From 87d8585b65d3a3d4ba62e53c7d7aeecc49a05862 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Thu, 1 Jan 2026 08:45:21 +0100 Subject: [PATCH] map: Fixed tile march for far wall/door rendering --- src/map.s | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/map.s b/src/map.s index 29827a4..443518a 100644 --- a/src/map.s +++ b/src/map.s @@ -462,13 +462,15 @@ map_get_tile_march: ; either draws a wall or an open space ; depending on the door state map_full_draw_far_center: + ld de, player map_load_march_vec dir_vector_forward ld a, 1 - ld de, player call map_get_tile_march ; hl = tile ahead ld de, t_flags0 add hl, de + + ; load forward direction bit ld b, [hl] ld a, [dir_tf_forward] and a, b ; mask out forward door bit @@ -481,12 +483,34 @@ map_full_draw_far_center: ld a, 3 jp tiles_block_copy @no_door: - ld hl, render_buffer + RENDER_BUF_W * 5 + 8 ld de, far_center_wall ld bc, RENDER_BUF_W - 4 ld a, 3 jp tiles_block_copy + + + ; draws a near wall or doo +map_full_draw_near_center: + ; near is just the current tile, no need for march load + ld a, [player+act_pos_y] + ld b, a + ld a, [player+act_pos_x] + ld c, a + call map_get_tile + ; hl = tile + ld de, t_flags0 + + ; get forward direction flag + add hl, de + ld b, [hl] + ld a, [dir_tf_forward] + + ret z ; do nothing if there is an opening + +@no_door: + ret + ; draws a full map copy into the current map view buffer ; based on the current location the player is facing @@ -510,6 +534,9 @@ map_full_draw: ; either draw a wall or a door ahead call map_full_draw_far_center + ; draw near wall or door + call map_full_draw_near_center + @done: call minimap_full_draw -- 2.30.2