From 2e7dd06cfdfbbcbde3f7e466da7b6b1716e967ae Mon Sep 17 00:00:00 2001 From: "XTra.KrazzY" Date: Mon, 29 Jun 2009 23:49:03 +0000 Subject: [PATCH] Documented the general sound decoder. Now all we need is to implement it. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3613 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Src/UCodes/UCode_Zelda_Voice.cpp | 8 +++++++- docs/DSP/DSP_UC_Zelda.txt | 20 +++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp index a63e6958df..1969a4e5ac 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp @@ -284,7 +284,6 @@ void CUCode_Zelda::MixAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _RightBu return; case 0x0005: // AFC / unknown - case 0x0021: // AFC / ADPCM??? case 0x0009: // AFC / ADPCM MixAddVoice_AFC(PB, m_TempBuffer, _Size); break; @@ -293,7 +292,14 @@ void CUCode_Zelda::MixAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _RightBu MixAddVoice_PCM16(PB, m_TempBuffer, _Size); break; + // Cases we're missing: 0x0008, 0x0020, 0x0021 + case 0x0008: + case 0x0020: + case 0x0021: + PanicAlert("Unimplemented MixAddVoice format in zelda %04x", PB.Format); + default: + // TODO: Implement general decoder here PanicAlert("Unknown MixAddVoice format in zelda %04x", PB.Format); break; } diff --git a/docs/DSP/DSP_UC_Zelda.txt b/docs/DSP/DSP_UC_Zelda.txt index 6133bc3a85..4540533943 100644 --- a/docs/DSP/DSP_UC_Zelda.txt +++ b/docs/DSP/DSP_UC_Zelda.txt @@ -2875,16 +2875,16 @@ void 087c_DefaultDecoder() { 087c 8100 clr $ACC0 087d 1f5e mrr $AX0.H, $AC0.M - 087e 00d8 0402 lr $AX0.L, @0x0402 - 0880 00dc 0430 lr $AC0.L, @0x0430 - 0882 0080 0520 lri $AR0, #0x0520 - 0884 00df 0480 lr $AC1.M, @0x0480 - 0886 1501 lsl $ACC1, #1 - 0887 0340 007e andi $AC1.M, #0x007e - 0889 0300 0891 addi $AC1.M, #0x0891 - 088b 1c5f mrr $AR2, $AC1.M - 088c 175f callr $AR2 - 088d 00fc 0430 sr @0x0430, $AC0.L + 087e 00d8 0402 lr $AX0.L, @0x0402 // AX0.L = PB.RatioInt + 0880 00dc 0430 lr $AC0.L, @0x0430 // AC0.L = PB.RatioFrac + 0882 0080 0520 lri $AR0, #0x0520 // AR0 = 0x0520 + 0884 00df 0480 lr $AC1.M, @0x0480 + 0886 1501 lsl $ACC1, #1 // AC1.M = (PB.Format << 1) + 0887 0340 007e andi $AC1.M, #0x007e // AC1.M &= 0x007e + 0889 0300 0891 addi $AC1.M, #0x0891 // AC1.M += 0x0891 + 088b 1c5f mrr $AR2, $AC1.M // AR2 = AC1.M + 088c 175f callr $AR2 // (*$AR2)() <-- Need to check where it actually goes + 088d 00fc 0430 sr @0x0430, $AC0.L // PB.RatioFrac = AC0.L // 088f 029f 02d8 jmp 0x02d8 GOTO ContinueWithBlock: // in SyncFrame