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

Conversation

finger563
Copy link
Contributor

@finger563 finger563 commented Jan 9, 2024

Description

  • Removed sleep from run_nes_rom, run_sms_rom, and run_gameboy_rom since the sleep does not affect performance but it degrades sound (specifically on NES)

Motivation and Context

Audio on NES wasn't perfect (some audio artifacts / pops), but simply removing the sleep fixes it. I went ahead and removed the associated sleeps within the GBC and SMS components as well.

NOTE: this decreases the measured FPS to 60 on all platforms, but doesn't seem to affect their performance.

Thanks to @danialre for finding out the fix (removing the sleep) over at his fork:
https://github.com/danialre/saintcon2023-emu

How has this been tested?

Building and running on Hardware V0 and playing NES, GBC, and SMS/GG roms.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Removed sleep from run_nes_rom, run_sms_rom, and run_gameboy_rom since the sleep does not affect performance but it degrades sound (specifically on NES)
@finger563 finger563 added bug Something isn't working gameboy gameboy color NES audio sms sega master system labels Jan 9, 2024
Copy link

github-actions bot commented Jan 9, 2024

✅Static analysis result - no issues found! ✅

@finger563 finger563 changed the title fix(nes): remove sleep during run fix(nes): remove sleep during run for better audio Jan 9, 2024
@finger563 finger563 merged commit b7b5b0a into main Jan 9, 2024
2 checks passed
@finger563 finger563 deleted the fix/nes-audio branch January 9, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio bug Something isn't working gameboy color gameboy NES sms sega master system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant