Skip to content
peterkmetPublic

About

DMMac: Dungeon Master and Chaos Strikes Back (Amiga version) rewritten in C11/SDL3 for macOS and Windows

Resources

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

DMMac: Dungeon Master for macOS and Windows

DMMac is a native C11 and SDL3 port of the Amiga versions of Dungeon Master v3.60 and Chaos Strikes Back for macOS (Apple Silicon) and Windows (x86-64).

Dungeon Master viewport showing a dungeon corridor Facing Lord Chaos on level 12

This repository contains no game data. You must provide your own Amiga disk images (.adf): Dungeon Master v3.60 (1 disk) and optionally Chaos Strikes Back (disks A and B). DOS, Atari ST, and other Amiga releases are not supported. The game identifies a disk by its content, not by its file name.

Features

  • Full campaigns: Both Dungeon Master and Chaos Strikes Back are playable to the end.
  • Vanilla mode: The original rules, timing, and interface.
  • Advanced mode: Automap, in-game options menu (volume, music, upscale filter), 8 save slots, quick save/load, cheat screen, WASD movement, 8 simultaneous sounds, FM-Towns and Super NES soundtracks, and direct entry to Chaos Strikes Back from the prison stairs.
  • LLM mode (macOS only, --mode turnbased): A program plays the game turn by turn over a Unix socket.
  • Display scaling: Window resizing with the scale2x and scale3x pixel-art filters.

Play

Download the latest release (DMMac-macos-arm64.zip or DMMac-windows-x64.zip), extract it, and copy your .adf disk images into the folder.

  • macOS: Remove the quarantine attribute and launch Dungeon Master.command (or double-click it in Finder):

    xattr -d com.apple.quarantine dm "Dungeon Master.command" libSDL3.0.dylib
    open "Dungeon Master.command"
  • Windows 10+: Run dm.exe. If Windows SmartScreen warns about an unknown publisher, select "More info", then "Run anyway".

On first launch, the game extracts the disk images into game/ and game-csb/. Each adventure keeps its saves in its own folder, in the original Amiga format.

Keys of the advanced mode (in the dungeon view):

Key Action
W, A, S, D, Q, E Move and turn
M, Tab Automap
Escape Options menu
C Cheat screen
F5, F9 Quick save, quick load
Ctrl+S Save dialog with the 8 slots

See the Player manual for all controls, game modes, and configuration.

Let an LLM play

build/dm --mode turnbased --control /tmp/dm.sock
DM_CONTROL=/tmp/dm.sock uv run dm-play --brief get_state
DM_CONTROL=/tmp/dm.sock uv run dm-play act move_forward

The dm-mcp server exposes the control socket over the Model Context Protocol (MCP) for clients such as Claude Code. LLM mode: turn-based play over MCP has the protocol, the actions, and the setup. LLM runs describes playthroughs with a coordinator and player agents.

Build

brew install sdl3
uv sync
make            # Build build/dm and the test library
make test       # Run the test suite
make check      # Check formatting, coding standard, and tests
make windows    # Cross-compile build/dm.exe with MinGW-w64

Run build/dm from the folder with your .adf images. See Development for build and release workflows, Architecture and Coding standard for codebase structure, and Changelog for release history.

Engineering

Claude Code built the port in four stages:

  1. Decompilation: Ghidra decompiled the 68000 FTL modules to C (Decompiling). The symbol tables in docs/reference/ name the functions and globals.
  2. Reimplementation: Claude Code rewrote the game logic in C11 from the decompilation alone, without code from other ports.
  3. Differential verification: Automated tests run each ported C function and the original 68000 code in an emulator with the same input and compare the state. Golden snapshots validate save files, viewport rendering, and game mechanics.
  4. Refactoring: Later passes added named constants, typed accessors, the five layers, and the automated coding-standard checks. The game behavior did not change.

DMMac takes only the function and structure names from ReDMCSB, Christophe Fontanel's reconstruction of the original 68000 source, so the two code bases are easy to compare.

More: FTL module format, Game state, Chaos Strikes Back data files, KAOS module map.

Acknowledgements

  • SDL3 — windowing, input, and audio output.
  • dr_mp3 by David Reid — MP3 audio decoding.
  • amitools — ADF image extraction and reference implementation for ADF reader tests.
  • machine68k — 68000 CPU emulation for differential tests.
  • ReDMCSB by Christophe Fontanel — symbol and structure naming reference.
  • dmcsb by Cycl0ne — reference validator for the Dungeon.DAT tests.

License

GPL-3.0-or-later (LICENSE). Dungeon Master and Chaos Strikes Back are properties of FTL Games. This project is not affiliated with or endorsed by the rights holders. Original game data is not included and is not covered by this license.

About

DMMac: Dungeon Master and Chaos Strikes Back (Amiga version) rewritten in C11/SDL3 for macOS and Windows

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages