TMTRAINER Pikachu Surfing Mini-game? - Page 1
This might be a stupid question, but where else to ask it: Does the HP-part of the TMTRAINER effect have anything to do with the Pikachu Surfing mini-game? (Remaining distance is counted in HP)
It probably doesn't and just looks similar, but it has been bugging me for some time so i wanted to ask anyway, just in case.
No. The high HP is caused by the cached screen tile data corrupting CFE6-CFE7. Specifically the tiles at y=06 x=0F, y=06 x=10 cause it according to my data.
What CoolTrainer and Super Glitch do is copy data from $CD6D, a buffer that holds the (random for CoolTrainer and at least one other Super Glitch move, I wonder if any have long names from the ROM) internal name of the move that caps at 20(?) characters long. It copies this data to $CF4B or $D0E1 or both (but CoolTrainer can only copy to $CF4B).
If there is no 50h terminator in the 20-long $CD6D buffer, this means that the game will also copy data past the buffer where the cached screen tile data (updated whenever you open a menu like Pokémon in Red/Blue/Yellow or when you enter battle in Yellow) is located until it finds a 50h where it stops copying data.
Battle tile screen data has a conveniently placed 50h so that the game doesn't copy too much data and freeze. Many battle tiles may look the same, but not all of the blank ones are 7F and the 50 is found at x=05 y=08 if you have normal graphics or x=03 y=08 if the graphics are inverted.
See this image:
Incidentally, the "TMTRAINER" part happens when thanks to the cached screen data the enemy Pokémon's nickname is made to have the character $5C followed by $5D in it. $5C causes the game to write "TM" and $5D causes the game to write "TRAINER".
I thought as much. Thanks for the answer.