mirror of https://github.com/PCSX2/pcsx2.git
Config: Move more GS settings to base class
This commit is contained in:
parent
77a890ff4a
commit
bd9b43b482
|
@ -67,20 +67,20 @@ enum class VsyncMode
|
|||
Adaptive,
|
||||
};
|
||||
|
||||
enum AspectRatioType
|
||||
enum class AspectRatioType : u8
|
||||
{
|
||||
AspectRatio_Stretch,
|
||||
AspectRatio_4_3,
|
||||
AspectRatio_16_9,
|
||||
AspectRatio_MaxCount
|
||||
Stretch,
|
||||
R4_3,
|
||||
R16_9,
|
||||
MaxCount
|
||||
};
|
||||
|
||||
enum FMVAspectRatioSwitchType
|
||||
enum class FMVAspectRatioSwitchType : u8
|
||||
{
|
||||
FMV_AspectRatio_Switch_Off,
|
||||
FMV_AspectRatio_Switch_4_3,
|
||||
FMV_AspectRatio_Switch_16_9,
|
||||
FMV_AspectRatio_Switch_MaxCount
|
||||
Off,
|
||||
R4_3,
|
||||
R16_9,
|
||||
MaxCount
|
||||
};
|
||||
|
||||
enum MemoryCardType
|
||||
|
@ -91,6 +91,13 @@ enum MemoryCardType
|
|||
MemoryCard_MaxCount
|
||||
};
|
||||
|
||||
enum class LimiterModeType : u8
|
||||
{
|
||||
Nominal,
|
||||
Turbo,
|
||||
Slomo,
|
||||
};
|
||||
|
||||
// Template function for casting enumerations to their underlying type
|
||||
template <typename Enumeration>
|
||||
typename std::underlying_type<Enumeration>::type enum_cast(Enumeration E)
|
||||
|
@ -325,6 +332,14 @@ struct Pcsx2Config
|
|||
double FramerateNTSC{ 59.94 };
|
||||
double FrameratePAL{ 50.00 };
|
||||
|
||||
AspectRatioType AspectRatio{AspectRatioType::R4_3};
|
||||
FMVAspectRatioSwitchType FMVAspectRatioSwitch{FMVAspectRatioSwitchType::Off};
|
||||
|
||||
double Zoom{100.0};
|
||||
double StretchY{100.0};
|
||||
double OffsetX{0.0};
|
||||
double OffsetY{0.0};
|
||||
|
||||
void LoadSave( IniInterface& conf );
|
||||
|
||||
int GetVsync() const;
|
||||
|
@ -462,6 +477,20 @@ struct Pcsx2Config
|
|||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
struct FramerateOptions
|
||||
{
|
||||
bool SkipOnLimit{false};
|
||||
bool SkipOnTurbo{false};
|
||||
|
||||
double NominalScalar{1.0};
|
||||
double TurboScalar{2.0};
|
||||
double SlomoScalar{0.5};
|
||||
|
||||
void LoadSave(IniInterface& conf);
|
||||
void SanityCheck();
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
struct FolderOptions
|
||||
{
|
||||
|
@ -532,6 +561,7 @@ struct Pcsx2Config
|
|||
GamefixOptions Gamefixes;
|
||||
ProfilerOptions Profiler;
|
||||
DebugOptions Debugger;
|
||||
FramerateOptions Framerate;
|
||||
|
||||
TraceLogFilters Trace;
|
||||
|
||||
|
@ -546,6 +576,8 @@ struct Pcsx2Config
|
|||
wxString CurrentELF;
|
||||
wxString CurrentIRX;
|
||||
wxString CurrentGameArgs;
|
||||
AspectRatioType CurrentAspectRatio = AspectRatioType::R4_3;
|
||||
LimiterModeType LimiterMode = LimiterModeType::Nominal;
|
||||
|
||||
Pcsx2Config();
|
||||
void LoadSave( IniInterface& ini );
|
||||
|
|
16
pcsx2/GS.cpp
16
pcsx2/GS.cpp
|
@ -21,7 +21,7 @@
|
|||
#include "GS.h"
|
||||
#include "Gif_Unit.h"
|
||||
#include "Counters.h"
|
||||
#include "gui/GSFrame.h"
|
||||
#include "Config.h"
|
||||
|
||||
using namespace Threading;
|
||||
using namespace R5900;
|
||||
|
@ -48,16 +48,16 @@ void gsReset()
|
|||
|
||||
void gsUpdateFrequency(Pcsx2Config& config)
|
||||
{
|
||||
switch (g_LimiterMode)
|
||||
switch (EmuConfig.LimiterMode)
|
||||
{
|
||||
case LimiterModeType::Limit_Nominal:
|
||||
config.GS.LimitScalar = g_Conf->Framerate.NominalScalar;
|
||||
case LimiterModeType::Nominal:
|
||||
config.GS.LimitScalar = EmuConfig.Framerate.NominalScalar;
|
||||
break;
|
||||
case LimiterModeType::Limit_Slomo:
|
||||
config.GS.LimitScalar = g_Conf->Framerate.SlomoScalar;
|
||||
case LimiterModeType::Slomo:
|
||||
config.GS.LimitScalar = EmuConfig.Framerate.SlomoScalar;
|
||||
break;
|
||||
case LimiterModeType::Limit_Turbo:
|
||||
config.GS.LimitScalar = g_Conf->Framerate.TurboScalar;
|
||||
case LimiterModeType::Turbo:
|
||||
config.GS.LimitScalar = EmuConfig.Framerate.TurboScalar;
|
||||
break;
|
||||
default:
|
||||
pxAssert("Unknown framelimiter mode!");
|
||||
|
|
|
@ -863,19 +863,6 @@ void GSsetExclusive(int enabled)
|
|||
}
|
||||
}
|
||||
|
||||
bool GSGetFMVSwitch()
|
||||
{
|
||||
return s_gs ? s_gs->GetFMVSwitch() : false;
|
||||
}
|
||||
|
||||
void GSSetFMVSwitch(bool enabled)
|
||||
{
|
||||
if (s_gs)
|
||||
{
|
||||
s_gs->SetFMVSwitch(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
|
||||
inline unsigned long timeGetTime()
|
||||
|
|
|
@ -1815,8 +1815,6 @@ void GSgetTitleInfo2(char* dest, size_t length);
|
|||
void GSsetFrameSkip(int frameskip);
|
||||
void GSsetVsync(int vsync);
|
||||
void GSsetExclusive(int enabled);
|
||||
bool GSGetFMVSwitch();
|
||||
void GSSetFMVSwitch(bool enabled);
|
||||
|
||||
class GSApp
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "GSRenderer.h"
|
||||
#include "gui/AppConfig.h"
|
||||
#include "pcsx2/Config.h"
|
||||
#if defined(__unix__)
|
||||
#include <X11/keysym.h>
|
||||
#endif
|
||||
|
@ -29,7 +29,6 @@ GSRenderer::GSRenderer()
|
|||
, m_shift_key(false)
|
||||
, m_control_key(false)
|
||||
, m_texture_shuffle(false)
|
||||
, m_fmv_switch(false)
|
||||
, m_real_size(0, 0)
|
||||
, m_wnd()
|
||||
, m_dev(NULL)
|
||||
|
@ -312,28 +311,10 @@ GSVector4i GSRenderer::ComputeDrawRectangle(int width, int height) const
|
|||
|
||||
double targetAr = clientAr;
|
||||
|
||||
if (m_fmv_switch)
|
||||
{
|
||||
if (g_Conf->GSWindow.FMVAspectRatioSwitch == FMV_AspectRatio_Switch_4_3)
|
||||
{
|
||||
targetAr = 4.0 / 3.0;
|
||||
}
|
||||
else if (g_Conf->GSWindow.FMVAspectRatioSwitch == FMV_AspectRatio_Switch_16_9)
|
||||
{
|
||||
targetAr = 16.0 / 9.0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g_Conf->GSWindow.AspectRatio == AspectRatio_4_3)
|
||||
{
|
||||
targetAr = 4.0 / 3.0;
|
||||
}
|
||||
else if (g_Conf->GSWindow.AspectRatio == AspectRatio_16_9)
|
||||
{
|
||||
targetAr = 16.0 / 9.0;
|
||||
}
|
||||
}
|
||||
if (EmuConfig.CurrentAspectRatio == AspectRatioType::R4_3)
|
||||
targetAr = 4.0 / 3.0;
|
||||
else if (EmuConfig.CurrentAspectRatio == AspectRatioType::R16_9)
|
||||
targetAr = 16.0 / 9.0;
|
||||
|
||||
const double arr = targetAr / clientAr;
|
||||
double target_width = f_width;
|
||||
|
@ -343,12 +324,12 @@ GSVector4i GSRenderer::ComputeDrawRectangle(int width, int height) const
|
|||
else if (arr > 1)
|
||||
target_height = std::floor(f_height / arr + 0.5);
|
||||
|
||||
float zoom = g_Conf->GSWindow.Zoom / 100.0;
|
||||
float zoom = EmuConfig.GS.Zoom / 100.0;
|
||||
if (zoom == 0) //auto zoom in untill black-bars are gone (while keeping the aspect ratio).
|
||||
zoom = std::max((float)arr, (float)(1.0 / arr));
|
||||
|
||||
target_width *= zoom;
|
||||
target_height *= zoom * g_Conf->GSWindow.StretchY / 100.0;
|
||||
target_height *= zoom * EmuConfig.GS.StretchY / 100.0;
|
||||
|
||||
double target_x, target_y;
|
||||
if (target_width > f_width)
|
||||
|
@ -361,8 +342,8 @@ GSVector4i GSRenderer::ComputeDrawRectangle(int width, int height) const
|
|||
target_y = (f_height - target_height) * 0.5;
|
||||
|
||||
const double unit = .01 * std::min(target_x, target_y);
|
||||
target_x += unit * g_Conf->GSWindow.OffsetX;
|
||||
target_y += unit * g_Conf->GSWindow.OffsetY;
|
||||
target_x += unit * EmuConfig.GS.OffsetX;
|
||||
target_y += unit * EmuConfig.GS.OffsetY;
|
||||
|
||||
return GSVector4i(
|
||||
static_cast<int>(std::floor(target_x)),
|
||||
|
@ -423,7 +404,7 @@ void GSRenderer::VSync(int field)
|
|||
#endif
|
||||
{
|
||||
//GS owns the window's title, be verbose.
|
||||
static const char* aspect_ratio_names[AspectRatio_MaxCount] = { "Stretch", "4:3", "16:9" };
|
||||
static const char* aspect_ratio_names[static_cast<int>(AspectRatioType::MaxCount)] = { "Stretch", "4:3", "16:9" };
|
||||
|
||||
std::string s2 = m_regs->SMODE2.INT ? (std::string("Interlaced ") + (m_regs->SMODE2.FFMD ? "(frame)" : "(field)")) : "Progressive";
|
||||
|
||||
|
@ -432,7 +413,7 @@ void GSRenderer::VSync(int field)
|
|||
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(),
|
||||
aspect_ratio_names[g_Conf->GSWindow.AspectRatio],
|
||||
aspect_ratio_names[static_cast<int>(EmuConfig.GS.AspectRatio)],
|
||||
(int)m_perfmon.Get(GSPerfMon::SyncPoint),
|
||||
(int)m_perfmon.Get(GSPerfMon::Prim),
|
||||
(int)m_perfmon.Get(GSPerfMon::Draw),
|
||||
|
|
|
@ -40,7 +40,6 @@ protected:
|
|||
bool m_fxaa;
|
||||
bool m_shadeboost;
|
||||
bool m_texture_shuffle;
|
||||
bool m_fmv_switch;
|
||||
GSVector2i m_real_size;
|
||||
|
||||
virtual GSTexture* GetOutput(int i, int& y_offset) = 0;
|
||||
|
@ -65,9 +64,6 @@ public:
|
|||
GSVector2i GetInternalResolution();
|
||||
void SetVSync(int vsync);
|
||||
|
||||
__fi bool GetFMVSwitch() const { return m_fmv_switch; }
|
||||
__fi void SetFMVSwitch(bool enabled) { m_fmv_switch = enabled; }
|
||||
|
||||
virtual bool BeginCapture(std::string& filename);
|
||||
virtual void EndCapture();
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "mpeg2lib/Mpeg.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include "gui/AppConfig.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "common/MemsetFast.inl"
|
||||
|
||||
|
@ -432,7 +432,7 @@ static __ri void ipuBDEC(tIPU_CMD_BDEC bdec)
|
|||
|
||||
static __fi bool ipuVDEC(u32 val)
|
||||
{
|
||||
if (g_Conf->GSWindow.FMVAspectRatioSwitch != FMV_AspectRatio_Switch_Off) {
|
||||
if (EmuConfig.GS.FMVAspectRatioSwitch != FMVAspectRatioSwitchType::Off) {
|
||||
static int count = 0;
|
||||
if (count++ > 5) {
|
||||
if (!FMVstarted) {
|
||||
|
|
|
@ -236,11 +236,34 @@ void Pcsx2Config::GSOptions::LoadSave( IniInterface& ini )
|
|||
|
||||
IniEntry( FramesToDraw );
|
||||
IniEntry( FramesToSkip );
|
||||
|
||||
static const wxChar* AspectRatioNames[] =
|
||||
{
|
||||
L"Stretch",
|
||||
L"4:3",
|
||||
L"16:9",
|
||||
// WARNING: array must be NULL terminated to compute it size
|
||||
NULL};
|
||||
|
||||
#ifdef PCSX2_CORE
|
||||
ini.EnumEntry(L"AspectRatio", AspectRatio, AspectRatioNames, AspectRatio);
|
||||
|
||||
static const wxChar* FMVAspectRatioSwitchNames[] =
|
||||
{
|
||||
L"Off",
|
||||
L"4:3",
|
||||
L"16:9",
|
||||
// WARNING: array must be NULL terminated to compute it size
|
||||
NULL};
|
||||
ini.EnumEntry(L"FMVAspectRatioSwitch", FMVAspectRatioSwitch, FMVAspectRatioSwitchNames, FMVAspectRatioSwitch);
|
||||
|
||||
IniEntry(Zoom);
|
||||
#endif
|
||||
}
|
||||
|
||||
int Pcsx2Config::GSOptions::GetVsync() const
|
||||
{
|
||||
if (g_LimiterMode == Limit_Turbo || !FrameLimitEnable)
|
||||
if (EmuConfig.LimiterMode == LimiterModeType::Turbo || !FrameLimitEnable)
|
||||
return 0;
|
||||
|
||||
// D3D only support a boolean state. OpenGL waits a number of vsync
|
||||
|
@ -432,6 +455,27 @@ Pcsx2Config::FolderOptions::FolderOptions()
|
|||
|
||||
}
|
||||
|
||||
void Pcsx2Config::FramerateOptions::SanityCheck()
|
||||
{
|
||||
// Ensure Conformation of various options...
|
||||
|
||||
NominalScalar = std::clamp(NominalScalar, 0.05, 10.0);
|
||||
TurboScalar = std::clamp(TurboScalar, 0.05, 10.0);
|
||||
SlomoScalar = std::clamp(SlomoScalar, 0.05, 10.0);
|
||||
}
|
||||
|
||||
void Pcsx2Config::FramerateOptions::LoadSave(IniInterface& ini)
|
||||
{
|
||||
ScopedIniGroup path(ini, L"Framerate");
|
||||
|
||||
IniEntry(NominalScalar);
|
||||
IniEntry(TurboScalar);
|
||||
IniEntry(SlomoScalar);
|
||||
|
||||
IniEntry(SkipOnLimit);
|
||||
IniEntry(SkipOnTurbo);
|
||||
}
|
||||
|
||||
Pcsx2Config::Pcsx2Config()
|
||||
{
|
||||
bitset = 0;
|
||||
|
@ -480,7 +524,15 @@ void Pcsx2Config::LoadSave( IniInterface& ini )
|
|||
Trace .LoadSave( ini );
|
||||
|
||||
// For now, this in the derived config for backwards ini compatibility.
|
||||
//BaseFilenames.LoadSave(ini);
|
||||
#ifdef PCSX2_CORE
|
||||
BaseFilenames.LoadSave(ini);
|
||||
Framerate.LoadSave(ini);
|
||||
#endif
|
||||
|
||||
if (ini.IsLoading())
|
||||
{
|
||||
CurrentAspectRatio = GS.AspectRatio;
|
||||
}
|
||||
|
||||
ini.Flush();
|
||||
}
|
||||
|
@ -524,6 +576,7 @@ void Pcsx2Config::CopyConfig(const Pcsx2Config& cfg)
|
|||
Debugger = cfg.Debugger;
|
||||
Trace = cfg.Trace;
|
||||
BaseFilenames = cfg.BaseFilenames;
|
||||
Framerate = cfg.Framerate;
|
||||
|
||||
CdvdVerboseReads = cfg.CdvdVerboseReads;
|
||||
CdvdDumpBlocks = cfg.CdvdDumpBlocks;
|
||||
|
|
|
@ -611,7 +611,7 @@ void AppConfig::LoadSave( IniInterface& ini )
|
|||
|
||||
EmuOptions.BaseFilenames.LoadSave( ini );
|
||||
GSWindow .LoadSave( ini );
|
||||
Framerate .LoadSave( ini );
|
||||
EmuOptions.Framerate .LoadSave( ini );
|
||||
#ifndef DISABLE_RECORDING
|
||||
inputRecording.loadSave(ini);
|
||||
#endif
|
||||
|
@ -738,13 +738,6 @@ AppConfig::GSWindowOptions::GSWindowOptions()
|
|||
DisableResizeBorders = false;
|
||||
DisableScreenSaver = true;
|
||||
|
||||
AspectRatio = AspectRatio_4_3;
|
||||
FMVAspectRatioSwitch = FMV_AspectRatio_Switch_Off;
|
||||
Zoom = 100;
|
||||
StretchY = 100;
|
||||
OffsetX = 0;
|
||||
OffsetY = 0;
|
||||
|
||||
WindowSize = wxSize( 640, 480 );
|
||||
WindowPos = wxDefaultPosition;
|
||||
IsMaximized = false;
|
||||
|
@ -768,9 +761,6 @@ void AppConfig::GSWindowOptions::SanityCheck()
|
|||
// move into view:
|
||||
if( !wxGetDisplayArea().Contains( wxRect( WindowPos, wxSize( 48,48 ) ) ) )
|
||||
WindowPos = wxDefaultPosition;
|
||||
|
||||
if( (uint)AspectRatio >= (uint)AspectRatio_MaxCount )
|
||||
AspectRatio = AspectRatio_4_3;
|
||||
}
|
||||
|
||||
void AppConfig::GSWindowOptions::LoadSave( IniInterface& ini )
|
||||
|
@ -800,7 +790,9 @@ void AppConfig::GSWindowOptions::LoadSave( IniInterface& ini )
|
|||
NULL
|
||||
};
|
||||
|
||||
ini.EnumEntry( L"AspectRatio", AspectRatio, AspectRatioNames, AspectRatio );
|
||||
ini.EnumEntry( L"AspectRatio", g_Conf->EmuOptions.GS.AspectRatio, AspectRatioNames, g_Conf->EmuOptions.GS.AspectRatio );
|
||||
if (ini.IsLoading())
|
||||
EmuConfig.CurrentAspectRatio = g_Conf->EmuOptions.GS.AspectRatio;
|
||||
|
||||
static const wxChar* FMVAspectRatioSwitchNames[] =
|
||||
{
|
||||
|
@ -810,9 +802,9 @@ void AppConfig::GSWindowOptions::LoadSave( IniInterface& ini )
|
|||
// WARNING: array must be NULL terminated to compute it size
|
||||
NULL
|
||||
};
|
||||
ini.EnumEntry(L"FMVAspectRatioSwitch", FMVAspectRatioSwitch, FMVAspectRatioSwitchNames, FMVAspectRatioSwitch);
|
||||
ini.EnumEntry(L"FMVAspectRatioSwitch", g_Conf->EmuOptions.GS.FMVAspectRatioSwitch, FMVAspectRatioSwitchNames, g_Conf->EmuOptions.GS.FMVAspectRatioSwitch);
|
||||
|
||||
IniEntry( Zoom );
|
||||
ini.Entry(wxT("Zoom"), g_Conf->EmuOptions.GS.Zoom, g_Conf->EmuOptions.GS.Zoom);
|
||||
|
||||
if( ini.IsLoading() ) SanityCheck();
|
||||
}
|
||||
|
@ -833,28 +825,6 @@ void AppConfig::InputRecordingOptions::loadSave(IniInterface& ini)
|
|||
}
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void AppConfig::FramerateOptions::SanityCheck()
|
||||
{
|
||||
// Ensure Conformation of various options...
|
||||
|
||||
NominalScalar = std::clamp(NominalScalar, 0.05, 10.0);
|
||||
TurboScalar = std::clamp(TurboScalar, 0.05, 10.0);
|
||||
SlomoScalar = std::clamp(SlomoScalar, 0.05, 10.0);
|
||||
}
|
||||
|
||||
void AppConfig::FramerateOptions::LoadSave( IniInterface& ini )
|
||||
{
|
||||
ScopedIniGroup path( ini, L"Framerate" );
|
||||
|
||||
IniEntry( NominalScalar );
|
||||
IniEntry( TurboScalar );
|
||||
IniEntry( SlomoScalar );
|
||||
|
||||
IniEntry( SkipOnLimit );
|
||||
IniEntry( SkipOnTurbo );
|
||||
}
|
||||
|
||||
AppConfig::CaptureOptions::CaptureOptions()
|
||||
{
|
||||
EnableAudio = true;
|
||||
|
@ -945,7 +915,7 @@ bool AppConfig::IsOkApplyPreset(int n, bool ignoreMTVU)
|
|||
|
||||
//Have some original and default values at hand to be used later.
|
||||
Pcsx2Config::GSOptions original_GS = EmuOptions.GS;
|
||||
AppConfig::FramerateOptions original_Framerate = Framerate;
|
||||
Pcsx2Config::FramerateOptions original_Framerate = EmuOptions.Framerate;
|
||||
Pcsx2Config::SpeedhackOptions original_SpeedHacks = EmuOptions.Speedhacks;
|
||||
AppConfig default_AppConfig;
|
||||
Pcsx2Config default_Pcsx2Config;
|
||||
|
@ -967,9 +937,9 @@ bool AppConfig::IsOkApplyPreset(int n, bool ignoreMTVU)
|
|||
|
||||
//Force some settings as a (current) base for all presets.
|
||||
|
||||
Framerate = default_AppConfig.Framerate;
|
||||
Framerate.SlomoScalar = original_Framerate.SlomoScalar;
|
||||
Framerate.TurboScalar = original_Framerate.TurboScalar;
|
||||
EmuOptions.Framerate = default_Pcsx2Config.Framerate;
|
||||
EmuOptions.Framerate.SlomoScalar = original_Framerate.SlomoScalar;
|
||||
EmuOptions.Framerate.TurboScalar = original_Framerate.TurboScalar;
|
||||
|
||||
EnableGameFixes = false;
|
||||
|
||||
|
@ -1210,7 +1180,7 @@ static void LoadVmSettings()
|
|||
std::unique_ptr<wxFileConfig> vmini( OpenFileConfig( GetVmSettingsFilename() ) );
|
||||
IniLoader vmloader( vmini.get() );
|
||||
g_Conf->EmuOptions.LoadSave( vmloader );
|
||||
g_Conf->EmuOptions.GS.LimitScalar = g_Conf->Framerate.NominalScalar;
|
||||
g_Conf->EmuOptions.GS.LimitScalar = g_Conf->EmuOptions.Framerate.NominalScalar;
|
||||
|
||||
if (g_Conf->EnablePresets){
|
||||
g_Conf->IsOkApplyPreset(g_Conf->PresetIndex, true);
|
||||
|
|
|
@ -175,14 +175,6 @@ public:
|
|||
bool DisableResizeBorders;
|
||||
bool DisableScreenSaver;
|
||||
|
||||
AspectRatioType AspectRatio;
|
||||
FMVAspectRatioSwitchType FMVAspectRatioSwitch;
|
||||
|
||||
double Zoom;
|
||||
double StretchY;
|
||||
double OffsetX;
|
||||
double OffsetY;
|
||||
|
||||
wxSize WindowSize;
|
||||
wxPoint WindowPos;
|
||||
|
||||
|
@ -197,19 +189,6 @@ public:
|
|||
void SanityCheck();
|
||||
};
|
||||
|
||||
struct FramerateOptions
|
||||
{
|
||||
bool SkipOnLimit{ false };
|
||||
bool SkipOnTurbo{ false };
|
||||
|
||||
double NominalScalar{ 1.0 };
|
||||
double TurboScalar{ 2.0 };
|
||||
double SlomoScalar{ 0.5 };
|
||||
|
||||
void LoadSave( IniInterface& conf );
|
||||
void SanityCheck();
|
||||
};
|
||||
|
||||
#ifndef DISABLE_RECORDING
|
||||
struct InputRecordingOptions
|
||||
{
|
||||
|
@ -312,7 +291,6 @@ public:
|
|||
ConsoleLogOptions ProgLogBox;
|
||||
FolderOptions Folders;
|
||||
GSWindowOptions GSWindow;
|
||||
FramerateOptions Framerate;
|
||||
#ifndef DISABLE_RECORDING
|
||||
InputRecordingOptions inputRecording;
|
||||
#endif
|
||||
|
|
|
@ -458,10 +458,21 @@ void Pcsx2App::LogicalVsync()
|
|||
|
||||
FpsManager.DoFrame();
|
||||
|
||||
if (g_Conf->GSWindow.FMVAspectRatioSwitch != FMV_AspectRatio_Switch_Off) {
|
||||
if (EmuConfig.GS.FMVAspectRatioSwitch != FMVAspectRatioSwitchType::Off) {
|
||||
if (EnableFMV) {
|
||||
DevCon.Warning("FMV on");
|
||||
GSSetFMVSwitch(true);
|
||||
|
||||
switch (EmuConfig.GS.FMVAspectRatioSwitch)
|
||||
{
|
||||
case FMVAspectRatioSwitchType::R4_3:
|
||||
EmuConfig.CurrentAspectRatio = AspectRatioType::R4_3;
|
||||
break;
|
||||
case FMVAspectRatioSwitchType::R16_9:
|
||||
EmuConfig.CurrentAspectRatio = AspectRatioType::R16_9;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
EnableFMV = false;
|
||||
}
|
||||
|
||||
|
@ -469,7 +480,7 @@ void Pcsx2App::LogicalVsync()
|
|||
int diff = cpuRegs.cycle - eecount_on_last_vdec;
|
||||
if (diff > 60000000 ) {
|
||||
DevCon.Warning("FMV off");
|
||||
GSSetFMVSwitch(false);
|
||||
EmuConfig.CurrentAspectRatio = EmuConfig.GS.AspectRatio;
|
||||
FMVstarted = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -696,11 +696,11 @@ void GSFrame::OnUpdateTitle( wxTimerEvent& evt )
|
|||
|
||||
if( g_Conf->EmuOptions.GS.FrameLimitEnable )
|
||||
{
|
||||
switch( g_LimiterMode )
|
||||
switch( EmuConfig.LimiterMode )
|
||||
{
|
||||
case Limit_Nominal: limiterStr = templates.LimiterNormal; break;
|
||||
case Limit_Turbo: limiterStr = templates.LimiterTurbo; break;
|
||||
case Limit_Slomo: limiterStr = templates.LimiterSlowmo; break;
|
||||
case LimiterModeType::Nominal: limiterStr = templates.LimiterNormal; break;
|
||||
case LimiterModeType::Turbo: limiterStr = templates.LimiterTurbo; break;
|
||||
case LimiterModeType::Slomo: limiterStr = templates.LimiterSlowmo; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,16 +20,6 @@
|
|||
#include "CpuUsageProvider.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
enum LimiterModeType
|
||||
{
|
||||
Limit_Nominal,
|
||||
Limit_Turbo,
|
||||
Limit_Slomo,
|
||||
};
|
||||
|
||||
extern LimiterModeType g_LimiterMode;
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// GSPanel
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
|
|
@ -67,8 +67,6 @@ wxString KeyAcceleratorCode::ToString() const
|
|||
.ToString();
|
||||
}
|
||||
|
||||
LimiterModeType g_LimiterMode = Limit_Nominal;
|
||||
|
||||
namespace Implementations
|
||||
{
|
||||
void Frameskip_Toggle()
|
||||
|
@ -94,15 +92,15 @@ namespace Implementations
|
|||
if (!g_Conf->EmuOptions.GS.FrameLimitEnable)
|
||||
{
|
||||
g_Conf->EmuOptions.GS.FrameLimitEnable = true;
|
||||
g_LimiterMode = Limit_Turbo;
|
||||
EmuConfig.LimiterMode = LimiterModeType::Turbo;
|
||||
OSDlog(Color_StrongRed, true, "(FrameLimiter) Turbo + FrameLimit ENABLED.");
|
||||
g_Conf->EmuOptions.GS.FrameSkipEnable = !!g_Conf->Framerate.SkipOnTurbo;
|
||||
g_Conf->EmuOptions.GS.FrameSkipEnable = !!EmuConfig.Framerate.SkipOnTurbo;
|
||||
}
|
||||
else if (g_LimiterMode == Limit_Turbo)
|
||||
else if (EmuConfig.LimiterMode == LimiterModeType::Turbo)
|
||||
{
|
||||
g_LimiterMode = Limit_Nominal;
|
||||
EmuConfig.LimiterMode = LimiterModeType::Nominal;
|
||||
|
||||
if (g_Conf->Framerate.SkipOnLimit)
|
||||
if (EmuConfig.Framerate.SkipOnLimit)
|
||||
{
|
||||
OSDlog(Color_StrongRed, true, "(FrameLimiter) Turbo DISABLED. Frameskip ENABLED");
|
||||
g_Conf->EmuOptions.GS.FrameSkipEnable = true;
|
||||
|
@ -115,9 +113,9 @@ namespace Implementations
|
|||
}
|
||||
else
|
||||
{
|
||||
g_LimiterMode = Limit_Turbo;
|
||||
EmuConfig.LimiterMode = LimiterModeType::Turbo;
|
||||
|
||||
if (g_Conf->Framerate.SkipOnTurbo)
|
||||
if (EmuConfig.Framerate.SkipOnTurbo)
|
||||
{
|
||||
OSDlog(Color_StrongRed, true, "(FrameLimiter) Turbo + Frameskip ENABLED.");
|
||||
g_Conf->EmuOptions.GS.FrameSkipEnable = true;
|
||||
|
@ -143,14 +141,14 @@ namespace Implementations
|
|||
// out a better consistency approach... -air
|
||||
|
||||
ScopedCoreThreadPause pauser;
|
||||
if (g_LimiterMode == Limit_Slomo)
|
||||
if (EmuConfig.LimiterMode == LimiterModeType::Slomo)
|
||||
{
|
||||
g_LimiterMode = Limit_Nominal;
|
||||
EmuConfig.LimiterMode = LimiterModeType::Nominal;
|
||||
OSDlog(Color_StrongRed, true, "(FrameLimiter) SlowMotion DISABLED.");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_LimiterMode = Limit_Slomo;
|
||||
EmuConfig.LimiterMode = LimiterModeType::Slomo;
|
||||
OSDlog(Color_StrongRed, true, "(FrameLimiter) SlowMotion ENABLED.");
|
||||
g_Conf->EmuOptions.GS.FrameLimitEnable = true;
|
||||
}
|
||||
|
@ -167,29 +165,27 @@ namespace Implementations
|
|||
OSDlog(Color_StrongRed, true, "(FrameLimiter) %s.", g_Conf->EmuOptions.GS.FrameLimitEnable ? "ENABLED" : "DISABLED");
|
||||
|
||||
// Turbo/Slowmo don't make sense when framelimiter is toggled
|
||||
g_LimiterMode = Limit_Nominal;
|
||||
EmuConfig.LimiterMode = LimiterModeType::Nominal;
|
||||
|
||||
pauser.AllowResume();
|
||||
}
|
||||
|
||||
void GSwindow_CycleAspectRatio()
|
||||
{
|
||||
AspectRatioType& art = g_Conf->GSWindow.AspectRatio;
|
||||
AspectRatioType& art = EmuConfig.CurrentAspectRatio;
|
||||
const char* arts = "Not modified";
|
||||
if (art == AspectRatio_Stretch && GSGetFMVSwitch()) //avoids a double 4:3 when coming from FMV aspect ratio switch
|
||||
art = AspectRatio_4_3;
|
||||
switch (art)
|
||||
{
|
||||
case AspectRatio_Stretch:
|
||||
art = AspectRatio_4_3;
|
||||
case AspectRatioType::Stretch:
|
||||
art = AspectRatioType::R4_3;
|
||||
arts = "4:3";
|
||||
break;
|
||||
case AspectRatio_4_3:
|
||||
art = AspectRatio_16_9;
|
||||
case AspectRatioType::R4_3:
|
||||
art = AspectRatioType::R16_9;
|
||||
arts = "16:9";
|
||||
break;
|
||||
case AspectRatio_16_9:
|
||||
art = AspectRatio_Stretch;
|
||||
case AspectRatioType::R16_9:
|
||||
art = AspectRatioType::Stretch;
|
||||
arts = "Stretch";
|
||||
break;
|
||||
default:
|
||||
|
@ -197,36 +193,33 @@ namespace Implementations
|
|||
}
|
||||
|
||||
OSDlog(Color_StrongBlue, true, "(GSwindow) Aspect ratio: %s", arts);
|
||||
|
||||
// Disable FMV mode if we were previously in it, so the user can override the AR.
|
||||
GSSetFMVSwitch(false);
|
||||
}
|
||||
|
||||
void SetOffset(float x, float y)
|
||||
{
|
||||
g_Conf->GSWindow.OffsetX = x;
|
||||
g_Conf->GSWindow.OffsetY = y;
|
||||
EmuConfig.GS.OffsetX = x;
|
||||
EmuConfig.GS.OffsetY = y;
|
||||
OSDlog(Color_StrongBlue, true, "(GSwindow) Offset: x=%f, y=%f", x, y);
|
||||
}
|
||||
|
||||
void GSwindow_OffsetYplus()
|
||||
{
|
||||
SetOffset(g_Conf->GSWindow.OffsetX, g_Conf->GSWindow.OffsetY + 1);
|
||||
SetOffset(EmuConfig.GS.OffsetX, EmuConfig.GS.OffsetY + 1);
|
||||
}
|
||||
|
||||
void GSwindow_OffsetYminus()
|
||||
{
|
||||
SetOffset(g_Conf->GSWindow.OffsetX, g_Conf->GSWindow.OffsetY - 1);
|
||||
SetOffset(EmuConfig.GS.OffsetX, EmuConfig.GS.OffsetY - 1);
|
||||
}
|
||||
|
||||
void GSwindow_OffsetXplus()
|
||||
{
|
||||
SetOffset(g_Conf->GSWindow.OffsetX + 1, g_Conf->GSWindow.OffsetY);
|
||||
SetOffset(EmuConfig.GS.OffsetX + 1, EmuConfig.GS.OffsetY);
|
||||
}
|
||||
|
||||
void GSwindow_OffsetXminus()
|
||||
{
|
||||
SetOffset(g_Conf->GSWindow.OffsetX - 1, g_Conf->GSWindow.OffsetY);
|
||||
SetOffset(EmuConfig.GS.OffsetX - 1, EmuConfig.GS.OffsetY);
|
||||
}
|
||||
|
||||
void GSwindow_OffsetReset()
|
||||
|
@ -238,17 +231,17 @@ namespace Implementations
|
|||
{
|
||||
if (zoom <= 0)
|
||||
return;
|
||||
g_Conf->GSWindow.StretchY = zoom;
|
||||
EmuConfig.GS.StretchY = zoom;
|
||||
OSDlog(Color_StrongBlue, true, "(GSwindow) Vertical stretch: %f", zoom);
|
||||
}
|
||||
|
||||
void GSwindow_ZoomInY()
|
||||
{
|
||||
SetZoomY(g_Conf->GSWindow.StretchY + 1);
|
||||
SetZoomY(EmuConfig.GS.StretchY + 1);
|
||||
}
|
||||
void GSwindow_ZoomOutY()
|
||||
{
|
||||
SetZoomY(g_Conf->GSWindow.StretchY - 1);
|
||||
SetZoomY(EmuConfig.GS.StretchY - 1);
|
||||
}
|
||||
void GSwindow_ZoomResetY()
|
||||
{
|
||||
|
@ -259,7 +252,7 @@ namespace Implementations
|
|||
{
|
||||
if (zoom < 0)
|
||||
return;
|
||||
g_Conf->GSWindow.Zoom = zoom;
|
||||
EmuConfig.GS.Zoom = zoom;
|
||||
|
||||
if (zoom == 0)
|
||||
OSDlog(Color_StrongBlue, true, "(GSwindow) Zoom: 0 (auto, no black bars)");
|
||||
|
@ -270,7 +263,7 @@ namespace Implementations
|
|||
|
||||
void GSwindow_ZoomIn()
|
||||
{
|
||||
float z = g_Conf->GSWindow.Zoom;
|
||||
float z = EmuConfig.GS.Zoom;
|
||||
if (z == 0)
|
||||
z = 100;
|
||||
z++;
|
||||
|
@ -278,7 +271,7 @@ namespace Implementations
|
|||
}
|
||||
void GSwindow_ZoomOut()
|
||||
{
|
||||
float z = g_Conf->GSWindow.Zoom;
|
||||
float z = EmuConfig.GS.Zoom;
|
||||
if (z == 0)
|
||||
z = 100;
|
||||
z--;
|
||||
|
@ -286,7 +279,7 @@ namespace Implementations
|
|||
}
|
||||
void GSwindow_ZoomToggle()
|
||||
{
|
||||
float z = g_Conf->GSWindow.Zoom;
|
||||
float z = EmuConfig.GS.Zoom;
|
||||
if (z == 100)
|
||||
z = 0;
|
||||
else
|
||||
|
|
|
@ -151,6 +151,7 @@ void Panels::GSWindowSettingsPanel::AppStatusEvent_OnSettingsApplied()
|
|||
|
||||
void Panels::GSWindowSettingsPanel::ApplyConfigToGui(AppConfig& configToApply, int flags)
|
||||
{
|
||||
const Pcsx2Config::GSOptions& gsconf(configToApply.EmuOptions.GS);
|
||||
const AppConfig::GSWindowOptions& conf(configToApply.GSWindow);
|
||||
|
||||
if (!(flags & AppConfig::APPLY_FLAG_FROM_PRESET))
|
||||
|
@ -160,9 +161,9 @@ void Panels::GSWindowSettingsPanel::ApplyConfigToGui(AppConfig& configToApply, i
|
|||
m_check_HideMouse->SetValue(conf.AlwaysHideMouse);
|
||||
m_check_SizeLock->SetValue(conf.DisableResizeBorders);
|
||||
|
||||
m_combo_AspectRatio->SetSelection((int)conf.AspectRatio);
|
||||
m_combo_FMVAspectRatioSwitch->SetSelection(enum_cast(conf.FMVAspectRatioSwitch));
|
||||
m_text_Zoom->ChangeValue(wxString::FromDouble(conf.Zoom, 2));
|
||||
m_combo_AspectRatio->SetSelection((int)gsconf.AspectRatio);
|
||||
m_combo_FMVAspectRatioSwitch->SetSelection(enum_cast(gsconf.FMVAspectRatioSwitch));
|
||||
m_text_Zoom->ChangeValue(wxString::FromDouble(gsconf.Zoom, 2));
|
||||
|
||||
m_check_DclickFullscreen->SetValue(conf.IsToggleFullscreenOnDoubleClick);
|
||||
|
||||
|
@ -184,12 +185,13 @@ void Panels::GSWindowSettingsPanel::Apply()
|
|||
appconf.AlwaysHideMouse = m_check_HideMouse->GetValue();
|
||||
appconf.DisableResizeBorders = m_check_SizeLock->GetValue();
|
||||
|
||||
appconf.AspectRatio = (AspectRatioType)m_combo_AspectRatio->GetSelection();
|
||||
appconf.FMVAspectRatioSwitch = (FMVAspectRatioSwitchType)m_combo_FMVAspectRatioSwitch->GetSelection();
|
||||
gsconf.AspectRatio = (AspectRatioType)m_combo_AspectRatio->GetSelection();
|
||||
gsconf.FMVAspectRatioSwitch = (FMVAspectRatioSwitchType)m_combo_FMVAspectRatioSwitch->GetSelection();
|
||||
EmuConfig.CurrentAspectRatio = gsconf.AspectRatio;
|
||||
|
||||
double new_zoom = 0.0;
|
||||
if (m_text_Zoom->GetValue().ToDouble(&new_zoom))
|
||||
appconf.Zoom = new_zoom;
|
||||
gsconf.Zoom = new_zoom;
|
||||
|
||||
gsconf.VsyncEnable = static_cast<VsyncMode>(m_combo_vsync->GetSelection());
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ void Panels::FramelimiterPanel::AppStatusEvent_OnSettingsApplied()
|
|||
|
||||
void Panels::FramelimiterPanel::ApplyConfigToGui( AppConfig& configToApply, int flags )
|
||||
{
|
||||
const AppConfig::FramerateOptions& appfps( configToApply.Framerate );
|
||||
const Pcsx2Config::FramerateOptions& appfps( configToApply.EmuOptions.Framerate );
|
||||
const Pcsx2Config::GSOptions& gsconf( configToApply.EmuOptions.GS );
|
||||
|
||||
if( ! (flags & AppConfig::APPLY_FLAG_FROM_PRESET) )
|
||||
|
@ -135,7 +135,7 @@ void Panels::FramelimiterPanel::ApplyConfigToGui( AppConfig& configToApply, int
|
|||
|
||||
void Panels::FramelimiterPanel::Apply()
|
||||
{
|
||||
AppConfig::FramerateOptions& appfps( g_Conf->Framerate );
|
||||
Pcsx2Config::FramerateOptions& appfps( g_Conf->EmuOptions.Framerate );
|
||||
Pcsx2Config::GSOptions& gsconf( g_Conf->EmuOptions.GS );
|
||||
|
||||
gsconf.FrameLimitEnable = !m_check_LimiterDisable->GetValue();
|
||||
|
@ -230,7 +230,7 @@ void Panels::FrameSkipPanel::AppStatusEvent_OnSettingsApplied()
|
|||
|
||||
void Panels::FrameSkipPanel::ApplyConfigToGui( AppConfig& configToApply, int flags )
|
||||
{
|
||||
const AppConfig::FramerateOptions& appfps( configToApply.Framerate );
|
||||
const Pcsx2Config::FramerateOptions& appfps( configToApply.EmuOptions.Framerate );
|
||||
const Pcsx2Config::GSOptions& gsconf( configToApply.EmuOptions.GS );
|
||||
|
||||
m_radio_SkipMode->SetSelection( appfps.SkipOnLimit ? 2 : (appfps.SkipOnTurbo ? 1 : 0) );
|
||||
|
@ -246,7 +246,7 @@ void Panels::FrameSkipPanel::ApplyConfigToGui( AppConfig& configToApply, int fla
|
|||
|
||||
void Panels::FrameSkipPanel::Apply()
|
||||
{
|
||||
AppConfig::FramerateOptions& appfps( g_Conf->Framerate );
|
||||
Pcsx2Config::FramerateOptions& appfps( g_Conf->EmuOptions.Framerate );
|
||||
Pcsx2Config::GSOptions& gsconf( g_Conf->EmuOptions.GS );
|
||||
|
||||
gsconf.FramesToDraw = m_spin_FramesToDraw->GetValue();
|
||||
|
@ -343,7 +343,7 @@ void Panels::VideoPanel::Defaults_Click(wxCommandEvent& evt)
|
|||
{
|
||||
AppConfig config = *g_Conf;
|
||||
config.EmuOptions.GS = Pcsx2Config::GSOptions();
|
||||
config.Framerate = AppConfig::FramerateOptions();
|
||||
config.EmuOptions.Framerate = Pcsx2Config::FramerateOptions();
|
||||
VideoPanel::ApplyConfigToGui(config);
|
||||
m_fpan->ApplyConfigToGui(config);
|
||||
m_span->ApplyConfigToGui(config);
|
||||
|
|
Loading…
Reference in New Issue