Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TrainerDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi Egg trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Rival LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitches
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
Glitch Pokémon cries
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Technical
Site Source Code

Search Wiki

 

Search Forums

 

Author Topic: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!  (Read 458 times)

0 Members and 1 Guest are viewing this topic.

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
UPDATE: Many extra thanks to Couldntthinkofaname, spamviech and Evie for reviewing and contributing to this guide

Hello there! Welcome to the world of Pokémon ACE!

Lately, with the release of Gold and Silver in 3DS's Virtual Console, there has been a lot of people asking questions about Arbitrary Code Execution (mainly Coin Case), and with this came a lot of new ideas to use it as well as to perform it. Very talented people (luckytyphlosion, gifvex, Crystal_, ISSOtm to mention some...) have restarted working on it especially for non-english adaptation, and all of this resulted in the information being spread in a lot of different threads, videos, talks on Discord, etc.

I felt like it was the time for a collaborative guide that gathers all of the current knowledge on
- What are the different ways to make ACE in my language
- What can I do with ACE
- On the long term, an introduction to opcodes and how to make codes that go beyond basic memory editing (if you want to write this part, please don't hesitate)
In forms of summaries but also by giving the links to the different threads and videos about it.

Please don't hesitate to contribute to this guide, as I don't know everything about it, especially regarding english games!

TABLE OF CONTENT:
I. WHAT ARE THE DIFFERENT ACE TECHNIQUES IN G/S/C
II. COIN CASE VS. WRONG POCKET TM ACE
III. WRONG POCKET TM ACE EXPLAINED
   III.1: Obtain a Glitch Pokémon n°000
   III.2: Use the Glitch Pokémon n°000 to get Mystery Eggs
   III.3: Use Mystery Eggs to get TM17
   III.4: Prepare the Party setup
IV. WRITE AND EXECUTE A CODE, REGARDLESS OF THE METHOD
   IV.1: GET TM17 IN THE WRONG POCKET (Box)
   IV.2: GET ANY TM/HM x255 CODE (Box)
   IV.3: INCREASE/DECREASE THE QUANTITY OF AN ITEM CODE (Items)
   IV.4: GET ANY ITEM CODE (Items)
   IV.5: MEMORY EDITOR CODE, A.K.A. GAMESHARK SIMULATOR (Items or Box)
   IV.6: CHANGING ID CODE (Items)
   IV.7: MAKE THE SIXTH POKEMON IN PARTY SHINY CODE (Items)
   IV.8: GOTTA CATCH 'EM ALL CODE (Box)
   IV.9: MORE AND COMPETITIVE CODES (Box)
   IV.10: A WORD ON HOW TO WRITE COMPLEX CODES
ANNEX 1: GET TM ACE SETUP THROUGH A FIRST-GENERATION GAME
   ANNEX 1.1: Gather the needed items
   ANNEX 1.2: Create custom jump Pokémon
   ANNEX 1.3: Use Mystery Eggs to get TM25
ANNEX 2: GET ACCESS TO PC ITEMS THROUGH THE BAG
   ANNEX 2.1: Obtain a Glitch Pokémon n°000
   ANNEX 2.2: Use the Glitch Pokémon n°000 to get Machine Part and SecretPotion
   ANNEX 2.3: Trigger the Expanded Balls Pocket
GENERAL CONCLUSION
   
I. WHAT ARE THE DIFFERENT ACE TECHNIQUES IN G/S/C

Much like in first generation games, arbitrary code execution is about to give you the power to modify the RAM in order to make the game do pretty much everything you want, but also, if you feel like it, change the maps, create scripts, and even program another game inside your game.

A well-known method to perform ACE in G/S is the Coin Case Glitch. This very simple glitch is due a mistake done by the english localization team, who forgot in just one occasion to change the end-of-string terminator that was used in japanese games for the actual terminator of english and european games. This mistake is not a part of the original game, and that's why unfortunately, because the localization team of every other country was more rigorous, this glitch cannot be performed in all other languages. Lame.

So what are the other options to perform ACE, being either in english games or non-english european games? Well, there is, at least, 4 other ACE methods:

- ACE can be theorically be achieved using Glitch Pokédex Mode. I dont think this has been researched a lot so far, because it seems to be really hard to do during legit gameplay, and any method that could give access to a suitable Glitch Pokédex Mode wouldn't be much worth it compared to other ACE methods. We're not gonna mention it anymore, but don't hesitate to look into it, though!
* You'll find some informations about Glitch Pokédex modes following this link.

- There is also the Bad Clone ACE which used the properties of a Bad Clone to execute code from box names, much like Coin Case. However, this method uses code from the Mobile GB Adapter and therefore, is a Crystal-only glitch! In view to the release of VC's G/S, it was left aside to work on a method that would be compatible with Gold and Silver, and thus, we're not gonna mention it anymore.
* This method was first documented last year by the speedrunner Werster (although nobody seems to know where it comes from) and described in this thread by Torchickens and luckytyphlosion.
* Crystal_ also made this video showing how to use it in legit gameplay.

- Move 0x00 ACE (also known as 'Move 00 Type ACE' or 'Type 0xD0 move glitch') is another method found by luckytyphlosion that involves a Ditto traded from R/B in which he has been taught the infamous Cooltrainer move. It can also be performed with a Bad Clone. Originally made for speedrunning, it was adapted for legit gameplay by Torchickens, but as far as I know it has not been tested in non-english games. Until it does, we're not gonna mention it in this guide, but I always felt this ACE method deserved more attention, so please don't hesitate to work on it!
* The method is well explained here.
* You will find more on this glitch in the official thread by Torchickens.

- And we finish with the main topic of discussion, the Wrong Pocket TM ACE, which is about having a certain TM in another Pocket than the TM/HM Pocket of the bag and take advantage of it. This can be achieved by different sub-methods, so we're gonna explain this in a whole chapter!

II. COIN CASE VS. WRONG POCKET TM ACE

NOTE: These methods can be performed on original cartridge as well as Virtual Console (even if it's a shitty emulator), but if performed on an emulator, you must use one that supports ECHO RAM. VisualBoyAdvance doesn't (although VBA-RR and VBA-M do). BGB does. BGB loves you. Use BGB.

Coin Case Glitch is a ready-to-use ACE technique that has no complicated requirements, and there has been work done to exploit it directly, for example to get Celebi. However, Wrong Pocket TM ACE requires less steps and is easier to handle. Also, it doesn't corrupt the Stack, which is an annoying side-effect of Coin Case Glitch. Thus, it is a more efficient ACE source than Coin Case... as long as you have the good TM in the wrong Pocket, and that is precisely the catch.

Fortunately, it is possible to use Coin Case glitch to get this TM in that Pocket! This to say that nowadays, most people prefer to use Coin Case glitch just once, in order to setup Wrong Pocket TM ACE. Whether what you will be one of them or not is up to you, but if you stick with Coin Case, codes that are designed for Wrong Pocket TM won't work without a prior adaptation step. If you're playing a non-english game and thus don't have access to Coin Case, or if you're playing an english game but for some reason prefer not using Coin Case, you can directly jump to chapter III which explains the Wrong Pocket TM ACE.

This is basically how Coin Case works:

1 ) You need what we call a 'Slide Pokémon' in slot 3 of the party. Unlike Wrong Pocket TM ACE, for which any lvl2 Sentret without 6 in Sp. Def. would work, the 'Slide Pokémon' for Coin Case is less permissive. The perfect Pokémon for this is Rocky, the Onix you can trade for a lvl5 (this is important) Bellsprout in Violet City, or Muscle the Machop traded for a lvl13 Drowzee in Goldenrod Departement Store. If you don't have access to these trades, then you can use a lvl2 female Hoothoot (Route 29) but this has only 60% chance to work and you have no way to figure out if it will before you try. If it doesn't, you need to catch another Hoothoot. In all cases the 'Slide Pokémon' must never be trained of receive an EV-changing item, as well as never receive significant friendship, and must be fully healed (without status) every time you use the glitch.

2 ) You need a Quagsire with some specific requirements in slot 4 of the party. There is two sets of requirements, depending on if you want to write a code from your items, in a similar fashion that what was used in R/B/Y, or from box names. Both methods will be explained in this guide, and codes will be given for both. I actually suggest you prepare two Quagsire so you can use one or the other method at any time.
   For item codes, have Quagsire hold a Protein and know SLEEP TALK (TM35, basement of Goldenrod Store, requires Basement Key) as first move.
   For box codes, have Quagsire hold TM02 (giveaway at Ilex Forest, or bought at Goldenrod Store) and know RETURN (TM27, giveaway if your first Pokémon is happy at Goldenrod Store).
   
