WP-092: Phantom’s well and its Jester (Gen 1)

Status: ✅ Done (2026-11-27). Fork PR barefootbetters/scummvm#16 merged on 2026-11-27 (merge commit 8410401169). Phase: 5 (a gap found while checking WP-075 after WP-090) Depends on: WP-061 ✅ (the room of doors and its Jester, JesterControl), WP-072 ✅ (the royal gallery, which keeps him the same way), WP-075 ✅ (the well) Companion EC: none (inline checklist under Exit criteria) Pre-flight: pre-flight-WP-092-2026-11-27. Required: the packet modifies engines/terraglyph/**. Targets generation(s): Gen 1, Phantom of the Knight only. Showdown has no such room. Estimated effort: An hour


Corrected by WP-109 (2026-11-28). The queued return doesn’t go to the gallery: it enters the well again (the room loaded, game+0x04) through movie 57. And the Jester is placed only once the yellow ball is found (0x42CA20), so a fresh visit has no Jester. The lines below describe the old reading.

Goal

Give ROOM_P22_Well_In_Maze its Jester. WP-075 left a member of the well’s class at +0xB8 unported and called it a ball-game sub-object. The decompile shows it is the shared Jester controller.

Background

WP-075 ported the well and noted, under Deviations, that “the well holds a ball-game sub-object (+0xb8) the fork does not reproduce”. After WP-090 found that a similar note hid an unplayable room, Jeff asked for this one to be looked at next.

The decompile of Phantom’s Scooby.exe (SHA-256 619EA687…AF807ED, Ghidra 12.1.4 headless, scratch project) shows the following (source):

scooby-exe already named the well as one of the four classes that call his tick.

The fork’s WellInMazeRoom had no Jester, an empty tick and no click handler, so the Jester stood in the well doing nothing:

The other Jester rooms still did all of this, so it was a missing behaviour, not a soft-lock.

Scope

In scope:

  1. Fork, maze_interior_rooms.{h,cpp}: a JesterControl member on WellInMazeRoom. Its entry runs on a visit that doesn’t bounce, its tick runs after the room’s, clicks are passed to it, and isBusy() holds input while he gives his clue or his thanks, as the gallery does.
  2. Fork, maze_interior_check.cpp: three lines for the well’s Jester: a click with no ball found; the yellow ball with the full bottle used, through the clue to the suspect board; the bounce with no bottle.
  3. Docs: this packet; the well’s section in scooby-exe; a pointer in WP-075; the index row.

Out of scope: the Jester’s own logic (WP-061’s JesterControl, unchanged), and the checks that end a visit without roomLeft() (see WP-090).

Exit criteria

  1. Self-test. The three new lines match expectations written from the trace before the run. The rest of the self-test matches the d18cb66884 baseline except the per-run random keys. The build has no new warnings.
  2. Live (session). In the well, the Jester answers a click.
  3. Process. A fork PR against scooby-engine is open (merged later the same day), and each claim here carries its evidence label.

Result

Every claim is Gen 1, Phantom. Evidence labels: source (the decompile), self-test, log (the engine’s debug log of a live run), live — session (a scripted run this session drove). Nothing here is live — Jeff.

The port (source). On wp-092-well-jester (b6c6319dfc), WellInMazeRoom keeps a JesterControl at +0xB8, as the gallery keeps one at +0xC8:

Self-test (self-test). Three lines were added to the maze interior check. Their expected text was written from the trace and the shared controller before the build ran:

All three match. The first run printed the untouched flag as an empty string where the expectation had “No”; the check now prints the flag as 0/1, and the second run matches line for line. The rest of the self-test matches the d18cb66884 baseline, built from C:\dev\scummvm, with two exceptions:

Both runs show the same 18 runtime warnings, which are pre-existing (see WP-090).

Build (log). Terraglyph only, in the fork worktree. Neither maze_interior_rooms.cpp nor maze_interior_check.cpp raises a warning.

Live (live — session, with log). The run used start_room=ROOM_P22_Well_In_Maze and a click at (585, 230) on the Jester:

The clue path wasn’t driven live: it needs the full bottle used and all three balls, which the self-test sets up directly.

Deliverables

Notes