Previous Thread
Next Thread
Print Thread
Page 34 of 55 1 2 32 33 34 35 36 54 55
Re: AO SDK release 1.4.4 available [Re: Deunan Knute] #45761 10/23/08 09:38 PM
Joined: Nov 2003
Posts: 459
K
Knurek Offline
Senior Member
Offline
Senior Member
K
Joined: Nov 2003
Posts: 459
Ladies and gentlemen, two new DSF rips:

DiGi Charat Fantasy (2001)(Westone, Broccoli)
Eve Zero Perfect Edition - Ark of the Matter (2001)(C's Ware, Gamevillage)

Do enjoy, Eve Zero is really nice from what I've listened to.

http://dsf.hcs64.com/

Re: AO SDK release 1.4.4 available [Re: Knurek] #45865 10/29/08 12:24 AM
Joined: Nov 2003
Posts: 459
K
Knurek Offline
Senior Member
Offline
Senior Member
K
Joined: Nov 2003
Posts: 459
Four new DSF rips today:

Giga Wing (1999)(Takumi, Capcom)
Hundred Swords (2001)(Sega) [by manakoAT]
Langrisser Millenium (1999)(Santa Entertainment, Masaya, NCS)
Shin Nihon Pro Wrestling Toukon Retsuden 4 (1999)(Tomy) [mostly streamed, those are just some menu tunes]

Hundred Swords is insane (yes, that's 70 MB of pure sequenced music) if a bit clicky (some glitches in ADPCM decoding?).

Re: AO SDK release 1.4.4 available [Re: Knurek] #45889 10/30/08 06:48 AM
Joined: Sep 2007
Posts: 56
K
kingshriek Offline
Member
Offline
Member
K
Joined: Sep 2007
Posts: 56
I've been attacking the AM2 (DTPK) sound driver this past week and now understand enough of it to successfully rip dsfs. So, I tested out some Virtua Fighter 3TB rips with AOSDK 1.4.4 and noticed the following:

(1) They are playing way too slow.
(2) Many voices aren't being keyed-on properly (many are cut off abruptly).

(1) was obviously a timer problem. A quick scan through aica.c revealed a few places where the timer register offsets were incorrect (some of these were actually using SCSP offsets). I changed these offsets to the correct values and the VF3 tracks are now playing at the correct speed. Interestingly enough, the AM2 driver actually runs on Timer B (so it is actually used for something).

For (2), I was almost certain that was related to slot-monitoring based on previous experience with Segagaga. Some quick tests confirmed my hypothesis. I'm not exactly sure how to fix this, but commenting out the AEG monitoring fixes the rest of the problems with VF3TB dsf playback.

patch:
Code:
diff -Nru aosdk_base/eng_dsf/aica.c aosdk/eng_dsf/aica.c
--- aosdk_base/eng_dsf/aica.c	2008-07-28 11:16:04.000000000 -0700
+++ aosdk/eng_dsf/aica.c	2008-10-29 22:54:12.000000000 -0700
@@ -469,6 +469,7 @@
 		slot->active=0;
 	}
 	slot->udata.data[0]&=~0x4000;
+	
 }
 
 #define log_base_2(n) (log((float) n)/log((float) 2))
@@ -712,16 +713,16 @@
 		case 0x95:
 			if(AICA->Master)
 			{
-				AICA->TimPris[1]=1<<((AICA->udata.data[0x92/2]>>8)&0x7);
-				AICA->TimCnt[1]=(AICA->udata.data[0x92/2]&0xff)<<8;
+				AICA->TimPris[1]=1<<((AICA->udata.data[0x94/2]>>8)&0x7);
+				AICA->TimCnt[1]=(AICA->udata.data[0x94/2]&0xff)<<8;
 			}
 			break;
 		case 0x98:
 		case 0x99:
 			if(AICA->Master)
 			{
-				AICA->TimPris[2]=1<<((AICA->udata.data[0x94/2]>>8)&0x7);
-				AICA->TimCnt[2]=(AICA->udata.data[0x94/2]&0xff)<<8;
+				AICA->TimPris[2]=1<<((AICA->udata.data[0x98/2]>>8)&0x7);
+				AICA->TimCnt[2]=(AICA->udata.data[0x98/2]&0xff)<<8;
 			}
 			break;
 		case 0xa4:	//SCIRE
