debug: Added stub for debug functions
authorLukas Krickl <lukas@krickl.dev>
Sun, 21 Sep 2025 06:32:27 +0000 (08:32 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sun, 21 Sep 2025 06:32:27 +0000 (08:32 +0200)
src/debug.s
src/mem.s
src/rectangle.s
src/update.s
src/wram.s

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..953b5e61db17067b13c02ef5b28511fde4c8c778 100644 (file)
@@ -0,0 +1,24 @@
+debug_routines:
+       dw dbg_nop
+       dw dbg_rect_draw
+
+dbg_nop:
+       ret
+       
+       ; inits the debug interface
+dbg_init:
+       ret
+
+       ; updates debug options
+       ; keys:
+       ;               down + select: cycle next debug function 
+dbg_update:
+       call dbg_rect_draw
+       ret
+       
+       ; draws a marker obj at 
+       ; the edge of a rectangle
+       ; keys:
+       ;               up + select: cycle to next debug rectangle
+dbg_rect_draw:
+       ret
index f2a9485f0641cb5349c5a749d46bdeafed93483d..f442af9490fcf9122a156120bfdf204e9ba171ef 100644 (file)
--- a/src/mem.s
+++ b/src/mem.s
@@ -29,6 +29,8 @@ mem_init:
        ld hl, new_game 
        call game_set_state
 
+       call dbg_init
+
   ret
 
 ; copies memory from one location to another 
index 8b3b22f990d7d365fe88759726978070ab259b53..74a0ee1f3b91360a759caddeae4e008a586a0995 100644 (file)
@@ -111,3 +111,4 @@ rect_test:
        ;               a == 0: not inside
 rect_point_test:
        ret
+       
index 74b365b307997c50f7bdccafef7d54057d5917c6..788b685ae5daf39e23d8801d33479a4174db2a50 100644 (file)
@@ -36,6 +36,8 @@ update:
   ; reset objects
   call oamfree_all 
 
+       call dbg_update
+
        ; load current sate routine
        ld a, [game_state]
        ld l, a
index 9728ae847c45823a52707c0d59ad3069e7fdec6d..6c4f9f2d491e2c1946eba2f107f590c778928888 100644 (file)
@@ -82,3 +82,9 @@ map_curr_obj: .adv 2
        
        ; current bg pointer to write to
 map_scrn_ptr: .adv 2
+       
+       ; current debug function
+dbg_fn: .adv 1
+
+       ; selected debug rect
+dbg_rect: .adv 2