Skip to content

Commit

Permalink
Merge pull request #6194 from TBoshoven/sdhc-off-by-one
Browse files Browse the repository at this point in the history
Off-by-one in SDHC detection
  • Loading branch information
delroth committed Nov 14, 2017
2 parents 8c6465c + 1fc7cf3 commit 496c337
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions Source/Core/Core/IOS/SDIO/SDIOSlot0.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ class SDIOSlot0 : public Device
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
{
Expand Down

0 comments on commit 496c337

Please sign in to comment.