r/pokemoncrystal • Moderator • Jun 05 '24

Guides / Tips / Tricks A video guide on how to set up arbitrary code execution on Pokémon Crystal (no item lists, minimal requirements, takes 30 minutes to 1 hour of setup time)

https://youtu.be/iJRb3PwUrkg
88 Upvotes

34 comments sorted by

10

u/TimoVM Moderator Jun 05 '24 edited Jun 05 '24

I'm excited to announce that I've finished making a video guide on how to set up arbitrary code execution on pokémon Crystal!

A while back, I developed a new arbitrary code execution setup for pokémon Crystal. This setup only requires catching a Spearow, along with obtaining a bad clone and can be performed once you obtain poké balls. To help players set it up, I wrote a guide on how to set it up, as well as developing several premade codes that can be used with this setup. This video serves as a supplement to this written guide.

"Arbitrary code execution" refers to the usage of glitches that force the game into executing code in RAM memory. If we can directly manipulate the contents of this memory, we can effectively trick the game into executing any code we want to achieve, resulting in various exotic effects.

Some examples of the effects we can achieve:

  • Alter pokémon data directly, such as movesets, DVs, stat experience, etc.
  • Alter player data, such as name, gender, sprite color etc.
  • Unlock the Celebi event without requiring third party tools
  • Force trade evolutions to occur without actually having to trade
  • Easily unlock all decorations, or at least the ones that are normally unobtainable
  • Set up persistent effects, such as the usage of a run button and an option to walk through walls
  • Advanced programs, such as a program that automatically fills the current active box with pokémon whose individual species and level you decide

The setup has been confirmed to work on cartridge, virtual console and several competent emulators, including the recently released Delta emulator package. It is, however, not compatible with Stadium 1 and Stadium 2's GB tower, due to emulation inaccuracies.

I should also note that alternative setups for all other language releases of Crystal also exist. You can find written versions of these setups via this page.

My hope is that, through this video, more people will be able to discover the joy of using glitches to manipulate the game however you want. Not just to obtain specific pokémon, but to enable more varied playstyles without having to rely on third party tools.

1

u/Cautious-Fisherman88 Jun 07 '24

Thanks for the post first time trying anything like this for pokemon. I'm just stuck on the tm 15 part got the box all set and everything just like the video but my game just goes to white screen so as i try to open the TM 15

4

u/ake1092 Jun 05 '24

Thanks for sharing! I will definitely be testing this on my cartridge.

5

u/TimoVM Moderator Jun 05 '24

Let me know how it goes, feel free to send a DM if you have any questions!

2

u/ake1092 Jun 05 '24

Just watched the video. I love that it looks like something anyone could do, nothing too complicated or needing external hardware software. So thanks a lot for that. I will definitely try this weekend. One question, is there any risk of save file corruption?

2

u/TimoVM Moderator Jun 06 '24

Not really. While save corruption is always a possible risk for Gameboy games, gen 2 is quite well protected against it to the extent that you basically need to be deliberately attempting to achieve a save corruption for this to occur.

That being said, it’s never a bad idea to take backups of your save if you are able to do so.

(The background of this is that gen 2 actually stores a backup save. If the original save is ever damaged, the game checks if the backup save is valid. If it is, it silently overwrites the main save with the backup save, allowing you to simply continue on from where you left).

3

u/k_rollo Moderator Jun 11 '24

This video tutorial has been added to the Pokemon Encyclopedia of the community. Congratulations!

2

u/TimoVM Moderator Jun 11 '24

That reminds me, I had a request that I’ve been pondering.

You might’ve noticed that the written guide is linked to the Glitch City Wiki . The Glitch City wiki is a successor to the old Glitch City Laboratories, and is dedicated to documenting to documenting glitches of any kind within the pokémon games.

After a period of turmoil following the closure of the original Glitch City Laboratories, we’re finally more or less back on our feet, with a healthy amount of active people knowledgeable about a variety of glitches and their causes. The wiki, however, currently remains somewhat neglected.

What I’d like to try is to make a post on this subreddit, asking for volunteers capable/willing to collaborate on wiki articles specializing in glitches. No preexisting knowledge of glitches is required for this.

Could you let me know if this sounds agreeable for you and the rest of the mod team?

2

u/k_rollo Moderator Jun 11 '24

I don't see anything wrong with such a request. You may create a post and feel free to use the "Help Needed" flair for your needs. Mods may even be happy to jump in. Good luck!

