Advertisement
Torchickens

Twinleaf Town in Pokémon Red description continued

Mar 31st, 2015
1,232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.04 KB | None | 0 0
  1. Read description for more information:
  2. https://www.youtube.com/watch?v=ddSHGg4-qSY
  3. I made two new 8F programs that turn Pallet Town into a devamped version of Twinleaf Town from Pokémon Diamond and Pearl!
  4.  
  5. It's not an April Fool's joke, but it's nice this was uploaded near/on April 1. Like TheZZAZZGlitch's Pokémon pong, although this takes time to set up, you can pull this off without a GameShark or an emulator's memory editor if you have the patience to do so. To set everything up, I used a slightly altered version of TheZZAZZGlitch's method for writing programs up to 254 bytes long (https://www.youtube.com/watch?v=D3EvpRHL_vk).
  6.  
  7. Summary:
  8. ----
  9. My code is stored from DC01-DCF0 (program 1) and from DD01-DD70 (program 2).
  10.  
  11. All of this data is supposed to be for data about Pokémon in the current box, so the code effectively stays there to be executed whenever you want until you change boxes or mess with a box's contents.
  12.  
  13. Once the code is executed, Pallet Town's map script byte (D5F1) is set to invalid value hex:15. This tells the game to execute arbitrary code from DB3E whenever you enter Pallet Town.
  14.  
  15. Program 1 (240 bytes) changes Pallet Town into basically this map (http://i.minus.com/iTZQ884Oe5f79.png, created with a tool called Pokemap) (but I made some minor changes to the top section) surrounded by some trees. This was done by modifying the 4x4 tile blocks in memory from C6F9. The program tells the game to write some data to the DB3E address, and the DB3E code copies 4x4 block addresses from DC04 into C6F9 using a 'call CopyData' with C6F9 (4x4 blocks on the screen) as the destination. In order for 8F not to execute the Twinleaf Town layout information as code, there is a jp DCDF at DC01 to jump over it.
  16.  
  17. Program 2 (112 bytes) adds custom text to the sign and adjusts the map's warps/gives all four doors a suitable warp. To add the custom text, I set the sign coordinates/number of signs by adjusting D4B0 onward. The number of signs was set to 05, and I added coordinates for sign 05, a glitch sign that doesn't normally exist. Sign 05 gets its text data from CA01; so I make the program write data beginning with 00 ('print text') to CA01, followed by character bytes that read "Twinleaf Town[NL]Fresh and Free![57]" The program writes to DB4A (overwriting the last byte, a ret in program 1, and overwriting the data onward) with three CopyData iterations. Like in program 1, the code at DD01 jumps over the variables (warp data, sign data, sign text data) to copy before writing to DB4A and DB4A taking the data from the variables past DD01.
  18.  
  19. To adjust the warps, I modified D3AE (number of warps) to 04 then the bytes that follow it that control the coordinates of warps and where they go.
  20.  
  21. My warps: Rival's house (top-left), Hall of Fame (top-right), Oak's Lab (bottom-left), Your house (bottom-right)
  22.  
  23. When you enter Pallet Town, parts of the map may originally look unchanged. You need to move them off the screen to load Twinleaf Town.
  24. --
  25. Setting things up:
  26. --
  27.  
  28. 1) Get 8F. One way is to use dry underflow (https://www.youtube.com/watch?v=ZyppANEvnh8) and the looping map trick to get 8F. (here is an 8F creation spot after Celadon City loops http://i2.minus.com/ikRWiyNP77Gap.png).
  29.  
  30. Another way is to use a double distort CoolTrainer (https://www.youtube.com/watch?v=aqy9QSbn1to) with a Good Rod in the fourth position using x (multiplication sign), however, CoolTrainer has to work on your save and I only really know about the 7 letter long name method yet.
  31.  
  32. 2) Get specific Pokémon in your party to redirect the code to item 3. They are needed for your code to work. (e.g. http://forums.glitchcity.info/index.php/topic,6638.msg194471.html#msg194471)
  33.  
  34. 3) A modified version of TheZZAZZGlitch's 'jailbreak' trick to turn Pokémon Red into Pong:
  35.  
  36. Prepare the following items from item 1:
  37. Max Repel x99 (optional but recommended)
  38. 8F x(any)
  39. X Accuracy, x97
  40. Burn Heal, x126
  41. Parlyz Heal, x15
  42. HP UP, x15
  43. Ice Heal, x15
  44. Potion, x134
  45. TM34, x20
  46. TM20, x46
  47. Leaf Stone, x52
  48. Great Ball, x201
  49. TM10, x1
  50. TM15, x46
  51. TM21 x46 (if you want to execute program 2 later to get warps and the sign to work)
  52.  
  53. 4) Swap TM20 x46 with TM15 x46, use 8F and jump off a ledge to walk through walls.
  54. 5) Swap TM20 and TM15 back, toss TM34 until only one of them remains. The program is now in entering mode, and upon using 8F one byte is written to DC01 onward, with its value depending on your X and Y positions (i.e. y=01, x=F is a value of 1F, y=00 x=05 is a value of 05, etc). TM34's value will increase each time you put in a byte.
  55.  
  56. 6) Write the following data ("Program 1") by walking to the right position (e.g. first you need to walk to y=C x=3), preferably while using repels to avoid grass encounters. You can use a memory viewer to keep track of what spots have which coordinates. But if this is not an option, here is a map that tells you the coordinates of spots. http://i1271.photobucket.com/albums/jj640/Torchickens/Coordinates%20map.png
  57.  
  58. Data:
  59. Raw code:
  60. C3DFDC0F0F0F0F0F0F7B7B0F0F0F0F0F
  61. 0F0F0F0F0F0F0F0F0F7B7B0F0F0F0F0F
  62. 0F0F0F0F0F0F0F0F0F0A0A0F0F0F0F0F
  63. 0F0F0F0F0F0F0C0E0A0A0A0A0A0A0F0F
  64. 0F0F0F0F0F0F10120A7B7B0A02030F0F
  65. 0F0F0F0F0F0F0A7B7B7B797B7B0A0F0F
  66. 0F0F0F0F0F0F74740A7B7B0A74740F0F
  67. 0F0F0F0F0F0F0A0A0A7B7B0A0C0E0F0F
  68. 0F0F0F0F0F0F02030A7B7B0A10120F0F
  69. 0F0F0F0F0F0F0A7B7B7B7B7B7B0A0F0F
  70. 0F0F0F0F0F0F0F0F1D1F1F1E0F0F0F0F
  71. 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
  72. 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
  73. 0F01CE002104DC11F9C6CDB500C9010D
  74. 0021D2DC113EDBCDB5003E15EAF1D5C9
  75.  
  76. ASM (Program 1):
  77. jp DCDF
  78. db 0F0F0F0F0F0F7B7B0F0F0F0F0F
  79. 0F0F0F0F0F0F0F0F0F7B7B0F0F0F0F0F
  80. 0F0F0F0F0F0F0F0F0F0A0A0F0F0F0F0F
  81. 0F0F0F0F0F0F0C0E0A0A0A0A0A0A0F0F
  82. 0F0F0F0F0F0F10120A7B7B0A02030F0F
  83. 0F0F0F0F0F0F0A7B7B7B797B7B0A0F0F
  84. 0F0F0F0F0F0F74740A7B7B0A74740F0F
  85. 0F0F0F0F0F0F0A0A0A7B7B0A0C0E0F0F
  86. 0F0F0F0F0F0F02030A7B7B0A10120F0F
  87. 0F0F0F0F0F0F0A7B7B7B7B7B7B0A0F0F
  88. 0F0F0F0F0F0F0F0F1D1F1F1E0F0F0F0F
  89. 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
  90. 0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F
  91. 0F ["Twinleaf Town" 4x4 blocks]
  92. ld bc,00CE
  93. ld hl,DC04
  94. ld de,C6F9
  95. call 00B5
  96. ret
  97. ld bc,000D
  98. ld hl,DCD2
  99. ld de,DB3E
  100. call 00B5
  101. ld a,15
  102. ld (D5F1),a
  103. ret
  104.  
  105. 7) Swap TM10 x1 with TM34 and use 8F to execute your code.
  106.  
  107. 8) Congratulations, program 1 (map layout into Twinleaf Town) is complete.
  108.  
  109. 9) Go back to Route 1 and set up your items like they were at the beginning (i.e. toss TM34 until you have 20). However, this time the TM21 x46 needs to be in the place of the TM20 x46, so that you begin writing at DD01 onwards instead of DC01 onward.
  110.  
  111. 10) Swap TM21 x46 with TM15 x46, use 8F and jump off a ledge to walk through walls.
  112.  
  113. 11) Swap TM21 and TM15 back, toss TM34 until only one of them remains. The program is now in entering mode, and upon using 8F one byte is written to DD01 onward, with its value depending on your X and Y positions (i.e. y=01, x=F is a value of 1F, y=00 x=05 is a value of 05, etc). TM34's value will increase each time you put in a byte.
  114.  
  115. 12) Write the following data ("Program 2").
  116.  
  117. Raw code:
  118. C364DD05FFFFFFFFFFFFFFFF070B0093
  119. B6A8ADABA4A0A57F93AEB6AD4E85B1A4
  120. B2A77FA0ADA37F85B1A4A4E757040504
  121. 0027050F00760D0300280D100025010B
  122. 002104DD11B0D4CDB500011F00210FDD
  123. 1101CACDB500011100212EDD11AED3CD
  124. B500C9012500213FDD114ADBCDB500C9
  125.  
  126. ASM (Program 2):
  127. jp DD64
  128. db 05FFFFFFFFFFFFFFFF070B [# of Signs, Sign coordinates]
  129. db 0093B6A8ADABA4A0A57 [Custom text]
  130. db 0405040027050F00760D0300280D100025 [Warps]
  131. ld bc,000B
  132. ld hl,DD04
  133. ld de,D4B0
  134. call 00B5
  135. ld bc,001F
  136. ld hl,DD0F
  137. ld de,CA01
  138. call 00B5
  139. ld bc,0011
  140. ld hl,DD2E
  141. ld de,D3AE
  142. call 00B5
  143. ret
  144.  
  145. 13) The next time you go to "Twinleaf Town", the signs and warps should be functionable.
  146.  
  147. Removing Twinleaf Town:
  148. 14) Set up dry underflow (https://www.youtube.com/watch?v=ZyppANEvnh8) in your item storage box, then place one of the j. x0 into item 92, which should be a Boulder Badge (probably the second one you encounter while scrolling down). If you run into long name glitch items you may need to hold down and press B a few times to get past them. This does not change the data you wrote, but will change Pallet Town's script to 00h from 15h, where no arbitrary code is executed upon entering the town.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement