Page 1 of 1

Poking at the C64 save format

Posted: Mon Dec 09, 2013 3:49 am
by jrodman
Some *very* trivial investigation on my part trying to edit my characters to bring my amiga BT1 characters to c64 BT2.

I found the layout looks overall similar to BT1, starting with the name for 16 bytes, 0xFF padded.

However, the name is xored with a rolling value, beginning with 0x7f, decreasing by one for every subsequent byte. Am I actually making a very basic foray into figuring out PirateSlayer here? I couldn't find much meat about how that stores data on disk.

Decoding gives the "BT text" format described by ZeroZero which is largely just ASCII with the high bit set.

After this I started trying to figure out the character stats format, but I couldn't find any way to interpret the data that resulted in things making sense. Added to this the checksum is still present and the bt1 bug where the checksum isn't checked on party load seems ineffective.

Another attack vector would be to modify the party in memory and save differrent versions out, but my vice monitor skills are pretty nonexistent. So I stopped here, and just decided to play the game from level 1.

Re: Poking at the C64 save format

Posted: Thu Aug 12, 2021 9:52 am
by IcePic
Don't know if it relates to BT2 also, but a friend of mine spent ages hacking the BT1 saves in the old days and from what I remember of his attempts, stuff like STR/INT stats were stored as 5-bit entities spread over a few bytes since they would only go from 0-31 in any case, presumably to save a bit of space, so you need to be on the lookout for data that isn't nicely stored and aligned as bytes in the save files. So if you try to look for 22 if that is your characters strength, you might not find it since the byte holding the strength value would be sharing 3 bits with the next stat.

Re: Poking at the C64 save format

Posted: Fri Aug 13, 2021 6:16 am
by Darendor
IcePic wrote: Thu Aug 12, 2021 9:52 am Don't know if it relates to BT2 also, but a friend of mine spent ages hacking the BT1 saves in the old days and from what I remember of his attempts, stuff like STR/INT stats were stored as 5-bit entities spread over a few bytes since they would only go from 0-31 in any case, presumably to save a bit of space, so you need to be on the lookout for data that isn't nicely stored and aligned as bytes in the save files. So if you try to look for 22 if that is your characters strength, you might not find it since the byte holding the strength value would be sharing 3 bits with the next stat.
My investigations into the character files seems to confirm this.

I posted it somewhere in this subforum. I believe the 5 stats along with the invisible "initiative" value for each character are represented as such.

Edit: See here - viewtopic.php?f=17&t=1693