PROGRAMMER'S GUIDEVDP2 library
Back | ■
VDP2 library

2.3 Function specifications


 List
 Title

Function specifications

 Function

Library initialization

 Function Name

SCL_Vdp2Init

 No

1

Form
void SCL_Vdp2Init (void)
input
none
output
none
Function value
none
function
Initialize the library. Must be run once first before using the library.

 List
 Title

Function specifications

 Function

Set screen mode

 Function Name

SCL_SetDisplayMode

 No

2

Form
void SCL_SetDisplayMode (Uint8 interlace, Uint8 vertical, Uint8 horizontal)
input
interlace: Interlace mode setting
value meaning
SCL_NON_INTER : Non-interlaced
SCL_SINGLE_INTER : Single-dense interlace
SCL_DOUBLE_INTER : Double-dense interlace

vertical: Vertical resolution bit
value meaning
SCL_224LINE : 224 lines
SCL_240LINE : 240 lines
SCL_256LINE : 256 lines

horizontal: Horizontal resolution bit
value meaning
SCL_NORMAL_A : 320 pixels: Normal graphic A
SCL_NORMAL_B : 352 pixels: Normal graphic B
SCL_HIRESO_A : 640 pixels: High resolution graphic A
SCL_HIRESO_B : 704 pixels: High resolution graphic B
SCL_NORMAL_AE : 320 pixels: Dedicated normal graphic A
SCL_NORMAL_BE : 352 pixels: Dedicated normal graphic B
SCL_HIRESO_AE : 640 pixels: Dedicated high resolution graphic A
SCL_HIRESO_BE : 704 pixels: Dedicated high resolution graphic B

output
none
Function value
none
function
Set the screen mode.
remarks
When changing the horizontal resolution from A to B, the SH2 clock switches from 76 to 78. (Example: SCL_NORMAL_A → SCL_NORMAL_B) At that time, please note that the settings of VDP1, VDP2, etc. will be reset.

 List
 Title

Function specifications

 Function

Initialize VRAM configuration table

 Function Name

SCL_InitVramConfigTb

 No

3

Form
void SCL_InitVramConfigTb (SclVramConfig * tp)
input
tp: VRAM configuration table
output
none
Function value
none
function
Writes the default value to the VRAM configuration data table.

 List
 Title

Function specifications

 Function

Initialization of scroll configuration data table

 Function Name

SCL_InitConfigTb

 No

Four

Form
void SCL_InitConfigTb (SclConfig * scfg)
input
scfg: Scroll configuration data
output
none
Function value
none
function
Initializes the scroll configuration data table.

 List
 Title

Function specifications

 Function

Set VRAM usage for VDP2

 Function Name

SCL_SetVramConfig

 No

Five

Form
void SCL_SetVramConfig (SclVramConfig * tp)
input
tp: VRAM configuration table
output
none
Function value
none
function
Sets how to use VRAM for VDP2.
example
Divide VRAM B and specify the character and pattern name data of RBG0 for each divided bank.

sample ()
{
          SclVramConfig tp;

          SCL_InitVramConfigTb (& tp);
          tp.vramModeB = ON / * VRAM B is divided and used * /
          tp.vramB0 = SCL_RBG0_CHAR; / * Put the character data of RBG0 * /
          tp.vramB1 = SCL_RBG0_PN; / * Place the pattern name data of RBG0 * /
          SCL_SetVramConfig (& tp);
}


 List
 Title

Function specifications

 Function

Set of scroll configurations

 Function Name

SCL_SetConfig

 No

6

Form
void SCL_SetConfig (Uint16 sclnum, SclConfig * scfg)
input
 sclnum
 : Scroll surface number
Select from 6 surfaces: SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3, SCL_RBG0, SCL_RBG1
 scfg
 : Scroll configuration data pointer
output
none
Function value
none
function
Set the scroll configuration.
remarks
Before setting the data of the surface of revolution, SCL_IntRotateTable () must be executed.

 List
 Title

Function specifications

 Function

Set of VRAM cycle pattern table

 Function Name

SCL_SetCycleTable

 No

7

Form
void SCL_SetCycleTable (Uint16 * tp)
input
tp: Cycle pattern table
output
none
Function value
none
function
Set the cycle pattern table.
remarks
If the cycle pattern table is not set correctly, the normal scroll screen will not be displayed. You need to understand VDP2 User's Manual Chapter 3 RAM " 3.3 How to access VRAM during the display period".

