MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / adjustFrameCounterOnReRecord

Method adjustFrameCounterOnReRecord

pcsx2/Recording/InputRecording.cpp:342–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342void InputRecording::adjustFrameCounterOnReRecord(u32 newFrameCounter)
343{
344 if (newFrameCounter > m_starting_frame + m_file.getTotalFrames())
345 {
346 InputRec::consoleLog("Warning, you've loaded PCSX2 emulation to a point after the end of the original recording. This should be avoided.");
347 InputRec::consoleLog("Save state's framecount has been ignored, using the max length of the recording instead.");
348 m_frame_counter = m_file.getTotalFrames();
349 if (getControls().isReplaying())
350 {
351 getControls().setRecordMode();
352 }
353 return;
354 }
355 if (newFrameCounter < m_starting_frame)
356 {
357 InputRec::consoleLog("Warning, you've loaded PCSX2 emulation to a point before the start of the original recording. This should be avoided.");
358 InputRec::consoleLog("Save state's framecount has been ignored, starting from the beginning in replay mode.");
359 m_frame_counter = 0;
360 if (getControls().isRecording())
361 {
362 getControls().setReplayMode();
363 }
364 return;
365 }
366 else if (newFrameCounter == 0 && getControls().isRecording())
367 {
368 getControls().setReplayMode();
369 }
370 m_frame_counter = newFrameCounter - m_starting_frame;
371 m_frame_counter_stateless--;
372 m_file.setTotalFrames(m_frame_counter);
373 InformGSThread();
374}
375
376InputRecordingControls& InputRecording::getControls()
377{

Callers

nothing calls this directly

Calls 7

consoleLogFunction · 0.85
getTotalFramesMethod · 0.80
isReplayingMethod · 0.80
setRecordModeMethod · 0.80
isRecordingMethod · 0.80
setReplayModeMethod · 0.80
setTotalFramesMethod · 0.80

Tested by

no test coverage detected