diff --git a/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp b/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp index 2e9cfa984e..6a7279440d 100644 --- a/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp +++ b/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp @@ -85,7 +85,7 @@ static void ReadXFData(u32 iBufferSize) u32 pData[16]; for (int i = 0; i < streamSize; i++) - pData[i] = DataReadU32(); + pData[i] = DataRead(); SWLoadXFReg(streamSize, streamAddress, pData); // return to normal command processing @@ -120,7 +120,7 @@ static void DecodeStandard(u32 bufferSize) { _assert_msg_(VIDEO, CommandRunnable(bufferSize), "Underflow during standard opcode decoding"); - int Cmd = DataReadU8(); + int Cmd = DataRead(); if (Cmd == GX_NOP) return; @@ -148,15 +148,15 @@ static void DecodeStandard(u32 bufferSize) case GX_LOAD_CP_REG: //0x08 { - u32 SubCmd = DataReadU8(); - u32 Value = DataReadU32(); + u32 SubCmd = DataRead(); + u32 Value = DataRead(); SWLoadCPReg(SubCmd, Value); } break; case GX_LOAD_XF_REG: { - u32 Cmd2 = DataReadU32(); + u32 Cmd2 = DataRead(); streamSize = ((Cmd2 >> 16) & 15) + 1; streamAddress = Cmd2 & 0xFFFF; currentFunction = ReadXFData; @@ -166,22 +166,22 @@ static void DecodeStandard(u32 bufferSize) break; case GX_LOAD_INDX_A: //used for position matrices - SWLoadIndexedXF(DataReadU32(), 0xC); + SWLoadIndexedXF(DataRead(), 0xC); break; case GX_LOAD_INDX_B: //used for normal matrices - SWLoadIndexedXF(DataReadU32(), 0xD); + SWLoadIndexedXF(DataRead(), 0xD); break; case GX_LOAD_INDX_C: //used for postmatrices - SWLoadIndexedXF(DataReadU32(), 0xE); + SWLoadIndexedXF(DataRead(), 0xE); break; case GX_LOAD_INDX_D: //used for lights - SWLoadIndexedXF(DataReadU32(), 0xF); + SWLoadIndexedXF(DataRead(), 0xF); break; case GX_CMD_CALL_DL: { - u32 dwAddr = DataReadU32(); - u32 dwCount = DataReadU32(); + u32 dwAddr = DataRead(); + u32 dwCount = DataRead(); ExecuteDisplayList(dwAddr, dwCount); } break; @@ -196,7 +196,7 @@ static void DecodeStandard(u32 bufferSize) case GX_LOAD_BP_REG: //0x61 { - u32 cmd = DataReadU32(); + u32 cmd = DataRead(); SWLoadBPReg(cmd); } break; @@ -210,7 +210,7 @@ static void DecodeStandard(u32 bufferSize) vertexLoader.SetFormat(vatIndex, primitiveType); // switch to primitive processing - streamSize = DataReadU16(); + streamSize = DataRead(); currentFunction = DecodePrimitiveStream; minCommandSize = vertexLoader.GetVertexSize(); readOpcode = false; @@ -249,7 +249,7 @@ bool CommandRunnable(u32 iBufferSize) if (readOpcode) { - u8 Cmd = DataPeek8(0); + u8 Cmd = DataPeek(0); u32 minSize = 1; switch (Cmd) diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 5673d1aa90..d186ad9cde 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -25,7 +25,7 @@ u8* g_vertex_manager_write_ptr; static void PosMtx_ReadDirect_UByte(VertexLoader* loader) { - u32 posmtx = DataReadU8() & 0x3f; + u32 posmtx = DataRead() & 0x3f; if (loader->m_counter < 3) VertexLoaderManager::position_matrix_index[loader->m_counter] = posmtx; DataWrite(posmtx); @@ -34,7 +34,7 @@ static void PosMtx_ReadDirect_UByte(VertexLoader* loader) static void TexMtx_ReadDirect_UByte(VertexLoader* loader) { - loader->m_curtexmtx[loader->m_texmtxread] = DataReadU8() & 0x3f; + loader->m_curtexmtx[loader->m_texmtxread] = DataRead() & 0x3f; PRIM_LOG("texmtx%d: %d, ", loader->m_texmtxread, loader->m_curtexmtx[loader->m_texmtxread]); loader->m_texmtxread++; diff --git a/Source/Core/VideoCommon/VertexLoaderUtils.h b/Source/Core/VideoCommon/VertexLoaderUtils.h index db37e26c43..88ab1bda1e 100644 --- a/Source/Core/VideoCommon/VertexLoaderUtils.h +++ b/Source/Core/VideoCommon/VertexLoaderUtils.h @@ -32,22 +32,6 @@ __forceinline T DataPeek(int _uOffset, u8* bufp = g_video_buffer_read_ptr) return Common::FromBigEndian(result); } -// TODO: kill these -__forceinline u8 DataPeek8(int _uOffset) -{ - return DataPeek(_uOffset); -} - -__forceinline u16 DataPeek16(int _uOffset) -{ - return DataPeek(_uOffset); -} - -__forceinline u32 DataPeek32(int _uOffset) -{ - return DataPeek(_uOffset); -} - template __forceinline T DataRead(u8** bufp = &g_video_buffer_read_ptr) { @@ -56,27 +40,6 @@ __forceinline T DataRead(u8** bufp = &g_video_buffer_read_ptr) return result; } -// TODO: kill these -__forceinline u8 DataReadU8() -{ - return DataRead(); -} - -__forceinline s8 DataReadS8() -{ - return DataRead(); -} - -__forceinline u16 DataReadU16() -{ - return DataRead(); -} - -__forceinline u32 DataReadU32() -{ - return DataRead(); -} - __forceinline u32 DataReadU32Unswapped() { u32 result; diff --git a/Source/Core/VideoCommon/VertexLoader_Color.cpp b/Source/Core/VideoCommon/VertexLoader_Color.cpp index 0fbc639a53..603be269b3 100644 --- a/Source/Core/VideoCommon/VertexLoader_Color.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Color.cpp @@ -85,7 +85,7 @@ void Color_ReadDirect_32b_888x(VertexLoader* loader) } void Color_ReadDirect_16b_565(VertexLoader* loader) { - SetCol565(loader, DataReadU16()); + SetCol565(loader, DataRead()); } void Color_ReadDirect_16b_4444(VertexLoader* loader) {