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 II Glitch Discussion

Pokémon Crystal: Control what glitch contacts say/do! (arbitrary phone scripts) - Page 1

Pokémon Crystal: Control what glitch contacts say/do! (arbitrary phone scripts)

Posted by: Torchickens
Date: 2019-02-07 22:14:20
24:445F (offset 0x9045F) is the start of the PhoneContacts.

These contain entries about the contacts that are 12 bytes long, beginning with caller 0x00 (no caller).

Here is a dump of the first two entries.

00 (no caller): 00 00 FF FF 00 2F A5 4E 00 2F A5 4E
01 (mom): 00 01 18 06 07 2F AA 4E 00 2F A5 4E

I haven't figured out what all the values do yet, but I found out bytes 6-8 in each entry seem to be a three byte pointer to a script controlling what happens when you ring the contact; so no caller's default behaviour is sourced from a script at 2F:4EA5 (giving unused phone text "Good morning." if forced. 2F:4EAA is mom's script.

Through extrapolation, you can find glitch contacts who have this pointer in RAM.

I made a quick data list below to find them.

https://pastebin.com/amJbgb72

One contact (0x6C) may not be out of the area (at least not always) and runs D2CD as a script when you call them. As this is in WRAM, we can change it with another ACE method (as ACE is the only way to get glitch contacts at present).

Note this uses one of the Generation II scripting codes documented on Tauwasser's  scripting compendium.

As an example, the following script will bring up an unused Goldenrod City Department Store 2F message with no issues.

4B 15 7C 5B 91

4B: Display text from three byte pointer (15:5B7C in this case).
91: Return code3

As these codes are based on the scripting language linked above, there is theoretically quite a lot you can do! It also explains the wild battle and credits triggers that are brought up by some glitch contacts.

Re: Pokémon Crystal: Control what glitch contacts say/do! (arbitrary phone scripts)

Posted by: Torchickens
Date: 2019-02-08 13:49:58
Gold's version of PhoneContacts is at 0x9043A (24:443A)

As before, here is a Pastebin of the phone data.

https://pastebin.com/cTPhrUpj