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