WP-119: Phantom’s room of doors, played (Gen 1)
Status: ✅ Done (2026-11-29). Fork PR barefootbetters/scummvm#43 merged on 2026-11-29 (merge commit dc8a9b3a57).
Phase: 5 (rooms played)
Depends on: WP-061 ✅ (the port of the room and its Jester), WP-116 ✅ (handleEvent())
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-119-2026-11-29. Required: the packet modifies engines/terraglyph/**.
Targets generation(s): Gen 1, Phantom of the Knight only.
Estimated effort: Two hours
Numbering: claimed first as WP-118. Another session had reserved WP-118
for the TV D-pad GUI focus packet about 30 seconds earlier (docs PR #300), so
this packet is WP-119. The fork branch keeps the name wp-118-room-of-doors,
and its first commit’s subject says WP-118.
Goal
Play the room of doors (ROOM_P11_Room_Of_Doors, 0x415720, vtable
0x45EA9C) and its Jester through the engine’s own event path, against the
decompile, and fix what differs.
WP-061 ported the room. Its check took the ways out
through the room’s handler and clicked the Jester through the room class’s
click(), never through the mouse. It’s the second of the 11 checks that
click through a class or script function, after the drawbridge (WP-117).
What the decompile says
- The claim (
0x415F80):- The dining room’s door, once the duster is used, is a sprite under
the first layer at depth −1000 (
0x4314C0); until then it isn’t built. The Jester isn’t built until then either. - The four ways out and four hotspots fall to the default path.
- The dining room’s door, once the duster is used, is a sprite under
the first layer at depth −1000 (
- The exit handler (
0x415C00):- to the dining room before the duster: the door is tried (
+0xB8), and the default handler isn’t called; - to the throne room: the crying stops, then
160D1_the first time and140B*_after; - to the armory:
140A*_; - to the dining room once the duster is used:
140C*_.
All but the locked door then go to the default handler (
0x40C1E0). - to the dining room before the duster: the door is tried (
- The tick (
0x415AB0), while the door is tried:- Velma tries it;
- every tick, the cursor is out and input held;
- when she’s idle again,
130B_is started blocking. Then, in the same tick, the cursor is shown at once (0x435EF0with 0) and input given back (game+0x24= 0). So130B_plays with input on.
- The Jester (
0x4122E0) reads a click with the arrow from his+0x08and the button coming up. The first time in this room he’s met and introduces himself on Big Head; after that, his talk or a line. - The reset (
0x4157B0) clears the room’sJesterIntro(+0xD0), and leaving (0x4157D0) copies the Jester’s own flag (+0xBC) into it. The fork has the same.
What differed
One thing, in the room class. The fork started 130B_ blocking, so input
stayed held and the cursor hidden through it. WP-061
had read the scene as holding input and missed the two lines after it. It’s
now a scene that doesn’t block (doors_rooms.cpp), which has the same
effect.
Everything else matches: the claim, the ways out, the locked door, the hovers and the Jester.
Scope
In scope:
- Fork:
doors_rooms.cpp(130B_),doors_check.cpp(the played section). - Docs: this packet, its pre-flight, the correction in scooby-exe, a pointer in WP-061, 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-117 run except for:
- the per-run random keys;
- WP-061’s locked line, now held 0;
- WP-117’s drawbridge points line, which moves with the flags’ random starting step.
No new warnings.
- Live. Scripted runs show the locked door,
130B_with the cursor drawn and a hotspot answering during it, a way out, and the Jester’s introduction. - Process. The fork PR against
scooby-engineis open (merged on 2026-11-29).
Result
Evidence labels: log (a self-test’s debug log), live (session) (a scripted run this session drove and read, with screenshots).
- The fix (source). On
wp-118-room-of-doors(5aba4c0d30, then1719c08bb9, which only renumbers a comment):doors_rooms.cpp, and a section at the end ofcheckDoors. - Self-test (log).
- Entry from the town:
- Fred walking in, a scream, and the opening
Room_Of_Doors.140_held; - after it, the four ways out show their rollovers:
ANIM_CURSOREU45L,…EU45R,…EU45Land…ED45R; - hotspot 1 shows the open hand;
- no door sprite and no Jester.
- Fred walking in, a scream, and the opening
- The way to the dining room at (33, 159), before the duster:
- no room change;
- Velma tries the door at tick 1, with the room busy and no cursor;
- at tick 160,
130B_, with input on and the open hand over hotspot 1; - a click on hotspot 1 meanwhile starts it playing, with B next.
- The other ways:
- to the armory:
140A_(orA1_/A2_), then the armory, movie −1; - to the throne room:
160D1_, then the throne room, with the crying stopped.
- to the armory:
- The duster used, from the dining room:
- Velma walking in;
- the door sprite under the first layer at −1000;
- the Jester at 147;
- the way out at (33, 159) alone, and with everything shown the same point still hits it. The door doesn’t cover it;
- clicked:
140C_or140C1_, then the dining room.
- The Jester’s first click:
- the open hand over him;
- clicked:
ROOM_Big_Head, with220B_onBIG_HEAD_BG_P11, then back here; - he’s met.
The rest matches the WP-117 run (
1c2b2f4b02) except for:- the per-run random keys;
- WP-061’s locked line, whose
130B_now reads held 0; - WP-117’s drawbridge points line, which moves with each flag’s random starting step.
18 warnings in both runs, and no build warnings in
engines/terraglyph. - Entry from the town:
- What I got wrong first. Nothing in the expectations. Three slips in the
check:
- Velma’s walk-in was read after the opening had run out, by which time she had stopped walking. The check reads it on entry now.
- The Jester’s first click gave a line, not his introduction. The check
started the new story while still in the room, then left it. Leaving
copies the Jester’s own flag into the room’s (
0x4157D0), and that flag was still set from WP-061’s check, so the reset’s clear was undone. The original does the same, but a real new game starts from the menu, after the room is left. The check now leaves first. - The hotspot readout during
130B_compared the step shown before and after the click. A clicked clickable first plays the state it’s on, so that couldn’t show the click. The check now reads whether it’s playing.
- Live (session). Two runs from profiles, from the town, with the opening
played:
- Run 1:
- the hovers on the four ways out and hotspot 1;
- the dining room’s door locked: Velma tries it, and the screenshot shows no cursor;
130B_“input stays on”, and the screenshot shows the open hand;- hotspot 1 clicked during it plays, with
SFX_P11_ROD_HOTSPOT1A; - then the way to the armory:
140A2_, and the armory.
- Run 2, the duster used: the open hand over the Jester; a click gives
his introduction on Big Head (
220B_1_JESTER).
- Run 1:
Found on the way
- The exit’s log line names the room even when the class keeps the gang (as in WP-117): “exit OBJ_P11_TO_P12 clicked: going to ROOM_P12_Dining_Room” before the door is found locked. It’s only a log line.
Deliverables
- Fork:
wp-118-room-of-doors, PR barefootbetters/scummvm#43 (5aba4c0d30,1719c08bb9), merged on 2026-11-29 asdc8a9b3a57; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:doors_rooms.cpp,doors_check.cpp. - Docs: this packet, its pre-flight, the correction in scooby-exe (
130B_), the pointer in WP-061, and the index row. - Local only: the self-test and live logs, the screenshots, the profiles, and the expected text.