From 0f4eb7ea43b4d9be20cf4153be611a528a6aa73a Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 19 Dec 2025 16:02:28 +0100 Subject: [PATCH] map: turning now causes oam to be cleared This prevents actors from drawing on top of a wall when turning --- src/map.s | 14 ++++++++++++++ src/player.s | 4 ++++ src/update.s | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/src/map.s b/src/map.s index 811811e..d38df5a 100644 --- a/src/map.s +++ b/src/map.s @@ -523,6 +523,19 @@ _map_full_draw_near_doors: @no_near_right: ret + ; optional: + ; clear oam and redraw only UI + ; should be run when the actor turns +map_full_draw_oam_clear: + ; first clear nearby actors from oam + call shadow_oam_clear + ; draw UI again + call compass_draw + call next_vblank_wait + ; dma empty oam + call OAMDMAFN + ret + ; draws a full map copy into the current map view buffer ; bsed on the current location the player is facing ; the map render buffer is then written to the screen @@ -536,6 +549,7 @@ _map_full_draw_near_doors: ; render_buffer: new map data to be drawn ; transferts to redraw state map_full_draw: + ; now we can draw the map call map_full_draw_count_forward_attributes ld a, [tmp_map_forward] diff --git a/src/player.s b/src/player.s index 46af4c0..1d2815f 100644 --- a/src/player.s +++ b/src/player.s @@ -55,6 +55,8 @@ player_handle_move: and a, ~ACT_DIR_MASK & 0xFF or a, b ld [player+act_dir], a + + call map_full_draw_oam_clear call map_full_draw @not_left: @@ -73,6 +75,8 @@ player_handle_move: and a, ~ACT_DIR_MASK & 0xFF or a, b ld [player+act_dir], a + + call map_full_draw_oam_clear call map_full_draw @not_right: diff --git a/src/update.s b/src/update.s index 97cf885..619a100 100644 --- a/src/update.s +++ b/src/update.s @@ -50,6 +50,10 @@ update_game: call ui_update + + ; draws visible act and props + ; for the current frame +update_game_draw_act_and_prop: ; TODO: update map routine _update_game_draw_act near _update_game_draw_act far -- 2.30.2