Example ・ 1
 image
 : NBG0 256 colors (1/2 reduced display available)
 VRAM A
 : Place NBG0 character pattern data
 VRAM B
 : Place NBG0 pattern name table
Uint16 cycle [] = {/ * Cycle pattern table * /
     0x4444,0xffff, / * VRAM A (A0) * /
     0xffff, 0xffff, / * VRAM A1 unused * /
     0x00ff, 0xffff, / * VRAM B (B0) * /
     0xffff, 0xffff, / * VRAM B1 unused * /
     }
     sample ()
     {
          SCL_SetCycleTable (& cycle);
     }

Example 2
 image
 : NBG0 16.77 million color bitmap data
 VRAM A
 : Place NBG0 bitmap data
 VRAM B
 : Place NBG0 bitmap data
Uint16 cycle [] = {/ * Cycle pattern table * /
        0x4444, 0x4444, / * VRAM A (A0) * /
        0xffff, 0xffff, / * VRAM A1 unused * /
        0x4444, 0x4444, / * VRAM B (B0) * /
        0xffff, 0xffff, / * VRAM B1 unused * /
}

sample ()
{
     SCL_SetCycleTable (& cycle);
}

Example ・ 3
 image
 : RBG0 256 color bitmap data
 NBG0 16-color bitmap data (with 1/4 reduction)
 NBG1 16-color bitmap data (with 1/2 reduction)
 NBG2 16-color character data / pattern name data
 NBG3 16-color character data / pattern name data
 VRAM A0
 : Place RBG0 bitmap data
 VRAM A1
 : Place rotation parameter coefficient table
 Place rotation parameter table
 VRAM B0
 : Place NBG0 bitmap data
 Place NBG1 bitmap data
 VRAM B1
 : Place NBG2 character data and pattern name data
 Place NBG3 character data and pattern name data ☆
Uint16 cycle [] = {/ * Cycle pattern table * /
        0xffff, 0xffff, / * VRAM A0 * /
        0xffff, 0xffff, / * VRAM A1 * /
        0x4444,0xff55, / * VRAM B0 * /
        0x23ff, 0x67ff, / * VRAM B1 * /
}

sample () { SclVramConfig tp; SCL_InitVramConfigTb (& tp); tp.vramModeA = ON / * VRAM A is divided and used * / tp.vramA0 = SCL_RBG0_CHAR; / * Place the bitmap data of RBG0 * / tp.vramA1 = SCL_RBG0_K; / * Place rotation parameter coefficient table * / SCL_SetVramConfig (& tp); SCL_SetCycleTable (& cycle); }


 List
 Title

Function specifications

 Function

Scroll open processing

 Function Name

SCL_Open

 No

8

Form
void SCL_Open (Uint32 sclnum)
input
sclnum:
Scroll surface number or rotation parameter table Select from 4 normal scroll surfaces (SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3) or rotation parameter tables A and B (SCL_RBG_TB_A, SCL_RBG_TB_B)
output
none
Function value
none
function
Enables the following functions for the selected scroll plane.

 List
 Title

Function specifications

 Function

Scroll close processing

 Function Name

SCL_Close

 No

9

Form
void SCL_Close (void)
input
none
output
none
Function value
none
function
Releases the function enabled state for the face selected by SclOpen ().

 List
 Title

Function specifications

 Function

Line & Vertical Cell Scroll Parameter Table Initialization

 Function Name

SCL_InitLineParamTb

 No

Ten

Form
void SCL_InitLineParamTb (SclLineParam * lp)
input
lp: Line & vertical scroll parameter data
output
none
Function value
none
function
Initializes the line & cell scroll parameter table.

 List
 Title

Function specifications

 Function

Set of line & vertical cell scroll parameters

 Function Name

SCL_SetLineParam

 No

11

Form
void SCL_SetLineParam (SclLineParam * lp)
input
lp: Line parameter table
output
none
Function value
none
function
none
remarks
It is executed between the execution of SclOpen () and the execution of SclClose (). Only NBG0 and NBG1 can be set.

 List
 Title

Function specifications

 Function

Scroll movement (movement amount: absolute)

 Function Name

SCL_MoveTo

 No

12

Form
void SCL_MoveTo (Fixed32 x, Fixed32 y, Fixed32 z)
input
Specify the coordinates to paste the scroll surface
x: X coordinate
y: Y coordinate
z: Z coordinate
output
none
Function value
none
function
Absolutely move the scroll plane.
remarks
It is executed between the execution of SclOpen () and the execution of SclClose (). You can specify the Z coordinate only for the rotation parameter table.

 List
 Title

Function specifications

 Function

Scroll movement (movement amount: relative)

 Function Name

SCL_Move

 No

13

Form
void SCL_Move (Fixed32 x, Fixed32 y, Fixed32 z)
input
x: Specify the movement distance in the X direction
y: Specify the movement distance in the Y direction
z: Specify the movement distance in the Z direction
output
none
Function value
none
function
Moves the scroll plane relative to each other.
remarks
It is executed between the execution of SclOpen () and the execution of SclClose (). You can specify the Z coordinate only for the rotation parameter table.

 List
 Title

Function specifications

 Function

Scroll enlargement / reduction

 Function Name

SCL_Scale

 No

14

Form
void SCL_Scale (Fixed32 sx, Fixed32 sy)
input
 sx
 : Specify size in X direction
 sy
 : Specify size in Y direction
 NBG0, NBG1
 : 1/4 to 256
 RBG0, RBG1
 :Any
output
none
Function value
none
function
Enlarging / reducing the scroll surface
remarks
It is executed between the execution of SclOpen () and the execution of SclClose (). It cannot be used with NBG2 and NBG3.

 List
 Title

Function specifications

 Function

Initialization of rotation parameter table

 Function Name

SCL_InitRotateTable

 No

15

Form
Uint32 SCL_InitRotateTable (Uint32 address, Uint16 num, Uint32 rotateA, Uint32 rotateB)
input

address: Specify the address where the rotation parameter table is placed.

num: Number of tables
 value
 meaning
 1
 Use only rotation parameter A
 2
 Use rotation parameters A and B

rotateA: Specify what to display using rotation parameter A.
 value
 meaning
 SCL_SPR
 Show only sprite framebuffer
 SCL_SPR
 Show only sprite framebuffer
 SCL_RBG0
 Show framebuffer for RBG0 and sprites
 SCL_NON
 Do not show

rotateB: Specify what to display using rotation parameter B.
 value
 meaning
 SCL_RBG0
 Show RBG0
 SCL_RBG1
 Show RBG1
 SCL_NON
 Do not show.

output
none
Function value
0: Normal
1: Allocation failure
2: There is a contradiction in the settings
function
Initializes the rotation parameter table and sets where to put the rotation parameter table in VRAM.
remarks
When displaying using both rotation parameters A and B, the combined rotation of screen count and XY axis rotation and Y axis rotation cannot be displayed correctly unless the display is specified by the window.

 List
 Title

Function specifications

 Function

Set the viewpoint of rotation

 Function Name

SCL_SetRotateViewPoint

 No

16

Form
void SCL_SetRotateViewPoint (Uint16 x, Uint16 y, Uint16 z)
input
x: X coordinate
y: Y coordinate
z: Z coordinate
output
none
Function value
none
function
Set the viewpoint of rotation.
remarks
It is executed between the execution of SclOpen () and the execution of SclClose (). It cannot be used with SCL_NBG0 to 3.

 List
 Title

Function specifications

 Function

Set the center coordinates of rotation

 Function Name

SCL_SetRotateCenter

 No

17

Form
void SCL_SetRotateCenter (Uint16 x, Uint16 y, Uint16 z)
input
x: X coordinate
y: Y coordinate
z: Z coordinate
output
none
Function value
none
function
Set the center coordinates of the surface of revolution
remarks
It is executed between the execution of SclOpen () and the execution of SclClose ().
It cannot be used with SCL_NBG0 to 3.

 List
 Title

Function specifications

 Function

Set the center coordinates of screen rotation

 Function Name

SCL_SetRotateCenterDisp

 No

18

Form
void SCL_SetRotateCenterDisp (Uint16 x, Uint16 y)
input
x: X coordinate
y: Y coordinate
output
none
Function value
none
function
Set the center point of screen rotation
remarks
Execute between the execution of SclOpen () and the execution of SclClose ().
Cannot be used with SCL_NBG0 ~ 3

 List
 Title

Function specifications

 Function

Scroll rotation (angle: absolute)

 Function Name

SCL_RotateTo

 No

19

