Japanese
PROGRAMMER'S GUIDEVDP1 library
BackForward
VDP1 library

4.3 Function specifications


4.2 Function list

 function
 Function name
 number
 Initialization processing of VDP1 basic processing library
 SPR_Initial
 1
 TV mode set
 SPR_SetTvMode
 2
 Get current sprite control information
 SPR_GetStatus
 3
 Frame buffer erase area, erase data set
 SPR_SetEraseData
 4
 Frame buffer drawing completion check
 SPR_WaitDrawEnd
 5
 Set sprite drawing source 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


 one
View
table
 Title

function specification

 Function

Initialization processing of VDP1 basic processing library

 Function name

SSPR_Initial

 No

1

Format
void SPR_Initial(Uint8 **vram)
input
vram: Pointer to VRAM address return area
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

 one
View
table
 Title

function specification

 Function

TV mode set

 Function name

SPR_SetTvMode

 No

2

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

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

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

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

output
none
function value
none
function
Set TV mode.

 one
View
table
 Title

function specification

 Function

Get current sprite control information

 Function name

SPR_GetStatus

 No

3

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

 one
View
table
 Title

function specification

 Function

frame buffer erase area,
erase data set

 Function name

SPR_SetEraseData

 No

4

Format
void SPR_SetEraseData(Uint16 eraseData, Uint16 leftX, Uint16 topY, Uint16 rightX, Uint16 botY)
input
eraseData: RGB erase data leftX: X coordinate of the left edge of the erase area topY: Y coordinate of the top edge of the erase area rightX: X coordinate of the right edge of the erase area botY: Y coordinate of the bottom edge of the erase area
output
none
function value
none
function
Specify what color and what range to fill when performing the erase process.

 one
View
table
 Title

function specification

 Function

Frame buffer drawing completion check

 Function name

SPR_WaitDrawEnd

 No

5

Format
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-BLANKVDP interrupt handling routine.

 one
View
table
 Title

function specification

 Function

Select picture coordinates from which to draw sprites
set of modes

 Function name

SPR_SetEosMode

 No

6

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

 one
View
table
 Title

function specification

 Function

System register write macro

 Function name

SPR_WRITE_REG

 No

7

Format
SPR_WRITE_REG(Uint16 reg, Uint16 val)
input
reg: Select and set the type of system register 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 write data SPR_W_EWLR = Erase write upper left coordinate SPR_W_EWRR = Erase write lower right coordinate SPR_W_ENDR = Forced termination of drawing
val: Write value
output
none
function value
none
function
Write to the VDP1 write-only system register.

 one
View
table
 Title

function specification

 Function

System register read macro

 Function name

SPR_READ_REG

 No

8

Format
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 interruption 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 VDP1 read-only system register.

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