some more error logging goodness in wii sd

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3023 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-04-20 17:26:40 +00:00
parent 8ef66cac92
commit daac0d8ca1
1 changed files with 9 additions and 5 deletions

View File

@ -208,6 +208,8 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
req.isDMA = Memory::Read_U32(_BufferIn + 28);
req.pad0 = Memory::Read_U32(_BufferIn + 32);
u32 success = 0;
switch (req.command)
{
case SELECT_CARD:
@ -237,7 +239,8 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
{
u32 size = req.bsize * req.blocks;
fseek(m_Card, req.arg, SEEK_SET);
if (fseek(m_Card, req.arg, SEEK_SET) != 0)
ERROR_LOG(WII_IPC_SD, "fseek failed WTF");
u8* buffer = new u8[size];
@ -250,14 +253,15 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
Memory::Write_U8((u8)buffer[i], req.addr++);
}
DEBUG_LOG(WII_IPC_SD, "outbuffer size %i wrote %i", _BufferOutSize, i);
return 1;
success = 1;
}
else
{
ERROR_LOG(WII_IPC_SD, "Read Failed %x", nRead);
ERROR_LOG(WII_IPC_SD, "Read Failed - read %x, error %i, eof? %i",
nRead, ferror(m_Card), feof(m_Card));
}
delete buffer;
delete [] buffer;
}
}
break;
@ -267,5 +271,5 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
break;
}
return 0;
return success;
}