ReDMCSB Canonical Reference
The canonical reverse-engineered source code for Dungeon Master and Chaos Strikes Back is ReDMCSB, hosted at:
- Community page: http://dmweb.free.fr/community/redmcsb/
- WIP 2021-02-06 archive (operator-local reference used for Firestaff
implementation):
reference/ReDMCSB_WIP20210206.7z, unpacked asreference/redmcsb-20210206/when source audits are required. This reference is not game media and is not committed to the repository. - Authoritative bugs-and-changes list (search this for
every
BUG0_xx/CHANGE7_xx/CHANGE8_xxreference): http://dmweb.free.fr/Stuff/ReDMCSB/Documentation/BugsAndChanges.htm - Forum discussion: https://www.dungeon-master.com/forum/viewtopic.php?t=29805
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:
- Animation script instructions and vertical-blank waits: http://dmweb.free.fr/community/documentation/file-formats/animation-script/
- Animation containers and frame data: http://dmweb.free.fr/community/documentation/file-formats/animations/
GRAPHICS.DAT, dungeon and related data files: http://dmweb.free.fr/community/documentation/file-formats/data-files/- Original saved-game formats: http://dmweb.free.fr/community/documentation/file-formats/saved-game-files/
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.
- 0..8 = game version where it appeared:
- 0: DM Atari ST 1.0a EN
- 1: DM Atari ST 1.0b EN
- 2: DM Atari ST 1.1 EN
- 3: DM Atari ST 1.2 EN
- 4: DM Atari ST 1.2 GE
- 5: DM Atari ST 1.3a FR
- 6: DM Atari ST 1.3b FR
- 7: CSB Atari ST 2.0 EN
- 8: CSB Atari ST 2.1 EN
- categories: FIX (bug fix), OPTIMIZATION, LOCALIZATION, IMPROVEMENT (most new features)
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.
- BUG0_03 (VBL handler glitch) — DUNVIEW palette switching fails under heavy load; fixed in CSB 2.0 (CHANGE7_01_FIX). → CSB V1 Graphics GAP 1.
- BUG0_04 (creature color conflicts) — DUNVIEW; no fix. → CSB V1 Graphics GAP 4.
- BUG7_01 (CSB creature color conflicts) — DUNVIEW; introduced in Atari ST CSB 2.0 and not fixed in 2.1. It is distinct from DM’s BUG0_04: the CSB Worm is intentionally map-palette-dependent, while Slime Devil, Lord Chaos, Hellhound and Zytaz retain source-data replacement quirks. Original mode must preserve the verified source result rather than invent corrected replacement colors.
- BUG0_05 (champion portrait wall sensor visible on all sides) — DUNVIEW; no fix.
- BUG0_06 (projectile bitmap crop glitch) — DUNVIEW; no fix.
- BUG0_07 (explosion bitmap crop glitch) — DUNVIEW; fixed in DM 1.1+ (CHANGE2_02_FIX).
- BUG0_09 / BUG0_10 (dungeon square event triggers) — DUNGEON.C; CSB V1 specific fixes (CHANGE7_17, CHANGE7_18).
- BUG0_56 (only fixed in DM 1.3b FR, not in DM1 PC 3.4 that Firestaff ships with).
- BUG0_67 / BUG0_69 (group AI + teleporter memory corruption with Lord Chaos / Grey Lord).
- CHANGE2_06_FIX, CHANGE2_19_FIX, CHANGE3_19_FIX, CHANGE5_01_FIX, CHANGE7_14_FIX (useless code removed).
- CHANGE7_01_FIX (VBL re-entrancy fix) — closes BUG0_03.
- CHANGE7_15 (wall drawing optimization) — DUNVIEW.C.
- CHANGE7_17, CHANGE7_18 (dungeon square event fixes) — CSB V1 DUNGEON.GAP 2.
- CHANGE7_19 (BUG0_69 Lord Chaos/Grey Lord teleporter fix) — CSB V1 DUNGEON.GAP 6.
- CHANGE7_20 (projectile speed normalization) — CSB
V1 Combat GAP 1, IMPLEMENTED in
6967b4f94. - CHANGE7_21 (endgame UI) — CSB V1 Dungeon GAP 2.
- CHANGE7_23 (version checker sensor) — CSB V1
Dungeon GAP 3, IMPLEMENTED in
9f50e167f…wait, that was level count. Version checker wasc3bf76b11was the M12 fix. Let me re-check. - CHANGE7_24 (reincarnation penalty) — CSB V1 Champions
GAP 2, IMPLEMENTED in
d3ccfda56. - CHANGE7_28 (left-click inventory access) — CSB V1 Champions GAP 4.
- CHANGE7_29 / CHANGE8_12 (save game combat state) — CSB V1 Combat GAP 5.
- CHANGE8_02 (60-tick delay multiplier) — endgame curtain.
- CHANGE8_06 (engine version 21 hardcoded for CSB 2.1) — CSB V1 Dungeon GAP 3.
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.