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:

  1. The yellow ball’s movie (0x42C8E0). The original tests game+0x25C, which the format doc’s anchored flag table names BlueBallFound: movie 0x42 (66) while it is clear, 4 once the blue ball is found. The fork tested YellowBallFound. 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 said game+0x25c. The door does the same in mirror: its blue ball plays 2, or 67 once the yellow is found.
  2. 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 with ROOM_P07_Royal_Gallery only 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.
  3. The Jester’s placement (0x42CA20). A placement whose first ten characters are OBJ_JESTER is 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

  1. Expectations first. The new lines and the three differences were written from the decompile before the run.
  2. Fixed. The three differences.
  3. 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.
  4. Live. Scripted runs play the yellow ball through to the Jester’s take, and the rope through to the climb.
  5. Process. The fork PR against scooby-engine is 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).

Deliverables