diff options
| author | Ash Ketchum <no-reply@sl0p.foo> | 2026-07-15 02:01:51 +0200 |
|---|---|---|
| committer | Ash Ketchum <no-reply@sl0p.foo> | 2026-07-15 02:01:51 +0200 |
| commit | 849fc45bc57e9a1f85c4fa98103ec04991406627 (patch) | |
| tree | 393b2932633e22a9d79fedbd442ef3f05a53159d /engine/warp_menu.asm | |
| parent | intro: real 2bpp graphic splash (POKeMON SL0P EDITION) (diff) | |
| download | pokeyellow-849fc45bc57e9a1f85c4fa98103ec04991406627.tar.gz pokeyellow-849fc45bc57e9a1f85c4fa98103ec04991406627.tar.xz pokeyellow-849fc45bc57e9a1f85c4fa98103ec04991406627.zip | |
menu: SL0P MENU scaffolding with WARP as a submenu
Refactor the flat warp menu into a table-driven top-level SL0P MENU opened by
SELECT. Each entry = a name in SlopMenuText + a routine in SlopMenuHandlers;
handlers return carry set (a warp was started, exit) or clear (back to the
menu). Ships two entries:
WARP -> WarpSubmenu (the 13-destination town list)
HEAL -> SlopHealParty (restore party HP + clear status), demoing an action
Shared open/close display handling (hide sprites, single-space flags, wTileMap
push, restore). Add an entry by appending a name+handler and bumping
SLOP_MENU_COUNT. (renamed engine/warp_menu.asm -> engine/slop_menu.asm)
Diffstat (limited to 'engine/warp_menu.asm')
| -rw-r--r-- | engine/warp_menu.asm | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/engine/warp_menu.asm b/engine/warp_menu.asm deleted file mode 100644 index 1fcca73e..00000000 --- a/engine/warp_menu.asm +++ /dev/null @@ -1,110 +0,0 @@ -; Quick-warp menu, opened with SELECT in the overworld (hooked in -; 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 13 - -SECTION "Warp Menu", ROMX - -WarpMenu:: -; 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 -; banner, two centered lines above the box - hlcoord 4, 0 - ld de, WarpTitleText1 - call PlaceString - hlcoord 5, 1 - ld de, WarpTitleText2 - call PlaceString -; horizontally-centered menu box (screen is 20 wide; box is 13) - hlcoord 3, 2 - lb bc, 13, 11 - call TextBoxBorder - hlcoord 5, 3 - ld de, WarpMenuText - call PlaceString -; 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 - ldh [hWY], a - call LoadFontTilePatterns - ld a, $01 - ldh [hAutoBGTransferEnabled], a - xor a - ld [wCurrentMenuItem], a - ld [wLastMenuItem], a - ld [wMenuWatchMovingOutOfBounds], a - ld [wMenuJoypadPollCount], a - ld a, 4 - ld [wTopMenuItemX], a ; cursor column (text at column 5) - ld a, 3 - 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 (no BIT_USED_FLY) - ld a, [wCurrentMenuItem] - ld e, a - ld d, 0 - ld hl, WarpMapTable - add hl, de - ld a, [hl] - ld [wDestinationMap], a - ld hl, wStatusFlags6 - set BIT_FLY_WARP, [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 - -WarpMenuText: - db "PALLET" - next "VIRIDIAN" - next "PEWTER" - next "CERULEAN" - next "LAVENDER" - next "VERMILION" - next "CELADON" - next "FUCHSIA" - next "CINNABAR" - next "INDIGO" - next "SAFFRON" - next "ROUTE 4" - next "ROUTE 10@" - -WarpMapTable: - 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 - -WarpTitleText1: - db "SECRET SL0P@" -WarpTitleText2: - db "WARP MENU@" |
