Previous Thread
Next Thread
Print Thread
Page 20 of 55 1 2 18 19 20 21 22 54 55
Re: AO SDK release 1.3.2 available [Re: Deunan Knute] #38440 02/15/08 11:21 PM
Joined: Mar 2001
Posts: 16,521
R
R. Belmont Offline OP
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,521
LOL :-)

Re: AO SDK release 1.3.2 available [Re: R. Belmont] #38441 02/16/08 01:21 AM
Joined: Feb 2008
Posts: 107
D
Deunan Knute Offline
Senior Member
Offline
Senior Member
D
Joined: Feb 2008
Posts: 107
Long story short: my bad. Both AO and Makaron will produce misaligned reads, it's just I take advantage of Intel CPUs being able to read any memory location for any data size. That means the LSB is always correct, whether you read as-is or align and rotate - and this is what counts for ARM programs. And RBOD will not rotate twice, because it masks address bits before it calls arm7_read_32, so the IF in there is always false.

The problem was, I was trying to be smart and since arm7_read_32 does rotation I thought I could kick RBOD out. Bad move. There was a bug in arm7_read_32, it was rotating all right but was not masking the adddress for the read... Didn't notice it at all.

Anyway, RBOD is back and stays, arm7_read_32 is fixed just in case. Everything seems to work again. I'll send you new sources via mail because the diff would be bigger then the file itself. Keep a copy though, somehow I no longer feel so confident about this stuff smile

Re: AO SDK release 1.3.2 available [Re: Deunan Knute] #38444 02/16/08 01:40 AM
Joined: Mar 2001
Posts: 16,521
R
R. Belmont Offline OP
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,521
Yeah, working with ARM emulation gives me that feeling too smile Thanks!

Re: AO SDK release 1.3.2 available [Re: Deunan Knute] #38445 02/16/08 01:40 AM
Joined: Jan 2006
Posts: 3,687
etabeta78 Offline
Very Senior Member
Offline
Very Senior Member
Joined: Jan 2006
Posts: 3,687
oh well, at least having two independent source code bases allowed to compare all this stuff and to improve both where needed... it's a win-win situation (even if sometimes a bit frustrating when you keep rewriting small bits and testing tons of instruction on the CPU...)

Re: AO SDK release 1.3.2 available [Re: R. Belmont] #38459 02/16/08 07:07 AM
Joined: Sep 2007
Posts: 56
K
kingshriek Offline
Member
Offline
Member
K
Joined: Sep 2007
Posts: 56
Originally Posted By R. Belmont
Right, but the real Gunbird 2 game may not use the same sound driver program as the DSF rip[1]. That would presumably affect if unaligned access occured or not. Try this: boot GB2, dump AICA RAM once it starts playing, and check for the driver version string near the top of RAM. Or alternatively, have AOSDK dump a RAM image, load that into Makaron, and see if unaligned accesses occur.

