Back to the original issue:
After saving 20 games, A-T, the beginning of gamename.dir will look like:
13 00 73 0a 12 00 72 0a slot 19 (T), slot 18 (S), ...
That's basically, slot number (in hex) followed by string that appears to be 0a-terminated.
Then I save over S (2nd in the list). And I get:
12 00 72 0a 13 00 73 0a slot 18 (S), slot 19 (T), ...
Looks great, exactly as it should look.
The time stamp on the file shows gamename.dir and gamename.018 written to, which is correct.
But now if I delete gamename.018, I can still load S (but actually it's not S, see below)
However, if I delete gamename.000, I can no longer load S. Which means loading S is actually trying to load the wrong save.
So what's going on: S is being saved properly (to gamename.018), but when we load we are loading gamename.000. This is despite gamename.dir linking S to slot 18. This isn't some kind of memory corruption, it persists even if I close and reopen the game.
If I rename gamename.000 to gamename.018, then I can load the "missing" S save.
So somehow, it appears the save games get into a state where the first slot number in gamename.dir is always getting treated as 0 by the game, despite the data in gamename.dir.