Skip to content

Instantly share code, notes, and snippets.

@claydolwithexplosion
Last active December 10, 2025 18:49
Show Gist options
  • Select an option

  • Save claydolwithexplosion/017f1784deebcd118b61d3ad917edb3c to your computer and use it in GitHub Desktop.

Select an option

Save claydolwithexplosion/017f1784deebcd118b61d3ad917edb3c to your computer and use it in GitHub Desktop.
Pokemon Emerald ACE

Contents

About this document

This is a document where I (claydolwithexplosion, Mettrich) dump information I found about Pokemon Emerald ACE. A lot of this is the result of my own research (reading through the great disassembly by pret, reading disassembly), but some of this is knowledge I gathered from people before me. Credits:

  • E-Sh4rk, for making the most extensive tool for Pokemon 3rd generation ACE, the Code Generator as well as a great tutorial on Emerald ACE and being the author of the original Hex Writer and PokeGlitzer
  • Sleipnir17, for creating a huge list of codes for Pokemon Emerald to do anything one could dream of, in large parts even without the Code Generator as far as I know, many of the short codes in this document are based on his assembly
  • (poke)merrp, for discovering practical ACE to begin with (with 0x615/0x611), making great Pokemon Emerald TASes and creating the original Thumb-to-ARM bootstrap
  • rileyk64, for creating an extensive list of all Pokemon species in Pokemon Emerald, their animation pointers and much more
  • it_is_final, for a lot of small things: The PC exit code for English, discovery and documentation of 0x410e, etc.
  • Adrichu00, Theocatic and others in the Discord for helping with many small things (Adrichu00 helped on the first really short exit code)
  • MankeyMite, Papa Jefe and others who make easy-to-follow tutorials for beginners
  • pret, for making a really good disassembly of these games, it was what allowed me to create shorter a lot of these codes at all

About stable ACE species

This guide assumes that you know about 0x611 (sometimes called the "DOTS egg") ACE and that you have at least one of these eggs ready to hatch.
Now, what is a stable ACE species?
A "stable" ACE species is a Pokémon which you can easily use to quickly trigger ACE anywhere, by just looking at its summary. Truely, utterly stable ACE species only exist in the Japanese, English and German localizations of the game, but all languages have at least one "metastable" ACE species, which are just as powerful, though they need a little more care.
With metastable species, you can't open their summary directly, but have to open the summary of a Pokemon before it, then scroll to any later page (so either stats, moves or contest moves), and only then scroll down/up to the summary of the metastable ACE species. The usual egg ACE species (0x611 in all Latin versions) is an unstable species; it's generally pretty safe but has a species name that instantly crashes if viewed on the summary screen and some other screens as well, so it's considered "unstable".

Now, there is another important detail in stable ACE species that is important especially for French, to some extent the other languages as well: There are stable/metastable ARM species and stable/metastable Thumb species. You don't need to worry about it too much, but if you use a Thumb species (only option for French) you need a "bootstrap" in Box 12 Slot 4 or later (usually a bad egg). In all Latin versions we basically always wanna execute codes as ARM (at least if you wanna execute regular box codes), that's what the bootstrap is for, it allows a Thumb species to execute ARM codes.

List of stable ACE species

The stable (ARM) ACE species differ from language to language (credits to Sleipnir17, rileyk64 and final):

  • (Japanese: 0x079D, 0x6789 (many more, but exclusively shiny or non-shiny))
  • English: 0x410E (keep box 12 slot 9 and 10 empty when using it)
  • German: 0x4130

To get these, see here.

The other languages don't have fully stable ACE species, but they do have "metastable" ones.\

List of metastable ACE species

The metastable (ARM) ACE species are:

  • (Japanese: 0x0615, 0x0A62)
  • (English: 0x4167)
  • French: None discovered yet D:
  • Italian: 0x415E
  • Spanish: 0x0599 - very slow, takes over 4 seconds to execute the code

To get these, see here.

One thing that all languages have though is a metastable Thumb species; these are like the other metastable ACE species but require a "(Thumb->ARM) bootstrap" to be in Boxes 12-14 (starting from Box 12 Slot 4) to execute regular ACE codes. With a bootstrap these are basically equivalent to the metastable ARM species in terms of usability, but together with the bootstrap they are a little annoying to generate. However, the metastable Thumb species are needed for my new fastest guide to getting a hex/base64 writer in the fastest way possible and setting up potential future payloads, because Thumb is way more suited for writing bigger codes into the game.

List of metastable Thumb species

The metastable Thumb species are:

  • English: 0x45bb
  • French: 0x40ed
  • Italian: 0x45b7
  • German: 0x44f1
  • Spanish: 0x45db

To get these, see here.

I won't be covering the Japanese ACE species, because in Japanese it doesn't really make sense to use ARM ACE codes, you should usually use Thumb there. Also I don't know how to insert any Japanese Kanas into this Github Gist.

Getting a stable ACE species

  • For English and German, look here
  • For Spanish and Italian, look here
  • For French, look here

Getting a stable ARM species

