2010-04-25 00:31:27 +00:00
|
|
|
/*
|
2009-02-09 21:15:56 +00:00
|
|
|
* Copyright (C) 2007-2009 Gabest
|
|
|
|
* http://www.gabest.org
|
|
|
|
*
|
|
|
|
* This Program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-02-09 21:15:56 +00:00
|
|
|
* This Program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-02-09 21:15:56 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNU Make; see the file COPYING. If not, write to
|
2012-09-09 18:16:11 +00:00
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
|
2009-02-09 21:15:56 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "GSdx.h"
|
|
|
|
#include "GSSettingsDlg.h"
|
|
|
|
#include "GSUtil.h"
|
2011-01-02 10:24:36 +00:00
|
|
|
#include "GSDevice9.h"
|
2011-02-19 03:36:30 +00:00
|
|
|
#include "GSDevice11.h"
|
|
|
|
#include "resource.h"
|
2009-10-23 14:32:01 +00:00
|
|
|
|
2011-02-20 16:09:46 +00:00
|
|
|
GSSettingsDlg::GSSettingsDlg(bool isOpen2)
|
2010-01-28 02:53:10 +00:00
|
|
|
: GSDialog(isOpen2 ? IDD_CONFIG2 : IDD_CONFIG)
|
|
|
|
, m_IsOpen2(isOpen2)
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2014-12-22 18:02:35 +00:00
|
|
|
#ifdef ENABLE_OPENCL
|
2014-09-22 07:15:25 +00:00
|
|
|
list<OCLDeviceDesc> ocldevs;
|
2014-09-22 03:29:40 +00:00
|
|
|
|
2014-09-22 07:15:25 +00:00
|
|
|
GSUtil::GetDeviceDescs(ocldevs);
|
2014-09-22 03:29:40 +00:00
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
for(auto dev : ocldevs)
|
|
|
|
{
|
|
|
|
m_ocl_devs.push_back(GSSetting(index++, dev.name.c_str(), ""));
|
|
|
|
}
|
2014-12-22 18:02:35 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
}
|
2011-02-20 16:09:46 +00:00
|
|
|
|
2009-06-03 12:09:04 +00:00
|
|
|
void GSSettingsDlg::OnInit()
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2009-06-03 12:09:04 +00:00
|
|
|
__super::OnInit();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-05-11 08:18:00 +00:00
|
|
|
m_modes.clear();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
CComPtr<IDirect3D9> d3d9;
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
d3d9.Attach(Direct3DCreate9(D3D_SDK_VERSION));
|
|
|
|
|
|
|
|
CComPtr<IDXGIFactory1> dxgi_factory;
|
2014-09-22 00:50:51 +00:00
|
|
|
|
|
|
|
if(GSUtil::CheckDXGI())
|
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)&dxgi_factory);
|
2014-09-22 00:50:51 +00:00
|
|
|
}
|
2012-08-06 05:26:44 +00:00
|
|
|
|
2010-01-28 02:53:10 +00:00
|
|
|
if(!m_IsOpen2)
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
|
|
|
D3DDISPLAYMODE mode;
|
|
|
|
memset(&mode, 0, sizeof(mode));
|
2009-05-11 08:18:00 +00:00
|
|
|
m_modes.push_back(mode);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-07-17 23:45:32 +00:00
|
|
|
ComboBoxAppend(IDC_RESOLUTION, "Please select...", (LPARAM)&m_modes.back(), true);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(d3d9)
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2009-06-03 12:09:04 +00:00
|
|
|
uint32 w = theApp.GetConfig("ModeWidth", 0);
|
|
|
|
uint32 h = theApp.GetConfig("ModeHeight", 0);
|
|
|
|
uint32 hz = theApp.GetConfig("ModeRefreshRate", 0);
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
uint32 n = d3d9->GetAdapterModeCount(D3DADAPTER_DEFAULT, D3DFMT_R5G6B5);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-06-03 12:09:04 +00:00
|
|
|
for(uint32 i = 0; i < n; i++)
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
if(S_OK == d3d9->EnumAdapterModes(D3DADAPTER_DEFAULT, D3DFMT_R5G6B5, i, &mode))
|
2009-06-03 12:09:04 +00:00
|
|
|
{
|
|
|
|
m_modes.push_back(mode);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-06-03 12:09:04 +00:00
|
|
|
string str = format("%dx%d %dHz", mode.Width, mode.Height, mode.RefreshRate);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-06-19 00:11:56 +00:00
|
|
|
ComboBoxAppend(IDC_RESOLUTION, str.c_str(), (LPARAM)&m_modes.back(), w == mode.Width && h == mode.Height && hz == mode.RefreshRate);
|
2009-02-09 21:15:56 +00:00
|
|
|
}
|
|
|
|
}
|
2009-06-03 12:09:04 +00:00
|
|
|
}
|
2009-02-09 21:15:56 +00:00
|
|
|
}
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
adapters.clear();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
adapters.push_back(Adapter("Default Hardware Device", "default", GSUtil::CheckDirect3D11Level(NULL, D3D_DRIVER_TYPE_HARDWARE)));
|
|
|
|
adapters.push_back(Adapter("Reference Device", "ref", GSUtil::CheckDirect3D11Level(NULL, D3D_DRIVER_TYPE_REFERENCE)));
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2014-09-22 00:50:51 +00:00
|
|
|
if(dxgi_factory)
|
2009-06-04 08:32:31 +00:00
|
|
|
{
|
2014-09-22 00:50:51 +00:00
|
|
|
for(int i = 0;; i++)
|
2010-06-23 05:32:50 +00:00
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
CComPtr<IDXGIAdapter1> adapter;
|
2014-09-22 00:50:51 +00:00
|
|
|
|
|
|
|
if(S_OK != dxgi_factory->EnumAdapters1(i, &adapter))
|
2012-08-06 05:26:44 +00:00
|
|
|
break;
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
DXGI_ADAPTER_DESC1 desc;
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
HRESULT hr = adapter->GetDesc1(&desc);
|
2014-09-22 00:50:51 +00:00
|
|
|
|
|
|
|
if(S_OK == hr)
|
2012-08-06 05:26:44 +00:00
|
|
|
{
|
|
|
|
D3D_FEATURE_LEVEL level = GSUtil::CheckDirect3D11Level(adapter, D3D_DRIVER_TYPE_UNKNOWN);
|
2014-09-22 00:50:51 +00:00
|
|
|
// GSDX isn't unicode!?
|
2012-08-06 05:26:44 +00:00
|
|
|
#if 1
|
2014-09-22 00:50:51 +00:00
|
|
|
int size = WideCharToMultiByte(CP_ACP, 0, desc.Description, sizeof(desc.Description), NULL, 0, NULL, NULL);
|
2012-08-06 05:26:44 +00:00
|
|
|
char *buf = new char[size];
|
2014-09-22 00:50:51 +00:00
|
|
|
WideCharToMultiByte(CP_ACP, 0, desc.Description, sizeof(desc.Description), buf, size, NULL, NULL);
|
2012-08-06 05:26:44 +00:00
|
|
|
adapters.push_back(Adapter(buf, GSAdapter(desc), level));
|
2014-09-22 00:50:51 +00:00
|
|
|
delete[] buf;
|
2012-08-06 05:26:44 +00:00
|
|
|
#else
|
|
|
|
adapters.push_back(Adapter(desc.Description, GSAdapter(desc), level));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-09-22 00:50:51 +00:00
|
|
|
else if(d3d9)
|
2012-08-06 05:26:44 +00:00
|
|
|
{
|
|
|
|
int n = d3d9->GetAdapterCount();
|
2014-09-22 00:50:51 +00:00
|
|
|
for(int i = 0; i < n; i++)
|
2012-08-06 05:26:44 +00:00
|
|
|
{
|
|
|
|
D3DADAPTER_IDENTIFIER9 desc;
|
2014-09-22 00:50:51 +00:00
|
|
|
|
|
|
|
if(D3D_OK != d3d9->GetAdapterIdentifier(i, 0, &desc))
|
2012-08-06 05:26:44 +00:00
|
|
|
break;
|
2014-09-22 00:50:51 +00:00
|
|
|
|
|
|
|
// GSDX isn't unicode!?
|
2012-08-06 05:26:44 +00:00
|
|
|
#if 0
|
|
|
|
wchar_t buf[sizeof desc.Description * sizeof(WCHAR)];
|
2014-09-22 00:50:51 +00:00
|
|
|
MultiByteToWideChar(CP_ACP /* I have no idea if this is right */, 0, desc.Description, sizeof(desc.Description), buf, sizeof buf / sizeof *buf);
|
2012-08-06 05:26:44 +00:00
|
|
|
adapters.push_back(Adapter(buf, GSAdapter(desc), (D3D_FEATURE_LEVEL)0));
|
|
|
|
#else
|
|
|
|
adapters.push_back(Adapter(desc.Description, GSAdapter(desc), (D3D_FEATURE_LEVEL)0));
|
|
|
|
#endif
|
2010-06-23 05:32:50 +00:00
|
|
|
}
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
std::string adapter_setting = theApp.GetConfig("Adapter", "default");
|
|
|
|
vector<GSSetting> adapter_settings;
|
2014-09-22 00:50:51 +00:00
|
|
|
unsigned int adapter_sel = 0;
|
2012-08-06 05:26:44 +00:00
|
|
|
|
2014-09-22 00:50:51 +00:00
|
|
|
for(unsigned int i = 0; i < adapters.size(); i++)
|
2012-08-06 05:26:44 +00:00
|
|
|
{
|
2014-09-22 00:50:51 +00:00
|
|
|
if(adapters[i].id == adapter_setting)
|
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
adapter_sel = i;
|
2014-09-22 00:50:51 +00:00
|
|
|
}
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
adapter_settings.push_back(GSSetting(i, adapters[i].name.c_str(), ""));
|
2009-06-03 12:09:04 +00:00
|
|
|
}
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2014-09-22 00:50:51 +00:00
|
|
|
std::string ocldev = theApp.GetConfig("ocldev", "");
|
|
|
|
|
|
|
|
unsigned int ocl_sel = 0;
|
|
|
|
|
2014-09-22 03:29:40 +00:00
|
|
|
for(unsigned int i = 0; i < m_ocl_devs.size(); i++)
|
2014-09-22 00:50:51 +00:00
|
|
|
{
|
2014-09-22 03:29:40 +00:00
|
|
|
if(ocldev == m_ocl_devs[i].name)
|
2014-09-22 00:50:51 +00:00
|
|
|
{
|
|
|
|
ocl_sel = i;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
ComboBoxInit(IDC_ADAPTER, adapter_settings, adapter_sel);
|
2014-09-22 03:29:40 +00:00
|
|
|
ComboBoxInit(IDC_OPENCL_DEVICE, m_ocl_devs, ocl_sel);
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
UpdateRenderers();
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2012-04-25 08:46:51 +00:00
|
|
|
ComboBoxInit(IDC_INTERLACE, theApp.m_gs_interlace, theApp.GetConfig("Interlace", 7)); // 7 = "auto", detects interlace based on SMODE2 register
|
2011-02-19 03:36:30 +00:00
|
|
|
ComboBoxInit(IDC_ASPECTRATIO, theApp.m_gs_aspectratio, theApp.GetConfig("AspectRatio", 1));
|
|
|
|
ComboBoxInit(IDC_UPSCALE_MULTIPLIER, theApp.m_gs_upscale_multiplier, theApp.GetConfig("upscale_multiplier", 1));
|
2014-02-03 16:58:11 +00:00
|
|
|
ComboBoxInit(IDC_AFCOMBO, theApp.m_gs_max_anisotropy, theApp.GetConfig("MaxAnisotropy", 0));
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-07-17 23:45:32 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_WINDOWED, theApp.GetConfig("windowed", 1));
|
2009-07-08 16:15:33 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_FILTER, theApp.GetConfig("filter", 2));
|
2009-10-26 15:52:45 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_PALTEX, theApp.GetConfig("paltex", 0));
|
2009-07-08 16:15:33 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_LOGZ, theApp.GetConfig("logz", 1));
|
2009-06-03 12:09:04 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_FBA, theApp.GetConfig("fba", 1));
|
|
|
|
CheckDlgButton(m_hWnd, IDC_AA1, theApp.GetConfig("aa1", 0));
|
2012-06-06 10:08:08 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_NATIVERES, theApp.GetConfig("nativeres", 1));
|
2014-02-03 16:58:11 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_ANISOTROPIC, theApp.GetConfig("AnisotropicFiltering", 0));
|
2012-02-29 00:29:29 +00:00
|
|
|
|
|
|
|
// Shade Boost
|
|
|
|
CheckDlgButton(m_hWnd, IDC_SHADEBOOST, theApp.GetConfig("ShadeBoost", 0));
|
2013-12-28 21:36:29 +00:00
|
|
|
|
|
|
|
// FXAA shader
|
|
|
|
CheckDlgButton(m_hWnd, IDC_FXAA, theApp.GetConfig("Fxaa", 0));
|
2014-01-17 10:17:24 +00:00
|
|
|
|
|
|
|
// External FX shader
|
|
|
|
CheckDlgButton(m_hWnd, IDC_SHADER_FX, theApp.GetConfig("shaderfx", 0));
|
2012-03-06 19:39:05 +00:00
|
|
|
|
|
|
|
// Hacks
|
|
|
|
CheckDlgButton(m_hWnd, IDC_HACKS_ENABLED, theApp.GetConfig("UserHacks", 0));
|
|
|
|
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2009-10-24 18:39:36 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_RESX), UDM_SETRANGE, 0, MAKELPARAM(8192, 256));
|
2009-06-03 12:09:04 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_RESX), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("resx", 1024), 0));
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-10-24 18:39:36 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_RESY), UDM_SETRANGE, 0, MAKELPARAM(8192, 256));
|
2009-06-03 12:09:04 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_RESY), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("resy", 1024), 0));
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2010-02-19 15:45:23 +00:00
|
|
|
|
2011-12-20 14:33:28 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_SETRANGE, 0, MAKELPARAM(16, 0));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("extrathreads", 0), 0));
|
2009-06-04 08:32:31 +00:00
|
|
|
|
|
|
|
UpdateControls();
|
2009-02-09 21:15:56 +00:00
|
|
|
}
|
|
|
|
|
2009-06-03 12:09:04 +00:00
|
|
|
bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
switch (id)
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
case IDC_ADAPTER:
|
|
|
|
if (code == CBN_SELCHANGE)
|
|
|
|
{
|
|
|
|
UpdateRenderers();
|
|
|
|
UpdateControls();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IDC_RENDERER:
|
|
|
|
case IDC_UPSCALE_MULTIPLIER:
|
|
|
|
if (code == CBN_SELCHANGE)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
|
|
|
case IDC_NATIVERES:
|
|
|
|
case IDC_SHADEBOOST:
|
2014-02-03 16:58:11 +00:00
|
|
|
case IDC_FILTER:
|
|
|
|
if (code == BN_CLICKED)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
|
|
|
case IDC_ANISOTROPIC:
|
|
|
|
if (code == BN_CLICKED)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
2012-08-06 05:26:44 +00:00
|
|
|
case IDC_HACKS_ENABLED:
|
|
|
|
if (code == BN_CLICKED)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
|
|
|
case IDC_SHADEBUTTON:
|
|
|
|
if (code == BN_CLICKED)
|
|
|
|
ShadeBoostDlg.DoModal();
|
|
|
|
break;
|
|
|
|
case IDC_HACKSBUTTON:
|
|
|
|
if (code == BN_CLICKED)
|
|
|
|
HacksDlg.DoModal();
|
|
|
|
break;
|
|
|
|
case IDOK:
|
2009-06-03 12:09:04 +00:00
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
INT_PTR data;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_ADAPTER, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("Adapter", adapters[(int)data].id.c_str());
|
|
|
|
}
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2014-09-22 00:50:51 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_OPENCL_DEVICE, data))
|
|
|
|
{
|
2015-01-16 08:38:23 +00:00
|
|
|
if ((int)data < m_ocl_devs.size()) {
|
|
|
|
theApp.SetConfig("ocldev", m_ocl_devs[(int)data].name.c_str());
|
|
|
|
}
|
2014-09-22 00:50:51 +00:00
|
|
|
}
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(!m_IsOpen2 && ComboBoxGetSelData(IDC_RESOLUTION, data))
|
|
|
|
{
|
|
|
|
const D3DDISPLAYMODE* mode = (D3DDISPLAYMODE*)data;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
theApp.SetConfig("ModeWidth", (int)mode->Width);
|
|
|
|
theApp.SetConfig("ModeHeight", (int)mode->Height);
|
|
|
|
theApp.SetConfig("ModeRefreshRate", (int)mode->RefreshRate);
|
|
|
|
}
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_RENDERER, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("Renderer", (int)data);
|
|
|
|
}
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_INTERLACE, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("Interlace", (int)data);
|
|
|
|
}
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_ASPECTRATIO, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("AspectRatio", (int)data);
|
|
|
|
}
|
2011-12-16 19:13:58 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_UPSCALE_MULTIPLIER, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("upscale_multiplier", (int)data);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
theApp.SetConfig("upscale_multiplier", 1);
|
|
|
|
}
|
2012-02-29 00:29:29 +00:00
|
|
|
|
2014-09-22 00:50:51 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_AFCOMBO, data))
|
2014-02-03 16:58:11 +00:00
|
|
|
{
|
|
|
|
theApp.SetConfig("MaxAnisotropy", (int)data);
|
|
|
|
}
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(GetId() == IDD_CONFIG) // TODO: other options may not be present in IDD_CONFIG2 as well
|
|
|
|
{
|
|
|
|
theApp.SetConfig("windowed", (int)IsDlgButtonChecked(m_hWnd, IDC_WINDOWED));
|
|
|
|
}
|
2012-03-06 19:39:05 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
theApp.SetConfig("filter", (int)IsDlgButtonChecked(m_hWnd, IDC_FILTER));
|
|
|
|
theApp.SetConfig("paltex", (int)IsDlgButtonChecked(m_hWnd, IDC_PALTEX));
|
|
|
|
theApp.SetConfig("logz", (int)IsDlgButtonChecked(m_hWnd, IDC_LOGZ));
|
|
|
|
theApp.SetConfig("fba", (int)IsDlgButtonChecked(m_hWnd, IDC_FBA));
|
|
|
|
theApp.SetConfig("aa1", (int)IsDlgButtonChecked(m_hWnd, IDC_AA1));
|
|
|
|
theApp.SetConfig("nativeres", (int)IsDlgButtonChecked(m_hWnd, IDC_NATIVERES));
|
|
|
|
theApp.SetConfig("resx", (int)SendMessage(GetDlgItem(m_hWnd, IDC_RESX), UDM_GETPOS, 0, 0));
|
|
|
|
theApp.SetConfig("resy", (int)SendMessage(GetDlgItem(m_hWnd, IDC_RESY), UDM_GETPOS, 0, 0));
|
|
|
|
theApp.SetConfig("extrathreads", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_GETPOS, 0, 0));
|
2014-02-03 16:58:11 +00:00
|
|
|
theApp.SetConfig("AnisotropicFiltering", (int)IsDlgButtonChecked(m_hWnd, IDC_ANISOTROPIC));
|
2012-08-06 05:26:44 +00:00
|
|
|
|
|
|
|
// Shade Boost
|
|
|
|
theApp.SetConfig("ShadeBoost", (int)IsDlgButtonChecked(m_hWnd, IDC_SHADEBOOST));
|
|
|
|
|
2013-12-28 21:36:29 +00:00
|
|
|
// FXAA shader
|
|
|
|
theApp.SetConfig("Fxaa", (int)IsDlgButtonChecked(m_hWnd, IDC_FXAA));
|
|
|
|
|
2014-01-17 10:17:24 +00:00
|
|
|
// External FX Shader
|
|
|
|
theApp.SetConfig("shaderfx", (int)IsDlgButtonChecked(m_hWnd, IDC_SHADER_FX));
|
2014-11-11 00:17:21 +00:00
|
|
|
|
|
|
|
// External FX Shader(OpenGL)
|
2014-11-15 21:33:23 +00:00
|
|
|
theApp.SetConfig("shaderfx_conf", "shaders/GSdx_FX_Settings.ini");
|
|
|
|
theApp.SetConfig("shaderfx_glsl", "shaders/GSdx.fx");
|
2014-01-17 10:17:24 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
theApp.SetConfig("UserHacks", (int)IsDlgButtonChecked(m_hWnd, IDC_HACKS_ENABLED));
|
|
|
|
}
|
|
|
|
break;
|
2009-06-03 12:09:04 +00:00
|
|
|
}
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-06-03 12:09:04 +00:00
|
|
|
return __super::OnCommand(hWnd, id, code);
|
2009-02-09 21:15:56 +00:00
|
|
|
}
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
void GSSettingsDlg::UpdateRenderers()
|
|
|
|
{
|
|
|
|
INT_PTR i;
|
|
|
|
|
|
|
|
if (!ComboBoxGetSelData(IDC_ADAPTER, i))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Ugggh
|
|
|
|
HacksDlg.SetAdapter(adapters[(int)i].id);
|
|
|
|
|
|
|
|
D3D_FEATURE_LEVEL level = adapters[(int)i].level;
|
|
|
|
|
|
|
|
vector<GSSetting> renderers;
|
|
|
|
|
|
|
|
unsigned renderer_setting = theApp.GetConfig("Renderer", 0);
|
|
|
|
unsigned renderer_sel = 0;
|
|
|
|
|
|
|
|
for(size_t i = 0; i < theApp.m_gs_renderers.size(); i++)
|
|
|
|
{
|
|
|
|
GSSetting r = theApp.m_gs_renderers[i];
|
|
|
|
|
2014-09-15 13:49:16 +00:00
|
|
|
if(r.id >= 3 && r.id <= 5 || r.id == 15)
|
2012-08-06 05:26:44 +00:00
|
|
|
{
|
|
|
|
if(level < D3D_FEATURE_LEVEL_10_0) continue;
|
|
|
|
|
2014-09-15 13:49:16 +00:00
|
|
|
r.name += (level >= D3D_FEATURE_LEVEL_11_0 ? "11" : "10");
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
renderers.push_back(r);
|
2014-09-15 13:49:16 +00:00
|
|
|
|
|
|
|
if(r.id == renderer_setting)
|
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
renderer_sel = renderer_setting;
|
2014-09-15 13:49:16 +00:00
|
|
|
}
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ComboBoxInit(IDC_RENDERER, renderers, renderer_sel);
|
|
|
|
}
|
|
|
|
|
2009-06-04 08:32:31 +00:00
|
|
|
void GSSettingsDlg::UpdateControls()
|
|
|
|
{
|
|
|
|
INT_PTR i;
|
|
|
|
|
2011-02-12 21:45:16 +00:00
|
|
|
int scaling = 1; // in case reading the combo doesn't work, enable the custom res control anyway
|
|
|
|
|
|
|
|
if(ComboBoxGetSelData(IDC_UPSCALE_MULTIPLIER, i))
|
|
|
|
{
|
|
|
|
scaling = (int)i;
|
2011-01-02 10:24:36 +00:00
|
|
|
}
|
|
|
|
|
2009-06-19 00:11:56 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_RENDERER, i))
|
2009-06-04 08:32:31 +00:00
|
|
|
{
|
2014-09-22 00:50:51 +00:00
|
|
|
bool dx9 = i >= 0 && i <= 2 || i == 14;
|
|
|
|
bool dx11 = i >= 3 && i <= 5 || i == 15;
|
|
|
|
bool ogl = i >= 12 && i <= 13 || i == 17;
|
|
|
|
bool hw = i == 0 || i == 3 || i == 12;
|
|
|
|
//bool sw = i == 1 || i == 4 || i == 10 || i == 13;
|
|
|
|
bool ocl = i >= 14 && i <= 17;
|
|
|
|
|
2009-06-04 08:32:31 +00:00
|
|
|
bool native = !!IsDlgButtonChecked(m_hWnd, IDC_NATIVERES);
|
|
|
|
|
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_LOGO9), dx9 ? SW_SHOW : SW_HIDE);
|
2011-02-22 18:50:51 +00:00
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_LOGO11), dx11 ? SW_SHOW : SW_HIDE);
|
2009-06-04 08:32:31 +00:00
|
|
|
|
2014-09-22 00:50:51 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OPENCL_DEVICE), ocl);
|
2009-07-17 23:45:32 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_WINDOWED), dx9);
|
2011-02-12 21:45:16 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_RESX), hw && !native && scaling == 1);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_RESX_EDIT), hw && !native && scaling == 1);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_RESY), hw && !native && scaling == 1);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_RESY_EDIT), hw && !native && scaling == 1);
|
2009-10-26 15:52:45 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_UPSCALE_MULTIPLIER), hw && !native);
|
2009-06-04 08:32:31 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_NATIVERES), hw);
|
2011-05-09 01:36:57 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw);
|
2009-07-06 16:35:06 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_PALTEX), hw);
|
2012-02-08 16:57:14 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_LOGZ), dx9 && hw);
|
2009-06-04 08:32:31 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_FBA), dx9 && hw);
|
2014-02-04 21:42:43 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ANISOTROPIC), (int)IsDlgButtonChecked(m_hWnd, IDC_FILTER) && hw && !ogl);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_AFCOMBO), (int)IsDlgButtonChecked(m_hWnd, IDC_FILTER) && (int)IsDlgButtonChecked(m_hWnd, IDC_ANISOTROPIC) && hw && !ogl);
|
2012-01-06 09:55:23 +00:00
|
|
|
//EnableWindow(GetDlgItem(m_hWnd, IDC_AA1), sw); // Let uers set software params regardless of renderer used
|
|
|
|
//EnableWindow(GetDlgItem(m_hWnd, IDC_SWTHREADS_EDIT), sw);
|
|
|
|
//EnableWindow(GetDlgItem(m_hWnd, IDC_SWTHREADS), sw);
|
2012-03-06 19:39:05 +00:00
|
|
|
|
2010-02-19 22:01:28 +00:00
|
|
|
|
2012-02-29 00:29:29 +00:00
|
|
|
// Shade Boost
|
2012-03-06 19:39:05 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SHADEBUTTON), IsDlgButtonChecked(m_hWnd, IDC_SHADEBOOST) == BST_CHECKED);
|
2012-02-29 00:29:29 +00:00
|
|
|
|
2012-03-06 19:39:05 +00:00
|
|
|
// Hacks
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_HACKS_ENABLED), hw);
|
2012-03-07 09:31:10 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_HACKSBUTTON), hw /*&& IsDlgButtonChecked(m_hWnd, IDC_HACKS_ENABLED) == BST_CHECKED*/);
|
2009-06-04 08:32:31 +00:00
|
|
|
}
|
2009-06-16 01:42:08 +00:00
|
|
|
}
|
2012-02-29 00:29:29 +00:00
|
|
|
|
2012-03-06 19:39:05 +00:00
|
|
|
// Shade Boost Dialog
|
2012-02-29 00:29:29 +00:00
|
|
|
|
|
|
|
GSShadeBostDlg::GSShadeBostDlg() :
|
2012-03-06 19:39:05 +00:00
|
|
|
GSDialog(IDD_SHADEBOOST)
|
2012-02-29 00:29:29 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
void GSShadeBostDlg::OnInit()
|
|
|
|
{
|
|
|
|
contrast = theApp.GetConfig("ShadeBoost_Contrast", 50);
|
|
|
|
brightness = theApp.GetConfig("ShadeBoost_Brightness", 50);
|
|
|
|
saturation = theApp.GetConfig("ShadeBoost_Saturation", 50);
|
|
|
|
|
|
|
|
UpdateControls();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GSShadeBostDlg::UpdateControls()
|
|
|
|
{
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
|
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER), TBM_SETPOS, TRUE, saturation);
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), TBM_SETPOS, TRUE, brightness);
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), TBM_SETPOS, TRUE, contrast);
|
|
|
|
|
|
|
|
char text[8] = {0};
|
|
|
|
|
|
|
|
sprintf(text, "%d", saturation);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_SATURATION_TEXT, text);
|
|
|
|
sprintf(text, "%d", brightness);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_BRIGHTNESS_TEXT, text);
|
|
|
|
sprintf(text, "%d", contrast);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_CONTRAST_TEXT, text);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GSShadeBostDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
switch(message)
|
|
|
|
{
|
|
|
|
case WM_HSCROLL:
|
|
|
|
{
|
|
|
|
if((HWND)lParam == GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER))
|
|
|
|
{
|
|
|
|
char text[8] = {0};
|
|
|
|
|
|
|
|
saturation = SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER),TBM_GETPOS,0,0);
|
|
|
|
|
|
|
|
sprintf(text, "%d", saturation);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_SATURATION_TEXT, text);
|
|
|
|
}
|
|
|
|
else if((HWND)lParam == GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER))
|
|
|
|
{
|
|
|
|
char text[8] = {0};
|
|
|
|
|
|
|
|
brightness = SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER),TBM_GETPOS,0,0);
|
|
|
|
|
|
|
|
sprintf(text, "%d", brightness);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_BRIGHTNESS_TEXT, text);
|
|
|
|
}
|
|
|
|
else if((HWND)lParam == GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER))
|
|
|
|
{
|
|
|
|
char text[8] = {0};
|
|
|
|
|
|
|
|
contrast = SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER),TBM_GETPOS,0,0);
|
|
|
|
|
|
|
|
sprintf(text, "%d", contrast);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_CONTRAST_TEXT, text);
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case WM_COMMAND:
|
|
|
|
{
|
|
|
|
int id = LOWORD(wParam);
|
|
|
|
|
|
|
|
switch(id)
|
|
|
|
{
|
|
|
|
case IDOK:
|
|
|
|
{
|
|
|
|
theApp.SetConfig("ShadeBoost_Contrast", contrast);
|
|
|
|
theApp.SetConfig("ShadeBoost_Brightness", brightness);
|
|
|
|
theApp.SetConfig("ShadeBoost_Saturation", saturation);
|
|
|
|
EndDialog(m_hWnd, id);
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case IDRESET:
|
|
|
|
{
|
|
|
|
contrast = 50;
|
|
|
|
brightness = 50;
|
|
|
|
saturation = 50;
|
|
|
|
|
|
|
|
UpdateControls();
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case WM_CLOSE:EndDialog(m_hWnd, IDCANCEL); break;
|
|
|
|
|
|
|
|
default: return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
2012-03-06 19:39:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hacks Dialog
|
|
|
|
|
|
|
|
GSHacksDlg::GSHacksDlg() :
|
|
|
|
GSDialog(IDD_HACKS)
|
|
|
|
{
|
|
|
|
memset(msaa2cb, 0, sizeof(msaa2cb));
|
|
|
|
memset(cb2msaa, 0, sizeof(cb2msaa));
|
|
|
|
}
|
|
|
|
|
|
|
|
void GSHacksDlg::OnInit()
|
|
|
|
{
|
|
|
|
bool dx9 = (int)SendMessage(GetDlgItem(GetParent(m_hWnd), IDC_RENDERER), CB_GETCURSEL, 0, 0) / 3 == 0;
|
|
|
|
unsigned short cb = 0;
|
|
|
|
|
|
|
|
if(dx9) for(unsigned short i = 0; i < 17; i++)
|
|
|
|
{
|
|
|
|
if( i == 1) continue;
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
int depth = GSDevice9::GetMaxDepth(i, adapter_id);
|
2012-03-06 19:39:05 +00:00
|
|
|
|
|
|
|
if(depth)
|
|
|
|
{
|
|
|
|
char text[32] = {0};
|
|
|
|
sprintf(text, depth == 32 ? "%dx Z-32" : "%dx Z-24", i);
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_MSAACB), CB_ADDSTRING, 0, (LPARAM)text);
|
|
|
|
|
|
|
|
msaa2cb[i] = cb;
|
|
|
|
cb2msaa[cb] = i;
|
|
|
|
cb++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else for(unsigned short j = 0; j < 5; j++) // TODO: Make the same kind of check for d3d11, eventually....
|
|
|
|
{
|
|
|
|
unsigned short i = j == 0 ? 0 : 1 << j;
|
|
|
|
|
|
|
|
msaa2cb[i] = j;
|
|
|
|
cb2msaa[j] = i;
|
|
|
|
|
|
|
|
char text[32] = {0};
|
2012-03-07 09:58:38 +00:00
|
|
|
sprintf(text, "%dx ", i);
|
2012-03-06 19:39:05 +00:00
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_MSAACB), CB_ADDSTRING, 0, (LPARAM)text);
|
|
|
|
}
|
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_MSAACB), CB_SETCURSEL, msaa2cb[min(theApp.GetConfig("UserHacks_MSAA", 0), 16)], 0);
|
|
|
|
|
|
|
|
CheckDlgButton(m_hWnd, IDC_ALPHAHACK, theApp.GetConfig("UserHacks_AlphaHack", 0));
|
|
|
|
CheckDlgButton(m_hWnd, IDC_OFFSETHACK, theApp.GetConfig("UserHacks_HalfPixelOffset", 0));
|
2012-06-19 01:12:01 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_SPRITEHACK, theApp.GetConfig("UserHacks_SpriteHack", 0));
|
2012-03-06 21:36:59 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfig("UserHacks_WildHack", 0));
|
2012-05-23 06:38:37 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_AGGRESSIVECRC, theApp.GetConfig("UserHacks_AggressiveCRC", 0));
|
2012-07-24 02:20:07 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_ALPHASTENCIL, theApp.GetConfig("UserHacks_AlphaStencil", 0));
|
2014-01-05 23:31:26 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_CHECK_NVIDIA_HACK, theApp.GetConfig("UserHacks_NVIDIAHack", 0));
|
2012-06-13 23:53:08 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS, theApp.GetConfig("UserHacks_DisableCrcHacks", 0));
|
2015-04-05 22:15:53 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_STRETCH_SPRITE, theApp.GetConfig("UserHacks_stretch_sprite", 0));
|
|
|
|
CheckDlgButton(m_hWnd, IDC_ALIGN_SPRITE, theApp.GetConfig("UserHacks_align_sprite_X", 0));
|
2012-03-06 19:39:05 +00:00
|
|
|
|
|
|
|
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));
|
2012-03-07 09:58:38 +00:00
|
|
|
|
2013-02-12 10:57:48 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_TCOffset", 0) & 0xFFFF, 0));
|
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_SETPOS, 0, MAKELPARAM((theApp.GetConfig("UserHacks_TCOffset", 0) >> 16) & 0xFFFF, 0));
|
2012-03-07 09:58:38 +00:00
|
|
|
|
2012-04-23 18:46:09 +00:00
|
|
|
// Hacks descriptions
|
2012-04-24 14:24:58 +00:00
|
|
|
SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), "Hover over an item to get a description.");
|
2012-03-06 19:39:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GSHacksDlg::UpdateControls()
|
|
|
|
{}
|
|
|
|
|
2012-03-07 09:58:38 +00:00
|
|
|
bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
2012-04-23 18:46:09 +00:00
|
|
|
switch(message)
|
2012-03-06 19:39:05 +00:00
|
|
|
{
|
2012-04-23 18:46:09 +00:00
|
|
|
case WM_SETCURSOR:
|
|
|
|
{
|
|
|
|
const char *helpstr = "";
|
2013-02-12 10:57:48 +00:00
|
|
|
bool updateText = true;
|
2012-04-23 18:46:09 +00:00
|
|
|
|
|
|
|
POINT pos;
|
|
|
|
GetCursorPos(&pos);
|
|
|
|
ScreenToClient(m_hWnd, &pos);
|
|
|
|
|
|
|
|
HWND hoveredwnd = ChildWindowFromPointEx(m_hWnd, pos, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT);
|
|
|
|
|
|
|
|
if (hoveredwnd != hovered_window)
|
|
|
|
hovered_window = hoveredwnd;
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
|
|
|
|
switch (GetDlgCtrlID(hoveredwnd))
|
|
|
|
{
|
|
|
|
case IDC_SKIPDRAWHACK:
|
|
|
|
case IDC_SKIPDRAWHACKEDIT:
|
|
|
|
case IDC_STATIC_SKIPDRAW:
|
|
|
|
helpstr = "Skipdraw\n\nSkips drawing n surfaces completely. "
|
2012-04-24 14:24:58 +00:00
|
|
|
"Use it, for example, to try and get rid of bad post processing effects."
|
2012-04-23 18:46:09 +00:00
|
|
|
" Try values between 1 and 100.";
|
|
|
|
break;
|
|
|
|
case IDC_ALPHAHACK:
|
2012-04-24 14:24:58 +00:00
|
|
|
helpstr = "Alpha Hack\n\nDifferent alpha handling. Can work around some shadow problems.";
|
2012-04-23 18:46:09 +00:00
|
|
|
break;
|
|
|
|
case IDC_OFFSETHACK:
|
|
|
|
helpstr = "Halfpixel\n\nMight fix some misaligned fog, bloom, or blend effect.";
|
|
|
|
break;
|
2012-06-19 01:12:01 +00:00
|
|
|
case IDC_SPRITEHACK:
|
|
|
|
helpstr = "Sprite Hack\n\nHelps getting rid of black inner lines in some filtered sprites."
|
2014-09-15 13:49:16 +00:00
|
|
|
" Half option is the preferred one. Use it for Mana Khemia or Ar Tonelico for example."
|
2012-06-19 01:12:01 +00:00
|
|
|
" Full can be used for Tales of Destiny.";
|
|
|
|
break;
|
2012-04-23 18:46:09 +00:00
|
|
|
case IDC_WILDHACK:
|
2012-05-28 20:32:48 +00:00
|
|
|
helpstr = "WildArms\n\nLowers the GS precision to avoid gaps between pixels when"
|
2012-04-23 18:46:09 +00:00
|
|
|
" upscaling. Full option fixes the text on WildArms games, while Half option might improve portraits"
|
2014-09-15 13:49:16 +00:00
|
|
|
" in Ar Tonelico.";
|
2012-04-23 18:46:09 +00:00
|
|
|
break;
|
|
|
|
case IDC_MSAACB:
|
|
|
|
case IDC_STATIC_MSAA:
|
|
|
|
helpstr = "Multisample Anti-Aliasing\n\nEnables hardware Anti-Aliasing. Needs lots of memory."
|
2012-04-24 14:24:58 +00:00
|
|
|
" The Z-24 modes might need to have LogarithmicZ to compensate for the bits lost (only in DX9 mode).";
|
2012-04-23 18:46:09 +00:00
|
|
|
break;
|
2012-05-23 06:38:37 +00:00
|
|
|
case IDC_AGGRESSIVECRC:
|
|
|
|
helpstr = "Use more aggressive CRC hacks on some games\n\n"
|
|
|
|
"Only affects few games, removing some effects which might make the image sharper/clearer.\n"
|
2013-03-02 11:51:14 +00:00
|
|
|
"Affected games: FFX, FFX2, FFXII, GOW2, ICO, SoTC, SSX3.\n"
|
|
|
|
"Works as a speedhack for: Steambot Chronicles.";
|
2012-05-23 06:38:37 +00:00
|
|
|
break;
|
2012-07-24 02:20:07 +00:00
|
|
|
case IDC_ALPHASTENCIL:
|
|
|
|
helpstr = "Extend stencil based emulation of destination alpha to perform stencil operations while drawing.\n\n"
|
|
|
|
"Improves many shadows which are normally overdrawn in parts, may affect other effects.\n"
|
|
|
|
"Will disable partial transparency in some games or even prevent drawing some elements altogether.";
|
|
|
|
break;
|
2014-01-05 23:31:26 +00:00
|
|
|
case IDC_CHECK_NVIDIA_HACK:
|
2014-02-02 22:46:06 +00:00
|
|
|
helpstr = "This is a hack to work around problems with recent NVIDIA drivers causing odd stretching problems in DirectX 11 only "
|
2014-01-05 23:31:26 +00:00
|
|
|
"when using Upscaling.\n\n"
|
|
|
|
"Try not to use this unless your game Videos or 2D screens are stretching outside the frame.\n\n"
|
2014-02-02 22:46:06 +00:00
|
|
|
"If you have an AMD/ATi graphics card you should not need this.";
|
2014-01-05 23:31:26 +00:00
|
|
|
break;
|
2012-06-13 23:53:08 +00:00
|
|
|
case IDC_CHECK_DISABLE_ALL_HACKS:
|
|
|
|
helpstr = "FOR TESTING ONLY!!\n\n"
|
|
|
|
"Disable all CRC hacks - will break many games. Overrides CrcHacksExclusion at gsdx.ini\n"
|
|
|
|
"\n"
|
|
|
|
"It's possible to exclude CRC hacks also via the gsdx.ini. E.g.:\n"
|
|
|
|
"CrcHacksExclusions=all\n"
|
|
|
|
"CrcHacksExclusions=0x0F0C4A9C, 0x0EE5646B, 0x7ACF7E03";
|
2015-04-06 19:39:51 +00:00
|
|
|
break;
|
2015-04-05 22:15:53 +00:00
|
|
|
case IDC_ALIGN_SPRITE:
|
|
|
|
helpstr = "Sprite Alignment Hack\n\n"
|
|
|
|
"Fixes issues with upscaling(vertical lines) in Namco games like Ace Combat, Tekken, Soul Calibur, etc.";
|
|
|
|
break;
|
|
|
|
case IDC_STRETCH_SPRITE:
|
|
|
|
helpstr = "Corrects the sampling of 2D sprite textures when upscaling.\n\n"
|
|
|
|
"Fixes lines in sprites of games like Ar tonelico when upscaling.\n"
|
|
|
|
"Works best at 2x, but helps at any resolution.";
|
2012-06-13 23:53:08 +00:00
|
|
|
break;
|
2013-02-12 10:57:48 +00:00
|
|
|
|
|
|
|
case IDC_TCOFFSETX:
|
|
|
|
case IDC_TCOFFSETX2:
|
|
|
|
case IDC_STATIC_TCOFFSETX:
|
|
|
|
case IDC_TCOFFSETY:
|
|
|
|
case IDC_TCOFFSETY2:
|
|
|
|
case IDC_STATIC_TCOFFSETY:
|
|
|
|
helpstr = "Texture Coordinates Offset Hack\n\n"
|
|
|
|
"Offset for the ST/UV texture coordinates. Fixes some odd texture issues and might fix some post processing alignment too.\n\n"
|
|
|
|
" 0500 0500, fixes Persona 3 minimap, helps Haunting Ground.\n"
|
|
|
|
" 0000 1000, fixes Xenosaga hair edges (DX10+ Issue)\n";
|
|
|
|
break;
|
|
|
|
|
2012-04-23 18:46:09 +00:00
|
|
|
default:
|
2013-02-12 10:57:48 +00:00
|
|
|
updateText = false;
|
2012-04-23 18:46:09 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-02-12 10:57:48 +00:00
|
|
|
if(updateText)
|
|
|
|
SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), helpstr);
|
2012-04-23 18:46:09 +00:00
|
|
|
|
|
|
|
} break;
|
2012-03-07 09:58:38 +00:00
|
|
|
|
2012-03-06 19:39:05 +00:00
|
|
|
case WM_COMMAND:
|
|
|
|
{
|
|
|
|
int id = LOWORD(wParam);
|
|
|
|
|
|
|
|
switch(id)
|
|
|
|
{
|
|
|
|
case IDOK:
|
|
|
|
{
|
|
|
|
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_HalfPixelOffset", (int)IsDlgButtonChecked(m_hWnd, IDC_OFFSETHACK));
|
2012-06-19 01:12:01 +00:00
|
|
|
theApp.SetConfig("UserHacks_SpriteHack", (int)IsDlgButtonChecked(m_hWnd, IDC_SPRITEHACK));
|
2012-03-06 19:39:05 +00:00
|
|
|
theApp.SetConfig("UserHacks_SkipDraw", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0));
|
2012-03-06 21:36:59 +00:00
|
|
|
theApp.SetConfig("UserHacks_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK));
|
2012-05-23 06:38:37 +00:00
|
|
|
theApp.SetConfig("UserHacks_AggressiveCRC", (int)IsDlgButtonChecked(m_hWnd, IDC_AGGRESSIVECRC));
|
2012-07-24 02:20:07 +00:00
|
|
|
theApp.SetConfig("UserHacks_AlphaStencil", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHASTENCIL));
|
2014-01-05 23:31:26 +00:00
|
|
|
theApp.SetConfig("UserHacks_NVIDIAHack", (int)IsDlgButtonChecked(m_hWnd, IDC_CHECK_NVIDIA_HACK));
|
2012-06-13 23:53:08 +00:00
|
|
|
theApp.SetConfig("UserHacks_DisableCrcHacks", (int)IsDlgButtonChecked(m_hWnd, IDC_CHECK_DISABLE_ALL_HACKS));
|
2015-04-05 22:15:53 +00:00
|
|
|
theApp.SetConfig("Userhacks_stretch_sprite", (int)IsDlgButtonChecked(m_hWnd, IDC_STRETCH_SPRITE));
|
|
|
|
theApp.SetConfig("Userhacks_align_sprite_X", (int)IsDlgButtonChecked(m_hWnd, IDC_ALIGN_SPRITE));
|
2013-02-12 10:57:48 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
theApp.SetConfig("UserHacks_TCOffset", TCOFFSET);
|
|
|
|
|
2012-03-06 19:39:05 +00:00
|
|
|
EndDialog(m_hWnd, id);
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case WM_CLOSE:EndDialog(m_hWnd, IDCANCEL); break;
|
|
|
|
|
|
|
|
default: return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|