From f41d1573e3eadf18b83ed6092f2bde4261caf5f3 Mon Sep 17 00:00:00 2001 From: Ash Ketchum Date: Wed, 15 Jul 2026 11:26:07 +0200 Subject: 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. --- engine/slop_menu.asm | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 90 insertions(+), 2 deletions(-) (limited to 'engine') 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 ; =========================================================================== @@ -213,6 +215,92 @@ WarpMapTable: db SAFFRON_CITY, ROUTE_4, ROUTE_10 +; =========================================================================== +; 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) ; =========================================================================== -- cgit v1.3.1-sl0p