wasm: full save decode/rebuild with dungeon.dat and graphics.dat #332

Open
opened 2026-10-24 09:45:52 +02:00 by jqueuniet · 0 comments
Owner

Make the field-driven full save decode available from WASM. Today saveToJson only produces the self-contained dump: the record stream (phases 3–7, where all items live) is carried as an opaque bitstream.

Scope

  • dm2-convert + dm2-wasm entry points taking save + dungeon.dat + graphics.dat bytes:
    • saveToJsonFull(save, dungeon, gdat) → SaveDump::full JSON
    • saveFromJsonFull(json, dungeon, gdat) → bytes via SaveDump::reconstruct
  • Clear errors when the context files don't match the save's variant / version, or when the record stream does not fully decode.
  • Check bundle size impact on the npm package.

Out of scope: inventory-specific helpers (separate issues).

Acceptance

  • For each save fixture with matching context files, full dump → rebuild is byte-exact.
  • Mismatched dungeon.dat (other port) yields an error, not a corrupt save.
Make the field-driven full save decode available from WASM. Today `saveToJson` only produces the self-contained dump: the record stream (phases 3–7, where all items live) is carried as an opaque bitstream. ## Scope - `dm2-convert` + `dm2-wasm` entry points taking save + `dungeon.dat` + `graphics.dat` bytes: - `saveToJsonFull(save, dungeon, gdat)` → `SaveDump::full` JSON - `saveFromJsonFull(json, dungeon, gdat)` → bytes via `SaveDump::reconstruct` - Clear errors when the context files don't match the save's variant / version, or when the record stream does not fully decode. - Check bundle size impact on the npm package. Out of scope: inventory-specific helpers (separate issues). ## Acceptance - For each save fixture with matching context files, full dump → rebuild is byte-exact. - Mismatched `dungeon.dat` (other port) yields an error, not a corrupt save.
jqueuniet added this to the dm2-tools project 2026-10-24 09:49:02 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jqueuniet/dm2-tools#332
No description provided.