Advertisement
entrpntr

[Crystal Any%] Notes for Checksum Collision route

Sep 15th, 2019 (edited)
1,358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.90 KB | None | 0 0
  1. TID ; target: wait7
  2.  
  3. wait6: 50675 (C5F3)
  4. wait7: 09947 (26DB)
  5. wait8: 33475 (82C3)
  6.  
  7.  
  8. Cynda ; target: f15
  9.  
  10. - f12: d
  11. - f13: l
  12. - f14: r
  13. - f15: u (89F7)
  14. - f16: d->u
  15. - f17: u (EB36/EC37/ED38)
  16. - f18: l->r
  17.  
  18.  
  19. R29 ; target: f4-f7 (f8 also routed)
  20.  
  21. - f3: l
  22. - f4: u
  23. - f5: u->r
  24. - f6: d->u
  25. - f7: u->l
  26. - f8: r
  27. - f9: u
  28.  
  29.  
  30.  
  31. =~=~=~=~=~=~=
  32.  
  33.  
  34. R29 Manip (works on IGT frames 8-14)
  35.  
  36. [4-8] D R R R R D D D D // D D D D
  37.  
  38.  
  39. [4] (npc: u)
  40. A+L L L L D D D D D L L L L L L L L L L L L L L L L L D L D D D D L L L L L L D D L L L L L U L U L U U U U R R R R R U U U U L L L L L L L L L L L L L L L U U L L L L L D D L L L L L L L
  41.  
  42. [5] (npc: u->r)
  43. A+L L L L D D D D D L L L L L L L L L L L L L L D D L D D D D L L L L D L L L L L L L L L L L A+L U U U U U U R R R R R U U U U L L L L L L L L L L L L L L L U U L L L L L D D A+L L L L L L L
  44.  
  45. [6] (npc: d->u)
  46. A+L L L L D D D D D L L L L L L L L L L L L L L D D L A+L L L D D D L L L L L D D L L L L L L U L U L U U U U R R R R R U U U U L L L L L L L L L L L L L L L U U L L L L L D D L L L L L L L
  47.  
  48. [7] (npc: u->l)
  49. D D D L L L L D D L L L L L L L A+L L L L L L D D D D L L D D L L L L D L L L L L L L L L L U U L L U U U U R R R R R U U U U L L L L L L L L L L L L L L L U U L L D L L D D L L L L L L L L
  50.  
  51. --
  52.  
  53. [8] (npc: r)
  54. A+L L L L D D D D D L L L L L L L A+L L L L D D D D L L L L D L L L L L L L L D D L L L L L L L A+L U U U U U U R R R R R U U U U L L L L L L L L L L L L L L L U U L L L L D D A+L L L L L L L L
  55.  
  56.  
  57.  
  58. =~=~=~=~=~=~=
  59.  
  60.  
  61. Practice ROM: https://cdn.discordapp.com/attachments/143862450712739840/618087960650448906/crysany-practice.zip
  62. - (presumably) requires flashcart with RTC for manips to work on console
  63. - Down+Select+B on title screen to load practice menu
  64. > A to load save
  65. > SEL to display diff of the current save compared to the expected save (note: wRTC values will be off when practicing)
  66. - if playing from new game, the "expected" wRTC second (204B) is 1 lower than realistic at cynda, so don't worry if that's off
  67. - wKenjiBreakTimer (27E6) is randomly rolled (between 3-6), but doesn't change between cynda/collision, so value doesn't matter
  68.  
  69.  
  70. Collision window (described by the last address in the sav that is written to before the power-off; assumes correct IGT, etc.)
  71. - v.early (3+ frames) = nothing written; save for cynda manip still present
  72. - early (2009-289B) = invalid checksum (save data is overwritten by cynda save after continue; 4 lagframes loading backup)
  73. - TARGET (289C-298C) = successful checksum collision; window size ~= 12488 cycles = 0.178 frames (or 1.00/5.62) = 2.98ms
  74. - late (298D-2B82) = invalid checksum (save data is overwritten by cynda save after continue; 4 lagframes loading backup)
  75. - v.late (7+ frames) = proper save with valid checksum, but cyndaquil's nickname (and everything after it) is written
  76.  
  77.  
  78. Miscellaneous notes
  79. - gifvex's paste w/route outline: https://pastebin.com/yJnfZbwF
  80. - pokecrystal wram/sav addresses: https://raw.githubusercontent.com/pokemon-speedrunning/symfiles/master/savwram/out/pokecrystal.txt
  81. - Other collision requirements:
  82. > buffered movement to the cynda save tile (for wPlayerField1c), then unbuffered save menu (to deload aide NPC data)
  83. > don't bonk into Elm (for wPlayerObjectStepFrame)
  84. > wait 4 frames after turnframe on collision save tile before menuing (for wPlayerObjectStepFrame)
  85. ; collision can still work, but IGT window changes by +2 (frame perfect) or +1 (2 frames worse than frame perfect)
  86. > unexpected wRTC boundaries being crossed (due to slow intro, etc.) can change the required IGT window by -1
  87. > intended collision cluster is on IGT frames 9-12; above r29 manip works on 8-14 to cover common mess-ups getting "lucky"
  88. - Other ACE requirements
  89. > only works if current box is Box 2
  90. ; have to S&Q after boxes to clear string buffers, so switching wastes no time (and is fastest way to save anyway)
  91. > 2nd/5th/8th characters of Box 6 are irrelevant (2nd/5th are overwritten by ACE, 8th is never reached)
  92.  
  93.  
  94. =~=~=~=~=~=~=
  95.  
  96.  
  97. Flowtimer Config (offsets for GBI, save file as crysany.json)
  98.  
  99. - NOTE: Stairs/S&Q is 2 sec slower than what is possible with TAS; 1 second faster is very plausible for RTA
  100. > can reduce offsets by 1.005 seconds (60 frames) to always do 1st cycle
  101. > alternatively, add beeps so you can do either 1st or 2nd cycle, depending on speed of intro (335ms * 3 beeps = 1005ms)
  102. > TAS only wastes 18 frames to get the *true* 1st cycle, which is not very realistic for RTA
  103.  
  104.  
  105. [{
  106. "numBeeps": 5,
  107. "offsets": "34670/64600",
  108. "name": "TID/SS0",
  109. "removeButton": false,
  110. "interval": 335
  111. }, {
  112. "numBeeps": 5,
  113. "offsets": "73381/76155",
  114. "name": "Stairs/S&Q",
  115. "removeButton": true,
  116. "interval": 335
  117. }, {
  118. "numBeeps": 5,
  119. "offsets": "11519/47048/49333",
  120. "name": "Cyn/Sav/Col",
  121. "removeButton": true,
  122. "interval": 335
  123. }, {
  124. "numBeeps": 5,
  125. "offsets": "11361",
  126. "name": "R29",
  127. "removeButton": true,
  128. "interval": 335
  129. }]
  130.  
  131.  
  132.  
  133. =~=~=~=~=~=~=
  134. =~=~=~=~=~=~=
  135.  
  136. SOURCE CODE (plus other dark secrets and mysteries)
  137.  
  138.  
  139. 15 00 control code ACE ; $15 in [$d10c] = wItemQuantityChangeBuffer
  140. ; $00 in [$d10d] = wItemQuantityBuffer
  141.  
  142. ($d10e :: start of wTempMon struct)
  143.  
  144. ; $9b in wTempMonSpecies (sbc e)
  145. ; $ad in wTempMonItem (xor l)
  146.  
  147. ; $21 in $00+wTempMonMoves (ld hl, $002b)
  148. ; $2b in $01+wTempMonMoves
  149.  
  150. +===========================================================================+
  151. | TID: $26db (ld h, $db) loaded at wTempMonID (RNG manip to get h=$db) |
  152. +===========================================================================+
  153.  
  154. ; 125xp in wTempMonExp (add a)
  155.  
  156. +===========================================================================+
  157. | DVs: $89f7 ; RNG manip to jump to section of wram ~= box names |
  158. +===========================================================================+
  159.  
  160. regs when pc=$d123 (wTempMonDVs)
  161.  
  162. ; af=0200
  163. ; bc=c569
  164. ; de=00ff
  165. ; hl=db2b
  166.  
  167.  
  168. > DV1: $89 = adc c
  169. / ld l,a \
  170. > DV2: $f7 = rst $30 = { pop de }
  171. \ jp hl /
  172.  
  173. > l = a = $6b ($02+$69)
  174. > jp $db6b
  175.  
  176. > [$db6b] = [$f9+wEventFlags] = $80 (add b)
  177. > [$db72] = [wCurBox] = $01 (ld bc, xxxx) ; ld bc, $0000
  178.  
  179.  
  180. regs when pc=$db75 (wBoxNames) | goals from ACE
  181. |
  182. ; af=3030 | [$dcad] = [$fcad] = [wBackupMapGroup] = $03
  183. ; bc=0000 | [$dcae] = [$fcae] = [wBackupMapNumber] = $4c
  184. ; de=d125 | [$dcd7] = [$fcd7] = [wPartyCount] = $00
  185. ; hl=db6b ($80) | [$db5e] = [$fb5e] = [$ec+wEventFlags] = $00
  186. ; bit 2 = EVENT_RED_IN_MT_SILVER = 0 (he's there)
  187.  
  188. >> BOX1: ( é d 5 'v H
  189.  
  190. sbc d
  191. ld [$fb92], a ; $5e
  192. sub $87
  193.  
  194. >> BOX2: é g 5 'v 's é n 6
  195.  
  196. ld [$fb95], a ; $d7
  197. sub $d4
  198. ld [$fcad], a ; $03
  199.  
  200. >> BOX3: × M é o 6
  201.  
  202. pop af
  203. adc h
  204. ld [$fcae], a ; $4c
  205.  
  206. >> BOX4+BOX5: keep their original names
  207.  
  208. ; 'X' ($97) in "BOX" is sub a (a=$00)
  209. ; '4' ($fa) is ld a, [xxxx] (a=[?])
  210. ; '@' ($50) (box terminator)
  211. (a=$c3 from ld a, [$0050])
  212. ; 'X' ($97) in "BOX" is sub a (a=$00)
  213. ; '5' ($fb) is ei (a=$00)
  214. ; '@' ($50) is ld d, b (a=$00 going into BOX6)
  215.  
  216. >> BOX6: é é 5 é é 6 'd
  217.  
  218. ld [$fbxx], a ; $00 | xx @ $fb92 (xx <- $5e)
  219. ld [$fcxx], a ; $00 | xx @ $fb95 (xx <- $d7)
  220. ret nc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement