SRAM

From Terranigma Wiki
Revision as of 23:17, 6 March 2021 by Crediar (talk | contribs)
Jump to navigation Jump to search

The game allows for three save files and keeps a backup of each one.

Each save file uses 1278 bytes but is aligned to 1280 in SRAM.

Checksum Code:

u16 x = 0x5236;
u16 y = 0x5236;

for( int i=0; i<1278; i+=2 )
{		
  x += *(u16*)(SaveFile+i);
  y ^= *(u16*)(SaveFile+i);
}

Deletion

When deleting a save file the game writes 0xFFFE to the first word an leaves the rest untouched.

Layout

(TODO)

Offset Length (byte) Description
0x000 2 Map ID
0x010 5 Name
0x01C 5 Name
0x048 2 Equipped item
0x04A 2 Equipped weapon
0x04C 2 Equipped armor
0x0A4 1 Text speed (1-5)
0x0B6 1 Window color (0-2)
0x4FA 2 Checksum ADD
0x4FC 2 Checksum XOR