11 March 2016 - Forum Rules

Main Menu

BGB Breakpoints

Started by jonahstrix, July 12, 2018, 02:43:50 PM

Previous topic - Next topic


I'm starting to experiment in the BGB debugger. I'm just experimenting with a shop in order to find the source of the of the item cost.

Is anyone able to explain the distinction between F3(run line) and F7(trace)? When I step through with F3, suddenly it jumps to my breakpoint and skips the steps where the registers are loaded with the price. Trace on the other hand goes through numerous loops (likely display) and never seems to get back to the store function.


F7 will 'trace into' sub-routines and F3 will 'step over' them. A stepped over routine will still be executed - it's simply not visualized.

When you hit a break-point, use F7 to continue the trace. If you notice that you are 'caught in a loop' it is usually a line with a jump-command that sends you 'back up' in the code execution.

Place a new break-point just after/below the jump and activate the game-screen to hit the break-point. With a little luck you have exited the loop and can continue your tracing with F7.



That's what I thought. I just really couldn't follow the operations.
Luckily I was able to figured out what I wanted once I realized addresses FF00 were also WRAM.

Now I need to figure out how to find tile sprite pointers..


You might also consider using Visualboy Advance Tracer to get a trace log of the instructions for more context and use BGB to dial into specific pieces of code.
Twilight Translations - More than just Dragonball Z. :P