GSdx: Add Windows UI options for HW hacks

Add UI options for Auto Flush and Unscale Point Line HW hacks.
This commit is contained in:
FlatOutPS2 2016-09-15 12:48:12 +02:00
parent 1a1d6ab478
commit 5420fcaf3a
5 changed files with 32 additions and 18 deletions

View File

@ -121,6 +121,12 @@ const char* dialog_message(int ID, bool* updateText) {
return "Enables external shader for additional post-processing effects."; return "Enables external shader for additional post-processing effects.";
case IDC_FXAA: case IDC_FXAA:
return "Enables fast approximate anti-aliasing. Small performance impact."; return "Enables fast approximate anti-aliasing. Small performance impact.";
case IDC_AUTO_FLUSH:
return "Force a primitive flush when a framebuffer is also an input texture. Fixes some processing effects such as the shadows in the Jak series and radiosity in GTA:SA.\n"
"Warning: it's very costly on the performance.\n\n"
"Note: OpenGL HW renderer is able to handle Jak shadows at full speed without this option.";
case IDC_UNSCALE_POINT_LINE:
return "Increases the width of lines at higher than native resolutions. This ensures that the lines will keep the correct proportions and prevents aliasing. Avoids empty lines on the screen in games such as Ridge Racer V, and clears FMV's obscured by a grid like Silent Hill series and Dirge of Cerberus.";
#ifdef _WIN32 #ifdef _WIN32
// DX9 only // DX9 only
case IDC_FBA: case IDC_FBA:
@ -131,9 +137,6 @@ const char* dialog_message(int ID, bool* updateText) {
#ifdef __linux__ #ifdef __linux__
case IDC_LINEAR_PRESENT: case IDC_LINEAR_PRESENT:
return "Use bilinear filtering when Upscaling/Downscaling the image to the screen. Disable it if you want a sharper/pixelated output."; return "Use bilinear filtering when Upscaling/Downscaling the image to the screen. Disable it if you want a sharper/pixelated output.";
case IDC_AUTO_FLUSH:
return "Force a primitive flush when framebuffer is also an input texture. Warning: it is very costly on the performances. Help to fix some processing effects such as Jak shadows, GTA radiosity..."
"Note: openGL HW renderer is able to handle Jak shadows at full speed without this option.";
#endif #endif
// Exclusive for Hardware Renderer // Exclusive for Hardware Renderer
case IDC_PRELOAD_GS: case IDC_PRELOAD_GS:

View File

@ -77,5 +77,6 @@ enum {
IDC_LARGE_FB, IDC_LARGE_FB,
IDC_LINEAR_PRESENT, IDC_LINEAR_PRESENT,
IDC_AUTO_FLUSH, IDC_AUTO_FLUSH,
IDC_UNSCALE_POINT_LINE,
}; };
#endif #endif

View File

@ -388,7 +388,6 @@ void GSSettingsDlg::UpdateControls()
ShowWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_DATE), ogl ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_DATE), ogl ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT), ogl ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT), ogl ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT_TEXT), ogl ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT_TEXT), ogl ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(m_hWnd, IDC_TC_DEPTH), ogl ? SW_SHOW : SW_HIDE);
EnableWindow(GetDlgItem(m_hWnd, IDC_CRC_LEVEL), hw); EnableWindow(GetDlgItem(m_hWnd, IDC_CRC_LEVEL), hw);
EnableWindow(GetDlgItem(m_hWnd, IDC_LARGE_FB), integer_scaling != 1 && hw); EnableWindow(GetDlgItem(m_hWnd, IDC_LARGE_FB), integer_scaling != 1 && hw);
@ -671,6 +670,8 @@ void GSHacksDlg::OnInit()
CheckDlgButton(m_hWnd, IDC_SAFE_FBMASK, theApp.GetConfigB("UserHacks_safe_fbmask")); CheckDlgButton(m_hWnd, IDC_SAFE_FBMASK, theApp.GetConfigB("UserHacks_safe_fbmask"));
CheckDlgButton(m_hWnd, IDC_TC_DEPTH, theApp.GetConfigB("UserHacks_DisableDepthSupport")); CheckDlgButton(m_hWnd, IDC_TC_DEPTH, theApp.GetConfigB("UserHacks_DisableDepthSupport"));
CheckDlgButton(m_hWnd, IDC_FAST_TC_INV, theApp.GetConfigB("UserHacks_DisablePartialInvalidation")); CheckDlgButton(m_hWnd, IDC_FAST_TC_INV, theApp.GetConfigB("UserHacks_DisablePartialInvalidation"));
CheckDlgButton(m_hWnd, IDC_AUTO_FLUSH, theApp.GetConfigB("UserHacks_AutoFlush"));
CheckDlgButton(m_hWnd, IDC_UNSCALE_POINT_LINE, theApp.GetConfigB("UserHacks_unscale_point_line"));
ComboBoxInit(IDC_ROUND_SPRITE, theApp.m_gs_hack, theApp.GetConfigI("UserHacks_round_sprite_offset")); ComboBoxInit(IDC_ROUND_SPRITE, theApp.m_gs_hack, theApp.GetConfigI("UserHacks_round_sprite_offset"));
ComboBoxInit(IDC_SPRITEHACK, theApp.m_gs_hack, theApp.GetConfigI("UserHacks_SpriteHack")); ComboBoxInit(IDC_SPRITEHACK, theApp.m_gs_hack, theApp.GetConfigI("UserHacks_SpriteHack"));
@ -688,6 +689,7 @@ void GSHacksDlg::OnInit()
ShowWindow(GetDlgItem(m_hWnd, IDC_ALPHAHACK), ogl ? SW_HIDE : SW_SHOW); ShowWindow(GetDlgItem(m_hWnd, IDC_ALPHAHACK), ogl ? SW_HIDE : SW_SHOW);
ShowWindow(GetDlgItem(m_hWnd, IDC_SAFE_FBMASK), ogl ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(m_hWnd, IDC_SAFE_FBMASK), ogl ? SW_SHOW : SW_HIDE);
EnableWindow(GetDlgItem(m_hWnd, IDC_TC_DEPTH), ogl); EnableWindow(GetDlgItem(m_hWnd, IDC_TC_DEPTH), ogl);
EnableWindow(GetDlgItem(m_hWnd, IDC_UNSCALE_POINT_LINE), ogl && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_MSAACB), !ogl); EnableWindow(GetDlgItem(m_hWnd, IDC_MSAACB), !ogl);
EnableWindow(GetDlgItem(m_hWnd, IDC_MSAA_TEXT), !ogl); EnableWindow(GetDlgItem(m_hWnd, IDC_MSAA_TEXT), !ogl);
EnableWindow(GetDlgItem(m_hWnd, IDC_SPRITEHACK), !native); EnableWindow(GetDlgItem(m_hWnd, IDC_SPRITEHACK), !native);
@ -716,6 +718,8 @@ void GSHacksDlg::OnInit()
AddTooltip(IDC_SAFE_FBMASK); AddTooltip(IDC_SAFE_FBMASK);
AddTooltip(IDC_TC_DEPTH); AddTooltip(IDC_TC_DEPTH);
AddTooltip(IDC_FAST_TC_INV); AddTooltip(IDC_FAST_TC_INV);
AddTooltip(IDC_AUTO_FLUSH);
AddTooltip(IDC_UNSCALE_POINT_LINE);
} }
void GSHacksDlg::UpdateControls() void GSHacksDlg::UpdateControls()
@ -753,6 +757,8 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
theApp.SetConfig("UserHacks_safe_fbmask", (int)IsDlgButtonChecked(m_hWnd, IDC_SAFE_FBMASK)); theApp.SetConfig("UserHacks_safe_fbmask", (int)IsDlgButtonChecked(m_hWnd, IDC_SAFE_FBMASK));
theApp.SetConfig("UserHacks_DisableDepthSupport", (int)IsDlgButtonChecked(m_hWnd, IDC_TC_DEPTH)); theApp.SetConfig("UserHacks_DisableDepthSupport", (int)IsDlgButtonChecked(m_hWnd, IDC_TC_DEPTH));
theApp.SetConfig("UserHacks_DisablePartialInvalidation", (int)IsDlgButtonChecked(m_hWnd, IDC_FAST_TC_INV)); theApp.SetConfig("UserHacks_DisablePartialInvalidation", (int)IsDlgButtonChecked(m_hWnd, IDC_FAST_TC_INV));
theApp.SetConfig("UserHacks_AutoFlush", (int)IsDlgButtonChecked(m_hWnd, IDC_AUTO_FLUSH));
theApp.SetConfig("UserHacks_unscale_point_line", (int)IsDlgButtonChecked(m_hWnd, IDC_UNSCALE_POINT_LINE));
unsigned int TCOFFSET = SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_GETPOS, 0, 0) & 0xFFFF; unsigned int TCOFFSET = SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_GETPOS, 0, 0) & 0xFFFF;
TCOFFSET |= (SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_GETPOS, 0, 0) & 0xFFFF) << 16; TCOFFSET |= (SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_GETPOS, 0, 0) & 0xFFFF) << 16;

