Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

TMTRAINER Pikachu Surfing Mini-game? - Page 1

TMTRAINER Pikachu Surfing Mini-game?

Posted by: SwedishDragon
Date: 2015-02-15 03:47:54
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.

Re: TMTRAINER Pikachu Surfing Mini-game?

Posted by: Torchickens
Date: 2015-02-15 10:46:22
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:
[img]http://i.minus.com/jrMP7e6C2eSdG.png[/img]

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".

Re: TMTRAINER Pikachu Surfing Mini-game?

Posted by: SwedishDragon
Date: 2015-02-15 11:33:12
I thought as much. Thanks for the answer.

Re: TMTRAINER Pikachu Surfing Mini-game?

Posted by: Torchickens
Date: 2015-02-15 11:47:48
You're welcome.