Table of Contents

Debugging your Program

The GameTank emulator contains a few tools to debug your program:

Setting Breakpoints

Setting breakpoints in Code Stepper isn't always easy when the program was written in C. Here is a tip to create breakpoints:

  void breakpoint() {}
  
  int main () {
     ...
     breakpoint();
     // Doing some stuff that needs to be debugged
     ...
  }

Assembly to C

In order to better understand how the assembly code shown in the Code Stepper relates to the original C code:

;
; if (tile_val & 0x20) {
;
L000D:	lda     _tile_val
	and     #$20
	beq     L000E
;
; tmp = 1;
;
	lda     #$01
	sta     _tmp