View File

@ -110,13 +110,13 @@ IDB_PSX_NULL BITMAP "res\\psx-logo-null.bmp"
// Dialog // Dialog
// //
IDD_HACKS DIALOGEX 0, 0, 161, 222 IDD_HACKS DIALOGEX 0, 0, 161, 235
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,89,201,57,14 DEFPUSHBUTTON "OK",IDOK,89,214,57,14
GROUPBOX "USE AT YOUR OWN RISK!",IDC_STATIC,7,7,147,193,0,WS_EX_TRANSPARENT GROUPBOX "USE AT YOUR OWN RISK!",IDC_STATIC,7,7,147,206,0,WS_EX_TRANSPARENT
CONTROL "Preload Frame Data",IDC_PRELOAD_GS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,115,80,8 CONTROL "Preload Frame Data",IDC_PRELOAD_GS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,115,80,8
RTEXT "MSAA:",IDC_MSAA_TEXT,62,20,22,8 RTEXT "MSAA:",IDC_MSAA_TEXT,62,20,22,8
RTEXT "Skipdraw:",IDC_STATIC,52,36,32,8 RTEXT "Skipdraw:",IDC_STATIC,52,36,32,8
@ -130,17 +130,19 @@ BEGIN
CONTROL "Alpha Stencil",IDC_ALPHASTENCIL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,77,57,8 CONTROL "Alpha Stencil",IDC_ALPHASTENCIL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,77,57,8
CONTROL "Align Sprite",IDC_ALIGN_SPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,88,51,58,8 CONTROL "Align Sprite",IDC_ALIGN_SPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,88,51,58,8
CONTROL "Disable Depth Emulation",IDC_TC_DEPTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,90,92,8 CONTROL "Disable Depth Emulation",IDC_TC_DEPTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,90,92,8
RTEXT "TC Offset X:",IDC_STATIC,40,166,44,8 RTEXT "TC Offset X:",IDC_STATIC,40,179,44,8
EDITTEXT IDC_TCOFFSETX2,88,163,58,14,ES_RIGHT | ES_AUTOHSCROLL EDITTEXT IDC_TCOFFSETX2,88,176,58,14,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "",IDC_TCOFFSETX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,161,11,14 CONTROL "",IDC_TCOFFSETX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,174,11,14
EDITTEXT IDC_TCOFFSETY2,88,181,58,14,ES_RIGHT | ES_AUTOHSCROLL EDITTEXT IDC_TCOFFSETY2,88,194,58,14,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "",IDC_TCOFFSETY,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,179,11,14 CONTROL "",IDC_TCOFFSETY,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,192,11,14
COMBOBOX IDC_ROUND_SPRITE,88,128,58,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_ROUND_SPRITE,88,141,58,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
RTEXT "Round Sprite:",IDC_ROUND_SPRITE_TEXT,39,131,45,8 RTEXT "Round Sprite:",IDC_ROUND_SPRITE_TEXT,39,144,45,8
RTEXT "Sprite:",IDC_SPRITEHACK_TEXT,62,147,22,8 RTEXT "Sprite:",IDC_SPRITEHACK_TEXT,62,160,22,8
COMBOBOX IDC_SPRITEHACK,88,145,58,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_SPRITEHACK,88,158,58,63,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Fast Texture Invalidation",IDC_FAST_TC_INV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,102,92,8 CONTROL "Fast Texture Invalidation",IDC_FAST_TC_INV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,102,92,8
RTEXT "TC Offset Y:",IDC_STATIC,40,184,44,8 CONTROL "Auto Flush", IDC_AUTO_FLUSH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,88,128,45,8
CONTROL "Unscale Point Line", IDC_UNSCALE_POINT_LINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,128,70,8
RTEXT "TC Offset Y:",IDC_STATIC,40,197,44,8
END END
IDD_SHADER DIALOGEX 0, 0, 248, 250 IDD_SHADER DIALOGEX 0, 0, 248, 250
@ -290,7 +292,7 @@ BEGIN
VERTGUIDE, 88 VERTGUIDE, 88
VERTGUIDE, 146 VERTGUIDE, 146
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 216 BOTTOMMARGIN, 229
HORZGUIDE, 51 HORZGUIDE, 51
HORZGUIDE, 64 HORZGUIDE, 64
HORZGUIDE, 77 HORZGUIDE, 77

View File

@ -104,6 +104,8 @@
#define IDC_SAFE_FBMASK 2100 #define IDC_SAFE_FBMASK 2100
#define IDC_FAST_TC_INV 2101 #define IDC_FAST_TC_INV 2101
#define IDC_LARGE_FB 2102 #define IDC_LARGE_FB 2102
#define IDC_AUTO_FLUSH 2103
#define IDC_UNSCALE_POINT_LINE 2104
#define IDR_CONVERT_FX 10000 #define IDR_CONVERT_FX 10000
#define IDR_TFX_FX 10001 #define IDR_TFX_FX 10001
#define IDR_MERGE_FX 10002 #define IDR_MERGE_FX 10002