[1] Most DSF rips use version 2.50 because it's known where to patch that version so it doesn't clear the SH4 command buffer before reading it, and it's assumed the sequence data remained compatible. In order to be more accurate games should probably be ripped with the real driver they shipped with, but in practice that hasn't turned out to make much difference (Neill Corlett's Skies of Arcadia test DSF using the game's driver does seem to sound subtly different from KS's full rip using 2.50 but I could be hallucinating ;-)


I can confirm that the Gunbird 2 rip uses the same sound driver as the game. The sound formats it uses are actually incompatible with the ver. 2.50 driver.

Byte 4 in the 0x20-byte music data headers is an indicator of the sound data format, so there shouldn't be any major incompatibility issues using a different driver version as long as this value is same. The driver checks this value with what it expects and will reject loading sound data if it is different. Other than Gunbird 2, all of the Dreamcast games I've seen have a value of 2 for this byte (Gunbird 2 has value 1).

I've disassembled enough of the manatee driver so that I know how to modify the patches so that they work with different versions. I'll try Skies of Arcadia using the original driver and see if that helps things. The Skies of Arcadia driver is named bonito.drv, so there may be a significant enough difference from manatee.drv 2.50 even though they have the same sound format indicator.

Re: AO SDK release 1.3.2 available [Re: kingshriek] #38460 02/16/08 09:53 AM
Joined: Mar 2001
Posts: 16,521
R
R. Belmont Offline OP
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,521
Yeah, it turns out there was no behavior difference after all between AO and Makaron with Gunbird anyway, so it was all a false alarm on that front. Kinda weird that the DC driver changed that much given how relatively similar all the Saturn SDDRVS.TSK versions were.

And I still could be hallucinating re: SoA smile

Re: AO SDK release 1.3.2 available [Re: R. Belmont] #38466 02/16/08 02:59 PM
Joined: Feb 2008
Posts: 107
D
Deunan Knute Offline
Senior Member
Offline
Senior Member
D
Joined: Feb 2008
Posts: 107
Sakura Wars for Dreamcast has some sequenced music too. I've just ripped the files from bonus GD and will send them to KS in a moment. This should be interesting, as it was originally Saturn game but got remade for DC. I assume the music was converted too and wonder what the difference would be.

The MANATEE is 2000.03.03 ver.2.02.05.00.

Re: AO SDK release 1.3.2 available [Re: Deunan Knute] #38496 02/17/08 10:00 PM
Joined: Mar 2001
Posts: 16,521
R
R. Belmont Offline OP
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,521
I got MAME's ARM core to write correct DISDL/DIPAN values now - unaligned 32-bit reads weren't masking the low bits before issuing the read to do the rotation on, and manatee.drv relies on it. (On the GBA side, that gets Ashita No Joe to boot and play instead of crashing).

Last edited by R. Belmont; 02/17/08 10:04 PM.
Re: AO SDK release 1.3.2 available [Re: R. Belmont] #38504 02/18/08 12:03 AM
Joined: Feb 2008
Posts: 107
D
Deunan Knute Offline
Senior Member
Offline
Senior Member
D
Joined: Feb 2008
Posts: 107
So it's the same one that creeped into arm7_read_32? smile
I tested that SUB PC,4 again and found out I got the opcode wrong. In the end this instruction takes 3 cycles just as any jump would. Also, barrel shifter should add .5 to any instruction using register count.

Code:
diff -Nru old/arm7i.c new/arm7i.c
--- old/arm7i.c	2008-02-18 00:47:09.000000000 +0100
+++ new/arm7i.c	2008-02-18 00:48:03.000000000 +0100
@@ -335,6 +335,7 @@
 
   if (ARM7.kod & (1 << 4))
     {
+    s_cykle++;
     // shift count in Rs (8 lowest bits)
     if (Rm != ARM7_PC)
       w = ARM7.Rx [Rm];
@@ -890,7 +891,7 @@
     {
     if (Rd == ARM7_PC)
       {
-      s_cykle++;
+      s_cykle += 4;
       // copy current SPSR to CPSR
       ARM7_SetCPSR (ARM7.Rx [ARM7_SPSR]);
       }


This needs to be patched against the source I've sent via mail. I think there were some Polish leftovers in that code, but just a line or two. I had double definitions and it didn't throw an error on compile. Let me just remind you that ARM7_Execute now needs to be fed with twice the number of cycles you want to run. This is to allow for all those .5 differences.

Re: AO SDK release 1.3.2 available [Re: Deunan Knute] #38506 02/18/08 12:56 AM
Joined: Mar 2001
Posts: 16,521
R
R. Belmont Offline OP
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,521
Yeah smile New interesting thing - I put the AICA into MAME and the Naomi BIOS sound test is generating weird values - it's keying on a sample with OCT=0 FNS=0 for the left speaker test, which obviously makes no noise. That's *got* to be an ARM7 bug I would think. The Naomi boot logo plays the appropriate sounds though :-)

Page 20 of 55 1 2 18 19 20 21 22 54 55

Moderated by  R. Belmont, Richard Bannister 

Who's Online Now
3 registered members (Darkstar, Richard Bannister, 1 invisible), 59 guests, and 3 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,782
Posts115,558
Members4,908
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3