• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Site › Dolphin Patches (Archive) v
« Previous 1 ... 3 4 5 6 7 Next »

[Patch] dspHLE Mario galaxy 1 music
View New Posts | View Today's Posts

Pages (18): « Previous 1 2 3 4 5 ... 18 Next »
Jump to page 
Thread Rating:
  • 4 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
[Patch] dspHLE Mario galaxy 1 music
07-08-2010, 07:11 AM (This post was last modified: 07-08-2010, 07:15 AM by Torin.)
#11
Torin Offline
Member
***
Posts: 65
Threads: 4
Joined: Jun 2010
hi nexus, actually, i'm don't using the patch that i released. i have started the work again. About the decoder 21_readAudio, i moved it couse there was another void decoder21_readaudio in blank, so i did that for making more cleaner the code.

The part of updatesamplecounters59, there is a thing to change, lika erasing the lines of YN1 and YN2, again, the urpose of that command, is for making more cleaner. Now actually i'm researching of reversing engineering on pcm16 and 8 decoder. There are some conditions that arent's stated on the RE, and in the c++ code is written other things, like condition if(PB.Remlength < rem_samples) instead of if(PB.Renlenght). And there is something strange how the setup accelerator and the calls for accelerator handles some things, like sample format ( for pcm8 is 0x05 and for pcm16 is 0x06), i think we should do something similar to the ADPCM calling in afc decoder, but for the accelerator in dma versión, couse it must use sample format. Here is one part of the RE i've made in base on what was written for pcm8 decoder:

