Add core option "Use NTSC" for default palette
This commit is contained in:
@@ -197,7 +197,8 @@ FILE *FCEUD_UTF8fopen(const char *n, const char *m)
|
||||
|
||||
/*palette for FCEU*/
|
||||
#define MAXPAL 17 /* raw palette # */
|
||||
int external_palette_exist = 0;
|
||||
static int use_ntsc = 0;
|
||||
static int external_palette_exist = 0;
|
||||
|
||||
struct st_palettes {
|
||||
char name[32];
|
||||
@@ -532,6 +533,7 @@ void retro_set_environment(retro_environment_t cb)
|
||||
{
|
||||
static const struct retro_variable vars[] = {
|
||||
{ "fceumm_palette", "Color Palette; default|asqrealc|nintendo-vc|rgb|yuv-v3|unsaturated-final|sony-cxa2025as-us|pal|bmf-final2|bmf-final3|smooth-fbx|composite-direct-fbx|pvm-style-d93-fbx|ntsc-hardware-fbx|nes-classic-fbx-fs|nescap|wavebeam|raw|custom" },
|
||||
{ "fceumm_use_ntsc", "Use NTSC Palette; disabled|enabled" },
|
||||
{ "fceumm_nospritelimit", "No Sprite Limit; disabled|enabled" },
|
||||
{ "fceumm_overclocking", "Overclocking; disabled|2x-Postrender|2x-VBlank" },
|
||||
#ifdef PSP
|
||||
@@ -608,11 +610,12 @@ void retro_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void retro_set_custom_palette (void)
|
||||
static void retro_set_custom_palette(void)
|
||||
{
|
||||
uint8_t i,r,g,b;
|
||||
|
||||
ipalette = 0;
|
||||
ntsccol = 0;
|
||||
use_raw_palette = false;
|
||||
|
||||
if (current_palette == 0 || current_palette > MAXPAL || (GameInfo->type == GIT_VSUNI))
|
||||
@@ -631,6 +634,9 @@ static void retro_set_custom_palette (void)
|
||||
if (GameInfo->type == GIT_VSUNI)
|
||||
FCEU_PrintError("Cannot use custom palette with VS. System.\n");
|
||||
|
||||
if (current_palette == 0 && use_ntsc)
|
||||
ntsccol = 1;
|
||||
|
||||
FCEU_ResetPalette(); /* Do palette reset*/
|
||||
return;
|
||||
}
|
||||
@@ -799,6 +805,14 @@ static void check_variables(bool startup)
|
||||
retro_set_custom_palette();
|
||||
}
|
||||
|
||||
var.key = "fceumm_use_ntsc";
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
use_ntsc = (!strcmp(var.value, "enabled")) ? 1 : 0;
|
||||
retro_set_custom_palette();
|
||||
}
|
||||
|
||||
var.key = "fceumm_nospritelimit";
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
|
||||
Reference in New Issue
Block a user