Guides:Coin Case ACE: Difference between revisions

Content deleted Content added
TimoVM (talk | contribs)
No edit summary
TimoVM (talk | contribs)
(9 intermediate revisions by the same user not shown)
Line 30: Line 30:
Now that we have the Coin Case, we'll need to set up everything needed to actually safely use it. Using a specific setup, we can force the Coin Case to execute code starting from the second character of the last read mail. From here, we need to ensure that we have the proper setup to execute box name codes.
Now that we have the Coin Case, we'll need to set up everything needed to actually safely use it. Using a specific setup, we can force the Coin Case to execute code starting from the second character of the last read mail. From here, we need to ensure that we have the proper setup to execute box name codes.


* Prepare a mail to ensure that a box name code can be executed.
* Prepare box names to execute a certain effect and return safely to normal game operations. For the purposes of this guide, we'll use the box name in the next section.
* Prepare box names to execute a certain effect and return safely to normal game operations. For the purposes of this guide, we'll use the box name in the next section.
* Give any pokémon a flower mail with the following content:
* Give any pokémon a flower mail with the following content:
Line 71: Line 70:
* Open the item bag, switch item pockets at least once, then use the Coin Case. ACE will be executed when the coin count displays on the screen.
* Open the item bag, switch item pockets at least once, then use the Coin Case. ACE will be executed when the coin count displays on the screen.


With the current box name setups, you can verify that the setup is working by checking the TM/HM pocket. The first item in the main item pocket should be altered to a TM33, in the TM/HM pocket you can now find all TMs, each having a quantity of x255.
With the current box name setups, you can verify that the setup is working by checking the TM/HM pocket. The first item in the main item pocket should be altered to a TM33, in the TM/HM pocket you can now find all TMs, each having a quantity of x255. '''Do not use this TM33 yet! This TM will allow us to execute the contents of the TM/HM pocket as code, but due to the specific quantities currently present it will be guaranteed to crash the game.'''


Anytime you wish to execute wrong pocket Coin Case ACE, you'll need to repeat the steps outlined at the beginning of this section. Always make sure the held mail was read before using the Coin Case and ensure that a valid box name code was prepared beforehand.
'''Do not use this TM33 yet! This TM will allow us to execute the contents of the TM/HM pocket as code, but due to the specific quantities currently present it will be guaranteed to crash the game.'''

===Troubleshooting===


If the code crashes, check the following:
If the code crashes, check the following:
Line 82: Line 83:
* Is the content of the mail correct?
* Is the content of the mail correct?


===A small note on the box names===
'''Anytime you wish to execute wrong pocket Coin Case ACE, you'll need to repeat the steps outlined at the beginning of this section. Always make sure the held mail was read before using the Coin Case and ensure that a valid box name code was prepared beforehand.'''

==A small note on the box names==


Due to the limited characterset, the box name code rewrites part of itself to be able to achieve its effect. This will cause the box names to appear glitched after executing Coin Case ACE once.
Due to the limited characterset, the box name code rewrites part of itself to be able to achieve its effect. This will cause the box names to appear glitched after executing Coin Case ACE once.
Line 232: Line 231:
Since we aren't planning on using the Coin Case anymore, the mail that was previously give to a pokémon can be removed. It is no longer relevant for the remainder of the setup.
Since we aren't planning on using the Coin Case anymore, the mail that was previously give to a pokémon can be removed. It is no longer relevant for the remainder of the setup.


===Troubleshooting & repairing TM33===
If the game crashes, first recheck if all TM quantities are correct. If all quantities are correct, you may need to redo the setup for TM33. This can be done using the box codes included a bit further below.

If the game crashes, first recheck if all TM quantities are correct. If all quantities are correct, you may need to redo the setup for TM33. This can be done using the following box code:

'''Please mind the differences between uppercase X ([[File:Character UCX.png]]), lowercase x ([[File:Character lcx.png]]) and multiplication symbol ([[File:Character mul.png]])'''.
{| class="wikitable" style="margin-left: auto; margin-right: auto; border: none;"
|
[[File:Reset box code GSEN.png]]
|}

To execute this box name code, repeat the process for Coin Case ACE:
* Read the mail previously given to a party pokémon.
* Go to the Goldenrod Radio Tower and follow the correct steps to finish the setup.
* Use the Coin Case to execute the code. If the game crashes, doublecheck the box name code and ensure you've performed every step of the process correctly.
* If the code executes succesfully without crashing the game, TM33's functionality has now been repaired.


==Step 4: Using the mail writer==
==Step 4: Using the mail writer==
Line 243: Line 256:


Due to a lack of available memory in the TM/HM pocket, it is not possible to quit the RAM writer without executing the newly written code. '''If you ever accidentally activate the mail writer and would like to quit, simply write a mail containing "Rh", then confirm and exit the RAM writer.'''
Due to a lack of available memory in the TM/HM pocket, it is not possible to quit the RAM writer without executing the newly written code. '''If you ever accidentally activate the mail writer and would like to quit, simply write a mail containing "Rh", then confirm and exit the RAM writer.'''

{| class="wikitable" style="margin-left: auto; margin-right: auto; border: none;"
|
[[File:Mail_English_GS_Rh.png]]
|}


Assembly can easily be converted to mail codes using [https://timovm.github.io/MailConverter/ TimoVM's MailConverter]. Simply paste the assembly of the code you wish to enter here, press "run" and the converter will automatically generate mail codes requiring the least amount of button presses to write.
Assembly can easily be converted to mail codes using [https://timovm.github.io/MailConverter/ TimoVM's MailConverter]. Simply paste the assembly of the code you wish to enter here, press "run" and the converter will automatically generate mail codes requiring the least amount of button presses to write.
Line 261: Line 279:
==Step 5: Improving the setup==
==Step 5: Improving the setup==


One final issue with the setup, since the mail writer is written using TM quantities, using or gaining TMs will break the mail writer. Because of this, we'll use the mail writer to execute a small code that achieves the following:
Since the mail writer is written using TM quantities, using or gaining TMs will break the mail writer. Because of this, we'll use the mail writer to execute a small code that achieves the following:
* Copies the mail writer to unused memory
* Copies the mail writer to unused memory
* Overwrite the existing quantities in the TM/HM pocket to x1 for every TM
* Overwrite the existing quantities in the TM/HM pocket to x1 for every TM
Line 279: Line 297:
! scope="row"| English
! scope="row"| English
||
||
01 32 00 11 F2 D6 21 1B D4 73 23 72 3E 3E 12 13 3E 04
01 32 00 11 F2 D6 21 1B D4 73 23 72 3E 3E 12 13
12 13 21 7E D5 E5 CD 1A 31 3E '''01''' 0E 32 E1 C3 4C 31
3E 04 12 13 21 7E D5 E5 CD 1A 31 3E 01 0E 32 E1
C3 4C 31
|}

After executing this code, attempt to start up the mail writer. If you are able to open it and are able to successfully execute the following blank mail, the copy has finished successfully and you can save the game.

{| class="wikitable" style="margin-left: auto; margin-right: auto; border: none;"
|
[[File:Mail_English_GS_Rh.png]]
|}
|}


Line 288: Line 314:
* [[User:TimoVM/Mail Writer Codes|Mail codes]]: this page contains a collection of assembly for mail codes that can be used for a variety of common purposes such as fixing the side effects of the ACE setup, editing pokémon and items, etc..
* [[User:TimoVM/Mail Writer Codes|Mail codes]]: this page contains a collection of assembly for mail codes that can be used for a variety of common purposes such as fixing the side effects of the ACE setup, editing pokémon and items, etc..
* [[User:TimoVM/RAM Writer|RAM writer]]: (recommended for more experienced users) this page contains the assembly for a large one-size-fits all program that allows you to edit any value in RAM with a user-friendly GUI. It will also fix the side effects of the ACE setup when you first run it. WARNING: THE RAM WRITER SETUP FOR GOLD/SILVER IS CURRENTLY BEING REDESIGNED. PLEASE DO NOT INSTALL YET.
* [[User:TimoVM/RAM Writer|RAM writer]]: (recommended for more experienced users) this page contains the assembly for a large one-size-fits all program that allows you to edit any value in RAM with a user-friendly GUI. It will also fix the side effects of the ACE setup when you first run it. WARNING: THE RAM WRITER SETUP FOR GOLD/SILVER IS CURRENTLY BEING REDESIGNED. PLEASE DO NOT INSTALL YET.

