function | normal scroll | rotating scroll | |||
---|---|---|---|---|---|
NBG0 | NBG1 | NBG2 | NBG3 | RBG0 | |
Number of character colors | 16 colors 256 colors 2048 colors* 32768 colors 16.77 million colors more selection | 16 colors 256 colors 2048 colors* 32768 colors more selection | 16 colors 256 colors more selection | 16 colors 256 colors more selection | 16 colors 256 colors 2048 colors* 32768 colors 16.77 million colors more selection |
character size | Select from 1 cell horizontally x 1 cell vertically or 2 cells horizontally x 2 cells vertically. | ||||
Pattern name data size | Select from 1 word or 2 words | ||||
plane size | Select from 1 page wide x 1 page tall, 2 pages wide x 1 page tall, or 2 pages wide x 2 pages tall. | ||||
Number of planes | 4 | 4 | 4 | 4 | 16 |
Scaling function | 1/4x ~ 256x | none | Any magnification | ||
Rotation function | none | can be |
In addition to VRAM access specification restrictions, there are also scroll drawing restrictions that come from the character color settings for the normal scroll screen "NBG0-3".
(See character pattern section)
These two limitations limit and determine the number of scroll planes that can be drawn at the same time and their functions.
Figure 8-9 Character pattern image
color format | Number of character colors | Number of bits per dot | Number of colors available depending on scroll surface | ||||
---|---|---|---|---|---|---|---|
NBG0 | NBG1 | NBG2 | NBG3 | RBG0 | |||
pallet format | 16 colors | 4 bits | ○ | ○ | ○ | ○ | ○ |
256 colors | 8 bit | ○ | ○ | ○ | ○ | ○ | |
2048 colors | 16 bit (Uses only lower 11 bits) | ○ | ○ | × | × | ○ | |
RGB format | 32768 colors | 16 bit | ○ | ○ | × | × | ○ |
16.77 million colors | 32 bit (Use MSB and lower 24 bits> | ○ | × | × | × | ○ |
Number of character colors | character size | ||||||
---|---|---|---|---|---|---|---|
pallet format | RGB format | ||||||
16 colors | 256 colors | 2048 colors | 32768 colors | 16.77 million colors | 1x1 | 2x2 | |
Substitution 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, NBG1 | valid 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 of the above two pieces of information plus the following two function control bits related to character patterns.
Special function bits (2 bits): Controls special color calculations and special priorities
Reversal function bit (2 bits): Controls the vertical and horizontal reversal of the character pattern.
Pattern name data is classified into three types shown in a), b), and c) in the figure below based on the difference in the amount of information they contain.
(See next section for details)
The figure is an image model of pattern name data. From this figure, you can see that depending on the type of pattern name data, special function bits and inversion function bits may or may not be included.
word size | Character number bit number | remarks |
---|---|---|
☆ 1 word | lower 10 bits | Reverse function can be specified for each character |
lower 12 bits | No reversal function | |
2 words | lower 15 bits | Reverse function can be specified for each character |
SGL recommends 1 word size. |
Figure 8-11 Page image
word count | character number bit | Substitution 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 : : Word count specification : Palette start address (offset specification) Character pattern start address
Listing 8-1 #define related to page setting parameters
● #define used for page setting 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 Plane image
plane size | |||
---|---|---|---|
1 horizontal x 1 vertical | 2 horizontal x 1 vertical | 2 horizontal x 2 vertical | |
Assignment value | PL_SIZE_1x1 | PL_SIZE_2x1 | PL_SIZE_2x2 |
Figure 8-14 Map image
Note | For rotation parameters, see below. |
---|
scroll type | name | Scaling | Scaling range |
---|---|---|---|
Normal scroll screen | NBG0 | ○ | 1/4 to 256 times |
NBG1 | ○ | 1/4 to 256 times | |
NBG2 | × | ||
NBG3 | × | ||
rotating scroll | RBG0 | ○ | Any magnification |
To set reduction in SGL, use the library function “slZoomModeNbg0,1” that corresponds to the normal scroll screen for which you want to set reduction.
plane size | |||
---|---|---|---|
1x | 1/2 times | 1/4 times | |
Assignment value | ZOOM_1 | ZOOM_HALF | ZOOM_QUATER |
mode 0 | mode 1 | mode 2 | mode 3 | |
---|---|---|---|---|
Assignment value | R.A. | R.B. | K_CHANGE | W_CHANGE |
Rotation parameter A | Rotation parameter B | |
---|---|---|
Assignment value | R.A. | R.B. |
Note
For details on rotation parameters, please refer to “HARDWARE MANUAL vol.2”
(VDP2 User's Manual)
Over processing mode | ||||
---|---|---|---|---|
mode 0 | mode 1 | mode 2 | mode 3 | |
Parameter substitution value | 0 | 1 | 2 | 3 |
Flow 8-1 Flow of scroll function settings