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

■4.3 Cell

A cell is a picture pattern of 8 dots horizontally x 8 dots vertically 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,770,000 colors (16,777,216 colors). The size of each dot color data and the VRAM capacity required for one cell's worth of data vary depending on the number of colors.

●Number of character colors

Color formats for displaying characters include palette format and RGB format. In the palette format, the display color data is the color RAM address data specified by the palette number in the pattern name data and the dot color code in the cell data. In RGB format, cell data is used as display color data as is. Table 4.1 shows the number of character colors and the number of bits per dot for 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
 pallet format
 16 colors
 4 bits
 256 colors
 8 bit
 2048 colors
 16 bits (only lower 11 bits are used)
 RGB format
 32768 colors
 16 bit
 16.77 million colors
 32 bits (only MSB and lower 24 bits are used)

[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 in 1 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 byte
 8 bits/dot
 64 bytes/cell
 20H byte
 16 bits/dot
 128 bytes/cell
 20H byte
 32 bits/dot
 256 bytes/cell
 20H byte

Reference: For the cell data structure based on the number of character colors, click on the details column of "Table 4.2"

●Transparent dots

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

Table 4.3 shows the data values for transparent dots.

Table 4.3 Transparent dot data values
 color format
 Number of character colors
 Number of bits per dot
 transparent code
 pallet format
 16 colors
 4 bits/dot
 0H (4 bits)
 256 colors
 8 bits/dot
 00H (8 bit)
 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 32,768 colors and 16,770,000 colors. For 16.77 million colors, specify 8 bits each for RGB, but for 32768 colors, specify the upper 5 bits of each 8 bit RGB, and the lower 3 bits are fixed to 0. Also, the most significant bit is a transparency bit that specifies whether the dot is transparent or not, and when it is 0, it becomes a transparent dot.
If you specify to disable the transparent code in the screen display enable register, the transparent bit will be ignored.
Figure 4.6 shows dot data in RGB format.

Figure 4.6 Dot data in RGB format

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

●For RGB each 5 bits
color data
 31
 30
 29
 28
 27
 26
 25
 24
 23
 22
 21
 20
 19
 18
 17
 16
 transparent
ignore
BLUE data 8 bits
 15
 14
 13
 12
 11
 10
 09
 08
 07
 06
 05
 04
 03
 02
 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