GFX: revert of r4044
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4051 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
6743dd6913
commit
984988c5d3
|
@ -91,8 +91,8 @@
|
||||||
#define XFMEM_SETMATRIXINDA 0x1018
|
#define XFMEM_SETMATRIXINDA 0x1018
|
||||||
#define XFMEM_SETMATRIXINDB 0x1019
|
#define XFMEM_SETMATRIXINDB 0x1019
|
||||||
#define XFMEM_SETVIEWPORT 0x101a
|
#define XFMEM_SETVIEWPORT 0x101a
|
||||||
#define XFMEM_SETCONST_ZNEAR 0x101c
|
#define XFMEM_SETZSCALE 0x101c
|
||||||
#define XFMEM_SETCONST_ZFAR 0x101f
|
#define XFMEM_SETZOFFSET 0x101f
|
||||||
#define XFMEM_SETPROJECTION 0x1020
|
#define XFMEM_SETPROJECTION 0x1020
|
||||||
#define XFMEM_SETNUMTEXGENS 0x103f
|
#define XFMEM_SETNUMTEXGENS 0x103f
|
||||||
#define XFMEM_SETTEXMTXINFO 0x1040
|
#define XFMEM_SETTEXMTXINFO 0x1040
|
||||||
|
@ -228,7 +228,6 @@ struct XFRegisters
|
||||||
bool bEnableDualTexTransform;
|
bool bEnableDualTexTransform;
|
||||||
float rawViewport[6];
|
float rawViewport[6];
|
||||||
float rawProjection[7];
|
float rawProjection[7];
|
||||||
float depthRangeConst[2];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -173,16 +173,14 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
|
||||||
// Actually everything i tried didn't seem to change anything x)
|
// Actually everything i tried didn't seem to change anything x)
|
||||||
// paper mario writes 16777216.0f, 1677721.75
|
// paper mario writes 16777216.0f, 1677721.75
|
||||||
// Killer 7 writes 16777216.0f here
|
// 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
|
// paper mario writes 16777216.0f, 5033165.0f
|
||||||
// Killer 7 alterns this between 16777216.0f and 16710107.0f
|
// Killer 7 alterns this between 16777216.0f and 16710107.0f
|
||||||
// WARN_LOG(VIDEO, "Set ZOffset : %x=%x\n", address, data);
|
case XFMEM_SETZOFFSET:
|
||||||
|
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);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// --------------
|
// --------------
|
||||||
|
|
|
@ -181,8 +181,6 @@ void HandleCgError(CGcontext ctx, CGerror err, void* appdata)
|
||||||
// Init functions
|
// Init functions
|
||||||
bool Renderer::Init()
|
bool Renderer::Init()
|
||||||
{
|
{
|
||||||
xfregs.depthRangeConst[0] = 16777215.0f;
|
|
||||||
xfregs.depthRangeConst[1] = 16777215.0f;
|
|
||||||
bool bSuccess = true;
|
bool bSuccess = true;
|
||||||
s_blendMode = 0;
|
s_blendMode = 0;
|
||||||
s_MSAACoverageSamples = 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 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 GLWidth = (int)ceil(abs((int)(2 * xfregs.rawViewport[0])) * MValueX);
|
||||||
int GLHeight = (int)ceil(abs((int)(2 * xfregs.rawViewport[1])) * MValueY);
|
int GLHeight = (int)ceil(abs((int)(2 * xfregs.rawViewport[1])) * MValueY);
|
||||||
double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / xfregs.depthRangeConst[0];
|
double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / 16777215.0f;
|
||||||
double GLFar = xfregs.rawViewport[5] / xfregs.depthRangeConst[1];
|
double GLFar = xfregs.rawViewport[5] / 16777215.0f;
|
||||||
|
|
||||||
// Update the view port
|
// Update the view port
|
||||||
glViewport(GLx, GLy, GLWidth, GLHeight);
|
glViewport(GLx, GLy, GLWidth, GLHeight);
|
||||||
|
|
Loading…
Reference in New Issue