mirror of https://github.com/PCSX2/pcsx2.git
GSdx: a few games fixes (one piece grand battle, xenosaga 1, chikyuu boueigun 2)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1469 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
fad91c7ebf
commit
f24be5c352
|
@ -41,6 +41,7 @@ GSRenderer::GSRenderer(uint8* base, bool mt, void (*irq)(), GSDevice* dev)
|
|||
s_dump = !!theApp.GetConfig("dump", 0);
|
||||
s_save = !!theApp.GetConfig("save", 0);
|
||||
s_savez = !!theApp.GetConfig("savez", 0);
|
||||
s_saven = theApp.GetConfig("saven", 0);
|
||||
}
|
||||
|
||||
GSRenderer::~GSRenderer()
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
bool s_dump;
|
||||
bool s_save;
|
||||
bool s_savez;
|
||||
int s_saven;
|
||||
|
||||
public:
|
||||
GSRenderer(uint8* base, bool mt, void (*irq)(), GSDevice* dev);
|
||||
|
|
|
@ -91,10 +91,30 @@ public:
|
|||
GSTextureFX::OMBlendSelector om_bsel;
|
||||
|
||||
om_bsel.abe = !IsOpaque();
|
||||
|
||||
if(om_bsel.abe)
|
||||
{
|
||||
om_bsel.a = context->ALPHA.A;
|
||||
om_bsel.b = context->ALPHA.B;
|
||||
om_bsel.c = context->ALPHA.C;
|
||||
om_bsel.d = context->ALPHA.D;
|
||||
|
||||
if(env.PABE.PABE)
|
||||
{
|
||||
if(om_bsel.a == 0 && om_bsel.b == 1 && om_bsel.c == 0 && om_bsel.d == 1)
|
||||
{
|
||||
// this works because with PABE alpha blending is on when alpha >= 0x80, but since the pixel shader
|
||||
// cannot output anything over 0x80 (== 1.0) blending with 0x80 or turning it off gives the same result
|
||||
|
||||
om_bsel.abe = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
om_bsel.wr = (context->FRAME.FBMSK & 0x000000ff) != 0x000000ff;
|
||||
om_bsel.wg = (context->FRAME.FBMSK & 0x0000ff00) != 0x0000ff00;
|
||||
om_bsel.wb = (context->FRAME.FBMSK & 0x00ff0000) != 0x00ff0000;
|
||||
|
@ -193,8 +213,13 @@ public:
|
|||
|
||||
GSTextureFX::PSConstantBuffer ps_cb;
|
||||
|
||||
if(ps_sel.fog)
|
||||
{
|
||||
ps_cb.FogColor_AREF = GSVector4((int)env.FOGCOL.FCR, (int)env.FOGCOL.FCG, (int)env.FOGCOL.FCB, 0) / 255;
|
||||
}
|
||||
|
||||
if(ps_sel.ate)
|
||||
{
|
||||
switch(ps_sel.atst)
|
||||
{
|
||||
case ATST_LESS:
|
||||
|
@ -207,6 +232,7 @@ public:
|
|||
ps_cb.FogColor_AREF.a = (float)(int)context->TEST.AREF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(tex)
|
||||
{
|
||||
|
|
|
@ -87,7 +87,7 @@ protected:
|
|||
|
||||
if(s_dump)
|
||||
{
|
||||
if(s_save)
|
||||
if(s_save && s_n >= s_saven)
|
||||
{
|
||||
t->Save(format("c:\\temp2\\_%05d_f%I64d_fr%d_%05x_%d.bmp", s_n, m_perfmon.GetFrame(), i, (int)TEX0.TBP0, (int)TEX0.PSM));
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ protected:
|
|||
|
||||
string s;
|
||||
|
||||
if(s_save && tex)
|
||||
if(s_save && s_n >= s_saven && tex)
|
||||
{
|
||||
s = format("c:\\temp2\\_%05d_f%I64d_tex_%05x_%d_%d%d_%02x_%02x_%02x_%02x.dds",
|
||||
s_n, frame, (int)context->TEX0.TBP0, (int)context->TEX0.PSM,
|
||||
|
@ -177,14 +177,14 @@ protected:
|
|||
|
||||
s_n++;
|
||||
|
||||
if(s_save)
|
||||
if(s_save && s_n >= s_saven)
|
||||
{
|
||||
s = format("c:\\temp2\\_%05d_f%I64d_rt0_%05x_%d.bmp", s_n, frame, context->FRAME.Block(), context->FRAME.PSM);
|
||||
|
||||
rt->m_texture->Save(s);
|
||||
}
|
||||
|
||||
if(s_savez)
|
||||
if(s_savez && s_n >= s_saven)
|
||||
{
|
||||
s = format("c:\\temp2\\_%05d_f%I64d_rz0_%05x_%d.bmp", s_n, frame, context->ZBUF.Block(), context->ZBUF.PSM);
|
||||
|
||||
|
@ -265,14 +265,14 @@ protected:
|
|||
|
||||
string s;
|
||||
|
||||
if(s_save)
|
||||
if(s_save && s_n >= s_saven)
|
||||
{
|
||||
s = format("c:\\temp2\\_%05d_f%I64d_rt1_%05x_%d.bmp", s_n, frame, context->FRAME.Block(), context->FRAME.PSM);
|
||||
|
||||
rt->m_texture->Save(s);
|
||||
}
|
||||
|
||||
if(s_savez)
|
||||
if(s_savez && s_n >= s_saven)
|
||||
{
|
||||
s = format("c:\\temp2\\_%05d_f%I64d_rz1_%05x_%d.bmp", s_n, frame, context->ZBUF.Block(), context->ZBUF.PSM);
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ GSTexture* GSRendererSW::GetOutput(int i)
|
|||
|
||||
if(s_dump)
|
||||
{
|
||||
if(s_save)
|
||||
if(s_save && s_n >= s_saven)
|
||||
{
|
||||
m_texture[i]->Save(format("c:\\temp1\\_%05d_f%I64d_fr%d_%05x_%d.bmp", s_n, m_perfmon.GetFrame(), i, (int)TEX0.TBP0, (int)TEX0.PSM));
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ void GSRendererSW::Draw()
|
|||
|
||||
string s;
|
||||
|
||||
if(s_save && PRIM->TME)
|
||||
if(s_save && s_n >= s_saven && PRIM->TME)
|
||||
{
|
||||
s = format("c:\\temp1\\_%05d_f%I64d_tex_%05x_%d.bmp", s_n, frame, (int)m_context->TEX0.TBP0, (int)m_context->TEX0.PSM);
|
||||
|
||||
|
@ -158,14 +158,14 @@ void GSRendererSW::Draw()
|
|||
|
||||
s_n++;
|
||||
|
||||
if(s_save)
|
||||
if(s_save && s_n >= s_saven)
|
||||
{
|
||||
s = format("c:\\temp1\\_%05d_f%I64d_rt0_%05x_%d.bmp", s_n, frame, m_context->FRAME.Block(), m_context->FRAME.PSM);
|
||||
|
||||
m_mem.SaveBMP(s, m_context->FRAME.Block(), m_context->FRAME.FBW, m_context->FRAME.PSM, GetFrameRect().width(), 512);//GetFrameSize(1).cy);
|
||||
}
|
||||
|
||||
if(s_savez)
|
||||
if(s_savez && s_n >= s_saven)
|
||||
{
|
||||
s = format("c:\\temp1\\_%05d_f%I64d_rz0_%05x_%d.bmp", s_n, frame, m_context->ZBUF.Block(), m_context->ZBUF.PSM);
|
||||
|
||||
|
@ -222,14 +222,14 @@ void GSRendererSW::Draw()
|
|||
|
||||
string s;
|
||||
|
||||
if(s_save)
|
||||
if(s_save && s_n >= s_saven)
|
||||
{
|
||||
s = format("c:\\temp1\\_%05d_f%I64d_rt1_%05x_%d.bmp", s_n, frame, m_context->FRAME.Block(), m_context->FRAME.PSM);
|
||||
|
||||
m_mem.SaveBMP(s, m_context->FRAME.Block(), m_context->FRAME.FBW, m_context->FRAME.PSM, GetFrameRect().width(), 512);//GetFrameSize(1).cy);
|
||||
}
|
||||
|
||||
if(s_savez)
|
||||
if(s_savez && s_n >= s_saven)
|
||||
{
|
||||
s = format("c:\\temp1\\_%05d_f%I64d_rz1_%05x_%d.bmp", s_n, frame, m_context->ZBUF.Block(), m_context->ZBUF.PSM);
|
||||
|
||||
|
|
|
@ -1881,6 +1881,19 @@ bool GSC_OnePieceGrandAdventure(const GSFrameInfo& fi, int& skip)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool GSC_OnePieceGrandBattle(const GSFrameInfo& fi, int& skip)
|
||||
{
|
||||
if(skip == 0)
|
||||
{
|
||||
if(fi.TME && fi.FBP == 0x02d00 && fi.FPSM == PSM_PSMCT16 && (fi.TBP0 == 0x00000 || fi.TBP0 == 0x00f00) && fi.TPSM == PSM_PSMCT16)
|
||||
{
|
||||
skip = 4;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GSC_ICO(const GSFrameInfo& fi, int& skip)
|
||||
{
|
||||
if(skip == 0)
|
||||
|
@ -2301,6 +2314,7 @@ bool GSState::IsBadFrame(int& skip)
|
|||
map[CRC::BullyCC] = GSC_BullyCC;
|
||||
map[CRC::SoTC] = GSC_SoTC;
|
||||
map[CRC::OnePieceGrandAdventure] = GSC_OnePieceGrandAdventure;
|
||||
map[CRC::OnePieceGrandBattle] = GSC_OnePieceGrandBattle;
|
||||
map[CRC::ICO] = GSC_ICO;
|
||||
map[CRC::GT4] = GSC_GT4;
|
||||
map[CRC::WildArms5] = GSC_WildArms5;
|
||||
|
|
|
@ -198,7 +198,7 @@ float4 wrapuv(float4 uv)
|
|||
else if(PS_WMS == 3)
|
||||
{
|
||||
#if SHADER_MODEL >= 0x400
|
||||
uv.xz = (float2)(((int2)(uv * WH.xyxy).xz & MskFix.xx) | MskFix.zz) / WH.xy;
|
||||
uv.xz = (float2)(((int2)(uv.xz * WH.xx) & MskFix.xx) | MskFix.zz) / WH.xx;
|
||||
#elif SHADER_MODEL <= 0x300
|
||||
uv.x = tex1D(UMSKFIX, uv.x);
|
||||
uv.z = tex1D(UMSKFIX, uv.z);
|
||||
|
@ -220,7 +220,7 @@ float4 wrapuv(float4 uv)
|
|||
else if(PS_WMT == 3)
|
||||
{
|
||||
#if SHADER_MODEL >= 0x400
|
||||
uv.yw = (float2)(((int2)(uv * WH.xyxy).yw & MskFix.yy) | MskFix.ww) / WH.xy;
|
||||
uv.yw = (float2)(((int2)(uv.yw * WH.yy) & MskFix.yy) | MskFix.ww) / WH.yy;
|
||||
#elif SHADER_MODEL <= 0x300
|
||||
uv.y = tex1D(VMSKFIX, uv.y);
|
||||
uv.w = tex1D(VMSKFIX, uv.w);
|
||||
|
|
Loading…
Reference in New Issue