From 27dc1cf346eeca2ed16de61f867a0ae700f0b08e Mon Sep 17 00:00:00 2001 From: fleroviux Date: Thu, 18 Jan 2024 22:03:25 +0100 Subject: [PATCH] Platform: Core: improve naming regarding input subsampling --- src/platform/core/include/platform/emulator_thread.hpp | 6 +++--- src/platform/core/src/emulator_thread.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platform/core/include/platform/emulator_thread.hpp b/src/platform/core/include/platform/emulator_thread.hpp index 90a9017a..8327d662 100644 --- a/src/platform/core/include/platform/emulator_thread.hpp +++ b/src/platform/core/include/platform/emulator_thread.hpp @@ -56,12 +56,12 @@ struct EmulatorThread { void ProcessMessages(); void ProcessMessage(const Message& message); - static constexpr int k_input_subsample_count = 4; + static constexpr int k_number_of_input_subframes = 4; static constexpr int k_cycles_per_second = 16777216; static constexpr int k_cycles_per_frame = 280896; - static constexpr int k_cycles_per_subsample = k_cycles_per_frame / k_input_subsample_count; + static constexpr int k_cycles_per_subframe = k_cycles_per_frame / k_number_of_input_subframes; - static_assert(k_cycles_per_frame % k_input_subsample_count == 0); + static_assert(k_cycles_per_frame % k_number_of_input_subframes == 0); std::queue msg_queue; std::mutex msg_queue_mutex; diff --git a/src/platform/core/src/emulator_thread.cpp b/src/platform/core/src/emulator_thread.cpp index 1a4bdd66..aaf0f402 100644 --- a/src/platform/core/src/emulator_thread.cpp +++ b/src/platform/core/src/emulator_thread.cpp @@ -11,7 +11,7 @@ namespace nba { EmulatorThread::EmulatorThread() { - frame_limiter.Reset(k_cycles_per_second / (float)k_cycles_per_subsample); + frame_limiter.Reset(k_cycles_per_second / (float)k_cycles_per_subframe); } EmulatorThread::~EmulatorThread() { @@ -62,10 +62,10 @@ void EmulatorThread::Start(std::unique_ptr core) { if(!paused) { // @todo: decide what to do with the per_frame_cb(). per_frame_cb(); - this->core->Run(k_cycles_per_subsample); + this->core->Run(k_cycles_per_subframe); } }, [this](float fps) { - float real_fps = fps / k_input_subsample_count; + float real_fps = fps / k_number_of_input_subframes; if(paused) { real_fps = 0; }