feat(frontend): Debug -> ROM Info panel (v1.20.0)#116
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new read-only "ROM Info" panel to the debugger, displaying key cartridge metadata such as CRC32, SHA-256, board name, map mode, speed, region, coprocessor, ROM/SRAM sizes, and header offsets. The metadata is captured once per ROM load or close to avoid redundant frame-by-frame computations. To support this, the rustysnes_cart::header::Header struct has been updated with a decoded title field, which utilizes a new best-effort ASCII decoding helper. The crc32fast crate has also been added as a dependency to calculate the ROM's CRC32 hash. As there are no review comments provided, I have no additional feedback to offer.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
Adds a new Debugger overlay panel to display ROM identity (CRC32/SHA-256) and decoded SNES cart header information, with ROM metadata captured on ROM load/close instead of recomputed each frame. Also surfaces the SNES internal title from the cart header for display and documents the new UI.
Changes:
- Add Debug → ROM Info panel UI and wiring (
RomInfosnapshot + panel rendering). - Capture/store ROM identity/header once per ROM load/close (native + wasm load paths).
- Extend
rustysnes_cart::header::Headerwith a decodedtitle: Stringand add unit tests.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/frontend.md | Documents the new ROM Info panel behavior and data sources. |
| crates/rustysnes-frontend/src/ui_shell.rs | Threads rom_info through shell rendering into the debugger overlay. |
| crates/rustysnes-frontend/src/debugger/rom_info_panel.rs | New ROM Info panel implementation (field grid + SHA formatting test). |
| crates/rustysnes-frontend/src/debugger/mod.rs | Registers the new panel and routes rendering based on selected tab. |
| crates/rustysnes-frontend/src/app.rs | Stores/captures RomInfo on ROM load/close and passes it to the UI. |
| crates/rustysnes-frontend/Cargo.toml | Adds crc32fast dependency for ROM CRC32 hashing. |
| crates/rustysnes-cart/src/header.rs | Adds decoded title field to Header and tests for title decode/trim. |
| CHANGELOG.md | Notes the new ROM Info panel and header title field under Unreleased. |
| Cargo.lock | Records the added direct dependency linkage for crc32fast. |
74201ed to
fc27015
Compare
A read-only CRC32/SHA-256/header decode of the loaded cart, following the existing debugger/*.rs panel pattern. RomInfo is captured once per ROM load/close (not recomputed every frame like DebugSnapshot) since a loaded ROM's identity and header never change while it stays loaded. rustysnes_cart::header::Header gains a decoded title: String field -- Header::parse already had the raw 21-byte title bytes in hand for its own coprocessor-disambiguation match, this just surfaces them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…g-hooks Four real findings from review: a stale refresh_rom_info doc reference (no such function exists), and RomInfo::capture (a full-ROM CRC32 + SHA-256 hash) running unconditionally on every load attempt -- even when debug-hooks is off (the only build where the panel is reachable) and even on a failed load (which leaves the previous ROM running untouched, making the recapture pure waste). Gated all three capture call sites accordingly, reusing the existing "Loaded " status-prefix success check the RetroAchievements block already established for the native OpenRom path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
55985f4 to
b7b98ef
Compare
Summary
crates/rustysnes-frontend/src/debugger/rom_info_panel.rs), following the existingdebugger/*.rspanel module pattern.RomInfois captured once per ROM load/close (nativeOpenRom/CloseRomand the wasm32 file-picker path), not recomputed every frame likeDebugSnapshot-- a loaded ROM's identity/header never changes while it stays loaded.rustysnes_cart::header::Headergains a decodedtitle: Stringfield --Header::parsealready had the raw 21-byte title bytes in hand for its own coprocessor-disambiguation title match, this just surfaces them for display.Part of the Phase A UI/UX-parity ladder (see #113/#114/#115 for the sibling wasm-demo/peripheral-input/overscan fixes).
Test plan
cargo test --workspace --exclude rustysnes-android(475 passed)cargo clippy --workspace --exclude rustysnes-android --all-targets -- -D warnings(clean)cargo clippy -p rustysnes-frontend --all-targets --features full -- -D warnings(clean)debug-hooks,scripting,cheats,netplay,retroachievements,emu-thread(all clean)cargo clippy --target wasm32-unknown-unknown -p rustysnes-frontend --no-default-features --features wasm-winit,cheats,debug-hooks -- -D warnings(clean except the confirmed pre-existingsave_states.rs::base_dirfinding, unrelated to this change)RUSTDOCFLAGS="-D warnings" cargo doc --workspace --exclude rustysnes-android --no-deps(clean)cargo fmt --all --check(clean)rustysnes-cartheader title decode/trim (2 tests),rom_info_panel::hex_sha256formatting (1 test)🤖 Generated with Claude Code