From 1445bf7fb1312ec23445a2ae76133f447dcd47d1 Mon Sep 17 00:00:00 2001 From: Akash Date: Fri, 12 Feb 2016 04:40:41 +0530 Subject: [PATCH 1/5] GSDX: Extend macros for all video modes. The following patch detects the other video modes based on Phased lock loop divider (LC) --- plugins/GSdx/GS.h | 16 +++++++++++++--- plugins/GSdx/GSState.cpp | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/plugins/GSdx/GS.h b/plugins/GSdx/GS.h index 12231ce023..b1c7fb5bfd 100644 --- a/plugins/GSdx/GS.h +++ b/plugins/GSdx/GS.h @@ -1285,6 +1285,16 @@ enum stateType {ST_WRITE, ST_TRANSFER, ST_VSYNC}; #define DEFAULT_EXTRA_RENDERING_THREADS 2 // GS Video modes macros -#define Vmode_VESA (m_regs->SMODE1.CMOD == 0) -#define Vmode_NTSC (m_regs->SMODE1.CMOD == 2) -#define Vmode_PAL (m_regs->SMODE1.CMOD == 3) +#define Vmode_VESA_DTV (m_regs->SMODE1.CMOD == 0) +#define Vmode_NTSC (m_regs->SMODE1.CMOD == 2) +#define Vmode_PAL (m_regs->SMODE1.CMOD == 3) +#define Vmode_VESA_1A (m_regs->SMODE1.LC == 15 && Vmode_VESA_DTV) +#define Vmode_VESA_1C (m_regs->SMODE1.LC == 28 && Vmode_VESA_DTV) +#define Vmode_VESA_2B (m_regs->SMODE1.LC == 71 && Vmode_VESA_DTV) +#define Vmode_VESA_2D (m_regs->SMODE1.LC == 44 && Vmode_VESA_DTV) +#define Vmode_VESA_3B (m_regs->SMODE1.LC == 58 && Vmode_VESA_DTV) +#define Vmode_VESA_3D (m_regs->SMODE1.LC == 35 && Vmode_VESA_DTV) +#define Vmode_VESA_4A (m_regs->SMODE1.LC == 8 && Vmode_VESA_DTV) +#define Vmode_VESA_4B (m_regs->SMODE1.LC == 10 && Vmode_VESA_DTV) +#define Vmode_DTV_480P (m_regs->SMODE1.LC == 32 && Vmode_VESA_DTV) +#define Vmode_DTV_720P_1080I (m_regs->SMODE1.LC == 22 && Vmode_VESA_DTV) diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 0e076fe3a8..a00c4c3a87 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -354,7 +354,7 @@ GSVector4i GSState::GetDisplayRect(int i) GSVector4i r; //Some games (such as Pool Paradise) use alternate line reading and provide a massive height which is really half. - if (height > 640 && !Vmode_VESA) + if (height > 640 && !Vmode_VESA_DTV) { height /= 2; } From 67a7a63a3664342d490ba1db5b7c8ddad7ecc924 Mon Sep 17 00:00:00 2001 From: Akash Date: Fri, 12 Feb 2016 05:28:30 +0530 Subject: [PATCH 2/5] GSDX: Add vertical frequency for all video modes --- plugins/GSdx/GSState.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index a00c4c3a87..b96a95ae39 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -467,10 +467,33 @@ bool GSState::IsEnabled(int i) float GSState::GetTvRefreshRate() { - // TODO: Frequencies for VESA / DTV : http://users.neoscientists.org/~blue/ps2videomodes.txt - // SMODE1 PLL Loop divider (LC) could be used for detection of other video modes. CMOD's only useful for NTSC/PAL.(2/3) + float vertical_frequency = 0; - return (Vmode_PAL) ? 50 : (60/1.001f); + switch (m_regs->SMODE1.CMOD) + { + case 0: + { + if (Vmode_VESA_1A) vertical_frequency = 59.94f; + if (Vmode_VESA_1C) vertical_frequency = 75; + if (Vmode_VESA_2B) vertical_frequency = 60.317f; + if (Vmode_VESA_2D) vertical_frequency = 75; + if (Vmode_VESA_3B) vertical_frequency = 60.004f; + if (Vmode_VESA_3D) vertical_frequency = 75.029f; + if (Vmode_VESA_4A) vertical_frequency = 60.020f; + if (Vmode_VESA_4B) vertical_frequency = 75.025f; + if (Vmode_DTV_480P) vertical_frequency = 59.94f; + if (Vmode_DTV_720P_1080I) vertical_frequency = 60; + break; + } + + case 2: vertical_frequency = (60 / 1.001f); //NTSC + break; + case 3: vertical_frequency = 50; //PAL + break; + default: ASSERT(0); + } + + return vertical_frequency; } // GIFPackedRegHandler* From 465cfb4fad7a6599a6fd8a64a9a3ca6c792ff256 Mon Sep 17 00:00:00 2001 From: Akash Date: Fri, 12 Feb 2016 06:04:02 +0530 Subject: [PATCH 3/5] PCSX2-GSFrame: Make upscaling impact resolution values --- plugins/GSdx/GSRenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index 32455f0c27..f2c084a0a6 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -363,7 +363,7 @@ void GSRenderer::VSync(int field) s = format( "%lld | %d x %d | %.2f fps (%d%%) | %s - %s | %s | %d S/%d P/%d D | %d%% CPU | %.2f | %.2f", - m_perfmon.GetFrame(), r.width(), r.height(), fps, (int)(100.0 * fps / GetTvRefreshRate()), + m_perfmon.GetFrame(), GetInternalResolution().x, GetInternalResolution().y, fps, (int)(100.0 * fps / GetTvRefreshRate()), s2.c_str(), theApp.m_gs_interlace[m_interlace].name.c_str(), theApp.m_gs_aspectratio[m_aspectratio].name.c_str(), @@ -395,7 +395,7 @@ void GSRenderer::VSync(int field) { // Satisfy PCSX2's request for title info: minimal verbosity due to more external title text - s = format("%dx%d | %s", r.width(), r.height(), theApp.m_gs_interlace[m_interlace].name.c_str()); + s = format("%dx%d | %s", GetInternalResolution().x, GetInternalResolution().y, theApp.m_gs_interlace[m_interlace].name.c_str()); } if(m_capture.IsCapturing()) From e810428c86469df32939eb3b0baaa6db11ead02d Mon Sep 17 00:00:00 2001 From: Akash Date: Fri, 12 Feb 2016 12:04:11 +0530 Subject: [PATCH 4/5] GSDX: Remove some old comments Disgaea 2 intro FMV now works fine with/without upscaling. (confirmed with rama) --- plugins/GSdx/GSState.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index b96a95ae39..8ccbfaba8a 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -370,8 +370,6 @@ GSVector4i GSState::GetDisplayRect(int i) return r; } -// There's a problem when games expand/shrink and relocate the visible area since GSdx doesn't support -// moving the output area. (Disgaea 2 intro FMV when upscaling is used). GSVector4i GSState::GetFrameRect(int i) { if (i < 0) i = IsEnabled(1) ? 1 : 0; @@ -391,7 +389,6 @@ GSVector4i GSState::GetFrameRect(int i) if (m_regs->SMODE2.INT && m_regs->SMODE2.FFMD && h > 1) h >>= 1; - //watch Disgaea2 FMV borders when changing r.left = m_regs->DISP[i].DISPFB.DBX; r.top = m_regs->DISP[i].DISPFB.DBY; r.right = r.left + w; From a20edc17839502e9d5387913877c65ea18776ea7 Mon Sep 17 00:00:00 2001 From: Akash Date: Fri, 12 Feb 2016 05:28:55 +0530 Subject: [PATCH 5/5] GitIgnore: Ignore wav files for local diff --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 59f1157f90..d0e8a74b92 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.bsc *.aps *.exe +*.wav *.trace *.dump