GSdx: added a few CRCs

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1451 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2009-07-02 16:05:03 +00:00
parent 7ddbaa6cb0
commit ba5823b144
5 changed files with 73 additions and 62 deletions

View File

@ -141,7 +141,9 @@ CRC::Game CRC::m_games[] =
{0x4C94B32C, SimpsonsGame, Unknown, 0}, {0x4C94B32C, SimpsonsGame, Unknown, 0},
{0xD71B57F4, Genji, Unknown, 0}, {0xD71B57F4, Genji, Unknown, 0},
{0x23A97857, StarOcean3, JPUNDUB, 0}, {0x23A97857, StarOcean3, JPUNDUB, 0},
{0xCC96CE93, ValkyrieProfile2, JPUNDUB, 0}, {0xCC96CE93, ValkyrieProfile2, US, 0},
{0x774DE8E2, ValkyrieProfile2, JP, 0},
{0x47B9B2FD, RadiataStories, US, 0},
}; };
hash_map<uint32, CRC::Game*> CRC::m_map; hash_map<uint32, CRC::Game*> CRC::m_map;

View File

@ -73,6 +73,7 @@ public:
Genji, Genji,
StarOcean3, StarOcean3,
ValkyrieProfile2, ValkyrieProfile2,
RadiataStories,
TitleCount, TitleCount,
}; };

View File

@ -2251,6 +2251,26 @@ bool GSC_ValkyrieProfile2(const GSFrameInfo& fi, int& skip)
return true; return true;
} }
bool GSC_RadiataStories(const GSFrameInfo& fi, int& skip)
{
if(skip == 0)
{
if(fi.TME && fi.FBP == fi.TBP0 && fi.FPSM == PSM_PSMCT32 && fi.TPSM == PSM_PSMT4HH)
{
skip = 1000; //
}
}
else
{
if(!(fi.TME && fi.FBP == fi.TBP0 && fi.FPSM == PSM_PSMCT32 && fi.TPSM == PSM_PSMT4HH))
{
skip = 0;
}
}
return true;
}
bool GSState::IsBadFrame(int& skip) bool GSState::IsBadFrame(int& skip)
{ {
GSFrameInfo fi; GSFrameInfo fi;
@ -2300,6 +2320,7 @@ bool GSState::IsBadFrame(int& skip)
map[CRC::Genji] = GSC_Genji; map[CRC::Genji] = GSC_Genji;
map[CRC::StarOcean3] = GSC_StarOcean3; map[CRC::StarOcean3] = GSC_StarOcean3;
map[CRC::ValkyrieProfile2] = GSC_ValkyrieProfile2; map[CRC::ValkyrieProfile2] = GSC_ValkyrieProfile2;
map[CRC::RadiataStories] = GSC_RadiataStories;
} }
// TODO: just set gsc in SetGameCRC once // TODO: just set gsc in SetGameCRC once

View File

