Japanese

★VRAM



ListReference

function

slVRAMMode


Setting the VRAM division method

Format

    #include "sgl.h"

    Uint16 type;

    void slVRAMMode( type );

argument

    Uint16 type - VRAM division method (described later).

Return number

    void - returns nothing.

function

Set the VRAM division method.
For type, Div_A , Div_B Specify only what to divide.
If you want to stop splitting, specify NULL .

example

    Of the VRAM of VDP2, only divide VRAM B (do not divide A).
slVRAMMode ( Div_B );

reference

 slScrAutoDisp
 slScrCycleSet
 slScrDisp
 slCharNbg0
 slCharNbg1
 slCharNbg2
 slCharNbg3
 slPageNbg0
 slPageNbg1
 slPageNbg2
 slPageNbg3
 slPageRbg0
 slMapNbg0
 slMapNbg1
 slMapNbg2
 slMapNbg3
 sl1MapRA
 sl1MapRB
 sl16MapRA
 sl16MapRB
 VDP2_RAMCTL 


★VRAM access



ListReference

function

slScrCycleSet


Set cycle pattern

Format

    #include "sgl.h"

    Uint32 a0;
    Uint32 a1;
    Uint32 b0;
    Uint32 b1;

    void slScrCycleSet( a0, a1, b0, b1 );

argument

    Uint32 a0 - Cycle pattern for bank a0.
Uint32 a1 - Cycle pattern for bank a1.
Uint32 b0 - Cycle pattern for bank b0.
Uint32 b1 - Cycle pattern for bank b1.

Return number

    void - returns nothing.

function

Set the cycle pattern for each bank. If each bank is divided, a cycle pattern can be set for a0,a1,b0,b1. When the bank is not divided, a cycle pattern can be set for a0,b0.

example

    Uint32 a0 = 0xfffffeee;
    Uint32 a1 = 0x4455feee;
    Uint32 b0 = 0x01feeeee;
    Uint32 b1 = 0xfffeeeee;

    slScrCycleSet ( a0, a1, b0, b1 );
    slScrDisp ( NBG0ON | NBG1ON | NBG2OFF | NBG3OFF ); 

Note

If you use this function to set the cycle pattern without using slScrAutoDisp , you must specify the surface to be drawn using slScrDisp .
When this function is executed, each setting value is immediately set to the VDP2 register.

reference

 slScrAutoDisp
 slScrDisp
 VDP2_CYCA0L
 VDP2_CYCA0U
 VDP2_CYCA1L
 VDP2_CYCA1U
 VDP2_CYCB0L
 VDP2_CYCB0U
 VDP2_CYCB1L
 VDP2_CYCB1U 



ListReference

function

slScrAutoDisp


System registration of the scroll surface for which function settings have been completed

Format

    #include "sgl.h"

    Uint32 mode;

    Bool slScrAutoDisp( mode );

argument

    Uint32 mode - The side for which you want to set the function (multiple specifications can be specified using '|') (described later).

Return number

    Bool - error status (described below)

function

Perform system registration of the scroll screen for which function settings have been completed.
The function automatically sets the VRAM access specification (cycle pattern register) for the scroll screen specified as a parameter, and at the same time turns on the registered scroll drawing settings.
In mode, NBG0ON , NBG1ON , NBG2ON , NBG3ON , RBG0ON is entered. If the settings are such that a cycle pattern cannot be created, NG is returned.
When setting the drawing settings for multiple scroll planes at the same time, set the mode for each plane to "|" Please specify by connecting.
The error status is NG if the cycle pattern could not be set. Returns OK if the settings were completed successfully.

example

    Use NBG1 in addition to the debug string display (NBG0) screen.
slCharNbg1 ( ... ); slPageNbg1 ( ... ); slPlaneNbg1 ( ... ); slMapNbg1 ( ... ); slScrAutoDisp ( NBG0ON | NBG1ON );

Note

This function does not support all VDP2 VRAM access patterns. Also, since this function requires a certain amount of time to process, it is strongly recommended that the final setting is a combination of slScrCycleSet and slScrDisp .
This function will reflect the result if the following function is executed in advance.
slCharNbg0 slCharNbg1 slCharNbg2 slCharNbg3 slCharRbg0 slPageNbg0 slPageNbg1 slPageNbg2 slPageNbg3 slPageRbg0 slMapNbg0 slMapNbg1 slMapNbg2 slMapNbg3 sl1MapRA sl1MapRB However, even with these function settings, the following cases are not supported.
In that case, you need to set it manually using slScrDisp and slScrCycleSet .
- When reduction settings are made for NBG0 and NBG1.
- When character data or map data spans multiple VRAM areas.
For example, character data occupies VRAM A0 and A1.

