feat(runtime): add an opt-in swimsuit unlock
Merged
TM
12d ago+278+278+012345678901234567890123456789-22-22-01234567890123456789
Summary
Adds an opt-in Unlock swimsuits toggle to the three launchers (RECOMP_UNLOCK_SWIMSUITS=1 for the runner). It is off by default, and with it off the runtime changes nothing.
- Vacation: the Collection of the girl being played holds every swimsuit she can wear (307 of the 328). They are reached the game's own way: View Collection in the hotel at night, then Take out.
- Taken-out suits are kept: a suit taken out is the player's from then on. It is saved with the rest of the inventory, and Keep puts it in the saved Collection.
- Exhibition: the swimsuit picker on the character select screen offers every girl all the suits she can wear.
- Saves: the Collection entries that were only lent are withdrawn when the game hashes its save image, so they are not written. Nothing else in the image is touched.
Design, guest addresses and seams are in docs/swimsuit-unlock.md.
How it works
unlock_swimsuits.csets the played girl's two ownership bits for each wearable swimsuit in the table at0xB5B244and remembers which bits it set. When the game clears one (Take out), the bit is forgotten and the inventory slot the game filled is left alone.- Exhibition reads a second table at
0x9DAE08that is never saved; every wearable suit is marked in it each frame. - Seams: the swap adapter (per frame), the
XcSHAUpdateadapter (save image hashed), and the save hooks insave_adapter.c(nothing is lent while the save routine runs).
No game function is replaced and the recipe is unchanged.
Testing
python -m unittest discover -s tools -p "test_*.py",tools/public_export.py verify --require-public-tree, and the runtimectestsuite pass on macOS, including the newunlock_swimsuits_test.c(lending, take-out, Keep and the save path on synthetic guest memory).- Scripted run on macOS against a copy of a save, made before taken-out suits were kept: View Collection listed the suits over 13 pages, one was taken out, and a save made afterwards had the same ownership table as before and loaded with the option off.
- Play-tested in Exhibition: the unlocked suits work there.
- Not yet checked: a save holding a suit taken out, Keep, the shops, a second girl's vacation, and Windows. The Windows launcher change is untested.
Draft until the remaining vacation checks are done.