Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nes): remove sleep during run for better audio #55

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading