Adding KrossX's Wild Arms text alignment hack to the new dialog box. This hack is actually very interesting for a number of games. It should work well in cases where game designers adjusted everything pixel perfect for the GS, that usually breaks with upscaling. 
It should be generalized and renamed later.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5120 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2012-03-06 21:36:59 +00:00
parent 0d5e312bdb
commit b25aec19c1
10 changed files with 41 additions and 10 deletions

View File

@ -76,6 +76,7 @@ public:
uint32 fst:1; uint32 fst:1;
uint32 logz:1; uint32 logz:1;
uint32 rtcopy:1; uint32 rtcopy:1;
uint32 wildhack:2;
}; };
uint32 key; uint32 key;

View File

@ -145,6 +145,9 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
vs_sel.logz = dev->HasDepth32() ? 0 : m_logz ? 1 : 0; vs_sel.logz = dev->HasDepth32() ? 0 : m_logz ? 1 : 0;
vs_sel.rtcopy = !!rtcopy; vs_sel.rtcopy = !!rtcopy;
if(tex) vs_sel.wildhack = tex->m_wildhack_t;
else vs_sel.wildhack = 0;
// The real GS appears to do no masking based on the Z buffer format and writing larger Z values // The real GS appears to do no masking based on the Z buffer format and writing larger Z values
// than the buffer supports seems to be an error condition on the real GS, causing it to crash. // than the buffer supports seems to be an error condition on the real GS, causing it to crash.
// We are probably receiving bad coordinates from VU1 in these cases. // We are probably receiving bad coordinates from VU1 in these cases.

View File

@ -421,6 +421,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_SPRITEHACK, theApp.GetConfig("UserHacks_SpriteHack", 0));
CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0));
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETRANGE, 0, MAKELPARAM(1000, 0)); SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETRANGE, 0, MAKELPARAM(1000, 0));
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_SkipDraw", 0), 0)); SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_SkipDraw", 0), 0));
@ -446,6 +447,7 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
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_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));
EndDialog(m_hWnd, id); EndDialog(m_hWnd, id);
} break; } break;
} }

View File