=Addendum: repairing the "MAILWRITER" pokémon=

In case something happens with the "MAILWRITER" nicknamed pokémon that causes it to no longer function, you can repair the pokémon without having to reset TM quantities using the following procedure:

* Arrange the party as follows:
*# Any
*# Any
*# "MAILWRITER" pokémon holding mail
*# Any
*# Any
*# Any
* Enter the following language-specific box name. '''Please mind the differences between uppercase X ([[File:Character UCX.png]]), lowercase x ([[File:Character lcx.png]]) and multiplication symbol ([[File:Character mul.png]])'''.

{| class="wikitable" style="margin-left: auto; margin-right: auto; border: none;"
|
[[File:Reset box code GSEN.png]]
|}

* Read the mail held by the "MAILWRITER" pokémon.
* Go to the Goldenrod Radio Tower and follow the correct steps to finish the setup.
* Use the Coin Case to execute the code. If the game crashes, doublecheck the box name code and ensure you've performed every step of the process correctly.
* If the code executes succesfully without crashing the game, the "MAILWRITER" nicknamed pokémon has now been repaired.


=Appendix=
=Appendix=
Line 323: Line 326:
<pre>h h 's z 2 Pk 'l 0 9 ♀ . 9 Pk * ' ]
<pre>h h 's z 2 Pk 'l 0 9 ♀ . 9 Pk * ' ]
h 'd</pre>
h 'd</pre>
|-
! scope="row" | Test box name
||
<pre>0 9 é A ♀ h 'd</pre>
|-
|-
! scope="row" | Setup box name
! scope="row" | Setup box name
||
||
Box 1: A p é 3 2 'v 9 5
Box 1: p 'v . é 'l 2 'v 1
Box 2: é 1 2 'v 'd é 6 2
Box 2: é 'd 2 'v 9 é 'v 2
Box 3: ? b é , 2 'v 5
Box 3: , , 'v D H H 'd 5
Box 4: é 2 2 'v ? é 5 2
Box 4: ? E 's 'v 2 'v H 5
Box 5: ? E é ) 4 'v G 5
Box 5: 'v 9 é 2 0 9
Box 6: é ♀ 2 é ; 4 0 9
Box 6: 5 5 é ♀ ♀ * 8 p
Box 7: ♀ ♀ 's 5 5
Box 7: 'm 6 2 h 'm - 2 p
Box 8: ? 'm é : 4 'v 4 5
Box 8: 0 'm 's 'v 2 'v T H
Box 9: é y 'v - é 8 4
Box 9: 's 'v 2 'v ; é y
Box 10: 'v x é ( 4 'd
Box 10: 0 'm 'v 2
|-
|-
! scope="row" | Reset box name
! scope="row" | Reset box name
||
||
Box 1: A p 'v 6 é ) 4 5
Box 1: p 'v . é 'l 2 'v 1
Box 2: 'v G é ; 4 'v J 5
Box 2: é 'd 2 'v 9 é 'v 2
Box 3: é [ 4 'v x é ( 4
Box 3: , , 'v D H H 'd 5
Box 4: H 'v z é : 4 h 'd
Box 4: ? E 's 'v 2 p 0 'm
Box 5: 's 'v 2 'v T 's 't 2
Box 6: p 0 ♀ 'm 'v 2
|}
|}


Line 457: Line 458:
A7 and a ; Reset carry flag. Not strictly necessary, but added for safety for now
A7 and a ; Reset carry flag. Not strictly necessary, but added for safety for now
D0 ret nc
D0 ret nc
</pre>

===Effect of the test box name code===

Box name data starts from $D8BF onward. Converting the provided mail code to assembly results in the following:

<pre>
F6 FF or $FF ; Set a to $FF, set carry flag to 0.
EA 80 F5 ld (F580), a ; $F580 is an echo ram copy of $D580, which corresponds to TM03's quantity.
D0 ret nc ; Thanks to the preparatory work done by the mail, allow safe return to normal game operation.
</pre>
</pre>


