Advertisement
Crystal_

Coin Case / TM17 as Memory Editor

Oct 17th, 2017
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. ### To get wrong pocket TM17
  2.  
  3. BOX NAMES (boxes 1 to 5) - https://i.imgur.com/Ts8QRXT.png
  4.  
  5. Use Coin Case with Quagsire @ TM02 - Return
  6.  
  7. ; d8bf - BOX 1
  8. add b
  9. ; Entry point
  10. xor a
  11. or $d0
  12. ld [$f5b8], a ; write TM17 to items pocket item #1
  13. pop hl
  14. ld d, b
  15.  
  16. ; d8c8 - BOX 2
  17. sub $d5
  18. sub $ea ; a = 0x11
  19. ld [$f8d1], a ; write 'ld de' of ld de, $f8d0
  20. and a
  21. ld d, b
  22.  
  23. ; d8d1 - BOX 3
  24. db $d0, $d0, $f8 ; <-- this becomes ld de, $f8d0
  25. sub $ff ; a = 0x12
  26. add sp, $ff
  27. push de
  28.  
  29. ; d8da - BOX 4
  30. ld [$f8e6], a ; write '12' of jp nc, $12f5
  31. and a
  32. and a
  33. and a
  34. and a
  35. and a
  36. ld d, b
  37.  
  38. ; d8e3 - BOX 5
  39. and a
  40. db $d2, $f5, $f5 ; <-- this becomes jp nc, $12f5
  41. db $50, $50, $50, $50, $50
  42.  
  43. ----------------------------------------
  44.  
  45. ### To get TM09
  46.  
  47. BOX NAMES (box 1) - https://i.imgur.com/PLlSVww.png
  48.  
  49. Use TM17 with quagsire @ TM02 - Return
  50.  
  51. ; d8bf - BOX 1
  52. add b
  53. ; Entry point
  54. xor a
  55. or $ff
  56. ld [$f586], a
  57. ret nc
  58. ld d, b
  59.  
  60. ----------------------------------------
  61.  
  62. ### To use TM17 as a memory editor
  63.  
  64. BOX NAMES (boxes 2 to 10) - https://i.imgur.com/PLlSVww.png
  65.  
  66. Rename Box 1 as address+value code.
  67. Give Quagsire TM09, then use TM17.
  68.  
  69. ; d8bf - BOX 1
  70. ; address + value code
  71.  
  72. ; d8c8 - BOX 2
  73. xor a
  74. sub $a0
  75. sub $a1 ; a = 0xbf
  76. ld [$f8e7], a ; write 'l' of ld hl, d16
  77. ld d, b
  78.  
  79. ; d8d1 - BOX 3
  80. sub $9e ; a = 0x21
  81. ld [$f8e6], a ; write 'ld hl' of ld hl, d16
  82. sub $fe ; a = 0x23
  83. ei
  84. ld d, b
  85.  
  86. ; d8da - BOX 4
  87. ld [$f8f8], a ; write inc hl
  88. sub $f9 ; a = 0x2a
  89. ld [$f8f6], a ; write ld a, [hli]
  90. ld d, b
  91.  
  92. ; d8e3 - BOX 5
  93. and a
  94. and a
  95. and a
  96. db $f8, $f8, $f8 ; <-- this becomes ld hl, $f8bf
  97. and a
  98. and a
  99. ld d, b
  100.  
  101. ; d8ec - BOX 6
  102. call nc, $f8fe
  103. and a
  104. and a
  105. and a
  106. db $ea, $ea, $50 ; <-- this becomes ld [<address>], a
  107.  
  108. ; d8f5 - BOX 7
  109. ret nc
  110. hl_reads_d8f6:
  111. db $f8 ; <-- this becomes ld a, [hli]
  112. add [hl]
  113. db $f8 ; <-- this becomes inc hl
  114. and a
  115. ret nc
  116. db $50, $50, $50
  117.  
  118. ; d8fe - BOX 8
  119. shifted_code_d8fe:
  120. call nc, $f8f6
  121. and a
  122. ld [$f8f4], a ; write high byte of address
  123. and a
  124. ld d, b
  125.  
  126. ; d907 - BOX 9
  127. call nc, $f8f6
  128. and a
  129. ld [$f8f3], a ; write low byte of address
  130. and a
  131. ld d, b
  132.  
  133. ; d910 - BOX 10
  134. call nc, $f8f6
  135. ret nc ; return value in a
  136. db $50, $50, $50, $50, $50
  137.  
  138. ----------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement