WP-015: Cel decoder, and a room background on screen (Gen 1)

Status: ✅ Done (2026-11-14) Phase: 3 (resource loading; first graphics) Depends on: WP-014 ✅ (ArtArchive), WP-001 ✅ (decode path traced), WP-002 ✅ (cel format) Companion EC: none (inline checklist under Exit criteria) Estimated effort: Half-day Pre-flight: pre-flight-WP-015-2026-11-14


Result (2026-11-14)

Exit criterion Result
1. Every cel matches probe_art.py ✅ Both titles were started from their mounted ISOs at graphics level 3. The engine logged an MD5 of each cel’s coverage and colour (solid colour where it applies). A reference built on probe_art.py’s decoder logged the same per-cel MD5s. The two logs are identical: Showdown 9,111 cels (453 objects + 69 rooms), Phantom 5,810, 0 bad.
2. Screen matches ✅ Screen MD5 after drawing room 0: Showdown ROOM_P01_Town_Center 4addb408…8109, Phantom ROOM_P31_KST 9401c2a4…2dfd. Both equal the probe’s composite of the room’s layers.
3. Screenshot ✅ Both rooms were captured from the ScummVM window, which scales to 960 × 720, and sent to Jeff. They are not in git.
4. Malformed cel rejected ✅ Room 0’s background cel header was corrupted in a scratch copy, past the detection MD5 range: mask A offset out of the block, 65,535 × 65,535 size, and height 20,000 so the stream overruns its block. Each gets a warning naming the cel, the room is not drawn, and the engine keeps running. The copy was restored, hash-checked and deleted.
5. Build and diff ✅ Scooby-only build: 0 errors, 0 warnings. The fork diff stays inside engines/scooby/. Commit 644305dddc, pushed.

Deviations:


Goal

Decode TGIFILE.ART cels in the engine and draw a room background in the ScummVM window. This is the first time the fork shows Showdown’s or Phantom’s art.

Background

tgifile-art §Cel format specifies the cel completely, and probe_art.py --verify decodes all of them:

A room block names its art through ten layer slots at 0x80. Each non-zero slot points to a frame record: n entries of (i16 x, i16 y, u32 cel offset). The renderer creates one sprite per used slot. In both Gen 1 titles only slot 0 is used, and it holds the full-screen background at (0, 0).

Scope

In scope (fork, engines/scooby/ only):

Out of scope:

Exit criteria

  1. Every cel in Showdown and in Phantom decodes in the engine to the same pixels and coverage as probe_art.py. Checked by MD5 per cel, 9,111 cels in Showdown.
  2. The screen after drawing room 0 matches the background decoded by probe_art.py, pixel for pixel (MD5), for both titles.
  3. A screenshot of the ScummVM window shows the room.
  4. A malformed cel is rejected with a warning, not a crash.
  5. Scooby-only build: 0 errors and 0 warnings in engines/scooby/. The fork diff stays inside engines/scooby/.

Deliverables