From 165cc200e49e9ec51b76eb4d7d9592c0f4fc1550 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Tue, 11 Oct 2022 12:03:10 +0300 Subject: [PATCH] Match CMemoryCardDriver::WriteBackupBuf Former-commit-id: d780a22b4e9f5fd1d48beeca6762ded513096eb8 --- include/MetroidPrime/Player/CGameState.hpp | 3 +++ src/MetroidPrime/CMemoryCardDriver.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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) {}