Japanese
HARDWARE ManualVDP2 User's ManualChapter 3 RAM
BackForward
VDP2 User's Manual/Chapter 3 RAM

■3.4 Color RAM mode

The color RAM is 32K bits (2K words), and the stored color data is used for all palette-style sprites and scroll screens. Color data can be stored by selecting either 15-bit data with 5 bits each for RGB or 24-bit data containing 8 bits each. You can also use the extended color calculation function by dividing the data into 16K bits (1K words) and storing the same color data in each. There are three ways to store color data in color RAM:

  1. Mode 0: 1024 color settings with a total of 15 bits (5 bits each for RGB)

  2. Mode 1: 2048 color settings with a total of 15 bits (5 bits each for RGB)

  3. Mode 2: 1024 color settings with a total of 24 bits (8 bits each for RGB)

When outputting color data, it is fixed at 8 bits each for RGB, so if the color data stored in the color RAM is 5 bits each for RGB, 0 is added to the lower 3 bits.
When the special color calculation mode is specified as mode 3, the most significant bit of the color RAM data becomes the color calculation enable bit. For details on the special color calculation mode, see " 12.2 Special color calculation function ".

Figure 3.9 shows the structure of color data on color RAM.

Figure 3.9 Color data structure on color RAM

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

 Output BLUE data
 07
 06
 05
 04
 03
 02
 01
 00
 BLUE data 5 bits
 0
 0
 0
 Output GREEN data
 07
 06
 05
 04
 03
 02
 01
 00
 GREEN data 5 bits
 0
 0
 0
 Output RED data
 07
 06
 05
 04
 03
 02
 01
 00
 RED data 5 bits
 0
 0
 0

[Note] The most significant bit CC is an enable bit when the special color calculation mode is mode 3.

●For RGB each 5 bits
color data
 31
 30
 29
 28
 27
 26
 25
 24
 23
 22
 21
 20
 19
 18
 17
 16
 CC
 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

 Output BLUE data
 07
 06
 05
 04
 03
 02
 01
 00
 BLUE data 8 bits
 Output GREEN data
 07
 06
 05
 04
 03
 02
 01
 00
 GREEN data 8 bits
 Output RED data
 07
 06
 05
 04
 03
 02
 01
 00
 RED data 8 bits

[Note] The most significant bit CC is an enable bit when the special color calculation mode is mode 3.

Figure 3.10 shows the color data written to color RAM.

Figure 3.10 Color data of color RAM
●Mode 0
  100000H┌──────────────┐
         │ 16 bits x    │1K words←┐
         │ 1024 colors  │         │Same color data
         ├ ─ ─ ─ ─ ─ ─ ─┤         │
         │ 16 bits x    │1K words←┘
         │ 1024 colors  │
  100FFFH└──────────────┘


●Mode 1
  100000H┌──────────────┐
         │              │
         │              │
         │ 16 bits x    │2K words
         │ 2048 colors  │
         │              │
  100FFFH└──────────────┘


●Mode 2
  100000H┌──────────────┐
         │              │
         │              │
         │ 32 bits x    │2K words
         │ 1024 colors  │
         │              │
  100FFFH└──────────────┘

●RAM control register

The RAM control register specifies VRAM bank division, VRAM usage purpose for rotating scroll screen, and color RAM mode. It is a 16-bit readable and writable register located at address 18000EH. The value is cleared to 0 after power-on or reset, so be sure to set it.

RAMCTL 18000EH
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 CRKTE
 -
 CRMD1
 CRMD0
 -
 -
 VRBMD
 VRAMD

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 RDBSB11
 RDBSB10
 RDBSB01
 RDBSB00
 RDBSA11
 RDBSA10
 RDBSA01
 RDBSA00

 

Color RAM Coefficient Table Enable Bit
:Color RAM coefficient table enable bit (CRKTE), bit 15
Please refer to " 6.4 Coefficient table control ".

 

Color RAM mode bit
:Color RAM mode bit (CRMD1, CRMD0), bits 13, 12
Specifies the color RAM mode.

 CRMD1
 CRMD0
 mode
 process
 0
 0
 0
 1024 colors set with 5 bits each for RGB
 0
 1
 1
 2048 colors set with 5 bits each for RGB
 1
 0
 2
 1024 colors set with 8 bits each for RGB
 1
 1
 -
 Setting prohibited

Be sure to set this bit before storing color data in color RAM.
If mode 0 is set, by writing data to the first half of the color RAM address, the same data as the first half will be written to the second half at the same time.
When the CRKTE bit is set to 1, set the color RAM mode to mode 1. At that time, the second half of the color RAM (100800H to 100FFFH) is used for coefficient table data, so color data cannot be stored.

  

VRAM mode bit : VRAM mode bit (VRBMD, VRAMD), bits 9, 8
Please refer to " 3.2 VRAM Bank Division ".

    

Rotation data bank selection bit : RBG0 data bank select bit (RDBSA00 to RDBSB11), bits 7 to 0
Please refer to " 6.2 Rotational scroll screen display control ".
When the CRKTE bit is set to 1, do not specify that the 4 banks of VRAM be used as RAM for coefficient table data.


BackForward
HARDWARE Manual VDP2 User's ManualChapter 3 RAM
Copyright SEGA ENTERPRISES, LTD., 1997