GSDX: Put the sprite hack back in because apparently it wasn't fixed.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5312 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1@gmail.com 2012-06-19 01:12:01 +00:00
parent 21522e71b2
commit f5f5074172
10 changed files with 36 additions and 5 deletions

View File

@ -174,12 +174,13 @@ public:
uint32 ltf:1; uint32 ltf:1;
uint32 colclip:2; uint32 colclip:2;
uint32 date:2; uint32 date:2;
uint32 spritehack:1;
}; };
uint32 key; uint32 key;
}; };
operator uint32() {return key & 0x3ffffff;} operator uint32() {return key & 0x7ffffff;}
PSSelector() : key(0) {} PSSelector() : key(0) {}
}; };

View File

@ -294,6 +294,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
ps_sel.tcc = context->TEX0.TCC; ps_sel.tcc = context->TEX0.TCC;
ps_sel.ltf = bilinear && !(ps_sel.fmt <= 2 && ps_sel.wms < 3 && ps_sel.wmt < 3); ps_sel.ltf = bilinear && !(ps_sel.fmt <= 2 && ps_sel.wms < 3 && ps_sel.wmt < 3);
ps_sel.rt = tex->m_target; ps_sel.rt = tex->m_target;
ps_sel.spritehack = tex->m_spritehack_t;
int w = tex->m_texture->GetWidth(); int w = tex->m_texture->GetWidth();
int h = tex->m_texture->GetHeight(); int h = tex->m_texture->GetHeight();

View File

@ -420,6 +420,7 @@ void GSHacksDlg::OnInit()
CheckDlgButton(m_hWnd, IDC_ALPHAHACK, theApp.GetConfig("UserHacks_AlphaHack", 0)); CheckDlgButton(m_hWnd, IDC_ALPHAHACK, theApp.GetConfig("UserHacks_AlphaHack", 0));
CheckDlgButton(m_hWnd, IDC_OFFSETHACK, theApp.GetConfig("UserHacks_HalfPixelOffset", 0)); CheckDlgButton(m_hWnd, IDC_OFFSETHACK, theApp.GetConfig("UserHacks_HalfPixelOffset", 0));
CheckDlgButton(m_hWnd, IDC_SPRITEHACK, theApp.GetConfig("UserHacks_SpriteHack", 0));
CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0)); CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0));
CheckDlgButton(m_hWnd, IDC_AGGRESSIVECRC, theApp.GetConfig("UserHacks_AggressiveCRC", 0)); CheckDlgButton(m_hWnd, IDC_AGGRESSIVECRC, theApp.GetConfig("UserHacks_AggressiveCRC", 0));
CheckDlgButton(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS, theApp.GetConfig("UserHacks_DisableCrcHacks", 0)); CheckDlgButton(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS, theApp.GetConfig("UserHacks_DisableCrcHacks", 0));
@ -469,6 +470,11 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
case IDC_OFFSETHACK: case IDC_OFFSETHACK:
helpstr = "Halfpixel\n\nMight fix some misaligned fog, bloom, or blend effect."; helpstr = "Halfpixel\n\nMight fix some misaligned fog, bloom, or blend effect.";
break; break;
case IDC_SPRITEHACK:
helpstr = "Sprite Hack\n\nHelps getting rid of black inner lines in some filtered sprites."
" Half option is the preferred one. Use it for Mana Khemia or ArTonelico for example."
" Full can be used for Tales of Destiny.";
break;
case IDC_WILDHACK: case IDC_WILDHACK:
helpstr = "WildArms\n\nLowers the GS precision to avoid gaps between pixels when" helpstr = "WildArms\n\nLowers the GS precision to avoid gaps between pixels when"
" upscaling. Full option fixes the text on WildArms games, while Half option might improve portraits" " upscaling. Full option fixes the text on WildArms games, while Half option might improve portraits"
@ -512,6 +518,7 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
theApp.SetConfig("UserHacks_MSAA", cb2msaa[(int)SendMessage(GetDlgItem(m_hWnd, IDC_MSAACB), CB_GETCURSEL, 0, 0)]); theApp.SetConfig("UserHacks_MSAA", cb2msaa[(int)SendMessage(GetDlgItem(m_hWnd, IDC_MSAACB), CB_GETCURSEL, 0, 0)]);
theApp.SetConfig("UserHacks_AlphaHack", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHAHACK)); theApp.SetConfig("UserHacks_AlphaHack", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHAHACK));
theApp.SetConfig("UserHacks_HalfPixelOffset", (int)IsDlgButtonChecked(m_hWnd, IDC_OFFSETHACK)); theApp.SetConfig("UserHacks_HalfPixelOffset", (int)IsDlgButtonChecked(m_hWnd, IDC_OFFSETHACK));
theApp.SetConfig("UserHacks_SpriteHack", (int)IsDlgButtonChecked(m_hWnd, IDC_SPRITEHACK));
theApp.SetConfig("UserHacks_SkipDraw", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0)); theApp.SetConfig("UserHacks_SkipDraw", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0));
theApp.SetConfig("UserHacks_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK)); theApp.SetConfig("UserHacks_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK));
theApp.SetConfig("UserHacks_AggressiveCRC", (int)IsDlgButtonChecked(m_hWnd, IDC_AGGRESSIVECRC)); theApp.SetConfig("UserHacks_AggressiveCRC", (int)IsDlgButtonChecked(m_hWnd, IDC_AGGRESSIVECRC));

