- 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
This commit is contained in:
ramapcsx2 2009-10-23 14:32:01 +00:00
parent 06d3e01efe
commit 2ede953125
6 changed files with 55 additions and 24 deletions

View File

@ -63,6 +63,14 @@ GSSetting GSSettingsDlg::g_aspectratio[] =
{2, "16:9", NULL}, {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() GSSettingsDlg::GSSettingsDlg()
: GSDialog(IDD_CONFIG) : GSDialog(IDD_CONFIG)
{ {
@ -119,6 +127,7 @@ void GSSettingsDlg::OnInit()
ComboBoxInit(IDC_RENDERER, &renderers[0], renderers.size(), theApp.GetConfig("Renderer", 0)); 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_INTERLACE, g_interlace, countof(g_interlace), theApp.GetConfig("Interlace", 0));
ComboBoxInit(IDC_ASPECTRATIO, g_aspectratio, countof(g_aspectratio), theApp.GetConfig("AspectRatio", 1)); 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_WINDOWED, theApp.GetConfig("windowed", 1));
CheckDlgButton(m_hWnd, IDC_FILTER, theApp.GetConfig("filter", 2)); CheckDlgButton(m_hWnd, IDC_FILTER, theApp.GetConfig("filter", 2));
@ -180,6 +189,11 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
theApp.SetConfig("AspectRatio", (int)data); 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("windowed", (int)IsDlgButtonChecked(m_hWnd, IDC_WINDOWED));
theApp.SetConfig("filter", (int)IsDlgButtonChecked(m_hWnd, IDC_FILTER)); theApp.SetConfig("filter", (int)IsDlgButtonChecked(m_hWnd, IDC_FILTER));
theApp.SetConfig("paltex", (int)IsDlgButtonChecked(m_hWnd, IDC_PALTEX)); 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("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("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)); theApp.SetConfig("swthreads", (int)SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_GETPOS, 0, 0));
} }
return __super::OnCommand(hWnd, id, code); 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_RESX_EDIT), hw && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_RESY), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_RESY), hw && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_RESY_EDIT), 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_NATIVERES), hw);
EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw && !native); EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_PALTEX), hw); EnableWindow(GetDlgItem(m_hWnd, IDC_PALTEX), hw);

View File

@ -40,4 +40,5 @@ public:
static GSSetting g_renderers[]; static GSSetting g_renderers[];
static GSSetting g_interlace[]; static GSSetting g_interlace[];
static GSSetting g_aspectratio[]; static GSSetting g_aspectratio[];
static GSSetting g_accurateScaleMulti[];
}; };

View File

@ -276,13 +276,18 @@ GSVector2i GSState::GetDeviceSize(int i)
int w = r.width(); int w = r.width();
int h = r.height(); 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; h /= 2;
} }
else else
{ {
h = (m_regs->SMODE1.CMOD & 1) ? 512 : 448; 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); return GSVector2i(w, h);

View File

@ -566,6 +566,11 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
GSVector4 size = GSVector4(dstsize).xyxy(); GSVector4 size = GSVector4(dstsize).xyxy();
GSVector4 scale = GSVector4(dst->m_texture->GetScale()).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 blockWidth = 64;
int blockHeight = TEX0.PSM == PSM_PSMCT32 || TEX0.PSM == PSM_PSMCT24 ? 32 : 64; int blockHeight = TEX0.PSM == PSM_PSMCT32 || TEX0.PSM == PSM_PSMCT24 ? 32 : 64;

View File

@ -70,7 +70,7 @@ IDB_LOGO10 BITMAP "res\\logo10.bmp"
// Dialog // 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 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Settings..." CAPTION "Settings..."
FONT 8, "MS Shell Dlg", 400, 0, 0x1 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 COMBOBOX IDC_INTERLACE,71,87,111,98,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Aspect Ratio (F6):",IDC_STATIC,7,105,60,8 LTEXT "Aspect Ratio (F6):",IDC_STATIC,7,105,60,8
COMBOBOX IDC_ASPECTRATIO,71,102,111,98,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_ASPECTRATIO,71,102,111,98,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "D3D internal res:",IDC_STATIC,7,120,55,8 LTEXT "D3D internal res:",IDC_STATIC,7,133,55,8
EDITTEXT IDC_RESX_EDIT,71,117,35,13,ES_AUTOHSCROLL | ES_NUMBER 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,120,11,14 CONTROL "",IDC_RESX,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,99,133,11,14
EDITTEXT IDC_RESY_EDIT,109,117,35,13,ES_AUTOHSCROLL | ES_NUMBER 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,120,11,14 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,149,119,33,10 CONTROL "Native",IDC_NATIVERES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,164,33,10
LTEXT "SW rend. threads:",IDC_STATIC,7,134,60,8 LTEXT "SW rend. threads:",IDC_STATIC,7,181,60,8
EDITTEXT IDC_SWTHREADS_EDIT,71,132,35,13,ES_AUTOHSCROLL | ES_NUMBER 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,135,11,14 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,152,67,10 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,153,58,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,165,82,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,166,93,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,179,51,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,179,93,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,193,141,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,207,121,10 CONTROL "Enable output merger blur effect",IDC_BLUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,254,121,10
DEFPUSHBUTTON "OK",IDOK,43,226,50,14 DEFPUSHBUTTON "OK",IDOK,43,277,50,14
PUSHBUTTON "Cancel",IDCANCEL,96,226,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 END
IDD_CAPTURE DIALOGEX 0, 0, 279, 71 IDD_CAPTURE DIALOGEX 0, 0, 279, 71
@ -166,7 +170,7 @@ BEGIN
VERTGUIDE, 89 VERTGUIDE, 89
VERTGUIDE, 182 VERTGUIDE, 182
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 240 BOTTOMMARGIN, 291
HORZGUIDE, 49 HORZGUIDE, 49
END END
@ -244,4 +248,3 @@ END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED #endif // not APSTUDIO_INVOKED

View File

@ -35,6 +35,7 @@
#define IDC_ASPECTRATIO 2031 #define IDC_ASPECTRATIO 2031
#define IDC_SWTHREADS 2032 #define IDC_SWTHREADS 2032
#define IDC_SCALE 2033 #define IDC_SCALE 2033
#define IDC_ACCURATESCALEMULTI 2033
#define IDC_BROWSE 2034 #define IDC_BROWSE 2034
#define IDC_FILENAME 2035 #define IDC_FILENAME 2035
#define IDC_WIDTH 2036 #define IDC_WIDTH 2036