input-rec: wire up changes to the rest of the project

This commit is contained in:
Tyler Wilding 2022-06-15 20:48:02 -04:00 committed by refractionpcsx2
parent c98b90a4e2
commit 142a1a392f
5 changed files with 52 additions and 5 deletions

View File

@ -762,21 +762,33 @@
</property> </property>
</action> </action>
<action name="actionInputRecNew"> <action name="actionInputRecNew">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>New</string> <string>New</string>
</property> </property>
</action> </action>
<action name="actionInputRecPlay"> <action name="actionInputRecPlay">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Play</string> <string>Play</string>
</property> </property>
</action> </action>
<action name="actionInputRecStop"> <action name="actionInputRecStop">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Stop</string> <string>Stop</string>
</property> </property>
</action> </action>
<action name="actionInputRecOpenSettings"> <action name="actionInputRecOpenSettings">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Settings</string> <string>Settings</string>
</property> </property>

View File

@ -841,7 +841,7 @@ void cdvdReset()
// If we are recording, always use the same RTC setting // If we are recording, always use the same RTC setting
// for games that use the RTC to seed their RNG -- this is very important to be the same everytime! // for games that use the RTC to seed their RNG -- this is very important to be the same everytime!
#ifndef DISABLE_RECORDING #ifndef PCSX2_CORE
if (g_InputRecording.IsActive()) if (g_InputRecording.IsActive())
{ {
Console.WriteLn("Input Recording Active - Using Constant RTC of 04-03-2020 (DD-MM-YYYY)"); Console.WriteLn("Input Recording Active - Using Constant RTC of 04-03-2020 (DD-MM-YYYY)");
@ -855,6 +855,20 @@ void cdvdReset()
cdvd.RTC.year = 20; cdvd.RTC.year = 20;
} }
else else
#else
if (g_InputRecording.isActive())
{
Console.WriteLn("Input Recording Active - Using Constant RTC of 04-03-2020 (DD-MM-YYYY)");
// Why not just 0 everything? Some games apparently require the date to be valid in terms of when
// the PS2 / Game actually came out. (MGS3). So set it to a value well beyond any PS2 game's release date.
cdvd.RTC.second = 0;
cdvd.RTC.minute = 0;
cdvd.RTC.hour = 0;
cdvd.RTC.day = 4;
cdvd.RTC.month = 3;
cdvd.RTC.year = 20;
}
else
#endif #endif
{ {
// CDVD internally uses GMT+9. If you think the time's wrong, you're wrong. // CDVD internally uses GMT+9. If you think the time's wrong, you're wrong.

View File

@ -36,13 +36,13 @@
#ifndef PCSX2_CORE #ifndef PCSX2_CORE
#include "gui/App.h" #include "gui/App.h"
#include "Recording/InputRecordingControls.h"
#else #else
#include "PAD/Host/PAD.h" #include "PAD/Host/PAD.h"
#include "Recording/InputRecording.h"
#include "VMManager.h" #include "VMManager.h"
#endif #endif
#include "Recording/InputRecordingControls.h"
using namespace Threading; using namespace Threading;
extern u8 psxhblankgate; extern u8 psxhblankgate;
@ -612,7 +612,14 @@ static __fi void VSyncStart(u32 sCycle)
{ {
// It is imperative that any frame locking that must happen occurs before Vsync is started // It is imperative that any frame locking that must happen occurs before Vsync is started
// Not doing so would sacrifice a frame of a savestate-based recording when loading any savestate // Not doing so would sacrifice a frame of a savestate-based recording when loading any savestate
#ifndef PCSX2_CORE
g_InputRecordingControls.HandlePausingAndLocking(); g_InputRecordingControls.HandlePausingAndLocking();
#else
if (g_InputRecording.isActive())
{
g_InputRecording.handleExceededFrameCounter();
}
#endif
} }
#ifdef PCSX2_CORE #ifdef PCSX2_CORE
@ -674,10 +681,18 @@ static __fi void GSVSync()
static __fi void VSyncEnd(u32 sCycle) static __fi void VSyncEnd(u32 sCycle)
{ {
#ifndef PCSX2_CORE
if (EmuConfig.EnableRecordingTools) if (EmuConfig.EnableRecordingTools)
{ {
g_InputRecordingControls.CheckPauseStatus(); g_InputRecordingControls.CheckPauseStatus();
} }
#else
if (EmuConfig.EnableRecordingTools && g_InputRecording.isActive())
{
g_InputRecording.getControls().processControlQueue();
g_InputRecording.incFrameCounter();
}
#endif
if(EmuConfig.Trace.Enabled && EmuConfig.Trace.EE.m_EnableAll) if(EmuConfig.Trace.Enabled && EmuConfig.Trace.EE.m_EnableAll)
SysTrace.EE.Counters.Write( " ================ EE COUNTER VSYNC END (frame: %d) ================", g_FrameCount ); SysTrace.EE.Counters.Write( " ================ EE COUNTER VSYNC END (frame: %d) ================", g_FrameCount );

View File

@ -24,7 +24,7 @@
#include "Host.h" #include "Host.h"
#include "HostDisplay.h" #include "HostDisplay.h"
#include "IconsFontAwesome5.h" #include "IconsFontAwesome5.h"
#include "Recording/InputRecordingControls.h" #include "Recording/InputRecording.h"
#include "VMManager.h" #include "VMManager.h"
#ifdef ENABLE_ACHIEVEMENTS #ifdef ENABLE_ACHIEVEMENTS
@ -202,7 +202,7 @@ DEFINE_HOTKEY("ResetVM", "System", "Reset Virtual Machine", [](s32 pressed) {
}) })
DEFINE_HOTKEY("InputRecToggleMode", "System", "Toggle Input Recording Mode", [](s32 pressed) { DEFINE_HOTKEY("InputRecToggleMode", "System", "Toggle Input Recording Mode", [](s32 pressed) {
if (!pressed && VMManager::HasValidVM()) if (!pressed && VMManager::HasValidVM())
g_InputRecordingControls.RecordModeToggle(); g_InputRecording.getControls().toggleRecordMode();
}) })
DEFINE_HOTKEY("PreviousSaveStateSlot", "Save States", "Select Previous Save Slot", [](s32 pressed) { DEFINE_HOTKEY("PreviousSaveStateSlot", "Save States", "Select Previous Save Slot", [](s32 pressed) {

View File

@ -60,6 +60,8 @@
#include "IconsFontAwesome5.h" #include "IconsFontAwesome5.h"
#include "Recording/InputRecording.h"
#include "common/emitter/tools.h" #include "common/emitter/tools.h"
#ifdef _M_X86 #ifdef _M_X86
#include "common/emitter/x86_intrin.h" #include "common/emitter/x86_intrin.h"
@ -1177,6 +1179,10 @@ bool VMManager::DoLoadState(const char* filename)
SaveState_UnzipFromDisk(filename); SaveState_UnzipFromDisk(filename);
UpdateRunningGame(false, false); UpdateRunningGame(false, false);
Host::OnSaveStateLoaded(filename, true); Host::OnSaveStateLoaded(filename, true);
if (g_InputRecording.isActive())
{
g_InputRecording.handleLoadingSavestate();
}
return true; return true;
} }
catch (Exception::BaseException& e) catch (Exception::BaseException& e)