summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2020-01-08 01:15:36 -0500
committerGitHub <noreply@github.com>2020-01-08 01:15:36 -0500
commite5df61e362beaaab9ae4344f4f160397df9c54cc (patch)
tree8bb86e5e523406b21daa08aff9bce080184fe31e /asm/macros
parent017fa294b5c88ddd7513cb4976b5c29cad0b94a5 (diff)
parent8b1595ebc36a623240fa8dd509864f5400eed1f9 (diff)
Merge branch 'master' into doc-dome
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/battle_frontier/battle_tower.inc31
-rw-r--r--asm/macros/event.inc38
2 files changed, 48 insertions, 21 deletions
diff --git a/asm/macros/battle_frontier/battle_tower.inc b/asm/macros/battle_frontier/battle_tower.inc
index d5a02ea21..71e795b1d 100644
--- a/asm/macros/battle_frontier/battle_tower.inc
+++ b/asm/macros/battle_frontier/battle_tower.inc
@@ -53,7 +53,36 @@
special CallBattleTowerFunc
.endm
- @ TODO: Document and add macros for BATTLE_TOWER_FUNC_10 - BATTLE_TOWER_FUNC_14
+ @ Load the parties, gfx, and other data (like Apprentice id) for the multi partner candidates
+ .macro tower_loadpartners
+ setvar VAR_0x8004, BATTLE_TOWER_FUNC_LOAD_PARTNERS
+ special CallBattleTowerFunc
+ .endm
+
+ @ Print message from potential multi partner. msgId is any PARTNER_MSGID_*
+ .macro tower_dopartnermsg msgId:req
+ setvar VAR_0x8004, BATTLE_TOWER_FUNC_PARTNER_MSG
+ setvar VAR_0x8005, \msgId
+ special CallBattleTowerFunc
+ .endm
+
+ @ Receives/loads the opponent data for a link multi challenge. Returns 6 when finished, and finishes immediately if not doing a link multi battle.
+ .macro tower_loadlinkopponents
+ setvar VAR_0x8004, BATTLE_TOWER_FUNC_LOAD_LINK_OPPONENTS
+ 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
+ special CallBattleTowerFunc
+ .endm
+
+ @ Set VAR_OBJ_GFX_ID_E to the gfx id of the selected multi partner
+ .macro tower_setpartnergfx
+ setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_PARTNER_GFX
+ special CallBattleTowerFunc
+ .endm
@ Set the data used for the post-challenge Battle Tower interview
.macro tower_setinterviewdata
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index 8b43d0821..5865856c3 100644
--- a/asm/macros/event.inc
+++ b/asm/macros/event.inc
@@ -233,14 +233,12 @@
.endm
@ Generic compare macro which attempts to deduce argument types based on their values
- @ Any values between 0x4000 to 0x4FFF and 0x8000 to 0x8FFF are considered event variable identifiers
- .macro compare arg1:req, arg2:req
- .if ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && ((\arg2 >> 12) == 4 || (\arg2 >> 12) == 8)
- compare_var_to_var \arg1, \arg2
- .elseif ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && (\arg2 >= 0 && \arg2 <= 0xFFFF)
- compare_var_to_value \arg1, \arg2
+ @ Any values between 0x4000 to 0x40FF and 0x8000 to 0x8015 are considered event variable identifiers
+ .macro compare var:req, arg:req
+ .if ((\arg >= VARS_START && \arg <= VARS_END) || (\arg >= SPECIAL_VARS_START && \arg <= SPECIAL_VARS_END))
+ compare_var_to_var \var, \arg
.else
- .error "Invalid arguments for 'compare'"
+ compare_var_to_value \var, \arg
.endif
.endm
@@ -465,12 +463,12 @@
.2byte \Y
.endm
- @ Retrieves the number of Pokemon in the player's party, and stores that number in variable 0x800D (LASTRESULT).
+ @ Retrieves the number of Pokemon in the player's party, and stores that number in VAR_RESULT.
.macro getpartysize
.byte 0x43
.endm
- @ Attempts to add quantity of item index to the player's Bag. If the player has enough room, the item will be added and variable 0x800D (LASTRESULT) will be set to 0x0001; otherwise, LASTRESULT is set to 0x0000.
+ @ Attempts to add quantity of item index to the player's Bag. If the player has enough room, the item will be added and VAR_RESULT will be set to TRUE; otherwise, VAR_RESULT is set to FALSE.
.macro giveitem index:req, quantity:req
.byte 0x44
.2byte \index
@@ -484,21 +482,21 @@
.2byte \quantity
.endm
- @ Checks if the player has enough space in their Bag to hold quantity more of item index. Sets variable 0x800D (LASTRESULT) to 0x0001 if there is room, or 0x0000 is there is no room.
+ @ Checks if the player has enough space in their Bag to hold quantity more of item index. Sets VAR_RESULT to TRUE if there is room, or FALSE is there is no room.
.macro checkitemspace index:req, quantity:req
.byte 0x46
.2byte \index
.2byte \quantity
.endm
- @ Checks if the player has quantity or more of item index in their Bag. Sets variable 0x800D (LASTRESULT) to 0x0001 if the player has enough of the item, or 0x0000 if they have fewer than quantity of the item.
+ @ Checks if the player has quantity or more of item index in their Bag. Sets VAR_RESULT to TRUE if the player has enough of the item, or FALSE if they have fewer than quantity of the item.
.macro checkitem index:req, quantity:req
.byte 0x47
.2byte \index
.2byte \quantity
.endm
- @ Checks which Bag pocket the specified (index) item belongs in, and writes the value to variable 0x800D (LASTRESULT). This script is used to show the name of the proper Bag pocket when the player receives an item via callstd (simplified to giveitem in XSE).
+ @ Checks which Bag pocket the specified item belongs in, and writes the pocket value (POCKET_*) to VAR_RESULT. This script is used to show the name of the proper Bag pocket when the player receives an item via callstd (simplified to giveitem in XSE).
.macro checkitemtype index:req
.byte 0x48
.2byte \index
@@ -536,7 +534,7 @@
.2byte \decoration
.endm
- @ Checks if the player has enough space in their PC to hold decoration. Sets variable 0x800D (LASTRESULT) to 0x0001 if there is room, or 0x0000 is there is no room. In FireRed, this command is a nop. (The argument is read, but not used for anything.)
+ @ Checks if the player has enough space in their PC to hold decoration. Sets VAR_RESULT to TRUE if there is room, or FALSE is there is no room. In FireRed, this command is a nop. (The argument is read, but not used for anything.)
.macro checkdecorspace decoration:req
.byte 0x4e
.2byte \decoration
@@ -818,7 +816,7 @@
.byte 0x6d
.endm
- @ Displays a YES/NO multichoice box at the specified coordinates, and blocks script execution until the user makes a selection. Their selection is stored in variable 0x800D (LASTRESULT); 0x0000 for "NO" or if the user pressed B, and 0x0001 for "YES".
+ @ Displays a YES/NO multichoice box at the specified coordinates, and blocks script execution until the user makes a selection. Their selection is stored in VAR_RESULT as NO (0) or YES (1). Pressing B is equivalent to answering NO
.macro yesnobox x:req, y:req
.byte 0x6e
.byte \x
@@ -925,7 +923,7 @@
.2byte \move
.endm
- @ Checks if at least one Pokemon in the player's party knows the specified (index) attack. If so, variable 0x800D (LASTRESULT) is set to the (zero-indexed) slot number of the first Pokemon that knows the move. If not, LASTRESULT is set to 0x0006. Variable 0x8004 is also set to this Pokemon's species.
+ @ Checks if at least one Pokemon in the player's party knows the specified (index) attack. If so, VAR_RESULT is set to the (zero-indexed) slot number of the first Pokemon that knows the move. If not, VAR_RESULT is set to PARTY_SIZE. VAR_0x8004 is also set to this Pokemon's species.
.macro checkpartymove index:req
.byte 0x7c
.2byte \index
@@ -1045,7 +1043,7 @@
.byte 0x8e
.endm
- @ Stores a random integer between 0 and limit in variable 0x800D (LASTRESULT).
+ @ Stores a random integer between 0 and limit in VAR_RESULT.
.macro random limit:req
.byte 0x8f
.2byte \limit
@@ -1065,7 +1063,7 @@
.byte \check
.endm
- @ If check is 0x00, this command will check if the player has value or more money; script variable 0x800D (LASTRESULT) is set to 0x0001 if the player has enough money, or 0x0000 if the do not.
+ @ If check is 0x00, this command will check if the player has money >= value; VAR_RESULT is set to TRUE if the player has enough money, or FALSE if they do not.
.macro checkmoney value:req, check:req
.byte 0x92
.4byte \value
@@ -1154,7 +1152,7 @@
.2byte \heallocation
.endm
- @ Checks the player's gender. If male, then 0x0000 is stored in variable 0x800D (LASTRESULT). If female, then 0x0001 is stored in LASTRESULT.
+ @ Checks the player's gender. If male, then MALE (0) is stored in VAR_RESULT. If female, then FEMALE (1) is stored in VAR_RESULT.
.macro checkplayergender
.byte 0xa0
.endm
@@ -1437,7 +1435,7 @@
.2byte \slot
.endm
- @ Checks if the Pokemon in the specified slot of the player's party is obedient. If the Pokemon is disobedient, 0x0001 is written to script variable 0x800D (LASTRESULT). If the Pokemon is obedient (or if the specified slot is empty or invalid), 0x0000 is written.
+ @ 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
.byte 0xce
.2byte \slot
@@ -1539,7 +1537,7 @@
.4byte \pointer
.endm
- .macro warp8 map:req, byte:req, word1:req, word2:req
+ .macro warpsootopolislegend map:req, byte:req, word1:req, word2:req
.byte 0xe0
map \map
.byte \byte