diff --git a/include/MetroidPrime/Player/CGameState.hpp b/include/MetroidPrime/Player/CGameState.hpp index e75defc6..16d11b58 100644 --- a/include/MetroidPrime/Player/CGameState.hpp +++ b/include/MetroidPrime/Player/CGameState.hpp @@ -22,6 +22,7 @@ public: rstl::rc_ptr< CPlayerState >& PlayerState(); CAssetId CurrentWorldAssetId(); + void WriteBackupBuf(); CSystemOptions& SystemOptions() { return xa8_systemOptions; } CGameOptions& GameOptions() { return x17c_gameOptions; } @@ -29,6 +30,8 @@ public: uint& SaveIdx() { return x20c_saveIdx; } u64& CardSerial() { return x210_cardSerial; } rstl::vector< uchar >& BackupBuf() { return x218_backupBuf; } + void SetCardSerial(u64 serial) { x210_cardSerial = serial; } + u64 GetCardSerial() const { return x210_cardSerial; } struct GameFileStateInfo { double x0_playTime; diff --git a/src/MetroidPrime/CMemoryCardDriver.cpp b/src/MetroidPrime/CMemoryCardDriver.cpp index 799344ec..cb89bd1c 100644 --- a/src/MetroidPrime/CMemoryCardDriver.cpp +++ b/src/MetroidPrime/CMemoryCardDriver.cpp @@ -338,7 +338,10 @@ void CMemoryCardDriver::StartFileRenameBtoA() { } } -void CMemoryCardDriver::WriteBackupBuf() {} +void CMemoryCardDriver::WriteBackupBuf() { + gpGameState->WriteBackupBuf(); + gpGameState->SetCardSerial(x28_cardSerial); +} void CMemoryCardDriver::UpdateFileAltDeleteTransactional(ECardResult) {}