GSDX: Prodded some offensive code, this isn't meant to affect emulation of any games and it probably won't.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5283 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1@gmail.com 2012-06-11 00:00:18 +00:00
parent 1711a26bbb
commit 17f28b24b3
3 changed files with 10 additions and 34 deletions

View File

@ -576,6 +576,7 @@ void GSTextureCache::IncAge()
//Fixme: Several issues in here. Not handling depth stencil, pitch conversion doesnt work. //Fixme: Several issues in here. Not handling depth stencil, pitch conversion doesnt work.
GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* dst) GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* dst)
{ {
const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[TEX0.PSM];
Source* src = new Source(m_renderer, TEX0, TEXA, m_temp); Source* src = new Source(m_renderer, TEX0, TEXA, m_temp);
int tw = 1 << TEX0.TW; int tw = 1 << TEX0.TW;
@ -596,7 +597,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
else else
src->m_spritehack_t = false; src->m_spritehack_t = false;
if(m_paltex && GSLocalMemory::m_psm[TEX0.PSM].pal > 0) if(m_paltex && psm.pal > 0)
{ {
src->m_fmt = FMT_8; src->m_fmt = FMT_8;
@ -769,26 +770,17 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
case PSM_PSMCT16S: case PSM_PSMCT16S:
src->m_fmt = FMT_16; src->m_fmt = FMT_16;
break; break;
case PSM_PSMT8H: // actually if we end up in that side of the function with a paletted format, we're probably already screwed
src->m_fmt = FMT_8H;
src->m_palette = m_renderer->m_dev->CreateTexture(256, 1);
break;
case PSM_PSMT8: case PSM_PSMT8:
//Not sure, this wasn't handled at all. case PSM_PSMT8H:
//Xenosaga 2 and 3 use it, Tales of Legendia as well. case PSM_PSMT4:
//It's always used for fog like effects.
src->m_fmt = FMT_8;
src->m_palette = m_renderer->m_dev->CreateTexture(256, 1);
break;
case PSM_PSMT4HL: case PSM_PSMT4HL:
src->m_fmt = FMT_4HL;
src->m_palette = m_renderer->m_dev->CreateTexture(256, 1);
break;
case PSM_PSMT4HH: case PSM_PSMT4HH:
src->m_fmt = FMT_4HH; src->m_fmt = FMT_8;
src->m_palette = m_renderer->m_dev->CreateTexture(256, 1);
break; break;
} }
if (psm.pal > 0)
src->m_palette = m_renderer->m_dev->CreateTexture(256, 1);
if(tmp != NULL) if(tmp != NULL)
{ {
@ -827,8 +819,6 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
return NULL; return NULL;
} }
const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[TEX0.PSM];
if(psm.pal > 0) if(psm.pal > 0)
{ {
memcpy(src->m_clut, (const uint32*)m_renderer->m_mem.m_clut, psm.pal * sizeof(uint32)); memcpy(src->m_clut, (const uint32*)m_renderer->m_mem.m_clut, psm.pal * sizeof(uint32));

View File

@ -34,9 +34,6 @@ public:
FMT_32, FMT_32,
FMT_24, FMT_24,
FMT_16, FMT_16,
FMT_8H,
FMT_4HL,
FMT_4HH,
FMT_8, FMT_8,
}; };

View File

@ -2,10 +2,7 @@
#define FMT_32 0 #define FMT_32 0
#define FMT_24 1 #define FMT_24 1
#define FMT_16 2 #define FMT_16 2
#define FMT_8H 3 #define FMT_8 3
#define FMT_4HL 4
#define FMT_4HH 5
#define FMT_8 6
#if SHADER_MODEL >= 0x400 #if SHADER_MODEL >= 0x400
@ -390,15 +387,7 @@ float4 sample(float2 st, float q)
float4x4 c; float4x4 c;
if(PS_FMT == FMT_8H) if(PS_FMT == FMT_8)
{
c = sample_4p(sample_4a(uv));
}
else if(PS_FMT == FMT_4HL || PS_FMT == FMT_4HH)
{
c = sample_4p(fmod(sample_4a(uv), 1.0f / 16));
}
else if(PS_FMT == FMT_8)
{ {
c = sample_4p(sample_4a(uv)); c = sample_4p(sample_4a(uv));
} }