diff --git a/Source/Core/DSPCore/Src/DSPAccelerator.cpp b/Source/Core/DSPCore/Src/DSPAccelerator.cpp index f4739a0910..4ce510b64d 100644 --- a/Source/Core/DSPCore/Src/DSPAccelerator.cpp +++ b/Source/Core/DSPCore/Src/DSPAccelerator.cpp @@ -133,17 +133,24 @@ u16 dsp_read_accelerator() val = ADPCM_Step(Address); break; case 0x0A: // 16-bit PCM audio - val = (DSPHost_ReadHostMemory(Address) << 8) | DSPHost_ReadHostMemory(Address + 1); + val = (DSPHost_ReadHostMemory(Address*2) << 8) | DSPHost_ReadHostMemory(Address*2 + 1); g_dsp.ifx_regs[DSP_YN2] = g_dsp.ifx_regs[DSP_YN1]; g_dsp.ifx_regs[DSP_YN1] = val; - Address += 2; + Address += 1; break; + case 0x19: // 8-bit PCM audio + val = DSPHost_ReadHostMemory(Address) << 8; // probably wrong + g_dsp.ifx_regs[DSP_YN2] = g_dsp.ifx_regs[DSP_YN1]; + g_dsp.ifx_regs[DSP_YN1] = val; + Address += 1; + break; default: ERROR_LOG(DSPLLE, "Unknown DSP Format %x", g_dsp.ifx_regs[DSP_FORMAT]); break; } // TODO: Take GAIN into account, whatever it is. + // It looks like its always 0x800 for PCM8/PCM16 and 0x0 for adpcm if (g_dsp.ifx_regs[DSP_GAIN] > 0) { //NOTICE_LOG(DSPLLE,"format: 0x%04x - val: 0x%04x - gain: 0x%04x", g_dsp.ifx_regs[DSP_FORMAT], val, g_dsp.ifx_regs[DSP_GAIN]); diff --git a/Source/Core/DSPCore/Src/DSPInterpreter.cpp b/Source/Core/DSPCore/Src/DSPInterpreter.cpp index 9d77f41d1e..03ae912adc 100644 --- a/Source/Core/DSPCore/Src/DSPInterpreter.cpp +++ b/Source/Core/DSPCore/Src/DSPInterpreter.cpp @@ -73,7 +73,7 @@ u16 ReadCR() void Step() { - DSPCore_CheckExternalInterrupt(); + //DSPCore_CheckExternalInterrupt(); DSPCore_CheckExceptions(); g_dsp.step_counter++; @@ -109,7 +109,7 @@ void Run() break; // This number (500) is completely arbitrary. TODO: tweak. - RunCyclesDebug(500); + RunCycles(500); if (!gdsp_running) break; @@ -136,9 +136,9 @@ int RunCyclesDebug(int cycles) if (cycles < 0) return 0; } - - //DSPCore_CheckExternalInterrupt(); + DSPCore_CheckExternalInterrupt(); + // Now, let's run a few cycles with idle skipping. for (int i = 0; i < 8; i++) { @@ -177,8 +177,6 @@ int RunCyclesDebug(int cycles) // Used by non-thread mode. Meant to be efficient. int RunCycles(int cycles) { - //DSPCore_CheckExternalInterrupt(); - // First, let's run a few cycles with no idle skipping so that things can progress a bit. for (int i = 0; i < 8; i++) { @@ -188,6 +186,8 @@ int RunCycles(int cycles) cycles--; } + DSPCore_CheckExternalInterrupt(); + // Next, let's run a few cycles with idle skipping, so that we can skip // idle loops. for (int i = 0; i < 8; i++)