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

■Color mode

Color mode bit: color mode bit, bits 5 to 3
Specify the number of colors and expression method for drawing sprites. Valid only for sprites. For non-textures, set the color mode to 000B. For non-texture, specify the color using non-texture color.
There are three ways to specify color modes: color bank mode, which uses a palette code and color bank, lookup table mode, which uses a color lookup table, and RGB mode, which specifies brightness directly.
In color bank mode, you can choose from 16, 64, 128, or 256 colors depending on the bit number of pixel data, in lookup table mode you can draw in 16 colors, and in RGB mode you can draw in 32,768 colors.
The contents of the color mode bits are:

 color mode
 mode
 Content
 1pixel
Number of bits
 bit 5
 4
 3
 Number of colors
 mode name
0 0 0 0
 16 colors
 color bank mode
 4bit
0 0 1 1
 16 colors
 lookup table mode
 4bit
0 1 0 2
 64 colors
 color bank mode
 8bit
0 1 1 3
 128 colors
 color bank mode
 8bit
1 0 0 4
 256 colors
 color bank mode
 8bit
1 0 1 5
 32768 colors
 RGB mode
 16bit
 Other than those above
 Setting prohibited (please do not set)

Character pattern for each mode
Character patterns are stored on VRAM in each mode. Let's take 8 pixels horizontally and 1 pixel vertically as an example.

mode 0
Color bank mode with 16 colors. Colors are represented by palette codes and color banks.
1 pixel is represented by 4 bits. You can draw in 16 colors. 4Bytes are required to represent 8 pixels. 1Byte has 2 pixels of data, and when not flipped horizontally, the upper 4 bits represent the left pixel and the lower 4 bits represent the right pixel.
The palette code is represented by 4 bits, and the upper 12 bits are added to the color bank from the color bank word (start address of the command table +06H) and written to the frame buffer as 16-bit data.
When 8bit/pixel (frame buffer rotation or high resolution), the lower 8 bits of 16 bits are written to the frame buffer. The upper 8 bits are discarded.
Since the drawing pixel data is a color bank code, color calculations cannot be performed.

 Bit 15     12 11     8 7      4 3       0 
     ┌────────┬────────┬────────┬────────┐
+00H |Pixel 0 |Pixel 1 |Pixel 2 |Pixel 3 |
     ├────────┼────────┼────────┼────────┤
+02H |Pixel 4 |Pixel 5 |Pixel 6 |Pixel 7 |
     └────────┴────────┴────────┴────────┘

mode 1
Lookup table mode using color lookup table.
4 bits represents 1 pixel. It is possible to draw in 16 colors. Character data is the same as mode 0.
One color data is selected in 4 bits from among the 16 16-bit colors stored in the color lookup table and written to the frame buffer. When 8bit/pixel (frame buffer rotation or high resolution), the lower 8 bits of 16 bits are written to the frame buffer.
Write the color lookup table address to the lookup table address (command table start address +06H, shared with color bank word). The lookup table color code can be specified as either a color bank code or an RGB code. However, RGB code is prohibited at 8bit/pixel.

Figure 6.11 Drawing example in modes 0 and 1
For an original picture of 8 pixels horizontally 
     ┌───────┬───────┐
+00H→|0 1 2 3 4 5 6 7|←+02H
     ├───────┼───────┤
+04H→│8 9 A B C D E F│←+06H
     ├───────┼───────┤
     │   :       :   │
     │   :       :   │

Mode 2, Mode 3, Mode 4
Mode 2 is a color bank mode with 64 colors, mode 3 with 128 colors, and mode 4 with 256 colors. Colors are represented by palette codes and color banks.
1 pixel is represented by 8 bits. You can draw 64 colors, 128 colors, and 256 colors respectively. 8Byte is required to represent 8 pixels.
The palette code is represented by 6 bits, 7 bits, and 8 bits, and the upper 10 bits, 9 bits, and 8 bits are added to the color bank from the color bank word (start address of the command table +06H), and written to the frame buffer as 16-bit data. In mode 2 and mode 3, the upper 2 bits and 1 bit are ignored respectively. When 8bit/pixel (frame buffer rotation or high resolution), the lower 8 bits of 16 bits are written to the frame buffer.
Since the drawing pixel data is a color bank code, color calculations cannot be performed.

  bit 15              8 7                 0 
      ┌────────────────┬──────────────────┐
 +00H |    Pixel 0           Pixel 1      |
      ├────────────────┼──────────────────┤
 +02H |    Pixel 2           Pixel 3      |
      ├────────────────┼──────────────────┤
 +04H |    Pixel 4           Pixel 5      |
      ├────────────────┼──────────────────┤
 +06H │    Pixel 6           Pixel 7      │
      ├────────────────┼──────────────────┤
      │       :                 :         │

