gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

ASM > How do you debug?

#8272 - funkeejeffou - Sun Jul 06, 2003 6:12 pm

I've been writing more than 3000 lines of code in ASM, and debugging using VisualBoyAdvance disassembler is becoming kind of hard.
I've seen that Mappy has a powerful debugger where you can use BreakPoints and Watches, the problem is that my code doesn't run on it...
After searching a while why it wasn't working (as my rom works on all other emulators AND hardware), I've found out that the division from the Mappy bios (SWI 0x60000) overwrites R0, R1 and R2.In every GBA doc, it is said that bios div overwrites r0, r1 and r3; and I took that in consideration while writing my code (in other words, when I use a division, I don' push r3 on the stack).
How can I change the Bios file for Mappy so it will be correct, I've seen there's the option for doing that, but can't find a Bios file...
Otherwise, what debugger do you use?

Thanks

#8273 - tepples - Sun Jul 06, 2003 7:01 pm

You have to use a serial cable and one of those MidiKey2Freq exploits to dump the BIOS from your own GBA system.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#8288 - funkeejeffou - Mon Jul 07, 2003 6:19 am

I've been spending all the night to figure out how to dump the bios, thanks tepples for telling me about the bios call MidiKeyFreq(SWI 0x1F0000 in ARM). The Gbatek gives the formula for reading the bios, very cool, it works, even with a F2A (just need to write the bios in SRAM, then modify it with a C code on PC so you just keep the 16KB).
So now, my bios works on VBA (besides the fact that I must patch my headers :( ), but not on Mappy...
Am I missing something?
Why is Mappy bios 148bytes long (as the bios is 16K)?

I'm going to sleep now, hope someone has done this before and that he'll help me.