News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: No$GBA debugger right after system boot  (Read 1975 times)

Bregalad

  • Hero Member
  • *****
  • Posts: 2747
    • View Profile
No$GBA debugger right after system boot
« on: March 07, 2016, 04:37:01 pm »
I'd want to use the No$ GBA debugger right when the system boots, because I am hacking an IRQ routine in a GBA game, and because of course I did something wrong (something wrong always happen ;) then the game crashes immediately.

I'd like to trace exactly what happens on the first IRQ execution of the routine, but unfortunately with no$ GBA this seems to be impossible. You need to boot the game, where the debugger is disabled, and only after the first "pause" the debugger can be enabled.

The problem is that no matter how fast I pause after hitting the "reset&run" button, the crash already happened. Why isn't there a "reset& NOT run" button? That'd be very useful.

How can I debug that IRQ routine with either no$GBA or anything else?

FAST6191

  • Hero Member
  • *****
  • Posts: 2898
    • View Profile
Re: No$GBA debugger right after system boot
« Reply #1 on: March 07, 2016, 04:52:47 pm »
If no$gba does not have it (and off the top of my head VBA-sdl-h does not have it either, not sure if the others have a run to line option or if I am remembering one of the DS ones) then what about a workaround? Depending upon the intro maker for games they would often completely subvert things with an almost self contained program and have its own IO and everything before dumping you back where the opening jump would normally have got you and having the game set up its IO and proceed as usual.

On IRQ then maybe also grab a copy of BOMA (boot-o-matic advance) if it is still out there somewhere. It is mainly used to add in a button combo for reset commands but might be useful here.

Gemini

  • Hero Member
  • *****
  • Posts: 2024
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: No$GBA debugger right after system boot
« Reply #2 on: March 07, 2016, 06:20:16 pm »
no$gba doesn't reset breakpoints upon hard reset. Just let it crash, add your breakpoint, reset, and wait for it to hit the IRQ code.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

STARWIN

  • Sr. Member
  • ****
  • Posts: 452
    • View Profile
Re: No$GBA debugger right after system boot
« Reply #3 on: March 07, 2016, 06:31:25 pm »
Isn't there an "Autostart Cartridge" option in the screen where you select the ROM for this purpose?

Bregalad

  • Hero Member
  • *****
  • Posts: 2747
    • View Profile
Re: No$GBA debugger right after system boot
« Reply #4 on: March 08, 2016, 04:14:32 am »
no$gba doesn't reset breakpoints upon hard reset. Just let it crash, add your breakpoint, reset, and wait for it to hit the IRQ code.
I of course already tried that, but the breakpoint while not resetted are disabled before the first pause. Maybe it's a bug in the debugger (how ironic) or maybe it's intended, but in all cases it's a major annoyance. Just try by yourself and see if you have the same issue, or if that issue is just for me ?

Quote
Isn't there an "Autostart Cartridge" option in the screen where you select the ROM for this purpose?
That's great, but for some reason it doesn't seem to allow breapoint at the first "run", but only the second. How weird/strange.
« Last Edit: March 08, 2016, 10:05:39 am by Bregalad »

STARWIN

  • Sr. Member
  • ****
  • Posts: 452
    • View Profile
Re: No$GBA debugger right after system boot
« Reply #5 on: March 08, 2016, 06:54:41 am »
If the first thing I do is setting an exec breakpoint, it triggers normally for me during the first run. If it really wants to execute for a moment, either try F7 to step some instructions or set a breakpoint in the earliest routine so that it has then "ran" once for your "real" breakpoint. Although at that point it sounds like something strange with the breakpoint itself that you try to trigger.

Gemini

  • Hero Member
  • *****
  • Posts: 2024
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: No$GBA debugger right after system boot
« Reply #6 on: March 08, 2016, 09:04:05 am »
Could be executing a different IRQ handler at boot, making the known breakpoint fail.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Bregalad

  • Hero Member
  • *****
  • Posts: 2747
    • View Profile
Re: No$GBA debugger right after system boot
« Reply #7 on: March 08, 2016, 10:06:57 am »
Well, nevermind, it seems the problem was a branch instruction revered, I fixed the problem of the IRQ routine. Thanks guys.