save path of the relocated coin and flag arrays verified in game: saves after finishing jungle 2 and village 1 byte-identical to the old exe, testlevel coins never reach the save

This commit is contained in:
MineTec committed 2026-11-07 16:51:16 +01:00
1 parent a64df88c77
commit bc8408d963
4 files changed
+34 -2

No files matched your search

+2
View File
@@ -28,6 +28,8 @@ first free chapter from 32, and old projects on other chapters are moved automat
LlamaMod additionally relocates both arrays to a 128-entry buffer in unused space of `groove.exe` LlamaMod additionally relocates both arrays to a 128-entry buffer in unused space of `groove.exe`
(base exe patch, revision 2), so even picking an empty chapter on the world map is harmless with (base exe patch, revision 2), so even picking an empty chapter on the world map is harmless with
LlamaMod's executable. Mods still keep to 1 and 32–49 so they also work with an unpatched exe. LlamaMod's executable. Mods still keep to 1 and 32–49 so they also work with an unpatched exe.
Save games are unaffected: a save after finishing a normal or TestLevel chapter is byte-identical
with and without the relocation, and only the 54 entries of worlds 0–8 are saved.
## Making world 9 reachable ## Making world 9 reachable
Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+32 -2
View File
@@ -109,8 +109,38 @@ Verified in game (apptest :24, 2026-11-07):
* Arena (test mod) on chapter 9, 2 coins collected (HUD 2 / 12), quit to the map → map fine. * Arena (test mod) on chapter 9, 2 coins collected (HUD 2 / 12), quit to the map → map fine.
* Save with world-1 chapter 1 flags = 3 and gold count 2: slot menu "Goldmünzen 2", the map shows * Save with world-1 chapter 1 flags = 3 and gold count 2: slot menu "Goldmünzen 2", the map shows
the collectible and gold icons of Village chapter 1 (KSV load loop + map reads relocated). the collectible and gold icons of Village chapter 1 (KSV load loop + map reads relocated).
* Not verified in game: the KSV save loop after finishing a level (same patch shape as the load * **KSV save loop after finishing a normal level, A/B byte comparison** (apptest :25, sessions
loop, covered by the unit test). `savetest-a` = fat jar of the commit before 00b2880, base REVISION 1; `savetest-b` = HEAD,
REVISION 2; 2026-11-07). Slot 3 (`king2.ksv`) preloaded identically in both with a distinct
pattern for worlds 1–8, chapters 1–5: flags `(w + c) % 4`, coins `((5w + c) % 15 + 1) << 12`
(gold count 19/20 to match), so a save loop reading the old arrays in B would write zeros.
Mods: boot-to-level (slot 3) + cheats `rewards` (flags |= 3 at the chapter end). Runs:
1. **Jungle night 2** (world 2 ch. 2, exit pad reachable directly): start `29.45, 3.5, 60.3, 180
@ 2/2`, Up ~5.5 s → 3 coins → tally "Münzen gesammelt 3 / 70" → Return.
2. **Village 1** (world 1 ch. 1): t1l1m001 rebuilt by a throw-away tool (WadImporter → tile 420
set to its swap-alt model 49 with the exit pad, RubyIdolDoor removed, the two coins near the
door moved to x 42.5, `StartOverride` 42.5/3.5/51.8 yaw 180 → WadBuilder), written over the
session's `cd-active/wads/t1l1m001.wad` after apply; Up 3.5 s → tally "Dorf Kapitel 1,
Münzen gesammelt 2 / 55" → Return. (Village 4's direct exit is behind the Yzma boss fight.)
3. **TestLevel chapter 1** (Test World, start `44.3, 3.6, 15.5, 90 @ 9/1`, 3 coins, rewards
cheat) on top of the Village-1 save → tally → Return.
All three saved KSVs are **byte-identical in A and B** (`cmp`: 0 differences). Run 1: chapter
(2,2) coins 9 → 3, flags 0 → 3, gold 20 → 21, progress (2,2) → (2,3), cursor (2,3), last played
(2,2); every other preloaded coin/flag entry and bytes 0xB0–0xFF unchanged. Run 2: (1,1) coins
→ 2, flags → 3, gold 19 → 20, progress (1,2). Run 3 (world-9 leak check): only cursor world/chapter
(9,1) and last-played world 9 change; all 54 coin/flag entries, gold, progress and 0xB0–0xFF stay
as before – the world-9 coins/flags (buffer index 55) are not written (54 entries only). B's save
loaded again without mods: slot menu "Gespeichertes Spiel 3 / Dorf Kapitel 2 / Goldmünzen 20",
world map on Village 2 with the collectible and gold icons (preloaded flags 3).
![tallies, slot menu, map (B)](img/mods/testlevel_save_ab.jpg)
* **TestLevel tally** (question from the coaster test): Return does save (KSV rewritten, see run 3)
– there is never a visible "saved" step, also not in normal levels (the next level loads at
once). The Test World / coaster / arena exits lead back to the same chapter, so the restart zeroes
that chapter's coin counter (level start, FUN_0041cba0) → the map then shows 0; world-9 coins are
never in the KSV anyway. Expected and harmless. Esc on the tally asks "Möchtest du das Spiel
beenden? Ja / Nein" (Return = Nein, back to the tally) – identical with the old exe (A), so not
caused by the relocation. ![Esc on the tally](img/mods/testlevel_tally_esc.jpg)
## Before the fix ## Before the fix