It's just a bitfield which distributes 510 EVs to the enabled stats.
If you have 1 enabled, that stat gets 255 (0xFF, the max) 510/1=510 (exceeds max)
If you have 2 enabled, each stat gets 255 (0xFF, the max) 510/2=255
If you have 3 enabled, each stat gets 170; 510/3=170
4 -> 510/4 = 127.5 (floor it, 127)
5 -> 510/5 = 102
6 -> 510/6 = 85
EV byte to binary -> 76543210
bit 0 flagged = HP flagged
bit 1 flagged = Atk flagged
bit 2 flagged = Def flagged
bit 3 flagged = Spe flagged
bit 4 flagged = SpA flagged
bit 5 flagged = SpD flagged
anything greater than 0x40 has bits 7 and 6 flagged, which are unused. The game only considers bits 0-5
For rosters, certain groups are allotted certain PKM choices.
Pretty sure andibad has an editor for subway PKM's as the format is the same as PWT's.