Pokémon Yellow: How to access (glitch) Trainers other than the standard 56
Posted by: Torchickens
Date: 2019-01-04 13:42:06
Now however, you can do this with ACE eliminating the need for Game Genie or ROM hacking.
Requirements:
0) To have mastered Celadon looping map glitch and to know how to destroy Cancel buttons.
1) ws m (0x63) bootstrapped to D321. C3 21 D3 at 0xDA7F will do the trick. You can use map script abuse or connection copier to write these values.
2) 4F (0x59) bootstrapped to D330. C3 30 D3 at 0xDA64 (technically 0xFA64; this might matter if you're using a bad emulator) will do this. This can be achieved with the same methods as 1).
3) The following code beginning from item 3 (no unterminated-name or lag glitch items, however those should be avoided with B-Button when you encounter them with Celadon looping map glitch):
Steps (code/items from below must be stored in the memory):
1) Use ws m. It appears 'nothing happened', but it actually copied data from ROM into RAM at DA7F (stored Pokémon).
2) Adjust Lemonade x0's quantity and use 4F immediately after using ws m to enter the battle with a Trainer class based on Lemonade's quantity.
@D321 (item 3) (routine copier)
ld a,3d
ld hl,5ff2
ld bc,0244
ld de,da7f
call 009d
ret
: Calls FarCopyData with source as 3D:5FF2, bytes to copy as 0x244 and destination as DA7F (modifies ws m)
@D330 (item 10 quantity) (pseudo-Game Genie and battle activator)
ld hl,dabb
ld a,3e
ldi (hl),a
inc b
ld a,(desired trainer class; d338)
ldi (hl),a
inc b
ld a,ff
ld (d058),a
inc b
inc b
ld b,3d
ld hl,da7f
call 3e84
ret
: 'Patches' DABB. This should be sub a,c8 (take the Trainer escape ID and subtract 200 to get Trainer class) but instead we change it to ld a, xx; allowing us to battle any Trainer class we want. D058 is set to a non-00 value, the bank is switched back to 0x3D and we run the code we copied to DA7F and modified with the patch.
The entirety of this code fills the item pack and touches money byte 1, so don't win any money from the trainer if you want to battle more than one in one session. The unique Trainer AIs you can access this way however may stop you and result in a freeze. TM55 (Trainer (actual):255) has an interesting AI which sends you to Victory Road.
The item list from item 3 is as such:
i3: Lemonade x61
i4: Thunderstone x242
i5: 10F x1
i6: X Special x2
i7: Max Potion x127
i8: TM18 x205
i9: Item 0x9D (#PkMn p# ##KE '#4) x0
i10: TM01 x33
i11: Item 0xBB (##) x218
i12: Lemonade x62
i13: Water Stone x4
i14: Lemonade x(desired (real) Trainer class ID)
i15: Water Stone x4
i16: Lemonade x255
i17: TM34 x88
i18: TM08 x4
i19: Poké Ball x6
i20: Soda Pop x33
i21 (normal end/money 1): Item 0x7F (# #### ### #####u#) x 218
i22 (money 2/3): TM05 x132
i23 (rival name 1/2) : Lemonade x201
You may also download the "all glitch trainers" save from my Google Sites, import it, and modify item 14's quantity to explore all 256 Trainers. Note the Lemonade x0 means Lemonade x256. You can toss from this quantity as if it was valid, to access roster 256 (no tossing) or rosters 1-255 (tossing).
Link: https://sites.google.com/site/torchickens2/pokemon-save-files
Unfortunately rosters are unsupported as of now. I'm unsure how to implement them but it may be possible.
Have fun glitching! :)