Pre-Flight — WP-140 — 2026-12-02
Filled-in copy of docs/reference/pre-flight for WP-140. Verdict at the bottom.
Written by the execution session, from the session prompt
docs/sessions/session-WP-140-2026-12-02.md(PR #371, open at claim time). Checked at claim time: WP-140 is 📝 onmain(landed in #352), noWP-140branch in either repository but the session prompt’s ownclaude/wp-140-session-prompt, and no open PR naming WP-140 but #371 (the prompt) — #368 (the draft) is closed. The claim branch was pushed before anything else.
Header
- WP:
WP-140 - Title: The pointer stays visible in the Knights of the Snack Table (Gen 1)
- Pre-flight date:
2026-12-02 - Targets generation(s): 1
- Targets disc(s): Phantom
Dependency check
| Prereq | Status in WORK_INDEX |
Notes |
|---|---|---|
| WP-073 | ✅ Done (2026-11-18) | The room, KstRoom. |
| WP-090 | ✅ Done (2026-11-27) | The serving game and its kst check lines. |
| WP-116 | ✅ Done (2026-11-29) | handleEvent(), the run loop’s event path the kst check play lines drive. |
Rule check: every prereq is ✅ Done.
Repo + disc state
- Docs repo: branch
docs/wp-140-kst-cursor-visiblecut fromorigin/main @ 8026a91, pushed at once. - Fork worktree, the claim:
tools/New-ForkWorktree.ps1 -Branch wp-140-kst-cursor-visible→C:\claude-worktrees\scummvm-wp-140-kst-cursor-visible, forked fromorigin/scooby-engine @ 6725e6e288. 6725e6e288is the merge of fork PR #67; its tree equals8cb9617318(git diff 8cb9617318 6725e6e288is empty), the commit WP-087’s baseline self-test ran on.- Build: MSYS2 UCRT64,
../configure --disable-all-engines --enable-engine=terraglyphthenmake, out of tree in the worktree’sbuild-tg/. - Game files:
C:\dev\scooby-engine\tools\exes\phantom(local, gitignored), the copy the self-test config points at.
Source read
kst_rooms.cpp:57–58:kCursorRows = 100.0f, “The cursor shows over the top 100 rows (0x45EDAC)”.kst_rooms.cpp:740–742:KstRoom::hidesCursor()returnsmouse.y > kCursorRows.kCursorRowshas no other user.kst_rooms.h:65–68: the declaration, with the comment “0x419E40: the cursor shown only over the top 100 rows”, andsetsCursor()→true, so the room’s class sets the cursor every tick, through the opening’s hold too.terraglyph.cpp:550:updateHover()is the only engine reader of a room class’shidesCursor(); it sets the cursor to none and returns before the rollover lookup. Nothing on the input path reads it (handleMouse()reads the script’shidesCursor(), not the class’s), so a visible pointer can’t change what a press or a release does.kst_check.cpp:361–368(thekst check cursorline) and:444–465(thekst check play entryline’s cursor at y 50 and y 300, during the hold and after it).
The cursor
ANIM_CURSORARROW, the room’s default arrow — what updateHover() already draws over the top 100 rows and over every room without a rollover. With hidesCursor() false the existing path picks it (or a hovered object’s rollover, e.g. ANIM_CURSORER on the exit), so no new cursor code is needed. Considered and not taken: ANIM_CURSORSNACK, the original’s snack cursor — it’s an inventory item’s cursor, and drawing it would say the player holds a snack.
Scope lock
fork: engines/terraglyph/kst_rooms.cpp
engines/terraglyph/kst_rooms.h (its comment at :65 says "shown only over the top 100 rows")
engines/terraglyph/kst_check.cpp
docs: docs/reference/pre-flight-WP-140-2026-12-02.md
docs/work-packets/WP-140-kst-cursor-visible.md
docs/work-packets/WORK_INDEX.md
Staged by name; git diff --cached --name-only checked against this list before each commit. Forbidden: game data or captures in any repo, any other engine file, a change to how another room hides the pointer.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| The pointer drawn but stealing input (press-to-fill, release-to-slide). | low | high | Only updateHover() reads the class’s hidesCursor(); exit criterion 2: the WP-090 / WP-116 KST lines match the baseline but for the two cursor lines. |
| The cursor shown during the opening narration where the original shows nothing. | low | low | During the hold the port already draws the arrow over the top rows (kst check play entry: cursor at y 50 ANIM_CURSORARROW with held 1). The change keeps that one behaviour and extends it to every row, hold or not. |
| Expectations shaped by the run. | med | med | The lines below are written from the source and committed before the first run; §Lessons learned says which were wrong. |
Predicted self-test lines
Today, on 8cb9617318 (WP-087’s baseline log):
kst check cursor: hidden at y 100 0, at y 101 1
kst check play entry: opening Knights_of_the_Snack_Table.350X_ held 1 narrating 1; cursor at y 50 ANIM_CURSORARROW, at y 300 -; pressed on the top row: Shaggy state 0; the hold over after 92 ticks (scenes skipped), held 0; cursor at y 50 ANIM_CURSORARROW, at y 300 -
After the change:
kst check cursor: hidden at y 100 0, at y 101 0
kst check play entry: opening Knights_of_the_Snack_Table.350X_ held 1 narrating 1; cursor at y 50 ANIM_CURSORARROW, at y 300 ANIM_CURSORARROW; pressed on the top row: Shaggy state 0; the hold over after 92 ticks (scenes skipped), held 0; cursor at y 50 ANIM_CURSORARROW, at y 300 ANIM_CURSORARROW
The arrow at (320, 300) assumes no object with a rollover sits under that point at either moment (the knights start off the left edge at x −26 and no mug is on a bench yet). Every other kst check line, and every other line of the self-test but the random keys (the villain and clue draws), is predicted unchanged.
Verdict
- READY TO EXECUTE
- NOT READY
Prepared by: Claude (WP-140 execution session) Date: 2026-12-02
Lessons learned
- The predictions held, but one was missing. Both cursor lines read
exactly as written,
ANIM_CURSORARROWat (320, 300) included. Not predicted: five newhover OBJ_KST_OVERLAY1/3, cursor ANIM_CURSORARROWinput lines.updateHover()returned before its hover log whenever the class hid the cursor, so the hidden rows never logged a hover. A prediction about one line should also ask which log lines sit behind the same early return. - Pin
random_seedto diff a whole self-test. Unseeded, the villain and clue draws make about 6,000 lines differ and the diff can’t be read. Withrandom_seed=<n>in the config’s[scummvm]section (common/random.cpp:43) and a second baseline run as the noise floor, what’s left is lip-sync timing jitter and the change itself.