fix spu loadstate crashes

This commit is contained in:
zeromus 2010-04-09 20:34:03 +00:00
parent a477807219
commit 1b8973649f
1 changed files with 12 additions and 6 deletions

View File

@ -250,15 +250,19 @@ void SPU_Reset(void)
int i;
SPU_core->reset();
if(SPU_user) SPU_user->reset();
if(SNDCore && SPU_user) {
SNDCore->DeInit();
SNDCore->Init(SPU_user->bufsize*2);
SNDCore->SetVolume(volume);
//todo - check success?
if(SPU_user) {
if(SNDCore)
{
SNDCore->DeInit();
SNDCore->Init(SPU_user->bufsize*2);
SNDCore->SetVolume(volume);
}
SPU_user->reset();
}
//zero - 09-apr-2010: this concerns me, regarding savestate synch.
//After 0.9.6, lets experiment with removing it and just properly zapping the spu instead
// Reset Registers
for (i = 0x400; i < 0x51D; i++)
T1WriteByte(MMU.ARM7_REG, i, 0);
@ -275,6 +279,8 @@ void SPU_struct::reset()
memset((void *)channels, 0, sizeof(channel_struct) * 16);
reconstruct(&regs);
for(int i = 0; i < 16; i++)
{
channels[i].num = i;