WP-129: Phantom’s Brad game, played (Gen 1)
Status: ✅ Done (2026-11-30). Fork PR barefootbetters/scummvm#54 merged on 2026-11-30 (merge commit e1dd7bea63).
Phase: 5 (rooms played)
Depends on: WP-070 ✅ (the port of the game), WP-116 ✅ (handleEvent())
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-129-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 Brad’s game (ROOM_Brad_SPOOKY and its levels, 0x41E9E0, vtable
0x45EF50) through the engine’s own event path, against the decompile, and
fix what differs.
WP-070 ported the game. Its check set the mouse’s
place and button by hand and called the room class’s click(), never
through the mouse. It’s the tenth of the 11 checks that click through a
class or script function.
What the decompile says
- A piece’s update (
0x41DD60) reads the input object (DAT_00474d9c) itself:- taken when the button goes down (
+0x20bit 2) with it under the mouse (+0x08); - dragged with the mouse while the button is held (bit 1) and it’s still
under the mouse (vtable
+0x14); - its turn and past 60: loose, flying out its way;
- not its turn: held within 20, and Brad complains the first time over.
- taken when the button goes down (
- Entry (
0x41EE80): the toolbar off, the order, links, depths and ways,Brad.ARMOR_INTRO_1, and the cursor faded out at once. Nothing sets game+0x24, so input isn’t held. - The tick (
0x41F3C0): the introduction over, the cursor back; the timer below 0, back to the arena. - A piece gone (
0x41F570): the last one wins the game, holds input, and sets the 72-tick timer.
What differed
Nothing. The class matches the decompile, and nothing in the engine needed a change. The pieces take the press, as the original’s do (input bit 2), so this game is played on the button going down, unlike the rooms before it.
Scope
In scope:
- Fork:
brad_check.cpp(the played section). - Docs: this packet, its pre-flight, a note in scooby-exe, a pointer in WP-070, 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-128 run except for the per-run random keys and Maria’s item places. No new warnings.
- Live. A scripted run shows the introduction with no cursor, the open hand on a piece, and the first piece dragged off the pile by the mouse.
- 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-129-brad-game(6f7a3c25eb): a section at the end ofcheckBrad, with events fed throughhandleEvent(). - Self-test (log). Level 0, entered from the second arena.
- Entry:
- the toolbar off (state 4);
Brad.ARMOR_INTRO_1playing, with no cursor, and the room not busy;- piece 0 pressed during it: dragged the next tick; released: not.
- The introduction over: the open hand on piece 0, the arrow on the body.
- A short drag: piece 0 pressed and dragged 2 a tick its way for 20 ticks. It’s 39.53 from where it hangs, and not loose. Let go, it’s back within half a pixel in 29 ticks.
- Piece 2, not its turn, pressed and pulled out four times: held at
20.06 each time. The fourth brings
HEADSEXCITEDandBrad.ARMOR_RESPONSE_1. - The game:
- each piece in turn, 0, 2, 4, 5, 1 and 3, pressed and dragged its way;
- loose on drag tick 32, and off the screen 21, 22, 25, 22, 19 and 26 ticks after it’s let go;
- these are the same as the direct drive’s level 0 line, tick for tick.
Won:
BradPuzzle, input held, no cursor, andROOM_P14_Arena273 ticks on.
The rest matches the WP-128 run (
0f608d640f), except for the per-run random keys and the item places in Maria’s played lines. WP-070’s Brad lines are unchanged. Both runs have 18 warnings, and the build has no warnings inengines/terraglyph. - Entry:
- What I got wrong first. I expected a piece held at 20 to drop out of the drag once the mouse was off it. In a pull of 40 the mouse never leaves it: the pieces are bigger than that, so it stays dragged until the button comes up. The decompile says the same.
- Live (session). One run from a profile, at level 0:
- The introduction:
Brad.ARMOR_INTRO_1, then “his introduction over”. - The hover: the open hand on the helmet, piece 0.
- The drag: pressed and dragged up and right in steps of 5. “Piece 0 loose at 65.0166”, then “piece 0 off the screen”. The screenshot mid-drag shows the helmet pulled up and right, with the open hand on it.
While it was dragged, the log’s hover alternates between the helmet and the heads behind it. The move’s own hover comes before the tick that moves the piece to the mouse. The run loop’s hover after the tick finds the piece again, and that’s the cursor the screenshot shows.
- The introduction:
Deliverables
- Fork:
wp-129-brad-game, PR barefootbetters/scummvm#54 (6f7a3c25eb), merged on 2026-11-30 ase1dd7bea63; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:brad_check.cpp. - Docs: this packet, its pre-flight, the note in scooby-exe, the pointer in WP-070, and the index row.
- Local only: the self-test and live logs, the screenshots, the profile, and the expected text.