aboutsummaryrefslogtreecommitdiffstats
path: root/SL0P.md
diff options
context:
space:
mode:
Diffstat (limited to 'SL0P.md')
-rw-r--r--SL0P.md19
1 files changed, 14 insertions, 5 deletions
diff --git a/SL0P.md b/SL0P.md
index 28c2df16..14a2865d 100644
--- a/SL0P.md
+++ b/SL0P.md
@@ -38,7 +38,7 @@ A table-driven cheat menu. Cursor + A to pick, B to back out / close.
| **NOWILD** | toggle wild encounters off (shows `ON`) |
| **REPEL** | refill repel steps |
| **EXPLORE** | a screen-paging overworld camera: each d-pad press smooth-scrolls the next screenful of the world (no walking), gliding across the connected map at each edge. **▲▼◀▶ arrows** show which directions you can move; **A** warps the player onto the tile you're looking at; **B** returns to the menu. |
-| **SAVER** | screensaver: EXPLORE on autopilot. Drifts the camera across the overworld on its own (persistent direction, DFS-ish: keeps going, turns when blocked or occasionally at a junction). Arrows and the player/Pikachu sprites are hidden. Any button wakes it back to the menu. |
+| **SAVER** | screensaver: EXPLORE on autopilot. Drifts the camera across the overworld on its own — keeps a heading until it hits a bound, then turns onto another open direction. Arrows and the player/Pikachu sprites are hidden. Any button wakes it back to the menu. |
Everything is in `engine/slop_menu.asm`. Adding a new entry = add a name to
`SlopMenuText`, a `dw Handler` to `SlopMenuHandlers`, and bump `SLOP_MENU_COUNT`.
@@ -63,10 +63,19 @@ neighbour (one unavoidable load), or stops if there's no connection.
**SAVER** is the same loop with `wSlopSaverDir` set: instead of reading the
d-pad, `SlopSaverPickDir` synthesises a direction into the normal dispatch (so it
-inherits smooth scroll + edge crossing), keeping a persistent heading and only
-turning when blocked or occasionally at a junction (never an immediate U-turn).
-Arrows are skipped, and OAM is cleared + frozen right after every `LoadMapData`
-so the reloaded player/Pikachu are never drawn. Any real button exits.
+inherits smooth scroll + edge crossing), keeping one heading until it's blocked,
+then turning onto a random still-open direction (never an immediate U-turn).
+"Open" (`SlopValidDirMask`) means >= 2 coords of room that way or a connection to
+cross — the >= 2 matters because moves round to even coords and a map's far edge
+is always odd, so a plain `coord != max` test would never register the edge and
+the wander would freeze one step short of it. Arrows are skipped, and OAM is
+cleared + frozen right after every `LoadMapData` so the reloaded player/Pikachu
+are never drawn. Any real button exits.
+
+Crossing a connection applies its alignment offset blindly, so at an edge the
+connection doesn't span the camera can land outside the neighbour; `SlopClampCoords`
+(run after every entry/cross `LoadMapData`) clamps the coords back into
+`[0,maxY] x [0,maxX]` so the view never reads past `wOverworldMap` into garbage.
- **Direction arrows** are 4 OBJ sprites in `wShadowOAM` using the font's down/
right glyphs (`$ee`/`$ed`) plus CGB OBJ X/Y-flip for up/left; set