WP-109: Phantom’s well in the maze, played (Gen 1)
Status: ✅ Done (2026-11-28). Fork PR barefootbetters/scummvm#32 merged on 2026-11-28 (merge commit 72eb81926d).
Phase: 5 (a room checked only by calling its class, played)
Depends on: WP-075 ✅ (the port of the maze interior), WP-092 ✅ (the well’s Jester), WP-099 ✅ (the balcony’s door, the same pattern)
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-109-2026-11-28. Required: the packet modifies engines/terraglyph/**.
Targets generation(s): Gen 1, Phantom of the Knight only.
Estimated effort: Two hours
Goal
Play the well in the maze (ROOM_P22_Well_In_Maze, class 0x42C740, vtable
0x45F404) through the engine’s mouse and tick, against the decompile, and fix
what differs. The yellow ball is found here, and the Jester takes it. The rope
used on the well opens the climb down to the mermaid’s cavern.
WP-075 ported the room and
WP-092 gave it its Jester. The well’s checks called the
class’s event() directly. WP-108 played the
fountain next to it and named the well as next.
What differed
The balcony’s door (WP-099) is the same pattern for the blue ball, and WP-099 already ported it the original’s way. The well differed from the original in three places:
- The yellow ball’s movie (
0x42C8E0). The original testsgame+0x25C, which the format doc’s anchored flag table namesBlueBallFound: movie0x42(66) while it is clear,4once the blue ball is found. The fork testedYellowBallFound. That flag is always clear while the ball can be clicked (the claim removes the ball once it’s set), so movie 4 never played. The fork’s own header comment saidgame+0x25c. The door does the same in mirror: its blue ball plays 2, or 67 once the yellow is found. - The return after it (
0x42C810). The next entry, unless the full bottle has been used, requests the room loaded (game+0x04, the well itself) through movie 57. It compares that room’s name withROOM_P07_Royal_Galleryonly to choose 54 instead. WP-092 read the comparison’s string as the destination, so the fork sent the gang to the royal gallery. The door’s return (0x4107F0) is the same code, and WP-099 ported it as the room loaded. - The Jester’s placement (
0x42CA20). A placement whose first ten characters areOBJ_JESTERis claimed and not built until the yellow ball is found (game+0x25D). So he appears only to take it, as at the door (0x4108C0). The fork always built him.
The rest matched: the well’s three lines, the rope on the well (movie 0x3B,
59), the rope-gated climb, the reset, and the tick (the Jester’s).
Scope
In scope: fork maze_interior_rooms.{h,cpp} (the three fixes) and
maze_interior_check.cpp (the played section, and two older lines that
change on purpose); this packet, its pre-flight, correction notes in WP-092,
WP-075 and scooby-exe.md, and the index row.
Out of scope: what movies 4, 57 and 66 show. The engine plays them by number.
Exit criteria
- Expectations first. The new lines and the three differences were written from the decompile before the run.
- Fixed. The three differences.
- Self-test. The new lines match the expectations. Apart from the per-run random keys, only the two older lines changed on purpose differ from the WP-108 run. No new warnings.
- Live. Scripted runs play the yellow ball through to the Jester’s take, and the rope through to the climb.
- Process. The fork PR against
scooby-engineis open (merged later the same day).
Result
Evidence labels: log (a self-test’s debug log), live (session) (a scripted run this session drove and read).
- The fix (source). On
wp-109-well-in-maze(548ebe90df):- the movie tests
BlueBallFound; - the return requests the room loaded, with the door’s code;
- the claim skips
OBJ_JESTER*until the yellow ball is found.
- the movie tests
- Self-test (log). The new lines:
- Entry:
ball 1; Jester present 0; well requires 1; TO_P21 0, WELL_ROPE 0; TO_P06 to ROOM_Hedge_Maze; WellVisited 1; opening none. - Clicks on the well:
Well_in_Maze.290_,Well_In_Maze.330X1_,Well_In_Maze.330X2_,Well_in_Maze.290_. - The ball: first
ROOM_P22_Well_In_Maze movie 66, withYellowBallFound 1and a return pending. Entered again,movie 57. Entered again, the Jester is present and playsANIM_JESTER_BTAKES_YELLOW;YellowBallTaken 1, and the ball is gone. - The blue ball found first:
movie 4. - The full bottle used: movie 66, then no bounce, and the Jester takes it.
- The rope on the well:
movie 59, the rope in no slot (still held), and the cursor is the arrow. Entered again: no well, the rope sprite, andTO_P21toROOM_P21_Mermaids_Cavern, which takes the gang there. - The exit:
TO_P06 -> ROOM_Hedge_Maze movie -1.
The two older lines that changed on purpose:
Well jester: present 0(waspresent 1; a click: one of his five lines 1);Well jester bounce: to ROOM_P22_Well_In_Maze movie 57(wasROOM_P07_Royal_Gallery).
The rest matches the WP-108 run (
50e43fc) except for the per-run random keys. 18 warnings in both, and no build warnings in the engine. - Entry:
- What failed first. The first run printed
YellowBallFound 0, pending 0after the ball, and the rope still in a slot. Both were read in the same call that ran the ticks, and C++ doesn’t fix the order a call’s arguments are evaluated in. That’s the same slip as WP-099’s. The check now takes each result before printing it. The Jester’s take showed asno takebecause his entry starts it before the first tick; the check now reads it at entry. None of these were the game. - Live (session). Two scripted runs started in the well with the rope:
- The ball: the first click missed the small ball. A hover sweep placed
it at (487, 390). Clicked there, the log has
the yellow ball, movie 66, thenwell: to ROOM_P22_Well_In_Maze, movie 57, then the Jester placed andANIM_JESTER_BTAKES_YELLOW. The screenshots show the ball by the well and no Jester before, and the Jester and no ball after. - The rope: picked from the toolbar and used on the well, it plays
movie 59. The well comes back withOBJ_P22_WELLunbuilt and the rope hanging in the well (screenshot).
- The ball: the first click missed the small ball. A hover sweep placed
it at (487, 390). Clicked there, the log has
Deliverables
- Fork:
wp-109-well-in-maze, PR barefootbetters/scummvm#32 (548ebe90df), merged on 2026-11-28 as72eb81926d; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:maze_interior_rooms.h,maze_interior_rooms.cpp,maze_interior_check.cpp. - Docs: this packet, its pre-flight, the correction notes in WP-092, WP-075
and
scooby-exe.md, and the index row. - Local only: the self-test and live logs, the screenshots, and the expected text.