Libretro: Reworked Left Border code so it doesn't affect core source

code.
This commit is contained in:
ds22x 2021-02-18 01:28:02 +01:00
parent 03d1482b29
commit 751d8867d4
2 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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)