From 06af24bce58b9285166d27fc371ad3c3dbb63a29 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 15 Sep 2019 23:47:07 -0400 Subject: Use misc ScrCmd constants --- asm/macros/event.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index bf1b8ce76..b6ca83596 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -902,15 +902,15 @@ .4byte \text .endm - @ Gives the player one of the specified (species) Pokemon at level level holding item. The unknown arguments should all be zeroes. - .macro givemon species:req, level:req, item:req, unknown1:req, unknown2:req, unknown3:req + @ 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 .2byte \species .byte \level .2byte \item - .4byte \unknown1 - .4byte \unknown2 - .byte \unknown3 + .4byte 0x0 + .4byte 0x0 + .byte 0 .endm .macro giveegg species:req -- cgit v1.2.3 From b6dffcf8b774ca06287dda30fa5a6323bd8835f6 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 19 Sep 2019 19:23:24 -0400 Subject: Clean up script_menu documentation --- asm/macros/event.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index b6ca83596..54078332c 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -825,7 +825,7 @@ .byte \y .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 (gMultichoiceLists) 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. + @ 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 .byte 0x6f .byte \x @@ -834,7 +834,7 @@ .byte \b .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 (gMultichoiceLists) 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. + @ 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 .byte 0x70 .byte \x @@ -844,7 +844,7 @@ .byte \b .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 (gMultichoiceLists) and the one to be used is specified with list. The per_row argument determines how many list items will be shown on a single row of the box. + @ 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 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 .byte 0x71 .byte \x -- cgit v1.2.3 From 3bf812939654ea092667bc2116783e6993941305 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 27 Sep 2019 02:46:33 -0400 Subject: Clean up new Cmd macro names --- asm/macros/battle_script.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 997af51cc..d2d678254 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -391,11 +391,11 @@ .byte 0x47 .endm - .macro playstatchangeanimation battler:req, param1:req, param2:req + .macro playstatchangeanimation battler:req, stats:req, statchange:req .byte 0x48 .byte \battler - .byte \param1 - .byte \param2 + .byte \stats + .byte \statchange .endm .macro moveend param0:req, param1:req @@ -738,10 +738,10 @@ .byte 0x88 .endm - .macro statbuffchange param0:req, param1:req + .macro statbuffchange flags:req, jumpptr:req .byte 0x89 - .byte \param0 - .4byte \param1 + .byte \flags + .4byte \jumpptr .endm .macro normalisebuffs -- cgit v1.2.3 From 799edaf3e6c4d1aa714e6b11890a50724f3dff0e Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 6 Oct 2019 14:17:34 -0500 Subject: Document hide/show reflection movement actions --- asm/macros/movement.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/movement.inc b/asm/macros/movement.inc index 99b5c8f84..e26a00d76 100644 --- a/asm/macros/movement.inc +++ b/asm/macros/movement.inc @@ -102,8 +102,8 @@ create_movement_action clear_fixed_priority create_movement_action init_affine_anim create_movement_action clear_affine_anim - create_movement_action unknown_movement_1 - create_movement_action unknown_movement_2 + create_movement_action hide_reflection + create_movement_action show_reflection create_movement_action walk_down_start_affine create_movement_action walk_down_affine -- cgit v1.2.3 From e47b3efdfe8a397e20905d566a8e1b1261170fbb Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 12 Oct 2019 17:30:45 -0500 Subject: Unify showmonpic and hidemonpic script command names with their function names --- asm/macros/event.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 54078332c..57bb504bd 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -878,15 +878,15 @@ .endm @ Displays a box containing the front sprite for the specified (species) Pokemon species. - .macro drawmonpic species:req, x:req, y:req + .macro showmonpic species:req, x:req, y:req .byte 0x75 .2byte \species .byte \x .byte \y .endm - @ Hides all boxes displayed with drawmonpic. - .macro erasemonpic + @ Hides all boxes displayed with showmonpic. + .macro hidemonpic .byte 0x76 .endm -- cgit v1.2.3 From 90a05cf824b14861b7c1c942aebae31f9cb502ea Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 15 Oct 2019 05:00:08 -0400 Subject: Finish Mossdeep Gym doc, beging documenting rotating tile puzzle --- asm/macros/event.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 54078332c..1500a8c44 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1478,21 +1478,21 @@ .endm @ In FireRed, this command is a nop. - .macro mossdeepgym3 var:req + .macro initrotatingtilepuzzle isTrickHouse:req .byte 0xd5 - .2byte \var + .2byte \isTrickHouse .endm .macro mossdeepgym4 .byte 0xd6 .endm - .macro warp7 map:req, byte:req, word1:req, word2:req + .macro warpmossdeepgym map:req, warpId:req, x:req, y:req .byte 0xd7 map \map - .byte \byte - .2byte \word1 - .2byte \word2 + .byte \warpId + .2byte \x + .2byte \y .endm .macro cmdD8 -- cgit v1.2.3 From 0f15264595e66f1de9aa030b69a9fedc9c75f13e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 16 Oct 2019 04:09:30 -0400 Subject: Document rotating_tile_puzzle --- asm/macros/event.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 1500a8c44..38046c778 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1468,22 +1468,25 @@ .byte \location .endm - .macro mossdeepgym1 unknown:req + @ For the rotating tile puzzles in Mossdeep Gym/Trick House Room 7. Moves the objects on the colored puzzle specified by puzzleNumber one rotation + .macro moverotatingtileobjects puzzleNumber:req .byte 0xd3 - .2byte \unknown + .2byte \puzzleNumber .endm - .macro mossdeepgym2 + @ For the rotating tile puzzles in Mossdeep Gym/Trick House Room 7. Updates the facing direction of all objects on the puzzle tiles + .macro turnrotatingtileobjects .byte 0xd4 .endm - @ In FireRed, this command is a nop. + @ For the rotating tile puzzles in Mossdeep Gym/Trick House Room 7. Allocates memory for the puzzle objects. isTrickHouse is needed to determine which of the two maps the puzzle is on, in order to know where in the tileset the puzzle tiles start. In FireRed, this command is a nop. .macro initrotatingtilepuzzle isTrickHouse:req .byte 0xd5 .2byte \isTrickHouse .endm - .macro mossdeepgym4 + @ For the rotating tile puzzles in Mossdeep Gym/Trick House Room 7. Frees the memory allocated for the puzzle objects. + .macro freerotatingtilepuzzle .byte 0xd6 .endm -- cgit v1.2.3 From a4d6ce417d11f7601c037f246cbcdc2f680d87ee Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 22 Oct 2019 16:02:01 -0400 Subject: Fix resetintimidatetracebits typo --- asm/macros/battle_script.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 997af51cc..c605099e1 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1267,7 +1267,7 @@ various \battler, 4 .endm - .macro resetintrimidatetracebits battler:req + .macro resetintimidatetracebits battler:req various \battler, VARIOUS_RESET_INTIMIDATE_TRACE_BITS .endm -- cgit v1.2.3 From 8055548fa4d6707ac311e32afc9614d4603115db Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 31 Oct 2019 17:00:37 -0400 Subject: Document legendary scripts --- asm/macros/event.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 39510c207..64f2cdc92 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1506,7 +1506,7 @@ .byte 0xd9 .endm - .macro hidebox2 + .macro closebraillemessage .byte 0xda .endm -- cgit v1.2.3 From 58dcd6d99dd7456006fe834e5fbab6b120698280 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 5 Nov 2019 15:08:07 -0500 Subject: Clean up mystery event msg --- asm/macros/event.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 64f2cdc92..e633a9d84 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1630,6 +1630,14 @@ call_if 5, \dest .endm + .macro vgoto_if_eq dest:req + vgoto_if 1, \dest + .endm + + .macro vgoto_if_ne dest:req + vgoto_if 0, \dest + .endm + .macro switch var:req copyvar VAR_0x8000, \var .endm -- cgit v1.2.3 From 6730df23216881d3ec8c70cc5c097ef0b74d5856 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 6 Nov 2019 09:31:04 -0500 Subject: Document Abandoned Ship scripts --- asm/macros/event.inc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index e633a9d84..e616ea3ae 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1679,3 +1679,10 @@ setorcopyvar VAR_0x8000, \trainer callstd STD_REGISTER_MATCH_CALL .endm + + .macro dofieldeffectsparkle x:req y:req + setfieldeffectargument 0, \x + setfieldeffectargument 1, \y + setfieldeffectargument 2, 0 + dofieldeffect FLDEFF_SPARKLE + .endm -- cgit v1.2.3 From dba94e3971579e6babf77fa72d8c9e5031cf72fe Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 6 Nov 2019 10:11:54 -0500 Subject: Update fldeff sparkle macro --- asm/macros/event.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index e616ea3ae..40430fe53 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1680,9 +1680,9 @@ callstd STD_REGISTER_MATCH_CALL .endm - .macro dofieldeffectsparkle x:req y:req + .macro dofieldeffectsparkle x:req, y:req, priority:req setfieldeffectargument 0, \x setfieldeffectargument 1, \y - setfieldeffectargument 2, 0 + setfieldeffectargument 2, \priority dofieldeffect FLDEFF_SPARKLE .endm -- cgit v1.2.3 From d5685db19a98657492d5d99541f266c26a52619a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 7 Nov 2019 10:37:15 -0500 Subject: Fold nops into hidemoneybox --- asm/macros/event.inc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 40430fe53..de98d6fa3 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1083,6 +1083,8 @@ @ Hides the secondary box spawned by showmoney. .macro hidemoneybox .byte 0x94 + nop + nop .endm @ Updates the secondary box spawned by showmoney. Consumes but does not use arguments. -- cgit v1.2.3 From 702ef745d97dcdeae03e1c47fb1f2f7fc1be6dd0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 7 Nov 2019 11:07:49 -0500 Subject: Add comments to hidemoneybox macro --- asm/macros/event.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index de98d6fa3..20b5f3e60 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1080,11 +1080,11 @@ .byte \check .endm - @ Hides the secondary box spawned by showmoney. + @ Hides the secondary box spawned by showmoney. Consumption of the x and y arguments was dummied out. .macro hidemoneybox .byte 0x94 - nop - nop + .byte 0 @ \x + .byte 0 @ \y .endm @ Updates the secondary box spawned by showmoney. Consumes but does not use arguments. -- cgit v1.2.3 From c0ae1cbc1c9c5c31c129009d521c4d62d15d1c95 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 10 Nov 2019 10:56:35 -0500 Subject: Document Lilycove scripts --- asm/macros/event.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 20b5f3e60..af4ada031 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -891,7 +891,7 @@ .endm @ Draws an image of the winner of the contest. In FireRed, this command is a nop. (The argument is discarded.) - .macro drawcontestwinner a:req + .macro showcontestwinner a:req .byte 0x77 .byte \a .endm -- cgit v1.2.3 From 5e01871f8b00d6b0ef4921a35e0b2bf18c7b4183 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 13 Nov 2019 16:10:05 -0500 Subject: Document Trainer Hill --- asm/macros/event.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index af4ada031..ba617f629 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -677,7 +677,7 @@ .elseif \type == TRAINER_BATTLE_SET_TRAINER_B .4byte \pointer1 @ text .4byte \pointer2 @ text - .elseif \type == TRAINER_BATTLE_12 + .elseif \type == TRAINER_BATTLE_HILL .4byte \pointer1 @ text .4byte \pointer2 @ text .endif -- cgit v1.2.3 From 6ac7efb54f79a3ecd216cdc560bf2703b6c799c2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 16 Nov 2019 18:12:21 -0500 Subject: Document Scotts House and begin frontier macros --- asm/macros/battle_frontier.inc | 35 +++++++++++++++++++++++++++++++++++ asm/macros/event.inc | 1 + 2 files changed, 36 insertions(+) create mode 100644 asm/macros/battle_frontier.inc (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc new file mode 100644 index 000000000..8a5f369a3 --- /dev/null +++ b/asm/macros/battle_frontier.inc @@ -0,0 +1,35 @@ +@ To be populated with macros for the Battle Frontier CallFacilityFunction specials + + +@ Frontier Util + +.macro frontier_setlvlmode lvlmode:req +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_2 +setvar VAR_0x8005, 1 +setvar VAR_0x8006, \lvlmode +special CallFrontierUtilFunc +.endm + +@ Battle Tower + +.macro battletower_getstreak +setvar VAR_0x8004, BATTLE_TOWER_FUNC_1 +setvar VAR_0x8005, 1 +special CallBattleTowerFunc +.endm + +@ Battle Dome + +@ Battle Palace + +@ Battle Arena + +@ Battle Factory + +@ Battle Pike + +@ Battle Pyramid + +@ Battle Tent + +@ Apprentice diff --git a/asm/macros/event.inc b/asm/macros/event.inc index ba617f629..9db57daf1 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1655,6 +1655,7 @@ MSGBOX_DEFAULT = 4 MSGBOX_YESNO = 5 MSGBOX_AUTOCLOSE = 6 + MSGBOX_GETPOINTS = 9 YES = 1 NO = 0 -- cgit v1.2.3 From 4e6a69c29736bd9bb81049c6944e27ce46f8333c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Nov 2019 11:36:38 -0500 Subject: WIP Document Apprentice --- asm/macros/battle_frontier.inc | 117 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc index 8a5f369a3..cbb91f680 100644 --- a/asm/macros/battle_frontier.inc +++ b/asm/macros/battle_frontier.inc @@ -32,4 +32,121 @@ special CallBattleTowerFunc @ Battle Tent +@ Trainer Hill + @ Apprentice + +.macro apprentice_gavelvlmode +setvar VAR_0x8004, APPRENTICE_FUNC_GAVE_LVLMODE +special CallApprenticeFunction +.endm + +.macro apprentice_setlvlmode lvlmode:req +setvar VAR_0x8004, APPRENTICE_FUNC_SET_LVLMODE +setorcopyvar VAR_0x8005, \lvlmode +addvar VAR_0x8005, 1 +special CallApprenticeFunction +.endm + +.macro apprentice_answeredquestion +setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION +special CallApprenticeFunction +.endm + +.macro apprentice_menu which:req +setvar VAR_0x8004, APPRENTICE_FUNC_MENU +setvar VAR_0x8005, \which +special CallApprenticeFunction +waitstate +.endm + +.macro apprentice_3 +setvar VAR_0x8004, APPRENTICE_FUNC_3 +special CallApprenticeFunction +.endm + +.macro apprentice_msg waitbuttonpress:req, which:req +setvar VAR_0x8004, APPRENTICE_FUNC_PRINT_MSG +setvar VAR_0x8005, \waitbuttonpress +setvar VAR_0x8006, \which +special CallApprenticeFunction +waitstate +.endm + +.macro apprentice_reset +setvar VAR_0x8004, APPRENTICE_FUNC_RESET +special CallApprenticeFunction +.endm + +.macro apprentice_shouldcheckgone +setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE +special CallApprenticeFunction +.endm + +.macro apprentice_getquestion +setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION +special CallApprenticeFunction +.endm + +.macro apprentice_getnumpartymons +setvar VAR_0x8004, APPRENTICE_FUNC_GET_NUM_PARTY_MONS +special CallApprenticeFunction +.endm + +.macro apprentice_setpartymon slot:req +copyvar VAR_0x8006, \slot +setvar VAR_0x8004, APPRENTICE_FUNC_SET_PARTY_MON +special CallApprenticeFunction +.endm + +.macro apprentice_initquestion which:req +setvar VAR_0x8004, APPRENTICE_FUNC_INIT_QUESTION_DATA +setvar VAR_0x8005, \which +special CallApprenticeFunction +.endm + +.macro apprentice_freequestion +setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA +special CallApprenticeFunction +.endm + +.macro apprentice_buff whichstringvar:req, tobuff:req +setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING +setvar VAR_0x8005, \whichstringvar +setvar VAR_0x8006, \tobuff +special CallApprenticeFunction +.endm + +.macro apprentice_buffv whichstringvar:req tobuff:req +setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING +setvar VAR_0x8005, \whichstringvar +copyvar VAR_0x8006, \tobuff +special CallApprenticeFunction +.endm + +.macro apprentice_setmove +setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE +special CallApprenticeFunction +.endm + +.macro apprentice_setfirstmon monId:req +copyvar VAR_0x8005, \monId +setvar VAR_0x8004, APPRENTICE_FUNC_SET_FIRST_MON +special CallApprenticeFunction +.endm + +.macro apprentice_openbag +setvar VAR_0x8004, APPRENTICE_FUNC_OPEN_BAG +special CallApprenticeFunction +waitstate +.endm + +.macro apprentice_setgfx +setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX +special CallApprenticeFunction +.endm + +.macro apprentice_shouldleave +setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE +special CallApprenticeFunction +.endm -- cgit v1.2.3 From a05006421b29ac49ce7173bb431d8a0419f5c143 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 20 Nov 2019 17:36:52 -0500 Subject: Document Apprentice --- asm/macros/battle_frontier.inc | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc index cbb91f680..337238cd3 100644 --- a/asm/macros/battle_frontier.inc +++ b/asm/macros/battle_frontier.inc @@ -60,8 +60,13 @@ special CallApprenticeFunction waitstate .endm -.macro apprentice_3 -setvar VAR_0x8004, APPRENTICE_FUNC_3 +.macro apprentice_shufflespecies +setvar VAR_0x8004, APPRENTICE_FUNC_SHUFFLE_SPECIES +special CallApprenticeFunction +.endm + +.macro apprentice_randomizequestions +setvar VAR_0x8004, APPRENTICE_FUNC_RANDOMIZE_QUESTIONS special CallApprenticeFunction .endm @@ -129,9 +134,9 @@ setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE special CallApprenticeFunction .endm -.macro apprentice_setfirstmon monId:req +.macro apprentice_setleadmon monId:req copyvar VAR_0x8005, \monId -setvar VAR_0x8004, APPRENTICE_FUNC_SET_FIRST_MON +setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON special CallApprenticeFunction .endm @@ -141,6 +146,16 @@ special CallApprenticeFunction waitstate .endm +.macro apprentice_trysetitem +setvar VAR_0x8004, APPRENTICE_FUNC_TRY_SET_HELD_ITEM +special CallApprenticeFunction +.endm + +.macro apprentice_save +setvar VAR_0x8004, APPRENTICE_FUNC_SAVE +special CallApprenticeFunction +.endm + .macro apprentice_setgfx setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX special CallApprenticeFunction @@ -150,3 +165,8 @@ special CallApprenticeFunction setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE special CallApprenticeFunction .endm + +.macro apprentice_shiftsaved +setvar VAR_0x8004, APPRENTICE_FUNC_SHIFT_SAVED +special CallApprenticeFunction +.endm -- cgit v1.2.3 From 2bf1e0600ee341970c4731640a351ded047a55c5 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 23 Nov 2019 08:09:25 -0500 Subject: Consolidate apprentice_buff macros --- asm/macros/battle_frontier.inc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc index 337238cd3..2a6ee7d74 100644 --- a/asm/macros/battle_frontier.inc +++ b/asm/macros/battle_frontier.inc @@ -118,14 +118,11 @@ special CallApprenticeFunction .macro apprentice_buff whichstringvar:req, tobuff:req setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING setvar VAR_0x8005, \whichstringvar -setvar VAR_0x8006, \tobuff -special CallApprenticeFunction -.endm - -.macro apprentice_buffv whichstringvar:req tobuff:req -setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING -setvar VAR_0x8005, \whichstringvar +.if \tobuff >= VARS_START copyvar VAR_0x8006, \tobuff +.else +setvar VAR_0x8006, \tobuff +.endif special CallApprenticeFunction .endm -- cgit v1.2.3 From 4dfa959fa297195a040a8cd0436d561296076f0e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 20 Nov 2019 21:46:29 -0500 Subject: Begin documenting Battle Pike and Frontier Util --- asm/macros/battle_frontier.inc | 144 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 141 insertions(+), 3 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc index 2a6ee7d74..2382d3ed2 100644 --- a/asm/macros/battle_frontier.inc +++ b/asm/macros/battle_frontier.inc @@ -1,15 +1,95 @@ -@ To be populated with macros for the Battle Frontier CallFacilityFunction specials +@ Frontier Util +.macro frontier_checkoutcome +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_STATUS +special CallFrontierUtilFunc +.endm -@ Frontier Util +.macro frontier_getchallengestatus +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA +setvar VAR_0x8005, 0 +special CallFrontierUtilFunc +.endm + +.macro frontier_setchallengestatus status:req +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA +setvar VAR_0x8005, 0 +setvar VAR_0x8006, \status +special CallFrontierUtilFunc +.endm + +.macro frontier_getlvlmode +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA +setvar VAR_0x8005, 1 +special CallFrontierUtilFunc +.endm .macro frontier_setlvlmode lvlmode:req -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_2 +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA setvar VAR_0x8005, 1 setvar VAR_0x8006, \lvlmode special CallFrontierUtilFunc .endm +.macro frontier_getbattlenum +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA +setvar VAR_0x8005, 2 +special CallFrontierUtilFunc +.endm + +.macro frontier_setbattlenum battleNum:req +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA +setvar VAR_0x8005, 2 +copyvar VAR_0x8006, \battleNum +special CallFrontierUtilFunc +.endm + +.macro frontier_getbattleoutcome +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA +setvar VAR_0x8005, 5 +special CallFrontierUtilFunc +.endm + +.macro frontier_set data:req, val=0xFFFF +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA +setvar VAR_0x8005, \data +.if \val == 0xFFFF +@ no value provided +.elseif \val >= VARS_START +copyvar VAR_0x8006, \val +.else +setvar VAR_0x8006, \val +.endif +special CallFrontierUtilFunc +.endm + +.macro frontier_loadselectedmons +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_LOAD_SELECTED_PARTY +setvar VAR_0x8005, FRONTIER_PARTY_SIZE +special CallFrontierUtilFunc +.endm + +@ Facilities with only 1 mode dont provide the mode argument +.macro frontier_results facility:req, mode=0xFF +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESULTS_WINDOW +setvar VAR_0x8005, \facility +.if \mode != 0xFF +setvar VAR_0x8006, \mode +.endif +special CallFrontierUtilFunc +.endm + +.macro frontier_getbrainstatus +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_BRAIN_STATUS +special CallFrontierUtilFunc +.endm + +.macro frontier_resetsketch +setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESET_SKETCH_MOVES +special CallFrontierUtilFunc +.endm + + @ Battle Tower .macro battletower_getstreak @@ -18,16 +98,74 @@ setvar VAR_0x8005, 1 special CallBattleTowerFunc .endm + @ Battle Dome + @ Battle Palace + @ Battle Arena + @ Battle Factory + @ Battle Pike +.macro battlepike_getstreak +setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_DATA +setvar VAR_0x8005, 1 +special CallBattlePikeFunction +.endm + +.macro battlepike_setstreak streak:req +setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_DATA +setvar VAR_0x8005, 1 +.if \streak >= VARS_START +copyvar VAR_0x8006, \streak +.else +setvar VAR_0x8006, \streak +.endif +special CallBattlePikeFunction +.endm + +.macro battlepike_isfinalroom +setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_FINAL_ROOM +special CallBattlePikeFunction +.endm + +.macro battlepike_setroomobjects +setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS +special CallBattlePikeFunction +.endm + +.macro battlepike_getroomtype +setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE +special CallBattlePikeFunction +.endm + +.macro battlepike_setnextroom +setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE +special CallBattlePikeFunction +.endm + +.macro battlepike_gethint +setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT +special CallBattlePikeFunction +.endm + +.macro battlepike_nohealing set:req +setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEALING_ROOMS_DISABLED +setvar VAR_0x8005, \set +special CallBattlePikeFunction +.endm + +.macro battlepike_ispartyfullhealth +setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH +special CallBattlePikeFunction +.endm + @ Battle Pyramid @ Battle Tent -- cgit v1.2.3 From 08a8dc46e307120d7007531826b58ac5ee227564 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 23 Nov 2019 16:08:50 -0500 Subject: Use macros for Trainer Hill --- asm/macros/battle_frontier.inc | 95 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc index 2382d3ed2..4e04043d8 100644 --- a/asm/macros/battle_frontier.inc +++ b/asm/macros/battle_frontier.inc @@ -166,12 +166,107 @@ setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH special CallBattlePikeFunction .endm + @ Battle Pyramid + @ Battle Tent + @ Trainer Hill +.macro trainerhill_start +setvar VAR_0x8004, TRAINER_HILL_FUNC_START +special CallTrainerHillFunction +.endm + +.macro trainerhill_getownerstate +setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_OWNER_STATE +special CallTrainerHillFunction +.endm + +.macro trainerhill_giveprize +setvar VAR_0x8004, TRAINER_HILL_FUNC_GIVE_PRIZE +special CallTrainerHillFunction +.endm + +.macro trainerhill_finaltime +setvar VAR_0x8004, TRAINER_HILL_FUNC_CHECK_FINAL_TIME +special CallTrainerHillFunction +.endm + +.macro trainerhill_resumetimer +setvar VAR_0x8004, TRAINER_HILL_FUNC_RESUME_TIMER +special CallTrainerHillFunction +.endm + +.macro trainerhill_lost +setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_LOST +special CallTrainerHillFunction +.endm + +.macro trainerhill_getstatus +setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_STATUS +special CallTrainerHillFunction +.endm + +.macro trainerhill_gettime +setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_TIME +special CallTrainerHillFunction +.endm + +.macro trainerhill_allfloorsused +setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_ALL_FLOORS_USED +special CallTrainerHillFunction +.endm + +.macro trainerhill_clearresult +setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_RESULT +special CallTrainerHillFunction +.endm + +.macro trainerhill_inchallenge +setvar VAR_0x8004, TRAINER_HILL_FUNC_IN_CHALLENGE +special CallTrainerHillFunction +.endm + +.macro trainerhill_postbattletext +setvar VAR_0x8004, TRAINER_HILL_FUNC_POST_BATTLE_TEXT +special CallTrainerHillFunction +.endm + +.macro trainerhill_settrainerflags +setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_ALL_TRAINER_FLAGS +special CallTrainerHillFunction +.endm + +.macro trainerhill_getsaved +setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_GAME_SAVED +special CallTrainerHillFunction +.endm + +.macro trainerhill_setsaved +setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_GAME_SAVED +special CallTrainerHillFunction +.endm + +.macro trainerhill_clearsaved +setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_GAME_SAVED +special CallTrainerHillFunction +.endm + +.macro trainerhill_getwon +setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_WON +special CallTrainerHillFunction +.endm + +.macro trainerhill_settag tag:req +setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG +copyvar VAR_0x8005, \tag +special CallTrainerHillFunction +.endm + + @ Apprentice .macro apprentice_gavelvlmode -- cgit v1.2.3 From 63ee15fc28fee12a1a9433f52d392eb3c922a844 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 24 Nov 2019 16:58:40 -0500 Subject: Document Frontier Util --- asm/macros/battle_frontier.inc | 830 ++++++++++++++++++++++------------------- 1 file changed, 440 insertions(+), 390 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc index 4e04043d8..ca06bc178 100644 --- a/asm/macros/battle_frontier.inc +++ b/asm/macros/battle_frontier.inc @@ -1,402 +1,452 @@ -@ Frontier Util - -.macro frontier_checkoutcome -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_STATUS -special CallFrontierUtilFunc -.endm - -.macro frontier_getchallengestatus -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA -setvar VAR_0x8005, 0 -special CallFrontierUtilFunc -.endm - -.macro frontier_setchallengestatus status:req -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA -setvar VAR_0x8005, 0 -setvar VAR_0x8006, \status -special CallFrontierUtilFunc -.endm - -.macro frontier_getlvlmode -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA -setvar VAR_0x8005, 1 -special CallFrontierUtilFunc -.endm - -.macro frontier_setlvlmode lvlmode:req -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA -setvar VAR_0x8005, 1 -setvar VAR_0x8006, \lvlmode -special CallFrontierUtilFunc -.endm - -.macro frontier_getbattlenum -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA -setvar VAR_0x8005, 2 -special CallFrontierUtilFunc -.endm - -.macro frontier_setbattlenum battleNum:req -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA -setvar VAR_0x8005, 2 -copyvar VAR_0x8006, \battleNum -special CallFrontierUtilFunc -.endm - -.macro frontier_getbattleoutcome -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA -setvar VAR_0x8005, 5 -special CallFrontierUtilFunc -.endm - -.macro frontier_set data:req, val=0xFFFF -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA -setvar VAR_0x8005, \data -.if \val == 0xFFFF -@ no value provided -.elseif \val >= VARS_START -copyvar VAR_0x8006, \val -.else -setvar VAR_0x8006, \val -.endif -special CallFrontierUtilFunc -.endm - -.macro frontier_loadselectedmons -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_LOAD_SELECTED_PARTY -setvar VAR_0x8005, FRONTIER_PARTY_SIZE -special CallFrontierUtilFunc -.endm - -@ Facilities with only 1 mode dont provide the mode argument -.macro frontier_results facility:req, mode=0xFF -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESULTS_WINDOW -setvar VAR_0x8005, \facility -.if \mode != 0xFF -setvar VAR_0x8006, \mode -.endif -special CallFrontierUtilFunc -.endm - -.macro frontier_getbrainstatus -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_BRAIN_STATUS -special CallFrontierUtilFunc -.endm - -.macro frontier_resetsketch -setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESET_SKETCH_MOVES -special CallFrontierUtilFunc -.endm - - -@ Battle Tower - -.macro battletower_getstreak -setvar VAR_0x8004, BATTLE_TOWER_FUNC_1 -setvar VAR_0x8005, 1 -special CallBattleTowerFunc -.endm - - -@ Battle Dome - - -@ Battle Palace - - -@ Battle Arena - - -@ Battle Factory - - -@ Battle Pike - -.macro battlepike_getstreak -setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_DATA -setvar VAR_0x8005, 1 -special CallBattlePikeFunction -.endm - -.macro battlepike_setstreak streak:req -setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_DATA -setvar VAR_0x8005, 1 -.if \streak >= VARS_START -copyvar VAR_0x8006, \streak -.else -setvar VAR_0x8006, \streak -.endif -special CallBattlePikeFunction -.endm - -.macro battlepike_isfinalroom -setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_FINAL_ROOM -special CallBattlePikeFunction -.endm - -.macro battlepike_setroomobjects -setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS -special CallBattlePikeFunction -.endm - -.macro battlepike_getroomtype -setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE -special CallBattlePikeFunction -.endm - -.macro battlepike_setnextroom -setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE -special CallBattlePikeFunction -.endm - -.macro battlepike_gethint -setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT -special CallBattlePikeFunction -.endm - -.macro battlepike_nohealing set:req -setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEALING_ROOMS_DISABLED -setvar VAR_0x8005, \set -special CallBattlePikeFunction -.endm + @ TODO: + @ Add macro comments + @ Split into individual files + @ Enforce tab spacing + @ Standardize Func->Function + + @ Frontier Util + + .macro frontier_getstatus + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_STATUS + special CallFrontierUtilFunc + .endm + + .macro frontier_get data:req + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallFrontierUtilFunc + .endm + + .macro frontier_set data:req, val=0xFFFF + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA + setvar VAR_0x8005, \data + .if \val == 0xFFFF + @ no value provided + .elseif \val >= VARS_START + copyvar VAR_0x8006, \val + .else + setvar VAR_0x8006, \val + .endif + special CallFrontierUtilFunc + .endm + + .macro frontier_setpartyorder partySize:req + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_PARTY_ORDER + setvar VAR_0x8005, \partySize + special CallFrontierUtilFunc + .endm + + .macro frontier_reset + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SOFT_RESET + special CallFrontierUtilFunc + .endm + + .macro frontier_settrainers + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_TRAINERS + special CallFrontierUtilFunc + .endm + + .macro frontier_saveparty + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY + special CallFrontierUtilFunc + .endm + + @ Facilities with only 1 mode dont provide the mode argument + .macro frontier_results facility:req, mode=0xFF + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESULTS_WINDOW + setvar VAR_0x8005, \facility + .if \mode != 0xFF + setvar VAR_0x8006, \mode + .endif + special CallFrontierUtilFunc + .endm + + .macro frontier_checkairshow + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_AIR_TV_SHOW + special CallFrontierUtilFunc + .endm + + .macro frontier_getbrainstatus + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_BRAIN_STATUS + special CallFrontierUtilFunc + .endm + + .macro frontier_isbrain + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_IS_BRAIN + special CallFrontierUtilFunc + .endm + + .macro frontier_givepoints + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GIVE_BATTLE_POINTS + special CallFrontierUtilFunc + .endm + + .macro frontier_getsymbols + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_FACILITY_SYMBOLS + special CallFrontierUtilFunc + .endm + + .macro frontier_givesymbol + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GIVE_FACILITY_SYMBOL + special CallFrontierUtilFunc + .endm + + .macro frontier_isbattletype battleType:req + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_BATTLE_TYPE + setvar VAR_0x8005, \battleType + special CallFrontierUtilFunc + .endm + + .macro frontier_checkineligible + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_INELIGIBLE + special CallFrontierUtilFunc + .endm + + @ Validates the visiting E-Reader trainer. 0 if valid, 1 if not + .macro frontier_checkvisittrainer + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_VISIT_TRAINER + special CallFrontierUtilFunc + .endm + + .macro frontier_incrementstreak + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_INCREMENT_STREAK + special CallFrontierUtilFunc + .endm + + .macro frontier_restorehelditems + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESTORE_HELD_ITEMS + special CallFrontierUtilFunc + .endm + + .macro frontier_savebattle + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_BATTLE + special CallFrontierUtilFunc + .endm + + .macro frontier_gettrainername stringVar:req + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_BUFFER_TRAINER_NAME + setvar VAR_0x8005, \stringVar + special CallFrontierUtilFunc + .endm + + .macro frontier_resetsketch + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESET_SKETCH_MOVES + special CallFrontierUtilFunc + .endm + + .macro frontier_setbrainobj + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_BRAIN_OBJECT + special CallFrontierUtilFunc + .endm + -.macro battlepike_ispartyfullhealth -setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH -special CallBattlePikeFunction -.endm + @ Battle Tower + + .macro battletower_getstreak + setvar VAR_0x8004, BATTLE_TOWER_FUNC_1 + setvar VAR_0x8005, 1 + special CallBattleTowerFunc + .endm + + + @ Battle Dome + + + @ Battle Palace -@ Battle Pyramid + @ Battle Arena -@ Battle Tent + @ Battle Factory -@ Trainer Hill + @ Battle Pike -.macro trainerhill_start -setvar VAR_0x8004, TRAINER_HILL_FUNC_START -special CallTrainerHillFunction -.endm + .macro battlepike_getstreak + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_DATA + setvar VAR_0x8005, 1 + special CallBattlePikeFunction + .endm -.macro trainerhill_getownerstate -setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_OWNER_STATE -special CallTrainerHillFunction -.endm + .macro battlepike_setstreak streak:req + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_DATA + setvar VAR_0x8005, 1 + .if \streak >= VARS_START + copyvar VAR_0x8006, \streak + .else + setvar VAR_0x8006, \streak + .endif + special CallBattlePikeFunction + .endm -.macro trainerhill_giveprize -setvar VAR_0x8004, TRAINER_HILL_FUNC_GIVE_PRIZE -special CallTrainerHillFunction -.endm + .macro battlepike_isfinalroom + setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_FINAL_ROOM + special CallBattlePikeFunction + .endm -.macro trainerhill_finaltime -setvar VAR_0x8004, TRAINER_HILL_FUNC_CHECK_FINAL_TIME -special CallTrainerHillFunction -.endm + .macro battlepike_setroomobjects + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS + special CallBattlePikeFunction + .endm -.macro trainerhill_resumetimer -setvar VAR_0x8004, TRAINER_HILL_FUNC_RESUME_TIMER -special CallTrainerHillFunction -.endm - -.macro trainerhill_lost -setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_LOST -special CallTrainerHillFunction -.endm - -.macro trainerhill_getstatus -setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_STATUS -special CallTrainerHillFunction -.endm - -.macro trainerhill_gettime -setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_TIME -special CallTrainerHillFunction -.endm - -.macro trainerhill_allfloorsused -setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_ALL_FLOORS_USED -special CallTrainerHillFunction -.endm - -.macro trainerhill_clearresult -setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_RESULT -special CallTrainerHillFunction -.endm - -.macro trainerhill_inchallenge -setvar VAR_0x8004, TRAINER_HILL_FUNC_IN_CHALLENGE -special CallTrainerHillFunction -.endm - -.macro trainerhill_postbattletext -setvar VAR_0x8004, TRAINER_HILL_FUNC_POST_BATTLE_TEXT -special CallTrainerHillFunction -.endm - -.macro trainerhill_settrainerflags -setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_ALL_TRAINER_FLAGS -special CallTrainerHillFunction -.endm - -.macro trainerhill_getsaved -setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_GAME_SAVED -special CallTrainerHillFunction -.endm - -.macro trainerhill_setsaved -setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_GAME_SAVED -special CallTrainerHillFunction -.endm - -.macro trainerhill_clearsaved -setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_GAME_SAVED -special CallTrainerHillFunction -.endm - -.macro trainerhill_getwon -setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_WON -special CallTrainerHillFunction -.endm - -.macro trainerhill_settag tag:req -setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG -copyvar VAR_0x8005, \tag -special CallTrainerHillFunction -.endm - - -@ Apprentice - -.macro apprentice_gavelvlmode -setvar VAR_0x8004, APPRENTICE_FUNC_GAVE_LVLMODE -special CallApprenticeFunction -.endm - -.macro apprentice_setlvlmode lvlmode:req -setvar VAR_0x8004, APPRENTICE_FUNC_SET_LVLMODE -setorcopyvar VAR_0x8005, \lvlmode -addvar VAR_0x8005, 1 -special CallApprenticeFunction -.endm - -.macro apprentice_answeredquestion -setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION -special CallApprenticeFunction -.endm - -.macro apprentice_menu which:req -setvar VAR_0x8004, APPRENTICE_FUNC_MENU -setvar VAR_0x8005, \which -special CallApprenticeFunction -waitstate -.endm - -.macro apprentice_shufflespecies -setvar VAR_0x8004, APPRENTICE_FUNC_SHUFFLE_SPECIES -special CallApprenticeFunction -.endm - -.macro apprentice_randomizequestions -setvar VAR_0x8004, APPRENTICE_FUNC_RANDOMIZE_QUESTIONS -special CallApprenticeFunction -.endm - -.macro apprentice_msg waitbuttonpress:req, which:req -setvar VAR_0x8004, APPRENTICE_FUNC_PRINT_MSG -setvar VAR_0x8005, \waitbuttonpress -setvar VAR_0x8006, \which -special CallApprenticeFunction -waitstate -.endm - -.macro apprentice_reset -setvar VAR_0x8004, APPRENTICE_FUNC_RESET -special CallApprenticeFunction -.endm - -.macro apprentice_shouldcheckgone -setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE -special CallApprenticeFunction -.endm - -.macro apprentice_getquestion -setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION -special CallApprenticeFunction -.endm - -.macro apprentice_getnumpartymons -setvar VAR_0x8004, APPRENTICE_FUNC_GET_NUM_PARTY_MONS -special CallApprenticeFunction -.endm - -.macro apprentice_setpartymon slot:req -copyvar VAR_0x8006, \slot -setvar VAR_0x8004, APPRENTICE_FUNC_SET_PARTY_MON -special CallApprenticeFunction -.endm - -.macro apprentice_initquestion which:req -setvar VAR_0x8004, APPRENTICE_FUNC_INIT_QUESTION_DATA -setvar VAR_0x8005, \which -special CallApprenticeFunction -.endm - -.macro apprentice_freequestion -setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA -special CallApprenticeFunction -.endm - -.macro apprentice_buff whichstringvar:req, tobuff:req -setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING -setvar VAR_0x8005, \whichstringvar -.if \tobuff >= VARS_START -copyvar VAR_0x8006, \tobuff -.else -setvar VAR_0x8006, \tobuff -.endif -special CallApprenticeFunction -.endm - -.macro apprentice_setmove -setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE -special CallApprenticeFunction -.endm - -.macro apprentice_setleadmon monId:req -copyvar VAR_0x8005, \monId -setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON -special CallApprenticeFunction -.endm - -.macro apprentice_openbag -setvar VAR_0x8004, APPRENTICE_FUNC_OPEN_BAG -special CallApprenticeFunction -waitstate -.endm - -.macro apprentice_trysetitem -setvar VAR_0x8004, APPRENTICE_FUNC_TRY_SET_HELD_ITEM -special CallApprenticeFunction -.endm - -.macro apprentice_save -setvar VAR_0x8004, APPRENTICE_FUNC_SAVE -special CallApprenticeFunction -.endm - -.macro apprentice_setgfx -setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX -special CallApprenticeFunction -.endm - -.macro apprentice_shouldleave -setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE -special CallApprenticeFunction -.endm - -.macro apprentice_shiftsaved -setvar VAR_0x8004, APPRENTICE_FUNC_SHIFT_SAVED -special CallApprenticeFunction -.endm + .macro battlepike_getroomtype + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE + special CallBattlePikeFunction + .endm + + .macro battlepike_setnextroom + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE + special CallBattlePikeFunction + .endm + + .macro battlepike_gethint + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT + special CallBattlePikeFunction + .endm + + .macro battlepike_nohealing set:req + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEALING_ROOMS_DISABLED + setvar VAR_0x8005, \set + special CallBattlePikeFunction + .endm + + .macro battlepike_ispartyfullhealth + setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH + special CallBattlePikeFunction + .endm + + + @ Battle Pyramid + + + @ Battle Tent + + + @ Trainer Hill + + .macro trainerhill_start + setvar VAR_0x8004, TRAINER_HILL_FUNC_START + special CallTrainerHillFunction + .endm + + .macro trainerhill_getownerstate + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_OWNER_STATE + special CallTrainerHillFunction + .endm + + .macro trainerhill_giveprize + setvar VAR_0x8004, TRAINER_HILL_FUNC_GIVE_PRIZE + special CallTrainerHillFunction + .endm + + .macro trainerhill_finaltime + setvar VAR_0x8004, TRAINER_HILL_FUNC_CHECK_FINAL_TIME + special CallTrainerHillFunction + .endm + + .macro trainerhill_resumetimer + setvar VAR_0x8004, TRAINER_HILL_FUNC_RESUME_TIMER + special CallTrainerHillFunction + .endm + + .macro trainerhill_lost + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_LOST + special CallTrainerHillFunction + .endm + + .macro trainerhill_getstatus + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_STATUS + special CallTrainerHillFunction + .endm + + .macro trainerhill_gettime + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_TIME + special CallTrainerHillFunction + .endm + + .macro trainerhill_allfloorsused + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_ALL_FLOORS_USED + special CallTrainerHillFunction + .endm + + .macro trainerhill_clearresult + setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_RESULT + special CallTrainerHillFunction + .endm + + .macro trainerhill_inchallenge + setvar VAR_0x8004, TRAINER_HILL_FUNC_IN_CHALLENGE + special CallTrainerHillFunction + .endm + + .macro trainerhill_postbattletext + setvar VAR_0x8004, TRAINER_HILL_FUNC_POST_BATTLE_TEXT + special CallTrainerHillFunction + .endm + + .macro trainerhill_settrainerflags + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_ALL_TRAINER_FLAGS + special CallTrainerHillFunction + .endm + + .macro trainerhill_getsaved + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_GAME_SAVED + special CallTrainerHillFunction + .endm + + .macro trainerhill_setsaved + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_GAME_SAVED + special CallTrainerHillFunction + .endm + + .macro trainerhill_clearsaved + setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_GAME_SAVED + special CallTrainerHillFunction + .endm + + .macro trainerhill_getwon + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_WON + special CallTrainerHillFunction + .endm + + .macro trainerhill_settag tag:req + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG + copyvar VAR_0x8005, \tag + special CallTrainerHillFunction + .endm + + + @ Apprentice + + .macro apprentice_gavelvlmode + setvar VAR_0x8004, APPRENTICE_FUNC_GAVE_LVLMODE + special CallApprenticeFunction + .endm + + .macro apprentice_setlvlmode lvlmode:req + setvar VAR_0x8004, APPRENTICE_FUNC_SET_LVLMODE + setorcopyvar VAR_0x8005, \lvlmode + addvar VAR_0x8005, 1 + special CallApprenticeFunction + .endm + + .macro apprentice_answeredquestion + setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION + special CallApprenticeFunction + .endm + + .macro apprentice_menu which:req + setvar VAR_0x8004, APPRENTICE_FUNC_MENU + setvar VAR_0x8005, \which + special CallApprenticeFunction + waitstate + .endm + + .macro apprentice_shufflespecies + setvar VAR_0x8004, APPRENTICE_FUNC_SHUFFLE_SPECIES + special CallApprenticeFunction + .endm + + .macro apprentice_randomizequestions + setvar VAR_0x8004, APPRENTICE_FUNC_RANDOMIZE_QUESTIONS + special CallApprenticeFunction + .endm + + .macro apprentice_msg waitbuttonpress:req, which:req + setvar VAR_0x8004, APPRENTICE_FUNC_PRINT_MSG + setvar VAR_0x8005, \waitbuttonpress + setvar VAR_0x8006, \which + special CallApprenticeFunction + waitstate + .endm + + .macro apprentice_reset + setvar VAR_0x8004, APPRENTICE_FUNC_RESET + special CallApprenticeFunction + .endm + + .macro apprentice_shouldcheckgone + setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE + special CallApprenticeFunction + .endm + + .macro apprentice_getquestion + setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION + special CallApprenticeFunction + .endm + + .macro apprentice_getnumpartymons + setvar VAR_0x8004, APPRENTICE_FUNC_GET_NUM_PARTY_MONS + special CallApprenticeFunction + .endm + + .macro apprentice_setpartymon slot:req + copyvar VAR_0x8006, \slot + setvar VAR_0x8004, APPRENTICE_FUNC_SET_PARTY_MON + special CallApprenticeFunction + .endm + + .macro apprentice_initquestion which:req + setvar VAR_0x8004, APPRENTICE_FUNC_INIT_QUESTION_DATA + setvar VAR_0x8005, \which + special CallApprenticeFunction + .endm + + .macro apprentice_freequestion + setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA + special CallApprenticeFunction + .endm + + .macro apprentice_buff whichstringvar:req, tobuff:req + setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING + setvar VAR_0x8005, \whichstringvar + .if \tobuff >= VARS_START + copyvar VAR_0x8006, \tobuff + .else + setvar VAR_0x8006, \tobuff + .endif + special CallApprenticeFunction + .endm + + .macro apprentice_setmove + setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE + special CallApprenticeFunction + .endm + + .macro apprentice_setleadmon monId:req + copyvar VAR_0x8005, \monId + setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON + special CallApprenticeFunction + .endm + + .macro apprentice_openbag + setvar VAR_0x8004, APPRENTICE_FUNC_OPEN_BAG + special CallApprenticeFunction + waitstate + .endm + + .macro apprentice_trysetitem + setvar VAR_0x8004, APPRENTICE_FUNC_TRY_SET_HELD_ITEM + special CallApprenticeFunction + .endm + + .macro apprentice_save + setvar VAR_0x8004, APPRENTICE_FUNC_SAVE + special CallApprenticeFunction + .endm + + .macro apprentice_setgfx + setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX + special CallApprenticeFunction + .endm + + .macro apprentice_shouldleave + setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE + special CallApprenticeFunction + .endm + + .macro apprentice_shiftsaved + setvar VAR_0x8004, APPRENTICE_FUNC_SHIFT_SAVED + special CallApprenticeFunction + .endm -- cgit v1.2.3 From cc81b5032bfbc7e6bee63242b5c1db30d493bde6 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 25 Nov 2019 14:19:17 -0500 Subject: Split frontier macros and comment frontier_util.inc --- asm/macros/battle_frontier.inc | 452 -------------------------- asm/macros/battle_frontier/apprentice.inc | 133 ++++++++ asm/macros/battle_frontier/battle_arena.inc | 1 + asm/macros/battle_frontier/battle_dome.inc | 1 + asm/macros/battle_frontier/battle_factory.inc | 1 + asm/macros/battle_frontier/battle_palace.inc | 1 + asm/macros/battle_frontier/battle_pike.inc | 54 +++ asm/macros/battle_frontier/battle_pyramid.inc | 1 + asm/macros/battle_frontier/battle_tower.inc | 7 + asm/macros/battle_frontier/frontier_util.inc | 153 +++++++++ asm/macros/battle_tent.inc | 1 + asm/macros/trainer_hill.inc | 92 ++++++ 12 files changed, 445 insertions(+), 452 deletions(-) delete mode 100644 asm/macros/battle_frontier.inc create mode 100644 asm/macros/battle_frontier/apprentice.inc create mode 100644 asm/macros/battle_frontier/battle_arena.inc create mode 100644 asm/macros/battle_frontier/battle_dome.inc create mode 100644 asm/macros/battle_frontier/battle_factory.inc create mode 100644 asm/macros/battle_frontier/battle_palace.inc create mode 100644 asm/macros/battle_frontier/battle_pike.inc create mode 100644 asm/macros/battle_frontier/battle_pyramid.inc create mode 100644 asm/macros/battle_frontier/battle_tower.inc create mode 100644 asm/macros/battle_frontier/frontier_util.inc create mode 100644 asm/macros/battle_tent.inc create mode 100644 asm/macros/trainer_hill.inc (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc deleted file mode 100644 index ca06bc178..000000000 --- a/asm/macros/battle_frontier.inc +++ /dev/null @@ -1,452 +0,0 @@ - @ TODO: - @ Add macro comments - @ Split into individual files - @ Enforce tab spacing - @ Standardize Func->Function - - @ Frontier Util - - .macro frontier_getstatus - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_STATUS - special CallFrontierUtilFunc - .endm - - .macro frontier_get data:req - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA - setvar VAR_0x8005, \data - special CallFrontierUtilFunc - .endm - - .macro frontier_set data:req, val=0xFFFF - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA - setvar VAR_0x8005, \data - .if \val == 0xFFFF - @ no value provided - .elseif \val >= VARS_START - copyvar VAR_0x8006, \val - .else - setvar VAR_0x8006, \val - .endif - special CallFrontierUtilFunc - .endm - - .macro frontier_setpartyorder partySize:req - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_PARTY_ORDER - setvar VAR_0x8005, \partySize - special CallFrontierUtilFunc - .endm - - .macro frontier_reset - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SOFT_RESET - special CallFrontierUtilFunc - .endm - - .macro frontier_settrainers - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_TRAINERS - special CallFrontierUtilFunc - .endm - - .macro frontier_saveparty - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY - special CallFrontierUtilFunc - .endm - - @ Facilities with only 1 mode dont provide the mode argument - .macro frontier_results facility:req, mode=0xFF - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESULTS_WINDOW - setvar VAR_0x8005, \facility - .if \mode != 0xFF - setvar VAR_0x8006, \mode - .endif - special CallFrontierUtilFunc - .endm - - .macro frontier_checkairshow - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_AIR_TV_SHOW - special CallFrontierUtilFunc - .endm - - .macro frontier_getbrainstatus - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_BRAIN_STATUS - special CallFrontierUtilFunc - .endm - - .macro frontier_isbrain - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_IS_BRAIN - special CallFrontierUtilFunc - .endm - - .macro frontier_givepoints - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GIVE_BATTLE_POINTS - special CallFrontierUtilFunc - .endm - - .macro frontier_getsymbols - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_FACILITY_SYMBOLS - special CallFrontierUtilFunc - .endm - - .macro frontier_givesymbol - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GIVE_FACILITY_SYMBOL - special CallFrontierUtilFunc - .endm - - .macro frontier_isbattletype battleType:req - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_BATTLE_TYPE - setvar VAR_0x8005, \battleType - special CallFrontierUtilFunc - .endm - - .macro frontier_checkineligible - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_INELIGIBLE - special CallFrontierUtilFunc - .endm - - @ Validates the visiting E-Reader trainer. 0 if valid, 1 if not - .macro frontier_checkvisittrainer - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_VISIT_TRAINER - special CallFrontierUtilFunc - .endm - - .macro frontier_incrementstreak - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_INCREMENT_STREAK - special CallFrontierUtilFunc - .endm - - .macro frontier_restorehelditems - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESTORE_HELD_ITEMS - special CallFrontierUtilFunc - .endm - - .macro frontier_savebattle - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_BATTLE - special CallFrontierUtilFunc - .endm - - .macro frontier_gettrainername stringVar:req - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_BUFFER_TRAINER_NAME - setvar VAR_0x8005, \stringVar - special CallFrontierUtilFunc - .endm - - .macro frontier_resetsketch - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESET_SKETCH_MOVES - special CallFrontierUtilFunc - .endm - - .macro frontier_setbrainobj - setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_BRAIN_OBJECT - special CallFrontierUtilFunc - .endm - - - @ Battle Tower - - .macro battletower_getstreak - setvar VAR_0x8004, BATTLE_TOWER_FUNC_1 - setvar VAR_0x8005, 1 - special CallBattleTowerFunc - .endm - - - @ Battle Dome - - - @ Battle Palace - - - @ Battle Arena - - - @ Battle Factory - - - @ Battle Pike - - .macro battlepike_getstreak - setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_DATA - setvar VAR_0x8005, 1 - special CallBattlePikeFunction - .endm - - .macro battlepike_setstreak streak:req - setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_DATA - setvar VAR_0x8005, 1 - .if \streak >= VARS_START - copyvar VAR_0x8006, \streak - .else - setvar VAR_0x8006, \streak - .endif - special CallBattlePikeFunction - .endm - - .macro battlepike_isfinalroom - setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_FINAL_ROOM - special CallBattlePikeFunction - .endm - - .macro battlepike_setroomobjects - setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS - special CallBattlePikeFunction - .endm - - .macro battlepike_getroomtype - setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE - special CallBattlePikeFunction - .endm - - .macro battlepike_setnextroom - setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE - special CallBattlePikeFunction - .endm - - .macro battlepike_gethint - setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT - special CallBattlePikeFunction - .endm - - .macro battlepike_nohealing set:req - setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEALING_ROOMS_DISABLED - setvar VAR_0x8005, \set - special CallBattlePikeFunction - .endm - - .macro battlepike_ispartyfullhealth - setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH - special CallBattlePikeFunction - .endm - - - @ Battle Pyramid - - - @ Battle Tent - - - @ Trainer Hill - - .macro trainerhill_start - setvar VAR_0x8004, TRAINER_HILL_FUNC_START - special CallTrainerHillFunction - .endm - - .macro trainerhill_getownerstate - setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_OWNER_STATE - special CallTrainerHillFunction - .endm - - .macro trainerhill_giveprize - setvar VAR_0x8004, TRAINER_HILL_FUNC_GIVE_PRIZE - special CallTrainerHillFunction - .endm - - .macro trainerhill_finaltime - setvar VAR_0x8004, TRAINER_HILL_FUNC_CHECK_FINAL_TIME - special CallTrainerHillFunction - .endm - - .macro trainerhill_resumetimer - setvar VAR_0x8004, TRAINER_HILL_FUNC_RESUME_TIMER - special CallTrainerHillFunction - .endm - - .macro trainerhill_lost - setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_LOST - special CallTrainerHillFunction - .endm - - .macro trainerhill_getstatus - setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_STATUS - special CallTrainerHillFunction - .endm - - .macro trainerhill_gettime - setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_TIME - special CallTrainerHillFunction - .endm - - .macro trainerhill_allfloorsused - setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_ALL_FLOORS_USED - special CallTrainerHillFunction - .endm - - .macro trainerhill_clearresult - setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_RESULT - special CallTrainerHillFunction - .endm - - .macro trainerhill_inchallenge - setvar VAR_0x8004, TRAINER_HILL_FUNC_IN_CHALLENGE - special CallTrainerHillFunction - .endm - - .macro trainerhill_postbattletext - setvar VAR_0x8004, TRAINER_HILL_FUNC_POST_BATTLE_TEXT - special CallTrainerHillFunction - .endm - - .macro trainerhill_settrainerflags - setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_ALL_TRAINER_FLAGS - special CallTrainerHillFunction - .endm - - .macro trainerhill_getsaved - setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_GAME_SAVED - special CallTrainerHillFunction - .endm - - .macro trainerhill_setsaved - setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_GAME_SAVED - special CallTrainerHillFunction - .endm - - .macro trainerhill_clearsaved - setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_GAME_SAVED - special CallTrainerHillFunction - .endm - - .macro trainerhill_getwon - setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_WON - special CallTrainerHillFunction - .endm - - .macro trainerhill_settag tag:req - setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG - copyvar VAR_0x8005, \tag - special CallTrainerHillFunction - .endm - - - @ Apprentice - - .macro apprentice_gavelvlmode - setvar VAR_0x8004, APPRENTICE_FUNC_GAVE_LVLMODE - special CallApprenticeFunction - .endm - - .macro apprentice_setlvlmode lvlmode:req - setvar VAR_0x8004, APPRENTICE_FUNC_SET_LVLMODE - setorcopyvar VAR_0x8005, \lvlmode - addvar VAR_0x8005, 1 - special CallApprenticeFunction - .endm - - .macro apprentice_answeredquestion - setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION - special CallApprenticeFunction - .endm - - .macro apprentice_menu which:req - setvar VAR_0x8004, APPRENTICE_FUNC_MENU - setvar VAR_0x8005, \which - special CallApprenticeFunction - waitstate - .endm - - .macro apprentice_shufflespecies - setvar VAR_0x8004, APPRENTICE_FUNC_SHUFFLE_SPECIES - special CallApprenticeFunction - .endm - - .macro apprentice_randomizequestions - setvar VAR_0x8004, APPRENTICE_FUNC_RANDOMIZE_QUESTIONS - special CallApprenticeFunction - .endm - - .macro apprentice_msg waitbuttonpress:req, which:req - setvar VAR_0x8004, APPRENTICE_FUNC_PRINT_MSG - setvar VAR_0x8005, \waitbuttonpress - setvar VAR_0x8006, \which - special CallApprenticeFunction - waitstate - .endm - - .macro apprentice_reset - setvar VAR_0x8004, APPRENTICE_FUNC_RESET - special CallApprenticeFunction - .endm - - .macro apprentice_shouldcheckgone - setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE - special CallApprenticeFunction - .endm - - .macro apprentice_getquestion - setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION - special CallApprenticeFunction - .endm - - .macro apprentice_getnumpartymons - setvar VAR_0x8004, APPRENTICE_FUNC_GET_NUM_PARTY_MONS - special CallApprenticeFunction - .endm - - .macro apprentice_setpartymon slot:req - copyvar VAR_0x8006, \slot - setvar VAR_0x8004, APPRENTICE_FUNC_SET_PARTY_MON - special CallApprenticeFunction - .endm - - .macro apprentice_initquestion which:req - setvar VAR_0x8004, APPRENTICE_FUNC_INIT_QUESTION_DATA - setvar VAR_0x8005, \which - special CallApprenticeFunction - .endm - - .macro apprentice_freequestion - setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA - special CallApprenticeFunction - .endm - - .macro apprentice_buff whichstringvar:req, tobuff:req - setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING - setvar VAR_0x8005, \whichstringvar - .if \tobuff >= VARS_START - copyvar VAR_0x8006, \tobuff - .else - setvar VAR_0x8006, \tobuff - .endif - special CallApprenticeFunction - .endm - - .macro apprentice_setmove - setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE - special CallApprenticeFunction - .endm - - .macro apprentice_setleadmon monId:req - copyvar VAR_0x8005, \monId - setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON - special CallApprenticeFunction - .endm - - .macro apprentice_openbag - setvar VAR_0x8004, APPRENTICE_FUNC_OPEN_BAG - special CallApprenticeFunction - waitstate - .endm - - .macro apprentice_trysetitem - setvar VAR_0x8004, APPRENTICE_FUNC_TRY_SET_HELD_ITEM - special CallApprenticeFunction - .endm - - .macro apprentice_save - setvar VAR_0x8004, APPRENTICE_FUNC_SAVE - special CallApprenticeFunction - .endm - - .macro apprentice_setgfx - setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX - special CallApprenticeFunction - .endm - - .macro apprentice_shouldleave - setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE - special CallApprenticeFunction - .endm - - .macro apprentice_shiftsaved - setvar VAR_0x8004, APPRENTICE_FUNC_SHIFT_SAVED - special CallApprenticeFunction - .endm diff --git a/asm/macros/battle_frontier/apprentice.inc b/asm/macros/battle_frontier/apprentice.inc new file mode 100644 index 000000000..e9b098a18 --- /dev/null +++ b/asm/macros/battle_frontier/apprentice.inc @@ -0,0 +1,133 @@ +@ TODO: These need to have description comment + + .macro apprentice_gavelvlmode + setvar VAR_0x8004, APPRENTICE_FUNC_GAVE_LVLMODE + special CallApprenticeFunction + .endm + + .macro apprentice_setlvlmode lvlmode:req + setvar VAR_0x8004, APPRENTICE_FUNC_SET_LVLMODE + setorcopyvar VAR_0x8005, \lvlmode + addvar VAR_0x8005, 1 + special CallApprenticeFunction + .endm + + .macro apprentice_answeredquestion + setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION + special CallApprenticeFunction + .endm + + .macro apprentice_menu which:req + setvar VAR_0x8004, APPRENTICE_FUNC_MENU + setvar VAR_0x8005, \which + special CallApprenticeFunction + waitstate + .endm + + .macro apprentice_shufflespecies + setvar VAR_0x8004, APPRENTICE_FUNC_SHUFFLE_SPECIES + special CallApprenticeFunction + .endm + + .macro apprentice_randomizequestions + setvar VAR_0x8004, APPRENTICE_FUNC_RANDOMIZE_QUESTIONS + special CallApprenticeFunction + .endm + + .macro apprentice_msg waitbuttonpress:req, which:req + setvar VAR_0x8004, APPRENTICE_FUNC_PRINT_MSG + setvar VAR_0x8005, \waitbuttonpress + setvar VAR_0x8006, \which + special CallApprenticeFunction + waitstate + .endm + + .macro apprentice_reset + setvar VAR_0x8004, APPRENTICE_FUNC_RESET + special CallApprenticeFunction + .endm + + .macro apprentice_shouldcheckgone + setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE + special CallApprenticeFunction + .endm + + .macro apprentice_getquestion + setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION + special CallApprenticeFunction + .endm + + .macro apprentice_getnumpartymons + setvar VAR_0x8004, APPRENTICE_FUNC_GET_NUM_PARTY_MONS + special CallApprenticeFunction + .endm + + .macro apprentice_setpartymon slot:req + copyvar VAR_0x8006, \slot + setvar VAR_0x8004, APPRENTICE_FUNC_SET_PARTY_MON + special CallApprenticeFunction + .endm + + .macro apprentice_initquestion which:req + setvar VAR_0x8004, APPRENTICE_FUNC_INIT_QUESTION_DATA + setvar VAR_0x8005, \which + special CallApprenticeFunction + .endm + + .macro apprentice_freequestion + setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA + special CallApprenticeFunction + .endm + + .macro apprentice_buff whichstringvar:req, tobuff:req + setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING + setvar VAR_0x8005, \whichstringvar + .if \tobuff >= VARS_START + copyvar VAR_0x8006, \tobuff + .else + setvar VAR_0x8006, \tobuff + .endif + special CallApprenticeFunction + .endm + + .macro apprentice_setmove + setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE + special CallApprenticeFunction + .endm + + .macro apprentice_setleadmon monId:req + copyvar VAR_0x8005, \monId + setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON + special CallApprenticeFunction + .endm + + .macro apprentice_openbag + setvar VAR_0x8004, APPRENTICE_FUNC_OPEN_BAG + special CallApprenticeFunction + waitstate + .endm + + .macro apprentice_trysetitem + setvar VAR_0x8004, APPRENTICE_FUNC_TRY_SET_HELD_ITEM + special CallApprenticeFunction + .endm + + .macro apprentice_save + setvar VAR_0x8004, APPRENTICE_FUNC_SAVE + special CallApprenticeFunction + .endm + + .macro apprentice_setgfx + setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX + special CallApprenticeFunction + .endm + + .macro apprentice_shouldleave + setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE + special CallApprenticeFunction + .endm + + .macro apprentice_shiftsaved + setvar VAR_0x8004, APPRENTICE_FUNC_SHIFT_SAVED + special CallApprenticeFunction + .endm diff --git a/asm/macros/battle_frontier/battle_arena.inc b/asm/macros/battle_frontier/battle_arena.inc new file mode 100644 index 000000000..c7294145f --- /dev/null +++ b/asm/macros/battle_frontier/battle_arena.inc @@ -0,0 +1 @@ +@ To be populated with macros for CallBattleArenaFunction diff --git a/asm/macros/battle_frontier/battle_dome.inc b/asm/macros/battle_frontier/battle_dome.inc new file mode 100644 index 000000000..12672ea37 --- /dev/null +++ b/asm/macros/battle_frontier/battle_dome.inc @@ -0,0 +1 @@ +@ To be populated with macros for CallBattleDomeFunction diff --git a/asm/macros/battle_frontier/battle_factory.inc b/asm/macros/battle_frontier/battle_factory.inc new file mode 100644 index 000000000..9a8879df8 --- /dev/null +++ b/asm/macros/battle_frontier/battle_factory.inc @@ -0,0 +1 @@ +@ To be populated with macros for CallBattleFactoryFunction diff --git a/asm/macros/battle_frontier/battle_palace.inc b/asm/macros/battle_frontier/battle_palace.inc new file mode 100644 index 000000000..e9a61c952 --- /dev/null +++ b/asm/macros/battle_frontier/battle_palace.inc @@ -0,0 +1 @@ +@ To be populated with macros for CallBattlePalaceFunction diff --git a/asm/macros/battle_frontier/battle_pike.inc b/asm/macros/battle_frontier/battle_pike.inc new file mode 100644 index 000000000..0f2d2627d --- /dev/null +++ b/asm/macros/battle_frontier/battle_pike.inc @@ -0,0 +1,54 @@ +@ To be populated with macros for CallBattlePikeFunction + + .macro battlepike_getstreak + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_DATA + setvar VAR_0x8005, 1 + special CallBattlePikeFunction + .endm + + .macro battlepike_setstreak streak:req + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_DATA + setvar VAR_0x8005, 1 + .if \streak >= VARS_START + copyvar VAR_0x8006, \streak + .else + setvar VAR_0x8006, \streak + .endif + special CallBattlePikeFunction + .endm + + .macro battlepike_isfinalroom + setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_FINAL_ROOM + special CallBattlePikeFunction + .endm + + .macro battlepike_setroomobjects + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS + special CallBattlePikeFunction + .endm + + .macro battlepike_getroomtype + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE + special CallBattlePikeFunction + .endm + + .macro battlepike_setnextroom + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE + special CallBattlePikeFunction + .endm + + .macro battlepike_gethint + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT + special CallBattlePikeFunction + .endm + + .macro battlepike_nohealing set:req + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEALING_ROOMS_DISABLED + setvar VAR_0x8005, \set + special CallBattlePikeFunction + .endm + + .macro battlepike_ispartyfullhealth + setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH + special CallBattlePikeFunction + .endm diff --git a/asm/macros/battle_frontier/battle_pyramid.inc b/asm/macros/battle_frontier/battle_pyramid.inc new file mode 100644 index 000000000..e23a819c0 --- /dev/null +++ b/asm/macros/battle_frontier/battle_pyramid.inc @@ -0,0 +1 @@ +@ To be populated with macros for CallBattlePyramidFunction diff --git a/asm/macros/battle_frontier/battle_tower.inc b/asm/macros/battle_frontier/battle_tower.inc new file mode 100644 index 000000000..e9f8c9293 --- /dev/null +++ b/asm/macros/battle_frontier/battle_tower.inc @@ -0,0 +1,7 @@ +@ To be populated with macros for CallBattleTowerFunc + + .macro battletower_getstreak + setvar VAR_0x8004, BATTLE_TOWER_FUNC_1 + setvar VAR_0x8005, 1 + special CallBattleTowerFunc + .endm diff --git a/asm/macros/battle_frontier/frontier_util.inc b/asm/macros/battle_frontier/frontier_util.inc new file mode 100644 index 000000000..def5b4d1c --- /dev/null +++ b/asm/macros/battle_frontier/frontier_util.inc @@ -0,0 +1,153 @@ + @ Get the status (CHALLENGE_STATUS_*) of the current challenge and store the result in VAR_TEMP_0 + .macro frontier_getstatus + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_STATUS + special CallFrontierUtilFunc + .endm + + @ Get the value of some FRONTIER_DATA_*. See GetFrontierData for the data types that can be retrieved + .macro frontier_get data:req + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallFrontierUtilFunc + .endm + + @ Set the value of some FRONTIER_DATA_*. Some data types do not need a val argument because the value is set directly from somewhere else. See SetFrontierData for the data types that can be set + .macro frontier_set data:req, val=0xFFFF + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA + setvar VAR_0x8005, \data + .if \val == 0xFFFF + @ no value provided + .elseif \val >= VARS_START + copyvar VAR_0x8006, \val + .else + setvar VAR_0x8006, \val + .endif + special CallFrontierUtilFunc + .endm + + @ Load the selected mons into gSelectedOrderFromParty and reduce the players party to these mons + .macro frontier_setpartyorder partySize:req + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_PARTY_ORDER + setvar VAR_0x8005, \partySize + special CallFrontierUtilFunc + .endm + + @ Performs a soft reset + .macro frontier_reset + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SOFT_RESET + special CallFrontierUtilFunc + .endm + + @ Loads gBattleFrontierTrainers into gFacilityTrainers + .macro frontier_settrainers + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_TRAINERS + special CallFrontierUtilFunc + .endm + + @ Sets the selected party mons in the saveblock + .macro frontier_saveparty + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY + special CallFrontierUtilFunc + .endm + + @ Shows the results window for the given facility and mode. Facilities with only 1 mode dont provide the mode argument + .macro frontier_results facility:req, mode=0xFF + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESULTS_WINDOW + setvar VAR_0x8005, \facility + .if \mode != 0xFF + setvar VAR_0x8006, \mode + .endif + special CallFrontierUtilFunc + .endm + + @ Checks if the Battle Frontier TV special should air, and if so attempts to set it up + .macro frontier_checkairshow + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_AIR_TV_SHOW + special CallFrontierUtilFunc + .endm + + @ Get the status of the Frontier Brain (Not ready, Silver/Gold streak before symbols, Silver/Gold streak after symbols) + .macro frontier_getbrainstatus + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_BRAIN_STATUS + special CallFrontierUtilFunc + .endm + + @ TRUE if the opponent is a Frontier Brain, FALSE otherwise + .macro frontier_isbrain + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_IS_BRAIN + special CallFrontierUtilFunc + .endm + + @ Awards battle points depending on the current challenge + .macro frontier_givepoints + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GIVE_BATTLE_POINTS + special CallFrontierUtilFunc + .endm + + @ Returns 0-2 for the number of facility symbols the player has + .macro frontier_getsymbols + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_FACILITY_SYMBOLS + special CallFrontierUtilFunc + .endm + + @ Awards a frontier symbol depending on the current challenge + .macro frontier_givesymbol + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GIVE_FACILITY_SYMBOL + special CallFrontierUtilFunc + .endm + + @ TRUE if the given battleType is set in gBattleTypeFlags, FALSE otherwise + .macro frontier_isbattletype battleType:req + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_BATTLE_TYPE + setvar VAR_0x8005, \battleType + special CallFrontierUtilFunc + .endm + + @ TRUE if there are insufficient eligible party mons to participate in the challenge, and buffers caught ineligible species to STR_VAR_1. FALSE otherwise. The return value is stored in VAR_0x8004 instead, and the current level mode is expected to be in VAR_RESULT + .macro frontier_checkineligible + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_INELIGIBLE + special CallFrontierUtilFunc + .endm + + @ Validates the visiting E-Reader trainer. 0 if valid, 1 if not + .macro frontier_checkvisittrainer + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_VISIT_TRAINER + special CallFrontierUtilFunc + .endm + + @ Increments the current win streak by 1 + .macro frontier_incrementstreak + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_INCREMENT_STREAK + special CallFrontierUtilFunc + .endm + + @ Resets the party held items to what they were upon entering the challenge + .macro frontier_restorehelditems + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESTORE_HELD_ITEMS + special CallFrontierUtilFunc + .endm + + @ Move the recorded battle to save data + .macro frontier_savebattle + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_BATTLE + special CallFrontierUtilFunc + .endm + + @ Buffer the name of gTrainerBattleOpponent_A in STR_VAR_1 (0) or STR_VAR_2 (1) + .macro frontier_gettrainername stringVar:req + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_BUFFER_TRAINER_NAME + setvar VAR_0x8005, \stringVar + special CallFrontierUtilFunc + .endm + + @ If any moves were copied using Sketch during the challenge then restore them to Sketch + .macro frontier_resetsketch + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESET_SKETCH_MOVES + special CallFrontierUtilFunc + .endm + + @ Set the object event gfx of the Frontier Brain for the current facility + .macro frontier_setbrainobj + setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_BRAIN_OBJECT + special CallFrontierUtilFunc + .endm diff --git a/asm/macros/battle_tent.inc b/asm/macros/battle_tent.inc new file mode 100644 index 000000000..9a304475b --- /dev/null +++ b/asm/macros/battle_tent.inc @@ -0,0 +1 @@ +@ To be populated with macros for CallVerdanturfTentFunction, CallFallarborTentFunction, and CallSlateportTentFunction diff --git a/asm/macros/trainer_hill.inc b/asm/macros/trainer_hill.inc new file mode 100644 index 000000000..7ea1c77f6 --- /dev/null +++ b/asm/macros/trainer_hill.inc @@ -0,0 +1,92 @@ +@ TODO: These need to have description comment + + .macro trainerhill_start + setvar VAR_0x8004, TRAINER_HILL_FUNC_START + special CallTrainerHillFunction + .endm + + .macro trainerhill_getownerstate + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_OWNER_STATE + special CallTrainerHillFunction + .endm + + .macro trainerhill_giveprize + setvar VAR_0x8004, TRAINER_HILL_FUNC_GIVE_PRIZE + special CallTrainerHillFunction + .endm + + .macro trainerhill_finaltime + setvar VAR_0x8004, TRAINER_HILL_FUNC_CHECK_FINAL_TIME + special CallTrainerHillFunction + .endm + + .macro trainerhill_resumetimer + setvar VAR_0x8004, TRAINER_HILL_FUNC_RESUME_TIMER + special CallTrainerHillFunction + .endm + + .macro trainerhill_lost + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_LOST + special CallTrainerHillFunction + .endm + + .macro trainerhill_getstatus + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_STATUS + special CallTrainerHillFunction + .endm + + .macro trainerhill_gettime + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_TIME + special CallTrainerHillFunction + .endm + + .macro trainerhill_allfloorsused + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_ALL_FLOORS_USED + special CallTrainerHillFunction + .endm + + .macro trainerhill_clearresult + setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_RESULT + special CallTrainerHillFunction + .endm + + .macro trainerhill_inchallenge + setvar VAR_0x8004, TRAINER_HILL_FUNC_IN_CHALLENGE + special CallTrainerHillFunction + .endm + + .macro trainerhill_postbattletext + setvar VAR_0x8004, TRAINER_HILL_FUNC_POST_BATTLE_TEXT + special CallTrainerHillFunction + .endm + + .macro trainerhill_settrainerflags + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_ALL_TRAINER_FLAGS + special CallTrainerHillFunction + .endm + + .macro trainerhill_getsaved + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_GAME_SAVED + special CallTrainerHillFunction + .endm + + .macro trainerhill_setsaved + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_GAME_SAVED + special CallTrainerHillFunction + .endm + + .macro trainerhill_clearsaved + setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_GAME_SAVED + special CallTrainerHillFunction + .endm + + .macro trainerhill_getwon + setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_WON + special CallTrainerHillFunction + .endm + + .macro trainerhill_settag tag:req + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG + copyvar VAR_0x8005, \tag + special CallTrainerHillFunction + .endm -- cgit v1.2.3 From 8d870d94c9f45f48419b979f7bf1c43928078eff Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 26 Nov 2019 17:20:08 -0500 Subject: Document Battle Arena scripts --- asm/macros/battle_frontier/battle_arena.inc | 46 ++++++++++++++++++++++++++++ asm/macros/battle_frontier/battle_palace.inc | 6 ++++ 2 files changed, 52 insertions(+) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_arena.inc b/asm/macros/battle_frontier/battle_arena.inc index c7294145f..b54ab3c25 100644 --- a/asm/macros/battle_frontier/battle_arena.inc +++ b/asm/macros/battle_frontier/battle_arena.inc @@ -1 +1,47 @@ @ To be populated with macros for CallBattleArenaFunction + + @ Initialize the Battle Arena challenge + .macro arena_init + setvar VAR_0x8004, BATTLE_ARENA_FUNC_INIT + special CallBattleArenaFunction + .endm + + @ Unused. Get the value of some ARENA_DATA_*. See GetArenaData for the data types that can be retrieved + .macro arena_get data:req + setvar VAR_0x8004, BATTLE_ARENA_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattleArenaFunction + .endm + + @ Set some ARENA_DATA_* to val. See SetArenaData for the data types that can be set + .macro arena_set data:req, val:req + setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_DATA + setvar VAR_0x8005, \data + setvar VAR_0x8006, \val + special CallBattleArenaFunction + .endm + + @ Save the game and set the challenge status + .macro arena_save challengeStatus:req + setvar VAR_0x8004, BATTLE_ARENA_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattleArenaFunction + .endm + + @ Unused. Set the reward item to give from one of two lists of possible awards, depending on streak. + .macro arena_setreward + setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_REWARD + special CallBattleArenaFunction + .endm + + @ Unused. Give the set award item to the player. TRUE if room in Bag for award, FALSE otherwise + .macro arena_givereward + setvar VAR_0x8004, BATTLE_ARENA_FUNC_GIVE_REWARD + special CallBattleArenaFunction + .endm + + @ Buffer the opponents name to STR_VAR_1 + .macro arena_gettrainername + setvar VAR_0x8004, BATTLE_ARENA_FUNC_GET_TRAINER_NAME + special CallBattleArenaFunction + .endm diff --git a/asm/macros/battle_frontier/battle_palace.inc b/asm/macros/battle_frontier/battle_palace.inc index e9a61c952..2b59fd734 100644 --- a/asm/macros/battle_frontier/battle_palace.inc +++ b/asm/macros/battle_frontier/battle_palace.inc @@ -1 +1,7 @@ @ To be populated with macros for CallBattlePalaceFunction + + @ Buffer the opponents intro speech to gStringVar4. Also used by Battle Arena and Factory + .macro palace_getopponentintro + setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO + special CallBattlePalaceFunction + .endm -- cgit v1.2.3 From 70d1f54ab96235b0e0d07d40526f16449e7cb1e7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 26 Nov 2019 17:25:29 -0500 Subject: Remove TODO comment for battle arena macros --- asm/macros/battle_frontier/battle_arena.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_arena.inc b/asm/macros/battle_frontier/battle_arena.inc index b54ab3c25..1c32de981 100644 --- a/asm/macros/battle_frontier/battle_arena.inc +++ b/asm/macros/battle_frontier/battle_arena.inc @@ -1,6 +1,4 @@ -@ To be populated with macros for CallBattleArenaFunction - - @ Initialize the Battle Arena challenge + @ Initialize the Battle Arena challenge .macro arena_init setvar VAR_0x8004, BATTLE_ARENA_FUNC_INIT special CallBattleArenaFunction -- cgit v1.2.3 From be17c1602d31d6f7d6601f27f2808b79a5644f7f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 28 Nov 2019 21:09:35 -0500 Subject: Set up remaining facility script doc, use Palace macros --- asm/macros/battle_frontier/battle_arena.inc | 78 ++++++++++++++-------------- asm/macros/battle_frontier/battle_palace.inc | 58 ++++++++++++++++++++- asm/macros/battle_frontier/battle_tower.inc | 2 +- 3 files changed, 97 insertions(+), 41 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_arena.inc b/asm/macros/battle_frontier/battle_arena.inc index 1c32de981..5539ffc59 100644 --- a/asm/macros/battle_frontier/battle_arena.inc +++ b/asm/macros/battle_frontier/battle_arena.inc @@ -1,45 +1,45 @@ - @ Initialize the Battle Arena challenge - .macro arena_init - setvar VAR_0x8004, BATTLE_ARENA_FUNC_INIT - special CallBattleArenaFunction - .endm + @ Initialize the Battle Arena challenge + .macro arena_init + setvar VAR_0x8004, BATTLE_ARENA_FUNC_INIT + special CallBattleArenaFunction + .endm - @ Unused. Get the value of some ARENA_DATA_*. See GetArenaData for the data types that can be retrieved - .macro arena_get data:req - setvar VAR_0x8004, BATTLE_ARENA_FUNC_GET_DATA - setvar VAR_0x8005, \data - special CallBattleArenaFunction - .endm + @ Unused. Get the value of some ARENA_DATA_*. See GetArenaData for the data types that can be retrieved + .macro arena_get data:req + setvar VAR_0x8004, BATTLE_ARENA_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattleArenaFunction + .endm - @ Set some ARENA_DATA_* to val. See SetArenaData for the data types that can be set - .macro arena_set data:req, val:req - setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_DATA - setvar VAR_0x8005, \data - setvar VAR_0x8006, \val - special CallBattleArenaFunction - .endm + @ Set some ARENA_DATA_* to val. See SetArenaData for the data types that can be set + .macro arena_set data:req, val:req + setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_DATA + setvar VAR_0x8005, \data + setvar VAR_0x8006, \val + special CallBattleArenaFunction + .endm - @ Save the game and set the challenge status - .macro arena_save challengeStatus:req - setvar VAR_0x8004, BATTLE_ARENA_FUNC_SAVE - setvar VAR_0x8005, \challengeStatus - special CallBattleArenaFunction - .endm + @ Save the game and set the challenge status + .macro arena_save challengeStatus:req + setvar VAR_0x8004, BATTLE_ARENA_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattleArenaFunction + .endm - @ Unused. Set the reward item to give from one of two lists of possible awards, depending on streak. - .macro arena_setreward - setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_REWARD - special CallBattleArenaFunction - .endm + @ Unused. Set the prize item to give from one of two lists of possible prizes, depending on streak. + .macro arena_setprize + setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_PRIZE + special CallBattleArenaFunction + .endm - @ Unused. Give the set award item to the player. TRUE if room in Bag for award, FALSE otherwise - .macro arena_givereward - setvar VAR_0x8004, BATTLE_ARENA_FUNC_GIVE_REWARD - special CallBattleArenaFunction - .endm + @ Unused. Give the set prize item to the player. TRUE if room in Bag for prize, FALSE otherwise + .macro arena_giveprize + setvar VAR_0x8004, BATTLE_ARENA_FUNC_GIVE_PRIZE + special CallBattleArenaFunction + .endm - @ Buffer the opponents name to STR_VAR_1 - .macro arena_gettrainername - setvar VAR_0x8004, BATTLE_ARENA_FUNC_GET_TRAINER_NAME - special CallBattleArenaFunction - .endm + @ Buffer the opponents name to STR_VAR_1 + .macro arena_gettrainername + setvar VAR_0x8004, BATTLE_ARENA_FUNC_GET_TRAINER_NAME + special CallBattleArenaFunction + .endm diff --git a/asm/macros/battle_frontier/battle_palace.inc b/asm/macros/battle_frontier/battle_palace.inc index 2b59fd734..c7fc6ded2 100644 --- a/asm/macros/battle_frontier/battle_palace.inc +++ b/asm/macros/battle_frontier/battle_palace.inc @@ -1,7 +1,63 @@ -@ To be populated with macros for CallBattlePalaceFunction + @ Initialize the Battle Palace challenge + .macro palace_init + setvar VAR_0x8004, BATTLE_PALACE_FUNC_INIT + special CallBattlePalaceFunction + .endm + + @ Get the value of some PALACE_DATA_*. See GetPalaceData for the data types that can be retrieved + .macro palace_get data:req + setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattlePalaceFunction + .endm + + @ Set some PALACE_DATA_* to val. See SetPalaceData for the data types that can be set + .macro palace_set data:req, val:req + setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_DATA + setvar VAR_0x8005, \data + setvar VAR_0x8006, \val + special CallBattlePalaceFunction + .endm + + @ Get the id of the comment to be made while being led through the corridor + .macro palace_getcomment + setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_COMMENT_ID + special CallBattlePalaceFunction + .endm + + @ Unused. Choose and set the opponent gfx id. The equivalent macro from Battle Tower is used instead + .macro palace_setopponent + setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_OPPONENT + special CallBattlePalaceFunction + .endm @ Buffer the opponents intro speech to gStringVar4. Also used by Battle Arena and Factory .macro palace_getopponentintro setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO special CallBattlePalaceFunction .endm + + @ Increments the current win streak by 1 + .macro palace_incrementstreak + setvar VAR_0x8004, BATTLE_PALACE_FUNC_INCREMENT_STREAK + special CallBattlePalaceFunction + .endm + + @ Save the game and set the challenge status + .macro palace_save challengeStatus:req + setvar VAR_0x8004, BATTLE_PALACE_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattlePalaceFunction + .endm + + @ Unused. Set the prize item to give from one of two lists of possible prizes, depending on streak. + .macro palace_setprize + setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_PRIZE + special CallBattleArenaFunction + .endm + + @ Unused. Give the set prize item to the player. TRUE if room in Bag for prize, FALSE otherwise + .macro palace_giveprize + setvar VAR_0x8004, BATTLE_PALACE_FUNC_GIVE_PRIZE + special CallBattleArenaFunction + .endm diff --git a/asm/macros/battle_frontier/battle_tower.inc b/asm/macros/battle_frontier/battle_tower.inc index e9f8c9293..3a42438bb 100644 --- a/asm/macros/battle_frontier/battle_tower.inc +++ b/asm/macros/battle_frontier/battle_tower.inc @@ -1,7 +1,7 @@ @ To be populated with macros for CallBattleTowerFunc .macro battletower_getstreak - setvar VAR_0x8004, BATTLE_TOWER_FUNC_1 + setvar VAR_0x8004, BATTLE_TOWER_FUNC_GET_DATA setvar VAR_0x8005, 1 special CallBattleTowerFunc .endm -- cgit v1.2.3 From 9b3d1cfab61fff89cae64c093f28775fdbad1027 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 28 Nov 2019 22:46:39 -0500 Subject: Set up Battle Dome and Tower macros --- asm/macros/battle_frontier/battle_arena.inc | 4 + asm/macros/battle_frontier/battle_dome.inc | 141 +++++++++++++++++++++++++++- asm/macros/battle_frontier/battle_tower.inc | 61 +++++++++++- 3 files changed, 202 insertions(+), 4 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_arena.inc b/asm/macros/battle_frontier/battle_arena.inc index 5539ffc59..cd7e0aa1d 100644 --- a/asm/macros/battle_frontier/battle_arena.inc +++ b/asm/macros/battle_frontier/battle_arena.inc @@ -15,7 +15,11 @@ .macro arena_set data:req, val:req setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_DATA setvar VAR_0x8005, \data + .if \val >= VARS_START + copyvar VAR_0x8006, \val + .else setvar VAR_0x8006, \val + .endif special CallBattleArenaFunction .endm diff --git a/asm/macros/battle_frontier/battle_dome.inc b/asm/macros/battle_frontier/battle_dome.inc index 12672ea37..128470422 100644 --- a/asm/macros/battle_frontier/battle_dome.inc +++ b/asm/macros/battle_frontier/battle_dome.inc @@ -1 +1,140 @@ -@ To be populated with macros for CallBattleDomeFunction +@ TODO: Add explanatory comments to macros + + @ Initialize the Battle Dome challenge + .macro dome_init + setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT + special CallBattleDomeFunction + .endm + + @ Get the value of some DOME_DATA_*. See GetDomeData for the data types that can be retrieved + .macro dome_get data:req + setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattleDomeFunction + .endm + + @ Set some DOME_DATA_* to val. See SetDomeData for the data types that can be set + .macro dome_set data:req, val=0xFFFF + setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_DATA + setvar VAR_0x8005, \data + .if \val != 0xFFFF + setvar VAR_0x8006, \val + .endif + special CallBattleDomeFunction + .endm + + @ + .macro dome_getroundtext + setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_ROUND_TEXT + special CallBattleDomeFunction + .endm + + @ + .macro dome_getopponentname + setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_OPPONENT_NAME + special CallBattleDomeFunction + .endm + + @ + .macro dome_initopponentparty + setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_OPPONENT_PARTY + special CallBattleDomeFunction + .endm + + @ + .macro dome_showopponentinfo + setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_OPPONENT_INFO + special CallBattleDomeFunction + .endm + + @ + .macro dome_showtourneytree + setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_TOURNEY_TREE + special CallBattleDomeFunction + .endm + + @ + .macro dome_showresultstree + setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_PREV_RESULTS_TREE + special CallBattleDomeFunction + .endm + + @ + .macro dome_setopponent + setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_OPPONENT_ID + special CallBattleDomeFunction + .endm + + @ + .macro dome_setopponentgfx + setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_OPPONENT_GFX + special CallBattleDomeFunction + .endm + + @ + .macro dome_showstatictourneytree + setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_STATIC_TOURNEY_TREE + special CallBattleDomeFunction + .endm + + @ + .macro dome_resolvewinners arg:req + setvar VAR_0x8004, BATTLE_DOME_FUNC_RESOLVE_WINNERS + setvar VAR_0x8005, \arg + special CallBattleDomeFunction + .endm + + @ Save the game and set the challenge status + .macro dome_save challengeStatus:req + setvar VAR_0x8004, BATTLE_DOME_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattleDomeFunction + .endm + + @ Unused. Increment the win streaks for the current challenge by one + .macro dome_incrementstreaks + setvar VAR_0x8004, BATTLE_DOME_FUNC_INCREMENT_STREAK + special CallBattleDomeFunction + .endm + + @ + .macro dome_settrainers + setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_TRAINERS + special CallBattleDomeFunction + .endm + + @ If any moves were copied using Sketch during the challenge then restore them to Sketch + .macro dome_resetsketch + setvar VAR_0x8004, BATTLE_DOME_FUNC_RESET_SKETCH + special CallBattleDomeFunction + .endm + + @ + .macro dome_restorehelditems + setvar VAR_0x8004, BATTLE_DOME_FUNC_RESTORE_HELD_ITEMS + special CallBattleDomeFunction + .endm + + @ + .macro dome_reduceparty + setvar VAR_0x8004, BATTLE_DOME_FUNC_REDUCE_PARTY + special CallBattleDomeFunction + .endm + + @ + .macro dome_compareseeds + setvar VAR_0x8004, BATTLE_DOME_FUNC_COMPARE_SEEDS + special CallBattleDomeFunction + .endm + + @ Buffer the name of the winner for the last Dome challenge to STR_VAR_1 + .macro dome_getwinnersname + setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_WINNER_NAME + special CallBattleDomeFunction + .endm + + @ + .macro dome_inittrainers + setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_TRAINERS + special CallBattleDomeFunction + .endm diff --git a/asm/macros/battle_frontier/battle_tower.inc b/asm/macros/battle_frontier/battle_tower.inc index 3a42438bb..d5a02ea21 100644 --- a/asm/macros/battle_frontier/battle_tower.inc +++ b/asm/macros/battle_frontier/battle_tower.inc @@ -1,7 +1,62 @@ -@ To be populated with macros for CallBattleTowerFunc + @ Initialize the Battle Tower challenge + .macro tower_init + setvar VAR_0x8004, BATTLE_TOWER_FUNC_INIT + special CallBattleTowerFunc + .endm - .macro battletower_getstreak + @ Get the value of some TOWER_DATA_*. See GetTowerData for the data types that can be retrieved + .macro tower_get data:req setvar VAR_0x8004, BATTLE_TOWER_FUNC_GET_DATA - setvar VAR_0x8005, 1 + setvar VAR_0x8005, \data + special CallBattleTowerFunc + .endm + + @ Set some TOWER_DATA_* to val. See SetTowerData for the data types that can be set + .macro tower_set data:req, val=0xFFFF + setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_DATA + setvar VAR_0x8005, \data + .if \val != 0xFFFF + setvar VAR_0x8006, \val + .endif + special CallBattleTowerFunc + .endm + + @ Choose and set the gfx for the next opponent. Also used by Battle Tents + .macro tower_setopponent + setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_OPPONENT + special CallBattleTowerFunc + .endm + + @ Increments the battle number and returns the new one. Also clears E-Reader trainer if defeated, and saves the current win streak + .macro tower_setbattlewon + setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_BATTLE_WON + special CallBattleTowerFunc + .endm + + @ Try to award ribbons for completing 56th straight Battle Tower win. VAR_RESULT is TRUE if ribbons were awarded. + .macro tower_giveribbons + setvar VAR_0x8004, BATTLE_TOWER_FUNC_GIVE_RIBBONS + special CallBattleTowerFunc + .endm + + @ Save the game and set the challenge status + .macro tower_save challengeStatus:req + setvar VAR_0x8004, BATTLE_TOWER_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattleTowerFunc + .endm + + @ Buffer the opponent's easy chat intro speech to STR_VAR_4 + .macro tower_getopponentintro opponent:req + setvar VAR_0x8004, BATTLE_TOWER_FUNC_GET_OPPONENT_INTRO + setvar VAR_0x8005, \opponent + special CallBattleTowerFunc + .endm + + @ TODO: Document and add macros for BATTLE_TOWER_FUNC_10 - BATTLE_TOWER_FUNC_14 + + @ Set the data used for the post-challenge Battle Tower interview + .macro tower_setinterviewdata + setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_INTERVIEW_DATA special CallBattleTowerFunc .endm -- cgit v1.2.3 From 41c1c9ca8a472573e5acaea26bf3682399f50e35 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 29 Nov 2019 02:00:19 -0500 Subject: Set up Battle Pike macros --- asm/macros/battle_frontier/battle_pike.inc | 153 +++++++++++++++++++++++++---- 1 file changed, 136 insertions(+), 17 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_pike.inc b/asm/macros/battle_frontier/battle_pike.inc index 0f2d2627d..150c7f02b 100644 --- a/asm/macros/battle_frontier/battle_pike.inc +++ b/asm/macros/battle_frontier/battle_pike.inc @@ -1,54 +1,173 @@ -@ To be populated with macros for CallBattlePikeFunction +@ TODO: Add explanatory comments - .macro battlepike_getstreak + @ + .macro pike_setnextroom + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE + special CallBattlePikeFunction + .endm + + @ + .macro pike_get data:req setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_DATA - setvar VAR_0x8005, 1 + setvar VAR_0x8005, \data special CallBattlePikeFunction .endm - .macro battlepike_setstreak streak:req + @ + .macro pike_set data:req, val:req setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_DATA - setvar VAR_0x8005, 1 - .if \streak >= VARS_START - copyvar VAR_0x8006, \streak + setvar VAR_0x8005, \data + .if \val >= VARS_START + copyvar VAR_0x8006, \val .else - setvar VAR_0x8006, \streak + setvar VAR_0x8006, \val .endif special CallBattlePikeFunction .endm - .macro battlepike_isfinalroom + @ + .macro pike_isfinalroom setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_FINAL_ROOM special CallBattlePikeFunction .endm - .macro battlepike_setroomobjects + @ + .macro pike_setroomobjects setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS special CallBattlePikeFunction .endm - .macro battlepike_getroomtype + @ + .macro pike_getroomtype setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE special CallBattlePikeFunction .endm - .macro battlepike_setnextroom - setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE + @ Sets a bool that's never read + .macro pike_inwildmonroom + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_IN_WILD_MON_ROOM + special CallBattlePikeFunction + .endm + + @ Clears a bool that's never read + .macro pike_exitwildmonroom + setvar VAR_0x8004, BATTLE_PIKE_FUNC_CLEAR_IN_WILD_MON_ROOM + special CallBattlePikeFunction + .endm + + @ Save the game and set the challenge status + .macro pike_save challengeStatus:req + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattlePikeFunction + .endm + + @ + .macro pike_getstatus + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_STATUS + special CallBattlePikeFunction + .endm + + @ + .macro pike_getstatusmon + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_STATUS_MON + special CallBattlePikeFunction + .endm + + @ + .macro pike_healonetwomons + setvar VAR_0x8004, BATTLE_PIKE_FUNC_HEAL_ONE_TWO_MONS + special CallBattlePikeFunction + .endm + + @ + .macro pike_getnpcmsg + setvar VAR_0x8004, BATTLE_PIKE_FUNC_BUFFER_NPC_MSG + special CallBattlePikeFunction + .endm + + @ + .macro pike_fadescreen + setvar VAR_0x8004, BATTLE_PIKE_FUNC_STATUS_SCREEN_FADE + special CallBattlePikeFunction + .endm + + @ TRUE if the player is currently in a Battle Pike challenge map + .macro pike_inchallenge + setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_IN + special CallBattlePikeFunction + .endm + + @ TRUE if its the Pike Queens room + .macro pike_sethintroom + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HINT_ROOM + special CallBattlePikeFunction + .endm + + @ + .macro pike_gethintroomid + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_HINT_ROOM_ID special CallBattlePikeFunction .endm - .macro battlepike_gethint + @ + .macro pike_gethint setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT special CallBattlePikeFunction .endm - .macro battlepike_nohealing set:req - setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEALING_ROOMS_DISABLED + @ + .macro pike_cleartrainerids + setvar VAR_0x8004, BATTLE_PIKE_FUNC_CLEAR_TRAINER_IDS + special CallBattlePikeFunction + .endm + + @ + .macro pike_gettrainerintro trainer:req + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_TRAINER_INTRO + setvar VAR_0x8005, \trainer + special CallBattlePikeFunction + .endm + + @ Get the status of the Pike Queen (Not ready, Silver/Gold streak before symbols, Silver/Gold streak after symbols) + .macro pike_getbrainstatus + setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_QUEEN_FIGHT_TYPE + special CallBattlePikeFunction + .endm + + @ + .macro pike_prequeenheal + setvar VAR_0x8004, BATTLE_PIKE_FUNC_HEAL_MONS_BEFORE_QUEEN + special CallBattlePikeFunction + .endm + + @ + .macro pike_nohealing set:req + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEAL_ROOMS_DISABLED setvar VAR_0x8005, \set special CallBattlePikeFunction .endm - .macro battlepike_ispartyfullhealth + @ + .macro pike_ispartyfullhealth setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH special CallBattlePikeFunction .endm + + @ + .macro pike_savehelditems + setvar VAR_0x8004, BATTLE_PIKE_FUNC_SAVE_HELD_ITEMS + special CallBattlePikeFunction + .endm + + @ + .macro pike_resethelditems + setvar VAR_0x8004, BATTLE_PIKE_FUNC_RESET_HELD_ITEMS + special CallBattlePikeFunction + .endm + + @ Initialize the Battle Arena challenge + .macro pike_init + setvar VAR_0x8004, BATTLE_PIKE_FUNC_INIT + special CallBattlePikeFunction + .endm -- cgit v1.2.3 From 9fcfbdbef563063f96ff61a95eaf0b6556db56e2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 2 Dec 2019 08:44:34 -0500 Subject: Set up Battle Factory macros --- asm/macros/battle_frontier/battle_factory.inc | 104 +++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_factory.inc b/asm/macros/battle_frontier/battle_factory.inc index 9a8879df8..f5ef7bda9 100644 --- a/asm/macros/battle_frontier/battle_factory.inc +++ b/asm/macros/battle_frontier/battle_factory.inc @@ -1 +1,103 @@ -@ To be populated with macros for CallBattleFactoryFunction +@ TODO: Add explanatory comments + + @ + .macro factory_init + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_INIT + special CallBattleFactoryFunction + .endm + + @ + .macro factory_get data:req + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattleFactoryFunction + .endm + + @ + .macro factory_set data:req, val=0xFFFF + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_DATA + setvar VAR_0x8005, \data + .if \val == 0xFFFF + @ argument not provided + .elseif \val >= VARS_START + copyvar VAR_0x8006, \val + .else + setvar VAR_0x8006, \val + .endif + special CallBattleFactoryFunction + .endm + + @ + .macro factory_save challengeStatus:req + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattleFactoryFunction + .endm + + @ + .macro factory_rentmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SELECT_RENT_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_swapmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SWAP_RENT_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_setswapped + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_SWAPPED + special CallBattleFactoryFunction + .endm + + @ + .macro factory_setopponentmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_setparties arg:req + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_PARTIES + setvar VAR_0x8005, \arg + special CallBattleFactoryFunction + .endm + + @ + .macro factory_setopponentgfx + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_GFX + special CallBattleFactoryFunction + .endm + + @ + .macro factory_generateopponentmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_OPPONENT_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_generaterentalmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_RENTAL_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_getopponentmontype + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_MON_TYPE + special CallBattleFactoryFunction + .endm + + @ + .macro factory_getopponentstyle + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_STYLE + special CallBattleFactoryFunction + .endm + + @ + .macro factory_resethelditems + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_RESET_HELD_ITEMS + special CallBattleFactoryFunction + .endm + -- cgit v1.2.3 From fdae25eab21128a7ec8074e6cb6fab27b3a263fe Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 2 Dec 2019 09:52:16 -0500 Subject: Set up Battle Pyramid macros --- asm/macros/battle_frontier/battle_pyramid.inc | 98 ++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_pyramid.inc b/asm/macros/battle_frontier/battle_pyramid.inc index e23a819c0..a7b7afb89 100644 --- a/asm/macros/battle_frontier/battle_pyramid.inc +++ b/asm/macros/battle_frontier/battle_pyramid.inc @@ -1 +1,97 @@ -@ To be populated with macros for CallBattlePyramidFunction +@ TODO: Add explanatory comments + + @ + .macro pyramid_init + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_get data:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_set data:req, val:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA + setvar VAR_0x8005, \data + setvar VAR_0x8006, \val + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_save challengeStatus:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_setprize + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_PRIZE + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_seedfloor + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SEED_FLOOR + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_setitem + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_ITEM + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_hideitem + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_HIDE_ITEM + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_inittrainers + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_TRAINERS + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_showhint + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT + special CallBattlePyramidFunction + .endm + + @ VAR_RESULT is 1 if on a Pyramid floor, 2 if on the Pyramid peak + .macro pyramid_inchallenge + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_IS_IN + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_updatelight radius:req, mode:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT + setvar VAR_0x8005, \radius + setvar VAR_0x8006, \mode + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_clearhelditems + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS + special CallBattlePyramidFunction + .endm + + @ BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE + .macro pyramid_setfloorpal + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE + special CallBattlePyramidFunction + .endm + + @ + .macro pyramid_healparty + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY + special CallBattlePyramidFunction + .endm -- cgit v1.2.3 From 467a103bcccbb0a072f7fbbb5e31329f7d17fe6a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 2 Dec 2019 14:49:22 -0500 Subject: Set up Battle Tent macros --- asm/macros/battle_tent.inc | 164 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 163 insertions(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_tent.inc b/asm/macros/battle_tent.inc index 9a304475b..c6f92ee15 100644 --- a/asm/macros/battle_tent.inc +++ b/asm/macros/battle_tent.inc @@ -1 +1,163 @@ -@ To be populated with macros for CallVerdanturfTentFunction, CallFallarborTentFunction, and CallSlateportTentFunction +@ TODO: Add explanatory comments + +@ Verdanturf Tent + + @ + .macro verdanturftent_init + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_INIT + special CallVerdanturfTentFunction + .endm + + @ + .macro verdanturftent_getprize + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_PRIZE + special CallVerdanturfTentFunction + .endm + + @ Unused. + .macro verdanturftent_setprize + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_PRIZE + special CallVerdanturfTentFunction + .endm + + @ Unused. + .macro verdanturftent_setopponentgfx + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_OPPONENT_GFX + special CallVerdanturfTentFunction + .endm + + @ Buffers the opponents intro speech to STR_VAR_4. Despite being a Verdanturf Tent function, it serves the same purpose for all 3 tents. + .macro battletent_getopponentintro + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_OPPONENT_INTRO + special CallVerdanturfTentFunction + .endm + + @ + .macro verdanturftent_save challengeStatus:req + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallVerdanturfTentFunction + .endm + + @ + .macro verdanturftent_setrandomprize + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_RANDOM_PRIZE + special CallVerdanturfTentFunction + .endm + + @ + .macro verdanturftent_giveprize + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GIVE_PRIZE + special CallVerdanturfTentFunction + .endm + + +@ Fallarbor Tent + + @ + .macro fallarbortent_init + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_INIT + special CallFallarborTentFunction + .endm + + @ + .macro fallarbortent_getprize + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_PRIZE + special CallFallarborTentFunction + .endm + + @ Unused. + .macro fallarbortent_setprize + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_PRIZE + special CallFallarborTentFunction + .endm + + @ + .macro fallarbortent_save challengeStatus:req + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallFallarborTentFunction + .endm + + @ + .macro fallarbortent_setrandomprize + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_RANDOM_PRIZE + special CallFallarborTentFunction + .endm + + @ + .macro fallarbortent_giveprize + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GIVE_PRIZE + special CallFallarborTentFunction + .endm + + @ + .macro fallarbortent_getopponentname + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME + special CallFallarborTentFunction + .endm + + +@ Slateport Tent + + @ + .macro slateporttent_init + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_INIT + special CallSlateportTentFunction + .endm + + @ + .macro slateporttent_getprize + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GET_PRIZE + special CallSlateportTentFunction + .endm + + @ Unused. + .macro slateporttent_setprize + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_PRIZE + special CallSlateportTentFunction + .endm + + @ + .macro slateporttent_save challengeStatus:req + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallSlateportTentFunction + .endm + + @ + .macro slateporttent_setrandomprize + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE + special CallSlateportTentFunction + .endm + + @ + .macro slateporttent_giveprize + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GIVE_PRIZE + special CallSlateportTentFunction + .endm + + @ + .macro slateporttent_rentmons + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SELECT_RENT_MONS + special CallSlateportTentFunction + .endm + + @ + .macro slateporttent_swapmons + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SWAP_RENT_MONS + special CallSlateportTentFunction + .endm + + @ + .macro slateporttent_generateopponentmons + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS + special CallSlateportTentFunction + .endm + + @ + .macro slateporttent_generaterentalmons + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_RENTAL_MONS + special CallSlateportTentFunction + .endm + -- cgit v1.2.3 From 49c6ae1ac66dd93a295dff543c8e774d9ae3d510 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 2 Dec 2019 15:26:56 -0500 Subject: Add some macro comments --- asm/macros/battle_frontier/apprentice.inc | 31 ++- asm/macros/battle_frontier/battle_arena.inc | 8 +- asm/macros/battle_frontier/battle_dome.inc | 6 + asm/macros/battle_frontier/battle_factory.inc | 204 ++++++++--------- asm/macros/battle_frontier/battle_palace.inc | 126 +++++------ asm/macros/battle_frontier/battle_pike.inc | 8 +- asm/macros/battle_frontier/battle_pyramid.inc | 164 +++++++------- asm/macros/battle_tent.inc | 308 +++++++++++++------------- asm/macros/trainer_hill.inc | 20 +- 9 files changed, 461 insertions(+), 414 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/apprentice.inc b/asm/macros/battle_frontier/apprentice.inc index e9b098a18..5d9ab8e3b 100644 --- a/asm/macros/battle_frontier/apprentice.inc +++ b/asm/macros/battle_frontier/apprentice.inc @@ -1,22 +1,24 @@ -@ TODO: These need to have description comment - + @ TRUE if the player has talked to the Apprentice and answered their level mode question .macro apprentice_gavelvlmode setvar VAR_0x8004, APPRENTICE_FUNC_GAVE_LVLMODE special CallApprenticeFunction .endm + @ Set the level mode the Apprentice should battle in .macro apprentice_setlvlmode lvlmode:req setvar VAR_0x8004, APPRENTICE_FUNC_SET_LVLMODE setorcopyvar VAR_0x8005, \lvlmode - addvar VAR_0x8005, 1 + addvar VAR_0x8005, 1 @ Apprentice lvl mode is +1 from regular lvl mode value special CallApprenticeFunction .endm + @ Question was answered, increment the number of questions answered .macro apprentice_answeredquestion setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION special CallApprenticeFunction .endm + @ Show the response selection box to answer the Apprentice question. Menus are defined as APPRENTICE_ASK_* .macro apprentice_menu which:req setvar VAR_0x8004, APPRENTICE_FUNC_MENU setvar VAR_0x8005, \which @@ -24,16 +26,19 @@ waitstate .endm + @ Shuffle and set the Apprentice party mons to pick between from their list of possible party species .macro apprentice_shufflespecies setvar VAR_0x8004, APPRENTICE_FUNC_SHUFFLE_SPECIES special CallApprenticeFunction .endm + @ Randomize the question data (e.g. moves to pick between) and shuffle the order to ask them in .macro apprentice_randomizequestions setvar VAR_0x8004, APPRENTICE_FUNC_RANDOMIZE_QUESTIONS special CallApprenticeFunction .endm + @ Print the APPRENTICE_MSG_* text for the current Apprentice .macro apprentice_msg waitbuttonpress:req, which:req setvar VAR_0x8004, APPRENTICE_FUNC_PRINT_MSG setvar VAR_0x8005, \waitbuttonpress @@ -42,46 +47,54 @@ waitstate .endm + @ Clear the data for the current Player Apprentice .macro apprentice_reset setvar VAR_0x8004, APPRENTICE_FUNC_RESET special CallApprenticeFunction .endm + @ Always returns TRUE. No side effect. May have been for debug or dummied for some other reason .macro apprentice_shouldcheckgone setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE special CallApprenticeFunction .endm + @ Return the APPRENTICE_QUESTION_* value for the current question to ask .macro apprentice_getquestion setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION special CallApprenticeFunction .endm + @ Get the number of mons that have been chosen for the Apprentice's party so far .macro apprentice_getnumpartymons setvar VAR_0x8004, APPRENTICE_FUNC_GET_NUM_PARTY_MONS special CallApprenticeFunction .endm + @ Set the Apprentice party mon at the given slot. VAR_0x8005 is used implicitly as which of the 2 mons was selected .macro apprentice_setpartymon slot:req copyvar VAR_0x8006, \slot setvar VAR_0x8004, APPRENTICE_FUNC_SET_PARTY_MON special CallApprenticeFunction .endm + @ Allocate and set up data to track about the question .macro apprentice_initquestion which:req setvar VAR_0x8004, APPRENTICE_FUNC_INIT_QUESTION_DATA setvar VAR_0x8005, \which special CallApprenticeFunction .endm + @ Free allocated question data .macro apprentice_freequestion setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA special CallApprenticeFunction .endm - .macro apprentice_buff whichstringvar:req, tobuff:req + @ Buffer some APPRENTICE_BUFF_* string to the given stringvar (0 for STR_VAR_1, 1 for STR_VAR_2, 2 for STR_VAR_3) + .macro apprentice_buff stringvar:req, tobuff:req setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING - setvar VAR_0x8005, \whichstringvar + setvar VAR_0x8005, \stringvar .if \tobuff >= VARS_START copyvar VAR_0x8006, \tobuff .else @@ -90,43 +103,51 @@ special CallApprenticeFunction .endm + @ Set which move to use that the player chose (implicitly VAR_0x8005) .macro apprentice_setmove setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE special CallApprenticeFunction .endm + @ Set which mon the Apprentice should lead with .macro apprentice_setleadmon monId:req copyvar VAR_0x8005, \monId setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON special CallApprenticeFunction .endm + @ Open the Bag Menu for the player to choose an item to recommend as a held item .macro apprentice_openbag setvar VAR_0x8004, APPRENTICE_FUNC_OPEN_BAG special CallApprenticeFunction waitstate .endm + @ Try and set the recommended held item. FALSE if the item has been recommended before, as Battle Frontier forbids using the same held item for multiple party mons .macro apprentice_trysetitem setvar VAR_0x8004, APPRENTICE_FUNC_TRY_SET_HELD_ITEM special CallApprenticeFunction .endm + @ Save the current Player Apprentice to the saveblock to make room for a new Apprentice .macro apprentice_save setvar VAR_0x8004, APPRENTICE_FUNC_SAVE special CallApprenticeFunction .endm + @ Set the object event gfx for the Apprentice based on their trainer class .macro apprentice_setgfx setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX special CallApprenticeFunction .endm + @ Always returns TRUE. No side effect. May have been for debug or dummied for some other reason .macro apprentice_shouldleave setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE special CallApprenticeFunction .endm + @ Shift the other saved Apprentices over to make room for saving a new Apprentice .macro apprentice_shiftsaved setvar VAR_0x8004, APPRENTICE_FUNC_SHIFT_SAVED special CallApprenticeFunction diff --git a/asm/macros/battle_frontier/battle_arena.inc b/asm/macros/battle_frontier/battle_arena.inc index cd7e0aa1d..8280f5845 100644 --- a/asm/macros/battle_frontier/battle_arena.inc +++ b/asm/macros/battle_frontier/battle_arena.inc @@ -15,11 +15,11 @@ .macro arena_set data:req, val:req setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_DATA setvar VAR_0x8005, \data - .if \val >= VARS_START - copyvar VAR_0x8006, \val - .else + .if \val >= VARS_START + copyvar VAR_0x8006, \val + .else setvar VAR_0x8006, \val - .endif + .endif special CallBattleArenaFunction .endm diff --git a/asm/macros/battle_frontier/battle_dome.inc b/asm/macros/battle_frontier/battle_dome.inc index 128470422..882c82e8b 100644 --- a/asm/macros/battle_frontier/battle_dome.inc +++ b/asm/macros/battle_frontier/battle_dome.inc @@ -133,6 +133,12 @@ special CallBattleDomeFunction .endm + @ TODO: Document this macro and its function + .macro dome_21 + setvar VAR_0x8004, BATTLE_DOME_FUNC_21 + special CallBattleDomeFunction + .endm + @ .macro dome_inittrainers setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_TRAINERS diff --git a/asm/macros/battle_frontier/battle_factory.inc b/asm/macros/battle_frontier/battle_factory.inc index f5ef7bda9..5a1eb33b7 100644 --- a/asm/macros/battle_frontier/battle_factory.inc +++ b/asm/macros/battle_frontier/battle_factory.inc @@ -1,103 +1,103 @@ -@ TODO: Add explanatory comments - - @ - .macro factory_init - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_INIT - special CallBattleFactoryFunction - .endm - - @ - .macro factory_get data:req - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_DATA - setvar VAR_0x8005, \data - special CallBattleFactoryFunction - .endm - - @ - .macro factory_set data:req, val=0xFFFF - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_DATA - setvar VAR_0x8005, \data - .if \val == 0xFFFF - @ argument not provided - .elseif \val >= VARS_START - copyvar VAR_0x8006, \val - .else - setvar VAR_0x8006, \val - .endif - special CallBattleFactoryFunction - .endm - - @ - .macro factory_save challengeStatus:req - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SAVE - setvar VAR_0x8005, \challengeStatus - special CallBattleFactoryFunction - .endm - - @ - .macro factory_rentmons - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SELECT_RENT_MONS - special CallBattleFactoryFunction - .endm - - @ - .macro factory_swapmons - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SWAP_RENT_MONS - special CallBattleFactoryFunction - .endm - - @ - .macro factory_setswapped - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_SWAPPED - special CallBattleFactoryFunction - .endm - - @ - .macro factory_setopponentmons - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_MONS - special CallBattleFactoryFunction - .endm - - @ - .macro factory_setparties arg:req - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_PARTIES - setvar VAR_0x8005, \arg - special CallBattleFactoryFunction - .endm - - @ - .macro factory_setopponentgfx - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_GFX - special CallBattleFactoryFunction - .endm - - @ - .macro factory_generateopponentmons - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_OPPONENT_MONS - special CallBattleFactoryFunction - .endm - - @ - .macro factory_generaterentalmons - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_RENTAL_MONS - special CallBattleFactoryFunction - .endm - - @ - .macro factory_getopponentmontype - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_MON_TYPE - special CallBattleFactoryFunction - .endm - - @ - .macro factory_getopponentstyle - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_STYLE - special CallBattleFactoryFunction - .endm - - @ - .macro factory_resethelditems - setvar VAR_0x8004, BATTLE_FACTORY_FUNC_RESET_HELD_ITEMS - special CallBattleFactoryFunction - .endm +@ TODO: Add explanatory comments to macros + + @ Initialize the Battle Factory challenge + .macro factory_init + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_INIT + special CallBattleFactoryFunction + .endm + + @ Get the value of some FACTORY_DATA_*. See GetBattleFactoryData for the data types that can be retrieved + .macro factory_get data:req + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattleFactoryFunction + .endm + + @ Set some FACTORY_DATA_* to val. See SetBattleFactoryData for the data types that can be set + .macro factory_set data:req, val=0xFFFF + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_DATA + setvar VAR_0x8005, \data + .if \val == 0xFFFF + @ argument not provided + .elseif \val >= VARS_START + copyvar VAR_0x8006, \val + .else + setvar VAR_0x8006, \val + .endif + special CallBattleFactoryFunction + .endm + + @ Save the game and set the challenge status + .macro factory_save challengeStatus:req + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattleFactoryFunction + .endm + + @ + .macro factory_rentmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SELECT_RENT_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_swapmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SWAP_RENT_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_setswapped + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_SWAPPED + special CallBattleFactoryFunction + .endm + + @ + .macro factory_setopponentmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_setparties arg:req + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_PARTIES + setvar VAR_0x8005, \arg + special CallBattleFactoryFunction + .endm + + @ + .macro factory_setopponentgfx + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_GFX + special CallBattleFactoryFunction + .endm + + @ + .macro factory_generateopponentmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_OPPONENT_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_generaterentalmons + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_RENTAL_MONS + special CallBattleFactoryFunction + .endm + + @ + .macro factory_getopponentmontype + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_MON_TYPE + special CallBattleFactoryFunction + .endm + + @ + .macro factory_getopponentstyle + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_STYLE + special CallBattleFactoryFunction + .endm + + @ + .macro factory_resethelditems + setvar VAR_0x8004, BATTLE_FACTORY_FUNC_RESET_HELD_ITEMS + special CallBattleFactoryFunction + .endm diff --git a/asm/macros/battle_frontier/battle_palace.inc b/asm/macros/battle_frontier/battle_palace.inc index c7fc6ded2..f326c1154 100644 --- a/asm/macros/battle_frontier/battle_palace.inc +++ b/asm/macros/battle_frontier/battle_palace.inc @@ -1,63 +1,63 @@ - @ Initialize the Battle Palace challenge - .macro palace_init - setvar VAR_0x8004, BATTLE_PALACE_FUNC_INIT - special CallBattlePalaceFunction - .endm - - @ Get the value of some PALACE_DATA_*. See GetPalaceData for the data types that can be retrieved - .macro palace_get data:req - setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_DATA - setvar VAR_0x8005, \data - special CallBattlePalaceFunction - .endm - - @ Set some PALACE_DATA_* to val. See SetPalaceData for the data types that can be set - .macro palace_set data:req, val:req - setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_DATA - setvar VAR_0x8005, \data - setvar VAR_0x8006, \val - special CallBattlePalaceFunction - .endm - - @ Get the id of the comment to be made while being led through the corridor - .macro palace_getcomment - setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_COMMENT_ID - special CallBattlePalaceFunction - .endm - - @ Unused. Choose and set the opponent gfx id. The equivalent macro from Battle Tower is used instead - .macro palace_setopponent - setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_OPPONENT - special CallBattlePalaceFunction - .endm - - @ Buffer the opponents intro speech to gStringVar4. Also used by Battle Arena and Factory - .macro palace_getopponentintro - setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO - special CallBattlePalaceFunction - .endm - - @ Increments the current win streak by 1 - .macro palace_incrementstreak - setvar VAR_0x8004, BATTLE_PALACE_FUNC_INCREMENT_STREAK - special CallBattlePalaceFunction - .endm - - @ Save the game and set the challenge status - .macro palace_save challengeStatus:req - setvar VAR_0x8004, BATTLE_PALACE_FUNC_SAVE - setvar VAR_0x8005, \challengeStatus - special CallBattlePalaceFunction - .endm - - @ Unused. Set the prize item to give from one of two lists of possible prizes, depending on streak. - .macro palace_setprize - setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_PRIZE - special CallBattleArenaFunction - .endm - - @ Unused. Give the set prize item to the player. TRUE if room in Bag for prize, FALSE otherwise - .macro palace_giveprize - setvar VAR_0x8004, BATTLE_PALACE_FUNC_GIVE_PRIZE - special CallBattleArenaFunction - .endm + @ Initialize the Battle Palace challenge + .macro palace_init + setvar VAR_0x8004, BATTLE_PALACE_FUNC_INIT + special CallBattlePalaceFunction + .endm + + @ Get the value of some PALACE_DATA_*. See GetPalaceData for the data types that can be retrieved + .macro palace_get data:req + setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattlePalaceFunction + .endm + + @ Set some PALACE_DATA_* to val. See SetPalaceData for the data types that can be set + .macro palace_set data:req, val:req + setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_DATA + setvar VAR_0x8005, \data + setvar VAR_0x8006, \val + special CallBattlePalaceFunction + .endm + + @ Get the id of the comment to be made while being led through the corridor + .macro palace_getcomment + setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_COMMENT_ID + special CallBattlePalaceFunction + .endm + + @ Unused. Choose and set the opponent gfx id. The equivalent macro from Battle Tower is used instead + .macro palace_setopponent + setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_OPPONENT + special CallBattlePalaceFunction + .endm + + @ Buffer the opponents intro speech to gStringVar4. Also used by Battle Arena and Factory + .macro palace_getopponentintro + setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO + special CallBattlePalaceFunction + .endm + + @ Increments the current win streak by 1 + .macro palace_incrementstreak + setvar VAR_0x8004, BATTLE_PALACE_FUNC_INCREMENT_STREAK + special CallBattlePalaceFunction + .endm + + @ Save the game and set the challenge status + .macro palace_save challengeStatus:req + setvar VAR_0x8004, BATTLE_PALACE_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattlePalaceFunction + .endm + + @ Unused. Set the prize item to give from one of two lists of possible prizes, depending on streak. + .macro palace_setprize + setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_PRIZE + special CallBattleArenaFunction + .endm + + @ Unused. Give the set prize item to the player. TRUE if room in Bag for prize, FALSE otherwise + .macro palace_giveprize + setvar VAR_0x8004, BATTLE_PALACE_FUNC_GIVE_PRIZE + special CallBattleArenaFunction + .endm diff --git a/asm/macros/battle_frontier/battle_pike.inc b/asm/macros/battle_frontier/battle_pike.inc index 150c7f02b..d40cb0bac 100644 --- a/asm/macros/battle_frontier/battle_pike.inc +++ b/asm/macros/battle_frontier/battle_pike.inc @@ -1,4 +1,4 @@ -@ TODO: Add explanatory comments +@ TODO: Add explanatory comments to macros @ .macro pike_setnextroom @@ -6,14 +6,14 @@ special CallBattlePikeFunction .endm - @ + @ Get the value of some PIKE_DATA_*. See GetBattlePikeData for the data types that can be retrieved .macro pike_get data:req setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_DATA setvar VAR_0x8005, \data special CallBattlePikeFunction .endm - @ + @ Set some PIKE_DATA_* to val. See SetBattlePikeData for the data types that can be set .macro pike_set data:req, val:req setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_DATA setvar VAR_0x8005, \data @@ -166,7 +166,7 @@ special CallBattlePikeFunction .endm - @ Initialize the Battle Arena challenge + @ Initialize the Battle Pike challenge .macro pike_init setvar VAR_0x8004, BATTLE_PIKE_FUNC_INIT special CallBattlePikeFunction diff --git a/asm/macros/battle_frontier/battle_pyramid.inc b/asm/macros/battle_frontier/battle_pyramid.inc index a7b7afb89..0468e5956 100644 --- a/asm/macros/battle_frontier/battle_pyramid.inc +++ b/asm/macros/battle_frontier/battle_pyramid.inc @@ -1,97 +1,97 @@ -@ TODO: Add explanatory comments +@ TODO: Add explanatory comments to macros - @ - .macro pyramid_init - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT - special CallBattlePyramidFunction - .endm + @ Initialize the Battle Pyramid challenge + .macro pyramid_init + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_get data:req - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA - setvar VAR_0x8005, \data - special CallBattlePyramidFunction - .endm + @ Get the value of some PYRAMID_DATA_*. See GetBattlePyramidData for the data types that can be retrieved + .macro pyramid_get data:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA + setvar VAR_0x8005, \data + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_set data:req, val:req - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA - setvar VAR_0x8005, \data - setvar VAR_0x8006, \val - special CallBattlePyramidFunction - .endm + @ Set some PYRAMID_DATA_* to val. See SetBattlePyramidData for the data types that can be set + .macro pyramid_set data:req, val:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA + setvar VAR_0x8005, \data + setvar VAR_0x8006, \val + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_save challengeStatus:req - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SAVE - setvar VAR_0x8005, \challengeStatus - special CallBattlePyramidFunction - .endm + @ Save the game and set the challenge status + .macro pyramid_save challengeStatus:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_setprize - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_PRIZE - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_setprize + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_PRIZE + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_seedfloor - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SEED_FLOOR - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_seedfloor + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SEED_FLOOR + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_setitem - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_ITEM - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_setitem + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_ITEM + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_hideitem - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_HIDE_ITEM - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_hideitem + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_HIDE_ITEM + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_inittrainers - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_TRAINERS - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_inittrainers + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_TRAINERS + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_showhint - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_showhint + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT + special CallBattlePyramidFunction + .endm - @ VAR_RESULT is 1 if on a Pyramid floor, 2 if on the Pyramid peak - .macro pyramid_inchallenge - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_IS_IN - special CallBattlePyramidFunction - .endm + @ VAR_RESULT is 1 if player is on a Pyramid floor, 2 if on the Pyramid peak, 0 otherwise + .macro pyramid_inchallenge + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_IS_IN + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_updatelight radius:req, mode:req - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT - setvar VAR_0x8005, \radius - setvar VAR_0x8006, \mode - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_updatelight radius:req, mode:req + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT + setvar VAR_0x8005, \radius + setvar VAR_0x8006, \mode + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_clearhelditems - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_clearhelditems + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS + special CallBattlePyramidFunction + .endm - @ BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE - .macro pyramid_setfloorpal - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_setfloorpal + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE + special CallBattlePyramidFunction + .endm - @ - .macro pyramid_healparty - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY - special CallBattlePyramidFunction - .endm + @ + .macro pyramid_healparty + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY + special CallBattlePyramidFunction + .endm diff --git a/asm/macros/battle_tent.inc b/asm/macros/battle_tent.inc index c6f92ee15..663d1d344 100644 --- a/asm/macros/battle_tent.inc +++ b/asm/macros/battle_tent.inc @@ -1,163 +1,167 @@ -@ TODO: Add explanatory comments - @ Verdanturf Tent - @ - .macro verdanturftent_init - setvar VAR_0x8004, VERDANTURF_TENT_FUNC_INIT - special CallVerdanturfTentFunction - .endm - - @ - .macro verdanturftent_getprize - setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_PRIZE - special CallVerdanturfTentFunction - .endm - - @ Unused. - .macro verdanturftent_setprize - setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_PRIZE - special CallVerdanturfTentFunction - .endm - - @ Unused. - .macro verdanturftent_setopponentgfx - setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_OPPONENT_GFX - special CallVerdanturfTentFunction - .endm - - @ Buffers the opponents intro speech to STR_VAR_4. Despite being a Verdanturf Tent function, it serves the same purpose for all 3 tents. - .macro battletent_getopponentintro - setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_OPPONENT_INTRO - special CallVerdanturfTentFunction - .endm - - @ - .macro verdanturftent_save challengeStatus:req - setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SAVE - setvar VAR_0x8005, \challengeStatus - special CallVerdanturfTentFunction - .endm - - @ - .macro verdanturftent_setrandomprize - setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_RANDOM_PRIZE - special CallVerdanturfTentFunction - .endm - - @ - .macro verdanturftent_giveprize - setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GIVE_PRIZE - special CallVerdanturfTentFunction - .endm + @ Initialize the Verdanturf Battle Tent challenge + .macro verdanturftent_init + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_INIT + special CallVerdanturfTentFunction + .endm + + @ Get the current prize item id + .macro verdanturftent_getprize + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_PRIZE + special CallVerdanturfTentFunction + .endm + + @ Unused. Set the prize item to be given + .macro verdanturftent_setprize unusedArg:req, itemId:req + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_PRIZE + setvar VAR_0x8005, \unusedArg + setvar VAR_0x8006, \itemId + special CallVerdanturfTentFunction + .endm + + @ Unused. Set the opponent trainer and gfx. SetNextBattleTentOpponent is used through tower_setopponent instead + .macro verdanturftent_setopponentgfx + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_OPPONENT_GFX + special CallVerdanturfTentFunction + .endm + + @ Buffers the opponents intro speech to STR_VAR_4. Despite being a Verdanturf Tent function, it serves the same purpose for all 3 tents. + .macro battletent_getopponentintro + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_OPPONENT_INTRO + special CallVerdanturfTentFunction + .endm + + @ Save the game and set the challenge status + .macro verdanturftent_save challengeStatus:req + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallVerdanturfTentFunction + .endm + + @ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item + .macro verdanturftent_setrandomprize + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_RANDOM_PRIZE + special CallVerdanturfTentFunction + .endm + + @ Give the current prize item. FALSE if no room for prize + .macro verdanturftent_giveprize + setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GIVE_PRIZE + special CallVerdanturfTentFunction + .endm @ Fallarbor Tent - @ - .macro fallarbortent_init - setvar VAR_0x8004, FALLARBOR_TENT_FUNC_INIT - special CallFallarborTentFunction - .endm - - @ - .macro fallarbortent_getprize - setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_PRIZE - special CallFallarborTentFunction - .endm - - @ Unused. - .macro fallarbortent_setprize - setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_PRIZE - special CallFallarborTentFunction - .endm - - @ - .macro fallarbortent_save challengeStatus:req - setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SAVE - setvar VAR_0x8005, \challengeStatus - special CallFallarborTentFunction - .endm - - @ - .macro fallarbortent_setrandomprize - setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_RANDOM_PRIZE - special CallFallarborTentFunction - .endm - - @ - .macro fallarbortent_giveprize - setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GIVE_PRIZE - special CallFallarborTentFunction - .endm - - @ - .macro fallarbortent_getopponentname - setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME - special CallFallarborTentFunction - .endm + @ Initialize the Fallarbor Battle Tent challenge + .macro fallarbortent_init + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_INIT + special CallFallarborTentFunction + .endm + + @ Get the current prize item id + .macro fallarbortent_getprize + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_PRIZE + special CallFallarborTentFunction + .endm + + @ Unused. Set the prize item to be given + .macro fallarbortent_setprize unusedArg:req, itemId:req + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_PRIZE + setvar VAR_0x8005, \unusedArg + setvar VAR_0x8006, \itemId + special CallFallarborTentFunction + .endm + + @ Save the game and set the challenge status + .macro fallarbortent_save challengeStatus:req + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallFallarborTentFunction + .endm + + @ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item + .macro fallarbortent_setrandomprize + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_RANDOM_PRIZE + special CallFallarborTentFunction + .endm + + @ Give the current prize item. FALSE if no room for prize + .macro fallarbortent_giveprize + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GIVE_PRIZE + special CallFallarborTentFunction + .endm + + @ Buffer the opponent trainers name to STR_VAR_1 + .macro fallarbortent_getopponentname + setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME + special CallFallarborTentFunction + .endm @ Slateport Tent - @ - .macro slateporttent_init - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_INIT - special CallSlateportTentFunction - .endm - - @ - .macro slateporttent_getprize - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GET_PRIZE - special CallSlateportTentFunction - .endm - - @ Unused. - .macro slateporttent_setprize - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_PRIZE - special CallSlateportTentFunction - .endm - - @ - .macro slateporttent_save challengeStatus:req - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SAVE - setvar VAR_0x8005, \challengeStatus - special CallSlateportTentFunction - .endm - - @ - .macro slateporttent_setrandomprize - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE - special CallSlateportTentFunction - .endm - - @ - .macro slateporttent_giveprize - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GIVE_PRIZE - special CallSlateportTentFunction - .endm - - @ - .macro slateporttent_rentmons - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SELECT_RENT_MONS - special CallSlateportTentFunction - .endm - - @ - .macro slateporttent_swapmons - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SWAP_RENT_MONS - special CallSlateportTentFunction - .endm - - @ - .macro slateporttent_generateopponentmons - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS - special CallSlateportTentFunction - .endm - - @ - .macro slateporttent_generaterentalmons - setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_RENTAL_MONS - special CallSlateportTentFunction - .endm + @ Initialize the Slateport Battle Tent challenge + .macro slateporttent_init + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_INIT + special CallSlateportTentFunction + .endm + + @ Get the current prize item id + .macro slateporttent_getprize + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GET_PRIZE + special CallSlateportTentFunction + .endm + + @ Unused. Set the prize item to be given + .macro slateporttent_setprize unusedArg:req, itemId:req + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_PRIZE + setvar VAR_0x8005, \unusedArg + setvar VAR_0x8006, \itemId + special CallSlateportTentFunction + .endm + + @ Save the game and set the challenge status + .macro slateporttent_save challengeStatus:req + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SAVE + setvar VAR_0x8005, \challengeStatus + special CallSlateportTentFunction + .endm + + @ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item + .macro slateporttent_setrandomprize + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE + special CallSlateportTentFunction + .endm + + @ Give the current prize item. FALSE if no room for prize + .macro slateporttent_giveprize + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GIVE_PRIZE + special CallSlateportTentFunction + .endm + + @ Slateport Tent's version of factory_rentmons + .macro slateporttent_rentmons + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SELECT_RENT_MONS + special CallSlateportTentFunction + .endm + + @ Slateport Tent's version of factory_swapmons + .macro slateporttent_swapmons + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SWAP_RENT_MONS + special CallSlateportTentFunction + .endm + + @ Slateport Tent's version of factory_generateopponentmons + .macro slateporttent_generateopponentmons + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS + special CallSlateportTentFunction + .endm + + @ Slateport Tent's version of factory_generaterentalmons + .macro slateporttent_generaterentalmons + setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_RENTAL_MONS + special CallSlateportTentFunction + .endm diff --git a/asm/macros/trainer_hill.inc b/asm/macros/trainer_hill.inc index 7ea1c77f6..d5c84fd02 100644 --- a/asm/macros/trainer_hill.inc +++ b/asm/macros/trainer_hill.inc @@ -1,90 +1,106 @@ -@ TODO: These need to have description comment - + @ Initialize the Trainer Hill challenge and start the timer .macro trainerhill_start setvar VAR_0x8004, TRAINER_HILL_FUNC_START special CallTrainerHillFunction .endm + @ 0 if not spoken to yet, 1 if spoken to but not received prize, 2 if received prize .macro trainerhill_getownerstate setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_OWNER_STATE special CallTrainerHillFunction .endm + @ Try to give prize. 0 if given successfully, 1 if no room for prize, 2 if giving prize should be skipped .macro trainerhill_giveprize setvar VAR_0x8004, TRAINER_HILL_FUNC_GIVE_PRIZE special CallTrainerHillFunction .endm + @ Check the final challenge time. 0 if new record, 1 if not, 2 if time has already been checked .macro trainerhill_finaltime setvar VAR_0x8004, TRAINER_HILL_FUNC_CHECK_FINAL_TIME special CallTrainerHillFunction .endm + @ Resume the timer. Wont resume if owner has been spoken to or max time has been reached .macro trainerhill_resumetimer setvar VAR_0x8004, TRAINER_HILL_FUNC_RESUME_TIMER special CallTrainerHillFunction .endm + @ Set player lost the challenge (trainerHill.hasLost) to TRUE .macro trainerhill_lost setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_LOST special CallTrainerHillFunction .endm + @ Get the current challenge status (TRAINER_HILL_PLAYER_STATUS_*) .macro trainerhill_getstatus setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_STATUS special CallTrainerHillFunction .endm + @ Buffer the current timer to string vars (mins to STR_VAR_1, secs to STR_VAR_2, fraction of sec to STR_VAR_3) .macro trainerhill_gettime setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_TIME special CallTrainerHillFunction .endm + @ FALSE if fewer than all 4 floors used, TRUE otherwise. Only FALSE in JP-exclusive modes .macro trainerhill_allfloorsused setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_ALL_FLOORS_USED special CallTrainerHillFunction .endm + @ Unknown, dummied. Only side effect is setting VAR_RESULT to 0. .macro trainerhill_clearresult setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_RESULT special CallTrainerHillFunction .endm + @ TRUE if currently in a Trainer Hill challenge .macro trainerhill_inchallenge setvar VAR_0x8004, TRAINER_HILL_FUNC_IN_CHALLENGE special CallTrainerHillFunction .endm + @ Show the post battle text for the spoken to Trainer Hill trainer .macro trainerhill_postbattletext setvar VAR_0x8004, TRAINER_HILL_FUNC_POST_BATTLE_TEXT special CallTrainerHillFunction .endm + @ Set all Trainer Hill trainers defeated .macro trainerhill_settrainerflags setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_ALL_TRAINER_FLAGS special CallTrainerHillFunction .endm + @ TRUE if the game has been saved for the challenge, FALSE otherwise .macro trainerhill_getsaved setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_GAME_SAVED special CallTrainerHillFunction .endm + @ Set that the game has been saved for the challenge .macro trainerhill_setsaved setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_GAME_SAVED special CallTrainerHillFunction .endm + @ Clear that the game has been saved for the challenge .macro trainerhill_clearsaved setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_GAME_SAVED special CallTrainerHillFunction .endm + @ FALSE if the Trainer Hill challenge was lost, TRUE otherwise .macro trainerhill_getwon setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_WON special CallTrainerHillFunction .endm + @ Set the challenge mode to HILL_TAG_* (Normal, Variety, Unique, or Expert) .macro trainerhill_settag tag:req setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG copyvar VAR_0x8005, \tag -- cgit v1.2.3 From 49f1a90534180445d293761e2bdac165b49319a2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 9 Dec 2019 02:10:42 -0500 Subject: Document Battle Pike scripts --- asm/macros/battle_frontier/battle_pike.inc | 44 ++++++++++++++---------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_pike.inc b/asm/macros/battle_frontier/battle_pike.inc index d40cb0bac..30f5c88d8 100644 --- a/asm/macros/battle_frontier/battle_pike.inc +++ b/asm/macros/battle_frontier/battle_pike.inc @@ -1,6 +1,4 @@ -@ TODO: Add explanatory comments to macros - - @ + @ Set sRoomType to the next PIKE_ROOM_* id .macro pike_setnextroom setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE special CallBattlePikeFunction @@ -25,19 +23,19 @@ special CallBattlePikeFunction .endm - @ + @ TRUE if the next room is the last (15th) room, FALSE otherwise .macro pike_isfinalroom setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_FINAL_ROOM special CallBattlePikeFunction .endm - @ + @ Set the object event gfx for the room being entered .macro pike_setroomobjects setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS special CallBattlePikeFunction .endm - @ + @ Get the current room type (sRoomType) .macro pike_getroomtype setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE special CallBattlePikeFunction @@ -62,33 +60,33 @@ special CallBattlePikeFunction .endm - @ + @ Returns the PIKE_STATUS_* to be afflicted for the status room .macro pike_getstatus setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_STATUS special CallBattlePikeFunction .endm - @ + @ Returns the PIKE_STATUSMON_* that attacks the player for the status room .macro pike_getstatusmon setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_STATUS_MON special CallBattlePikeFunction .endm - @ + @ Randomly heals either one or two party mons and returns the number of mons healed .macro pike_healonetwomons setvar VAR_0x8004, BATTLE_PIKE_FUNC_HEAL_ONE_TWO_MONS special CallBattlePikeFunction .endm - @ + @ Buffers a message for the lone NPC in the NPC room to gStringVar4 .macro pike_getnpcmsg setvar VAR_0x8004, BATTLE_PIKE_FUNC_BUFFER_NPC_MSG special CallBattlePikeFunction .endm - @ - .macro pike_fadescreen - setvar VAR_0x8004, BATTLE_PIKE_FUNC_STATUS_SCREEN_FADE + @ Flashes the screen 3 times for when the Dusclops/Kirlia attacks the player + .macro pike_flashscreen + setvar VAR_0x8004, BATTLE_PIKE_FUNC_STATUS_SCREEN_FLASH special CallBattlePikeFunction .endm @@ -98,31 +96,31 @@ special CallBattlePikeFunction .endm - @ TRUE if its the Pike Queens room + @ Set which room to give a hint about. TRUE if its the Pike Queens room next .macro pike_sethintroom setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HINT_ROOM special CallBattlePikeFunction .endm - @ + @ Get PIKE_ROOM_(LEFT/CENTER/RIGHT) for which room to give a hint about .macro pike_gethintroomid setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_HINT_ROOM_ID special CallBattlePikeFunction .endm - @ + @ Get the PIKE_HINT_* to give about the next room .macro pike_gethint setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT special CallBattlePikeFunction .endm - @ + @ Reset the frontier trainer ids for the start of the challenge .macro pike_cleartrainerids setvar VAR_0x8004, BATTLE_PIKE_FUNC_CLEAR_TRAINER_IDS special CallBattlePikeFunction .endm - @ + @ Buffer the opponents battle intro speech to gStringVar4. \trainer 0 for Trainer A, 1 for Trainer B .macro pike_gettrainerintro trainer:req setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_TRAINER_INTRO setvar VAR_0x8005, \trainer @@ -135,32 +133,32 @@ special CallBattlePikeFunction .endm - @ + @ Heal 0-2 party mons depending on which room was chosen for the Pike Queen battle. Return the number healed .macro pike_prequeenheal setvar VAR_0x8004, BATTLE_PIKE_FUNC_HEAL_MONS_BEFORE_QUEEN special CallBattlePikeFunction .endm - @ + @ When \set is TRUE, prevent healing rooms from appearing (for 1st room or when party is full health). \set FALSE to re-enable healing rooms .macro pike_nohealing set:req setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEAL_ROOMS_DISABLED setvar VAR_0x8005, \set special CallBattlePikeFunction .endm - @ + @ TRUE if the party is full health (full HP, PP, and no status), FALSE otherwise .macro pike_ispartyfullhealth setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH special CallBattlePikeFunction .endm - @ + @ Save the party held items in pikeHeldItemsBackup .macro pike_savehelditems setvar VAR_0x8004, BATTLE_PIKE_FUNC_SAVE_HELD_ITEMS special CallBattlePikeFunction .endm - @ + @ Restore the party held items from pikeHeldItemsBackup .macro pike_resethelditems setvar VAR_0x8004, BATTLE_PIKE_FUNC_RESET_HELD_ITEMS special CallBattlePikeFunction -- cgit v1.2.3 From aa72c0ada32632f3dfa7641375a84fa8dc8e7e08 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 9 Dec 2019 14:00:13 -0500 Subject: Document Battle Factory scripts --- asm/macros/battle_frontier/battle_factory.inc | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_factory.inc b/asm/macros/battle_frontier/battle_factory.inc index 5a1eb33b7..684eeb98d 100644 --- a/asm/macros/battle_frontier/battle_factory.inc +++ b/asm/macros/battle_frontier/battle_factory.inc @@ -1,5 +1,3 @@ -@ TODO: Add explanatory comments to macros - @ Initialize the Battle Factory challenge .macro factory_init setvar VAR_0x8004, BATTLE_FACTORY_FUNC_INIT @@ -34,68 +32,68 @@ special CallBattleFactoryFunction .endm - @ + @ Select the initial rental mons for the challenge .macro factory_rentmons setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SELECT_RENT_MONS special CallBattleFactoryFunction .endm - @ + @ Select a mon to swap for from the previously defeated team .macro factory_swapmons setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SWAP_RENT_MONS special CallBattleFactoryFunction .endm - @ + @ Allows FACTORY_DATA_WIN_STREAK_SWAPS to be incremented once .macro factory_setswapped setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_SWAPPED special CallBattleFactoryFunction .endm - @ + @ Update gEnemyParty with the next set of rental mons .macro factory_setopponentmons setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_MONS special CallBattleFactoryFunction .endm - @ + @ Populate gPlayerParty and gEnemyParty with the rental mons. Only needed when resuming a challenge, otherwise only factory_setopponentmons and factory_rentmons/factory_swapmons are needed .macro factory_setparties arg:req setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_PARTIES setvar VAR_0x8005, \arg special CallBattleFactoryFunction .endm - @ + @ Set the object event gfx for the opponent trainer .macro factory_setopponentgfx setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_GFX special CallBattleFactoryFunction .endm - @ + @ Generate the mons for the opponents team .macro factory_generateopponentmons setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_OPPONENT_MONS special CallBattleFactoryFunction .endm - @ + @ Generate the random 6 mons to choose from for the initial rental .macro factory_generaterentalmons setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_RENTAL_MONS special CallBattleFactoryFunction .endm - @ + @ Return the pokemon type most common in the opponents team, or NUMBER_OF_MON_TYPES if there is no standout type .macro factory_getopponentmontype setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_MON_TYPE special CallBattleFactoryFunction .endm - @ + @ Return the FACTORY_STYLE_* dependent on what types of moves the opponents team has, or FACTORY_NUM_STYLES if multiple styles tie for the same amount of moves .macro factory_getopponentstyle setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_STYLE special CallBattleFactoryFunction .endm - @ + @ Restore the held items for the players party to what they were pre-battle .macro factory_resethelditems setvar VAR_0x8004, BATTLE_FACTORY_FUNC_RESET_HELD_ITEMS special CallBattleFactoryFunction -- cgit v1.2.3 From 75b0c9d7a9edabc742bc42f19d078fa2ae64870c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 11 Dec 2019 03:28:55 -0500 Subject: Document Battle Pyramid scripts --- asm/macros/battle_frontier/battle_pyramid.inc | 39 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_pyramid.inc b/asm/macros/battle_frontier/battle_pyramid.inc index 0468e5956..f8141e2dd 100644 --- a/asm/macros/battle_frontier/battle_pyramid.inc +++ b/asm/macros/battle_frontier/battle_pyramid.inc @@ -1,5 +1,3 @@ -@ TODO: Add explanatory comments to macros - @ Initialize the Battle Pyramid challenge .macro pyramid_init setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT @@ -28,37 +26,43 @@ special CallBattlePyramidFunction .endm - @ + @ Set the prize item to give from one of two lists of possible prizes, depending on streak. .macro pyramid_setprize setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_PRIZE special CallBattlePyramidFunction .endm - @ + @ Unused. Give the set prize item to the player. TRUE if room in Bag for prize, FALSE otherwise + .macro pyramid_giveprize + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GIVE_PRIZE + special CallBattlePyramidFunction + .endm + + @ Set the random values for the floor (used to determine object positions, e.g.), and clear trainer flags .macro pyramid_seedfloor setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SEED_FLOOR special CallBattlePyramidFunction .endm - @ + @ Set the item to pick up depending on the random seed and quantity (always 1) to the arguments for STD_FIND_ITEM .macro pyramid_setitem setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_ITEM special CallBattlePyramidFunction .endm - @ + @ Hide the picked-up item (technically it moves the item far offscreen) .macro pyramid_hideitem setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_HIDE_ITEM special CallBattlePyramidFunction .endm - @ - .macro pyramid_inittrainers - setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT_TRAINERS + @ Set the facility trainers to gBattleFrontierTrainers + .macro pyramid_settrainers + setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_TRAINERS special CallBattlePyramidFunction .endm - @ + @ Show the post-battle hint text .macro pyramid_showhint setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT special CallBattlePyramidFunction @@ -70,28 +74,31 @@ special CallBattlePyramidFunction .endm - @ - .macro pyramid_updatelight radius:req, mode:req + @ Update the light around the player. 2 different modes, for setting or incrementing light. See PYRAMID_LIGHT_* + .macro pyramid_updatelight radius:req, mode:req, sound=0xFFFF setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT setvar VAR_0x8005, \radius setvar VAR_0x8006, \mode + .if \sound != 0xFFFF + setvar VAR_0x8007, \sound + .endif special CallBattlePyramidFunction .endm - @ + @ Reset the held items to what they were at the start of the challenge .macro pyramid_clearhelditems setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS special CallBattlePyramidFunction .endm - @ + @ Set the palette depending on current floor number .macro pyramid_setfloorpal setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE special CallBattlePyramidFunction .endm - @ - .macro pyramid_healparty + @ Reset sketched moves and update the party order in the saveblock + .macro pyramid_resetparty setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY special CallBattlePyramidFunction .endm -- cgit v1.2.3 From 6967caefb246f9709032049b0ae2baee71f71eb6 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 12 Dec 2019 02:35:37 -0500 Subject: Split finditem_std from giveitem_std --- asm/macros/event.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 9db57daf1..96971b583 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1665,10 +1665,16 @@ callstd \type .endm - .macro giveitem_std item:req, amount=1, function=0 + .macro giveitem_std item:req, amount=1 setorcopyvar VAR_0x8000, \item setorcopyvar VAR_0x8001, \amount - callstd \function + callstd STD_OBTAIN_ITEM + .endm + + .macro finditem_std item:req, amount=1 + setorcopyvar VAR_0x8000, \item + setorcopyvar VAR_0x8001, \amount + callstd STD_FIND_ITEM .endm .macro givedecoration_std decoration:req -- cgit v1.2.3 From 96ec5e1b84f2c1d189dc67b53a113d0299b4f37b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 15 Dec 2019 11:42:50 -0500 Subject: Use fadescreen constants --- asm/macros/event.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 96971b583..8b43d0821 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1101,16 +1101,16 @@ .2byte \index .endm - @ Fades the screen to and from black and white. Mode 0x00 fades from black, mode 0x01 fades out to black, mode 0x2 fades in from white, and mode 0x3 fades out to white. - .macro fadescreen effect:req + @ Fades the screen to and from black and white. Modes are FADE_(TO/FROM)_(WHITE/BLACK) + .macro fadescreen mode:req .byte 0x97 - .byte \effect + .byte \mode .endm - @ Fades the screen to and from black and white. Mode 0x00 fades from black, mode 0x01 fades out to black, mode 0x2 fades in from white, and mode 0x3 fades out to white. Other modes may exist. - .macro fadescreenspeed effect:req, speed:req + @ Fades the screen to and from black and white. Modes are FADE_(TO/FROM)_(WHITE/BLACK) + .macro fadescreenspeed mode:req, speed:req .byte 0x98 - .byte \effect + .byte \mode .byte \speed .endm @@ -1517,9 +1517,9 @@ .4byte \pointer .endm - .macro fadescreenswapbuffers byte:req + .macro fadescreenswapbuffers mode:req .byte 0xdc - .byte \byte + .byte \mode .endm .macro buffertrainerclassname out:req, class:req -- cgit v1.2.3 From d1cf9006fb4b29e63302c69c912e431a873626c0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 17 Dec 2019 03:24:44 -0500 Subject: Document some warp/field screen effect --- asm/macros/event.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 96971b583..7aa4a19c9 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1539,7 +1539,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 -- cgit v1.2.3 From ddfa0c6298f4c4dcde9b40782bbdf41867bff761 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 14 Dec 2019 03:58:20 -0500 Subject: Document Battle Tower scripts --- asm/macros/battle_frontier/battle_tower.inc | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'asm/macros') 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 -- cgit v1.2.3 From d137a1a0c11737e1cbe9ca9fbeba74913ad63eab Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 18 Dec 2019 19:12:09 -0500 Subject: Use constants in compare macro --- asm/macros/event.inc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 8b43d0821..951e295a6 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 -- cgit v1.2.3 From 9e08cfe55f632fd749ce64c0e54eb93bd10926dc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 18 Dec 2019 19:22:39 -0500 Subject: Remove uses of compare_var_to --- asm/macros/event.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 951e295a6..764dcf054 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -235,7 +235,7 @@ @ Generic compare macro which attempts to deduce argument types based on their values @ 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) + .if ((\arg >= VARS_START && \arg <= VARS_END) || (\arg >= SPECIAL_VARS_START && \arg <= SPECIAL_VARS_END)) compare_var_to_var \var, \arg .else compare_var_to_value \var, \arg -- cgit v1.2.3 From 76280199527e9ba6806f1e17d6460f13a132c2e3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 20 Dec 2019 08:47:31 -0500 Subject: Remove references to LASTRESULT --- asm/macros/event.inc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 8b43d0821..15e74cbb6 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -465,12 +465,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 +484,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 +536,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 +818,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; 0 for "NO" or if the user pressed B, and 1 for "YES". .macro yesnobox x:req, y:req .byte 0x6e .byte \x @@ -925,7 +925,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 +1045,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 +1065,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 +1154,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 +1437,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 -- cgit v1.2.3 From 63c8cf97d1e47573ba8c5bcdf23543013a0f2a14 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 18 Dec 2019 02:32:52 -0500 Subject: Document Battle Dome scripts and some battle_dome.c --- asm/macros/battle_frontier/battle_dome.inc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_dome.inc b/asm/macros/battle_frontier/battle_dome.inc index 882c82e8b..836d4eecd 100644 --- a/asm/macros/battle_frontier/battle_dome.inc +++ b/asm/macros/battle_frontier/battle_dome.inc @@ -23,13 +23,13 @@ special CallBattleDomeFunction .endm - @ + @ Buffer the name of the current round to gStringVar1 .macro dome_getroundtext setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_ROUND_TEXT special CallBattleDomeFunction .endm - @ + @ Buffer the name of the opponent to gStringVar2 and the name of the round to gStringVar1 .macro dome_getopponentname setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_OPPONENT_NAME special CallBattleDomeFunction @@ -41,7 +41,7 @@ special CallBattleDomeFunction .endm - @ + @ Show the page that gives information on the next opponent .macro dome_showopponentinfo setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_OPPONENT_INFO special CallBattleDomeFunction @@ -65,7 +65,7 @@ special CallBattleDomeFunction .endm - @ + @ Set the object event gfx id for the opponent .macro dome_setopponentgfx setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_OPPONENT_GFX special CallBattleDomeFunction @@ -77,10 +77,10 @@ special CallBattleDomeFunction .endm - @ - .macro dome_resolvewinners arg:req + @ Decides the winners of NPC vs NPC matches, and eliminates either the player or their opponent depending on the playerStatus (DOME_PLAYER_*) + .macro dome_resolvewinners playerStatus:req setvar VAR_0x8004, BATTLE_DOME_FUNC_RESOLVE_WINNERS - setvar VAR_0x8005, \arg + setvar VAR_0x8005, \playerStatus special CallBattleDomeFunction .endm @@ -109,13 +109,13 @@ special CallBattleDomeFunction .endm - @ + @ Reset the held items of the mons that just battled to what they were prior to battling .macro dome_restorehelditems setvar VAR_0x8004, BATTLE_DOME_FUNC_RESTORE_HELD_ITEMS special CallBattleDomeFunction .endm - @ + @ Reduce the players party to the selected mons, used to reduce down to the 2 selected for battle .macro dome_reduceparty setvar VAR_0x8004, BATTLE_DOME_FUNC_REDUCE_PARTY special CallBattleDomeFunction @@ -133,9 +133,9 @@ special CallBattleDomeFunction .endm - @ TODO: Document this macro and its function - .macro dome_21 - setvar VAR_0x8004, BATTLE_DOME_FUNC_21 + @ Performs a random tourney to initialize the results board before the player has entered a challenge + .macro dome_initresultstree + setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_RESULTS_TREE special CallBattleDomeFunction .endm -- cgit v1.2.3 From 324a81ed5db07985a0f11257bc372043d66ed552 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 20 Dec 2019 18:53:58 -0500 Subject: Reword yesnobox comment --- asm/macros/event.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 15e74cbb6..14a1447ee 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -818,7 +818,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 VAR_RESULT; 0 for "NO" or if the user pressed B, and 1 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 -- cgit v1.2.3 From 3efc8199d49862a9d5bfc5f5bd11986c9848da8e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 21 Dec 2019 04:27:12 -0500 Subject: More battle_dome.c documentation --- asm/macros/battle_frontier/battle_dome.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_dome.inc b/asm/macros/battle_frontier/battle_dome.inc index 836d4eecd..07d6534eb 100644 --- a/asm/macros/battle_frontier/battle_dome.inc +++ b/asm/macros/battle_frontier/battle_dome.inc @@ -97,7 +97,7 @@ special CallBattleDomeFunction .endm - @ + @ Sets the facility trainer/mon set pointers .macro dome_settrainers setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_TRAINERS special CallBattleDomeFunction -- cgit v1.2.3 From fb5bea98ce28044917451d83695991693fb0b64a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 5 Jan 2020 10:50:32 -0500 Subject: More battle_dome.c doc --- asm/macros/battle_frontier/battle_dome.inc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/battle_frontier/battle_dome.inc b/asm/macros/battle_frontier/battle_dome.inc index 07d6534eb..9adbcc54e 100644 --- a/asm/macros/battle_frontier/battle_dome.inc +++ b/asm/macros/battle_frontier/battle_dome.inc @@ -1,5 +1,3 @@ -@ TODO: Add explanatory comments to macros - @ Initialize the Battle Dome challenge .macro dome_init setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT @@ -35,7 +33,7 @@ special CallBattleDomeFunction .endm - @ + @ Choose which of the opponents mons to use in battle and load them into the enemy party .macro dome_initopponentparty setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_OPPONENT_PARTY special CallBattleDomeFunction @@ -47,19 +45,19 @@ special CallBattleDomeFunction .endm - @ + @ Displays the tourney tree for the current tourney .macro dome_showtourneytree setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_TOURNEY_TREE special CallBattleDomeFunction .endm - @ - .macro dome_showresultstree - setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_PREV_RESULTS_TREE + @ Displays the tourney tree for the results of the previous tourney. Before the player enters their first tourney this is a random tourney generated by dome_initresultstree + .macro dome_showprevtourneytree + setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_PREV_TOURNEY_TREE special CallBattleDomeFunction .endm - @ + @ Sets gTrainerBattleOpponent_A to the trainer ID of the next opponent .macro dome_setopponent setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_OPPONENT_ID special CallBattleDomeFunction @@ -71,7 +69,7 @@ special CallBattleDomeFunction .endm - @ + @ A non-interactive version of the tourney tree shown when a round is completed .macro dome_showstatictourneytree setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_STATIC_TOURNEY_TREE special CallBattleDomeFunction @@ -121,7 +119,7 @@ special CallBattleDomeFunction .endm - @ + @ Compares the initial tournament ranking (seed) of the player to opponent A. Returns 1 if the player's seed is better, 2 if the opponent's seed is better. .macro dome_compareseeds setvar VAR_0x8004, BATTLE_DOME_FUNC_COMPARE_SEEDS special CallBattleDomeFunction @@ -139,7 +137,7 @@ special CallBattleDomeFunction .endm - @ + @ Generates the tourney trainers and their parties, and seeds them in the tourney tree .macro dome_inittrainers setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_TRAINERS special CallBattleDomeFunction -- cgit v1.2.3 From f2e7b1507e564ba3b6b027a17aeeec2f89fba8c8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 11 Jan 2020 12:02:58 -0500 Subject: Port some macro/script fixes from pokefirered --- asm/macros/event.inc | 54 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 12 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 5865856c3..b26851148 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -469,14 +469,14 @@ .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 VAR_RESULT will be set to TRUE; otherwise, VAR_RESULT is set to FALSE. - .macro giveitem index:req, quantity:req + .macro additem index:req, quantity=1 .byte 0x44 .2byte \index .2byte \quantity .endm @ Removes quantity of item index from the player's Bag. - .macro takeitem index:req, quantity:req + .macro takeitem index:req, quantity=1 .byte 0x45 .2byte \index .2byte \quantity @@ -517,7 +517,7 @@ .endm @ Adds decoration to the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro givedecoration decoration:req + .macro adddecoration decoration:req .byte 0x4b .2byte \decoration .endm @@ -1564,12 +1564,12 @@ .macro goto_if_unset flag:req, dest:req checkflag \flag - goto_if 0, \dest + goto_if FALSE, \dest .endm .macro goto_if_set flag:req, dest:req checkflag \flag - goto_if 1, \dest + goto_if TRUE, \dest .endm .macro goto_if_lt dest:req @ LESS THAN @@ -1598,12 +1598,12 @@ .macro call_if_unset flag:req, dest:req checkflag \flag - call_if 0, \dest + call_if FALSE, \dest .endm .macro call_if_set flag:req, dest:req checkflag \flag - call_if 1, \dest + call_if TRUE, \dest .endm .macro call_if_lt dest:req @ LESS THAN @@ -1631,11 +1631,41 @@ .endm .macro vgoto_if_eq dest:req - vgoto_if 1, \dest + vgoto_if TRUE, \dest .endm .macro vgoto_if_ne dest:req - vgoto_if 0, \dest + vgoto_if FALSE, \dest + .endm + + .macro vgoto_if_unset flag:req, dest:req + checkflag \flag + vgoto_if FALSE, \dest + .endm + + .macro vgoto_if_set flag:req, dest:req + checkflag \flag + vgoto_if TRUE, \dest + .endm + + .macro goto_if_defeated trainer:req, dest:req + checktrainerflag \trainer + goto_if TRUE, \dest + .endm + + .macro goto_if_undefeated trainer:req, dest:req + checktrainerflag \trainer + goto_if FALSE, \dest + .endm + + .macro call_if_defeated trainer:req, dest:req + checktrainerflag \trainer + call_if TRUE, \dest + .endm + + .macro call_if_undefeated trainer:req, dest:req + checktrainerflag \trainer + call_if FALSE, \dest .endm .macro switch var:req @@ -1663,19 +1693,19 @@ callstd \type .endm - .macro giveitem_std item:req, amount=1 + .macro giveitem item:req, amount=1 setorcopyvar VAR_0x8000, \item setorcopyvar VAR_0x8001, \amount callstd STD_OBTAIN_ITEM .endm - .macro finditem_std item:req, amount=1 + .macro finditem item:req, amount=1 setorcopyvar VAR_0x8000, \item setorcopyvar VAR_0x8001, \amount callstd STD_FIND_ITEM .endm - .macro givedecoration_std decoration:req + .macro givedecoration decoration:req setorcopyvar VAR_0x8000, \decoration callstd STD_OBTAIN_DECORATION .endm -- cgit v1.2.3 From e497fc64e302f6c9257da5a9435d2905e2e780a8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 12 Jan 2020 20:20:02 -0500 Subject: if_undefeated macro to if_not_defeated --- asm/macros/event.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index b26851148..298e8eb7c 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -1653,7 +1653,7 @@ goto_if TRUE, \dest .endm - .macro goto_if_undefeated trainer:req, dest:req + .macro goto_if_not_defeated trainer:req, dest:req checktrainerflag \trainer goto_if FALSE, \dest .endm @@ -1663,7 +1663,7 @@ call_if TRUE, \dest .endm - .macro call_if_undefeated trainer:req, dest:req + .macro call_if_not_defeated trainer:req, dest:req checktrainerflag \trainer call_if FALSE, \dest .endm -- cgit v1.2.3 From c19289596da7ccd86219d3f7e246a2e48a2f9ed7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 12 Jan 2020 23:24:52 -0500 Subject: Give/Take to Add/Remove for silent script macros --- asm/macros/event.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'asm/macros') diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 298e8eb7c..abb2eb13a 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -476,7 +476,7 @@ .endm @ Removes quantity of item index from the player's Bag. - .macro takeitem index:req, quantity=1 + .macro removeitem index:req, quantity=1 .byte 0x45 .2byte \index .2byte \quantity @@ -503,7 +503,7 @@ .endm @ Adds a quantity amount of item index to the player's PC. Both arguments can be variables. - .macro givepcitem index:req, quantity:req + .macro addpcitem index:req, quantity:req .byte 0x49 .2byte \index .2byte \quantity @@ -523,7 +523,7 @@ .endm @ Removes a decoration from the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro takedecoration decoration:req + .macro removedecoration decoration:req .byte 0x4c .2byte \decoration .endm @@ -1050,14 +1050,14 @@ .endm @ If check is 0x00, this command adds value to the player's money. - .macro givemoney value:req, check:req + .macro addmoney value:req, check:req .byte 0x90 .4byte \value .byte \check .endm @ If check is 0x00, this command subtracts value from the player's money. - .macro takemoney value:req, check:req + .macro removemoney value:req, check:req .byte 0x91 .4byte \value .byte \check @@ -1281,12 +1281,12 @@ .2byte \out .endm - .macro givecoins count:req + .macro addcoins count:req .byte 0xb4 .2byte \count .endm - .macro takecoins count:req + .macro removecoins count:req .byte 0xb5 .2byte \count .endm -- cgit v1.2.3