PCSX2: "FMV Aspect Ratio Switch/Override" feature.

Change "Switch to 4:3 aspect ratio when an FMV plays" to
"FMV Aspect Ratio Override" drop down menu.

The option temporarily changes the Aspect Ratio to either
16:9 or 4:3 depending on the option that is selected,
and depending on the Window Aspect ratio that is selected.

Original commit:
8d471e1f16

Co author: lightningterror.
This commit is contained in:
FlatOutPS2 2018-10-23 20:58:28 +02:00 committed by lightningterror
parent 292e7a6573
commit fd7a862226
7 changed files with 62 additions and 23 deletions

View File

@ -409,7 +409,7 @@ static __ri void ipuBDEC(tIPU_CMD_BDEC bdec)
static __fi bool ipuVDEC(u32 val) static __fi bool ipuVDEC(u32 val)
{ {
if (EmuConfig.Gamefixes.FMVinSoftwareHack || g_Conf->GSWindow.IsToggleAspectRatioSwitch) { if (EmuConfig.Gamefixes.FMVinSoftwareHack || g_Conf->GSWindow.FMVAspectRatioSwitch != FMV_AspectRatio_Switch_Off) {
static int count = 0; static int count = 0;
if (count++ > 5) { if (count++ > 5) {
if (!FMVstarted) { if (!FMVstarted) {

View File

@ -817,6 +817,7 @@ AppConfig::GSWindowOptions::GSWindowOptions()
DisableScreenSaver = true; DisableScreenSaver = true;
AspectRatio = AspectRatio_4_3; AspectRatio = AspectRatio_4_3;
FMVAspectRatioSwitch = FMV_AspectRatio_Switch_Off;
Zoom = 100; Zoom = 100;
StretchY = 100; StretchY = 100;
OffsetX = 0; OffsetX = 0;
@ -829,7 +830,6 @@ AppConfig::GSWindowOptions::GSWindowOptions()
EnableVsyncWindowFlag = false; EnableVsyncWindowFlag = false;
IsToggleFullscreenOnDoubleClick = true; IsToggleFullscreenOnDoubleClick = true;
IsToggleAspectRatioSwitch = false;
} }
void AppConfig::GSWindowOptions::SanityCheck() void AppConfig::GSWindowOptions::SanityCheck()
@ -868,7 +868,6 @@ void AppConfig::GSWindowOptions::LoadSave( IniInterface& ini )
IniEntry( EnableVsyncWindowFlag ); IniEntry( EnableVsyncWindowFlag );
IniEntry( IsToggleFullscreenOnDoubleClick ); IniEntry( IsToggleFullscreenOnDoubleClick );
IniEntry( IsToggleAspectRatioSwitch );
static const wxChar* AspectRatioNames[] = static const wxChar* AspectRatioNames[] =
{ {
@ -880,6 +879,18 @@ void AppConfig::GSWindowOptions::LoadSave( IniInterface& ini )
}; };
ini.EnumEntry( L"AspectRatio", AspectRatio, AspectRatioNames, AspectRatio ); ini.EnumEntry( L"AspectRatio", AspectRatio, AspectRatioNames, AspectRatio );
static const wxChar* FMVAspectRatioSwitchNames[] =
{
// FIXME: fmv_aspect_ratio_switch_labels[] is inverted
L"Off", // Standard (4:3)
L"4:3", // Widescreen (16:9)
L"16:9", // Off
// WARNING: array must be NULL terminated to compute it size
NULL
};
ini.EnumEntry(L"FMVAspectRatioSwitch", FMVAspectRatioSwitch, FMVAspectRatioSwitchNames, FMVAspectRatioSwitch);
IniEntry( Zoom ); IniEntry( Zoom );
if( ini.IsLoading() ) SanityCheck(); if( ini.IsLoading() ) SanityCheck();

View File

@ -96,6 +96,14 @@ enum AspectRatioType
AspectRatio_MaxCount AspectRatio_MaxCount
}; };
enum FMVAspectRatioSwitchType
{
FMV_AspectRatio_Switch_4_3,
FMV_AspectRatio_Switch_16_9,
FMV_AspectRatio_Switch_Off,
FMV_AspectRatio_Switch_MaxCount
};
enum MemoryCardType enum MemoryCardType
{ {
MemoryCard_None, MemoryCard_None,
@ -205,6 +213,7 @@ public:
bool DisableScreenSaver; bool DisableScreenSaver;
AspectRatioType AspectRatio; AspectRatioType AspectRatio;
FMVAspectRatioSwitchType FMVAspectRatioSwitch;
Fixed100 Zoom; Fixed100 Zoom;
Fixed100 StretchY; Fixed100 StretchY;
Fixed100 OffsetX; Fixed100 OffsetX;
@ -218,7 +227,6 @@ public:
bool EnableVsyncWindowFlag; bool EnableVsyncWindowFlag;
bool IsToggleFullscreenOnDoubleClick; bool IsToggleFullscreenOnDoubleClick;
bool IsToggleAspectRatioSwitch;
GSWindowOptions(); GSWindowOptions();

View File

@ -517,7 +517,7 @@ extern bool EnableFMV;
void DoFmvSwitch(bool on) void DoFmvSwitch(bool on)
{ {
if (g_Conf->GSWindow.IsToggleAspectRatioSwitch) { if (g_Conf->GSWindow.FMVAspectRatioSwitch != FMV_AspectRatio_Switch_Off) {
if (on) { if (on) {
switchAR = true; switchAR = true;
iniAR = g_Conf->GSWindow.AspectRatio; iniAR = g_Conf->GSWindow.AspectRatio;
@ -546,7 +546,7 @@ void Pcsx2App::LogicalVsync()
FpsManager.DoFrame(); FpsManager.DoFrame();
if (EmuConfig.Gamefixes.FMVinSoftwareHack || g_Conf->GSWindow.IsToggleAspectRatioSwitch) { if (EmuConfig.Gamefixes.FMVinSoftwareHack || g_Conf->GSWindow.FMVAspectRatioSwitch != FMV_AspectRatio_Switch_Off) {
if (EnableFMV) { if (EnableFMV) {
DevCon.Warning("FMV on"); DevCon.Warning("FMV on");
DoFmvSwitch(true); DoFmvSwitch(true);

View File

@ -172,6 +172,12 @@ void GSPanel::DoResize()
targetAr = 4.0 / 3.0; targetAr = 4.0 / 3.0;
else if (g_Conf->GSWindow.AspectRatio == AspectRatio_16_9) else if (g_Conf->GSWindow.AspectRatio == AspectRatio_16_9)
targetAr = 16.0 / 9.0; targetAr = 16.0 / 9.0;
} else if (switchAR) {
if (g_Conf->GSWindow.FMVAspectRatioSwitch == FMV_AspectRatio_Switch_4_3 && g_Conf->GSWindow.AspectRatio != AspectRatio_4_3) {
targetAr = 4.0 / 3.0;
} else if (g_Conf->GSWindow.FMVAspectRatioSwitch == FMV_AspectRatio_Switch_16_9 && g_Conf->GSWindow.AspectRatio != AspectRatio_16_9) {
targetAr = 16.0 / 9.0;
}
} else { } else {
targetAr = 4.0 / 3.0; targetAr = 4.0 / 3.0;
} }

View File

@ -267,6 +267,7 @@ namespace Panels
{ {
protected: protected:
wxComboBox* m_combo_AspectRatio; wxComboBox* m_combo_AspectRatio;
wxComboBox* m_combo_FMVAspectRatioSwitch;
wxComboBox* m_combo_vsync; wxComboBox* m_combo_vsync;
wxTextCtrl* m_text_Zoom; wxTextCtrl* m_text_Zoom;
@ -287,7 +288,6 @@ namespace Panels
pxCheckBox* m_check_HideMouse; pxCheckBox* m_check_HideMouse;
pxCheckBox* m_check_DclickFullscreen; pxCheckBox* m_check_DclickFullscreen;
pxCheckBox* m_check_AspectRatioSwitch;
wxTextCtrl* m_text_WindowWidth; wxTextCtrl* m_text_WindowWidth;
wxTextCtrl* m_text_WindowHeight; wxTextCtrl* m_text_WindowHeight;

View File

@ -32,6 +32,13 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent )
_("Widescreen (16:9)") _("Widescreen (16:9)")
}; };
const wxString fmv_aspect_ratio_switch_labels[] =
{
_("Standard (4:3)"),
_("Widescreen (16:9)"),
_("Off (Default)")
};
// Warning must match the order of the VsyncMode Enum // Warning must match the order of the VsyncMode Enum
const wxString vsync_label[] = const wxString vsync_label[] =
{ {
@ -45,6 +52,9 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent )
m_combo_AspectRatio = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_combo_AspectRatio = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
ArraySize(aspect_ratio_labels), aspect_ratio_labels, wxCB_READONLY ); ArraySize(aspect_ratio_labels), aspect_ratio_labels, wxCB_READONLY );
m_combo_FMVAspectRatioSwitch = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
ArraySize(fmv_aspect_ratio_switch_labels), fmv_aspect_ratio_switch_labels, wxCB_READONLY);
m_combo_vsync = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_combo_vsync = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
ArraySize(vsync_label), vsync_label, wxCB_READONLY ); ArraySize(vsync_label), vsync_label, wxCB_READONLY );
@ -59,9 +69,12 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent )
m_check_CloseGS = new pxCheckBox( this, _("Hide window when paused") ); m_check_CloseGS = new pxCheckBox( this, _("Hide window when paused") );
m_check_Fullscreen = new pxCheckBox( this, _("Default to fullscreen mode on open") ); m_check_Fullscreen = new pxCheckBox( this, _("Default to fullscreen mode on open") );
m_check_DclickFullscreen = new pxCheckBox( this, _("Double-click toggles fullscreen mode") ); m_check_DclickFullscreen = new pxCheckBox( this, _("Double-click toggles fullscreen mode") );
m_check_AspectRatioSwitch = new pxCheckBox(this, _("Switch to 4:3 aspect ratio when an FMV plays"));
//m_check_ExclusiveFS = new pxCheckBox( this, _("Use exclusive fullscreen mode (if available)") ); //m_check_ExclusiveFS = new pxCheckBox( this, _("Use exclusive fullscreen mode (if available)") );
m_combo_FMVAspectRatioSwitch->SetToolTip( pxEt( L"4:3: Temporarily switch to a 4:3 aspect ratio while an FMV plays to correctly display an 4:3 FMV.\n\n"
L"16:9: Temporarily switch to a 16:9 aspect ratio while an FMV plays to correctly display a widescreen 16:9 FMV.\n\n"
L"Off: Disables temporary aspect ratio switch.") );
m_text_Zoom->SetToolTip( pxEt( L"Zoom = 100: Fit the entire image to the window without any cropping.\nAbove/Below 100: Zoom In/Out\n0: Automatic-Zoom-In untill the black-bars are gone (Aspect ratio is kept, some of the image goes out of screen).\n NOTE: Some games draw their own black-bars, which will not be removed with '0'.\n\nKeyboard: CTRL + NUMPAD-PLUS: Zoom-In, CTRL + NUMPAD-MINUS: Zoom-Out, CTRL + NUMPAD-*: Toggle 100/0" m_text_Zoom->SetToolTip( pxEt( L"Zoom = 100: Fit the entire image to the window without any cropping.\nAbove/Below 100: Zoom In/Out\n0: Automatic-Zoom-In untill the black-bars are gone (Aspect ratio is kept, some of the image goes out of screen).\n NOTE: Some games draw their own black-bars, which will not be removed with '0'.\n\nKeyboard: CTRL + NUMPAD-PLUS: Zoom-In, CTRL + NUMPAD-MINUS: Zoom-Out, CTRL + NUMPAD-*: Toggle 100/0"
) ); ) );
@ -95,6 +108,8 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent )
s_AspectRatio += Label(_("Aspect Ratio:")) | pxMiddle; s_AspectRatio += Label(_("Aspect Ratio:")) | pxMiddle;
s_AspectRatio += m_combo_AspectRatio | pxAlignRight; s_AspectRatio += m_combo_AspectRatio | pxAlignRight;
s_AspectRatio += Label(_("FMV Aspect Ratio Override:")) | pxMiddle;
s_AspectRatio += m_combo_FMVAspectRatioSwitch | pxAlignRight;
s_AspectRatio += Label(_("Custom Window Size:")) | pxMiddle; s_AspectRatio += Label(_("Custom Window Size:")) | pxMiddle;
s_AspectRatio += s_customsize | pxAlignRight; s_AspectRatio += s_customsize | pxAlignRight;
@ -115,7 +130,6 @@ Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent )
*this += m_check_Fullscreen; *this += m_check_Fullscreen;
*this += m_check_DclickFullscreen; *this += m_check_DclickFullscreen;
*this += m_check_AspectRatioSwitch;
//*this += m_check_ExclusiveFS; //*this += m_check_ExclusiveFS;
*this += new wxStaticLine( this ) | StdExpand(); *this += new wxStaticLine( this ) | StdExpand();
@ -146,10 +160,10 @@ void Panels::GSWindowSettingsPanel::ApplyConfigToGui( AppConfig& configToApply,
m_check_SizeLock ->SetValue( conf.DisableResizeBorders ); m_check_SizeLock ->SetValue( conf.DisableResizeBorders );
m_combo_AspectRatio ->SetSelection( (int)conf.AspectRatio ); m_combo_AspectRatio ->SetSelection( (int)conf.AspectRatio );
m_combo_FMVAspectRatioSwitch->SetSelection( enum_cast( conf.FMVAspectRatioSwitch ) );
m_text_Zoom ->ChangeValue( conf.Zoom.ToString() ); m_text_Zoom ->ChangeValue( conf.Zoom.ToString() );
m_check_DclickFullscreen ->SetValue( conf.IsToggleFullscreenOnDoubleClick ); m_check_DclickFullscreen ->SetValue( conf.IsToggleFullscreenOnDoubleClick );
m_check_AspectRatioSwitch->SetValue( conf.IsToggleAspectRatioSwitch );
m_text_WindowWidth ->ChangeValue( wxsFormat( L"%d", conf.WindowSize.GetWidth() ) ); m_text_WindowWidth ->ChangeValue( wxsFormat( L"%d", conf.WindowSize.GetWidth() ) );
m_text_WindowHeight ->ChangeValue( wxsFormat( L"%d", conf.WindowSize.GetHeight() ) ); m_text_WindowHeight ->ChangeValue( wxsFormat( L"%d", conf.WindowSize.GetHeight() ) );
@ -170,12 +184,12 @@ void Panels::GSWindowSettingsPanel::Apply()
appconf.DisableResizeBorders = m_check_SizeLock ->GetValue(); appconf.DisableResizeBorders = m_check_SizeLock ->GetValue();
appconf.AspectRatio = (AspectRatioType)m_combo_AspectRatio->GetSelection(); appconf.AspectRatio = (AspectRatioType)m_combo_AspectRatio->GetSelection();
appconf.FMVAspectRatioSwitch = (FMVAspectRatioSwitchType)m_combo_FMVAspectRatioSwitch->GetSelection();
appconf.Zoom = Fixed100::FromString( m_text_Zoom->GetValue() ); appconf.Zoom = Fixed100::FromString( m_text_Zoom->GetValue() );
gsconf.VsyncEnable = static_cast<VsyncMode>(m_combo_vsync->GetSelection()); gsconf.VsyncEnable = static_cast<VsyncMode>(m_combo_vsync->GetSelection());
appconf.IsToggleFullscreenOnDoubleClick = m_check_DclickFullscreen->GetValue(); appconf.IsToggleFullscreenOnDoubleClick = m_check_DclickFullscreen->GetValue();
appconf.IsToggleAspectRatioSwitch = m_check_AspectRatioSwitch->GetValue();
long xr, yr = 1; long xr, yr = 1;