@ -26,6 +26,7 @@ GSTextureCache::GSTextureCache(GSRenderer* r)
: m_renderer(r) : m_renderer(r)
{ {
m_spritehack = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_SpriteHack", 0) : 0; m_spritehack = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_SpriteHack", 0) : 0;
m_wildhack = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_WildHack", 0) : 0;
UserHacks_HalfPixelOffset = !!theApp.GetConfig("UserHacks", 0) && !!theApp.GetConfig("UserHacks_HalfPixelOffset", 0); UserHacks_HalfPixelOffset = !!theApp.GetConfig("UserHacks", 0) && !!theApp.GetConfig("UserHacks_HalfPixelOffset", 0);
m_paltex = !!theApp.GetConfig("paltex", 0); m_paltex = !!theApp.GetConfig("paltex", 0);
@ -583,6 +584,8 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
bool hack = false; bool hack = false;
src->m_wildhack_t = m_wildhack; // dunno where to put it really, but works fine here.
if(dst == NULL) if(dst == NULL)
{ {
if(m_spritehack && (TEX0.PSM == PSM_PSMT8 || TEX0.PSM == PSM_PSMT8H)) if(m_spritehack && (TEX0.PSM == PSM_PSMT8 || TEX0.PSM == PSM_PSMT8H))

View File

@ -76,6 +76,7 @@ public:
bool m_complete; bool m_complete;
bool m_repeating; bool m_repeating;
bool m_spritehack_t; bool m_spritehack_t;
int m_wildhack_t;
vector<GSVector2i>* m_p2t; vector<GSVector2i>* m_p2t;
public: public:
@ -120,6 +121,7 @@ protected:
list<Target*> m_dst[2]; list<Target*> m_dst[2];
bool m_paltex; bool m_paltex;
int m_spritehack; int m_spritehack;
int m_wildhack;
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

@ -88,12 +88,13 @@ void GSDevice11::SetupVS(VSSelector sel, const VSConstantBuffer* cb)
if(i == m_vs.end()) if(i == m_vs.end())
{ {
string str[4]; string str[5];
str[0] = format("%d", sel.bppz); str[0] = format("%d", sel.bppz);
str[1] = format("%d", sel.tme); str[1] = format("%d", sel.tme);
str[2] = format("%d", sel.fst); str[2] = format("%d", sel.fst);
str[3] = format("%d", sel.rtcopy); str[3] = format("%d", sel.rtcopy);
str[4] = format("%d", sel.wildhack);
D3D11_SHADER_MACRO macro[] = D3D11_SHADER_MACRO macro[] =
{ {
@ -101,6 +102,7 @@ void GSDevice11::SetupVS(VSSelector sel, const VSConstantBuffer* cb)
{"VS_TME", str[1].c_str()}, {"VS_TME", str[1].c_str()},
{"VS_FST", str[2].c_str()}, {"VS_FST", str[2].c_str()},
{"VS_RTCOPY", str[3].c_str()}, {"VS_RTCOPY", str[3].c_str()},
{"VS_WILDHACK", str[4].c_str()},
{NULL, NULL}, {NULL, NULL},
}; };

View File

@ -67,13 +67,14 @@ void GSDevice9::SetupVS(VSSelector sel, const VSConstantBuffer* cb)
if(i == m_vs.end()) if(i == m_vs.end())
{ {
string str[5]; string str[6];
str[0] = format("%d", sel.bppz); str[0] = format("%d", sel.bppz);
str[1] = format("%d", sel.tme); str[1] = format("%d", sel.tme);
str[2] = format("%d", sel.fst); str[2] = format("%d", sel.fst);
str[3] = format("%d", sel.logz); str[3] = format("%d", sel.logz);
str[4] = format("%d", sel.rtcopy); str[4] = format("%d", sel.rtcopy);
str[5] = format("%d", sel.wildhack);
D3DXMACRO macro[] = D3DXMACRO macro[] =
{ {
@ -82,6 +83,7 @@ void GSDevice9::SetupVS(VSSelector sel, const VSConstantBuffer* cb)
{"VS_FST", str[2].c_str()}, {"VS_FST", str[2].c_str()},
{"VS_LOGZ", str[3].c_str()}, {"VS_LOGZ", str[3].c_str()},
{"VS_RTCOPY", str[4].c_str()}, {"VS_RTCOPY", str[4].c_str()},
{"VS_WILDHACK", str[5].c_str()},
{NULL, NULL}, {NULL, NULL},
}; };

View File

@ -74,14 +74,14 @@ IDB_LOGO10 BITMAP "res\\logo10.bmp"
// Dialog // Dialog
// //
IDD_HACKS DIALOGEX 0, 0, 316, 133 IDD_HACKS DIALOGEX 0, 0, 315, 203
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Hacks Configuration" CAPTION "Hacks Configuration"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "OK",IDOK,259,112,50,14 DEFPUSHBUTTON "OK",IDOK,258,182,50,14
GROUPBOX "Hack",IDC_STATIC,7,7,76,100 GROUPBOX "Hack",IDC_STATIC,7,7,76,165
GROUPBOX "Description",IDC_STATIC,86,7,223,100 GROUPBOX "Description",IDC_STATIC,85,7,223,165
LTEXT "MSAA",IDC_STATIC,14,20,20,8 LTEXT "MSAA",IDC_STATIC,14,20,20,8
LTEXT "Skipdraw",IDC_STATIC,14,37,30,8 LTEXT "Skipdraw",IDC_STATIC,14,37,30,8
EDITTEXT IDC_SKIPDRAWHACKEDIT,45,35,24,14,ES_RIGHT | ES_AUTOHSCROLL EDITTEXT IDC_SKIPDRAWHACKEDIT,45,35,24,14,ES_RIGHT | ES_AUTOHSCROLL
@ -94,8 +94,10 @@ BEGIN
LTEXT "Works around some shadow problems",IDC_STATIC,92,54,120,8 LTEXT "Works around some shadow problems",IDC_STATIC,92,54,120,8
LTEXT "May fix displaced fog or blend effects",IDC_STATIC,92,71,117,8 LTEXT "May fix displaced fog or blend effects",IDC_STATIC,92,71,117,8
LTEXT "Fixes character sprites in some 2D games",IDC_STATIC,92,88,129,8 LTEXT "Fixes character sprites in some 2D games",IDC_STATIC,92,88,129,8
LTEXT "USE AT YOUR OWN RISK!",IDC_STATIC,7,115,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,105,64,10
LTEXT "Lowers GS precission. Can fix text in Wild Arms and others.",IDC_STATIC,92,105,200,11
END END
IDD_SHADEBOOST DIALOGEX 0, 0, 316, 129 IDD_SHADEBOOST DIALOGEX 0, 0, 316, 129
@ -256,9 +258,9 @@ BEGIN
IDD_HACKS, DIALOG IDD_HACKS, DIALOG
BEGIN BEGIN
LEFTMARGIN, 7 LEFTMARGIN, 7
RIGHTMARGIN, 309 RIGHTMARGIN, 308
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 126 BOTTOMMARGIN, 196
END END
IDD_SHADEBOOST, DIALOG IDD_SHADEBOOST, DIALOG

View File

@ -13,6 +13,7 @@
#define VS_BPPZ 0 #define VS_BPPZ 0
#define VS_TME 1 #define VS_TME 1
#define VS_FST 1 #define VS_FST 1
#define VS_WILDHACK 0
#endif #endif
#ifndef GS_IIP #ifndef GS_IIP
@ -620,7 +621,13 @@ VS_OUTPUT vs_main(VS_INPUT input)
{ {
if(VS_FST) if(VS_FST)
{ {
#if VS_WILDHACK == 1
output.t.xy = (input.uv & 0x3FEF) * TextureScale;
#elif VS_WILDHACK == 2
output.t.xy = (input.uv & 0x3FF7) * TextureScale;
#else
output.t.xy = input.uv * TextureScale; output.t.xy = input.uv * TextureScale;
#endif
output.t.w = 1.0f; output.t.w = 1.0f;
} }
else else
@ -767,7 +774,13 @@ VS_OUTPUT vs_main(VS_INPUT input)
{ {
if(VS_FST) if(VS_FST)
{ {
#if VS_WILDHACK == 1
output.t.xy = (input.t & 0x3FEF) * TextureScale;
#elif VS_WILDHACK == 2
output.t.xy = (input.t & 0x3FF7) * TextureScale;
#else
output.t.xy = input.t * TextureScale; output.t.xy = input.t * TextureScale;
#endif
output.t.w = 1.0f; output.t.w = 1.0f;
} }
else else

View File

@ -88,6 +88,7 @@
#define IDC_CONTRAST_TEXT 2063 #define IDC_CONTRAST_TEXT 2063
#define IDC_MSAACB 2070 #define IDC_MSAACB 2070
#define IDC_HACKSBUTTON 2071 #define IDC_HACKSBUTTON 2071
#define IDC_WILDHACK 2072
#define IDC_COLORSPACE 3000 #define IDC_COLORSPACE 3000
#define IDR_CONVERT_FX 10000 #define IDR_CONVERT_FX 10000
#define IDR_TFX_FX 10001 #define IDR_TFX_FX 10001
@ -106,7 +107,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 10012 #define _APS_NEXT_RESOURCE_VALUE 10012
#define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 2072 #define _APS_NEXT_CONTROL_VALUE 2073
#define _APS_NEXT_SYMED_VALUE 5000 #define _APS_NEXT_SYMED_VALUE 5000
#endif #endif
#endif #endif