dm2-dungeon: expand text escape codes 29/30 via per-version tables #274
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/274/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #270.
Escape codes 29/30 in the dungeon.dat text section are two-code escapes: the next 5-bit code indexes an expansion table carried by the engine binary.
TextDatabase::text_at(offset, expansion)now expands them through per-version tables selected by the newdm2_dungeon::TextExpansionenum:a–x, 24–31 → digits0–7.Standard(DOS EN/DE/FR/Demo, Mac JP, Sega CD US; presumed for the packed-executable ports) =? ! THE YOU ' …;MacUs(Mac US/FR/Demo) truncatesTHE/YOUto a single space. Single-byte entries are font indices decoded intent-faithfully (0x79renders blank due to the DM/CSB font bug but is documented as!).Tables were recovered from the shipped executables (offsets documented in
docs/formats/dungeon-dat.md§ "Text data") and cross-checked against DMWEB's DM/CSB tables; glyph identity verified by rendering the 5×6 font from the DOS-EN retail and beta archives.Expansion is decode-side only —
parse/to_bytesare untouched and all 16 fixture round-trips stay byte-for-byte. Pinned tests cover DOS-EN retail (escape-29 digit strings, the SNAKE STAFF recipe) and the DOS 0.9 beta (the one port that renders this section in-game: "BE WARNED! …" via(30, 1), "NO WATER?" via(30, 0)). Callers indm2-saves(inscriptions) anddm2-cli(extract JSON) passStandard.Gates:
cargo fmt --all -- --check,cargo clippy --workspace --all-targets, andcargo test --workspaceall exit 0 locally (fixture tests exercised for real; CI skips them per policy).