From 4ed15aedf51f139eed888a56885da00ead3eb001 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 16 Jun 2009 19:35:54 +0000 Subject: [PATCH] Add a couple of comments to Zelda ucode HLE - now we know exactly what the DSPADPCM_FILTER is at least. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3467 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp index 9223a70ab5..79a0fd20cc 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp @@ -188,7 +188,7 @@ void CUCode_Zelda::ExecuteList() // DsetupTable ... zelda ww jumps to 0x0095 case 0x01: { - u32 tmp[4]; + u32 tmp[4]; tmp[0] = Read32(); tmp[1] = Read32(); tmp[2] = Read32(); @@ -197,20 +197,24 @@ void CUCode_Zelda::ExecuteList() m_SyncMaxStep = CmdMail & 0xFFFF; DEBUG_LOG(DSPHLE, "DsetupTable"); - DEBUG_LOG(DSPHLE, "???: 0x%08x", tmp[0]); - DEBUG_LOG(DSPHLE, "DSPRES_FILTER (size: 0x40): 0x%08x", tmp[1]); - DEBUG_LOG(DSPHLE, "DSPADPCM_FILTER (size: 0x500): 0x%08x", tmp[2]); - DEBUG_LOG(DSPHLE, "???: 0x%08x", tmp[3]); - } - break; + DEBUG_LOG(DSPHLE, "Some mixing buffer: 0x%08x", tmp[0]); - // SyncFrame ... zelda ww jumps to 0x0243 - case 0x02: - { - u32 tmp[3]; - tmp[0] = Read32(); - tmp[1] = Read32(); - tmp[2] = Read32(); + // This points to some strange data table. + DEBUG_LOG(DSPHLE, "DSPRES_FILTER (size: 0x40): 0x%08x", tmp[1]); + + // See 0x02, same thing as DSPADPCM_FILTER there. + DEBUG_LOG(DSPHLE, "DSPADPCM_FILTER (size: 0x500): 0x%08x", tmp[2]); + DEBUG_LOG(DSPHLE, "Some other mixing buffer: 0x%08x", tmp[3]); + } + break; + + // SyncFrame ... zelda ww jumps to 0x0243 + case 0x02: + { + u32 tmp[3]; + tmp[0] = Read32(); + tmp[1] = Read32(); + tmp[2] = Read32(); // We're ready to mix // soundStream->GetMixer()->SetHLEReady(true); @@ -222,10 +226,19 @@ void CUCode_Zelda::ExecuteList() m_SyncCount = 0; m_SyncMax = (CmdMail >> 16) & 0xFF; - DEBUG_LOG(DSPHLE, "DsyncFrame"); - DEBUG_LOG(DSPHLE, "???: 0x%08x", tmp[0]); - DEBUG_LOG(DSPHLE, "???: 0x%08x", tmp[1]); - DEBUG_LOG(DSPHLE, "DSPADPCM_FILTER (size: 0x500): 0x%08x", tmp[2]); + DEBUG_LOG(DSPHLE, "DsyncFrame"); + + // These alternate between three sets of mixing buffers. They are all three fairly near, + // but not at, the ADMA read addresses. + DEBUG_LOG(DSPHLE, "Left mixing buffer? 0x%08x", tmp[0]); + DEBUG_LOG(DSPHLE, "Right mixing buffer? 0x%08x", tmp[1]); + + // Zelda WW: This points to a 64-byte array of coefficients, which are EXACTLY the same + // as the AFC ADPCM coef array in decode.c of the in_cube winamp plugin, + // which can play Zelda audio. + // There's also a lot more table-looking data immediately after - maybe alternative + // tables? I wonder where the parameter blocks are? + DEBUG_LOG(DSPHLE, "DSPADPCM_FILTER (size: 0x40): 0x%08x", tmp[2]); } return; break;