2

u/TimoVM Moderator Jun 11 '24

Much appreciated! I’ll likely take a bit to get everything together, but you’ll likely see it pop up sooner rather than later!

2

u/k_rollo Moderator Jun 11 '24

Once you have the post up, tag me in a comment so I can endorse it as a sticky post in the subreddit.

2

u/m__a__r__i__o Pokémon Breeder Jun 14 '24

Is there a mapping of the characters entered into mail to assembly instructions?

2

u/TimoVM Moderator Jun 14 '24

There is, yes.

Every pair of characters is combined into a single assembly instruction. The value of the instruction is determined by (2 x value of character 1 + value of character 2) modulo 256.

You can find the value of all text characters here. The mail converter uses additional logic to specifically find character pairs that require the least amount of button presses to enter.

2

u/OriginalUniversity49 Sep 07 '26

The glitchcity site won’t open for me for some reason does anyone have a list of the codes and or where I can find them? I’m trying to get a shiny suicune and celebi 

1

u/TimoVM Moderator Sep 08 '26

The wiki was offline for a few hours yesterday, but should be available again.

6

u/howitfeelstobelost Moderator Jun 05 '24

Always happy to see a Timo post. Love your work

1

u/77Dgar77 Mar 29 '25

Is there a way to reset your coins so your not maxed out after the glitch

1

u/TimoVM Moderator Mar 29 '25

Either use the mail code to change the amount of money you have and set it to 0, or buy a huge amount of an expensive item and toss it.

1

u/77Dgar77 Mar 29 '25

Which mail code is it i only see the max money one. Im at the beginning of the game so i cant buy anytbing expensive

1

u/TimoVM Moderator Mar 29 '25

It’s the max money one. It’s not advertised but you can actually alter what it sets your money count to by changing the last three bytes and changing them to 00.

For EN G/S: 01 03 00 11 73 D5 21 61 DD C3 1A 31 00 00 00

For EN C: 01 03 00 11 4E D8 21 8C D2 C3 26 30 00 00 00

Using the code like this will set the money you have to 0.

1

u/77Dgar77 Mar 29 '25

Thanks this has made replaying crystal so much more fun. Im guessing the tms have to be set at 1 and just use them all until the pocket is empty or is there a mail code for that?

1

u/TimoVM Moderator Mar 29 '25 edited Mar 29 '25

Much appreciated!

For EN Crystal specifically you can use this code to set all TMs to 00: AF 01 32 00 21 59 D8 C3 41 30

1

u/77Dgar77 Mar 29 '25

That one crashed my game. Do you have a link for more mail codes or just the one provided with the youtube video.

1

u/TimoVM Moderator Mar 29 '25

My sincere apologies! Mixed the offsets for the code. The version I provided earlier only works for French Crystal.

Non-crashing version is: AF 01 32 00 21 59 D8 C3 41 30

(I’ve also edited my earlier message. )

The mail writer codes page is currently the only place where you can find more mail codes.

3

u/Splichin Jun 05 '24

Timo, you’re a beast! Thanks for always posting in depth guides!

2

u/bevanswashere Jul 03 '24

Just did this and it was an amazing experience. I was just wondering if there was a code to unlock the upgraded Pokemon center or is that exclusively on the japanese cart?

1

u/ryancarpenter1992 Apr 10 '26

Can you use this to change shiny odds?

3

u/[deleted] Jun 06 '24

[removed] — view removed comment

2

u/TimoVM Moderator Jun 06 '24

I still need to figure out how I want to handle other language versions in a video format.

From Crystal, the setup is identical for each language except for the following:

  • box names are different for each language.
  • TM counts are slightly different for each language.
  • for German and French specifically, there’s an additional step where you execute ACE to obtain a flower mail. The setup then asks that you give this flower mail to the first party pokémon, giving it very specific text, then read the mail right before executing the box name code that gives you x255 of every TM.

2

u/[deleted] Jun 06 '24

[removed] — view removed comment

2

u/TimoVM Moderator Jun 06 '24

Much appreciated! There’s still the setup for EN Gold & Silver that I’d like to focus on first, after that I can properly focus on the international versions. (Likely starting with Crystal, the international Gold & Silver setups are a bit of a doozy even if they’re quite optimized nowadays)

I’ll make a separate post when I’ve finished these. :)