From 94db9142ccb4d1467585e0887cb46df048abd018 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Mon, 23 Dec 2024 09:02:49 +0100 Subject: [PATCH] WIP: exit direction selection --- src/map.s | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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: -- 2.30.2