Skip to content
Permalink
Browse files

Add GB Color Correction core option

  • Loading branch information
retro-wertz
retro-wertz committed Jul 18, 2019
1 parent 02a7a48 commit aac30c72d3cf01cc495053a1101aa00ec266e454
Showing with 25 additions and 0 deletions.
  1. +14 −0 src/libretro/libretro.cpp
  2. +11 −0 src/libretro/libretro_core_options.h
@@ -187,6 +187,11 @@ static void set_gbPalette(void)
gbPalette[i] = pal[i];
}

static void set_gbColorCorrection(int value)
{
gbColorOption = value;
}

extern int gbRomType; // gets type from header 0x147
extern int gbBattery; // enabled when gbRamSize != 0

@@ -1194,6 +1199,15 @@ static void update_variables(bool startup)
if (lastpal != current_gbPalette)
set_gbPalette();
}

var.key = "vbam_gbcoloroption";
var.value = NULL;

if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
int val = (!strcmp(var.value, "enabled")) ? 1 : 0;
set_gbColorCorrection(val);
}
}

// System analog stick range is -0x7fff to 0x7fff
@@ -145,6 +145,17 @@ struct retro_core_option_definition option_defs_us[] = {
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Color Correction",
"Applies color correction which fixes colors in some games games.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_turboenable",
"Enable Turbo Buttons",

0 comments on commit aac30c7

Please sign in to comment.
You can’t perform that action at this time.