From 8aca40216362e3ea82f1ea8c8b27d38a6cabd17e Mon Sep 17 00:00:00 2001 From: Shaun Inman Date: Mon, 6 Feb 2023 09:03:03 -0500 Subject: [PATCH] need to restore deferred configs on load changed default vsync to strict (primarily for menus) --- src/common/api.c | 2 +- src/minarch/main.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/api.c b/src/common/api.c index facdc3a..686462f 100644 --- a/src/common/api.c +++ b/src/common/api.c @@ -159,7 +159,7 @@ SDL_Surface* GFX_init(int mode) { SDL_ShowCursor(0); TTF_Init(); - gfx.vsync = VSYNC_LENIENT; + gfx.vsync = VSYNC_STRICT; gfx.mode = mode; // we're drawing to the (triple-buffered) framebuffer directly diff --git a/src/minarch/main.c b/src/minarch/main.c index 14b5fd5..48d4fa8 100644 --- a/src/minarch/main.c +++ b/src/minarch/main.c @@ -3208,7 +3208,7 @@ static int Menu_options(MenuList* list) { return 0; } static void Menu_loop(void) { - GFX_setVsync(VSYNC_LENIENT); + GFX_setVsync(VSYNC_STRICT); POW_setCPUSpeed(CPU_SPEED_MENU); // set Hz directly fast_forward = 0; @@ -3669,7 +3669,10 @@ int main(int argc , char* argv[]) { Game_open(rom_path); Core_load(); - Config_read(); // TODO: tmp + // restore configs + Config_read(); + setOverclock(overclock); + GFX_setVsync(prevent_tearing); SND_init(core.sample_rate, core.fps);