]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
p96refresh fix
authorToni Wilen <twilen@winuae.net>
Tue, 23 Feb 2010 18:45:08 +0000 (20:45 +0200)
committerToni Wilen <twilen@winuae.net>
Tue, 23 Feb 2010 18:45:08 +0000 (20:45 +0200)
custom.cpp
od-win32/ahidsound_dsonly.cpp

index 7fa2fa6cf9b739b2879b3baddc2f2c5925d71a91..8501d19fae3d1bfcb39fc96dd971a2b8eb13eeaa 100644 (file)
@@ -183,6 +183,7 @@ frame_time_t syncbase;
 static int fmode;
 uae_u16 beamcon0, new_beamcon0;
 uae_u16 vtotal = MAXVPOS_PAL, htotal = MAXHPOS_PAL;
+static int maxvpos_stored, maxhpos_stored, vblank_hz_stored;
 static uae_u16 hsstop, hbstrt, hbstop, vsstop, vbstrt, vbstop, hsstrt, vsstrt, hcenter;
 static int ciavsyncmode;
 static int diw_hstrt, diw_hstop;
@@ -2790,8 +2791,13 @@ void init_hz (void)
                changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = abs (currprefs.gfx_refreshrate);
        }
        maxvpos_total = (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? 2047 : 511;
-       if (maxvpos > MAXVPOS)
-               maxvpos = MAXVPOS;
+       if (maxvpos_total > MAXVPOS)
+               maxvpos_total = MAXVPOS;
+       if (!p96refresh_active) {
+               maxvpos_stored = maxvpos;
+               maxhpos_stored = maxhpos;
+               vblank_hz_stored = vblank_hz;
+       }
 
        compute_vsynctime ();
 #ifdef PICASSO96
@@ -3492,7 +3498,7 @@ void set_picasso_hack_rate (int hz)
        if (!picasso_on)
                return;
        vpos_count = 0;
-       p96refresh_active = hz * 2 * maxvpos / (currprefs.ntscmode ? 60 : 50);
+       p96refresh_active = maxvpos_stored * vblank_hz_stored / hz;
        if (!currprefs.cs_ciaatod)
                changed_prefs.cs_ciaatod = currprefs.cs_ciaatod = currprefs.ntscmode ? 2 : 1;
        if (p96refresh_active > 0) {
index 7e1f9ed91abc38d5268879e8576e713be152e593..545dd7de1a462db3964e457d9015c4f962c05b57 100644 (file)
@@ -614,7 +614,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
 
        case 13: /* HACK */
                { //for higher P96 mouse draw rate
-                       set_picasso_hack_rate (m68k_dreg (regs, 1));
+                       set_picasso_hack_rate (m68k_dreg (regs, 1) * 2);
                } //end for higher P96 mouse draw rate
                return 0;