summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-06-01 20:40:27 -0400
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-06-01 20:40:27 -0400
commitf0b41debc35c2084aad6d369eab11a2d2df4ab44 (patch)
tree9b720ab0b617fa207051efc7ff9373669f7dc47b /asm/macros
parenta839463c849679974c986bf9c9c260eff0e94cb7 (diff)
parent9f5bf65fb336cf7a3ba68d32267bf993f0f6a494 (diff)
Merge branch 'master' of https://github.com/pret/pokeemerald into remove-temps
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/battle_frontier/battle_tower.inc6
-rw-r--r--asm/macros/battle_script.inc6
-rw-r--r--asm/macros/ec.inc19
-rw-r--r--asm/macros/event.inc90
-rw-r--r--asm/macros/map.inc10
5 files changed, 63 insertions, 68 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/battle_script.inc b/asm/macros/battle_script.inc
index 37548f410..0f51061e8 100644
--- a/asm/macros/battle_script.inc
+++ b/asm/macros/battle_script.inc
@@ -503,7 +503,7 @@
.byte \battler
.endm
- .macro atk57
+ .macro endlinkbattle
.byte 0x57
.endm
@@ -941,7 +941,7 @@
.byte 0xb5
.endm
- .macro happinesstodamagecalculation
+ .macro friendshiptodamagecalculation
.byte 0xb6
.endm
@@ -1311,7 +1311,7 @@
various \battler, 15
.endm
- .macro arenajudmengtstring id:req
+ .macro arenajudgmentstring id:req
various \id, VARIOUS_ARENA_JUDGMENT_STRING
.endm
diff --git a/asm/macros/ec.inc b/asm/macros/ec.inc
deleted file mode 100644
index a70b8e244..000000000
--- a/asm/macros/ec.inc
+++ /dev/null
@@ -1,19 +0,0 @@
- .macro ec_word word
- .2byte EC_WORD_\word
- .endm
-
- .macro ec_move1 name
- .2byte (EC_GROUP_MOVE_1 << 9) | MOVE_\name
- .endm
-
- .macro ec_move2 name
- .2byte (EC_GROUP_MOVE_2 << 9) | MOVE_\name
- .endm
-
- .macro ec_pokemon1 name
- .2byte (EC_GROUP_POKEMON << 9) | SPECIES_\name
- .endm
-
- .macro ec_pokemon2 name
- .2byte (EC_GROUP_POKEMON2 << 9) | SPECIES_\name
- .endm
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index eafd19b1c..915fc7142 100644
--- a/asm/macros/event.inc
+++ b/asm/macros/event.inc
@@ -345,11 +345,12 @@
.byte 0x32
.endm
- @ Plays the specified (song_number) song. The byte is apparently supposed to be 0x00.
- .macro playbgm song_number:req, unknown:req
+ @ Plays the specified (song_number) song. If save_song is TRUE, the
+ @ specified (song_number) will be saved as if savebgm was called with it.
+ .macro playbgm song_number:req, save_song:req
.byte 0x33
.2byte \song_number
- .byte \unknown
+ .byte \save_song
.endm
@ Saves the specified (song_number) song to be played later.
@@ -846,38 +847,40 @@
.endm
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
- @ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with list. If b is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
- .macro multichoice x:req, y:req, list:req, b:req
+ @ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId.
+ @ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
+ .macro multichoice x:req, y:req, multichoiceId:req, ignoreBPress:req
.byte 0x6f
.byte \x
.byte \y
- .byte \list
- .byte \b
+ .byte \multichoiceId
+ .byte \ignoreBPress
.endm
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
- @ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with list. The default argument determines
- @ the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00.
- @ If b is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
- .macro multichoicedefault x:req, y:req, list:req, default:req, b:req
+ @ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId.
+ @ The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00.
+ @ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
+ .macro multichoicedefault x:req, y:req, multichoiceId:req, default:req, ignoreBPress:req
.byte 0x70
.byte \x
.byte \y
- .byte \list
+ .byte \multichoiceId
.byte \default
- .byte \b
+ .byte \ignoreBPress
.endm
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
- @ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with list.
+ @ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId.
@ The per_row argument determines how many list items will be shown on a single row of the box.
- .macro multichoicegrid x:req, y:req, list:req, per_row:req, B:req
+ @ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
+ .macro multichoicegrid x:req, y:req, multichoiceId:req, per_row:req, ignoreBPress:req
.byte 0x71
.byte \x
.byte \y
- .byte \list
+ .byte \multichoiceId
.byte \per_row
- .byte \B
+ .byte \ignoreBPress
.endm
@ Nopped in Emerald.
@@ -886,21 +889,21 @@
.endm
@ Nopped in Emerald, but still consumes parameters.
- .macro erasebox byte1:req, byte2:req, byte3:req, byte4:req
+ .macro erasebox left:req, top:req, right:req, bottom:req
.byte 0x73
- .byte \byte1
- .byte \byte2
- .byte \byte3
- .byte \byte4
+ .byte \left
+ .byte \top
+ .byte \right
+ .byte \bottom
.endm
@ Nopped in Emerald, but still consumes parameters.
- .macro drawboxtext byte1:req, byte2:req, byte3:req, byte4:req
+ .macro drawboxtext left:req, top:req, multichoiceId:req, ignoreBPress:req
.byte 0x74
- .byte \byte1
- .byte \byte2
- .byte \byte3
- .byte \byte4
+ .byte \left
+ .byte \top
+ .byte \multichoiceId
+ .byte \ignoreBPress
.endm
@ Displays a box containing the front sprite for the specified (species) Pokemon species.
@@ -916,10 +919,10 @@
.byte 0x76
.endm
- @ Draws an image of the winner of the contest. In FireRed, this command is a nop. (The argument is discarded.)
- .macro showcontestwinner a:req
+ @ Draws an image of the winner of the contest. winnerId is any CONTEST_WINNER_* constant.
+ .macro showcontestpainting winnerId:req
.byte 0x77
- .byte \a
+ .byte \winnerId
.endm
@ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille
@@ -930,6 +933,17 @@
.4byte \text
.endm
+ @ Formatting for the braille window, to be put at the start of a pointer used by braillemessage.
+ @ These are from RS and are ignored in Emerald (see ScrCmd_braillemessage, and comment above)
+ .macro brailleformat winLeft:req, winTop:req, winRight:req, winBottom:req, textLeft:req, textTop:req
+ .byte \winLeft
+ .byte \winTop
+ .byte \winRight
+ .byte \winBottom
+ .byte \textLeft
+ .byte \textTop
+ .endm
+
@ Gives the player one of the specified (species) Pokemon at level level holding item. The trailing 0s are unused parameters
.macro givemon species:req, level:req, item:req
.byte 0x79
@@ -1475,15 +1489,15 @@
.4byte \value
.endm
- @ Makes the Pokemon in the specified slot of the player's party obedient. It will not randomly disobey orders in battle.
- .macro setmonobedient slot:req
+ @ Sets the Pokemon in the specified slot of the player party's eventLegal bit.
+ .macro setmoneventlegal slot:req
.byte 0xcd
.2byte \slot
.endm
- @ Checks if the Pokemon in the specified slot of the player's party is obedient. If the Pokemon is disobedient,
- @ VAR_RESULT is TRUE. If the Pokemon is obedient (or if the specified slot is empty or invalid), VAR_RESULT is FALSE.
- .macro checkmonobedience slot:req
+ @ Checks if the Pokemon in the specified slot of the player's party has its eventLegal bit set. If it isn't set,
+ @ VAR_RESULT is TRUE. If the bit is set (or if the specified slot is empty or invalid), VAR_RESULT is FALSE.
+ .macro checkmoneventlegal slot:req
.byte 0xce
.2byte \slot
.endm
@@ -1550,11 +1564,11 @@
.2byte \y
.endm
- .macro cmdD8
+ .macro selectapproachingtrainer
.byte 0xd8
.endm
- .macro cmdD9
+ .macro lockfortrainer
.byte 0xd9
.endm
@@ -1562,7 +1576,7 @@
.byte 0xda
.endm
- .macro message3 pointer:req
+ .macro messageinstant pointer:req
.byte 0xdb
.4byte \pointer
.endm
diff --git a/asm/macros/map.inc b/asm/macros/map.inc
index b520eb216..74ed06917 100644
--- a/asm/macros/map.inc
+++ b/asm/macros/map.inc
@@ -51,25 +51,25 @@
inc _num_traps
.endm
- .macro bg_event x, y, elevation, kind, arg6, arg7, arg8
+ .macro bg_event x, y, elevation, kind, arg6, arg7
.2byte \x, \y
.byte \elevation, \kind
.2byte 0
- .if \kind < 5
+ .if \kind != BG_EVENT_HIDDEN_ITEM
.4byte \arg6
.else
.2byte \arg6
- .byte \arg7, \arg8
+ .2byte \arg7
.endif
inc _num_signs
.endm
.macro bg_hidden_item_event x, y, height, item, flag
- bg_event \x, \y, \height, 7, \item, ((\flag) - FLAG_HIDDEN_ITEMS_START), 0
+ bg_event \x, \y, \height, BG_EVENT_HIDDEN_ITEM, \item, ((\flag) - FLAG_HIDDEN_ITEMS_START)
.endm
.macro bg_secret_base_event x, y, height, secret_base_id
- bg_event \x, \y, \height, 8, \secret_base_id, 0, 0
+ bg_event \x, \y, \height, BG_EVENT_SECRET_BASE, \secret_base_id
.endm
.macro map_events npcs, warps, traps, signs