summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
Diffstat (limited to 'asm')
-rw-r--r--asm/macros/battle_frontier/battle_tower.inc6
-rw-r--r--asm/macros/event.inc7
-rw-r--r--asm/macros/music_voice.inc91
3 files changed, 69 insertions, 35 deletions
diff --git a/asm/macros/battle_frontier/battle_tower.inc b/asm/macros/battle_frontier/battle_tower.inc
index 71e795b1d..ccc777c50 100644
--- a/asm/macros/battle_frontier/battle_tower.inc
+++ b/asm/macros/battle_frontier/battle_tower.inc
@@ -72,9 +72,9 @@
special CallBattleTowerFunc
.endm
- @ Unknown. Destroys some link task if using wireless link. Wait for link?
- .macro tower_unklink
- setvar VAR_0x8004, BATTLE_TOWER_FUNC_13
+ @ Attempts to close link connection. Used when finishing a link multi challenge.
+ .macro tower_closelink
+ setvar VAR_0x8004, BATTLE_TOWER_FUNC_TRY_CLOSE_LINK
special CallBattleTowerFunc
.endm
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index 5e5a2758d..eafd19b1c 100644
--- a/asm/macros/event.inc
+++ b/asm/macros/event.inc
@@ -1434,6 +1434,7 @@
@ Sets the color of the text in standard message boxes. 0x00 produces blue (male) text, 0x01 produces red (female) text,
@ 0xFF resets the color to the default for the current OW's gender, and all other values produce black text.
+ @ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro textcolor color:req
.byte 0xc7
.byte \color
@@ -1441,6 +1442,7 @@
@ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom
@ of the screen when the Main Menu is opened.
+ @ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro loadhelp pointer:req
.byte 0xc8
.4byte \pointer
@@ -1448,21 +1450,25 @@
@ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom of
@ the screen when the Main Menu is opened.
+ @ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro unloadhelp
.byte 0xc9
.endm
@ After using this command, all standard message boxes will use the signpost frame.
+ @ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro signmsg
.byte 0xca
.endm
@ Ends the effects of signmsg, returning message box frames to normal.
+ @ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro normalmsg
.byte 0xcb
.endm
@ Compares the value of a hidden variable to a dword.
+ @ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro comparehiddenvar a:req, value:req
.byte 0xcc
.byte \a
@@ -1489,6 +1495,7 @@
.endm
@ Sets worldmapflag to 1. This allows the player to Fly to the corresponding map, if that map has a flightspot.
+ @ Used only in FireRed/LeafGreen, does nothing in Emerald.
.macro setworldmapflag worldmapflag:req
.byte 0xd0
.2byte \worldmapflag
diff --git a/asm/macros/music_voice.inc b/asm/macros/music_voice.inc
index b7a9e7f8d..64dd38214 100644
--- a/asm/macros/music_voice.inc
+++ b/asm/macros/music_voice.inc
@@ -1,19 +1,19 @@
- .macro voice_directsound base_midi_key, pan, sample_data_pointer, attack, decay, sustain, release
+ .macro voice_directsound base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req
.byte 0
_voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
.endm
- .macro voice_directsound_no_resample base_midi_key, pan, sample_data_pointer, attack, decay, sustain, release
+ .macro voice_directsound_no_resample base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req
.byte 8
_voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
.endm
- .macro voice_directsound_alt base_midi_key, pan, sample_data_pointer, attack, decay, sustain, release
+ .macro voice_directsound_alt base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req
.byte 16
_voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
.endm
- .macro _voice_directsound base_midi_key, pan, sample_data_pointer, attack, decay, sustain, release
+ .macro _voice_directsound base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req
.byte \base_midi_key
.byte 0
.if \pan != 0
@@ -28,16 +28,22 @@
.byte \release
.endm
- .macro voice_square_1 sweep, duty_cycle, attack, decay, sustain, release
- _voice_square_1 1, \sweep, \duty_cycle, \attack, \decay, \sustain, \release
+ .macro voice_square_1 base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
+ _voice_square_1 1, \base_midi_key, \pan, \sweep, \duty_cycle, \attack, \decay, \sustain, \release
.endm
- .macro voice_square_1_alt sweep, duty_cycle, attack, decay, sustain, release
- _voice_square_1 9, \sweep, \duty_cycle, \attack, \decay, \sustain, \release
+ .macro voice_square_1_alt base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
+ _voice_square_1 9, \base_midi_key, \pan, \sweep, \duty_cycle, \attack, \decay, \sustain, \release
.endm
- .macro _voice_square_1 type, sweep, duty_cycle, attack, decay, sustain, release
- .byte \type, 60, 0
+ .macro _voice_square_1 type:req, base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
+ .byte \type
+ .byte \base_midi_key
+ .if \pan != 0
+ .byte (0x80 | \pan)
+ .else
+ .byte 0
+ .endif
.byte \sweep
.byte (\duty_cycle & 0x3)
.byte 0, 0, 0
@@ -47,16 +53,23 @@
.byte (\release & 0x7)
.endm
- .macro voice_square_2 duty_cycle, attack, decay, sustain, release
- _voice_square_2 2, \duty_cycle, \attack, \decay, \sustain, \release
+ .macro voice_square_2 base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
+ _voice_square_2 2, \base_midi_key, \pan, \duty_cycle, \attack, \decay, \sustain, \release
.endm
- .macro voice_square_2_alt duty_cycle, attack, decay, sustain, release
- _voice_square_2 10, \duty_cycle, \attack, \decay, \sustain, \release
+ .macro voice_square_2_alt base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
+ _voice_square_2 10, \base_midi_key, \pan, \duty_cycle, \attack, \decay, \sustain, \release
.endm
- .macro _voice_square_2 type, duty_cycle, attack, decay, sustain, release
- .byte \type, 60, 0, 0
+ .macro _voice_square_2 type:req, base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
+ .byte \type
+ .byte \base_midi_key
+ .if \pan != 0
+ .byte (0x80 | \pan)
+ .else
+ .byte 0
+ .endif
+ .byte 0
.byte (\duty_cycle & 0x3)
.byte 0, 0, 0
.byte (\attack & 0x7)
@@ -65,16 +78,23 @@
.byte (\release & 0x7)
.endm
- .macro voice_programmable_wave wave_samples_pointer, attack, decay, sustain, release
- _voice_programmable_wave 3, \wave_samples_pointer, \attack, \decay, \sustain, \release
+ .macro voice_programmable_wave base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req
+ _voice_programmable_wave 3, \base_midi_key, \pan, \wave_samples_pointer, \attack, \decay, \sustain, \release
.endm
- .macro voice_programmable_wave_alt wave_samples_pointer, attack, decay, sustain, release
- _voice_programmable_wave 11, \wave_samples_pointer, \attack, \decay, \sustain, \release
+ .macro voice_programmable_wave_alt base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req
+ _voice_programmable_wave 11, \base_midi_key, \pan, \wave_samples_pointer, \attack, \decay, \sustain, \release
.endm
- .macro _voice_programmable_wave type, wave_samples_pointer, attack, decay, sustain, release
- .byte \type, 60, 0, 0
+ .macro _voice_programmable_wave type:req, base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req
+ .byte \type
+ .byte \base_midi_key
+ .if \pan != 0
+ .byte (0x80 | \pan)
+ .else
+ .byte 0
+ .endif
+ .byte 0
.4byte \wave_samples_pointer
.byte (\attack & 0x7)
.byte (\decay & 0x7)
@@ -82,16 +102,23 @@
.byte (\release & 0x7)
.endm
- .macro voice_noise period, attack, decay, sustain, release
- _voice_noise 4, \period, \attack, \decay, \sustain, \release
+ .macro voice_noise base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req
+ _voice_noise 4, \base_midi_key, \pan, \period, \attack, \decay, \sustain, \release
.endm
- .macro voice_noise_alt period, attack, decay, sustain, release
- _voice_noise 12, \period, \attack, \decay, \sustain, \release
+ .macro voice_noise_alt base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req
+ _voice_noise 12, \base_midi_key, \pan, \period, \attack, \decay, \sustain, \release
.endm
- .macro _voice_noise type, period, attack, decay, sustain, release
- .byte \type, 60, 0, 0
+ .macro _voice_noise type:req, base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req
+ .byte \type
+ .byte \base_midi_key
+ .if \pan != 0
+ .byte (0x80 | \pan)
+ .else
+ .byte 0
+ .endif
+ .byte 0
.byte (\period & 0x1)
.byte 0, 0, 0
.byte (\attack & 0x7)
@@ -100,25 +127,25 @@
.byte (\release & 0x7)
.endm
- .macro voice_keysplit voice_group_pointer, keysplit_table_pointer
+ .macro voice_keysplit voice_group_pointer:req, keysplit_table_pointer:req
.byte 0x40, 0, 0, 0
.4byte \voice_group_pointer
.4byte \keysplit_table_pointer
.endm
- .macro voice_keysplit_all voice_group_pointer
+ .macro voice_keysplit_all voice_group_pointer:req
.byte 0x80, 0, 0, 0
.4byte \voice_group_pointer
.4byte 0
.endm
- .macro cry sample
+ .macro cry sample:req
.byte 0x20, 60, 0, 0
.4byte \sample
.byte 0xff, 0, 0xff, 0
.endm
- .macro cry2 sample
+ .macro cry2 sample:req
.byte 0x30, 60, 0, 0
.4byte \sample
.byte 0xff, 0, 0xff, 0