The stable species will be generated inside the PC in Box 10 Slot 19 (Row 4, Column 1). Keep this slot free before executing this code. These codes can be executed with both a stable ACE species AND any ARM ACE egg (so the usual 0x0611/0x0615).
After this code executes, the sprite of the Pokémon (stable or unstable) will become invisible;
this means that it worked, even if you get asked to nickname the hatched egg (DON'T try to nickname it, it will crash).
Also, these codes will unlock the Eon ticket, so you can go upstairs in any Pokecenter to claim it.

  • English (0x410e):
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ R n – B U n P	[ Rn–BUnP] ← on old emulators, replace "P" with "Q"
Box  3: 9 q / w Q m B R	[9q/wQmBR] ← on old emulators, replace "/" with "B"
Box  4: o B U R n	[oBURn]
Box  5: / F P m D F P m	[/FPmDFPm]
Box  6: B T o D Y J m 2	[BToDYJm2]
Box  7: ! n	        [!n]
  • German (0x4130):
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ R n – B U n P	[ Rn–BUnP] ← on old emulators, replace "P" with "Q"
Box  3: 9 q / w Q m D R	[9q/wQmDR] ← on old emulators, replace "/" with "B"
Box  4: o T F R n	[oTFRn]
Box  5: / F P m D F P m	[/FPmDFPm]
Box  6: B T o D Y J m 2	[BToDYJm2]
Box  7: ! n	        [!n]
  • English/German/Italian source code:
@@ title = "Create (meta)stable ACE species"
@@ author = "Mettrich"
@@ exit = null
@@ filler4 = 0xffffffff
@@ fill = false

; This code creates a (meta)stable species
; in box 10 slot 19 for English, Italian and German.
; It also gives you access to the eon ticket:
; just go upstairs in any pokecenter and you
; will be given the ticket.

old_emu = 0
lang = 2
; (1 - JP) not supported by this code
; 2 - EN ; 0x410e (stable)
; (3 - FR) not supported by this code
; 4 - IT ; 0x415e (metastable)
; 5 - DE ; 0x4130 (stable)
; (7 - ES) not supported by this code

@@

sbc r10, r15, #0x3900 ; addressing 1/2
adcs r12, r14, #0xca0 ; exit code 1/2
sbc r0, r12, #0xff ; exit code 2/2

sbc r11, r15, #0xae00 ; eon ticket 1/2

str r15, [r10, #{old_emu?0xfcb:0xfca}]! ; addressing 2/2

strh r14, [r11, #{old_emu?0xbc:0xba}] ; eon ticket 2/2

{lang == 2 ? 0xe3ffccbc :\
(lang == 4 ? 0xe3ffccbc :\
(lang == 5 ? 0xe3ffccbe : 0xbbffbbbb))} ; species 1/2
; mvns r12, #(…)
; EN: 0xbc00
; IT: 0xbc00
; DE: 0xbe00
; else: filler

sbc r12, r12, #{\
(lang == 2 ? 0x2f0 :\
(lang == 4 ? 0x2a0 :\
(lang == 5 ? 0xce : 0x00)))} ; species 2/2
; sub r12, r12, #(…)
; EN: 0x2f1
; IT: 0x2a1
; DE: 0xcf
; else: 0x01

strh r12, [r10, #10] ; store checksum
strh r12, [r10, #14] ; store species

bic r11, r14, #0xff00 ; jump 1/2
strh r13, [r4, #0x3e] ; completely redundant
adc r15, r11, #0x28c ; jump 2/2

Getting a metastable ARM species

The metastable species will be generated inside the PC in Box 10 Slot 19 (Row 4, Column 1). Keep this slot free before executing this code. These codes can be executed with both a stable ACE species AND any ARM ACE egg (so the usual 0x0611/0x0615).
After this code executes, the sprite of the Pokémon (stable or unstable) will become invisible;
this means that it worked, even if you get asked to nickname the hatched egg (DON'T try to nickname it, it will crash).
Also, these codes will unlock the Eon ticket, so you can go upstairs in any Pokecenter to claim it.

  • Italian (shiny 0x415e):
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ R n – B U n P	[ Rn–BUnP] ← on old emulators, replace "P" with "Q"
Box  3: 9 q / w Q m B R	[9q/wQmBR] ← on old emulators, replace "/" with "B"
Box  4: o 7 U R n	[o7URn]
Box  5: / F P m D F P m	[/FPmDFPm]
Box  6: B T o D Y J m 2	[BToDYJm2]
Box  7: ! n	        [!n]
  • Spanish (shiny 0x599):
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ R n – B k n P	[ Rn–BknP] ← on old emulators, replace "P" with "Q"
Box  3: 9 q / w Q m	[9q/wQm] ← on old emulators, replace "/" with "B"
Box  4: A H U . o	[AHU.o]
Box  5: 3 U B n / F P m	[3UBn/FPm]
Box  6: B T o D F P m 2	[BToDFPm2]
Box  7: ! n	        [!n]
  • Italian source code can be found above with the stable species
  • Spanish source code:
@@ title = "Create (meta)stable ACE species"
@@ author = "Mettrich"
@@ exit = null
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

; This code creates a metastable (ARM) species
; in box 10 slot 19 for Spanish (0x0599).
; It also gives you access to the eon ticket:
; just go upstairs in any pokecenter and you
; will be given the ticket.

old_emu = 0

@@

sbc r10, r15, #0x3900 ; addressing 1/2
adcs r12, r14, #0xca0 ; exit code 1/2
sbc r0, r12, #0xff ; exit code 2/2

sbcs r11, r15, #0xae00 ; eon ticket 1/2

str r15, [r10, #{old_emu?0xfcb:0xfca}]! ; addressing 2/2

strh r14, [r11, #{old_emu?0xbc:0xba}] ; eon ticket 2/2

mov r12, #0x308 ; species 1/2
adcs r12, r12, #0x290 ; species 2/2

strh r12, [r10, #10] ; store checksum

bic r11, r14, #0xff00 ; jump 1/2
strh r12, [r10, #14] ; store species
adc r15, r11, #0x28c ; jump 2/2

Getting a metastable Thumb species

The metastable species will be generated inside the PC in Box 10 Slot 19 (Row 4, Column 1). Keep this slot free before executing this code. The Thumb→ARM bootstrap will be generated in Box 12 Slot 4 (Row 1, Column 4) and looks like a bad egg. Also keep this slot free beforehand.
After this code executes, the sprite of the Pokémon (stable or unstable) will become invisible, this means that it worked, even if you get asked to nickname the hatched egg (DON'T try to nickname it, it will crash).
RECOMMENDED: After you execute the code the first time, check the boxes to see whether it worked, if it did, you should fortify the Thumb→ARM bootstrap (the bad egg). By default this bootstrap is quite fragile and can easily be overwritten by just placing other Pokemon on top of it, to prevent this, move the bootstrap from Box 12 Slot 4 (where it should have generated) to Box 12 Slot 7 (Row 2, Column 1). Then change the code in Box 6 slightly (just replace the "T" with a "U") and trigger execution with your newly generated metastable Thumb species (or any ARM species, doesn't matter). There should be another metastable Thumb species in Box 10 Slot 19, and the bootstrap should now be fortified. To test this, pick up the bootstrap in a group selection and look whether it disappears when you place it down. If it disappears, reset and go to your last save point, something must have gone wrong. Otherwise, you're done and can place the bootstrap anywhere in between Box 12 Slot 4 and Box 14 Slot 30 for it to work (Box 12 Slot 4 or Slot 7 is recommended though).

  • English:
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ h n z O D F P	[ hnzODFP] ← for old emulators, replace "P" with "Q"
Box  3: 9 q O K B n A B	[9qOKBnAB]
Box  4: o B … A n	[oB…An]
Box  5: / … P m D … P m	[/…PmD…Pm]
Box  6: B j o _ T 9 q 2	[Bjo T9q2] ← for fortifying the bootstrap, replace "T" with "U"
Box  7: A n	        [An]
  • French:
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ h n z O D F P	[ hnzODFP] ← for old emulators, replace "P" with "Q"
Box  3: 9 q O K B n F B	[9qOKBnFB]
Box  4: o z … A n	[oz…An]
Box  5: / … P m D … P m	[/…PmD…Pm]
Box  6: B j o _ T 9 q 2	[Bjo T9q2] ← for fortifying the bootstrap, replace "T" with "U"
Box  7: A n	        [An]
  • Italian:
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ h n z O D F P	[ hnzODFP] ← for old emulators, replace "P" with "Q"
Box  3: 9 q O K B n D B	[9qOKBnDB]
Box  4: o z E A n	[ozEAn]
Box  5: / … P m D … P m	[/…PmD…Pm]
Box  6: B j o _ T 9 q 2	[Bjo T9q2] ← for fortifying the bootstrap, replace "T" with "U"
Box  7: A n	        [An]
  • German:
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ h n z O D F P	[ hnzODFP] ← for old emulators, replace "P" with "Q"
Box  3: 9 q O K B n B B	[9qOKBnBB]
Box  4: o Ö … A n	[oÖ…An]
Box  5: / … P m D … P m	[/…PmD…Pm]
Box  6: B j o _ T 9 q 2	[Bjo T9q2] ← for fortifying the bootstrap, replace "T" with "U"
Box  7: A n	        [An]
  • Spanish:
Box  1: p . U n P T D n	[p.UnPTDn]
Box  2: _ h n z O D F P	[ hnzODFP] ← for old emulators, replace "P" with "Q"
Box  3: 9 q O K B n A B	[9qOKBnAB]
Box  4: o h … A n	[oh…An]
Box  5: / … P m D … P m	[/…PmD…Pm]
Box  6: B j o _ T 9 q 2	[Bjo T9q2] ← for fortifying the bootstrap, replace "T" with "U"
Box  7: A n	        [An]
  • Source code:
@@ title = "Create Pokémon from nothing"
@@ author = "Mettrich"
@@ exit = null
@@ filler4 = 0xffffffff
@@ fill = false

; This code creates a (meta)stable Thumb species
; in box 10 slot 19 for all languages,
; and a Thumb->ARM bootstrap in Box 12 Slot 4.

old_emu = 0

lang = 2
; (1 - JP) not supported by this code
; 2 - EN ; 0x45bb (metastable)
; 3 - FR ; 0x40ed (pseudostable)
; 4 - IT ; 0x45b7 (pseodostable)
; 5 - DE ; 0x44f1 (metastable)
; 7 - ES ; 0x45db (metastable)

fortify = 0
; set this to 1 for the second execution to
; "fortify" the bootstrap (so you don't accidentally overwrite it, since it's pretty fragile otherwise).
; only box 6 should change slightly, you can keep the rest the same.
; before executing the fortify code, move the bootstrap (bad egg)
; to Box 12 Slot 7 (Row 2, Column 1).


@@

sbc r10, r15, #0x3900 ; addressing
adcs r12, r14, #0xca0 ; exit code 1/2
sbcs r0, r12, #0xff ; exit code 2/2

; generate `bx r15` in the high bits here...
adcgts r12, r14, r14, ror #19

str r15, [r10, #{old_emu?0xfcb:0xfca}]! ; set hasSpecies to 1

; and finish it here, have the low bits be nonzero
adcs r12, r12, #0x32400000

{lang == 2 ? 0xe3ffbcbb :\
(lang == 3 ? 0xe3ffbcc0 :\
(lang == 4 ? 0xe3ffbcbe :\
(lang == 5 ? 0xe3ffbcbc :\
(lang == 7 ? 0xe3ffbcbb : 0xbbffffff))))}
; species 1/2
; EN: mvns r11, 0xbb00
; FR: mvns r11, 0xc000
; IT: mvns r11, 0xbe00
; DE: mvns r11, 0xbc00
; ES: mvns r11, 0xbb00

{lang == 2 ? 0xE2BBB0BC :\
(lang == 3 ? 0xE2BBB0EE :\
(lang == 4 ? 0xE2BBBFEE :\
(lang == 5 ? 0xE2BBB0F2 :\
(lang == 7 ? 0xE2BBB0DC : 0xbbbbbbbb))))}
; species 2/2
; EN: adcs r11, r11, #0xbc
; FR: adcs r11, r11, #0xee
; IT: adcs r11, r11, #0x3b8
; DE: adcs r11, r11, #0xf2
; ES: adcs r11, r11, #0xdc

strh r11, [r10, #10] ; store checksum
strh r11, [r10, #14] ; store species

bic r11, r14, #0xff00
str r12, [r10, #{fortify?0xf00:0xe00}]! ; store bootstrap in PID/flags
adc r15, r11, #0x28c

Short codes

These codes need to be executed with any stable/metastable ACE species. They should be compatible with all Western/Latin versions of the game.

List of all codes:

Get all badges

  • Box names:
Box  1: – B U n , H g m	[–BUn,Hgm] ← Replace comma (,) with slash (/) on old emulator
Box  2: ? . o P F R m   [?.oPFRm]
Box  3: E E P F ? l    	[EEPF?l]
Box  4: E , H Q m       [E,HQm] ← Replace comma (,) with slash (/) on old emulator
Box  5: E              	[E]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: ? n            	[?n]
  • Source Code:
@@ title = "Get all badges"
@@ author = "Mettrich"
@@ exit = null

old_emu = 0

@@

sbc r11, r15, #0xAE00
ldrh r12, [r11, #{old_emu?42:40}]
mov r10, #0xFF00
bic r12, r12, r10, asr #1
adc r12, r12, r10, asr #1
strh r12, [r11, #{old_emu?42:40}]

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adc r15, r12, #0x2b0

Unlock Southern Island

Note that you can also unlock Southern Island together with the code to get a (meta)stable ACE species (in all languages except French), for that just look here.

  • Box names:
Box  1: – B U n ♀ x Q m    [–BUn♀xQm] ← replace "♀" with "," on old emulators
Box  2: R T o D Y J m ?    [RToDYJm?]
Box  3: ? n                [?n]
  • Source code:
@@ title = "Unlock Southern Island"
@@ author = "Mettrich"
@@ exit = null

old_emu=0

@@

sbc r11, r15, #0xae00
strh r14, [r11, #{old_emu?0xc8:0xc6}]

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adc r15, r12, #0x2b0

Unlock Birth Island via Mystery Gift

!!! YOU HAVE TO EXECUTE THIS CODE INSIDE THE MAUVILLE POKÈCENTER !!!
!!! AFTER EXECUTING THE CODE, TALK TO THE MAN ON THE TOP LEFT !!!

  • English:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: U – n 0 N B n	[U–n0NBn] ← zero
Box  3: A A q O R n	[AAqORn] ← capital "o"
Box  4: A f R R n	[AfRRn]
Box  5: 3 F R n _ N ! q	[3FRn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • French:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: U – n z O B n	[U–nzOBn] ← capital "o"
Box  3: A A ? O B n	[AA?OBn] ← capital "o"
Box  4: A 3 R B n	[A3RBn]
Box  5: a F B n _ N ! q	[aFBn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • Italian:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: U – n z O B n	[U–nzOBn] ← capital "o"
Box  3: A A ? O B n	[AA?OBn] ← capital "o"
Box  4: A . S B n	[A.SBn]
Box  5: M F B n _ N ! q	[MFBn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • German:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: U – n ü O B n	[U–nüOBn] ← capital "o"
Box  3: A A 8 O B n	[AA8OBn] ← capital "o"
Box  4: A e S B n	[AeSBn]
Box  5: Z F B n _ N ! q	[ZFBn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • Spanish:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: U – n z O B n	[U–nzOBn] ← capital "o"
Box  3: A A – O B n	[AA–OBn] ← capital "o"
Box  4: A – T B n	[A–TBn]
Box  5: F H B n _ N ! q	[FHBn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • Source code:
@@ title = "Unlock Birth Island via Mystery Gift"
@@ author = "Sleipnir17, adapted by Mettrich"
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

lang = 7
; 2 - English
; 3 - French
; 4 - Italian
; 5 - German
; 7 - Spanish

address = (lang == 2 ? 0x0867533C :\
          (lang == 3 ? 0x086792B8 :\
          (lang == 4 ? 0x086719EA :\
          (lang == 5 ? 0x086864F7 :\
          (lang == 7 ? 0x086778CF : 0)))))

@@

sbc r11, r15, #0xBC00
sbc r11, r11, #0xBA
adc r12, r14, #0x3fc
adc r12, r12, #{address - 0x080069e7 - 0x3fc} ?
str r12, [r11, #0x800]!

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adcs r15, r12, #0x2b0

Unlock Navel Rock via Mystery Gift

!!! YOU HAVE TO EXECUTE THIS CODE INSIDE THE MAUVILLE POKÈCENTER !!!
!!! AFTER EXECUTING THE CODE, TALK TO THE MAN ON THE TOP LEFT !!!

  • English:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: A A A z O D n	[AAAzODn] ← capital "o"
Box  3: A A . O B n	[AA.OBn] ← capital "o"
Box  4: A 9 S B n	[A9SBn]
Box  5: 3 F B n _ N ! q	[3FBn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • French:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: A A A z O D n	[AAAzODn] ← capital "o"
Box  3: A A – O B n	[AA–OBn] ← capital "o"
Box  4: A 6 S B n	[A6SBn]
Box  5: M F B n _ N ! q	[MFBn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • Italian:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: A A A z O D n	[AAAzODn] ← capital "o"
Box  3: A A ? O B n	[AA?OBn] ← capital "o"
Box  4: A J S B n	[AJSBn]
Box  5: E F B n _ N ! q	[EFBn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • German:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: A A A G I D n	[AAAGIDn]
Box  3: A A r M R n	[AArMRn]
Box  4: A I U R n	[AIURn]
Box  5: _ N ! q		[ N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • Spanish:
Box  1: B B U n / … Q n	[BBUn/…Qn]
Box  2: A A A z O D n	[AAAzODn] ← capital "o"
Box  3: A A ! O B n	[AA!OBn] ← capital "o"
Box  4: A V R B n	[AVRBn]
Box  5: O F B n _ N ! q	[OFBn N!q]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n		[Bn]
  • Source code:
@@ title = "Unlock Navel Rock via Mystery Gift"
@@ author = "Sleipnir17, adapted by Mettrich"
@@ exit = null
@@ filler0 = 0xffffffff
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

lang = 7
; 2 - English
; 3 - French
; 4 - Italian
; 5 - German
; 7 - Spanish

address = (lang == 2 ? 0x0867550B :\
          (lang == 3 ? 0x0867946E :\
          (lang == 4 ? 0x08671BA6 :\
          (lang == 5 ? 0x086866DC :\
          (lang == 7 ? 0x08677AB0 : 0)))))

@@

sbc r11, r15, #0xBC00
sbc r11, r11, #0xBA
adc r12, r14, #{address - 0x080069e7} ?
str r12, [r11, #0x800]!

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adcs r15, r12, #0x2b0

Get any item

First you have to get the hexadecimal number of the item you want to get from here. After you execute the code, you can get the item from the Lilicove Store from the lottery lady on the first floor.

  • Box names:
Box  1: – B U n L … ! n	[–BUnL…!n]
Box  2: A A A $ F . o	[AA$FF.o]
Box  3: A A @ T B n	[AA@TBn]
Box  4: A # R B n	[A#RBn]
Box  5: % P B n A F Q m	[%PBnAFQm]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: B n	[Bn]

for old emulators (not mGBA):
Box  1: – B U n N … ! n	[–BUnN…!n]

Replace $ depending on the lowest (right) hex digit:
xxx0 → F, xxx1 → G,
xxx2 → H, xxx3 → I,
xxx4 → J, xxx5 → K,
xxx6 → L, xxx7 → M,
xxx8 → N, xxx9 → O,
xxxA → P, xxxB → Q,
xxxC → R, xxxD → S,
xxxE → T, xxxF → U

Replace @ depending on the second lowest (right) hex digit:
xx0x → J, xx1x → K,
xx2x → L, xx3x → M,
xx4x → N, xx5x → O,
xx6x → P, xx7x → Q,
xx8x → R, xx9x → S,
xxAx → T, xxBx → U,
xxCx → V, xxDx → W,
xxEx → X, xxFx → Y

Replace # depending on the second highest (left) hex digit:
x0xx → I, x1xx → J,
x2xx → K, x3xx → L,
x4xx → M, x5xx → N,
x6xx → O, x7xx → P,
x8xx → Q, x9xx → R,
xAxx → S, xBxx → T,
xCxx → U, xDxx → V,
xExx → W, xFxx → X

Replace % depending on the highest (left) hex digit:
0xxx → I, 1xxx → J,
2xxx → K, 3xxx → L,
4xxx → M, 5xxx → N,
6xxx → O, 7xxx → P,
8xxx → Q, 9xxx → R,
Axxx → S, Bxxx → T,
Cxxx → U, Dxxx → V,
Exxx → W, Fxxx → X
  • Source code:
@@ title = "Title"
@@ author = "Author"
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

old_emu = 0

@@

sbc r11, r15, #0xae00
adc r11, r11, #{(old_emu?0xd3:0xd1)-0xb}
mov r12, #0xc0
adcs r12, r12, #0xc40
adcs r12, r12, #0xc300
adcs r12, r12, #0xc3000
strh r12, [r11, #0xb]

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adcs r15, r12, #0x2b0

Duplicate all items in the PC

  • Box names:
Box  1: 3 A . o _ F J u	[3A.o FJu]
Box  2: R . o C ? U n	[R.oC?Un]
Box  3: E E F 2 / n	[EEF2/n]
Box  4: E ♀ I P m	[E♀IPm] ← on old emulators, replace "♀" with a comma (,)
Box  5: X D g n _ F Z 8	[XDgn FZ8]
Box  6: R T Y D Y J W ?	[RTYDYJW?]
Box  7: ? X	        [?X]
  • Source code:
@@ title = "Duplicate all your items in your PC storage"
@@ author = "Mettrich"
@@ exit = null
@@ filler1 = 0xbfbfbfff
@@ filler2 = 0xbfbfffff
@@ filler3 = 0xbfffffff
@@ filler4 = 0xffffffff
@@ fill = false

old_emu = 0

@@

mov r11, #0x29000
0xe9c4c000 ; stmib r4, {r14, r15} ^
mov r12, #0xff00
sbc r10, r15, #0xbd00

adcs r10, r10, #3
strh r12, [r10, #{old_emu?0x38:0x36}]
sbcs r11, r11, #0xd20

0xa9d4c000 ; ldmibge r4, {r14, r15} ^

bicle r12, r14, #0xff00
strhle r13, [r4, #0x3e]
adcle r15, r12, #0x2b0

Get all TMs and HMs

  • Box names:
Box  1: A B U n _ F J u	[ABUn FJu]
Box  2: U . o 7 U h n	[U.o7Uhn]
Box  3: _ q F ‘ A n	[ qF‘An]
Box  4: A _ F R n	[A FRn]
Box  5: A I Q m C 2 g m	[AIQmC2gm]
Box  6: A A A N 9 / n	[AAAN9/n]
Box  7: A A C 2 Q m	[AAC2Qm]
Box  8: A J 0 R n	[AJ0Rn]
Box  9: z _ f n _ F Z O	[z fn FZO]
Box 10: R j o D Y J m ?	[RjoDYJm?]
Box 11: B n	[Bn]

For old emulators:
Box  5: C I Q m E 2 g m	[CIQmE2gm]
Box  6: A A A N 9 / n	[AAAN9/n]
Box  7: A A E 2 Q m	[AAE2Qm]

To not get the HMs:
Box  2: U . o 9 U h n	[U.o9Uhn]
  • Source code:
@@ title = "Get all TMs/HMs"
@@ author = "Mettrich"
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

old_emu = 0

@@

sbc r11, r15, #0xbb00
0xe9c4c000 ; stmib r4, {r14, r15} ^
mov r12, #0x3fc
sbcs r12, r12, #0x2a0

str r15, [r0, #-0xfff]


adcs r11, r11, #3
sbc r12, r12, #0
strh r12, [r11, #{old_emu?0x3d:0x3b}]

ldrh r10, [r11, #{old_emu?0x3f:0x3d}]
adcs r10, r10, #0xc8000
strh r10, [r11, #{old_emu?0x3f:0x3d}]

sbc r10, r12, #0x31
sbcs r0, r10, #0xee

0xc9d4c000 ; ldmibgt r4, {r14, r15} ^

bics r12, r14, #0xff00
strh r13, [r4, #0x3e]
adcs r15, r12, #0x2b0

Nickname a Pokemon in Box 1 Slot 1

  • English:
Box  1: r P D n V S B n	[rPDnVSBn]
Box  2: B T o j _ B n 2	[BToj Bn2]
Box  3: A n	        [An]
  • French:
Box  1: u P D n G F B n	[uPDnGFBn]
Box  2: B T o 4 _ B n 2	[BTo4 Bn2]
Box  3: A n	        [An]
  • Italian:
Box  1: r P D n H S B n	[rPDnHSBn]
Box  2: B T o … _ B n 2	[BTo… Bn2]
Box  3: A n	        [An]
  • German:
Box  1: u P D n 2 F B n	[uPDn2FBn]
Box  2: B T o 2 _ B n 2	[BTo2 Bn2]
Box  3: A n	        [An]
  • Spanish:
Box  1: r P D n H S B n	[rPDnHSBn]
Box  2: B T o / _ B n 2	[BTo/ Bn2]
Box  3: A n	        [An]
  • English source code:
@@ title = "Nickname the Pokemon in Box 1 Slot 1"
@@ author = "Mettrich"
@@ exit = null
@@ fill = false

@@

adcs r12, r14, #0xe6000
adcs r12, r12, #0x3400

bic r11, r14, #0xff00
adcs r0, r12, #0xde
adcs r15, r11, #0x28c
  • French source code:
@@ title = "Nickname the Pokemon in Box 1 Slot 1"
@@ author = "Mettrich"
@@ exit = null
@@ fill = false

@@

adcs r12, r14, #0xe9000
adcs r12, r12, #0xc1

bic r11, r14, #0xff00
adcs r0, r12, #0xa5
adcs r15, r11, #0x28c
  • Italian source code:
@@ title = "Nickname the Pokemon in Box 1 Slot 1"
@@ author = "Mettrich"
@@ exit = null
@@ fill = false

@@

adcs r12, r14, #0xe6000
adcs r12, r12, #0x3080

bic r11, r14, #0xff00
adcs r0, r12, #0xb0
adcs r15, r11, #0x28c
  • German source code:
@@ title = "Nickname the Pokemon in Box 1 Slot 1"
@@ author = "Mettrich"
@@ exit = null
@@ fill = false

@@

adcs r12, r14, #0xe9000
adcs r12, r12, #0xa3

bic r11, r14, #0xff00
adcs r0, r12, #0xa3
adcs r15, r11, #0x28c
  • Spanish source code:
@@ title = "Nickname the Pokemon in Box 1 Slot 1"
@@ author = "Mettrich"
@@ exit = null
@@ fill = false

@@

adcs r12, r14, #0xe6000
adcs r12, r12, #0x3080

bic r11, r14, #0xff00
adcs r0, r12, #0xba
adcs r15, r11, #0x28c

Make Hoenn Starters reappear

  • Box names:
Box  1: – B U n f … Q n	[–BUnf…Qn] ← for old emulator replace "f" with "d"
Box  2: E E E B J g m	[EEEBJgm]
Box  3: E E m P R o	[EEmPRo]
Box  4: E B J Q m      	[EBJQm]
Box  5: E              	[E]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: ? n	        [?n]
  • Source code:
@@ title = "Make Hoenn Starter reappear"
@@ author = "Sleipnir17, adapted by Mettrich"
@@ exit = null

old_emu = 0

@@

sbc r11, r15, #0xAE00
sbc r11, r11, #{old_emu?0xd8:0xda}

ldrh r12, [r11, #0x4c]
bic r12, r12, #0xE1000
strh r12, [r11, #0x4c]

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adc r15, r12, #0x2b0

Make Johto Starters (re)appear

  • Box names:
Box  1: . B U n n … ! n	[.BUnn…!n]
Box  2: G . o p G R n  	[G.opGRn]
Box  3: E E B F Q m    	[EEBFQm] ← for old emulator, replace "B" with "D"
Box  4: E              	[E]
Box  5: E              	[E]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: ? n            	[?n]
  • Source code:
@@ title = "Make Johto Starters reappear"
@@ author = "Sleipnir17, adapted by Mettrich"
@@ exit = null

old_emu = 0

@@

sbc r11, r15, #0xAD00
adc r11, r11, #0xE2
mov r12, #0xc000003f
sbc r12, r12, #0x39
strh r12, [r11, #{old_emu?14:12}]

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adc r15, r12, #0x2b0

Encounter any Pokemon

Credits to Theocatic, Adrichu00 and final for the original code, I just shortened and adapted it for better typability and manual input of the species. To use this code you need to get the three hexadecimal digits of the Pokemon you want to encounter from here (take the lower number, the one from the left). You should execute this code in the Mauville Pokecenter and then talk to the Old Man on the top left to start the encounter.

  • Box names:
Box  1: B B U n B ? E n    [BBUnB?En]
Box  2: 2 P o / … Q n      [2Po/…Qn]
Box  3: A A ♀ F . o        [AA♀F.o]
Box  4: A $ N B n          [A$NBn]
Box  5: @ P B n # R B n    [@PBn#RBn]
Box  6: L R o _ 7 ! q      [LRo 7!q]
Box  7: A A _ F 9 q        [AA F9q]
Box  8: A . M . o          [A.M.o]
Box  9: F Q ? n T R 9 s    [FQ?nTR9s]
Box 10: R T o D Y J m ?    [RToDYJm?]
Box 11: B n                [Bn]

Take the last three digits of the Pokémon's hex index, and use them like so:

Replace $ depending on the first (left) hex digit:
0→I, 1→J,
2→K, 3→L,
4→M, 5→N,
6→O, 7→P,
8→Q, 9→R,
A→S, B→T,
C→U, D→V,
E→W, F→X

Replace @ depending on the middle hex digit:
0→J, 1→K,
2→L, 3→M,
4→N, 5→O,
6→P, 7→Q,
8→R, 9→S,
A→T, B→U,
C→V, D→W,
E→X, F→Y

Replace # depending on the last (right) hex digit:
0→F, 1→G,
2→H, 3→I,
4→J, 5→K,
6→L, 7→M,
8→N, 9→O,
A→P, B→Q,
C→R, D→S,
E→T, F→U
  • Box names for egg ACE:
The egg will hatch normally, but should turn invisible,
then you'll get asked to nickname it (DON'T try to nickname it, it will crash).
There will be no certificate or whiteout.

Box  1: B B U n B ? E n    [BBUnB?En]
Box  2: 2 P o / … Q n      [2Po/…Qn]
Box  3: A A _ 7 ! q        [AA 7!q]
Box  4: A ♀ F . o          [A♀F.o]
Box  5: @ R B n # $ B n    [@RBn#$Bn]
Box  6: M R o _ F 9 q      [MRo F9q]
Box  7: A A . M . o        [AA.M.o]
Box  8: A F Q ? n          [AFQ?n]
Box  9: T R 9 s – T D n    [TR9s–TDn]
Box 10: B T o L _ B n 2    [BToL Bn2]
Box 11: A n                [An]

Get the three hexadecimal index of your wanted Pokémon from the link, and replace @,# and $ as follows:
- Replace @ depending on the last (right) hexadecimal digit:
xx0 → F, xx1 → G,
xx2 → H, xx3 → I,
xx4 → J, xx5 → K,
xx6 → L, xx7 → M,
xx8 → N, xx9 → O,
xxA → P, xxB → Q,
xxC → R, xxD → S,
xxE → T, xxF → U
- Replace # based on the middle AND first (left) hexadecimal digit:
00x → V, 01x → Z,
02x → d, 03x → h,
04x → l (lowercase "L"), 05x → p,
06x → t, 07x → A,
08x → B, 09x → C,
0Ax → D, 0Bx → E,
0Cx → F, 0Dx → G,
0Ex → H, 0Fx → I,
10x → J, 11x → K,
12x → L, 13x → M,
14x → N, 15x → O,
16x → P, 17x → Q,
18x → R, 19x → S,
1Ax → T, 1Bx → U,
1Cx → V, 1Dx → W,
1Ex → X, 1Fx → Y
- Replace $ based on the first (left) AND middle hexadecimal digit:
00x - 06x → Q
07x - 0Fx → P
1xx → P
  • Source code:
@@ title = "Set up wild battle with any Pokemon"                
@@ author = "Theocatic / it-is-final / Adrichu00, modified by Mettrich"                
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

; After Executing this code talk to the old guy in Mauville City Pokemon Center or
; to the fat man in Littleroot Town
; (do not leave the area or reload the map though)

; The index for a pokemon can be found at
; bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_index_number_in_Generation_III

@@                

sbc r11, r15, #0xbc00
adcs r10, r15, #0xbc00
bic r10, r10, #0xfc000003

sbc r11, r11, #0xba

mov r12, #0xb6
adcs r12, r12, #0xc30000
adcs r12, r12, #0xc4000
adcs r12, r12, #0xc000
bic r12, r12, #0xff00000
str r10, [r11, #0x800]!
str r12, [r10]!
mov r12, 0x02b70000 ?
str r12, [r10, r14, asr #25]!

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adcs r15, r12, #0x2b0
  • Source code for egg ACE:
@@ title = "Set up wild battle with any Pokemon"                
@@ author = "Theocatic / it-is-final / Adrichu00, modified by Mettrich"                
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

; After Executing this code talk to the old guy in Mauville City Pokemon Center or
; to the fat man in Littleroot Town
; (do not leave the area or reload the map though)

; The index for a pokemon can be found at
; bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_index_number_in_Generation_III

@@                

sbc r11, r15, #0xbc00
adcs r10, r15, #0xbc00
bic r10, r10, #0xfc000003

sbc r11, r11, #0xba
str r10, [r11, #0x800]!
mov r12, #0xb6
adcs r12, r12, #0xc000
adcs r12, r12, #0x34000
bic r12, r12, #0x3fc0000
str r12, [r10]!
mov r12, 0x02b70000 ?
str r12, [r10, r14, asr #25]!

adcs r12, r14, #0xae0
bic r11, r14, #0xff00
adcs r0, r12, #0xc6
adcs r15, r11, #0x28c

Complete the Pokedex

  • Box names:
Box  1: W B U n 3 … Q n    [WBUn3…Qn] ← for old emulator, replace "3" with "1"
Box  2: F . o _ F J u      [F.o FJu]
Box  3: E E R _ R n        [EER Rn]
Box  4: E _ … A n          [E …An]
Box  5: G – ! n Q F Q q    [G–!nQFQq]
Box  6: F Q q N S P q      [FQqNSPq]
Box  7: E E w . 9 n        [EEw.9n]
Box  8: E 2 J P q          [E2JPq]
Box  9: _ _ V n _ F Z O    [  Vn FZO]
Box 10: R T o D Y J m ?    [RToDYJm?]
Box 11: ? n                [?n]
  • Source code:
@@ title = "Complete the Pokédex"
@@ author = "Mettrich"
@@ exit = null

inaccurate_emu = 0

@@

sub r11, r15, #{inaccurate_emu?0xd1a4:0xd1a6} ?
mov r12, #0xff
0xe9c4c000 ; stmib r4, {r14, r15} ^
sbc r0, r12, #0xcc

adcs r11, #0
adc r10, r11, #0xc10
strb r12, [r11, #0xcb]
strb r12, [r11, #0xff]
strb r12, [r10, #0xdc8]
adc r10, r10, #0x3ac0
strb r12, [r10, #0x4a3]

sbcs r0, r0, #0
0xc9d4c000 ; ldmibgt r4, {r14, r15} ^

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adc r15, r12, #0x2b0

Get 31 perfect Pokeblocks

  • Box names:
Box  1: / R U n _ F J u	[/RUn FJu]
Box  2: _ . o F G B n	[ .oFGBn]
Box  3: A A _ F B n F B	[AA FBnFB]
Box  4: o J … R q	[oJ…Rq] ← for old emulator, replace "J" with "L"
Box  5: _ _ V n _ F Z 8	[  Vn FZ8]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: ? n	        [?n]
  • Source code:
@@ title = "Fill your case with perfect Pokeblocks"
@@ author = "Mettrich, slightly based on sleipnir17's code"
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

old_emu = 0

@@

sbc r12, r15, #0xba00
0xe9c4c000 ; stmib r4, {r14, r15} ^
mov r0, #0xff
adcs r12, r12, #0x30

adcs r12, r12, #0
0xe3ffbcc0
strb r11, [r12, #{old_emu?0xc6:0xc4}]
sbcs r0, r0, #0

0xa9d4c000 ; ldmibgt r4, {r14, r15} ^

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adc r15, r12, #0x2b0

Reactivate all move tutors and non-event static legendaries

  • Box names:
Box  1: – B U n B … Q n	[–BUnB…Qn] ← for old emulator, replace "B" with a slash (/)
Box  2: 3 m o D F g m	[3moDFgm]
Box  3: E E v F R m	[EEvFRm]
Box  4: E D F Q m      	[EDFQm]
Box  5: E              	[E]
Box  6: R T o D Y J m ?	[RToDYJm?]
Box  7: ? n	        [?n]
  • Source code:
@@ title = "Reactivate all move tutors and non-even static legendaries"
@@ author = "Sleipnir17, shortened by Mettrich"
@@ exit = null

old_emu = 0

@@

sbc r11, r15, #0xae00
sbc r11, r11, #{14+(old_emu?0xac:0xae)}

mvn r10, #0xff000000
ldrh r12, [r11, #14]
bic r12, r12, r10, ror #1
strh r12, [r11, #14]

bic r12, r14, #0xff00
strh r13, [r4, #0x3e]
adc r15, r12, #0x2b0

Make any Pokemon shiny

This code currently requires a BIOS. If you're on console, you already have a BIOS, but some emulators may need to be provided an original BIOS for this code to work.
This code makes the Pokemon in Box 10 Slot 19 shiny. You don't need to know your TID, SID or its PID, this works with any Pokemon!

  • Box names:
Box  1: 5 . U n h 0 9 n	[5.Unh09n]
Box  2: S D n T z . s	[SDnTz.s]
Box  3: A A _ _ / n	[AA  /n]
Box  4: A E Q B n	[AEQBn]
Box  5: see below
Box  6: E . o _ m E n 3	[E.o mEn3]
Box  7: Q o T z C s	[QoTzCs]
Box  8: A _ _ P n	[A  Pn]
Box  9: T D / s T B 9 s	[TD/sTB9s]
Box 10: E . o D Y J m 3	[E.oDYJm3]
Box 11: Q o	[Qo]

For English and French:
Box  5: E Q B n 5 F B n	[EQBn5FBn]

For Italian and German:
Box  5: E Q B n 9 F B n	[EQBn9FBn]

For Spanish:
Box  5: E Q B n 1 F B n	[EQBn1FBn]


For old emulators:
Box  1: 5 . U n p 0 9 n	[5.Unp09n]
  • Source code:
@@ title = "Make any Pokémon shiny"
@@ author = "Mettrich"
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

; Requirements:
; - Any Stable ACE species
; - A BIOS
;
; Effects:
; - Makes the Pokémon in Box 10 Slot 19 shiny

old_emu = 0

; Language:
; 2 - EN
; 3 - FR
; 4 - IT
; 5 - DE
; 7 - ES
lang = 2

@@

sub r10, r15, #{old_emu?0x2948:0x294a} ?

adcs r12, r14, #0x3fc0
str r14, [r13, r14, asr #29]!

adcs r0, r10, #0

adcs r12, r12, #0x2fc00
adcs r12, r12, #0x2fc00
adcs r12, r12, #{(lang==2||lang==3)?0xa6:(lang==4||lang==5?0xaa:(lang==7?0xa2:0xa6))}

mov r11, #0x3fc
0xe2bfe100 ; adcs r14, r15, #0
bic r15, r11, #0x290 ; call the function

ldr r14, [r13, r14, asr #29]! ; return to here, now C is set to 1

sbc r0, r10, #0 ; complicated register move
ldr r11, [r10, r14, asr #29]!
str r11, [r10, r14, asr #25]!

mov r11, #0x3fc
strh r13, [r4, #0x3e]
bic r15, r11, #0x290

Advanced codes

These codes need to be executed with a stable/metastable ACE species, some also need accurate BIOS emulation (I'm working on some workarounds for BIOSless, but that'd need some setup).

Making long codes with wallpapers

If you want to create really long codes, for example to write a payload into the game, you'll want to use this exit code that I developed. It also needs accurate BIOS emulation (if you're on emulator) though (On BIOSless emulator, you can do this instead).
To use it, just input this into the boxes:

Box  14: F c o D Y J m u	[FcoDYJmu]

and then apply these wallpapers:

Box 1 wallpaper: "Machine" (4th menu -> 3rd entry)
Box 2 wallpaper: "Desert" (1st menu -> 3rd entry)

And that's it! Some of the things that you can do with this short exit code are:

Creating a base64 writer

This writer can write 80 bytes at once, but doesn't allow for use of a crafting table, for that look here.

Codes:

  • Code 1:
Box  1: 4 C U n 7 … Q n	[4CUn7…Qn] <- for inaccurate emulator replace 7 with 5
Box  2: _ _ _ I K l o _	[   IKlo ]
Box  3: _ _ 6 O ? n _ _	[  6O?n  ]
Box  4: _ i R ? n _ _ _	[ iR?n   ]
Box  5: O U ? n … F ! q	[OU?n…F!q]
Box  6: _ _ _ M K … o _	[   MK…o ]
Box  7: _ _ D N R n _ _	[  DNRn  ]
Box  8: _ 2 R R n _ _ _	[ 2RRn   ]
Box  9: A F R n T R ! s	[AFRnTR!s]
Box 10: _ _ _ F K l o _	[   FKlo ]
Box 11: _ _ H P ? n _ _	[  HP?n  ]
Box 12: _ … T ? n _ _ _	[ …T?n   ]
Box 13: T R ! s _ _ _ _	[TR!s    ]
  • Code 2:
(Box  1: 4 C U n 7 … Q n	[4CUn7…Qn]) <- stays the same as in code 1
Box  2: _ _ _ 6 M … o _	[   6M…o ]
Box  3: _ _ , I ? n _ _	[  ,I?n  ]
Box  4: _ U P R n _ _ _	[ UPRn   ]
Box  5: 0 F ! q n J 0 o	[0F!qnJ0o]
Box  6: _ _ _ V N R n _	[   VNRn ]
Box  7: _ _ y F R n _ _	[  yFRn  ]
Box  8: _ T R ! s _ _ _	[ TR!s   ]
Box  9: _ F 0 o T R ! s	[ F0oTR!s]
Box 10: _ _ _ 6 J 0 o _	[   6J0o ]
Box 11: _ _ Q P ? n _ _	[  QP?n  ]
Box 12: _ g U ? n _ _ _	[ gU?n   ]
Box 13: 0 U ? n T R ! s	[0U?nTR!s]

  • Code 3:
(Box  1: 4 C U n 7 … Q n	[4CUn7…Qn]) <- stays the same as in code 1
Box  2: _ _ _ ? K l o _	[   ?Klo ]
Box  3: _ _ t S ? n _ _	[  tS?n  ]
Box  4: _ B F ? n _ _ _	[ BF?n   ]
Box  5: B F ! q z N … o	[BF!qzN…o]
Box  6: _ _ _ . N ? n _	[   .N?n ]
Box  7: _ _ O S ? n _ _	[  OS?n  ]
Box  8: _ l H ? n _ _ _	[ lH?n   ]
Box  9: T R ! s d K … o	[TR!sdK…o]
Box 10: _ _ _ p Q ? n _	[   pQ?n ]
Box 11: _ _ 0 Q ? n _ _	[  0Q?n  ]
Box 12: _ z U ? n _ _ _	[ zU?n   ]
Box 13: o F ? n T R ! s	[oF?nTR!s]
  • Code 4:
(Box  1: 4 C U n 7 … Q n	[4CUn7…Qn]) <- stays the same as in code 1
Box  2: _ _ _ P I l o _	[   PIlo ]
Box  3: _ _ G M ? n _ _	[  GM?n  ]
Box  4: _ , S ? n _ _ _	[ ,S?n   ]
Box  5: F H ? n N F ! q	[FH?nNF!q]
Box  6: _ _ _ o J l o _	[   oJlo ]
Box  7: _ _ q N R n _ _	[  qNRn  ]
Box  8: _ E R R n _ _ _	[ ERRn   ]
Box  9: C U R n T R ! s	[CURnTR!s]
Box 10: _ _ _ s H … o _	[   sH…o ]
Box 11: _ _ u O ? n _ _	[  uO?n  ]
Box 12: _ p F ? n _ _ _	[ pF?n   ]
Box 13: T R ! s _ _ _ _	[TR!s    ]
  • Code 5:
(Box  1: 4 C U n 7 … Q n	[4CUn7…Qn]) <- stays the same as in code 1
Box  2: _ _ _ 4 K … o _	[   4K…o ]
Box  3: _ _ l O ? n _ _	[  lO?n  ]
Box  4: _ e S ? n _ _ _	[ eS?n   ]
Box  5: G F ? n Z F ! q	[GF?nZF!q]
Box  6: _ _ _ k I l o _	[   kIlo ]
Box  7: _ _ z M ? n _ _	[  zM?n  ]
Box  8: _ A O ? n _ _ _	[ AO?n   ]
Box  9: z T ? n W T ? n	[zT?nWT?n]
Box 10: _ _ _ T R ! s _	[   TR!s ]
Box 11: _ _ A R … o _ _	[  AR…o  ]
Box 12: _ B U ? n _ _ _	[ BU?n   ]
Box 13: T R ! s _ _ _ _	[TR!s    ]

These will generate a bad egg in Box 10 Slot 19, this is your base64 writer. All in all, for this you have to input 61 box names + the one box code for the exit code. When you have the base64 writer, you need to put it into Box 14 Slot 29 for it to work, and it will generate a Pokemon in the next slot, Box 14 Slot 30. An example to create a Combusken named Mettrich:

Box  1: Y m F a o w A A	[YmFaowAA]
Box  2: A A D H 2 e j o	[AADH2ejo]
Box  3: 5 t 3 X 3 A A A	[5t3X3AAA]
Box  4: B Q K 8 z M P S	[BQK8zMPS]
Box  5: A A A A A P J z	[AAAAAPJz]
Box  6: A A B 6 Y W ! j	[AAB6YW!j]
Box  7: L m A D o 1 J 5	[LmADo1J5]
Box  8: e r N i c d ! C	[erNicd!C]
Box  9: n Z 6 l n G J h	[nZ6lnGJh]
Box 10: W q N 7 Y O e j	[WqN7YOej]
Box 11: N n R a o 5 2 p	[NnRao52p]
Box 12: W q N m n V p f	[WqNmnVpf]
Box 13: Y m F a o 2 J h	[YmFao2Jh]
Box 14: W q M A A A A A	[WqMAAAAA]

In principle to generate a base64 code, I'd recommend using the tool "PokeGlitzer" by E-Sh4rk to generate a Pokemon, then copy the whole Pokemon in hex (right click, "Open Hex Data Editor", select all and copy), and then using an online converter from hex to base64 (like this one I used for this https://base64.guru/converter/encode/hex) to generate the letters, then copy them to a text file, and insert a newline every 8 characters. Replace all pluses (+) with exclamation marks (!) and all slashes (/) with question marks (?), remove the equals (=) at the end and fill the last box up with A's (thought this shouldn't matter). It's still a little bit of a hassle, maybe I'll make an online generator for that some time, but not today.

Creating a Thumb writer

This is the new method, that only takes 3.5 codes, but may require a bit more attention.
The method itself only takes about 3 codes (~41 box renames) as opposed to the 5 codes (~62 box renames) of the method above to create a base64 writer, but it's also superior in the way that it allows for use of a "crafting table", which allows you to generate Pokemon one after the other starting at a specific slot in the boxes (after the slot of the crafting table).
However, it does require a metastable Thumb species, which you can get here, it only takes 8 box renames (in theory only 7 if you skip the fortify step, which you don't need for this purpose).
Then, when you have the metastable Thumb species, you need to execute these two codes to generate a bad egg in Box 10 Slot 19:
(You need to have Box 14 named like mentioned here) Code 1:

Box  1: 7 . k n F K . o	[7.knFK.o]
Box  2: A A A j Q B n	[AAAjQBn]
Box  3: A A H , R o	[AAH,Ro]
Box  4: A 0 I m o	[A0Imo] ← zero, not an "O"
Box  5: D L ? n t Q ? n	[DL?ntQ?n]
Box  6: A A A K U ? n	[AAAKU?n]
Box  7: A A M F 9 q	[AAMF9q] ← for old emulators, replace "M" with "O" (big "o")
Box  8: A 8 I . o	[A8I.o]
Box  9: ♂ Q ? n H T ? n	[♂Q?nHT?n]
Box 10: O ? n T R 9 s	[O?nTR9s] ← big "o"
Box 11: A A h J . o	[AAhJ.o]
Box 12: A M Q ? n	[AMQ?n]
Box 13: i T ? n _ d P u	[iT?n dPu]
Box 14: F c o D Y J m u [FcoDYJmu] ← may be different on emulator without BIOS

Code 2:

Box  1: 7 . U n , I . o	[7.Un,I.o] ← mind the "U" instead of the "k"
Box  2: A A A p T ? n	[AAApT?n]
Box  3: A A 0 D ? n z L	[AA0D?nzL] ← zero, not an "O"
Box  4: o k P R n	[okPRn]
Box  5: B I R n 6 S B n	[BIRn6SBn]
Box  6: A A A c F 9 q	[AAAcF9q] ← for old emulators, replace "c" with "e"
Box  7: A A T B 9 s	[AATB9s]
Box  8: A , M . o	[A,M.o]
Box  9: F R ? n G U ? n	[FR?nGU?n]
Box 10: ♂ ? n ♂ H m o   [♂?n♂Hmo]
Box 11: A A k L ? n	[AAkL?n]
Box 12: A h R ? n	[AhR?n]
Box 13: _ d P u		[ dPu]
Box 14: keep as in code 1

This is basically an intermediate writer, that is very small and simple. It's written in Thumb though, so to use it you need to actually remove the Thumb->ARM bootstrap (the bad egg at the beginning of Box 12) to use it. Then, put the newly created intermediate writer (the bad egg in Box 10 Slot 19) into Box 14, Slot 29 (the second to last slot), and execute this code to create a Thumb base64 writer:
(Note that all oval characters here are big "o"s, not zeros, there are no zeroes in this code)

  • base64:
Box  1: KA CF LF PA [KACFLFPA]
Box  2: KH AM IH OA [KHAMIHOA]
Box  3: MP HC AO JK [MPHCAOJK]
Box  4: BM DL NC AA [BMDLNCAA]
Box  5: DB AB FM EC [DBABFMEC]
Box  6: NA AM CK PP [NAAMCKPP]
Box  7: NF AA DK LL [NFAADKLL]
Box  8: AB KE DC EO [ABKEDCEO]
Box  9: DG AG BI KE [DGAGBIKE]
Box 10: NL AE CO AI [NLAECOAI]
Box 11: BM CC DO AI [BMCCDOAI]
Box 12: HA BK EA PC [HABKEAPC]
Box 13: CJ HI DD AB [CJHIDDAB]
Box 14: LN PA NL OM [LNPANLOM]
  • hex:
Box  1: KA CF LF PA [KACFLFPA]
Box  2: KH AN IH OA [KHANIHOA]
Box  3: MP GC AO JK [MPGCAOJK]
Box  4: BM DL NC AA [BMDLNCAA]
Box  5: FM EC EG MA [FMECEGMA]
Box  6: CK MA DB AB [CKMADBAB]
Box  7: DK LB NM AJ [DKLBNMAJ]
Box  8: DC BA NF AA [DCBANFAA]
Box  9: BI KE AB CE [BIKEABCE]
Box 10: AI HC DG AB [AIHCDGAB]
Box 11: HA BM NC AB [HABMNCAB]
Box 12: CJ HO DD AB [CJHODDAB]
Box 13: LN PA NL OO [LNPANLOO]
Box 14: AA AA AA AA [AAAAAAAA]
  • base16: UNTESTED, SHOULD WORK THOUGH
Box  1: KA CF LF LA [KACFLFLA]
Box  2: KH AN IH OA [KHANIHOA]
Box  3: MP DC AO JK [MPDCAOJK]
Box  4: BM DL NC AA [BMDLNCAA]
Box  5: DB AB FM EC [DBABFMEC]
Box  6: NM AH CK MA [NMAHCKMA]
Box  7: AB CE DK LL [ABCEDKLL]
Box  8: DF AB BI KE [DFABBIKE]
Box  9: NC AB AI GK [NCABAIGK]
Box 10: DD AB HA BM [DDABHABM]
Box 11: NL AB CJ HO [NLABCJHO]
Box 12: AA AA LN LA [AAAALNLA]
Box 13: AA AA OH OO [AAAAOHOO]
Box 14: AA AA AA AA [AAAAAAAA]

And that's mostly it, you can now remove the intermediate writer bad egg (in Box 14 Slot 29) and put it in some safe box (or delete it if you want), and put the new base64/hex/base16 writer in Box 14 Slot 29 and start using it like a normal writer (except without a Thumb->ARM bootstrap, because this writer is also pure Thumb).

To create new Pokemon with the base64 writer: In principle to generate a base64 code, I'd recommend using the tool "PokeGlitzer" by E-Sh4rk to generate a Pokemon, then copy the whole Pokemon in hex (right click, "Open Hex Data Editor", select all and copy), and then using an online converter from hex to base64 (like this one I used for this https://base64.guru/converter/encode/hex) to generate the letters, then copy them to a text file, and insert a newline every 8 characters. Replace all pluses (+) with exclamation marks (!) and all slashes (/) with question marks (?), remove the equals (=) at the end and fill the last box up with A's (thought this shouldn't matter). It's still a little bit of a hassle, maybe I'll make an online generator for that some time, but not today.

To make a "CRAFTY" simple crafting table you can use this code (basically required for hex and base16 writers, optional for base64):

  • base64:
Box  1: E6 MM Sc oY [E6MMScoY]
Box  2: De C9 zL vA [DeC9zLvA]
Box  3: zt P? ?? ?? [ztP?????]
Box  4: Ag K7 vb ?? [AgK7vb??]
Box  5: ?? ?? AP kj [????APkj]
Box  6: AA BX ug Gp [AABXugGp]
Box  7: As sA KQ LQ [AssAKQLQ]
Box  8: k0 IA 2v nn [k0IA2vnn] ← zero
Box  9: BD uf Rm AJ [BDufRmAJ]
Box 10: AA AA AA AA [AAAAAAAA]
Box 11: AA AA AA AA [AAAAAAAA]
Box 12: AA AA AA AA [AAAAAAAA]
Box 13: AA AA AA AA [AAAAAAAA]
Box 14: AA AA AA AA [AAAAAAAA]
  • hex:
Box  1: 13 A3 0C 49 [13A30C49]
Box  2: CA 18 0D E0 [CA180DE0]
Box  3: BD CC BB C0 [BDCCBBC0]
Box  4: CE D3 FF FF [CED3FFFF]
Box  5: FF FF 02 02 [FFFF0202]
Box  6: BB BD BF FF [BBBDBFFF]
Box  7: FF FF FF 00 [FFFFFF00]
Box  8: F9 23 00 00 [F9230000]
Box  9: 57 BA 01 A9 [57BA01A9]
Box 10: 02 CB 00 29 [02CB0029]
Box 11: 02 D0 93 42 [02D09342]
Box 12: 00 DA F9 E7 [00DAF9E7]
Box 13: 04 3B 9F 46 [043B9F46]
Box 14: 60 09 00 00 [60090000]
  • base16:
Box  1: BD KD AM EJ [BDKDAMEJ]
Box  2: MK BI AN OA [MKBIANOA]
Box  3: LN MM LL MA [LNMMLLMA]
Box  4: MO ND PP PP [MONDPPPP]
Box  5: PP PP AC AC [PPPPACAC]
Box  6: LL LN LP PP [LLLNLPPP]
Box  7: PP PP PP AA [PPPPPPAA]
Box  8: PJ CD AA AA [PJCDAAAA]
Box  9: FH LK AB KJ [FHLKABKJ]
Box 10: AC ML AA CJ [ACMLAACJ]
Box 11: AC NA JD EC [ACNAJDEC]
Box 12: AA NK PJ OH [AANKPJOH]
Box 13: AE DL JP EG [AEDLJPEG]
Box 14: GA AJ AA AA [GAAJAAAA]
  • Code 1 source code:
@@ title = "Title"
@@ author = "Author"
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff

old_emu = 0

@@

sbcs r10, r15, #0x2a00 ; Box 10 Slot 19 - 0xc0 + (old_emu?7:9)

; mov r12, #0x30017801 ?
mov r12, #0x30000000
adcs r12, r12, #0x37800
bic r11, r12, #0xc20000

mov r12, #0x87e3a311 ?
str r12, [r10, #{0xc0-(old_emu?7:9)+16}]!

mov r12, #{0xa442a022-0x3fc000} ?
adc r12, r12, #0x3fc000
str r12, [r10, r14, asr #25]!

; mov r12, #0xdc0329d0 ?
MOV r12, #0xdc000000
ADC r12, r12, #0x31c00
ADC r12, r12, #0xdd0
0xe9cad800
  • Code 2 source code:
@@ title = "Title"
@@ author = "Author"
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

old_emu = 0

@@

sbc r10, r15, #0x2a00 ; Box 10 Slot 19 - 0xc0 + (old_emu?7:9)

; mov r12, #0xe0001852 ?
MOV r12, #0xe0000002
ADC r12, r12, #0xe40
ADC r11, r12, #0xa10

; mov r12, #0x011239bb ? I had to make this one manually D:
0xe3ffc6ee ; mvns r12, #0x0ee00000
sbc r12, r12, #0xdf000
sbc r12, r12, #0xf0000002
adcs r12, r12, #0x29c0
str r12, [r10, #{0xc0-(old_emu?7:9)+32}]!
str r11, [r10, r14, asr #25]!

mov r12, #{0x42a0c304-0x3fc00000} ?
adc r11, r12, #0x3fc00000

mov r12, #{0xbdf0dbf4} ?

0xe9cad800
  • Thumb intermediate writer source code:
.text

.thumb

.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000000

// we should have offset 16 here, so PC is 16+4=20, +68=88
add r3, r15, #68

strh r3, [r4, #0x3e]

// we should have offset 20 here, so PC is 20+4=24, +136=160
add r0, r15, #136

// points behind last 0xff terminator
add r4, r15, #264

1:
	// load the next byte from src[src_count]
	ldrb r1, [r0]
	add r0, #1
	// check for terminator
	cmp r1, #0xd0
	bgt 2f

	// subtract 0xbb
	sub r1, #0xbb
	// add the value to the accumulator
	lsl r2, r2, #4
	add r2, r2, r1

	// usually skip the store, unless we jumped here from 0xFF
	b 3f
	2:
		stmia r3!, {r2}
	3:

	cmp r0, r4
	blt 1b

// Immediately return to the main callback, not even to AnimateSprites
pop {r4-r7,pc}
  • Thumb base64 writer source code:
.text

.thumb

// r0 - src
// r1 - src_counter
// r2 - tmp
// r3 - dst
// r4 - accumulator
// r6 - bit_counter

.4byte 0x00000000
.4byte 0x00000000

push {r4-r7,lr}

// We should have offset 8 here, so PC is 8+4=12, +148=160
add r0, pc, #148

// Prepare NormalExit
strh r0, [r4, #62]

// We should have offset 12 here, so PC is 12+4=16, +48=64
add r7, pc, #48

// Check for crafting table
lsr r2, r3, #26

// Zero these registers, r7 = r7+16 = offset 80
ldmia r7!, {r1, r4, r5, r6}

// Otherwise write after itself
bcs 2f
	mov r3, r7
2:
	// load the next byte from src[src_count]
	ldrb r2, [r0, r1]
	add r1, #1
	// check for terminator
	cmp r2, #0xff
	beq 4f
	// subtract 0xbb
	sub r2, #0xbb
	// skip the adjustment if the char is in the letter range
	bpl 3f
		// if not, it is interpreted as a number/symbol
		add r2, #0x4e
	3:
	// add the value to the accumulator
	lsl r4, r4, #6
	add r4, r2

	// check whether it should be written (whenever there is more than 8 bits to write)
	add r6, #6
	cmp r6, #8
	blt 4f
		sub r6, #8
		mov r2, r4
		// extract the highest 8 bits (so shift right by bits_counter - 8)
		lsr r2, r6
		strb r2, [r3]
		add r3, #1
	4:

	cmp r1, #120
	blt 2b

pop {r4-r7,pc}
  • Thumb hex writer source code:
.text

.thumb

// r0 - src
// r1 - src_counter
// r2 - tmp
// r3 - dst
// r4 - accumulator
// r6 - bit_counter

//.4byte 0x00000000
//.4byte 0x00000000

push {r4-r7,lr}

// We should have offset 8 here, so PC is 8+4=12, +148=160
add r0, pc, #148

// Prepare NormalExit
strh r0, [r4, #62]

// We should have offset 12 here, so PC is 12+4=16, +52=68
add r7, pc, #52

// Check for crafting table
lsr r2, r3, #26

// Zero these registers, r4 = r4+12 = offset 80
ldmia r7!, {r1, r5, r6}

// Otherwise write after itself
bcs 2f
	mov r3, r7
2:
	// nop so the last branch does not contain a 0xef :/
	nop
	// load the next byte from src[src_count]
	ldrb r2, [r0, r1]
	add r1, #1
	// check for terminator
	cmp r2, #0xc0
	bgt 4f
	// subtract 0xb1
	sub r2, #0xb1
	// skip the adjustment if the char is in the letter range
	bpl 3f
		// if not, it is interpreted as a number
		add r2, #0x10
	3:
	// add the value to the accumulator
	lsl r4, r4, #4
	add r4, r2

	// check whether it should be written (whenever there is more than 8 bits to write)
	add r6, #1
	lsr r2, r6, #1
	bcs 4f
		strb r4, [r3]
		add r3, #1
	4:

	cmp r1, #126
	blt 2b

pop {r4-r7,pc}
  • Crafty source code:
.text

// r0 - counter
// r1 - size
// r3 - address

.thumb

// offset 0+4 = 4, +76=80
add r3, pc, #76
ldr r1, size
add r2, r1, r3
b 1f

.byte 0xbd,0xcc,0xbb,0xc0,0xce,0xd3,0xff,0xff,0xff,0xff
.2byte 0x0202
.byte 0xbb,0xbd,0xbf,0xff,0xff,0xff,0xff
.byte 0x00
.2byte 0x0000,0x0000

.2byte 0x0000,0x0000

1:
	ldmia r3!, {r1}
	cmp r1, #0
	beq end
	cmp r3, r2
	bge end
b 1b

end:
	sub r3, #4
	mov pc, r3

size: .4byte 0x00000960

Creating a Thumb writer on Japanese

Creating a Thumb writer on Japanese doesn't need any intermediate writer, you can just instantly create any Thumb writer in just one code with 12 box names.

  • base64:
Box  1:    の べ ル で き 1 _ み    [のべルでき1 み] ← Hiragana "be"/べ, so from the second page (same as the "no"/の)
Box  2:    c て シ さ エ _ l      [cてシさエ l] ← first character is a small C, last character is a small L
Box  3:    あ ぃ づ き あ W あ ぇ    [あぃづきあWあぇ] ← second character is small, last character is small
Box  4:    c ぎ り む i ミ び      [cぎりむiミび] ← first character is a small C, third character looks like リ ingame, but is from the second page (Hiragana), same as the character before
Box  5:    ‥ ♂ ゆ ッ l ガ す 6    [‥♂ゆッlガす6] ← fourth character is small, followed by a small L, last character is a six
Box  6:    ボ せ ぇ U _ X ご ふ    [ボせぇU Xごふ] ← third character is small
Box  7:    ぢ シ あ ぅ z れ し h    [ぢシあぅzれしh] ← fourth character is small
Box  8:    A げ _ a ぺ ぇ 3 あ    [Aげ aぺぇ3あ] ← sixth character is small
Box  9:    3 ね か ゅ く を え g    [3ねかゅくをえg] ← fourth character is small, seventh character is big
Box 10:    く じ め ふ v ぞ は ミ    [くじめふvぞはミ]
Box 11:    あ ぉ リ る x g ‥ C    [あぉリるxg‥C] ← second character is small
Box 12:    あ W s s s H ワ      [あWsssHワ]
Box 13-14: anything, doesn't matter
  • hex:
Box  1:	の べ ル で き 1 _ み	[のべルでき1 み]
Box  2:	c て シ さ エ _ l  	[cてシさエ l]
Box  3:	あ ぃ づ き あ W あ ぇ	[あぃづきあWあぇ]
Box  4:	c ぎ り む i ミ び  	[cぎりむiミび]
Box  5:	‥ ♂ ゆ ッ l ガ す 6	[‥♂ゆッlガす6]
Box  6:	ボ せ ぇ U _ X ご ふ	[ボせぇU Xごふ]
Box  7:	_ _ ぢ シ あ ぅ F れ	[  ぢシあぅFれ]
Box  8:	け h 『 げ _ a た ぇ	[けh『げ aたぇ]
Box  9:	や あ 3 ね あ ゅ ハ く	[やあ3ねあゅハく]
Box 10:	あ X ふ ミ あ ぉ ン る	[あXふミあぉンる]
Box 11:	z g ‥ C        	[zg‥C]
Box 12:	ア W s s s H ワ  	[アWsssHワ]
Box 13-14: anything, doesn't matter
  • base16:
Box  1:    の べ ル で き 1 _ み    [のべルでき1 み]
Box  2:    c て シ さ エ _ l      [cてシさエ l] ← last char is lower "L"
Box  3:    あ ぃ づ き あ W あ ぇ    [あぃづきあWあぇ] ← 2nd and last char are small
Box  4:    c ぎ り む i ミ び      [cぎりむiミび]
Box  5:    ‥ ♂ ゆ ッ l ガ す 6     [‥♂ゆッlガす6] ← 4th char is small, 5th is lower "L", last is a six (6)
Box  6:    ボ せ ぇ U _ X ご ふ    [ボせぇU Xごふ] ← 3rd char is small
Box  7:    ぢ シ あ ぅ P れ き h    [ぢシあぅPれきh] ← 4th char is small
Box  8:    A げ や あ 3 ね あ ゅ    [Aげやあ3ねあゅ] ← 5th char is a three (3), last char is small
Box  9:    ハ く あ X ふ ミ あ ぉ    [ハくあXふミあぉ] ← last char is small
Box 10:    ン る あ g ‥ C        [ンるあg‥C]
Box 11:    z s                [zs]
Box 12:    あ W s s s H ワ      [あWsssHワ]
Box 13-14: anything, doesn't matter

Creating a full code bootstrap

This code generates a very special Abra in Box 14 Slot 29 (so keep that empty before executing the code!) that allows you to use all 14 boxes for ACE codes (except for the very last character of the Box 14 name).
To do this, it uses a special wallpaper called "Friends", that you can obtain from Rustboro City, just north of the Pokecenter. There you need to go upstairs and talk to Walda's dad. You need to tell him a special code word that depends on your TID, there are generators that can give you this code word, for example here. Currently there are sadly not any codes that actually use this last additional instruction, but one useful application of it is for BIOSless users on emulator, as it allows you to execute the other long codes that normally require the Box 14 exit, which doesn't work without a BIOS.\

  • Box names for console/new emulators (mGBA):
Box  1: 4 … U n q 3 . o	[4…Unq3.o]
Box  2: G . o , G Q m	[G.o,GQm]
Box  3: A A B G Q m	[AABGQm]
Box  4: A K N 9 n	[AKN9n]
Box  5: V R ? n T R ! s	[VR?nTR!s]
Box  6: F m o G U ? n	[FmoGU?n]
Box  7: A A / F Q m	[AA/FQm]
Box  8: A ♀ I . o	[A♀I.o]
Box  9: U L ? n D O ? n	[UL?nDO?n]
Box 10: A A A T R ! s	[AAATR!s]
Box 11: A A I I . o	[AAII.o]
Box 12: A x U ? n	[AxU?n]
Box 13: 3 G ? n s T ! s	[3G?nsT!s]
Box 14: 2 c o D Y J m x	[2coDYJmx]

Box 1 Wallpaper: "Polkadot" (4th menu, 1st entry)
Box 2 Wallpaper: "Forest" (1st menu, 1st entry)
  • Box names for old emulators (for example MyBoy, VBA):
Box  1: 2 … U n q 3 . o	[2…Unq3.o]
Box  2: G . o , G Q m	[G.o,GQm]
Box  3: A A B G Q m	[AABGQm]
Box  4: A K N 9 n	[AKN9n]
Box  5: V R ? n T R ! s	[VR?nTR!s]
Box  6: F m o G U ? n	[FmoGU?n]
Box  7: A A / F Q m	[AA/FQm]
Box  8: A p J . o	[ApJ.o]
Box  9: z N ? n L O ? n	[zN?nLO?n]
Box 10: A A A T R ! s	[AAATR!s]
Box 11: A A I I . o	[AAII.o]
Box 12: A x U ? n	[AxU?n]
Box 13: 3 G ? n s T ! s	[3G?nsT!s]
Box 14: 2 c o D Y J m x	[2coDYJmx]

Box 1 Wallpaper: "Polkadot" (4th menu, 1st entry)
Box 2 Wallpaper: "Forest" (1st menu, 1st entry)

Now that you have the Abra, put him somewhere in Boxes 12-14 (I prefer Box 14 Slot 25) and set the wallpapers as follows:

Box 1 Wallpaper: "Beach" (3rd menu, 1st entry)
Box 2 Wallpaper: "Friends" (5th entry)

Now you can execute any full code, by just setting the last letter of Box 14 to "t" (lower "T"). You can also just use it as a substitute for the regular Box 14 exit code, by just filling the first 7 characters with spaces or "A" or "E", whichever you prefer:

Box 14: _ _ _ _ _ _ _ t  [       t]
or
Box 14: A A A A A A A t  [AAAAAAAt]
or
Box 14: E E E E E E E t  [EEEEEEEt]
  • Source code:
@@ title = "Full code bootstrap (Emerald)"
@@ author = "Mettrich"
@@ exit = null
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff

; Requirements:
; - any stable ACE species
; - no BIOS emulation needed
; - Box 1 wallpaper: "Polkadot"
; - Box 2 wallpaper: "Forest"
; - Box 14 Slot 29 (second to last) should be empty, this is where the Abra will be generated
;
; Effects:
; - a shiny Abra with the name " FKqÁ  q" will be generated
; - this shiny Abra serves as a bootstrap for full codes with a wallpaper exit
; - when put into any of the executed boxes (12-14, I prefer Box 14 Slot 25), it prepares register 8 so you can do the whole exit code in the last character of Box 14 (you can use the rest) and the wallpapers
; - to exit with this bootstrap, set your last character in Box 14 to "t" like this:
;   Box 14: *******t (where * are part of your actual code, or fill with spaces) and set the wallpapers as follows:
; - Box 1 wallpaper: "Beach"
; - Box 2 wallpaper: "Friends" (given by Walda's dad in Rustboro City)
; and that's it! Box names 1-14 can all be used for your code.

old_emu=0

@@

sbc r11, r15, #{old_emu?0xa3:0xa5}

; mov r12, #0xe5c5d000 ?
MOV r10, #0xe5000000
; <
mov r12, #0xc000003f
strh r12, [r11, #24]
strh r12, [r11, #28]
; >
ADC r12, r10, #0xc50000
ADC r12, r12, #0xd000
str r12, [r11, r14, asr #25]!

mvn r12, #0xff
adc r12, r12, #0x304
strh r12, [r11, #10]

mov r12, #{old_emu?0xe51f8000:0xe51f8002} ?
str r12, [r11, r14, asr #25]!

; mov r12, #{0x0c0003dc} ?
MOV r12, #0xc000003
ADC r12, r12, #0x3b0
ADC r12, r12, #0x29
str r12, [r11, r7, ror #29]!

bics r10, r7, #0xfc000003
strh r13, [r4, 0x3e]
andeq r15, r12, r12, ror #31

; andne r15, r8, r8, ror #31

Function call codes

These codes call functions from the game itself to do some pretty cool stuff.
Currently these require accurate BIOS emulation, but I'm working on maybe making another bootstrap for BIOSless users sometime.

Change any data of any Pokemon

This code is meant to be used with the E-Sh4rk generator. Just copy the whole source code and replace the existing code in the generator with it, change the variable "old_emu" to 1 if you're using an old emulator (non-mGBA), change the variable "field" to the desired property of the Pokemon to change, and change the variable "data" to the data you want to set it to, then click on "Generate". A table on what field has what value is given below. Sadly not all fields are able to be used with this code, it will show "Tweaking failed" or something if that's the case.

  • English source code:
@@ title = "Change any data of any Pokémon"
@@ author = "Mettrich"
@@ exit = null
@@ filler0 = 0xbbbbbbbb
@@ filler1 = 0xbbbbbbff
@@ filler2 = 0xbbbbffff
@@ filler3 = 0xbbffffff
@@ filler4 = 0xffffffff
@@ fill = false

; Requirements:
; - Any Stable ACE species
; - Box 1 wallpaper: "Sky" (3rd menu, 4th entry)
; - Box 2 wallpaper: "Desert" (1st menu, 3rd entry)
; - Accurate BIOS emulation
;
; Effects:
; - Changes the field specified by "field" of your first Pokémon in your party to "data"

old_emu = 0
field = 66 ; field "IVs"
data = 0x3fffffff ; value for perfect IVs

@@

adcs r11, r15, #{old_emu?0xc0:0xbe}
0xe8cb00ee

bics r12, r15, #0x3fc
sbc r12, r12, #0xd400
adc r0, r12, #{old_emu?0xed:0xeb}

mov r10, #{field} ?2
0xe8cbcc00 ; store the field and data pointer

mov r12, #{data} ?
0xe8db00ee ; load field and data pointer

mov r10, #0x3fc00
str r12, [r11, r14, asr #29]! ; store the actual data

strh r13, [r4, #0x3e]
adc r12, r10, #{0x0806acad-0x3fc00} ? ; setmondata

bics r11, r7, #0xff
adc r11, r14, #0x388
andeq r15, r11, #0x36c
  • Field value table: 0:MON_DATA_PERSONALITY
    1:MON_DATA_OT_ID

    2:MON_DATA_NICKNAME
    3:MON_DATA_LANGUAGE
    4:MON_DATA_SANITY_IS_BAD_EGG
    5:MON_DATA_SANITY_HAS_SPECIES
    6:MON_DATA_SANITY_IS_EGG
    7:MON_DATA_OT_NAME
    8:MON_DATA_MARKINGS
    9:MON_DATA_CHECKSUM
    10:MON_DATA_ENCRYPT_SEPARATOR
    11:MON_DATA_SPECIES
    12:MON_DATA_HELD_ITEM
    13:MON_DATA_MOVE1
    14:MON_DATA_MOVE2
    15:MON_DATA_MOVE3
    16:MON_DATA_MOVE4
    17:MON_DATA_PP1
    18:MON_DATA_PP2
    19:MON_DATA_PP3
    20:MON_DATA_PP4

    21:MON_DATA_PP_BONUSES
    22:MON_DATA_COOL
    23:MON_DATA_BEAUTY
    24:MON_DATA_CUTE
    25:MON_DATA_EXP
    26:MON_DATA_HP_EV
    27:MON_DATA_ATK_EV
    28:MON_DATA_DEF_EV
    29:MON_DATA_SPEED_EV
    30:MON_DATA_SPATK_EV
    31:MON_DATA_SPDEF_EV

    32:MON_DATA_FRIENDSHIP
    33:MON_DATA_SMART
    34:MON_DATA_POKERUS
    35:MON_DATA_MET_LOCATION
    36:MON_DATA_MET_LEVEL
    37:MON_DATA_MET_GAME
    38:MON_DATA_POKEBALL
    39:MON_DATA_HP_IV
    40:MON_DATA_ATK_IV
    41:MON_DATA_DEF_IV
    42:MON_DATA_SPEED_IV
    43:MON_DATA_SPATK_IV
    44:MON_DATA_SPDEF_IV

    45:MON_DATA_IS_EGG
    46:MON_DATA_ABILITY_NUM
    47:MON_DATA_TOUGH
    48:MON_DATA_SHEEN
    49:MON_DATA_OT_GENDER
    50:MON_DATA_COOL_RIBBON
    51:MON_DATA_BEAUTY_RIBBON
    52:MON_DATA_CUTE_RIBBON
    53:MON_DATA_SMART_RIBBON
    54:MON_DATA_TOUGH_RIBBON
    55:MON_DATA_STATUS
    56:MON_DATA_LEVEL
    57:MON_DATA_HP
    58:MON_DATA_MAX_HP
    59:MON_DATA_ATK
    60:MON_DATA_DEF
    61:MON_DATA_SPEED
    62:MON_DATA_SPATK
    63:MON_DATA_SPDEF
    64:MON_DATA_MAIL
    65:MON_DATA_SPECIES_OR_EGG
    66:MON_DATA_IVS
    67:MON_DATA_CHAMPION_RIBBON
    68:MON_DATA_WINNING_RIBBON
    69:MON_DATA_VICTORY_RIBBON
    70:MON_DATA_ARTIST_RIBBON
    71:MON_DATA_EFFORT_RIBBON
    72:MON_DATA_MARINE_RIBBON
    73:MON_DATA_LAND_RIBBON
    74:MON_DATA_SKY_RIBBON
    75:MON_DATA_COUNTRY_RIBBON
    76:MON_DATA_NATIONAL_RIBBON
    77:MON_DATA_EARTH_RIBBON
    78:MON_DATA_WORLD_RIBBON
    79:MON_DATA_UNUSED_RIBBONS
    80:MON_DATA_MODERN_FATEFUL_ENCOUNTER
    81:MON_DATA_KNOWN_MOVES
    82:MON_DATA_RIBBON_COUNT
    83:MON_DATA_RIBBONS
    84:MON_DATA_ATK2
    85:MON_DATA_DEF2
    86:MON_DATA_SPEED2
    87:MON_DATA_SPATK2
    88:MON_DATA_SPDEF2\

How to create an ACE code

This is still very much a Work-in-progress and not nearly complete.

Introduction

This is supposed to be a guide to creating new ACE codes with the E-Sh4rk generator, mostly meant for Pokémon Emerald (since that's what I know best), but pretty much everything here should apply to Pokémon Firered/Leafgreen the same, and it'll be obvious when it doesn't apply. Now, how do ACE codes roughly work? Well, if you trigger ACE you actually just instruct the CPU of the GameBoy Advancs to execute the Pokémon (if there are any) from Box 11 Slot 28 to the end of the Boxes, and then the Box names. So ultimately, the CPU interpretes the Box names as CPU instructions and executes them. Thus, we have to write our ACE codes in the right CPU instructions, in our case ARMv4T machine language, or rather assembly language. Luckily, E-Sh4rk's generator does a lot of the heavy lifting already (converting our assembly to machine code and translating that to Box names), so you don't need to learn the binary encoding of all the CPU instructions (though it can help fit more instructions into a code sometimes).

Instructions

An ACE code ultimately is just a sequence of CPU instructions (in total, 18 freely choosable instructions per code). Here is a list of all instructions we can use:

  • adc: "add with carry", so usually just a normal addition
  • sbc: "subtract with carry", so usually a subtraction that subtracts one more
  • mov: "move", moves an immediate (or a shifted register) into a register
  • mvn: "move negated", moves the bitwise negation of an immediate (or shifted register) into a register. the bitwise negation is like the arithmetic negation (so +3 → -3) minus one
  • strh: "store halfword", stores the lower 16 bits of a register in memory, at an address of another register + an offset of 0-255, potentially adds the offset to the register afterwards (! means writeback)
  • ldrh: "load halfword", loads a 16 bit value from memory to a register, basically the opposite of strh. can't write back the address + the offset into the address register afterwards.
  • str: "store word"
  • ldr: "load word"
  • bic: "bit clear"
  • strb: "store byte"
  • ldrb: "load byte"
  • (stmia/stmib): "store multiple", stores multiple registers to a memory address. hard to use, but powerful if used right
  • (ldmia/ldmib): "load multiple", loads multiple values from a memory address to multiple registers. hard to use, but powerful if used right
  • (rsc): a "reverse subtract with carry", very niche
  • (b/bl): a "branch" instruction (basically jumps to other instructions), usually jumps too far or not far enough to be useful though

Registers

Immediates

.text
add r1, r15, #1
bx r1
.thumb
// r0 - src
// r1 - src_count
// r2 - tmp
// r3 - accumulator
// r6 - bit_count
// r7 - dst
.2byte 0x0000
.2byte 0x0000
push {r4-r7,lr}
// We should have offset 12 here, so PC is 12+4=16, +48=64
add r7, pc, #48
// We should have offset 16 here, so PC is 16+4=20
add r0, pc, #140
// Zero these registers, r7 = r7+16 = offset 80
ldmia r7!, {r1, r3, r5, r6}
2:
// load the next byte from src[src_count]
ldrb r2, [r0, r1]
add r1, #1
// check for terminator
cmp r2, #0xff
beq 4f
// subtract 0xbb
sub r2, #0xbb
// skip the adjustment if the char is in the letter range
bpl 3f
// if not, it is interpreted as a number/symbol
add r2, #0x4e
3:
// add the value to the accumulator
lsl r3, r3, #6
add r3, r2
// check whether it should be written (whenever there is more than 8 bits to write)
add r6, #6
cmp r6, #8
blt 4f
sub r6, #8
mov r2, r3
// extract the highest 8 bits (so shift right by bits_counter - 8)
lsr r2, r6
strb r2, [r7]
add r7, #1
4:
cmp r1, #120
blt 2b
strh r6, [r4, #62] // for Grab ACE replace this with mov r0, #0
pop {r4-r7,pc}

Techniques I discovered / invented / want to document

NormalExit and derivatives

When it comes to the actual technicalities of animation ACE in Pokémon Emerald (so unstable and stable ACE species), the actual context of our ACE codes is that they get called from a function called "AnimateSprites" (technically from a helper to call functions via registers, but those aren't real functions), and the return address of the code segment (our ACE code) is 0x080069e7 in all Latin/Western versions of the game.
If you are not familiar with programming: If you call a function in a program, you usually expect that function to do something and then "return", so jump back to the place where the function was called, so the program can continue (very rough generalisation). On CPUs that implement pretty much any ARM architecture (the ARM7TDMI of the GBA included, implementing ARMv4T), this place to jump back to is stored in a CPU register, specifically register 14 (r14/lr), also sometimes called the "link register", since it kind of links back to the code that called the function. So, we can assume that r14 has the value 0x080069e7 during ACE codes, and we may not overwrite it, otherwise the game will crash or hang. Technically, the glitch animations don't directly call the box names either, they rather cause the CPU to jump to (or rather call) address 0x0206fefe (in the case of ARM species like 0x0611, 0x410e, 0x4130, etc.) or 0x0206ffff (in the case of Thumb species like 0x40e9, 0x40ed). This address is not the one of the box names but rather of Pokémon inside the PC box system (0x0206fefe -> Box 11 Slot 28-30, 0x0206ffff -> Box 12 Slot 1-3). That means, that all Pokémon from those box slots onwards are actually interpreted as code when you execute an ACE code, which us why you shouldn't have any Pokémon there that weren't explicitly made to be placed there. Empty Pokémon slots luckily don't do anything when interpreted as code. But back to the function call: The ACE code is called as a function, so the natural way of exiting the code would be to just call a return instruction, which for ARMv4T is usually a BX r14 instruction (Branch and eXchange to r14, basically jump back to the code that called this function). Because the function that called our code (AnimateSprites) is written in "Thumb" instructions (basically instructions to save space, but that can do less), it is actually required to exit with a BX, since regular ACE codes in Latin/Western versions basically have to be written in non-Thumb ARM instructions to do anything useful, and the CPU needs to be signalled that it should "eXchange" modes of execution from "ARM" to "Thumb". Now, this instruction isn't even typable in Latin fonts, in fact no BX to any register is typable. So can you just not exit these ACE codes and are doomed to crash the game?
Well no, there are actually a few ways to go around this:

  1. You can use self-modifying codes to basically use multiple instructions to create the code for the return instruction and then write that into itself to execute that instruction. If this idea sounds crazy to you, that's because it kind of is. Self-modifying code is terrible style if you wanna program anything reasonably big, but for our purposes of ACE codes, they are not that bad, because the whole ACE code only has about 18 freely writable instructions, which is nearly nothing. Plus, it's better than crashing, right? Well yes, but this doesn't actually fully work with many species. Even when a species is considered "stable", that usually doesn't mean that the sprite/animation of the glitch species is fully stable, just that they are stable enough to trigger ACE and then somehow escape, since letting the animation continue would crash the game (after all, these animations are just some other data inside the game being interpreted as an animation). Now I kind of teased you with the solution already: It's to somehow escape from the animation to not have it crash! There are multiple ways to accomplish this; personally I'd say NormalExit (my discovery) is the best compromise. Sadly I don't know which escape methods were discovered first, but here is a short list:
    1. Pressing "B" at the right time to exit the summary screen of a stable ACE (sometimes called "RecusiveExit", even though it has nothing to do with recursion)
    2. Jumping into an escape function that somehow closes the summary/egg hatch screen to interrupt the animation (usually "WhiteOut" or "Certificate", see below for newer escape functions)
    3. Disabling the glitch animation to interrupt it (this is the idea of NormalExit)

The first has the disadvantage that you have to time it well and that you can actually not control how often the ACE code is executed, usually at least a few times before you can exit the summary screen. Also, I'm not sure whether it works with all languages/species, since the animation delays differ a lot.
The second is what pretty much all of sleipnir17's, merrp's and E-Sh4rk's codes use, and it has the advantage of working with both stable ACE and the unstable ACE egg, sadly it also has the disadvantage of using quite a bit of space. Just calculating the address of WhiteOut or Certificate takes 4 instructions (reminder: we have about 18 total), and then you still need to somehow execute the untypable return instruction (BX r0 in this case, since we jump to a different function that returns for us), which can easily take another 4-5 instructions with self-modifying code. E-Sh4rk improved this method quite a bit with the "CertificateShort" and "WhiteOutShort" codes, which just need to calculate the address of the escape function, while the untypable "BX r0" instruction stays there in Box 14. But, since these require that exact untypable box name for box 14, it takes some (minimal) setup, but is very incompatible with most of sleipnir17's codes, since these use a different location for the "BX r0" and need to write into box 14. There is also a "bootstrap", a Pokémon that you can create in two 14 box name codes (or one 14 box name code with some of my old adaptations), which basically calculates the address of the escape function and stores it in register 0 (r0) so you can even cut off that part from the exit code, thus just needing an untypable "BX r0" in Box 14, but this bootstrap also disallows you from overwriting r0 in the code, otherwise it won't work.
Now, third and most recent in the list is NormalExit, which takes an approach more similar to "RecursiveExit", as in just normally returning to AnimateSprites. However, instead of hoping that we mash fast enough to cancel the animation, we let the code itself disable the animation. The easiest way I found to do this is to set sprite->inUse to false, which is a boolean value (so can just be true or false) which is stored as bit 0 of the byte at offset #62 (#0x3e) of the sprite structure.
The pointer to our own current sprite is contained in register 4 (r4) by default, so you can store any number with bit 0 set to 0 to that byte to set sprite->inUse to false and thus stop the animation from advancing further. Another pointer directly pointing to the byte of sprite->inUse is stored in register 5 (r5).
The bit 0 of the byte being set to 0 basically just means that the number we store there needs to be even, and there is one register for which it is basically guaranteed that it should be even; The Stack Pointer (r13). So, a simple instruction like this can implememt NormalExit:

strh r13, [r4, #0x3e]

or

strh r13, [r5, #0]

or

strb r13, [r5]

The first instruction is the first that was found and in my opinion the easiest to type (DYJm).

BIOSless regular return

Now, even though NormalExit makes the preparation for returning way shorter (1 instruction vs. 4), it doesn't yet solve the problem of not being able to type a return instruction (BX r14/r0). The regular way of using self-modifying code can go down to 5-6 instructions (5 full instructions + 1 filler instruction), for example in E-Sh4rk's "CertificateFull" and "WhiteOutFull" codes. However, this can be shortened as well. The ARM "BX r14/r0" instruction may not be typable, but it is a very common instruction, so there are many instances of that instruction in the memory space, and if we get the CPU to jump exactly onto one of these instructions (or slightly before in some cases), it's the same as executing the instruction ourselves. Namely, there is an easily accessible BX r14 inside the BIOS at 0x0354 and a BX r0 at 0x0324, a jump to both of these can be performed pretty easily with a MOV instruction that just sets register 15 (r15/pc) to that value, resulting in a jump to there. You can't just jump anywhere, so apart from these two addresses you can't do too much with a MOV like this. I don't exactly know who discovered this trick, I think it might have been sleipnir17 for some codes for Pokémon Firered/Leafgreen, but I might be wrong. Obviously though, you need a BIOS for this, which isn't a problem on actual hardware, you always have the original BIOS there, but there are some emulators who don't support accurate BIOS emulation well, especially on Android (Lemuroid, MyBoy), which is a downside if you want everyone to be able to use your codes. Another downside with this is that this MOV instruction needs to be placed at a specific position, which is only possible in boxes 10-11, 6-7 and 2-3. It's almost possible in box 14, but you'd need to write two characters into box 15, which doesn't exist. Directly after the box names of box 14 come the box wallpapers though, which are also user modifiable, but not with the same range (0x00-0x0f/0x10 with 0x10 being unlocked by Walda's dad in Rustboro city), so you can't complete a MOV or any other arithmetic instruction, apart from AND. Anyway, my discovery was a way to jump to different BX r14/r0 instructions, that aren't inside the BIOS, but inside the game ROM itself. There is a BX r14 at 0x08000398 and a BX r0 at 0x08000370, and I found an easy way to jump there that combines nicely with NormalExit; It uses the value of r14 (0x080069e7) and does a BIC (bit clear) operation on it with the value 0xff00, which conveniently uses a 0xFF filler, and results in 0x080000e7. Then, instead of using a MOV and jumping to a given address, this exit code adds 0x2b0 (for BX r14) / 0x28c (for BX r0) to the previous result and jumps there, which ends up at the aforementioned addresses of BX r14/r0 inside the ROM. These addresses are also the same on all languages. This type of exit code can also be placed inside boxes 2-3, 6-7 and 10-11, and keeps one instruction in an awkward position free, which integrates nicely with NormalExit, which needs exactly one instruction to disable the animation.

MVNS to use an unused 0xFF filler

STR r15 to use an unused 0xFF filler

Teleport escape function

ReturnFromBattleToOverworld escape function

@Monvee-bot
Copy link

Awesome work, unfortunately playing on a German Game and cant use the IV and Shiny Code :(

@lateus
Copy link

lateus commented Oct 14, 2025

Please restore the comment to line 1332 (name of the box 1 for shinies). For Analogue Pocket (openFPGA), the code only works with "p" instead of "h". I had to go through the diff because I knew it has worked before just didn't remember how.

Box 1: 5 . U n h 0 9 n [5.Unh09n] ← zero, for old emulators, replace "h" with "p"

Edit: And thank you for adding support for all those languages!

@satyrsaw
Copy link

Great work! I have a question, tho. I have a playthrough that when ii got to 3rd gym, I activated the mystery gift in the poke mart (LINK TOGETHER WITH ALL). Now after beating the E4 and doing the procedure for ACE I tried to get the mystery gifts where u have to speak with the man in the Pokémon center. But he will not give any MG, I triple checked if it codes were right. Is there a chance that activating mystery gift changes the required code?

@HylianTrainer
Copy link

HylianTrainer commented Nov 16, 2025

This is amazing stuff, thank you! Any chance that the Japanese codes for “Make any Pokémon Shiny” will at some point be deciphered?

I have a Japanese copy of Emerald and there are some Pokemon that I would love to have in Gen 3 and Gen 4 as shinies, but I see that it is one of the only languages that doesn’t have the source codes for the box names. I know it’s probably a lot of hard work, but I’m hoping that at some point these will be available! Or if there is a tool that could determine the box names, that would be equally great.

@Destri321
Copy link

Would love to have codes for Japanese copies as well!

@deandreparra123-art
Copy link

Hi, so i just setup my stable ace did work all good and all but i think i overused it and i cannot redo glitchs cause as sooj i open the summary to trigger another glitch the game just crash and i cant use another glitch, i was putting all my pokemon shinys and yeah i couldnt get more, i tried to change the glktch to make another statter and the outcome is the same.
Can somebody help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment