WP-111: Phantom’s king’s armory and its slide, played (Gen 1)
Status: ✅ Done (2026-11-28). Fork PR barefootbetters/scummvm#35 merged on 2026-11-28 (merge commit cb505e77f2).
Phase: 5 (rooms checked without clicks, played)
Depends on: WP-068 ✅ (the port of both rooms)
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-111-2026-11-28. Required: the packet modifies engines/terraglyph/**.
Targets generation(s): Gen 1, Phantom of the Knight only.
Estimated effort: Two hours
Corrected 2026-11-28 (found in WP-112). The one fix recorded below, the cursor, changed nothing. The engine hides the cursor whenever a room class is busy or hides it (
isBusy() || hidesCursor(),terraglyph.cpp), and the armory’sisBusyalready covered the duster. So the armory had no gap; thehidesCursoroverride is a harmless duplicate. Also: the self-test’s line that each scream plays is not always so.Kings_Armory.Jane_Screaming5has no clip on the disc, so one visit in five while Jane screams is silent, in the original too.
Goal
Play the king’s armory (ROOM_P20_Kings_Armory) and its slide
(ROOM_P20_Kings_Armory_Slide), one class (0x40EBC0, vtable 0x45E710),
through the engine’s mouse and tick, against the decompile, and fix what
differs.
WP-068 ported both rooms. Their check only inspected state and never clicked. They’re the second of the five room groups whose checks don’t click at all (after the gallery, WP-110).
What the decompile says
- The entry (
0x40EC40). With the full bottle used (ever had, in no slot), the armory goes to the slide room (game vtable+0x04) in place of its entry. Otherwise, with Jane not screaming (game+0x288), it playsKings_Armory.150_once (IntroDone). With Jane screaming, it plays one of her five screams (rand() % 5) andIntro2_orIntro_(rand() & 1) on every visit. - The claim (
0x40EF10). The duster, never had, is a requires object (0x408C80: the first layer, polygon hit); once had, it is not built. - The click (
0x40EDD0):- The duster: Scooby is to take it.
- The scratch:
150C_,150C1_,150C2_in turn, blocking. - The armour: the room again through movie 44.
- The full bottle on either: the slide through movie 7; the bottle leaves its slot and the cursor goes back to the default.
- The tick (
0x40EFE0). While the duster is being taken, every tick holds input and hides the cursor (0x435E80). Scooby, idle with no scene and the opening done, takes it (OBJ_SCOOBY_P20_TAKES_DUSTER), and it is hidden. His state is read again, so when he is idle again the duster goes in a slot and150B_plays. - The leave, save and load (
0x40F150,0x40F1A0,0x40F1E0). A duster being taken is added anyway on leaving;IntroDonegoes in each room’s own section.
What differed
The cursor. The fork held input while the duster was being taken but
didn’t hide the cursor. It now does (hidesCursor). Everything else matched,
including the second read of Scooby’s state, which the gallery (WP-110) had
missed.
Traced along the way
Just after starting a character’s special, the original calls the
character’s vtable +0x10. The armory does it, and so do the maze centre and
the Princess’s bedroom; WP-100 left that call
untraced. The character’s vtable (0x45E4D8, from its constructor 0x4048E0)
has 0x4316F0 there, a sprite method. It sets the shown cel (+0x18) from
the sequence at the current step, so the new sequence shows on this frame. The
fork’s sprites draw from their step anyway, so there is nothing to model. The
comments in all three rooms and the format doc’s character notes now say so.
Scope
In scope: fork armory_rooms.{h,cpp} (the cursor), armory_check.cpp
(the played section), and the +0x10 comments in maze_interior_rooms.cpp
and princess_rooms.cpp; this packet, its pre-flight, a pointer in WP-068,
the format doc’s notes, and the index row.
Exit criteria
- Expectations first. The new lines and the difference were written from the decompile before the run.
- Fixed. The cursor.
- Self-test. The new lines match the expectations, after the one wrong expectation was corrected (below). The rest matches the WP-110 run except for the per-run random keys. No new warnings.
- Live. A scripted run plays the duster through Scooby’s take.
- 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-111-kings-armory(dea5874443). - Self-test (log). The new lines:
- Entry:
opening Kings_Armory.150_, IntroDone 1. The duster, the scratch and the armour are eachrequires depth 0 hit 2. Entered again: no opening, and input is free. - Jane screaming: three visits, each with a
Jane_ScreamingNsound playing andIntro2_orIntro_as the opening. - The duster: the next tick has busy 1, cursor hidden 1 and the duster
hidden. Scooby plays
ANIM_SCOOBY_P20_TAKES_DUSTER1from tick 1, with its sound. At tick 43 the duster is in a slot,150B_plays, and input and the cursor are back. Entered again, there’s no duster. - Clicks: the scratch gives
150C_,150C1_,150C2_,150C_; the armour givesROOM_P20_Kings_Armory movie 44. - The bottle:
- on the scratch, and on the armour:
ROOM_P20_Kings_Armory_Slide movie 7, the bottle in no slot (still held), the cursor the arrow; - the armory entered afterwards: the slide room (movie -1);
- the slide room: opening
150_, with its ownIntroDone.
- on the scratch, and on the armour:
- The ways out: the armory’s
TO_P11goes to the room of doors with150H_; the slide room’sTO_P15goes to the secret passage with150F_.
The rest matches the WP-110 run (
077cae1) except for the per-run random keys. 18 warnings in both, and no build warnings. - Entry:
- What I got wrong first.
- The way to the secret passage. I expected the armory to have it. Only the slide room places it, which is the original’s layout, so the check now tries it there.
- Build warnings. The first build gave three
-Wshadowwarnings in the check’s own names. They’re renamed.
- Live (session). A sweep that waited after each move placed the duster
at about (76, 349). Started in the armory, the run plays the intro
150_. After the click, Scooby takes the duster:OBJ_INV_DUSTER in slot 0,150B_,Scooby has the duster. The screenshots show:- the duster on the floor, with the cursor;
- Scooby bending to it, with no cursor;
- Scooby holding it;
- the duster in the toolbar.
Deliverables
- Fork:
wp-111-kings-armory, PR barefootbetters/scummvm#35 (dea5874443), merged on 2026-11-28 ascb505e77f2; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:armory_rooms.h,armory_rooms.cpp,armory_check.cpp,maze_interior_rooms.cpp,princess_rooms.cpp. - Docs: this packet, its pre-flight, the pointer in WP-068, the format doc’s notes, and the index row.
- Local only: the self-test and live logs, the screenshots, and the expected text.