Jump to content

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

Line 472:
 
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..
 
=Addendum: raw text transcripts of nickname codes=
 
These are provided as an alternative in case images fail to load.
 
==Infinite Eevee Mode Nickname==
 
{| class="wikitable"
! Nickname (FR/IT/SP) !! Nickname (DE)
|-
!<pre>
C l l U ) : : ; W ;</pre>!!<pre>
C l d e d M : ; W ;</pre>
|}
 
==4F Bootstrap Nicknames==
 
{| class="wikitable"
! List of nicknames (FR/IT/SP) !! List of nicknames (DE)
|-
!<pre>
g . [ X w w k Mn ( v
a Pk z q g . [ . w w
a Mn z p y , , . g .
z q Q P w w w w w w
g . Pk X w v w w : )
</pre>!!<pre>
ö w * * w w ü m d d
Ü ; w w ü u v ö w w
a Mn z p y , , . ü u
z p Q P w w w w w w
ü u u * w v w w * *
</pre>
|}
 
==Nickname Writer==
 
{| class="wikitable"
! French !! German !! Italian !! Spanish
|-
| <pre>
h Mn L l l L L t t (
t v u t t v u t s t
j ? ( t v v v v ; [
t z j ? ( ) t v v v
a q H h H Z y y p Q
r r P p y r j ? ) )
s k l l : ; : V U U
q y [ x w v : * * Mn
Z Pk Z * * ] Y Mn Mn L
A H ] . w ; ♀ : u k
z p p * ( ) ) ) ) ,
S j A H g . p q A A
j u l l u z Mn S Mn ]
q r A a i I h H h H
</pre>
|| <pre>
ä k L l l L L t k m
l ü u t t v u t s t
ä s S ä v v v v ; [
Ä ] ä s S l l ü v v
a q H h H Z y y ) y
r r P p q ä ä s ) )
s k l l K Ö : V V V
s u u L Ü ; ; ♂ ♂ ?
r r z r A B Ä S ü ü
A H h Mn T - - Ä Ä S
z p o / ( ) ) ) ) ,
S j Mn ü ü u Ü K A A
j u l l w v V y y .
t l L K L Ü : ; : ;
</pre>
|| <pre>
h Mn L l l L L t t (
t v u t t v u t s t
j ? ( t v v v v ; [
t z j ? ( ) t v v v
a q H h H Z y y p Q
r r R l u u j ? ) )
s k l l : ; : V V V
q y [ x w v : * * Mn
Z Pk Z * * ] Y Mn Mn L
A H ] . w ; ♀ : u k
z p p * ( ) ) ) ) ,
S j B A g . p q A A
j u l l v x x o x ♀
q r A a i I h H h H
</pre>
|| <pre>
h Mn L l l L L t t (
t v u t t v u t s t
j ? ( t v v v v ; [
t z j ? ( ) t v v v
a q H h H Z y y p Q
r r P p z r j ? ) )
s k l l : ; : V V V
q y [ x w v : * * Mn
Z Pk Z * * ] Y Mn Mn L
A H ] . w ; ♀ : u k
z p p * ( ) ) ) ) ,
b L D D m ? s k A A
j u l l u z Z Mn Mn ]
q r A a i I h H h H
</pre>
|}
 
=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.
 
<pre>
11 6F D6 ld de, UNUSED_MEMORY ; Memory between $D66F and $D6F4 goes unused
D5 push de
21 0B 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 Leaf Stone, simply form a pointer to $F32F. Due to echo RAM this address is equivalent to $D32F, 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===
 
<pre>
11 6F Max Potion x111
D6 D5 TM14 x213
21 0B Thunderstone x11
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
 
2F F3 Leaf Stone x243
</pre>
 
==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.
 
<pre>
AF xor a ; a = $00
EA D2 D5 ld (wMissableObjectList), a ; Misaligns which objects are made invisible
C9 ret
</pre>
 
===Raw Assembly===
 
<pre>
AF EA D2 D5 C9
</pre>
 
==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.
 
<pre>
3E 59 ld a, $59 ; 4F's item ID
21 22 D3 ld hl, wBagItems ; item #1's ID
22 ldi (hl), a
AF xor a ; a = $00
22 ldi (hl), a
22 ldi (hl), a
22 ldi (hl), a
22 ldi (hl), a ; clears a bunch of $FF values placed by swapping party pokémon
21 64 DA ld hl, 4F_Execution_Pointer
3E 21 ld a, $21
22 ldi (hl), a
3E 2E ld a, $2E
22 ldi (hl), a
3E D3 ld a, $D3
22 ldi (hl), a
36 E9 ld hl, $E9
; The contents of the first nickname (see previous section) are written right after this, ensuring safe return.
</pre>
 
