Guides:SRAM Glitch ACE Setups (EN): Difference between revisions

From Glitch City Wiki
Jump to navigation Jump to search
Content added Content deleted
No edit summary
mNo edit summary
Tags: Mobile edit Mobile web edit
 
(38 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page serves as a repository for methods to quickly set up advanced ACE setups, starting from a fresh save file. These methods can be used for the English releases of Red & Blue.
This page serves as a repository for methods to quickly set up advanced ACE setups, starting from a fresh save file. These methods can be used for the English releases of Red & Blue. It is part of the [[Guides:TimoVM's_gen_1_ACE_setups|TimoVM's Gen 1 ACE setups]] set of guides.


The methods described here were heavily inspired by previous SRAM glitch setups developed by Evie (Chickasaurus GL), as well existing setups intended to be used for the Japanese releases.
The methods described here were heavily inspired by previous SRAM glitch setups developed by Evie (Chickasaurus GL), as well existing setups intended to be used for the Japanese releases.
Line 6: Line 6:


If you encounter any issues when going through this guide or would like to provide feedback, please contact TimoVM on the [https://discord.gg/EA7jxJ6 Glitch City Research Institute Discord].
If you encounter any issues when going through this guide or would like to provide feedback, please contact TimoVM on the [https://discord.gg/EA7jxJ6 Glitch City Research Institute Discord].

The contents of this guide are demonstrated in the following video:

{{youtube|jxu9VgwvkJw|TimoVM}}


=Setting up initial ACE=
=Setting up initial ACE=
Line 17: Line 21:
# Using an exploit known as "Map Script ACE", set up a method to quickly pick up an unlimited amount of Eevees
# Using an exploit known as "Map Script ACE", set up a method to quickly pick up an unlimited amount of Eevees
# Write code by repeatedly picking up and nicknaming Eevees. This will be used to build a program that allows you to more easily write arbitrary code.
# Write code by repeatedly picking up and nicknaming Eevees. This will be used to build a program that allows you to more easily write arbitrary code.

===Note: setting up ACE on an existing save===

While this guide is built with new saves in mind, the method itself is inherently compatible with existing saves that fulfill the following criteria:
* Must have reached Celadon City.
* Must be able to use Fly and have a party pokémon that has learned Fly.
* Must have set up the [[Expanded item pack]]. It is recommended to deposit all important items to the PC prior to setting up the expanded item pack.
* While setting up the expanded item pack, make sure to set it up in such a way that item slot #6 through #16 do not have any CANCEL buttons

Once you have all of these requirements, you can continue the guide from step 4 onward.


==Step 1: Starting a new game and setting up SRAM glitch==
==Step 1: Starting a new game and setting up SRAM glitch==
Line 128: Line 142:
| [[File:ThunderstoneLocation.png]] || Thunderstone || x06 || Go to the Thunderstone spot to get Thunderstone x0. Toss 250 from the stack, then swap to slot #8. (Make sure to preserve the x19 item stack in slot #7 so you can still use Fly)
| [[File:ThunderstoneLocation.png]] || Thunderstone || x06 || Go to the Thunderstone spot to get Thunderstone x0. Toss 250 from the stack, then swap to slot #8. (Make sure to preserve the x19 item stack in slot #7 so you can still use Fly)
|-
|-
| || TM14 || x42 || At the Thunderstone spot, swap the Thunderstone with the TM23 x64 stack 4 slots below, then toss 63 TM23s. Walk 1 step up and 9 step left to get TM14 x0. Toss 214 from the stack, then swap to slot #9.
| [[File:TM22Location.png]] || TM22 || x42 || At the Thunderstone spot, swap the Thunderstone with the TM23 x64 stack 4 slots below, then toss 63 TM23s. Walk 1 step up and 1 step left to get TM22 x0. Toss 214 from the stack, then swap to slot #9.
|-
|-
| [[File:GreatBallLocation.png]] || Great Ball || x135 || At the Thunderstone spot, walk 30 steps to the left to get Great Ball x0. Toss 99 from the stack, then toss an additional 22 from the stack to reach x135, then swap to slot #10.
| [[File:GreatBallLocation.png]] || Great Ball || x135 || At the Thunderstone spot, walk 30 steps to the left to get Great Ball x0. Toss 99 from the stack, then toss an additional 22 from the stack to reach x135, then swap to slot #10.
Line 144: Line 158:
| [[File:RareCandyLocation.png]] || Rare Candy|| x243 || At the Thunderstone spot, walk 7 steps to the right to get Rare Candy x0. Toss 13 from the stack, then swap to slot #16.
| [[File:RareCandyLocation.png]] || Rare Candy|| x243 || At the Thunderstone spot, walk 7 steps to the right to get Rare Candy x0. Toss 13 from the stack, then swap to slot #16.
|-
|-
| [[File:TM21Location.png]] || TM21 || x213 || At the Thunderstone spot, swap the Thunderstone with the TM23 x64 stack 4 slots below, then toss 63 TM23s. Walk 1 step up and 2 steps left to get TM21 x0. Toss 43 from the stack, then swap to slot #17.
| [[File:TM14Location.png]] || TM14 || x213 || At the Thunderstone spot, swap the Thunderstone with the TM23 x64 stack 4 slots below, then toss 63 TM23s. Walk 1 step up and 9 steps left to get TM14 x0. Toss 43 from the stack, then swap to slot #17.
|}
|}


Line 150: Line 164:


* Before opening the bag, walk 5 steps to the right from the entrance of the pokémon center. This will ensure that we can open the item bag without issues.
* Before opening the bag, walk 5 steps to the right from the entrance of the pokémon center. This will ensure that we can open the item bag without issues.
* Open the item bag and swap the TM21 x213 stack located in slot #17 to the item stack in slot #7. This will remove the ability to fly, but is required to complete the item code.
* Open the item bag and swap the TM14 x213 stack located in slot #17 to the item stack in slot #7. This will remove the ability to fly, but is required to complete the item code.
* Next, make sure your item bag looks as follows:
* Next, make sure your item bag looks as follows:


Line 179: Line 193:
|}
|}


After this item code, head to the room where you can pick up the gift Eevee. '''Do not pick up this Eevee yet''', make sure to save before continuing.
After assembling this item code, head to the room where you can pick up the gift Eevee. '''Do not pick up this Eevee yet''', make sure to save before continuing.


===Note: setting up ACE on an existing save===
===A small note regarding Eevee's room===

Before heading to the room where you can pick up the Gift Eevee, make sure to do the following:
* Full up your party with 6 pokémon, to ensure that newly picked up Pokémon will be sent to the PC.
* Change the active box to an empty box.
* '''Only if you have already picked up the gift Eevee in the past''', catch any pokémon, nickname it so that it matches the name shown below, then send it to the currently empty box.

{| class="wikitable"
! Nickname
|-
![[File:InfiniteEeveeMode.png]]
|}

===Note: unterminated name items in Eevee's room===


Within this room, no safe spots exist that allow unterminated name items to be safely handled. Please make sure to not press a or select on unterminated items while in this room.
Within this room, no safe spots exist that allow unterminated name items to be safely handled. Please make sure to not press a or select on unterminated items while in this room.
Line 214: Line 241:
|}
|}


* Pick up an Eevee and nickname it so that its name matches the above screenshot on the left. It will be sent to the current active box.
* Pick up an Eevee and nickname it so that its name matches the above screenshot on the left. It will be sent to the current active box. '''Previously existing saves that have already picked up Eevee in the past must skip this step.'''
* Open the item bag. Swap the Rare Candy x243 with the contents of item slot #41, which should contain Dire Hit x93. This will activate Map Script ACE.
* Open the item bag. Swap the Rare Candy x243 with the contents of item slot #41, which should contain Dire Hit x93. This will activate Map Script ACE.
* Close the start menu. If everything went all right, Eevee's poké ball will have reappeared.
* Close the start menu. If everything went all right, Eevee's poké ball will have reappeared.
Line 227: Line 254:
===Setting up 4F to execute item codes===
===Setting up 4F to execute item codes===


Next, we'll be entering a list of five nicknames that gives us 4F and the necessary bootstrap. This ensures that using 4F will activate the item code.
Next, we'll be entering a list of three nicknames that gives us 4F and the necessary bootstrap. This ensures that using 4F will activate the item code.


