From 2259a37e1ff83756a8b9143663d45401c8532ab5 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Thu, 7 May 2026 19:40:03 +0300 Subject: [PATCH] Update RTG variables even if current mode is not yet RTG (ModeInfo_PixelClock needs gfx_refreshrate) --- od-win32/picasso96_win.cpp | 7 ++++--- od-win32/win32gfx.cpp | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index 6e257df9..9689556f 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -2201,8 +2201,9 @@ static void FillBoardInfo(TrapContext *ctx, uaecptr amigamemptr, struct LibResol trap_put_byte(ctx, amigamemptr + PSSO_ModeInfo_first_union, 98); trap_put_byte(ctx, amigamemptr + PSSO_ModeInfo_second_union, 14); + int freq = currprefs.gfx_apmode[GF_RTG].gfx_refreshrate; trap_put_long(ctx, amigamemptr + PSSO_ModeInfo_PixelClock, - width * height * (currprefs.gfx_apmode[1].gfx_refreshrate ? abs (currprefs.gfx_apmode[1].gfx_refreshrate) : default_freq)); + width * height * (freq ? abs(freq) : default_freq)); } struct modeids { @@ -2431,8 +2432,8 @@ static int p96depth (int depth) static int _cdecl resolution_compare (const void *a, const void *b) { - struct PicassoResolution *ma = (struct PicassoResolution *)a; - struct PicassoResolution *mb = (struct PicassoResolution *)b; + struct PicassoResolution *ma = (struct PicassoResolution*)a; + struct PicassoResolution *mb = (struct PicassoResolution*)b; if (ma->res.width < mb->res.width) return -1; if (ma->res.width > mb->res.width) diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 4a196fa3..bcc9c8bf 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1740,7 +1740,20 @@ static void update_gfxparams(struct AmigaMonitor *mon) struct picasso96_state_struct *state = &picasso96_state[mon->monitor_id]; updatewinfsmode(mon->monitor_id, &currprefs); + #ifdef PICASSO96 + + if (currprefs.win32_rtgvblankrate == 0) { + currprefs.gfx_apmode[1].gfx_refreshrate = currprefs.gfx_apmode[0].gfx_refreshrate; + if (currprefs.gfx_apmode[0].gfx_interlaced) { + currprefs.gfx_apmode[1].gfx_refreshrate *= 2; + } + } else if (currprefs.win32_rtgvblankrate < 0) { + currprefs.gfx_apmode[1].gfx_refreshrate = 0; + } else { + currprefs.gfx_apmode[1].gfx_refreshrate = currprefs.win32_rtgvblankrate; + } + if (mon->screen_is_picasso) { float mx = 1.0; float my = 1.0; @@ -1753,16 +1766,6 @@ static void update_gfxparams(struct AmigaMonitor *mon) mon->currentmode.current_width = (int)(state->Width * currprefs.rtg_horiz_zoom_mult * mx); mon->currentmode.current_height = (int)(state->Height * currprefs.rtg_vert_zoom_mult * my); currprefs.gfx_apmode[1].gfx_interlaced = false; - if (currprefs.win32_rtgvblankrate == 0) { - currprefs.gfx_apmode[1].gfx_refreshrate = currprefs.gfx_apmode[0].gfx_refreshrate; - if (currprefs.gfx_apmode[0].gfx_interlaced) { - currprefs.gfx_apmode[1].gfx_refreshrate *= 2; - } - } else if (currprefs.win32_rtgvblankrate < 0) { - currprefs.gfx_apmode[1].gfx_refreshrate = 0; - } else { - currprefs.gfx_apmode[1].gfx_refreshrate = currprefs.win32_rtgvblankrate; - } } else { #endif mon->currentmode.current_width = currprefs.gfx_monitor[mon->monitor_id].gfx_size.width; -- 2.47.3