NOTE: If you can't or don't want to get these TMs, you can use a glitch called the Bad Clone Trick to get them. However, as this glitch is the entry (and hot) point of using Wrong Pocket TM ACE if you don't use Coin Case, doing it makes the whole Coin Case thing useless because you will now be able to use TM ACE. If you really want to learn about this, continue this guide and you'll find out how when we'll come to the part of preparing these Quagsire for Wrong Pocket TM ACE.

NOTE: Of course, you can setup only one ACE method for now, as you will learn from this guide how to use it to setup the other method.

3 ) Write whatever code you want using the method you chose. You will learn how to do this later in the guide, since it is exactly the same for Coin Case and Wrong Pocket TM ACE.

4 ) Enter Cherrygrove City's Pokémon Mart.

5 ) Exit it and take exactly 4 steps to the right.

6 ) Open Bellsprout or Machop's entry in the Pokédex.

7 ) Open the bag, switch Pocket at least once, then go to the Key Items Pocket.

8 ) Use Coin Case to launch the code.

Now before we explain how TM ACE works and how to make codes you will be able to use with one or the other method, here are some ressources you might want to look at:
* GCL's official page about the Coin Case Glitch which also gives some troubleshooting.
* Technical explanations about this glitch can be found in this thread
* Crystal_ made this video illustrating the glitch and explaining how to setup Wrong TM ACE with it (although this is detailed later in this guide).

III. WRONG POCKET TM ACE EXPLAINED

This technique relies on the fact that a TM or HM that is placed, using some glitch magic, in another Pocket than the TM/HM Pocket will execute code, instead of teaching a move. Unless you use the Coin Case ACE to do that, you will have to use one of the following techniques:
- The 'Withdraw Smash' technique, also known as Stack Corruption, is yet another ACE technique invented by Crystal_ and ISSOtm that I didn't mention before because it's not extremely relevant to use it for something else than setting up Wrong Pocket TM ACE. We won't detail this here because this technique is more complex and has more side-effect than the other one, but don't hesitate to watch this video if you want to learn it!
- The 'Expanded Balls Pocket' technique that is obsolete (although experienced users might want to still use it) but described in 'ANNEX 2: GET ACCESS TO PC ITEMS THROUGH THE BAG' in case you would want to use it.
- The 'Item Shifting' technique that is by far the most convenient, and is the one described below.

Credits for it essentially goes to Paco81, for the initial discovery of the Bad Clone Trick (and all those who worked to make this glitch better), luckytyphlosion and gifvex (for the discovery of the Item Shifting Glitch that is currently used to get the TM) and Háčky (for its initial work discovering the Expanded Balls Pocket glitch).

NOTE: You can use 'ANNEX 1: GET TM ACE SETUP THROUGH A FIRST-GENERATION GAME' instead of this whole part.

If you have selected the 'Item Shifting', you will now need to use the Bad Clone Trick in a certain way to get two Mystery Eggs. The most reliable way to do this, that guarantees that it will work, has been invented by uckytyphlosion and gifvex and is described in this pastebin. Once you're done, jump to 'III.4: Prepare the Party setup'.
NOTE: You can also use another yet similar method that is quicker BUT it will NOT work if your Trainer ID is superior to 65280 or is equal to 255 modulo 256 (which means 511, 767, 1023, etc.). This variant is described below in III.1, III.2 and III.3, and requires:
- A Machop with Seismic Toss as first move (stored in the PC).
- 5 clones of a Pokémon obtained by trading with an NPC that has never been trained before. If this is impossible to you, use clones of any caught Pokémon that has never been trained before, but note that there is 3% chance it won't work.
- At least $200.
- Great Ball x1 and Poké Ball x2 as first and second items in the Balls Pocket (in this order). Any other balls must be stored in the PC.
- 1 Protein.

   III.1: Obtain a Glitch Pokémon n°000

Go to the Daycare, south of Goldenrod, and clone any Pokémon while making sure that you reset your game right after saying 'YES' to the question about save replacement. If it worked, the obtained clone will be level 0 and won't have a name; this is what we call a Bad Clone.
NOTE: Any clone without name but not at level 0 won't work.
NOTE: Getting a Bad Clone is easier when the box already contains 15 Pokémon, but never had more than 15 Pokémon.

Make a party of the Bad Clone and the 5 clones.

Give the Bad Clone to the Daycare lady and immediately take it back. It will now be a Glitch Pokémon with n°000.

   III.2: Use the Glitch Pokémon n°000 to get Mystery Eggs

Put the glitch Pokémon n°000 in front at the top of your party, and go to Bill's PC.

Choose 'MOVE PKMN W/O MAIL' and it will seem like your party is empty. Thanks to this, you can move the Machop at first slot (therefore you now have 7 Pokémon).

Exit the PC and give the glitch Pokémon n°000 to the Daycare lady again. Don't take it back this time.
NOTE: It is also possible to move it a slot 7 instead, and give it to the lady only after finishing this step.

Go back to Bill's PC and store Machop. It will now have a Mystery Egg attached.

Before taking the Egg from it, clone this Pokémon at least once, then take both Mystery Eggs.
NOTE: I recommend you do a backup clone also, in case you need other Eggs.

   III.3: Use Mystery Eggs to get TM17

Move the Mystery Eggs in the Key Items Pocket so that they are the last items in the Pocket (do not swap them together).
NOTE: For this trick to work, the Key Items Pocket must be full. If you don't have enough Key Items, you can keep cloning the Machop to get more Eggs in order to fill the Pocket.

Now, swap the first Mystery Egg with the second Mystery Egg (order is important). A S.S. Ticket will appear.

