Work around PS3 version save state crash by using heap allocation for soundsnapshot. (danieldematteis)

This commit is contained in:
Brandon Wright 2010-12-25 18:26:28 -06:00
parent 6ada867da9
commit a925747bbd
1 changed files with 4 additions and 2 deletions

View File

@ -1272,6 +1272,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);
@ -1305,7 +1306,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);
@ -1428,6 +1428,8 @@ void S9xFreezeToStream (STREAM stream)
#endif #endif
S9xSetSoundMute(FALSE); S9xSetSoundMute(FALSE);
delete [] soundsnapshot;
} }
int S9xUnfreezeFromStream (STREAM stream) int S9xUnfreezeFromStream (STREAM stream)