summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2010-04-10 05:04:51 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2010-04-10 05:04:51 +0000
commit474363bc270842f9fd1663292b1e519c946b8dfd (patch)
tree68cd1aa3d9ff80237d7dcc4b23cd17a83f4193af
parenta75c37826b4198b8907a821e5750bcfeab8b8781 (diff)
neXus' patch for z:tp intro music
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5312 8ced0084-cf51-0410-be5f-012b33b47a6e
-rw-r--r--Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp19
1 files changed, 11 insertions, 8 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 021c573d30..0c3e466a3a 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
@@ -297,8 +297,7 @@ restart:
{
PB.ReachedEnd = 0;
- // HACK: AFC looping doesn't work yet. (remove "true ||" for pikmin2/zeldatp intro music - but its causing probs)
- if (true || PB.RepeatMode == 0)
+ if ((PB.RepeatMode == 0) || (!PB.StopOnSilence == 0))
{
PB.KeyOff = 1;
PB.RemLength = 0;
@@ -310,15 +309,19 @@ restart:
}
else
{
- // The loop start pos is incorrect, so samples will loop a bit wrong. However, at least
- // this fixes the intro music in ZTP, Pikmin2.
- // PB.RestartPos = PB.LoopStartPos;
- PB.RemLength = PB.Length; // - PB.RestartPos;
- PB.CurAddr = PB.StartAddr; //+ (PB.LoopStartPos >> 4) * PB.Format + ;
+ //AFC looping
+ // The loop start pos is incorrect? (Fixed?), so samples will loop a bit wrong.
+ // this fixes the intro music in ZTP.
+ PB.RestartPos = PB.LoopStartPos;
+ PB.RemLength = PB.Length - PB.RestartPos;
+ // see DSP_UC_Zelda.txt line 2817
+ PB.CurAddr = ((((((PB.LoopStartPos >> 4) & 0xffff0000)*PB.Format)<<16)+
+ (((PB.LoopStartPos >> 4) & 0xffff)*PB.Format))+PB.StartAddr) & 0xffffffff;
+
// Hmm, this shouldn't be reversed .. or should it? Is it different between versions of the ucode?
+ // -> it has to be reversed in ZTP, otherwise intro music is broken...
PB.YN1 = PB.LoopYN2;
PB.YN2 = PB.LoopYN1;
-
}
}