PC Engine Hardware : VCE

I/O ports :

The VCE (Video Color Encoder) chip can be accessed through three 16-bit I/O ports in the hardware bank (bank $FF) :

Control Register
$0400  /W bit 15-1 : (unused)
bit 0 : Color clock frequency (0 = 5MHz / 1 = 7MHz).

Color Table Index Register
$0402  /W bit 15-9 : (unused)
bit 8-0 : Color index in the palette.

Put in this register the index of the color you want to read/write. This register is auto-incremented after each access to the high byte ($0405) of the color data register.

Color Table Data Register
$0404 R/W bit 15-9 : (unused)
bit 8-6 : Green
bit 5-3 : Red
bit 2-0 : Blue

Any data written in this register will immediately affect the display. But to avoid snow on the monitor, it's better to wait the vertical sync before reading or writing to this register.