|
Joined: Nov 2003
Posts: 459
Senior Member
|
Senior Member
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/
|
|
|
|
Joined: Nov 2003
Posts: 459
Senior Member
|
Senior Member
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?).
|
|
|
|
Joined: Sep 2007
Posts: 56
Member
|
Member
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:
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
|
|
|
|
Joined: Nov 2003
Posts: 459
Senior Member
|
Senior Member
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?
|
|
|
|
Joined: Feb 2008
Posts: 107
Senior Member
|
Senior Member
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  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.
|
|
|
|
Joined: Mar 2001
Posts: 17,250 Likes: 265
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,250 Likes: 265 |
"I don't think it can be fixed"? Dude, it's only code.
|
|
|
|
Joined: Feb 2008
Posts: 107
Senior Member
|
Senior Member
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".
|
|
|
|
Joined: Mar 2001
Posts: 17,250 Likes: 265
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,250 Likes: 265 |
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 
|
|
|
|
Joined: Feb 2008
Posts: 107
Senior Member
|
Senior Member
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 
|
|
|
|
Joined: Mar 2001
Posts: 17,250 Likes: 265
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,250 Likes: 265 |
Cool. I know I have Corlett's document someplace, I'm just not sure where 
|
|
|
0 members (),
131
guests, and
0
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,345
Posts122,350
Members5,082
|
Most Online1,283 Dec 21st, 2022
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|