WP-127: Phantom’s secret passages and treasury, played (Gen 1)
Status: ✅ Done (2026-11-30). Fork PR barefootbetters/scummvm#52 merged on 2026-11-30 (merge commit a9516e1531).
Phase: 5 (rooms played)
Depends on: WP-071 ✅ (the port of the four rooms), WP-116 ✅ (handleEvent())
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-127-2026-11-30. Required: the packet modifies engines/terraglyph/**.
Targets generation(s): Gen 1, Phantom of the Knight only.
Estimated effort: Two hours
Goal
Play Phantom’s two secret passages, the storage room and the treasury
(ROOM_P15_Secret_Passage1, ROOM_P19_Secret_Passage2, ROOM_P18_Storage,
ROOM_P16_Treasury) through the engine’s own event path, against the
decompile, and fix what differs.
WP-071 ported the rooms. Its check sent the
fire’s and the rope’s events with sendEvent(), set the snacks given, and
called the treasury’s click(), never through the mouse. These are the
eighth of the 11 checks that click through a class or script function.
What the decompile says
- The first passage (
0x416CA0): from the armory’s slide Velma walks in, from the storage room Daphne. - The second passage:
- entry (
0x416F30): the level’s snacks plus two needed; - the fire (
0x416D90): a requires object, burning (FLAMEAwith its sound) or out (FLAMEB); - its event (
0x416E90): with fewer snacks given here than needed, a line by level, blocking, and the snack box flashes; else the fire out and movie 39 back into the room.
- entry (
- The storage room:
- its event (
0x4176D0): the hotspots’ lines in turn, not blocking; the rope,370B_or370A_byWellVisited, blocking, setting “to take” as it ends; - its tick (
0x4177C0): Velma takes the rope, the cursor out and input held until she’s idle again, and the rope in the toolbar on her step 34.
- its event (
- The treasury (
0x418340): the Princess clicked with the arrow (game+0x20bit 4, her+0x08):FinalClue, and movie 55 to the suspects. - The fire’s and the rope’s clicks are a requires object’s (
0x402F20): the button coming up, with the game’s own cursor.
What differed
Nothing. The classes match the decompile, and nothing in the engine needed a change. The Princess’s click is read on the press, where the original reads the release. As in WP-117, WP-120, WP-121, WP-124 and WP-125, a press and release on one point plays the same.
Scope
In scope:
- Fork:
passage_check.cpp(the played section). - Docs: this packet, its pre-flight, a note in scooby-exe, a pointer in WP-071, and the index row.
Exit criteria
- Expectations first. The new lines were written from the decompile before the run.
- Self-test. The new lines match the decompile, with the check slips corrected (below). The rest matches the WP-125 run except for the per-run random keys and Maria’s item places. No new warnings.
- Live. Scripted runs put the fire out with two snacks fed through the toolbar, have Velma take the rope, and take the Princess’s final clue to the suspects.
- Process. The fork PR against
scooby-engineis open (merged on 2026-11-30).
Result
Evidence labels: log (a self-test’s debug log), live (session) (a scripted run this session drove and read, with screenshots).
- The change (source). On
wp-127-secret-passages(5fc75af267): a section at the end ofcheckPassages, with events fed throughhandleEvent(). - Self-test (log). Level 0, each room entered from the one before it.
- The first passage, from the slide: Velma walks in.
ANIM_CURSOREU45Lon the way to the storage room,ANIM_CURSORED45Ron the way back. - The second passage:
- two snacks needed;
- the fire
FLAMEA, with its sound and the open hand; ANIM_CURSOREU45Lon the way to the throne room. The way to the treasury has no point while the fire covers it.
- The fire:
- clicked with none given:
360A_held, the snack box flashing, still burning; - the snack box clicked: the snack cursor. Scooby clicked with it: he
eats it (
EAT_SNACK), and one is given here; - clicked again:
360A_again; - a second snack fed, and clicked: movie 39 back into the room;
- back in:
FLAMEB, and no sound.
- clicked with none given:
- The storage room:
- the rope, a requires object with the open hand;
- hotspots 1, 2 and 1:
370X_,370X1_and370X2_, not held; - the rope clicked:
370B_held. As it ends, “to take”, input held, and no cursor; - Velma takes it in the same tick, with her sound, and the rope hidden;
- in the toolbar 102 ticks on, and done at 165, with the arrow back.
- The treasury: the open hand on the Princess. Clicked:
FinalClue, and movie 55 toROOM_Suspect_Chooser.
The rest matches the WP-125 run (
80cae0ee4a), except for:- the per-run random keys: the drawbridge’s states, Ewan’s question, the room of doors’ ways, the screams, and Ewan’s pages and wrong lines;
- the item places in Maria’s played lines;
- the wizard’s taunt in the library (
300C1_or300C2_, at random). The new section draws more random numbers before it, so it isn’t the same draw as before.
WP-071’s passage lines are unchanged. Both runs have 18 warnings, and the build has no warnings in
engines/terraglyph. - The first passage, from the slide: Velma walks in.
- What I got wrong first. Nothing in the expectations. Two slips in the
check:
- The Princess’s final clue was read in the same
format()call that ran the room change, so it was read first and showed 0. As in WP-115 and WP-120. - Scooby was clicked in the same frame as the snack box. The toolbar
takes a click in its own tick (
0x431130), so his click replaced the snack box’s. The check now ticks between them.
- The Princess’s final clue was read in the same
- Live (session). Three runs from profiles:
- The fire, with two snacks:
- the open hand on it, and
360A_on a click; - the toolbar opens with the snack box flashing;
- the snack box gives “a snack (2 left)”, and the snack cursor over Scooby, who eats it;
- a second snack, and the room’s
Global.Snack_GivenC_; - the fire clicked: “the fire out”, and movie 39. The screenshot after shows the way to the treasury open.
- the open hand on it, and
- The storage room: the open hand on the rope; a click and
370B_. Then “Velma takes the rope”, the rope in slot 0, and “Velma has the rope”. The screenshot shows it in the toolbar. - The treasury: the open hand on the Princess; a click and “the final clue”, movie 55, and the suspects “the final one”.
- The fire, with two snacks:
Deliverables
- Fork:
wp-127-secret-passages, PR barefootbetters/scummvm#52 (5fc75af267), merged on 2026-11-30 asa9516e1531; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:passage_check.cpp. - Docs: this packet, its pre-flight, the note in scooby-exe, the pointer in WP-071, and the index row.
- Local only: the self-test and live logs, the screenshots, the profiles, and the expected text.