Skip to content

Commit

Permalink
Platform: Core: improve naming regarding input subsampling
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Jan 18, 2024
1 parent d9e87f9 commit 27dc1cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/platform/core/include/platform/emulator_thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Message> msg_queue;
std::mutex msg_queue_mutex;
Expand Down
6 changes: 3 additions & 3 deletions src/platform/core/src/emulator_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -62,10 +62,10 @@ void EmulatorThread::Start(std::unique_ptr<CoreBase> 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;
}
Expand Down

0 comments on commit 27dc1cf

Please sign in to comment.