Form
void SCL_RotateTo (Fixed32 angelXy, Fixed32 angleZ, Fixed32 angleD, Uint16 mode)
input
 angelXy
 : Set the X-axis or Y-axis angle
 angleZ
 : Set the Z-axis angle
 angleD
 : Set the screen rotation angle
 mode
 : Rotation mode. The first argument sets whether X or Y is enabled for the axis.
 SCL_X_AXIS: Scroll X-axis rotation
 SCL_Y_AXIS: Scroll Y-axis rotation (cannot be specified on RBG1 plane)
output
none
Function value
none
function
Rotation of scroll surface
remarks
It is executed between the execution of SclOpen () and the execution of SclClose (). It cannot be used with SCL_NBG0 to 3.
To perform XY axis rotation, you must use the SCL_SetVramConfig function to assign a coefficient table for rotation (VRAM A0, VRAM A1, VRAM B0, VRAM B1) somewhere in VRAM of VDP2.

 List
 Title

Function specifications

 Function

Scroll rotation (angle: relative)

 Function Name

SCL_Rotate

 No

20

Form
void SCL_Rotate (Fixed32 angelXy, Fixed32 angleZ, Fixed32 angleD)
input
 angelXy
 : Set the angle increase of X-axis or Y-axis
 angleZ
 : Set the Z-axis angle increase
 angleD
 : Set the screen rotation angle increase
output
none
Function value
none
function
Rotation Scroll surface rotation
remarks
It is executed between the execution of SclOpen () and the execution of SclClose (). It cannot be used with SCL_NBG0 to 3.

 List
 Title

Function specifications

 Function

Set scaling factor data in rotation parameter coefficient table

 Function Name

SCL_SetCoefficientData

 No

twenty one

Form
voidSCL_SetCoefficientData (Uint32 surface, Uint16 * datap, Uint16 x, Uint16 y)
input
 surface
 : Specify which rotation parameter table to set the data set to.
 (SCL_RBG_TB_A, SCL_RBG_TB_B)
 datap
 : Data table pointer
 x
 : Data size in the X direction
 y
 : Data size in Y direction
output
none
Function value
none
function
Set the enlargement / reduction coefficient data in the rotation parameter coefficient table.

 List
 Title

Function specifications

 Function

Mosaic processing settings

 Function Name

SCL_SetMosaic

 No

twenty two

Form
void SCL_SetMosaic (Uint32 surface, Uint8 x, Uint8 y)
input
 surface
 : Screen type SCL_NBG0 | SCL_NBG1 | SCL_NBG2 | SCL_NBG3 | SCL_RBG0 | SCL_RBG1
 x
 : Horizontal mosaic size (mosaic off at 0 to 15, 0)
 y
 : Vertical mosaic size (0 to 15) Cannot be set for the rotating surface (RBG0, RBG1).
output
none
Function value
none
function
Set the mosaic processing for each screen.
remarks
Vertical cell scrolling is disabled when using mosaic processing.

 List
 Title

Function specifications

 Function

Set of line color screen data

 Function Name

SCL_SetLncl

 No

twenty three

Form
void SCL_SetLncl (Uint32 address, Unit16 tbsize, Uint16 * palNumTb)
input
 address
 : Specifies where to put the line color table in VRAM.
 tbsize
 : Specify the size of the table.
 palNumTb
 : Specify the data for each line by the palette number.
 16 colors 0 to 15
 256 colors 0-255
 2048 colors 0 to 2047
output
none
Function value
none
function
Set the line color screen data.
remarks
Use SCL_AllocColRam () and SCL_SetColRam () to set the palette data to color RAM in advance, and then execute.

 List
 Title

Function specifications

 Function

Back screen data set

 Function Name

SCL_SetBack

 No

twenty four

Form
void SCL_SetBack (Uint32 address, Uint16 dataSize, Uint16 * dataTb)
input
 address
 : Specifies where to put the line color table in VRAM.
 dataSize
 : Specify the number of data tables.
 dataTb
 : Specify the data for each line in 5bit RGB.
output
none
Function value
none
function
Set the back screen data and address.
-Example-
Set the back screen address to the beginning of VRAM and make the color black.
void sample (void)
{
     Uint16 DataTB;

DataTB = 0x0000; / * black * / SCL_SetBack (SCL_VDP2_VRAM, 1, & DataTB); }


 List
 Title

Function specifications

 Function

Normal rectangular window settings

 Function Name

SCL_SetWindow

 No

twenty five

