>>45920353They're stored in an 8-bit index, which ranges from 0-255. I made a mistake, they're actually limited to 253. 0 is to denote the lack of a Pokemon, 254 is for the egg, and 255 is the end marker.
Work has been done on expanding this to a 16-bit index to support a theoretical 65535 unique species. This isn't finished because it needs to do the same for items and moves, and requires fairly sizable rewrites to just about every system in the game.
https://github.com/aaaaaa123456789/pokecrystal16/