Anonymous user
Glitch Pokédex flag: Difference between revisions
no edit summary
>ISSOtm m (→Why glitch flags ?: Fixed a broken link.) |
>Torchickens No edit summary |
||
Line 1:
'''Glitch Pokédex flags''' are consequences of the existence of [[Glitch Pokémon]].
Every Pokémon game has flags that mark whether each Pokémon has been seen and
Glitch Pokédex flags are Pokédex flags associated with Glitch Pokémon.
▲== Why glitch flags ? ==
In computer programming, and games are no exception to this, everything is numbers. Thus, each Pokémon is assigned a number, called its '''ID'''. The game identifies each Pokémon using its ID, and each ID corresponds to a specific Pokémon.
Line 15 ⟶ 14:
# Tamper with its ( (Pokédex ID - 1) % 8)th flag (Note : % is [https://en.wikipedia.org/wiki/Modulo_operation the modulo operator]).
Why "Pokédex ID
For example, take Generation I and its 151 (non-glitch) Pokémon. We need to store all the flags in an integer amount of bytes, hence, 19 bytes (152 bits) are used.
Line 21 ⟶ 20:
Now, imagine we caught a Rattata (Pokédex ID 19). The game starts at address D2F7 ([url=https://github.com/pret/pokered/blob/46a94c63fc287e7290502776d02648476bc44171/wram.asm#L2339]wPokedexOwned[/url]), and advances (18 / 8 :) 2 bytes forward. Then it sets bit (18 % 8 :) 2, because we have captured it.
Now, this method works fine for all IDs up to 151. But what would happen with higher IDs
The more complicated case is Pokémon with ID 0 (like [[Missingno]] or [[GlitchDex/RB:000|'M (R/B)]]), because upon subtracting 1 (Pokédex ID - 1, remember
== Uses
Setting a flag (whether it be "seen" or "caught") modifies one bit in memory. The most famous example is when seeing Missingno, where it sets bit 7 of the quantity of the 6th item in the player's inventory (which is why it is known as "gives 128 if has less than 128").
The other way around is that if a Pokémon is marked as "already caught", its Pokédex entry won't show up. Since some glitch Pokémon's Pokédex entries crash the game, they are required to be "already caught" to be catchable without freezing.
[[Category:Terminology]]
[[Category:Reference documents]]
|