PROGRAMMER'S GUIDEVDP1 library
BackForward
VDP1 library

4.3 Function specifications


4.2 Function list

 function
 Seki several people
 number
 VDP1 basic processing library initialization processing
 SPR_Initial
 1
 TV mode set
 SPR_SetTvMode
 2
 Acquisition of current sprite control information
 SPR_GetStatus
 3
 Framebuffer erase area, erase dataset
 SPR_SetEraseData
 Four
 Frame buffer drawing end check
 SPR_WaitDrawEnd
 Five
 Set of sprite drawing original picture coordinate selection mode
 SPR_SetEosMode
 6
 System register write macro
 SPR_WRITE_REG
 7
 System register read macro
 SPR_READ_REG
 8


4.3 Function specifications


 List
 Title

Function specifications

 Function

VDP1 basic processing library initialization processing

 Function Name

SSPR_Initial

 No

1

Form
void SPR_Initial (Uint8 ** vram)
input
vram: VRAM address return area pointer
output
none
Function value
none
function
Set the following values as default values.
  • Erase data = 0x8000 (black)
  • Erase area = (0, 0)-(319, 223)
  • TV mode is normal, resolution is 320 x 224

 List
 Title

Function specifications

 Function

TV mode set

 Function Name

SPR_SetTvMode

 No

2

Form
void Spr_SetTvMode (Uint16 mode, Uint16 screenSize, Unit16 doubleInterlace)
input

mode: mode:
The following TV mode definition values can be set.
SPR_TV_NORMAL = Normal mode SPR_TV_HIREZO = High resolution mode SPR_TV_ROT16 = Rotation 16 mode SPR_TV_ROT8 = Rotation 8 mode SPR_TV_HDTV = HDTV mode

screenSize: screenSize:
Select and set the screen resolution corresponding to TV mode from the following definition values.
See the VDP1 hardware manual for detailed combinations.
SPR_TV_320X224 = 320 x 224
SPR_TV_320X240 = 320 x 240
SPR_TV_352X224 = 352 x 224
SPR_TV_352X240 = 352 x 240
SPR_TV_640X224 = 640 x 224
SPR_TV_640X240 = 640 x 240
SPR_TV_704X224 = 704 x 224
SPR_TV_704X240 = 704 x 240

doubleInterlace:
Sets the double-dense interlace usage mode.
ON = Use double-dense interlaced mode OFF = Do not use double-dense interlaced mode

output
none
Function value
none
function
Set the TV mode.

 List
 Title

Function specifications

 Function

Acquisition of current sprite control information

 Function Name

SPR_GetStatus

 No

3

Form
void SPR_GetStatus (SprSpStatus * spStatus)
input
none
output
SprSpStatus: Pointer to status return area
Function value
none
function
Get sprite control information

 List
 Title

Function specifications

 Function

Framebuffer erase area,
Erase dataset

 Function Name

SPR_SetEraseData

 No

Four

Form
void SPR_SetEraseData (Uint16 eraseData, Uint16 leftX, Uint16 topY, Uint16 rightX, Uint16 botY)
input
eraseData: RGB erase data leftX: Left end X coordinate of erase area topY: Top Y coordinate of erase area rightX: Right end X coordinate of erase area botY: Bottom Y coordinate of erase area
output
none
Function value
none
function
Specifies what color and what area to fill when the erase process is performed.

 List
 Title

Function specifications

 Function

Frame buffer drawing end check

 Function Name

SPR_WaitDrawEnd

 No

Five

Form
void SPR_WaitDrawEnd (void)
input
none
output
none
Function value
none
function
Wait for VDP1 to finish drawing to the framebuffer. This routine is called from the V-BLANK VDP interrupt processing routine.

 List
 Title

Function specifications

 Function

Set of sprite drawing original picture coordinate selection mode

 Function Name

SPR_SetEosMode

 No

6

Form
void SPR_SetEosMode (Sint32 eosFlag)
input
eosFlag:
0 = Sampling even coordinates (default)
1 = Sampling odd coordinates
output
none
Function value
none
function
Set the sampling coordinate mode of the original picture texture when high-speed priority drawing is specified in the drawing mode word of the sprite command.

 List
 Title

Function specifications

 Function

System register write macro

 Function Name

SPR_WRITE_REG

 No

7

Form
SPR_WRITE_REG (Uint16 reg, Uint16 val)
input
reg: Select and set the system register type from the following definition values.
SPR_W_TVMR = TV mode selection SPR_W_FBCR = Frame buffer switching mode SPR_W_PTMR = Plot trigger SPR_W_EWDR = Erase light data SPR_W_EWLR = Erase light upper left coordinates SPR_W_EWRR = Erase light lower right coordinates SPR_W_ENDR = Forced drawing end
val: Light value
output
none
Function value
none
function
Write to the VDP1 write-only system register.

 List
 Title

Function specifications

 Function

System register read macro

 Function Name

SPR_READ_REG

 No

8

Form
Uint16 val = SPR_READ_REG (Uint16 reg)
input
reg: Set the system register type from the following definition values.
SPR_R_EDSR = Transfer end status SPR_R_LOPR = Processing interrupted table address SPR_R_COPR = Current processing table address SPR_R_MODR = Mode status
output
none
Function value
val: read value
function
Reads the register value from the read-only system register of VDP1.

BackForward
PROGRAMMER'S GUIDEVDP1 library
Copyright SEGA ENTERPRISES, LTD., 1997