restore savestate error recovery functionality. This should have the side effect of guaranteeing that ( SF [ 2040761 ] Wrong savestate bug - crashes FCEUX) is resolved.
[[Split portion of a mixed commit.]]
This commit is contained in:
parent
f6cb29ca1c
commit
ddae078b3a
|
@ -1,5 +1,6 @@
|
||||||
---version 2.0.2 released---
|
---version 2.0.2 released---
|
||||||
|
|
||||||
|
14-aug-2008 - zeromus - restore savestate error recovery functionality. This should have the side effect of guaranteeing that ( SF [ 2040761 ] Wrong savestate bug - crashes FCEUX) is resolved.
|
||||||
14-aug-2008 - zeromus - SF [ 2047001 ] Low speeds crash FCEUX
|
14-aug-2008 - zeromus - SF [ 2047001 ] Low speeds crash FCEUX
|
||||||
14-aug-2008 - zeromus - SF [ 2050371 ] FCM>FM2 converter should release file handle
|
14-aug-2008 - zeromus - SF [ 2050371 ] FCM>FM2 converter should release file handle
|
||||||
13-aug-2008 - zeromus - restore ungzipping (and unzipping in sdl) capability which was lost when archive support was added
|
13-aug-2008 - zeromus - restore ungzipping (and unzipping in sdl) capability which was lost when archive support was added
|
||||||
|
|
|
@ -548,6 +548,12 @@ int FCEUSS_LoadFP_old(std::istream* is, ENUM_SSLOADPARAMS params)
|
||||||
|
|
||||||
bool FCEUSS_LoadFP(std::istream* is, ENUM_SSLOADPARAMS params)
|
bool FCEUSS_LoadFP(std::istream* is, ENUM_SSLOADPARAMS params)
|
||||||
{
|
{
|
||||||
|
//maybe make a backup savestate
|
||||||
|
memorystream msBackupSavestate;
|
||||||
|
bool backup = (params == SSLOADPARAM_BACKUP);
|
||||||
|
if(backup)
|
||||||
|
FCEUSS_SaveMS(&msBackupSavestate,Z_NO_COMPRESSION);
|
||||||
|
|
||||||
uint8 header[16];
|
uint8 header[16];
|
||||||
|
|
||||||
//read and analyze the header
|
//read and analyze the header
|
||||||
|
@ -558,6 +564,7 @@ bool FCEUSS_LoadFP(std::istream* is, ENUM_SSLOADPARAMS params)
|
||||||
FCEU_state_loading_old_format = true;
|
FCEU_state_loading_old_format = true;
|
||||||
bool ret = FCEUSS_LoadFP_old(is,params)!=0;
|
bool ret = FCEUSS_LoadFP_old(is,params)!=0;
|
||||||
FCEU_state_loading_old_format = false;
|
FCEU_state_loading_old_format = false;
|
||||||
|
if(!ret && backup) FCEUSS_LoadFP(&msBackupSavestate,SSLOADPARAM_NOBACKUP);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -578,6 +585,7 @@ bool FCEUSS_LoadFP(std::istream* is, ENUM_SSLOADPARAMS params)
|
||||||
int error = uncompress((uint8*)&buf[0],&uncomprlen,(uint8*)&cbuf[0],comprlen);
|
int error = uncompress((uint8*)&buf[0],&uncomprlen,(uint8*)&cbuf[0],comprlen);
|
||||||
if(error != Z_OK || uncomprlen != totalsize)
|
if(error != Z_OK || uncomprlen != totalsize)
|
||||||
return false;
|
return false;
|
||||||
|
//we dont need to restore the backup here because we havent messed with the emulator state yet
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -604,6 +612,8 @@ bool FCEUSS_LoadFP(std::istream* is, ENUM_SSLOADPARAMS params)
|
||||||
x=FCEUMOV_PostLoad();
|
x=FCEUMOV_PostLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!x && backup) FCEUSS_LoadFP(&msBackupSavestate,SSLOADPARAM_NOBACKUP);
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue