feat(bindings): SaveGame in wasm, FFI and Python #449

Merged
jqueuniet merged 1 commit from feat/446-save-game-bindings into main 2026-10-31 08:43:16 +01:00
Owner

Part of #446 (PR 2b of 3). Stacked on #448.

SaveGame as a wasm class, an opaque Dm2SaveGame * in C (dm2_save_game_*; edits return an empty buffer) and a Python class. READMEs and CHANGELOG updated.

Release wasm (without wasm-opt), node, DOS EN sksave0.dat:

operation free functions SaveGame
item move + inventory read 32 ms 0.5 ms
open (saveToJsonFull / new SaveGame) 10.2 ms 1.8 ms
bytes (saveFromJsonFull / toBytes) 12.9 ms 0.8 ms

The edited bytes are identical either way.

https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7

Part of #446 (PR 2b of 3). Stacked on #448. `SaveGame` as a wasm class, an opaque `Dm2SaveGame *` in C (`dm2_save_game_*`; edits return an empty buffer) and a Python class. READMEs and CHANGELOG updated. Release wasm (without wasm-opt), node, DOS EN `sksave0.dat`: | operation | free functions | `SaveGame` | |---|---|---| | item move + inventory read | 32 ms | 0.5 ms | | open (`saveToJsonFull` / `new SaveGame`) | 10.2 ms | 1.8 ms | | bytes (`saveFromJsonFull` / `toBytes`) | 12.9 ms | 0.8 ms | The edited bytes are identical either way. https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
feat(bindings): SaveGame in wasm, FFI and Python
All checks were successful
CI / msrv (1.90) (pull_request) Successful in 34s
CI / stable (pull_request) Successful in 59s
CI / audit (pull_request) Successful in 13s
CI / python bindings (3.11) (pull_request) Successful in 26s
CI / msrv (1.90) (push) Successful in 29s
CI / audit (push) Successful in 19s
CI / stable (push) Successful in 58s
CI / python bindings (3.11) (push) Successful in 27s
4ece850c57
A SaveGame class in wasm, an opaque Dm2SaveGame * in C and a Python
class, built from save bytes or a dump against the dungeon and
graphics handles; options objects as GraphicsArchive's. In wasm, an
item move plus inventory read drops from 32 ms to 0.5 ms on DOS
sksave0.

Part of #446

Claude-Session: https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
jqueuniet changed target branch from feat/446-save-game to main 2026-10-31 08:42:52 +01:00
jqueuniet deleted branch feat/446-save-game-bindings 2026-10-31 08:43:16 +01:00
Sign in to join this conversation.
No reviewers
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!449
No description provided.