@@ -912,7 +913,7 @@
 {
 	if(AICA->TimCnt[0]<=0xff00)
 	{
- 		AICA->TimCnt[0] += ticks << (8-((AICA->udata.data[0x18/2]>>8)&0x7));
+ 		AICA->TimCnt[0] += ticks << (8-((AICA->udata.data[0x90/2]>>8)&0x7));
 		if (AICA->TimCnt[0] > 0xFF00)
 		{
 			AICA->TimCnt[0] = 0xFFFF;
@@ -924,7 +925,7 @@
 
 	if(AICA->TimCnt[1]<=0xff00)
 	{
-		AICA->TimCnt[1] += ticks << (8-((AICA->udata.data[0x1a/2]>>8)&0x7));
+		AICA->TimCnt[1] += ticks << (8-((AICA->udata.data[0x94/2]>>8)&0x7));
 		if (AICA->TimCnt[1] > 0xFF00)
 		{
 			AICA->TimCnt[1] = 0xFFFF;
@@ -936,7 +937,7 @@
 
 	if(AICA->TimCnt[2]<=0xff00)
 	{
-		AICA->TimCnt[2] += ticks << (8-((AICA->udata.data[0x1c/2]>>8)&0x7));
+		AICA->TimCnt[2] += ticks << (8-((AICA->udata.data[0x98/2]>>8)&0x7));
 		if (AICA->TimCnt[2] > 0xFF00)
 		{
 			AICA->TimCnt[2] = 0xFFFF;
@@ -1096,7 +1097,7 @@
 		if (!(AFSEL(AICA)))
 		{
 			AICA->udata.data[0x10/2] |= slot->EG.state<<13;
-			AICA->udata.data[0x10/2] |= 0x3FF - (slot->EG.volume>>EG_SHIFT);
+			//AICA->udata.data[0x10/2] |= 0x3FF - (slot->EG.volume>>EG_SHIFT);
 		}
 	}
 


test data:
http://www.snesmusic.org/hoot/kingshriek/other/dsfdtpk_test.zip

Re: AO SDK release 1.4.4 available [Re: kingshriek] #45890 10/30/08 07:55 AM
Joined: Nov 2003
Posts: 459
K
Knurek Offline
Senior Member
Offline
Senior Member
K
Joined: Nov 2003
Posts: 459
Great news, since the driver is used in most Naomi games and a few DC ones too to boot (Guilty Gear X, Shenmue IIRC).

Should I upload the music data from other games for you to play with?

Re: AO SDK release 1.4.4 available [Re: Knurek] #45892 10/30/08 12:29 PM
Joined: Feb 2008
Posts: 107
D
Deunan Knute Offline
Senior Member
Offline
Senior Member
D
Joined: Feb 2008
Posts: 107
It would seem my code can play that test DSF just fine. Well, at the very least I don't have to worry about those SCSP copy/paste bugs smile

As for AEG monitor... I don't think it can be fixed. AO treats AEG like a fancy addition to volume control but it's way more than that.
I do have an idea though: AO only keeps track of the EG volume and uses 10 bits for that, meaning it can go from 0 to 1023 (and back). However the AEG internal state counter range is only 0 to 959. Try either masking, or better yet - rescaling, the value that's being put into the monitoring register. It's a hack but it might just be enough to fool the driver.

Re: AO SDK release 1.4.4 available [Re: Deunan Knute] #45893 10/30/08 01:25 PM
Joined: Mar 2001
Posts: 16,337
R
R. Belmont Offline OP
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,337
"I don't think it can be fixed"? Dude, it's only code.

Re: AO SDK release 1.4.4 available [Re: R. Belmont] #45894 10/30/08 02:16 PM
Joined: Feb 2008
Posts: 107
D
Deunan Knute Offline
Senior Member
Offline
Senior Member
D
Joined: Feb 2008
Posts: 107
Semantics. This all depends on your definition of a "fix".
What I'm trying to say here is the algorithm behind that code is at fault, so this particular problem would require a "change" (not a trivial one IMO) rather than a "fix".

Re: AO SDK release 1.4.4 available [Re: Deunan Knute] #45895 10/30/08 02:37 PM
Joined: Mar 2001
Posts: 16,337
R
R. Belmont Offline OP
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,337
My definition of a "fix" is "correct operation of the emulated hardware" (more than ever given that the hack for Segagaga is what broke VF3). We're trying to advance the (only) working public emulation of the AICA here. If you have patches or pseudocode or anything else that's helpful towards that end I'd love to hear it. "It's not as good as Makaron and I don't think it can be fixed" is not really what I'm looking for smile

Re: AO SDK release 1.4.4 available [Re: R. Belmont] #45902 10/30/08 05:06 PM
Joined: Feb 2008
Posts: 107
D
Deunan Knute Offline
Senior Member
Offline
Senior Member
D
Joined: Feb 2008
Posts: 107
Thing is, it's such a mess I don't know where to begin...
AO's AICA more or less worked without AEG in it at first - and that is the root of all evil. Don't take me wrong - my own code was like that too, once. In short: if you can key on/off channels and set volume without emulating AEG, it's a hack.
Only when I added AEG to my code I could finally make it behave like the hardware would. But that was a big move, one I call a rewrite. Definitely not a "fix".

You should start with Corlett's document on AICA. The perfect timings on AEG are a nice touch, but not required. You can go with the values from SEGA docs too and noone would be the wiser. I you really want perfect timing that's another level of difficulty.
If you want I can provide you with my AICA sources. Though this time only for reference and not to be directly included into any open source project. And don't go thinking it'd be piece of cake to figure it out just because you got the ARM7 core running smile

Re: AO SDK release 1.4.4 available [Re: Deunan Knute] #45903 10/30/08 05:36 PM
Joined: Mar 2001
Posts: 16,337
R
R. Belmont Offline OP
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,337
Cool. I know I have Corlett's document someplace, I'm just not sure where wink

Page 34 of 55 1 2 32 33 34 35 36 54 55

Moderated by  R. Belmont, Richard Bannister 

Who's Online Now
4 registered members (Edstrom, belegdol, JonasP, Dorando), 34 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,693
Posts114,287
Members4,865
Most Online510
Aug 26th, 2019
Powered by UBB.threads™ PHP Forum Software 7.7.3