Form
void SCL_SetWindow (Uint8 win, Uint32 logic, Uint32 enable, Uint32 area, Uint16 startX, Uint16 startY, Uint16 endX, Uint16 endY)
input
 win
 : Specify the window type.
 SCL_W0 = Specify W0 window
 SCL_W1 = Specify W1 window
 logic
 : On the screen specified here, overlaying between multiple windows is processed by AND.
 The default is OR processing.
 enable enable
 : Specify the screen to display the window.
 area
 : Specifies the window to enable outside the window.
 The default is inside.
The logic, enable, and area variables can be specified at the same time by the OR operation.
 Specifying a constant
 logic
 enable enable
 area
 meaning
 SCL_NBG0
 NBG0 in the transparent processing window
 SCL_NBG1
 NBG1 in the transparent processing window
 SCL_NBG2
 NBG2 in the transparent processing window
 SCL_NBG3
 NBG3 in transparent processing window
 SCL_RBG0
 RBG0 of transparent processing window
 SCL_RBG1
 RBG1 of transparent processing window
 SCL_EXBG
 EXBG in transparent processing window
 SCL_SPR
 Transparency window sprite
 SCL_RP
 Rotation parameter window
 SCL_CC
 Color calculation window
 SCL_NON
 Unspecified
○: Can be specified
△: Cannot be specified in the sprite window

 startX
 : Start point X coordinate of rectangular data
 startY
 : Starting point Y coordinate of rectangular data
 endX
 : End point X coordinate of rectangular data
 endY
 : End point Y coordinate of rectangular data
output
none
Function value
none
function
Set a normal rectangular window.

 List
 Title

Function specifications

 Function

Normal line window settings

 Function Name

SCL_SetLineWindow

 No

26

Form
void SCL_SetLineWindow (Uint8 win, Uint32 logic, Uint32 enable, Uint32 area,
Uint32 address, Uint32 sy, Uint32 tbSize, SclLinWindowTb * tb)
input
 win
 : Specify the window type.
 SCL_W0 = Specify W0 window
 SCL_W1 = Specify W1 window
 logic
 : On the screen specified here, overlaying between multiple windows is processed by AND.
 The default is OR processing.
 enable enable
 : Specify the screen to display the window.
 area
 : Specifies the window to enable outside the window.
 The default is inside.
 address
 : Specifies where to place the line window table in VRAM.
 sy
 : The beginning of the Y coordinate
 tbSize
 : The size of the line window table
 tb
 : Line window table pointer
Multiple variables of logic, enable, and area can be specified at the same time by OR operation.
output
none
Function value
none
function
Set the normal line window.

 List
 Title

Function specifications

 Function

Sprite window settings

 Function Name

SCL_SetSpriteWindow

 No

27

Form
void SCL_SetSpriteWindow (Uint32 logic, Uint32 enable, Uint32 area)
input
 logic
 : On the screen specified here, overlaying between multiple windows is processed by AND.
 The default is OR processing.
 enable enable
 : Specify the screen to display the window.
 area
 : Specifies the window to enable outside the window.
 The default is inside.
Multiple variables of logic, enable, and area can be specified at the same time by OR operation.
output
none
Function value
none
function
Sets the sprite line window.
remarks
A window sprite must be prepared in advance on the VDP1 side.

 List
 Title

Function specifications

 Function

Set of sprite modes

 Function Name

SCL_SetSpriteMode

 No

28

Form
void SCL_SetSpriteMode (Uint8 type, Uint8 colMode, Uint8 winMode)
input
 type
 : Sprite type SCL_SPR_TYPE0, SCL_SPR_TYPE1 ... SCL_SPR_TYPEF
 colMode
 : Color mode SCL_PALETTE, SCL_MIX (SCL_MIX: mixed palette and RGB)
 winMode
 : Window mode SCL_MSB_SHADOW, SCL_SP_WINDOW
output
none
Function value
none
function
Set the sprite type.

 List
 Title

Function specifications

 Function

Color RAM mode set

 Function Name

SCL_SetColRamMode

 No

29

Form
void SCL_SetColRamMode (Uint32 mode)
input
mode: Color RAM mode SCL_CRM15_1024, SCL_CRM15_2048, SCL_CRM24_1024
output
none
Function value
none
function
Set the color RAM mode.

 List
 Title

Function specifications

 Function

Get color RAM mode

 Function Name

SCL_GetColRamMode

 No

