From 31bdf0602a195f2d6e477ccc0040c020cfe315ae Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 21 Sep 2025 08:32:27 +0200 Subject: [PATCH] debug: Added stub for debug functions --- src/debug.s | 24 ++++++++++++++++++++++++ src/mem.s | 2 ++ src/rectangle.s | 1 + src/update.s | 2 ++ src/wram.s | 6 ++++++ 5 files changed, 35 insertions(+) diff --git a/src/debug.s b/src/debug.s index e69de29..953b5e6 100644 --- a/src/debug.s +++ b/src/debug.s @@ -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 diff --git a/src/mem.s b/src/mem.s index f2a9485..f442af9 100644 --- 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 diff --git a/src/rectangle.s b/src/rectangle.s index 8b3b22f..74a0ee1 100644 --- a/src/rectangle.s +++ b/src/rectangle.s @@ -111,3 +111,4 @@ rect_test: ; a == 0: not inside rect_point_test: ret + diff --git a/src/update.s b/src/update.s index 74b365b..788b685 100644 --- a/src/update.s +++ b/src/update.s @@ -36,6 +36,8 @@ update: ; reset objects call oamfree_all + call dbg_update + ; load current sate routine ld a, [game_state] ld l, a diff --git a/src/wram.s b/src/wram.s index 9728ae8..6c4f9f2 100644 --- a/src/wram.s +++ b/src/wram.s @@ -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 -- 2.30.2