diff options
| author | Naim2000 <naimarnohero@gmail.com> | 2024-12-08 13:11:34 -0500 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2025-11-19 20:11:05 -0600 |
| commit | 227c4e05158e7c3cc41cfc751ba6b5df92193d26 (patch) | |
| tree | 531599cb5ed90ee0871686f3ccab73619bbfd7ce /Source | |
| parent | 2e340ab160cba5c3fb02a4af60d75a6fc3801a38 (diff) | |
SDIO: report actual error if writes are disabled
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/Core/IOS/SDIO/SDIOSlot0.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp index df1419a6c0..3500e22d41 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp @@ -309,7 +309,12 @@ s32 SDIOSlot0Device::ExecuteCommand(const Request& request, u32 buffer_in, u32 b INFO_LOG_FMT(IOS_SD, "{}Write {} Block(s) from {:#010x} bsize {} to offset {:#010x}!", req.isDMA ? "DMA " : "", req.blocks, req.addr, req.bsize, req.arg); - if (m_card && Config::Get(Config::MAIN_ALLOW_SD_WRITES)) + if (!Config::Get(Config::MAIN_ALLOW_SD_WRITES)) + { + ERROR_LOG_FMT(IOS_SD, "Write attempted while locked."); + ret = RET_LOCKED; + } + else if (m_card) { const u32 size = req.bsize * req.blocks; const u64 address = GetAddressFromRequest(req.arg); diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.h b/Source/Core/Core/IOS/SDIO/SDIOSlot0.h index 242b8d57cc..8f5ab32a8e 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.h +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.h @@ -63,6 +63,7 @@ private: { RET_OK, RET_FAIL, + RET_LOCKED = -10, RET_EVENT_REGISTER, // internal state only - not actually returned }; |
