Skip to content
12 changes: 12 additions & 0 deletions libretro/libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ struct retro_perf_callback perf_cb;
int dynarec_enable;
boot_mode selected_boot_mode = boot_game;
int sprite_limit = 1;
int oam_hijacking_enabled = 0; // Default to disabled

static int rtc_mode = FEAT_AUTODETECT;
static int rumble_mode = FEAT_AUTODETECT;
Expand Down Expand Up @@ -918,6 +919,17 @@ static void check_variables(bool started_from_load)
sprite_limit = 0;
}

var.key = "gpsp_oam_hijack";
var.value = 0;

if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "disabled") == 0)
oam_hijacking_enabled = 0;
else if (strcmp(var.value, "enabled") == 0)
oam_hijacking_enabled = 1;
}

var.key = "gpsp_frameskip";
var.value = 0;
frameskip_type_prev = current_frameskip_type;
Expand Down
11 changes: 11 additions & 0 deletions libretro/libretro_core_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ struct retro_core_option_definition option_defs_us[] = {
},
"disabled"
},
{
"gpsp_oam_hijack",
"OAM Priority Hijacking",
"Support for OAM priority hijacking behavior where objects relative BG priority does not follow the normal OAM order priority. The GBA has a transparency bug in these situations which is used by some games (Golden Sun, Golden Sun 2, Zelda: Minish Cap, Mario Golf etc), this option emulates that bug.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"gpsp_rtc",
"RTC support",
Expand Down
Loading