===Raw Assembly===
 
<pre>
3E 59 21 22 D3
22 AF 22 22 22
22 21 64 DA 3E
21 22 3E 2E 22
3E D3 22 36 E9
</pre>
 
==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.
 
<pre>
21 2E D3 ld hl, ITEM_6_ID
E9 jp hl
</pre>
 
===Raw Assembly===
 
<pre>21 2E D3 E9</pre>
 
==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.
 
====French====
 
<pre>
11 A0 D8 ld de, $D8A0 ; location written to
D5 push de
.newMail
D5 push de
06 01 ld b, 01
21 56 63 ld hl, DisplayNameRaterScreen
CD 87 3E call BankSwitch ; Change rom banks and call b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4F 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
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
CD BC 13 call PrintBCDNumber.loop ; Prints c amount of bytes at de to hl in binary coded decimal format, prints checksum
CD 21 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
D1 pop de
F0 B5 ld a, (hJoy5)
A7 and a ; Check if no buttons are pressed
28 EE jp z, .terminator ; If no buttons pressed, keep displaying checksum
1F rra ; Shift all bits to the right, transfer former bit 7 to bit 1 and store status of this bit in c flag
38 CF jp c, .loop ; Is A is pressed, start new nickname
1B dec de ; If another button outside of A is pressed, either we're using the correction function, executing or stopping
1F rra ; is B pressed?
38 E7 jp c, .terminator ; If B is pressed, de has been decremented once so continue just displaying the new value de points towards
1F rra
1F rra ; Is START pressed?
D8 ret c ; Jump to $D89C, which was pushed to the stack at the start of the code and execute newly written code
1B dec de
1B dec de
1B dec de
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
17 rla ; Shift all bits to the left, transfer former bit 7 to bit 1 and store status of this bit in c flag. Is SELECT pressed?
30 C1 jp nc, loop ; If SELECT NOT pressed and dpad pressed instead, start new mail after de has been decremented a total of 5 times. Basically undoes a full nickname's worth of data
E1 pop hl ; Otherwise, pop the stored address of $D89C from the stack
C9 ret ; Since $D89C was popped, return to normal execution without executing newly written code
</pre>
 
====German====
 
<pre>
11 A0 D8 ld de, $D8A0 ; location written to
D5 push de
.newMail
D5 push de
06 01 ld b, 01
21 E2 62 ld hl, DisplayNameRaterScreen
CD 89 3E call BankSwitch ; Change rom banks and call b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4F 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
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
CD BF 13 call PrintBCDNumber.loop ; Prints c amount of bytes at de to hl in binary coded decimal format, prints checksum
CD 23 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
D1 pop de
F0 B5 ld a, (hJoy5)
A7 and a ; Check if no buttons are pressed
28 EE jp z, .terminator ; If no buttons pressed, keep displaying checksum
1F rra ; Shift all bits to the right, transfer former bit 7 to bit 1 and store status of this bit in c flag
38 CF jp c, .loop ; Is A is pressed, start new nickname
1B dec de ; If another button outside of A is pressed, either we're using the correction function, executing or stopping
1F rra ; is B pressed?
38 E7 jp c, .terminator ; If B is pressed, de has been decremented once so continue just displaying the new value de points towards
1F rra
1F rra ; Is START pressed?
D8 ret c ; Jump to $D89C, which was pushed to the stack at the start of the code and execute newly written code
1B dec de
1B dec de
1B dec de
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
17 rla ; Shift all bits to the left, transfer former bit 7 to bit 1 and store status of this bit in c flag. Is SELECT pressed?
30 C1 jp nc, loop ; If SELECT NOT pressed and dpad pressed instead, start new mail after de has been decremented a total of 5 times. Basically undoes a full nickname's worth of data
E1 pop hl ; Otherwise, pop the stored address of $D89C from the stack
C9 ret ; Since $D89C was popped, return to normal execution without executing newly written code
</pre>
 
====Italian====
 
