
Chapter 6
;----------------------------------------------------------
; Melody INT subroutine
;----------------------------------------------------------
MELODY_INT:
MOV A, 0x04
; save RAM select register
MOV 0x15, A
MOV A, beat_counter
JBS 0x03, 2
; check beat counter = 0 or not
JMP ENVELOPE
; not equal 0, go to do envelope
READ_NEW_DATA:
MOV A, @0x2
; read next note data
MOV 0x9, A
IOR
0x9
MOV buffer, A
; save in buffer
………
; processing the note data…
………
; extract waveform address
………
; (store wave 2, 1, 0),
………
; beat counter value
………
; (store in beat-counter),
………
; note pitch value (store in freq1, 2)
PLAY-TONE:
MOV A, @0x04
; select melody channel 1 control
MOV 0x09, A
MOV A, @127
; write initial envelope (127)
IOW
0xA
MOV A, wave0
; write waveform address: wave2, 1, 0
IOW
0x6
MOV A, wave1
IOW
0x7
MOV A, wave2
IOW
0x8
MOV A, freq1
; write frequency value for pitch
IOW
0xB
MOV A, freq2
IOW
0xC
BS 0x0A, 0
; enable tone generator
ENVELOPE:
………
; calculate envelope value
………
………
MOV A, envelope
; write envelope value
IOW
0xA
DEC beat_counter; decrease beat-counter
JMP MTC_RET
; return
98
•
Software Application
EM60000Series User’s Manual
Содержание EM60000 series
Страница 8: ...Contents viii Contents EM60000 Series User s Manual ...
Страница 24: ...Chapter 2 16 Architecture EM60000 Series User s Manual ...
Страница 54: ...Chapter 4 46 Special Function Control EM60000Series User s Manual ...
Страница 80: ...Chapter 5 72 Instruction Set EM60000Series User s Manual ...