reference

 slScrCycleSet
 slScrDisp
 slCharNbg0
 slCharNbg1
 slCharNbg2
 slCharNbg3
 slCharRbg0
 slPageNbg0
 slPageNbg1
 slPageNbg2
 slPageNbg3
 slPageRbg0
 slPlaneNbg0
 slPlaneNbg1
 slPlaneNbg2
 slPlaneNbg3
 slPlaneRA
 slPlaneRB
 slMapNbg0
 slMapNbg1
 slMapNbg2
 slMapNbg3
 sl1MapRA
 sl1MapRB
 sl16MapRA
 sl16MapRB
 Resolution
 VDP2_CYCA0L
 VDP2_CYCA0U
 VDP2_CYCA1L
 VDP2_CYCA1U
 VDP2_CYCB0L
 VDP2_CYCB0U
 VDP2_CYCB1L
 VDP2_CYCB1U
 VDP2_BGON
 VDP2_CHCTLA
 VDP2_CHCTLB
 VDP2_ZMCTL
 VDP2_SCRCTL
 VDP2_VCSTA
 nbg0_char_adr
 nbg1_char_adr
 nbg2_char_adr
 nbg3_char_adr
 nbg0_page_adr
 nbg1_page_adr
 nbg2_page_adr 


★Draw enable



ListReference

function

slScrDisp


Scroll surface drawing settings

Format

    #include "sgl.h"

    Uint32 mode;

    void slScrDisp( mode );

argument

    Uint32 mode - Surface to draw (multiple specifications can be specified using '|') (described later).

Return number

    void - returns nothing.

function

Configures the drawing settings for the scroll surface specified as a parameter.
mode contains the following predefined macros.
NBG0ON | NBG0OFF NBG1ON | NBG1OFF NBG2ON | NBG2OFF NBG3ON | NBG3OFF RBG0ON | RBG0OFF If you want to set the drawing settings for multiple scroll planes at the same time, specify the mode for each plane by connecting them with "|".
Settings for scroll surfaces that are not specified will not change.

example

    Displays NBG0~2 and does not display NBG3.
slScrDisp ( NBG0ON | NBG1ON | NBG2ON | NBG3OFF );

Note

If only BG enable is specified using this function, and other BG planes have already been enabled, those settings will continue.
If you want to output only a specific BG surface, you must explicitly disable the other surfaces.
(Even if you do not set a cycle pattern, if you specify the display of the BG surface, the BG will be displayed. )

reference

 slScrAutoDisp
 slScrCycleSet
 VDP2_BGON 


★Color RAM



ListReference

function

slColRAMMode


Determine color RAM mode

Format

    #include "sgl.h"

    Uint16 mode;

    void slColRAMMode( mode );

argument

    Uint16 mode - Color RAM mode name (described later).

Return number

    void - returns nothing.

function

Determines color RAM mode.
Be sure to determine the color RAM mode before storing color data in the color RAM.
Assign the following value corresponding to the color RAM mode to mode.
CRM16_1024 : Color RAM mode 0 (16-bit color 1024 colors x 2 banks) CRM16_2048 : Color RAM mode 1 (2048 16-bit colors) CRM32_1024 : Color RAM mode 2 (1024 24-bit colors)

example

    Set the color RAM mode to 16-bit color 2048 colors.
slColRAMMode ( CRM16_2048 );

reference

 slGradationOn
 VDP2_RAMCTL 



ListReference

function

slColRAMOffsetNbg0



ListReference

function

slColRAMOffsetNbg1



ListReference

function

slColRAMOffsetNbg2



ListReference

function

slColRAMOffsetNbg3



ListReference

function

slColRAMOffsetRbg0



ListReference

function

slColRAMOffsetSpr


Set the start address of color RAM

Format

    #include "sgl.h"

    Uint16 offset;

    void slColRAMOffsetNbg0( offset );
    void slColRAMOffsetNbg1( offset );
    void slColRAMOffsetNbg2( offset );
    void slColRAMOffsetNbg3( offset );
    void slColRAMOffsetRbg0( offset );
    void slColRAMOffsetSpr( offset );

argument

    Uint16 offset - starting address of color RAM. 

Return number

    void - returns nothing.

function

Offset the start address of the color RAM used for each screen using a 256 color boundary ^^^^^^^^^^^^^^^^^^^^^^^ Over you.
Offset is 0 to 7 (3 if color RAM mode is 0 or 2) ).

example

    Use NBG1 with color RAM address 25F00200H as offset 0.
slColRAMOffsetNbg1 ( 1 );

reference

 slPageNbg0
 slPageNbg1
 slPageNbg2
 slPageNbg3
 slPageRbg0
 VDP2_CRAOFA
 VDP2_CRAOFB

return
Copyright SEGA ENTERPRISES, LTD., 1997