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

Author Topic: BGB Breakpoints  (Read 578 times)

jonahstrix

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
BGB Breakpoints
« on: July 12, 2018, 02:43:50 pm »
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.

dACE

  • Sr. Member
  • ****
  • Posts: 330
    • View Profile
Re: BGB Breakpoints
« Reply #1 on: July 13, 2018, 12:50:35 pm »
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.

/dACE

jonahstrix

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: BGB Breakpoints
« Reply #2 on: August 09, 2018, 12:55:04 am »
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..

RedComet

  • Hero Member
  • *****
  • Posts: 3160
    • View Profile
    • Twilight Translations
Re: BGB Breakpoints
« Reply #3 on: August 09, 2018, 09:23:54 pm »
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