★ SGL User's Manual ★ PROGRAMMER'S STRUCT| function | Normal scroll | Rotating scroll | |||
|---|---|---|---|---|---|
| NBG0 | NBG1 | NBG2 | NBG3 | RBG0 | |
| Number of character colors | 16 colors 256 colors 2048 colors * 32768 colors Choose from 16.77 million colors | 16 colors 256 colors 2048 colors * Select from 32768 colors | 16 colors Select from 256 colors | 16 colors Select from 256 colors | 16 colors 256 colors 2048 colors * 32768 colors Choose from 16.77 million colors |
| Character size | Select from 1 horizontal x 1 vertical cell, 2 horizontal x 2 vertical cells | ||||
| Pattern name data size | Select from 1 word or 2 words | ||||
| Plain size | Select from 1 horizontal x 1 vertical page, 2 horizontal x 1 vertical page, 2 horizontal x 2 vertical pages | ||||
| Number of planes | Four | Four | Four | Four | 16 |
| Scale function | 1/4 times to 256 times | none | Arbitrary magnification | ||
| Rotation function | none | can be | |||
In addition to the VRAM access specification restrictions, there are also scroll drawing restrictions that come from the character color number setting of the normal scroll screen "NBG0 to 3".
(Refer to the character pattern section)
Due to these two restrictions, the number of scroll faces that can be drawn at the same time and their functions are limited and determined.
Figure 8-9 Character pattern image
Color format | Number of character colors | Number of bits per dot | Number of colors that can be used by the scroll surface | ||||
|---|---|---|---|---|---|---|---|
| NBG0 | NBG1 | NBG2 | NBG3 | RBG0 | |||
| Palette format | 16 colors | 4 bits | ○ | ○ | ○ | ○ | ○ |
| 256 colors | 8 bits | ○ | ○ | ○ | ○ | ○ | |
| 2048 colors | 16 bit (Use only the lower 11 bits) | ○ | ○ | × | × | ○ | |
| RGB format | 32768 colors | 16 bit | ○ | ○ | × | × | ○ |
| 16.77 million colors | 32 bit (Uses MSB and lower 24 bits> | ○ | × | × | × | ○ | |
| Number of character colors | Character size | ||||||
|---|---|---|---|---|---|---|---|
| Palette format | RGB format | ||||||
| 16 colors | 256 colors | 2048 colors | 32768 colors | 16.77 million colors | 1x1 | 2x2 | |
Substituted value | COL_TYPE_16 | COL_TYPE_256 | COL_TYPE_2048 | COL_TYPE_32768 | COL_TYPE_1M | CHAR_SIZE_1x1 | CHAR_SIZE_2x2 |
| Number of colors of NBG0 and NBG1 | Effective scroll surface | ||||
|---|---|---|---|---|---|
| NBG0 | NBG1 | NBG0 | NBG1 | NBG2 | NBG3 |
| 16.77 million colors | * | ○ | × | × | × |
| 2048 colors or 32678 colors | * | ○ | ○ | × | × |
| * | 2048 colors or 32678 colors | ○ | ○ | ○ | × |
| 2048 colors or 32678 colors | 2048 colors or 32678 colors | ○ | ○ | × | × |
Character number: Start address of character pattern (VRAM)
Character patterns are stored in units of 20H Palette number: Palette number of the color palette to be used (color RAM)
The pattern name data is finally composed by adding the following two function control bits related to the character pattern in addition to the above two information.
Special function bit (2 bits): Controls special color calculation and special priority Inversion function bit (2 bits): Controls up / down / left / right inversion of character pattern
Pattern name data is classified into the three types shown in a), b), and c) in the figure below based on the difference in the amount of information contained.
(For details, see the next section)
The figure is an image model of pattern name data. From this figure, it can be seen that the special function bit and the inversion function bit may or may not be included depending on the type of the pattern name data.

The pattern name data is used when setting the page, and a pattern name data table is created with 64 x 64 minutes of continuous pattern name data as a set, and the layout information is passed to the plane or map.
| Word size | Number of character number bits | remarks |
|---|---|---|
| ☆ 1 word | Lower 10 bits | Inversion function can be specified for each character |
| Lower 12 bits | There is no inversion function | |
| 2 words | Lower 15 bits | Inversion function can be specified for each character |
![]() | 1 word size is recommended for SGL. |
|---|
Figure 8-11 Page image
| Number of words | Character number bit | Substituted value |
|---|---|---|
| 1 word | Lower 10 bits | PNB_1WORD |
| Lower 12 bits | PNB_1WORD | CN_12BIT | |
| 2 words | Lower 16 bits | PNB_2WORD |
slPageNbg0 (NBG0_CELL_ADR, 0, PNB_1WORD | CN_10BIT); ↑ ↑ ↑ ↑ ::: Character number bit specification :: Number of words specified: Palette start address (offset specification) Character pattern start address
Listing 8-1 #define related to page setup parameters
● #define used for page setup parameters ● / * VRAM_BANK ADDRESS * / #define VDP2_VRAM_A0 0x25e00000 #define VDP2_VRAM_A1 0x25e20000 #define VDP2_VRAM_B0 0x25e40000 #define VDP2_VRAM_B1 0x25e60000 / * slPage * / #define PNB_2WORD 0 #define PNB_1WORD 0x8000 #define CN_10BIT 0 #define CN_12BIT 0x4000 / * others * / #define NBG_CELL_ADR VDP2_VRAM_B0
Figure 8-13 Plain image
| Plain size | |||
|---|---|---|---|
| 1 horizontal x 1 vertical | 2 horizontal x 1 vertical | Horizontal 2 x vertical 2 | |
| Price | PL_SIZE_1x1 | PL_SIZE_2x1 | PL_SIZE_2x2 |
Figure 8-14 Map image
caution | The rotation parameters will be described later. |
|---|
| Scroll type | name | Scale | Scale range |
|---|---|---|---|
| Normal scroll screen | NBG0 | ○ | 1/4 to 256 times |
| NBG1 | ○ | 1/4 to 256 times | |
| NBG2 | × | ||
| NBG3 | × | ||
| Rotating scroll | RBG0 | ○ | Arbitrary magnification |
To set the reduction in SGL, use the library function "slZoomModeNbg0,1" corresponding to the normal scroll screen for setting the reduction.
| Plain size | |||
|---|---|---|---|
1x | 1/2 times | 1/4 times | |
| Price | ZOOM_1 | ZOOM_HALF | ZOOM_QUATER |
| Mode 0 | Mode 1 | Mode 2 | Mode 3 | |
|---|---|---|---|---|
| Price | RA | RB | K_CHANGE | W_CHANGE |
| Rotation parameter A | Rotation parameter B | |
|---|---|---|
| Price | RA | RB |
Caution <BR> For details on rotation parameters, refer to "HARDWARE MANUAL vol.2" (VDP2 User's Manual).
| Over processing mode | ||||
|---|---|---|---|---|
| Mode 0 | Mode 1 | Mode 2 | Mode 3 | |
| Parameter assignment value | 0 | 1 | 2 | 3 |
Flow 8-1 Flow of scroll function setting
★ SGL User's Manual ★ PROGRAMMER'S STRUCT