From: Oggom Date: Mon, 23 Mar 2015 16:46:02 +0000 (+0100) Subject: (libretro) Implement region switch X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b38bccea1210febbe0ee8df051481e0098ce7681;p=picodrive.git (libretro) Implement region switch --- diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 057cd525..0cada6bd 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -314,6 +314,7 @@ void retro_set_environment(retro_environment_t cb) { "picodrive_input2", "Input device 2; 3 button pad|6 button pad|None" }, { "picodrive_sprlim", "No sprite limit; disabled|enabled" }, { "picodrive_ramcart", "MegaCD RAM cart; disabled|enabled" }, + { "picodrive_region", "Region; Auto|Japan NTSC|Japan PAL|US|Europe" }, #ifdef DRC_SH2 { "picodrive_drc", "Dynamic recompilers; enabled|disabled" }, #endif @@ -975,6 +976,21 @@ static void update_variables(void) PicoOpt &= ~POPT_EN_MCD_RAMCART; } + var.value = NULL; + var.key = "picodrive_region"; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + if (strcmp(var.value, "Auto") == 0) + PicoRegionOverride = 0; + else if (strcmp(var.value, "Japan NTSC") == 0) + PicoRegionOverride = 1; + else if (strcmp(var.value, "Japan PAL") == 0) + PicoRegionOverride = 2; + else if (strcmp(var.value, "US") == 0) + PicoRegionOverride = 4; + else if (strcmp(var.value, "Europe") == 0) + PicoRegionOverride = 8; + } + #ifdef DRC_SH2 var.value = NULL; var.key = "picodrive_drc";