Japanese
PROGRAMMER'S GUIDEVDP2 library
Back | ■
VDP2 library

2.3 Function specifications


 one
View
table
 Title

function specification

 Function

Library initialization

 Function name

SCL_Vdp2Init

 No

1

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

 one
View
table
 Title

function specification

 Function

Set screen mode

 Function name

SCL_SetDisplayMode

 No

2

Format
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 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) Please note that the settings of VDP1, VDP2, etc. will be reset at that time.

 one
View
table
 Title

function specification

 Function

Initializing the VRAM configuration table

 Function name

SCL_InitVramConfigTb

 No

3

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

 one
View
table
 Title

function specification

 Function

scroll configuration data
Initialize the table

 Function name

SCL_InitConfigTb

 No

4

Format
void SCL_InitConfigTb(SclConfig *scfg)
input
scfg: scroll configuration data
output
none
function value
none
function
Initialize the scroll configuration data table.

 one
View
table
 Title

function specification

 Function

Configure VDP2 VRAM usage

 Function name

SCL_SetVramConfig

 No

5

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

sample()
{
          SclVramConfig tp;

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


 one
View
table
 Title

function specification

 Function

Set of scroll configurations

 Function name

SCL_SetConfig

 No

6

Format
void SCL_SetConfig(Uint16 sclnum, SclConfig *scfg)
input
 sclnum
 :Scroll surface number
Select from 6 sides: 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
If you want to set rotation surface data, you must execute SCL_IntRotateTable() in advance.

 one
View
table
 Title

function specification

 Function

Set VRAM cycle pattern table

 Function name

SCL_SetCycleTable

 No

7

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

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

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

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 bitmap data of NBG0
 Place NBG1 bitmap data
 VRAM B1
 :Arrange 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 /* Divide and use VRAM A */ tp.vramA0 = SCL_RBG0_CHAR; /* Place RBG0 bitmap data */ tp.vramA1 = SCL_RBG0_K; /* Place rotation parameter coefficient table */ SCL_SetVramConfig(&tp); SCL_SetCycleTable(&cycle); }


 one
View
table
 Title

function specification

 Function

Scroll open processing

 Function name

SCL_Open

 No

8

Format
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, B (SCL_RBG_TB_A, SCL_RBG_TB_B)
output
none
function value
none
function
Enables the following functions for the selected scroll surface.

 one
View
table
 Title

function specification

 Function

Scroll close processing

 Function name

SCL_Close

 No

9

Format
void SCL_Close(void)
input
none
output
none
function value
none
function
Cancels the ability to use functions on the surface selected with SclOpen().

 one
View
table
 Title

function specification

 Function

Line & vertical cell scrolling parameters
Initialize the table

 Function name

SCL_InitLineParamTb

 No

10

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

 one
View
table
 Title

function specification

 Function

Line & vertical cell scroll parameters
set

 Function name

SCL_SetLineParam

 No

11

Format
void SCL_SetLineParam(SclLineParam *lp)
input
lp: line parameter table
output
none
function value
none
function
none
remarks
Executes between SclOpen() and SclClose(). Only NBG0 and NBG1 can be set.

 one
View
table
 Title

function specification

 Function

Scroll movement (movement amount: absolute)

 Function name

SCL_MoveTo

 No

12

Format
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 moves the scroll surface.
remarks
Executes between SclOpen() and SclClose(). You can specify the Z coordinate only for rotation parameter tables.

 one
View
table
 Title

function specification

 Function

Scroll movement (movement amount: relative)

 Function name

SCL_Move

 No

13

Format
void SCL_Move(Fixed32 x, Fixed32 y, Fixed32 z)
input
x: Specify the moving distance in the X direction
y: Specify the moving distance in the Y direction
z: Specify the movement distance in the Z direction
output
none
function value
none
function
Moves the scroll plane relatively.
remarks
Executes between SclOpen() and SclClose(). You can specify the Z coordinate only for rotation parameter tables.

 one
View
table
 Title

function specification

 Function

Scroll enlargement/reduction

 Function name

SCL_Scale

 No

14

Format
void SCL_Scale(Fixed32 sx, Fixed32 sy)
input
 sx
 : Size specification in the X direction
 sy
 : Specify the size in the Y direction
 NBG0,NBG1
 :1/4~256
 RBG0,RBG1
 :Any
output
none
function value
none
function
Enlarging/reducing the scroll surface
remarks
Executes between SclOpen() and SclClose(). Cannot be used with NBG2 and NBG3.

 one
View
table
 Title

function specification

 Function

Initializing the rotation parameter table

 Function name

SCL_InitRotateTable

 No

15

Format
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
 Only rotation parameter A is used
 2
 Use rotation parameters A and B

