]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Update RTG variables even if current mode is not yet RTG (ModeInfo_PixelClock needs...
authorToni Wilen <twilen@winuae.net>
Thu, 7 May 2026 16:40:03 +0000 (19:40 +0300)
committerToni Wilen <twilen@winuae.net>
Thu, 7 May 2026 16:40:03 +0000 (19:40 +0300)
od-win32/picasso96_win.cpp
od-win32/win32gfx.cpp

index 6e257df9e51636032bb26a44d1ff55b0cefb47f3..9689556f2e2f096a64bbf7bc1379c54465988ad7 100644 (file)
@@ -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)
index 4a196fa32c0e12a0abda7f35edb8a47d0de4c754..bcc9c8bfa499182994b71928a4444ed2f7e9dac1 100644 (file)
@@ -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;