30

Form
Uint32 SCL_GetColRamMode (void)
input
none
output
none
Function value
Color RAM mode SCL_CRM15_1024, SCL_CRM15_2048, SCL_CRM24_1024
function
Gets the color RAM mode.

 List
 Title

Function specifications

 Function

Set color data in color RAM

 Function Name

SCL_SetColRam

 No

31

Form
void SCL_SetColRam (Uint32 surface, Uint32 index, Uint32 num, void * color)
input
 surface
 : Screen type SCL_SPR, SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3, SCL_RBG0, SCL_RBG1, SCL_LNCL
 index
 : Write start palette number
 num
 : Color data table size
 color
 : Color data table (Unit 32 or Unit 16)
output
none
Function value
none
function
Set the color data in the color RAM.
remarks
If you are sharing color RAM, you only need to set one of the screens.

 List
 Title

Function specifications

 Function

Secure area in color RAM

 Function Name

SCL_AllocColRam

 No

32

Form
Uint32 = SCL_AllocColRam (Uint32 surface, Uint32 numOfColors, Uint8 transparent)
input
 surface
 : Screen type
 SCL_SPR | SCL_NBG0 | SCL_NBG1 | SCL_NBG2 | SCL_NBG3 | SCL_RBG0 | SCL_RBG1 | SCL_LNCL
 The same palette can be shared by multiple screens by OR operation.
 numOfColors
 :Number of colors
 transparent
 : Set whether to disable transparency.
 ON = Palette 0 is not transparent
 OFF = Palette 0 is transparent
output
none
Function value
The beginning of the reserved address
function
Allocate space in the color RAM.

 List
 Title

Function specifications

 Function

Release the area reserved for color RAM

 Function Name

SCL_FreeColRam

 No

33

Form
void SCL_FreeColRam (Uint32 surface)
input
surface: screen type
SCL_SPR | SCL_NBG0 | SCL_NBG1 | SCL_NBG2 | SCL_NBG3 | SCL_RBG0 | SCL_RBG1
Multiple screens can be released at the same time by OR operation.
output
none
Function value
none
function
Allocate space in the color RAM.

 List
 Title

Function specifications

 Function

Set automatic color change

 Function Name

SCL_SetAutoColChg

 No

34

Form
void SCL_SetAutoColChg (Uint32 surface, Uint32 interval, Uint32 index, Uint32 numOfCol, Uint32 numOfTbl, Uint32 changeTbl [])
input
 surface
 : Screen type
 SCL_SPR, SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3, SCL_RBG0, SCL_RBG1
 interval interval
 : Interval (specified in 1/60 second units)
 index
 : The beginning of the palette number to be changed
 numOfCol
 : Number of colors
 numOfTbl
 : Number of tables
 changeTbl []
 : Conversion table
output
none
Function value
none
function
Gradually changes a part of the palette toward the color specified for each palette. The maximum number of palettes is 256 colors. 2048 colors and 1024 colors are not supported.

 List
 Title

Function specifications

 Function

Get color RAM address offset

 Function Name

SCL_GetColRamOffset

 No

35

Form
Uint32 = SCL_GetColRamOffset (Uint32 surface)
input
surface: screen type
SCL_SPR, SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3, SCL_RBG0, SCL_RBG1
output
none
Function value
Offset address from VRAM of VDP2
function
Gets the color RAM address offset.

 List
 Title

Function specifications

 Function

Set priority

 Function Name

SCL_SetPriority

 No

36

Form
void SCL_SetPriorty (Uint32 surface, Uint8 priority)
input
surfaces: screen type
SCL_SP0 | SCL_SP1 ... SCL_SP7 | SCL_NBG0 | SCL_NBG1 |
SCL_NBG2 | SCL_NBG3 | SCL_RBG0 | SCL_RBG1 | SCL_EXBG
Multiple simultaneous specifications are possible by using the OR operation
priority: Priority number
output
none
Function value
none
function
Set the priority.

 List
 Title

Function specifications

 Function

Get priority

 Function Name

SCL_GetPriority

 No

37

Form
Uint8 Priority = SCL_GetPriority (Uint32 surface)
input
surface: screen type
SCL_SPR, SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3,
SCL_RBG0, SCL_RBG1, SCL_EXBG
priority: Priority number
output
none
Function value
none
function
Get priority.

 List
 Title

Function specifications

 Function

