diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2025-11-19 20:13:33 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2025-11-19 21:05:57 -0600 |
| commit | 1a71f0fa2e85244a977fceff717a08f1e97d5d02 (patch) | |
| tree | d3faa9c51de796e76066863d6cd0c565aa9ca5ad /Source/Core | |
| parent | f1f8b0a825fd288ef1ab445fb0b2603fddae6b19 (diff) | |
SDIO: Remove file "good" checks so errors are properly produced.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp index b8d389a8a2..6047c88088 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp @@ -284,24 +284,21 @@ s32 SDIOSlot0Device::ExecuteCommand(const Request& request, u32 buffer_in, u32 b INFO_LOG_FMT(IOS_SD, "{}Read {} Block(s) from {:#010x} bsize {} into {:#010x}!", req.isDMA ? "DMA " : "", req.blocks, req.arg, req.bsize, req.addr); - if (m_card) - { - const u32 size = req.bsize * req.blocks; - const u64 address = GetAddressFromRequest(req.arg); + const u32 size = req.bsize * req.blocks; + const u64 address = GetAddressFromRequest(req.arg); - if (!m_card.Seek(address, File::SeekOrigin::Begin)) - ERROR_LOG_FMT(IOS_SD, "Seek failed"); + if (!m_card.Seek(address, File::SeekOrigin::Begin)) + ERROR_LOG_FMT(IOS_SD, "Seek failed"); - if (m_card.ReadBytes(memory.GetPointerForRange(req.addr, size), size)) - { - DEBUG_LOG_FMT(IOS_SD, "Outbuffer size {} got {}", rw_buffer_size, size); - } - else - { - ERROR_LOG_FMT(IOS_SD, "Read Failed - error: {}, eof: {}", std::ferror(m_card.GetHandle()), - std::feof(m_card.GetHandle())); - ret = RET_FAIL; - } + if (m_card.ReadBytes(memory.GetPointerForRange(req.addr, size), size)) + { + DEBUG_LOG_FMT(IOS_SD, "Outbuffer size {} got {}", rw_buffer_size, size); + } + else + { + ERROR_LOG_FMT(IOS_SD, "Read Failed - error: {}, eof: {}", std::ferror(m_card.GetHandle()), + std::feof(m_card.GetHandle())); + ret = RET_FAIL; } } memory.Write_U32(0x900, buffer_out); @@ -319,7 +316,7 @@ s32 SDIOSlot0Device::ExecuteCommand(const Request& request, u32 buffer_in, u32 b ERROR_LOG_FMT(IOS_SD, "Write attempted while locked."); ret = RET_LOCKED; } - else if (m_card) + else { const u32 size = req.bsize * req.blocks; const u64 address = GetAddressFromRequest(req.arg); @@ -475,24 +472,21 @@ std::optional<IPCReply> SDIOSlot0Device::SendCommand(const IOCtlRequest& request IPCReply SDIOSlot0Device::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() <= SDSC_MAX_SIZE) { - if (m_card.GetSize() <= SDSC_MAX_SIZE) - { - // No further initialization required. - m_status |= CARD_INITIALIZED; - } - else + // No further initialization required. + m_status |= CARD_INITIALIZED; + } + else + { + // Some IOS versions support SDHC. + // Others will work if they are manually initialized (SEND_IF_COND) + if (m_sdhc_supported) { - // Some IOS versions support SDHC. - // Others will work if they are manually initialized (SEND_IF_COND) - if (m_sdhc_supported) - { - // All of the initialization is done internally by IOS, so we get to skip some steps. - InitSDHC(); - } - m_status |= CARD_SDHC; + // All of the initialization is done internally by IOS, so we get to skip some steps. + InitSDHC(); } + m_status |= CARD_SDHC; } // Evaluate whether a card is currently inserted (config value). |
