Skip to content

Save Data (EEPROM)

David Benepe edited this page Jun 19, 2023 · 1 revision

Diddy Kong Racing uses a 4Kb EEPROM (512 bytes) for save data.

These are some notes about the save format.

0x00 - 0x78 = Save files
 * 0x00 - 0x27 Save 1
 * 0x28 - 0x4F Save 2
 * 0x50 - 0x77 Save 3
 --- Save format 320 bits (40 bytes) ---
 * A empty save file has 0xFF set for all 40 bytes. You should be able to get away with just testing if the checksum is 0xFFFF for a empty file.
 Save data is segmented by bits, not bytes
     1.) Checksum, 16 bits
     2.) Level Status, 2 bits per level (34 levels)
         0 = Not visited
         1 = Visited
         2 = Completed
         3 = Silver Coins Completed
     3.) Taj flags, 6 bits
         bit 0: Car Challenge Unlocked
         bit 1: Hover Challenge Unlocked
         bit 2: Plane Challenge Unlocked         
	 bit 3: Car Challenge Completed
         bit 4: Hover Challenge Completed
         bit 5: Plane Challenge Completed
     4.) Trophies, 2 bits per trophy (5 trophies)
         0 = No Trophy
         1 = Bronze Trophy
         2 = Silver Trophy
         3 = Gold Trophy
     5.) Bosses, 12 bits
         bit 0: Wizpig 1
         bit 1: Tricky 1
         bit 2: Bubbler 1
         bit 3: Bluey 1
         bit 4: Smokey 1
         bit 5: Wizpig 2
         bit 6: Tricky 2
         bit 7: Bubbler 2
         bit 8: Bluey 2
         bit 9: Smokey 2
         bits 10-11: Unused
     6.) World Balloon Counts, 7 bits per world (6 worlds)         
         No count for Overworld (World 0), it is instead used for the total balloon count.
         World 1 = Dino Domain
         World 2 = Sherbet Island
         World 3 = Snowflake Mountain
         World 4 = Dragon Forest
         World 5 = Future Fun Land
     7.) T.T. Amulet Count, 3 bits
     8.) Wizpig Amulet Count, 3 bits
     9.) World Flags, 16 bits per world (6 worlds)
         World 0 = Overworld 
             Flags 0x4, 0x40, 0x400, 0x4000 = Overworld Gold Balloons
    10.) Key Flags, 8 bits
         bit 0: Unused
         bit 1: Ancient Lake key         
         bit 2: Crescent Island key
         bit 3: Snowball Valley key    
         bit 4: Boulder Canyon key
         bit 5-7: Unused
    11.) Cutscene Flags, 32 bits
         bit 0: Lighthouse rocket cutscene
         bit 1: T.T. help prompt
         bit 2: Adventure 2 flag?
         bit 3: Dino domain boss cutscene
         bit 4: Sherbet island boss cutscene
         bit 5: Snowflake mountain boss cutscene
         bit 6: Dragon forest boss cutscene
         bit 7: Future Fun Land boss cutscene
         bit 8: Dino domain boss cutscene 2
         bit 9: Shertbet island boss cutscene 2
         bit 10: Snowflake mountain boss cutscene 2
         bit 11: Dragon forest boss cutscene 2
         bit 13: Wizpig face cutscene
         bit 14: Dino domain key cutscene
         bit 15: Sherbet Island key cutscene
         bit 16: Snowflake mountain key cutscene
         bit 17: Dragon forest key cutscene
    12.) Unused, 1 bit
    13.) Compressed filename, 5 bits per index (3 indices)
         Index of the string: "ABCDEFGHIJKLMNOPQRSTUVWXYZ.?    "
 Levels order in save data (34 levels):
     Walrus Boss
     Fossil Canyon
     Pirate Lagoon
     Ancient Lake
     Walrus Cove
     Hot Top Volcano
     Whale Bay
     Snowball Valley
     Crescent Island
     Fire Mountain
     EverFrost Peak
     Spaceport Alpha
     Spacedust Alley
     Greenwood Village
     Boulder Canyon
     Windmill Plains
     Smokey Castle
     Darkwater Beach
     Icicle Pyramid
     Frosty Village
     Jungle Falls
     Treasure Caves
     Haunted Woods
     DarkMoon Caverns
     Star City
     WizPig 1
     TrickyTops 1
     Sherbet Boss
     Dragon Boss
     TrickyTops 2
     Walrus 2
     Sherbet 2
     Dragon 2
     WizPig 2
-------------------------------------------------------------
0x78 - 0x80 = Global unlocks/settings (64-bits)
 * bit 0: Is adventure 2 unlocked?
 * bit 1: Is Drumstick unlocked?
 * bits 2-3: Current Language
   0 = English
   1 = German
   2 = French
   3 = Japanese
 * bits 4-24: All must be set to 1 for T.T. to be unlocked.
 * bit 25: Are subtitles on?
 * bit 26-55: Currently unknown
 * bits 56-63: Checksum
-------------------------------------------------------------
0x80 - 0x200 = Times
 *  0x80 - 0x140: Fast Lap times for tracks
 * 0x140 - 0x200: Total times for tracks
First 2 bytes is the checksum, followed by 4 bytes for each track/vehicle combo (47)
For each track combo the first 2 bytes is the actual time, 
   the second 2 bytes is the compressed filename for who set the record.
The last 2 bytes of both sections is junk data. That junk data is included in the checksum calculation,
   so you can't just change it without updating the checksum.
Tracks order:
    Fossil Canyon, Car
    Fossil Canyon, Hover
    Fossil Canyon, Plane
    Pirate Lagoon, Hover
    Ancient Lake, Car
    Ancient Lake, Hover
    Ancient Lake, Plane
    Walrus Cove, Car
    Walrus Cove, Hover
    Hot Top Volcano, Hover
    Hot Top Volcano, Plane
    Whale Bay, Hover
    Snowball Valley, Car
    Snowball Valley, Hover
    Crescent Island, Car
    Crescent Island, Hover
    EverFrost Peak, Car
    EverFrost Peak, Hover
    EverFrost Peak, Plane
    Spaceport Alpha, Car
    Spaceport Alpha, Hover
    Spaceport Alpha, Plane
    Spacedust Alley, Car
    Spacedust Alley, Hover
    Spacedust Alley, Plane
    Greenwood Village, Car
    Greenwood Village, Hover
    Boulder Canyon, Hover
    Windmill Plains, Car
    Windmill Plains, Hover
    Windmill Plains, Plane
    Frosty Village, Car
    Frosty Village, Hover
    Frosty Village, Plane
    Jungle Falls, Car
    Jungle Falls, Hover
    Jungle Falls, Plane
    Treasure Caves, Car
    Treasure Caves, Hover
    Treasure Caves, Plane
    Haunted Woods, Car
    Haunted Woods, Hover
    Darkmoon Caverns, Car
    Darkmoon Caverns, Hover
    Star City, Car
    Star City, Hover
    Star City, Plane
-------------------------------------------------------------
Clone this wiki locally