Set color calculation conditions (SPRITE)

 Function Name

SCL_SetColMixMode

 No

38

Form
void SCL_SetColMixMode (Uint32 colMixPriority, Uint8 mode)
input
 colMixPriority
 : Sprite priority number (0-7)
 mode
 :mode
 SCL_IF_FRONT, SCL_IF_EQUAL, SCL_IF_BEHIND
output
none
Function value
none
function
Set the color calculation conditions.

 List
 Title

Function specifications

 Function

Set the ratio of color calculation

 Function Name

SCL_SetColMixRate

 No

39

Form
void SCL_SetColMixRate (Uint32 surfaces, Uint8 rate)
input
surfaces: screen type
SCL_SP0 | SCL_SP1 ... SCL_SP7 | SCL_NBG0 | SCL_NBG1 |
SCL_NBG2 | SCL_NBG3 | SCL_RBG0 | SCL_RBG1 | SCL_EXBG
Multiple simultaneous specifications are possible by using the OR operation
rate: Rate (0 to 31)
output
none
Function value
none
function
Sets the percentage of color operations.

 List
 Title

Function specifications

 Function

Set automatic color calculation

 Function Name

SCL_SetAutoColMix

 No

40

Form
void SCL_SetAutoColMix (Uint32 surfaces, Uint32 interval, Uint32 time, Uint8 startRate, Uint8 endRate)
input
 surfaces
 : Screen type
 SCL_SP0 | SCL_SP1 ... SCL_SP7 | SCL_NBG0 | SCL_NBG1 |
 SCL_NBG2 | SCL_NBG3 | SCL_RBG0 | SCL_RBG1 | SCL_EXBG
 Multiple simultaneous specifications are possible by using the OR operation
 interval interval
 : Interval (specified in 1/60 second units)
 time
 : Specify the time it takes to finish the color change. (Specified in 1/60 second units)
 startRate
 : Percentage at start
 endRate
 : Percentage at the end
output
none
Function value
none
function
Changes the percentage of color operations at the specified time or interval.

 List
 Title

Function specifications

 Function

Set color offset

 Function Name

SCL_SetColOffset

 No

41

Form
void SCL_SetColOffset (Uint32 offsetreg, Uint32 surfaces, Sint16 red, Sint16 green, Sint16 blue)
input
 offsetreg
 : Specifies which color offset register to use.
 SCL_OFFSET_A, SCL_OFFSET_B
 surfaces
 : Screen type
 SCL_SP0 | SCL_SP1 ... SCL_SP7 | SCL_NBG0 | SCL_NBG1 |
 SCL_NBG2 | SCL_NBG3 | SCL_RBG0 | SCL_RBG1 | SCL_EXBG
 Multiple simultaneous specifications are possible by using the OR operation
 red
 : Color specification (red)
 green
 : Color specification (green)
 blue
 : Color specification (blue)
output
none
Function value
none
function
Set the color offset.

 List
 Title

Function specifications

 Function

Increase or decrease the color offset value

 Function Name

SCL_IncColOffset

 No

42

Form
void SCL_IncColOffset (Uint16 offsetReg, Sint16 red, Sint16 green, Sint16 blue)
input
 offsetReg
 : Specifies which color offset register to use.
 SCL_OFFSET_A, SCL_OFFSET_B
 red
 : Color specification (red) -255 ~ 255
 green
 : Color specification (green) -255 ~ 255
 blue
 : Color specification (blue) -255 ~ 255
output
none
Function value
none
function
Increases or decreases the color offset value.

 List
 Title

Function specifications

 Function

Set automatic color offset

 Function Name

SCL_SetAutoColOffset

 No

43

Form
voidSCL_SetAutoColOffset (Uint32 offsetReg, Uint32 interval, Uint32time, SclRgb * start, SclRgb * end)
input
 offsetReg
 : Specifies which color offset register to use.
 SCL_OFFSET_A, SCL_OFFSET_B
 interval interval
 : Interval (specified in 1/60 second units)
 time
 : Specify the time it takes to finish the color change. (Specified in 1/60 second units)
 start
 : Start color specification (red) -255 ~ 255
 Start color specification (green)-255 ~ 255
 Start color specification (blue) -255 to 255
 end
 : End color specification (red) -255 ~ 255
 End color specification (green) -255 to 255
 End color specification (blue) -255 to 255
output
none
Function value
none
function
Gradually changes the color offset data at the specified time or interval.

 List
 Title

