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

Feature/video speedup #72

Merged
merged 11 commits into from
Jun 29, 2024
Merged

Feature/video speedup #72

merged 11 commits into from
Jun 29, 2024

Conversation

finger563
Copy link
Contributor

@finger563 finger563 commented Jun 29, 2024

Description

  • Switch frame timing to use esp_timer_get_time() for more precision and less overhead
  • Update video task to perform the display scaling divide and store it as an inverse factor for multiplication in the loops for faster speed
  • Update video task so the loops iterate over half as many values, writing two values (32 bits) at a time for slightly faster speed
  • Allow nes, gameboy/color, sms emulators to unlock their frame timing (toggled with the x button), otherwise they target 60 Hz (sleeping to wait)
  • Work on improving speed of genesis emulator, moving more of its code to IRAM.

Motivation and Context

Overall we want better performance (so we can unlock the emulators and run them faster than real time - because I'm impatient :P) and we need to squeeze more performance out of every subsystem to try to get the genesis emulator to run full speed when audio is enabled (and ideally to not have to skip frame rendering...).

How has this been tested?

Building and running main on box-3-emu. Testing all the emulators (and the unlocked variants of nes, gbc, and sms emulators.

  • Main branch test on Sonic 1: 53.8 FPS average (when frameskip=3, audio on)

  • This branch test on Sonic 1: 74.8 FPS average (when frameskip=3, audio on)

    Frames: 1859
    FPS: 74.8
    Frame Time: [min 5151 us, avg: 13369.2 us, max: 33994 us]
    

There's still quite a few frames which exceed the target of 16ms (60Hz), but it's definitely an improvement.

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.

@finger563 finger563 marked this pull request as draft June 29, 2024 19:17
Copy link

github-actions bot commented Jun 29, 2024

✅Static analysis result - no issues found! ✅

@finger563 finger563 self-assigned this Jun 29, 2024
@finger563 finger563 added enhancement New feature or request performance labels Jun 29, 2024
@finger563 finger563 marked this pull request as ready for review June 29, 2024 21:25
@finger563 finger563 merged commit 86732be into main Jun 29, 2024
3 checks passed
@finger563 finger563 deleted the feature/video-speedup branch June 29, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant