Add an option to remove left side border ( Sega Master System)

This commit is contained in:
ds22x 2021-02-17 17:02:36 +01:00
parent 58758aef3d
commit 03d1482b29
3 changed files with 23 additions and 0 deletions

View File

@ -330,6 +330,12 @@ void vdp_reset(void)
bitmap.viewport.x = (config.overscan & 2) ? 14 : -48;
bitmap.viewport.y = (config.overscan & 1) ? (24 * (vdp_pal + 1)) : -24;
}
else if ((system_hw == SYSTEM_SMS || system_hw == SYSTEM_SMS2) && config.left_border)
{
/* Horizontal display area reduced to 240 when hiding the left border */
bitmap.viewport.x = (config.overscan & 2) ? 7 : -8;
bitmap.viewport.y = (config.overscan & 1) * 24 * (vdp_pal + 1);
}
else
{
bitmap.viewport.x = (config.overscan & 2) * 7;

View File

@ -621,6 +621,7 @@ static void config_default(void)
config.ntsc = 0;
config.lcd = 0;
config.render = 0;
config.left_border = 0;
/* input options */
input.system[0] = SYSTEM_GAMEPAD;
@ -1385,6 +1386,18 @@ static void check_variables(void)
config.invert_mouse = 1;
}
var.key = "genesis_plus_gx_left_border";
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var);
{
orig_value = config.left_border;
if (!var.value || !strcmp(var.value, "disabled"))
config.left_border = 0;
else if (var.value && !strcmp(var.value, "enabled"))
config.left_border = 1;
if (orig_value != config.left_border)
update_viewports = true;
}
#ifdef HAVE_OVERCLOCK
var.key = "genesis_plus_gx_overclock";
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var);
@ -1432,6 +1445,8 @@ static void check_variables(void)
bitmap.viewport.changed = 11;
if ((system_hw == SYSTEM_GG) && !config.gg_extra)
bitmap.viewport.x = (config.overscan & 2) ? 14 : -48;
else if ((system_hw == SYSTEM_SMS || system_hw == SYSTEM_SMS2) && config.left_border)
bitmap.viewport.x = (config.overscan & 2) ? 7 : -8;
else
bitmap.viewport.x = (config.overscan & 2) * 7;
}
@ -1996,6 +2011,7 @@ void retro_set_environment(retro_environment_t cb)
{ "genesis_plus_gx_lcd_filter", "LCD Ghosting filter; disabled|enabled" },
{ "genesis_plus_gx_overscan", "Borders; disabled|top/bottom|left/right|full" },
{ "genesis_plus_gx_gg_extra", "Game Gear extended screen; disabled|enabled" },
{ "genesis_plus_gx_left_border", "Hide Master System Left Border; disabled|enabled" },
{ "genesis_plus_gx_aspect_ratio", "Core-provided aspect ratio; auto|NTSC PAR|PAL PAR" },
{ "genesis_plus_gx_render", "Interlaced mode 2 output; single field|double field" },
{ "genesis_plus_gx_gun_cursor", "Show Lightgun crosshair; disabled|enabled" },

View File

@ -123,6 +123,7 @@ typedef struct
uint8 ntsc;
uint8 lcd;
uint8 gg_extra;
uint8 left_border;
uint8 render;
t_input_config input[MAX_INPUTS];
uint8 invert_mouse;