From 1628237ba76948d5ce7d5ecb5becb3d84d9ae7a5 Mon Sep 17 00:00:00 2001 From: sonicfind Date: Thu, 22 Sep 2022 12:23:20 -0500 Subject: [PATCH] input-rec: replace u64s with u32 + Converts g_inputRecordingFile's total frame count to unsigned long to match. --- pcsx2/Recording/InputRecording.cpp | 6 +++--- pcsx2/Recording/InputRecording.h | 8 ++++---- pcsx2/Recording/InputRecordingFile.cpp | 2 +- pcsx2/Recording/InputRecordingFile.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pcsx2/Recording/InputRecording.cpp b/pcsx2/Recording/InputRecording.cpp index ec96928e49..6e24c6bf0f 100644 --- a/pcsx2/Recording/InputRecording.cpp +++ b/pcsx2/Recording/InputRecording.cpp @@ -741,7 +741,7 @@ bool InputRecording::isTypeSavestate() const return m_type == Type::FROM_SAVESTATE; } -void InputRecording::setStartingFrame(u64 startingFrame) +void InputRecording::setStartingFrame(u32 startingFrame) { if (m_type == Type::POWER_ON) { @@ -751,9 +751,9 @@ void InputRecording::setStartingFrame(u64 startingFrame) m_starting_frame = startingFrame; } -void InputRecording::adjustFrameCounterOnReRecord(u64 newFrameCounter) +void InputRecording::adjustFrameCounterOnReRecord(u32 newFrameCounter) { - if (newFrameCounter > m_starting_frame + (u64)m_file.getTotalFrames()) + if (newFrameCounter > m_starting_frame + m_file.getTotalFrames()) { InputRec::consoleLog("Warning, you've loaded PCSX2 emulation to a point after the end of the original recording. This should be avoided."); InputRec::consoleLog("Savestate's framecount has been ignored, using the max length of the recording instead."); diff --git a/pcsx2/Recording/InputRecording.h b/pcsx2/Recording/InputRecording.h index 9d5f8d8e2f..218b26fb5e 100644 --- a/pcsx2/Recording/InputRecording.h +++ b/pcsx2/Recording/InputRecording.h @@ -178,7 +178,7 @@ public: void handleExceededFrameCounter(); void handleLoadingSavestate(); bool isTypeSavestate() const; - void adjustFrameCounterOnReRecord(u64 newFrameCounter); + void adjustFrameCounterOnReRecord(u32 newFrameCounter); InputRecordingControls& getControls(); const InputRecordingFile& getData() const; @@ -199,12 +199,12 @@ private: bool m_pad_data_available = false; bool m_watching_for_rerecords = false; - u64 m_frame_counter = 0; + u32 m_frame_counter = 0; // Either 0 for a power-on movie, or the g_FrameCount that is stored on the starting frame - u64 m_starting_frame = 0; + u32 m_starting_frame = 0; void initializeState(); - void setStartingFrame(u64 startingFrame); + void setStartingFrame(u32 startingFrame); private: // Resolve the name and region of the game currently loaded using the GameDB diff --git a/pcsx2/Recording/InputRecordingFile.cpp b/pcsx2/Recording/InputRecordingFile.cpp index b4a9b5796d..13430354cf 100644 --- a/pcsx2/Recording/InputRecordingFile.cpp +++ b/pcsx2/Recording/InputRecordingFile.cpp @@ -288,7 +288,7 @@ InputRecordingFileHeader& InputRecordingFile::getHeader() noexcept return m_header; } -long InputRecordingFile::getTotalFrames() const noexcept +unsigned long InputRecordingFile::getTotalFrames() const noexcept { return m_totalFrames; } diff --git a/pcsx2/Recording/InputRecordingFile.h b/pcsx2/Recording/InputRecordingFile.h index 4c60d83a6d..12af8fa311 100644 --- a/pcsx2/Recording/InputRecordingFile.h +++ b/pcsx2/Recording/InputRecordingFile.h @@ -177,7 +177,7 @@ public: // Retrieve the input recording's filename (not the path) const std::string& getFilename() const noexcept; InputRecordingFileHeader& getHeader() noexcept; - long getTotalFrames() const noexcept; + unsigned long getTotalFrames() const noexcept; unsigned long getUndoCount() const noexcept; void logRecordingMetadata(); @@ -202,7 +202,7 @@ private: InputRecordingSavestate m_savestate; // An signed 32-bit frame limit is equivalent to 1.13 years of continuous 60fps footage - long m_totalFrames = 0; + unsigned long m_totalFrames = 0; unsigned long m_undoCount = 0; // Calculates the position of the current frame in the input recording