2.9 KiB
2.9 KiB
Issue: Lost Woods Transition Coordinate Desync
Status: Active / Low Priority
Created: March 2026 Impact: Visual/Gameplay discontinuity when exiting the Lost Woods (Area 0x29) back to the West (0x28).
Problem Description
The custom Lost Woods puzzle uses a coordinate manipulation trick (INC/DEC $21, INC/DEC $E7) to simulate an infinite loop.
- Symptoms:
- When completing the puzzle (Exit East -> 0x2A), the fix implemented (
LostWoods_ResetCoordinates) correctly snaps Link to the left edge of the new screen, preventing him from skipping the map. - Regression: When returning to the previous map (Exit West -> 0x28), Link may appear at incorrect coordinates or the camera may be misaligned relative to the player.
- The "Snapping" logic forces Link's X/Y to the base of Area 0x29 (e.g., X=0x0200). However, the transition logic in
ZSCustomOverworld.asmuses these coordinates to calculate the destination position in the new area. If the snap happens too early or incorrectly, the destination calculation (Start X - Offset) might underflow or misalign.
- When completing the puzzle (Exit East -> 0x2A), the fix implemented (
Technical Analysis
Custom Logic (lost_woods.asm)
The puzzle modifies:
$21/$23: Link's High-Byte Coordinates (World Grid Position).$E1/$E7/$E9: Overlay and BG Scroll Registers.
This desynchronizes the "Visible" position from the "Logical" position expected by the standard Overworld engine.
ZSOW Transition Logic
OverworldHandleTransitions in ZSCustomOverworld.asm relies on:
$20/$22: Link's 16-bit absolute coordinates.Pool_OverworldTransitionPositionX/Y: Lookup tables for screen boundaries.
Root Cause Hypothesis
- Coordinate Mismatch: The
LostWoods_ResetCoordinatesroutine snaps Link toX=0x0200(Left edge of 0x29). - Transition Calc: When moving West to 0x28, the engine expects Link to be crossing the boundary.
- Vanilla vs. Custom: Vanilla ALTTP does not use infinite looping coordinates in the overworld. This mechanic is entirely custom and fights the static grid nature of the engine.
Future Investigation Strategy (Reference usdasm)
- Vanilla Transitions: Study
Bank02.asminusdasmto see howModule09_Overworldhandles coordinate handoffs.- Look for
Overworld_ScrollMapandOverworld_HandleCardinalCollision.
- Look for
- Camera Re-centering: Search for routines that "center" the camera on Link after a transition (
Overworld_SetCameraBoundaries). We may need to manually invoke this after the transition logic finishes, rather than snapping coordinates before. - Scroll Register Reset: Instead of zeroing
$E1etc., we might need to recalculate them based on the new area's properties immediately upon load.
Workaround
The bug is non-fatal. Players can navigate out of the area, though the visual transition may be jarring.
Related Files
Overworld/lost_woods.asmOverworld/ZSCustomOverworld.asmusdasm/bank_02.asm(Reference)