DataReader migration to faster one: first step.

TODO: doing it for DX9, move DataReader to VideoCommon, remove dirty debug #def if ok

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@729 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
memberTwo.mb2
2008-09-29 17:29:25 +00:00
parent d80178bd89
commit df9eba79b2
13 changed files with 423 additions and 204 deletions

View File

@ -30,15 +30,15 @@ void LOADERDECL TexCoord_Read_Dummy(void* _p)
void LOADERDECL TexCoord_ReadDirect_UByte1(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)ReadBuffer8() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)DataReadU8() * tcScaleU[tcIndex];
LOG_TEX1();
VertexManager::s_pCurBufferPointer += 4;
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_UByte2(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)ReadBuffer8() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = (float)ReadBuffer8() * tcScaleV[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)DataReadU8() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = (float)DataReadU8() * tcScaleV[tcIndex];
LOG_TEX2();
VertexManager::s_pCurBufferPointer += 8;
tcIndex++;
@ -46,15 +46,15 @@ void LOADERDECL TexCoord_ReadDirect_UByte2(void* _p)
void LOADERDECL TexCoord_ReadDirect_Byte1(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)ReadBuffer8() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)DataReadU8() * tcScaleU[tcIndex];
LOG_TEX1();
VertexManager::s_pCurBufferPointer += 4;
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Byte2(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)ReadBuffer8() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s8)ReadBuffer8() * tcScaleV[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)DataReadU8() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s8)DataReadU8() * tcScaleV[tcIndex];
LOG_TEX2();
VertexManager::s_pCurBufferPointer += 8;
tcIndex++;
@ -62,15 +62,15 @@ void LOADERDECL TexCoord_ReadDirect_Byte2(void* _p)
void LOADERDECL TexCoord_ReadDirect_UShort1(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)ReadBuffer16() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)DataReadU16() * tcScaleU[tcIndex];
LOG_TEX1();
VertexManager::s_pCurBufferPointer += 4;
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_UShort2(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)ReadBuffer16() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = (float)ReadBuffer16() * tcScaleV[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)DataReadU16() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = (float)DataReadU16() * tcScaleV[tcIndex];
LOG_TEX2();
VertexManager::s_pCurBufferPointer += 8;
tcIndex++;
@ -78,15 +78,15 @@ void LOADERDECL TexCoord_ReadDirect_UShort2(void* _p)
void LOADERDECL TexCoord_ReadDirect_Short1(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)ReadBuffer16() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)DataReadU16() * tcScaleU[tcIndex];
LOG_TEX1();
VertexManager::s_pCurBufferPointer += 4;
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Short2(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)ReadBuffer16() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s16)ReadBuffer16() * tcScaleV[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)DataReadU16() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = (float)(s16)DataReadU16() * tcScaleV[tcIndex];
LOG_TEX2();
VertexManager::s_pCurBufferPointer += 8;
tcIndex++;
@ -94,15 +94,15 @@ void LOADERDECL TexCoord_ReadDirect_Short2(void* _p)
void LOADERDECL TexCoord_ReadDirect_Float1(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = ReadBuffer32F() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = DataReadF32() * tcScaleU[tcIndex];
LOG_TEX1();
VertexManager::s_pCurBufferPointer += 4;
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Float2(void* _p)
{
((float*)VertexManager::s_pCurBufferPointer)[0] = ReadBuffer32F() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = ReadBuffer32F() * tcScaleV[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[0] = DataReadF32() * tcScaleU[tcIndex];
((float*)VertexManager::s_pCurBufferPointer)[1] = DataReadF32() * tcScaleV[tcIndex];
LOG_TEX2();
VertexManager::s_pCurBufferPointer += 8;
tcIndex++;
@ -111,7 +111,7 @@ void LOADERDECL TexCoord_ReadDirect_Float2(void* _p)
// ==================================================================================
void LOADERDECL TexCoord_ReadIndex8_UByte1(void* _p)
{
u8 Index = ReadBuffer8();
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex];
@ -121,7 +121,7 @@ void LOADERDECL TexCoord_ReadIndex8_UByte1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex8_UByte2(void* _p)
{
u8 Index = ReadBuffer8();
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex];
@ -133,7 +133,7 @@ void LOADERDECL TexCoord_ReadIndex8_UByte2(void* _p)
void LOADERDECL TexCoord_ReadIndex8_Byte1(void* _p)
{
u8 Index = ReadBuffer8();
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex];
@ -143,7 +143,7 @@ void LOADERDECL TexCoord_ReadIndex8_Byte1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex8_Byte2(void* _p)
{
u8 Index = ReadBuffer8();
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex];
@ -155,7 +155,7 @@ void LOADERDECL TexCoord_ReadIndex8_Byte2(void* _p)
void LOADERDECL TexCoord_ReadIndex8_UShort1(void* _p)
{
u8 Index = ReadBuffer8();
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex];
@ -165,7 +165,7 @@ void LOADERDECL TexCoord_ReadIndex8_UShort1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex8_UShort2(void* _p)
{
u8 Index = ReadBuffer8();
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex];
@ -177,7 +177,7 @@ void LOADERDECL TexCoord_ReadIndex8_UShort2(void* _p)
void LOADERDECL TexCoord_ReadIndex8_Short1(void* _p)
{
u8 Index = ReadBuffer8();
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex];
@ -187,7 +187,7 @@ void LOADERDECL TexCoord_ReadIndex8_Short1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex8_Short2(void* _p)
{
u8 Index = ReadBuffer8();
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex];
@ -199,7 +199,7 @@ void LOADERDECL TexCoord_ReadIndex8_Short2(void* _p)
void LOADERDECL TexCoord_ReadIndex8_Float1(void* _p)
{
u16 Index = ReadBuffer8();
u16 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress);
@ -210,7 +210,7 @@ void LOADERDECL TexCoord_ReadIndex8_Float1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex8_Float2(void* _p)
{
u16 Index = ReadBuffer8();
u16 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress);
@ -225,7 +225,7 @@ void LOADERDECL TexCoord_ReadIndex8_Float2(void* _p)
// ==================================================================================
void LOADERDECL TexCoord_ReadIndex16_UByte1(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex];
@ -235,7 +235,7 @@ void LOADERDECL TexCoord_ReadIndex16_UByte1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex16_UByte2(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex];
@ -247,7 +247,7 @@ void LOADERDECL TexCoord_ReadIndex16_UByte2(void* _p)
void LOADERDECL TexCoord_ReadIndex16_Byte1(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex];
@ -257,7 +257,7 @@ void LOADERDECL TexCoord_ReadIndex16_Byte1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex16_Byte2(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex];
@ -269,7 +269,7 @@ void LOADERDECL TexCoord_ReadIndex16_Byte2(void* _p)
void LOADERDECL TexCoord_ReadIndex16_UShort1(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex];
@ -279,7 +279,7 @@ void LOADERDECL TexCoord_ReadIndex16_UShort1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex16_UShort2(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(u16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex];
@ -291,7 +291,7 @@ void LOADERDECL TexCoord_ReadIndex16_UShort2(void* _p)
void LOADERDECL TexCoord_ReadIndex16_Short1(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex];
@ -301,7 +301,7 @@ void LOADERDECL TexCoord_ReadIndex16_Short1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex16_Short2(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
((float*)VertexManager::s_pCurBufferPointer)[0] = (float)(s16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex];
@ -313,7 +313,7 @@ void LOADERDECL TexCoord_ReadIndex16_Short2(void* _p)
void LOADERDECL TexCoord_ReadIndex16_Float1(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
@ -324,7 +324,7 @@ void LOADERDECL TexCoord_ReadIndex16_Float1(void* _p)
}
void LOADERDECL TexCoord_ReadIndex16_Float2(void* _p)
{
u16 Index = ReadBuffer16();
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );