Jump to content

Pokémon No. 152: Difference between revisions

m
→‎Entries: Fixed grammar.
m (Added a references section.)
m (→‎Entries: Fixed grammar.)
 
Line 19:
 
==Entries==
The Pokédex numbers for all Pokémon are stored in a contiguous table, <code>PokedexOrder</code>. This table is used for both converting internal IDs to Pokédex numbers, and vice versa. In all versions listed below except Japanese Blue, the number 152 (0x98) does not appear in the first 256 entries of this table, so there is no Pokémon, glitch or not, with "real" Pokédex number 152. However, the way converting Pokédex numbers to internal IDs works, the game will keep looking for the Pokédex number past the 256th entry<ref>[https://github.com/pret/pokered/blob/1dcaede8b5e41dbec9bf3f2b18c77d1b7d2de708/engine/menus/pokedex.asm#L626 The function to convert Pokédex numbers to internal IDs]</ref>, and the byte 0x98 is eventually found in the ROM, if not by sheer coincidence (e.g. as the low bytesbyte of an address), then by virtue of it being the ''high'' bytesbyte of the address <code>vBGMap0</code>, $9800 in the VRAM.
 
The location of the first 0x98 byte found determines the species of the "Pokémon No. 152". For example, on English Red, the address of the function <code>Trade_DrawOpenEndOfLinkCable</code> happens to be $10:5298, and a (small-endian) pointer to that function is at $10:5163<ref>[https://github.com/pret/pokered/blob/1dcaede8b5e41dbec9bf3f2b18c77d1b7d2de708/engine/movie/trade.asm#L118 The pointer to the function <code>Trade_DrawOpenEndOfLinkCable</code>]; note that the macro invocations <code>tradefunc Trade_DrawOpenEndOfLinkCable</code> appearing before this point represent the ''index'' of the function pointer in this table, instead of a direct pointer to the function.</ref>, meaning that the value of $10:5163 is 0x98 (and the value of $10:5164 is 0x52). This is the "320th entry" of the <code>PokedexOrder</code> table, which means that the "Pokémon No. 152" on English Red is the Pokémon with internal ID 64, Farfetch'd, even though its "real" Pokédex number is 83, which is the 64th entry of the <code>PokedexOrder</code> table.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.