Skip to content

Commit fe9e1ae

Browse files
doublegateclaude
andcommitted
fix(frontend): address PR #49 review comments
- 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>
1 parent c5bd89d commit fe9e1ae

7 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎crates/rustysnes-cart/src/board.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub trait Board {
133133
/// The GSU register file (R0-R15 + SFR + PBR), for a Super FX board's debugger Cart panel.
134134
///
135135
/// Default `None` — only [`crate::coproc::superfx::SuperFxBoard`] overrides this. A
136-
/// read-only debug accessor, not a control surface (`docs/frontend.md` §open questions).
136+
/// read-only debug accessor, not a control surface (`docs/frontend.md` §Debugger overlay).
137137
fn debug_gsu_state(&self) -> Option<([u16; 16], u16, u8)> {
138138
None
139139
}

‎crates/rustysnes-cart/src/coproc/gsu.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ impl Gsu {
414414

415415
// --- Debug-only read accessors (no side effects, unlike `read_register`'s memory-mapped
416416
// window which can have read-clear/latch behavior on some addresses). For the debugger
417-
// overlay's Cart panel (`docs/frontend.md` §open questions). ------------------------------
417+
// overlay's Cart panel (`docs/frontend.md` §Debugger overlay). ------------------------------
418418

419419
/// The R0-R15 general-purpose register file (R15 is also the program counter).
420420
#[must_use]

‎crates/rustysnes-core/src/scheduler.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl System {
205205
}
206206

207207
/// The SA-1 second CPU's architectural register file, or `None` when no SA-1 cart is
208-
/// installed. For the debugger overlay's Cart panel (`docs/frontend.md` §open questions).
208+
/// installed. For the debugger overlay's Cart panel (`docs/frontend.md` §Debugger overlay).
209209
#[must_use]
210210
pub fn sa1_regs(&self) -> Option<Regs> {
211211
self.sa1_cpu.as_ref().map(|c| c.regs)

‎crates/rustysnes-frontend/src/app.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl App {
439439
rom_loaded: emu.rom_loaded(),
440440
};
441441
// Only build the debugger snapshot when the window is actually open — a real,
442-
// avoidable per-frame cost otherwise (`docs/frontend.md` §open questions).
442+
// avoidable per-frame cost otherwise (`docs/frontend.md` §Debugger overlay).
443443
let debug = active.shell.debugger_open.then(|| emu.debug_snapshot());
444444
drop(emu); // release the brief lock BEFORE the wgpu upload + egui pass
445445
(fb, dims, info, audio_samples, debug)

‎crates/rustysnes-frontend/src/debug_snapshot.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ pub struct PpuSnapshot {
4343
/// The full 256-entry CGRAM palette (512 bytes — cheap to copy wholesale every frame, unlike
4444
/// VRAM's 64 KiB).
4545
pub cgram: [u16; 256],
46-
/// A [`VRAM_WINDOW_LEN`]-word window of VRAM starting at `vram_window_start` (word address),
47-
/// controlled by the debugger UI's scroll position — copying all 64 KiB every frame would be
48-
/// real, avoidable per-frame cost for a window the user can only look at part of at once.
46+
/// A [`VRAM_WINDOW_LEN`]-word window of VRAM starting at `vram_window_start` (word address) —
47+
/// copying all 64 KiB every frame would be real, avoidable per-frame cost for a window the
48+
/// user can only look at part of at once. `EmuCore::set_debug_vram_scroll` moves the window;
49+
/// no UI control calls it yet (fixed at the window's start address today) — a follow-up.
4950
pub vram_window: [u16; VRAM_WINDOW_LEN],
5051
/// The word address `vram_window` starts at.
5152
pub vram_window_start: u16,

‎crates/rustysnes-frontend/src/ui_shell.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ impl ShellState {
313313
});
314314
ui.separator();
315315
let Some(debug) = debug else {
316-
ui.label("(no ROM loaded — nothing to inspect yet)");
316+
// `debug` tracks `debugger_open`, not ROM state (a snapshot builds fine for a
317+
// blank core) — don't claim a ROM-load reason that may not be why it's `None`.
318+
ui.label("(no debugger snapshot yet)");
317319
return;
318320
};
319321
match self.panel {

‎crates/rustysnes-ppu/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ impl Ppu {
892892
}
893893

894894
/// The current `BGMODE` ($2105) value (0..=7) — which of the 8 tile/priority layouts is
895-
/// active. For the debugger overlay's PPU panel (`docs/frontend.md` §open questions).
895+
/// active. For the debugger overlay's PPU panel (`docs/frontend.md` §Debugger overlay).
896896
#[must_use]
897897
pub const fn bg_mode(&self) -> u8 {
898898
self.io.bg_mode

0 commit comments

Comments
 (0)