diff --git a/core/vdp_ctrl.c b/core/vdp_ctrl.c index be0f02c..cc40063 100644 --- a/core/vdp_ctrl.c +++ b/core/vdp_ctrl.c @@ -330,12 +330,6 @@ 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; diff --git a/libretro/libretro.c b/libretro/libretro.c index 3908260..c064d3d 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -907,6 +907,12 @@ static void update_overclock(void) } #endif +static void check_sms_border(void) +{ + if (config.left_border && (bitmap.viewport.x == 0) && ((system_hw == SYSTEM_MARKIII) || (system_hw & SYSTEM_SMS) || (system_hw == SYSTEM_PBC))) + bitmap.viewport.x = -8; +} + static void check_variables(void) { unsigned orig_value; @@ -1445,10 +1451,9 @@ 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; + check_sms_border(); } } @@ -2373,7 +2378,7 @@ bool retro_unserialize(const void *data, size_t size) overclock_delay = OVERCLOCK_FRAME_DELAY; update_overclock(); #endif - + check_sms_border(); return TRUE; } @@ -2641,6 +2646,7 @@ bool retro_load_game(const struct retro_game_info *info) audio_init(SOUND_FREQUENCY, 0); system_init(); system_reset(); + check_sms_border(); is_running = false; if (system_hw == SYSTEM_MCD)