From 28e52e4baf88599bfec9c3aaa5709379bd55566d Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 8 Sep 2025 18:20:49 +0300 Subject: [PATCH] Do not attempt to autodetect resolution if resolution table is empty. --- drawing.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)) { -- 2.47.3