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 b8bdd151a2
commit 6b2eac9b49

View File

@ -1255,6 +1255,7 @@ bool8 S9xUnfreezeGame (const char *filename)
void S9xFreezeToStream (STREAM stream)
{
char buffer[1024];
uint8 *soundsnapshot = new uint8[SPC_SAVE_STATE_BLOCK_SIZE];
S9xSetSoundMute(TRUE);
@ -1288,7 +1289,6 @@ void S9xFreezeToStream (STREAM stream)
FreezeBlock (stream, "FIL", Memory.FillRAM, 0x8000);
uint8 soundsnapshot[SPC_SAVE_STATE_BLOCK_SIZE];
S9xAPUSaveState(soundsnapshot);
FreezeBlock (stream, "SND", soundsnapshot, SPC_SAVE_STATE_BLOCK_SIZE);
@ -1411,6 +1411,8 @@ void S9xFreezeToStream (STREAM stream)
#endif
S9xSetSoundMute(FALSE);
delete [] soundsnapshot;
}
int S9xUnfreezeFromStream (STREAM stream)
@ -2143,7 +2145,7 @@ static void UnfreezeStructFromCopy (void *sbase, FreezeData *fields, int num_fie
case 1:
if (fields[i].offset < 0)
{
ptr++;
ptr++;
break;
}