From ab4e68da8c9a2486ecf2c7fc232b5442d4a6d990 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 24 Sep 2011 23:37:56 +0000 Subject: [PATCH] newppu-fix bug in scroll reg logic causing mis-scrolls in p'radikus conflict --- src/ppu.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ppu.cpp b/src/ppu.cpp index 8f8bafef..b0094088 100644 --- a/src/ppu.cpp +++ b/src/ppu.cpp @@ -207,11 +207,15 @@ struct PPUREGS { void increment_vs() { fv++; - vt += (fv>>3); + int fv_overflow = (fv >> 3); + vt += fv_overflow; vt &= 31; //fixed tecmo super bowl - v += (vt==30)?1:0; + if(vt == 30 && fv_overflow==1) //caution here (only do it at the exact instant of overflow) fixes p'radikus conflict + { + v++; + vt=0; + } fv &= 7; - if(vt==30) vt=0; v &= 1; }