View Single Post
Old 16th August 2017, 03:56 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236

There is an error in my explanation about the string "KHJC". It is indeed the magic number for prefixing valid save slots in Banjo-Tooie, but it does not preface the entire EEPROM save chip data--only the save slot blocks of memory within the file (and the one currently signaled to the game's protection against save hacking through this stupid mechanism the game does to throw off hackers).

The actual beginning bytes to the entire EEPROM save file as a .eep file to Project64 are just a few bitfields encoding the widescreen mode setting and the X/Y coordinate offset screen adjustment of the game for TVs, which is not something reliable for identifying the beginning of the save file.

So I took a look at your MPK file's index node mapper section and worked out through the MPK file format that the save starts at 0x0500 deep into the MPK file.

Likewise, for your original BANJOTOOIE22.n64 file from your first ZIP attachment, the file starts at 0x1540. Why, I don't know. I never reverse-engineered the DexDrive mempak format, just the real N64 one. It appears from your data that the DexDrive file format, starting at offset 0x1040, generally is identical from that point onwards with the N64 mempak file format in the MPK files starting at 0x0000 from the beginning. (In other words, just as I originally surmised years ago when I was converting DexDrive .n64 save files off the GameFAQs website, the DexDrive save format is actually a bloated superset of the real N64 mempak format...yours is only smaller than the MPK file because not all 123 pages of the controller pak file are being reserved, so it saves disk space by truncating the file to the pages that are in use.)

So here is your solution in both formats:
  • In the .MPK file, extract all the bytes from NEW.mpk offset 0x0500 down to 0x0CFF to create a 2-KiB EEP file.
  • In your .N64 file, extract all the bytes from 0x1540 (0x0500 + 0x1040) down to 0x1D3F (0x0CFF + 0x1040).

Either of those must create the real working save chip contents loadable into N64 emulators.
Reply With Quote