{| class="wikitable"
{| class="wikitable"
Line 249: Line 276:
===Setting up the Nickname Writer===
===Setting up the Nickname Writer===


* Next, we'll be entering a list of fourteen nicknames. This will form a small program that, when activated using 4F, will allow us to easily write large amount of arbitrary code using the nickname screen.
* Next, we'll be entering a list of thirteen nicknames. This will form a small program that, when activated using 4F, will allow us to easily write large amount of arbitrary code using the nickname screen.


{| class="wikitable"
{| class="wikitable"
Line 258: Line 285:


* Pick up Eevees and enter the nicknames in the above screenshot one by one. '''The nicknames from this list needs to be entered in this exact order from the top to the bottom.'''
* Pick up Eevees and enter the nicknames in the above screenshot one by one. '''The nicknames from this list needs to be entered in this exact order from the top to the bottom.'''
* Once all nicknames have been entered, look at your trainer card, then use 4F. This should open a screen in which you're asked to enter a pokémon's nickname
* Exit the room and head to the pokémon center. We'll be testing out the Nickname writer.
* Once you're at the pokémon center, use 4F. This should open a screen in which you're asked to enter a pokémon's nickname
* For now, press START to end writing the nickname. This should display the main menu, a number should be written on screen.
* For now, press START to end writing the nickname. This should display the main menu, a number should be written on screen.
* Press SELECT to exit the Nickname Writer safely.
* Press SELECT to exit the Nickname Writer safely.
Line 267: Line 293:
From this point onward, whenever you use the ACE item, you should be able to open the nickname writer. Please make sure to keep note of the following:
From this point onward, whenever you use the ACE item, you should be able to open the nickname writer. Please make sure to keep note of the following:
* Since the Nickname Writer works independently of the current active box, you can change the current active box however much you like.
* Since the Nickname Writer works independently of the current active box, you can change the current active box however much you like.
* When writing data, the Nickname Writer will overwrite enemy party data. While this does not have any effect outside of battle, it is recommended to not use the Nickname Writer in battle.
* Make sure to only use the Nickname Writer inside a pokémon center to ensure that the checksums are correctly displayed.'''
* As a side effect, the Nickname Writer will overwrite the nicknames of the party pokémon corresponding with the current item slot of 4F. '''Please make sure to keep 4F in the first 6 item slots while using the Nickname Writer.'''


The program works as follows:
The program works as follows:
Line 275: Line 300:
* This nickname then gets converted to a sequence of five bytes.
* This nickname then gets converted to a sequence of five bytes.
* All five bytes are written starting from the starting location
* All five bytes are written starting from the starting location
* The program displays a checksum (sum of all written byte values) to confirm that you correctly entered the code. '''If the printed checksum doesn't match the expected checksum, you made a mistake entering a code.'''
* The program displays a glitched overworld view, along with a checksum (sum of all written byte values) towards the top right of the screen to confirm that you correctly entered the code. '''If the printed checksum doesn't match the expected checksum, you made a mistake entering a code.''' The glitched overworld view is temporary and will not affect your game.
* Afterwards, it waits for the user to decide what to do.
* Afterwards, it waits for the user to decide what to do.


During the input phase, the controls are as follows:
During the input phase, the controls are as follows:
* '''Press A''' for the program to ask for a new nickname and convert that to the next five bytes to be written.
* '''Press A''' for the program to ask for a new nickname and convert that to the next five bytes to be written.
* '''Press B''' to go back one byte at a time. The checksum will automatically be overwritten by the value written at the current selected address, giving you a measure of how far back you're going. '''This function is only needed if you accidentally confirmed a nickname without writing all 10 characters.'''
* '''Press B''' to go back one byte at a time. The checksum will automatically be overwritten by the value written at the current selected address, giving you a measure of how far back you're going. If a name is incorrect, press B five times before pressing A, entering the nickname again to overwrite the incorrect nickname.
* '''Press START''' to immediately start executing the newly written program. '''Only do this when you've finished writing everything.'''
* '''Press START''' to immediately start executing the newly written program. '''Only do this when you've finished writing everything.'''
* '''Press SELECT''' to safely quit the Nickname Writer, without executing the newly written code.
* '''Press SELECT''' to safely quit the Nickname Writer, without executing the newly written code.
* '''Press any button on the D-pad''' to go back five bytes and ask for a new nickname to correct errors. '''Use this if the printed checksum does not match the predicted checksum and the last written nickname contained ten characters.'''


{| class="wikitable"
{| class="wikitable"
! Write mode !! Input mode
! Write mode !! Input mode
|-
|-
![[File:RB Name writer write mode.png|thumb]]!![[File:RB Name writer input mode.png|thumb]]
! [[File:RB Name writer write mode.png]]
! [[File:RB Name writer input mode.png]]
|-
|-
| Press select to switch between uppercase/lowercase || Checksum is displayed right next to ITEM
| Enter nickname, press select to switch between uppercase/lowercase || Checksum ("4E", in this case) is displayed as a hex value on the top right quadrant
|}
|}


Line 296: Line 321:


At this point, there are certain side effects that have been introduced by the setup:
At this point, there are certain side effects that have been introduced by the setup:
* For all saves
* By picking up Eevee, we have flagged its poké ball as "obtained"
* We currently have two badges set as obtained
** By picking up Eevee, we have flagged its poké ball as "obtained"
* The current active box is filled with nicknamed Eevees
** The current active box is filled with nicknamed Eevees
* Setting up SRAM glitch has given us a party of 255 pokémon
** The item pack currently has 255 items
* The item pack currently has 255 items
** The item code is currently still required to run the Nickname Writer
* For new saves only
* The item code is currently still required to run the Nickname Writer
** We currently have two badges set as obtained
* We are currently located in the Celadon Pokémon center, while we need to return to Pallet Town to pick up the starter pokémon
* Our pokédex currently has 152 pokémon species caught, preventing the story from continuing
** Our pokédex currently has 152 pokémon species caught, preventing the story from continuing
** Setting up SRAM glitch has given us a party of 255 pokémon
** We are currently located in the Celadon Pokémon center, while we need to return to Pallet Town to pick up the starter pokémon


We will be removing all these side effect using the Nickname Writer. The nicknames we need to enter will be generated by the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]. Simply open the link, copy paste the entire code below into the converter, then press the "Run" button to display the list of nicknames. Please make sure that you use the Nickname Writer within a poké center, to ensure that the checksums are displayed properly.
We will be removing all these side effect using the Nickname Writer. The nicknames we need to enter will be generated by the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]. Simply open the link, copy paste one of the two codes below into the converter, then press the "Run" button to display the list of nicknames.


'''When using the Nickname Writer, the generated nicknames need to be entered from top to bottom.'''
'''When using the Nickname Writer, the generated nicknames need to be entered from top to bottom.'''

Please ensure to pick the code that suits your type of save.


{| class="wikitable"
{| class="wikitable"
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
! New Saves !! Older Saves
|-
|-
| <pre>21 AE D5 CB AE
| <pre>21 AE D5 CB AE
Line 323: Line 353:
3E 21 66 DA 36
3E 21 66 DA 36
6A 23 36 D6 C9
6A 23 36 D6 C9
</pre> || <pre>21 AE D5 CB AE
AF 21 80 DA 22
3D 22 AF EA 1D
D3 21 66 DA 36
6A 23 36 D6 01
01 59 C3 2E 3E
</pre>
</pre>
|}
|}


Once all 11 codes have been entered and verified, you can press START during input mode to execute the code.
Once all nicknames have been entered and verified, you can press START during input mode to execute the code.


This will activate the following effects:
This will activate the following effects:
* For all saves:
* Reset the state of Eevee's poké ball, allowing it to be picked up again at a later point
** Reset the state of Eevee's poké ball, allowing it to be picked up again at a later point
* Reset all badges
* Empty the current active box
** Empty the current active box
** Resets the bag, removing all items aside from 4F and removing the inventory underflow state
* Reset all Pokédex flags
** Rewire 4F so that it can activate the Nickname Writer independently of the item code
* Removes all party pokémon
* Only for new saves:
* Resets the bag, removing all items aside from 4F and removing the inventory underflow state
** Reset all badges
* Alters the exit of the poké center to lead out to Pallet Town
** Reset all Pokédex flags
** Removes all party pokémon
** Alters the exit of the poké center to lead out to Pallet Town


From this point onward, you can exit the Poké Center and continue the story as normal.
From this point onward, you can exit the penthouse and continue the story as normal.


==Addendum: Additional codes==
==Additional applications of the Nickname Writer==


The Nickname Writer allows you to easily write and execute arbitrary payloads. You can either make and execute your own codes, or head to the [[Guides:Nickname Writer Codes|Nickname Writer codes]] page. This page contains a collection of assembly for nickname codes that can be used for a variety of common purposes such as editing pokémon and items, editing player stats, resetting legendaries etc..
The following codes can be used with the Nickname Writer:


[[Guides:Nickname Writer Codes|Nickname Writer Codes]]
===Giving yourself a VC transferable Mew===


=Addendum: raw text transcripts of nickname codes=
Effects:
* Remove all pokémon from the party.
* Add a lvl 5 Mew. This Mew cannot be transferred to gen 7 without additional modifications.
* Add a second lvl 5 Mew. This Mew is transferable and will be shiny upon transfer.


These are provided as an alternative in case images fail to load.
Warning:

* This code is intended to be used right after setting up the Nickname Writer. Be mindful that it will remove the entirety of your party in the process.
==Infinite Eevee Mode Nickname==
* '''In order to be able to transfer, make sure to NOT give a nickname to the second Mew.'''


{| class="wikitable"
{| class="wikitable"
! Nickname
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
|-
|-
| <pre>AF EA 63 D1 01
|<pre>
C l l U ( ( : ; W ;
05 15 C5 CD 48
</pre>
3E C1 CD 48 3E
21 A3 D1 3E 59
22 36 0C 2E B2
3E AA 22 22 21
7E D2 3E 86 22
3D 22 36 50 C9</pre>
|}
|}


==4F Bootstrap Nicknames==
===PokeGiver script===


{| class="wikitable"
Effects:
! List of nicknames
* Change second bag item to ACE item "4F".
|-
* Set up everything so that 4F will activate the PokéGiver script (regardless of the current active box).
|<pre>
g . y y ] , k Mn * Pk
* ( ; ! ? ) [ [ ] ,
w v v u U l k Mn Pk X
</pre>
|}


==Nickname Writer==
How to use the PokéGiver script:
* Please use a different box than the one that contains the Nickname Writer.
* Use 4F to activate the script. Once activated, the script will do the following:
** Give a pokémon.
** If the pokémon is deposited to the PC, the Pokémon will be made shiny. The default code will give female shiny pokémon (if the gender ratio allows it).
** Display two numbers (in hexadecimal) on screen. The left number indicates the species ID of the pokémon to be given, the right number indicated the level the pokémon is to be given at.
** The numbers can be altered by using the d-pad. Press A to confirm the values and give the next pokémon. Press Start to stop the script without giving any more pokémon.
** The script will stop automatically once the current active box is full.

Warnings:
* Species IDs do not match pokédex IDs in gen 1. Please use the Big Hex List article to determine which Species IDs give which pokémon.
* Be mindful of using this code to give yourself glitch pokémon, as the seen flags set by these glitch pokémon can alter the contents of the bag.
* The script is located in the area of memory that corresponds with enemy trainer party data. The script persists through saves, but will be destroyed when battling any trainer.
* Nickname writer codes with a length of up to 4 nicknames can be used without overwriting the PokéGiver script.


{| class="wikitable"
{| class="wikitable"
! List of nicknames
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
|-
|-
| <pre>3E 59 EA 20 D3
|<pre>
a b v v ) l l C d d
21 AD D8 11 65
j ? ) V t v v v l Mn
DA 01 03 00 C3
q p y y ] z y p g F
B5 00 C3 B1 D8
a * j ? t K K b c c
00 3E 01 E0 B7
R j j m v w w P P p
01 01 01 CD 48
l l M v V v v l : ♀
3E D0 21 B1 DA
P x w v v W M m m w
36 2A 23 36 AA
A B r q x Pk z g g h
21 B7 D8 11 91
i z , [ o w o x w x
C4 CD F1 D8 13
( ) ) ) ) , , ] ] .
2B CD F1 D8 CD
j ! U ? ? u w v u -
31 38 F0 B5 FE
v x w y y ♀ ♂ ♂ w w
01 28 DA 07 38
r p P X [ : : ; : ;
10 07 38 0B 23
</pre>
07 38 09 07 38
04 07 30 D9 D8
34 34 35 18 D3
CD F4 D8 CB 36
7E E6 0F C6 F6
F6 80 12 13 C9</pre>
|}
|}


