diff --git a/soh/include/functions.h b/soh/include/functions.h
index 4631cdb92..9284d2ccd 100644
--- a/soh/include/functions.h
+++ b/soh/include/functions.h
@@ -1322,18 +1322,9 @@ void SkinMatrix_SetTranslateRotateZYX(MtxF* dest, s16 rotX, s16 rotY, s16 rotZ,
f32 translateZ);
Mtx* SkinMatrix_MtxFToNewMtx(GraphicsContext* gfxCtx, MtxF* src);
void SkinMatrix_SetRotateAxis(MtxF* mf, s16 angle, f32 axisX, f32 axisY, f32 axisZ);
-void Sram_InitNewSave(void);
-void Sram_InitDebugSave(void);
-void Sram_OpenSave(SramContext* sramCtx);
-void Sram_WriteSave(SramContext* sramCtx);
-void Sram_VerifyAndLoadAllSaves(FileChooseContext* fileChoose, SramContext* sramCtx);
-void Sram_InitSave(FileChooseContext* fileChoose, SramContext* sramCtx);
-void Sram_EraseSave(FileChooseContext* fileChoose, SramContext* sramCtx);
-void Sram_CopySave(FileChooseContext* fileChoose, SramContext* sramCtx);
-void Sram_WriteSramHeader(SramContext* sramCtx);
-void Sram_InitSram(GameState* gameState, SramContext* sramCtx);
-void Sram_Alloc(GameState* gameState, SramContext* sramCtx);
-void Sram_Init(GlobalContext* globalCtx, SramContext* sramCtx);
+void Sram_OpenSave();
+void Sram_InitSave(FileChooseContext* fileChoose);
+void Sram_InitSram(GameState* gameState);
void SsSram_ReadWrite(uintptr_t addr, void* dramAddr, size_t size, s32 direction);
void func_800A9F30(PadMgr*, s32);
void func_800A9F6C(f32, u8, u8, u8);
diff --git a/soh/include/z64.h b/soh/include/z64.h
index 05a32a1f9..20874908f 100644
--- a/soh/include/z64.h
+++ b/soh/include/z64.h
@@ -1072,10 +1072,6 @@ typedef struct {
/* 0x01 */ u8 room;
} EntranceEntry;
-typedef struct {
- /* 0x00 */ u8* readBuff;
-} SramContext; // size = 0x4
-
#define SRAM_SIZE 0x8000
#define SRAM_HEADER_SIZE 0x10
@@ -1120,7 +1116,6 @@ typedef struct {
/* 0x0000 */ GameState state;
/* 0x00A4 */ u8* staticSegment;
/* 0x00A8 */ View view;
- /* 0x01D0 */ SramContext sramCtx;
/* 0x01D4 */ u16 unk_1D4; // not used in mq dbg (some sort of timer that doesn't seem to affect anything)
/* 0x01D6 */ s16 coverAlpha;
/* 0x01D8 */ s16 addAlpha; // not used in mq dbg
@@ -1206,7 +1201,6 @@ typedef struct GlobalContext {
/* 0x01C24 */ ActorContext actorCtx;
/* 0x01D64 */ CutsceneContext csCtx; // "demo_play"
/* 0x01DB4 */ SoundSource soundSources[16];
- /* 0x01F74 */ SramContext sramCtx;
/* 0x01F78 */ SkyboxContext skyboxCtx;
/* 0x020D8 */ MessageContext msgCtx; // "message"
/* 0x104F0 */ InterfaceContext interfaceCtx; // "parameter"
@@ -1280,7 +1274,6 @@ typedef struct {
/* 0x000AC */ u8* parameterSegment;
/* 0x000B0 */ char unk_B0[0x8];
/* 0x000B8 */ View view;
- /* 0x001E0 */ SramContext sramCtx;
/* 0x001E4 */ char unk_1E4[0x4];
/* 0x001E8 */ SkyboxContext skyboxCtx;
/* 0x00348 */ MessageContext msgCtx;
@@ -1291,13 +1284,6 @@ typedef struct {
/* 0x1C9EC */ Vtx* keyboardVtx;
/* 0x1C9F0 */ Vtx* nameEntryVtx;
/* 0x1C9F4 */ u8 n64ddFlag;
- /* 0x1C9F6 */ u16 deaths[3];
- /* 0x1C9FC */ u8 fileNames[3][8];
- /* 0x1CA14 */ u16 healthCapacities[3];
- /* 0x1CA1C */ u32 questItems[3];
- /* 0x1CA28 */ s16 n64ddFlags[3];
- /* 0x1CA2E */ s8 defense[3];
- /* 0x1CA32 */ u16 health[3];
/* 0x1CA38 */ s16 buttonIndex;
/* 0x1CA3A */ s16 confirmButtonIndex; // 0: yes, 1: quit
/* 0x1CA3C */ s16 menuMode;
diff --git a/soh/include/z64save.h b/soh/include/z64save.h
index 982da9d5c..a284dbf56 100644
--- a/soh/include/z64save.h
+++ b/soh/include/z64save.h
@@ -68,7 +68,6 @@ typedef struct {
/* 0x0010 */ s32 nightFlag;
/* 0x0014 */ s32 totalDays;
/* 0x0018 */ s32 bgsDayCount; // increments with totalDays, can be cleared with `Environment_ClearBgsDayCount`
- /* 0x001C */ char newf[6]; // string "ZELDAZ". start of `info` substruct, originally called "information"
/* 0x0022 */ u16 deaths;
/* 0x0024 */ char playerName[8];
/* 0x002C */ s16 n64ddFlag;
@@ -80,7 +79,6 @@ typedef struct {
/* 0x0036 */ u16 swordHealth;
/* 0x0038 */ u16 naviTimer;
/* 0x003A */ u8 magicAcquired;
- /* 0x003B */ char unk_3B[0x01];
/* 0x003C */ u8 doubleMagic;
/* 0x003D */ u8 doubleDefense;
/* 0x003E */ u8 bgsFlag;
@@ -88,30 +86,23 @@ typedef struct {
/* 0x0040 */ ItemEquips childEquips;
/* 0x004A */ ItemEquips adultEquips;
/* 0x0054 */ u32 unk_54; // this may be incorrect, currently used for alignement
- /* 0x0058 */ char unk_58[0x0E];
/* 0x0066 */ s16 savedSceneNum;
/* 0x0068 */ ItemEquips equips;
/* 0x0074 */ Inventory inventory;
/* 0x00D4 */ SavedSceneFlags sceneFlags[124];
/* 0x0E64 */ FaroresWindData fw;
- /* 0x0E8C */ char unk_E8C[0x10];
/* 0x0E9C */ s32 gsFlags[6];
- /* 0x0EB4 */ char unk_EB4[0x4];
/* 0x0EB8 */ s32 highScores[7];
/* 0x0ED4 */ u16 eventChkInf[14]; // "event_chk_inf"
/* 0x0EF0 */ u16 itemGetInf[4]; // "item_get_inf"
/* 0x0EF8 */ u16 infTable[30]; // "inf_table"
- /* 0x0F34 */ char unk_F34[0x04];
/* 0x0F38 */ u32 worldMapAreaData; // "area_arrival"
- /* 0x0F3C */ char unk_F3C[0x4];
/* 0x0F40 */ u8 scarecrowCustomSongSet;
/* 0x0F41 */ u8 scarecrowCustomSong[0x360];
- /* 0x12A1 */ char unk_12A1[0x24];
/* 0x12C5 */ u8 scarecrowSpawnSongSet;
/* 0x12C6 */ u8 scarecrowSpawnSong[0x80];
/* 0x1346 */ char unk_1346[0x02];
/* 0x1348 */ HorseData horseData;
- /* 0x1352 */ u16 checksum; // "check_sum"
/* 0x1354 */ s32 fileNum; // "file_no"
/* 0x1358 */ char unk_1358[0x0004];
/* 0x135C */ s32 gameMode;
@@ -120,13 +111,11 @@ typedef struct {
/* 0x1368 */ RespawnData respawn[3]; // "restart_data"
/* 0x13BC */ f32 entranceSpeed;
/* 0x13C0 */ u16 entranceSound;
- /* 0x13C2 */ char unk_13C2[0x0001];
/* 0x13C3 */ u8 unk_13C3;
/* 0x13C4 */ s16 dogParams;
/* 0x13C6 */ u8 textTriggerFlags;
/* 0x13C7 */ u8 showTitleCard;
/* 0x13C8 */ s16 nayrusLoveTimer;
- /* 0x13CA */ char unk_13CA[0x0002];
/* 0x13CC */ s16 rupeeAccumulator;
/* 0x13CE */ s16 timer1State;
/* 0x13D0 */ s16 timer1Value;
@@ -134,7 +123,6 @@ typedef struct {
/* 0x13D4 */ s16 timer2Value;
/* 0x13D6 */ s16 timerX[2];
/* 0x13DA */ s16 timerY[2];
- /* 0x13DE */ char unk_13DE[0x0002];
/* 0x13E0 */ u8 seqId;
/* 0x13E1 */ u8 natureAmbienceId;
/* 0x13E2 */ u8 buttonStatus[5];
@@ -152,14 +140,11 @@ typedef struct {
/* 0x1402 */ u16 mapIndex; // intended for maps/minimaps but commonly used as the dungeon index
/* 0x1404 */ u16 minigameState;
/* 0x1406 */ u16 minigameScore; // "yabusame_total"
- /* 0x1408 */ char unk_1408[0x0001];
/* 0x1409 */ u8 language; // NTSC 0: Japanese; 1: English | PAL 0: English; 1: German; 2: French
/* 0x140A */ u8 audioSetting;
- /* 0x140B */ char unk_140B[0x0001];
/* 0x140C */ u8 zTargetSetting; // 0: Switch; 1: Hold
/* 0x140E */ u16 forcedSeqId; // immediately start playing the sequence if set
/* 0x1410 */ u8 unk_1410; // transition related
- /* 0x1411 */ char unk_1411[0x0001];
/* 0x1412 */ u16 nextCutsceneIndex;
/* 0x1414 */ u8 cutsceneTrigger;
/* 0x1415 */ u8 chamberCutsceneNum;
@@ -169,7 +154,6 @@ typedef struct {
/* 0x141A */ u16 skyboxTime;
/* 0x141C */ u8 dogIsLost;
/* 0x141D */ u8 nextTransition;
- /* 0x141E */ char unk_141E[0x0002];
/* 0x1420 */ s16 worldMapArea;
/* 0x1422 */ s16 sunsSongState; // controls the effects of suns song
/* 0x1424 */ s16 healthAccumulator;
diff --git a/soh/soh.vcxproj b/soh/soh.vcxproj
index b3ac29855..75ed13bef 100644
--- a/soh/soh.vcxproj
+++ b/soh/soh.vcxproj
@@ -186,6 +186,7 @@
+
@@ -935,8 +936,10 @@
+
+
diff --git a/soh/soh.vcxproj.filters b/soh/soh.vcxproj.filters
index e2add99f7..f72817cea 100644
--- a/soh/soh.vcxproj.filters
+++ b/soh/soh.vcxproj.filters
@@ -85,6 +85,9 @@
{dbcf07c4-80b1-4c88-ac54-2bbdd8f53ee4}
+
+ {9c880c8e-492b-48f6-b230-1fd269ea74b1}
+
@@ -2202,6 +2205,9 @@
Source Files\soh\Enhancements
+
+ Source Files\soh
+
@@ -3770,6 +3776,12 @@
Source Files\soh
+
+ Source Files\soh\Lib\nlohmann
+
+
+ Source Files\soh
+
diff --git a/soh/soh/Lib/nlohmann/LICENSE.MIT b/soh/soh/Lib/nlohmann/LICENSE.MIT
new file mode 100644
index 000000000..1c1f7a690
--- /dev/null
+++ b/soh/soh/Lib/nlohmann/LICENSE.MIT
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2013-2022 Niels Lohmann
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/soh/soh/Lib/nlohmann/json.hpp b/soh/soh/Lib/nlohmann/json.hpp
new file mode 100644
index 000000000..cb27e0581
--- /dev/null
+++ b/soh/soh/Lib/nlohmann/json.hpp
@@ -0,0 +1,22091 @@
+/*
+ __ _____ _____ _____
+ __| | __| | | | JSON for Modern C++
+| | |__ | | | | | | version 3.10.5
+|_____|_____|_____|_|___| https://github.com/nlohmann/json
+
+Licensed under the MIT License .
+SPDX-License-Identifier: MIT
+Copyright (c) 2013-2022 Niels Lohmann .
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/****************************************************************************\
+ * Note on documentation: The source files contain links to the online *
+ * documentation of the public API at https://json.nlohmann.me. This URL *
+ * contains the most recent documentation and should also be applicable to *
+ * previous versions; documentation for deprecated functions is not *
+ * removed, but marked deprecated. See "Generate documentation" section in *
+ * file doc/README.md. *
+\****************************************************************************/
+
+#ifndef INCLUDE_NLOHMANN_JSON_HPP_
+#define INCLUDE_NLOHMANN_JSON_HPP_
+
+#define NLOHMANN_JSON_VERSION_MAJOR 3
+#define NLOHMANN_JSON_VERSION_MINOR 10
+#define NLOHMANN_JSON_VERSION_PATCH 5
+
+#include // all_of, find, for_each
+#include // nullptr_t, ptrdiff_t, size_t
+#include // hash, less
+#include // initializer_list
+#ifndef JSON_NO_IO
+ #include // istream, ostream
+#endif // JSON_NO_IO
+#include // random_access_iterator_tag
+#include // unique_ptr
+#include // accumulate
+#include // string, stoi, to_string
+#include // declval, forward, move, pair, swap
+#include // vector
+
+// #include
+
+
+#include
+#include
+
+// #include
+
+
+#include // transform
+#include // array
+#include // forward_list
+#include // inserter, front_inserter, end
+#include