pokecrystal/macros/scripts/audio.asm

266 lines
3.9 KiB
NASM
Raw Normal View History

musicheader: MACRO
; number of tracks, track idx, address
dbw ((\1 - 1) << 6) + (\2 - 1), \3
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 22:26:16 +00:00
note: MACRO
dn (\1), (\2) - 1
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 22:26:16 +00:00
sound: MACRO
2015-12-07 16:28:58 +00:00
note \1, \2
db \3 ; intensity
dw \4 ; frequency
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 22:26:16 +00:00
noise: MACRO
2015-12-07 16:28:58 +00:00
note \1, \2 ; duration
db \3 ; intensity
db \4 ; frequency
2017-12-28 21:31:16 +00:00
ENDM
2015-12-07 16:28:58 +00:00
; MusicCommands indexes (see audio/engine.asm)
2015-12-07 03:36:09 +00:00
enum_start $d8
2017-12-15 05:38:52 +00:00
enum notetype_cmd ; $d8
octave: MACRO
2015-12-07 03:36:09 +00:00
db notetype_cmd - (\1)
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
notetype: MACRO
2015-12-07 03:36:09 +00:00
db notetype_cmd
2015-01-20 08:01:23 +00:00
db \1 ; note_length
if _NARG >= 2
db \2 ; intensity
endc
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum pitchoffset_cmd ; $d9
pitchoffset: MACRO
db pitchoffset_cmd
dn \1, \2 - 1 ; octave, key
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum tempo_cmd ; $da
tempo: MACRO
2015-12-07 03:36:09 +00:00
db tempo_cmd
2015-01-20 08:01:23 +00:00
bigdw \1 ; tempo
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum dutycycle_cmd ; $db
dutycycle: MACRO
2015-12-07 03:36:09 +00:00
db dutycycle_cmd
2015-01-20 08:01:23 +00:00
db \1 ; duty_cycle
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum intensity_cmd ; $dc
intensity: MACRO
2015-12-07 03:36:09 +00:00
db intensity_cmd
2015-01-20 08:01:23 +00:00
db \1 ; intensity
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum soundinput_cmd ; $dd
soundinput: MACRO
2015-12-07 03:36:09 +00:00
db soundinput_cmd
2015-01-20 08:01:23 +00:00
db \1 ; input
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum sound_duty_cmd ; $de
sound_duty: MACRO
2016-05-10 20:38:40 +00:00
db sound_duty_cmd
if _NARG == 4
2016-05-10 20:46:46 +00:00
db \1 | (\2 << 2) | (\3 << 4) | (\4 << 6) ; duty sequence
else
2018-11-10 23:44:07 +00:00
db \1 ; LEGACY: Support for one-byte duty value
endc
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum togglesfx_cmd ; $df
togglesfx: MACRO
2015-12-07 03:36:09 +00:00
db togglesfx_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum slidepitchto_cmd ; $e0
slidepitchto: MACRO
2016-05-10 18:33:24 +00:00
db slidepitchto_cmd
db \1 - 1 ; duration
2015-12-07 03:36:09 +00:00
dn \2, \3 ; octave, pitch
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum vibrato_cmd ; $e1
vibrato: MACRO
2015-12-07 03:36:09 +00:00
db vibrato_cmd
2015-01-20 08:01:23 +00:00
db \1 ; delay
db \2 ; extent
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum unknownmusic0xe2_cmd ; $e2
unknownmusic0xe2: MACRO
2015-12-07 03:36:09 +00:00
db unknownmusic0xe2_cmd
2015-01-20 08:01:23 +00:00
db \1 ; unknown
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum togglenoise_cmd ; $e3
togglenoise: MACRO
2015-12-07 03:36:09 +00:00
db togglenoise_cmd
2015-01-20 08:01:23 +00:00
db \1 ; id
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum panning_cmd ; $e4
panning: MACRO
2015-12-07 03:36:09 +00:00
db panning_cmd
2015-01-20 08:01:23 +00:00
db \1 ; tracks
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum volume_cmd ; $e5
volume: MACRO
2015-12-07 03:36:09 +00:00
db volume_cmd
2015-01-20 08:01:23 +00:00
db \1 ; volume
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum tone_cmd ; $e6
tone: MACRO
2015-12-07 03:36:09 +00:00
db tone_cmd
2015-01-20 08:01:23 +00:00
bigdw \1 ; tone
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum unknownmusic0xe7_cmd ; $e7
unknownmusic0xe7: MACRO
2015-12-07 03:36:09 +00:00
db unknownmusic0xe7_cmd
2015-01-20 08:01:23 +00:00
db \1 ; unknown
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum unknownmusic0xe8_cmd ; $e8
unknownmusic0xe8: MACRO
2015-12-07 03:36:09 +00:00
db unknownmusic0xe8_cmd
2015-01-20 08:01:23 +00:00
db \1 ; unknown
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum tempo_relative_cmd ; $e9
tempo_relative: MACRO
2015-12-08 21:06:13 +00:00
db tempo_relative_cmd
2015-01-20 08:01:23 +00:00
bigdw \1 ; value
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum restartchannel_cmd ; $ea
restartchannel: MACRO
2015-12-07 03:36:09 +00:00
db restartchannel_cmd
2015-01-20 08:01:23 +00:00
dw \1 ; address
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum newsong_cmd ; $eb
newsong: MACRO
2015-12-07 03:36:09 +00:00
db newsong_cmd
2015-01-20 08:01:23 +00:00
bigdw \1 ; id
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum sfxpriorityon_cmd ; $ec
sfxpriorityon: MACRO
2015-12-07 03:36:09 +00:00
db sfxpriorityon_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum sfxpriorityoff_cmd ; $ed
sfxpriorityoff: MACRO
2015-12-07 03:36:09 +00:00
db sfxpriorityoff_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum unknownmusic0xee_cmd ; $ee
unknownmusic0xee: MACRO
2015-12-07 03:36:09 +00:00
db unknownmusic0xee_cmd
2015-01-20 08:01:23 +00:00
dw \1 ; address
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum stereopanning_cmd ; $ef
stereopanning: MACRO
2015-12-07 03:36:09 +00:00
db stereopanning_cmd
2015-01-20 08:01:23 +00:00
db \1 ; tracks
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum sfxtogglenoise_cmd ; $f0
sfxtogglenoise: MACRO
2015-12-07 03:36:09 +00:00
db sfxtogglenoise_cmd
2015-01-20 08:01:23 +00:00
db \1 ; id
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum music0xf1_cmd ; $f1
music0xf1: MACRO
2015-12-07 03:36:09 +00:00
db music0xf1_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum music0xf2_cmd ; $f2
music0xf2: MACRO
2015-12-07 03:36:09 +00:00
db music0xf2_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum music0xf3_cmd ; $f3
music0xf3: MACRO
2015-12-07 03:36:09 +00:00
db music0xf3_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum music0xf4_cmd ; $f4
music0xf4: MACRO
2015-12-07 03:36:09 +00:00
db music0xf4_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum music0xf5_cmd ; $f5
music0xf5: MACRO
2015-12-07 03:36:09 +00:00
db music0xf5_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum music0xf6_cmd ; $f6
music0xf6: MACRO
2015-12-07 03:36:09 +00:00
db music0xf6_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum music0xf7_cmd ; $f7
music0xf7: MACRO
2015-12-07 03:36:09 +00:00
db music0xf7_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum music0xf8_cmd ; $f8
music0xf8: MACRO
2015-12-07 03:36:09 +00:00
db music0xf8_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum unknownmusic0xf9_cmd ; $f9
unknownmusic0xf9: MACRO
2015-12-07 03:36:09 +00:00
db unknownmusic0xf9_cmd
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum setcondition_cmd ; $fa
setcondition: MACRO
2015-12-07 03:36:09 +00:00
db setcondition_cmd
2015-01-20 08:01:23 +00:00
db \1 ; condition
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum jumpif_cmd ; $fb
jumpif: MACRO
2015-12-07 03:36:09 +00:00
db jumpif_cmd
2015-01-20 08:01:23 +00:00
db \1 ; condition
dw \2 ; address
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum jumpchannel_cmd ; $fc
jumpchannel: MACRO
2015-12-07 03:36:09 +00:00
db jumpchannel_cmd
2015-01-20 08:01:23 +00:00
dw \1 ; address
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum loopchannel_cmd ; $fd
loopchannel: MACRO
2015-12-07 03:36:09 +00:00
db loopchannel_cmd
2015-01-20 08:01:23 +00:00
db \1 ; count
dw \2 ; address
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum callchannel_cmd ; $fe
callchannel: MACRO
2015-12-07 03:36:09 +00:00
db callchannel_cmd
2015-01-20 08:01:23 +00:00
dw \1 ; address
2017-12-28 21:31:16 +00:00
ENDM
2015-01-20 08:01:23 +00:00
2017-12-15 05:38:52 +00:00
enum endchannel_cmd ; $ff
endchannel: MACRO
2015-12-07 03:36:09 +00:00
db endchannel_cmd
2017-12-28 21:31:16 +00:00
ENDM