Palettes: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 13: Line 13:
There are two special colors used:
There are two special colors used:


*The first color of the palette bank ($400000) is the '''reference color''' for the video output. It has to be $8000 (black).
*The first color of the palette bank ($400000) is the [[reference color]] for the video output. It has to be $8000 (black) otherwise monitors won't be happy and other colors won't be displayed correctly.
*The last color of the palette bank ($401FFE) is the '''backdrop color''' (the color of the backmost layer on the screen).
*The last color of the palette bank ($401FFE) is the '''backdrop color''' (the color of the backmost layer on the screen).


==Color format==
==Color format==
[[File:Pal perfect.png|thumb|All 65536 (2^16) possible NeoGeo colors.]]


D
D
Line 27: Line 29:


{{Template:16BitRegister|[[Video DAC|Dark bit]]|1|R0|1|G0|1|B0|1|R4|1|R3|1|R2|1|R1|1|G4|1|G3|1|G2|1|G1|1|B4|1|B3|1|B2|1|B1|1|}}
{{Template:16BitRegister|[[Video DAC|Dark bit]]|1|R0|1|G0|1|B0|1|R4|1|R3|1|R2|1|R1|1|G4|1|G3|1|G2|1|G1|1|B4|1|B3|1|B2|1|B1|1|}}
Each color component is coded in 6 bits, with 1 common "dark bit", effectively making full use of the 16 color definition bits.


[[Category:Video system]]
[[Category:Video system]]

Revision as of 02:29, 23 December 2015

Palette organisation

There are 2 banks (one usable at a time) of 256 palettes available. Each palette has 16 entries, the first is the transparent index ("color 0"), the 15 others are real colors, made of 16bit RGB definitions. Palettes are located at $400000 in the 68k memory map, they're physically stored in the palette RAM.

The bank used can be set by writing a byte to registers REG_PALBANK1 or REG_PALBANK0.

Sprite tiles can use any of the 256 palettes, while the fix tiles can only use the 16 firsts.

The maximum number of colors on screen without RLI tricks is 256*16=4096 (out of 2^16=65536).

Special colors

There are two special colors used:

  • The first color of the palette bank ($400000) is the reference color for the video output. It has to be $8000 (black) otherwise monitors won't be happy and other colors won't be displayed correctly.
  • The last color of the palette bank ($401FFE) is the backdrop color (the color of the backmost layer on the screen).

Color format

All 65536 (2^16) possible NeoGeo colors.

D R0 G0 B0 R4 R3 R2 R1 G4 G3 G2 G1 B4 B3 B2 B1

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Dark bit R0G0B0R4R3R2R1G4G3G2G1B4B3B2B1

Each color component is coded in 6 bits, with 1 common "dark bit", effectively making full use of the 16 color definition bits.