Function specifications

 Function

Enable blur calculation

 Function Name

SCL_EnableBlur

 No

44

Form
void SCL_EnableBlur (Uint32 surface)
input
surface: Screen type SCL_SPR, SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3, SCL_RBG0, SCL_RBG1, SCL_EXBG
output
none
Function value
none
function
Enable blur calculation.

 List
 Title

Function specifications

 Function

Disable blurring

 Function Name

SCL_DisableBlur

 No

45

Form
voidSCL_DisableBlur (void)
input
none
output
none
Function value
none
function
Disable blurring

 List
 Title

Function specifications

 Function

Insert line color screen

 Function Name

SCL_EnableLineCol

 No

46

Form
void SCL_EnableLineCol (Uint32 surface);
input
 surface
 : Screen type
 SCL_SPR, SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3,
 SCL_RBG0, SCL_RBG1, SCL_EXBG
output
none
Function value
none
function
Insert a line color screen.

 List
 Title

Function specifications

 Function

Cancel the line color screen

 Function Name

SCL_DisableLineCol

 No

47

Form
voidSCL_DisableLineCol (Uint32 surface)
input
 surface
 : Screen type
 SCL_SPR, SCL_NBG0, SCL_NBG1, SCL_NBG2, SCL_NBG3,
 SCL_RBG0, SCL_RBG1, SCL_EXBG
output
none
Function value
none
function
Cancel the line color screen

 List
 Title

Function specifications

 Function

Shadow bit settings

 Function Name

SCL_SetShadowBit

 No

48

Form
void SCL_SetShadowBit (Uint32 enable);
input
 enable enable
 : Specify the screen to display the shadow.
 Multiple can be specified at the same time by OR operation.
 SCL_NBG0 | SCL_NBG1 | SCL_NBG2 | SCL_NBG3 |
 SCL_RBG0 | SCL_RBG1 | SCL_BACK | SCL_EXBG | SCL_NON
output
none
Function value
none
function
Set the shadow bit.
remarks
A shadow sprite must be prepared in advance on the VDP1 side.

 List
 Title

Function specifications

 Function

Set of number of frame change intervals

 Function Name

SCL_SetFrameInterval

 No

49

Form
voidSCL_SetFrameInterval (Uint16 count)
input
count: V blank interval count number
output
none
Function value
none
function
Set the number of frame change intervals.
It has the following meaning depending on the value of the number of intervals.
0 = Set the frame switching to auto change mode and set the number of intervals to 1.
Synchronization by SCL_DisplayFrame () is not possible.
1 = Set the frame switching to auto change mode and set the number of intervals to 1.
You can synchronize with SCL_DisplayFrame ().
0xffff = Indefinite interval manual change mode. Confirm the end of drawing of VDP1 and change the frame.
0xfffe = V Blank erase indefinite interval manual change mode. The frame is changed without confirming the end of drawing of VDP1.
Other = Fixed interval manual change mode with the specified number of intervals.
b15 = 0: Erase light is performed.
= 1: Do not erase light.

 List
 Title

Function specifications

 Function

Frame change request and waiting for completion

 Function Name

SCL_DisplayFrame

 No

50

Form
voidSCL_DisplayFrame (void)
input
none
output
none
Function value
none
function
Turn on the frame display request flag and wait for the V-BLANK interrupt routine to complete sprite and scroll frame display.

 List
 Title

Function specifications

 Function

V-BLANK start VDP interrupt processing

 Function Name

SCL_VblankStart

 No

51

Form
void SCL_VblankStart (void)
input
none
output
none
Function value
none
function
VDP1, 2 Start processing of V-BLANK for display (scroll parameter set, etc.).

 List
 Title

Function specifications

 Function

V-BLANK end VDP interrupt processing

 Function Name

SCL_VblankEnd

 No

52

Form
void SCL_VblankEnd (void)
input
none
output
none
Function value
none
function
VDP1 and 2 Display V-BLANK termination processing (sprite frame change, etc.).

 List
 Title

Function specifications

 Function

Forced termination of automatic VE

 Function Name

SCL_AbortAutoVe

 No

53

Form
void SCL_AbortAutoVe (void)
input
none
output
none
Function value
none
function
Forced termination of automatic VE

Back | ■
PROGRAMMER'S GUIDEVDP2 library
Copyright SEGA ENTERPRISES, LTD., 1997