PRET's crystal and crystal_au builds reproduce both retail cartridges,
and every label the profile pins keeps its address in all three;
check:reference now verifies that when the rebuilds are present. The
revision comes from the header. Revision 1.0's Battle Tower draws only
the first 21 trainers and picks its texts' gender from the name's sixth
character, checked against each cartridge. A native backup imports
across the three, which share every map, event and object.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Savegames → Import backup now reads an English Crystal .sav (from an
emulator, a cartridge dump or the 3DS Virtual Console's sav.dat) and
converts it into a native save after a preview.
- world/cartridge-save.ts: picks the copy TryLoadSaveFile would load
(check values and checksums of the main copy, else the backup), reads
the saved WRAM block, the numbered boxes, mail backups, Hall of Fame and
Battle Tower by PRET labels (SRAM, SAVE_BLOCK in the profile, checked by
check:reference with the SAV constants), engine flags via EngineFlags,
scenes via MapScenes, and the map's objects and masks.
- Clock: an emulator MBC3 footer plus the time since it was written,
FixDays/FixTime with wStart*, mapped to the minute and weekday offsets;
without one, the device's time and the saved wCurDay. Day countdowns
move with the day difference.
- Refused with the reason: unported maps, the Bug-Catching Contest, a
Battle Tower challenge, characters outside the naming screen.
- Names keep <PK>/<MN> as ᴾᴷ/ᴹᴺ (one character, one tile); trainer names
accept the naming screen's alphabet; boxed Eggs validate; native states
up to 256 kB load (a full PC exceeded 64 kB).
- Tests: the committed debug saves, layout offsets against the symbols,
backup fallback, clock footers, day counters, refusals, slot session
and the Savegames flow in Chromium and WebKit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Savegames now lists independent save slots made with the loaded ROM:
new game, continue, rename, duplicate, export and delete. The native
database moves to IndexedDB version 2; the singleton save becomes
"Save 1" inside the upgrade transaction, so it migrates exactly once and
the old store is left untouched. Each write adds a generation and drops
older ones in one transaction, keeping two records with CRC-32
checksums: a damaged newest record falls back to the previous one.
Slots and records from a newer player are kept and never written.
Imports are checked in a scratch world before anything changes and
previewed with the trainer, progress, saved time, game data version and
the slots of the same trainer; they go into a new save or replace one,
whose previous record stays recoverable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>