Prev: EF19 Up: Map Next: F0C6
EF22: Drum sample player
Used by the routine at define_keys.
Input
B Speed value?
playdrum_2 EF22 LD HL,$F05A Address of drum 2 data
EF25 LD D,$6C Sample bytes remaining = 108
EF27 JR playdrum_start Jump to playdrum_start
This entry point is used by the routine at define_keys.
playdrum_1 EF29 LD HL,$EF5E Address of drum 1 data
EF2C LD D,$FC Sample bytes remaining = 252
playdrum_start EF2E LD ($EF3A),A Self modify 'LD B' @ playdrum_go to be A -- speed value passed in?
EF31 LD A,$01 Self modify 'LD A' @ dk_ef0d to be 1 -- set to 1 while playing?
EF33 LD ($EF0E),A
EF36 JR playdrum_go Jump to playdrum_go
This entry point is used by the routine at define_keys.
playdrum_2_0 EF38 EXX
playdrum_go EF39 LD B,$08 Self modified by playdrum_start (sampled: 8, 3, 1)
playdrum_loop EF3B LD A,$10 Output flag
EF3D NOP Delay?
EF3E BIT 7,(HL) Test a bit
EF40 JR NZ,playdrum_2_1 Don't reset output if sample bit set
EF42 RES 4,A Reset flag if bit was zero
playdrum_2_1 EF44 OUT ($FE),A Output it
EF46 RLC (HL) Rotate sample byte in-place
EF48 DJNZ playdrum_loop Loop to playdrum_loop while B
EF4A INC HL Move to next sample byte
EF4B DEC D Decrement sample bytes remaining
EF4C JR Z,playdrum_end_of_sample Jump to playdrum_end_of_sample if no bytes remain
EF4E LD A,($EF14) Read A from 'LD A' @ dk_wait -- wait/spinlock
EF51 AND A Set flags
EF52 JP Z,playdrum_go Jump to playdrum_go if zero
EF55 EXX
EF56 RET Return
playdrum_end_of_sample EF57 XOR A Self modify 'LD A' @ dk_ef0d to be 0 -- set to 0 when playing stops?
EF58 LD ($EF0E),A
EF5B JP dk_wait Jump to dk_playdrum_finished
drum1 EF5E DEFB $FF,$00,$00,$00,$0F,$FF,$FF,$FF Drum 1 sample/data
EF66 DEFB $EF,$FF,$FF,$FF,$BE,$36,$10,$00
EF6E DEFB $00,$00,$00,$00,$00,$00,$00,$00
EF76 DEFB $00,$FF,$FF,$FF,$FF,$FF,$FF,$FF
EF7E DEFB $FF,$FF,$FF,$FF,$FF,$F8,$78,$80
EF86 DEFB $00,$00,$00,$00,$00,$00,$00,$00
EF8E DEFB $00,$C0,$E1,$FF,$FF,$FF,$FF,$FF
EF96 DEFB $FF,$FF,$FF,$FF,$FF,$BE,$F3,$9E
EF9E DEFB $70,$C0,$00,$00,$00,$00,$00,$00
EFA6 DEFB $01,$9E,$FF,$3F,$FF,$FF,$FF,$FF
EFAE DEFB $FF,$FF,$FF,$FF,$FF,$FB,$FF,$3F
EFB6 DEFB $38,$F0,$03,$80,$00,$00,$00,$00
EFBE DEFB $00,$00,$C6,$DB,$9D,$FF,$FF,$FF
EFC6 DEFB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
EFCE DEFB $FF,$FE,$07,$70,$60,$00,$00,$00
EFD6 DEFB $01,$00,$00,$08,$80,$77,$DF,$FF
EFDE DEFB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
EFE6 DEFB $FE,$FF,$F8,$A3,$CE,$1C,$64,$02
EFEE DEFB $20,$00,$0E,$00,$00,$3F,$18,$8F
EFF6 DEFB $9F,$FF,$FF,$DF,$FF,$FF,$FF,$FF
EFFE DEFB $FF,$EF,$FF,$FF,$EF,$FF,$3F,$FC
F006 DEFB $9C,$38,$CE,$00,$03,$00,$00,$00
F00E DEFB $C4,$7F,$01,$FF,$FF,$FF,$FF,$FF
F016 DEFB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
F01E DEFB $3E,$40,$98,$10,$C0,$1F,$80,$00
F026 DEFB $FF,$00,$1F,$FF,$7F,$FF,$FF,$FF
F02E DEFB $FF,$FF,$FF,$FF,$FF,$FF,$B8,$77
F036 DEFB $7E,$FC,$FE,$7F,$E7,$6F,$DE,$FF
F03E DEFB $FE,$07,$F9,$FF,$3B,$3F,$3F,$FE
F046 DEFB $DF,$FF,$FF,$EF,$FF,$FF,$FF,$FF
F04E DEFB $FF,$FF,$03,$FE,$FF,$33,$A7,$FF
F056 DEFB $9F,$FF,$EF,$00
drum2 F05A DEFB $FF,$FF,$FF,$FF,$FF,$F3,$F8,$30 Drum 2 sample/data
F062 DEFB $FF,$DE,$00,$FF,$81,$FF,$FF,$FF
F06A DEFB $FF,$FF,$FF,$FF,$FF,$F4,$3B,$80
F072 DEFB $00,$00,$00,$00,$00,$3C,$00,$00
F07A DEFB $00,$00,$1B,$FF,$FF,$FF,$FF,$FF
F082 DEFB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
F08A DEFB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
F092 DEFB $FF,$FF,$E0,$00,$00,$00,$00,$00
F09A DEFB $00,$00,$00,$00,$00,$00,$00,$00
F0A2 DEFB $00,$00,$00,$00,$7F,$FF,$FF,$FF
F0AA DEFB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
F0B2 DEFB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
F0BA DEFB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
F0C2 DEFB $FF,$FD,$7E,$00
Prev: EF19 Up: Map Next: F0C6