#include "sgl.h" void slTVOn();
void - gives nothing.
void - returns nothing.
Resumes output to the monitor that was stopped with slTVOff .
slTVOff (); : slTVOn ();
slTVOff | VDP2_TVMD |
#include "sgl.h" void slTVOff();
void - gives nothing.
void - returns nothing.
Stops output to the monitor.
slTVOff ();
slTVOn | VDP2_TVMD |
#include "sgl.h" Uint16 slGetHCount( void );
void - gives nothing.
Uint16 - VDP2 H counter value
Read the H counter of VDP2.
h_cnt = slGetHCount ();
slGetVCount | VDP2_EXTEN | VDP2_HCNT |
#include "sgl.h" Uint16 slGetVCount( void );
void - gives nothing.
Uint16 - V counter value of VDP2
Read the V counter of VDP2.
v_cnt = slGetVCount ();
slGetHCount | VDP2_EXTEN | VDP2_VCNT |
#include "sgl.h" Uint16 signal; Uint16 mask; void slExtSignal( signal, mask );
Uint16 signal - the name of the signal you want to set.
Uint16 mask - the name of the signal you want to manipulate.
void - returns nothing.
slExtSignal ( EXLTEN | DASEL , DASEL );
VDP2_EXTEN |
#include "sgl.h" Uint16 type; Uint16 size; void *addr_A; void slBitMapNbg0( type, size, addr_A ); void slBitMapNbg1( type, size, addr_A ); void slBitMapRbg0( type, size, addr_A );
Uint16 type - color mode.
Uint16 size - Bitmap size.
void *addr_A - V-RAM address to set bitmap data.
void - returns nothing.
slBitMapNbg0 ( COL_TYPE_256 , BM_1024x256 , ( void * )( 0x25e40000 ) );
slBMPaletteNbg0 | slBMPaletteNbg1 | slBMPaletteRbg0 | VDP2_CHCTLA |
VDP2_CHCTLB | VDP2_MPOFN | VDP2_MPOFR | nbg0_page_adr |
nbg1_page_adr | ra_page_adr |
#include "sgl.h" Uint16 num; void slBMPaletteNbg0( num ); void slBMPaletteNbg1( num ); void slBMPaletteRbg0( num );
Uint16 num - Palette number when displaying a bitmap screen.
void - returns nothing.
Uses a palette starting with 0x25f00200 in 16Bit color mode.
slBMPaletteNbg1 ( 1 );
slBitMapNbg0 | slBitMapNbg1 | slBitMapRbg0 | VDP2_BMPNA |
#include "sgl.h" Uint16 flag; void slSpriteWinMode( flag );
Uint16 flag - Flag parameter that specifies whether the sprite window is enabled or disabled.
void - returns nothing.
Display the NBG2 screen only inside the sprite window.
/* Set the sprite's color mode to palette-only mode. */ slSpriteColMode ( SPR_PAL ); /* Declare the use of sprite window. */ slSpriteWinMode ( ON ); /* Display NBG2 inside the sprite window. */ slScrWindowModeNbg2 ( spw_IN );
#include "sgl.h" Uint16 cond; void slSpriteCCalcCond( cond );
Uint16 cond - Sprite color calculation condition.
void - returns nothing.
Specify a sprite as sprite type 5 and set its priority number to 6.
Next, only the sprites that match the color calculation number and priority number, Specifies to perform color calculations with NBG0. SPR_ATTR attr = SPR_ATTRIBUTE[macro]( 0, 0x100 | ( 6 << 12 ) | ( 1 << 11 ), /* ^^^^^^^ ^^^^^^^*/ /* Priority number 6 Color calculation ratio bit */ No_Gouraud, CL256Bnk, sprNoflip | _ZmCC ); : /* Set any sprite parameters. */ slSpriteType ( 5 ); slPrioritySpr4 ( 6 ); slSpriteCCalcCond ( CC_PR_CN ); slSpriteCCalcNum ( 6 ); /* Set and Color calculation parameter. */ slColorCalc ( CC_RATE | CC_2ND | NBG0ON | SPRON ); slColRateNbg0 ( CLRate20_12 ); : /* Display sprite. */ slPutSprite ( &attr, pos, DEGtoANG ( 90.0 ) );
#include "sgl.h" Uint16 num; void slSpriteCCalcNum( num );
Uint16 num - Sprite color calculation condition number.
void - returns nothing.
slSpriteCCalcCond ( CC_PR_cn ); slSpriteCCalcNum ( 2 );
#include "sgl.h" Uint16 mode; void slSpriteColMode( mode );
Uint16 mode - sprite color mode
void - returns nothing.
Set the sprite's color mode to palette mode.
slSpriteColMode ( SPR_PAL )
slInitSystem | slSetSprTVMode | slSpriteWinMode | VDP2_SPCTL |
#include "sgl.h" Uint16 type; void slSpriteType( type );
Uint16 type - sprite data type
void - returns nothing.
Set sprite type to 2.
slSpriteType ( 2 );
slDispSprite | slSetSprite | slPutSprite | slDispSpriteHV |
slDispSpriteSZ | slDispSprite4P | slSpriteWinMode | VDP2_SPCTL |
#include "sgl.h" Uint16 mode; void slScrMosaicOn( mode );
Uint16 mode - Scroll surface to be mosaiced
void - returns nothing.
slScrMosaicOn ( NBG2ON | NBG3ON );
slScrMosSize | VDP2_MZCTL |
#include "sgl.h" Uint16 h_size, v_size; void slScrMosSize( h_size, v_size );
Uint16 h_size - Horizontal size. Uint16 v_size - Vertical size.
void - returns nothing.
slScrMosSize ( 4, 6 );
slScrMosaicOn | Resolution | VDP2_MZCTL |
#include "sgl.h" Uint16 left, top, right, bottom; void slScrWindow0( left, top, right, bottom ); void slScrWindow1( left, top, right, bottom );
Uint16 left - Coordinate of the right corner Uint16 top - Coordinate of the top edge Uint16 right - Coordinate of the left corner Uint16 bottom - Coordinate of the bottom edge
void - returns nothing.
slScrWindow1 ( 50, 50, 180, 150 );
#include "sgl.h" void *addr_A; void slScrLineWindow0( addr_A ); void slScrLineWindow1( addr_A );
void *addr_A - address of line window data table
void - returns nothing.
・When using line window Address = 0x25E3F00 slScrLineWindow0 ( ( void * )( 0x25E3F000 | 0x80000000) ); ・If the address is held as a pointer variable, Sint16 *lnptr; lnptr = ( Sint16 * )0x25e3f000 ; slScrLineWindow1 ( ( void * )( lnptr + 0x40000000 ) ); (The value to be added is doubledSint16 )> ・When the line window is no longer used slScrLineWindow0 ( ( void * ) NULL );
slScrWindow0 ( 10, 0, 0, 10 ); /* The left and right positional relationship is incorrect */ | | | |__ Bottom | | |_____ Right | |_______ Top |_________ Left slScrWindow0 (10,10,0,0); /* The vertical and horizontal positional relationships are incorrect */
#include "sgl.h" Uint16 mode; Uint16 type; void slScrWindowMode( mode, type ); void slScrWindowModeNbg0( type ); void slScrWindowModeNbg1( type ); void slScrWindowModeNbg2( type ); void slScrWindowModeNbg3( type ); void slScrWindowModeRbg0( type ); void slScrWindowModeSPR( type ); void slScrWindowModeROT( type ); void slScrWindowModeCCAL( type );
Uint16 mode - Scroll surface to use (described later) Uint16 type - condition/mode.
void - returns nothing.
NBG0 is only inside window 0, NBG1 only outside window 1, NBG2 is inside window 0 and window 1, If NBG3 is only inside the overlapping part of window 0 and window 1 slScrWindowModeNbg0 ( win0_IN ); slScrWindowModeNbg1 ( win1_OUT ); slScrWindowModeNbg2 ( win_OR | win0_IN | win1_IN ); slScrWindowModeNbg3 ( win_AND | win0_IN | win1_IN );
slSpriteWinMode | slScrWindow0 | slScrWindow1 | slScrLineWindow0 |
slScrLineWindow1 | VDP2_WCTLA |
#include "sgl.h" Uint16 mode; Uint16 num; void slPriority( mode, num ); void slPriorityNbg0( num ); void slPriorityNbg1( num ); void slPriorityNbg2( num ); void slPriorityNbg3( num ); void slPriorityRbg0( num ); void slPrioritySpr0( num ); void slPrioritySpr1( num ); void slPrioritySpr2( num ); void slPrioritySpr3( num ); void slPrioritySpr4( num ); void slPrioritySpr5( num ); void slPrioritySpr6( num ); void slPrioritySpr7( num );
Uint16 num - Priority number.
Uint16 mode - The plane to set the priority (described later).
void - returns nothing.
slPriority ( scnSPR5 , 6 ); slPriorityRbg0 ( 5 );
slSpriteType |
#include "sgl.h" Uint16 mode; void slShadowOn( mode );
Uint16 mode - The side that uses the shadow function (described later).
void - returns nothing.
slShadowOn ( NBG2ON );
slSpriteType | slTpShadowMode | VDP2_SDCTL | VDP2_PRISA |
#include "sgl.h" Uint16 flag; void slTpShadowMode( flag );
Uint16 flag - Flag indicating whether to enable sprites with transparent shadows.
void - returns nothing.
Apply a transparent shadow.
slTpShadowMode ( ON );
slSpriteType | slShadowOn | VDP2_SDCTL |
#include "sgl.h" Uint16 mode; Uint16 type; slLineScrollMode( mode, type ); slLineScrollModeNbg0( type ); slLineScrollModeNbg1( type );
Uint16 mode - Surface to set line scroll mode (described later).
Uint16 type - line scroll mode
void - returns nothing.
slLineScrollMode ( scnNBG1 , lineSZ2 | lineVScroll | VCellScroll ); slLineScrollModeNbg1 ( lineSZ8 | lineZoom );
slScrCycleSet | slScrDisp | slLineScrollTable0 | slLineScrollTable0 |
slVCellTable | VDP2_SCRCTL |
#include "sgl.h" void *addr_A; void slLineScrollTable0( addr_A ); void slLineScrollTable1( addr_A );
void *addr_A - VRAM address where line scroll data was set
void - returns nothing.
void slLineScrollTable0 ( ( void * )0x25e20000 );
slLineScrollMode | slLineScrollModeNbg0 | slLineScrollModeNbg1 | slVCellTable |
VDP2_VCSTA | VDP2_LSTA0 | VDP2_LSTA1 |
#include "sgl.h" void *addr_A; void slVCellTable( addr_A );
void addr_A - VRAM address where vertical cell scroll data is set
void - returns nothing.
Scroll NBG0 vertically.
slScrCycleSet ( 0xc0feeeee, 0x44feeeee, 0xfeeeeeee, 0xfeeeeeee ); slScrDisp ( NBG0ON ); void slVCellTable ( ( void * )0x25e10000 );
slLineScrollMode | slLineScrollModeNbg0 | slLineScrollModeNbg1 | slLineScrollTable0 |
slLineScrollTable0 | VDP2_VCSTA |