From 2ede9531258f1fe57f41701e08132b293843ecdf Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Fri, 23 Oct 2009 14:32:01 +0000 Subject: [PATCH] GSdx: - Worked on the configuration dialog, bringing in the scaler option - Changed the DeviceSize code to use Jake's kinda better method. Fixes some odd resolution games :) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2061 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSSettingsDlg.cpp | 18 ++++++++++++- plugins/GSdx/GSSettingsDlg.h | 1 + plugins/GSdx/GSState.cpp | 7 ++++- plugins/GSdx/GSTextureCache.cpp | 5 ++++ plugins/GSdx/GSdx.rc | 47 ++++++++++++++++++--------------- plugins/GSdx/resource.h | 1 + 6 files changed, 55 insertions(+), 24 deletions(-) diff --git a/plugins/GSdx/GSSettingsDlg.cpp b/plugins/GSdx/GSSettingsDlg.cpp index fdac28dcf3..bf77d66d61 100644 --- a/plugins/GSdx/GSSettingsDlg.cpp +++ b/plugins/GSdx/GSSettingsDlg.cpp @@ -63,6 +63,14 @@ GSSetting GSSettingsDlg::g_aspectratio[] = {2, "16:9", NULL}, }; +GSSetting GSSettingsDlg::g_accurateScaleMulti[] = +{ + {1, "1x (Use D3D internal Res)", NULL}, + {2, "2x", NULL}, + {3, "3x", NULL}, + {4, "4x", NULL}, +}; + GSSettingsDlg::GSSettingsDlg() : GSDialog(IDD_CONFIG) { @@ -119,6 +127,7 @@ void GSSettingsDlg::OnInit() ComboBoxInit(IDC_RENDERER, &renderers[0], renderers.size(), theApp.GetConfig("Renderer", 0)); ComboBoxInit(IDC_INTERLACE, g_interlace, countof(g_interlace), theApp.GetConfig("Interlace", 0)); ComboBoxInit(IDC_ASPECTRATIO, g_aspectratio, countof(g_aspectratio), theApp.GetConfig("AspectRatio", 1)); + ComboBoxInit(IDC_ACCURATESCALEMULTI, g_accurateScaleMulti, countof(g_accurateScaleMulti), theApp.GetConfig("accurateScaleMulti", 0)); CheckDlgButton(m_hWnd, IDC_WINDOWED, theApp.GetConfig("windowed", 1)); CheckDlgButton(m_hWnd, IDC_FILTER, theApp.GetConfig("filter", 2)); @@ -179,7 +188,12 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code) { theApp.SetConfig("AspectRatio", (int)data); } - + + if(ComboBoxGetSelData(IDC_ACCURATESCALEMULTI, data)) + { + theApp.SetConfig("accurateScaleMulti", (int)data); + } + theApp.SetConfig("windowed", (int)IsDlgButtonChecked(m_hWnd, IDC_WINDOWED)); theApp.SetConfig("filter", (int)IsDlgButtonChecked(m_hWnd, IDC_FILTER)); theApp.SetConfig("paltex", (int)IsDlgButtonChecked(m_hWnd, IDC_PALTEX)); @@ -193,6 +207,7 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code) 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("swthreads", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_GETPOS, 0, 0)); + } return __super::OnCommand(hWnd, id, code); @@ -222,6 +237,7 @@ void GSSettingsDlg::UpdateControls() EnableWindow(GetDlgItem(m_hWnd, IDC_RESX_EDIT), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_RESY), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_RESY_EDIT), hw && !native); + EnableWindow(GetDlgItem(m_hWnd, IDC_ACCURATESCALEMULTI), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_NATIVERES), hw); EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_PALTEX), hw); diff --git a/plugins/GSdx/GSSettingsDlg.h b/plugins/GSdx/GSSettingsDlg.h index 82e947eabc..1c2a1e1a79 100644 --- a/plugins/GSdx/GSSettingsDlg.h +++ b/plugins/GSdx/GSSettingsDlg.h @@ -40,4 +40,5 @@ public: static GSSetting g_renderers[]; static GSSetting g_interlace[]; static GSSetting g_aspectratio[]; + static GSSetting g_accurateScaleMulti[]; }; \ No newline at end of file diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 18493aba11..d2ffc75557 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -276,13 +276,18 @@ GSVector2i GSState::GetDeviceSize(int i) int w = r.width(); int h = r.height(); - if(h == 2 * 416 || h == 2 * 448 || h == 2 * 512) + /*if(h == 2 * 416 || h == 2 * 448 || h == 2 * 512) { h /= 2; } else { h = (m_regs->SMODE1.CMOD & 1) ? 512 : 448; + }*/ + + //Fixme : Just slightly better than the hack above + if(m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1){ + if (!IsEnabled(0) || !IsEnabled(1)){h >>= 1;} } return GSVector2i(w, h); diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index fa07be2a4f..71c221e631 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -565,6 +565,11 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con GSVector4 size = GSVector4(dstsize).xyxy(); GSVector4 scale = GSVector4(dst->m_texture->GetScale()).xyxy(); + + if (dst->m_TEX0.TBW < TEX0.TBW) // otherwise scale.x need to be reduced to make the larger texture fit + { + scale.x *= (dst->m_TEX0.TBW/TEX0.TBW); + } int blockWidth = 64; int blockHeight = TEX0.PSM == PSM_PSMCT32 || TEX0.PSM == PSM_PSMCT24 ? 32 : 64; diff --git a/plugins/GSdx/GSdx.rc b/plugins/GSdx/GSdx.rc index af187f972d..286e29a076 100644 --- a/plugins/GSdx/GSdx.rc +++ b/plugins/GSdx/GSdx.rc @@ -70,7 +70,7 @@ IDB_LOGO10 BITMAP "res\\logo10.bmp" // Dialog // -IDD_CONFIG DIALOGEX 0, 0, 189, 247 +IDD_CONFIG DIALOGEX 0, 0, 189, 298 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Settings..." FONT 8, "MS Shell Dlg", 400, 0, 0x1 @@ -85,25 +85,29 @@ BEGIN COMBOBOX IDC_INTERLACE,71,87,111,98,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Aspect Ratio (F6):",IDC_STATIC,7,105,60,8 COMBOBOX IDC_ASPECTRATIO,71,102,111,98,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "D3D internal res:",IDC_STATIC,7,120,55,8 - EDITTEXT IDC_RESX_EDIT,71,117,35,13,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_RESX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,99,120,11,14 - EDITTEXT IDC_RESY_EDIT,109,117,35,13,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_RESY,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,133,120,11,14 - CONTROL "Native",IDC_NATIVERES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,149,119,33,10 - LTEXT "SW rend. threads:",IDC_STATIC,7,134,60,8 - EDITTEXT IDC_SWTHREADS_EDIT,71,132,35,13,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SWTHREADS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,99,135,11,14 - CONTROL "Texture filtering",IDC_FILTER,"Button",BS_AUTO3STATE | WS_TABSTOP,7,152,67,10 - CONTROL "Logarithmic Z",IDC_LOGZ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,153,58,10 - CONTROL "Allow 8-bit textures",IDC_PALTEX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,165,82,10 - CONTROL "Alpha correction (FBA)",IDC_FBA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,166,93,10 - CONTROL "Wait VSync",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,179,51,10 - CONTROL "Windowed",IDC_WINDOWED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,179,93,10 - CONTROL "Edge anti-aliasing (AA1, sw-mode only)",IDC_AA1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,193,141,10 - CONTROL "Enable output merger blur effect",IDC_BLUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,207,121,10 - DEFPUSHBUTTON "OK",IDOK,43,226,50,14 - PUSHBUTTON "Cancel",IDCANCEL,96,226,50,14 + LTEXT "D3D internal res:",IDC_STATIC,7,133,55,8 + EDITTEXT IDC_RESX_EDIT,71,130,35,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_RESX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,99,133,11,14 + EDITTEXT IDC_RESY_EDIT,109,130,35,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_RESY,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,133,133,11,14 + CONTROL "Native",IDC_NATIVERES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,164,33,10 + LTEXT "SW rend. threads:",IDC_STATIC,7,181,60,8 + EDITTEXT IDC_SWTHREADS_EDIT,71,179,35,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_SWTHREADS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,99,182,11,14 + CONTROL "Texture filtering",IDC_FILTER,"Button",BS_AUTO3STATE | WS_TABSTOP,7,199,67,10 + CONTROL "Logarithmic Z",IDC_LOGZ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,200,58,10 + CONTROL "Allow 8-bit textures",IDC_PALTEX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,212,82,10 + CONTROL "Alpha correction (FBA)",IDC_FBA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,213,93,10 + CONTROL "Wait VSync",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,226,51,10 + CONTROL "Windowed",IDC_WINDOWED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,89,226,93,10 + CONTROL "Edge anti-aliasing (AA1, sw-mode only)",IDC_AA1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,240,141,10 + CONTROL "Enable output merger blur effect",IDC_BLUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,254,121,10 + DEFPUSHBUTTON "OK",IDOK,43,277,50,14 + PUSHBUTTON "Cancel",IDCANCEL,96,277,50,14 + COMBOBOX IDC_ACCURATESCALEMULTI,71,145,111,98,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Or use Scaling:",IDC_STATIC,7,149,49,8 + LTEXT "D3D Enhancements (can cause glitches)",IDC_STATIC,31,118,128,8 + LTEXT "Or use original PS2 resolution :",IDC_STATIC,7,164,99,8 END IDD_CAPTURE DIALOGEX 0, 0, 279, 71 @@ -166,7 +170,7 @@ BEGIN VERTGUIDE, 89 VERTGUIDE, 182 TOPMARGIN, 7 - BOTTOMMARGIN, 240 + BOTTOMMARGIN, 291 HORZGUIDE, 49 END @@ -244,4 +248,3 @@ END ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED - diff --git a/plugins/GSdx/resource.h b/plugins/GSdx/resource.h index 7d291cdced..f6bef92ba8 100644 --- a/plugins/GSdx/resource.h +++ b/plugins/GSdx/resource.h @@ -35,6 +35,7 @@ #define IDC_ASPECTRATIO 2031 #define IDC_SWTHREADS 2032 #define IDC_SCALE 2033 +#define IDC_ACCURATESCALEMULTI 2033 #define IDC_BROWSE 2034 #define IDC_FILENAME 2035 #define IDC_WIDTH 2036