From 6a5bb5df83a4fbeb1229589f919b53533f4b285f Mon Sep 17 00:00:00 2001 From: lightningterror Date: Fri, 21 Dec 2018 16:42:30 +0100 Subject: [PATCH] GSdx: Remove support for D3D9 device on ps1 emu compatibility. Note: Resolution scaling is unavailable right now so I disabled the option, if someone feels like fixing it they can do so. --- plugins/GSdx/GSdx.rc | 2 +- plugins/GSdx/PSX/GPUSettingsDlg.cpp | 45 ++++------------------------- plugins/GSdx/PSX/GPUSettingsDlg.h | 2 -- plugins/GSdx/resource.h | 5 ++-- 4 files changed, 10 insertions(+), 44 deletions(-) diff --git a/plugins/GSdx/GSdx.rc b/plugins/GSdx/GSdx.rc index 88b3b4fecb..82dd96e3df 100644 --- a/plugins/GSdx/GSdx.rc +++ b/plugins/GSdx/GSdx.rc @@ -262,7 +262,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL IDB_PSX_LOGO11,IDC_PSX_LOGO11,"Static",SS_BITMAP,7,7,175,42 CONTROL IDB_PSX_NULL,IDC_PSX_NULL,"Static",SS_BITMAP,7,7,175,42 - LTEXT "Resolution:",IDC_STATIC,7,59,37,8 + LTEXT "Resolution:",IDC_RESOLUTION_TEXT,7,59,37,8 COMBOBOX IDC_RESOLUTION,80,57,102,125,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Renderer:",IDC_STATIC,7,74,34,8 COMBOBOX IDC_RENDERER,80,72,102,118,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP diff --git a/plugins/GSdx/PSX/GPUSettingsDlg.cpp b/plugins/GSdx/PSX/GPUSettingsDlg.cpp index 015fa7ddcb..616761ebe8 100644 --- a/plugins/GSdx/PSX/GPUSettingsDlg.cpp +++ b/plugins/GSdx/PSX/GPUSettingsDlg.cpp @@ -35,36 +35,8 @@ void GPUSettingsDlg::OnInit() { __super::OnInit(); - m_modes.clear(); - - { - D3DDISPLAYMODE mode; - memset(&mode, 0, sizeof(mode)); - m_modes.push_back(mode); - - ComboBoxAppend(IDC_RESOLUTION, "Please select...", (LPARAM)&m_modes.back(), true); - - if(CComPtr d3d = Direct3DCreate9(D3D_SDK_VERSION)) - { - uint32 w = theApp.GetConfigI("ModeWidth"); - uint32 h = theApp.GetConfigI("ModeHeight"); - uint32 hz = theApp.GetConfigI("ModeRefreshRate"); - - uint32 n = d3d->GetAdapterModeCount(D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8); - - for(uint32 i = 0; i < n; i++) - { - if(S_OK == d3d->EnumAdapterModes(D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8, i, &mode)) - { - m_modes.push_back(mode); - - std::string str = format("%dx%d %dHz", mode.Width, mode.Height, mode.RefreshRate); - - ComboBoxAppend(IDC_RESOLUTION, str.c_str(), (LPARAM)&m_modes.back(), w == mode.Width && h == mode.Height && hz == mode.RefreshRate); - } - } - } - } + // FIXME: Someone can fix this to use D3D11 or OGL Device, D3D9 is no longer supported. + ComboBoxAppend(IDC_RESOLUTION, "Please select..."); ComboBoxInit(IDC_RENDERER, theApp.m_gpu_renderers, theApp.GetConfigI("Renderer")); ComboBoxInit(IDC_FILTER, theApp.m_gpu_filter, theApp.GetConfigI("filter")); @@ -90,15 +62,6 @@ bool GPUSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code) { INT_PTR data; - if(ComboBoxGetSelData(IDC_RESOLUTION, data)) - { - const D3DDISPLAYMODE* mode = (D3DDISPLAYMODE*)data; - - theApp.SetConfig("ModeWidth", (int)mode->Width); - theApp.SetConfig("ModeHeight", (int)mode->Height); - theApp.SetConfig("ModeRefreshRate", (int)mode->RefreshRate); - } - if(ComboBoxGetSelData(IDC_RENDERER, data)) { theApp.SetConfig("Renderer", (int)data); @@ -143,6 +106,10 @@ void GPUSettingsDlg::UpdateControls() bool dx11 = renderer == GPURendererType::D3D11_SW; bool null = renderer == GPURendererType::NULL_Renderer; bool sw = !null; + bool resscalenotsupported = true; + + EnableWindow(GetDlgItem(m_hWnd, IDC_RESOLUTION), !resscalenotsupported); + EnableWindow(GetDlgItem(m_hWnd, IDC_RESOLUTION_TEXT), !resscalenotsupported); ShowWindow(GetDlgItem(m_hWnd, IDC_PSX_LOGO11), dx11 ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(m_hWnd, IDC_PSX_NULL), null ? SW_SHOW : SW_HIDE); diff --git a/plugins/GSdx/PSX/GPUSettingsDlg.h b/plugins/GSdx/PSX/GPUSettingsDlg.h index 97c488904e..2b11452e24 100644 --- a/plugins/GSdx/PSX/GPUSettingsDlg.h +++ b/plugins/GSdx/PSX/GPUSettingsDlg.h @@ -26,8 +26,6 @@ class GPUSettingsDlg : public GSDialog { - std::list m_modes; - void UpdateControls(); protected: diff --git a/plugins/GSdx/resource.h b/plugins/GSdx/resource.h index 5fca891b07..77b1ca5d3d 100644 --- a/plugins/GSdx/resource.h +++ b/plugins/GSdx/resource.h @@ -58,8 +58,9 @@ #define IDC_ASPECTRATIO 2077 #define IDC_DITHERING 2078 #define IDC_WINDOWED 2079 -#define IDC_RESOLUTION 2080 -#define IDC_SCALE 2081 +#define IDC_RESOLUTION_TEXT 2080 +#define IDC_RESOLUTION 2081 +#define IDC_SCALE 2082 // Capture: #define IDD_CAPTURE 2090 #define IDC_FILENAME 2091