Remove weird buffering from WII_IPC_HLE_Device_sdio_slot0.cpp

This commit is contained in:
Matthew Parlane 2014-06-30 03:34:28 +00:00
parent fb18b8b689
commit 5dc7c8ad31
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()));