Move to the Balls Pocket. The Great Ball x1 and Poké Ball x2 should have turned into a Master Ball x5 and Ultra Ball x255 respectively (255 is indicated by a [tile]5).

Toss 47 Ultra Balls from the Ultra Ball x255 stack.

Swap the Master Ball x5 with the Ultra Ball x208.

Deposit the Mystery Egg in the Player's PC.

Withdraw the Mystery Egg from the Player's PC. In the Balls Pocket, the Ultra Ball x208 and Master Ball x5 should now have turned into a TM17 x1 and Poké Ball x255.

Store 255 (all) from the Poké Ball x255 stack in the Player's PC.

   III.4: Prepare the Party setup

Get TM02 (giveaway at Ilex Forest, or bought at Goldenrod Store), TM27 (giveaway if your first Pokémon is happy at Goldenrod Store) and TM35 (basement of Goldenrod Store, requires Basement Key).
NOTE: You can also use 'I.2: Use the Glitch Pokémon n°000 to get Mystery Eggs' again twice, with instead of Machop a Pokémon having ZAP CANNON (Magnemite for example) as first move the first time, and a Pokémon having ENCORE as first move (Clefairy, for example) the second time. These Pokémon will hold TM02 and TM35.
NOTE: In case you only have unhappy Pokémon and receive TM21 (FRUSTRATION) instead of TM27, you can perform 'I.2: Use the Glitch Pokémon n°000 to get Mystery Eggs' yet again with a Pokémon having FRUSTRATION as first move to get TM27.
   
To execute box codes, get the Quagsire to know RETURN as first move (using TM27), and give it TM02 to hold. To execute item codes, get the Quagsire to know SLEEP TALK as first move (using TM35), and give it a Protein to hold.
NOTE: I suggest you actually do both, and store the Quagsire you don't use when you don't.

You now need a 'Slide Pokémon'. Catch either a Bellsprout in Violet City that you raise at lvl5 then trade for Rocky the Onix with the NPC in Violet City, or a Drowzee that you raise at lvl13 then trade for Muscle the Machop with the NPC in Goldenrod Departement Store. This Pokémon must then never win any battle, or you won't be able to use it anymore.
NOTE: Instead, you can catch a lvl2 Sentret in Route 29, and make sure it doesn't have a 6 in its SP. DEF. stat (if so, catch another - this stat value appears in 31.25% of lvl2 Sentret). This Pokémon must then never win any battle, or you won't be able to use it anymore.

Place the 'Slide Pokémon' (fully healed, without status) in slot 1 of your party, and the good Quagsire in slot 2 in accordance with what you want to do.

IV. WRITE AND EXECUTE A CODE, REGARDLESS OF THE METHOD

At this point, you know how to have your setup ready to execute code and you just need to write it. We will review here some codes, either Item Codes and Box Codes, for use with either Coin Case or Wrong Pocket TM17, as well as explain how to make some of your own!

NOTE: Unfortunately, there is no way to use most, if not all, box codes in the German version.

   IV.1: GET TM17 IN THE WRONG POCKET (Box)
   This code is exclusively for Coin Case ACE.
   
