code wiki / (root) / nx_save_slot.nx

nx_save_slot.nx

buildroot/runtime/nx_save_slot.nx

5133 B145 linesdepth 4pulls 6 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_save_slot.nx -- signed content-addressed game save format. Composes nx_chromatin (snapshot mechanism) + nx_hash_facade (content hash) + nx_sign_facade (signature). A save_slot holds player + world chromatin pointers; verify roundtrip ensures the saved state hasn't been tampered with between sessions. Composes: nx_chromatin -- snapshots are the substrate's canonical state-capture nx_hash_facade -- content hash for the combined player+world bytes nx_sign_facade -- signature over (hash + ts + save_id) nx_vacuole -- saves can be stored in a vacuole

dependencies 5 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_chromatin.nx nx_hash_facade.nx nx_sign_facade.nx nx_save_slot.nx nx_game_runtime_compose_test.nx nx_save_slot_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_chromatin.nxnx_hash_facade.nxnx_sign_facade.nx

imported by: nx_game_runtime_compose_test.nxnx_save_slot_test.nx

structs

29struct NxSaveSlot

consts

20const NX_SS_OK: nx_int = 0
21const NX_SS_ERR_BAD_INPUT: nx_int = 1
22const NX_SS_ERR_BAD_SIG: nx_int = 2
23const NX_SS_ERR_BAD_HASH: nx_int = 3
24const NX_SS_VALID: nx_int = 4
25const NX_SS_INVALID: nx_int = 5

functions

44func _hash_two_chromatins(player: *NxChromatin, world: *NxChromatin) -> nx_size
57func nx_save_slot_create(save_id: nx_int,
106func nx_save_slot_verify(s: *NxSaveSlot,
135func nx_save_slot_id(s: *NxSaveSlot) -> nx_int
called by 2: mainmain
139func nx_save_slot_captured_us(s: *NxSaveSlot) -> nx_size
called by 1: main
143func nx_save_slot_combined_hash(s: *NxSaveSlot) -> nx_size