Set aspect ratio
[picodrive.git] / platform / libretro / libretro.c
index 057cd52..10af663 100644 (file)
@@ -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
@@ -358,7 +359,7 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
        info->geometry.base_height  = vout_height;
        info->geometry.max_width    = VOUT_MAX_WIDTH;
        info->geometry.max_height   = VOUT_MAX_HEIGHT;
-       info->geometry.aspect_ratio = 0.0f;
+       info->geometry.aspect_ratio = 4.0f / 3.0f;
 }
 
 /* savestates */
@@ -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";