mirror of https://github.com/snes9xgit/snes9x.git
Work around PS3 version save state crash by using heap allocation for soundsnapshot. (danieldematteis)
This commit is contained in:
parent
b8bdd151a2
commit
6b2eac9b49
|
@ -1255,6 +1255,7 @@ bool8 S9xUnfreezeGame (const char *filename)
|
||||||
void S9xFreezeToStream (STREAM stream)
|
void S9xFreezeToStream (STREAM stream)
|
||||||
{
|
{
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
|
uint8 *soundsnapshot = new uint8[SPC_SAVE_STATE_BLOCK_SIZE];
|
||||||
|
|
||||||
S9xSetSoundMute(TRUE);
|
S9xSetSoundMute(TRUE);
|
||||||
|
|
||||||
|
@ -1288,7 +1289,6 @@ void S9xFreezeToStream (STREAM stream)
|
||||||
|
|
||||||
FreezeBlock (stream, "FIL", Memory.FillRAM, 0x8000);
|
FreezeBlock (stream, "FIL", Memory.FillRAM, 0x8000);
|
||||||
|
|
||||||
uint8 soundsnapshot[SPC_SAVE_STATE_BLOCK_SIZE];
|
|
||||||
S9xAPUSaveState(soundsnapshot);
|
S9xAPUSaveState(soundsnapshot);
|
||||||
FreezeBlock (stream, "SND", soundsnapshot, SPC_SAVE_STATE_BLOCK_SIZE);
|
FreezeBlock (stream, "SND", soundsnapshot, SPC_SAVE_STATE_BLOCK_SIZE);
|
||||||
|
|
||||||
|
@ -1411,6 +1411,8 @@ void S9xFreezeToStream (STREAM stream)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
S9xSetSoundMute(FALSE);
|
S9xSetSoundMute(FALSE);
|
||||||
|
|
||||||
|
delete [] soundsnapshot;
|
||||||
}
|
}
|
||||||
|
|
||||||
int S9xUnfreezeFromStream (STREAM stream)
|
int S9xUnfreezeFromStream (STREAM stream)
|
||||||
|
|
Loading…
Reference in New Issue