Figured out Step 1.0 VROM texture uploads. Fixes missing textures in VF3 and VF3TB.

This commit is contained in:
Bart Trzynadlowski 2016-04-11 03:48:36 +00:00
parent ef87093824
commit 94c66eea7b

View file

@ -832,6 +832,20 @@ void CReal3D::WriteTextureFIFO(uint32_t data)
void CReal3D::WriteTexturePort(unsigned reg, uint32_t data) void CReal3D::WriteTexturePort(unsigned reg, uint32_t data)
{ {
if (step == 0x10)
{
uint32_t addr = data & 0xFFFFFF;
uint32_t num_words = (2+vrom[addr+0]/2) / 4;
if (!num_words)
{
DebugLog("Real3D: 0-length VROM texture upload @ PC=%08X (%08X)\n", ppc_get_pc(), data);
return;
}
for (size_t i = 0; i < num_words; i++)
WriteTextureFIFO(vrom[(addr + i) & 0xFFFFFF]);
}
else
{
if (m_vromTextureFIFOIdx == 2) if (m_vromTextureFIFOIdx == 2)
{ {
uint32_t addr = m_vromTextureFIFO[0]; uint32_t addr = m_vromTextureFIFO[0];
@ -841,6 +855,7 @@ void CReal3D::WriteTexturePort(unsigned reg, uint32_t data)
} }
else else
m_vromTextureFIFO[m_vromTextureFIFOIdx++] = data; m_vromTextureFIFO[m_vromTextureFIFOIdx++] = data;
}
} }
void CReal3D::WriteLowCullingRAM(uint32_t addr, uint32_t data) void CReal3D::WriteLowCullingRAM(uint32_t addr, uint32_t data)