summaryrefslogtreecommitdiff
path: root/home/battle.asm
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2020-02-22 12:52:13 +0100
committermid-kid <esteve.varela@gmail.com>2020-02-22 12:52:13 +0100
commit7bd8d56ff93e14839d304cc3a3a2a182e992f909 (patch)
treedbf48363b85804dadedfbd59e3b5d9336e844804 /home/battle.asm
parent43eff93861b5b00473e567e6449c64f039f8f4ba (diff)
Implement suggestions in PR #687
Merge mon_stats.asm, cry.asm, print_level.asm, and mon_data.asm into pokemon.asm Merge mon_party.asm into battle.asm Merge menu.asm, menu_window.asm, and menu2.asm into menu.asm
Diffstat (limited to 'home/battle.asm')
-rw-r--r--home/battle.asm35
1 files changed, 35 insertions, 0 deletions
diff --git a/home/battle.asm b/home/battle.asm
index fff6b7d42..77ec0b026 100644
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -1,3 +1,38 @@
+GetPartyParamLocation::
+; Get the location of parameter a from wCurPartyMon in hl
+ push bc
+ ld hl, wPartyMons
+ ld c, a
+ ld b, 0
+ add hl, bc
+ ld a, [wCurPartyMon]
+ call GetPartyLocation
+ pop bc
+ ret
+
+GetPartyLocation::
+; Add the length of a PartyMon struct to hl a times.
+ ld bc, PARTYMON_STRUCT_LENGTH
+ jp AddNTimes
+
+Unreferenced_GetDexNumber::
+; Probably used in gen 1 to convert index number to dex number
+; Not required in gen 2 because index number == dex number
+ push hl
+ ld a, b
+ dec a
+ ld b, 0
+ add hl, bc
+ ld hl, BaseData + BASE_DEX_NO
+ ld bc, BASE_DATA_SIZE
+ call AddNTimes
+ ld a, BANK(BaseData)
+ call GetFarHalfword
+ ld b, l
+ ld c, h
+ pop hl
+ ret
+
UserPartyAttr::
push af
ldh a, [hBattleTurn]