Dolphin, the GameCube and Wii emulator - Forums

Full Version: AFC Looping and Zelda music..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I think I may be on to something..

Quote:// PB.RestartPos = PB.LoopStartPos;
PB.RemLength = PB.Length; // - PB.RestartPos;
PB.CurAddr = PB.StartAddr; //+ (PB.LoopStartPos >> 4) * PB.Format + ;

Why is all that commented out?

Quote:// The loop start pos is incorrect, so samples will loop a bit wrong. However, at least this fixes the intro music in ZTP, Pikmin2.[quote]

Yeah I noticed this, however it produces more correct sound/music when uncommented and gets rid of that echoing in Zelda Windwaker when the AFC looping hack is enabled. However I did changed the above to the following:

[quote]
PB.RestartPos = PB.LoopStartPos;
PB.RemLength = PB.Length - PB.RestartPos;
PB.CurAddr = PB.StartAddr + (PB.LoopStartPos >> 4) * PB.Format;

Notice the the "4" in bold, when set to 4 there is no echoing in Windwaker with the AFC looping hack, more correct sound is output besides samples being looped somewhat incorrectly and best of all looping still works in Twilight Princess. Also notice the other parts I uncommented that coincide with this.

Now I ask, what is the correct LoopStartPos if it isn't "4"? Zelda Windwaker sounds magnificent besides the slightly incorrect looping, on the file screen the waves can be heard in the background where before it was just the music without the AFC Looping Hack and that annoying echoing with the hack enabled?
Well so far that seems to fix the echoing in Zelda Windwaker when the AFC hack is enabled allowing intro music to work in ZTP, not sure about anything else yet.

It loops slightly incorrect, and I would like to fix that except I'm not sure what the correct LoopStartPos is for PB.LoopStartPos if it isn't 4. Would the correct LoopStartPos be "0" instead of "4"?

:Edit: Arghh, the board software isn't merging double posts anymore. o_O