ReDMCSB Canonical Reference

The canonical reverse-engineered source code for Dungeon Master and Chaos Strikes Back is ReDMCSB, hosted at:

DMweb companion reference

ReDMCSB is the primary source for original control flow and named symbols. Use the Dungeon Master Encyclopaedia (DMweb) alongside it for independently documented file layouts and animation semantics:

For DM1 and CSB, Firestaff must not replace a ReDMCSB source-owned visual or state transition with a synthetic equivalent when the corresponding original data can be decoded. DMweb is used to cross-check byte layout, palette/frame ownership, and wait units; it is not a substitute for ReDMCSB control flow.

Identifier convention

Each entry has a unique name: BUG0_NN for bugs, CHANGE<version>_<index>_<category> for changes.

Currently relevant to Firestaff

The current DM1/CSB implementation audit is maintained in docs/qa/qa_bugs.md. It distinguishes source-modelled behaviour from capture-pending parity work and records historical bugs that Original mode must preserve rather than silently correct.

Local working set

The Firestaff source-lock scripts default to: reference/redmcsb-20210206/Toolchains/Common/Source/

Set FIRESTAFF_REDMCSB_SOURCE to use an operator-maintained checkout elsewhere. If neither source exists, source-only gates skip rather than constructing replacement evidence.

tools/redmcsb_source.py is the shared locator for new and repaired DM1/CSB source locks. It accepts only a complete ReDMCSB source root and validates the files requested by each audit. A source lock may prove Firestaff code and the named ReDMCSB control-flow anchors, but it must not fail merely because an unrelated private extraction of GRAPHICS.DAT, a screenshot atlas, CSBWin, or another reference project is absent. Those materials can strengthen a separate real-media comparison; they are not substitutes for the primary source proof.

The 2026-08-31 DM1 audit repaired the D0/D1 side-wall, D1C door-front, far door-front, and wall-parity locks on that basis. Their runtime probe is the built test_dm1_v1_viewport_3d_pc34_compat binary; it protects the source contracts without manufacturing a capture or asserting pixel parity.

The same audit found a live panel-state omission: ReDMCSB PANEL.C F0352_INVENTORY_ProcessCommand71_ClickOnEye begins a held-eye interaction, while F0353_INVENTORY_DrawStopPressingEye restores the ordinary panel on release. Firestaff now carries that state only until mouse-up, closes the temporary eye-opened chest, and reopens an action-hand container through the normal CHEST.C:F0333 route. The focused regression is dm1_v1_chest_eye_open_to_action_hand_switch_pc34_compat; it validates source state transitions, not a synthetic screenshot or capture claim.

The current source-review findings, exact corrections and remaining capture-only limits are recorded in docs/parity/REDMCSB_DM1_CSB_AUDIT.md.

The CSB V2 lighting and phase-7 source locks use that lookup order. They are evidence gates, not a reason to copy ReDMCSB or game assets into Firestaff: when the reference is unavailable they report an explicit skipped result; when it is available they verify the named source anchors and write only the derived JSON receipt.

This directory contains 36 different .C files split by subsystem. Most CSB V1 / DM1 V1 gap work references one of these directly:

CHAMPION.C, CHAMPRST.C, GROUP.C, PROJEXPL.C, MOVESENS.C, DUNGEON.C, DUNVIEW.C, MAGIC.C, REVIVE.C, TIMELINE.C, GAME_LOOP.C (merged with GAMELOOP.C), ENDGAME.C, SENSORS.C (split from MOVESENS.C), STARTUP1.C, CLIKCHAM.C, ENTRANCE.C, PANEL.C, CHEST.C, DECOMPDU.C, VBL.C (split from BASE.C for Atari), COMBAT.C (split from CHAMPION.C), etc.