Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

Pokemon Red Hall of Fame and surrounding bytes corruption - Page 1

Pokemon Red Hall of Fame and surrounding bytes corruption

Posted by: camper
Date: 2012-08-02 06:07:36
Continuation of http://forums.glitchcity.info/index.php/topic,4909.0.html


[img]http://darksquid.org/images/pokesave.gif[/img]


If you're curious about what healthy HoF data looks like, here's a picture:

[img]http://darksquid.org/images/halloffame.gif[/img]

The formatting is simple enough. Each Pokemon gets 16 bytes. One for species, then one for level, then eleven for nickname, followed by three nulls. Any leftovers in the nickname are filled with end-string characters (hex 50).
The HoF data pictures will display:
A level 6 Charmander named CHARMANDER
A level 12 Rattata named Mutton
A level 4 Rattata named AAAAAAAAAA
A level 3 Mew named MEW
A level 40 Cloyster named NAUGHTY
A level 21 Magikarp named MAGIKARP

If a team has less than six pokemon, the empty slots will still be occupied with data, with a species value of FF. There is another byte, at 284E, that seems to determine the number of E4 victories. I can't test this, though, as changing the byte causes the save file to read as corrupt.

You might also notice that the 256 bytes before the HoF (which I am affectionately calling the "Danger Zone) is filled with FF in a normal new game. I'm not certain if this is changed over the course of the game, as I (obviously) used cheats to beat the E4 early. If anyone knows about this, or has a late game save file that has never encountered a glitch pokemon, feel free to let me know.


Well, my memory map now looks like this:
[img]http://db.tt/adDQCh9p[/img]
[img]http://db.tt/eJ6Y5gk1[/img]
[img]http://db.tt/AwUFbxn6[/img]
[img]http://db.tt/isg3773K[/img]

As you can see, the mass amount of bytes before and after the hall of fame data (even before 0498) are also filled with garbage values. I haven't beaten the E4 yet (only have 6 badges). I didn't use cheat codes in this save state, and I have only caught (and encountered) A, h Poke, LM4, Ghost sprite Missingno., some other normal Missingno. I'm currently standing just outside the Safari Zone gatehouse, with the 500-step counter activated (still studying glitch maps) and having flown away from the Jr. Trainer in Route 24. I've done ZZAZZ in another save state (deleted).

None of the above glitches should affect the area before 0498, if the supposed affected area is correct.

Re: Pokemon Red Hall of Fame and surrounding bytes corruption

Posted by: OwnageMuch
Date: 2012-08-02 22:23:41
It does seem that the bug only affects a certain area which just so happens to involve the hall of fame, as after you go through a large number of records the data is not corrupt (of course, you need to have beaten the Elite Four many times to see this).

Re: Pokemon Red Hall of Fame and surrounding bytes corruption

Posted by: camper
Date: 2012-08-03 02:27:47
I've tested it yesterday. I hacked the byte D5A2 to be hex 20 (32 entries). The first 20~22 entries are all glitched up (with plenty of blacked out sprites), but the last ones all consist of a single Charizard 'M, so I assume those are not affected.

Re: Pokemon Red Hall of Fame and surrounding bytes corruption

Posted by: GARYM9
Date: 2012-08-03 13:44:39
That's the ROM, not the SRAM.

That is a bank of data directly from the ROM (game data), not WRAM or SRAM or RAM.  The first picture is a picture of mostly just the games header, hence the "POKEMON RED" string in the ASCII view.

You're looking in the wrong area, you want to hit the dropdown arrow that says ROM and look for SRAM, RAM, and WRAM.  The aforementioned data in Okk's pictures refers to the larger, entire physical space of the SRAM.  The Gameboy bankswaps the SRAM to read it in pieces.

Re: Pokemon Red Hall of Fame and surrounding bytes corruption

Posted by: camper
Date: 2012-08-04 08:55:01
Thanks! I'm now reading the SRAM data starting from A000. But now the data before A598 is not even corrupted. The corruption starts from A598 and ends at A6DB (inclusive).

Edit: Found the reason. Apparently saving the game resets the part before A598 to FF.