Skip to content

Commit

Permalink
Merge pull request #55 from esp-cpp/fix/nes-audio
Browse files Browse the repository at this point in the history
fix(nes): remove sleep during run for better audio
  • Loading branch information
finger563 authored Jan 9, 2024
2 parents f494698 + 414a959 commit b7b5b0a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions components/gbc/src/gameboy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ void run_to_vblank() {
auto end = std::chrono::high_resolution_clock::now();
auto elapsed = std::chrono::duration<float>(end-start).count();
update_frame_time(elapsed);
// frame rate should be 60 FPS, so 1/60th second is what we want to sleep for
static constexpr auto delay = std::chrono::duration<float>(1.0f/60.0f);
std::this_thread::sleep_until(start + delay);
}

void reset_gameboy() {
Expand Down
3 changes: 0 additions & 3 deletions components/nes/src/nes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ void run_nes_rom() {
auto end = std::chrono::high_resolution_clock::now();
auto elapsed = std::chrono::duration<float>(end-start).count();
update_frame_time(elapsed);
// frame rate should be 60 FPS, so 1/60th second is what we want to sleep for
static constexpr auto delay = std::chrono::duration<float>(1.0f/60.0f);
std::this_thread::sleep_until(start + delay);
}

void load_nes(std::string_view save_path) {
Expand Down
3 changes: 0 additions & 3 deletions components/sms/src/sms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ void run_sms_rom() {
auto end = std::chrono::high_resolution_clock::now();
auto elapsed = std::chrono::duration<float>(end-start).count();
update_frame_time(elapsed);
// frame rate should be 60 FPS, so 1/60th second is what we want to sleep for
static constexpr auto delay = std::chrono::duration<float>(1.0f/60.0f);
std::this_thread::sleep_until(start + delay);
}

void load_sms(std::string_view save_path) {
Expand Down

0 comments on commit b7b5b0a

Please sign in to comment.