From 984988c5d37c2576b86c8a441e954d49c278f6ff Mon Sep 17 00:00:00 2001 From: omegadox Date: Mon, 24 Aug 2009 23:36:28 +0000 Subject: [PATCH] GFX: revert of r4044 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4051 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/XFMemory.h | 5 ++--- Source/Core/VideoCommon/Src/XFStructs.cpp | 14 ++++++-------- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 6 ++---- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Source/Core/VideoCommon/Src/XFMemory.h b/Source/Core/VideoCommon/Src/XFMemory.h index d36e90de39..10f554072a 100644 --- a/Source/Core/VideoCommon/Src/XFMemory.h +++ b/Source/Core/VideoCommon/Src/XFMemory.h @@ -91,8 +91,8 @@ #define XFMEM_SETMATRIXINDA 0x1018 #define XFMEM_SETMATRIXINDB 0x1019 #define XFMEM_SETVIEWPORT 0x101a -#define XFMEM_SETCONST_ZNEAR 0x101c -#define XFMEM_SETCONST_ZFAR 0x101f +#define XFMEM_SETZSCALE 0x101c +#define XFMEM_SETZOFFSET 0x101f #define XFMEM_SETPROJECTION 0x1020 #define XFMEM_SETNUMTEXGENS 0x103f #define XFMEM_SETTEXMTXINFO 0x1040 @@ -228,7 +228,6 @@ struct XFRegisters bool bEnableDualTexTransform; float rawViewport[6]; float rawProjection[7]; - float depthRangeConst[2]; }; diff --git a/Source/Core/VideoCommon/Src/XFStructs.cpp b/Source/Core/VideoCommon/Src/XFStructs.cpp index 9e7cdec9f9..7ea749ffd7 100644 --- a/Source/Core/VideoCommon/Src/XFStructs.cpp +++ b/Source/Core/VideoCommon/Src/XFStructs.cpp @@ -173,16 +173,14 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData) // Actually everything i tried didn't seem to change anything x) // paper mario writes 16777216.0f, 1677721.75 // Killer 7 writes 16777216.0f here - // WARN_LOG(VIDEO, "Set ZScale : %x=%x\n", address, data); + case XFMEM_SETZSCALE: + WARN_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 - // WARN_LOG(VIDEO, "Set ZOffset : %x=%x\n", address, data); - - case XFMEM_SETCONST_ZNEAR: - xfregs.depthRangeConst[0] = *((float*)&data); - break; - case XFMEM_SETCONST_ZFAR: - xfregs.depthRangeConst[1] = *((float*)&data); + case XFMEM_SETZOFFSET: + WARN_LOG(VIDEO, "Set ZOffset : %x=%x\n", address, data); break; // -------------- diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index d8004d9102..f0a669cfdf 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -181,8 +181,6 @@ void HandleCgError(CGcontext ctx, CGerror err, void* appdata) // Init functions bool Renderer::Init() { - xfregs.depthRangeConst[0] = 16777215.0f; - xfregs.depthRangeConst[1] = 16777215.0f; bool bSuccess = true; s_blendMode = 0; s_MSAACoverageSamples = 0; @@ -1448,8 +1446,8 @@ void UpdateViewport() int GLy = (int)ceil(Renderer::GetTargetHeight() - ((int)(xfregs.rawViewport[4] - xfregs.rawViewport[1] - 342 - scissorYOff)) * MValueY); int GLWidth = (int)ceil(abs((int)(2 * xfregs.rawViewport[0])) * MValueX); int GLHeight = (int)ceil(abs((int)(2 * xfregs.rawViewport[1])) * MValueY); - double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / xfregs.depthRangeConst[0]; - double GLFar = xfregs.rawViewport[5] / xfregs.depthRangeConst[1]; + double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / 16777215.0f; + double GLFar = xfregs.rawViewport[5] / 16777215.0f; // Update the view port glViewport(GLx, GLy, GLWidth, GLHeight);