NOTE: Of course, this code is destined to Coin Case users willing to have TM17 on the Item Pocket to shift on Wrong Pocket TM ACE (the code is from Crystal_'s video linked in chapter II). It would, of course, be useless to do that with TM ACE, and since it contains a way to fix the Stack, doing it will not work.

Make that the first item in your Item Pocket is disposable, as it will be replaced by TM17.

Go to Bill's PC and use the CHANGE BOX option to rename Box 1 to 5 into as follows:
Ap0'déy♀Pk (Pk is an available symbol, not "P followed by k")
'v't'véé'l2h
'd'd2'v9.9't
é?2hhhhh
h'm♀♀

Follow step 4 to 8 in chapter II while making sure the 'Slide Pokémon' and Quagsire with RETURN and TM02 are placed in the right spots (3 and 4). TM17 will then appear in your Item Pocket.

   IV.2: GET ANY TM/HM x255 CODE (Box)

Go to Bill's PC and use the CHANGE BOX option to rename Box 1 into Ap09é_♀'d (english game), Ap09é_♀ì (italian and spanish game) or Ap09é_♀n' (french game) while replacing _ by the character corresponding to the TM in the following table:
(space) = TM02
A = TM03
B = TM04
C = TM05
D = TM06
E = TM07
F = TM08
G = TM09
H = TM10
I = TM11
J = TM12
K = TM13
L = TM14
M = TM15
N = TM16
O = TM17
P = TM18
Q = TM19
R = TM20
S = TM21
T = TM22
U = TM23
V = TM24
W = TM25
X = TM26
Y = TM27
Z = TM28
( = TM29
) = TM30
: = TM31
; = TM32
[ = TM33
] = TM34
a = TM35
b = TM36
c = TM37
d = TM38
e = TM39
f = TM40
g = TM41
h = TM42
i = TM43
j = TM44
k = TM45
l = TM46
m = TM47
n = TM48
o = TM49
p = TM50
q = HM01
r = HM02
s = HM03
t = HM04
u = HM05
v = HM06
w = HM07
NOTE: As of now, to my knowledge there is no equivalent to this for german games.

Use TM17 from the Wrong Pocket (or follow step 4 to 8 in chapter II if you use Coin Case) while making sure the 'Slide Pokémon' and Quagsire with RETURN and TM02 are placed in the right spots (1 and 2 for TM ACE, 3 and 4 for Coin Case). The TM/HM x255 will appear in the TM/HM Pocket.

   IV.3: INCREASE/DECREASE THE QUANTITY OF AN ITEM CODE (Items)

Use 'IV.2: GET ANY TM/HM x255 CODE' to get TM10 and TM23, unless you already have them in the necessary quantities below.
NOTE: TM10 can be bought.

Get (unless you already have), then store the following items in the PC, in that order:
Any Item x(any quantity)
Any item x(any quantity)
Fresh Water x44
Poké Ball x38
TM23 x52 (to increase) or x53 (to decrease)
[ONLY FOR COIN CASE: X Defense x1] (otherwise replace with TM10 x(any quantity))
[ONLY FOR COIN CASE: X Speed + x1] (otherwise replace with Any item x(any quantity))
[ONLY FOR COIN CASE: TM06 x195 (use IV.2 and IV.3 to get them)] (otherwise replace with Any item x(any quantity))
[ONLY FOR COIN CASE: HM03 x18 (use IV.2 and IV.3 to get them)] (otherwise replace with Any item x(any quantity))
[ONLY FOR COIN CASE: TM10 x(any quantity)] (otherwise replace with Any item x(any quantity))
The item that must change x(any quantity)
Any other items in any quantities can go from here on

Use TM17 from the Wrong Pocket (or follow step 4 to 8 in chapter II if you use Coin Case) while making sure the 'Slide Pokémon' and Quagsire with SLEEP TALK and Protein are placed in the right spots (1 and 2 for TM ACE, 3 and 4 for Coin Case) and the 11th item will get or lose one unit.
NOTE: Decreasing the quantity is very useful if the item is x1; this way, using the code twice will set the quantity to x255, and then you can toss as many units as you want to reach the quantity you actually need.

   IV.4: GET ANY ITEM CODE (Items)

Use 'IV.2: GET ANY TM/HM x255 CODE' to get TM10 and TM23, unless you already have them in the necessary quantities below.
NOTE: TM10 can be bought.

Use this list: http://pastebin.com/raw/arPmsvYu to find an item that you have or can easily buy/get and is the closest possible (above or below) of the wanted item in the Item column. Get this selected item.

Get (unless you already have), then store the following items in the PC, in that order:
Any Item x(any quantity)
Any item x(any quantity)
Fresh Water x43
Poké Ball x38
TM23 x52 (if the wanted item is below the selected one) or x53 (if the wanted item is above the selected one)
[ONLY FOR COIN CASE: X Defense x1] (otherwise replace with TM10 x(any quantity))
[ONLY FOR COIN CASE: X Speed + x1] (otherwise replace with Any item x(any quantity))
[ONLY FOR COIN CASE: TM06 x195 (use IV.2 and IV.3 to get them)] (otherwise replace with Any item x(any quantity))
[ONLY FOR COIN CASE: HM03 x18 (use IV.2 and IV.3 to get them)] (otherwise replace with Any item x(any quantity))
[ONLY FOR COIN CASE: TM10 x(any quantity)] (otherwise replace with Any item x(any quantity))
The selected item x(any quantity)
Any other items in any quantities can go from here on

Use TM17 from the Wrong Pocket (or follow step 4 to 8 in chapter II if you use Coin Case) while making sure the 'Slide Pokémon' and Quagsire with SLEEP TALK and Protein are placed in the right spots (1 and 2 for TM ACE, 3 and 4 for Coin Case) and the 11th item will become the one directly below or above in the list. Thus, use TM17 as many times as necessary to reach the wanted item.

   IV.5: MEMORY EDITOR CODE, A.K.A. GAMESHARK SIMULATOR (Items or Box)
   
The box version of this code is tricky and described in Crystal_'s videos. First use 'IV.2: GET ANY TM/HM x255 CODE' to get TM09 (unless you already have it) and make Quagsire hold it instead of TM02, then click here for english games (from 10:29) and click here for non-english games (from 9:41). For the items version of the code, do as follows.

If you want to simulate a G/S Gameshark code (which always is 01XXYYZZ):
- Use the Windows Calculator to convert XX into Decimal and note the value.
- Do the same with YY.
- Check in this table http://pastebin.com/raw/arPmsvYu the item that matches ZZ.
If you want to edit a WRAM address value instead:
- Use one of the two following sources to find the $ZZYY memory address that contains the data you want to edit. The first one is more convenient and easier to use, but less exhaustive than the second one.
* Datacrystal's G/S RAM MAP: https://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_Gold_and_Silver:RAM_map
* Pokémon Gold(/Silver) disassembly project: https://github.com/PikalaxALT/pokegold/blob/master/wram.asm
- Determine the XX value you want to put in the address. For example, if the address is the one that controls the quantity of the first item in the Balls Pocket and you want it to be 5, then XX is 5. If the address controls what the first item is and you want it to be a Master Ball, use this table http://pastebin.com/raw/arPmsvYu to see that Master Ball's hex ID is 01. Therefore XX would be 01.
- Use the Windows Calculator to convert XX into Decimal and note the value.
- Do the same with YY.
- Check in the aforementioned table the item that matches ZZ.

Use 'IV.2: GET ANY TM/HM x255 CODE' to get TM10 and TM42, unless you already have them in the necessary quantities below. If ZZ matches a TM and you need it, use it also for this TM.
NOTE: TM10 can be bought.

Use 'IV.4: GET ANY ITEM CODE (Items)' to get PP Up, unless you already have one (or more). If ZZ doesn't match a TM and you need it, use it also for this item.

Get (unless you already have), then store the following items in the PC, in that order:
Any Item x(any quantity)
Any item x(any quantity)
PP Up x(decimal conversion of XX)
TM42 x(decimal conversion of YY)
Item that matches ZZ x3
[ONLY FOR COIN CASE: X Defense x1] (otherwise nothing)
[ONLY FOR COIN CASE: X Speed + x1] (otherwise nothing)
[ONLY FOR COIN CASE: TM06 x195 (use IV.2 and IV.3 to get them)] (otherwise nothing)
[ONLY FOR COIN CASE: HM03 x18 (use IV.2 and IV.3 to get them)] (otherwise nothing)
TM10 x(any quantity)
Any other items in any quantities can go from here on

Use TM17 from the Wrong Pocket (or follow step 4 to 8 in chapter II if you use Coin Case) while making sure the 'Slide Pokémon' and Quagsire with SLEEP TALK and Protein are placed in the right spots (1 and 2 for TM ACE, 3 and 4 for Coin Case) to edit the address.

   IV.6: CHANGING ID CODE (Items)
   Particular usage of 'IV.5: MEMORY EDITOR CODE, A.K.A. GAMESHARK SIMULATOR (Items or Box)'

Use 'IV.2: GET ANY TM/HM x255 CODE' to get TM10, TM42 and TM18, unless you already have them in the necessary quantities below.
NOTE: TM10 and TM18 can be bought.

Use 'IV.4: GET ANY ITEM CODE (Items)' to get PP Up, unless you already have one (or more).

Using the Windows Calculator, convert the ID you want into hexadecimal (example: 13579 translates into 350B). Then, split this hexadecimal ID number in two parts (example: in this case, you get '35' and '0B').

Use this list: http://pastebin.com/raw/arPmsvYu to find the number from the Decimal column corresponding to the SECOND part of the hexadecimal ID number (read in the Hexadecimal column) (example: in this case, 0B corresponds to 11).

Use 'IV.3: INCREASE/DECREASE THE QUANTITY OF AN ITEM CODE (Items)' on PP Up to give them the quantity corresponding to this previously obtained number.

Get (unless you already have), then store the following items in the PC, in that order:
Any Item x(any quantity)
Any item x(any quantity)
PP Up x(the obtained number)
TM42 x162
TM18 x3
[ONLY FOR COIN CASE: X Defense x1] (otherwise nothing)
[ONLY FOR COIN CASE: X Speed + x1] (otherwise nothing)
[ONLY FOR COIN CASE: TM06 x195 (use IV.2 and IV.3 to get them)] (otherwise nothing)
[ONLY FOR COIN CASE: HM03 x18 (use IV.2 and IV.3 to get them)] (otherwise nothing)
TM10 x(any quantity)
Any other items in any quantities can go from here on

Use TM17 from the Wrong Pocket (or follow step 4 to 8 in chapter II if you use Coin Case) while making sure the 'Slide Pokémon' and Quagsire with SLEEP TALK and Protein are placed in the right spots (1 and 2 for TM ACE, 3 and 4 for Coin Case).

Use this list: http://pastebin.com/raw/arPmsvYu to find the number from the Decimal column corresponding to the FIRST part of the hexadecimal ID number (read in the Hexadecimal column) (example: in this case, 35 corresponds to 53).

Use 'IV.3: INCREASE/DECREASE THE QUANTITY OF AN ITEM CODE (Items)' on PP Up to give them the quantity corresponding to this previously obtained number.

Toss or withdraw 1 TM42, so you now have TM42 x161 in the PC.

Use TM17 from the Wrong Pocket (or follow step 4 to 8 in chapter II if you use Coin Case) while making sure the 'Slide Pokémon' and Quagsire with SLEEP TALK and Protein are placed in the right spots (1 and 2 for TM ACE, 3 and 4 for Coin Case). You now have your wanted ID!

   IV.7: MAKE THE SIXTH POKEMON IN PARTY SHINY CODE (Items)

Use 'IV.2: GET ANY TM/HM x255 CODE (Box)' to get TM10 and TM28, unless you already have them in the necessary quantities below.

Use 'IV.4: GET ANY ITEM CODE (Items)' to get Polkadot Bow and Metal Powder.
NOTE: You can also trade respectively Jigglypuff and Ditto from R/B/Y, they will hold these items.

Use 'IV.3: INCREASE/DECREASE THE QUANTITY OF AN ITEM CODE (Items)' on Polkadot Bow and Metal Powder to give them the quantity of x119.

Get (unless you already have), then store the following items in the PC, in that order:
Any Item x(any quantity)
Any item x(any quantity)
X Accuracy x47
TM28 x62
Polkadot Bow x119
Metal Powder x119
[ONLY FOR COIN CASE: X Defense x1] (otherwise nothing)
[ONLY FOR COIN CASE: X Speed + x1] (otherwise nothing)
[ONLY FOR COIN CASE: TM06 x195 (use IV.2 and IV.3 to get them)] (otherwise nothing)
[ONLY FOR COIN CASE: HM03 x18 (use IV.2 and IV.3 to get them)] (otherwise nothing)
TM10 x(any quantity)
Any other items in any quantities can go from here on

Use TM17 from the Wrong Pocket (or follow step 4 to 8 in chapter II if you use Coin Case) while making sure the 'Slide Pokémon' and Quagsire with SLEEP TALK and Protein are placed in the right spots (1 and 2 for TM ACE, 3 and 4 for Coin Case) and the sixth Pokémon will be Shiny.
   
   IV.8: GOTTA CATCH 'EM ALL CODE (Box)
   
The standard version of this code is easy and quick to perform:
- For English games, see this post for that gives it for Wrong Pocket TM ACE and Coin Case ACE (a video is also available here). This code also gives shiny Pokémon.
- For italian and spanish games, do the same as English Wrong Pocket TM but replace 'v with ° and 'd with ì in italian and spanish games. This code also gives shiny Pokémon.
- For french games, see this post.
- There doesn't seem to be a German adaptation to this so far.

NOTE: If you don't like this code, you can also apply another method that is significantly longer but uses one code for all Pokémon. This method is explained in Crystal_'s video here.

   IV.9: MORE AND COMPETITIVE CODES (Box)

More codes made by the members of GCLF can be found in this thread. Don't hesitate to read it, but pay attention to what they have been designed for (Coin Case, Wrong Pocket TM, or both).

This thread here by FMK gives more box codes and explain how to convert Coin Case box codes into Wrong Pocket TM box codes. It also gives a slightly different process with TM25 instead.

For some competitive battling codes, check this thread by Torchickens.

   IV.10: A WORD ON HOW TO WRITE COMPLEX CODES

As of now, you know how to create your own code to change a single value in the game's RAM. That's very cool, but you might want to do more complex codes that will affect several values at once or create your own scripts. To do that, you'll need to understand how ACE works.

In G/S, using TM17 in the wrong pocket makes the game read code from address $FA47, which is located in what we call Echo RAM. Starting at $E000, this Echo RAM is a duplicate of WRAM, the memory section going from $C000 to $DFFF which stores the game's data. $FA47 thus contains exactly the same value than $DA47, the caught data of your current first Pokémon. Registered inside two consecutive addresses ($DA47 and $DA48 in the case of Pokémon 1), caught data is an unused section of the Pokémon's data, so its value is always 00. If you ever heard about people using TM25 instead, well the concept is the same, but it reads from the Defense EV of the second Pokémon. Finally, using Coin Case is no different, but this time we read data from the third Pokémon!

In all these cases, writing useful code from Pokémon data is almost impossible because it would require specific stats, EV, sometimes even IV... so we need to get the hell out of this place to reach another section of WRAM in which we have more control (either items or box names). Now let's explain the theory with the case of TM17 and let's take a look at the RAM's data for party Pokémon 1 and 2 (you can see all of this using the RAM Map)

Pokémon 1
($DA2A to $DA46 are all the other datas that are not useful here)
$DA47 to $DA48 = Caught Data
$DA49 = Level
$DA4A to $DA4B = Status
$DA4C to $DA4D = HP
$DA4E to $DA4F = Max HP
$DA50 to $DA51 = Attack
$DA52 to $DA53 = Defense
$DA54 to $DA55 = Speed
$DA56 to $DA57 = Special Defense
$DA58 to $DA59 = Special Attack
Pokémon 2
$DA5A = Species
$DA5B = Item Held
$DA5C to $DA5F = Moves

Every address mentioned here has an hexadecimal value corresponding to the data of your Pokémon (for example, if the attack stat of Pokémon 1 is 21, the value of $DA51 is 15). You must now understand that when the game reads code from a point, it interprets the hexadecimal values into instructions called opcodes. In the corresponding list we've provided before for Hex/Dec/Items correspondance, you also have the opcode for each hex, and you can also find here on this more complete table. To take an example, 41 matches the instruction 'ld B,C'.

I don't want (and it's above my knowledge) to explain all opcodes here, but you can actually find a lot of useful ressources on the Internet (I'll link some later in this guide) but we're going to review some basics:
- nop (matching hexadecimal 00) means no operation. The game just continues reading.
- ld means load, in the way that a variable is loaded with ('becomes') a value.
- inc and dec command to increase or decrease the value of a given variable.
- add and sub means that a given value is added or substracted to the variable A (always).
- jp is a jump. It allows you to move to a given part of the WRAM, that can be either directly set by the user or contained in a duo of variable, HL.
- jr is also a jump, but a relative one. It jumps at a given distance of the current reading position.
- ret is mainly used, here, to end your code (in fact, it pops the top of the stack to the program counter).

At first, we want to jump at $D61B (third stored item) or $D8C0 (box 1 name, character two). In the latter case, that translates to "jp D8C0". We will then use the instruction coded by hexadecimal C3, which is a jump at the position given by the two following hexadecimals (reversed - to understand why, read Wikipedia's page about endianness). That means if the game reads C3 C0 D8, then it will jump at box name 1.

We can't easily control the data we have access to in Pokémon 1 when using TM17, but we could use the species (hex:C3 is Quagsire in the list), held item (hex:C0 is TM02) and first move of Pokémon 2 (hex:D8 is RETURN) because that is not a big requirement. Our best shot is then to make sure Pokémon 1's data matches 'unharmful opcodes' that won't jump or will only affect variables we don't care about to so it can 'slide' until Quagsire: this is why the first Pokémon is called 'Slide Pokémon'. The same goes for Pokémon 3 with Coin Case, although it reads more ot its data, so the 'Slide Pokémon' is less permissive. However, in the case of TM25, we can actually affect the EV of the Pokémon by training it until it reaches these values, so it's not mandatory to use a 'Slide Pokémon' (but then, it's longer to setup).

Let's now review the gameshark simulation/single-address value changing code (IV.5). Keep in mind what we want to do here is to put BB as the value of address $DDCC. PP Up's hex ID is 3E, TM42 is EA, and TM10 is C9. Remember that after the address of an item comes the address of its quantity, and only then we can proceed with item 2.
Code: [Select]
$D61B 3E ld A,XXAs mentioned in the table by the small '2' under this opcode, it takes two bytes: XX will be the value of the following address ($D61C, the quantity of item 3 - in our case, "BB"). This instruction thus says 'ld A,BB' and the variable A becomes BB. Therefore, $D61C is not read as an opcode, and we proceed.
Code: [Select]
$D61D EA ld XXXX,A (3 octets) This instruction takes 3 bytes so we need to consider the two following ones.
$D61E "CC"
$D61F "DD" → ld (DDCC),A The parenthesis indicates it's the value of XXXX that changes. Then, the value of $DDCC becomes A which is now BB!
$D620 03 inc BC Increase the duo of variable b and c. It's just a placeholder here, we don't use these variables.
The 4 following items in the code (instructions read from $D621 to $D628) are exclusive to Coin Case. This is because Coin Case has a major drawback compared to Wrong Pocket TM ACE which we mentioned before: it destroys the stack. This set of instructions is meant to fix it, and thus are not used with Wrong Pocket TM ACE. Let's finish this code:
Code: [Select]
$D629 C9 ret Code reading ends.
Isn't that easy? See this other example with the code that changes Stored Item 11 (IV.4). This item's address is $D62B. You should be able to understand that the code read by the game in this case is 2E 2B 05 26 D6 34 [Coin Case Set] C9.
Code: [Select]
$D61B 2E ld l,XX (2 bytes)
$D61C 2B → ld l,2B Variable l becomes 2B.
$D61D 05 dec b Variable b is decreased. This is still a placeholder.
$D61E 26 ld h,XX (2 bytes)
$D61F D6 → ld h,D6 Variable l becomes D6.
$D620 34 inc (hl) Value of address hl ($D62B) is increased. We're done!
$D621 to $D628 Coin Case set.
$D629 C9 ret Code reading ends.

Writing codes with items is easy in theory because you have access to almost all opcodes. However, it can be a bit unpractical when it comes to gathering items. Writing box codes is of course quicker and easier, but you won't have access to all opcodes because the first character, the space, has an hex ID of 7F (followed by A, which has an hex ID of 80). This is why box codes are longer than item codes, since it requires to spam add and sub to workaround the impossibility to use 2-bytes ld. Also, some characters are exclusive to languages, which means codes have to be translated for each language! It is rather easy in italian and spanish, very difficult in french (because of the lack of sub) and almost impossible in german because it doesn't even have 3-bytes ld.

This guide won't get into details for box codes, because it would require more lessons on opcodes and how to use flags. If you're new to this, you can stick to item codes, or ask here for specific help with your codes! We can always go further and ACE can be also used to program something, in the way TheZZAZZGlitch did a Pong game in R/B/Y! Everything cannot be included in this guide, but there is a lot for you to discover. Your very own ACE legend is about to unfold! A world of dreams and adventures with ACE awaits! Let's go!

Useful ressources:
* This website's guide to GB Programming
* A GameBoy opcode summary can be found here for basic understanding of what opcodes do.
* A more detailed guide with syntax is available on this website.

ANNEX 1: GET TM ACE SETUP THROUGH A FIRST-GENERATION GAME
   
You will need:
- A R/B/Y game in which you can perform code execution using either the 8F item, the wsl'm item, or the 4F item (this is NOT a guide to code execution in first generation games, it assumes you already have one of these items and a proper setup to use it. If you don't know what we're talking about here, please go back to the normal process).
- The following TMs (at least 1 of each): TM01, TM14, TM18, HM03.
- At least 1 of each of the following : Thunderstone, Max Revive, X Accuracy, Lemonade, Water Stone, Soda Pop.
- 34 Ice Heal stored in the PC.
- Some other things that can easily be bought in-game.

   ANNEX 1.1: Gather the needed items

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
Thunderstone x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have Thunderstone x0 instead of x1. Store them in the PC.

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
Max Revive x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have Max Revive x0 instead of x1. Store them in the PC.

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
X Accuracy x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have X Accuracy x0 instead of x1. Store them in the PC.

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
Lemonade x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have Lemonade x0 instead of x1. Store them in the PC.

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
Water Stone x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have Water Stone x0 instead of x1. Store them in the PC.

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
Soda Pop x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have Soda Pop x0 instead of x1. Store them in the PC.

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
HM03 x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have HM03 x0 instead of x1 (but you won't seen its number). Store them in the PC.

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
TM18 (TM17 in Yellow) x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have the TM x0 instead of x1. Store them in the PC.

Place the following items, in that order, in your pack:
8F (4F or wsl'm in Yellow)
TM14 x1
Poké Ball x45
Revive x3
TM01 x(any quantity)
Any other items in any quantities can go from here on

Use the 8F (4F or wsl'm in Yellow) item. You should now have TM14 x0 instead of x1. Store them in the PC.

   ANNEX 1.2: Create custom jump Pokémon
   
Make sure you have at least 2 Pokémon in the active box.
NOTE: If you're playing Yellow, these 2 Pokémon are part of your setup.

Withdrawing items from the x0 stacks in your PC, place the following items, in that order, in your pack:
Any item x(any quantity)
8F (4F or wsl'm in Yellow)
Thunderstone x190 in english R/B (x189 in english Yellow, x195 in non-english R/B, x194 in non-english Yellow)
TM18 x4
Max Revive x69
X Accuracy x205 in english R/B (x204 in english Yellow, x210 in non-english R/B, x209 in non-english Yellow)
Lemonade x195
Water Stone x12
TM14 x3
Ice Heal x34
HM03 x25
Soda Pop x119
TM01 x(any quantity)

Use the 8F (4F or wsl'm in Yellow) item.

Toss 33 Thunderstone.

Toss 33 X Accuracy.

Withdraw 165 TM14 from the PC.

Toss all HM03 and withdraw 188 HM03 from the PC (it takes time!).

Place the following items, in that order, in your pack:
Any item x(any quantity)
8F (4F or wsl'm in Yellow)
Thunderstone x157 in english R/B (x156 in english Yellow, x162 in non-english R/B, x161 in non-english Yellow)
TM18 x4
Max Revive x69
X Accuracy x172 in english R/B (x171 in english Yellow, x177 in non-english R/B, x176 in non-english Yellow)
Lemonade x195
Water Stone x12
TM14 x168
Ice Heal x34
HM03 x188
Soda Pop x119
TM01 x(any quantity)

Use the 8F (4F or wsl'm in Yellow) item.

Withdraw and trade the first two Pokémon in your active box to your G/S game: both will hold a Mystery Egg. They must NEVER win any battle, or you won't be able to use them anymore.

   ANNEX 1.3: Use Mystery Eggs to get TM25

Take both Mystery Eggs and place them in the Key Items Pocket so that they are the last items in the Pocket (do not swap them together).
NOTE: For this trick to work, the Key Items Pocket must be full. If you don't have enough Key Items, you can clone one or both Pokémon before taking the Egg, to get more Eggs in order to fill the Pocket.

Now, swap the first Mystery Egg with the second Mystery Egg (order is important). A S.S. Ticket will appear.

Move to the Balls Pocket. The Great Ball x1 and Poké Ball x2 should have turned into a Master Ball x5 and Ultra Ball x255 respectively (255 is indicated by a [tile]5).

Toss 39 Ultra Balls from the Ultra Ball x255 stack.

Swap the Master Ball x5 with the Ultra Ball x216.

Deposit the Mystery Egg in the Player's PC.

Withdraw the Mystery Egg from the Player's PC. In the Balls Pocket, the Ultra Ball x216 and Master Ball x5 should now have turned into a TM25 x1 and Poké Ball x255.

Store 255 (all) from the Poké Ball x255 stack in the Player's PC.
   
   ANNEX 1.4: Prepare the Party setup

Place the Pokémon that was FIRST in the R/B/Y's PC box at slot 2 of your party everytime you need to execute item codes during 'IV. WRITE AND EXECUTE A CODE' (instead of the Quagsire with SLEEP TALK and Protein), and place the Pokémon that was SECOND in the R/B/Y's PC box at slot 2 of your party everytime you need to execute box codes during 'IV. WRITE AND EXECUTE A CODE' (instead of the Quagsire with RETURN and TM02). In both cases, you won't need any 'Slide Pokémon' in slot 1.

Use TM25 from the Balls Pocket everytime you need to execute codes during 'IV. WRITE AND EXECUTE A CODE' (instead of TM17).

ANNEX 2: GET ACCESS TO PC ITEMS THROUGH THE BAG

You will need:
- A Pokémon with CLAMP (Shellder or Cloyster) as first move, and another with LOW KICK as first move (Machop for example), both stored in the PC.
- Some useless Pokémon.
- At least $200.
- TM17 stored in the PC.

   ANNEX 2.1: Obtain a Glitch Pokémon n°000

Go to the Daycare, south of Goldenrod, and clone any Pokémon while making sure that you reset your game right after saying 'YES' to the question about save replacement. If it worked, the obtained clone will be level 0 and won't have a name; this is what we call a Bad Clone.
NOTE: Any clone without name but not at level 0 won't work.
NOTE: Getting a Bad Clone is easier when the box already contains 15 Pokémon, but never had more than 15 Pokémon.

Make a party of the Bad Clone and 5 other useless Pokémon (or clones).

Give the Bad Clone to the Daycare lady and immediately take it back. It will now be a Glitch Pokémon with n°000.

   ANNEX 2.2: Use the Glitch Pokémon n°000 to get Machine Part and SecretPotion

Put the glitch Pokémon n°000 in front at the top of your party, and go to Bill's PC.

Choose 'MOVE PKMN W/O MAIL' and it will seem like your party is empty. Thanks to this, you can move the CLAMP Pokémon at first slot (therefore you now have 7 Pokémon).

Exit the PC and give the glitch Pokémon n°000 to the Daycare lady again. Don't take it back this time.

Go back to Bill's PC and store the CLAMP Pokémon. It will now have a Machine Part attached.

Before taking the Part from it, clone this Pokémon at least once, then take both Machine Part.

Redo the whole sub-step again with the other Pokémon to get 2 SecretPotion.

   ANNEX 2.3: Trigger the Expanded Balls Pocket

Place the obtained items in the last position of your Key Items Pocket, just like in this screenshot: http://www.prama-initiative.com/OAC/AAIDPCALPDPBDSEDMI.png

In your pack, make sure to have ABSOLUTELY NOTHING in your Balls Pocket (if so, toss them or store them). Now, go to the Key Items pocket, swap both Machine Part.

Normally, you should now see an Iron and a Apricorn in the pack. Swap the first SecretPotion with the Apricorn.

Swap the second SecretPotion with the Apricorn again. Both should now be at last position of your pack. Now swap both Secret Potion.

Go in the Balls Pocket of your pack, you should be able to go down, beyond the CANCEL button. If you keep going down, you will now see your PC items! This is useful because it gives you a direct vision of what's is in the PC when you want to execute a code, but also because everytime you will store a non-Ball item into the PC from the Balls Pocket, this item gets duplicated. However, you won't be able to buy/get any Balls without using 'II.3: GET ANY ITEM CODE (Items)'.

In case you want to remove this, use 'IV.4: GET ANY ITEM CODE (Items)', 'IV.3: INCREASE/DECREASE THE QUANTITY OF AN ITEM CODE (Items)' and 'IV.2: GET ANY TM/HM x255 CODE (Box)', to get PP Up x0, TM42, TM22 and TM10, unless you already have them. Then, have this in your PC, in that order, and use TM17.
PP Up x0
TM42 x252
TM22 x3
TM10 x(any quantity)
Any other items in any quantities

GENERAL CONCLUSION

Alright, I'mma stop here with this guide for now. I know I have to add some colours and more BBCodes, but please mention me any improvement, any mistake, any thread that gives more interesting codes, and don't hesitate to ask questions!
« Last Edit: November 19, 2017, 01:18:24 pm by Krys3000 »

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

Couldntthinkofaname

  • Zeta
  • GCLF Member
  • *
  • Offline Offline
  • The default personal text makes no sense
    • View Profile
Wow, this is incredibly detailed! Nice work!
« Last Edit: October 30, 2017, 01:22:27 pm by Couldntthinkofaname »
"What's a stack? Can you eat that?"

"Sure, just POP it into your mouth!" (someoneplskillme)

Clash Royale profile: #LYQC9LLV. Join our clan because we're lonely.

Does anybody really know what time it is?

Does anybody really care?
- Chicago

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Thanks! :)

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

Couldntthinkofaname

  • Zeta
  • GCLF Member
  • *
  • Offline Offline
  • The default personal text makes no sense
    • View Profile
Your encounter code seems a little complex, however. It seems to require multiple uses of TM 25. I wrote a wild encounter box name code that only requires one use of of TM 25, and it's only 9 boxes long. It can be found here.

And as a plus, the found Pokemon is shiny.
« Last Edit: October 30, 2017, 01:47:47 pm by Couldntthinkofaname »
"What's a stack? Can you eat that?"

"Sure, just POP it into your mouth!" (someoneplskillme)

Clash Royale profile: #LYQC9LLV. Join our clan because we're lonely.

Does anybody really know what time it is?

Does anybody really care?
- Chicago

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Thanks! I'll add this code asap, that's very cool. I also must add this as a more easy-to-handle list http://pastebin.com/raw/arPmsvYu , a way to make guarantee the expanded balls pocket trick and links to code threads from this board.

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

spamviech

  • GCLF Member
  • *
  • Offline Offline
  • Gender: Male
    • View Profile
   IV.1: GET TM17 IN THE WRONG POCKET (Box)
   
NOTE: Of course, this code is destined to Coin Case users willing to have TM17 on the Item Pocket to shift on Wrong Pocket TM ACE (the code is from Crystal_'s video linked in chapter II). But it could also be used with Wrong Pocket TM ACE, just for fun.

Make that the first item in your Item Pocket is disposable, as it will be replaced by TM17.

Go to Bill's PC and use the CHANGE BOX option to rename Box 1 to 5 into as follows:
Ap0'déy♀Pk (Pk is an available symbol, not "P followed by k")
'v't'véé'l2h
'd'd2'v9.9't
é?2hhhhh
h'm♀♀

Didn't really check, but doesn't this code contain a part for fixing the stack from Coin Case?
Therefore it will probably crash the game when executed via wrong pocket TM ACE. The same is true vice versa for wrong pocket codes executed via coin case ACE.

Oh and btw. all box name codes probably won't work for german language games since we don't have the é character available as an input character (same for 'v, but you can work around that one).

Anyway, great work on this compilation.   :)

Thanks! I'll add this code asap, that's very cool. I also must add this as a more easy-to-handle list http://pastebin.com/raw/arPmsvYu , a way to make guarantee the expanded balls pocket trick and links to code threads from this board.
You need to add Pk- and Mn-Symbols missing in the list (e1 & e2).
« Last Edit: October 31, 2017, 02:20:06 am by spamviech »

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
You're probably right indeed! Thanks I'll change things asap :)

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Re: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!
« Reply #7 on: November 03, 2017, 03:30:56 pm »
The guide was a bit modified with all the informations that you all gave to me. Many thanks!

I would like to understand more about adapting Wrong Pocket TM ACE codes to Coin Case variants, so I can add both for each categories.

Of course, I don't want to link all codes from the main thread but I will add links to some code threads to the guide :)

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

Evie ✿

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!
« Reply #8 on: November 03, 2017, 04:04:27 pm »
The guide was a bit modified with all the informations that you all gave to me. Many thanks!

I would like to understand more about adapting Wrong Pocket TM ACE codes to Coin Case variants, so I can add both for each categories.

Of course, I don't want to link all codes from the main thread but I will add links to some code threads to the guide :)

Basically with Coin Case arbitrary code execution you have to fix the stack. The stack can be fixed to a degree with the help of two pop des, followed by an inc sp, followed by pop de (in that order. I think the order you do this matters if I remember rightly), and you also should set FF83 (a zero page address) to 0. Only after you do that, you can terminate the code with "or a" (to ensure the carry flag is not set) and a "ret nc".

To avoid a laggy menu you can also set address D199 (or its Echo RAM equivalent F199) to 00. However you don't need to do this and you can also avoid the lag by setting Menu Account to Off in the options.

FMK's "one-off code" ensures that the last two boxes (box 13 and box 14) have code that will both 'fix' the stack and return control to the game, hence you can make simpler codes followed by 5s (filler code) until box 13 and box 14.

With wrong pocket TM execution (and glitch Pokédex mode ACE) you don't have to fix the stack, so you can terminate with the or a and ret nc as usual. Furthermore they can be used anywhere without having to make any overworld movement or listen to Bellsprout/Machop etc.'s cry.
« Last Edit: November 03, 2017, 04:12:26 pm by Torchickens »
Hi! I identify as transgender female.  She/her pronouns, please.

Online I most often use the username Torchickens or Chickasaurus.



Thank you Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

I like to collect interesting video games.
https://www.vgcollect.com/Torchickens

The psychology of birth (including spiritual birth): pain>acceptance/courage in face of pain>embracement>unconditional love and strength

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Re: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!
« Reply #9 on: November 03, 2017, 04:11:23 pm »
Thank you Torchickens! I should be able to provide equivalents for each code now. If you have any other comment to make to this guide, don't hesitate to. It's meant to be the most accurate and user-friendly so it can be visible and a proper introduction to ACE :)

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

Evie ✿

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!
« Reply #10 on: November 03, 2017, 04:13:18 pm »
Thank you Torchickens! I should be able to provide equivalents for each code now. If you have any other comment to make to this guide, don't hesitate to. It's meant to be the most accurate and user-friendly so it can be visible and a proper introduction to ACE :)

Pleasure! ^^

Good luck and have fun and I'll keep that in mind!
Hi! I identify as transgender female.  She/her pronouns, please.

Online I most often use the username Torchickens or Chickasaurus.



Thank you Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

I like to collect interesting video games.
https://www.vgcollect.com/Torchickens

The psychology of birth (including spiritual birth): pain>acceptance/courage in face of pain>embracement>unconditional love and strength

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.

spamviech

  • GCLF Member
  • *
  • Offline Offline
  • Gender: Male
    • View Profile
Re: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!
« Reply #11 on: November 03, 2017, 04:55:10 pm »
It's possible to replace the (not representable by an available character) INC SP with a ADD SP, ff followed by an additional POP DE (as pointed out by ISSOtm here).

It also turns out that you don't have to set ff83 to 0 when setting f199 to 0.

So the only adjustment you have to make from a wrong-pocket TM code to a Coin Case one is replace the final x'd with
Code: [Select]
péZ×.9'l'l'l'lx'd
You have to keep the "péZ×", the ".9" and the "x'd" (obviously has to be at the end) together. If you have space problems in my experience it is no problem to space it out in the code (replace some filler 5s).[/code]
« Last Edit: November 03, 2017, 04:56:05 pm by spamviech »

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Re: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!
« Reply #12 on: November 05, 2017, 06:05:21 am »
Thanks!

I assume the job is the same with items? I'll add the variants for each code.

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov

Couldntthinkofaname

  • Zeta
  • GCLF Member
  • *
  • Offline Offline
  • The default personal text makes no sense
    • View Profile
Re: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!
« Reply #13 on: November 05, 2017, 08:39:32 am »
Thanks!

I assume the job is the same with items? I'll add the variants for each code.

With item codes, most developers simply use:
Code: [Select]
Inc sp
Ld bc,0134
Push bc
Jp 12f5

What this effectively does is trick the game into reading the end-terminator $50, which fixes the stack on it's own.
"What's a stack? Can you eat that?"

"Sure, just POP it into your mouth!" (someoneplskillme)

Clash Royale profile: #LYQC9LLV. Join our clan because we're lonely.

Does anybody really know what time it is?

Does anybody really care?
- Chicago

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french Pokémon glitch website
Re: The newcomer and experienced user's guide to G/S Arbitrary Code Execution!
« Reply #14 on: November 05, 2017, 12:34:11 pm »
I've added as an option to item codes, before TM10 (ret) a list of items which matches the opcodes you gave me, Couldntthinkofaname:
X Defense x1
X Speed + x1
TM06 x195
HM03 x18

Thanks! This makes easier to understand why everyone should focus on TM ACE imo  :P

Regarding the OAM DMA Hijacking, I'm unsure whether we can replace 2'd with péZ×.9'l'l'l'lx'd or péZ×.9'l'l'l'l2'd.
« Last Edit: November 05, 2017, 01:19:20 pm by Krys3000 »

Admin of the PRAMA Initiative, the main french Pokémon glitch website
http://www.prama-initiative.com
“Anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that 'my ignorance is just as good as your knowledge.'” - Isaac Asimov