Dolphin, the GameCube and Wii emulator - Forums

Full Version: [PATCH] DSP-HLE Plugin: Zelda TP Intro Music [OBSOLETE]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12

LuisR14

(04-11-2010, 10:09 PM)MIKEYK255 Wrote: [ -> ]Awesome, u sir are a god, working music in zelda tp at last Smile
but there are still sounds that are missing (that i have noticed anyways) Undecided
(04-15-2010, 09:12 AM)LuisR14 Wrote: [ -> ]
(04-11-2010, 10:09 PM)MIKEYK255 Wrote: [ -> ]Awesome, u sir are a god, working music in zelda tp at last Smile
but there are still sounds that are missing (that i have noticed anyways) Undecided

at least the intro music works Smile

I've uploaded another patch which tries to solve the looping problem. Sometimes it actually works but I don't know what to do if it does not work (see first post).

P.S. The patch V2 is already uploaded to DolphinSVN Smile (thanks to godisgovernment).
Anyone planning on making any further improvements to this patch?
Well the third patch causes sound and music to cut out in some instances, I haven't tested the second patch extensively yet.
Just wondering if you plan on attempting any further improvements of this patch?

Also, perhaps you could try to take a crack at the looping issue with Mario Galaxy. This code seems to be responsible for the PCM16 looping that Mario Galaxy uses:

Code:
void CUCode_Zelda::RenderVoice_PCM16(ZeldaVoicePB &PB, s16 *_Buffer, int _Size)
{
    int _RealSize = SizeForResampling(PB, _Size, PB.RatioInt);
    u32 rem_samples = _RealSize;
    if (PB.KeyOff)
        goto clear_buffer;
    if (PB.NeedsReset)
    {
        UpdateSampleCounters10(PB);
        for (int i = 0; i < 4; i++)
            PB.ResamplerOldData[i] = 0;  // Doesn't belong here, but dunno where to do it.
    }
    if (PB.ReachedEnd)
    {
        PB.ReachedEnd = 0;
reached_end:
        if (!PB.RepeatMode) {
            // One shot - play zeros the rest of the buffer.
clear_buffer:
            for (u32 i = 0; i < rem_samples; i++)
                *_Buffer++ = 0;
            PB.KeyOff = 1;
            return;
        }
        else
        {
            PB.RestartPos = PB.LoopStartPos;
            UpdateSampleCounters10(PB);
        }
    }
(05-03-2010, 12:19 PM)Xtreme2damax Wrote: [ -> ]Just wondering if you plan on attempting any further improvements of this patch?

Also, perhaps you could try to take a crack at the looping issue with Mario Galaxy.

Just as I said, I don't know how to solve this particular problem. I've tried a lot of things but the music keeps stopping after a certain amount of time.
Maybe someone else has an idea. Here are my thoughts:

First of all the music does not stop every time but most of the time. Maybe one particular condition is not checked or the memory addresses are set wrong.
As you quoted, the problem seems to be in the method RenderVoice_PCM16.
Moreover, I have noticed a buffer underflow of the PB.RemLength variable. If this happens, everything works and the music does not stop (sometimes). If the condition (PB.IsBlank == 1) is true nothing can be done to restart the music (at least nothing I've tried so far). Even a soft reset of the game does not help.

So as I said, I have tried a lot of different things and nothing works. And I guess that this special case was not monitored in the DSP_UC_Zelda.txt (or at least I cannot find the correct lines Wink ). Unfortunately, I don't know how to produce such code as in DSP_UC_Zelda.txt.
I see, was just wondering. Tongue

I'm not as concerned about Mario as I am in Zelda, some samples still seem to loop wrong in Twilight Princess so I thought I would ask. Even though the music and sound no longer stops after a while with the AFC looping hack, AFC looping itself will stop after a while causing cinematic music to stop playing.

Also AFC looping stops working if you let the game play through both intros. I do appreciate your effort though and hope you might figure something out.
(05-05-2010, 01:25 AM)neXus Wrote: [ -> ]Moreover, I have noticed a buffer underflow of the PB.RemLength variable. If this happens, everything works and the music does not stop (sometimes). If the condition (PB.IsBlank == 1) is true nothing can be done to restart the music (at least nothing I've tried so far). Even a soft reset of the game does not help.
That sounds like a timing problem between the DSP and the CPU. The CPU has probably set a flag to note that the DSP has gone into a hung state and does not continue to send the music data. This is similar to the DSP "LLE on thread" problem. If what I am saying is correct, the fix will need to be a major change.
(05-06-2010, 11:25 AM)skid Wrote: [ -> ]That sounds like a timing problem between the DSP and the CPU.

Hmm... But the sound hangs always after a fixed time span, so I don't think that's a timing problem. Or did you mean something else?
By timing, I mean the emulated speed of the DSP relative to the emulated speed of the CPU. This is especially so with the DSP HLE plugin as the timing of the DSP is not based on individual DSP instructions but whole audio functions.

It seems like (and let me emphasise that I am still guessing) both the CPU and DSP hit a certain state which hangs one or both of the chips.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12