This commit is contained in:
rozlette 2022-05-23 00:16:16 -05:00
commit 71af01bda9
5 changed files with 6 additions and 36 deletions

View file

@ -1323,11 +1323,7 @@ void SkinMatrix_SetTranslateRotateZYX(MtxF* dest, s16 rotX, s16 rotY, s16 rotZ,
Mtx* SkinMatrix_MtxFToNewMtx(GraphicsContext* gfxCtx, MtxF* src);
void SkinMatrix_SetRotateAxis(MtxF* mf, s16 angle, f32 axisX, f32 axisY, f32 axisZ);
void Sram_OpenSave();
void Sram_WriteSave();
void Sram_InitSave(FileChooseContext* fileChoose);
void Sram_EraseSave(FileChooseContext* fileChoose);
void Sram_CopySave(FileChooseContext* fileChoose);
void Sram_WriteSramHeader();
void Sram_InitSram(GameState* gameState);
void SsSram_ReadWrite(uintptr_t addr, void* dramAddr, size_t size, s32 direction);
void func_800A9F30(PadMgr*, s32);

View file

@ -3,9 +3,6 @@
#include <string.h>
void Sram_InitNewSave(void);
void Sram_InitDebugSave(void);
/**
* Initialize new save.
* This save has an empty inventory with 3 hearts and single magic.
@ -180,14 +177,6 @@ void Sram_OpenSave() {
gSaveContext.magicLevel = 0;
}
/**
* Write the contents of the Save Context to a main and backup slot in SRAM.
* Note: The whole Save Context is written even though only the `save` substruct is read back later
*/
void Sram_WriteSave() {
Save_SaveFile();
}
void Sram_InitSave(FileChooseContext* fileChooseCtx) {
u16 offset;
u16 j;
@ -213,22 +202,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
gSaveContext.playerName[offset] = Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->playerName[offset];
}
Sram_WriteSave();
}
void Sram_EraseSave(FileChooseContext* fileChooseCtx) {
Save_DeleteFile(fileChooseCtx->selectedFileIndex);
}
void Sram_CopySave(FileChooseContext* fileChooseCtx) {
Save_CopyFile(fileChooseCtx->selectedFileIndex, fileChooseCtx->copyDestFileIndex);
}
/**
* Write the first 16 bytes of the read buffer to the SRAM header
*/
void Sram_WriteSramHeader() {
Save_SaveGlobal();
Save_SaveFile();
}
void Sram_InitSram(GameState* gameState) {

View file

@ -367,7 +367,7 @@ void FileChoose_CopyConfirm(GameState* thisx) {
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
} else if (CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) {
dayTime = gSaveContext.dayTime;
Sram_CopySave(this);
Save_CopyFile(this->selectedFileIndex, this->copyDestFileIndex);
gSaveContext.dayTime = dayTime;
this->fileInfoAlpha[this->copyDestFileIndex] = this->nameAlpha[this->copyDestFileIndex] = 0;
this->nextTitleLabel = FS_TITLE_COPY_COMPLETE;
@ -924,7 +924,7 @@ void FileChoose_EraseAnim1(GameState* thisx) {
D_80813800 += 2;
if (this->actionTimer == 0) {
Sram_EraseSave(this);
Save_DeleteFile(this->selectedFileIndex);
this->titleLabel = this->nextTitleLabel;
this->titleAlpha[0] = 255;
this->titleAlpha[1] = this->connectorAlpha[this->selectedFileIndex] = 0;

View file

@ -663,7 +663,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) {
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
this->configMode = CM_OPTIONS_TO_MAIN;
osSyncPrintf("");
Sram_WriteSramHeader();
Save_SaveGlobal();
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting);
osSyncPrintf("Na_SetSoundOutputMode = %d\n", gSaveContext.audioSetting);

View file

@ -3625,7 +3625,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx)
&D_801333E8);
Gameplay_SaveSceneFlags(globalCtx);
gSaveContext.savedSceneNum = globalCtx->sceneNum;
Sram_WriteSave();
Save_SaveFile();
pauseCtx->unk_1EC = 4;
D_8082B25C = 3;
}
@ -3865,7 +3865,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx)
pauseCtx->promptChoice = 0;
Gameplay_SaveSceneFlags(globalCtx);
gSaveContext.savedSceneNum = globalCtx->sceneNum;
Sram_WriteSave();
Save_SaveFile();
pauseCtx->state = 0xF;
D_8082B25C = 3;
}