Unfortunately you are going to have to deal with it for right now. It's either use the LLE plugin or deal with the music stopping, there is no other way.
[Patch] dspHLE Mario galaxy 1 music
|
10-17-2010, 02:51 PM
(This post was last modified: 10-17-2010, 02:52 PM by Xtreme2damax.)
(06-29-2010, 11:15 AM)Torin Wrote: Resulting in what i think, that this part of code from UCode_Zelda_voice.cpp: I decided to read this again, according to Zelda_Ucode.h, 0x50 is some unknown buffer. That might be part of the issue considering that it has been stated that the looping issue is a buffer or sync issue or both. Apparently when the last five samples of the PB are 0, it tries to buffer and sync the music but I wouldn't know where to look. Yes the music in SMG1/SMG2 is PCM16, however the AFC decoder is used in some way to buffer the samples, sync and loop the music. I've spent the last two days trying to figure this and some other issues out. I feel I may be headed in the right direction, but all attempts so far have been unsuccessful, the best I've done so far is to make the music last a bit longer. I have a question for the developers, I would like to know if any of the developers working on dsp emulation have pinpointed at what point in the code that looping fails? Has anyone actually debugged the code to get an estimate at least where the music halts. If I had an idea what point in the code this is failing I may be able to concentrate on that specific area instead of jumping about the code which is a bit confusing and much to handle at once. I wonder where neXus or Torin is at since they've probably tried debugging, maybe you might have an idea Jack Frost? 10-17-2010, 05:50 PM
(This post was last modified: 10-17-2010, 05:53 PM by Xtreme2damax.)
Har har, I think I may be figuring some stuff out. I've been digging around and altering code like heck today and yesterday. I have the AFC code simplified down to the point that it looks almost like PCM8 and PCM16 without breaking anything. Made some other alterations, so far I don't think I fixed the looping issue afaik. Maybe it's the wishful thinking in me, but I think I may have improved sound somewhat. :/
I also think I may know where music is breaking in Super Mario Galaxy, not sure how complicated it will be or if it will be complicated to fix. I think it's breaking around the following line of code as Torin mentioned. But I used the value that was at 0x50 which is an unknown buffer and modified the code. I had music in SMG going three times as long, and it sounded more smooth, like it was actually streaming smoothly and transitioning the loop for a while. Maybe when it reaches the end of the loop it tries to buffer the pb's and reset to loop to the correct start position. If it is able to do that successfully then music should loop without a problem. As for why it sometimes plays longer than other times I don't know, maybe the developers have an explanation for that. Around here: Code: return (PB.CurSampleFrac + PB.Unk50[0x8] * PB.RatioInt) << 4; I can't do this alone so I would appreciate ideas and feedback from the developers. 10-17-2010, 08:06 PM
I can help you out with testing if thats any help
out of interest what does the return sample represent? 10-17-2010, 08:12 PM
Well, you already know that AFC is far from correct, and likely just a modified copy of PCM16.
Not sure if my pastie is still up, but it should show the important parts related to that buffer. Wheres that PB.Unk50 stuff from? Its not in my modified UCode_Zelda_Voice.cpp. 10-18-2010, 04:38 AM
You're right it isn't, it is in the RE of the Zelda Ucode, the text file. According to Ucode_Zelda.h 0x50 appears to be an unknown buffer. I have the line of code Torin pointed out as such:
Code: return (PB.CurSampleFrac + PB.Unk50[0x8] + size * ConvertRatio(PB.RatioInt)) >> 16; That may not be correct, but it seems to be the only thing that works without destroying audio in Zelda Ucode games or crashing the emulator, it also seems to make the music last slightly longer. I realize that the current AFC code is way off, I am just trying to rework it so that it's more similar to PCM16 and PCM8 and managed to do so without breaking anything but have more work to do. I am going to use bits of the RE'd code on pastie as reference to try to hopefully get this working, but my lack of coding skills makes things more difficult which is why I could use the help. The trick is to buffer the pb's properly and reset to the correct LoopStartPos. It shouldn't require a major rewrite of the AFC code as far as I know, there is probably a simpler way to do it. I do need to know where exactly in the code that the music is killed, so I was wondering if you could debug that Jack Frost if you would oblige? Do we know yet what the correct loop start position is for PCM16 and AFC audio? PB.Format also seems to be needed else screechy and echoing audio seems to happen with Zelda Ucode games. Trying to do this all without destroying audio is the main goal. Another question, is there a way to simplify the following code? Code: PB.CurAddr = ((((((PB.RestartPos / 16) & 0xffff0000) * PB.Format) << 16) + (((PB.RestartPos / 16) & 0xffff) * PB.Format)) + PB.StartAddr) & 0xffffffff; Thanks. 10-18-2010, 08:17 AM
(This post was last modified: 10-18-2010, 09:12 AM by Xtreme2damax.)
Just wondering if the following RE is for the AFC decoder in Zelda_Ucode.txt?
Quote:// SAMPLER DECODER FOR FORMAT 0x05, 0x09 I also need to know what PB values ACC0, ACC1, AC0.M, AX0.L, ACM.M, AX1.L, AX1.M etc.. refer to as that would make referencing the docs and RE easier for me. Besides the buffer it appears that NumberOfSamples is not implemented or most of it's missing besides a few commented lines, it's probably not returning the correct amount of samples when it the music tries to loop. There also appears to be quite a bit missing, but I'm having trouble making heads or tales of the RE'd Ucode in Ucode_Zelda.txt. 10-18-2010, 11:48 AM
Is there also a way to see what pb's memory addresses refer to? I want to try implementing FilterBufferInPlace/Filterstate in this block of code but can't find the pb values for the memory addresses in Zelda_Ucode.txt:
Quote:if (PB.FilterEnable != 0) Need to know what 0x038f, 0x0520, 0x0484, 0x0440 is. Has this been RE'd yet, because I'm not able to find much. 10-18-2010, 09:12 PM
by the pricking of my thumb, something wickedly working this way comes...
I just got a feeling ^^
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
10-19-2010, 01:17 AM
don't get your hopes to high, Strip!
|
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)