HARDWARE ManualVDP1 User's Manual
BackForward
VDP1 User's Manual / Chapter 5 Table

■ 5.2 Color look-up table

The color lookup table is used to specify the pixel color of the character pattern in lookup table mode. The color lookup table defines 16 color codes in VRAM with 16-bit data each.
In the lookup table mode, a character pattern is defined in the character pattern table at 4 bits / pixel, and one of the 16 colors in the color lookup table is selected from the defined 4-bit data. The 16-bit color code of the selected color is written to the frame buffer as the pixel color code as it is.
The size of the color lookup table is 20H (32) Byte. Write the table from the boundary address in 20HByte units of VRAM. However, it cannot be defined as 00000H.
VRAM is up to address 7FFFFH. Do not define a color look-up table beyond address 80000H.
Both the color bank code and RGB code are valid for the data to be written to the color lookup table. The RGB code is MSB = 1. The color bank code is MSB = 0 when RGB codes are mixed, and MSB is arbitrary (0 or 1) when RGB codes are not mixed.
Set the MSB according to the data processing of VDP2.

Figure 5.2 Color look-up table

┌──────────┐ 
+ 00H │ 16-bit data │ (0H color code)
├──────────┤ 
+ 02H │ 16-bit data │ (1H color code)
├──────────┤ 
+ 04H │ 16-bit data │ (2H color code)
├──────────┤ 
: │: │: 
: │: │: 
: │: │: 
├──────────┤ 
+ 1CH │ 16-bit data │ (EH color code)
├──────────┤ 
+ 1EH │ 16-bit data │ (FH color code)
└──────────┘ 

● Look-up table mode
Specify the color mode as the lookup table mode with the sprite drawing command. With this specification, the character pattern stored in VRAM at 4bit / pixel is converted to a color code and written to the frame buffer by referring to the specified color lookup table.
In the sprite drawing command, specify the storage address and size of the character pattern, and the storage address of the color lookup table.

● Character pattern
The character pattern in lookup table mode is stored in VRAM at 4bit / pixel.

● Command table
Specify the address of the color lookup table to be referenced by the sprite in the address of the color lookup table of the command table (start address + 06H). The specified value is the address / 8H. Since the color lookup table is stored in the boundary of 20HByte unit, the lower 2bit is 00H.
The relationship between the command table, color lookup table, and character pattern table is as follows.

Figure 5.3 Look-up table method table relationship
Command table 
┏━━━━━━━━━━━━━━┓ 
┃ ┃ 
┠──────────────┨ 
┌────┨ Look-up table address ┃ 
│ ┠──────────────┨ 
│ ┌─── ┨ Character address ┃ 
│ │ ┠──────────────┨ 
│ │ ┃ Character size ┃ 
│ │ ┠──────────────┨ 
│ │ ┃ ┃ 
│ │ ┃ ┃ 
│ │ ┃ ┃ 
│ │ ┗━━━━━━━━━━━━━━┛ ┏━━━━━━━━━━━━━━┓
│ │ ┃ Frame buffer ┃
│ └── → ┏━━━━━━━━━━━━━━┓ ┃ ┃
│ Address ┃ Character pattern table ┃ 4-bit ┃ ┃
│ ┃: ┃ Data ┃ ┃
│ ┃: ┠─┐ ┃ ┃
│ ┗━━━━━━━━━━━━━━┛ │ ┃ ┃
└─── → ┏━━━━━━━━━━━━━━┓ │ ┃ ┃
Address ┃ Color look-up table ┃ ← ┘ ┃ ┃
┃: ┃┃┃┃
┃: ┃──── → ┃┃
┗━━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━━┛
16-bit data 

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