Where does UpdateSampleCounters59(PB); come from? Does that come from the AFC decoder and AFC looping, is it listed in the ucode disassm documentation or not? I have an idea how to rework the AFC code which is why I am asking.
[Patch] dspHLE Mario galaxy 1 music
|
08-18-2010, 03:39 PM
(This post was last modified: 08-18-2010, 04:41 PM by Xtreme2damax.)
Well it wasn't exactly stupid..
I would like to know where you got it from to see if the UpdateSampleCounters corresponds with AFC audio. I noticed that Render_AFC looks nearly similar to the code for PCM16. I am piecing in some code from PCM16 as the current AFC code is improper and has issues, here is what I've done so far: Code: void UpdateSampleCounters59(ZeldaVoicePB &PB) There's more to do yet and it seems I haven't broke anything so far, but I need your help and the help of another developer to fix the AFC code completely. What are these lines of code responsible for, this just looks funky: Code: // This is 0717_ReadOutPBStuff That isn't in the PCM16 code since it relates to AFC looping. Hopefully if we can get the AFC code more corect'ish it might fix the music looping issue. This part of the code should be focused on next: Code: // Round upwards how many samples we need to copy, 0759 And so on until all of the AFC code is corrected and accounted for. I think the above code is the last piece of code that should be focused on to fix the issue, if not we'll need to go from there to find and fix the issue. I verified that the alterations I made did not have any unwanted side effects, although it does nothing to fix the music looping issue. According to this it appears the dsp get's desynced, then tries to write to the left/right buffer address and that's when the AFC starts going crazy. Even if this is the issue that still doesn't mean AFC can't be cleaned and properly done as it may save headaches down the road: http://forums.dolphin-emu.org/thread-108...#pid103192 Code: 26:25:920 .\Src\UCodes\UCode_Zelda.cpp:433 D[DSPHLE]: ============================================================================== 08-19-2010, 03:31 AM
(This post was last modified: 08-19-2010, 03:33 AM by Xtreme2damax.)
I tried with the following code:
Code: void UpdateSampleCounters4(ZeldaVoicePB &PB) But it produced a loud screeching sound in Windwaker and other games that use AFC. My goal is to get AFC closer to PCM16 code without breaking anything, so far I had to settle with the following until the issues with the above code are worked out: Code: void CUCode_Zelda::RenderVoice_AFC(ZeldaVoicePB &PB, s16 *_Buffer, int _Size) Here is a patch of the current work I've done. I've tested and it doesn't appear to break anything, but some widespread testing is needed to confirm. There's still things left to do, I would like to solve the issue with that annoying screeching the first block of code I posted causes. If any developers spot inconsistencies with the code I've posted, please let me know. 08-19-2010, 05:29 AM
I don't think thats a good idea, its two different things after all.
Torin and I am working on it anyways, at least when I'm bored enough 08-19-2010, 05:42 AM
I haven't really changed the AFC code much, just added some things. The code can be tweaked where appropriate but so far it seems to not broke anything. Do you and Torin know what code is responsible for killing the music and why the music sometimes lasts longer than other times?
08-19-2010, 08:36 AM
It seems something in this section of code causes music to break, would anyone know what's wrong with this code by glancing over it?
Code: restart: 08-20-2010, 02:28 AM
I didn't really intend to look at the code thats there already, I was going to reverse it from scratch. And as far as I know, this wasnt done for AFC, it was more like copied over from PCM and modified a bit.
08-20-2010, 05:46 AM
I see, any estimate on how long it will take? I thought it had already been reverse engineered by Lord Mark, nakee and whatever other developers that were working on DSP emulation, it was my understanding that it just hadn't been implemented into the plugin yet. Something also seems amiss with the light Zelda ucode, music does not work in Wario World. I was able to somewhat get the music working by messing with the code for the light Zelda ucode at the bottom of Ucode_Zelda_Voice.cpp.
08-21-2010, 09:29 AM
I know the code for AFC is not the same as it is for PCM16, but I felt this was better than the previous implementation. From what I've tested so far it seems there is no issues with the alterations I made, it may not fix the looping issues but is doesn't seem to cause any problems.
I'm attaching both the patch file and the pre-compiled plugins for x86 and x64, be sure to test thoroughly and report any issues that didn't exist with the previous implementation. Also be sure to report if this fixed anything or not, it's unlikely that it fixed anything though so I'd appreciate any positive news. Ucode_Zelda_Voice.patch (Size: 4.45 KB / Downloads: 280) Plugin_DSP_HLE_Patched.7z (Size: 1.09 MB / Downloads: 272) |
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)