GSdx: the valkyrie profile 2 fix

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1450 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2009-07-02 00:47:50 +00:00
parent 4de732685f
commit 7ddbaa6cb0
4 changed files with 47 additions and 2 deletions

View File

@ -141,6 +141,7 @@ 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},
}; };
hash_map<uint32, CRC::Game*> CRC::m_map; hash_map<uint32, CRC::Game*> CRC::m_map;

View File

@ -72,6 +72,7 @@ public:
SimpsonsGame, SimpsonsGame,
Genji, Genji,
StarOcean3, StarOcean3,
ValkyrieProfile2,
TitleCount, TitleCount,
}; };

View File

@ -2231,6 +2231,26 @@ bool GSC_StarOcean3(const GSFrameInfo& fi, int& skip)
return true; return true;
} }
bool GSC_ValkyrieProfile2(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;
@ -2279,6 +2299,7 @@ bool GSState::IsBadFrame(int& skip)
map[CRC::SonicUnleashed] = GSC_SonicUnleashed; map[CRC::SonicUnleashed] = GSC_SonicUnleashed;
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;
} }
// TODO: just set gsc in SetGameCRC once // TODO: just set gsc in SetGameCRC once

View File

@ -286,6 +286,8 @@ void GSTextureCache::InvalidateVideoMem(const GIFRegBITBLTBUF& BITBLTBUF, const
} }
else else
{ {
// TODO
if(s->m_TEX0.TBP0 == bp) if(s->m_TEX0.TBP0 == bp)
{ {
m_src.RemoveAt(s); m_src.RemoveAt(s);
@ -781,6 +783,15 @@ void GSTextureCache::SourceMap::Add(Source* s, const GIFRegTEX0& TEX0)
uint32 bp = TEX0.TBP0; uint32 bp = TEX0.TBP0;
uint32 bw = TEX0.TBW; uint32 bw = TEX0.TBW;
if(s->m_target)
{
// TODO
m_map[bp >> 5][s] = true;
return;
}
const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[TEX0.PSM]; const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[TEX0.PSM];
GSVector2i bs = (bp & 31) ? psm.pgs : psm.bs; GSVector2i bs = (bp & 31) ? psm.pgs : psm.bs;
@ -838,10 +849,21 @@ void GSTextureCache::SourceMap::RemoveAt(Source* s)
{ {
m_surfaces.erase(s); m_surfaces.erase(s);
for(uint32 i = s->m_TEX0.TBP0 >> 5; i < countof(m_map); i++) uint32 page = s->m_TEX0.TBP0 >> 5;
if(s->m_target)
{
// TODO
m_map[page].erase(s);
}
else
{
for(uint32 i = page; i < countof(m_map); i++)
{ {
m_map[i].erase(s); m_map[i].erase(s);
} }
}
delete s; delete s;
} }