WP-115: Phantom’s souvenir shop, played (Gen 1)
Status: ✅ Done (2026-11-29). Fork PR barefootbetters/scummvm#40 merged on 2026-11-29 (merge commit fab4620dcb).
Phase: 5 (rooms checked without clicks, played)
Depends on: WP-058 ✅ (the port of the room)
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-115-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 souvenir shop (ROOM_P03_Souvenir_Shop, 0x416FE0, vtable
0x45EB9C) through the engine’s mouse and tick, against the decompile, and
fix what differs.
WP-058 ported the room. Its check only inspected state and sent events by name, never through the mouse. It’s the last of the five room groups whose checks don’t click at all, after the gallery (WP-110), the armory (WP-111), the garden group (WP-112) and the kitchen storage room (WP-114).
What the decompile says
- Entry (
0x4172D0, after the base entry):- nothing bought or being fetched (
+0xC0,+0xC1); - from the town, Fred walks in (
DL,0x405F20); - without
Screaming, the first time:1201_, andIntroDone; - while
Screaming: one of Jane’s screams, then330A1_; - either way the opening holds input through
+0x3C(0x40C7B0), which also fades the cursor out (0x435E80with0x12).
- nothing bought or being fetched (
- The claim (
0x417170):- the bottle, until ever taken, is a requires object at depth 0
(
0x408C80with −1); once taken, a plain sprite showingANIM_INV_BOTTLE_EMPTYB(0x4314C0); - hotspot 1 is a clickable (
0x408DC0with 1, −1), at itspriority=150; - hotspot 3 and the exit aren’t claimed, so the default path builds them.
- the bottle, until ever taken, is a requires object at depth 0
(
- The event (
0x417060):- the bottle with the tokens: they leave the toolbar (
0x406C80), the cursor is the game’s default again, and the bottle is bought; - the bottle with the arrow:
120A_, blocking; - hotspot 1:
120X_while it plays its B (+0x54), else120X1_if its next state is its A (+0x60). Nothing for hotspot 3.
- the bottle with the tokens: they leave the toolbar (
- The tick (
0x417400), while bought:- every tick, input held (game
+0x24) and the cursor out (0x435E80with 0); - Fred, once idle with no scene and the opening done, fetches the bottle
(
OBJ_FRED_P03_GET_WATER_BOTTLE,Fred_Takes_Bottle), and the shelf showsANIM_INV_BOTTLE_EMPTYB; - Fred idle again: the bottle in the toolbar, then
120B_, blocking.
- every tick, input held (game
- A blocking scene (
0x40B400, its last argument set) fades the cursor out (0x435E80with0x12) and holds input. The scene player’s end (0x40C810) fades it back (0x435EF0) and gives input back, unless an exit is parked.
What differed
The fork’s room class matched the decompile.
One gap was in the engine. The fork hid the cursor only for an exit and for a room class holding input. Through every opening and every blocking scene, the arrow stayed drawn. Now:
- the cursor is out while the room’s script holds input
(
RoomScript::hidesCursor()); - the run loop and a mouse move hide it (
terraglyph.cpp); - the next hover after the hold shows it again.
The fork still has no fade. The ghost (0x40A990) touches neither the
cursor nor input itself, and what calls it isn’t traced, so it keeps the
cursor as before.
Scope
In scope:
- Fork:
souvenir_check.cpp(the played section),room_script.handterraglyph.cpp(the cursor),room.h(a getter for the cursor as drawn). - Docs: this packet, its pre-flight, the corrections in scooby-exe, a pointer in WP-058 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-114 run except for the per-run random keys. No new warnings.
- Live. A scripted run buys the bottle with the tokens from the toolbar and leaves for the town, with no cursor drawn during the opening and the scenes.
- 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 fix (source). On
wp-115-souvenir-shop(484cb947c5):room_script.h,terraglyph.cpp,room.h, and a section at the end ofcheckSouvenirShop. - Self-test (log). The new lines:
- Entry from the town:
- Fred walking in (state 1), and
1201_held; - over the bottle meanwhile, no cursor;
- the bottle a requires object at depth 0, hotspot 1 a clickable at 150, hotspot 3 a clickable at −1, the exit at −1000;
- after the opening, the open hand on the bottle and on both hotspots,
and
ANIM_CURSORED45Lon the exit; - again from the town: no opening, nothing held;
- with
Screaming: Fred walking in, a scream,330A1_held, andIntroDonestill off.
- Fred walking in (state 1), and
- The bottle:
- with the arrow:
120A_held; - the van clicked: the toolbar open after 36 ticks;
- the tokens’ slot clicked: the tokens are the cursor, and over the bottle they stay the cursor (no rollover);
- on the bottle: the tokens out of the toolbar, the arrow back, bought, the room class busy, no cursor;
- a click on hotspot 1 meanwhile starts nothing;
- Fred in state 13 with
ANIM_FRED_P03_GET_WATER_BOTTLE1andFred_Takes_Bottle, and the shelf showingANIM_INV_BOTTLE_EMPTYB; - a click on the exit meanwhile: still in the shop;
- done: the bottle in slot 0,
120B_held, not busy.
- with the arrow:
- The bottle had: a plain sprite (hit type 1) showing
ANIM_INV_BOTTLE_EMPTYB, the arrow over it, and no line for a click. - The hotspots:
- hotspot 1 gives
120X_(B), none (C),120X1_(D), none (A),120X_(B); - hotspot 3 gives none, none.
- hotspot 1 gives
- The way out: the exit at (3, 3), and to the town with movie −1.
The rest matches the WP-114 run (
abe55e0d84), except for the per-run random keys (the drawbridge, Ewan’s question, the screams in the gardener’s house and the armory). Hiding the cursor changed no other line. 18 warnings in both runs, and no build warnings inengines/terraglyph. - Entry from the town:
- What I got wrong first.
- The cursor during the opening. I wrote that it would be hidden. It was the arrow, which is the gap above.
- Check slips.
- The first run read the opening’s name from the scene, which is empty until the opening starts on tick 100. The check reads the opening now.
- It read the hover from the toolbar’s last-shown cursor, which a room
class’s hold never updates. The check reads the cursor as drawn now
(
Room::getCursorAnim()). - The line for the arrow on the bottle read input as free. The same
format()call that ticked for the line also read the hold, and GCC evaluated the hold first. The check now reads the line first.
- Live (session). A profile with the tokens in the toolbar, entered from
the town:
- during
1201_, with the mouse on the bottle, the screenshot shows no cursor; - after it, the open hand on the bottle and both hotspots, and
ANIM_CURSORED45Lon the exit; - the bottle with the arrow:
120A_, and no cursor in the screenshot; - the van, then the tokens’ slot: the tokens are the cursor, and stay it over the bottle;
- a click on the bottle: the tokens out of slot 0. Fred fetches the bottle
(the screenshot shows it in his hand, no cursor), it goes in slot 0, and
120B_plays; - a click on the exit: the town, with
Town.110_.
- during
Found on the way
- Leaving while bought can’t happen by the mouse. The leave handler
(
0x417580) puts the bottle in the toolbar if the room is left while it’s bought. But the tick holds input every tick while bought, so an exit click is ignored until the bottle is in the toolbar. - The other played checks read the hover from the toolbar’s last-shown cursor. That’s right while nothing holds input, which is where those checks read it. A hover read during a room class’s hold would show a stale cursor there.
Deliverables
- Fork:
wp-115-souvenir-shop, PR barefootbetters/scummvm#40 (484cb947c5), merged on 2026-11-29 asfab4620dcb; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:souvenir_check.cpp,room_script.h,terraglyph.cpp,room.h. - Docs: this packet, its pre-flight, the corrections in scooby-exe (the cursor through a blocking scene, and the shop’s hotspots and leave), the pointer in WP-058, and the index row.
- Local only: the self-test and live logs, the screenshots, and the expected text.