Repository navigation
Genesis: rebuild YM2612 pointers after loading a save state - #21
Conversation
Bumps components/genesis/gwenesis to esp-cpp/gwenesis#1. A save state written by another firmware build restored stale YM2612 pointers (operator routing, detune rows), so the FM output went silent and stray writes corrupted memory; the load now rebuilds them and keeps this build's audio rates. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
There was a problem hiding this comment.
🔵 Needs a closer look
The missing submodule and lack of attachable changed files prevent a complete review, while Tab5 save/load compatibility still requires target-device validation.
No open issues 🎉
What changed in this PR
This PR updates the Genesis emulator’s gwenesis submodule to fix stale YM2612 pointers restored from save states created by another firmware build, addressing lost audio and heap corruption.
Changes:
- Rebuilds YM2612 operator-routing and detune pointers after loading a save state.
- Preserves the current build’s YM2612 and SN76489 audio rates.
- Stores the full 512-byte register file in new saves.
The submodule may need re-pinning if the upstream PR is squash-merged. No changed-file paths were supplied for review; this overview reflects the PR description.
| File | Description |
|---|
Review effort: Balanced
ESP-IDF Size Report for 'Tab5 Emu'
FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Bumps
components/genesis/gwenesisto esp-cpp/gwenesis#1, the same fix as esp-cpp/esp-box-emu#137.Problem
A save state written by another firmware build restored stale YM2612 pointers (operator routing, detune rows). On the box this left Sonic 2 silent after resuming, even after an emulator reset, and the stray writes corrupted the heap.
Fix
The load now rebuilds those pointers and keeps this build's YM2612 / SN76489 audio rates. New saves store the full 512-byte register file.
The submodule points at the gwenesis PR branch commit (
d984bd5). If that PR is squash-merged, re-pin it to the merge commit onesp32before merging this one.Testing
🤖 Generated with Claude Code
https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY