From 3425a234ddae0e60c1cbf134a507ff185f104d0c Mon Sep 17 00:00:00 2001 From: retrotalker <42415066+retrotalker@users.noreply.github.com> Date: Wed, 15 Aug 2018 12:08:57 -0500 Subject: [PATCH] Console region option auto, ntsc, pal --- libretro/libretro.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 7f4b0171..225ae5a1 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -191,6 +191,7 @@ void retro_set_environment(retro_environment_t cb) { "snes9x_sndchan_8", "Enable sound channel 8; enabled|disabled" }, { "snes9x_overscan", "Crop overscan; enabled|disabled|auto" }, { "snes9x_aspect", "Preferred aspect ratio; 4:3|8:7|auto|ntsc|pal" }, + { "snes9x_region", "Console region (Reload core); auto|ntsc|pal" }, { NULL, NULL }, }; @@ -406,6 +407,27 @@ static void update_variables(void) } } + var.key = "snes9x_region"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (!strcmp(var.value, "auto")) + { + Settings.ForceNTSC = false; + Settings.ForcePAL = false; + } + else if (!strcmp(var.value, "ntsc")) + { + Settings.ForceNTSC = true; + Settings.ForcePAL = false; + } + else if (!strcmp(var.value, "pal")) + { + Settings.ForceNTSC = false; + Settings.ForcePAL = true; + } + } + if (geometry_update) update_geometry(); }