From: Lukas Krickl Date: Sun, 5 Oct 2025 10:07:05 +0000 (+0200) Subject: map: Added map enable scroll if all enemis are defeated check X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=8f81de41ce5c3379bf9c4243b21f20edbcc3683b;p=gbrg%2F.git map: Added map enable scroll if all enemis are defeated check --- 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: