Palettes: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
There are 2 banks of 256 palettes of 16 colors made of 16bit RGB definitions available.
There are 2 banks of 256 palettes of 16 colors available, made of 16bit RGB definitions.
Palettes are located at $400000 in the 68k's memory map and is 16kB in size.
Palettes are located at $400000 in the 68k's memory map.
 
The bank used for video output is set by registers REG_PALBANK1 ($3A000E) and REG_PALBANK0 ($3A001E).


Only one bank can be used at a time. They can be switched by using register ???
Only one bank can be used at a time. They can be switched by using register ???


Color definition: DrgbRRRRGGGGBBBB, D is the Dark bit. RGB are the MSBs of each components, rgb are the LSBs.
'''Color definition word''':  
D
<span style="color:red;">R0</span>
<span style="color:green;">G0</span>
<span style="color:blue;">B0</span>
<span style="color:red;">R4 R3 R2 R1</span>
<span style="color:green;">G4 G3 G2 G1</span>
<span style="color:blue;">B4 B3 B2 B1</span>
 
{{Template:16BitRegister|[[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|}}


[[Sprites|Sprite]] tiles can use any of the 256 palettes, while [[Fix layer|fix]] tiles can only use the 16 firsts.
[[Sprites|Sprite]] tiles can use any of the 256 palettes, while [[Fix layer|fix]] tiles can only use the 16 firsts.


Max colors on screen with [[68k interrupts|RLI]] tricks: 256*16=4096 out of 2^16=65536.
Max colors on screen without [[68k interrupts|RLI]] tricks: 256*16=4096 out of 2^16=65536.


Palettes are stored in [[Palette RAM]].
Palettes are stored in [[Palette RAM]].


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

Revision as of 10:34, 10 February 2011

There are 2 banks of 256 palettes of 16 colors available, made of 16bit RGB definitions. Palettes are located at $400000 in the 68k's memory map.

The bank used for video output is set by registers REG_PALBANK1 ($3A000E) and REG_PALBANK0 ($3A001E).

Only one bank can be used at a time. They can be switched by using register ???

Color definition word: 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

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

Max colors on screen without RLI tricks: 256*16=4096 out of 2^16=65536.

Palettes are stored in Palette RAM.