<pre>
11 A0 D8 ld de, $D8A0 ; location written to
D5 push de
.newMail
D5 push de
06 01 ld b, 01
21 1C 63 ld hl, DisplayNameRaterScreen
CD 82 3E call BankSwitch ; Change rom banks and call b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4F 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
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
CD BF 13 call PrintBCDNumber.loop ; Prints c amount of bytes at de to hl in binary coded decimal format, prints checksum
CD 1C 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
D1 pop de
F0 B5 ld a, (hJoy5)
A7 and a ; Check if no buttons are pressed
28 EE jp z, .terminator ; If no buttons pressed, keep displaying checksum
1F rra ; Shift all bits to the right, transfer former bit 7 to bit 1 and store status of this bit in c flag
38 CF jp c, .loop ; Is A is pressed, start new nickname
1B dec de ; If another button outside of A is pressed, either we're using the correction function, executing or stopping
1F rra ; is B pressed?
38 E7 jp c, .terminator ; If B is pressed, de has been decremented once so continue just displaying the new value de points towards
1F rra
1F rra ; Is START pressed?
D8 ret c ; Jump to $D89C, which was pushed to the stack at the start of the code and execute newly written code
1B dec de
1B dec de
1B dec de
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
17 rla ; Shift all bits to the left, transfer former bit 7 to bit 1 and store status of this bit in c flag. Is SELECT pressed?
30 C1 jp nc, loop ; If SELECT NOT pressed and dpad pressed instead, start new mail after de has been decremented a total of 5 times. Basically undoes a full nickname's worth of data
E1 pop hl ; Otherwise, pop the stored address of $D89C from the stack
C9 ret ; Since $D89C was popped, return to normal execution without executing newly written code
</pre>
 
====Spanish====
 
<pre>
11 A0 D8 ld de, $D8A0 ; location written to
D5 push de
.newMail
D5 push de
06 01 ld b, 01
21 14 63 ld hl, DisplayNameRaterScreen
CD 89 3E call BankSwitch ; Change rom banks and call b:hl
0E 80 ld c, $80 ; Ensure checksum consistency
21 4F 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
21 29 C4 ld hl, $C429 ; Corresponds to screen tile
0E 01 ld c, 01
D5 push de
CD BF 13 call PrintBCDNumber.loop ; Prints c amount of bytes at de to hl in binary coded decimal format, prints checksum
CD 23 38 call JoypadLowSensitivity ; Halt execution until frame has passed, get joypad status and store result in hJoy5
D1 pop de
F0 B5 ld a, (hJoy5)
A7 and a ; Check if no buttons are pressed
28 EE jp z, .terminator ; If no buttons pressed, keep displaying checksum
1F rra ; Shift all bits to the right, transfer former bit 7 to bit 1 and store status of this bit in c flag
38 CF jp c, .loop ; Is A is pressed, start new nickname
1B dec de ; If another button outside of A is pressed, either we're using the correction function, executing or stopping
1F rra ; is B pressed?
38 E7 jp c, .terminator ; If B is pressed, de has been decremented once so continue just displaying the new value de points towards
1F rra
1F rra ; Is START pressed?
D8 ret c ; Jump to $D89C, which was pushed to the stack at the start of the code and execute newly written code
1B dec de
1B dec de
1B dec de
1B dec de ; de's value has been decremented a total of 5 times, equal to a full nickname's worth of data
17 rla ; Shift all bits to the left, transfer former bit 7 to bit 1 and store status of this bit in c flag. Is SELECT pressed?
30 C1 jp nc, loop ; If SELECT NOT pressed and dpad pressed instead, start new mail after de has been decremented a total of 5 times. Basically undoes a full nickname's worth of data
E1 pop hl ; Otherwise, pop the stored address of $D89C from the stack
C9 ret ; Since $D89C was popped, return to normal execution without executing newly written code
</pre>
 
===Raw Assembly===
 
====French====
 
<pre>
11 A0 D8 D5 D5
06 01 21 56 63
CD 87 3E 0E 80
21 4F CF D1 2A
87 30 09 86 12
13 23 81 12 4F
18 F3 21 29 C4
0E 01 D5 CD BC
13 CD 21 38 D1
F0 B5 A7 28 EE
1F 38 CF 1B 1F
38 E7 1F 1F D8
1B 1B 1B 1B 17
30 C1 E1 C9 00
</pre>
 
====German====
 
