Difference between revisions of "Palettes"

From SpecNext official Wiki
Jump to: navigation, search
Line 5: Line 5:
 
Palette configuration can be done through registers $40-$44. {{NextRegNo|$43}} sets which palette is being set up. There are two palettes each for Layer 2, Sprites, and ULA; which one of the two is used for each is selected using the lower bits of {{NextRegNo|$43}}.
 
Palette configuration can be done through registers $40-$44. {{NextRegNo|$43}} sets which palette is being set up. There are two palettes each for Layer 2, Sprites, and ULA; which one of the two is used for each is selected using the lower bits of {{NextRegNo|$43}}.
  
Once a palette is selected, {{NextRegNo|$40}} sets the palette entry number to set up; you can then send the color to set it to on {{NextRegNo|$41}} and {{NextRegNo|$44}} which then auto-increment. $41 sends the main 8 bits of the colour; $44 sends the remaining 1 bit for 9-bit colour (3 bits each for red, green, and blue).
+
Once a palette is selected, {{NextRegNo|$40}} sets the palette entry number to set up; you can then send the color to set it to on {{NextRegNo|$41}} ''or'' {{NextRegNo|$44}} which then auto-increment. $41 is used for sending 8-bit colours in RRRGGGBB format; the "missing" third blue bit is set to an OR between the other two. $44 is used for sending 9-bit colours in two byte packets; the first byte sent should be RRRGGGBB as with $41, and the second byte's LSB fills in the third blue bit. (Bits in the second byte other than the LSB are reserved and should be 0.)

Revision as of 18:58, 27 December 2017

To increase the number of available colours on screen, the Spectrum Next supports palletized colours.

Colour IDs in Layer 2 and Sprites are always taken as palette indices. Colour values in the ULA are mapped to the palette as fixed indices, or can be taken as partial palette indices if ULANext mode is enabled. The palette entry numbers for standard ULA mode are: 0-7 for the standard ink colors, 8-15 for BRIGHT ink colors, 128-135 for standard paper colors, and 136-143 for BRIGHT paper colors.

Palette configuration can be done through registers $40-$44. Enhanced ULA Control Register ($43) sets which palette is being set up. There are two palettes each for Layer 2, Sprites, and ULA; which one of the two is used for each is selected using the lower bits of Enhanced ULA Control Register ($43).

Once a palette is selected, Palette Index Register ($40) sets the palette entry number to set up; you can then send the color to set it to on Palette Value Register ($41) or Enhanced ULA Palette Extension ($44) which then auto-increment. $41 is used for sending 8-bit colours in RRRGGGBB format; the "missing" third blue bit is set to an OR between the other two. $44 is used for sending 9-bit colours in two byte packets; the first byte sent should be RRRGGGBB as with $41, and the second byte's LSB fills in the third blue bit. (Bits in the second byte other than the LSB are reserved and should be 0.)