diff options
| author | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-11-19 02:28:41 +0000 |
|---|---|---|
| committer | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-11-19 02:28:41 +0000 |
| commit | fe1a5142a784305fa9c4e54bdf8d989102d89187 (patch) | |
| tree | 79219fad0de90b9397f729ebc8d6f9f3f26dab70 /Source/Core/VideoCommon/Src/XFStructs.cpp | |
| parent | 73af91281a6f47cf31ae9b7978a745769a9a40f2 (diff) | |
a minor cleanup in xf registers, an some small bug fixes. please test and give me feedback
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4589 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/XFStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/XFStructs.cpp | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/Source/Core/VideoCommon/Src/XFStructs.cpp b/Source/Core/VideoCommon/Src/XFStructs.cpp index 0ccc09c398..670e4bf188 100644 --- a/Source/Core/VideoCommon/Src/XFStructs.cpp +++ b/Source/Core/VideoCommon/Src/XFStructs.cpp @@ -49,6 +49,28 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData) { xfregs.texcoords[address - XFMEM_SETPOSMTXINFO].postmtxinfo.hex = pData[i]; } + else if (address >= XFMEM_SETVIEWPORT && address <= XFMEM_SETVIEWPORT+5) + { + VertexManager::Flush(); + u32 Index = address - XFMEM_SETVIEWPORT; + VertexShaderManager::SetViewport((float*)&pData[i],Index); + PixelShaderManager::SetViewport((float*)&pData[i],Index); + if(Index == 0) + { + i += 5; + } + + } + else if (address >= XFMEM_SETPROJECTION && address <= XFMEM_SETPROJECTION+7) + { + VertexManager::Flush(); + u32 Index = address - XFMEM_SETPROJECTION; + VertexShaderManager::SetProjection((float*)&pData[i],Index); + if(Index == 0) + { + i += 7; + } + } else if (address < 0x2000) { u32 data = pData[i]; @@ -147,47 +169,13 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData) //_assert_msg_(GX_XF, 0, "XF matrixindex1"); VertexShaderManager::SetTexMatrixChangedB(data); // ? break; - - case XFMEM_SETVIEWPORT: - VertexManager::Flush(); - VertexShaderManager::SetViewport((float*)&pData[i]); - PixelShaderManager::SetViewport((float*)&pData[i]); - i += 6; - break; - - case XFMEM_SETPROJECTION: - VertexManager::Flush(); - VertexShaderManager::SetProjection((float*)&pData[i]); - i += 7; - break; - case XFMEM_SETNUMTEXGENS: // GXSetNumTexGens if ((u32)xfregs.numTexGens != data) { VertexManager::Flush(); xfregs.numTexGens = data; } - break; - - // GXSetZScaleOffset ? - // Actually everything i tried didn't seem to change anything x) - // paper mario writes 16777216.0f, 1677721.75 - // Killer 7 writes 16777216.0f here - case XFMEM_SETZSCALE: - VertexManager::Flush(); - VertexShaderManager::SetZScale(*(float*)&data); - PixelShaderManager::SetZScale(*(float*)&data); - INFO_LOG(VIDEO, "Set ZScale : %x=%x\n", address, data); - break; - - // paper mario writes 16777216.0f, 5033165.0f - // Killer 7 alterns this between 16777216.0f and 16710107.0f - case XFMEM_SETZOFFSET: - VertexManager::Flush(); - VertexShaderManager::SetZOffset(*(float*)&data); - PixelShaderManager::SetZOffset(*(float*)&data); - INFO_LOG(VIDEO, "Set ZOffset : %x=%x\n", address, data); - break; + break; // -------------- // Unknown Regs |
