
ok guys, all the credits is for nexus, almost all is based on his modifications on patch v1, v2 and v3 for zelda, and his patch for intro music, thanks to him and xtreme2damax too.
Ive decided to create a thread apart, couse this problems are different for each game; copy paste myself:
i feel that the solution for mario galaxy is near, i can't wait xD.
Ok guys, finally i managed to reproduce the music without cuting off. Now, this is the weird thing, this patch only fix sounds from the begining to the first planet or second, don't remember, aaaHH, yes, when you meet the other princes (the mother of stars?), then the sound start to loop weird again (it must be couse i use last fixv3 from Nexus). Ok that is all, i wish people can help me with this, couse practically, i didn't do alomst anithing to the code, only a few modifications.
To reproduce the same experiencie, this is what i have: Windows 7 x64, with ati hd 5770 and phenom II x2 555 @ X4 @3,8ghz and 4 gb of ram. The main config is dual core, idle skip, lock on theards, lle on single thread eneabled. OpenCL eneabled.
Audio plugin audio throttle is disable.
Video plugin is dx9 all default but eneable efb copy to texture.
Greets and sorry for my poor english, i wish you understand me. CYA
------------------------
Oo the most important thing i forgot to mention, i'm using my compiled version with opencl x64 of the emu at rev 5807M (M is becouse of Opencl?)
---------------------------
mmmm this may cause loop problems on zelda tp, i can't verify that couse i don't have that game. Plz, somebody check it
also posted this patch on my "no so issue" : http://code.google.com/p/dolphin-emu/iss...il?id=2875
-----------------------------------
guys, i need people to test this patch, couse xtreme told me that killed his audio completely on wind waker. But after that, i've managed to aquire wind waker, and i don't have any glitches (only one, that i think i know how to fix it. It is a glitchy sound that u can hear time to time, but notheing more). Cheers
----------------------------------------------------------------------------------
Last update:
Ok, this is what i got so far:
I'm doing things with RE (yep, read the manual of menanings like clrc or subax and that stuff). I think i've got something interesting while doing this reverse engineering. This is the thing, i've looked into UC_MarioGalaxy_wii.txt or smething like that xD, and found that it's kinda wrong how SizeForResampling and ConvertRatio wroks, or maybe i didn't understand the RE, here it goes:
Resulting in what i think, that this part of code from UCode_Zelda_voice.cpp:
Is wrong. As i stated before with the RE, the return should be something like this:
And the PB.CurSampleFrac should be gone, and so, adapt the size to 0x50, when i reched this, i though that i should read the UC_Zelda.txt, and the surprise is this:
They look similar, only that this have the PB.CurentSampleFrac added to mulxac, and mulxac only multiplies the others ac. So i tried this, erasing the currentsamplefrac, and i obtained a very long time music, but after 4 or 5 repeats, don't remember well, it cut off and i got fifo error. The strange thing is that i think that the samples are being calculated wrong, so with each looping, the adress copied to mem is also wrong, so i think the factor for convertraio should be changed ( to 0x50 ? ). Greets
Ive decided to create a thread apart, couse this problems are different for each game; copy paste myself:
i feel that the solution for mario galaxy is near, i can't wait xD.
Ok guys, finally i managed to reproduce the music without cuting off. Now, this is the weird thing, this patch only fix sounds from the begining to the first planet or second, don't remember, aaaHH, yes, when you meet the other princes (the mother of stars?), then the sound start to loop weird again (it must be couse i use last fixv3 from Nexus). Ok that is all, i wish people can help me with this, couse practically, i didn't do alomst anithing to the code, only a few modifications.
To reproduce the same experiencie, this is what i have: Windows 7 x64, with ati hd 5770 and phenom II x2 555 @ X4 @3,8ghz and 4 gb of ram. The main config is dual core, idle skip, lock on theards, lle on single thread eneabled. OpenCL eneabled.
Audio plugin audio throttle is disable.
Video plugin is dx9 all default but eneable efb copy to texture.
Greets and sorry for my poor english, i wish you understand me. CYA
------------------------
Oo the most important thing i forgot to mention, i'm using my compiled version with opencl x64 of the emu at rev 5807M (M is becouse of Opencl?)
---------------------------
mmmm this may cause loop problems on zelda tp, i can't verify that couse i don't have that game. Plz, somebody check it
also posted this patch on my "no so issue" : http://code.google.com/p/dolphin-emu/iss...il?id=2875
-----------------------------------
guys, i need people to test this patch, couse xtreme told me that killed his audio completely on wind waker. But after that, i've managed to aquire wind waker, and i don't have any glitches (only one, that i think i know how to fix it. It is a glitchy sound that u can hear time to time, but notheing more). Cheers
----------------------------------------------------------------------------------
Last update:
Ok, this is what i got so far:
I'm doing things with RE (yep, read the manual of menanings like clrc or subax and that stuff). I think i've got something interesting while doing this reverse engineering. This is the thing, i've looked into UC_MarioGalaxy_wii.txt or smething like that xD, and found that it's kinda wrong how SizeForResampling and ConvertRatio wroks, or maybe i didn't understand the RE, here it goes:
Code:
// Prepare regs for format 0x10 \/ |
0b2e 0092 0004 lri $CR, #0x0004 // $CR = 0x0004 |
0b30 2002 lrs $AX0.L, @0x0002 // $AX0.L = RatioInt |
0b31 8100 clr $ACC0 // $ACC0 = 0 |
0b32 8900 clr $ACC1 // $ACC1 = 0 |
0b33 2430 lrs $AC0.L, @0x0030 // $AC0.L = CurSampleFrac |
0b34 8d00 set15 // doo? |
0b35 0950 lris $AX1.L, #0x50 // $AX1.L = 0x50 |
0b36 a000 mulx $AX0.L, $AX1.L // product = CurSampleFrac * 0x50 |
0b37 a400 mulxac $AX0.L, $AX1.L, $ACC0 // $ACC0 = product -> (RatioInt * 0x50) |
0b38 1404 lsl $ACC0, #4 // ACC0 = (RatioInt * 0x50) << 4; |
0b39 8c00 clr15 // doo? = 0 |
0b3a 1ffe mrr $AC1.M, $AC0.M // AC1.M = AC0.M; |
0b3b 0083 0580 lri $AR3, #0x0580 // $AR3 = 0x0580 |
0b3d 02df ret // return
Resulting in what i think, that this part of code from UCode_Zelda_voice.cpp:
Code:
int CUCode_Zelda::SizeForResampling(ZeldaVoicePB &PB, int size, int ratio) {
// This is the little calculation at the start of every sample decoder
// in the ucode.
return (PB.CurSampleFrac + size * ConvertRatio(PB.RatioInt)) >> 16;
Is wrong. As i stated before with the RE, the return should be something like this:
Code:
return (size * ConvertRatio(PB.RatioInt)) >> 16;
And the PB.CurSampleFrac should be gone, and so, adapt the size to 0x50, when i reched this, i though that i should read the UC_Zelda.txt, and the surprise is this:
Code:
// 0a1b 0950 lris $AX1.L, #0x50
// 0a1c a000 mulx $AX0.L, $AX1.L
// 0a1d a400 mulxac $AX0.L, $AX1.L, $ACC0
// 0a1e 1404 lsl $ACC0, #4
// 0a1f 8c00 clr15
// Compute how much data we need to read, to get 0x50 samples after resampling.
// AC0.L is cursamplefrac, AX0.L is ratio.
$ACC0 = (PB.CurrentSampleFrac + 0x50 * PB.Ratio) << 4;
They look similar, only that this have the PB.CurentSampleFrac added to mulxac, and mulxac only multiplies the others ac. So i tried this, erasing the currentsamplefrac, and i obtained a very long time music, but after 4 or 5 repeats, don't remember well, it cut off and i got fifo error. The strange thing is that i think that the samples are being calculated wrong, so with each looping, the adress copied to mem is also wrong, so i think the factor for convertraio should be changed ( to 0x50 ? ). Greets