From 02dbbca861e4f0fc32b9c83158d80f7cd81adce5 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 19 May 2018 22:01:00 -0230 Subject: [PATCH] Fixed bug with autodetecting SaveKey controller. - The cycles were being reset to the current system cycles, when in the old code they were not being updated at all (other than being normalized when the old system cycles could be running backwards). - This change restores behaviour to that in 5.0.2. --- src/emucore/MT24LC256.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/emucore/MT24LC256.cxx b/src/emucore/MT24LC256.cxx index 80fe2f4e3..6c3ba58db 100644 --- a/src/emucore/MT24LC256.cxx +++ b/src/emucore/MT24LC256.cxx @@ -149,9 +149,6 @@ void MT24LC256::update() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void MT24LC256::systemReset() { - myCyclesWhenSDASet = myCyclesWhenSCLSet = myCyclesWhenTimerSet = - mySystem.cycles(); - memset(myPageHit, false, sizeof(myPageHit)); } @@ -399,8 +396,8 @@ bool MT24LC256::jpee_timercheck(int mode) { if(myTimerActive) { - uInt32 elapsed = uInt32(mySystem.cycles() - myCyclesWhenTimerSet); - myTimerActive = elapsed < uInt32(5000000.0 / 838.0); + uInt64 elapsed = mySystem.cycles() - myCyclesWhenTimerSet; + myTimerActive = elapsed < uInt64(5000000.0 / 838.0); } return myTimerActive; }