Guides:Wrong Pocket TM ACE setup (JP): Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
Line 235: Line 235:


Use the following link to continue to the next guide: [[User:TimoVM/Mail Writer GS (JP)|Mail writer GS (JP)]]
Use the following link to continue to the next guide: [[User:TimoVM/Mail Writer GS (JP)|Mail writer GS (JP)]]

=Appendix: in-depth explanation of the setup=

===Effect of Unown===

Using TM17 will trigger ACE from address $FA47 onward, an echo RAM copy of $DA47, in the middle of Unown's stat values. Lvl 5 Unown will never have stat values that can cause the game to softlock or crash, allowing execution to safely slide through this region until it encounters Quagsire's data.

===Effect of Quagsire===

Translating the species ID, held item ID and first move ID of Quagsire's data to assembly results in the following code:

<pre>
C3 AD D8 jp $D8AD ; 5 bytes before the start of wBoxNames
</pre>

This causes a redirection of execution to a region right in front of wBoxNames. This region is mostly unused and consists of $00 values, with the exception of $D8AF which describes the current active box. After safely sliding through this region, the box name code is executed.

===Effect of the box name===

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

<pre>
AF xor a ; a = $00
3D dec a ; a = $FF
EA 8B D5 ld ($D58B), a ; Address corresponds to TM27's quantity
C9 ret ; Return to normal game operation.
</pre>


==Acknowledgements==
==Acknowledgements==