Skip to content

Retrode2#32

Open
pathawks wants to merge 6 commits into
mainfrom
retrode2
Open

Retrode2#32
pathawks wants to merge 6 commits into
mainfrom
retrode2

Conversation

@pathawks

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 20, 2026 15:47

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.

Pull request overview

This PR adds first-class support for the Retrode 2 as a “directory-based” (USB mass-storage) device, and expands the system-handling/verification pipeline to better validate, name, and optionally trim dumps across several cartridge formats.

Changes:

  • Introduces a File System Access (“directory”) transport plus Retrode 2 connection/driver + UI flow for mounting a volume and dumping multiple ROMs/saves.
  • Adds/extends SystemHandlers and pure parsers for additional systems (SNES, Genesis, N64, SMS/GG, Virtual Boy, Atari 2600) including header-derived titles and DB-free integrity summaries.
  • Enhances No-Intro verification and dump pipeline behavior: combined multi-DAT lookups, canonical DAT ROM filename support, and No-Intro-confirmed over-dump correction + optional heuristic trim suggestions.

Reviewed changes

Copilot reviewed 67 out of 68 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/web-apis.d.ts File System Access API type augmentations used by directory-based devices.
src/lib/types.ts Extends core types (directory transport, headerTitle/suggestTrim hooks, verification metadata).
src/lib/transport/directory-transport.ts New transport for directory-mounted devices (Retrode-style volumes).
src/lib/core/overdump.ts Device/system-agnostic No-Intro-confirmed over-dump correction logic.
src/lib/core/overdump.test.ts Tests for candidate detection and authoritative trim adoption.
src/lib/core/dump-job.ts Integrates authoritative over-dump correction + optional trim suggestion into the dump pipeline.
src/lib/core/dump-job.test.ts Verifies databaseLoaded stamping behavior.
src/lib/core/nointro.ts Adds DAT romName propagation, expands system-name mapping, adds combined multi-DB lookup.
src/lib/core/nointro.test.ts Tests combined DB lookup and romName propagation.
src/lib/core/devices.ts Registers Retrode 2 as a supported device using directory transport.
src/lib/core/connection-registry.ts Wires Retrode 2 into connection/driver creation.
src/hooks/use-nointro.ts Exposes a multi-DAT DB getter for “match against anything” verification flows.
src/hooks/use-connection.ts Adds “directory” transport availability/labels + abort handling.
src/components/wizard/connect-step.tsx Detects directory picker availability for connect UI.
src/components/wizard/device-info-dialog.tsx Labels directory transport in device info UI.
src/components/wizard/retrode-rom-card.tsx New per-ROM card UI with trim toggle + header overrides on Retrode dumps.
src/lib/drivers/retrode2/retrode2-firmware.ts Firmware parsing/status helpers for Retrode config awareness.
src/lib/drivers/retrode2/retrode2-firmware.test.ts Firmware parsing/status tests.
src/lib/drivers/retrode2/retrode2-detect.ts Retrode volume file classification + save association helpers.
src/lib/drivers/retrode2/retrode2-detect.test.ts Tests for Retrode volume detection helpers.
src/lib/drivers/retrode2/retrode2-config.test.ts Tests for curated Retrode config parsing/serialization behavior.
src/lib/systems/snes/snes-system-handler.ts New SNES handler with headerTitle, summarizeDump, and suggestTrim.
src/lib/systems/snes/snes-system-handler.test.ts SNES handler tests.
src/lib/systems/snes/snes-rom.test.ts SNES checksum/header/trim tests supporting handler behavior.
src/lib/systems/genesis/genesis-system-handler.ts New Genesis handler with headerTitle, summarizeDump, and suggestTrim.
src/lib/systems/genesis/genesis-system-handler.test.ts Genesis handler tests.
src/lib/systems/genesis/genesis-header.ts Pure Genesis/32X header parser + checksum logic for summaries.
src/lib/systems/genesis/genesis-header.test.ts Genesis header parsing/checksum tests.
src/lib/systems/n64/n64-system-handler.ts New N64 handler (byte-order canonicalization, headerTitle, summarizeDump, suggestTrim).
src/lib/systems/n64/n64-system-handler.test.ts N64 handler title normalization tests.
src/lib/systems/n64/n64-header.test.ts N64 header parse/CRC/byte-order tests.
src/lib/systems/n64/controller-pak.ts Pure Controller Pak parser (directory + integrity) for summary UI.
src/lib/systems/n64/controller-pak.test.ts Controller Pak parser tests.
src/lib/systems/n64/n64-controller-pak-handler.ts Save-only handler for Controller Pak dumps with integrity-based summary.
src/lib/systems/n64/n64-controller-pak-handler.test.ts Controller Pak handler tests.
src/lib/systems/sms/sms-system-handler.ts New SMS/GG handler with summarizeDump + suggestTrim.
src/lib/systems/sms/sms-rom.test.ts SMS checksum/header/trim tests.
src/lib/systems/sms/sms-header.ts Pure “TMR SEGA” header parser for SMS/GG summary UI.
src/lib/systems/sms/sms-header.test.ts SMS/GG header parser tests.
src/lib/systems/vboy/vboy-rom.ts Pure Virtual Boy internal-header parser.
src/lib/systems/vboy/vboy-system-handler.ts New Virtual Boy handler with headerTitle + summarizeDump.
src/lib/systems/vboy/vboy-system-handler.test.ts Virtual Boy parsing/handler tests.
src/lib/systems/atari2600/atari2600-header.ts Pure heuristic identifier for Atari 2600 images (no header/checksum).
src/lib/systems/atari2600/atari2600-system-handler.ts New Atari 2600 handler with structural summary.
src/lib/systems/atari2600/atari2600-system-handler.test.ts Atari 2600 parser/handler tests.
src/lib/systems/gba/gba-system-handler.ts Adds headerTitle + summarizeDump for GBA and refactors hashing/validation formatting.
src/lib/systems/gba/gba-system-handler.test.ts Tests for GBA headerTitle + summarizeDump behavior.
src/lib/systems/gba/gba-header.ts Adds checksum helpers, header validity gate, region resolution, and metadata adjustments.
src/lib/systems/gba/gba-header.test.ts Tests for checksum/isGBARom/region resolution.
src/lib/systems/gb/gb-system-handler.ts Adds headerTitle + summarizeDump for GB/GBC based on header parsing.
src/lib/systems/gb/gb-system-handler.test.ts Tests for GB/GBC headerTitle + summarizeDump.
src/lib/systems/gb/gb-header.ts Expands GB header parsing (region/flags/checksums) to support summaries.
src/hooks/use-retrode2.test.ts Tests for “volume gone” error classification behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +198 to +204
async send(): Promise<void> {
throw new Error("DirectoryTransport does not support streaming I/O");
}

async receive(): Promise<Uint8Array> {
throw new Error("DirectoryTransport does not support streaming I/O");
}
Comment thread src/lib/core/overdump.ts
Comment on lines +23 to +26
/** Don't propose a trimmed size below this (smallest plausible cart). */
const MIN_SIZE = 0x8000; // 32 KB
/** A trailing constant-fill run must be at least this long to count. */
const MIN_FILL = 0x10000; // 64 KB
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