Jump to content

Guides:Mail Writer GS (non-EN): Difference between revisions

m
no edit summary
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1:
 
 
 
'''WARNING: This portion of the guide is outdated, the contents of this guide have been merged with the main setup articles. It is only kept for legacy purposes. You can find all up-to-date guides on the [[Guides:TimoVM's_gen_2_ACE_setups|TimoVM's Gen 2 ACE setups]] article.'''
 
{{Guides header|Mail writer}}
 
The Mail writer is an arbitrary code execution program that allows the user to quickly and accurately write and execute arbitrary code payloads of up to a maximum size of 428 bytes. Payloads are written from wOtPartyCount onward, where enemy trainer's parties are usually buffered.
 
This guide is applicable to the French, German, Italian and Spanish versions of Gold & Silver only. It is part of the [[Guides:TimoVM's_gen_2_ACE_setups|TimoVM's genGen 2 ACE setups]] set of guides.
 
'''Using the Mail writer requires an ACE setup that redirects execution to the start of box names. For this guide, it is assumed that you've previously set up [[Guides:Wrong Pocket TM ACE setup (non-EN)|Wrong Pocket TM25 ACE]] instead.'''
 
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].
 
=How the mail writer works=
Line 26 ⟶ 31:
= Step 1: setting all TM quantities to x255 =
 
