Skip to content

Genesis: fix the Maximum Carnage hang (Z80 reset), keep sound running muted - #22

Merged
finger563 merged 6 commits into
mainfrom
fix/genesis-z80-reset
Nov 13, 2026
Merged

finger563 merged 6 commits into
mainfrom
fix/genesis-z80-reset

Conversation

@finger563

@finger563 finger563 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #21 (based on its branch; retarget to main once #21 is merged). Pins esp-cpp/gwenesis#2.

What

Bumps the shared Genesis core to pick up:

  • Maximum Carnage hang after START GAME, fixed: the Z80 was restarted on every "release reset" write, even when it was already running. One restart cut the sound driver off while it was loading the level-start song, so the song never ended and the game waited forever.
  • Menu Reset holds the Z80 in reset as at power on.
  • Sound while muted: the Z80 and sound chips keep running; mute only drops the output.
  • Save states: loading keeps the Z80's IAutoReset set (older saves stored 0).

The 68000 clock setting and wait-loop skip in that PR compile out here: this build doesn't define M68K_OVERCLOCK_SHIFT / M68K_IDLE_SKIP.

Testing

  • Build: the Tab5 build compiles cleanly.
  • Maximum Carnage on the Tab5: installed over the USB link; after the pause-menu Reset, START GAME reaches the first level. Also verified on the ESP32-S3-BOX-3 and in a host build of the core against Genesis Plus GX.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

finger563 and others added 2 commits November 13, 2026 12:10
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
… muted)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Copilot AI balanced review requested due to automatic review settings November 13, 2026 21:50
finger563 and others added 2 commits November 13, 2026 16:01
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Changes to muted dual-core Z80 execution and legacy save-state interrupt restoration require Tab5 runtime validation of mute/unmute transitions and older-state resume, which the reported test does not cover.

No open issues 🎉

What changed in this PR

Updates the shared Genesis core to fix Maximum Carnage’s hang after START GAME and improve reset, mute, and save-state behavior, building on the save-state fixes in #21.

Changes:

  • Corrects Z80 reset handling and restores power-on reset behavior for menu Reset.
  • Keeps the Z80 and sound chips running while muted, suppressing only audio output.
  • Preserves Z80 IAutoReset when loading older save states.

No file paths were supplied for review.

File Description

Review effort: Balanced

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Base automatically changed from fix/genesis-savestate-sound to main November 13, 2026 22:59
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
@github-actions

Copy link
Copy Markdown

ESP-IDF Size Report for 'Tab5 Emu'

Metric Base PR Delta
FLASH 0 bytes (0.00%) 0 bytes (0.00%) 0 bytes (0.00%)
DRAM 267,922 bytes (60.71%) 267,732 bytes (60.67%) ⬇️ -190 bytes (-0.04%)
IRAM 0 bytes 0 bytes 0 bytes
RAM (DRAM+IRAM) 267,922 bytes 267,732 bytes ⬇️ -190 bytes (-0.04%)

FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available.
DRAM/IRAM usage does not include memory used by the heap allocator at runtime.
This report was generated by esp-idf-size-delta.

@finger563
finger563 merged commit 34511df into main Nov 13, 2026
1 check passed
@finger563
finger563 deleted the fix/genesis-z80-reset branch November 13, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants