PCSX2-Counters: Fix tracking of scalar limit

The scalar limit value was updated only during any turbo/slowmotion
toggle, let's also update it properly after any change in the emulation
settings.

This prevents the need of toggling from turbo/slowmotion to update to
your requested frame rate percentage.
This commit is contained in:
Akash 2017-07-17 21:41:17 +05:30 committed by Gregory Hainaut
parent 4e19f7adbf
commit 59fa831542
4 changed files with 28 additions and 8 deletions

View File

@ -21,6 +21,7 @@
#include "GS.h"
#include "Gif_Unit.h"
#include "Counters.h"
#include "GSFrame.h"
using namespace Threading;
using namespace R5900;
@ -55,6 +56,25 @@ void gsReset()
GSIMR.reset();
}
void gsUpdateFrequency(Pcsx2Config& config)
{
switch (g_LimiterMode)
{
case LimiterModeType::Limit_Nominal:
config.GS.LimitScalar = g_Conf->Framerate.NominalScalar;
break;
case LimiterModeType::Limit_Slomo:
config.GS.LimitScalar = g_Conf->Framerate.SlomoScalar;
break;
case LimiterModeType::Limit_Turbo:
config.GS.LimitScalar = g_Conf->Framerate.TurboScalar;
break;
default:
pxAssert("Unknown framelimiter mode!");
}
UpdateVSyncRate();
}
static __fi void gsCSRwrite( const tGS_CSR& csr )
{
if (csr.RESET) {

View File

@ -414,6 +414,7 @@ extern void gsSetVideoMode( GS_VideoMode mode );
extern void gsResetFrameSkip();
extern void gsPostVsyncStart();
extern void gsFrameSkip();
extern void gsUpdateFrequency( Pcsx2Config& config );
// Some functions shared by both the GS and MTGS
extern void _gs_ResetFrameskip();

View File

@ -458,13 +458,15 @@ static void _ApplySettings( const Pcsx2Config& src, Pcsx2Config& fixup )
}
}
// When we're booting, the bios loader will set a a title which would be more interesting than this
// to most users - with region, version, etc, so don't overwrite it with patch info. That's OK. Those
// users which want to know the status of the patches at the bios can check the console content.
wxString consoleTitle = gameName + gameSerial;
consoleTitle += L" [" + gameCRC.MakeUpper() + L"]" + gameCompat + gameFixes + gamePatch + gameCheats + gameWsHacks;
if (ingame)
Console.SetTitle(consoleTitle);
// When we're booting, the bios loader will set a a title which would be more interesting than this
// to most users - with region, version, etc, so don't overwrite it with patch info. That's OK. Those
// users which want to know the status of the patches at the bios can check the console content.
gsUpdateFrequency(fixup);
}
// FIXME: This function is not for general consumption. Its only consumer (and

View File

@ -86,7 +86,6 @@ namespace Implementations
{
g_Conf->EmuOptions.GS.FrameLimitEnable = true;
g_LimiterMode = Limit_Turbo;
g_Conf->EmuOptions.GS.LimitScalar = g_Conf->Framerate.TurboScalar;
OSDlog( Color_StrongRed, true, "(FrameLimiter) Turbo + FrameLimit ENABLED." );
g_Conf->EmuOptions.GS.FrameSkipEnable = !!g_Conf->Framerate.SkipOnTurbo;
}
@ -94,7 +93,6 @@ namespace Implementations
{
GSsetVsync( g_Conf->EmuOptions.GS.VsyncEnable );
g_LimiterMode = Limit_Nominal;
g_Conf->EmuOptions.GS.LimitScalar = g_Conf->Framerate.NominalScalar;
if ( g_Conf->Framerate.SkipOnLimit)
{
@ -111,7 +109,6 @@ namespace Implementations
{
GSsetVsync( false );
g_LimiterMode = Limit_Turbo;
g_Conf->EmuOptions.GS.LimitScalar = g_Conf->Framerate.TurboScalar;
if ( g_Conf->Framerate.SkipOnTurbo)
{
@ -124,6 +121,7 @@ namespace Implementations
g_Conf->EmuOptions.GS.FrameSkipEnable = false;
}
}
gsUpdateFrequency(g_Conf->EmuOptions);
pauser.AllowResume();
}
@ -140,16 +138,15 @@ namespace Implementations
if( g_LimiterMode == Limit_Slomo )
{
g_LimiterMode = Limit_Nominal;
g_Conf->EmuOptions.GS.LimitScalar = g_Conf->Framerate.NominalScalar;
OSDlog( Color_StrongRed, true, "(FrameLimiter) SlowMotion DISABLED." );
}
else
{
g_LimiterMode = Limit_Slomo;
g_Conf->EmuOptions.GS.LimitScalar = g_Conf->Framerate.SlomoScalar;
OSDlog( Color_StrongRed, true, "(FrameLimiter) SlowMotion ENABLED." );
g_Conf->EmuOptions.GS.FrameLimitEnable = true;
}
gsUpdateFrequency(g_Conf->EmuOptions);
pauser.AllowResume();
}