mirror of
https://github.com/PCSX2/gsdx-sourceforge.git
synced 2026-02-04 03:11:19 +01:00
This commit is contained in:
@@ -667,7 +667,7 @@ REG64_(GIFReg, TEST)
|
||||
UINT32 _PAD1:13;
|
||||
UINT32 _PAD2:32;
|
||||
REG_END2
|
||||
bool DoFirstPass() {return !(ATE && ATST == 0);} // not all pixels fail automatically
|
||||
bool DoFirstPass() {return !ATE || ATST != 0;} // not all pixels fail automatically
|
||||
bool DoSecondPass() {return ATE && ATST != 1 && AFAIL != 0;} // pixels may fail, write fb/z
|
||||
bool NoSecondPass() {return ATE && ATST != 1 && AFAIL == 0;} // pixels may fail, no output
|
||||
REG_END2
|
||||
|
||||
@@ -1790,15 +1790,16 @@ void GSLocalMemory::ReadTexture(CRect r, BYTE* dst, int dstpitch, GIFRegTEX0& TE
|
||||
|
||||
if(w % bs.cx == 0 && maxu % bs.cx == 0 && h % bs.cy == 0 && maxv % bs.cy == 0)
|
||||
{
|
||||
//printf("!!! 3 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
// printf("!!! 1 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
|
||||
T* buff = (T*)_aligned_malloc(w * h * sizeof(T), 16);
|
||||
|
||||
(this->*st)(CRect(CPoint(maxu, maxv), CSize(w, h)), (BYTE*)buff, w * sizeof(T), TEX0, TEXA);
|
||||
|
||||
dst -= r.left;
|
||||
dst -= r.left * sizeof(T);
|
||||
|
||||
int k = (r.right - r.left) >> 2;
|
||||
int left = (r.left + minu) & ~minu;
|
||||
int right = r.right & ~minu;
|
||||
|
||||
for(int y = r.top; y < r.bottom; y++, dst += dstpitch)
|
||||
{
|
||||
@@ -1806,15 +1807,17 @@ void GSLocalMemory::ReadTexture(CRect r, BYTE* dst, int dstpitch, GIFRegTEX0& TE
|
||||
|
||||
int x = r.left;
|
||||
|
||||
for(int i = 0; i < k; x += 4, i++)
|
||||
for(; x < left; x++)
|
||||
{
|
||||
((T*)dst)[x+0] = src[(x+0) & minu];
|
||||
((T*)dst)[x+1] = src[(x+1) & minu];
|
||||
((T*)dst)[x+2] = src[(x+2) & minu];
|
||||
((T*)dst)[x+3] = src[(x+3) & minu];
|
||||
((T*)dst)[x] = src[x & minu];
|
||||
}
|
||||
|
||||
for(; x < r.right; x++)
|
||||
for(; x < right; x += minu + 1)
|
||||
{
|
||||
memcpy(&((T*)dst)[x], src, sizeof(T) * (minu + 1));
|
||||
}
|
||||
|
||||
for(; x < right; x++)
|
||||
{
|
||||
((T*)dst)[x] = src[x & minu];
|
||||
}
|
||||
@@ -1838,6 +1841,84 @@ void GSLocalMemory::ReadTexture(CRect r, BYTE* dst, int dstpitch, GIFRegTEX0& TE
|
||||
r.bottom = max(r.top, min(r.bottom, (int)maxv));
|
||||
}
|
||||
|
||||
if(wms == 3 && wmt != 3)
|
||||
{
|
||||
int w = ((minu + 1) + bsxm) & ~bsxm;
|
||||
|
||||
if(w % bs.cx == 0 && maxu % bs.cx == 0)
|
||||
{
|
||||
// printf("!!! 2 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
int top = r.top & ~bsym;
|
||||
int bottom = (r.bottom + bsym) & ~bsym;
|
||||
|
||||
int h = bottom - top;
|
||||
|
||||
T* buff = (T*)_aligned_malloc(w * h * sizeof(T), 16);
|
||||
|
||||
(this->*st)(CRect(CPoint(maxu, top), CSize(w, h)), (BYTE*)buff, w * sizeof(T), TEX0, TEXA);
|
||||
|
||||
dst -= r.left * sizeof(T);
|
||||
|
||||
int left = (r.left + minu) & ~minu;
|
||||
int right = r.right & ~minu;
|
||||
|
||||
for(int y = r.top; y < r.bottom; y++, dst += dstpitch)
|
||||
{
|
||||
T* src = &buff[(y - top) * w];
|
||||
|
||||
int x = r.left;
|
||||
|
||||
for(; x < left; x++)
|
||||
{
|
||||
((T*)dst)[x] = src[x & minu];
|
||||
}
|
||||
|
||||
for(; x < right; x += minu + 1)
|
||||
{
|
||||
memcpy(&((T*)dst)[x], src, sizeof(T) * (minu + 1));
|
||||
}
|
||||
|
||||
for(; x < right; x++)
|
||||
{
|
||||
((T*)dst)[x] = src[x & minu];
|
||||
}
|
||||
}
|
||||
|
||||
_aligned_free(buff);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(wms != 3 && wmt == 3)
|
||||
{
|
||||
int h = (minv + 1 + bsym) & ~bsym;
|
||||
|
||||
if(h % bs.cy == 0 && maxv % bs.cy == 0)
|
||||
{
|
||||
// printf("!!! 3 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
int left = r.left & ~bsxm;
|
||||
int right = (r.right + bsxm) & ~bsxm;
|
||||
|
||||
int w = right - left;
|
||||
|
||||
T* buff = (T*)_aligned_malloc(w * h * sizeof(T), 16);
|
||||
|
||||
(this->*st)(CRect(CPoint(left, maxv), CSize(w, h)), (BYTE*)buff, w * sizeof(T), TEX0, TEXA);
|
||||
|
||||
for(int y = r.top; y < r.bottom; y++, dst += dstpitch)
|
||||
{
|
||||
T* src = &buff[(y & minv) * w + (r.left - left)];
|
||||
|
||||
memcpy(dst, src, sizeof(T) * r.Width());
|
||||
}
|
||||
|
||||
_aligned_free(buff);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch(wms)
|
||||
{
|
||||
default: for(int x = r.left; x < r.right; x++) m_xtbl[x] = x; break;
|
||||
@@ -1850,7 +1931,7 @@ void GSLocalMemory::ReadTexture(CRect r, BYTE* dst, int dstpitch, GIFRegTEX0& TE
|
||||
case 3: for(int y = r.top; y < r.bottom; y++) m_ytbl[y] = (y & minv) | maxv; break;
|
||||
}
|
||||
|
||||
// printf("1 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
// printf("!!! 4 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
|
||||
for(int y = r.top; y < r.bottom; y++, dst += dstpitch)
|
||||
for(int x = r.left, i = 0; x < r.right; x++, i++)
|
||||
@@ -1889,7 +1970,8 @@ void GSLocalMemory::ReadTexture(CRect r, BYTE* dst, int dstpitch, GIFRegTEX0& TE
|
||||
// TODO: expand r to block size, read into temp buffer, copy to r (like above)
|
||||
|
||||
if(!aligned) printf("unaligned memory pointer passed to ReadTexture\n");
|
||||
// printf("2 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
|
||||
// printf("!!! 5 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
|
||||
for(int y = r.top; y < r.bottom; y++, dst += dstpitch)
|
||||
for(int x = r.left, i = 0; x < r.right; x++, i++)
|
||||
@@ -1897,7 +1979,7 @@ if(!aligned) printf("unaligned memory pointer passed to ReadTexture\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
// printf("4 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
// printf("!!! 6 wms = %d, wmt = %d, %3x %3x %3x %3x, %d %d - %d %d\n", wms, wmt, minu, maxu, minv, maxv, r.left, r.top, r.right, r.bottom);
|
||||
|
||||
for(int y = r.top; y < cr.top; y++, dst += dstpitch)
|
||||
for(int x = r.left, i = 0; x < r.right; x++, i++)
|
||||
|
||||
@@ -915,7 +915,7 @@ void GSState::FlushWrite(BYTE* mem, int len)
|
||||
|
||||
(m_mem.*st)(m_x, m_y, mem, len, m_env.BITBLTBUF, m_env.TRXPOS, m_env.TRXREG);
|
||||
|
||||
// TODO: m_perfmon.Put(GSPerfMon::Swizzle, len);
|
||||
m_perfmon.Put(GSPerfMon::Swizzle, len);
|
||||
|
||||
//ASSERT(m_env.TRXREG.RRH >= m_y - y);
|
||||
|
||||
@@ -1459,6 +1459,28 @@ bool GSState::DetectBadFrame(int crc, int& skip)
|
||||
|
||||
break;
|
||||
|
||||
case 0x6F8545DB: // ICO ntsc/us
|
||||
|
||||
if(skip == 0)
|
||||
{
|
||||
if(TME && FBP == 0x00800 && FPSM == PSM_PSMCT32 && TBP0 == 0x03d00 && TPSM == PSM_PSMCT32)
|
||||
{
|
||||
skip = 3;
|
||||
}
|
||||
else if(TME && FBP == 0x00800 && FPSM == PSM_PSMCT32 && TBP0 == 0x02800 && TPSM == PSM_PSMT8H)
|
||||
{
|
||||
skip = 56;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(TME && TBP0 == 0x00800 && TPSM == PSM_PSMCT32)
|
||||
{
|
||||
skip = 0;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(skip == 0)
|
||||
|
||||
@@ -121,8 +121,6 @@ class GSState
|
||||
protected:
|
||||
bool DetectBadFrame(int crc, int& skip);
|
||||
|
||||
GSPerfMon m_perfmon;
|
||||
|
||||
public:
|
||||
GIFRegPRIM* PRIM;
|
||||
GSRegPMODE* PMODE;
|
||||
@@ -146,6 +144,7 @@ public:
|
||||
GSVertex m_v;
|
||||
float m_q;
|
||||
|
||||
GSPerfMon m_perfmon;
|
||||
bool m_nloophack;
|
||||
|
||||
public:
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
ProjectGUID="{18E42F6F-3A62-41EE-B42F-79366C4F1E95}"
|
||||
RootNamespace="GSdx"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
@@ -24,7 +23,7 @@
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\common.vsprops;..\debug.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -79,7 +78,7 @@
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\common.vsprops;..\debug.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -135,7 +134,7 @@
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\common.vsprops;..\release.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -191,7 +190,7 @@
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\common.vsprops;..\release.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -248,7 +247,7 @@
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\common.vsprops;..\debug.vsprops;..\sse2.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -300,7 +299,10 @@
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug SSE2|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -350,6 +352,9 @@
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
@@ -359,7 +364,7 @@
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\common.vsprops;..\release.vsprops;..\sse2.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -412,7 +417,10 @@
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release SSE2|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -462,6 +470,9 @@
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
@@ -563,7 +574,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -573,7 +584,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -582,7 +593,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -592,7 +603,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -601,7 +612,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -611,7 +622,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -620,7 +631,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -630,7 +641,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -651,7 +662,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -668,7 +679,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -678,7 +689,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -687,7 +698,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
@@ -704,7 +715,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)""
|
||||
CommandLine="ml /nologo /c /Zi /Fo"$(IntDir)\$(InputName).obj" "$(InputPath)"
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
|
||||
@@ -239,7 +239,8 @@ TRACE(_T("[%d] FlushPrim f %05x (%d) z %05x (%d %d %d %d) t %05x %05x (%d)\n"),
|
||||
PRIM->TME ? (int)m_context->TEX0.PSM : 0xff);
|
||||
*/
|
||||
|
||||
if(s_n >= 274)
|
||||
if(s_dump && m_env.COLCLAMP.CLAMP == 0)
|
||||
//if(s_n >= 260)
|
||||
{
|
||||
s_save = true;
|
||||
// s_savez = true;
|
||||
@@ -627,7 +628,7 @@ if(s_dump)
|
||||
if(s_save) ::D3DX10SaveTextureToFile(rt->m_texture, D3DX10_IFF_BMP, str);
|
||||
}
|
||||
|
||||
//s_dump = m_perfmon.GetFrame() >= 5000;
|
||||
// s_dump = m_perfmon.GetFrame() >= 5001;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -641,7 +642,7 @@ if(s_dump)
|
||||
|
||||
void GSRendererHW::InvalidateTexture(const GIFRegBITBLTBUF& BITBLTBUF, CRect r)
|
||||
{
|
||||
// TRACE(_T("[%d] InvalidateTexture %d,%d - %d,%d %05x\n"), (int)m_perfmon.GetFrame(), r.left, r.top, r.right, r.bottom, (int)BITBLTBUF.DBP);
|
||||
TRACE(_T("[%d] InvalidateTexture %d,%d - %d,%d %05x\n"), (int)m_perfmon.GetFrame(), r.left, r.top, r.right, r.bottom, (int)BITBLTBUF.DBP);
|
||||
|
||||
m_tc.InvalidateTexture(BITBLTBUF, &r);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void GSRendererNull::DrawingKick(bool skip)
|
||||
|
||||
if(!skip)
|
||||
{
|
||||
//m_perfmon.Put(GSPerfMon::Prim, 1);
|
||||
m_perfmon.Put(GSPerfMon::Prim, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ static int bZTE; // , iZTST, iATST, iLOD, bLCM, bTCC, iTFX;
|
||||
template <class Vertex>
|
||||
void GSRendererSW<Vertex>::Draw()
|
||||
{
|
||||
if(s_n >= 252)
|
||||
if(s_dump && m_env.COLCLAMP.CLAMP == 0)
|
||||
{
|
||||
s_save = true;
|
||||
// s_savez = true;
|
||||
@@ -376,7 +376,7 @@ if(s_dump)
|
||||
if(s_save) ::D3DX10SaveTextureToFile(m_texture[i], D3DX10_IFF_BMP, str);
|
||||
}
|
||||
|
||||
// s_dump = m_perfmon.GetFrame() >= 5000;
|
||||
// s_dump = m_perfmon.GetFrame() >= 5001;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -284,6 +284,8 @@ void GSTextureCache::GSTexture::Update(GSLocalMemory::readTexture rt)
|
||||
return;
|
||||
}
|
||||
|
||||
TRACE(_T("GSTexture::Update %d,%d - %d,%d (%08x)\n"), r.left, r.top, r.right, r.bottom, m_TEX0.TBP0);
|
||||
|
||||
static BYTE* buff = (BYTE*)::_aligned_malloc(1024 * 1024 * 4, 16);
|
||||
|
||||
int pitch = 1024 * m_bpp >> 3;
|
||||
@@ -296,19 +298,19 @@ void GSTextureCache::GSTexture::Update(GSLocalMemory::readTexture rt)
|
||||
|
||||
m_tc->m_renderer->m_dev->UpdateSubresource(m_texture, 0, &box, bits, pitch, 0);
|
||||
|
||||
// m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Unswizzle, r.Width() * r.Height() * m_bpp >> 3);
|
||||
m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Unswizzle, r.Width() * r.Height() * m_bpp >> 3);
|
||||
|
||||
CRect r2 = m_valid & r;
|
||||
|
||||
if(!r2.IsRectEmpty())
|
||||
{
|
||||
// m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Unswizzle2, r2.Width() * r2.Height() * m_bpp >> 3);
|
||||
m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Unswizzle2, r2.Width() * r2.Height() * m_bpp >> 3);
|
||||
}
|
||||
|
||||
m_valid |= r;
|
||||
m_dirty.RemoveAll();
|
||||
|
||||
// m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Texture, r.Width() * r.Height() * m_bpp >> 3);
|
||||
m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Texture, r.Width() * r.Height() * m_bpp >> 3);
|
||||
}
|
||||
|
||||
bool GSTextureCache::GSTexture::GetDirtyRect(CRect& r)
|
||||
|
||||
@@ -367,7 +367,7 @@ GSTextureCache::GSTexture* GSTextureCache::GetTexture()
|
||||
|
||||
m_renderer->m_dev->UpdateSubresource(t->m_palette, 0, &box, t->m_clut, size, 0);
|
||||
|
||||
// m_renderer->m_perfmon.Put(GSPerfMon::Texture, size);
|
||||
m_renderer->m_perfmon.Put(GSPerfMon::Texture, size);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -524,9 +524,45 @@ void GSTextureCache::InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const
|
||||
if(HasSharedBits(BITBLTBUF.SBP, BITBLTBUF.SPSM, rt->m_TEX0.TBP0, rt->m_TEX0.PSM))
|
||||
{
|
||||
rt->Read(r);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
GSRenderTarget* rt2 = NULL;
|
||||
int ymin = INT_MAX;
|
||||
|
||||
pos = m_rt.GetHeadPosition();
|
||||
|
||||
while(pos)
|
||||
{
|
||||
GSRenderTarget* rt = m_rt.GetNext(pos);
|
||||
|
||||
if(HasSharedBits(BITBLTBUF.SPSM, rt->m_TEX0.PSM) && BITBLTBUF.SBP > rt->m_TEX0.TBP0)
|
||||
{
|
||||
// ffx2 pause screen background
|
||||
|
||||
DWORD rowsize = BITBLTBUF.SBW * 8192;
|
||||
DWORD offset = (BITBLTBUF.SBP - rt->m_TEX0.TBP0) * 256;
|
||||
|
||||
if(rowsize > 0 && offset % rowsize == 0)
|
||||
{
|
||||
int y = m_renderer->m_mem.m_psm[BITBLTBUF.SPSM].pgs.cy * offset / rowsize;
|
||||
|
||||
if(y < ymin && y < 512)
|
||||
{
|
||||
rt2 = rt;
|
||||
ymin = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(rt2)
|
||||
{
|
||||
rt2->Read(CRect(r.left, r.top + ymin, r.right, r.bottom + ymin));
|
||||
}
|
||||
|
||||
// TODO: ds
|
||||
}
|
||||
|
||||
void GSTextureCache::IncAge()
|
||||
|
||||
@@ -131,7 +131,7 @@ EXPORT_C_(UINT32) PS2EgetLibVersion2(UINT32 type)
|
||||
{
|
||||
const UINT32 revision = 0;
|
||||
const UINT32 build = 1;
|
||||
const UINT32 minor = 2;
|
||||
const UINT32 minor = 3;
|
||||
|
||||
return (build << 0) | (revision << 8) | (PS2E_GS_VERSION << 16) | (minor << 24);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\debug.vsprops;..\common.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -97,7 +97,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\debug.vsprops;..\common.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -172,7 +172,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\release.vsprops;..\common.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -247,7 +247,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\release.vsprops;..\common.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -325,7 +325,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\debug.vsprops;..\common.vsprops;..\sse2.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -400,7 +400,7 @@
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -463,7 +463,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\release.vsprops;..\common.vsprops;..\sse2.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -540,7 +540,7 @@
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
|
||||
@@ -61,5 +61,7 @@ float4 ps_main3(PS_INPUT input) : SV_Target0
|
||||
|
||||
float4 ps_main4(PS_INPUT input) : SV_Target0
|
||||
{
|
||||
return (float4)((uint4)Texture.Sample(Sampler, input.t) & 0xff);
|
||||
float4 c = Texture.Sample(Sampler, input.t);
|
||||
|
||||
return fmod(c * 255 + 0.5f, 256) / 255;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void GSRendererNull::DrawingKick(bool skip)
|
||||
|
||||
if(!skip)
|
||||
{
|
||||
//m_perfmon.Put(GSPerfMon::Prim, 1);
|
||||
m_perfmon.Put(GSPerfMon::Prim, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -292,20 +292,20 @@ void GSTextureCache::GSTexture::Update(GSLocalMemory::readTexture rt)
|
||||
|
||||
m_texture->UnlockRect(0);
|
||||
|
||||
// m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Unswizzle, r.Width() * r.Height() * m_bpp >> 3);
|
||||
m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Unswizzle, r.Width() * r.Height() * m_bpp >> 3);
|
||||
}
|
||||
|
||||
CRect r2 = m_valid & r;
|
||||
|
||||
if(!r2.IsRectEmpty())
|
||||
{
|
||||
// m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Unswizzle2, r2.Width() * r2.Height() * m_bpp >> 3);
|
||||
m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Unswizzle2, r2.Width() * r2.Height() * m_bpp >> 3);
|
||||
}
|
||||
|
||||
m_valid |= r;
|
||||
m_dirty.RemoveAll();
|
||||
|
||||
// m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Texture, r.Width() * r.Height() * m_bpp >> 3);
|
||||
m_tc->m_renderer->m_perfmon.Put(GSPerfMon::Texture, r.Width() * r.Height() * m_bpp >> 3);
|
||||
}
|
||||
|
||||
bool GSTextureCache::GSTexture::GetDirtyRect(CRect& r)
|
||||
|
||||
@@ -372,7 +372,7 @@ GSTextureCache::GSTexture* GSTextureCache::GetTexture()
|
||||
|
||||
t->m_palette->UnlockRect(0);
|
||||
|
||||
// m_renderer->m_perfmon.Put(GSPerfMon::Texture, size);
|
||||
m_renderer->m_perfmon.Put(GSPerfMon::Texture, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ __declspec(align(16)) union GSVertexHW
|
||||
struct
|
||||
{
|
||||
float x, y, z, w;
|
||||
union {struct {BYTE r, g, b, a;}; DWORD c;};
|
||||
DWORD f;
|
||||
union {struct {BYTE r, g, b, a;}; DWORD c0;};
|
||||
union {struct {BYTE ta0, ta1, res, f;}; DWORD c1;};
|
||||
float u, v;
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ EXPORT_C_(UINT32) PS2EgetLibVersion2(UINT32 type)
|
||||
{
|
||||
const UINT32 revision = 0;
|
||||
const UINT32 build = 11;
|
||||
const UINT32 minor = 2;
|
||||
const UINT32 minor = 3;
|
||||
|
||||
return (build << 0) | (revision << 8) | (PS2E_GS_VERSION << 16) | (minor << 24);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\common.vsprops;..\debug.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -98,7 +98,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\common.vsprops;..\debug.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -174,7 +174,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\common.vsprops;..\release.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -250,7 +250,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\common.vsprops;..\release.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -329,7 +329,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\common.vsprops;..\debug.vsprops;..\sse2.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -404,7 +404,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\common.vsprops;..\debug.vsprops;..\sse2.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
@@ -479,7 +479,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\common.vsprops;..\release.vsprops;..\sse2.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
@@ -555,7 +555,7 @@
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\common.vsprops;..\release.vsprops;..\sse2.vsprops"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
|
||||
Reference in New Issue
Block a user