Figure 6.12 Drawing example for modes 2, 3, and 4
For an original picture of 8 pixels horizontally 
      ┌───┬───┬───┬───┐
+00H →│0 1│2 3│4 5│6 7│← +06H
      ├───┼───┼───┼───┤
+08H →│8 9│A B│C D│E F│← +0EH
      ├───┼───┼───┼───┤
      │ : │ : │ : │ : │
      │ : │ : │ : │ : │

mode 5
RGB mode with 32768 colors. Colors are represented by the brightness of each RGB (red, green, and blue). 1 pixel is represented by 16 bits. You can draw in 32768 colors. 16 bytes are required to represent 8 pixels.
The RGB code represents the RGB code with MSB1bit (value is 1) and the brightness of each RGB with 5bits. The brightness of each RGB color ranges from 00H to 1FH; the closer it gets to 00H, the darker it gets, and the closer it gets to 1FH, the brighter it gets. When all RGB are 00H, it is 8000H, representing black; when all RGB is 1FH, it is FFFFH, representing white.
16 bits of RGB code is written to the frame buffer as is. This mode cannot be used when using 8bit/pixel (frame buffer rotation or high resolution).
RGB codes can perform color calculations.

  bit 15              8 7                 0 
      ┌────────────────┬──────────────────┐
 +00H |   Pixel 0            Pixel 0      |
      | (upper byte)       (lower byte)   |
      ├────────────────┼──────────────────┤
 +02H |   Pixel 1            Pixel 1      |
      | (upper byte)       (lower byte)   |
      ├────────────────┼──────────────────┤
 +04H |   Pixel 2            Pixel 2      |
      | (upper byte)       (lower byte)   |
      ├────────────────┼──────────────────┤
 +06H |   Pixel 3            Pixel 3      |
      | (upper byte)       (lower byte)   |
      ├────────────────┼──────────────────┤
 +08H |   Pixel 4            Pixel 4      |
      | (upper byte)       (lower byte)   |
      ├────────────────┼──────────────────┤
 +0AH |   Pixel 5            Pixel 5      |
      | (upper byte)       (lower byte)   |
      ├────────────────┼──────────────────┤
 +0CH │   Pixel 6            Pixel 6      │
      | (upper byte)       (lower byte)   |
      ├────────────────┼──────────────────┤
      │       :                 :         │

Figure 6.13 RGB code format
MSB LSB
┌─┬─────────┬─────────┬─────────┐
│ │    B    │    G    │    R    │
│1├─┬─┬─┬─┬─┼─┬─┬─┬─┬─┼─┬─┬─┬─┬─┤
│ │4│3│2│1│0│4│3│2│1│0│4│3│2│1│0│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
[Note] MBS is “1”

Table 6.2 Pixel data
 pixel data
 drawing data
 0000H
 transparent color code
 0001H
:
7FFEH
 Setting prohibited
(Do not set in RGB mode)
(Palette bank code)
 7FFEH
 end code
 8000H
:
FFFFH
 RGB code

Figure 6.14 Mode 5 drawing example
   For an original picture of 8 pixels horizontally 
      ┌─┬─┬─┬─┬─┬─┬─┬─┐
+00H →│0│1│2│3│4│5│6│7│← +0EH
      ├─┼─┼─┼─┼─┼─┼─┼─┤
+10H →│8│9│A│B│C│D│E│F│← +1EH
      ├─┼─┼─┼─┼─┼─┼─┼─┤
      │:│:│:│:│:│:│:│:│
      │:│:│:│:│:│:│:│:│


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