From 8f81de41ce5c3379bf9c4243b21f20edbcc3683b Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 5 Oct 2025 12:07:05 +0200 Subject: [PATCH] map: Added map enable scroll if all enemis are defeated check --- src/map.s | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/map.s b/src/map.s index 14be493..5803601 100644 --- a/src/map.s +++ b/src/map.s @@ -255,11 +255,33 @@ map_r_nop: ; checks if all enemies are defeated ; and re-enables scroll map_r_enable_scroll_all_enemies_defeated: + ; check if all enemies are NULL actors + ld hl, actors_enemy + ld de, act_size + ld b, ACTS_ENEMY + + xor a, a +@check_loop: + ; or type into a + or a, [hl] + ret nz ; one type is not 0 + add hl, de ; next actor + dec b + jr nz, @check_loop REL + ld a, [map_anim_timer] cp a, 0 jp z, @no_animation - ; TODO call map_arrow_indicator + + ld a, [map_anim_timer] + cp a, 0 + ret nz ; if timer is not 0 do not set scroll + + ; re-enable scroll + ld a, [game_flags] + and a, ~GPF_NO_SCROLL & 0xFF + ld [game_flags], a ret @no_animation: -- 2.30.2