From e7bdd0c81d80f8f1e8aebe224a15d5b31dc87445 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 4 Apr 2026 12:39:23 +0300 Subject: [PATCH] Enable integer aspect ratio option automatically if config has same horizontal and vertical zoom and size. --- cfgfile.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/cfgfile.cpp b/cfgfile.cpp index 74958063..d56a945f 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -60,6 +60,7 @@ static struct strlist *error_lines; static struct zfile *default_file, *configstore; static int uaeconfig; static int unicode_config = 0; +static bool gfx_keep_aspect_seen; /* @@@ need to get rid of this... just cut part of the manual and print that * as a help text. */ @@ -394,6 +395,20 @@ static const TCHAR *obsolete[] = { #define UNEXPANDED _T("$(FILE_PATH)") +static void fixup_prefs2(struct uae_prefs* p) +{ + // enable integer keep aspect if config has same horizontal and vertical zoom and standard resolution/doubling + if (!gfx_keep_aspect_seen) { + if (p->gf[GF_NORMAL].gfx_filter_horiz_zoom_mult == p->gf[GF_NORMAL].gfx_filter_vert_zoom_mult && + p->gf[GF_NORMAL].gfx_filter_horiz_zoom == p->gf[GF_NORMAL].gfx_filter_vert_zoom && + p->gf[GF_INTERLACE].gfx_filter_horiz_zoom_mult == p->gf[GF_INTERLACE].gfx_filter_vert_zoom_mult && + p->gf[GF_INTERLACE].gfx_filter_horiz_zoom == p->gf[GF_INTERLACE].gfx_filter_vert_zoom && + p->gfx_resolution == RES_HIRES && p->gfx_vresolution == VRES_DOUBLE) { + p->gfx_keep_aspect = true; + } + } +} + static TCHAR *cfgfile_unescape(const TCHAR *s, const TCHAR **endpos, TCHAR separator, bool min) { bool quoted = false; @@ -3704,7 +3719,6 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) || cfgfile_intval (option, value, _T("gfx_center_horizontal_size"), &p->gfx_xcenter_size, 1) || cfgfile_intval (option, value, _T("gfx_center_vertical_size"), &p->gfx_ycenter_size, 1) - || cfgfile_yesno(option, value, _T("gfx_keep_aspect"), &p->gfx_keep_aspect, 1) || cfgfile_intval (option, value, _T("filesys_max_size"), &p->filesys_limit, 1) || cfgfile_intval (option, value, _T("filesys_max_name_length"), &p->filesys_max_name, 1) @@ -3829,6 +3843,10 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; } + if (cfgfile_yesno(option, value, _T("gfx_keep_aspect"), &p->gfx_keep_aspect, 1)) { + gfx_keep_aspect_seen = true; + return 1; + } if (cfgfile_string(option, value, _T("gfx_colour_mode"), tmpbuf, sizeof tmpbuf / sizeof(TCHAR))) { return 1; @@ -7357,6 +7375,7 @@ end: memcpy(&p->gfx_monitor[i], &p->gfx_monitor[0], sizeof(struct monconfig)); } fixup_prefs (p, userconfig != 0); + fixup_prefs2(p); for (int i = 0; i < MAX_JPORTS_CUSTOM; i++) { inputdevice_jportcustom_fixup(p, p->jports_custom[i].custom, i); } @@ -8823,6 +8842,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type) p->lightboost_strobo_ratio = 50; savestate_state = 0; + gfx_keep_aspect_seen = false; target_default_options (p, type); -- 2.47.3