@ -260,98 +260,76 @@ bool GSTextureCacheSW::GSTexture::Update(const GIFRegTEX0& TEX0, const GIFRegTEX
m_complete = true; // lame, but better than nothing m_complete = true; // lame, but better than nothing
} }
GSLocalMemory& mem = m_state->m_mem;
uint32 bp = TEX0.TBP0; uint32 bp = TEX0.TBP0;
uint32 bw = TEX0.TBW; uint32 bw = TEX0.TBW;
GSLocalMemory::readTextureBlock rtxb = psm.rtxbP; bool repeating = tw > (bw << 6); // TODO: bw == 0
int bytes = psm.pal > 0 ? 1 : 4;
uint32 pitch = (1 << m_tw) * bytes;
uint8* dst = (uint8*)m_buff + pitch * r.top;
uint32 blocks = 0; uint32 blocks = 0;
if(tw <= (bw << 6)) GSLocalMemory& mem = m_state->m_mem;
GSLocalMemory::readTextureBlock rtxb = psm.rtxbP;
int shift = psm.pal == 0 ? 2 : 0;
uint32 pitch = (1 << m_tw) << shift;
uint8* dst = (uint8*)m_buff + pitch * r.top;
for(int y = r.top, o = pitch * s.y; y < r.bottom; y += s.y, dst += o)
{ {
for(int y = r.top, o = pitch * s.y; y < r.bottom; y += s.y, dst += o) uint32 base = psm.bn(0, y, bp, bw);
for(int x = r.left; x < r.right; x += s.x)
{ {
uint32 base = psm.bn(0, y, bp, bw); uint32 block = base + psm.blockOffset[x >> 3];
for(int x = r.left; x < r.right; x += s.x) if(block < MAX_BLOCKS)
{ {
uint32 block = base + psm.blockOffset[x >> 3]; uint32 row = block >> 5;
uint32 col = 1 << (block & 31);
if(block < MAX_BLOCKS) if((m_valid[row] & col) == 0)
{ {
uint32 row = block >> 5; if(!repeating)
uint32 col = 1 << (block & 31);
if((m_valid[row] & col) == 0)
{ {
m_valid[row] |= col; m_valid[row] |= col;
(mem.*rtxb)(block, &dst[x * bytes], pitch, TEXA);
blocks++;
} }
(mem.*rtxb)(block, &dst[x << shift], pitch, TEXA);
blocks++;
} }
} }
} }
} }
else
if(blocks > 0)
{ {
// unfortunatelly a block may be part of the same texture multiple times at different places (tw 1024 > tbw 640, between 640 -> 1024 it is repeated from the next row), if(repeating)
// so just can't set the block's bit to valid in one pass, even if 99.9% of the games don't address the repeated part at the right side
// TODO: still bogus if those repeated parts aren't fetched together
for(int y = r.top, o = pitch * s.y; y < r.bottom; y += s.y, dst += o)
{ {
uint32 base = psm.bn(0, y, bp, bw); for(int y = r.top; y < r.bottom; y += s.y)
for(int x = r.left; x < r.right; x += s.x)
{ {
uint32 block = base + psm.blockOffset[x >> 3]; uint32 base = psm.bn(0, y, bp, bw);
if(block < MAX_BLOCKS) for(int x = r.left; x < r.right; x += s.x)
{ {
uint32 row = block >> 5; uint32 block = base + psm.blockOffset[x >> 3];
uint32 col = 1 << (block & 31);
if((m_valid[row] & col) == 0) if(block < MAX_BLOCKS)
{ {
(mem.*rtxb)(block, &dst[x * bytes], pitch, TEXA); uint32 row = block >> 5;
uint32 col = 1 << (block & 31);
blocks++; m_valid[row] |= col;
} }
} }
} }
} }
for(int y = r.top; y < r.bottom; y += s.y) m_state->m_perfmon.Put(GSPerfMon::Unswizzle, s.x * s.y * blocks << shift);
{
uint32 base = psm.bn(0, y, bp, bw);
for(int x = r.left; x < r.right; x += s.x)
{
uint32 block = base + psm.blockOffset[x >> 3];
if(block < MAX_BLOCKS)
{
uint32 row = block >> 5;
uint32 col = 1 << (block & 31);
m_valid[row] |= col;
}
}
}
} }
m_state->m_perfmon.Put(GSPerfMon::Unswizzle, s.x * s.y * bytes * blocks);
return true; return true;
} }

View File

@ -1029,9 +1029,13 @@ public:
return _mm_movemask_epi8(m) == 0xffff; return _mm_movemask_epi8(m) == 0xffff;
} }
bool anytrue() const bool allfalse() const
{ {
return _mm_movemask_epi8(m) != 0x0000; #if _M_SSE >= 0x401
return _mm_testz_si128(m, m);
#else
return _mm_movemask_epi8(m) == 0;
#endif
} }
#if _M_SSE >= 0x401 #if _M_SSE >= 0x401
@ -2544,7 +2548,12 @@ public:
bool allfalse() const bool allfalse() const
{ {
#if _M_SSE >= 0x401
__m128i a = _mm_castps_si128(m);
return _mm_testz_si128(a, a);
#else
return _mm_movemask_ps(m) == 0; return _mm_movemask_ps(m) == 0;
#endif
} }
// TODO: insert // TODO: insert