Skip to content

Commit 855ba40

Browse files
committed
libretro: Use Sony CXA2025AS palette from YUV generator
1 parent 0316e95 commit 855ba40

File tree

2 files changed

+12
-27
lines changed

2 files changed

+12
-27
lines changed

libretro/libretro.cpp

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,6 @@ static bool is_pal;
103103
static byte custpal[64*3];
104104
static char slash;
105105

106-
static const byte cxa2025as_palette[64][3] =
107-
{
108-
{0x58,0x58,0x58}, {0x00,0x23,0x8C}, {0x00,0x13,0x9B}, {0x2D,0x05,0x85},
109-
{0x5D,0x00,0x52}, {0x7A,0x00,0x17}, {0x7A,0x08,0x00}, {0x5F,0x18,0x00},
110-
{0x35,0x2A,0x00}, {0x09,0x39,0x00}, {0x00,0x3F,0x00}, {0x00,0x3C,0x22},
111-
{0x00,0x32,0x5D}, {0x00,0x00,0x00}, {0x00,0x00,0x00}, {0x00,0x00,0x00},
112-
{0xA1,0xA1,0xA1}, {0x00,0x53,0xEE}, {0x15,0x3C,0xFE}, {0x60,0x28,0xE4},
113-
{0xA9,0x1D,0x98}, {0xD4,0x1E,0x41}, {0xD2,0x2C,0x00}, {0xAA,0x44,0x00},
114-
{0x6C,0x5E,0x00}, {0x2D,0x73,0x00}, {0x00,0x7D,0x06}, {0x00,0x78,0x52},
115-
{0x00,0x69,0xA9}, {0x00,0x00,0x00}, {0x00,0x00,0x00}, {0x00,0x00,0x00},
116-
{0xFF,0xFF,0xFF}, {0x1F,0xA5,0xFE}, {0x5E,0x89,0xFE}, {0xB5,0x72,0xFE},
117-
{0xFE,0x65,0xF6}, {0xFE,0x67,0x90}, {0xFE,0x77,0x3C}, {0xFE,0x93,0x08},
118-
{0xC4,0xB2,0x00}, {0x79,0xCA,0x10}, {0x3A,0xD5,0x4A}, {0x11,0xD1,0xA4},
119-
{0x06,0xBF,0xFE}, {0x42,0x42,0x42}, {0x00,0x00,0x00}, {0x00,0x00,0x00},
120-
{0xFF,0xFF,0xFF}, {0xA0,0xD9,0xFE}, {0xBD,0xCC,0xFE}, {0xE1,0xC2,0xFE},
121-
{0xFE,0xBC,0xFB}, {0xFE,0xBD,0xD0}, {0xFE,0xC5,0xA9}, {0xFE,0xD1,0x8E},
122-
{0xE9,0xDE,0x86}, {0xC7,0xE9,0x92}, {0xA8,0xEE,0xB0}, {0x95,0xEC,0xD9},
123-
{0x91,0xE4,0xFE}, {0xAC,0xAC,0xAC}, {0x00,0x00,0x00}, {0x00,0x00,0x00}
124-
};
125-
126106
static const byte royaltea_palette[64][3] =
127107
{
128108
{0x5A,0x61,0x65}, {0x00,0x23,0xA8}, {0x0F,0x17,0xB0}, {0x28,0x12,0x9F},
@@ -1179,13 +1159,17 @@ static void check_variables(void)
11791159
video.GetPalette().SetMode(Api::Video::Palette::MODE_YUV);
11801160
video.SetDecoder(Api::Video::DECODER_ALTERNATIVE);
11811161
}
1162+
else if (strcmp(var.value, "cxa2025as") == 0) {
1163+
video.GetPalette().SetMode(Api::Video::Palette::MODE_YUV);
1164+
video.SetDecoder(Api::Video::DECODER_CXA2025AS_US);
1165+
}
1166+
else if (strcmp(var.value, "cxa2025as_jp") == 0) {
1167+
video.GetPalette().SetMode(Api::Video::Palette::MODE_YUV);
1168+
video.SetDecoder(Api::Video::DECODER_CXA2025AS_JP);
1169+
}
11821170
else if (strcmp(var.value, "rgb") == 0) {
11831171
video.GetPalette().SetMode(Api::Video::Palette::MODE_RGB);
11841172
}
1185-
else if (strcmp(var.value, "cxa2025as") == 0) {
1186-
video.GetPalette().SetMode(Api::Video::Palette::MODE_CUSTOM);
1187-
video.GetPalette().SetCustom(cxa2025as_palette, Api::Video::Palette::STD_PALETTE);
1188-
}
11891173
else if (strcmp(var.value, "royaltea") == 0) {
11901174
video.GetPalette().SetMode(Api::Video::Palette::MODE_CUSTOM);
11911175
video.GetPalette().SetCustom(royaltea_palette, Api::Video::Palette::STD_PALETTE);
@@ -1644,7 +1628,7 @@ bool retro_load_game(const struct retro_game_info *info)
16441628
}
16451629
else
16461630
{
1647-
memcpy(custpal, cxa2025as_palette, sizeof(custpal));
1631+
memcpy(custpal, royaltea_palette, sizeof(custpal));
16481632
if (log_cb)
16491633
log_cb(RETRO_LOG_INFO, "custom.pal not found in system directory.\n");
16501634
}

libretro/libretro_core_options.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ struct retro_core_option_v2_definition option_defs_us[] = {
142142
NULL,
143143
"video",
144144
{
145-
{ "cxa2025as", "CXA2025AS" },
145+
{ "cxa2025as", "CXA2025AS (US)" },
146+
{ "cxa2025as_jp", "CXA2025AS (JP)" },
146147
{ "royaltea", "Royaltea" },
147148
{ "consumer", "Consumer" },
148149
{ "canonical", "Canonical" },
@@ -157,7 +158,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
157158
{ "custom", "Custom" },
158159
{ NULL, NULL },
159160
},
160-
"cxa2025as" /* TODO/FIXME - is this correct ? */
161+
"cxa2025as"
161162
},
162163
{
163164
"nestopia_overscan_v_top",

0 commit comments

Comments
 (0)