rotateA: Specify what to display using rotation parameter A.
 value
 meaning
 SCL_SPR
 Display only sprite framebuffer
 SCL_SPR
 Display only sprite framebuffer
 SCL_RBG0
 Show RBG0 and sprite framebuffer
 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 conflict in the settings
function
Initialize the rotation parameter table and set where to place the rotation parameter table on VRAM.
remarks
When displaying using both rotation parameters A and B, the composite rotation of the screen count and XY axis rotation and Y axis rotation cannot be displayed correctly unless the display is specified using the window.

 one
View
table
 Title

function specification

 Function

Set rotation perspective

 Function name

SCL_SetRotateViewPoint

 No

16

Format
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 rotation perspective.
remarks
Executes between SclOpen() and SclClose(). Cannot be used with SCL_NBG0~3.

 one
View
table
 Title

function specification

 Function

Set rotation center coordinates

 Function name

SCL_SetRotateCenter

 No

17

Format
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 rotation plane
remarks
Executes between SclOpen() and SclClose().
Cannot be used with SCL_NBG0~3.

 one
View
table
 Title

function specification

 Function

Set center coordinates of screen rotation

 Function name

SCL_SetRotateCenterDisp

 No

18

Format
void SCL_SetRotateCenterDisp(Uint16 x, Uint16 y)
input
x: X coordinate
y: Y coordinate
output
none
function value
none
function
Set center point for screen rotation
remarks
Execute between SclOpen() and SclClose().
Not available for SCL_NBG0~3

 one
View
table
 Title

function specification

 Function

Scroll rotation (angle: absolute)

 Function name

SCL_RotateTo

 No

19

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

 one
View
table
 Title

function specification

 Function

Scroll rotation (angle: relative)

 Function name

SCL_Rotate

 No

20

Format
void SCL_Rotate(Fixed32 angelXy, Fixed32 angleZ, Fixed32 angleD)
input
 angelXy
 : Set the angular increment of the X-axis or Y-axis
 angleZ
 : Set the angle increment of the Z axis
 angleD
 : Set the angle increment for screen rotation.
output
none
function value
none
function
Rotating the rotating scroll surface
remarks
Executes between SclOpen() and SclClose(). Cannot be used with SCL_NBG0~3.

 one
View
table
 Title

function specification

 Function

Scale to rotation parameter coefficient table
Set coefficient data

 Function name

SCL_SetCoefficientData

 No

21

