mirror of
https://github.com/mkwong98/HDNes.git
synced 2024-05-20 13:07:54 -04:00
Fix loading save state
Undo some of last commit and move save state and load state to the end of frame
This commit is contained in:
parent
1bb335e14c
commit
91141c5bb5
|
@ -68,18 +68,16 @@ void gameManager::start(){
|
|||
ppuCore->resetCycleCount();
|
||||
apuCore->resetCycleCount();
|
||||
mmc->resetCycleCount();
|
||||
if (loadStateFlag) {
|
||||
loadState();
|
||||
}
|
||||
if (saveStateFlag) {
|
||||
saveState();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(pauseFrame != 1 && !vid->waitFrame){
|
||||
cpuCore->runIRQ();
|
||||
|
||||
if (loadStateFlag) {
|
||||
loadState();
|
||||
}
|
||||
if (saveStateFlag) {
|
||||
saveState();
|
||||
}
|
||||
|
||||
}
|
||||
while( SDL_PollEvent( &event ) ){
|
||||
inputCore->handleEvent(event);
|
||||
|
@ -131,11 +129,8 @@ void gameManager::loadState(){
|
|||
mmc->loadState(&statefile);
|
||||
cpuCore->loadState(&statefile);
|
||||
ppuCore->loadState(&statefile);
|
||||
apuCore->loadState(&statefile);
|
||||
vid->init();
|
||||
|
||||
apuCore->loadState(&statefile);
|
||||
statefile.close();
|
||||
|
||||
}
|
||||
loadStateFlag = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue