Pre-Flight — WP-016 — 2026-11-14
Filled-in copy of docs/reference/pre-flight for WP-016. Verdict at the bottom.
Written before engine code, on Jeff’s “continue” after PR #45 merged. Sprites were the next step named at WP-015’s close. Before the WP was written, the blitter at
0x439170was read from WP-001’s decompile dump and its tables were dumped, because the WP’s exactness criterion depends on them.
Header
- WP:
WP-016 - Title: A whole room on screen: placed sprites, draw order and translucent blending (Gen 1)
- Pre-flight date:
2026-11-14 - Targets generation(s): 1
- Targets disc(s): Showdown, Phantom
Pre-flight intent
Validating readiness for
WP-016. Verdict only.
Dependency check
| Prereq | Status in WORK_INDEX |
Locked on | Notes |
|---|---|---|---|
| WP-015 | ✅ Done | 2026-11-14 (PR #45 merged) | Cel decodes every cel with coverage. |
| WP-001 | ✅ Done | 2026-11-13 | Sprite tree, placement kinds and blitters traced. The decompile dump is in the session scratchpad. |
| WP-008 | ✅ Done | 2026-06-03 | object.ini layout: 215 sections in Showdown, ID= kinds. |
Repo + disc state
- Project worktree on new branch
claude/wp-016fromorigin/main(9d6b73c), clean. - Fork
C:\dev\scummvmonscooby-engineat644305dddc, clean, in sync with origin. - Blend tables dumped (2026-11-14).
0x47075C(32 × i32),0x4707DC(64) and0x4708DC(16) in.dataareround(255i/31),round(255i/63)and17i. Phantom’s bytes are identical (file offset0x6F5A4). object.inicheck. Both titles’ files (215 and 241 sections) have no duplicate sections or keys, and every name is[A-Za-z0-9_-]. SoCommon::INIFilereads them without warnings, and first-match lookup is unambiguous.
Doc-vs-tree cross-check
probe_art.pyfloors 5- and 6-bit channels (v × 255 // 31) and composites in 8-bit RGBA. The original rounds and blends on the 565 screen. The probe’s PNGs stay a visual reference. Exactness is checked against a 565 model that uses the probe’s tree code. The tgifile-art note “expands each nibble … through a table” gets the table values.- Draw method. The original draws front to back with occlusion and then blends queued alpha regions back to front (
0x439C00,0x438660). This WP paints back to front. For opaque pixels the two are the same. For translucent pixels they match as long as the blends happen in the same back-to-front order, which they do.
Scope lock
Allowed paths (this repo):
docs/formats/tgifile-art.md (§Cel format blend tables)
docs/02-SCUMMVM-INTEGRATION.md (§5)
docs/work-packets/WP-016-room-sprites.md
docs/work-packets/WORK_INDEX.md
docs/reference/pre-flight-WP-016-2026-11-14.md
Fork: engines/scooby/** only, staged by file name (lesson from WP-015).
Forbidden: game data, decoded images or binary dumps in git. The blend tables are documented as formulas, and the engine computes them.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Two implementations share a misreading of the tree rules | low | med | The rules are traced, and the probe’s renders were checked against WP-009 frames. The engine reimplements them from the doc, not from the probe’s code. |
| Painter’s order differs from the original’s occlusion order on translucent-over-translucent pixels | low | low | Back-to-front blending matches the original’s back-to-front alpha pass. The 565 model fixes the expected values. |
start_room config key leaks into upstream |
low | low | It’s a debug convenience. Before Phase 5, revisit it or move it into the console. |
Verdict
- READY TO EXECUTE
- NOT READY
Prepared by: Claude (WP-001 session, continuing), on Jeff’s “continue” of 2026-11-14 Date: 2026-11-14
After execution — lessons learned
Lesson: read the blitter before trusting a reference. The probe’s RGBA renders looked right, but the original rounds its 5- and 6-bit expansion where the probe floors. Exact matching needed the decompiled blend and the dumped tables. Model the target’s arithmetic, not a plausible one.
Lesson: a hash map’s values move. The first draft of RoomRenderer kept raw pointers to object blocks stored in a HashMap, and a rehash would leave them dangling. Shared pointers fixed it before the first build. Watch for this wherever blocks are cached.
Lesson: staging by name in the shared fork checkout worked. git status before staging showed only this WP’s seven files, and they were staged explicitly (WP-015 lesson).
Scope note: the lock held. One fork commit. The ISOs were dismounted afterwards, and the screenshots and probe renders stayed in the scratchpad.