add USE_BGR565

This commit is contained in:
Tobias Gunkel
2025-08-16 11:50:51 +02:00
parent a9d2851688
commit b71c83a5ca
2 changed files with 174 additions and 161 deletions
+165 -159
View File
@@ -39,6 +39,12 @@ void auto_assign_palette(uint16_t palette[3][4], uint8_t game_checksum, const ch
#ifndef GBCOLOR_HEADER_ONLY #ifndef GBCOLOR_HEADER_ONLY
#ifdef USE_BGR565
#define RGB565(r, g, b) (((b) << 11) | (g << 5) | (r))
#else
#define RGB565(r, g, b) (((r) << 11) | (g << 5) | (b))
#endif
/* /*
* Get an RGB565 colour palette by entry ID & shuffling flags * Get an RGB565 colour palette by entry ID & shuffling flags
* *
@@ -57,9 +63,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x00 && shuffling_flags==0x01) if(table_entry==0x00 && shuffling_flags==0x01)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFB80, 0x9200, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x1C, 0x00), RGB565(0x12, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xAD70, 0x438F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x15, 0x2B, 0x10), RGB565(0x08, 0x1C, 0x0F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xAD70, 0x438F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x15, 0x2B, 0x10), RGB565(0x08, 0x1C, 0x0F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -67,9 +73,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x00 && shuffling_flags==0x03) if(table_entry==0x00 && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFB80, 0x9200, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x1C, 0x00), RGB565(0x12, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFB80, 0x9200, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x1C, 0x00), RGB565(0x12, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xAD70, 0x438F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x15, 0x2B, 0x10), RGB565(0x08, 0x1C, 0x0F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -77,9 +83,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x00 && shuffling_flags==0x05) if(table_entry==0x00 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFB80, 0x9200, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x1C, 0x00), RGB565(0x12, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x5DFF, 0xF800, 0x001F }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0B, 0x2F, 0x1F), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x1F) }, /* OBJ1 */
{ 0xFFFF, 0xAD70, 0x438F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x15, 0x2B, 0x10), RGB565(0x08, 0x1C, 0x0F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -87,9 +93,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x01 && shuffling_flags==0x05) if(table_entry==0x01 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFE28, 0xFEA0, 0x91C0, 0x4800 }, /* OBJ0 */ { RGB565(0x1F, 0x31, 0x08), RGB565(0x1F, 0x35, 0x00), RGB565(0x12, 0x0E, 0x00), RGB565(0x09, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFF3, 0x95BF, 0x64AE, 0x01C7 } /* BG */ { RGB565(0x1F, 0x3F, 0x13), RGB565(0x12, 0x2D, 0x1F), RGB565(0x0C, 0x25, 0x0E), RGB565(0x00, 0x0E, 0x07) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -97,9 +103,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x02 && shuffling_flags==0x05) if(table_entry==0x02 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFFFF, 0x653F, 0x001F }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F) }, /* OBJ0 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0x6FE0, 0xFFFF, 0xFA89, 0x0000 } /* BG */ { RGB565(0x0D, 0x3F, 0x00), RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x14, 0x09), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -107,9 +113,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x03 && shuffling_flags==0x05) if(table_entry==0x03 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFFFF, 0x653F, 0x001F }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0x56E0, 0xFC20, 0xFFE0, 0xFFFF } /* BG */ { RGB565(0x0A, 0x37, 0x00), RGB565(0x1F, 0x21, 0x00), RGB565(0x1F, 0x3F, 0x00), RGB565(0x1F, 0x3F, 0x1F) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -117,9 +123,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x04 && shuffling_flags==0x03) if(table_entry==0x04 && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x7FE0, 0xB380, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x00), RGB565(0x16, 0x1C, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -127,9 +133,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x05 && shuffling_flags==0x00) if(table_entry==0x05 && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x57E0, 0xFA00, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0A, 0x3F, 0x00), RGB565(0x1F, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x57E0, 0xFA00, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0A, 0x3F, 0x00), RGB565(0x1F, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x57E0, 0xFA00, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0A, 0x3F, 0x00), RGB565(0x1F, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -137,9 +143,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x05 && shuffling_flags==0x03) if(table_entry==0x05 && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x57E0, 0xFA00, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0A, 0x3F, 0x00), RGB565(0x1F, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -147,9 +153,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x05 && shuffling_flags==0x04) if(table_entry==0x05 && shuffling_flags==0x04)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x57E0, 0xFA00, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0A, 0x3F, 0x00), RGB565(0x1F, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x5DFF, 0xF800, 0x001F }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0B, 0x2F, 0x1F), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x1F) }, /* OBJ1 */
{ 0xFFFF, 0x57E0, 0xFA00, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0A, 0x3F, 0x00), RGB565(0x1F, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -157,9 +163,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x06 && shuffling_flags==0x00) if(table_entry==0x06 && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFCE0, 0xF800, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x27, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFCE0, 0xF800, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x27, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFCE0, 0xF800, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x27, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -167,9 +173,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x06 && shuffling_flags==0x03) if(table_entry==0x06 && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFCE0, 0xF800, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x27, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -177,9 +183,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x06 && shuffling_flags==0x04) if(table_entry==0x06 && shuffling_flags==0x04)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFCE0, 0xF800, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x27, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x5DFF, 0xF800, 0x001F }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0B, 0x2F, 0x1F), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x1F) }, /* OBJ1 */
{ 0xFFFF, 0xFCE0, 0xF800, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x27, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -187,9 +193,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x07 && shuffling_flags==0x00) if(table_entry==0x07 && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFFE0, 0xF800, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFFE0, 0xF800, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFFE0, 0xF800, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -197,9 +203,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x07 && shuffling_flags==0x04) if(table_entry==0x07 && shuffling_flags==0x04)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFFE0, 0xF800, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x5DFF, 0xF800, 0x001F }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0B, 0x2F, 0x1F), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x1F) }, /* OBJ1 */
{ 0xFFFF, 0xFFE0, 0xF800, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -207,9 +213,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x08 && shuffling_flags==0x00) if(table_entry==0x08 && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xA4FF, 0xFFE0, 0x0300, 0x0000 }, /* OBJ0 */ { RGB565(0x14, 0x27, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x00, 0x18, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xA4FF, 0xFFE0, 0x0300, 0x0000 }, /* OBJ1 */ { RGB565(0x14, 0x27, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x00, 0x18, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xA4FF, 0xFFE0, 0x0300, 0x0000 } /* BG */ { RGB565(0x14, 0x27, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x00, 0x18, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -217,9 +223,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x08 && shuffling_flags==0x03) if(table_entry==0x08 && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFB0A, 0xD000, 0x6000, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x18, 0x0A), RGB565(0x1A, 0x00, 0x00), RGB565(0x0C, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFB0A, 0xD000, 0x6000, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x18, 0x0A), RGB565(0x1A, 0x00, 0x00), RGB565(0x0C, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xA4FF, 0xFFE0, 0x0300, 0x0000 } /* BG */ { RGB565(0x14, 0x27, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x00, 0x18, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -227,9 +233,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x08 && shuffling_flags==0x05) if(table_entry==0x08 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFB0A, 0xD000, 0x6000, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x18, 0x0A), RGB565(0x1A, 0x00, 0x00), RGB565(0x0C, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0x001F, 0xFFFF, 0xFFEF, 0x043F }, /* OBJ1 */ { RGB565(0x00, 0x00, 0x1F), RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x0F), RGB565(0x00, 0x21, 0x1F) }, /* OBJ1 */
{ 0xA4FF, 0xFFE0, 0x0300, 0x0000 } /* BG */ { RGB565(0x14, 0x27, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x00, 0x18, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -237,9 +243,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x09 && shuffling_flags==0x05) if(table_entry==0x09 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFB80, 0x9200, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x1C, 0x00), RGB565(0x12, 0x10, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFF9, 0x677D, 0x9C26, 0x5ACB } /* BG */ { RGB565(0x1F, 0x3F, 0x19), RGB565(0x0C, 0x3B, 0x1D), RGB565(0x13, 0x21, 0x06), RGB565(0x0B, 0x16, 0x0B) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -247,9 +253,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0A && shuffling_flags==0x03) if(table_entry==0x0A && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0x0000, 0xFFFF, 0xFC30, 0x91C7 }, /* OBJ0 */ { RGB565(0x00, 0x00, 0x00), RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07) }, /* OBJ0 */
{ 0x0000, 0xFFFF, 0xFC30, 0x91C7 }, /* OBJ1 */ { RGB565(0x00, 0x00, 0x00), RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07) }, /* OBJ1 */
{ 0xB5BF, 0xFFF2, 0xAAC8, 0x0000 } /* BG */ { RGB565(0x16, 0x2D, 0x1F), RGB565(0x1F, 0x3F, 0x12), RGB565(0x15, 0x16, 0x08), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -257,9 +263,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0B && shuffling_flags==0x01) if(table_entry==0x0B && shuffling_flags==0x01)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -267,9 +273,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0B && shuffling_flags==0x02) if(table_entry==0x0B && shuffling_flags==0x02)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -277,9 +283,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0B && shuffling_flags==0x05) if(table_entry==0x0B && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFFEF, 0x043F, 0xF800 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x0F), RGB565(0x00, 0x21, 0x1F), RGB565(0x1F, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -287,9 +293,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0C && shuffling_flags==0x02) if(table_entry==0x0C && shuffling_flags==0x02)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x8C7B, 0x5291, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x11, 0x23, 0x1B), RGB565(0x0A, 0x14, 0x11), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFE28, 0xFEA0, 0x91C0, 0x4800 }, /* OBJ1 */ { RGB565(0x1F, 0x31, 0x08), RGB565(0x1F, 0x35, 0x00), RGB565(0x12, 0x0E, 0x00), RGB565(0x09, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x8C7B, 0x5291, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x11, 0x23, 0x1B), RGB565(0x0A, 0x14, 0x11), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -297,9 +303,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0C && shuffling_flags==0x03) if(table_entry==0x0C && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFE28, 0xFEA0, 0x91C0, 0x4800 }, /* OBJ0 */ { RGB565(0x1F, 0x31, 0x08), RGB565(0x1F, 0x35, 0x00), RGB565(0x12, 0x0E, 0x00), RGB565(0x09, 0x00, 0x00) }, /* OBJ0 */
{ 0xFE28, 0xFEA0, 0x91C0, 0x4800 }, /* OBJ1 */ { RGB565(0x1F, 0x31, 0x08), RGB565(0x1F, 0x35, 0x00), RGB565(0x12, 0x0E, 0x00), RGB565(0x09, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x8C7B, 0x5291, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x11, 0x23, 0x1B), RGB565(0x0A, 0x14, 0x11), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -307,9 +313,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0C && shuffling_flags==0x05) if(table_entry==0x0C && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFE28, 0xFEA0, 0x91C0, 0x4800 }, /* OBJ0 */ { RGB565(0x1F, 0x31, 0x08), RGB565(0x1F, 0x35, 0x00), RGB565(0x12, 0x0E, 0x00), RGB565(0x09, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x5DFF, 0xF800, 0x001F }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0B, 0x2F, 0x1F), RGB565(0x1F, 0x00, 0x00), RGB565(0x00, 0x00, 0x1F) }, /* OBJ1 */
{ 0xFFFF, 0x8C7B, 0x5291, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x11, 0x23, 0x1B), RGB565(0x0A, 0x14, 0x11), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -317,9 +323,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0D && shuffling_flags==0x01) if(table_entry==0x0D && shuffling_flags==0x01)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x8C7B, 0x5291, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x11, 0x23, 0x1B), RGB565(0x0A, 0x14, 0x11), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x8C7B, 0x5291, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x11, 0x23, 0x1B), RGB565(0x0A, 0x14, 0x11), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -327,9 +333,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0D && shuffling_flags==0x03) if(table_entry==0x0D && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x8C7B, 0x5291, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x11, 0x23, 0x1B), RGB565(0x0A, 0x14, 0x11), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -337,9 +343,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0D && shuffling_flags==0x05) if(table_entry==0x0D && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x8C7B, 0x5291, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x11, 0x23, 0x1B), RGB565(0x0A, 0x14, 0x11), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -347,9 +353,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0E && shuffling_flags==0x03) if(table_entry==0x0E && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -357,9 +363,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0E && shuffling_flags==0x05) if(table_entry==0x0E && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -367,9 +373,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0F && shuffling_flags==0x03) if(table_entry==0x0F && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -377,9 +383,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x0F && shuffling_flags==0x05) if(table_entry==0x0F && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -387,9 +393,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x10 && shuffling_flags==0x01) if(table_entry==0x10 && shuffling_flags==0x01)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -397,9 +403,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x10 && shuffling_flags==0x05) if(table_entry==0x10 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -407,9 +413,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x11 && shuffling_flags==0x05) if(table_entry==0x11 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x07E0, 0x3420, 0x0240 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x00, 0x3F, 0x00), RGB565(0x06, 0x21, 0x00), RGB565(0x00, 0x12, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -417,9 +423,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x12 && shuffling_flags==0x00) if(table_entry==0x12 && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -427,9 +433,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x12 && shuffling_flags==0x03) if(table_entry==0x12 && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -437,9 +443,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x12 && shuffling_flags==0x05) if(table_entry==0x12 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -447,9 +453,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x13 && shuffling_flags==0x00) if(table_entry==0x13 && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0x0000, 0x0430, 0xFEE0, 0xFFFF }, /* OBJ0 */ { RGB565(0x00, 0x00, 0x00), RGB565(0x00, 0x21, 0x10), RGB565(0x1F, 0x37, 0x00), RGB565(0x1F, 0x3F, 0x1F) }, /* OBJ0 */
{ 0x0000, 0x0430, 0xFEE0, 0xFFFF }, /* OBJ1 */ { RGB565(0x00, 0x00, 0x00), RGB565(0x00, 0x21, 0x10), RGB565(0x1F, 0x37, 0x00), RGB565(0x1F, 0x3F, 0x1F) }, /* OBJ1 */
{ 0x0000, 0x0430, 0xFEE0, 0xFFFF } /* BG */ { RGB565(0x00, 0x00, 0x00), RGB565(0x00, 0x21, 0x10), RGB565(0x1F, 0x37, 0x00), RGB565(0x1F, 0x3F, 0x1F) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -457,9 +463,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x14 && shuffling_flags==0x05) if(table_entry==0x14 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFE0, 0xF800, 0x6000, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x00), RGB565(0x1F, 0x00, 0x00), RGB565(0x0C, 0x00, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -467,9 +473,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x15 && shuffling_flags==0x05) if(table_entry==0x15 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xAD70, 0x438F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x15, 0x2B, 0x10), RGB565(0x08, 0x1C, 0x0F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -477,9 +483,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x16 && shuffling_flags==0x00) if(table_entry==0x16 && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xB634, 0x8CCF, 0x63AA, 0x31C4 }, /* OBJ0 */ { RGB565(0x16, 0x31, 0x14), RGB565(0x11, 0x26, 0x0F), RGB565(0x0C, 0x1D, 0x0A), RGB565(0x06, 0x0E, 0x04) }, /* OBJ0 */
{ 0xB634, 0x8CCF, 0x63AA, 0x31C4 }, /* OBJ1 */ { RGB565(0x16, 0x31, 0x14), RGB565(0x11, 0x26, 0x0F), RGB565(0x0C, 0x1D, 0x0A), RGB565(0x06, 0x0E, 0x04) }, /* OBJ1 */
{ 0xB634, 0x8CCF, 0x63AA, 0x31C4 } /* BG */ { RGB565(0x16, 0x31, 0x14), RGB565(0x11, 0x26, 0x0F), RGB565(0x0C, 0x1D, 0x0A), RGB565(0x06, 0x0E, 0x04) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -487,9 +493,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x17 && shuffling_flags==0x00) if(table_entry==0x17 && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFF4, 0xFCB2, 0x94BF, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x14), RGB565(0x1F, 0x25, 0x12), RGB565(0x12, 0x25, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFF4, 0xFCB2, 0x94BF, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x14), RGB565(0x1F, 0x25, 0x12), RGB565(0x12, 0x25, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFF4, 0xFCB2, 0x94BF, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x14), RGB565(0x1F, 0x25, 0x12), RGB565(0x12, 0x25, 0x1F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -497,9 +503,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x18 && shuffling_flags==0x05) if(table_entry==0x18 && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -507,9 +513,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x19 && shuffling_flags==0x03) if(table_entry==0x19 && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFD6C, 0x8180, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x2B, 0x0C), RGB565(0x10, 0x0C, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFF38, 0xCCF0, 0x8345, 0x5981 } /* BG */ { RGB565(0x1F, 0x39, 0x18), RGB565(0x19, 0x27, 0x10), RGB565(0x10, 0x1A, 0x05), RGB565(0x0B, 0x0C, 0x01) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -517,9 +523,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x1A && shuffling_flags==0x05) if(table_entry==0x1A && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x7FE6, 0x0420, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x21, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFFE0, 0x7A40, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x3F, 0x00), RGB565(0x0F, 0x12, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -527,9 +533,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x1B && shuffling_flags==0x00) if(table_entry==0x1B && shuffling_flags==0x00)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFE60, 0x9B00, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x33, 0x00), RGB565(0x13, 0x18, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFE60, 0x9B00, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x33, 0x00), RGB565(0x13, 0x18, 0x00), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0xFE60, 0x9B00, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x33, 0x00), RGB565(0x13, 0x18, 0x00), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -537,9 +543,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x1C && shuffling_flags==0x01) if(table_entry==0x1C && shuffling_flags==0x01)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x7FE6, 0x0318, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x18, 0x18), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x7FE6, 0x0318, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x18, 0x18), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -547,9 +553,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x1C && shuffling_flags==0x03) if(table_entry==0x1C && shuffling_flags==0x03)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x7FE6, 0x0318, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x18, 0x18), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -557,9 +563,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
if(table_entry==0x1C && shuffling_flags==0x05) if(table_entry==0x1C && shuffling_flags==0x05)
{ {
const palette_t palette = { const palette_t palette = {
{ 0xFFFF, 0xFC30, 0x91C7, 0x0000 }, /* OBJ0 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x1F, 0x21, 0x10), RGB565(0x12, 0x0E, 0x07), RGB565(0x00, 0x00, 0x00) }, /* OBJ0 */
{ 0xFFFF, 0x653F, 0x001F, 0x0000 }, /* OBJ1 */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0C, 0x29, 0x1F), RGB565(0x00, 0x00, 0x1F), RGB565(0x00, 0x00, 0x00) }, /* OBJ1 */
{ 0xFFFF, 0x7FE6, 0x0318, 0x0000 } /* BG */ { RGB565(0x1F, 0x3F, 0x1F), RGB565(0x0F, 0x3F, 0x06), RGB565(0x00, 0x18, 0x18), RGB565(0x00, 0x00, 0x00) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -568,9 +574,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
{ {
/* Game Boy DMG palette (4 shades of green) */ /* Game Boy DMG palette (4 shades of green) */
const palette_t palette = { const palette_t palette = {
{ 0xDFEA, 0xAE68, 0x74E6, 0x4388 }, /* OBJ0 */ { RGB565(0x1B, 0x3F, 0x0A), RGB565(0x15, 0x33, 0x08), RGB565(0x0E, 0x27, 0x06), RGB565(0x08, 0x1C, 0x08) }, /* OBJ0 */
{ 0xDFEA, 0xAE68, 0x74E6, 0x4388 }, /* OBJ1 */ { RGB565(0x1B, 0x3F, 0x0A), RGB565(0x15, 0x33, 0x08), RGB565(0x0E, 0x27, 0x06), RGB565(0x08, 0x1C, 0x08) }, /* OBJ1 */
{ 0xDFEA, 0xAE68, 0x74E6, 0x4388 } /* BG */ { RGB565(0x1B, 0x3F, 0x0A), RGB565(0x15, 0x33, 0x08), RGB565(0x0E, 0x27, 0x06), RGB565(0x08, 0x1C, 0x08) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
return; return;
@@ -581,9 +587,9 @@ void get_colour_palette(palette_t selected_palette,uint8_t table_entry,uint8_t s
shuffling_flags); shuffling_flags);
/* Game Boy DMG palette (4 shades of green) */ /* Game Boy DMG palette (4 shades of green) */
const palette_t palette = { const palette_t palette = {
{ 0xDFEA, 0xAE68, 0x74E6, 0x4388 }, /* OBJ0 */ { RGB565(0x1B, 0x3F, 0x0A), RGB565(0x15, 0x33, 0x08), RGB565(0x0E, 0x27, 0x06), RGB565(0x08, 0x1C, 0x08) }, /* OBJ0 */
{ 0xDFEA, 0xAE68, 0x74E6, 0x4388 }, /* OBJ1 */ { RGB565(0x1B, 0x3F, 0x0A), RGB565(0x15, 0x33, 0x08), RGB565(0x0E, 0x27, 0x06), RGB565(0x08, 0x1C, 0x08) }, /* OBJ1 */
{ 0xDFEA, 0xAE68, 0x74E6, 0x4388 } /* BG */ { RGB565(0x1B, 0x3F, 0x0A), RGB565(0x15, 0x33, 0x08), RGB565(0x0E, 0x27, 0x06), RGB565(0x08, 0x1C, 0x08) } /* BG */
}; };
memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES); memcpy(selected_palette, palette, PALETTE_SIZE_IN_BYTES);
} }
+9 -2
View File
@@ -1402,8 +1402,12 @@ void __gb_write(struct gb_s *gb, uint_fast16_t addr, uint8_t val)
/* CGB BG Palette*/ /* CGB BG Palette*/
case 0x69: case 0x69:
gb->cgb.BGPalette[(gb->cgb.BGPaletteID & 0x3F)] = val; gb->cgb.BGPalette[(gb->cgb.BGPaletteID & 0x3F)] = val;
fixPaletteTemp = (gb->cgb.BGPalette[(gb->cgb.BGPaletteID & 0x3E) + 1] << 8) + (gb->cgb.BGPalette[(gb->cgb.BGPaletteID & 0x3E)]); // BGR555 fixPaletteTemp = (gb->cgb.BGPalette[(gb->cgb.BGPaletteID & 0x3E) + 1] << 8) + (gb->cgb.BGPalette[(gb->cgb.BGPaletteID & 0x3E)]);
#ifdef USE_BGR565 // BGR555 -> BGR565
gb->cgb.fixPalette[((gb->cgb.BGPaletteID & 0x3E) >> 1)] = ((fixPaletteTemp & 0x7C00) << 1) | ((fixPaletteTemp & 0x03E0) << 1) | (fixPaletteTemp & 0x001F); // swap Red and Blue
#else // RGB565
gb->cgb.fixPalette[((gb->cgb.BGPaletteID & 0x3E) >> 1)] = ((fixPaletteTemp & 0x7C00) >> 10) | ((fixPaletteTemp & 0x03E0) << 1) | ((fixPaletteTemp & 0x001F) << 11); // swap Red and Blue gb->cgb.fixPalette[((gb->cgb.BGPaletteID & 0x3E) >> 1)] = ((fixPaletteTemp & 0x7C00) >> 10) | ((fixPaletteTemp & 0x03E0) << 1) | ((fixPaletteTemp & 0x001F) << 11); // swap Red and Blue
#endif
if(gb->cgb.BGPaletteInc) gb->cgb.BGPaletteID = (++gb->cgb.BGPaletteID) & 0x3F; if(gb->cgb.BGPaletteInc) gb->cgb.BGPaletteID = (++gb->cgb.BGPaletteID) & 0x3F;
return; return;
@@ -1417,8 +1421,11 @@ void __gb_write(struct gb_s *gb, uint_fast16_t addr, uint8_t val)
case 0x6B: case 0x6B:
gb->cgb.OAMPalette[(gb->cgb.OAMPaletteID & 0x3F)] = val; gb->cgb.OAMPalette[(gb->cgb.OAMPaletteID & 0x3F)] = val;
fixPaletteTemp = (gb->cgb.OAMPalette[(gb->cgb.OAMPaletteID & 0x3E) + 1] << 8) + (gb->cgb.OAMPalette[(gb->cgb.OAMPaletteID & 0x3E)]); fixPaletteTemp = (gb->cgb.OAMPalette[(gb->cgb.OAMPaletteID & 0x3E) + 1] << 8) + (gb->cgb.OAMPalette[(gb->cgb.OAMPaletteID & 0x3E)]);
gb->cgb.fixPalette[0x20 + ((gb->cgb.OAMPaletteID & 0x3E) >> 1)] = ((fixPaletteTemp & 0x7C00) >> 10) | ((fixPaletteTemp & 0x03E0) << 1) | ((fixPaletteTemp & 0x001F) << 11); // swap Red and Blue #ifdef USE_BGR565 // BGR555 -> BGR565
gb->cgb.fixPalette[0x20 + ((gb->cgb.OAMPaletteID & 0x3E) >> 1)] = ((fixPaletteTemp & 0x7C00) << 1) | ((fixPaletteTemp & 0x03E0) << 1) | (fixPaletteTemp & 0x001F); // swap Red and Blue
#else // RGB565
if(gb->cgb.OAMPaletteInc) gb->cgb.OAMPaletteID = (++gb->cgb.OAMPaletteID) & 0x3F; if(gb->cgb.OAMPaletteInc) gb->cgb.OAMPaletteID = (++gb->cgb.OAMPaletteID) & 0x3F;
#endif
return; return;
/* CGB WRAM Bank*/ /* CGB WRAM Bank*/