★ FAQ ★ SGL programming related In addition, slInitSystem secures and initializes the work area used by other SGL functions.
If you use an SGL function, be sure to execute this function first. If you execute other SGL functions before executing slInitSystem, the operation cannot be guaranteed.
Left | : 0 |
Top | : 0 |
Right | : ScreenXSize --1 |
Bottom | : ScreenYSize --1 |
Zlimit | : 0x7fff |
CenterX | : ScreenXSize / 2 |
CenterY | : ScreenYSize / 2 |
PersAngle | : 90 ° |
ZdspLevel | : 1 |
Scroll surface displayed: NBG0, NBG1, RBG0
Scroll priority: NBG0 NBG1 NBG2 NBG3 RBG0
: 7 3 2 1 4
Sprite 0: SPR0
(Polygon) Priority: 6
Other sprites: SPR1 to SPR7
: Five
Number of scroll colors: 256 color mode on each side Color RAM mode: 1 (2048 out of 32768 colors)
VRAM division: Divided for both banks A and B Character data: From NBG0, NBG1 25E60000: From RBG0 25E00000 Character size: 8x8 dot pattern name data on each side: From NBG0 25E76000: From NBG1 257E7800: From RBG0 PA 25E40000: From RBG0 PB 25E50000 Pattern name size: NBG0 1 word: 10-bit with inversion for each cell Pattern name: NBG1 and RBG0 1 word: No inversion, 12-bit pattern name Plain size: 64x64 on each side Screen color: 25E3FFFE black (R = 0, G = 0, B = 0)
Rotation parameter: From 25E3FF00 Sprite data: Mixing palette and RGB format Special effects function: Mosaic, color offset, etc. Not used Sprite type: scnSPR3
ASCII character set: 0x25e00000 (For RBG), 0x25e60000 (For NBG)
slDynamicFrame
Is in charge.
Also, if the number of base intervals does not change, such as 1 to -1, you do not need to reconfigure SynchConst.
/ * Switch from 1 int fixed to 2 int base indefinite 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 ();
/ * Change from 1 int indefinite interval to 1 int fixed interval * /
slInitSystem (TV_320x224, NULL, -1);
::
::
/ * Set fixed interval mode 1 * /
slDynamicFrame (OFF);
/ * No need to change SynchConst * /
slSynch ();
Then look at the system variable SynchCount just before running slSynch. If SynchCount is negative, you know that the process is down.
When I changed the parameter "Count" (frame switching count) of to a negative number, it went out of control.
This phenomenon occurs when the executable file is placed in LowRam.
SGL does not consider putting the program in LowRAM because the transfer speed of LowRAM is slow and the SCU is out of the control of LowRAM.
When entering a sprite or polygon into the buffer, the clipping due to the Z limit and the near limit is compared with the upper 16 bits of the Z value, and then the upper 8 bits of the integer part are used for primary sorting.
Furthermore, for polygons and sprites of the same order, secondary sorting is performed using the lower 8 bits of the integer part.
Therefore, it is not used for the fractional part.
Also, since the argument of SPR_ATTRIBUTE is information about the number of colors from the beginning of the color RAM, the boundary per color differs between 24-bit color and 15-bit color. Therefore, it is different from the address offset.
For example, in 24-bit mode, the 256th color is offset, which is 400h, but in 15-bit mode, it is 200h. In slPageNbg, the values given are 0x400 and 0x200, respectively, but in the case of SPR_ATTRIBUTE, both are 256 (0x100).
★ FAQ ★ SGL programming related