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

152 caught? - Page 1

152 caught?

Posted by: rortik
Date: 2014-01-06 16:05:22
Pokemon Yellow I did the 0:00 Hall of Fame glitch. I decided to screw around… but why the fuck when I look @ the item "Pokedex" in my bag does it state that I have Scyther as #152? When I click it, the correct info/number is shown.


Any particular reason why?


Oh and on a side note- is it actually possible to reach the end of the pokemon list in my party?

Re: 152 caught?

Posted by: Bert
Date: 2014-01-06 16:17:02
#152 is corrupted byte data that appears when the last bit for the Poké Dex is loaded. I'm not sure what this means, but it sounds like something with the 'Dexes data gets corrupted and it throws in another Pokémon as a result.

Farfetch'd also appears in the 152nd space occasionally, and there are up to 255 other Pokémon in the Dex, but it becomes impossible to scroll through after a point because of a corrupted flag event.

Reaching the end of your party is impossible since there are an unlimited number of the things in there. Technically, the Glitchmon above the first Glitchmon in your party would be the end of the list, but continuously scrolling will have the pointer loop around, and can appear on the right side of the screen sometimes.

Re: 152 caught?

Posted by: Torchickens
Date: 2014-01-06 16:52:13
Like Bert says, you get 152 if every 'own' Pokédex bit is set. You can see 152 if every 'seen' Pokédex bit is set too. The reason for this is because there are 19 "seen" and "own" bytes each, and there are a total of 8 bits for every byte; (2^0, 2^1… 2^7). e.g. 2^0 (1) in the first byte means you've seen/owned Bulbasaur and 2^1 + 2^0 (3) means you've seen/owned both Bulbasaur and Ivysaur. Multiply 19 by 8 and we get 152.

When you perform the save corruption glitch and then switch one of the Pokémon like the first or second with the tenth, a lot of bytes in memory get replaced with FF (255), including all seen/own bytes and your number of items.

In Red/Blue, #152 is Farfetch'd, while in Yellow #152 is Scyther and in Red/Green it's one of the Missingno. I don't know the exact reasons why. There are more glitch Pokédex entries past #152, but seeing them requires cheating, like using the Pokédex item with 0 Pokémon seen/owned. How far you can scroll down depends on the glitch Pokémon's 'seen/own' bits. To see #153 for instance, you'd have to have at least 1 item in the number of items byte (D31D), because it is the first byte that follows D31C (seen 145-152).

Re: 152 caught?

Posted by: Stackout
Date: 2014-01-07 07:18:24
At 10:5024 is an array of bytes in index number order containing the dex number for that Pokémon.

To print the Pokédex strings, the code calls PokedexToIndex (10:4ff9) which given a Pokédex number in $D11E, iterates through this array looking for that number; when found it puts the index number in $D11E and returns. Obviously it assumes $D11E contains a number between 0 and 151. And even though it increases the pointer to the array value in hl successfully, an 8-bit register is used to store the array index. Which will obviously wrap around :)

Farfetch'd = $40
Decimal 152 = $98

The nearest $98 to $41024 is at $41163. The difference between these is $13F: take $FF from $13F and you get $40, or Farfetch'd :)


By the way, there's a corresponding function IndexToPokedex at 10:5010. This function basically takes the index number from $D11E, puts it into the a register, decrements it, gets the byte at 10:5024 + the contents of register a, puts that byte into D11E and returns.

If you encounter 'M for example, IndexToPokedex is called with $D11E = 0. It's put into the a register and decremented to 255. $41024+$FF=$41123, and the contents of $41123 is… 0!

Let's take another example: 'A'(RB) whose index number is $BF.
$41024+$BE=$410E2. The contents of $410E2 is… $FA, or decimal 250 :)