=Addendum: technical explanation of the setup=
====Altering the PokéGiver script so that it is kept after battle====


==Nickname Converter Item Code==
By executing the following two nickname codes, you can ensure that you can keep using the PokéGiver script even after engaging in trainer battles.


===Explanation===
First, execute the following code:


The item code itself consists of two components. The first 10 items are used to write a program that takes text characters from the nicknames of characters currently within the active box, converts them, then writes the resulting values to unused memory starting from $D66A.
{| class="wikitable"
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
|-
| <pre>21 02 0A 74 26
40 75 01 FF 00
11 53 BA 21 B1
D8 C3 B5 00 00</pre>
|}


Pairs of text characters are converted to single values through a [(2a + b)%256] formula, where a is the value of the first character and b the value of the second. text terminators are skipped, the code will stop and execute the newly written code once it either reads a $00 value or if values are being read past $DEFF.
Using this code will store a copy of the PokéGiver script in an unused area of memory, located in sram bank 02 at $BA53 (right after box #5).


<pre>
Next, execute the following code:
11 6A D6 ld de, UNUSED_MEMORY ; Memory between $D66A and $D6EF goes unused
D5 push de
21 06 DE ld hl, wBoxNicks
.loop
2A ldi a, (hl)
03 inc bc ; Filler, no effect on flags
87 add a
0B dec bc ; Filler, compensates previous inc bc, no effect on flags
30 04 jp nc, .notChar ; Aside from space (should not be used), "add a" will only give nc if value read is not a text char
86 add a, (hl)
12 ld (de), a
2C inc l ; Affects z flag
13 inc de
.notChar
20 F4 jp nz, .loop ; loop unless l rolled over to $00 or value read was $00
C9 ret ; Due to previous push de, this ret will cause execution to resume from $D66A onward, immediately running the newly written code
</pre>


The last item, the Rare Candies, simply form a pointer to $F328. Due to echo RAM this address is equivalent to $D328, which correspond to item #6's item ID, the start of the item code. By replacing the map script pointer with this item, we can redirect the map script routine to execute the item code instead. This routine is executed on every frame, as long as the start menu isn't open.
{| class="wikitable"
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
|-
| <pre>01 19 00 11 65
DA 21 A8 D8 C3
B5 00 11 B1 D8
D5 21 02 0A 74
26 40 E5 75 01
FF 00 21 53 BA
CD B5 00 E1 36
00 C9 </pre>
|}


===Raw Assembly===
This code will alter the bootstrap of 4F such that, when it is used, it will look up the copy of the PokéGiver script and once more copy it over to $D8B1, in the middle of enemy trainer data, where it will immediately be executed.


<pre>
Please make sure to not use 4F during trainer battles, as it will overwrite buffered trainer data leading to unintended side effects.
11 6A Max Potion x106
D6 D5 TM14 x213
21 06 Thunderstone x06
DA 2A TM22 x42
03 87 Great Ball x135
0B 30 Antidote x48
04 86 Poké Ball x134
12 2C Hyper Potion x44
13 20 Super Potion x32
F4 C9 TM44 x201


28 F3 Rare Candy x243
The bootstrap for 4F is located in daycare data. To preserve the bootstrap, you will unable to store or retrieve any pokémon from the Day-Care.
</pre>


==Infinite Eevee Nickname==
If the bootstrap fails to work, you can reapply the bootstrap by executing the second code again.


===Explanation===
===Changing the gender of pokémon given by the PokéGiver script===


The Infinite Eevee mode nickname writes $00 to the lower byte of wMissableObjectList, causing a misalignment in how the game applies NPC disappearance, causing Eevee's pokéball to stay permanently visible until the game is reset or the player leaves the Celadon Mansion penthouse.
With the PokéGiver script installed, you can use the following codes to change the gender of the pokémon given by the script.


<pre>
{| class="wikitable"
AF xor a ; a = $00
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
EA CE D5 ld (wMissableObjectList), a ; Misaligns which objects are made invisible
|-
C9 ret
! rowspan="7" | All Languages
</pre>
|-
! Female Shiny !! Male Shiny
|-
| <pre>3E 2A EA C0 D8
C9 00 00 00 00</pre>
|| <pre>3E FA EA C0 D8
C9 00 00 00 00</pre>
|}


===Raw Assembly===
===Changing a Mew to be VC transferable===


<pre>
This code changes the data of the 6th party pokémon to have an OT ID of 22796 and a nickname of "GF". By putting a Mew in the sixth party slot and executing the code, the Mew can be passed through poké transporter to gen 7.
AF EA CE D5 C9
</pre>


==4F Boostrap Nicknames==
It is small enough to not destroy the PokéGiver script.


This set of nicknames, when converted, will modify item #1's ID to be 4F and writes a bootstrap so that using it will lead to execution of the item code from $D328 onward. It requires the presence of the Infinite Eevee Mode Nickname (see previous section) to properly return.
{| class="wikitable"
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
|-
! All Languages
|-
| <pre>21 53 D2 3E 59
22 36 0C 21 AA
D2 3E 86 22 3E
85 22 36 50 C9</pre>
|}


<pre>
===Installing a RAM writer===
21 1E D3 ld hl, wBagItems ; item #1's ID
36 59 ld (hl), $59 ; 4F's item ID
7C ld a, h ; a = $D3
21 67 DA ld hl, 4F_Execution_Pointer +2
32 ldd (hl), a
3E 28 ld a, $28
22 ldi (hl), a
36 C3 ld (hl), $C3
; The contents of the first nickname (see previous section) are written right after this, ensuring safe return.
</pre>


===Raw Assembly===
A RAM writer is an installable program that allows you to view and change any value in memory using a graphical user interface. This allows you to easily change specific values, set up and run small payloads and verify specific values in memory.


<pre>
{| class="wikitable"
21 1E D3 36 59
|+ Codes to be used with the [https://timovm.github.io/NicknameConverter/ Nickname Converter webtool]
7C 21 67 DA 32
|-
3E 28 32 36 C3
| <pre>3E 03 CD 92 D9 3E 59 EA 1E D3
</pre>
01 45 00 11 53 BA 21 C3 D8 CD
B5 00 11 30 D4 0E 78 CD B5 00
11 65 DA D5 0E 1B C3 B5 00 AF
3C E0 B6 E0 B7 21 00 DA CD 30
D4 E5 11 F8 FF 19 54 5D 01 0C
00 CD 75 DA 21 A9 C3 CD 99 D4
3E 7C 22 7A CD 99 D4 7B CD 99
D4 3E E3 22 1A CD 99 D4 36 7C
09 13 7D FE 13 20 E5 26 00 74
21 50 C4 36 ED E1 18 C4 CD 7A
D4 CB 5F 20 39 CB 57 28 0A 0F
30 01 E9 F0 FE 83 E0 FE C9 0F
30 2A E5 CD 75 DA 4E CD 7A D4
0F 38 12 0F 30 01 4B 79 83 4F
21 50 C4 36 EC 23 CD 99 D4 18
E8 E1 71 E5 06 1C 21 CE 77 CD
D6 35 E1 C9 0F 30 03 53 1E 00
19 C9 CD 31 38 F0 B5 76 11 00
00 F5 07 30 01 13 07 30 01 1B
07 30 03 11 F0 FF 07 30 02 1E
10 F1 C9 F5 CB 37 CD A0 D4 F1
E6 0F C6 F6 F6 80 22 C9 3E 03
CD 77 DA 11 E3 DE D5 21 53 BA
4D C3 B5 00 F0 FE E5 26 0A 74
26 40 77 E1 C9 </pre>
|}


====Using the full RAM writer====
==Using 4F==


===Explanation===
Assuming the program was entered correctly, the game should open up one of the screens as seen in the below screenshots. The RAM writer will draw various values on the screen. The leftmost 4 columns describe the addresses that are currently in view. The rightmost two columns describe the values at each of these addresses. All values on screen are represented in hexadecimal format.


Using 4F, an invalid item, will cause the game to index the item effects table out of bounds, leading to an invalid execution pointer. For 4F, this causes the game to execute code from $FA65 onward. Due to echo RAM, this address is equivalent to $DA65. Thanks to the bootstrap that was applied earlier, this will then cause the game to jump to $D328, corresponding to the start of the item code.
For example: DA01>05 means that the address $DA01 is currently holding the value of $05.


<pre>
'''Make sure to save the game after you've confirmed that the RAM writer is fully functional.'''
C3 28 D3 jp ITEM_6_ID
</pre>


===Raw Assembly===
The RAM writer can also be used during battle. Opening and closing the RAM writer in battle will pass your turn to the enemy and cause the battle to continue as usual.


<pre>C3 28 D3</pre>
Due to the location the RAM writer is buffered, upon closing the RAM writer in battle in Red/Blue, you will see a slight graphical corruption at the bottom of the screen that will immediately be overwritten by the battle text box. This corruption is purely cosmetic and temporary, meaning that it will not cause any harm to your game.


====Full Writer Controls====
==Nickname Writer==


===Explanation===
The RAM writer uses two modes of operation. In Read mode you are able to navigate memory and view the values at specific addresses. in Write mode you'll lock in a single address and manipulate the value at that address. By default, the RAM writer will open in Read mode.


The Nickname Writer is a small program that, using nicknames as input, is able to write arbitrary amounts of custom code relatively quickly. It first request a nickname as input, then converts that data to custom code, then displays a checksum of the written data and finally asks the player to provide additional input.
{| class="wikitable"

|[[file:Full RB DA96 Read mode.png|288px]]||[[file:Full_RB_DA96_Write_mode.png|288px]]
The value of the checksum is calculated by [($80 + the sum of all written values)%256]. Custom code is buffered and executed within enemy party data. Due to how it calls DisplayNameRaterScreen, it will also nickname a party pokémon corresponding to the item slot that 4F currently occupies.
|-
|RAM writer in Read mode ||RAM writer in Write mode.
|}


=====Read mode controls=====
<pre>
<pre>
11 B5 D8 ld de, $D8B5 ; location written to
up: address -1
D5 push de
down: address +1
.newMail
left: address -10
D5 push de
right: address +10
21 24 65 ld hl, AskName + 39h ; Prepares data and calls DisplayNamingScreen
CD 22 39 call $3922 ; sets b to 01, then jumps to Bankswitch, calling b:hl
B + up: address -1
0E 80 ld c, $80 ; Ensure checksum consistency
B + down: address +1
21 4B CF ld hl, wStringBuffer ; Address where new name gets written to
B + left: address -10
D1 pop de ; Continue writing from last saved de
B + right: address +10
.newChar
2A ld a, (hli)
start: exit program
87 add a
A: toggle write mode
30 09 jp nc, .terminator ; If blank space as first character of pair, only terminator $50 will result in a nc result
86 add a, (hl)
12 ld (de), a
13 inc de
23 inc hl
81 add a, c ; Current checksum total is buffered in c
12 ld (de), a
4F ld c, a
18 F3 jp .newChar
.terminator
D5 push de
21 00 C4 ld hl, $C400 ; Corresponds to screen tile
0E 01 ld c, $01 ; How many bytes printed as numbers?
CD DF 15 call PrintBCDNumber.loop
.numLoop
2D dec l
CB FE set 7, (hl)
20 FB jp nz, .numLoop ; Repeat until hl == $C400
.inputLoop
CD 31 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
F0 B5 ld a, (hJoy5)
E6 0F and $0F ; Set z flag if A, B, START, SELECT not pressed
28 F7 jp z, .inputLoop
1F rra ; Is A pressed? If yes, set c flag
D1 pop de
38 CB jr c, .newMail
1B dec de
1F rra ; Is B pressed? If yes, set c flag
38 E1 jr c, .terminator
1F rra ; Is SELECT pressed? If yes, set c flag
E1 pop hl ; pop starting address to hl
D8 ret c ; If SELECT pressed, simply return to normal operations
E9 jp hl ; If START pressed, jump to hl to execute newly written code
</pre>


===Raw Assembly===
select + up: sram bank -1

select + down: sram bank +1
<pre>
select + left: sram bank -10
11 B5 D8 D5 D5
select + right: sram bank +10
21 5C 65 CD 22
select + A: start executing code from current address onwards (use with caution!)
39 0E 80 21 4B
CF D1 2A 87 30
09 86 12 13 23
81 12 4F 18 F3
D5 21 01 C4 4D
CD DF 15 2D CB
FE 20 FB 75 CD
31 38 F0 B5 E6
0F 28 F7 1F D1
38 CB 1B 1F 38
E1 1F E1 D8 E9
</pre>
</pre>


=====Write mode controls=====
==Cleanup Code (new save)==

===Explanation===

This code cleans up every negative side effect brought on by the setup and allows the player to continue the story as intended, with the exception of 4F being added to the item bag, enabling use of the Nickname Writer.

The negative effects targeted are:
* By picking up Eevee, we have flagged its poké ball as "obtained"
* The current active box is filled with nicknamed Eevees
* The item pack currently has 255 items
* The item code is currently still required to run the Nickname Writer
* We currently have two badges set as obtained
* Our pokédex currently has 152 pokémon species caught, preventing the story from continuing
* Setting up SRAM glitch has given us a party of 255 pokémon
* We are currently located in the Celadon Pokémon center, while we need to return to Pallet Town to pick up the starter pokémon

<pre>
<pre>
21 AE D5 ld hl, $D5AE ; Part of wMissableObjectFlags
up: value -1
CB AE res 5, (hl) ; Reenable Eevee's poké ball
down: value +1
AF xor a ; a = $00
left: value -10
EA 56 D3 ld (wObtainedBadges), a ; Reset badges
right: value +10
21 80 DA ld hl, wBoxCount
B: set current value to 0
22 ldi (hl), a ; Set amount of pokémon in box to 0
A: exit write mode and load final value into the address
3D dec a ; a = $FF
22 ldi (hl), a ; Add proper terminator to wBoxSpecies
AF xor a ; a = $00
01 26 00 ld bc, 0026
21 F7 D2 ld hl, wPokedexOwned
.loop
22 ldi (hl), a
0D dec c
20 FC jp nz, .loop ; Fully clear all Pokédex flags
2E B1 ld l, $B1 ; hl = $D3B1, within wWarpEntries
22 ldi (hl), a
22 ldi (hl), a
23 inc hl
23 inc hl
22 ldi (hl), a
22 ldi (hl), a ; Changes first two warp tiles to lead to Pallet Town instead
EA 63 D1 ld (wPartyCount), a ; Set amount of pokémon in party to 0
EA 1D D3 ld (wNumBagItems), a ; Set amount of items to 0
01 01 59 ld bc, $5901
CD 2E 3E call GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
21 66 DA ld hl, $DA66 ; Part of 4F bootstrap
36 6A ld (hl), $6A
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
C9 ret
</pre>
</pre>

===Raw Assembly===

<pre>
21 AE D5 CB AE
AF EA 56 D3 21
80 DA 22 3D 22
AF 01 26 00 21
F7 D2 22 0D 20
FC 2E B1 22 22
23 23 22 22 EA
63 D1 EA 1D D3
01 01 59 CD 2E
3E 21 66 DA 36
6A 23 36 D6 C9
</pre>

==Cleanup Code (existing save)==

===Explanation===

This code cleans up every negative side effect brought on by the setup and allows the player to continue the story as intended, with the exception of 4F being added to the item bag, enabling use of the Nickname Writer.

The negative effects targeted are:
* By picking up Eevee, we have flagged its poké ball as "obtained"
* The current active box is filled with nicknamed Eevees
* The item pack currently has 255 items
* The item code is currently still required to run the Nickname Writer

Since existing saves do not have to set up SRAM glitch, there are a lot less side effects that need to be addressed by the cleanup code.

<pre>
21 AE D5 ld hl, $D5AE ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
21 80 DA ld hl, wBoxCount
22 ldi (hl), a ; Set amount of pokémon in box to 0
3D dec a ; a = $FF
22 ldi (hl), a ; Add proper terminator to wBoxSpecies
AF xor a ; a = $00
EA 1D D3 ld (wNumBagItems), a ; Set amount of items to 0
01 01 59 ld bc, $5900
CD 2E 3E call GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
21 66 DA ld hl, $DA66 ; Part of 4F bootstrap
36 6A ld (hl), $6A
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
01 01 59 ld bc, $5901
C3 2E 3E jp GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
</pre>

===Raw Assembly===

<pre>
21 AE D5 CB AE
AF 21 80 DA 22
3D 22 AF EA 1D
D3 21 66 DA 36
6A 23 36 D6 01
01 59 C3 2E 3E
</pre>

[[Category:Guides]]

Latest revision as of 09:46, 2 April 2024

This page serves as a repository for methods to quickly set up advanced ACE setups, starting from a fresh save file. These methods can be used for the English releases of Red & Blue. It is part of the TimoVM's Gen 1 ACE setups set of guides.

The methods described here were heavily inspired by previous SRAM glitch setups developed by Evie (Chickasaurus GL), as well existing setups intended to be used for the Japanese releases.

Please make sure to fully read every step of the guide before executing them.

If you encounter any issues when going through this guide or would like to provide feedback, please contact TimoVM on the Glitch City Research Institute Discord.

The contents of this guide are demonstrated in the following video:

YouTube video by TimoVM


Setting up initial ACE

When you use UP + SELECT + B on the title screen, the game will delete the save by filling the entirety of SRAM with $FF values. When you then interrupt the very first save process with specific timing, you can create a glitched save file that has a party consisting of 255 ($FF) pokémon. This is known as "SRAM glitch".

Within this glitched state, we can abuse the expanded party to affect memory areas that are normally unrelated to the party, with a wide variety of possible effects. In this guide, we will be abusing this to set up an ACE environment through the following process:

  1. Set up SRAM glitch
  2. Using SRAM glitch, access Celadon City so that we can assemble an item code that will allow us to write code using boxed pokémon's nicknames.
  3. Using an exploit known as "Map Script ACE", set up a method to quickly pick up an unlimited amount of Eevees
  4. Write code by repeatedly picking up and nicknaming Eevees. This will be used to build a program that allows you to more easily write arbitrary code.

Note: setting up ACE on an existing save

While this guide is built with new saves in mind, the method itself is inherently compatible with existing saves that fulfill the following criteria:

  • Must have reached Celadon City.
  • Must be able to use Fly and have a party pokémon that has learned Fly.
  • Must have set up the Expanded item pack. It is recommended to deposit all important items to the PC prior to setting up the expanded item pack.
  • While setting up the expanded item pack, make sure to set it up in such a way that item slot #6 through #16 do not have any CANCEL buttons

Once you have all of these requirements, you can continue the guide from step 4 onward.

Step 1: Starting a new game and setting up SRAM glitch

First, we need to set up SRAM glitch.

  • Clear all saved data by pressing UP + SELECT + B on the title screen and confirming that you want to erase all saved data. (This needs to be done even if no save data is present).
  • Start up the game and go through the intro. Name your character and rival any name you want.
  • Open the start menu, and select "Save".
  • Select "Yes" in the "Yes/No" dialog box. At a very precise moment, power off or reset the console.
    • Soft resetting (holding Start+Select+A+B) will not work, as the game prevents soft resets while it is saving.
    • The timing to power off or reset is after the "Yes/No" dialog box has disappeared, but before the text changes to "Now saving..." (Red/Blue) or "Saving..." (Yellow).
      • The time window between those two visual cues is around 20 frames (depending somewhat on the version and the circumstances), but the window to successfully perform this glitch is only 4 frames.
  • Reload the game. If you can continue the game and can open the pokémon menu, you have successfully set up SRAM glitch and can continue with the guide. Otherwise, repeat the process from the start, erasing the save in the process.

A quick note on the effects of SRAM glitch

Thanks to clearing out the previous save using UP + SELECT + B, which fills saved data with $FF values, we will reload with a party consisting of 255 ($FF) pokémon. There are, however, quite a number of side effects due to this:

  • Having 255 party pokémon makes us unable to enter battle without heavy side effects. Due to this, we will be avoiding battle completely.
  • It is heavily recommended to not look at the summary of any of the party pokémon, since they are made up of glitched data.
  • Thanks to having 255 party pokémon, we are able to swap pokémon beyond the 6th party slot.
  • Every few steps, the game will act as if at least one party pokémon is poisoned. This effect can be freely ignored.

Throughout the guide, codes are provided that resolve these side effects and allow you to resume normal game progression.

A quick note regarding unterminated name items

Certain glitch items lack a proper string terminator. When you select them, either by pressing A or select when highlighting them in the bag, these items will crash the game. On the Virtual Console releases, this has a possibility of erasing your save. When you see any item with an unusually long glitched name, please make sure to not use either of these buttons to select them.

In certain maps, such as Celadon City, opening the item bag or scrolling the item bag to display an unterminated name item will cause the game to seemingly freeze. You can cause the game to safely resume by tapping b regularly until the game continues.

In the Celadon City map, unterminated name items can be made safe to handle as long as at least one tree is visible on the upper row of the map while the start screen is opened. Under these circumstances, unterminated name items can be safely selected with a or select. This will also ensure that you do not need to tap b multiple times in order to scroll through unterminated name items, but certain items may still require a single b press to scroll through.

During the guide, care is taken to ensure that we'll only stand on these safe spots when using the item bag.

Step 2: Reaching Celadon City

The main item code will be assembled in Celadon City. We will be abusing the extended party's properties to obtain an expanded item pack. The expanded item pack is a glitched state where the game thinks that we have 255 ($FF) items in the item pocket, even though the item pocket usually has a maximum size of only 20 items. This allows us to access areas of memory beyond the item pack and treat them as if they are items. We will be abusing this to warp directly to Celadon City.

Place to stand
  • Go downstairs and exit your house to Pallet Town. This registers Pallet Town as a Fly location, preventing a possible crash at a later point in the guide.
  • Go back inside your house and take a single step to the right, so you end up at the location indicated by the screenshot above.
  • Open the party menu and swap the 2nd party pokémon with the 10th pokémon. This sets the amount of pokémon caught in the pokédex to 152, as well as setting the amount of items in the bag to 255.
  • Open the item bag and scroll down to the 36th item slot. This will be a Master Ball with quantity x0 (see screenshots below). Toss a total of 250 items from it for a final quantity of 6. When tossing, you can press down to underflow the amount of items to be tossed from 0 to 255, then press down 5 more times.
  • Exit your house. Thanks to changing the item quantity, you will exit to Celadon City.
Slot #36

Step 3: Setting up a pokémon that can use Fly

In order to assemble the required item code, we need a pokémon that knows Fly and we need the necessary badge to be able to use it. We will be abusing the mechanics of the extended party and the extended inventory to add Fly to the 11th party pokémon.

Potion location
  • From where you exited out to Celadon, Walk 6 steps right, 4 steps up,6 steps right and another 4 steps up so you end up at the spot indicated by the above screenshot on the left. At this spot, the item in the 35th item slot will have turned into a Potion x0, as indicated by the below screenshots. Using Select, swap this Potion x0 to the 29th item slot. This will give you the Thunderbadge and the Soulbadge, allowing you to use both Surf and Fly. Check your trainer card, you should now have the third and fifth badges.
  • In the 39th item slot, you'll find a TM23 x64 stack. Toss 45 items from this stack until you get a TM23 x19 stack, then swap it to the 7th item slot. This will alter party pokemon #11's data and allow it to use Fly.
  • Finally, open the party menu, select the 11th party pokémon and have it use fly. Fly directly to Celadon City. If it doesn't have fly, make sure that the TM23 x19 stack is located in item slot #7.
  • After you've flown to the Celadon City poké center, it is advised to save.

It is now safe to save the game.

Slot #35

Step 4: Assembling an item code in Celadon City

While standing in front of the Celadon City Pokémon Center, take 3 steps right, 5 steps up, 11 steps left and finally 3 steps up to reach the following spot. Make sure to bring a pokémon with Fly/Teleport.

Place to stand

While standing on this spot, open your item bag and keep scrolling down until you find a Thunderstone x0 item stack, located at item slot #35 as indicated by the below screenshot. We will use this spot to orient ourselves for the next section.

Slot #35

By walking left or right, you can increment or decrement the item ID in slot #35. By walking up and down we can alternate between an item quantity of x0 and x1. We can safely swap the contents of item slot #35 with other item slots, as long as we use Fly/Teleport afterwards to restore the map back to normal. We can use this to collect all the items we need for the item code. slot #33 will always contain a bicycle, you can safely use this to speed up the process.

For every item in the following table, head to the Thunderstone x0 spot, follow the instructions to obtain an item stack, then Fly back to Celadon and head back to the same spot to obtain the next item stack. It is heavily recommended to save after every time you fly back to the Celadon City Pokémon Center.

During the entire process, make sure to not swap two item stacks that have the same item. This will cause both item stacks to merge, resulting in glitches as side effects. When this happens, you can reset the game to restore the game back to normal.

Item location Item ID Item quantity How to acquire
Max Potion x106 At the Thunderstone spot, walk 16 steps to the left to get Max Potion x0. Toss 99 from the stack, then toss another 51 from the stack, then swap to slot #6.
Thunderstone x06 Go to the Thunderstone spot to get Thunderstone x0. Toss 250 from the stack, then swap to slot #8. (Make sure to preserve the x19 item stack in slot #7 so you can still use Fly)
TM22 x42 At the Thunderstone spot, swap the Thunderstone with the TM23 x64 stack 4 slots below, then toss 63 TM23s. Walk 1 step up and 1 step left to get TM22 x0. Toss 214 from the stack, then swap to slot #9.
Great Ball x135 At the Thunderstone spot, walk 30 steps to the left to get Great Ball x0. Toss 99 from the stack, then toss an additional 22 from the stack to reach x135, then swap to slot #10.
Antidote x48 At the Thunderstone spot, walk 22 steps to the left to get Antidote x0. Toss 208 from the stack, then swap to slot #11.
Poké Ball x134 At the Thunderstone spot, walk 29 steps to the left to get Poké Ball x0. Toss 99 from the stack, then toss an additional 23 from the stack to reach x134, then swap to slot #12.
Hyper Potion x44 At the Thunderstone spot, walk 15 steps to the left to get Hyper Potion x0. Toss 212 from the stack, then swap to slot #13.
Super Potion x32 At the Thunderstone spot, walk 14 steps to the left to get Super Potion x0. Toss 224 from the stack, then swap to slot #14.
TM44 x201 At the Thunderstone spot, swap the Thunderstone with the TM23 x64 stack 4 slots below, then toss 63 TM23s. Walk 2 steps down, 12 steps right, 5 steps down and then 9 steps right to get TM44 x0. Toss 55 from the stack, then swap to slot #15.
Rare Candy x243 At the Thunderstone spot, walk 7 steps to the right to get Rare Candy x0. Toss 13 from the stack, then swap to slot #16.
TM14 x213 At the Thunderstone spot, swap the Thunderstone with the TM23 x64 stack 4 slots below, then toss 63 TM23s. Walk 1 step up and 9 steps left to get TM14 x0. Toss 43 from the stack, then swap to slot #17.

After flying back to Celadon city, we will verify if all items have been successfully collected.

  • Before opening the bag, walk 5 steps to the right from the entrance of the pokémon center. This will ensure that we can open the item bag without issues.
  • Open the item bag and swap the TM14 x213 stack located in slot #17 to the item stack in slot #7. This will remove the ability to fly, but is required to complete the item code.
  • Next, make sure your item bag looks as follows:
Item slot Item ID Item Quantity
Slot #6 Max Potion x106
Slot #7 TM14 x213
Slot #8 Thunderstone x06
Slot #9 TM22 x42
Slot #10 Great Ball x135
Slot #11 Antidote x48
Slot #12 Poké Ball x134
Slot #13 Hyper Potion x44
Slot #14 Super Potion x32
Slot #15 TM44 x201
Slot #16 Rare Candy x243

After assembling this item code, head to the room where you can pick up the gift Eevee. Do not pick up this Eevee yet, make sure to save before continuing.

Note: setting up ACE on an existing save

Before heading to the room where you can pick up the Gift Eevee, make sure to do the following:

  • Full up your party with 6 pokémon, to ensure that newly picked up Pokémon will be sent to the PC.
  • Change the active box to an empty box.
  • Only if you have already picked up the gift Eevee in the past, catch any pokémon, nickname it so that it matches the name shown below, then send it to the currently empty box.
Nickname

Note: unterminated name items in Eevee's room

Within this room, no safe spots exist that allow unterminated name items to be safely handled. Please make sure to not press a or select on unterminated items while in this room.

Step 5: Setting up an initial ACE environment using map script ACE

Now that we have an item code ready, we'll be using it to set up an ACE environment. The item code we just made looks at the nicknames of the pokémon in the currently stored box, then uses pairs of text characters to write a new program. After it finishes, it immediately jumps to execute the newly written program.

Having a party of 255 pokémon makes it impractical to safely enter battle. To circumvent this, we'll be picking up multiple Eevees, nicknaming them, then storing them in the current active box.

We'll be executing ACE by overwriting the contents of item slot #41. This item slot contains the map script pointer. By overwriting it with a pointer aimed for the 6th item slot, the item code we made will be executed on every individual frame the start menu isn't open.

We will be using this in three stages:

  • First we will alter a value in memory so that we can continuously keep picking up Eevees while we remain on the same map.
  • Next we will give ourselves a glitch item that, when used, will execute ACE starting from the sixth item slot. This allows us to execute ACE outside of the limits of Map Script ACE.
  • Finally we will set up a short program that uses the nickname screen to quickly and easily write programs of arbitrary size, effectively giving us a flexible ACE environment.

It is recommended to not save the game until the Nickname Writer program is installed.

A note on using ACE

The first generation of pokémon games, especially the Virtual console releases, are vulnerable to certain crashes wiping the save file. As a protective measure, make sure to open the trainer card to display Red's sprite on screen right before using ACE of any kind. Loading any sprite switches the current active sram bank, offering a measure of safety against game crashes.

Setting up Infinite Eevee mode

First, we'll use Map Script ACE to make sure that we can pick up as many Eevee as we want.

Nickname
  • Pick up an Eevee and nickname it so that its name matches the above screenshot on the left. It will be sent to the current active box. Previously existing saves that have already picked up Eevee in the past must skip this step.
  • Open the item bag. Swap the Rare Candy x243 with the contents of item slot #41, which should contain Dire Hit x93. This will activate Map Script ACE.
  • Close the start menu. If everything went all right, Eevee's poké ball will have reappeared.
  • Open the item bag. Swap the Dire Hit x93 that was previously in item slot #41 with the Rare Candy x243. This will deactivate Map Script ACE.
Slot #41

Setting up 4F to execute item codes

Next, we'll be entering a list of three nicknames that gives us 4F and the necessary bootstrap. This ensures that using 4F will activate the item code.

List of nicknames
  • Pick up Eevees and enter the nicknames in the above screenshot one by one. The nicknames from this list needs to be entered in this exact order from the top to the bottom.
  • Open the item bag. Swap the Rare Candy x243 with the contents of item slot #41, which should contain Dire Hit x93. This will activate Map Script ACE.
  • Close the start menu. If everything went all right, the CANCEL buttons in the first three slots have been removed and the first item was replaced with a glitch item named "4F"
  • Open the item bag. Swap the Dire Hit x93 that was previously in item slot #41 with the Rare Candy x243. This will deactivate Map Script ACE.
  • Finally, verify that 4F works by using it. If the game doesn't crash, 4F was set up correctly.
Slot #41

Setting up the Nickname Writer

  • Next, we'll be entering a list of thirteen nicknames. This will form a small program that, when activated using 4F, will allow us to easily write large amount of arbitrary code using the nickname screen.
List of nicknames
  • Pick up Eevees and enter the nicknames in the above screenshot one by one. The nicknames from this list needs to be entered in this exact order from the top to the bottom.
  • Once all nicknames have been entered, look at your trainer card, then use 4F. This should open a screen in which you're asked to enter a pokémon's nickname
  • For now, press START to end writing the nickname. This should display the main menu, a number should be written on screen.
  • Press SELECT to exit the Nickname Writer safely.

Using the nickname writer

From this point onward, whenever you use the ACE item, you should be able to open the nickname writer. Please make sure to keep note of the following:

  • Since the Nickname Writer works independently of the current active box, you can change the current active box however much you like.
  • When writing data, the Nickname Writer will overwrite enemy party data. While this does not have any effect outside of battle, it is recommended to not use the Nickname Writer in battle.

The program works as follows:

  • The program opens the nickname screen and asks you to input a nickname.
  • This nickname then gets converted to a sequence of five bytes.
  • All five bytes are written starting from the starting location
  • The program displays a glitched overworld view, along with a checksum (sum of all written byte values) towards the top right of the screen to confirm that you correctly entered the code. If the printed checksum doesn't match the expected checksum, you made a mistake entering a code. The glitched overworld view is temporary and will not affect your game.
  • Afterwards, it waits for the user to decide what to do.

During the input phase, the controls are as follows:

  • Press A for the program to ask for a new nickname and convert that to the next five bytes to be written.
  • Press B to go back one byte at a time. The checksum will automatically be overwritten by the value written at the current selected address, giving you a measure of how far back you're going. If a name is incorrect, press B five times before pressing A, entering the nickname again to overwrite the incorrect nickname.
  • Press START to immediately start executing the newly written program. Only do this when you've finished writing everything.
  • Press SELECT to safely quit the Nickname Writer, without executing the newly written code.
Write mode Input mode
Enter nickname, press select to switch between uppercase/lowercase Checksum ("4E", in this case) is displayed as a hex value on the top right quadrant

Step 6: Returning the game state to normal

At this point, there are certain side effects that have been introduced by the setup:

  • For all saves
    • By picking up Eevee, we have flagged its poké ball as "obtained"
    • The current active box is filled with nicknamed Eevees
    • The item pack currently has 255 items
    • The item code is currently still required to run the Nickname Writer
  • For new saves only
    • We currently have two badges set as obtained
    • Our pokédex currently has 152 pokémon species caught, preventing the story from continuing
    • Setting up SRAM glitch has given us a party of 255 pokémon
    • We are currently located in the Celadon Pokémon center, while we need to return to Pallet Town to pick up the starter pokémon

We will be removing all these side effect using the Nickname Writer. The nicknames we need to enter will be generated by the Nickname Converter webtool. Simply open the link, copy paste one of the two codes below into the converter, then press the "Run" button to display the list of nicknames.

When using the Nickname Writer, the generated nicknames need to be entered from top to bottom.

Please ensure to pick the code that suits your type of save.

Codes to be used with the Nickname Converter webtool
New Saves Older Saves
21 AE D5 CB AE
AF EA 56 D3 21
80 DA 22 3D 22
AF 01 26 00 21
F7 D2 22 0D 20
FC 2E B1 22 22
23 23 22 22 EA
63 D1 EA 1D D3
01 01 59 CD 2E
3E 21 66 DA 36
6A 23 36 D6 C9
21 AE D5 CB AE
AF 21 80 DA 22
3D 22 AF EA 1D
D3 21 66 DA 36
6A 23 36 D6 01
01 59 C3 2E 3E

Once all nicknames have been entered and verified, you can press START during input mode to execute the code.

This will activate the following effects:

  • For all saves:
    • Reset the state of Eevee's poké ball, allowing it to be picked up again at a later point
    • Empty the current active box
    • Resets the bag, removing all items aside from 4F and removing the inventory underflow state
    • Rewire 4F so that it can activate the Nickname Writer independently of the item code
  • Only for new saves:
    • Reset all badges
    • Reset all Pokédex flags
    • Removes all party pokémon
    • Alters the exit of the poké center to lead out to Pallet Town

From this point onward, you can exit the penthouse and continue the story as normal.

Additional applications of the Nickname Writer

The Nickname Writer allows you to easily write and execute arbitrary payloads. You can either make and execute your own codes, or head to the Nickname Writer codes page. This page contains a collection of assembly for nickname codes that can be used for a variety of common purposes such as editing pokémon and items, editing player stats, resetting legendaries etc..

Nickname Writer Codes

Addendum: raw text transcripts of nickname codes

These are provided as an alternative in case images fail to load.

Infinite Eevee Mode Nickname

Nickname
C l l U ( ( : ; W ;

4F Bootstrap Nicknames

List of nicknames
g . y y ] , k Mn * Pk
* ( ; ! ? ) [ [ ] ,
w v v u U l k Mn Pk X

Nickname Writer

List of nicknames
a b v v ) l l C d d
j ? ) V t v v v l Mn
q p y y ] z y p g F
a * j ? t K K b c c
R j j m v w w P P p
l l M v V v v l : ♀
P x w v v W M m m w
A B r q x Pk z g g h
i z , [ o w o x w x
( ) ) ) ) , , ] ] .
j ! U ? ? u w v u -
v x w y y ♀ ♂ ♂ w w
r p P X [ : : ; : ;

Addendum: technical explanation of the setup

Nickname Converter Item Code

Explanation

The item code itself consists of two components. The first 10 items are used to write a program that takes text characters from the nicknames of characters currently within the active box, converts them, then writes the resulting values to unused memory starting from $D66A.

Pairs of text characters are converted to single values through a [(2a + b)%256] formula, where a is the value of the first character and b the value of the second. text terminators are skipped, the code will stop and execute the newly written code once it either reads a $00 value or if values are being read past $DEFF.

11 6A D6	ld de, UNUSED_MEMORY	; Memory between $D66A and $D6EF goes unused
D5		push de
21 06 DE	ld hl, wBoxNicks
.loop
2A		ldi a, (hl)
03		inc bc			; Filler, no effect on flags
87		add a
0B		dec bc			; Filler, compensates previous inc bc, no effect on flags
30 04		jp nc, .notChar		; Aside from space (should not be used), "add a" will only give nc if value read is not a text char
86		add a, (hl)
12		ld (de), a
2C		inc l			; Affects z flag
13		inc de
.notChar
20 F4	jp nz, .loop			; loop unless l rolled over to $00 or value read was $00
C9		ret			; Due to previous push de, this ret will cause execution to resume from $D66A onward, immediately running the newly written code

The last item, the Rare Candies, simply form a pointer to $F328. Due to echo RAM this address is equivalent to $D328, which correspond to item #6's item ID, the start of the item code. By replacing the map script pointer with this item, we can redirect the map script routine to execute the item code instead. This routine is executed on every frame, as long as the start menu isn't open.

Raw Assembly

11 6A	Max Potion x106
D6 D5	TM14 x213
21 06	Thunderstone x06
DA 2A	TM22 x42
03 87	Great Ball x135
0B 30	Antidote x48
04 86	Poké Ball x134
12 2C	Hyper Potion x44
13 20	Super Potion x32
F4 C9	TM44 x201

28 F3	Rare Candy x243

Infinite Eevee Nickname

Explanation

The Infinite Eevee mode nickname writes $00 to the lower byte of wMissableObjectList, causing a misalignment in how the game applies NPC disappearance, causing Eevee's pokéball to stay permanently visible until the game is reset or the player leaves the Celadon Mansion penthouse.

AF		xor a				; a = $00
EA CE D5	ld (wMissableObjectList), a	; Misaligns which objects are made invisible
C9		ret

Raw Assembly

AF EA CE D5 C9

4F Boostrap Nicknames

This set of nicknames, when converted, will modify item #1's ID to be 4F and writes a bootstrap so that using it will lead to execution of the item code from $D328 onward. It requires the presence of the Infinite Eevee Mode Nickname (see previous section) to properly return.

21 1E D3	ld hl, wBagItems	; item #1's ID
36 59		ld (hl), $59		; 4F's item ID
7C		ld a, h			; a = $D3 
21 67 DA	ld hl, 4F_Execution_Pointer +2
32		ldd (hl), a
3E 28		ld a, $28
22		ldi (hl), a
36 C3		ld (hl), $C3
; The contents of the first nickname (see previous section) are written right after this, ensuring safe return.

Raw Assembly

21 1E D3 36 59
7C 21 67 DA 32
3E 28 32 36 C3

Using 4F

Explanation

Using 4F, an invalid item, will cause the game to index the item effects table out of bounds, leading to an invalid execution pointer. For 4F, this causes the game to execute code from $FA65 onward. Due to echo RAM, this address is equivalent to $DA65. Thanks to the bootstrap that was applied earlier, this will then cause the game to jump to $D328, corresponding to the start of the item code.

C3 28 D3	jp ITEM_6_ID

Raw Assembly

C3 28 D3

Nickname Writer

Explanation

The Nickname Writer is a small program that, using nicknames as input, is able to write arbitrary amounts of custom code relatively quickly. It first request a nickname as input, then converts that data to custom code, then displays a checksum of the written data and finally asks the player to provide additional input.

The value of the checksum is calculated by [($80 + the sum of all written values)%256]. Custom code is buffered and executed within enemy party data. Due to how it calls DisplayNameRaterScreen, it will also nickname a party pokémon corresponding to the item slot that 4F currently occupies.

11 B5 D8	ld de, $D8B5			; location written to
D5		push de
.newMail
D5		push de
21 24 65	ld hl, AskName + 39h	; Prepares data and calls DisplayNamingScreen
CD 22 39	call $3922			; sets b to 01, then jumps to Bankswitch, calling b:hl
0E 80		ld c, $80			; Ensure checksum consistency
21 4B CF	ld hl, wStringBuffer		; Address where new name gets written to
D1		pop de				; Continue writing from last saved de
.newChar
2A		ld a, (hli)
87		add a
30 09		jp nc, .terminator		; If blank space as first character of pair, only terminator $50 will result in a nc result
86		add a, (hl)
12		ld (de), a
13		inc de
23		inc hl
81		add a, c			; Current checksum total is buffered in c
12		ld (de), a
4F		ld c, a
18 F3		jp .newChar
.terminator
D5		push de
21 00 C4	ld hl, $C400			; Corresponds to screen tile
0E 01		ld c, $01				; How many bytes printed as numbers?
CD DF 15	call PrintBCDNumber.loop
.numLoop
2D		dec l
CB FE		set 7, (hl)
20 FB		jp nz, .numLoop			; Repeat until hl == $C400
.inputLoop
CD 31 38	call JoypadLowSensitivity	; Halt execution until frame has passed, get joypad status and store result in hJoy5
F0 B5		ld a, (hJoy5)
E6 0F		and $0F				; Set z flag if A, B, START, SELECT not pressed
28 F7		jp z, .inputLoop
1F		rra				; Is A pressed? If yes, set c flag
D1		pop de
38 CB		jr c, .newMail
1B		dec de
1F		rra				; Is B pressed? If yes, set c flag
38 E1		jr c, .terminator
1F		rra				; Is SELECT pressed? If yes, set c flag
E1		pop hl				; pop starting address to hl
D8		ret c				; If SELECT pressed, simply return to normal operations
E9		jp hl				; If START pressed, jump to hl to execute newly written code

Raw Assembly

11 B5 D8 D5 D5
21 5C 65 CD 22
39 0E 80 21 4B
CF D1 2A 87 30
09 86 12 13 23
81 12 4F 18 F3
D5 21 01 C4 4D
CD DF 15 2D CB
FE 20 FB 75 CD
31 38 F0 B5 E6
0F 28 F7 1F D1
38 CB 1B 1F 38
E1 1F E1 D8 E9

Cleanup Code (new save)

Explanation

This code cleans up every negative side effect brought on by the setup and allows the player to continue the story as intended, with the exception of 4F being added to the item bag, enabling use of the Nickname Writer.

The negative effects targeted are:

  • By picking up Eevee, we have flagged its poké ball as "obtained"
  • The current active box is filled with nicknamed Eevees
  • The item pack currently has 255 items
  • The item code is currently still required to run the Nickname Writer
  • We currently have two badges set as obtained
  • Our pokédex currently has 152 pokémon species caught, preventing the story from continuing
  • Setting up SRAM glitch has given us a party of 255 pokémon
  • We are currently located in the Celadon Pokémon center, while we need to return to Pallet Town to pick up the starter pokémon
21 AE D5	ld hl, $D5AE		; Part of wMissableObjectFlags
CB AE		res 5, (hl)		; Reenable Eevee's poké ball
AF		xor a			; a = $00
EA 56 D3	ld (wObtainedBadges), a	; Reset badges
21 80 DA	ld hl, wBoxCount
22		ldi (hl), a		; Set amount of pokémon in box to 0
3D		dec a			; a = $FF
22		ldi (hl), a		; Add proper terminator to wBoxSpecies
AF		xor a			; a = $00
01 26 00	ld bc, 0026
21 F7 D2	ld hl, wPokedexOwned
.loop
22		ldi (hl), a
0D		dec c
20 FC		jp nz, .loop		; Fully clear all Pokédex flags
2E B1		ld l, $B1		; hl = $D3B1, within wWarpEntries
22		ldi (hl), a
22		ldi (hl), a
23		inc hl
23		inc hl
22		ldi (hl), a
22		ldi (hl), a		; Changes first two warp tiles to lead to Pallet Town instead
EA 63 D1	ld (wPartyCount), a	; Set amount of pokémon in party to 0
EA 1D D3	ld (wNumBagItems), a	; Set amount of items to 0
01 01 59	ld bc, $5901
CD 2E 3E	call GiveItem		; Gives c amount of b item, giving 1 copy of 4F.
21 66 DA	ld hl, $DA66		; Part of 4F bootstrap
36 6A		ld (hl), $6A
23		inc hl
36 D6		ld (hl), $D6		; 4F now redirects directly to Nickname Writer
C9		ret

Raw Assembly

21 AE D5 CB AE
AF EA 56 D3 21
80 DA 22 3D 22
AF 01 26 00 21
F7 D2 22 0D 20
FC 2E B1 22 22
23 23 22 22 EA
63 D1 EA 1D D3
01 01 59 CD 2E
3E 21 66 DA 36
6A 23 36 D6 C9

Cleanup Code (existing save)

Explanation

This code cleans up every negative side effect brought on by the setup and allows the player to continue the story as intended, with the exception of 4F being added to the item bag, enabling use of the Nickname Writer.

The negative effects targeted are:

  • By picking up Eevee, we have flagged its poké ball as "obtained"
  • The current active box is filled with nicknamed Eevees
  • The item pack currently has 255 items
  • The item code is currently still required to run the Nickname Writer

Since existing saves do not have to set up SRAM glitch, there are a lot less side effects that need to be addressed by the cleanup code.

21 AE D5	ld hl, $D5AE		; Part of wMissableObjectFlags
CB AE		res 5, (hl)		; Reenable Eevee's poké ball
AF		xor a	; a = $00
21 80 DA	ld hl, wBoxCount
22		ldi (hl), a		; Set amount of pokémon in box to 0
3D		dec a	; a = $FF
22		ldi (hl), a		; Add proper terminator to wBoxSpecies
AF		xor a	; a = $00
EA 1D D3	ld (wNumBagItems), a	; Set amount of items to 0
01 01 59	ld bc, $5900
CD 2E 3E	call GiveItem		; Gives c amount of b item, giving 1 copy of 4F.
21 66 DA	ld hl, $DA66		; Part of 4F bootstrap
36 6A		ld (hl), $6A
23		inc hl
36 D6		ld (hl), $D6		; 4F now redirects directly to Nickname Writer
01 01 59	ld bc, $5901
C3 2E 3E	jp GiveItem		; Gives c amount of b item, giving 1 copy of 4F.

Raw Assembly

21 AE D5 CB AE
AF 21 80 DA 22
3D 22 AF EA 1D
D3 21 66 DA 36
6A 23 36 D6 01
01 59 C3 2E 3E