From baf82a0849fb420c9e84af0ba46294497f0123d0 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Thu, 2 Sep 2010 01:36:45 +0000 Subject: [PATCH] hackfix dsp reset: fixes zelda collector's edition and some other games which reset and hang (...are there any others?) the problem was that the streaming audio interrupts were still being triggered, causing the game to try and jump to an invalid interrupt handler. The code for dsp lle looks like a hack :( (but it works) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6163 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/DSP.cpp | 7 +++++++ Source/Core/DSPCore/Src/DSPInterpreter.cpp | 14 +++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index 07dd335bf5..71b338a9a6 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -387,6 +387,13 @@ void Write16(const u16 _Value, const u32 _Address) tmpControl.Hex = (_Value & ~DSP_CONTROL_MASK) | (dsp_plugin->DSP_WriteControlRegister(_Value) & DSP_CONTROL_MASK); + // HACK for DSPReset: do it instantaneously + if (_Value & 1) + { + Shutdown(); + Init(); + } + // Update DSP related flags g_dspState.DSPControl.DSPReset = tmpControl.DSPReset; g_dspState.DSPControl.DSPAssertInt = tmpControl.DSPAssertInt; diff --git a/Source/Core/DSPCore/Src/DSPInterpreter.cpp b/Source/Core/DSPCore/Src/DSPInterpreter.cpp index 54c2f60322..96fac7d485 100644 --- a/Source/Core/DSPCore/Src/DSPInterpreter.cpp +++ b/Source/Core/DSPCore/Src/DSPInterpreter.cpp @@ -42,12 +42,20 @@ volatile u32 gdsp_running; void WriteCR(u16 val) { // reset - if (val & 0x0001) + if (val & 1) { DSPCore_Reset(); + val &= ~1; + } + // init - can reset and init be done at the same time? + else if (val == 4) + { + // this looks like a hack! OSInitAudioSystem ucode + // should send this mail - not dsp core itself + gdsp_mbox_write_h(GDSP_MBOX_DSP, 0x8054); + gdsp_mbox_write_l(GDSP_MBOX_DSP, 0x4348); + val |= 0x800; } - - val &= ~0x0001; // update cr g_dsp.cr = val;