#include "sgl.h"
void slTVOn ();
void --Do not give anything.
void --Nothing is returned.
Starts outputting to the monitor.
The output to the monitor that was stopped by slTVOff is resumed.
slTVOff ();
::
slTVOn ();
When this function is executed, it is immediately set in the VDP2 register.
slTVOff | VDP2_TVMD |
#include "sgl.h"
void slTVOff ();
void --Do not give anything.
void --Nothing is returned.
Stops output to the monitor.
Nothing is displayed on the monitor.
Stops output to the monitor.
slTVOff ();
When this function is executed, it is immediately set in the VDP2 register.
There have been some reports of problems using this function before running slInitSystem. This function can only be executed after running slInitSystem.
slTVOn | VDP2_TVMD |
#include "sgl.h"
Uint16 slGetHCount (void);
void --Do not give anything.
Uint16 --VDP2 H counter value
Read the VDP2 H counter.
h_cnt = slGetHCount ();
slGetVCount | VDP2_EXTEN | VDP2_HCNT |
#include "sgl.h"
Uint16 slGetVCount (void);
void --Do not give anything.
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 --Nothing is returned.
Operates the external signal enable register.
The signal names are the following four.
EXLTEN : Specify when the timing to latch the value of the HV counter is adjusted to the external signal.
EXSYEN : Specify when displaying the TV screen according to the external sync signal.
DASEL: Specify when the image display area is used to fill the standard area.
EXBGEN : Specify when inputting external screen data.
slExtSignal ( EXLTEN | DASEL , DASEL );
This function is used for business use such as ST-V and for karaoke machines (Prologue).
It is never used in SATURN.
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 the bitmap data.
void --Nothing is returned.
Set the NBG0 / 1 screen to bitmap mode and set the size of the bitmap.
For type, specify the following parameters.
COL_TYPE_16 , COL_TYPE_256 , COL_TYPE_2048 , COL_TYPE_32768
COL_TYPE_1M
For size, specify the following parameters.
BM_512x256 , BM_512x512 , BM_1024x256 , BM_1024x512
In addr_A, set the V-RAM address to set the bitmap data.
This should be an address with a 0x20000 boundary.
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 for displaying bitmap screens.
void --Nothing is returned.
Set the palette number for displaying the bitmap screen.
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 --A flag parameter that specifies whether the sprite window is enabled or disabled.
void --Nothing is returned.
Specifies whether to enable or disable the sprite window.
flag has
ON : Sprite window enabled OFF : Sprite window disabled.
Display the NBG2 screen only inside the sprite window.
/ * Set the sprite color mode to palette-only mode. * /
slSpriteColMode ( SPR_PAL );
/ * Declared the use of sprite windows. * /
slSpriteWinMode ( ON );
/ * Display NBG2 inside the sprite window. * /
slScrWindowModeNbg2 ( spw_IN );
When using the sprite window, it cannot be used when the color mode of the sprite is RGB palette mixed mode, so use slSpriteWinMode to set it to palette mode.
#include "sgl.h"
Uint16 cond;
void slSpriteCCalcCond (cond);
Uint16 cond --Sprite color arithmetic condition.
void --Nothing is returned.
Specify the sprite color calculation condition.
Specify the following parameters for cond.
CC_pr_CN : Performs color calculation when the priority is the same as or smaller than the color calculation condition number. (Priority <= ConditionNumber)
CC_PR_CN : Performs color calculation when the priority is the same as the color calculation condition number. (Priority == ConditionNumber)
CC_PR_cn : Performs color calculation when the priority is the same as or greater than the color calculation condition number. (Priority> = Condition Number)
CC_MSB : Performs color calculation when the most significant bit of color data is 1.
Specify a sprite with sprite type 5 and set its priority number to 6.
Next, only sprites that match the color calculation number and the priority number,
Specifies to perform color calculation with NBG0.
SPR_ATTR attr = SPR_ATTRIBUTE [macro] (0, 0x100 | (6 << 12) | (1 << 11),
/ * ^^^^^^^ ^^^^^^^ * /
/ * Priority number 6 color arithmetic ratio bits * /
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 --Nothing is returned.
Specify the sprite color calculation condition number.
Specify num in the range 0-7.
slSpriteCCalcCond ( CC_PR_cn );
slSpriteCCalcNum (2);
#include "sgl.h"
Uint16 mode;
void slSpriteColMode (mode);
Uint16 mode --Sprite color mode
void --Nothing is returned.
Specifies the color mode of the sprite.
SPR_PAL , SPR_PAL_RGB for mode
Specify one of.
SPR_PAL : Specify when the sprite data is in palette data format only.
SPR_PAL_RGB: Specify when the sprite data is a mixture of palette format and RGB format.
Set the sprite 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 --Nothing is returned.
Specifies the type of sprite data.
type is specified from 0 to 15.
0 to 7 are for low resolution (320 or 352) and 8 to 15 are for high resolution (640 or 704).
Set the sprite type to 2.
slSpriteType (2);
The default value for SGL sprite types is type 3. (When you set it to high resolution,
It will be type B. )
slDispSprite | slSetSprite | slPutSprite | slDispSpriteHV |
slDispSpriteSZ | slDispSprite4P | slSpriteWinMode | VDP2_SPCTL |
#include "sgl.h"
Uint16 mode;
void slScrMosaicOn (mode);
Uint16 mode --Scroll surface to be mosaicked
void --Nothing is returned.
Specify the scroll surface to be mosaicked.
In mode,
NBG0ON , NBG1ON , NBG2ON , NBG3ON , RBG0ON , LNCLON , SPRON
Is entered.
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 --Nothing is returned.
Specify the size for mosaic processing.
The size that can be specified is 1 to 16 dots in both the horizontal and vertical directions.
slScrMosSize (4, 6);
When double-dense interlace is used, it is forced to be single-dense interlace, and the actual display size is in units of 2 dots in the V direction.
(v_size is doubled internally.)
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 --Coordinates of the right corner Uint16 top --Coordinates of the top Uint16 right --Coordinates of the left corner Uint16 bottom --Coordinates of the bottom
void --Nothing is returned.
Set the area of rectangular window 0/1 for scrolling.
If a line window is specified, the line window will be disabled.
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 --Nothing is returned.
Specifies the address of the line window data table 0/1.
When using a line window, set the most significant bit to 1.
Specify NULL if not used.
-When using the line window Address = 0x25E3F00
slScrLineWindow0 ((void *) (0x25E3F000 | 0x80000000));
-If the address is a pointer variable Sint16 * lnptr;
lnptr = ( Sint16 *) 0x25e3f000;
slScrLineWindow1 ((void *) (lnptr + 0x40000000));
(Double the value to add Sint16 )> Because)
-When the line window is no longer used slScrLineWindow0 ((void *) NULL );
Even if you set the line window, the data in the rectangular window remains valid (hardware specification), so both areas are within window 0.
If you want to invalidate the data of the rectangular window, you can use the top and bottom of the window and
Set the data so that there is a contradiction in the positional relationship between the left and right.
example)
slScrWindow0 (10, 0, 0, 10); / * The left-right positional relationship is strange * /
| | | | __ Bottom
| | | _____ Right
| | _______ Top
| _________ Left
slScrWindow0 (10,10,0,0); / * The positional relationship between the top and bottom and left and right is strange * /
#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 --Nothing is returned.
Sets the usage mode of the window on each scroll plane.
In mode,
scnNBG0 , scnNBG1 , scnNBG2 , scnNBG3 , scnRBG0 , scnSPR ,
scnROT , scnCCAL
One of
For type, select from the following elements and specify.
[ win_OR | win_AND ] Conditions for multiple windows [ win0_IN | win0_OUT ]
[ win1_IN | win1_OUT ] ... _IN shows the inside of the window [ spw_IN | spw_OUT ] ... _OUT shows the outside of the window
NBG0 is only inside window 0,
NBG1 is 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 --A face to set the priority (described later).
void --Nothing is returned.
Set the priority number for each screen.
The following parameters are entered in mode.
scnNBG0 , scnNBG1 , scnNBG2 , scnNBG3 , scnRBG0 , scnSPR0 , scnSPR1
scnSPR2 , scnSPR3 , scnSPR4 , scnSPR5 , scnSPR6 , scnSPR7
num specifies a value between 0 and 7 (but not displayed if 0 is specified).
slPriority ( scnSPR5 , 6);
slPriorityRbg0 (5);
slSpriteType |
#include "sgl.h"
Uint16 mode;
void slShadowOn (mode);
Uint16 mode --The side that activates the shadow function (described later).
void --Nothing is returned.
Specifies which scroll surface the shadow function works for.
In mode,
NBG0ON , NBG1ON , NBG2ON , NBG3ON , RBG0ON , BACKON
Give either.
slShadowOn ( NBG2ON );
It is valid for both normal shadows and MSB shadows.
slSpriteType | slTpShadowMode | VDP2_SDCTL | VDP2_PRISA |
#include "sgl.h"
Uint16 flag;
void slTpShadowMode (flag);
Uint16 flag-A flag that indicates whether to enable transparent shadow sprites.
void --Nothing is returned.
Specifies whether to enable transparent shadow sprites.
flag has
' ON ' or'OFF '
Is specified.
Apply a transparent shadow.
slTpShadowMode ( ON );
The MSB of the sprite data is to apply a transparent shadow ON must have been to.
slSpriteType | slShadowOn | VDP2_SDCTL |
#include "sgl.h"
Uint16 mode;
Uint16 type;
slLineScrollMode (mode, type);
slLineScrollModeNbg0 (type);
slLineScrollModeNbg1 (type);
Uint16 mode --The surface to set the line scroll mode (described later).
Uint16 type --Line scroll mode
void --Nothing is returned.
Sets the line scroll mode for the scroll surface.
In mode,
scnNBG0 , scnNBG1
One of the types is
lineSZ1 | lineSZ2 | lineSZ4 | lineSZ8 : Line width lineZoom : Horizontal scaling lineVScroll : Vertical scroll lineHScroll : Horizontal scroll VCellScroll : Vertical cell scroll Specify the mode you want to use by connecting with'|'.
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 is set
void --Nothing is returned.
Specifies a table of line scrolling data.
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 --Nothing is returned.
Specifies a table of vertical cell scroll data.
If you want to use vertical cell scrolling, you need to set the VRAM access cycle.
Set by the functions slScrCycleSet , slScrDisp.
Scroll NBG0 vertically.
slScrCycleSet (0xc0feeeee, 0x44feeeee, 0xfeeeeeee, 0xfeeeeeee);
slScrDisp ( NBG0ON );
void slVCellTable ((void *) 0x25e10000);
Vertical cell scrolling is not available in high resolution mode.
Also, it is not allowed to use the same bank as the data (coefficient, CG, etc.) used for rotary scrolling.
slLineScrollMode | slLineScrollModeNbg0 | slLineScrollModeNbg1 | slLineScrollTable0 |
slLineScrollTable0 | VDP2_VCSTA |