Palette
Created by: phil, Last modification: Tue 11 of Aug, 2009 (18:44 UTC)
The V6Z80P's colour resolution is 12 bit, with 4 bits for red, green and blue (giving a choice of 4096 colours). The indexed pixel colour system used by OSCA allows up to 256 colours on screen at once (without using tricks).
There are two sets of palette registers, this allows one palette to be used by the video hardware to build the video frame, whilst the other receives writes from the CPU / LineCop (see vreg_palette_ctrl)
Both palettes are located at memory locations $000 - $1FF, each colour entry is a 16 bit word. Bits 15:12 are not used and should be written with zeroes, bits 8:11 hold the red level, bits 7:4 hold the green level and bits 3:0 hold the blue level. IE:
| Location | Data Bits | Description |
| $00 | Green:Blue | Colour index 0 LSB |
| $01 | 0000:Red | Colour index 0 MSB |
| $02 | Green:Blue | Colour index 1 LSB |
| $03 | 0000:Red | Colour inded 1 MSB |
| $04 | Green:Blue | Colour index 2 LSB |
| $05 | 0000:Red | Colour index 2 MSB |
| etc | etc | etc |