Skip to content

Commit

Permalink
Add GB Color Correction core option
Browse files Browse the repository at this point in the history
  • Loading branch information
retro-wertz committed Jul 18, 2019
1 parent 02a7a48 commit aac30c7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libretro/libretro.cpp
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions src/libretro/libretro_core_options.h
Expand Up @@ -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",
Expand Down

0 comments on commit aac30c7

Please sign in to comment.