;**************************************************************************** ; Channel ID constants ;**************************************************************************** ESF_FM1 equ $00 ; FM channel #1 ESF_FM2 equ $01 ; FM channel #2 ESF_FM3 equ $02 ; FM channel #3 ESF_FM4 equ $04 ; FM channel #4 ESF_FM5 equ $05 ; FM channel #5 ESF_FM6 equ $06 ; FM channel #6 ESF_PSG1 equ $08 ; PSG square channel #1 ESF_PSG2 equ $09 ; PSG square channel #2 ESF_PSG3 equ $0A ; PSG square channel #3 ESF_PSG4 equ $0B ; PSG noise channel ESF_PCM equ $0C ; PCM channel ;**************************************************************************** ; ESF_NoteOn ; Start playing a note. ;---------------------------------------------------------------------------- ; For FM channels: ; ESF_NoteOn channel, octave, semitone ; For square PSG channels: ; ESF_NoteOn channel, octave, semitone ; For noise PSG channel: ; ESF_NoteOn channel, type ; For PCM channel: ; ESF_NoteOn channel, instrument ;---------------------------------------------------------------------------- ; param channel ...... channel to play on ; param octave ....... octave (0 to 7 for FM, 0 to 5 for PSG) ; param semitone ..... semitone (0 to 11) ; param type ......... noise type ($00 to $07) ; param instrument ... drum instrument ID ($00 to $FF) ;**************************************************************************** ESF_NoteOn macro dc.b $00+(\1) if (\1)>8) dc.b (\3)&$FF elseif (\1)>6 else dc.b (\2) endc endm ;**************************************************************************** ; ESF_SetInstr ; Set the instrument of a channel. ;---------------------------------------------------------------------------- ; Format: ; ESF_SetInstr channel, instrument ;---------------------------------------------------------------------------- ; param channel ...... Channel to lock ; param instrument ... Instrument ID ($00 to $FF) ;**************************************************************************** ESF_SetInstr macro dc.b $40+(\1) dc.b (\2) endm ;**************************************************************************** ; ESF_Lock ; Lock SFX channel. ;---------------------------------------------------------------------------- ; Format: ; ESF_Lock channel ;---------------------------------------------------------------------------- ; param channel ... Channel to lock ;**************************************************************************** ESF_Lock macro dc.b $E0 dc.b (\1) endm ;**************************************************************************** ; ESF_Delay ; Stop event. ;---------------------------------------------------------------------------- ; Format: ; ESF_Delay ticks ;---------------------------------------------------------------------------- ; param ticks ... Ticks to wait (60 = 1 second) ;**************************************************************************** ESF_Delay macro dc.b $FE dc.b (\1) endm ;**************************************************************************** ; ESF_Stop ; Stop event. ;**************************************************************************** ESF_Stop macro dc.b $FF endm