Prev: EE6E Up: Map Next: EF19
EE9E: Define keys
Loads of self modifying hopping around... likely to need a better name.
Input
Used by the routines at wait_for_keypress, redefine_keys and ED6D.
define_keys EE9E XOR A Enable wait/spinlock at dk_wait
EE9F LD ($EF14),A
EEA2 LD A,$00 Self modified by EEA8
EEA4 AND A Set flags
EEA5 JR NZ,define_keys_0 Jump to define_keys_0 if non-zero
EEA7 INC A A++
EEA8 LD ($EEA3),A Self modify EEA2
EEAB JR dk_eec9 Jump to dk_eec9
define_keys_0 EEAD LD A,$00 Self modified by EEBB, cycles 5,3,2,1
EEAF DEC A A--
EEB0 JP Z,dk_eeb9 Jump to dk_eeb9 if zero
EEB3 LD ($EEAE),A Self modified by EE8E
EEB6 JP dk_ef00 Jump to dk_ef00
dk_eeb9 EEB9 LD A,$00 Self modified by EE8E
EEBB LD ($EEAE),A Self modify 'LD A' @ define_keys_0
EEBE LD HL,$0000 Self modified, cycles $F12x .. $F2xx ish
dk_eec1 EEC1 LD A,(HL) A = *HL - 1
EEC2 DEC A
EEC3 JP NZ,dk_eed2 Jump to dk_eed2 if non-zero
EEC6 CALL sub_EE6E Call sub_EE6E
dk_eec9 EEC9 LD HL,$0000 HL = xxxx Self modified by EE94
EECC LD ($EEBF),HL *$EEBF = HL
EECF JP dk_eec1 Goto dk_eec1
dk_eed2 EED2 INC HL HL++
EED3 LD ($EEBF),HL *$EEBF = HL
EED6 INC A A++
EED7 BIT 7,A >= 128?
EED9 JR Z,define_keys_1
EEDB AND $7F A &= $7F note
EEDD EX AF,AF'
EEDE LD A,$01 Self modify 'LD A' @ define_keys_0
EEE0 LD ($EEAE),A
EEE3 LD ($EF01),A Self modify 'LD A' @ dk_ef00
EEE6 EX AF,AF'
define_keys_1 EEE7 LD D,A D = A
EEE8 AND $07 A &= 7
EEEA JR Z,dk_ef00 Jump to dk_ef00 if zero
EEEC LD B,A B = A the 'note'
EEED LD A,D A = D
EEEE SRL A A >>= 3
EEF0 SRL A
EEF2 SRL A
EEF4 DEC B B--
EEF5 JP Z,playdrum_2 Jump to playdrum_2 if zero
EEF8 DEC B B--
EEF9 JP Z,playdrum_1 Jump to playdrum_1 if zero
EEFC DEC B B--
EEFD JP Z,noise Jump to noise if zero
dk_ef00 EF00 LD A,$00 Self modified by EEE3, EF09
EF02 AND A Set flags
EF03 JR Z,dk_ef0d Jump to dk_ef0d if zero
EF05 LD HL,$EEAE Self modify 'LD A' @ define_keys_0
EF08 DEC (HL) (*HL)--
EF09 LD HL,$EF01 Self modify 'LD A' @ dk_ef00
EF0C DEC (HL) (*HL)--
dk_ef0d EF0D LD A,$00 Self modified by EF33
EF0F DEC A A--
EF10 JP Z,playdrum_2_0 Jump to playdrum_go if zero
This entry point is used by the routines at playdrum_2 and noise.
dk_wait EF13 LD A,$00 Wait/spinlock. Self modified
EF15 AND A
EF16 JR Z,dk_wait
EF18 RET Return
Prev: EE6E Up: Map Next: EF19