Fixed RSYNC bug.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2627 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-02-24 02:06:34 +00:00
parent 0650c48977
commit 079cc3c8f1
1 changed files with 1 additions and 8 deletions

View File

@ -1219,18 +1219,11 @@ inline void TIA::waitHorizontalRSync()
// Since the horizontal sync counter counts once every 4 pixels, one more CPU
// cycle occurs before the counter warps around to zero. Therefore the positioning
// code will hit RESPx one cycle sooner after a RSYNC than after a WSYNC.
//
// Essentially, HBLANK is completed after HBLANK/3 cycles have elapsed, after
// which point objects moved with RSYNC trail those moved with WSYNC by
// 3 pixels (or 1 cycle)
uInt32 cyclesToEndOfLine = 76 - ((mySystem->cycles() -
(myClockWhenFrameStarted / 3)) % 76);
if((cyclesToEndOfLine > HBLANK/3) && (cyclesToEndOfLine < 76))
mySystem->incrementCycles(cyclesToEndOfLine - 1);
else
mySystem->incrementCycles(cyclesToEndOfLine);
mySystem->incrementCycles(cyclesToEndOfLine-1);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -