chris c1ce972ce9 Save import: add Gen 4 and Gen 5 (NDS)
savedex.js now also reads 512 KB DS saves:

- Gen 4 (D/P/Pt, HG/SS): dex struct at slot+0x12 — caught 0x40 bytes at
  +0x16, four per-form "seen" copies at +0x56/0x96/0xD6/0x116 OR'd
  together, 493 species.
- Gen 5 (B/W, B2/W2): dex block at slot+0x21600 (BW) / +0x21400 (B2W2) —
  caught at +0x08, four "seen" copies at +0x5C/0xB0/0x104/0x158, 649
  species; the offset that validates picks the game.
- Handles both save slots (picks the fuller one), a DeSmuME `.dsv`
  footer, and oversized flash dumps.

No block CRC — validated structurally instead (nothing set past the last
species, every caught species also seen), so a wrong offset is rejected
rather than importing garbage. Offsets are from PKHeX; worth checking
against a real save.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Ve7HLspzeG2xDPtJQ8vmu
2026-09-10 10:10:56 -04:00
..