mirror of https://github.com/PCSX2/pcsx2.git
GSdx: now I think only the window classes of mfc are left to be replaced (main window, config dialog), trying to get familiar with wx...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1219 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
3f9a45c8aa
commit
5f392aba63
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "GSdx.h"
|
||||||
#include "GSUtil.h"
|
#include "GSUtil.h"
|
||||||
#include "GPURendererSW.h"
|
#include "GPURendererSW.h"
|
||||||
#include "GSDevice7.h"
|
#include "GSDevice7.h"
|
||||||
|
@ -52,30 +53,22 @@ EXPORT_C_(uint32) PSEgetLibVersion()
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUinit()
|
EXPORT_C_(int32) GPUinit()
|
||||||
{
|
{
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUshutdown()
|
EXPORT_C_(int32) GPUshutdown()
|
||||||
{
|
{
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUclose()
|
EXPORT_C_(int32) GPUclose()
|
||||||
{
|
{
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
|
||||||
|
|
||||||
delete s_gpu;
|
delete s_gpu;
|
||||||
|
|
||||||
s_gpu = NULL;
|
s_gpu = NULL;
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
if(SUCCEEDED(s_hr))
|
if(SUCCEEDED(s_hr))
|
||||||
{
|
{
|
||||||
::CoUninitialize();
|
::CoUninitialize();
|
||||||
|
@ -83,32 +76,47 @@ EXPORT_C_(int32) GPUclose()
|
||||||
s_hr = E_FAIL;
|
s_hr = E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUopen(HWND hWnd)
|
EXPORT_C_(int32) GPUopen(HWND hWnd)
|
||||||
{
|
{
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
|
||||||
|
|
||||||
if(!GSUtil::CheckDirectX() || !GSUtil::CheckSSE())
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
GPUclose();
|
GPUclose();
|
||||||
|
|
||||||
GPURendererSettings rs;
|
GPURendererSettings rs;
|
||||||
|
|
||||||
rs.m_filter = AfxGetApp()->GetProfileInt(_T("GPUSettings"), _T("filter"), 0);
|
int threads = 1;
|
||||||
rs.m_dither = AfxGetApp()->GetProfileInt(_T("GPUSettings"), _T("dithering"), 1);
|
int renderer = 1;
|
||||||
rs.m_aspectratio = AfxGetApp()->GetProfileInt(_T("GPUSettings"), _T("AspectRatio"), 1);
|
|
||||||
rs.m_vsync = !!AfxGetApp()->GetProfileInt(_T("GPUSettings"), _T("vsync"), FALSE);
|
|
||||||
rs.m_scale.x = AfxGetApp()->GetProfileInt(_T("GPUSettings"), _T("scale_x"), 0);
|
|
||||||
rs.m_scale.y = AfxGetApp()->GetProfileInt(_T("GPUSettings"), _T("scale_y"), 0);
|
|
||||||
|
|
||||||
int threads = AfxGetApp()->GetProfileInt(_T("GPUSettings"), _T("swthreads"), 1);
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
int renderer = AfxGetApp()->GetProfileInt(_T("GPUSettings"), _T("Renderer"), 1);
|
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
||||||
|
|
||||||
|
s_hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||||
|
|
||||||
|
if(!GSUtil::CheckDirectX())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(!GSUtil::CheckSSE())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
rs.m_filter = theApp.GetConfig("filter", 0);
|
||||||
|
rs.m_dither = theApp.GetConfig("dithering", 1);
|
||||||
|
rs.m_aspectratio = theApp.GetConfig("AspectRatio", 1);
|
||||||
|
rs.m_vsync = !!theApp.GetConfig("vsync", 0);
|
||||||
|
rs.m_scale.x = theApp.GetConfig("scale_x", 0);
|
||||||
|
rs.m_scale.y = theApp.GetConfig("scale_y", 0);
|
||||||
|
|
||||||
|
threads = theApp.GetConfig("swthreads", 1);
|
||||||
|
renderer = theApp.GetConfig("Renderer", 1);
|
||||||
|
|
||||||
switch(renderer)
|
switch(renderer)
|
||||||
{
|
{
|
||||||
|
@ -119,8 +127,6 @@ EXPORT_C_(int32) GPUopen(HWND hWnd)
|
||||||
// TODO: case 3: s_gpu = new GPURendererNull<GSDeviceNull>(rs, threads); break;
|
// TODO: case 3: s_gpu = new GPURendererNull<GSDeviceNull>(rs, threads); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
|
||||||
|
|
||||||
if(!s_gpu->Create(hWnd))
|
if(!s_gpu->Create(hWnd))
|
||||||
{
|
{
|
||||||
GPUclose();
|
GPUclose();
|
||||||
|
@ -133,6 +139,9 @@ EXPORT_C_(int32) GPUopen(HWND hWnd)
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUconfigure()
|
EXPORT_C_(int32) GPUconfigure()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
||||||
|
|
||||||
GPUSettingsDlg dlg;
|
GPUSettingsDlg dlg;
|
||||||
|
@ -143,13 +152,13 @@ EXPORT_C_(int32) GPUconfigure()
|
||||||
GPUinit();
|
GPUinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUtest()
|
EXPORT_C_(int32) GPUtest()
|
||||||
{
|
{
|
||||||
// TODO
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -381,6 +381,15 @@ public:
|
||||||
|
|
||||||
virtual bool MakeSnapshot(const string& path)
|
virtual bool MakeSnapshot(const string& path)
|
||||||
{
|
{
|
||||||
return m_dev.SaveCurrent(format("%s_%s", path.c_str(), CTime::GetCurrentTime().Format(_T("%Y%m%d%H%M%S"))) + ".bmp");
|
time_t t = time(NULL);
|
||||||
|
|
||||||
|
char buff[16];
|
||||||
|
|
||||||
|
if(!strftime(buff, sizeof(buff), "%Y%m%d%H%M%S", localtime(&t)))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_dev.SaveCurrent(format("%s_%s.bmp", path.c_str(), buff));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -130,8 +130,6 @@ BOOL GPUSettingsDlg::OnInitDialog()
|
||||||
{
|
{
|
||||||
__super::OnInitDialog();
|
__super::OnInitDialog();
|
||||||
|
|
||||||
CWinApp* pApp = AfxGetApp();
|
|
||||||
|
|
||||||
D3DCAPS9 caps;
|
D3DCAPS9 caps;
|
||||||
memset(&caps, 0, sizeof(caps));
|
memset(&caps, 0, sizeof(caps));
|
||||||
caps.PixelShaderVersion = D3DPS_VERSION(0, 0);
|
caps.PixelShaderVersion = D3DPS_VERSION(0, 0);
|
||||||
|
@ -154,9 +152,9 @@ BOOL GPUSettingsDlg::OnInitDialog()
|
||||||
|
|
||||||
if(CComPtr<IDirect3D9> d3d = Direct3DCreate9(D3D_SDK_VERSION))
|
if(CComPtr<IDirect3D9> d3d = Direct3DCreate9(D3D_SDK_VERSION))
|
||||||
{
|
{
|
||||||
uint32 ModeWidth = pApp->GetProfileInt(_T("Settings"), _T("ModeWidth"), 0);
|
uint32 ModeWidth = theApp.GetConfig("ModeWidth", 0);
|
||||||
uint32 ModeHeight = pApp->GetProfileInt(_T("Settings"), _T("ModeHeight"), 0);
|
uint32 ModeHeight = theApp.GetConfig("ModeHeight", 0);
|
||||||
uint32 ModeRefreshRate = pApp->GetProfileInt(_T("Settings"), _T("ModeRefreshRate"), 0);
|
uint32 ModeRefreshRate = theApp.GetConfig("ModeRefreshRate", 0);
|
||||||
|
|
||||||
uint32 nModes = d3d->GetAdapterModeCount(D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8);
|
uint32 nModes = d3d->GetAdapterModeCount(D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8);
|
||||||
|
|
||||||
|
@ -194,12 +192,12 @@ BOOL GPUSettingsDlg::OnInitDialog()
|
||||||
renderers.push_back(g_renderers[i]);
|
renderers.push_back(g_renderers[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
GSSetting::InitComboBox(&renderers[0], renderers.size(), m_renderer, pApp->GetProfileInt(_T("GPUSettings"), _T("Renderer"), 1));
|
GSSetting::InitComboBox(&renderers[0], renderers.size(), m_renderer, theApp.GetConfig("Renderer", 1));
|
||||||
GSSetting::InitComboBox(g_psversion, countof(g_psversion), m_psversion, pApp->GetProfileInt(_T("Settings"), _T("PixelShaderVersion2"), D3DPS_VERSION(2, 0)), caps.PixelShaderVersion);
|
GSSetting::InitComboBox(g_psversion, countof(g_psversion), m_psversion, theApp.GetConfig("PixelShaderVersion2", D3DPS_VERSION(2, 0)), caps.PixelShaderVersion);
|
||||||
GSSetting::InitComboBox(g_filter, countof(g_filter), m_filter, pApp->GetProfileInt(_T("GPUSettings"), _T("filter"), 0));
|
GSSetting::InitComboBox(g_filter, countof(g_filter), m_filter, theApp.GetConfig("filter", 0));
|
||||||
GSSetting::InitComboBox(g_dithering, countof(g_dithering), m_dithering, pApp->GetProfileInt(_T("GPUSettings"), _T("dithering"), 1));
|
GSSetting::InitComboBox(g_dithering, countof(g_dithering), m_dithering, theApp.GetConfig("dithering", 1));
|
||||||
GSSetting::InitComboBox(g_aspectratio, countof(g_aspectratio), m_aspectratio, pApp->GetProfileInt(_T("GPUSettings"), _T("AspectRatio"), 1));
|
GSSetting::InitComboBox(g_aspectratio, countof(g_aspectratio), m_aspectratio, theApp.GetConfig("AspectRatio", 1));
|
||||||
GSSetting::InitComboBox(g_internalresolution, countof(g_internalresolution), m_internalresolution, pApp->GetProfileInt(_T("GPUSettings"), _T("scale_x"), 0) | (pApp->GetProfileInt(_T("GPUSettings"), _T("scale_y"), 0) << 2));
|
GSSetting::InitComboBox(g_internalresolution, countof(g_internalresolution), m_internalresolution, theApp.GetConfig("scale_x", 0) | (theApp.GetConfig("scale_y", 0) << 2));
|
||||||
|
|
||||||
|
|
||||||
OnCbnSelchangeCombo1();
|
OnCbnSelchangeCombo1();
|
||||||
|
@ -207,7 +205,7 @@ BOOL GPUSettingsDlg::OnInitDialog()
|
||||||
//
|
//
|
||||||
|
|
||||||
m_swthreads.SetRange(1, 16);
|
m_swthreads.SetRange(1, 16);
|
||||||
m_swthreads.SetPos(pApp->GetProfileInt(_T("GPUSettings"), _T("swthreads"), 1));
|
m_swthreads.SetPos(theApp.GetConfig("swthreads", 1));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -219,53 +217,51 @@ BOOL GPUSettingsDlg::OnInitDialog()
|
||||||
|
|
||||||
void GPUSettingsDlg::OnOK()
|
void GPUSettingsDlg::OnOK()
|
||||||
{
|
{
|
||||||
CWinApp* pApp = AfxGetApp();
|
|
||||||
|
|
||||||
UpdateData();
|
UpdateData();
|
||||||
|
|
||||||
if(m_resolution.GetCurSel() >= 0)
|
if(m_resolution.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
D3DDISPLAYMODE& mode = *(D3DDISPLAYMODE*)m_resolution.GetItemData(m_resolution.GetCurSel());
|
D3DDISPLAYMODE& mode = *(D3DDISPLAYMODE*)m_resolution.GetItemData(m_resolution.GetCurSel());
|
||||||
|
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("ModeWidth"), mode.Width);
|
theApp.SetConfig("ModeWidth", (int)mode.Width);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("ModeHeight"), mode.Height);
|
theApp.SetConfig("ModeHeight", (int)mode.Height);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("ModeRefreshRate"), mode.RefreshRate);
|
theApp.SetConfig("ModeRefreshRate", (int)mode.RefreshRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_renderer.GetCurSel() >= 0)
|
if(m_renderer.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("GPUSettings"), _T("Renderer"), (DWORD)m_renderer.GetItemData(m_renderer.GetCurSel()));
|
theApp.SetConfig("Renderer", (int)m_renderer.GetItemData(m_renderer.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_psversion.GetCurSel() >= 0)
|
if(m_psversion.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("PixelShaderVersion2"), (DWORD)m_psversion.GetItemData(m_psversion.GetCurSel()));
|
theApp.SetConfig("PixelShaderVersion2", (int)m_psversion.GetItemData(m_psversion.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_filter.GetCurSel() >= 0)
|
if(m_filter.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("GPUSettings"), _T("filter"), (DWORD)m_filter.GetItemData(m_filter.GetCurSel()));
|
theApp.SetConfig("filter", (int)m_filter.GetItemData(m_filter.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_dithering.GetCurSel() >= 0)
|
if(m_dithering.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("GPUSettings"), _T("dithering"), (DWORD)m_dithering.GetItemData(m_dithering.GetCurSel()));
|
theApp.SetConfig("dithering", (int)m_dithering.GetItemData(m_dithering.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_aspectratio.GetCurSel() >= 0)
|
if(m_aspectratio.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("GPUSettings"), _T("AspectRatio"), (DWORD)m_aspectratio.GetItemData(m_aspectratio.GetCurSel()));
|
theApp.SetConfig("AspectRatio", (int)m_aspectratio.GetItemData(m_aspectratio.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_internalresolution.GetCurSel() >= 0)
|
if(m_internalresolution.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
DWORD value = (DWORD)m_internalresolution.GetItemData(m_internalresolution.GetCurSel());
|
int value = (int)m_internalresolution.GetItemData(m_internalresolution.GetCurSel());
|
||||||
|
|
||||||
pApp->WriteProfileInt(_T("GPUSettings"), _T("scale_x"), value & 3);
|
theApp.SetConfig("scale_x", value & 3);
|
||||||
pApp->WriteProfileInt(_T("GPUSettings"), _T("scale_y"), (value >> 2) & 3);
|
theApp.SetConfig("scale_y", (value >> 2) & 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
pApp->WriteProfileInt(_T("GPUSettings"), _T("swthreads"), m_swthreads.GetPos());
|
theApp.SetConfig("swthreads", m_swthreads.GetPos());
|
||||||
|
|
||||||
__super::OnOK();
|
__super::OnOK();
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,14 +71,11 @@ EXPORT_C GSsetBaseMem(uint8* mem)
|
||||||
|
|
||||||
EXPORT_C_(INT32) GSinit()
|
EXPORT_C_(INT32) GSinit()
|
||||||
{
|
{
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C GSshutdown()
|
EXPORT_C GSshutdown()
|
||||||
{
|
{
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C GSclose()
|
EXPORT_C GSclose()
|
||||||
|
@ -87,36 +84,51 @@ EXPORT_C GSclose()
|
||||||
|
|
||||||
s_gs = NULL;
|
s_gs = NULL;
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
if(SUCCEEDED(s_hr))
|
if(SUCCEEDED(s_hr))
|
||||||
{
|
{
|
||||||
::CoUninitialize();
|
::CoUninitialize();
|
||||||
|
|
||||||
s_hr = E_FAIL;
|
s_hr = E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT32 GSopen(void* dsp, char* title, int mt, int renderer)
|
static INT32 GSopen(void* dsp, char* title, int mt, int renderer)
|
||||||
{
|
{
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
|
||||||
|
|
||||||
if(!GSUtil::CheckDirectX() || !GSUtil::CheckSSE())
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
GSclose();
|
GSclose();
|
||||||
|
|
||||||
GSRendererSettings rs;
|
GSRendererSettings rs;
|
||||||
|
|
||||||
rs.m_interlace = AfxGetApp()->GetProfileInt(_T("Settings"), _T("interlace"), 0);
|
int threads = 1;
|
||||||
rs.m_aspectratio = AfxGetApp()->GetProfileInt(_T("Settings"), _T("aspectratio"), 1);
|
|
||||||
rs.m_filter = AfxGetApp()->GetProfileInt(_T("Settings"), _T("filter"), 1);
|
|
||||||
rs.m_vsync = !!AfxGetApp()->GetProfileInt(_T("Settings"), _T("vsync"), FALSE);
|
|
||||||
rs.m_nativeres = !!AfxGetApp()->GetProfileInt(_T("Settings"), _T("nativeres"), FALSE);
|
|
||||||
rs.m_aa1 = !!AfxGetApp()->GetProfileInt(_T("Settings"), _T("aa1"), FALSE);
|
|
||||||
rs.m_blur = !!AfxGetApp()->GetProfileInt(_T("Settings"), _T("blur"), FALSE);
|
|
||||||
|
|
||||||
int threads = AfxGetApp()->GetProfileInt(_T("Settings"), _T("swthreads"), 1);
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
|
s_hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||||
|
|
||||||
|
if(!GSUtil::CheckDirectX())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(!GSUtil::CheckSSE())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
rs.m_interlace = theApp.GetConfig("interlace", 0);
|
||||||
|
rs.m_aspectratio = theApp.GetConfig("aspectratio", 1);
|
||||||
|
rs.m_filter = theApp.GetConfig("filter", 1);
|
||||||
|
rs.m_vsync = !!theApp.GetConfig("vsync", 0);
|
||||||
|
rs.m_nativeres = !!theApp.GetConfig("nativeres", 0);
|
||||||
|
rs.m_aa1 = !!theApp.GetConfig("aa1", 0);
|
||||||
|
rs.m_blur = !!theApp.GetConfig("blur", 0);
|
||||||
|
|
||||||
|
threads = theApp.GetConfig("swthreads", 1);
|
||||||
|
|
||||||
switch(renderer)
|
switch(renderer)
|
||||||
{
|
{
|
||||||
|
@ -131,8 +143,6 @@ static INT32 GSopen(void* dsp, char* title, int mt, int renderer)
|
||||||
case 7: s_gs = new GSRendererNull<GSDeviceNull>(s_basemem, !!mt, s_irq, rs); break;
|
case 7: s_gs = new GSRendererNull<GSDeviceNull>(s_basemem, !!mt, s_irq, rs); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
|
||||||
|
|
||||||
if(!s_gs->Create(title))
|
if(!s_gs->Create(title))
|
||||||
{
|
{
|
||||||
GSclose();
|
GSclose();
|
||||||
|
@ -151,8 +161,12 @@ static INT32 GSopen(void* dsp, char* title, int mt, int renderer)
|
||||||
|
|
||||||
EXPORT_C_(INT32) GSopen(void* dsp, char* title, int mt)
|
EXPORT_C_(INT32) GSopen(void* dsp, char* title, int mt)
|
||||||
{
|
{
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
int renderer;
|
int renderer;
|
||||||
|
|
||||||
if(mt == 2)
|
if(mt == 2)
|
||||||
|
@ -164,7 +178,7 @@ EXPORT_C_(INT32) GSopen(void* dsp, char* title, int mt)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// normal init
|
// normal init
|
||||||
renderer = AfxGetApp()->GetProfileInt(_T("Settings"), _T("renderer"), 0);
|
renderer = theApp.GetConfig("renderer", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GSopen(dsp, title, mt, renderer);
|
return GSopen(dsp, title, mt, renderer);
|
||||||
|
@ -212,6 +226,20 @@ EXPORT_C GSgifTransfer3(uint8* mem, uint32 size)
|
||||||
|
|
||||||
EXPORT_C GSvsync(int field)
|
EXPORT_C GSvsync(int field)
|
||||||
{
|
{
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
|
MSG msg;
|
||||||
|
|
||||||
|
memset(&msg, 0, sizeof(msg));
|
||||||
|
|
||||||
|
while(msg.message != WM_QUIT && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||||
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
s_gs->VSync(field);
|
s_gs->VSync(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,8 +248,9 @@ EXPORT_C_(uint32) GSmakeSnapshot(char* path)
|
||||||
return s_gs->MakeSnapshot(string(path) + "gsdx");
|
return s_gs->MakeSnapshot(string(path) + "gsdx");
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C GSkeyEvent(keyEvent* ev)
|
EXPORT_C GSkeyEvent(GSKeyEventData* e)
|
||||||
{
|
{
|
||||||
|
s_gs->KeyEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(int) GSfreeze(int mode, GSFreezeData* data)
|
EXPORT_C_(int) GSfreeze(int mode, GSFreezeData* data)
|
||||||
|
@ -244,6 +273,8 @@ EXPORT_C_(int) GSfreeze(int mode, GSFreezeData* data)
|
||||||
|
|
||||||
EXPORT_C GSconfigure()
|
EXPORT_C GSconfigure()
|
||||||
{
|
{
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
||||||
|
|
||||||
GSSettingsDlg dlg;
|
GSSettingsDlg dlg;
|
||||||
|
@ -253,21 +284,14 @@ EXPORT_C GSconfigure()
|
||||||
GSshutdown();
|
GSshutdown();
|
||||||
GSinit();
|
GSinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(INT32) GStest()
|
EXPORT_C_(INT32) GStest()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
/*
|
|
||||||
AFX_MANAGE_STATE(AfxGetStaticModuleState());
|
|
||||||
|
|
||||||
CComPtr<ID3D10Device> dev;
|
|
||||||
|
|
||||||
return SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &dev)) ? 0 : -1;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C GSabout()
|
EXPORT_C GSabout()
|
||||||
|
@ -294,6 +318,8 @@ EXPORT_C GSsetFrameSkip(int frameskip)
|
||||||
s_gs->SetFrameSkip(frameskip);
|
s_gs->SetFrameSkip(frameskip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
EXPORT_C GSReplay(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
|
EXPORT_C GSReplay(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
int renderer = -1;
|
int renderer = -1;
|
||||||
|
@ -597,3 +623,4 @@ EXPORT_C GSBenchmark(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -1163,7 +1163,7 @@ struct GSPrivRegSet
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
enum {KEYPRESS=1, KEYRELEASE=2};
|
enum {KEYPRESS=1, KEYRELEASE=2};
|
||||||
struct keyEvent {uint32 key, event;};
|
struct GSKeyEventData {uint32 key, type;};
|
||||||
|
|
||||||
enum {FREEZE_LOAD=0, FREEZE_SAVE=1, FREEZE_SIZE=2};
|
enum {FREEZE_LOAD=0, FREEZE_SAVE=1, FREEZE_SIZE=2};
|
||||||
struct GSFreezeData {int size; uint8* data;};
|
struct GSFreezeData {int size; uint8* data;};
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include <afxpriv.h>
|
#include <afxpriv.h>
|
||||||
|
#include "GSdx.h"
|
||||||
#include "GSCaptureDlg.h"
|
#include "GSCaptureDlg.h"
|
||||||
|
|
||||||
// GSCaptureDlg dialog
|
// GSCaptureDlg dialog
|
||||||
|
@ -29,9 +30,9 @@ IMPLEMENT_DYNAMIC(GSCaptureDlg, CDialog)
|
||||||
GSCaptureDlg::GSCaptureDlg(CWnd* pParent /*=NULL*/)
|
GSCaptureDlg::GSCaptureDlg(CWnd* pParent /*=NULL*/)
|
||||||
: CDialog(GSCaptureDlg::IDD, pParent)
|
: CDialog(GSCaptureDlg::IDD, pParent)
|
||||||
{
|
{
|
||||||
m_width = AfxGetApp()->GetProfileInt(_T("Capture"), _T("Width"), 640);
|
m_width = theApp.GetConfig("CaptureWidth", 640);
|
||||||
m_height = AfxGetApp()->GetProfileInt(_T("Capture"), _T("Height"), 480);
|
m_height = theApp.GetConfig("CaptureHeight", 480);
|
||||||
m_filename = AfxGetApp()->GetProfileString(_T("Capture"), _T("FileName"));
|
m_filename = theApp.GetConfig("CaptureFileName", "").c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
GSCaptureDlg::~GSCaptureDlg()
|
GSCaptureDlg::~GSCaptureDlg()
|
||||||
|
@ -123,7 +124,7 @@ BOOL GSCaptureDlg::OnInitDialog()
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
CString DisplayNameToFind = AfxGetApp()->GetProfileString(_T("Capture"), _T("VideoCodecDisplayName"));
|
CString DisplayNameToFind = theApp.GetConfig("CaptureVideoCodecDisplayName", "").c_str();
|
||||||
|
|
||||||
for(int i = 0; i < m_codeclist.GetCount(); i++)
|
for(int i = 0; i < m_codeclist.GetCount(); i++)
|
||||||
{
|
{
|
||||||
|
@ -230,10 +231,10 @@ void GSCaptureDlg::OnBnClickedOk()
|
||||||
|
|
||||||
m_enc = c.filter;
|
m_enc = c.filter;
|
||||||
|
|
||||||
AfxGetApp()->WriteProfileInt(_T("Capture"), _T("Width"), m_width);
|
theApp.SetConfig("CaptureWidth", m_width);
|
||||||
AfxGetApp()->WriteProfileInt(_T("Capture"), _T("Height"), m_height);
|
theApp.SetConfig("CaptureHeight", m_height);
|
||||||
AfxGetApp()->WriteProfileString(_T("Capture"), _T("FileName"), m_filename);
|
theApp.SetConfig("CaptureFileName", m_filename);
|
||||||
AfxGetApp()->WriteProfileString(_T("Capture"), _T("VideoCodecDisplayName"), CString(c.DisplayName));
|
theApp.SetConfig("CaptureVideoCodecDisplayName", CString(c.DisplayName));
|
||||||
|
|
||||||
OnOK();
|
OnOK();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,7 @@ CRC::Game CRC::m_games[] =
|
||||||
{0xC19A374E, SoTC, US},
|
{0xC19A374E, SoTC, US},
|
||||||
{0x7D8F539A, SoTC, EU},
|
{0x7D8F539A, SoTC, EU},
|
||||||
{0x3122B508, OnePieceGrandAdventure, US},
|
{0x3122B508, OnePieceGrandAdventure, US},
|
||||||
|
{0x8DF14A24, OnePieceGrandAdventure, Unknown},
|
||||||
{0x6F8545DB, ICO, US},
|
{0x6F8545DB, ICO, US},
|
||||||
{0xB01A4C95, ICO, JP},
|
{0xB01A4C95, ICO, JP},
|
||||||
{0x5C991F4E, ICO, Unknown},
|
{0x5C991F4E, ICO, Unknown},
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "GSdx.h"
|
||||||
#include "GSDevice9.h"
|
#include "GSDevice9.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
|
@ -102,7 +103,7 @@ bool GSDevice9::Create(HWND hWnd, bool vsync)
|
||||||
|
|
||||||
m_d3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &m_d3dcaps);
|
m_d3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &m_d3dcaps);
|
||||||
|
|
||||||
bool fs = AfxGetApp()->GetProfileInt(_T("Settings"), _T("ModeWidth"), 0) > 0;
|
bool fs = theApp.GetConfig("ModeWidth", 0) > 0;
|
||||||
|
|
||||||
if(!Reset(1, 1, fs)) return false;
|
if(!Reset(1, 1, fs)) return false;
|
||||||
|
|
||||||
|
@ -110,7 +111,7 @@ bool GSDevice9::Create(HWND hWnd, bool vsync)
|
||||||
|
|
||||||
// shaders
|
// shaders
|
||||||
|
|
||||||
DWORD psver = AfxGetApp()->GetProfileInt(_T("Settings"), _T("PixelShaderVersion2"), D3DPS_VERSION(2, 0));
|
uint32 psver = (uint32)theApp.GetConfig("PixelShaderVersion2", D3DPS_VERSION(2, 0));
|
||||||
|
|
||||||
if(psver > m_d3dcaps.PixelShaderVersion)
|
if(psver > m_d3dcaps.PixelShaderVersion)
|
||||||
{
|
{
|
||||||
|
@ -262,9 +263,9 @@ bool GSDevice9::Reset(int w, int h, bool fs)
|
||||||
|
|
||||||
// m_pp.Flags |= D3DPRESENTFLAG_VIDEO; // enables tv-out (but I don't think anyone would still use a regular tv...)
|
// m_pp.Flags |= D3DPRESENTFLAG_VIDEO; // enables tv-out (but I don't think anyone would still use a regular tv...)
|
||||||
|
|
||||||
int mw = AfxGetApp()->GetProfileInt(_T("Settings"), _T("ModeWidth"), 0);
|
int mw = theApp.GetConfig("ModeWidth", 0);
|
||||||
int mh = AfxGetApp()->GetProfileInt(_T("Settings"), _T("ModeHeight"), 0);
|
int mh = theApp.GetConfig("ModeHeight", 0);
|
||||||
int mrr = AfxGetApp()->GetProfileInt(_T("Settings"), _T("ModeRefreshRate"), 0);
|
int mrr = theApp.GetConfig("ModeRefreshRate", 0);
|
||||||
|
|
||||||
if(fs && mw > 0 && mh > 0 && mrr >= 0)
|
if(fs && mw > 0 && mh > 0 && mrr >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "GSdx.h"
|
||||||
#include "GSWnd.h"
|
#include "GSWnd.h"
|
||||||
#include "GSState.h"
|
#include "GSState.h"
|
||||||
#include "GSVertexList.h"
|
#include "GSVertexList.h"
|
||||||
|
@ -43,56 +44,10 @@ class GSRendererBase : public GSState, protected GSRendererSettings
|
||||||
protected:
|
protected:
|
||||||
bool m_osd;
|
bool m_osd;
|
||||||
|
|
||||||
void ProcessWindowMessages()
|
|
||||||
{
|
|
||||||
MSG msg;
|
|
||||||
|
|
||||||
memset(&msg, 0, sizeof(msg));
|
|
||||||
|
|
||||||
while(msg.message != WM_QUIT && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
|
||||||
{
|
|
||||||
if(OnMessage(msg))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
TranslateMessage(&msg);
|
|
||||||
DispatchMessage(&msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool OnMessage(const MSG& msg)
|
|
||||||
{
|
|
||||||
if(msg.message == WM_KEYDOWN)
|
|
||||||
{
|
|
||||||
int step = (::GetAsyncKeyState(VK_SHIFT) & 0x8000) ? -1 : 1;
|
|
||||||
|
|
||||||
switch(msg.wParam)
|
|
||||||
{
|
|
||||||
case VK_F5:
|
|
||||||
m_interlace = (m_interlace + 7 + step) % 7;
|
|
||||||
return true;
|
|
||||||
case VK_F6:
|
|
||||||
m_aspectratio = (m_aspectratio + 3 + step) % 3;
|
|
||||||
return true;
|
|
||||||
case VK_F7:
|
|
||||||
m_wnd.SetWindowText(_T("PCSX2"));
|
|
||||||
m_osd = !m_osd;
|
|
||||||
return true;
|
|
||||||
case VK_DELETE:
|
|
||||||
m_aa1 = !m_aa1;
|
|
||||||
return true;
|
|
||||||
case VK_END:
|
|
||||||
m_blur = !m_blur;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSWnd m_wnd;
|
GSWnd m_wnd;
|
||||||
|
GSCapture m_capture;
|
||||||
|
string m_snapshot;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSRendererBase(uint8* base, bool mt, void (*irq)(), const GSRendererSettings& rs)
|
GSRendererBase(uint8* base, bool mt, void (*irq)(), const GSRendererSettings& rs)
|
||||||
|
@ -108,9 +63,59 @@ public:
|
||||||
m_blur = rs.m_blur;
|
m_blur = rs.m_blur;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void KeyEvent(GSKeyEventData* e)
|
||||||
|
{
|
||||||
|
if(e->type == KEYPRESS)
|
||||||
|
{
|
||||||
|
// TODO: linux
|
||||||
|
|
||||||
|
int step = (::GetAsyncKeyState(VK_SHIFT) & 0x8000) ? -1 : 1;
|
||||||
|
|
||||||
|
switch(e->key)
|
||||||
|
{
|
||||||
|
case VK_F5:
|
||||||
|
m_interlace = (m_interlace + 7 + step) % 7;
|
||||||
|
return;
|
||||||
|
case VK_F6:
|
||||||
|
m_aspectratio = (m_aspectratio + 3 + step) % 3;
|
||||||
|
return;
|
||||||
|
case VK_F7:
|
||||||
|
m_wnd.SetWindowText(_T("PCSX2"));
|
||||||
|
m_osd = !m_osd;
|
||||||
|
return;
|
||||||
|
case VK_F12:
|
||||||
|
if(m_capture.IsCapturing()) m_capture.EndCapture();
|
||||||
|
else m_capture.BeginCapture(GetFPS());
|
||||||
|
return;
|
||||||
|
case VK_DELETE:
|
||||||
|
m_aa1 = !m_aa1;
|
||||||
|
return;
|
||||||
|
case VK_END:
|
||||||
|
m_blur = !m_blur;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MakeSnapshot(const string& path)
|
||||||
|
{
|
||||||
|
if(m_snapshot.empty())
|
||||||
|
{
|
||||||
|
time_t t = time(NULL);
|
||||||
|
|
||||||
|
char buff[16];
|
||||||
|
|
||||||
|
if(strftime(buff, sizeof(buff), "%Y%m%d%H%M%S", localtime(&t)))
|
||||||
|
{
|
||||||
|
m_snapshot = format("%s_%s", path.c_str(), buff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool Create(const string& title) = 0;
|
virtual bool Create(const string& title) = 0;
|
||||||
virtual void VSync(int field) = 0;
|
virtual void VSync(int field) = 0;
|
||||||
virtual bool MakeSnapshot(const string& path) = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class Device> class GSRenderer : public GSRendererBase
|
template<class Device> class GSRenderer : public GSRendererBase
|
||||||
|
@ -382,21 +387,6 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool OnMessage(const MSG& msg)
|
|
||||||
{
|
|
||||||
if(msg.message == WM_KEYDOWN)
|
|
||||||
{
|
|
||||||
switch(msg.wParam)
|
|
||||||
{
|
|
||||||
case VK_F12:
|
|
||||||
if(m_capture.IsCapturing()) m_capture.EndCapture();
|
|
||||||
else m_capture.BeginCapture(GetFPS());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return __super::OnMessage(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Device m_dev;
|
Device m_dev;
|
||||||
|
@ -407,18 +397,15 @@ public:
|
||||||
bool s_save;
|
bool s_save;
|
||||||
bool s_savez;
|
bool s_savez;
|
||||||
|
|
||||||
string m_snapshot;
|
|
||||||
GSCapture m_capture;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSRenderer(uint8* base, bool mt, void (*irq)(), const GSRendererSettings& rs, bool psrr)
|
GSRenderer(uint8* base, bool mt, void (*irq)(), const GSRendererSettings& rs, bool psrr)
|
||||||
: GSRendererBase(base, mt, irq, rs)
|
: GSRendererBase(base, mt, irq, rs)
|
||||||
, m_psrr(psrr)
|
, m_psrr(psrr)
|
||||||
{
|
{
|
||||||
s_n = 0;
|
s_n = 0;
|
||||||
s_dump = !!AfxGetApp()->GetProfileInt(_T("Debug"), _T("dump"), 0);
|
s_dump = !!theApp.GetConfig("dump", 0);
|
||||||
s_save = !!AfxGetApp()->GetProfileInt(_T("Debug"), _T("save"), 0);
|
s_save = !!theApp.GetConfig("save", 0);
|
||||||
s_savez = !!AfxGetApp()->GetProfileInt(_T("Debug"), _T("savez"), 0);
|
s_savez = !!theApp.GetConfig("savez", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Create(const string& title)
|
bool Create(const string& title)
|
||||||
|
@ -446,8 +433,6 @@ public:
|
||||||
|
|
||||||
m_perfmon.Put(GSPerfMon::Frame);
|
m_perfmon.Put(GSPerfMon::Frame);
|
||||||
|
|
||||||
ProcessWindowMessages();
|
|
||||||
|
|
||||||
field = field ? 1 : 0;
|
field = field ? 1 : 0;
|
||||||
|
|
||||||
if(!Merge(field)) return;
|
if(!Merge(field)) return;
|
||||||
|
@ -530,16 +515,6 @@ public:
|
||||||
DoCapture();
|
DoCapture();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeSnapshot(const string& path)
|
|
||||||
{
|
|
||||||
if(m_snapshot.empty())
|
|
||||||
{
|
|
||||||
m_snapshot = format("%s_%s", path.c_str(), CTime::GetCurrentTime().Format(_T("%Y%m%d%H%M%S")));
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void MinMaxUV(int w, int h, GSVector4i& r) {r = GSVector4i(0, 0, w, h);}
|
virtual void MinMaxUV(int w, int h, GSVector4i& r) {r = GSVector4i(0, 0, w, h);}
|
||||||
virtual bool CanUpscale() {return !m_nativeres;}
|
virtual bool CanUpscale() {return !m_nativeres;}
|
||||||
};
|
};
|
||||||
|
|
|
@ -677,8 +677,8 @@ public:
|
||||||
{
|
{
|
||||||
if(!m_nativeres)
|
if(!m_nativeres)
|
||||||
{
|
{
|
||||||
m_width = AfxGetApp()->GetProfileInt(_T("Settings"), _T("resx"), m_width);
|
m_width = theApp.GetConfig("resx", m_width);
|
||||||
m_height = AfxGetApp()->GetProfileInt(_T("Settings"), _T("resy"), m_height);
|
m_height = theApp.GetConfig("resy", m_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_tc = new TextureCache(this);
|
m_tc = new TextureCache(this);
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
GSRendererHW9::GSRendererHW9(uint8* base, bool mt, void (*irq)(), const GSRendererSettings& rs)
|
GSRendererHW9::GSRendererHW9(uint8* base, bool mt, void (*irq)(), const GSRendererSettings& rs)
|
||||||
: GSRendererHW<Device, Vertex, TextureCache>(base, mt, irq, rs, false)
|
: GSRendererHW<Device, Vertex, TextureCache>(base, mt, irq, rs, false)
|
||||||
{
|
{
|
||||||
m_fba.enabled = !!AfxGetApp()->GetProfileInt(_T("Settings"), _T("fba"), TRUE);
|
m_fba.enabled = !!theApp.GetConfig("fba", 1);
|
||||||
m_logz = !!AfxGetApp()->GetProfileInt(_T("Settings"), _T("logz"), FALSE);
|
m_logz = !!theApp.GetConfig("logz", 0);
|
||||||
|
|
||||||
InitVertexKick<GSRendererHW9>();
|
InitVertexKick<GSRendererHW9>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,8 +141,6 @@ BOOL GSSettingsDlg::OnInitDialog()
|
||||||
{
|
{
|
||||||
__super::OnInitDialog();
|
__super::OnInitDialog();
|
||||||
|
|
||||||
CWinApp* pApp = AfxGetApp();
|
|
||||||
|
|
||||||
D3DCAPS9 caps;
|
D3DCAPS9 caps;
|
||||||
memset(&caps, 0, sizeof(caps));
|
memset(&caps, 0, sizeof(caps));
|
||||||
caps.PixelShaderVersion = D3DPS_VERSION(0, 0);
|
caps.PixelShaderVersion = D3DPS_VERSION(0, 0);
|
||||||
|
@ -165,9 +163,9 @@ BOOL GSSettingsDlg::OnInitDialog()
|
||||||
|
|
||||||
if(CComPtr<IDirect3D9> d3d = Direct3DCreate9(D3D_SDK_VERSION))
|
if(CComPtr<IDirect3D9> d3d = Direct3DCreate9(D3D_SDK_VERSION))
|
||||||
{
|
{
|
||||||
uint32 ModeWidth = pApp->GetProfileInt(_T("Settings"), _T("ModeWidth"), 0);
|
uint32 ModeWidth = theApp.GetConfig("ModeWidth", 0);
|
||||||
uint32 ModeHeight = pApp->GetProfileInt(_T("Settings"), _T("ModeHeight"), 0);
|
uint32 ModeHeight = theApp.GetConfig("ModeHeight", 0);
|
||||||
uint32 ModeRefreshRate = pApp->GetProfileInt(_T("Settings"), _T("ModeRefreshRate"), 0);
|
uint32 ModeRefreshRate = theApp.GetConfig("ModeRefreshRate", 0);
|
||||||
|
|
||||||
uint32 nModes = d3d->GetAdapterModeCount(D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8);
|
uint32 nModes = d3d->GetAdapterModeCount(D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8);
|
||||||
|
|
||||||
|
@ -204,27 +202,27 @@ BOOL GSSettingsDlg::OnInitDialog()
|
||||||
renderers.push_back(g_renderers[i]);
|
renderers.push_back(g_renderers[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
GSSetting::InitComboBox(&renderers[0], renderers.size(), m_renderer, pApp->GetProfileInt(_T("Settings"), _T("Renderer"), 0));
|
GSSetting::InitComboBox(&renderers[0], renderers.size(), m_renderer, theApp.GetConfig("Renderer", 0));
|
||||||
GSSetting::InitComboBox(g_psversion, countof(g_psversion), m_psversion, pApp->GetProfileInt(_T("Settings"), _T("PixelShaderVersion2"), D3DPS_VERSION(2, 0)), caps.PixelShaderVersion);
|
GSSetting::InitComboBox(g_psversion, countof(g_psversion), m_psversion, theApp.GetConfig("PixelShaderVersion2", D3DPS_VERSION(2, 0)), caps.PixelShaderVersion);
|
||||||
GSSetting::InitComboBox(g_interlace, countof(g_interlace), m_interlace, pApp->GetProfileInt(_T("Settings"), _T("Interlace"), 0));
|
GSSetting::InitComboBox(g_interlace, countof(g_interlace), m_interlace, theApp.GetConfig("Interlace", 0));
|
||||||
GSSetting::InitComboBox(g_aspectratio, countof(g_aspectratio), m_aspectratio, pApp->GetProfileInt(_T("Settings"), _T("AspectRatio"), 1));
|
GSSetting::InitComboBox(g_aspectratio, countof(g_aspectratio), m_aspectratio, theApp.GetConfig("AspectRatio", 1));
|
||||||
|
|
||||||
OnCbnSelchangeCombo1();
|
OnCbnSelchangeCombo1();
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
m_filter = pApp->GetProfileInt(_T("Settings"), _T("filter"), 1);
|
m_filter = theApp.GetConfig("filter", 1);
|
||||||
m_vsync = !!pApp->GetProfileInt(_T("Settings"), _T("vsync"), FALSE);
|
m_vsync = !!theApp.GetConfig("vsync", 0);
|
||||||
m_logz = !!pApp->GetProfileInt(_T("Settings"), _T("logz"), FALSE);
|
m_logz = !!theApp.GetConfig("logz", 0);
|
||||||
m_fba = !!pApp->GetProfileInt(_T("Settings"), _T("fba"), TRUE);
|
m_fba = !!theApp.GetConfig("fba", 1);
|
||||||
m_aa1 = !!pApp->GetProfileInt(_T("Settings"), _T("aa1"), FALSE);
|
m_aa1 = !!theApp.GetConfig("aa1", 0);
|
||||||
m_blur = !!pApp->GetProfileInt(_T("Settings"), _T("blur"), FALSE);
|
m_blur = !!theApp.GetConfig("blur", 0);
|
||||||
|
|
||||||
m_resx.SetRange(512, 4096);
|
m_resx.SetRange(512, 4096);
|
||||||
m_resy.SetRange(512, 4096);
|
m_resy.SetRange(512, 4096);
|
||||||
m_resx.SetPos(pApp->GetProfileInt(_T("Settings"), _T("resx"), 1024));
|
m_resx.SetPos(theApp.GetConfig("resx", 1024));
|
||||||
m_resy.SetPos(pApp->GetProfileInt(_T("Settings"), _T("resy"), 1024));
|
m_resy.SetPos(theApp.GetConfig("resy", 1024));
|
||||||
m_nativeres = !!pApp->GetProfileInt(_T("Settings"), _T("nativeres"), FALSE);
|
m_nativeres = !!theApp.GetConfig("nativeres", 0);
|
||||||
|
|
||||||
m_resx.EnableWindow(!m_nativeres);
|
m_resx.EnableWindow(!m_nativeres);
|
||||||
m_resy.EnableWindow(!m_nativeres);
|
m_resy.EnableWindow(!m_nativeres);
|
||||||
|
@ -232,7 +230,7 @@ BOOL GSSettingsDlg::OnInitDialog()
|
||||||
m_resyedit.EnableWindow(!m_nativeres);
|
m_resyedit.EnableWindow(!m_nativeres);
|
||||||
|
|
||||||
m_swthreads.SetRange(1, 16);
|
m_swthreads.SetRange(1, 16);
|
||||||
m_swthreads.SetPos(pApp->GetProfileInt(_T("Settings"), _T("swthreads"), 1));
|
m_swthreads.SetPos(theApp.GetConfig("swthreads", 1));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -244,50 +242,48 @@ BOOL GSSettingsDlg::OnInitDialog()
|
||||||
|
|
||||||
void GSSettingsDlg::OnOK()
|
void GSSettingsDlg::OnOK()
|
||||||
{
|
{
|
||||||
CWinApp* pApp = AfxGetApp();
|
|
||||||
|
|
||||||
UpdateData();
|
UpdateData();
|
||||||
|
|
||||||
if(m_resolution.GetCurSel() >= 0)
|
if(m_resolution.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
D3DDISPLAYMODE& mode = *(D3DDISPLAYMODE*)m_resolution.GetItemData(m_resolution.GetCurSel());
|
D3DDISPLAYMODE& mode = *(D3DDISPLAYMODE*)m_resolution.GetItemData(m_resolution.GetCurSel());
|
||||||
|
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("ModeWidth"), mode.Width);
|
theApp.SetConfig("ModeWidth", (int)mode.Width);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("ModeHeight"), mode.Height);
|
theApp.SetConfig("ModeHeight", (int)mode.Height);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("ModeRefreshRate"), mode.RefreshRate);
|
theApp.SetConfig("ModeRefreshRate", (int)mode.RefreshRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_renderer.GetCurSel() >= 0)
|
if(m_renderer.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("Renderer"), (uint32)m_renderer.GetItemData(m_renderer.GetCurSel()));
|
theApp.SetConfig("Renderer", (uint32)m_renderer.GetItemData(m_renderer.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_psversion.GetCurSel() >= 0)
|
if(m_psversion.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("PixelShaderVersion2"), (uint32)m_psversion.GetItemData(m_psversion.GetCurSel()));
|
theApp.SetConfig("PixelShaderVersion2", (uint32)m_psversion.GetItemData(m_psversion.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_interlace.GetCurSel() >= 0)
|
if(m_interlace.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("Interlace"), (uint32)m_interlace.GetItemData(m_interlace.GetCurSel()));
|
theApp.SetConfig("Interlace", (uint32)m_interlace.GetItemData(m_interlace.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_aspectratio.GetCurSel() >= 0)
|
if(m_aspectratio.GetCurSel() >= 0)
|
||||||
{
|
{
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("AspectRatio"), (uint32)m_aspectratio.GetItemData(m_aspectratio.GetCurSel()));
|
theApp.SetConfig("AspectRatio", (uint32)m_aspectratio.GetItemData(m_aspectratio.GetCurSel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("filter"), m_filter);
|
theApp.SetConfig("filter", m_filter);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("vsync"), m_vsync);
|
theApp.SetConfig("vsync", m_vsync);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("logz"), m_logz);
|
theApp.SetConfig("logz", m_logz);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("fba"), m_fba);
|
theApp.SetConfig("fba", m_fba);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("aa1"), m_aa1);
|
theApp.SetConfig("aa1", m_aa1);
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("blur"), m_blur);
|
theApp.SetConfig("blur", m_blur);
|
||||||
|
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("resx"), m_resx.GetPos());
|
theApp.SetConfig("resx", m_resx.GetPos());
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("resy"), m_resy.GetPos());
|
theApp.SetConfig("resy", m_resy.GetPos());
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("swthreads"), m_swthreads.GetPos());
|
theApp.SetConfig("swthreads", m_swthreads.GetPos());
|
||||||
pApp->WriteProfileInt(_T("Settings"), _T("nativeres"), m_nativeres);
|
theApp.SetConfig("nativeres", m_nativeres);
|
||||||
|
|
||||||
__super::OnOK();
|
__super::OnOK();
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,6 +182,8 @@ public:
|
||||||
|
|
||||||
GSVector4i fit(int preset) const;
|
GSVector4i fit(int preset) const;
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
operator LPCRECT() const
|
operator LPCRECT() const
|
||||||
{
|
{
|
||||||
return (LPCRECT)this;
|
return (LPCRECT)this;
|
||||||
|
@ -192,6 +194,8 @@ public:
|
||||||
return (LPRECT)this;
|
return (LPRECT)this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
uint32 rgba32() const
|
uint32 rgba32() const
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
|
#include "GSdx.h"
|
||||||
#include "GSWnd.h"
|
#include "GSWnd.h"
|
||||||
|
|
||||||
BEGIN_MESSAGE_MAP(GSWnd, CWnd)
|
BEGIN_MESSAGE_MAP(GSWnd, CWnd)
|
||||||
|
@ -51,7 +52,7 @@ bool GSWnd::Create(const string& title)
|
||||||
|
|
||||||
r = CRect(r.CenterPoint() - CSize(s.cx / 2, s.cy / 2), s);
|
r = CRect(r.CenterPoint() - CSize(s.cx / 2, s.cy / 2), s);
|
||||||
|
|
||||||
LPCTSTR wc = AfxRegisterWndClass(CS_VREDRAW|CS_HREDRAW|CS_DBLCLKS, AfxGetApp()->LoadStandardCursor(IDC_ARROW), 0, 0);
|
LPCTSTR wc = AfxRegisterWndClass(CS_VREDRAW|CS_HREDRAW|CS_DBLCLKS, theApp.LoadStandardCursor(IDC_ARROW), 0, 0);
|
||||||
|
|
||||||
return !!CreateEx(0, wc, title.c_str(), WS_OVERLAPPEDWINDOW, r, NULL, 0);
|
return !!CreateEx(0, wc, title.c_str(), WS_OVERLAPPEDWINDOW, r, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,15 +51,12 @@
|
||||||
// details.
|
// details.
|
||||||
//
|
//
|
||||||
|
|
||||||
BEGIN_MESSAGE_MAP(GSdxApp, CWinApp)
|
GSdxApp theApp;
|
||||||
END_MESSAGE_MAP()
|
|
||||||
|
|
||||||
GSdxApp::GSdxApp()
|
GSdxApp::GSdxApp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GSdxApp theApp;
|
|
||||||
|
|
||||||
BOOL GSdxApp::InitInstance()
|
BOOL GSdxApp::InitInstance()
|
||||||
{
|
{
|
||||||
__super::InitInstance();
|
__super::InitInstance();
|
||||||
|
@ -97,3 +94,23 @@ BOOL GSdxApp::InitInstance()
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string GSdxApp::GetConfig(const char* entry, const char* value)
|
||||||
|
{
|
||||||
|
return string(GetProfileString("Settings", entry, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
void GSdxApp::SetConfig(const char* entry, const char* value)
|
||||||
|
{
|
||||||
|
WriteProfileString("Settings", entry, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int GSdxApp::GetConfig(const char* entry, int value)
|
||||||
|
{
|
||||||
|
return GetProfileInt("Settings", entry, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GSdxApp::SetConfig(const char* entry, int value)
|
||||||
|
{
|
||||||
|
WriteProfileInt("Settings", entry, value);
|
||||||
|
}
|
||||||
|
|
|
@ -21,17 +21,18 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef __AFXWIN_H__
|
|
||||||
#error include 'stdafx.h' before including this file for PCH
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class GSdxApp : public CWinApp
|
class GSdxApp : public CWinApp
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
virtual BOOL InitInstance();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSdxApp();
|
GSdxApp();
|
||||||
|
|
||||||
public:
|
string GetConfig(const char* entry, const char* value);
|
||||||
virtual BOOL InitInstance();
|
void SetConfig(const char* entry, const char* value);
|
||||||
|
int GetConfig(const char* entry, int value);
|
||||||
DECLARE_MESSAGE_MAP()
|
void SetConfig(const char* entry, int value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern GSdxApp theApp;
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#pragma warning(disable: 4996 4995 4324 4100)
|
#pragma warning(disable: 4996 4995 4324 4100)
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
#ifndef VC_EXTRALEAN
|
#ifndef VC_EXTRALEAN
|
||||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,11 +37,13 @@
|
||||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||||
//#include <afxmt.h>
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// stdc
|
// stdc
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
Loading…
Reference in New Issue