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.asm57
1 files changed, 39 insertions, 18 deletions
diff --git a/engine/warp_menu.asm b/engine/warp_menu.asm
index d31aba45..38758665 100644
--- a/engine/warp_menu.asm
+++ b/engine/warp_menu.asm
@@ -1,23 +1,35 @@
; Quick-warp menu, opened with SELECT in the overworld (hooked in
-; home/overworld.asm). Draws a town list, and on selection reuses the game's
-; fly-warp machinery (wDestinationMap + BIT_FLY_WARP/BIT_USED_FLY); the
-; overworld loop then fades out and warps us in at the destination fly coords.
+; home/overworld.asm). Hides the overworld sprites, clears the screen, and draws
+; a single-spaced destination list. On selection it reuses the fly-warp
+; machinery (wDestinationMap + BIT_FLY_WARP) to warp in at the destination's
+; fly coordinates. BIT_USED_FLY is deliberately NOT set, so arrival uses the
+; teleport-in animation (the departure bird is redirected to a plain fade in
+; engine/overworld/player_animations.asm).
-DEF WARP_COUNT EQU 10
+DEF WARP_COUNT EQU 13
SECTION "Warp Menu", ROMX
WarpMenu::
- call SaveScreenTilesToBuffer2 ; stash the overworld so we can restore
+; single-space the list text (<NEXT> = 1 row) and the menu cursor
+ ldh a, [hUILayoutFlags]
+ set BIT_SINGLE_SPACED_LINES, a
+ set BIT_DOUBLE_SPACED_MENU, a
+ ldh [hUILayoutFlags], a
+; hide the overworld sprites so nothing shows behind the menu
+ ld a, $ff
+ ld [wUpdateSpritesEnabled], a
+ call ClearSprites
+ call ClearScreen
hlcoord 0, 0
- lb bc, 11, 11
+ lb bc, 13, 11
call TextBoxBorder
hlcoord 2, 1
ld de, WarpMenuText
call PlaceString
-; push wTileMap to VRAM and switch on the menu/window display (the overworld
-; renders the scrolled map straight to VRAM, so without this our box drawn into
-; wTileMap would be invisible - mirrors the tail of DisplayTextIDInit)
+; push wTileMap to VRAM and switch on the menu display (mirrors the tail of
+; DisplayTextIDInit); the overworld renders the scrolled map straight to VRAM,
+; so our box drawn into wTileMap would otherwise be invisible.
ld b, HIGH(vBGMap1)
call CopyScreenTileBufferToVRAM
xor a
@@ -31,16 +43,22 @@ WarpMenu::
ld [wMenuWatchMovingOutOfBounds], a
ld [wMenuJoypadPollCount], a
inc a ; 1
- ld [wTopMenuItemX], a ; cursor column (text is at column 2)
+ ld [wTopMenuItemX], a ; cursor column (text at column 2)
ld [wTopMenuItemY], a ; first item row
ld a, PAD_A | PAD_B
ld [wMenuWatchedKeys], a
ld a, WARP_COUNT - 1
ld [wMaxMenuItem], a
call HandleMenuInput
+ push af ; save pressed keys
+ ldh a, [hUILayoutFlags] ; restore default UI spacing
+ res BIT_SINGLE_SPACED_LINES, a
+ res BIT_DOUBLE_SPACED_MENU, a
+ ldh [hUILayoutFlags], a
+ pop af
bit B_PAD_B, a
jr nz, .cancel
-; A pressed: look up the chosen map id and fire the fly-warp
+; A pressed: look up the chosen map id and fire the fly-warp (no BIT_USED_FLY)
ld a, [wCurrentMenuItem]
ld e, a
ld d, 0
@@ -50,11 +68,10 @@ WarpMenu::
ld [wDestinationMap], a
ld hl, wStatusFlags6
set BIT_FLY_WARP, [hl]
- ASSERT wStatusFlags6 + 1 == wStatusFlags7
- inc hl
- set BIT_USED_FLY, [hl]
ret ; overworld loop performs the warp
.cancel
+ ld a, $01
+ ld [wUpdateSpritesEnabled], a ; re-enable overworld sprites
call LoadScreenTilesFromBuffer2
jp CloseTextDisplay ; redraw the overworld and return
@@ -63,13 +80,17 @@ WarpMenuText:
next "VIRIDIAN"
next "PEWTER"
next "CERULEAN"
+ next "LAVENDER"
next "VERMILION"
next "CELADON"
next "FUCHSIA"
- next "SAFFRON"
next "CINNABAR"
- next "INDIGO@"
+ next "INDIGO"
+ next "SAFFRON"
+ next "ROUTE 4"
+ next "ROUTE 10@"
WarpMapTable:
- db PALLET_TOWN, VIRIDIAN_CITY, PEWTER_CITY, CERULEAN_CITY, VERMILION_CITY
- db CELADON_CITY, FUCHSIA_CITY, SAFFRON_CITY, CINNABAR_ISLAND, INDIGO_PLATEAU
+ db PALLET_TOWN, VIRIDIAN_CITY, PEWTER_CITY, CERULEAN_CITY, LAVENDER_TOWN
+ db VERMILION_CITY, CELADON_CITY, FUCHSIA_CITY, CINNABAR_ISLAND, INDIGO_PLATEAU
+ db SAFFRON_CITY, ROUTE_4, ROUTE_10