2019-09-02 01:40:58 -07:00
|
|
|
channel_count: MACRO
|
2019-09-03 20:36:32 -07:00
|
|
|
_num_channels = \1 - 1
|
2019-09-02 01:40:58 -07:00
|
|
|
ENDM
|
|
|
|
|
|
|
|
channel: MACRO
|
2019-09-03 20:36:32 -07:00
|
|
|
dn (_num_channels << 2), \1 - 1 ; channel id
|
2019-09-02 01:40:58 -07:00
|
|
|
dw \2 ; address
|
2019-09-03 20:36:32 -07:00
|
|
|
_num_channels = 0
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2017-12-26 09:50:32 -08:00
|
|
|
|
2015-01-20 14:26:16 -08:00
|
|
|
note: MACRO
|
2019-09-02 01:40:58 -07:00
|
|
|
dn (\1), (\2) - 1 ; pitch, length
|
|
|
|
ENDM
|
|
|
|
|
2019-09-03 20:36:32 -07:00
|
|
|
drum_note: MACRO
|
2019-09-02 01:40:58 -07:00
|
|
|
note \1, \2 ; drum instrument, length
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
rest: MACRO
|
|
|
|
note 0, \1 ; length
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 14:26:16 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
square_note: MACRO
|
|
|
|
db \1 ; length
|
|
|
|
IF \3 < 0
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \2, %1000 | (\3 * -1) ; volume envelope
|
2019-09-02 01:40:58 -07:00
|
|
|
ELSE
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \2, \3 ; volume envelope
|
2019-09-02 01:40:58 -07:00
|
|
|
ENDC
|
2015-12-07 08:28:58 -08:00
|
|
|
dw \4 ; frequency
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 14:26:16 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
noise_note: MACRO
|
|
|
|
db \1 ; length
|
|
|
|
IF \3 < 0
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \2, %1000 | (\3 * -1) ; volume envelope
|
2019-09-02 01:40:58 -07:00
|
|
|
ELSE
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \2, \3 ; volume envelope
|
2019-09-02 01:40:58 -07:00
|
|
|
ENDC
|
2015-12-07 08:28:58 -08:00
|
|
|
db \4 ; frequency
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-12-07 08:28:58 -08:00
|
|
|
|
2017-12-12 10:22:19 -08:00
|
|
|
; MusicCommands indexes (see audio/engine.asm)
|
2020-03-21 10:07:18 -07:00
|
|
|
enum_start $d0, 8
|
2018-12-09 14:56:13 -08:00
|
|
|
FIRST_MUSIC_CMD EQU __enum__
|
2017-12-12 10:22:19 -08:00
|
|
|
|
2018-12-09 14:56:13 -08:00
|
|
|
enum octave_cmd ; $d0
|
2017-12-28 04:23:44 -08:00
|
|
|
octave: MACRO
|
2019-09-02 01:40:58 -07:00
|
|
|
db octave_cmd | 8 - (\1) ; octave
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2020-03-21 10:07:18 -07:00
|
|
|
__enumdir__ = 1
|
2018-12-09 14:56:13 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum note_type_cmd ; $d8
|
|
|
|
note_type: MACRO
|
|
|
|
db note_type_cmd
|
|
|
|
db \1 ; note length
|
|
|
|
IF _NARG >= 2
|
|
|
|
IF \3 < 0
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \2, %1000 | (\3 * -1) ; volume envelope
|
2019-09-02 01:40:58 -07:00
|
|
|
ELSE
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \2, \3 ; volume envelope
|
2019-09-02 01:40:58 -07:00
|
|
|
ENDC
|
|
|
|
ENDC
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
; only valid on the noise channel
|
2019-09-03 20:36:32 -07:00
|
|
|
drum_speed: MACRO
|
2019-09-02 01:40:58 -07:00
|
|
|
note_type \1 ; note length
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
enum transpose_cmd ; $d9
|
|
|
|
transpose: MACRO
|
|
|
|
db transpose_cmd
|
|
|
|
dn \1, \2 ; num octaves, num pitches
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum tempo_cmd ; $da
|
2017-12-28 04:23:44 -08:00
|
|
|
tempo: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db tempo_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
bigdw \1 ; tempo
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum duty_cycle_cmd ; $db
|
|
|
|
duty_cycle: MACRO
|
|
|
|
db duty_cycle_cmd
|
|
|
|
db \1 ; duty cycle
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
enum volume_envelope_cmd ; $dc
|
|
|
|
volume_envelope: MACRO
|
|
|
|
db volume_envelope_cmd
|
|
|
|
IF \2 < 0
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \1, %1000 | (\2 * -1) ; volume envelope
|
2019-09-02 01:40:58 -07:00
|
|
|
ELSE
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \1, \2 ; volume envelope
|
2019-09-02 01:40:58 -07:00
|
|
|
ENDC
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum pitch_sweep_cmd ; $dd
|
|
|
|
pitch_sweep: MACRO
|
|
|
|
db pitch_sweep_cmd
|
|
|
|
IF \2 < 0
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \1, %1000 | (\2 * -1) ; pitch sweep
|
2019-09-02 01:40:58 -07:00
|
|
|
ELSE
|
2019-09-03 20:55:51 -07:00
|
|
|
dn \1, \2 ; pitch sweep
|
2019-09-02 01:40:58 -07:00
|
|
|
ENDC
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum duty_cycle_pattern_cmd ; $de
|
|
|
|
duty_cycle_pattern: MACRO
|
|
|
|
db duty_cycle_pattern_cmd
|
|
|
|
db (\1 << 6) | (\2 << 4) | (\3 << 2) | (\4 << 0) ; duty cycle pattern
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum toggle_sfx_cmd ; $df
|
|
|
|
toggle_sfx: MACRO
|
|
|
|
db toggle_sfx_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum pitch_slide_cmd ; $e0
|
|
|
|
pitch_slide: MACRO
|
|
|
|
db pitch_slide_cmd
|
2016-07-29 07:40:54 -07:00
|
|
|
db \1 - 1 ; duration
|
2019-09-02 01:40:58 -07:00
|
|
|
dn 8 - \2, \3 % 12 ; octave, pitch
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum vibrato_cmd ; $e1
|
2017-12-28 04:23:44 -08:00
|
|
|
vibrato: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db vibrato_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
db \1 ; delay
|
2019-09-03 22:17:10 -07:00
|
|
|
IF _NARG > 2
|
|
|
|
dn \2, \3 ; extent, rate
|
|
|
|
ELSE
|
|
|
|
db \2 ; LEGACY: Support for 1-arg extent
|
|
|
|
ENDC
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum unknownmusic0xe2_cmd ; $e2
|
2017-12-28 04:23:44 -08:00
|
|
|
unknownmusic0xe2: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db unknownmusic0xe2_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
db \1 ; unknown
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum toggle_noise_cmd ; $e3
|
|
|
|
toggle_noise: MACRO
|
|
|
|
db toggle_noise_cmd
|
2020-01-05 13:41:55 -08:00
|
|
|
IF _NARG > 0
|
|
|
|
db \1 ; drum kit
|
|
|
|
ENDC
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum force_stereo_panning_cmd ; $e4
|
|
|
|
force_stereo_panning: MACRO
|
|
|
|
db force_stereo_panning_cmd
|
2019-09-08 10:09:43 -07:00
|
|
|
dn %1111 * (1 && \1), %1111 * (1 && \2) ; left enable, right enable
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum volume_cmd ; $e5
|
2017-12-28 04:23:44 -08:00
|
|
|
volume: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db volume_cmd
|
2019-09-03 22:17:10 -07:00
|
|
|
IF _NARG > 1
|
|
|
|
dn \1, \2 ; left volume, right volume
|
|
|
|
ELSE
|
|
|
|
db \1 ; LEGACY: Support for 1-arg volume
|
|
|
|
ENDC
|
2019-09-02 01:40:58 -07:00
|
|
|
ENDM
|
|
|
|
|
|
|
|
enum pitch_offset_cmd ; $e6
|
|
|
|
pitch_offset: MACRO
|
|
|
|
db pitch_offset_cmd
|
|
|
|
bigdw \1 ; pitch offset
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum unknownmusic0xe7_cmd ; $e7
|
2017-12-28 04:23:44 -08:00
|
|
|
unknownmusic0xe7: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db unknownmusic0xe7_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
db \1 ; unknown
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum unknownmusic0xe8_cmd ; $e8
|
2017-12-28 04:23:44 -08:00
|
|
|
unknownmusic0xe8: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db unknownmusic0xe8_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
db \1 ; unknown
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum tempo_relative_cmd ; $e9
|
2017-12-28 04:23:44 -08:00
|
|
|
tempo_relative: MACRO
|
2015-12-08 13:06:13 -08:00
|
|
|
db tempo_relative_cmd
|
2019-09-02 01:40:58 -07:00
|
|
|
bigdw \1 ; tempo adjustment
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum restart_channel_cmd ; $ea
|
|
|
|
restart_channel: MACRO
|
|
|
|
db restart_channel_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
dw \1 ; address
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum new_song_cmd ; $eb
|
|
|
|
new_song: MACRO
|
|
|
|
db new_song_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
bigdw \1 ; id
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum sfx_priority_on_cmd ; $ec
|
|
|
|
sfx_priority_on: MACRO
|
|
|
|
db sfx_priority_on_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum sfx_priority_off_cmd ; $ed
|
|
|
|
sfx_priority_off: MACRO
|
|
|
|
db sfx_priority_off_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum unknownmusic0xee_cmd ; $ee
|
2017-12-28 04:23:44 -08:00
|
|
|
unknownmusic0xee: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db unknownmusic0xee_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
dw \1 ; address
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum stereo_panning_cmd ; $ef
|
|
|
|
stereo_panning: MACRO
|
|
|
|
db stereo_panning_cmd
|
2019-09-08 10:09:43 -07:00
|
|
|
dn %1111 * (1 && \1), %1111 * (1 && \2) ; left enable, right enable
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum sfx_toggle_noise_cmd ; $f0
|
|
|
|
sfx_toggle_noise: MACRO
|
|
|
|
db sfx_toggle_noise_cmd
|
2020-01-05 13:41:55 -08:00
|
|
|
IF _NARG > 0
|
|
|
|
db \1 ; drum kit
|
|
|
|
ENDC
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum music0xf1_cmd ; $f1
|
2017-12-28 04:23:44 -08:00
|
|
|
music0xf1: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db music0xf1_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum music0xf2_cmd ; $f2
|
2017-12-28 04:23:44 -08:00
|
|
|
music0xf2: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db music0xf2_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum music0xf3_cmd ; $f3
|
2017-12-28 04:23:44 -08:00
|
|
|
music0xf3: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db music0xf3_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum music0xf4_cmd ; $f4
|
2017-12-28 04:23:44 -08:00
|
|
|
music0xf4: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db music0xf4_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum music0xf5_cmd ; $f5
|
2017-12-28 04:23:44 -08:00
|
|
|
music0xf5: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db music0xf5_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum music0xf6_cmd ; $f6
|
2017-12-28 04:23:44 -08:00
|
|
|
music0xf6: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db music0xf6_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum music0xf7_cmd ; $f7
|
2017-12-28 04:23:44 -08:00
|
|
|
music0xf7: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db music0xf7_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum music0xf8_cmd ; $f8
|
2017-12-28 04:23:44 -08:00
|
|
|
music0xf8: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db music0xf8_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2017-12-14 21:38:52 -08:00
|
|
|
enum unknownmusic0xf9_cmd ; $f9
|
2017-12-28 04:23:44 -08:00
|
|
|
unknownmusic0xf9: MACRO
|
2015-12-06 19:36:09 -08:00
|
|
|
db unknownmusic0xf9_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum set_condition_cmd ; $fa
|
|
|
|
set_condition: MACRO
|
|
|
|
db set_condition_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
db \1 ; condition
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum sound_jump_if_cmd ; $fb
|
|
|
|
sound_jump_if: MACRO
|
|
|
|
db sound_jump_if_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
db \1 ; condition
|
|
|
|
dw \2 ; address
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum sound_jump_cmd ; $fc
|
|
|
|
sound_jump: MACRO
|
|
|
|
db sound_jump_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
dw \1 ; address
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum sound_loop_cmd ; $fd
|
|
|
|
sound_loop: MACRO
|
|
|
|
db sound_loop_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
db \1 ; count
|
|
|
|
dw \2 ; address
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum sound_call_cmd ; $fe
|
|
|
|
sound_call: MACRO
|
|
|
|
db sound_call_cmd
|
2015-01-20 00:01:23 -08:00
|
|
|
dw \1 ; address
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|
2015-01-20 00:01:23 -08:00
|
|
|
|
2019-09-02 01:40:58 -07:00
|
|
|
enum sound_ret_cmd ; $ff
|
|
|
|
sound_ret: MACRO
|
|
|
|
db sound_ret_cmd
|
2017-12-28 13:31:16 -08:00
|
|
|
ENDM
|