Format
voidSCL_SetCoefficientData(Uint32 surface,Uint16 *datap,Uint16 x,Uint16 y)
input
 surface
 : Specify which rotational parameter table to set the data for.
 (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 scaling coefficient data in the rotation parameter coefficient table.

 one
View
table
 Title

function specification

 Function

Mosaic settings

 Function name

SCL_SetMosaic

 No

22

Format
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 (0 to 15, 0 turns off mosaic)
 y
 : Vertical mosaic size (0 to 15) cannot be set to rotation plane (RBG0, RBG1).
output
none
function value
none
function
Set mosaic processing for each screen.
remarks
If you use mosaic processing, vertical cell scrolling will not be available.

 one
View
table
 Title

function specification

 Function

Set of line color screen data

 Function name

SCL_SetLncl

 No

23

Format
void SCL_SetLncl(Uint32 address,Unit16 tbsize, Uint16 *palNumTb)
input
 address
 : Specify where to place the line color table on VRAM.
 tbsize
 : Specify the size of the table.
 palNumTb
 : Specify the data for each line by pallet number.
 16 colors 0~15
 256 colors 0-255
 2048 colors 0 to 2047
output
none
function value
none
function
Set the line color screen data.
remarks
Please set the palette data in color RAM in advance using SCL_AllocColRam() and SCL_SetColRam() before executing.

 one
View
table
 Title

function specification

 Function

Set back screen data

 Function name

SCL_SetBack

 No

24

Format
void SCL_SetBack(Uint32 address, Uint16 dataSize, Uint16 *dataTb)
input
 address
 : Specify where to place the line color table on VRAM.
 dataSize
 : Specify the number of data tables.
 dataTb
 : Specify the data for each line in 5bitRGB.
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 set the color to black.
void sample(void)
{
     Uint16 DataTB;

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


 one
View
table
 Title

function specification

 Function

Normal rectangular window settings

 Function name

SCL_SetWindow

 No

25

Format
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, overlapping of multiple windows will be processed using AND.
 The default is OR processing.
 enable
 : Specify the screen where the window will be displayed.
 area
 : Specifies the window to enable outside the window.
 By default, inside is enabled.
Each variable of logic, enable, and area can be specified simultaneously by OR operation.
 Specifying constants
 logic
 enable
 area
 meaning
 SCL_NBG0
 NBG0 of the transparent processing window
 SCL_NBG1
 NBG1 of transparent processing window
 SCL_NBG2
 NBG2 of transparent processing window
 SCL_NBG3
 NBG3 of transparent processing window
 SCL_RBG0
 RBG0 of transparency processing window
 SCL_RBG1
 RBG1 of transparency processing window
 SCL_EXBG
 EXBG of transparent processing window
 SCL_SPR
 Sprite in transparency window
 SCL_RP
 Rotation parameters window
 SCL_CC
 Color calculation window
 SCL_NON
 unspecified
○: Can be specified
△: Cannot be specified in the sprite window

 startX
 : Starting point X coordinate of rectangular data
 startY
 : Y coordinate of starting point of rectangular data
 endX
 : End point X coordinate of rectangle data
 endY
 : End point Y coordinate of rectangular data
output
none
function value
none
function
Sets a normal rectangular window.

 one
View
table
 Title

function specification

 Function

Normal line window settings

 Function name

SCL_SetLineWindow

 No

26

Format
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, the overlapping of multiple windows will be processed using AND.
 The default is OR processing.
 enable
 : Specify the screen where the window will be displayed.
 area
 : Specifies the window to enable outside the window.
 By default, inside is enabled.
 address
 : Specify where to place the line window table on VRAM.
 sy
 :Start of Y coordinate
 tbSize
 : Size of line window table
 tb
 : Line window table pointer
Multiple variables of logic, enable, and area can be specified at the same time using OR operation.
output
none
function value
none
function
Set the normal line window.

 one
View
table
 Title

function specification

 Function

Sprite window settings

 Function name

SCL_SetSpriteWindow

 No

27

Format
void SCL_SetSpriteWindow(Uint32 logic,Uint32 enable, Uint32 area)
input
 logic
 : On the screen specified here, the overlapping of multiple windows will be processed using AND.
 The default is OR processing.
 enable
 : Specify the screen where the window will be displayed.
 area
 : Specifies the window to enable outside the window.
 By default, inside is enabled.
Multiple variables of logic, enable, and area can be specified at the same time using OR operation.
output
none
function value
none
function
Set the sprite line window.
remarks
A window sprite must be prepared in advance on the VDP1 side.

 one
View
table
 Title

function specification

 Function

Set of sprite modes

 Function name

SCL_SetSpriteMode

 No

28

Format
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: mix of palette and RGB)
 winMode
 :Window mode SCL_MSB_SHADOW,SCL_SP_WINDOW
output
none
function value
none
function
Set the sprite type.

 one
View
table
 Title

function specification

 Function

Color RAM mode set

 Function name

SCL_SetColRamMode

 No

29

Format
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 color RAM mode.

 one
View
table
 Title

function specification

 Function

Get color RAM mode

 Function name

SCL_GetColRamMode

 No

30

Format
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.

 one
View
table
 Title

function specification

 Function

Set color data to color RAM

 Function name

SCL_SetColRam

 No

31

Format
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
 : Writing start pallet number
 num
 :Size of color data table
 color
 :Color data table (Unit32 or Unit 16)
output
none
function value
none
function
Set color data to color RAM.
remarks
If the color RAM is shared, you only need to configure one screen.

 one
View
table
 Title

function specification

 Function

Reserve space in color RAM

 Function name

SCL_AllocColRam

 No

32

Format
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 on multiple screens using OR operation.
 numOfColors
 :Number of colors
 transparent
 : Set whether to disable transparent display.
 ON = Palette #0 is not transparent
 OFF = Palette #0 is transparent
output
none
function value
Start of reserved address
function
Reserve space in color RAM.

 one
View
table
 Title

function specification

 Function

Release the area reserved in color RAM

 Function name

SCL_FreeColRam

 No

33

Format
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
Reserve space in color RAM.

 one
View
table
 Title

function specification

 Function

Set automatic color change

 Function name

SCL_SetAutoColChg

 No

34

Format
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 (specified in 1/60 seconds)
 index
 : Start of palette number to change
 numOfCol
 : Number of colors
 numOfTbl
 : Number of tables
 changeTbl[]
 : Conversion table
output
none
function value
none
function
Gradually changes parts of the palette toward the specified color for each palette. The maximum number of palettes is 256 colors. 2048 colors and 1024 colors are not supported.

 one
View
table
 Title

function specification

 Function

Get color RAM address offset

 Function name

SCL_GetColRamOffset

 No

35

Format
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.

 one
View
table
 Title

function specification

 Function

set priority

 Function name

SCL_SetPriority

 No

36

Format
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 specifications can be specified simultaneously by using the OR operation.
priority: Priority number
output
none
function value
none
function
Set priority.

 one
View
table
 Title

function specification

 Function

get priority

 Function name

SCL_GetPriority

 No

37

Format
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.

 one
View
table
 Title

function specification

 Function

Set color calculation conditions (SPRITE)

 Function name

SCL_SetColMixMode

 No

38

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

 one
View
table
 Title

function specification

 Function

Set color calculation ratio

 Function name

SCL_SetColMixRate

 No

39

Format
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 specifications can be specified simultaneously by using the OR operation.
rate: rate (0 to 31)
output
none
function value
none
function
Set the color calculation ratio.

 one
View
table
 Title

function specification

 Function

Set automatic color calculation

 Function name

SCL_SetAutoColMix

 No

40

Format
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 specifications can be specified simultaneously by using the OR operation.
 interval
 :Interval (specified in 1/60 seconds)
 time
 : Specify the time it takes to complete the color change. (specified in 1/60 seconds)
 startRate
 : Starting percentage
 endRate
 : Percentage at end
output
none
function value
none
function
Changes the color calculation rate at a specified time or interval.

 one
View
table
 Title

function specification

 Function

set color offset

 Function name

SCL_SetColOffset

 No

41

Format
void SCL_SetColOffset(Uint32 offsetreg, Uint32 surfaces, Sint16 red, Sint16 green, Sint16 blue)
input
 offsetreg
 : Specify 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 specifications can be specified simultaneously by using the OR operation.
 red
 : Color specification (red)
 green
 : Color specification (green)
 blue
 : Color specification (blue)
output
none
function value
none
function
Set color offset.

 one
View
table
 Title

function specification

 Function

Increase/decrease color offset value

 Function name

SCL_IncColOffset

 No

42

Format
void SCL_IncColOffset(Uint16 offsetReg, Sint16 red, Sint16 green, Sint16 blue)
input
 offsetReg
 : Specify which color offset register to use.
 SCL_OFFSET_A,SCL_OFFSET_B
 red
 : Color specification (red) -255 to 255
 green
 : Color specification (green) -255 to 255
 blue
 : Color specification (blue) -255 to 255
output
none
function value
none
function
Increase or decrease the color offset value.

 one
View
table
 Title

function specification

 Function

Set automatic color offset

 Function name

SCL_SetAutoColOffset

 No

43

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

 one
View
table
 Title

function specification

 Function

Enable blur calculation

 Function name

SCL_EnableBlur

 No

44

Format
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 blurring operation.

 one
View
table
 Title

function specification

 Function

Disable blur calculation

 Function name

SCL_DisableBlur

 No

45

Format
voidSCL_DisableBlur(void)
input
none
output
none
function value
none
function
Disable blur calculation

 one
View
table
 Title

function specification

 Function

Insert line color screen

 Function name

SCL_EnableLineCol

 No

46

Format
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.

 one
View
table
 Title

function specification

 Function

Cancel line color screen

 Function name

SCL_DisableLineCol

 No

47

Format
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 line color screen

 one
View
table
 Title

function specification

 Function

Shadow bit settings

 Function name

SCL_SetShadowBit

 No

48

Format
void SCL_SetShadowBit(Uint32 enable);
input
 enable
 : Specify the screen where the shadow will be displayed.
 Multiple items can be specified at the same time using the 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
You must prepare a shadow sprite in advance on the VDP1 side.

 one
View
table
 Title

function specification

 Function

number of frame change intervals
set

 Function name

SCL_SetFrameInterval

 No

49

Format
voidSCL_SetFrameInterval(Uint16 count)
input
count: V blank interval count number
output
none
function value
none
function
Set the frame change interval number.
The value of the interval number has the following meanings.
0 = Set frame switching to auto change mode and set interval number to 1.
Synchronization using SCL_DisplayFrame() is not possible.
1 = Set frame switching to auto change mode and set interval number to 1.
You can synchronize using SCL_DisplayFrame().
0xffff = Indeterminate interval manual change mode. Confirm that VDP1 has finished drawing and change the frame.
0xfffe = Indeterminate interval manual change mode with V blank erase. Performs a frame change without checking that VDP1 has finished drawing.
Other = constant interval manual change mode with specified interval number.
b15 = 0: Perform erase write.
= 1: Erase write is not performed.

 one
View
table
 Title

function specification

 Function

Frame change request and wait for completion

 Function name

SCL_DisplayFrame

 No

50

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

 one
View
table
 Title

function specification

 Function

V-BLANK start VDP interrupt processing

 Function name

SCL_VblankStart

 No

51

Format
void SCL_VblankStart(void)
input
none
output
none
function value
none
function
Performs V-BLANK start processing for VDP1 and 2 display (setting scroll parameters, etc.).

 one
View
table
 Title

function specification

 Function

V-BLANK end VDP interrupt processing

 Function name

SCL_VblankEnd

 No

52

Format
void SCL_VblankEnd(void)
input
none
output
none
function value
none
function
Performs V-BLANK termination processing for VDP1 and 2 display (sprite frame change, etc.).

 one
View
table
 Title

function specification

 Function

Forced termination of automatic VE

 Function name

SCL_AbortAutoVe

 No

53

Format
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