-
Notifications
You must be signed in to change notification settings - Fork 0
Game Remake
Navigation: Home - Title screen & UI - Game Remake
Faithful C++ reimplementation of Might & Magic II (Amiga), driven by the
68k disassembly and decoded .dat / asset formats in EXTRACTED/.
-
100% ASM/Amiga fidelity — match original 68k behaviour exactly; no invented
UX. See Game remake (
game/) inCLAUDE.md.
| Platform | Backend | C/C++ runtime |
|---|---|---|
| Windows, Linux, macOS | SDL2 | Host libc + libstdc++ |
| Amiga (68000+) | ACE (AmigaPorts/ACE) |
mini-std + custom new/delete/operator[] — no libstdc++ |
Desktop builds use SDL2 directly (not ACE’s experimental SDL shim). Amiga builds
link ACE for blitter/copper/input/audio and route all dynamic allocation through
mm2::runtime (memAlloc / memFree).
game/
CMakeLists.txt
include/mm2/ Shared headers (platform-neutral game API)
src/
main.cpp Entry (desktop) or thin wrapper (Amiga + ACE generic main)
Game.cpp High-level setup / tick / draw
TitleScreen.cpp Title attract/menu (320×200), logo, peekers
ui/ Character UI backends (AmigaClassic / Stub)
gfx/ 320×200 compositor + Mm2Font8x8.inc
platform/sdl/ SDL2 window, input, file I/O
platform/amiga/ ACE viewport, chip/fast mem, OS file hooks
runtime/ Allocators, freestanding buffers
EXTRACTED/decomp/ Pure-C codecs lifted from RE (shared with editor tools)
flowchart TB
subgraph host [Host layer]
SDL[SDL2 PC/Linux]
ACE[ACE Amiga]
end
subgraph plat [mm2::platform]
IO[File I/O]
IN[Input]
VID[Present / blit]
CLK[Timer]
end
subgraph core [Game core — portable C++]
GS[GameState A4 workspace]
MAP[map.dat + 3D view]
EVT[event VM 0x172CA]
CBT[combat 0x12A22]
SVC[town services]
end
subgraph data [Data layer — C codecs]
DAT[.dat loaders]
GFX[.32 / .anm codecs]
STR[str.dat]
end
SDL --> plat
ACE --> plat
plat --> core
core --> data
-
Bootstrap (current) — 320×200 compositor (
ScreenCompositor), title screen (intro.32@ (3,0) +introclips.32pegasus/peekers +nwcp.32logo +book.32menu on black), roster viewer (roster.dat), 2× SDL present. Menu text usesMm2Font8x8.inc(plain ASCII). Title animation spec:EXTRACTED/docs/39-title-screen-animation.md. Character UI is pluggable — see39-character-ui-view-create.md. -
Data + state — wire all
.datcodecs; materializeA4workspace (mm2_gamestate.h). -
3D view — port
0x2900hood renderer (208×120 viewport, wall fields from map page 0). -
Main loop —
0x1280mode dispatch (overland, town, combat, menus). -
Events — triplet scanner
0x175E2, script VM,OP_0Etown-service dispatch. - Combat — round loop, player bar, monster AI, rewards.
-
Audio — Paula tone path from
master.32or MOD export fallback on desktop. -
Copy protection — externalize globe/disk strings (already extracted to
EXTRACTED/embedded_strings.json).
RE references: EXTRACTED/docs/README.md,
EXTRACTED/mm2.capstone.annotated.asm, per-location events in EXTRACTED/docs/events/.
Requires CMake ≥ 3.16, C++17, network on first configure (SDL2 fetched via FetchContent).
cd game
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
./build/mm2 ../ # pass MM2 data directory (contains map.dat, town.32, …)
./build/mm2 ../ --ui=stub # text-only character UI fallbackView Party (P) and Create (C) use a swappable layer (game/include/mm2/ui/):
| Backend | Select |
|---|---|
AmigaClassic (default) |
--ui=classic, MM2_UI=classic, or -DMM2_UI=classic
|
Stub (text overlay) |
--ui=stub, MM2_UI=stub, or -DMM2_UI=stub
|
Requires book.32 in the data directory for the classic sheet backdrop.
See EXTRACTED/docs/39-character-ui-view-create.md.
Validate .32 decode (C codec vs Python reference):
cmake --build build
python ../tools/test_image32_golden.py --data-dir ..Cross-compile with AmigaCMakeCrossToolchains
and Bartman’s or Bebbo’s m68k GCC. ACE is pulled as a submodule/FetchContent when
-DAMIGA=ON.
cmake -S . -B build-amiga -DCMAKE_TOOLCHAIN_FILE=…/m68k-amigaos.cmake -DAMIGA=ON
cmake --build build-amigaAmiga link flags use -fno-exceptions -fno-rtti; game code must not depend on STL
containers or iostreams on that target.
-
Endianness:
.datmultibyte fields are little-endian on disk (see rootCLAUDE.md). -
Graphics: planar 5-bp
.32/.anmimage chunks —mm2_image32_codec.c. -
Naming: lifted routines keep
sub_<addr>_<purpose>until fully understood. - No Blitz3D: original 68k ASM is the source of truth for runtime behaviour.
- Docs Wiki Hub ← full doc index
- Getting Started ← read this first
- Overview
- Workspace Notes
- Open Questions
- Full Analysis
- Game Remake
- Startup and Init
- Runtime Memory Map
- Main Loop and Map
- Exploration Input and Options
- Party and Session
- Game State Struct
- Data Hunk mm2 data 00
- Time Era Calendar
- GFX Loading
- ANM TV Format
- PC DOS graphics
- SNES graphics
- 3D View and Game Screen
- Amiga 3D Render Process
- Scripted Scene Graphics
- Event Graphics Opcodes
- Title Screen Assets
- Title Screen Animation
- Format inventory
- items.dat
- monsters.dat
- roster.dat
- attrib.dat
- map.dat
- spells & item use
- event.dat
- Events by location ← 71 maps
- Events hub (numbered)
- Event Script Opcodes
-
Event Script DSL ←
.mm2evtauthoring - Event Text Rendering
- Event Graphics Opcodes
- Combat Overview
- Combat System
- Encounter Tables
- Spell Cast ASM
- monsters.dat abilities
- Spells and item use
- Amiga audio in exe ← Paula / DATA / remake
- Controls: Sounds / Walk Beep
- MM2 music format (superseded)
- Title/death audio paths (superseded)
- Known songs catalog (superseded)
- Town Services
- Spell Sources
- Character Mechanics
- Skills and Hirelings
- Commerce Formulas
- Commerce World Services
- Mount Farview Class Quest
- Class Quest HP Bug
- Event Runtime
- Event to String Path
- Embedded Exe Strings
- Copy Protection
- Time Era Calendar
- Game State Struct
- MM1 Overview ← hub + decode status
- MM1 MAZEDATA format
- MM1 to MM2 outdoor
- MM1 WALLPIX by sector
- MM1 art & graphics
- MM1 items / monsters (status)
- MM1 map walker ↗
- MM1 2D maps gallery
- MM1 WALLPIX gallery