Merge pull request #542 from Parlane/weird_buffering

Remove weird buffering from WII_IPC_HLE_Device_sdio_slot0.cpp
This commit is contained in:
Pierre Bourdon 2014-08-03 21:30:35 -07:00
commit b1553b42ce
1 changed files with 3 additions and 18 deletions

View File

@ -2,8 +2,6 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
#include <vector>
#include "Common/Common.h"
#include "Common/SDCardUtil.h"
@ -398,16 +396,10 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
if (!m_Card.Seek(req.arg, SEEK_SET))
ERROR_LOG(WII_IPC_SD, "Seek failed WTF");
std::vector<u8> buffer(size);
if (m_Card.ReadBytes(buffer.data(), size))
if (m_Card.ReadBytes(Memory::GetPointer(req.addr), size))
{
u32 i;
for (i = 0; i < size; ++i)
{
Memory::Write_U8(buffer[i], req.addr++);
}
DEBUG_LOG(WII_IPC_SD, "Outbuffer size %i got %i", _rwBufferSize, i);
DEBUG_LOG(WII_IPC_SD, "Outbuffer size %i got %i", _rwBufferSize, size);
}
else
{
@ -434,14 +426,7 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
if (!m_Card.Seek(req.arg, SEEK_SET))
ERROR_LOG(WII_IPC_SD, "fseeko failed WTF");
std::vector<u8> buffer(size);
for (u32 i = 0; i < size; ++i)
{
buffer[i] = Memory::Read_U8(req.addr++);
}
if (!m_Card.WriteBytes(buffer.data(), size))
if (!m_Card.WriteBytes(Memory::GetPointer(req.addr), size))
{
ERROR_LOG(WII_IPC_SD, "Write Failed - error: %i, eof: %i",
ferror(m_Card.GetHandle()), feof(m_Card.GetHandle()));