From 3396f2cbfa9826ea9b301c94dbc8246a43df8682 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 27 Dec 2024 10:16:47 +0100 Subject: [PATCH] Added better docs for savegame storage --- src/sram.s | 11 ++++++++--- src/wram.s | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/sram.s b/src/sram.s index dd3786d..b0edd89 100644 --- a/src/sram.s +++ b/src/sram.s @@ -12,10 +12,15 @@ sram_magic: .adv 1 ; checksum of save game ; this is simply all bytes in the save game added -save_game_chksm: .adv 1 +save_game1_chksm: .adv 1 -save_game: .adv SAVE_GAME_SIZE + ; saving rng seed +save_game1_seed: .adv 1 + ; saving all rooms +save_game1_rooms: .adv ROOM_SIZE_TOTAL * ROOMS_TOTAL + ; saving player state +save_game1_player: .adv player_size ; this is a canary value to detect out of bounds reads in sram ; if this value is not SRAM_MAGIC then the save game is corrupted -save_game_overflow_canary: .adv 1 +save_game1_overflow_canary: .adv 1 diff --git a/src/wram.s b/src/wram.s index 870a4cf..3db3cd8 100644 --- a/src/wram.s +++ b/src/wram.s @@ -137,10 +137,10 @@ curr_room_init_act: .adv 2 curr_room_exits: .adv 2 ; total size of a room including the struct header - ; tiles, flags, actors and exits -#define ROOM_SIZE_TOTAL ROOM_TILES_SIZE + ROOM_FLAGS_SIZE + ACTOR_TABLE_SIZE + ROOM_EXIT_TABLE_SIZE - -#define SAVE_GAME_SIZE ROOM_SIZE_TOTAL * ROOMS_TOTAL + player_size + ; tiles, flags, actors and exits + ; rooms are always in the order specified here: + ; room_struct, tiles, flags, actor_table, exit_table +#define ROOM_SIZE_TOTAL room_size + ROOM_TILES_SIZE + ROOM_FLAGS_SIZE + ACTOR_TABLE_SIZE + ROOM_EXIT_TABLE_SIZE ; drawing related flags -- 2.30.2