Winning the Lucky Number Show with out of bounds Pokémon?
Posted by: TheZZAZZGlitch
Date: 2020-06-14 05:13:31
One of my old friends got this to happen too, a very long time ago - the game stated he had a ????? in his PC. I was a kid back then, so I didn't really think much about it. But now, I decided to revisit this curiosity.
I don't have any save files which reproduce the issue, so I had to go in blind. Lucky Number winners are determined by this CheckForLuckyNumberWinners subroutine in the disassembly.
Unfortunately, even after going through it line by line multiple times, I just can't seem to find the bug.
Boxed Pokémon data is read directly from SRAM. This behavior makes the lottery capable of drawing Pokémon data from previous save files. I wondered how the lottery would behave without any save file present. However, resetting a save file in G/S/C sets all bytes in SRAM to 0x00, not 0xFF. So all of the boxes are correctly considered empty, and there are no out of bounds reads. This seems like a dead end.
Anyone have some ideas?