feat(genesis): Significantly improve performance, splitting emulation across both cores for 60fps with audio no frameskip required 🚀#110
Merged
Conversation
…s somewhat broken
|
✅Static analysis result - no issues found! ✅ |
ESP-IDF Size Report for 'Esp Box Emu'
FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Splits the Genesis (Mega Drive) emulator across both ESP32-S3 cores and tunes memory/cache so it runs at a full 60 fps with audio and no frameskip (previously ~44 fps with frameskip). Also fixes incorrect Doom audio and clears the PR's static-analysis findings.
Genesis dual-core (components/genesis)
Performance/memory tuning
Static analysis
Motivation and Context
The Genesis core was the most demanding emulator in the project and only ran ~44 fps, requiring frameskip and producing imperfect audio. Profiling showed the cost was spread across all subsystems (interpreters + VDP) serialized on one core and starved by a too-small instruction cache — no single micro-optimization could reach 60 fps. Splitting the sound subsystem onto the second core plus the cache bump removes that ceiling. Separately, Doom's audio was audibly wrong due to a
stereo/mono buffer-sizing bug, and the PR's static-analysis check was failing (largely due to a cppcheck vck ids).
How has this been tested?
bottlenecks and to diagnose/fix a V-int-delivery bug that had silenced Sonic 2's music. The single-core pains as a fallback and was used as the reference.
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Console FPS/frame-time stats (representative, in-game):
SONIC THE HEDGEHOG: FPS: 69.9 Frame Time [min 9.5ms, avg 14.3ms, max 18.6ms]
ALADDIN: FPS: 75.7 Frame Time [min 9.0ms, avg 13.2ms, max 17.3ms]
SONIC 3 & KNUCKLES: FPS: 65.9 Frame Time [min 9.4ms, avg 15.2ms, max 23.0ms]
Types of changes
Checklist:
Software