Japanese
HARDWARE ManualVDP1 User's Manual
BackForward
VDP1 User's Manual/Chapter 1 VDP1 Functions

●Color

Color-related functions and special features are as follows.

There are two ways to represent the colors of pixels drawn (written) to the frame buffer: the color bank method and the RGB code method. The color bank method can express 16, 64, 128, and 256 colors in one character, and the RGB code method can express 32,768 colors in one character.

◆Color bank method
The color bank method combines a 16, 64, 128, or 256 color palette code with a color bank to refer to the colors stored in the VDP2's color RAM. When using 16 colors, the character pattern pixel data represents the palette code in 4 bits, the upper 12 bits are added from the color bank, and 16 bit data is written to the frame buffer. When it is 8bit/pixel, the lower 8bits are written. For 64, 128, and 256 colors, the character pattern is 8 bits/pixel, and for 64, 128, and 256 colors, the lower 6, 7, and 8 bits are valid, respectively. The top 10, 9, and 8 bits of the color bank are added.
Data written using the color bank method is divided into the following functional bits and processed on the VDP2 side. Please refer to the VDP2 manual /for details.

Figure 1.10 Bit configuration of color bank method

MSB LSB
┌──┬──┬──────────┬──────────────┐
│  │  │Color bank│ Palette code │
└──┴──┴──────────┴──────────────┘
 │  │ 
 │  └→Priority 
 ↓ 
color calculation 

◆RGB code method
The RGB code system represents colors using 5 bits of brightness for each of RGB (red, green, blue). The brightness of each RGB is expressed as 00H to 1FH, the closer it gets to 00H, the darker it gets, and the closer it gets to 1FH, it gets brighter. There are 32768 colors that can be expressed using RGB codes. RGB code is 16-bit data, whose most significant bit (MSB) is 1.

◆Parts color
Sprites are colored using color banks, color lookup tables, or RGB codes. For non-textured polygons, polylines, and lines, set the non-textured color. Set for each part.

◆Color lookup table
The color lookup table refers to the 16-color color lookup table and exchanges the 4bit data of the character pattern into 16bit data.
Since the 16-bit data on the table is written to the frame buffer as is, there is no distinction between color bank code and RGB code as texture data.
When read to VDP2, when the 16-bit MSB is 0, it is treated as a color bank code, and when it is 1, it is treated as an RGB code.

◆Non-texture color
Non-texture colors are treated as pixel data. I don't use color banks or color lookup tables.

◆8bit/pixel color
When using high resolution, or when rotating the frame buffer and specifying a bit width of 8 bits/pixel, data is written to the frame buffer at 8 bits/pixel. At this time, when using the color lookup table method or non-texture color, the lower 8 bits of 16 bits are written to the frame buffer.
Hereinafter, it will be abbreviated as 8bit/pixel (high resolution or rotation 8).


BackForward
HARDWARE ManualVDP1 User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997