From ec85ab7d6e302eb5dac5d067c241285bf1f60e9c Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Tue, 23 Feb 2010 20:45:08 +0200 Subject: [PATCH] p96refresh fix --- custom.cpp | 12 +++++++++--- od-win32/ahidsound_dsonly.cpp | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/custom.cpp b/custom.cpp index 7fa2fa6c..8501d19f 100644 --- a/custom.cpp +++ b/custom.cpp @@ -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) { diff --git a/od-win32/ahidsound_dsonly.cpp b/od-win32/ahidsound_dsonly.cpp index 7e1f9ed9..545dd7de 100644 --- a/od-win32/ahidsound_dsonly.cpp +++ b/od-win32/ahidsound_dsonly.cpp @@ -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; -- 2.47.3