summaryrefslogtreecommitdiff
path: root/home.asm
diff options
context:
space:
mode:
authorDaniel Harding <corrnondacqb@yahoo.com>2015-07-20 17:40:25 -0500
committerDaniel Harding <corrnondacqb@yahoo.com>2015-07-20 17:40:25 -0500
commit13e28b0ece7c7888cba792cc6f7219b384213427 (patch)
tree4dcd58e0fe7ac33bf38817f423754dc758cb902f /home.asm
parent64b4cf624fe2175e2c7539b91bc41b6dae28a00e (diff)
parentdb7d941d22d89cf8d6d13cbf768208c5cf2ac2c2 (diff)
Merge pull request #106 from YamaArashi/master
jpab/jpba macros
Diffstat (limited to 'home.asm')
-rw-r--r--home.asm54
1 files changed, 15 insertions, 39 deletions
diff --git a/home.asm b/home.asm
index 69634a7c..6bb54df2 100644
--- a/home.asm
+++ b/home.asm
@@ -253,9 +253,7 @@ DrawHPBar:: ; 1336 (0:1336)
; wLoadedMon = base address of pokemon data
; W_MONHDEXNUM = base address of base stats
LoadMonData:: ; 1372 (0:1372)
- ld hl, LoadMonData_
- ld b, BANK(LoadMonData_)
- jp Bankswitch
+ jpab LoadMonData_
OverwritewMoves:: ; 137a (0:137a)
@@ -1317,9 +1315,7 @@ CountSetBits:: ; 2b7f (0:2b7f)
; subtracts the amount the player paid from their money
; sets carry flag if there is enough money and unsets carry flag if not
SubtractAmountPaidFromMoney:: ; 2b96 (0:2b96)
- ld b,BANK(SubtractAmountPaidFromMoney_)
- ld hl,SubtractAmountPaidFromMoney_
- jp Bankswitch
+ jpba SubtractAmountPaidFromMoney_
; adds the amount the player sold to their money
AddAmountSoldToMoney:: ; 2b9e (0:2b9e)
@@ -2077,9 +2073,7 @@ ReloadTilesetTilePatterns:: ; 3090 (0:3090)
ChooseFlyDestination:: ; 30a9 (0:30a9)
ld hl,wd72e
res 4,[hl]
- ld b, BANK(LoadTownMap_Fly)
- ld hl, LoadTownMap_Fly
- jp Bankswitch
+ jpba LoadTownMap_Fly
; causes the text box to close without waiting for a button press after displaying text
DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6)
@@ -2097,9 +2091,7 @@ DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6)
; 01: successful
; 02: not able to be used right now, no extra menu displayed (only certain items use this)
UseItem:: ; 30bc (0:30bc)
- ld b,BANK(UseItem_)
- ld hl,UseItem_
- jp Bankswitch
+ jpba UseItem_
; confirms the item toss and then tosses the item
; INPUT:
@@ -2201,14 +2193,10 @@ RunNPCMovementScript:: ; 310e (0:310e)
dw PewterMuseumGuyMovementScriptPointerTable
dw PewterGymGuyMovementScriptPointerTable
.playerStepOutFromDoor
- ld b, BANK(PlayerStepOutFromDoor)
- ld hl, PlayerStepOutFromDoor
- jp Bankswitch
+ jpba PlayerStepOutFromDoor
EndNPCMovementScript:: ; 314e (0:314e)
- ld b, BANK(_EndNPCMovementScript)
- ld hl, _EndNPCMovementScript
- jp Bankswitch
+ jpba _EndNPCMovementScript
EmptyFunc2:: ; 3156 (0:3156)
ret
@@ -2309,7 +2297,7 @@ TalkToTrainer:: ; 31cc (0:31cc)
call ReadTrainerHeaderInfo ; read flag's byte ptr
ld a, [wTrainerHeaderFlagBit]
ld c, a
- ld b, $2
+ ld b, FLAG_TEST
call TrainerFlagAction ; read trainer's flag
ld a, c
and a
@@ -2404,7 +2392,7 @@ EndTrainerBattle:: ; 3275 (0:3275)
call ReadTrainerHeaderInfo
ld a, [wTrainerHeaderFlagBit]
ld c, a
- ld b, $1
+ ld b, FLAG_SET
call TrainerFlagAction ; flag trainer as fought
ld a, [W_ENEMYMONORTRAINERCLASS]
cp $c8
@@ -2434,9 +2422,7 @@ ResetButtonPressedAndMapScript:: ; 32c1 (0:32c1)
; calls TrainerWalkUpToPlayer
TrainerWalkUpToPlayer_Bank0:: ; 32cf (0:32cf)
- ld b, BANK(TrainerWalkUpToPlayer)
- ld hl, TrainerWalkUpToPlayer
- jp Bankswitch
+ jpba TrainerWalkUpToPlayer
; sets opponent type and mon set/lvl based on the engaging trainer data
InitBattleEnemyParameters:: ; 32d7 (0:32d7)
@@ -2484,7 +2470,7 @@ CheckForEngagingTrainers:: ; 3306 (0:3306)
ret z
ld a, $2
call ReadTrainerHeaderInfo ; read trainer flag's byte ptr
- ld b, $2
+ ld b, FLAG_TEST
ld a, [wTrainerHeaderFlagBit]
ld c, a
call TrainerFlagAction ; read trainer flag
@@ -2726,9 +2712,7 @@ IsItemInBag:: ; 3493 (0:3493)
DisplayPokedex:: ; 349b (0:349b)
ld [wd11e], a
- ld b, BANK(_DisplayPokedex)
- ld hl, _DisplayPokedex
- jp Bankswitch
+ jpba _DisplayPokedex
SetSpriteFacingDirectionAndDelay:: ; 34a6 (0:34a6)
call SetSpriteFacingDirection
@@ -2937,9 +2921,7 @@ GetTrainerInformation:: ; 3566 (0:3566)
ret
GetTrainerName:: ; 359e (0:359e)
- ld b, BANK(GetTrainerName_)
- ld hl, GetTrainerName_
- jp Bankswitch
+ jpba GetTrainerName_
HasEnoughMoney::
@@ -3604,9 +3586,7 @@ CopyDataUntil:: ; 3913 (0:3913)
; [wRemoveMonFromBox] == 0 specifies the party.
; [wRemoveMonFromBox] != 0 specifies the current box.
RemovePokemon:: ; 391f (0:391f)
- ld hl, _RemovePokemon
- ld b, BANK(_RemovePokemon)
- jp Bankswitch
+ jpab _RemovePokemon
AddPartyMon:: ; 3927 (0:3927)
push hl
@@ -4590,9 +4570,7 @@ GivePokemon::
ld [W_CURENEMYLVL], a
xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a
- ld b, BANK(_GivePokemon)
- ld hl, _GivePokemon
- jp Bankswitch
+ jpba _GivePokemon
Random::
@@ -4613,9 +4591,7 @@ INCLUDE "home/predef.asm"
Func_3ead:: ; 3ead (0:3ead)
- ld b, BANK(CinnabarGymQuiz_1eb0a)
- ld hl, CinnabarGymQuiz_1eb0a
- jp Bankswitch
+ jpba CinnabarGymQuiz_1eb0a
CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ; 3eb5 (0:3eb5)
ld a, [H_LOADEDROMBANK]