From c8a7185444e7a7b1f43090fd09d4dd3d4e345b2d Mon Sep 17 00:00:00 2001 From: benstephens56 <49702729+benstephens56@users.noreply.github.com> Date: Sat, 5 Mar 2022 02:08:35 -0500 Subject: [PATCH] Convert Input Count to Frame Count (#5954) * Convert Input Count to Frame Count While recording or playing a movie file, the left side of the status bar currently displays an input counter which shows how many times the emulator has polled for button inputs during the movie. This information is far less easily understandable and less useful for TASing compared to a frame count. The frame count has a linear relationship with input count that can be expressed with Frame Count = 0.255689103308912 * Input Count. Simply put, instead of having a counter that goes up by 3 or 4 every frame, this makes it a counter that goes up by exactly 1 every frame. * Update movie.cpp * Update movie.cpp * Fixing clang-format errors * Update movie.cpp Did not realize that the frame rate was defined as a constant somewhere in the source code. This makes this conversion far less sketchy. * Update movie.cpp --- src/core/movie.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/movie.cpp b/src/core/movie.cpp index 49d1e654f..68bcf2237 100644 --- a/src/core/movie.cpp +++ b/src/core/movie.cpp @@ -22,6 +22,7 @@ #include "core/hle/service/hid/hid.h" #include "core/hle/service/ir/extra_hid.h" #include "core/hle/service/ir/ir_rst.h" +#include "core/hw/gpu.h" #include "core/movie.h" namespace Core { @@ -222,10 +223,10 @@ Movie::PlayMode Movie::GetPlayMode() const { } u64 Movie::GetCurrentInputIndex() const { - return current_input; + return nearbyint(current_input / 234.0 * GPU::SCREEN_REFRESH_RATE); } u64 Movie::GetTotalInputCount() const { - return total_input; + return nearbyint(total_input / 234.0 * GPU::SCREEN_REFRESH_RATE); } void Movie::CheckInputEnd() {