/*
* libretro core glue for PicoDrive
* (C) notaz, 2013
+ * (C) aliaspider, 2016
+ * (C) Daniel De Matteis, 2013
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
static const float VOUT_4_3 = (224.0f * (4.0f / 3.0f));
static const float VOUT_CRT = (224.0f * 1.29911f);
+bool show_overscan = false;
+
static void *vout_buf;
static int vout_width, vout_height, vout_offset;
static float user_vout_width = 0.0;
memset(vout_buf, 0, 320 * 240 * 2);
vout_width = is_32cols ? 256 : 320;
PicoDrawSetOutBuf(vout_buf, vout_width * 2);
+ if (show_overscan == true) line_count += 16;
+ if (show_overscan == true) start_line -= 8;
vout_height = line_count;
vout_offset = vout_width * start_line;
{ "picodrive_region", "Region; Auto|Japan NTSC|Japan PAL|US|Europe" },
{ "picodrive_region_fps", "Region FPS; Auto|NTSC|PAL" },
{ "picodrive_aspect", "Core-provided aspect ratio; PAR|4/3|CRT" },
+ { "picodrive_overscan", "Show Overscan; disabled|enabled" },
#ifdef DRC_SH2
{ "picodrive_drc", "Dynamic recompilers; enabled|disabled" },
#endif
{
memset(info, 0, sizeof(*info));
info->library_name = "PicoDrive";
- info->library_version = VERSION;
+#ifndef GIT_VERSION
+#define GIT_VERSION ""
+#endif
+ info->library_version = VERSION GIT_VERSION;
info->valid_extensions = "bin|gen|smd|md|32x|cue|iso|sms";
info->need_fullpath = true;
}
info->geometry.base_height = vout_height;
info->geometry.max_width = vout_width;
info->geometry.max_height = vout_height;
-
+
float common_width = vout_width;
if (user_vout_width != 0)
common_width = user_vout_width;
-
+
info->geometry.aspect_ratio = common_width / vout_height;
}
return NULL;
}
+static void sram_reset()
+{
+ SRam.data = NULL;
+ SRam.start = 0;
+ SRam.end = 0;
+ SRam.flags = '\0';
+ SRam.unused2 = '\0';
+ SRam.changed = '\0' ;
+ SRam.eeprom_type = '\0';
+ SRam.unused3 = '\0';
+ SRam.eeprom_bit_cl = '\0';
+ SRam.eeprom_bit_in = '\0';
+ SRam.eeprom_bit_out = '\0';
+ SRam.size = 0;
+}
+
bool retro_load_game(const struct retro_game_info *info)
{
enum media_type_e media_type;
{ 0 },
};
+ sram_reset();
+
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) {
if (log_cb)
data = NULL;
break;
}
-
+
return data;
}
{
unsigned int i;
int sum;
-
+
switch(type)
{
case RETRO_MEMORY_SAVE_RAM:
sum |= SRam.data[i];
return (sum != 0) ? SRam.size : 0;
-
+
case RETRO_MEMORY_SYSTEM_RAM:
if (PicoAHW & PAHW_SMS)
return sizeof(Pico.vramb);
else
return sizeof(Pico.ram);
-
+
default:
return 0;
}
-
+
}
void retro_reset(void)
else if (strcmp(var.value, "NTSC") == 0)
PicoRegionFPSOverride = 1;
else if (strcmp(var.value, "PAL") == 0)
- PicoRegionFPSOverride = 2;
+ PicoRegionFPSOverride = 2;
}
// Update region, fps and sound flags if needed
else if (strcmp(var.value, "CRT") == 0)
user_vout_width = VOUT_CRT;
else
- user_vout_width = VOUT_PAR;
+ user_vout_width = VOUT_PAR;
+ }
+
+ var.value = NULL;
+ var.key = "picodrive_overscan";
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
+ if (strcmp(var.value, "enabled") == 0)
+ show_overscan = true;
+ else
+ show_overscan = false;
}
if (user_vout_width != old_user_vout_width)