mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
@ -2,6 +2,8 @@
|
|||||||
// Licensed under GPLv2+
|
// Licensed under GPLv2+
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include "Common/ChunkFile.h"
|
#include "Common/ChunkFile.h"
|
||||||
#include "Common/CommonFuncs.h"
|
#include "Common/CommonFuncs.h"
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
@ -104,58 +106,55 @@ void CheckGatherPipe()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write8(const u8 _iValue)
|
void Write8(const u8 value)
|
||||||
{
|
{
|
||||||
// LOG(GPFIFO, "GPFIFO #%x: 0x%02x",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue);
|
FastWrite8(value);
|
||||||
FastWrite8(_iValue);
|
|
||||||
CheckGatherPipe();
|
CheckGatherPipe();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write16(const u16 _iValue)
|
void Write16(const u16 value)
|
||||||
{
|
{
|
||||||
// LOG(GPFIFO, "GPFIFO #%x: 0x%04x",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue);
|
FastWrite16(value);
|
||||||
FastWrite16(_iValue);
|
|
||||||
CheckGatherPipe();
|
CheckGatherPipe();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write32(const u32 _iValue)
|
void Write32(const u32 value)
|
||||||
{
|
{
|
||||||
//#ifdef _DEBUG
|
FastWrite32(value);
|
||||||
// float floatvalue = *(float*)&_iValue;
|
|
||||||
// LOG(GPFIFO, "GPFIFO #%x: 0x%08x / %f",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue, floatvalue);
|
|
||||||
//#endif
|
|
||||||
FastWrite32(_iValue);
|
|
||||||
CheckGatherPipe();
|
CheckGatherPipe();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write64(const u64 _iValue)
|
void Write64(const u64 value)
|
||||||
{
|
{
|
||||||
FastWrite64(_iValue);
|
FastWrite64(value);
|
||||||
CheckGatherPipe();
|
CheckGatherPipe();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FastWrite8(const u8 _iValue)
|
void FastWrite8(const u8 value)
|
||||||
{
|
{
|
||||||
m_gatherPipe[m_gatherPipeCount] = _iValue;
|
m_gatherPipe[m_gatherPipeCount] = value;
|
||||||
++m_gatherPipeCount;
|
++m_gatherPipeCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FastWrite16(const u16 _iValue)
|
void FastWrite16(u16 value)
|
||||||
{
|
{
|
||||||
*(u16*)(&m_gatherPipe[m_gatherPipeCount]) = Common::swap16(_iValue);
|
value = Common::swap16(value);
|
||||||
m_gatherPipeCount += 2;
|
std::memcpy(&m_gatherPipe[m_gatherPipeCount], &value, sizeof(u16));
|
||||||
|
m_gatherPipeCount += sizeof(u16);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FastWrite32(const u32 _iValue)
|
void FastWrite32(u32 value)
|
||||||
{
|
{
|
||||||
*(u32*)(&m_gatherPipe[m_gatherPipeCount]) = Common::swap32(_iValue);
|
value = Common::swap32(value);
|
||||||
m_gatherPipeCount += 4;
|
std::memcpy(&m_gatherPipe[m_gatherPipeCount], &value, sizeof(u32));
|
||||||
|
m_gatherPipeCount += sizeof(u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FastWrite64(const u64 _iValue)
|
void FastWrite64(u64 value)
|
||||||
{
|
{
|
||||||
*(u64*)(&m_gatherPipe[m_gatherPipeCount]) = Common::swap64(_iValue);
|
value = Common::swap64(value);
|
||||||
m_gatherPipeCount += 8;
|
std::memcpy(&m_gatherPipe[m_gatherPipeCount], &value, sizeof(u64));
|
||||||
|
m_gatherPipeCount += sizeof(u64);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace GPFifo
|
} // end of namespace GPFifo
|
||||||
|
@ -34,16 +34,16 @@ void FastCheckGatherPipe();
|
|||||||
bool IsEmpty();
|
bool IsEmpty();
|
||||||
|
|
||||||
// Write
|
// Write
|
||||||
void Write8(const u8 _iValue);
|
void Write8(u8 value);
|
||||||
void Write16(const u16 _iValue);
|
void Write16(u16 value);
|
||||||
void Write32(const u32 _iValue);
|
void Write32(u32 value);
|
||||||
void Write64(const u64 _iValue);
|
void Write64(u64 value);
|
||||||
|
|
||||||
// These expect pre-byteswapped values
|
// These expect pre-byteswapped values
|
||||||
// Also there's an upper limit of about 512 per batch
|
// Also there's an upper limit of about 512 per batch
|
||||||
// Most likely these should be inlined into JIT instead
|
// Most likely these should be inlined into JIT instead
|
||||||
void FastWrite8(const u8 _iValue);
|
void FastWrite8(u8 value);
|
||||||
void FastWrite16(const u16 _iValue);
|
void FastWrite16(u16 value);
|
||||||
void FastWrite32(const u32 _iValue);
|
void FastWrite32(u32 value);
|
||||||
void FastWrite64(const u64 _iValue);
|
void FastWrite64(u64 value);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user