zzogl-pg: Work on the FOGCOL & GIFRegHandlerTEXA registers in the new register code.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3437 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-07-09 09:26:35 +00:00
parent 1adf69bfb2
commit d536cc5cde
3 changed files with 32 additions and 33 deletions

View File

@ -626,17 +626,12 @@ void __fastcall GIFRegHandlerSCANMSK(u32* data)
{
FUNCLOG
GIFRegSCANMSK* r = (GIFRegSCANMSK*)(data);
// ZeroGS::FlushBoth();
// ZeroGS::ResolveC(&ZeroGS::vb[0]);
// ZeroGS::ResolveZ(&ZeroGS::vb[0]);
// GSdx flushes here, like this:
/*if(r->SCANMSK != gs.smask)
{
//Flush
}*/
if(r->MSK != gs.smask)
{
ZeroGS::FlushBoth();
// ZeroGS::ResolveC(&ZeroGS::vb[0]);
// ZeroGS::ResolveZ(&ZeroGS::vb[0]);
}
gs.smask = r->MSK;
@ -710,38 +705,34 @@ void __fastcall GIFRegHandlerTEXA(u32* data)
{
FUNCLOG
GIFRegTEXA* r = (GIFRegTEXA*)(data);
texaInfo newinfo;
/*if(r->TEXA != m_env.TEXA)
{
Flush();
}*/
newinfo.aem = r->AEM;
newinfo.ta[0] = r->TA0;
newinfo.ta[1] = r->TA1;
if (*(u32*)&newinfo != *(u32*)&gs.texa)
if ((r->AEM != gs.texa.aem) || (r->TA0 != gs.texa.ta[0]) || (r->TA1 != gs.texa.ta[1]))
{
ZeroGS::FlushBoth();
*(u32*)&gs.texa = *(u32*) & newinfo;
gs.texa.fta[0] = newinfo.ta[0] / 255.0f;
gs.texa.fta[1] = newinfo.ta[1] / 255.0f;
ZeroGS::vb[0].bTexConstsSync = false;
ZeroGS::vb[1].bTexConstsSync = false;
}
gs.texa.aem = r->AEM;
gs.texa.ta[0] = r->TA0;
gs.texa.ta[1] = r->TA1;
gs.texa.fta[0] = r->TA0 / 255.0f;
gs.texa.fta[1] = r->TA1 / 255.0f;
}
void __fastcall GIFRegHandlerFOGCOL(u32* data)
{
FUNCLOG
//GIFRegFOGCOL* r = (GIFRegFOGCOL*)(data);
GIFRegFOGCOL* r = (GIFRegFOGCOL*)(data);
// Yeah, it even flushes here.
// I'll worry about changing this later.
ZeroGS::SetFogColor(data[0]&0xffffff);
if (gs.fogcol != r->ai32[0])
{
ZeroGS::FlushBoth();
}
ZeroGS::SetFogColor(r);
gs.fogcol = r->ai32[0];
}
void __fastcall GIFRegHandlerTEXFLUSH(u32* data)

View File

@ -614,9 +614,6 @@ __forceinline void MOVFOG(VertexGPU *p, Vertex gsf)
int Values[100] = {0, };
#ifndef __LINUX__
__forceinline
#endif
void SET_VERTEX(VertexGPU *p, int Index, const VB& curvb)
{
int index = Index;
@ -789,9 +786,6 @@ void ZeroGS::KickTriangleFan()
OUTPUT_VERT(p[2], 2);
}
#ifndef __LINUX__
__forceinline
#endif
void SetKickVertex(VertexGPU *p, Vertex v, int next, const VB& curvb)
{
SET_VERTEX(p, next, curvb);
@ -886,6 +880,19 @@ void ZeroGS::SetFogColor(u32 fog)
// }
}
void ZeroGS::SetFogColor(GIFRegFOGCOL* fog)
{
FUNCLOG
SetShaderCaller("SetFogColor");
Vector v;
v.x = fog->FCR / 255.0f;
v.y = fog->FCG / 255.0f;
v.z = fog->FCB / 255.0f;
ZZcgSetParameter4fv(g_fparamFogColor, v, "g_fParamFogColor");
}
void ZeroGS::ExtWrite()
{
FUNCLOG

View File

@ -492,6 +492,7 @@ void SetDestAlphaTest();
bool IsWriteDestAlphaTest();
void SetFogColor(u32 fog);
void SetFogColor(GIFRegFOGCOL* fog);
void SaveTex(tex0Info* ptex, int usevid);
char* NamedSaveTex(tex0Info* ptex, int usevid);