<pre>
11 A0 D8 D5 D5
06 01 21 E2 62
CD 89 3E 0E 80
21 4F CF D1 2A
87 30 09 86 12
13 23 81 12 4F
18 F3 21 29 C4
0E 01 D5 CD BF
13 CD 23 38 D1
F0 B5 A7 28 EE
1F 38 CF 1B 1F
38 E7 1F 1F D8
1B 1B 1B 1B 17
30 C1 E1 C9 00
</pre>
 
====Italian====
 
<pre>
11 A0 D8 D5 D5
06 01 21 1C 63
CD 82 3E 0E 80
21 4F CF D1 2A
87 30 09 86 12
13 23 81 12 4F
18 F3 21 29 C4
0E 01 D5 CD BF
13 CD 1C 38 D1
F0 B5 A7 28 EE
1F 38 CF 1B 1F
38 E7 1F 1F D8
1B 1B 1B 1B 17
30 C1 E1 C9 00
</pre>
 
====Spanish====
 
<pre>
11 A0 D8 D5 D5
06 01 21 14 63
CD 89 3E 0E 80
21 4F CF D1 2A
87 30 09 86 12
13 23 81 12 4F
18 F3 21 29 C4
0E 01 D5 CD BF
13 CD 23 38 D1
F0 B5 A7 28 EE
1F 38 CF 1B 1F
38 E7 1F 1F D8
1B 1B 1B 1B 17
30 C1 E1 C9 00
</pre>
 
==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
 
====French====
 
<pre>
21 B2 D5 ld hl, $D5B2 ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
EA 5A D3 ld (wObtainedBadges), a ; Reset badges
21 84 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 FB D2 ld hl, wPokedexOwned
.loop
22 ldi (hl), a
0D dec c
20 FC jp nz, .loop ; Fully clear all Pokédex flags
2E B5 ld l, $B5 ; hl = $D3B6, 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 67 D1 ld (wPartyCount), a ; Set amount of pokémon in party to 0
EA 21 D3 ld (wNumBagItems), a ; Set amount of items to 0
01 01 59 ld bc, $5901
CD 42 3E call GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
21 64 DA ld hl, $DA64 ; Part of 4F bootstrap
36 6E ld (hl), $6E
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
C9 ret
</pre>
 
====German====
 
<pre>
21 B2 D5 ld hl, $D5B2 ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
EA 5A D3 ld (wObtainedBadges), a ; Reset badges
21 84 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 FB D2 ld hl, wPokedexOwned
.loop
22 ldi (hl), a
0D dec c
20 FC jp nz, .loop ; Fully clear all Pokédex flags
2E B5 ld l, $B5 ; hl = $D3B6, 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 67 D1 ld (wPartyCount), a ; Set amount of pokémon in party to 0
EA 21 D3 ld (wNumBagItems), a ; Set amount of items to 0
01 01 59 ld bc, $5901
CD 44 3E call GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
21 64 DA ld hl, $DA64 ; Part of 4F bootstrap
36 6E ld (hl), $6E
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
C9 ret
</pre>
 
====Italian====
 
<pre>
21 B2 D5 ld hl, $D5B2 ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
EA 5A D3 ld (wObtainedBadges), a ; Reset badges
21 84 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 FB D2 ld hl, wPokedexOwned
.loop
22 ldi (hl), a
0D dec c
20 FC jp nz, .loop ; Fully clear all Pokédex flags
2E B5 ld l, $B5 ; hl = $D3B6, 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 67 D1 ld (wPartyCount), a ; Set amount of pokémon in party to 0
EA 21 D3 ld (wNumBagItems), a ; Set amount of items to 0
01 01 59 ld bc, $5901
CD 3D 3E call GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
21 64 DA ld hl, $DA64 ; Part of 4F bootstrap
36 6E ld (hl), $6E
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
C9 ret
</pre>
 
====Spanish====
 
<pre>
21 B2 D5 ld hl, $D5B2 ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
EA 5A D3 ld (wObtainedBadges), a ; Reset badges
21 84 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 FB D2 ld hl, wPokedexOwned
.loop
22 ldi (hl), a
0D dec c
20 FC jp nz, .loop ; Fully clear all Pokédex flags
2E B5 ld l, $B5 ; hl = $D3B6, 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 67 D1 ld (wPartyCount), a ; Set amount of pokémon in party to 0
EA 21 D3 ld (wNumBagItems), a ; Set amount of items to 0
01 01 59 ld bc, $5901
CD 44 3E call GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
21 64 DA ld hl, $DA64 ; Part of 4F bootstrap
36 6E ld (hl), $6E
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
C9 ret
</pre>
 