Line 481: Line 472:
<pre>
<pre>
Box 1: $D8BF
Box 1: $D8BF
80 add a, b
AF xor a ; a = $00
AF xor a ; a = $00
D6 E8 sub $FF ; a = $18
EA F9 F8 ld ($F8F9), a
EA D1 F8 ld ($F8D1), a
D6 FF sub $FF ; a = $01
D6 F7 sub $F7 ; a = $21
FB ei
50 ld d, b
50 ld d, b


Box 2: $D8C8
Box 2: $D8C8
EA F7 F8 ld ($F8F7), a
EA D0 F8 ld ($F8D0), a
D6 D0 sub $D0 ; a = $31
D6 FF sub $FF ; a = $22
EA FC F8 ld ($F8FC), a
EA D6 F8 ld ($F8D6), a
21
50 ld d; b


Box 3: $D8D1
Box 3: $D8D1
18 F4 ld hl, $F418
E6 A1 and $A1 ; a = $21
D6 83 sub $83 ; a = $9F
EA F4 F8 ld ($F8F4), a
D6 EF sub $EF ; a = $32
87 add a, a ; a = $3E, carry flag set
.write
22 ldi (hl), a
D0 ret nc ; Ignore on first pass, taken when .write called
FB ei
FB ei
50 ld d, b
50 ld d, b


Box 4: D8DA
Box 4: D8DA
E6 84 and $84 ; a = $04
EA F8 F8 ld ($F8F8), a
D4 D6 F8 call nc, .write
D6 E6 sub $E6 ; a = $4C
D6 87 sub $87 ; a = $7D
EA FB F8 ld ($F8FB), a
FB ei
50 ld d, b
50 ld d, b


Box 5: $D8E3
Box 5: $D8E3
.loop
E6 84 and $84 ; a = $04
D6 FF sub $FF ; Increments a on each pass
EA 9B FA ld ($FA9B), a
EA EF F8 ld ($F8EF), a
D6 86 sub $86 ; a = $7E
F5 push af
FB ei
F6 FF or $FF ; a = $FF
50 ld d, b
50 ld d, b


Box 6: $D8EC
Box 6: $D8EC
FB ei
EA F5 F8 ld ($F8F5), a
FB ei
EA 9D FA ld ($FA9D), a
F6 FF or $FF ; a = $FF, reset carry flag
EA xx F5 ld ($F5xx), a ; Ranges from $F57E to $F5AF, all 50 TMs
F1 pop af
21
FE AF cp $AF
50 ld d, b



Box 7: $D8F5
Box 7: $D8F5
7E F5 ld hl, wTMsHMs
D2 FC F8 jp nc, .continue
A7 and a, a ; Reset carry flag
01 32 00 ld bc, $0032
D4 4C 31 call nc, byteFill
D2 E3 F8 jp nc, .loop
.continue
AF xor a, a
50 ld d, b
50 ld d, b


Box 8: $D8FE
Box 8: $D8FE
E6 D2 and $D2 ; a = $D2
F6 D2 and $D2 ; a = $D2, reset carry flag
EA 9C FA ld ($FA9C), a
D4 D6 F8 call nc, .write
D6 FA sub $FA ; a = $D8, TM25's item ID
D6 93 sub $93 ; a = $3F
87 add a, a ; a = $7E, reset carry flag
FB ei
50 ld d, b
50 ld d, b


Box 9: $D907
Box 9: $D907
D4 D6 F8 call nc, .write
D6 9D sub $9D ; a = $E1, TM33's item ID
EA B8 F5 ld (wItems), a ; Main item pocket, first item ID
EA B8 F5 ld (wItems), a ; Main item pocket, first item ID
D6 E3 sub $E3 ; a = $F5
EA 9E FA ld ($FA9E), a
50 ld d, b
50 ld d, b


Box 10: $D910
Box 10: $D910
D6 B7 sub $B7 ; a = 3E, reset carry flag
F6 F5 or $F5 ; a = $F5
EA 9A FA ld ($FA9A), a
D2 D6 F8 jp nc, .write
D0 ret nc
50 ld d, b
50 ld d, b


