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

■5.2 Color lookup table

A color lookup table is used to specify the color of pixels in a character pattern in lookup table mode. The color lookup table defines 16 color codes in VRAM as 16-bit data each.
In lookup table mode, a character pattern is defined in the character pattern table with 4 bits/pixel, and one color from the 16 colors in the color lookup table is selected using the defined 4 bit data. The 16-bit color code of the selected color is written directly to the frame buffer as a pixel color code.
The size of the color lookup table is 20H (32) Byte. Write the table starting 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 color lookup tables beyond address 80000H.
Both color bank codes and RGB codes are valid for the data written to the color lookup table. The RGB code is MSB=1. For the color bank code, when RGB codes are mixed, MSB = 0, and when RGB codes are not mixed, MSB is arbitrary (0 or 1).
Set MSB according to VDP2 data processing .

Figure 5.2 Color lookup 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)
     └───────────┘ 

●Lookup table mode
Specify the color mode in the sprite drawing command to lookup table mode. With this specification, the character pattern stored in VRAM at 4 bits/pixel will be 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
Character patterns in lookup table mode are stored in VRAM at 4 bits/pixel.

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

Figure 5.3 Table relationships in lookup table method
         command table                       
        ┏━━━━━━━━━━━━━━┓                     
        ┃              ┃                     
        ┠──────────────┨                     
┌───────┨Lookup table  ┃                     
│       ┃address       ┃                     
│       ┠──────────────┨                     
│┌──────┨Character     ┃                     
││      ┃address       ┃                     
││      ┠──────────────┨                     
││      ┃Character size┃                     
││      ┠──────────────┨                     
││      ┃              ┃                     
││      ┃              ┃                     
││      ┃              ┃                     
││      ┗━━━━━━━━━━━━━━┛     ┏━━━━━━━━━━━━━━┓
││                           ┃ Frame buffer ┃
│└─────→┏━━━━━━━━━━━━━━┓     ┃              ┃
│Address┃Character     ┃     ┃ 4 bit data   ┃
│       ┃pattern       ┃     ┃              ┃
│       ┃table         ┃     ┃              ┃
│       ┃       :      ┃Data ┃              ┃
│       ┃       :      ┠─┐   ┃              ┃
│       ┗━━━━━━━━━━━━━━┛ │   ┃              ┃
└──────→┏━━━━━━━━━━━━━━┓ │   ┃              ┃
 Address┃Color         ┃ │   ┃              ┃
        ┃Lookup        ┃←┘   ┃              ┃
        ┃Table         ┃     ┃              ┃
        ┃       :      ┃     ┃              ┃
        ┃       :      ┃────→┃              ┃
        ┗━━━━━━━━━━━━━━┛     ┗━━━━━━━━━━━━━━┛
                    16 bit data              

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