From 221643b7a684d2cd9848397413d41f3a7e49daa7 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Wed, 19 Nov 2025 05:14:12 +0100 Subject: [PATCH] debug: wip added renderer for current tile --- src/debug.s | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/debug.s b/src/debug.s index c3703ce..416e2fa 100644 --- a/src/debug.s +++ b/src/debug.s @@ -40,6 +40,7 @@ debug_update: ; draw current update tile ; using a cursor + call debug_current_tile_draw @poll_toggle_debug: ; debug mode can be enabled by pressing select 4 times in a @@ -83,3 +84,39 @@ debug_update: xor a, a ld [debug_enable_count], a ret + + ; draws a cursor at the location + ; of the current update tile +debug_current_tile_draw: + ld a, 1 + call oamalloc + + ; y position + ld a, [scroll_y] + ld b, a + + ld a, [current_tile_y] + mul16 a + add a, OBJ_OFF_Y + sub a, b ; - scroll + ld [hl+], a + + ; x pos + ld a, [scroll_x] + ld b, a + + ld a, [current_tile_x] + mul16 a + add a, OBJ_OFF_X + sub a, b ; - scroll x + + ld [hl+], a + + ; tile + ld a, PLAYER_CURSOR_L + ld [hl+], a + + ; flags + xor a, a + ld [hl+], a + ret -- 2.30.2