; 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
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