Advertisement
Torchickens

Pokémon Yellow rotating Porygon save file

Nov 25th, 2022 (edited)
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.49 KB | None | 0 0
  1. Notes: While coding this things went wrong and a couple of the sprites are unused (one of them was glitched and did not display properly). This program works but there are various things I stubbed out/overwrote.
  2.  
  3.  
  4. Q&A:
  5.  
  6. *Where is the save file?:
  7.  
  8. Here ^^
  9. https://drive.google.com/file/d/1DoI4gl8o1D3wQEWsbcGY5B53tzlcIaim/view?usp=sharing
  10.  
  11. *What is this?:
  12.  
  13. A way to display 7 custom Pokémon sprites on loop, even if they're not in the game.
  14.  
  15. *How to start it:
  16.  
  17. -Talk to the man in front of Red to view the rotating Porygon
  18.  
  19. -(Optional) Use ws m in the bag to view just one sprite of it
  20.  
  21. -(Optional) Use 4F to set the palette to Virtual Boy mode. Though you can do the two above without setting the palette. (edit: I'll need to update the save file again sorry, as this also changes the map script and freezes the game after closing the menu on an unknown opcode at the moment. It might not freeze on Nintendo 3DS Virtual Console because they ignore unknown opcodes. Either way, a GameShark code 010E5CD3 will fix that for now by setting the palette without 4F).
  22.  
  23. *How did you make it rotate?
  24.  
  25. You can play around with the skew feature on Paint, and for the upside down Porygon I rotated some parts while keeping the rest and made some small other changes.
  26.  
  27. *How do I add sprites?:
  28.  
  29. To import sprites, use/follow the steps on the readme of the sprite import tools link on my old Google Sites.
  30. https://sites.google.com/site/torchickens2/glitching-tools
  31.  
  32. You don't have to do a rotation demo, for example, you could add a slideshow of seven or more unreleased Pokémon, or Gen II+ Pokémon, etc.
  33.  
  34. This only works for compressed sprites (not uncompressed sprites) and if you're editing the Porygon rotation demo save,
  35. a maximum of 0x015A bytes long (as in the ld bc,015A below) (unless you rework the code).
  36.  
  37. Editing the code can be done by opening BGB debugger and going to the memory addresses below.
  38.  
  39. To do that,
  40.  
  41. 1. Run BGB emulator with Pokémon Yellow and the save file (the easiest way is to rename the save file the same name as the ROM and have it in the
  42. same folder/directory). Right click on the window and go to other>debugger.
  43. 2. Right click again on the new debugging window and select "Go to..."
  44. 3. Choose one of the below memory addresses (such as da80, dd50, dac5, etc.) you want to inspect by typing da80 and clicking OK, etc.
  45. DAC5-DBE4 is the first picture, which you can replace with your own after following the steps below and copy/pasting the bytes.
  46. For the save file, it's a bit more complicated as the save file is normally locked.
  47. On the debugger, click debug, then access breakpoints, then add an entry for address range A000-BFFF (the value doesn't matter) with on write checked.
  48.  
  49. Attempt to save the game. Now, BGB should pause at a point where the save file is open. This time go to 2:(save file pointer) such as 2:A000 for the picture 2,
  50. 2:A15A for the picture 3, etc. You can then right click and modify code/data, then paste the bytes you got using your hex editor after making a new compressed
  51. sprite with the sprite import tools.
  52.  
  53.  
  54. *Changing the 'Virtual Boy palette': Go to DA65 and change the 0E to another ID to get another possible palette after using the 4F in your bag. Or directly,
  55. you can just edit D35C but this won't change how 4F works. As another example, f0 d3 ea 5c d3 c9 at DA64 would give a (pseudo)random palette after using 4F.
  56. Note 4F won't work on Nintendo 64 GB Tower (and I haven't tested it there for this concept either).
  57.  
  58. da80 (da81-dac4)
  59. > print box of compressed picture file, next text box at DD00.
  60.  
  61. dd50
  62. > declare dimensions/sprite source (picture 1) ; dimensions = 56x56 ($77), pointer=dac5
  63.  
  64. dac5-dbe4
  65.  
  66. > Picture 1, Gen I compressed picture file
  67.  
  68. 77 BF 49 53 D1 5B DC F2 D5 0E BC 28 8C C9 53 A5 7E A1 8E 38 EA 82 8B 62 D0 DA AA A2 23 95 04 95 0F B2 E2 DC BA 38 D4 56 D6 58 D5 92 5D 43 38 DF 82 0C 23 14 A8 BA 05 38 FE 1F 21 8C 20 96 86 18 22 63 8E 85 0A 8C 53 14 1E 29 39 6D 29 68 3A 31 5A 3B D5 A8 AC CA E8 C2 3C 3C C6 33 8F 0F 39 13 C4 81 3D 8C 85 63 28 F1 B0 A8 C5 AA 3C 54 15 31 53 C8 78 9A 94 F2 9C 22 D5 F6 8F 11 0E 15 43 FA 8F 1D E0 5F A8 F3 77 C2 8F C5 F7 E9 29 E9 21 AC 19 E5 20 B0 21 44 F9 92 76 2E 85 F4 4A E6 7C 75 61 4B 43 7F B8 23 2C 76 AC D4 08 E1 B5 02 D4 47 BE 38 67 26 2A 14 0A 1C 12 09 78 2A 0B A8 67 1B F0 42 C5 D2 08 E4 C0 9D 1F 12 D3 C4 41 41 71 30 30 41 04 72 A2 DF C0 A1 C0 95 20 A8 A8 A7 3C 90 B4 31 12 5C 91 47 66 14 6A 95 AB 44 47 94 98 E4 47 8B 97 06 52 29 E3 46 09 EB 2F 28 EB 9E 47 E3 44 E4 C7 90 A6 2E 79 8D 7E A3 1E 53 51 28 60 C7 8E B4 08 2C C1 1E 42 C8 4C 11 E6 E1 30 47 E2 E0
  69.  
  70. (1. facing left)
  71.  
  72. dd00 (dd01)
  73. > ASM (text code) for picture 2 - Open bank 2 of save file, copy $015A bytes of data from 2:A000 to dynamically change dac5. Next text box is now at DD1F.
  74.  
  75. db 08
  76. ld a,02
  77. ld (4000),a
  78. ld a,0a
  79. ld (0000),a
  80. ld bc,015a
  81. ld de,dac5
  82. ld hl,a000
  83. call 00b1
  84. ld a,1f
  85. ld (dac2),a
  86. jp da81
  87.  
  88. (2. diagonal bottom left)
  89.  
  90. dd1F
  91. > ASM (text code) for picture 3. Next text box is now at dd60
  92.  
  93. db 08
  94. ld a,02
  95. ld (4000),a
  96. ld a,0a
  97. ld (0000),a
  98. ld bc,015a
  99. ld de,dac5
  100. ld hl,a15a
  101. call 00b1
  102. ld a,60
  103. ld (dac2),a
  104. jp da81
  105.  
  106. (3. facing down red/blue sprite)
  107.  
  108. dd60
  109. > ASM (text code) for picture 4. Next text box is now at dd60.
  110.  
  111.  
  112. A15A +15B=A2B5 (picture 4)
  113. DD60 +1F=7F (next text code)
  114.  
  115. db 08
  116. ld a,02
  117. ld (4000),a
  118. ld a,0a
  119. ld (0000),a
  120. ld bc,015a
  121. ld de,dac5
  122. ld hl,a2B5
  123. call 00b1
  124. ld a,7f
  125. ld (dac2),a
  126. jp da81
  127.  
  128.  
  129. (4. diagonal bottom-right)
  130.  
  131. DD7F
  132.  
  133.  
  134. ''' +15B = A410 (picture 5)
  135. DD9E (next) (note I used 7.pic because 6.pic wouldn't display properly)
  136.  
  137. db 08
  138. ld a,02
  139. ld (4000),a
  140. ld a,0a
  141. ld (0000),a
  142. ld bc,015a
  143. ld de,dac5
  144. ld hl,a410
  145. call 00b1
  146. ld a,9e
  147. ld (dac2),a
  148. jp da81
  149.  
  150. (5. another intermediatry between bottom-right and top-right unneeded on hindsight)
  151.  
  152. DD9E
  153. ''' +15B = A56B (picture 6)
  154. DDBD (next)
  155.  
  156. db 08
  157. ld a,02
  158. ld (4000),a
  159. ld a,0a
  160. ld (0000),a
  161. ld bc,015a
  162. ld de,dac5
  163. ld hl,a56b
  164. call 00b1
  165. ld a,bd
  166. ld (dac2),a
  167. jp da81
  168.  
  169. (6. diagonal top-right)
  170.  
  171. DDBD
  172. ''' +15B = A6C6 (picture 7)
  173. DDDC (next)
  174.  
  175. db 08
  176. ld a,02
  177. ld (4000),a
  178. ld a,0a
  179. ld (0000),a
  180. ld bc,015a
  181. ld de,dac5
  182. ld hl,a6c6
  183. call 00b1
  184. ld a,dc
  185. ld (dac2),a
  186. jp da81
  187.  
  188. (7. facing up 'upside down Porygon')
  189.  
  190. DDDC
  191. ''' +15B = A821 (I stored another copy of the picture 1 here, it works though inefficient (as is the rest of this program))
  192. DD00
  193.  
  194. db 08
  195. ld a,02
  196. ld (4000),a
  197. ld a,0a
  198. ld (0000),a
  199. ld bc,015a
  200. ld de,dac5
  201. ld hl,a821
  202. call 00b1
  203. ld a,00
  204. ld (dac2),a
  205. jp da81
  206.  
  207. (8. copy of picture 1 'facing left', loop to picture 2, and repeat indefinitely))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement