aboutsummaryrefslogtreecommitdiffstats
path: root/engine/slop_menu.asm
diff options
context:
space:
mode:
authorAsh Ketchum <no-reply@sl0p.foo>2026-07-15 11:26:07 +0200
committerAsh Ketchum <no-reply@sl0p.foo>2026-07-15 11:26:07 +0200
commitf41d1573e3eadf18b83ed6092f2bde4261caf5f3 (patch)
tree561109ad62d5dda464e6ec13fc4b41802046c0cf /engine/slop_menu.asm
parentfix(nowild): use wUnusedFlag (0xCC5B) instead of wc5d8 for the toggle (diff)
downloadpokeyellow-f41d1573e3eadf18b83ed6092f2bde4261caf5f3.tar.gz
pokeyellow-f41d1573e3eadf18b83ed6092f2bde4261caf5f3.tar.xz
pokeyellow-f41d1573e3eadf18b83ed6092f2bde4261caf5f3.zip
explore (P1 core): overworld map-connection browser
New EXPLORE entry in the SL0P menu renders any overworld map (LoadMapData, no NPCs, OBJ layer disabled so even the player sprite is hidden), centered on the map. U/D/L/R jump to the connected map in that direction when wCurMapConnections has that flag, following the connection graph (verified Pallet<->Route 1). B restores the origin map + coords and returns to the menu (movement intact). Arrows/indicators next.
Diffstat (limited to 'engine/slop_menu.asm')
-rw-r--r--engine/slop_menu.asm92
1 files changed, 90 insertions, 2 deletions
diff --git a/engine/slop_menu.asm b/engine/slop_menu.asm
index 38c5bdcf..fbcd222a 100644
--- a/engine/slop_menu.asm
+++ b/engine/slop_menu.asm
@@ -8,7 +8,7 @@
; To add an entry: add a "NAME" line to SlopMenuText, a `dw Handler` to
; SlopMenuHandlers, and bump SLOP_MENU_COUNT.
-DEF SLOP_MENU_COUNT EQU 12
+DEF SLOP_MENU_COUNT EQU 13
SECTION "Slop Menu", ROMX
@@ -120,7 +120,8 @@ SlopMenuText:
next "HMS"
next "ITEMS"
next "NOWILD"
- next "REPEL@"
+ next "REPEL"
+ next "EXPLORE@"
SlopOnText:
db "ON@"
SlopMenuHandlers:
@@ -136,6 +137,7 @@ SlopMenuHandlers:
dw GiveItemSubmenu
dw SlopToggleNoWild
dw SlopRepel
+ dw SlopExplore
; ===========================================================================
@@ -214,6 +216,92 @@ WarpMapTable:
; ===========================================================================
+; EXPLORE (P1): overworld map-connection browser. Renders the current map (no
+; NPCs), and U/D/L/R jump to the connected map in that direction if one exists
+; (via wCurMapConnections + the connection headers). B restores the original
+; map and returns to the SL0P menu. No warping yet - read-only browse.
+; ===========================================================================
+SlopExplore:
+; save origin map + coords on the stack
+ ld a, [wYCoord]
+ ld b, a
+ ld a, [wXCoord]
+ ld c, a
+ push bc
+ ld a, [wCurMap]
+ push af
+.render
+; seed safe coords (0,0 is in-bounds for any map), load the map to get its real
+; dimensions + connections, then re-render centered on the map.
+ xor a
+ ld [wYCoord], a
+ ld [wXCoord], a
+ call LoadMapData
+ ld a, [wCurMapHeight]
+ ld [wYCoord], a
+ ld a, [wCurMapWidth]
+ ld [wXCoord], a
+ call LoadMapData ; render centered
+ ldh a, [rLCDC] ; hide ALL sprites (player + actors) via LCDC
+ res B_LCDC_OBJS, a
+ ldh [rLCDC], a
+ ld a, $90
+ ldh [hWY], a ; window off-screen -> the BG map is visible
+.input
+ call DelayFrame
+ call JoypadLowSensitivity
+ ldh a, [hJoyPressed]
+ ld d, a
+ bit B_PAD_B, d
+ jr nz, .exit
+ bit B_PAD_UP, d
+ jr z, .chkDown
+ ld a, [wCurMapConnections]
+ bit NORTH_F, a
+ jr z, .input
+ ld a, [wNorthConnectedMap]
+ ld [wCurMap], a
+ jr .render
+.chkDown
+ bit B_PAD_DOWN, d
+ jr z, .chkLeft
+ ld a, [wCurMapConnections]
+ bit SOUTH_F, a
+ jr z, .input
+ ld a, [wSouthConnectedMap]
+ ld [wCurMap], a
+ jr .render
+.chkLeft
+ bit B_PAD_LEFT, d
+ jr z, .chkRight
+ ld a, [wCurMapConnections]
+ bit WEST_F, a
+ jr z, .input
+ ld a, [wWestConnectedMap]
+ ld [wCurMap], a
+ jr .render
+.chkRight
+ bit B_PAD_RIGHT, d
+ jr z, .input
+ ld a, [wCurMapConnections]
+ bit EAST_F, a
+ jr z, .input
+ ld a, [wEastConnectedMap]
+ ld [wCurMap], a
+ jr .render
+.exit
+ pop af
+ ld [wCurMap], a ; restore origin map
+ pop bc
+ ld a, b
+ ld [wYCoord], a
+ ld a, c
+ ld [wXCoord], a
+ call LoadMapData ; reload the origin map
+ and a ; carry clear -> back to SL0P menu
+ ret
+
+; ===========================================================================
; ITEMS submenu: give 99 of the chosen item (stacks via GiveItem)
; ===========================================================================
DEF GIVE_COUNT EQU 12