Drennthew

Veran Warp in Oracle of Ages JP

May 26th, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. As done here: https://www.twitch.tv/drenn_thew/v/42860974 (around 2:09:00)
  2.  
  3. The goals of the custom code are to spawn veran by:
  4. - writing $2d to dx41 (veran object ID)
  5. - writing a nonzero value to dx40 (activate veran object)
  6.  
  7. Each sprite is 4 bytes, but I only have direct control over the x-position. The y-position is always
  8. $e0 on the map screen. The rest depend on what kind of sprite it is. The Cane of Somaria block is
  9. useful, because the right half's sprite ID and attribute correspond to "ld (hl),$2d". That's
  10. insanely lucky because $2d is veran's object ID.
  11.  
  12. For the most part, the mystery seed poof is used because it's easy to place wherever I want in the
  13. sprite memory, and it doesn't have many side effects. But it does overwrite the 'A' register. So at
  14. one point I need to use link's right half and dimitri's flute's note instead when I'm using that
  15. register.
  16.  
  17. The sprites are placed in memory where I need them by having a specific number of other sprites on
  18. the screen at the same time. Bgb's OAM viewer (sprite viewer) is your friend. They are written
  19. backwards, because the earliest slots are the earliest ones to get overwritten.
  20.  
  21. Once the code is in place, you go to the map screen. You need to select the glitched map tile at
  22. a precise time - right after the arrow disappears. This is because the cursor and portal animations
  23. might interfere with the custom code, though I didn't experiment with this much.
  24.  
  25. You need to keep doing this until the game decides to run your code. The memory the custom code is
  26. in is unreadable while the screen is being drawn, so you need to persist until you happen to get
  27. a favorable timing.
  28.  
  29.  
  30. Code created using sprites:
  31.  
  32. (numbers on the left are sprite indices, numbers in brackets are x positions)
  33.  
  34. 0,1,2,3 ??? | Map sprites (not directly modifiable)
  35. 4 [??] ??? | Link facing right [left half]
  36. 5 [??] ??? | Link facing right [right half]
  37. 6 [18] jr $08 | Roc's feather shadow
  38. 7 [??] ??? | Mystery seed poof [right half]
  39. 8 [??] ??? | Mystery seed poof [right half]
  40. 9 [??] ??? | Mystery seed poof [right half]
  41.  
  42. -- Actual important code starts here --
  43.  
  44. a [47] ld b,a | Mystery seed poof [right half]
  45. b [61] ld h,c | Mystery seed poof [right half]
  46. c [69/6c] ld l,h | Mystery seed poof [right half]
  47. d [2a/3a] ldi a,(hl) | Link facing right [right half]
  48. e [0f] rrc a | Dimitri's flute note?
  49. f [6f] ld l,a | Mystery seed poof [right half]
  50. 10 [63] ld h,e | Mystery seed poof [right half]
  51. 11 [75] ld (hl),l [ld [d440],l] | Mystery seed poof [right half]
  52. 12 [2c] inc l | Mystery seed poof [right half]
  53. 13 [??] ld (hl),2d | Cane of somaria block [right half?]
  54. 14 [??] ret | Fairy
Add Comment
Please, Sign In to add comment