User:Blaziken257/T1 Save file research: Difference between revisions

From Wikifang, a definitive guide to Telefang, Dino Device and Bugsite
Jump to navigation Jump to search
No edit summary
No edit summary
Line 58: Line 58:
** 4-5 - Experience (little endian), divided by 2
** 4-5 - Experience (little endian), divided by 2
** 6-7 - ???
** 6-7 - ???
** 8 - Seems to have some effect on proximity when calling for battles
** 8 - [[Origin]]
** 9 - ???
** 9 - ???
** A-D - Numerical value of phone number (ignoring *, #, and -), little endian -- last byte (D) seems to be reduced mod 4
** A-D - Numerical value of phone number (ignoring *, #, and -), little endian -- last byte (D) seems to be reduced mod 4
** E - Placement of *, #, and - symbols in phone number (how this works exactly is currently unknown, does not seem to have any true pattern)
** E - Placement of *, #, and - symbols in phone number (how this works exactly is currently unknown, does not seem to have any true pattern)
** F - ???
** F - ???

Revision as of 18:07, 30 January 2013

Telefang has four external RAM banks (each bank is 8KB), resulting in 32KB external RAM. Save data is used in bank 0 (which corresponds to 0-1FFF in a .sav file), and possibly other banks.

Terminology:

b:xxxx -- b = External RAM bank, xxxx = RAM address.
To map this to an address in a .sav file, take the bank and multiply by 0x2000. Take the RAM address, subtract 0xA000 from this, and add to the previous result.
Examples:

  • 0:A000
    • External RAM bank is 0, so we start with 0 * 0x2000 = 0.
    • RAM address is 0xA000. Subtract 0xA000 from this, and we get 0.
    • Add 0+0 to get 0, and this maps to 0x0 in a .sav file.
  • 2:B200
    • External RAM bank is 2, so we start with 2 * 0x2000 = 0x4000.
    • RAM address is 0xB200. Subtract 0xA000 from this, and we get 0x1200.
    • Add 0x4000+0x1200 to get 0x5200, and this maps to 0x5200 in a .sav file.

Save file header

Each version of Telefang has a header at the beginning, in the form of a string, denoting the game's version. This appears at ROM offset 0xF61-F70 in both versions, and is compared to 0:A000-A00F in RAM (0-F in a .sav file).

  • In Power Version, this is " TELEFANG POWER\x00" (without the quotes).
  • In Speed Version, this is " TELEFANG SPEED\x00" (without the quotes).

If this header is not present, the save file will be erased. There won't even be a message stating that the game is corrupt -- probably because it's not present the first time you play the game.

Checksum

After the title screen, the game runs a checksum, adding up each byte from 0:A000-BFEF (0-1FEF in a .sav file). The result is a 16-bit number. This is compared to a 16-bit, big endian integer at 0:BFFE-BFFF (1FFE-1FFF in a .sav file). If this doesn't match, a save file corruption message will appear afterwards, with Crypto crying, and the data will be erased.

Save file bit

At 0:BFFD in RAM (1FFD in a .sav file), this value is 00 if a save file is not present, and 01 if it is.

Converting saves across versions

Due to the difference in save file headers, save files from one version to another are not compatible.

To convert a Power Version save to a Speed Version save:

  • Change the POWER string at the beginning to SPEED.
  • Subtract 0x1C from the checksum at 0:BFFE-BFFF (1FFE-1FFF in a .sav file).

To convert a Speed Version save to a Power Version save:

  • Change the SPEED string at the beginning to POWER.
  • Add 0x1C to the checksum at 0:BFFE-BFFF (1FFE-1FFF in a .sav file).

Denjuu data

  • Saved to 0:A410-0:BD0F
  • When continuing a saved game, this data is always transferred to 2:A000-2:B8FF. During gameplay, this area in RAM is used when Denjuu data is needed. While technically part of save data, it is treated as if it were volatile RAM, since it is read and written to even without saving on the D-Shot screen. When saving on the D-Shot screen, it is transferred back to 0:A410-0:BD0F.
  • Note: This may not all be Denjuu data. Look at this some more!

Nicknames

  • Saved to 0:B610-????
  • Upon continuing a saved game, this is written to 2:B200-????.
  • 6 bytes per nickname.

Level, phone number, etc.

  • Saved to 0:A410-????
  • Upon continuing a saved game, this is written to 2:A000-????.
  • 0x10 bytes per Denjuu:
    • 0 - Species, added by 1
    • 1 - Level
    • 2 - FD
    • 3 - Personality
    • 4-5 - Experience (little endian), divided by 2
    • 6-7 - ???
    • 8 - Origin
    • 9 - ???
    • A-D - Numerical value of phone number (ignoring *, #, and -), little endian -- last byte (D) seems to be reduced mod 4
    • E - Placement of *, #, and - symbols in phone number (how this works exactly is currently unknown, does not seem to have any true pattern)
    • F - ???