/

Login

Username:

Password:

Register

Username:

Password:

Password confirm:

Email:

ram map rom map

Writing Colors

HAL provides several tables for holding palettes. The main palette is at $0500, which contains all 512 colors. However, several alternative palettes are available, and which one is in use is specified by $32DC. The alternative FG/BG palettes write to colors $04-$7F, while the alternative sprite palettes write to colors $B0-$FF (the remaining colors are still pulled from $0500).
The alternative FG/BG palettes are $0708, $7878, $7A78, $7C78, $7E78, $8078, and $8278.
The alternative sprite palettes are $0860, $79D0, $7BD0, $7DD0, $7FD0, $81D0, and $83D0.
The game provides a routine to write to the standard palette at $008BB2, or alternative palette 0 at $008BC1. JSL to it with:
A = Lower 16 bits of source
X = Upper 8 bits of source
Y = Starting color (high byte) and number of colors (low byte)


For the status bar, there also is a fixed DMA on channel 2 pointed at CGRAM color $04 by NMI every frame; simply set the DMA source and enable it to write. Specifically, the status bar sets its source during IRQ to $151F. Hence, writes there will change the palette for the status bar.
The game provides a routine to write status bar colors at $01FBB1. JSL to it with the following:
A = Lower 16 bits of source
X = Upper 8 bits of source
Y = Starting color (high byte) and number of colors (low byte)

Edit entry: Writing Colors