Party pokémon #5's stat experience, starting from $DAFA
TM33 bootstrap, starting from $D418
3E 04 ld a, $04
3E 04 ld a, $04
D2 7E F5 jp nc, wTMsHMS ; Carry and zero flag are both reset when using TM25
D2 7E F5 jp nc, wTMsHMS ; Carry and zero flag are both reset when using TM25
</pre>

====Raw Assembly====

<pre>
AF D6 E8 EA D1 F8 D6 F7 50
EA D0 F8 D6 FF EA D6 F8 50
F4 F4 D6 83 87 87 D0 FB 50
E6 84 D4 D6 F8 D6 87 FB 50
D6 FF EA EF F8 F5 F6 FF 50
FB FB EA F5 F5 F1 FE AF 50
D2 FC F8 A7 D2 E3 F8 AF 50
F6 D2 D4 D6 F8 D6 93 87 50
D4 D6 F8 D6 9D EA B8 F5 50
F6 F5 D2 D6 F8 50 50 50 50
</pre>
</pre>


Line 595: Line 609:
<pre>
<pre>
Box 1: $D8BF
Box 1: $D8BF
80 add a, b
AF xor a ; a = $00
AF xor a ; a = $00
D6 FC sub $FC ; a = $04
D6 E8 sub $FF ; a = $18
EA 9B FA ld ($FA9B), a
EA D1 F8 ld ($F8D1), a
D6 F7 sub $F7 ; a = $21
FB ei
50 ld d, b
50 ld d, b


Box 2: $D8C8
Box 2: $D8C8
EA D0 F8 ld ($F8D0), a
D6 86 sub $86 ; a = $7E
D6 FF sub $FF ; a = $22
EA 9D FA ld ($FA9B), a
D6 89 sub $89 ; a = $F5
EA D6 F8 ld ($F8D6), a
21
FB ei
50 ld d; b


Box 3: $D8D1
Box 3: $D8D1
EA 9E FA ld ($FA9E), a
18 F4 ld hl, $F418
D6 B7 sub $D7 ; a = $3E
D6 83 sub $83 ; a = $9F
.doubleAndWrite
EA 9A FA ld ($FA9A), a
87 add a, a ; a = $3E, carry flag set
.write
22 ldi (hl), a
D0 ret nc ; Ignore on first pass, taken when .write/.doubleAndWrite called
FB ei
50 ld d, b
50 ld d, b


Box 4: D8DA
Box 4: D8DA
E6 84 and $84 ; a = $04
87 add a, a
D4 D6 F8 call nc, .write
D6 B9 sub $B9 ; a = $C3
AF xor a ; a = $00
EA 9C FA ld ($FA9C), a
A7 and a ; Reset carry flag
F6 D2 or $D2 ; a = $D2
D0 ret nc
50 ld d, b
50 ld d, b


Box 5: $D8E3
Party pokémon #3's stat experience, starting from $DA9A
D4 D6 F8 call nc, .write
D6 93 sub $93 ; a = $3F
D4 D5 F8 call nc, .doubleAndWrite
50 ld d, b

Box 6: $D8EC
AF xor a ; a = $00
F6 F5 or $F5 ; a = $F5
D2 D6 F8 jp nc, .write
50 ld d, b

TM33 bootstrap, starting from $D418
3E 04 ld a, $04
3E 04 ld a, $04
C3 7E F5 jp wTMsHMs ; Carry and zero flag are both reset when using TM25
D2 7E F5 jp nc, wTMsHMS ; Carry and zero flag are both reset when using TM25
</pre>
</pre>

====Raw Assembly====

<pre>
AF D6 E8 EA D1 F8 D6 F7 50
EA D0 F8 D6 FF EA D6 F8 50
F4 F4 D6 83 87 87 D0 FB 50
E6 84 D4 D6 F8 AF F6 D2 50
D4 D6 F8 D6 93 D4 D5 F8 50
AF F6 E1 D2 D6 F8 50 50 50
</pre>


[[Category:Guides]]
[[Category:Guides]]