===Raw Assembly===
 
====French====
 
<pre>
21 B2 D5 CB AE
AF EA 5A D3 21
84 DA 22 3D 22
AF 01 26 00 21
FB D2 22 0D 20
FC 2E B5 22 22
23 23 22 22 EA
67 D1 EA 21 D3
01 01 59 CD 42
3E 21 65 DA 36
6E 23 36 D6 C9
</pre>
 
====German====
 
<pre>
21 B2 D5 CB AE
AF EA 5A D3 21
84 DA 22 3D 22
AF 01 26 00 21
FB D2 22 0D 20
FC 2E B5 22 22
23 23 22 22 EA
67 D1 EA 21 D3
01 01 59 CD 44
3E 21 65 DA 36
6E 23 36 D6 C9
</pre>
 
====Italian====
 
<pre>
21 B2 D5 CB AE
AF EA 5A D3 21
84 DA 22 3D 22
AF 01 26 00 21
FB D2 22 0D 20
FC 2E B5 22 22
23 23 22 22 EA
67 D1 EA 21 D3
01 01 59 CD 3D
3E 21 65 DA 36
6E 23 36 D6 C9
</pre>
 
====Spanish====
 
<pre>
21 B2 D5 CB AE
AF EA 5A D3 21
84 DA 22 3D 22
AF 01 26 00 21
FB D2 22 0D 20
FC 2E B5 22 22
23 23 22 22 EA
67 D1 EA 21 D3
01 01 59 CD 44
3E 21 65 DA 36
6E 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.
 
====French====
 
<pre>
21 B2 D5 ld hl, $D5B2 ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
21 84 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 21 D3 ld (wNumBagItems), a ; Set amount of items to 0
21 65 DA ld hl, $DA65 ; Part of 4F bootstrap
36 6E ld (hl), $6E
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
01 01 59 ld bc, $5901
C3 42 3E jp GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
</pre>
 
====German====
 
<pre>
21 B2 D5 ld hl, $D5B2 ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
21 84 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 21 D3 ld (wNumBagItems), a ; Set amount of items to 0
21 65 DA ld hl, $DA65 ; Part of 4F bootstrap
36 6E ld (hl), $6E
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
01 01 59 ld bc, $5901
C3 44 3E jp GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
</pre>
 
====Italian====
 
<pre>
21 B2 D5 ld hl, $D5B2 ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
21 84 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 21 D3 ld (wNumBagItems), a ; Set amount of items to 0
21 65 DA ld hl, $DA65 ; Part of 4F bootstrap
36 6E ld (hl), $6E
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
01 01 59 ld bc, $5901
C3 3D 3E jp GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
</pre>
 
====Spanish====
 
<pre>
21 B2 D5 ld hl, $D5B2 ; Part of wMissableObjectFlags
CB AE res 5, (hl) ; Reenable Eevee's poké ball
AF xor a ; a = $00
21 84 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 21 D3 ld (wNumBagItems), a ; Set amount of items to 0
21 65 DA ld hl, $DA65 ; Part of 4F bootstrap
36 6E ld (hl), $6E
23 inc hl
36 D6 ld (hl), $D6 ; 4F now redirects directly to Nickname Writer
01 01 59 ld bc, $5901
C3 44 3E jp GiveItem ; Gives c amount of b item, giving 1 copy of 4F.
</pre>
 
===Raw Assembly===
 
====French====
 
<pre>
21 B2 D5 CB AE
AF 21 84 DA 22
3D 22 AF EA 21
D3 21 65 DA 36
6E 23 36 D6 01
01 59 CD 42 3E
</pre>
 
====German====
 
<pre>
21 B2 D5 CB AE
AF 21 84 DA 22
3D 22 AF EA 21
D3 21 65 DA 36
6E 23 36 D6 01
01 59 CD 44 3E
</pre>
 
====Italian====
 
<pre>
21 B2 D5 CB AE
AF 21 84 DA 22
3D 22 AF EA 21
D3 21 65 DA 36
6E 23 36 D6 01
01 59 CD 3D 3E
</pre>
 
====Spanish====
 
<pre>
21 B2 D5 CB AE
AF 21 84 DA 22
3D 22 AF EA 21
D3 21 65 DA 36
6E 23 36 D6 01
01 59 CD 44 3E
</pre>
1,514

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.