From d7cf2ebdde1cd1fcaca2588cb008f65c9ca6768b Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Tue, 11 Oct 2022 14:07:44 +0300 Subject: [PATCH] Match CMemoryCardDriver::CheckCardCapacity --- include/MetroidPrime/CMemoryCardDriver.hpp | 4 ++-- src/MetroidPrime/CMemoryCardDriver.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/MetroidPrime/CMemoryCardDriver.hpp b/include/MetroidPrime/CMemoryCardDriver.hpp index af31b12b..05b32fdd 100644 --- a/include/MetroidPrime/CMemoryCardDriver.hpp +++ b/include/MetroidPrime/CMemoryCardDriver.hpp @@ -110,8 +110,8 @@ private: CAssetId xc_saveIcon1; EState x10_state; EError x14_error; - int x18_cardFreeBytes; - int x1c_cardFreeFiles; + uint x18_cardFreeBytes; + uint x1c_cardFreeFiles; uint x20_fileTime; long long x28_cardSerial; rstl::reserved_vector< u8, 174 > x30_systemData; diff --git a/src/MetroidPrime/CMemoryCardDriver.cpp b/src/MetroidPrime/CMemoryCardDriver.cpp index 731f9e9c..3e706c28 100644 --- a/src/MetroidPrime/CMemoryCardDriver.cpp +++ b/src/MetroidPrime/CMemoryCardDriver.cpp @@ -431,7 +431,12 @@ void CMemoryCardDriver::ClearError() { x14_error = kE_OK; } -void CMemoryCardDriver::CheckCardCapacity() {} +void CMemoryCardDriver::CheckCardCapacity() { + if (x18_cardFreeBytes >= 0x2000 && x1c_cardFreeFiles >= 1) { + return; + } + x14_error = kE_CardStillFull; +} void CMemoryCardDriver::NoCardFound() {}