mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Remove weird buffering from WII_IPC_HLE_Device_sdio_slot0.cpp
This commit is contained in:
parent
fb18b8b689
commit
5dc7c8ad31
@ -2,8 +2,6 @@
|
|||||||
// Licensed under GPLv2
|
// Licensed under GPLv2
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
#include "Common/SDCardUtil.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))
|
if (!m_Card.Seek(req.arg, SEEK_SET))
|
||||||
ERROR_LOG(WII_IPC_SD, "Seek failed WTF");
|
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;
|
DEBUG_LOG(WII_IPC_SD, "Outbuffer size %i got %i", _rwBufferSize, size);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
else
|
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))
|
if (!m_Card.Seek(req.arg, SEEK_SET))
|
||||||
ERROR_LOG(WII_IPC_SD, "fseeko failed WTF");
|
ERROR_LOG(WII_IPC_SD, "fseeko failed WTF");
|
||||||
|
|
||||||
std::vector<u8> buffer(size);
|
if (!m_Card.WriteBytes(Memory::GetPointer(req.addr), size))
|
||||||
|
|
||||||
for (u32 i = 0; i < size; ++i)
|
|
||||||
{
|
|
||||||
buffer[i] = Memory::Read_U8(req.addr++);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_Card.WriteBytes(buffer.data(), size))
|
|
||||||
{
|
{
|
||||||
ERROR_LOG(WII_IPC_SD, "Write Failed - error: %i, eof: %i",
|
ERROR_LOG(WII_IPC_SD, "Write Failed - error: %i, eof: %i",
|
||||||
ferror(m_Card.GetHandle()), feof(m_Card.GetHandle()));
|
ferror(m_Card.GetHandle()), feof(m_Card.GetHandle()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user