WP-102: Phantom’s wizard’s library, played (Gen 1)

Status: ✅ Done (2026-11-28). Fork PR barefootbetters/scummvm#27 merged on 2026-11-28 (merge commit 76688f1b89). Phase: 5 (from the search of the packets for rooms checked only by name) Depends on: WP-077 ✅ (the library’s class), WP-100 ✅ (the spell book it takes) Companion EC: none (inline checklist under Exit criteria) Pre-flight: pre-flight-WP-102-2026-11-28. Required: the packet modifies engines/terraglyph/**. Targets generation(s): Gen 1, Phantom of the Knight only. Showdown has no such room. Estimated effort: A few hours


Goal

Play the wizard’s library (ROOM_P25_Wizards_Library, 0x42D1F0) through the engine’s mouse and tick, and live, against the decompile, and fix what differs.

Background

WP-077 ported the library with the skull room. WP-095 played the skull and left the library alone. Its self-test checked the library’s claims and clips by name. Its live run saw the room draw. The library takes the spell book from the Princess’s bedroom (WP-100) and leads, through Big Head, to the skull. It was fourth on the list from Jeff’s search of the packets.

The fork at 1604799 (source): the shelf was a clickable. In the original (0x42D600) it’s a requires object, built with 0x408C80. A clickable takes no item, so the spell book used on the shelf got the game’s wrong-item line. The reveal on Big Head and the way to the skull never came: a soft-lock on the main path. WP-077’s reference gave the shelf the same build, so its check agreed with it.

Scope

In scope: fork wizards_rooms.cpp (the library’s claim) and wizards_check.cpp; this packet, its pre-flight, a WP-102 note in scooby-exe, a pointer in WP-077, and the index row.

Exit criteria

  1. Self-test. The new lines match text written from the decompile before the run. The same check run against the unfixed build shows the soft-lock. The rest matches the WP-101 self-test except for the per-run random keys and WP-077’s shelf line. No new warnings.
  2. Live (session). The spell book, used on the shelf from the toolbar, goes to Big Head through movie 61 with the reveal.
  3. Process. The fork PR against scooby-engine is open (merged later the same day), and each claim carries its evidence label.

Result

Every claim is Gen 1, Phantom. Evidence labels: source (the decompile), self-test, log (the engine’s debug log of a live run), live — session (a scripted run this session drove). Nothing here is live — Jeff.

Source. Scooby.exe (SHA-256 619EA687…AF807ED), Ghidra 12.1.4 headless: the class and its vtable. The event, the entry (the taunt) and the other claims match the fork. The shelf’s build is the one difference, plus the underlay’s layer (layer 0, game +0x58), which the fork now sets.

The port (source). On wp-102-wizards-library (f4e8f9da58): the shelf a requires object, and the underlay under layer 0.

Self-test (self-test). The text was written from the decompile before the run (kept locally). Each line clicks through the engine’s mouse, after the opening (Wizards_Library.300_, which holds input).

The rest of the self-test matches the WP-101 run (1604799) except for the per-run random keys and WP-077’s claim line, now SHELF unsolved requires. The runtime warnings match, 18 each.

Build (log). Terraglyph only, in the fork worktree; no warnings in the engine.

Live (live — session, with log). start_room=ROOM_P25_Wizards_Library with start_items=OBJ_INV_SPELL_BOOK. Mouse sweeps found the shelf at (140, 80) and the book’s slot at (490, 440).

  1. The opening 300_ (Shaggy, Velma, Scooby).
  2. A plain click on the shelf: room event OBJ_P25_WIZARDS_LIBRARY_SHELF 0, then 300F_.
  3. The book clicked in the toolbar: OBJ_INV_SPELL_BOOK in use.
  4. The shelf clicked: room event OBJ_P25_WIZARDS_LIBRARY_SHELF 1, then OBJ_INV_SPELL_BOOK out of slot 0, then movie 61 (11.0 s).
  5. Big Head: big head: Wizards_Library.300C_ on BIG_HEAD_BG_SKULLS, then ROOM_P25_Wizards_Library.

A first sweep clicked where the van would be and hit the open toolbar’s Quit Game button. The spots came from the sweeps’ hover logs instead.

Deliverables

Notes