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.
This commit is contained in:
Stephen Anthony 2018-05-19 22:01:00 -02:30
parent 2fd1cafc2d
commit 02dbbca861
1 changed files with 2 additions and 5 deletions

View File

@ -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;
}