Palettes: Difference between revisions
m (→Special colors) |
m (Split to "colors" page) |
||
Line 2: | Line 2: | ||
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. | 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. | ||
[[Sprites|Sprite]] tiles can use any of the 256 palettes, while the [[Fix layer|fix]] tiles can only use the 16 | [[Sprites|Sprite]] tiles can use any of the 256 palettes, while the [[Fix layer|fix]] tiles can only use the first 16. | ||
The maximum number of colors on screen without [[timer interrupt]] tricks is: 256 palettes * 15 colors | The maximum number of colors on screen without [[timer interrupt]] tricks is: 256 palettes * 15 colors = '''3840''' (out of 2^16 = 65536). | ||
==Special colors | =Color format= | ||
See [[colors]]. | |||
=Special colors= | |||
There are two special colors used: | There are two special colors used: | ||
Line 13: | Line 17: | ||
*The last color of the palette bank ($401FFE) is the [[backdrop color]] (the color of the backmost "layer" on the screen). Caused by line buffers in {{Chipname|NEO-B1}} being cleared to $FFF (Last color of last palette). | *The last color of the palette bank ($401FFE) is the [[backdrop color]] (the color of the backmost "layer" on the screen). Caused by line buffers in {{Chipname|NEO-B1}} being cleared to $FFF (Last color of last palette). | ||
=Access= | |||
Palettes are located at $400000 in the [[68k memory map]], and they're physically stored in the [[palette RAM]]. | Palettes are located at $400000 in the [[68k memory map]], and they're physically stored in the [[palette RAM]]. | ||
Byte access may be allowed, but it will trash the corresponding word's other byte (/WE are tied together). Maybe | Byte access may be allowed, but it will trash the corresponding word's other byte (/WE are tied together). Maybe {{Chipname|NEO-C1}} doesn't assert {{Sig|PAL|PAL}} during byte access ? | ||
The palettes can be read and written at any time. During active display, since the CPU has priority over rendering, the color read or written will be displayed during at least one pixel, resulting in noticeable "snow" if multiple colors are updated. A workaround is to update the palette only during blanking (horizontal or vertical), over multiple frames if necessary. | |||
The bank can be set by writing a byte to registers {{Reg|REG_PALBANK1}} or {{Reg|REG_PALBANK0}}. | The bank can be set by writing a byte to registers {{Reg|REG_PALBANK1}} or {{Reg|REG_PALBANK0}}. | ||
[[Category:Video system]] | [[Category:Video system]] | ||
Revision as of 04:06, 12 October 2016
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.
Sprite tiles can use any of the 256 palettes, while the fix tiles can only use the first 16.
The maximum number of colors on screen without timer interrupt tricks is: 256 palettes * 15 colors = 3840 (out of 2^16 = 65536).
Color format
See colors.
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). Caused by line buffers in NEO-B1 being cleared to $FFF (Last color of last palette).
Access
Palettes are located at $400000 in the 68k memory map, and they're physically stored in the palette RAM.
Byte access may be allowed, but it will trash the corresponding word's other byte (/WE are tied together). Maybe NEO-C1 doesn't assert PAL during byte access ?
The palettes can be read and written at any time. During active display, since the CPU has priority over rendering, the color read or written will be displayed during at least one pixel, resulting in noticeable "snow" if multiple colors are updated. A workaround is to update the palette only during blanking (horizontal or vertical), over multiple frames if necessary.
The bank can be set by writing a byte to registers REG_PALBANK1 or REG_PALBANK0.