From 5dc7c8ad3150e1af8516c68261f6fee012038e4d Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Mon, 30 Jun 2014 03:34:28 +0000 Subject: [PATCH] Remove weird buffering from WII_IPC_HLE_Device_sdio_slot0.cpp --- .../IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp index 746064d705..abb3517753 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp @@ -2,8 +2,6 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include - #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 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 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()));