Code:
//////////////////////////////////////////// 0x08 DECODER
// Hardcoded destination 0x0580.
void Decoder0x08() {
    098f 0092 0004 lri         $CR, #0x0004
    0991 2002      lrs         $AX0.L, @0x0002
    0992 8100      clr         $ACC0
    0993 8900      clr         $ACC1
    0994 2430      lrs         $AC0.L, @0x0030   // CurSampleFrac
    
    $AX0.L = PB.RatioInt;
    $AC0.L = PB.CurSampleFrac;

    // 0995 8d00      set15      
    // 0996 0950      lris        $AX1.L, #0x50
    // 0997 a000      mulx        $AX0.L, $AX1.L
    // 0998 a400      mulxac      $AX0.L, $AX1.L, $ACC0
    // 0999 1404      lsl         $ACC0, #4
    // 099a 8c00      clr15      
    // Compute how much data we need to read, to get 0x50 samples after resampling.
    // AC0.L is cursamplefrace, AX0.L is ratio.
    $ACC0 = PB.CurrentSampleFrac + 0x50 * PB.Ratio;

    099b 1ffe      mrr         $AC1.M, $AC0.M
    099c 0083 0580 lri         $AR3, #0x0580
    // 099e 2201      lrs         $AX0.H, @0x0001
    // 099f 8600      tstaxh      $AX0.H
    // 09a0 0294 09b1 jnz         0x09b1
    
    if (PB.KeyOff)
        goto clear_buffer;
        
    // 09a2 2204      lrs         $AX0.H, @0x0004
    // 09a3 8600      tstaxh      $AX0.H
    // 09a4 02b4 09f9 callne      0x09f9
    
    if (PB.NeedsReset)
    {
        09f9_UpdateSampleCounters8();
    }

    09a6 8100      clr         $ACC0
    
    // 09a7 2605      lrs         $AC0.M, @0x0005
    // 09a8 b100      tst         $ACC0
    // 09a9 0295 09be jz          0x09be
    
    if (PB.ReachedEnd)
    {
        09be_SetupAccelerator
    

reached_end:

    09ab 8100      clr         $ACC0
    09ac 2e05      srs         @0x0005, $AC0.M
    
    PB.ReachedEnd = 0;
    
    09ad 2281      lrs         $AX0.H, @0xff81
    09ae 8600      tstaxh      $AX0.H
    09af 0294 09b8 jnz         0x09b8
    
    if (!RepeatMode)
    {
        
clear_buffer:

    09b1 8100      clr         $ACC0
    
    // 09b2 005f      loop        $AC1.M
    // 09b3 1b7e      srri        @$AR3, $AC0.M
    // 09b4 7400      incm        $AC0.M
    // 09b5 2e01      srs         @0x0001, $AC0.M
    // 09b6 029f 09f2 jmp         0x09f2
    
    for (u32 i = 0; i < rem_samples; i++)
        *_Buffer++ = 0;
    PB.KeyOff = 1;
    return;
    
    }
    else
    {    
    
    // 09b8 2688      lrs         $AC0.M, @0xff88
    // 09b9 2489      lrs         $AC0.L, @0xff89
    // 09ba 2e34      srs         @0x0034, $AC0.M
    // 09bb 2c35      srs         @0x0035, $AC0.L
    // 09bc 02bf 09f9 call        0x09f9
    
    PB.RestartPos = PB.LoopStartPos;
    09f9_UpdateSampleCounters8();
    }
    }
    
    09be 00ff 0360 sr          @0x0360, $AC1.M
    09c0 2638      lrs         $AC0.M, @0x0038
    09c1 2439      lrs         $AC0.L, @0x0039
    09c2 0f05      lris        $AC1.M, #0x05   // Sample format 5, how we can use this?
    // 09c3 02bf 05ad call        0x05ad
    
    void 05ad_SetupAccelerator(_acceleratorH(PB.CurAddr), _accleratorL(0x0039), _format(0x05))
    {
    *SampleFormat = AC1.M
    *ACCAH/ACCAL = PB.CurAddr >> ((0x05 & 3) - 1);
    }  

    09c5 00df 0360 lr          $AC1.M, @0x0360
    09c7 8100      clr         $ACC0
    
    // 09c8 263a      lrs         $AC0.M, @0x003a
    // 09c9 b100      tst         $ACC0
    // 09ca 0294 09d9 jnz         0x09d9
    
    if (!PB.RemLength)
    {
    
        // 09cc 263b      lrs         $AC0.M, @0x003b
        // 09cd 5c00      sub         $ACC0, $ACC1
        // 09ce 0290 09d9 jge         0x09d9
        
        PB.CurAddr = 0x003b
        $ACC0 -= $ACC1
        $AX0.H = PB.RemLength
        09d0 223b      lrs         $AX0.H, @0x003b
        
        // 09d1 02bf 0a0a call        0x0a0a   // Load more samples.
        void 0a0a_ReadFromAccelerator8To16(OutBuffer($AR3), Count($AX0.H))
        {
            for (int i = 0; i < PB.RemLength; i++)
                *_Buffer++ = (s8)(*read_ptr++) << 8;   // ffd3 is the non-adpcm alternative read address for the accelerator.
        }

        // 09d3 5500      subr        $ACC1, $AX0.H
        // 09d4 0a01      lris        $AX0.H, #0x01
        // 09d5 00fa 0405 sr          @0x0405, $AX0.H
        // 09d7 029f 09ab jmp         0x09ab
        
        rem_samples -= PB.RemLength
        PB.ReachedEnd = 1;
        goto reached_end;        
    }
    else
    {
    09d9 1f5f      mrr         $AX0.H, $AC1.M
    $AX0.H = 0x05 = 0x0360
    
    // 09da 02bf 0a0a call        0x0a0a   // Load more samples.
        void 0a0a_ReadFromAccelerator8To16(OutBuffer($AR3), Count($AX0.H))
        {
            for (int i = 0; i < (PB.Format == 5); i++)
                *_Buffer++ = (s8)(*read_ptr++) << 8;
        }    
    
    // Stash AX0.H away, it gets read again at 09ef.
    09dc 00fa 0362 sr          @0x0362, $AX0.H

    09de 8100      clr         $ACC0
    // 09df 263a      lrs         $AC0.M, @0x003a
    // 09e0 243b      lrs         $AC0.L, @0x003b
    // 09e1 1570      lsr         $ACC1, #-16
    
    $AC0.M = PB.RemLength
    $ACC1 = (rem_samples << 16)
    
    // 09e2 0a01      lris        $AX0.H, #0x01
    // 09e3 0081 0405 lri         $AR1, #0x0405
    // 09e5 5c00      sub         $ACC0, $ACC1
    // 09e6 b100      tst         $ACC0
    // 09e7 0275      ifz        
    //     09e8 1a3a      srr         @$AR1, $AX0.H
    
    PB.RemLength -= (rem_samples << 16);
    if(PB.RemLength == 0)
    PB.ReachedEnd = 1;
    }
        
    09e9 2e3a      srs         @0x003a, $AC0.M
    09ea 2c3b      srs         @0x003b, $AC0.L
    09eb 2638      lrs         $AC0.M, @0x0038
    09ec 2439      lrs         $AC0.L, @0x0039
    09ed 00d8 0362 lr          $AX0.L, @0x0362
    09ef 7000      addaxl      $ACC0, $AX0.L
    09f0 2c39      srs         @0x0039, $AC0.L
    09f1 2e38      srs         @0x0038, $AC0.M
    
    PB.CurAddr -=PB.RemLength + PB.Format      // do not know how to write this

    // 09f2 0092 00ff lri         $CR, #0x00ff
    // 09f4 029f 02d0 jmp         0x02d0
    GOTO Resample_From0580To0520:
}
Find
07-08-2010, 07:14 AM (This post was last modified: 07-08-2010, 07:18 AM by Xtreme2damax.)
#12
Xtreme2damax Offline
New & Improved
********
Global Moderators
Posts: 3,135
Threads: 91
Joined: Mar 2009
I really wish these sound issues would be looked into more extensively and worked on. Even with your patch that was committed to SVN, AFC stops looping in Twilight Princess after a few minutes, although the upside is that it no longer kill sound. Tongue

:Edit: I was referring to neXus's patch of course. Smile
Find
07-08-2010, 11:55 AM (This post was last modified: 07-08-2010, 12:17 PM by Torin.)
#13
Torin Offline
Member
***
Posts: 65
Threads: 4
Joined: Jun 2010
i forgot to tell, that the arrange of writting if(!PB.Remlengt) instead of if (PB.Remlenght < (u32) remsamples) will make the music to cut off after mm 5 or maybe 7 seconds. I need to rethink the RE
Find
07-11-2010, 04:55 AM
#14
Torin Offline
Member
***
Posts: 65
Threads: 4
Joined: Jun 2010
hey guys, at the moment i'm not in my computer. But i've got to tell you good noews about PCM8 and mario kart double dash sound cuting, well, i've managed to reach the same effect like in mario galaxy with pcm16 (sound looping sometimes does more loops and sometimes not), but generally making it playing more longer, by adding a few code lines in the accelerator that were missing. Other thing i'm managing to do, is making longer playing by adding the factor of SAMPLE_FORMAT to the addressing of the ACCAH and ACCAL, like it was written in ucode_zelda.txt. In 2 days i'll back home with the "some kind improvement" patch. Greets
Find
07-11-2010, 07:39 PM
#15
StripTheSoul Offline
YouKittenMe?
*******
Posts: 4,617
Threads: 37
Joined: Oct 2009
Smile good to see you're keeping this up!
Intel i5-4690k (Devil's Canyon) @ 3.5 GHz (+Scythe Mugen) / Gainward GTX 1070 Phoenix (OC'd) / ASUS Z97 PRO GAMER / 16GB G.Skill DDR3-2400 CL10 TridentX / X-Fi XtremeMusic / Win10 Pro 64bit / Dell S2716DG Monitor / 3x original WiiMote+MotionPlus+Nunchuk
Find
07-11-2010, 08:57 PM
#16
jumb Offline
Senior Member
****
Posts: 322
Threads: 1
Joined: Jun 2010
Absolutely! It looks like there's little development to updating the DSP by the devs, so it's good to see some fixes coming here.

Thank you.
E8400 @ 3GHz, 4GB Ram, Gigabyte 275GTX, Windows 7 64-bit
Find
07-11-2010, 11:34 PM
#17
razor1911 Offline
Member
***
Posts: 107
Threads: 8
Joined: Oct 2009
I had been holding off playing SMG 1 on dolphin just for this purpose.

any news or updates on this please.

your effort is appreciated.
Find
07-12-2010, 05:08 AM
#18
felipaopl Offline
Member
***
Posts: 81
Threads: 3
Joined: Nov 2009
Also waiting here to finally play SMG2 the way is meant to be played... in full HD Big Grin
Find
07-13-2010, 04:38 AM
#19
Torin Offline
Member
***
Posts: 65
Threads: 4
Joined: Jun 2010
Sorry guys, reached dead end, currently don't know what to do, previous patch that i wanted to released didn't fix anything at the end (my mistakes), seriously, i need a little help on this while nexxus is offline. For the moment, i think devs must watch this bug that is coming for about more than 1000 builds, but don't know either if they know what is exactly the root of the problem. The thing is this, i think the problem is the main handling of the accelerator, but like i've comment before, i've reached a dead end where i don't know how to restore the previous address. Greets
Find
07-13-2010, 05:05 AM
#20
StripTheSoul Offline
YouKittenMe?
*******
Posts: 4,617
Threads: 37
Joined: Oct 2009
oh bugger Undecided well, thanks for your efforts, anyway, much appreciated!
I haven't seen any of the devs tinker on the HLE plugin for ages -_-
Intel i5-4690k (Devil's Canyon) @ 3.5 GHz (+Scythe Mugen) / Gainward GTX 1070 Phoenix (OC'd) / ASUS Z97 PRO GAMER / 16GB G.Skill DDR3-2400 CL10 TridentX / X-Fi XtremeMusic / Win10 Pro 64bit / Dell S2716DG Monitor / 3x original WiiMote+MotionPlus+Nunchuk
Find
« Next Oldest | Next Newest »
Pages (18): « Previous 1 2 3 4 5 ... 18 Next »
Jump to page 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode