Repository navigation
feat(frontend): debugger overlay live state viewers (T-81-001, PR A) - #49
Merged
Merged
Conversation
Fill in the debugger window's 4 panels (65C816/PPU/APU/Cart) with real read-only state, gated behind the debug-hooks flag. A new DebugSnapshot is copied out under the same brief emu lock ShellInfo already uses, mirroring the shell's non-negotiable never-hold-the-lock-in-egui rule. Includes SA-1 second-CPU and Super FX/GSU register-file state in the Cart panel from day one, resolving docs/frontend.md's open question. Disassembly + PC breakpoints/step controls (PR B) and read/write watchpoints (T-81-001b, needs a core-crate debug-hooks feature + Bus-level hook) are tracked as explicit follow-ups, not bundled here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
There was a problem hiding this comment.
Pull request overview
Adds a read-only, per-frame “live state” debugger overlay to the RustySNES frontend, using a DebugSnapshot copied under the same brief emu lock as ShellInfo, so egui never touches the lock directly. This expands the existing debugger window scaffold into real CPU/PPU/APU/Cart viewers (including SA-1 and Super FX state) and updates project docs/changelog to reflect the new instrumentation scope split.
Changes:
- Implemented
DebugSnapshot+ plumbing (EmuCore::debug_snapshot) and passed it into the egui shell for rendering. - Replaced debugger panel stubs with live state viewers (CPU regs/flags, key PPU regs + CGRAM + VRAM window, APU SMP/DSP voice regs, Cart board + SA-1/GSU state).
- Added small read-only accessors in core/PPU/cart needed to surface this state, and updated docs/to-dos/changelog accordingly.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| to-dos/phase-8-reach/sprint-1-instrumentation.md | Updates the Phase 8 instrumentation plan to reflect PR A/PR B split and current status. |
| docs/frontend.md | Documents the debugger overlay design/feature gating and resolves the coprocessor panel question. |
| crates/rustysnes-ppu/src/lib.rs | Adds small read-only PPU accessors for overlay display (bg_mode, display_brightness). |
| crates/rustysnes-frontend/src/ui_shell.rs | Renders real debugger panels from a provided DebugSnapshot; feature-gates the Debug menu entry UI. |
| crates/rustysnes-frontend/src/lib.rs | Exposes the new debug_snapshot module. |
| crates/rustysnes-frontend/src/emu.rs | Implements EmuCore::debug_snapshot and VRAM-window snapshotting for the overlay. |
| crates/rustysnes-frontend/src/debug_snapshot.rs | Defines snapshot structs used by the debugger overlay panels. |
| crates/rustysnes-frontend/src/app.rs | Builds the snapshot under lock only when the debugger window is open; passes snapshot into shell render. |
| crates/rustysnes-core/src/scheduler.rs | Exposes SA-1 regs via System::sa1_regs for the Cart panel. |
| crates/rustysnes-cart/src/coproc/superfx.rs | Implements Board::debug_gsu_state for Super FX boards. |
| crates/rustysnes-cart/src/coproc/gsu.rs | Adds read-only GSU register accessors for debug viewing. |
| crates/rustysnes-cart/src/board.rs | Adds default-no-op debug_gsu_state trait hook. |
| CHANGELOG.md | Records the new debugger overlay live state viewers and scope split. |
doublegate
added a commit
that referenced
this pull request
Jul 9, 2026
This entry belongs to PR #49 (a separate, still-unmerged branch) and was mistakenly duplicated into this branch's CHANGELOG while resolving a merge conflict against main -- this PR has nothing to do with the debugger overlay. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- ui_shell.rs: the "no debugger snapshot yet" message no longer claims a ROM-load reason it doesn't actually check -- debug tracks debugger_open, not ROM state (a snapshot builds fine for a blank core). - debug_snapshot.rs: stop claiming vram_window_start is "controlled by the debugger UI's scroll position" -- no UI calls set_debug_vram_scroll yet, so the window is fixed today. - Five stale `docs/frontend.md §open questions` references updated to `§Debugger overlay`, the section that actually documents this now. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
doublegate
added a commit
that referenced
this pull request
Jul 9, 2026
…ation" (#48) * docs(plan): fold the real wasm frontend build into v0.8.0 "Instrumentation" The user found RustySNES's live wasm demo renders blank by comparing against RustyNES's own working deployment. Root cause: wasm.rs has been an explicitly-labeled scaffold stub since v0.1.0 -- it installs a panic hook, logs one message, and returns, never building the actual app. Every prior "wasm demo is live" CHANGELOG claim checked only HTTP-level liveness (200 status, correct content-types), never that the app actually renders. A research pass into RustyNES's own wasm.rs/wasm_winit.rs confirmed a concrete two-stage port path RustySNES's own Cargo.toml feature split (wasm-winit default / wasm-canvas) already anticipated: a canvas-2D MVP first (fast, no wgpu/egui dependency), then winit/wgpu unification through the same App native already uses. Also confirmed a real gap, not just plumbing: app.rs/audio.rs are currently excluded from the wasm32 build entirely. Updates to-dos/VERSION-PLAN.md's v0.8.0 section, to-dos/phase-8-reach/ overview.md (goal, exit criteria, scope, risks), and sprint-1-instrumentation.md (two new tickets, T-81-005/T-81-006) with the concrete port plan, sourced from RustyNES's actual code, not invented from scratch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(changelog): remove debugger-overlay entry accidentally added here This entry belongs to PR #49 (a separate, still-unmerged branch) and was mistakenly duplicated into this branch's CHANGELOG while resolving a merge conflict against main -- this PR has nothing to do with the debugger overlay. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * docs: fix bot-flagged issues on PR #48 (split code spans, T-81-005 audio gap) - Rejoin three inline code spans that were split across a line wrap (CommonMark renders the newline as a literal space, corrupting the path/identifier), in CHANGELOG.md, VERSION-PLAN.md, and sprint-1-instrumentation.md. - T-81-005's description text never mentioned audio even though its acceptance criteria required it; added it to the description so the two agree. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…state-viewers # Conflicts: # CHANGELOG.md
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.
Summary
debug-hooksfeature flag.DebugSnapshot(crates/rustysnes-frontend/src/debug_snapshot.rs) is copied out under the same brief emu lockShellInfoalready uses — the shell's non-negotiable rule (ui_shell.rs's module doc) is that egui never touches the emu lock directly.System::sa1_regs) and Super FX/GSU register-file state (Board::debug_gsu_state) in the Cart panel from day one, resolvingdocs/frontend.md's previously-open question in the breadth-inclusive direction this ladder takes.debug-hooksoff, the Debug menu entry itself is feature-gated, sodebugger_opencan never becometrueand the app never builds a snapshot — build stays byte-identical.Scope note
T-81-001's original acceptance criteria bundled breakpoints/stepping into the same ticket as the state viewers. Splitting that out during implementation:
System::step_instruction().debug-hooksfeature onrustysnes-coreitself plus aBus-level hook, deserving its own focused review since it touches the hottest path in the engine.to-dos/phase-8-reach/sprint-1-instrumentation.mdanddocs/frontend.mdare updated to reflect this split and current status.Test plan
cargo test --workspace— 332 passed, 0 failedcargo clippy --workspace --all-targets -- -D warnings— cleancargo clippy -p rustysnes-frontend --all-targets --features debug-hooks -- -D warnings— cleancargo fmt --check— cleanRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps— cleandebug-hooksoff, the debug menu/snapshot code path is unreachable (verified via feature gating, not just review)🤖 Generated with Claude Code