From: Lukas Krickl Date: Mon, 23 Dec 2024 08:02:49 +0000 (+0100) Subject: WIP: exit direction selection X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=94db9142ccb4d1467585e0887cb46df048abd018;p=gbrg%2F.git WIP: exit direction selection --- diff --git a/src/map.s b/src/map.s index 3c2efb2..dfe844d 100644 --- a/src/map.s +++ b/src/map.s @@ -71,8 +71,23 @@ room_goto_player_pos: ; compare to expected positions to decide what to do + ; 0/0 == north + xor a, a ; a = 0 + + ; d == 0 && e == 0 + cp a, d + jr nz, @not_north REL + cp a, e + jr nz, @not_north REL + + ; load north as direction + ld a, NORTH + jp room_goto +@not_north: + ; default use special exit ld a, EXIT_SPECIAL + ; no need to jmp in default case ; transitions to a new room ; that is part of the map: