Prev: 8D8F Up: Map Next: 8E29
8DF9: Seems to setup a transition
Input
A $08 or $F8 to animate forwards or backwards respectively.
setup_transition 8DF9 AND A Set flags from A
8DFA LD C,A Widen A to BC
8DFB LD B,$00
8DFD LD DE,$EC00 Points to first half of table
8E00 JP P,st_set_offset Jump over if A was +ve
8E03 DEC B B = $FF to make BC properly negative
8E04 LD DE,$EC0C Points to second half of table
st_set_offset 8E07 LD ($8DB1),BC Self modify "LD DE,x" at 8DB0 to load BC
Pick a random entry in the table.
8E0B CALL rng Get a random number 0..3
8E0E AND $03
8E10 LD L,A HL = A * 3 + DE
8E11 RLCA
8E12 ADD A,L
8E13 LD L,A
8E14 LD H,$00
8E16 ADD HL,DE
8E17 LD A,(HL) Load first byte from entry
8E18 LD ($8DA1),A Self modify "LD A,x" at 8DA0 to load A
8E1B INC HL DE = wordat(++HL)
8E1C LD E,(HL)
8E1D INC HL
8E1E LD D,(HL)
8E1F LD ($8DBB),DE Set transition animation start address
8E23 LD A,$04 4 frames of animation? 4 states?
8E25 LD ($A231),A transition_control = A
8E28 RET Return
Prev: 8D8F Up: Map Next: 8E29