DataReader: turn WritePointer into GetPointer
This commit is contained in:
parent
68d204e877
commit
2cedc0034d
|
@ -15,9 +15,9 @@ public:
|
|||
__forceinline DataReader(u8* src, u8* _end)
|
||||
: buffer(src), end(_end) {}
|
||||
|
||||
__forceinline void WritePointer(u8** src)
|
||||
__forceinline u8* GetPointer()
|
||||
{
|
||||
*src = buffer;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
__forceinline u8* operator=(u8* src)
|
||||
|
|
|
@ -137,7 +137,7 @@ u8* OpcodeDecoder_Run(DataReader src, u32* cycles, bool in_display_list)
|
|||
u8* opcodeStart;
|
||||
while (true)
|
||||
{
|
||||
src.WritePointer(&opcodeStart);
|
||||
opcodeStart = src.GetPointer();
|
||||
|
||||
if (!src.size())
|
||||
goto end;
|
||||
|
@ -301,7 +301,7 @@ u8* OpcodeDecoder_Run(DataReader src, u32* cycles, bool in_display_list)
|
|||
if (!is_preprocess && g_bRecordFifoData && cmd_byte != GX_CMD_CALL_DL)
|
||||
{
|
||||
u8* opcodeEnd;
|
||||
src.WritePointer(&opcodeEnd);
|
||||
opcodeEnd = src.GetPointer();
|
||||
FifoRecorder::GetInstance().WriteGPCommand(opcodeStart, u32(opcodeEnd - opcodeStart));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,8 +453,8 @@ void VertexLoader::WriteSetVariable(int bits, void *address, OpArg value)
|
|||
|
||||
int VertexLoader::RunVertices(int primitive, int count, DataReader src, DataReader dst)
|
||||
{
|
||||
dst.WritePointer(&g_vertex_manager_write_ptr);
|
||||
src.WritePointer(&g_video_buffer_read_ptr);
|
||||
g_vertex_manager_write_ptr = dst.GetPointer();
|
||||
g_video_buffer_read_ptr = src.GetPointer();
|
||||
|
||||
m_numLoadedVertices += count;
|
||||
m_skippedVertices = 0;
|
||||
|
|
|
@ -159,9 +159,7 @@ public:
|
|||
if (memcmp(buffer_a.data(), buffer_b.data(), std::min(count_a, count_b)))
|
||||
ERROR_LOG(VIDEO, "Both vertexloaders have loaded different data.");
|
||||
|
||||
u8* dstptr;
|
||||
dst.WritePointer(&dstptr);
|
||||
memcpy(dstptr, buffer_a.data(), count_a);
|
||||
memcpy(dst.GetPointer(), buffer_a.data(), count_a);
|
||||
return count_a;
|
||||
}
|
||||
std::string GetName() const override { return "CompareLoader"; }
|
||||
|
|
|
@ -50,7 +50,7 @@ __forceinline void ReadIndirect(const T* data)
|
|||
dst.Write(FracAdjust(Common::FromBigEndian(data[i])));
|
||||
}
|
||||
|
||||
dst.WritePointer(&g_vertex_manager_write_ptr);
|
||||
g_vertex_manager_write_ptr = dst.GetPointer();
|
||||
LOG_NORM();
|
||||
}
|
||||
|
||||
|
|
|
@ -81,8 +81,8 @@ void LOADERDECL Pos_ReadDirect(VertexLoader* loader)
|
|||
for (int i = 0; i < 3; ++i)
|
||||
dst.Write(i<N ? PosScale(src.Read<T>(), scale) : 0.f);
|
||||
|
||||
dst.WritePointer(&g_vertex_manager_write_ptr);
|
||||
src.WritePointer(&g_video_buffer_read_ptr);
|
||||
g_vertex_manager_write_ptr = dst.GetPointer();
|
||||
g_video_buffer_read_ptr = src.GetPointer();
|
||||
LOG_VTX();
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ void LOADERDECL Pos_ReadIndex(VertexLoader* loader)
|
|||
for (int i = 0; i < 3; ++i)
|
||||
dst.Write(i<N ? PosScale(Common::FromBigEndian(data[i]), scale) : 0.f);
|
||||
|
||||
dst.WritePointer(&g_vertex_manager_write_ptr);
|
||||
g_vertex_manager_write_ptr = dst.GetPointer();
|
||||
LOG_VTX();
|
||||
}
|
||||
|
||||
|
|
|
@ -56,8 +56,8 @@ void LOADERDECL TexCoord_ReadDirect(VertexLoader* loader)
|
|||
for (int i = 0; i != N; ++i)
|
||||
dst.Write(TCScale(src.Read<T>(), scale));
|
||||
|
||||
dst.WritePointer(&g_vertex_manager_write_ptr);
|
||||
src.WritePointer(&g_video_buffer_read_ptr);
|
||||
g_vertex_manager_write_ptr = dst.GetPointer();
|
||||
g_video_buffer_read_ptr = src.GetPointer();
|
||||
LOG_TEX<N>();
|
||||
|
||||
++loader->m_tcIndex;
|
||||
|
@ -77,7 +77,7 @@ void LOADERDECL TexCoord_ReadIndex(VertexLoader* loader)
|
|||
for (int i = 0; i != N; ++i)
|
||||
dst.Write(TCScale(Common::FromBigEndian(data[i]), scale));
|
||||
|
||||
dst.WritePointer(&g_vertex_manager_write_ptr);
|
||||
g_vertex_manager_write_ptr = dst.GetPointer();
|
||||
LOG_TEX<N>();
|
||||
++loader->m_tcIndex;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue