- 566
- Posts
- 5
- Years
- Seen yesterday
Maybe you want to do something interesting with it. Maybe you want to just unbork your Hall of Fame after encountering missingno. Either way, this tutorial is going to describe just where and how the HoF data is stored in Gen 1 save files. Keep in mind that hexadecimal numbers are prefixed by "$".
I've recently discovered this information through my own experimentation. It doesn't seem to be well documented anywhere, so I wanted to post it here for anyone who happens upon it.
Let's begin. You will need a Gen 1 .SAV file wherein the elite 4 has been defeated at least once. You will also need a hex editor. Use the hex editor to open the .SAV file.
Scroll to address $0598. This is where the hall of fame data begins.
Now, each pokemon in the HoF is recorded in a 16-byte structure. Each address location of the .SAV file holds a single byte of data. Address locations $0598 through $05A7 contain the 16 bytes of the very first pokemon in the HoF. The second pokemon is stored in $05A8 through $05B7. And so on and so forth.
The HoF data does not contain which team each pokemon belongs to. All pokemon are stored back-to-back. Things like actual number of teams used to beat the elite 4 are stored elsewhere, and they really aren't important to this tutorial.
Now for an explanation of the 16-byte structure:
Byte 1 - Hex ID for the pokemon's species.
Byte 2 - Pokemon's level in hexadecimal.
Bytes 3 through 12 - The pokemon's name. Each byte holds the hex ID assigned to a single character. Unused characters at the end are filled-in with the value $50.
Byte 13 - Always has a value of $50 because that value is the end-of-name terminator.
Bytes 14 through 16 - All zero values. It seems to act as a buffer space, but needs more experimentation.
EXAMPLE: Here's is the mapping for a level 61 Raichu named "CABBA" that is the very first pokemon in the HoF.
Address | value | meaning
$0598 | $55 | Raichu
$0599 | $3D | lvl 61
$059A | $82 | "C"
$059B | $80| "A"
$059C | $81 | "B"
$059D | $81 | "B"
$059E | $80 | "A"
$059F | $50 | end-of-name
$05A0 | $50 | end-of-name
$05A1 | $50 | end-of-name
$05A2 | $50 | end-of-name
$05A3 | $50 | end-of-name
$05A4 | $50 | end-of-name
$05A5 | $00 | padded with zero
$05A6 | $00 | padded with zero
$05A7 | $00 | padded with zero
The HoF data extends all the way to address $1857. That's enough room for 300 pokemon! Space not used for pokemon will be likely populated with junk data, but this can generally be ignored if you know how many pokemon should be in the HoF at one time. This swath of space is also not locked-down by the save checksum. You are able to freely edit it with the hex editor.
I've recently discovered this information through my own experimentation. It doesn't seem to be well documented anywhere, so I wanted to post it here for anyone who happens upon it.
Let's begin. You will need a Gen 1 .SAV file wherein the elite 4 has been defeated at least once. You will also need a hex editor. Use the hex editor to open the .SAV file.
Scroll to address $0598. This is where the hall of fame data begins.
Now, each pokemon in the HoF is recorded in a 16-byte structure. Each address location of the .SAV file holds a single byte of data. Address locations $0598 through $05A7 contain the 16 bytes of the very first pokemon in the HoF. The second pokemon is stored in $05A8 through $05B7. And so on and so forth.
The HoF data does not contain which team each pokemon belongs to. All pokemon are stored back-to-back. Things like actual number of teams used to beat the elite 4 are stored elsewhere, and they really aren't important to this tutorial.
Now for an explanation of the 16-byte structure:
Byte 1 - Hex ID for the pokemon's species.
Byte 2 - Pokemon's level in hexadecimal.
Bytes 3 through 12 - The pokemon's name. Each byte holds the hex ID assigned to a single character. Unused characters at the end are filled-in with the value $50.
Byte 13 - Always has a value of $50 because that value is the end-of-name terminator.
Bytes 14 through 16 - All zero values. It seems to act as a buffer space, but needs more experimentation.
EXAMPLE: Here's is the mapping for a level 61 Raichu named "CABBA" that is the very first pokemon in the HoF.
Address | value | meaning
$0598 | $55 | Raichu
$0599 | $3D | lvl 61
$059A | $82 | "C"
$059B | $80| "A"
$059C | $81 | "B"
$059D | $81 | "B"
$059E | $80 | "A"
$059F | $50 | end-of-name
$05A0 | $50 | end-of-name
$05A1 | $50 | end-of-name
$05A2 | $50 | end-of-name
$05A3 | $50 | end-of-name
$05A4 | $50 | end-of-name
$05A5 | $00 | padded with zero
$05A6 | $00 | padded with zero
$05A7 | $00 | padded with zero
The HoF data extends all the way to address $1857. That's enough room for 300 pokemon! Space not used for pokemon will be likely populated with junk data, but this can generally be ignored if you know how many pokemon should be in the HoF at one time. This swath of space is also not locked-down by the save checksum. You are able to freely edit it with the hex editor.