neXus' patch for z:tp intro music

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5312 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2010-04-10 05:04:51 +00:00
parent a75c37826b
commit 474363bc27
1 changed files with 11 additions and 8 deletions

View File

@ -297,8 +297,7 @@ restart:
{ {
PB.ReachedEnd = 0; PB.ReachedEnd = 0;
// HACK: AFC looping doesn't work yet. (remove "true ||" for pikmin2/zeldatp intro music - but its causing probs) if ((PB.RepeatMode == 0) || (!PB.StopOnSilence == 0))
if (true || PB.RepeatMode == 0)
{ {
PB.KeyOff = 1; PB.KeyOff = 1;
PB.RemLength = 0; PB.RemLength = 0;
@ -310,15 +309,19 @@ restart:
} }
else else
{ {
// The loop start pos is incorrect, so samples will loop a bit wrong. However, at least //AFC looping
// this fixes the intro music in ZTP, Pikmin2. // The loop start pos is incorrect? (Fixed?), so samples will loop a bit wrong.
// PB.RestartPos = PB.LoopStartPos; // this fixes the intro music in ZTP.
PB.RemLength = PB.Length; // - PB.RestartPos; PB.RestartPos = PB.LoopStartPos;
PB.CurAddr = PB.StartAddr; //+ (PB.LoopStartPos >> 4) * PB.Format + ; 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? // 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.YN1 = PB.LoopYN2;
PB.YN2 = PB.LoopYN1; PB.YN2 = PB.LoopYN1;
} }
} }