- More work on the configuration, preparing for some reorganization.
- 8 Bit textures default to off again, since there are issue reports (mainly from ATI users).
- Add a gamefix that allows users to set an amount of "bad" frames to be skipped.
Add gamefix_skipdraw = x to the GSdx.ini to enable. (More work on this soon)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2085 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2009-10-26 15:52:45 +00:00
parent 6032a142dd
commit 62d2532a1e
10 changed files with 39 additions and 29 deletions

View File

@ -35,9 +35,9 @@ GSRenderer::GSRenderer()
m_vsync = !!theApp.GetConfig("vsync", 0);
m_nativeres = !!theApp.GetConfig("nativeres", 0);
m_accurateScaleMulti = theApp.GetConfig("accurateScaleMulti", 1);
if(m_nativeres) m_accurateScaleMulti = 1;
else if (m_accurateScaleMulti > 4) m_accurateScaleMulti = 1;
m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", 1);
if(m_nativeres) m_upscale_multiplier = 1;
else if (m_upscale_multiplier > 4) m_upscale_multiplier = 1;
m_aa1 = !!theApp.GetConfig("aa1", 0);
m_blur = !!theApp.GetConfig("blur", 0);

View File

@ -41,7 +41,7 @@ protected:
int m_interlace;
int m_aspectratio;
int m_filter;
int m_accurateScaleMulti;
int m_upscale_multiplier;
bool m_vsync;
bool m_nativeres;
bool m_aa1;
@ -89,9 +89,9 @@ public:
{
return !m_nativeres && m_regs->PMODE.EN != 0; // upscale ratio depends on the display size, with no output it may not be set correctly (ps2 logo to game transition)
}
virtual int accurateScaleMulti()
virtual int upscale_Multiplier()
{
return m_accurateScaleMulti;
return m_upscale_multiplier;
}
// TODO : Implement proper locking here *if needed* (not sure yet if it is) --air

View File

@ -32,7 +32,8 @@ class GSRendererHW : public GSRendererT<Vertex>
{
int m_width;
int m_height;
int m_accurateScaleMulti;
int m_upscale_multiplier;
int m_gamefix_skipdraw;
int m_skip;
bool m_reset;
@ -531,7 +532,7 @@ protected:
void Draw()
{
if(IsBadFrame(m_skip)) return;
if(IsBadFrame(m_skip, m_gamefix_skipdraw)) return;
GSDrawingEnvironment& env = m_env;
GSDrawingContext* context = m_context;
@ -710,22 +711,24 @@ public:
, m_tc(tc)
, m_width(1024)
, m_height(1024)
, m_accurateScaleMulti(1)
, m_upscale_multiplier(1)
, m_skip(0)
, m_reset(false)
, m_gamefix_skipdraw (0)
{
if(!m_nativeres)
{
m_width = theApp.GetConfig("resx", m_width);
m_height = theApp.GetConfig("resy", m_height);
m_accurateScaleMulti = theApp.GetConfig("accurateScaleMulti", m_accurateScaleMulti);
if (m_accurateScaleMulti > 4) m_accurateScaleMulti = 1; //use the normal upscale math
if (m_accurateScaleMulti > 1)
m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", m_upscale_multiplier);
if (m_upscale_multiplier > 4) m_upscale_multiplier = 1; //use the normal upscale math
if (m_upscale_multiplier > 1)
{
m_width = 1024 * m_accurateScaleMulti;
m_height = 1024 * m_accurateScaleMulti;
m_width = 1024 * m_upscale_multiplier;
m_height = 1024 * m_upscale_multiplier;
}
}
m_gamefix_skipdraw = theApp.GetConfig("gamefix_skipdraw", m_gamefix_skipdraw);
}
virtual ~GSRendererHW()

View File

@ -63,7 +63,7 @@ GSSetting GSSettingsDlg::g_aspectratio[] =
{2, "16:9", NULL},
};
GSSetting GSSettingsDlg::g_accurateScaleMulti[] =
GSSetting GSSettingsDlg::g_upscale_multiplier[] =
{
{1, "1x (Use D3D internal Res)", NULL},
{2, "2x", NULL},
@ -127,11 +127,11 @@ 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));
ComboBoxInit(IDC_UPSCALE_MULTIPLIER, g_upscale_multiplier, countof(g_upscale_multiplier), theApp.GetConfig("upscale_multiplier", 1));
CheckDlgButton(m_hWnd, IDC_WINDOWED, theApp.GetConfig("windowed", 1));
CheckDlgButton(m_hWnd, IDC_FILTER, theApp.GetConfig("filter", 2));
CheckDlgButton(m_hWnd, IDC_PALTEX, theApp.GetConfig("paltex", 1));
CheckDlgButton(m_hWnd, IDC_PALTEX, theApp.GetConfig("paltex", 0));
CheckDlgButton(m_hWnd, IDC_VSYNC, theApp.GetConfig("vsync", 0));
CheckDlgButton(m_hWnd, IDC_LOGZ, theApp.GetConfig("logz", 1));
CheckDlgButton(m_hWnd, IDC_FBA, theApp.GetConfig("fba", 1));
@ -189,9 +189,13 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
theApp.SetConfig("AspectRatio", (int)data);
}
if(ComboBoxGetSelData(IDC_ACCURATESCALEMULTI, data))
if(ComboBoxGetSelData(IDC_UPSCALE_MULTIPLIER, data))
{
theApp.SetConfig("accurateScaleMulti", (int)data);
theApp.SetConfig("upscale_multiplier", (int)data);
}
else
{
theApp.SetConfig("upscale_multiplier", 1);
}
theApp.SetConfig("windowed", (int)IsDlgButtonChecked(m_hWnd, IDC_WINDOWED));
@ -208,6 +212,7 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
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("gamefix_skipdraw", 0);
}
return __super::OnCommand(hWnd, id, code);
@ -237,7 +242,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_UPSCALE_MULTIPLIER), hw && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_NATIVERES), hw);
EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw && !native);
EnableWindow(GetDlgItem(m_hWnd, IDC_PALTEX), hw);

View File

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

View File

@ -2413,7 +2413,7 @@ bool GSC_RadiataStories(const GSFrameInfo& fi, int& skip)
return true;
}
bool GSState::IsBadFrame(int& skip)
bool GSState::IsBadFrame(int& skip, int gamefix_skipdraw)
{
GSFrameInfo fi;
@ -2481,7 +2481,9 @@ bool GSState::IsBadFrame(int& skip)
{
if(GSUtil::HasSharedBits(fi.FBP, fi.FPSM, fi.TBP0, fi.TPSM))
{
// skip = 1;
if (gamefix_skipdraw > 0) {
skip = gamefix_skipdraw;
}
}
// depth textures (bully, mgs3s1 intro)

View File

@ -130,7 +130,7 @@ class GSState : public GSAlignedClass<16>
void FlushWrite();
protected:
bool IsBadFrame(int& skip);
bool IsBadFrame(int& skip, int gamefix_skipdraw);
typedef void (GSState::*VertexKickPtr)(bool skip);

View File

@ -172,7 +172,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
if(m_renderer->CanUpscale())
{
int multiplier = m_renderer->accurateScaleMulti();
int multiplier = m_renderer->upscale_Multiplier();
if (multiplier > 1) //it's limited to a maximum of 4 on reading the config
{
dst->m_texture->SetScale(GSVector2((float)multiplier, (float)multiplier));

View File

@ -104,7 +104,7 @@ BEGIN
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
COMBOBOX IDC_UPSCALE_MULTIPLIER,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

View File

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