View File

@ -25,6 +25,7 @@
GSTextureCache::GSTextureCache(GSRenderer* r) GSTextureCache::GSTextureCache(GSRenderer* r)
: m_renderer(r) : m_renderer(r)
{ {
m_spritehack = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_SpriteHack", 0) : 0;
UserHacks_HalfPixelOffset = !!theApp.GetConfig("UserHacks", 0) && !!theApp.GetConfig("UserHacks_HalfPixelOffset", 0); UserHacks_HalfPixelOffset = !!theApp.GetConfig("UserHacks", 0) && !!theApp.GetConfig("UserHacks_HalfPixelOffset", 0);
@ -590,6 +591,16 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
bool hack = false; bool hack = false;
if(m_spritehack && (TEX0.PSM == PSM_PSMT8 || TEX0.PSM == PSM_PSMT8H))
{
src->m_spritehack_t = true;
if(m_spritehack == 2 && TEX0.CPSM != PSM_PSMCT16)
src->m_spritehack_t = false;
}
else
src->m_spritehack_t = false;
if (dst) if (dst)
{ {
// TODO: clean up this mess // TODO: clean up this mess

View File

@ -63,6 +63,7 @@ public:
bool m_target; bool m_target;
bool m_complete; bool m_complete;
bool m_repeating; bool m_repeating;
bool m_spritehack_t;
vector<GSVector2i>* m_p2t; vector<GSVector2i>* m_p2t;
public: public:
@ -106,6 +107,7 @@ protected:
SourceMap m_src; SourceMap m_src;
list<Target*> m_dst[2]; list<Target*> m_dst[2];
bool m_paltex; bool m_paltex;
int m_spritehack;
uint8* m_temp; uint8* m_temp;
virtual Source* CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* t = NULL); virtual Source* CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* t = NULL);

View File

@ -177,7 +177,7 @@ void GSDevice11::SetupPS(PSSelector sel, const PSConstantBuffer* cb, PSSamplerSe
if(i == m_ps.end()) if(i == m_ps.end())
{ {
string str[15]; string str[16];
str[0] = format("%d", sel.fst); str[0] = format("%d", sel.fst);
str[1] = format("%d", sel.wms); str[1] = format("%d", sel.wms);
@ -194,6 +194,7 @@ void GSDevice11::SetupPS(PSSelector sel, const PSConstantBuffer* cb, PSSamplerSe
str[12] = format("%d", sel.ltf); str[12] = format("%d", sel.ltf);
str[13] = format("%d", sel.colclip); str[13] = format("%d", sel.colclip);
str[14] = format("%d", sel.date); str[14] = format("%d", sel.date);
str[15] = format("%d", sel.spritehack);
D3D11_SHADER_MACRO macro[] = D3D11_SHADER_MACRO macro[] =
{ {
@ -212,6 +213,7 @@ void GSDevice11::SetupPS(PSSelector sel, const PSConstantBuffer* cb, PSSamplerSe
{"PS_LTF", str[12].c_str()}, {"PS_LTF", str[12].c_str()},
{"PS_COLCLIP", str[13].c_str()}, {"PS_COLCLIP", str[13].c_str()},
{"PS_DATE", str[14].c_str()}, {"PS_DATE", str[14].c_str()},
{"PS_SPRITEHACK", str[15].c_str()},
{NULL, NULL}, {NULL, NULL},
}; };

View File

@ -135,7 +135,7 @@ void GSDevice9::SetupPS(PSSelector sel, const PSConstantBuffer* cb, PSSamplerSel
if(i == m_ps.end()) if(i == m_ps.end())
{ {
string str[14]; string str[15];
str[0] = format("%d", sel.fst); str[0] = format("%d", sel.fst);
str[1] = format("%d", sel.wms); str[1] = format("%d", sel.wms);
@ -151,6 +151,7 @@ void GSDevice9::SetupPS(PSSelector sel, const PSConstantBuffer* cb, PSSamplerSel
str[11] = format("%d", sel.ltf); str[11] = format("%d", sel.ltf);
str[12] = format("%d", sel.colclip); str[12] = format("%d", sel.colclip);
str[13] = format("%d", sel.date); str[13] = format("%d", sel.date);
str[14] = format("%d", sel.spritehack);
D3DXMACRO macro[] = D3DXMACRO macro[] =
{ {
@ -168,6 +169,7 @@ void GSDevice9::SetupPS(PSSelector sel, const PSConstantBuffer* cb, PSSamplerSel
{"PS_LTF", str[11].c_str()}, {"PS_LTF", str[11].c_str()},
{"PS_COLCLIP", str[12].c_str()}, {"PS_COLCLIP", str[12].c_str()},
{"PS_DATE", str[13].c_str()}, {"PS_DATE", str[13].c_str()},
{"PS_SPRITEHACK", str[14].c_str()},
{NULL, NULL}, {NULL, NULL},
}; };

View File

@ -88,11 +88,12 @@ BEGIN
CONTROL "",IDC_SKIPDRAWHACK,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS,68,35,10,14 CONTROL "",IDC_SKIPDRAWHACK,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS,68,35,10,14
CONTROL "Alpha",IDC_ALPHAHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,54,34,10 CONTROL "Alpha",IDC_ALPHAHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,54,34,10
CONTROL "Half-pixel Offset",IDC_OFFSETHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,71,65,10 CONTROL "Half-pixel Offset",IDC_OFFSETHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,71,65,10
CONTROL "Sprite",IDC_SPRITEHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,88,35,10
LTEXT "USE AT YOUR OWN RISK!",IDC_STATIC,7,182,84,8,WS_DISABLED LTEXT "USE AT YOUR OWN RISK!",IDC_STATIC,7,182,84,8,WS_DISABLED
COMBOBOX IDC_MSAACB,35,18,44,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_MSAACB,35,18,44,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "WildArmsOffset",IDC_WILDHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,88,64,10 CONTROL "WildArmsOffset",IDC_WILDHACK,"Button",BS_AUTO3STATE | WS_TABSTOP,14,105,64,10
LTEXT "TEXT_GOES_HERE",IDC_HACK_DESCRIPTION,92,20,209,145 LTEXT "TEXT_GOES_HERE",IDC_HACK_DESCRIPTION,92,20,209,145
CONTROL "Aggressive-CRC",IDC_AGGRESSIVECRC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,105,66,10 CONTROL "Aggressive-CRC",IDC_AGGRESSIVECRC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,122,66,10
CONTROL "Disable CRCs",IDC_CHECK_DISABLE_ALL_HACKS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,157,58,10 CONTROL "Disable CRCs",IDC_CHECK_DISABLE_ALL_HACKS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,157,58,10
END END

View File

@ -33,6 +33,7 @@
#define PS_LTF 1 #define PS_LTF 1
#define PS_COLCLIP 0 #define PS_COLCLIP 0
#define PS_DATE 0 #define PS_DATE 0
#define PS_SPRITEHACK 0
#endif #endif
struct VS_INPUT struct VS_INPUT
@ -504,7 +505,9 @@ void atst(float4 c)
} }
else if(PS_ATST == 2) // l else if(PS_ATST == 2) // l
{ {
#if PS_SPRITEHACK == 0
clip(AREF - a); clip(AREF - a);
#endif
} }
else if(PS_ATST == 3) // le else if(PS_ATST == 3) // le
{ {

View File

@ -75,6 +75,7 @@
#define IDC_SKIPDRAWHACKEDIT 2048 #define IDC_SKIPDRAWHACKEDIT 2048
#define IDC_STATIC10 2049 #define IDC_STATIC10 2049
#define IDC_HACKDISABLED 2050 #define IDC_HACKDISABLED 2050
#define IDC_SPRITEHACK 2051
#define IDRESET 2052 #define IDRESET 2052
#define IDC_SATURATION_SLIDER 2053 #define IDC_SATURATION_SLIDER 2053
#define IDC_BRIGHTNESS_SLIDER 2055 #define IDC_BRIGHTNESS_SLIDER 2055