Function detect
pub fn detect(rom: &[u8]) -> Option<Cartridge>Expand description
Detect the bankswitch scheme from a ROM image and build the board.
Same-size same-catalogue collisions (CV vs plain 2K/4K, Superchip vs
plain F8/F6/F4, E7 vs plain F6) are resolved with hotspot-pattern
heuristics ported from Stella’s CartDetector (T-0401-009) — checked
BEFORE falling back to the more common plain scheme, so a real CV/
Superchip/E7 image is never silently misdetected. Schemes Rusty2600
hasn’t implemented yet (E0/FE/3F at 8 KiB, DPC+/BMC, etc.) still return
None, keeping the honesty gate truthful — see each TODO below.
Returns None for an unrecognized size / scheme.