debug: Added jp to hl for debug routine
authorLukas Krickl <lukas@krickl.dev>
Sun, 21 Sep 2025 06:34:22 +0000 (08:34 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sun, 21 Sep 2025 06:34:22 +0000 (08:34 +0200)
src/debug.s

index 953b5e61db17067b13c02ef5b28511fde4c8c778..45fa78931e5648e62d42fd2333e9e877adf0a5b1 100644 (file)
@@ -13,8 +13,21 @@ dbg_init:
        ; keys:
        ;               down + select: cycle next debug function 
 dbg_update:
-       call dbg_rect_draw
-       ret
+       ld a, [dbg_fn]
+       add a, a ; * 2 for table offset
+       
+       ld hl, debug_routines
+       ld d, 0
+       ld e, a
+       add hl, de
+
+       ld a, [hl+]
+       ld d, a
+       ld a, [hl]
+       ld h, a
+       ld l, d 
+
+       jp hl
        
        ; draws a marker obj at 
        ; the edge of a rectangle