This new core option will override the Region option.
So it's possible to choose the Europe Region and the NTSC FPS.
Strangely the region protection has no effect on megadrive :-)
But will happend on 32x and SegaCD (Maybe it can be fixed by activating
this core option after a little delay on startup)
\r
struct Pico Pico;\r
int PicoOpt; \r
-int PicoSkipFrame; // skip rendering frame?\r
-int PicoPad[2]; // Joypads, format is MXYZ SACB RLDU\r
-int PicoPadInt[2]; // internal copy\r
-int PicoAHW; // active addon hardware: PAHW_*\r
-int PicoQuirks; // game-specific quirks\r
-int PicoRegionOverride; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
+int PicoSkipFrame; // skip rendering frame?\r
+int PicoPad[2]; // Joypads, format is MXYZ SACB RLDU\r
+int PicoPadInt[2]; // internal copy\r
+int PicoAHW; // active addon hardware: PAHW_*\r
+int PicoQuirks; // game-specific quirks\r
+int PicoRegionOverride; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
+int PicoRegionFPSOverride; // override the refresh rate of the region 0: Auto, 1: NTSC, 2: PAL\r
int PicoAutoRgnOrder;\r
\r
struct PicoSRAM SRam;\r
\r
PICO_INTERNAL void PicoDetectRegion(void)\r
{\r
+ // PicoDetectRegion not ready yet\r
+ if (Pico.romsize <= 0)\r
+ return;\r
+\r
int support=0, hw=0, i;\r
unsigned char pal=0;\r
\r
else hw=0x80; // USA\r
\r
Pico.m.hardware=(unsigned char)(hw|0x20); // No disk attached\r
+\r
+ if (PicoRegionFPSOverride > 0)\r
+ pal = PicoRegionFPSOverride - 1; // pal - 0: NTSC, 1: PAL | PicoRegionFPSOverride - 0: Auto, 1: NTSC, 2: PAL\r
+ \r
Pico.m.pal=pal;\r
}\r
\r
// flush config changes before emu loop starts\r
void PicoLoopPrepare(void)\r
{\r
- if (PicoRegionOverride)\r
+ if (PicoRegionFPSOverride) // PicoRegionFPSOverride is proprietary on PicoRegionOverride\r
+ {\r
+ // force setting possibly changed..\r
+ Pico.m.pal = PicoRegionFPSOverride - 1; // Pico.m.pal - 0: NTSC, 1: PAL | PicoRegionFPSOverride - 0: Auto, 1: NTSC, 2: PAL\r
+ }\r
+ else if (PicoRegionOverride)\r
+ {\r
// force setting possibly changed..\r
Pico.m.pal = (PicoRegionOverride == 2 || PicoRegionOverride == 8) ? 1 : 0;\r
+ }\r
\r
// FIXME: PAL has 313 scanlines..\r
scanlines_total = Pico.m.pal ? 312 : 262;\r
#define PQUIRK_FORCE_6BTN (1<<0)\r
extern int PicoQuirks;\r
\r
-extern int PicoSkipFrame; // skip rendering frame, but still do sound (if enabled) and emulation stuff\r
-extern int PicoRegionOverride; // override the region detection 0: auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
-extern int PicoAutoRgnOrder; // packed priority list of regions, for example 0x148 means this detection order: EUR, USA, JAP\r
+extern int PicoSkipFrame; // skip rendering frame, but still do sound (if enabled) and emulation stuff\r
+extern int PicoRegionOverride; // override the region detection 0: auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
+extern int PicoRegionFPSOverride; // override the refresh rate of the region 0: Auto, 1: NTSC, 2: PAL\r
+extern int PicoAutoRgnOrder; // packed priority list of regions, for example 0x148 means this detection order: EUR, USA, JAP\r
extern int PicoSVPCycles;\r
void PicoInit(void);\r
void PicoExit(void);\r
// to be called after changing sound rate or chips\r
void PsndRerate(int preserve_state)\r
{\r
+ // PsndRerate not ready yet\r
+ if (Pico.romsize <= 0)\r
+ return;\r
+\r
void *state = NULL;\r
int target_fps = Pico.m.pal ? 50 : 60;\r
\r
void retro_set_environment(retro_environment_t cb)
{
static const struct retro_variable vars[] = {
- //{ "region", "Region; Auto|NTSC|PAL" },
- { "picodrive_input1", "Input device 1; 3 button pad|6 button pad|None" },
- { "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" },
+ { "picodrive_input1", "Input device 1; 3 button pad|6 button pad|None" },
+ { "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" },
+ { "picodrive_region_fps", "Region FPS; Auto|NTSC|PAL"},
#ifdef DRC_SH2
{ "picodrive_drc", "Dynamic recompilers; enabled|disabled" },
#endif
PicoOpt &= ~POPT_EN_MCD_RAMCART;
}
+ int OldPicoRegionOverride = PicoRegionOverride;
var.value = NULL;
var.key = "picodrive_region";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
PicoRegionOverride = 8;
}
+ int OldPicoRegionFPSOverride = PicoRegionFPSOverride;
+ var.value = NULL;
+ var.key = "picodrive_region_fps";
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
+ if (strcmp(var.value, "Auto") == 0)
+ PicoRegionFPSOverride = 0;
+ else if (strcmp(var.value, "NTSC") == 0)
+ PicoRegionFPSOverride = 1;
+ else if (strcmp(var.value, "PAL") == 0)
+ PicoRegionFPSOverride = 2;
+ }
+
+ // Update region, fps and sound flags if needed
+ if (PicoRegionOverride != OldPicoRegionOverride ||
+ PicoRegionFPSOverride != OldPicoRegionFPSOverride)
+ {
+ PicoDetectRegion();
+ PicoLoopPrepare();
+ PsndRerate(1);
+ }
+
#ifdef DRC_SH2
var.value = NULL;
var.key = "picodrive_drc";