From: Toni Wilen Date: Mon, 8 Sep 2025 15:20:49 +0000 (+0300) Subject: Do not attempt to autodetect resolution if resolution table is empty. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=28e52e4baf88599bfec9c3aaa5709379bd55566d;p=francis%2Fwinuae.git Do not attempt to autodetect resolution if resolution table is empty. --- diff --git a/drawing.cpp b/drawing.cpp index 7752b1d7..d4cde65b 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -1554,11 +1554,13 @@ static void init_drawing_frame(void) largest_count_res = i; } } - if (currprefs.gfx_resolution == changed_prefs.gfx_resolution && lines_count > 0) { + bool resolution_detected = resolution_count[RES_LORES] || resolution_count[RES_HIRES] || resolution_count[RES_SUPERHIRES]; + + if (currprefs.gfx_resolution == changed_prefs.gfx_resolution && lines_count > 0 && resolution_detected) { detected_screen_resolution = largest_res; } - if (currprefs.gfx_resolution == changed_prefs.gfx_resolution && lines_count > 0) { + if (currprefs.gfx_resolution == changed_prefs.gfx_resolution && lines_count > 0 && resolution_detected) { if (currprefs.gfx_autoresolution_vga && programmedmode == 1 && vidinfo->gfx_resolution_reserved >= RES_HIRES && vidinfo->gfx_vresolution_reserved >= VRES_DOUBLE) { if (largest_res == RES_SUPERHIRES && (vidinfo->gfx_resolution_reserved < RES_SUPERHIRES || vidinfo->gfx_vresolution_reserved < 1)) {