* Rename box names to form the following language dependent codes. '''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;"
Line 241 ⟶ 246:
*# 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;"
Line 267 ⟶ 272:
 
The code overwrites part of itself to call the byteFill function. This will fill the area between $D57E and $D5AF with $FF values, setting all 50 TM quantities to 255. Separately, this code overwrites the latter half of party pokémon #5's stat experience data, allowing it to function as a TM25 bootstrap that redirects execution to the Mail Writer.
 
====French====
 
<pre>
Box 1: $D8BF
80 add a, b
AF xor a ; a = $00, carry flag reset
EA F9 F8 ld ($F8F9), a
DE FF sbc $FF ; a = $01, carry flag set
FB ei
50 ld d, b
 
Box 2: $D8C8
EA F7 F8 ld ($F8F7), a
DE A2 sbc $A2 ; a = $5E, carry flag set
EA FB F8 ld ($F8FB), a
50 ld d; b
 
Box 3: $D8D1
87 add a ; a = $BC, carry flag reset
DE 8B sbc $8B ; a = $31, carry flag reset
EA FC F8 ld ($F8FC), a
E6 A1 or $A1 ; a = $21, carry flag reset
50 ld d, b
 
Box 4: $D8DA
EA F4 F8 ld ($F8F4), a
DE EF sbc $EF ; a = $32, carry flag set
EA F8 F8 ld ($F8F8), a
50 ld d, b
 
Box 5: $D8E3
DE B3 sbc $B3 ; a = $7E, carry flag set
EA F5 F8 ld ($F8F5), a
EA 9D FA ld ($FA9D), a
50 ld d, b
 
Box 6: $D8EC
AF xor a ; a = $00, carry flag reset
DE FC sbc $FC ; a = $04, carry flag set
EA 9B FA ld ($FA9B), a
9F sbc a ; a = $FF, carry flag set
FB ei
21
 
Box 7: $D8F5
7E F5 ld hl, wTMsHMs
01 32 00 ld bc, $0032
DC 5E 31 call c, byteFill
50 ld d, b
 
Box 8: $D907
E6 F5 and $F5 ; a = $F5, carry flag reset
EA 9E FA ld ($FA9E), a
DE B7 sub $B7 ; a = $3E, carry flag reset
FB ei
50 ld d, b
 
Box 9: $D910
EA 9A FA ld ($FA9A), a
87 add a ; a = $7C, carry flag reset
DE B9 sbc $B9 ; a = $C3, carry flag set
FB ei
FB ei
50 ld d, b
 
Box 10: $D919
EA 9C FA ld ($FA9C), a
D9 ret c
50 ld d, b
 
Party pokémon #3's stat experience, starting from $DA9A
3E 04 ld a, $04
C3 7E F5 jp wTMsHMs
</pre>
 
====German====
 
<pre>
Lead-up to wBoxNames: $D8BE
22 ldi (hl), a
 
Box 1: $D8BF
C0
21 F4 F8 ld hl, $F8F4 ; Corresponds to terminator of box #9's name
C4 BE F8 call nz, $F8BE ; Due to mail, a = $21
96 sub (hl) ; a = $7E
50 ld d, b
 
Box 2: $D8C8
C4 BE F8 call nz, $F8BE
96 sub (hl) ; a = $F5
C4 BE F8 call nz, $F8BE
AE xor (hl) ; a = $0E
50 ld d; b
 
Box 3: $D8D1
C4 BE F8 call nz, $F8BE
B6 or (hl) ; a = $9F
86 add (hl) ; a = $32
C4 BE F8 call nz, $F8BE
50 ld d, b
 
Box 4: $D8DA
86 add (hl) ; a = $C3
C4 BE F8 call nz, $F8BE
86 add (hl) ; a = $79
C4 BE F8 call nz, $F8BE
50 ld d, b
 
Box 5: $D8E3
86 add (hl) ; a = $31
C4 BE F8 call nz, $F8BE
A6 and (hl) ; a = $21
C4 BE F8 call nz, $F8BE
50 ld d, b
 
Box 6: $D8EC
AF xor a ; a = $00
F6 9A or $9A ; a = $9A
C4 BE F8 call nz, $F8BE
F6 FF or $FF ; a = $FF
21
 
Box 7: $D8F5
7E F5 ld hl, wTMsHMs
0E 32 ld c, $32
C4 5E 31 call nz, byteFill
21 9A
 
Box 8: $D907
FA ld hl, $FA9A
E6 7F and $7F ; a = $7F
E6 BE and $BE ; a = $3E
C4 BE F8 call nz, $F8BE
50 ld d, b
 
Box 9: $D910
E6 84 and $84 ; a = $04
C4 BE F8 call nz, $F8BE
AF xor a ; a = $00
F6 C2 or C2 ; a = $C2
50 ld d, b
 
Box 10: $D919
C4 BE F8 call nz, $F8BE
87 add a ; a = $84
84 add a, h ; a = $7E
C4 BE F8 call nz, $F8BE
 
Box 11: $D922
AF xor a
F6 F5 or $F5 ; a = $F5
C3 BE F8 jp $F8BE
 
Party pokémon #3's stat experience, starting from $DA9A
3E 04 ld a, $04
C2 7E F5 jp nz, wTMsHMs ; Carry and zero flag are both reset when using TM25
</pre>
 
====Italian====
 
<pre>
Box 1: $D8BF
80 add a, b
AF xor a ; a = $00
EA F9 F8 ld ($F8F9), a
D6 FF sub $FF ; a = $01
FB ei
50 ld d, b
 
Box 2: $D8C8
EA F7 F8 ld ($F8F7), a
D6 FD sub $FD ; a = $04
EA 9B FA ld ($FA 9B), a
50 ld d; b
 
Box 3: $D8D1
D6 86 sub $86 ; a = $7E
EA F5 F8 ld ($F8F5), a
EA 9D FA ld ($FA9D), a
50 ld d, b
 
Box 4: $D8DA
C6 A3 add $A3 ; a = $21
EA F4 F8 ld ($F8F4), a
D6 EF sub $EF ; a = $32
FB ei
50 ld d, b
 
Box 5: $D8E3
EA F8 F8 ld ($F8F8), a
C6 FF add $FF ; a = $31
EA FC F8 ld ($F8FC), a
50 ld d, b
 
Box 6: $D8EC
AF xor a ; a = $00
D6 8F suc $8F ; a = $71
EA FB F8 ld ($F8FB), a
F6 FF or $FF ; a = $FF
21
 
Box 7: $D8F5
7E F5 ld hl, wTMsHMs
01 32 00 ld bc, $0032
D4 71 31 call nc, byteFill
50 ld d, b
 
Box 8: $D907
AF xor a ; a = $00
F6 F5 or $F5 ; a = $F5
EA 9E FA ld ($FA9E)
D6 B7 sub $B7 ; a = $3E
50 ld d, b
 
Box 9: $D910
EA 9A FA ld ($FA9A), a
C6 85 add $85 ; a = $C3, reset carry flag
EA 9A FA ld ($FA9C), a
50 ld d, b
 
Box 10: $D919
D0 ret c
50 ld d, b
 
Party pokémon #3's stat experience, starting from $DA9A
3E 04 ld a, $04
C3 7E F5 jp wTMsHMs
</pre>
 
====Spanish====
 
<pre>
Box 1: $D8BF
80 add a, b
AF xor a ; a = $00
EA F9 F8 ld ($F8F9), a
D6 FF sub $FF ; a = $01
FB ei
50 ld d, b
 
Box 2: $D8C8
EA F7 F8 ld ($F8F7), a
D6 FD sub $FD ; a = $04
EA 9B FA ld ($FA9B), a
50 ld d; b
 
Box 3: $D8D1
D6 86 sub $86 ; a = $7E
EA F5 F8 ld ($F8F5), a
EA 9D FA ld ($FA9D), a
50 ld d, b
 
Box 4: $D8DA
C6 A3 add $A3 ; a = $21
EA F4 F8 ld ($F8F4), a
D6 EF sub $EF ; a = $32
FB ei
50 ld d, b
 
Box 5: $D8E3
EA F8 F8 ld ($F8F8), a
C6 FF add $FF ; a = $31
EA FC F8 ld ($F8FC), a
50 ld d, b
 
Box 6: $D8EC
AF xor a ; a = $00
D6 90 suc $90 ; a = $70
EA FB F8 ld ($F8FB), a
F6 FF or $FF ; a = $FF
21
 
Box 7: $D8F5
7E F5 ld hl, wTMsHms
01 32 00 ld bc, $0032
D4 70 31 call nc, byteFill
50 ld d, b
 
Box 8: $D907
AF xor a ; a = $00
F6 F5 or $F5 ; a = $F5
EA 9E FA ld ($FA9E)
D6 B7 sub $B7 ; a = $3E
50 ld d, b
 
Box 9: $D910
EA 9A FA ld ($FA9A), a
C6 85 add $85 ; a = $C3, reset carry flag
EA 9A FA ld ($FA9C), a
50 ld d, b
 
Box 10: $D919
D0 ret c
50 ld d, b
 
Party pokémon #3's stat experience, starting from $DA9A
3E 04 ld a, $04
C3 7E F5 jp wTMsHMs
</pre>
 
===Effect of the TM code===
Line 272 ⟶ 578:
Converting the TM quantities to assembly results in the following code. Please note that this code requires a value of $04 in register a in order to properly work.
 
====French====
<pre>
French
 
<pre>
11 55 DD ld de, $DD55
D5 push de
Line 296 ⟶ 602:
12 ld (de), a
18 EF jr .continue
21 01 C4 ld hl, $C401 ; .screenLoop
4D ld c, l
CD 90 3A call PrintBCDNumber.loop
Line 309 ⟶ 615:
</pre>
 
====German====
<pre>
German
 
<pre>
11 55 DD ld de, $DD55
D5 push de
Line 333 ⟶ 639:
12 ld (de), a
18 EF jr .continue
21 01 C4 ld hl, $C401 ; .screenLoop
4D ld c, l
CD E6 3A call PrintBCDNumber.loop - 1
Line 346 ⟶ 652:
</pre>
 
====Italian====
<pre>
Italian
 
<pre>
11 55 DD ld de, $DD55
D5 push de
Line 370 ⟶ 676:
12 ld (de), a
18 EF jr .continue
21 01 C4 ld hl, $C401 ; .screenLoop
4D ld c, l
CD DE 3A call PrintBCDNumber.loop
Line 383 ⟶ 689:
</pre>
 
====Spanish====
<pre>
Spanish
 
<pre>
11 55 DD ld de, $DD55
D5 push de
Line 407 ⟶ 713:
12 ld (de), a
18 EF jr .continue
21 01 C4 ld hl, $C401 ; .screenLoop
4D ld c, l
CD A2 3A call PrintBCDNumber.loop - 1
Line 423 ⟶ 729:
 
Converting the characters from box names to assembly results in the following code. This code overwrites the latter half of party pokémon #3's stat experience data, allowing it to function as a TM25 bootstrap that redirects execution to the Mail Writer.
 
====French====
 
<pre>
Box 1: $D8BF
AF xor a ; a = $00, reset carry flag
DE FC sbc $FC ; a = $04, set carry flag
EA 9B FA ld ($FA9B), a
D6 85 sbc $85 ; a = $7E, set carry flag
50 ld d, b
 
Box 2: $D8C8
 
EA 9D FA ld ($FA9B), a
DE 88 sbc $88 ; a = $F5, set carry flag
EA 9E FA ld ($FA9E), a
50 ld d; b
 
Box 3: $D8D1
 
DE B6 sub $D6 ; a = $3E, reset carry flag
EA 9A FA ld ($FA9A), a
87 add a, a ; a = $7C, reset carry flag
DE B9 sbc $B9 ; a = $C3, set carry flag
50 ld d, b
 
Box 4: $D8DA
 
EA 9C FA ld ($FA9C), a
D9 reti
50 ld d, b
 
Party pokémon #3's stat experience, starting from $DA9A
3E 04 ld a, $04
C3 7E F5 jp wTMsHMs
</pre>
 
====German====
 
<pre>
Lead-up to wBoxNames: $D8BE
22 ldi (hl), a
 
Box 1: $D8BF
C0 ret nz
21 9A FA hl hl, FA9A
AF xor a ; a = $00
F6 9F or $9F ; a = $9F
87 add a ; a = $3E
50 ld d, b
 
Box 2: $D8C8
C4 BE F8 call nz, $F8BE
E6 84 or $84 ; a = $04
C4 BE F8 call nz, $F8BE
50 ld d, b
 
Box 3: $D8D1
AF xor a ; a = $00
F6 C2 or $C2 ; a = $C2
C4 BE F8 call nz, $F8BE
87 add a ; a = $84
84 add a, h ; a = $7E
50 ld d, b
 
Box 4: $D8DA
C4 BE F8 call nz, $F8BE
AF xor a ; a = $00
F6 F5 or $F5 ; a = $F5
FB ei
FB ei
50 ld d, b
 
Box 5: $D8E3
C3 BE F8 call nz, $F8BE
 
Party pokémon #3's stat experience, starting from $DA9A
3E 04 ld a, $04
C2 7E F5 jp wTMsHMs ; carry and zero flag are both reset when using TM25
</pre>
 
====Italian & Spanish====
 
<pre>
Box 1: $D8BF
AF xor a ; a = $00
D6 FC sub $FC ; a = $04
EA 9B FA ld ($FA9B), a
D6 86 sub $86 ; a = $7E
50 ld d, b
 
Box 2: $D8C8
EA 9D FA ld ($FA9B), a
D6 89 sub $89 ; a = $F5
EA 9E FA ld ($FA9E), a
50 ld d; b
 
Box 3: $D8D1
D6 B7 sub $D7 ; a = $3E
EA 9A FA ld ($FA9A), a
87 add a, a ; a = $7C
D6 B9 sub $B9 ; a = $C3
50 ld d, b
 
Box 4: $D8DA
 
EA 9C FA ld ($FA9C), a
C9 ret
50 ld d, b
 
Party pokémon #3's stat experience, starting from $DA9A
3E 04 ld a, $04
C3 7E F5 jp wTMsHMs
</pre>
 
=Plain text transcripts of codes=
1,540

edits

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