mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-06 16:18:58 +00:00
SDIO: report actual error if writes are disabled
This commit is contained in:
parent
f706bb0aff
commit
ed0d33953d
1 changed files with 18 additions and 11 deletions
|
@ -309,7 +309,9 @@ 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}!",
|
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);
|
req.isDMA ? "DMA " : "", req.blocks, req.addr, req.bsize, req.arg);
|
||||||
|
|
||||||
if (m_card && Config::Get(Config::MAIN_ALLOW_SD_WRITES))
|
if (m_card)
|
||||||
|
{
|
||||||
|
if (Config::Get(Config::MAIN_ALLOW_SD_WRITES))
|
||||||
{
|
{
|
||||||
const u32 size = req.bsize * req.blocks;
|
const u32 size = req.bsize * req.blocks;
|
||||||
const u64 address = GetAddressFromRequest(req.arg);
|
const u64 address = GetAddressFromRequest(req.arg);
|
||||||
|
@ -319,11 +321,16 @@ s32 SDIOSlot0Device::ExecuteCommand(const Request& request, u32 buffer_in, u32 b
|
||||||
|
|
||||||
if (!m_card.WriteBytes(memory.GetPointerForRange(req.addr, size), size))
|
if (!m_card.WriteBytes(memory.GetPointerForRange(req.addr, size), size))
|
||||||
{
|
{
|
||||||
ERROR_LOG_FMT(IOS_SD, "Write Failed - error: {}, eof: {}", std::ferror(m_card.GetHandle()),
|
ERROR_LOG_FMT(IOS_SD, "Write Failed - error: {}, eof: {}",
|
||||||
std::feof(m_card.GetHandle()));
|
std::ferror(m_card.GetHandle()), std::feof(m_card.GetHandle()));
|
||||||
ret = RET_FAIL;
|
ret = RET_FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = -10;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
memory.Write_U32(0x900, buffer_out);
|
memory.Write_U32(0x900, buffer_out);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue