HARDWARE ManualVDP2 User's ManualChapter 4 Scroll screen
BackForward
VDP2 User's Manual / Chapter 4 Scroll Screen

■ 4.3 cell

The cell is a picture pattern of 8 dots wide x 8 dots high and is stored in VRAM. The number of character colors (number of colors per cell) can be selected from 16 colors, 256 colors, 2048 colors, 32768 colors, and 16.77 million colors (16,777,216 colors). The size of each dot color data and the VRAM capacity required for one cell of data vary depending on the number of colors.

● Number of character colors

There are two types of color formats for displaying characters: palette format and RGB format. In the palette format, the data of the color RAM address specified by the palette number in the pattern name data and the dot color code in the cell data is used as the display color data. In the RGB format, the cell data is used as the display color data as it is. Table 4.1 shows the number of character colors and the number of bits per dot at that time in each color format.

Table 4.1 Number of character colors and dot data size
 Color format
 Number of character colors
 Number of bits per dot
 Palette format
 16 colors
 4 bits
 256 colors
 8 bits
 2048 colors
 16 bits (use only the lower 11 bits)
 RGB format
 32768 colors
 16 bit
 16.77 million colors
 32 bits (use only MSB and lower 24 bits)

[Note] In color RAM modes 0 and 2, 2048 colors become 1024 colors.

● Cell data structure

The data structure of each cell stored in the character pattern table changes depending on the number of bits per dot. The boundary when storing in VRAM is 20H regardless of the number of bits per dot.
The structure of cell data is shown in Table 4.2, "Details".

Table 4.2 Cell data structure
 Number of bits per dot
 Cell data
 Boundary
detail
 4 bits / dot
 32 bytes / cell
 20H bytes
 8 bits / dot
 64 bytes / cell
 20H bytes
 16 bits / dot
 128 bytes / cell
 20H bytes
 32 bits / dot
 256 bytes / cell
 20H bytes

Reference: Click the details column in "Table 4.2" for the data structure of cells by the number of character colors.

● Transparent dots

The dot color code (transparent code) that becomes a transparent dot changes depending on the color format. If the color format is palette format, it becomes a transparent dot when all the bits per dot are 0. In the case of RGB format, it becomes a transparent dot when the most significant bit of the dot data is 0.
In the palette format, the color data at the beginning of the palette corresponds to the transparent code, so it is not normally used. If the transparency code is disabled, this color data can also be used, and its control is performed by the screen display enable register.

The data values for transparent dots are shown in Table 4.3.

Table 4.3 Transparent dot data values
 Color format
 Number of character colors
 Number of bits per dot
 Transparent code
 Palette format
 16 colors
 4 bits / dot
 0H (4 bits)
 256 colors
 8 bits / dot
 00H (8 bits)
 2048 colors
 16 bits / dot
 000H (lower 11 bits)
 RGB format
 32768 colors
 16 bits / dot
 MSB (bit 15) is 0
 16.77 million colors
 32 bits / dot
 MSB (bit 31) is 0

● RGB format dot data

When the color format is RGB format, the number of character colors can be selected from 32768 colors and 16.77 million colors. For 16.77 million colors, specify 8 bits for each of RGB, but for 32768 colors, specify the upper 5 bits of each of the 8 bits for RGB, and the lower 3 bits are fixed at 0. The most significant bit is a transparent bit that specifies whether it is a transparent dot, and when it is 0, it becomes a transparent dot.
If you specify to disable the transparency code in the screen display enable register, the transparency bit is ignored.
Figure 4.6 shows the dot data in RGB format.

Figure 4.6 Dot data in RGB format

● For 32768 colors
Color data
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 Transparent
BLUE data 5 bits
GREEN data 5 bits
RED data 5 bits

● For RGB 5 bits each
Color data
 31
 30
 29
 28
 27
 26
 twenty five
 twenty four
 twenty three
 twenty two
 twenty one
 20
 19
 18
 17
 16
 Transparent
ignore
BLUE data 8 bits
 15
 14
 13
 12
 11
 Ten
 09 09
 08 08
 07 07
 06 06
 05 05
 04
 03 03
 02 02
 01 01
 00
 GREEN data 8 bits
 RED data 8 bits

BackForward
HARDWARE Manual VDP2 User's ManualChapter 4 Scroll screen
Copyright SEGA ENTERPRISES, LTD., 1997