aboutsummaryrefslogtreecommitdiffstats
path: root/engine/warp_menu.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/warp_menu.asm')
-rw-r--r--engine/warp_menu.asm17
1 files changed, 17 insertions, 0 deletions
diff --git a/engine/warp_menu.asm b/engine/warp_menu.asm
new file mode 100644
index 00000000..17cc3904
--- /dev/null
+++ b/engine/warp_menu.asm
@@ -0,0 +1,17 @@
+; Quick-warp menu, opened with SELECT in the overworld (hooked in
+; home/overworld.asm). Reuses the game's fly-warp machinery: set the
+; destination map and the fly-warp flags, then return to the overworld loop,
+; which fades out and warps us in at the destination's fly coordinates.
+
+SECTION "Warp Menu", ROMX
+
+WarpMenu::
+; B1 (pipeline validation): unconditionally warp to Pallet Town.
+ ld a, PALLET_TOWN
+ ld [wDestinationMap], a
+ ld hl, wStatusFlags6
+ set BIT_FLY_WARP, [hl]
+ ASSERT wStatusFlags6 + 1 == wStatusFlags7
+ inc hl
+ set BIT_USED_FLY, [hl]
+ ret