WP-128: Phantom’s arenas, played (Gen 1)
Status: ✅ Done (2026-11-30). Fork PR barefootbetters/scummvm#53 merged on 2026-11-30 (merge commit c1c88abe41).
Phase: 5 (rooms played)
Depends on: WP-069 ✅ (the port of the two arenas), WP-116 ✅ (handleEvent())
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-128-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 arenas (ROOM_P09_Arena1, 0x40D4E0; ROOM_P14_Arena2,
0x40D790) through the engine’s own event path, against the decompile, and
fix what differs.
WP-069 ported the arenas. Its check sent the stone’s and
the pile’s events, and called the second arena’s click() on Brad, never
through the mouse. These are the ninth of the 11 checks that click through a
class or script function.
What the decompile says
- The first arena:
- entry (
0x40D700): from the throne room Velma walks in (U), from the second arena Velma (D); back from its own movie, the toolbar opens; - the event (
0x40D560): the stone with the rusty shears, movie 40 back into the room, the shears used, the arrow; with the arrow,170XB_,170A_,170A1_,170A2_in turn, blocking. Hotspot 3,170X_, not blocking; - leaving (
0x40D6A0): sharpened, the sharp shears unless ever had.
- entry (
- The second arena:
- entry (
0x40D830):- won without his clue: his clue, Brad met, and
180B_, blocking; - not won with the opening unplayed: Brad hidden;
- the shield given: Brad 50 to the left.
- won without his clue: his clue, Brad met, and
- before the scene player (
0x40E440): on the opening’s fifth line Brad rises, and the scene waits until he’s idle; - the tick (
0x40DA80):- the opening done on a first visit: the pile’s click queued as the player’s;
- Brad clicked (game
+0x20bit 4, his+0x08) with the shield’s cursor: Big Head through movie 29, the shield used; - his clue:
GIVESwith the cursor out and input held, then the thanks; - the mirror: Velma takes it, with input held until she’s done;
- the event (
0x40E5A0): the pile, unless the click is the room’s own, into Brad’s game by level.
- entry (
What differed
Nothing. The classes match the decompile, and nothing in the engine needed a change. Brad’s click is read on the press, where the original reads the release. As in WP-117, WP-120, WP-121, WP-124, WP-125 and WP-127, a press and release on one point plays the same.
Scope
In scope:
- Fork:
arena_check.cpp(the played section). - Docs: this packet, its pre-flight, a note in scooby-exe, a pointer in WP-069, 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-127 run except for the per-run random keys and Maria’s item places. No new warnings.
- Live. Scripted runs sharpen the shears through movie 40, show Brad rising in the opening and the pile into his game, and give him the shield through Big Head, after which Velma takes the mirror.
- 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-128-arenas(0f608d640f): a section at the end ofcheckArenas, with events fed throughhandleEvent(). - Self-test (log). Level 0, each visit from the throne room.
- The first arena:
- Velma walks in;
- the open hand on the stone and hotspot 3,
ANIM_CURSOREUon the way out; - the stone with the arrow five times:
170XB_,170A_,170A1_,170A2_,170XB_, each held; - hotspot 3:
170X_, not held.
- The rusty shears’ cursor on the stone: movie 40 back into the arena, the shears out of their slot, and the arrow. Back from itself: the sharp shears in a slot, and the toolbar opening.
- The second arena, the first time:
- Fred walks in, and Brad is hidden;
- he rises at tick 107 on
180A_’s fifth line (ANIM_BRAD_HRISE, withArena2.Brad_H.Rise), and the scene stays on that line for 21 ticks while he does; - the opening over:
ROOM_Brad_SPOOKY.
- Again: Brad shown, and the pile a clickable with the open hand.
Clicked:
ROOM_Brad_SPOOKY. - His game won:
180B_held, with Brad a clue owner and met;- his
GIVES: the room busy, no cursor on him, and a click on him not taken; - then
Global.Thank_You_andROOM_Suspect_Chooser.
- The shield’s cursor on Brad:
- Big Head with
180E_onBIG_HEAD_BG_P14, back to the arena, through movie 29; - the shield used, and the arrow;
- back: Brad 50 to the left, and the arena’s shield shown;
- Velma takes the mirror at once, with her sound, the mirror hidden, the room busy and no cursor;
- 45 ticks later, the mirror in a slot and the room free.
- Big Head with
The rest matches the WP-127 run (
5fc75af267), except for the per-run random keys and the item places in Maria’s played lines. WP-069’s arena lines are unchanged. Both runs have 18 warnings, and the build has no warnings inengines/terraglyph. - The first arena:
- What I got wrong first. Nothing in the expectations. Two slips in the
check:
- The opening skipped whole.
skip()ends the opening rather than a line, so Brad rose after it, by the decompile’s other branch. The check now says each line at once, so the scene runs on line by line, as WP-069’s check does. - The pile clicked in the frame of entry. The room queues the pile’s click on entry as its own. A click in the same frame went with it, and the room’s flag ignored it. The check now lets that click play out first, as a player’s would.
I didn’t trace whether the original takes a click in that frame as a second one. It keeps a count of queued clicks (
+0x80). No player can click that fast. - The opening skipped whole.
- Live (session). Three runs from profiles:
- The first arena:
- the rusty shears taken from the toolbar, and over the stone the shears’ cursor;
- a click: “the shears on the stone”, and movie 40;
- the sharp shears in slot 0, and the toolbar open.
- The second arena’s first visit:
- “Brad rises” as the opening’s fifth line starts. The screenshot shows him rising out of the pile;
- the opening over after 8 lines: “the pile, to
ROOM_Brad_SPOOKY”, and his game.
- His game won, the shield in the toolbar:
- the open hand on Brad; the shield taken from the toolbar;
- a click on him: “the shield for Brad”, movie 29, and Big Head with
180E_; - back in the arena: “Velma has the mirror”, in slot 0. The screenshot shows Brad aside, the stand empty, and the shield on the wall.
A first try at the third run missed Brad. Once won, he’s
OBJ_BRADin another place, and the script had his point from before. That was the script, not the game. - The first arena:
Deliverables
- Fork:
wp-128-arenas, PR barefootbetters/scummvm#53 (0f608d640f), merged on 2026-11-30 asc1c88abe41; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:arena_check.cpp. - Docs: this packet, its pre-flight, the note in scooby-exe, the pointer in WP-069, and the index row.
- Local only: the self-test and live logs, the screenshots, the profiles, and the expected text.