aboutsummaryrefslogtreecommitdiffstats
path: root/home
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2014-06-16 13:57:26 -0700
committeryenatch <yenatch@gmail.com>2014-06-16 13:57:26 -0700
commitb36f793667924f868282ce979fabab3e95d642a5 (patch)
tree580af2e7c0afc016ccf7a31b44e98898321176ac /home
parentUse macros to define predefs. (diff)
downloadpokeyellow-b36f793667924f868282ce979fabab3e95d642a5.tar.gz
pokeyellow-b36f793667924f868282ce979fabab3e95d642a5.tar.xz
pokeyellow-b36f793667924f868282ce979fabab3e95d642a5.zip
Use macros for predef calls/jumps instead of static ids.
Diffstat (limited to '')
-rw-r--r--home.asm39
-rw-r--r--home/overworld.asm27
2 files changed, 22 insertions, 44 deletions
diff --git a/home.asm b/home.asm
index 5062b18c..e9dc60c3 100644
--- a/home.asm
+++ b/home.asm
@@ -275,8 +275,7 @@ LoadFrontSpriteByMonIndex:: ; 1389 (0:1389)
push af
ld a, [wcf91]
ld [wd11e], a
- ld a, $3a
- call Predef
+ predef IndexToPokedex
ld hl, wd11e
ld a, [hl]
pop bc
@@ -576,8 +575,7 @@ GetMonHeader:: ; 1537 (0:1537)
jr z,.specialID
cp a,MEW
jr z,.mew
- ld a,$3a
- call Predef ; convert pokemon ID in [wd11e] to pokedex number
+ predef IndexToPokedex ; convert pokemon ID in [wd11e] to pokedex number
ld a,[wd11e]
dec a
ld bc,28
@@ -1509,8 +1507,7 @@ PokeCenterSignText:: ; 24ef (0:24ef)
Predef5CText:: ; 24f4 (0:24f4)
; XXX better label (what does predef $5C do?)
db $08 ; asm
- ld a, $5c
- call Predef
+ predef PickupItem
jp TextScriptEnd
@@ -1862,8 +1859,7 @@ AddAmountSoldToMoney:: ; 2b9e (0:2b9e)
ld de,wPlayerMoney + 2
ld hl,$ffa1 ; total price of items
ld c,3 ; length of money in bytes
- ld a,$0b
- call Predef ; add total price to money
+ predef AddBCDPredef ; add total price to money
ld a,$13
ld [wd125],a
call DisplayTextBoxID ; redraw money text box
@@ -2182,8 +2178,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
ld de,$ffa1
ld hl,$ff8d
push bc
- ld a,$0b
- call Predef ; add the individual price to the current sum
+ predef AddBCDPredef ; add the individual price to the current sum
pop bc
dec b
jr nz,.addLoop
@@ -2195,8 +2190,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
ld [$ffa3],a
ld a,$02
ld [$ffa4],a
- ld a,$0d
- call Predef ; halves the price
+ predef DivideBCDPredef3 ; halves the price
; store the halved price
ld a,[$ffa2]
ld [$ff9f],a
@@ -2843,8 +2837,7 @@ ReadTrainerHeaderInfo:: ; 3193 (0:3193)
ret
TrainerFlagAction::
- ld a, $10 ; FlagActionPredef
- jp Predef
+ predef_jump FlagActionPredef
; direct talking to a trainer (rather than getting seen by one)
TalkToTrainer:: ; 31cc (0:31cc)
@@ -2900,8 +2893,7 @@ CheckFightingMapTrainers:: ; 3219 (0:3219)
ld [wcd4f], a
xor a
ld [wcd50], a
- ld a, $4c
- call Predef
+ predef EmotionBubble
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
xor a
@@ -2960,8 +2952,7 @@ EndTrainerBattle:: ; 3275 (0:3275)
inc hl
ld a, [hl]
ld [wcc4d], a ; load corresponding missable object index and remove it
- ld a, $11
- call Predef
+ predef HideObject
.skipRemoveSprite
ld hl, wd730
bit 4, [hl]
@@ -3048,8 +3039,7 @@ CheckForEngagingTrainers:: ; 3306 (0:3306)
ld a, [wcf13]
swap a
ld [wTrainerSpriteOffset], a ; wWhichTrade
- ld a, $39
- call Predef
+ predef TrainerEngage
pop de
pop hl
ld a, [wTrainerSpriteOffset] ; wWhichTrade
@@ -3258,8 +3248,7 @@ IsItemInBag:: ; 3493 (0:3493)
; set zero flag if item isn't in player's bag
; else reset zero flag
; related to Pokémon Tower and ghosts
- ld a,$1C
- call Predef
+ predef IsItemInBag_
ld a,b
and a
ret
@@ -4011,8 +4000,7 @@ WaitForTextScrollButtonPress:: ; 3865 (0:3865)
call HandleDownArrowBlinkTiming
pop hl
call JoypadLowSensitivity
- ld a, $2d
- call Predef
+ predef Func_5a5f
ld a, [$ffb5]
and A_BUTTON | B_BUTTON
jr z, .asm_3872
@@ -5079,8 +5067,7 @@ GoPAL_SET:: ; 3def (0:3def)
ld a,[wcf1b]
and a
ret z
- ld a,$45
- jp Predef
+ predef_jump Func_71ddf
GetHealthBarColor::
; Return at hl the palette of
diff --git a/home/overworld.asm b/home/overworld.asm
index 941b50cb..872d63ee 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -98,8 +98,7 @@ OverworldLoopLessDelay::
and a
jp z,OverworldLoop
.displayDialogue
- ld a,$35
- call Predef ; check what is in front of the player
+ predef Func_c586 ; check what is in front of the player
call UpdateSprites ; move sprites
ld a,[wFlags_0xcd60]
bit 2,a
@@ -117,8 +116,7 @@ OverworldLoopLessDelay::
ld a,$00
ld [wcc47],a
jr z,.changeMap
- ld a,$52
- call Predef
+ predef LoadSAV
ld a,[W_CURMAP]
ld [wd71a],a
call Func_62ce
@@ -301,8 +299,7 @@ OverworldLoopLessDelay::
ld a,[W_ISINBATTLE]
and a
jp nz,CheckWarpsNoCollision
- ld a,$13
- call Predef ; decrement HP of poisoned pokemon
+ predef Func_c69c ; decrement HP of poisoned pokemon
ld a,[wd12d]
and a
jp nz,HandleBlackOut ; if all pokemon fainted
@@ -1070,8 +1067,7 @@ IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23)
and a
jr z,.extendRangeOverCounter
; if there are signs
- ld a,$35
- call Predef ; get the coordinates in front of the player in de
+ predef Func_c586 ; get the coordinates in front of the player in de
ld hl,wd4b1 ; start of sign coordinates
ld a,[wd4b0] ; number of signs in the map
ld b,a
@@ -1105,8 +1101,7 @@ IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23)
jr nz,.signLoop
; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC
.extendRangeOverCounter
- ld a,$35
- call Predef ; get the tile in front of the player in c
+ predef Func_c586 ; get the tile in front of the player in c
ld hl,W_TILESETTALKINGOVERTILES ; list of tiles that extend talking range (counter tiles)
ld b,$03
ld d,$20 ; talking range in pixels (long range)
@@ -1246,8 +1241,7 @@ CollisionCheckOnLand:: ; 0bd1 (0:0bd1)
; function that checks if the tile in front of the player is passable
; clears carry if it is, sets carry if not
CheckTilePassable:: ; 0c10 (0:0c10)
- ld a,$35
- call Predef ; get tile in front of player
+ predef Func_c586 ; get tile in front of player
ld a,[wcfc6] ; tile in front of player
ld c,a
ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles
@@ -1271,8 +1265,7 @@ CheckTilePassable:: ; 0c10 (0:0c10)
; sets carry if there is a collision and unsets carry if not
CheckForJumpingAndTilePairCollisions:: ; 0c2a (0:0c2a)
push hl
- ld a,$35
- call Predef ; get the tile in front of the player
+ predef Func_c586 ; get the tile in front of the player
push de
push bc
callba HandleLedges ; check if the player is trying to jump a ledge
@@ -1920,8 +1913,7 @@ CollisionCheckOnWater:: ; 0fb7 (0:0fb7)
ld hl,TilePairCollisionsWater
call CheckForJumpingAndTilePairCollisions
jr c,.collision
- ld a,$35
- call Predef ; get tile in front of player (puts it in c and [wcfc6])
+ predef Func_c586 ; get tile in front of player (puts it in c and [wcfc6])
ld a,[wcfc6] ; tile in front of player
cp a,$14 ; water tile
jr z,.noCollision ; keep surfing if it's a water tile
@@ -2274,8 +2266,7 @@ LoadMapHeader:: ; 107c (0:107c)
dec b
jp nz,.loadSpriteLoop
.finishUp
- ld a,$19
- call Predef ; load tileset data
+ predef Func_c754 ; load tileset data
callab LoadWildData ; load wild pokemon data
pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose)
ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks