summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorGriffinR <griffin.richards@comcast.net>2019-11-28 22:46:39 -0500
committerhuderlem <huderlem@gmail.com>2019-12-05 21:11:17 -0600
commit9b3d1cfab61fff89cae64c093f28775fdbad1027 (patch)
treed446b1559526f144906cf4fc1a13ae3da07fea43 /asm/macros
parentbe17c1602d31d6f7d6601f27f2808b79a5644f7f (diff)
Set up Battle Dome and Tower macros
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/battle_frontier/battle_arena.inc4
-rw-r--r--asm/macros/battle_frontier/battle_dome.inc141
-rw-r--r--asm/macros/battle_frontier/battle_tower.inc61
3 files changed, 202 insertions, 4 deletions
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