#include "sgl.h"
Uint16 mode;
TEXTURE *form_tbl;
Sint8 cnt;
void slInitSystem( mode, form_tbl , cnt );
Uint16 mode - Screen mode.
TEXTURE *form_tbl - Texture definition table.
Sint8 cnt - count of frame switches.
void - returns nothing.
TV_320x224 , TV_320x240 , TV_320x256
TV_352x224 , TV_352x240 , TV_352x256
TV_640x224 , TV_640x240 , TV_640x256
TV_704x224 , TV_704x240 , TV_704x256
TV_320x448 , TV_320x480 , TV_320x512
TV_352x448 , TV_352x480 , TV_352x512
TV_640x448 , TV_640x480 , TV_640x512
TV_704x448 , TV_704x480 , TV_704x512
is entered. Left : 0
Top : 0
Right : ScreenXSize - 1
Bottom : ScreenYSize - 1
Zlimit : 0x7fff
CenterX : ScreenXSize / 2
CenterY : ScreenYSize / 2
PersAngle : 90゜
ZdspLevel : 1
ClipSizeX : 320
ClipSizeY : 512
Scroll related
Displayed scroll surface : NBG0 , NBG1 , RBG0
Scroll priority: : NBG0 NBG1 NBG2 NBG3 RBG0
7 7 2 1 4
Sprite 0 (polygon) priority : 6
Other sprites : 5
Number of scroll colors : 256 colors on each side
Color RAM mode : 1 (2048 out of 32768 colors)
VRAM division : Both banks A and B are divided
Character data : NBG0, NBG1 25E60000~
: RBG0 25E00000~
Character size : 8x8 dots on each side
Pattern name data : NBG0 25E76000~
: NBG1 25E78000~
: RBG0 PA 25E40000~
: RBG0PB 25E50000〜
Pattern name size : NBG0 1 word
: 10-bit pattern name with inversion for each cell
: NBG1 and RGB0 1 word
: No inversion, 12-bit pattern name
Plane size : 64x64 cells on each side
Back screen color : 25E3FFFE to black (R= 0, G=0, B=0)
Rotation parameters : From 25E3FF00
Sprite data : Mixed mosaic with palette and RGB format, special effect functions such as color offset are not used
SCU interrupt priority (not the default of SCU)
High Name SCU Interrupt Mask Register
^ H Blank In FFFF
| Level 2 DMA Ended FFFB (Reserved with SGL)
| Level 1 DMA Ended FDFB (Reserved with SGL)
| Level 0 DMA End F9FB (Reserve with SGL)
| DMA Illegal F1FB
| V Blank In E1FB (Reserve with SGL)
| V Blank Out E1FA (Reserve with SGL)
| Timer 0 E1F8
| Timer 1 E1F0
| DSP end E1E0
| Sound Request E1C0 (Reserve with SGL)
| SMPC E180 (Reserved with SGL)
| Pad E100
Low Sprite drawing finished E000
Sound initialization is not performed, so when using sound-related functions,
Please initialize using the sound initialization function of each library.
When not using textures (sprites). (Polygons can be used.)
ss_main() {
slInitSystem ( TV_352x224 , NULL , 1 );
:
When using textures.
extern TEXTURE textbl[];
ss_main() {
slInitSystem ( TV_320x240 , textbl, 1 );
:
When using dynamic frame (drawing waiting frame switching) mode.
ss_main() {
slInitSystem ( TV_320x240 , NULL , -3 );
:
#include "sgl.h"
Uint16 mode;
Bool slSetTVMode( mode );
Uint16 mode - TV mode (described later).
Bool - Error code (described below).
320,640 dots <--> 352,704 dots
(26.84MHz) (28.64MHz) <NTSC>
(26.66MHz) (28.44MHz) <PAL>
Therefore, although it is possible to switch from 320 dot mode to 640 dot mode, an error will occur if you try to switch
to 352 dot mode. TV_320x224 , TV_320x240 , TV_320x256
TV_352x224 , TV_352x240 , TV_352x256
TV_640x224 , TV_640x240 , TV_640x256
TV_704x224 , TV_704x240 , TV_704x256
TV_320x448 , TV_320x480 , TV_320x512
TV_352x448 , TV_352x480 , TV_352x512
TV_640x448 , TV_640x480 , TV_640x512
TV_704x448 , TV_704x480 , TV_704x512
is entered.
slInitSystem ( TV_352x224 , NULL , 1 );
:
slSetTVMode ( TV_352x480 );
OK.
slInitSystem ( TV_352x224 , NULL , 1 );
:
slSetTVMode ( TV_320x224 );
NG.
#include "sgl.h"
Uint16 mode;
Bool slSetScrTVMode( mode );
Uint16 mode - TV mode (described later).
Bool - Error code (described below).
TV_320x224 , TV_320x240 , TV_320x256
TV_352x224 , TV_352x240 , TV_352x256
TV_640x224 , TV_640x240 , TV_640x256
TV_704x224 , TV_704x240 , TV_704x256
TV_320x448 , TV_320x480 , TV_320x512
TV_352x448 , TV_352x480 , TV_352x512
TV_640x448 , TV_640x480 , TV_640x512
TV_704x448 , TV_704x480 , TV_704x512
is entered.
slInitSystem ( TV_352x224 , NULL , 1 );
:
slSetScrTVMode ( TV_352x480 );
OK.
slInitSystem ( TV_352x448 , NULL , 1 );
:
slSetScrTVMode ( TV_320x448 );
NG.
slInitSystem ( TV_352x448 , NULL , 1 );
:
slSetScrTVMode ( TV_352x240 );
NG.
slInitSystem | slSetSprTVMode | slSetTVMode | slTVOff |
slTVOn | Resolution | VDP2_TVSTAT |
#include "sgl.h"
Uint16 mode;
Bool slSetSprTVMode( mode );
Uint16 mode - TV mode (described later).
Bool - Error code (described below).
TV_320x224 , TV_320x240 , TV_320x256
TV_352x224 , TV_352x240 , TV_352x256
TV_640x224 , TV_640x240 , TV_640x256
TV_704x224 , TV_704x240 , TV_704x256
TV_320x448 , TV_320x480 , TV_320x512
TV_352x448 , TV_352x480 , TV_352x512
TV_640x448 , TV_640x480 , TV_640x512
TV_704x448 , TV_704x480 , TV_704x512
is entered.
slInitSystem ( TV_352x448 , NULL , 1 );
:
slSetSprTVMode ( TV_352x240 );
OK.
slInitSystem ( TV_352x224 , NULL , 1 );
:
slSetSprTVMode ( TV_352x480 );
NG.
slInitSystem ( TV_352x448 , NULL , 1 );
:
slSetSprTVMode ( TV_320x448 );
NG.
slInitSystem ( TV_320x448 , NULL , 1 );
:
slSetScrTVMode ( TV_320x224 );
slSetSprTVMode ( TV_320x224 );
OK.
#include "sgl.h"
Uint16 flag;
Bool slDynamicFrame( flag );
Uint16 flag - toggle dynamic frame mode
Bool - error status
Switches between a constant frame change and a dynamic frame change that waits for VDP1 to finish drawing.
Specify either ON or OFF for flag.
Returns FALSE if in interlaced mode.
Fixed interval → Indeterminate interval /* Switch from 1 int fixed to 2 int base indeterminate mode */
extern Uint8 SynchConst ; /* unsigned int instead of signed int */
/* ^^^^^^ ^^^^^^^^ */
slInitSystem ( TV_320x224 , NULL , 1 );
:
:
/* Set indefinite interval mode-2 */
slDynamicFrame ( ON );
SynchConst = 2; /* not -2 */
slSynch ();
Indeterminate interval → Fixed interval /* Change from 1 int indeterminate interval to 1 int fixed interval */
slInitSystem ( TV_320x224 , NULL , -1 );
:
:
/* Set fixed interval mode 1 */
slDynamicFrame ( OFF );
/* No need to change SynchConst */
slSynch ();
slInitSystem | SynchConst | SynchCount | Resolution |