adding a set of 16 colours to the "unvaried" palette, especially useful for Lua overlay graphics

This commit is contained in:
rainwarrior 2016-08-25 12:33:21 +00:00
parent a23b61eea0
commit cf175a60bd
2 changed files with 29 additions and 11 deletions

View File

@ -528,13 +528,14 @@ void WritePalette(void)
int x; int x;
//set the 'unvarying' palettes to low < 64 palette entries //set the 'unvarying' palettes to low < 64 palette entries
for(x=0;x<7;x++) const int unvaried = sizeof(palette_unvarying)/sizeof(palette_unvarying[0]);
for(x=0;x<unvaried;x++)
FCEUD_SetPalette(x,palette_unvarying[x].r,palette_unvarying[x].g,palette_unvarying[x].b); FCEUD_SetPalette(x,palette_unvarying[x].r,palette_unvarying[x].g,palette_unvarying[x].b);
//clear everything else to a deterministic state. //clear everything else to a deterministic state.
//it seems likely that the text rendering on NSF has been broken since the beginning of fceux, depending on palette entries 205,205,205 everywhere //it seems likely that the text rendering on NSF has been broken since the beginning of fceux, depending on palette entries 205,205,205 everywhere
//this was just whatever msvc filled malloc with. on non-msvc platforms, there was no backdrop on the rendering. //this was just whatever msvc filled malloc with. on non-msvc platforms, there was no backdrop on the rendering.
for(x=7;x<256;x++) for(x=unvaried;x<256;x++)
FCEUD_SetPalette(x,205,205,205); FCEUD_SetPalette(x,205,205,205);
//sets palette entries >= 128 with the 64 selected main colors //sets palette entries >= 128 with the 64 selected main colors

View File

@ -23,15 +23,32 @@ pal rp2c05004[512] = {
EMPTY_PALETTE_DEEMPH_X_7 EMPTY_PALETTE_DEEMPH_X_7
}; };
//I think these are used for 'unvarying' palette entries, for the gui // Fixed palette entries used by the GUI
pal palette_unvarying[7] = { pal palette_unvarying[] = {
{ 0x00<<2,0x00<<2,0x00<<2}, // Black { 0x00<<2,0x00<<2,0x00<<2}, // 0 = Black
{ 0x3F<<2,0x3F<<2,0x34<<2}, // White { 0x3F<<2,0x3F<<2,0x34<<2}, // 1 = White
{ 0x00<<2,0x00<<2,0x00<<2}, // Black { 0x00<<2,0x00<<2,0x00<<2}, // 2 = Black
{ 0x1d<<2,0x1d<<2,0x24<<2}, // Greyish { 0x1d<<2,0x1d<<2,0x24<<2}, // 3 = Greyish
{ 190,0,0 }, // Redish { 190, 0, 0}, // 4 = Reddish
{ 51,255,51}, // Bright green { 51,255, 51}, // 5 = Bright green
{ 49,14,200}, { 49, 14,200}, // 6 = Ultramarine Blue
// 16 saturated colors useful for Lua scripts
{ 0, 0, 0}, // 7 = Black
{ 0, 0,128}, // 8 = Dark Blue
{ 0,128, 0}, // 9 = Dark Green
{ 0,128,128}, // 10 = Dark Cyan
{ 128, 0, 0}, // 11 = Dark Red
{ 128, 0,128}, // 12 = Dark Magenta
{ 128,128, 0}, // 13 = Dark Yellow
{ 128,128,128}, // 14 = Light Grey
{ 64, 64, 64}, // 15 = Dark Grey
{ 0, 0,255}, // 16 = Bright Blue
{ 0,255, 0}, // 17 = Bright Green
{ 0,255,255}, // 18 = Bright Cyan
{ 255, 0, 0}, // 19 = Bright Red
{ 255, 0,255}, // 20 = Bright Magenta
{ 255,255, 0}, // 21 = Bright Yellow
{ 255,255,255}, // 22 = Bright White
}; };