PCSX2: Wait some frames between F9 SW render toggles. (#3052)

Setting the toggle variable is now at the vsync point. FMV toggle should still work as usual, but the F9 toggle should have to wait the full period of around 32 frames. This seems short enough while also depends on how fast those frames can rendered, avoiding having to set a timer in ms.
This commit is contained in:
KrossX 2019-08-07 14:51:29 -03:00 committed by lightningterror
parent c0a38b45f1
commit 4bb968158d
2 changed files with 16 additions and 10 deletions

View File

@ -517,8 +517,9 @@ double FramerateManager::GetFramerate() const
// times a second if not (ok, not quite, but you get the idea... I hope.) // times a second if not (ok, not quite, but you get the idea... I hope.)
extern uint eecount_on_last_vdec; extern uint eecount_on_last_vdec;
extern bool FMVstarted; extern bool FMVstarted;
extern bool renderswitch;
extern bool EnableFMV; extern bool EnableFMV;
extern bool renderswitch;
extern uint do_renderswitch;
void DoFmvSwitch(bool on) void DoFmvSwitch(bool on)
{ {
@ -534,11 +535,8 @@ void DoFmvSwitch(bool on)
viewport->DoResize(); viewport->DoResize();
} }
if (EmuConfig.Gamefixes.FMVinSoftwareHack) { if (EmuConfig.Gamefixes.FMVinSoftwareHack)
ScopedCoreThreadPause paused_core(new SysExecEvent_SaveSinglePlugin(PluginId_GS)); do_renderswitch = -1;
renderswitch = !renderswitch;
paused_core.AllowResume();
}
} }
void Pcsx2App::LogicalVsync() void Pcsx2App::LogicalVsync()
@ -568,6 +566,14 @@ void Pcsx2App::LogicalVsync()
} }
} }
if (do_renderswitch == -1) {
ScopedCoreThreadPause paused_core(new SysExecEvent_SaveSinglePlugin(PluginId_GS));
renderswitch = !renderswitch;
paused_core.AllowResume();
}
do_renderswitch >>= 1;
// Only call PADupdate here if we're using GSopen2. Legacy GSopen plugins have the // Only call PADupdate here if we're using GSopen2. Legacy GSopen plugins have the
// GS window belonging to the MTGS thread. // GS window belonging to the MTGS thread.
if( (PADupdate != NULL) && (GSopen2 != NULL) && (wxGetApp().GetGsFramePtr() != NULL) ) if( (PADupdate != NULL) && (GSopen2 != NULL) && (wxGetApp().GetGsFramePtr() != NULL) )

View File

@ -35,6 +35,7 @@
// renderswitch - tells GSdx to go into dx9 sw if "renderswitch" is set. // renderswitch - tells GSdx to go into dx9 sw if "renderswitch" is set.
bool renderswitch = false; bool renderswitch = false;
uint do_renderswitch = 0;
extern bool switchAR; extern bool switchAR;
@ -361,9 +362,8 @@ namespace Implementations
void Sys_RenderToggle() void Sys_RenderToggle()
{ {
ScopedCoreThreadPause paused_core( new SysExecEvent_SaveSinglePlugin(PluginId_GS) ); if (do_renderswitch == 0)
renderswitch = !renderswitch; do_renderswitch = -1;
paused_core.AllowResume();
} }
void Sys_LoggingToggle() void Sys_LoggingToggle()