WP-117: Phantom’s drawbridge, played (Gen 1)
Status: ✅ Done (2026-11-29). Fork PR barefootbetters/scummvm#42 merged on 2026-11-29 (merge commit 8868fed861).
Phase: 5 (rooms played)
Depends on: WP-057 ✅ (the port of the room), WP-116 ✅ (handleEvent())
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-117-2026-11-29. Required: the packet modifies engines/terraglyph/**.
Targets generation(s): Gen 1, Phantom of the Knight only.
Estimated effort: Two hours
Goal
Play the drawbridge (ROOM_P01_Drawbridge, 0x426730, vtable 0x45F214)
through the engine’s own event path, against the decompile, and fix what
differs.
WP-057 ported the room. Its check clicked the flags
through the room class’s click(), never through the mouse. It’s the first
of the 11 checks that click through a class or script function.
What the decompile says
- A flag (
0x427380, vtable0x45F254):- its update (
0x427430) takes a click when it’s enabled (+0x68), under the mouse (+0x08), the cursor is the default, and the button came up this frame (game+0x20bit 4). It also goes on when its sequence ends; - its rollover (
0x4273D0) isANIM_CURSOROPENwhile it’s enabled and the cursor is the default, else none.
- its update (
- The tick (
0x4268D0) checks the flags in turn, and the first off its banner ends the look. With all four right:- every flag is disabled;
- the way out is built (
0x401850, depth −1, hit type 2); - fanfare 2 plays.
When the fanfare stops, the door plays (mode 3), then
Drawbridge.Down, thenDrawbridge.Enter_, blocking. - The sign is a plain clickable in
OBJECT.INI. Its event (0x427270) says100X1_and100X2_in turn, not blocking. - The way out (
0x426EA0): with no snack given here (+0x88),110A_, blocking, and the snack box asked to flash (0x40D4D0). Else the default handler (0x40C1E0).
What differed
Nothing. The room class matches the decompile, and nothing in the engine needed a change. The flag’s click is read on the press, where the original reads it on the release (WP-057 lists this). A press and release on one point plays the same.
Scope
In scope:
- Fork:
drawbridge_check.cpp(the played section). - Docs: this packet, its pre-flight, two notes in scooby-exe, a pointer in WP-057, 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 expectation I got wrong corrected (below). The rest matches the WP-116 run except for the per-run random keys. No new warnings.
- Live. Scripted runs solve the puzzle with a click, meet the no-snack line at the way out, and leave by it for the town once a snack is given.
- 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 change (source). On
wp-117-drawbridge(1c2b2f4b02): a section at the end ofcheckDrawbridge, with events fed throughhandleEvent(). - Self-test (log). From the town, banners 1 2 3 4, flags 1 2 3 3:
- Entry:
- Velma walking in (state 1), and the opening
Drawbridge.100A_held; - after it, the open hand on flag 1, the sign and Velma;
- the arrow on banner 1 and on the door;
- no way out built.
- Velma walking in (state 1), and the opening
- Flag 4 clicked (down and up on it):
- 10 at tick 1, 11 at 22, 4 at 43, and the puzzle done at 43;
- over flag 1, the arrow;
- the way out built at depth −1, hit type 2, with
ANIM_CURSOREUover it; - fanfare 2 playing, and the door waiting (mode 0).
With the fanfare stopped:
- the door plays (mode 3) and
Drawbridge.Downplays; Drawbridge.Enter_is held, with no cursor over the way out;- flag 1 clicked after: it stays on 1.
- The sign, three clicks, each let rest:
100X1_,100X2_,100X1_, none held. - The way out at (312, 159):
- no snack:
110A_held, and the snack box asked to flash; - a snack given here:
ROOM_P04_Town, movie −1.
- no snack:
The rest matches the WP-116 run (
3a0b86642e), except for the per-run random keys (the drawbridge’s states, Ewan’s question, the screams in the gardener’s house and the armory). 18 warnings in both runs, and no build warnings inengines/terraglyph. - Entry:
- What I got wrong first. I wrote the arrow over Velma. A character’s
rollover is the open hand for the arrow (
0x4062E0), which the fork already had. - Live (session). Two runs from profiles with the opening played:
- Run 1, flag 4 one off:
- the open hand over flag 1 and the sign, the arrow over banner 1 and the door;
- flag 4 clicked: both raises, fanfare 1, fanfare 2, the puzzle done;
ANIM_CURSOREUover the doorway;Drawbridge.Down, then Fred’s twoEnter_lines;- the sign:
100X1_(Velma), with input on; - the way out with no snack:
110A_’s three lines. The screenshot during it shows no cursor.
The log has the snack box flashing once the scene is over. That’s right: the flash waits for no scene and the opening done (
0x40D130). - Run 2, solved, a snack given: over flag 1, the arrow. The way out
goes to the town, where Velma walks in from the drawbridge and
Town.110_starts.
- Run 1, flag 4 one off:
Found on the way
- The exit’s log line names the room even when the class keeps the gang.
With no snack, the log reads “exit OBJ_P01_TO_P04 clicked: going to
ROOM_P04_Town”, and then
110A_plays instead.clickExitlogs before the room’s exit handler decides. It’s only a log line.
Deliverables
- Fork:
wp-117-drawbridge, PR barefootbetters/scummvm#42 (1c2b2f4b02), merged on 2026-11-29 as8868fed861; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:drawbridge_check.cpp. - Docs: this packet, its pre-flight, the notes in scooby-exe (when the flag’s click is read, and when the snack box flashes), the pointer in WP-057, and the index row.
- Local only: the self-test and live logs, the screenshots, the profiles, and the expected text.