★ VRAM



ListReference

function

slVRAMMode


Setting how to divide VRAM

Form

    #include "sgl.h"

    Uint16 type;

    void slVRAMMode (type);

argument

    Uint16 type --How to split VRAM (see below).

Number of returns

    void --Nothing is returned.

function

    Set the VRAM division method.
type is Div_A , Div_B Specify only those that divide.
Specify NULL if you want to stop splitting.

Example

    Of the VRAM of VDP2, only VRAM B is split (A is not split).
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

Form

    #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-Circuit pattern for bank b1.

Number of returns

    void --Nothing is returned.

function

    Set the cycle pattern for each bank. If each bank is divided, you can set the cycle pattern to a0, a1, b0, b1. When the banks are not split, you can set cycle patterns for a0 and b0.

Example

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

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

caution


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

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 setting has been completed

Form

    #include "sgl.h"

    Uint32 mode;

    Bool slScrAutoDisp (mode);

argument

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

Number of returns

    Bool --Error status (see below)

function

    Register the system of the scroll surface for which the function settings have been completed.
The function automatically sets the access specification (cycle pattern register) to VRAM of the scroll screen specified as a parameter, and at the same time, turns on the drawing setting of the registered scroll.
In mode, NBG0ON , NBG1ON , NBG2ON , NBG3ON , RBG0ON Is entered. If the setting cannot create a cycle pattern, NG is returned.
If you want to set the drawing settings for multiple scroll planes at the same time, set the mode of each plane to "|". Please specify by connecting with.
The error status is NG if the cycle pattern cannot be set. Returns OK if the configuration completes successfully.

Example

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

caution


    This function does not support all patterns of VDP2 VRAM access. Also, since this function takes some time to process, it is strongly recommended to set it with a combination of slScrCycleSet and slScrDisp in the end.
The result of this function will be reflected when the following functions are executed in advance.
slCharNbg0 slCharNbg1 slCharNbg2 slCharNbg3 slCharRbg0 slPageNbg0 slPageNbg1 slPageNbg2 slPageNbg3 slPageRbg0 slMapNbg0 slMapNbg1 slMapNbg2 slMapNbg3 sl1MapRA sl1MapRB However, even the settings of these functions do not support the following cases.
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, when 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 


★ Drawing enable



ListReference

function

slScrDisp


Scroll surface drawing settings

Form

    #include "sgl.h"

    Uint32 mode;

    void slScrDisp (mode);

argument

    Uint32 mode --The surface to draw (multiple can be specified with'|') (described later).

Number of returns

    void --Nothing is returned.

function

    Sets the drawing of 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 of each plane by connecting them with "|".
The settings of the scroll plane that are not specified do not change.

Example

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

caution


    If only the BG is enabled with this function, and if other BG faces have already been enabled, the setting will continue.
If you want to output only a specific BG surface, you need to explicitly disable the other surface.
(Even if the cycle pattern is not set, if the display of the BG surface is specified, that BG Will be displayed. )

reference

 slScrAutoDisp
 slScrCycleSet
 VDP2_BGON 


★ Color RAM



ListReference

function

slColRAMMode


Determine color RAM mode

Form

    #include "sgl.h"

    Uint16 mode;

    void slColRAMMode (mode);

argument

    Uint16 mode --Color RAM mode name (see below).

Number of returns

    void --Nothing is returned.

function

    Determines the color RAM mode.
Be sure to determine the color RAM mode before storing color data in the color RAM.
Substitute the following values corresponding to the color RAM mode for mode.
CRM16_1024 : Color RAM mode 0 (16-bit color 1024 colors x 2 banks) CRM16_2048 : Color RAM mode 1 (16-bit color 2048 colors) CRM32_1024 : Color RAM mode 2 (24-bit color 1024 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 the color RAM

Form

    #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-Start address of color RAM. 

Number of returns

    void --Nothing is returned.

function

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

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