Files
gen1recomp/tests
Claude 5920402de4 Gen 2: a cart saves into its own scope, not the base game's
A cart's saves are keyed by cart id, not by version.  SaveData resolves
every path through activeScopeKey, which answers cart_<id> while one is
active, and the launcher lists, creates and selects a cart's slots from
the cartSlots registry (RomImporter._refreshSlots / _selectSlot /
_newSlot).

src/core/gen2/Save.lua asked in the version's name alone.  saveNames
built saves/<version>/<slot>.lua or save_<suffix>.lua from the version in
both branches and never consulted the active cart, so a cart on Gold,
Silver or Crystal read and wrote the BASE GAME's playthrough.  Gen 1 was
unaffected because it saves through SaveData itself, which is already
cart-scoped -- so this only showed on a Gen 2 cart.

It was worse than sharing one file.  Save.save opens by asking
activeSlot(version) and, on nil, calling createSlot + setActiveSlot in
the version's name, so the first save inside a cart registered a slot in
the base game's registry and made it active: the cart's playthrough
appeared in the launcher's list for the base version, and the player's
own save there was what the cart then overwrote.

Both sites now resolve the cart scope the way SaveData does, and the
names they build are SaveData's own -- slotDir's saves/cart_<id>/ and
legacyNames' save_cart_<id>.lua -- so the in-game save layer and the
launcher land on one file again.

tests/gen2_save_test.lua covers the cart's flat name, its slot name, the
slot going into the cart's registry rather than the base game's, the
cart's scope winning over a base slot, and the base game keeping its own
once the cart is cleared.  Four of them fail on the unpatched module.

Reported as "when I select Wild Crystal to launch it loads my save from
regular Crystal".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 18:36:17 +00:00
..
2026-07-19 16:18:18 -04:00
2026-09-05 09:03:47 -04:00
2026-07-17 20:30:02 -04:00
2026-07-19 16:18:18 -04:00
2026-08-15 06:04:04 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-18 10:49:04 -04:00
2026-08-24 07:52:05 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-24 07:52:05 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-18 15:37:27 -05:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-24 07:52:05 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-24 07:52:05 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-24 07:52:05 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-24 07:52:05 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-24 07:52:05 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-08-11 11:53:30 -04:00
2026-07-19 16:18:18 -04:00
2026-08-28 10:14:44 -04:00
2026-08-28 10:14:44 -04:00
2026-08-28 10:14:44 -04:00
2026-08-28 10:14:44 -04:00
2026-08-28 10:14:44 -04:00
2026-07-19 16:18:18 -04:00
2026-08-13 06:05:27 -04:00
2026-08-12 09:22:30 -04:00
2026-08-12 09:22:30 -04:00
2026-07-24 09:06:29 -04:00
2026-09-03 07:11:31 -04:00
2026-09-04 09:56:35 -04:00
2026-08-28 14:15:51 -04:00
2026-08-28 10:14:44 -04:00
2026-09-04 09:56:35 -04:00
2026-08-28 10:14:44 -04:00
2026-08-04 10:32:51 -04:00
2026-07-21 05:50:40 -04:00
2026-08-04 09:41:44 -04:00
2026-08-04 09:41:44 -04:00
2026-07-24 09:06:29 -04:00
2026-07-19 16:18:18 -04:00
2026-08-04 09:41:44 -04:00
2026-07-24 09:06:29 -04:00
2026-08-18 11:43:23 -04:00
2026-07-19 16:18:18 -04:00
2026-07-26 13:38:52 -04:00
2026-08-27 07:11:43 -04:00
2026-07-19 16:18:18 -04:00
2026-07-24 09:06:29 -04:00
2026-08-27 07:11:43 -04:00
2026-07-23 16:55:03 -04:00
2026-07-21 05:50:40 -04:00
2026-07-23 16:55:03 -04:00
2026-07-24 09:06:29 -04:00
2026-07-21 05:50:40 -04:00
2026-07-19 16:18:18 -04:00
2026-08-24 07:52:05 -04:00
2026-08-13 06:05:27 -04:00
2026-07-30 10:17:30 -04:00
2026-08-11 11:53:30 -04:00
2026-07-19 16:18:18 -04:00
2026-07-19 16:18:18 -04:00
2026-08-28 10:14:44 -04:00
2026-07-27 08:37:11 -04:00