diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2017-11-14 19:10:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-14 19:10:36 +0100 |
| commit | 496c33738f380482ee83c578fbb3dabd2f06aa74 (patch) | |
| tree | dd68670319ded57bcc6f1d799fdf03a827a9cb41 /Source | |
| parent | 8c6465c66f50eb9f0ec53299350c1fd532e3cd95 (diff) | |
| parent | 1fc7cf3cb4264815099c5b6dd3624e24ae8741c9 (diff) | |
Merge pull request #6194 from TBoshoven/sdhc-off-by-one
Off-by-one in SDHC detection
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/IOS/SDIO/SDIOSlot0.h | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp index a832c66b38..2b8fa3e79d 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp @@ -439,7 +439,7 @@ IPCCommandResult SDIOSlot0::GetStatus(const IOCtlRequest& request) // Since IOS does the SD initialization itself, we just say we're always initialized. if (m_card) { - if (m_card.GetSize() < SDHC_BYTES) + if (m_card.GetSize() <= SDSC_MAX_SIZE) { // No further initialization required. m_status |= CARD_INITIALIZED; diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.h b/Source/Core/Core/IOS/SDIO/SDIOSlot0.h index ee6e3115e0..b9b605b2ff 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.h +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.h @@ -118,8 +118,9 @@ private: V2, }; - // Number of bytes to trigger using SDHC instead of SDSC - static constexpr u32 SDHC_BYTES = 0x80000000; + // Maximum number of bytes in an SDSC card + // Used to trigger using SDHC instead of SDSC + static constexpr u64 SDSC_MAX_SIZE = 0x80000000; struct Event { |
