shithub: pokecrystal

Download patch

ref: 181840cf434bd70cd8ec8f8c9770c81a5bf99ea5
parent: eb5a7afe2b4baef9b2f8ad1d3979aaccbe65aab1
author: Mr Wint <[email protected]>
date: Tue Oct 1 23:20:48 EDT 2013

* even more callab/callba macros

--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -5095,9 +5095,7 @@
 	push bc
 
 	ld b, a
-	ld hl, $45ec
-	ld a, $f
-	rst $8
+	callab Function3c5ec
 	ld a, b
 
 	pop bc
@@ -11024,25 +11022,19 @@
 
 
 Function0x37ec0: ; 37ec0
-	ld a, $3e
-	ld hl, $7d54
-	rst $8
+	callba Functionfbd54
 	ret
 ; 37ec7
 
 
 Function0x37ec7: ; 37ec7
-	ld a, $3e
-	ld hl, $7d71
-	rst $8
+	callba Functionfbd71
 	ret
 ; 37ece
 
 
 Function0x37ece: ; 37ece
-	ld a, $3e
-	ld hl, $7d69
-	rst $8
+	callba Functionfbd69
 	ret
 ; 37ed5
 
@@ -11052,9 +11044,7 @@
 	push hl
 	push de
 	push bc
-	ld a, $13
-	ld hl, $6a44
-	rst $8
+	callba Function4ea44
 	pop bc
 	pop de
 	pop hl
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -214,9 +214,7 @@
 	ld e, a
 	call GetScriptByte
 	ld d, a
-	ld a, $3
-	ld hl, $401b
-	rst $8
+	callba Functionc01b
 	ret
 ; 0x96e35
 
@@ -421,9 +419,7 @@
 	ld a, [$c2dd]
 .asm_96f1f
 	ld [$d108], a
-	ld a, $9
-	ld hl, $44e3
-	rst $8
+	callba Function244e3
 	ret
 ; 0x96f29
 
@@ -430,9 +426,7 @@
 Script_pokepicyesorno: ; 0x96f29
 ; script command 0x57
 
-	ld a, $9
-	ld hl, $4528
-	rst $8
+	callba Function24528
 	ret
 ; 0x96f30
 
@@ -473,9 +467,7 @@
 	call Function106c
 	call GetScriptByte
 	ld c, a
-	ld a, $47
-	ld hl, $4000
-	rst $8
+	callba Function11c000
 	ret
 ; 0x96f60
 
@@ -579,9 +571,7 @@
 Script_specialsound: ; 0x96fe4
 ; script command 0x88
 
-	ld a, $3
-	ld hl, $543d
-	rst $8
+	callba CheckItemPocket
 	ld a, [$d142]
 	cp TM_HM
 	ld de, SFX_GET_TM
@@ -660,9 +650,7 @@
 	ld d, a
 	ld a, [ScriptBank]
 	ld b, a
-	ld a, $5
-	ld hl, $5a45
-	rst $8
+	callba OpenMartDialog
 	ret
 ; 0x9707c
 
@@ -679,9 +667,7 @@
 	ld d, a
 	ld a, [ScriptBank]
 	ld b, a
-	ld a, $4
-	ld hl, $742d
-	rst $8
+	callba Function1342d
 	ret c
 	ld a, $1
 	ld [$c2dd], a
@@ -695,9 +681,7 @@
 
 	call GetScriptByte
 	ld e, a
-	ld a, $3f
-	ld hl, $4ba8
-	rst $8
+	callba Functionfcba8
 	ret
 ; 0x970a4
 
@@ -712,9 +696,7 @@
 	ld d, a
 	ld a, [ScriptBank]
 	ld b, a
-	ld a, $24
-	ld hl, $429a
-	rst $8
+	callba Function9029a
 	ret
 ; 0x970b7
 
@@ -721,9 +703,7 @@
 Script_hangup: ; 0x970b7
 ; script command 0x99
 
-	ld a, $24
-	ld hl, $42eb
-	rst $8
+	callba Function902eb
 	ret
 ; 0x970be
 
@@ -736,9 +716,7 @@
 	jr c, .asm_970d6 ; 0x970c1 $13
 	call GetScriptByte
 	ld c, a
-	ld a, $24
-	ld hl, $4000
-	rst $8
+	callba Function90000
 	jr c, .asm_970d2 ; 0x970cd $3
 	xor a
 	jr .asm_970db ; 0x970d0 $9
@@ -760,9 +738,7 @@
 
 	call GetScriptByte
 	ld b, a
-	ld a, $9
-	ld hl, $6f59
-	rst $8
+	callba Function26f59
 	ld h, d
 	ld l, e
 	jp ScriptJump
@@ -792,9 +768,7 @@
 	ld d, a
 	call GetScriptByte
 	ld e, a
-	ld a, $3
-	ld hl, $4403
-	rst $8
+	callba Functionc403
 	ret
 ; 0x9710f
 
@@ -898,9 +872,7 @@
 
 	ld a, [$d22f]
 	ld e, a
-	ld a, $3a
-	ld hl, $500a
-	rst $8
+	callba PlayTrainerEncounterMusic
 	ret
 ; 0x97185
 
@@ -968,9 +940,7 @@
 Script_warpsound: ; 0x971c7
 ; script command 0x87
 
-	ld a, $5
-	ld hl, $4a07
-	rst $8
+	callba Function14a07
 	call StartSFX
 	ret
 ; 0x971d1
@@ -1026,9 +996,7 @@
 Function971fa: ; 971fa
 	push bc
 	ld a, c
-	ld a, $1
-	ld hl, $585c
-	rst $8
+	callba Function585c
 	pop bc
 	push bc
 	call Unknown_0x97221
@@ -1048,9 +1016,7 @@
 ; 0x97221
 
 Unknown_0x97221: ; 0x97221
-	ld a, $1
-	ld hl, $5897
-	rst $8
+	callba Function5897
 	ret
 ; 0x97228
 
@@ -1073,9 +1039,7 @@
 	ld d, $0
 	ld a, [$ffe0]
 	ld e, a
-	ld a, $2
-	ld hl, $4417
-	rst $8
+	callba Function8417
 	ld a, d
 	add a
 	add a
@@ -1107,9 +1071,7 @@
 .asm_97261
 	ld d, a
 	push de
-	ld a, $2
-	ld hl, $4417
-	rst $8
+	callba Function8417
 	pop bc
 	ret c
 	ld a, d
@@ -1233,9 +1195,7 @@
 	ld a, [$ffaf]
 	ld b, $1
 	call Unknown_0x9730b
-	ld a, $1
-	ld hl, $5920
-	rst $8
+	callba Function5920
 	ret
 ; 0x9730b
 
@@ -1272,9 +1232,7 @@
 	call GetScriptByte
 	call Unknown_0x971e3
 	ld c, a
-	ld a, $1
-	ld hl, $5803
-	rst $8
+	callba Function5803
 	ret
 ; 0x9733a
 
@@ -1281,9 +1239,7 @@
 Script_stopfollow: ; 0x9733a
 ; script command 0x71
 
-	ld a, $1
-	ld hl, $581f
-	rst $8
+	callba Function581f
 	ret
 ; 0x97341
 
@@ -1303,9 +1259,7 @@
 	call GetScriptByte
 	add $4
 	ld e, a
-	ld a, $2
-	ld hl, $407e
-	rst $8
+	callba Function807e
 	ret
 ; 0x9735b
 
@@ -1321,9 +1275,7 @@
 	ld a, [$ffe0]
 .asm_97367
 	ld b, a
-	ld a, $2
-	ld hl, $40a1
-	rst $8
+	callba Function80a1
 	ret
 ; 0x9736f
 
@@ -1339,9 +1291,7 @@
 	call GetScriptByte
 	call Unknown_0x971e3
 	ld c, a
-	ld a, $2
-	ld hl, $439e
-	rst $8
+	callba Function839e
 	ret
 ; 0x97384
 
@@ -1356,9 +1306,7 @@
 	ld a, [$c2dd]
 .asm_9738e
 	ld c, a
-	ld a, $5
-	ld hl, $442f
-	rst $8
+	callba Function1442f
 	ret
 ; 0x97396
 
@@ -1514,9 +1462,7 @@
 	call GetScriptByte
 	ld [$d230], a
 	call Function2879
-	ld a, $13
-	ld hl, $6554
-	rst $8
+	callba Function4e554
 	jp Script_reloadmap
 ; 0x97459
 
@@ -1536,9 +1482,7 @@
 .asm_97470
 	bit 0, d
 	jr z, .asm_9747c ; 0x97472 $8
-	ld a, $3f
-	ld hl, $4fec
-	rst $8
+	callba Functionfcfec
 	jr .asm_9748e ; 0x9747a $12
 .asm_9747c
 	ld a, [$d0ee]
@@ -2061,9 +2005,7 @@
 
 Unknown_0x9769e: ; 0x9769e
 	ld c, a
-	ld a, $20
-	ld hl, $4648
-	rst $8
+	callba Function80648
 	ret
 ; 0x976a6
 
@@ -2140,9 +2082,7 @@
 
 Unknown_976f4: ; 0x976f4
 	ld e, a
-	ld a, $72
-	ld hl, $68a5
-	rst $8
+	callba GetLandmarkName
 	ld de, StringBuffer1
 	jp Unknown_976c0
 ; 0x97701
@@ -2168,9 +2108,7 @@
 	ld c, a
 	call GetScriptByte
 	ld b, a
-	ld a, $e
-	ld hl, $594c
-	rst $8
+	callba Function3994c
 	jr Unknown_976c0 ; 0x97714 $aa
 ; 0x97716
 
@@ -2286,9 +2224,7 @@
 	ld a, [ScriptBank]
 	call FarCopyBytes
 	pop bc
-	ld a, $11
-	ld hl, $46cc
-	rst $8
+	callba Function446cc
 	ret
 ; 0x977b7
 
@@ -2303,9 +2239,7 @@
 	ld d, a
 	ld a, [ScriptBank]
 	ld b, a
-	ld a, $11
-	ld hl, $4654
-	rst $8
+	callba Function44654
 	ret
 ; 0x977ca
 
@@ -2382,9 +2316,7 @@
 
 	call Unknown_0x97861
 	call Unknown_0x9786d
-	ld a, $5
-	ld hl, $5fd7
-	rst $8
+	callba Function15fd7
 	ret
 ; 0x97836
 
@@ -2396,9 +2328,7 @@
 
 	call Unknown_0x97861
 	call Unknown_0x9786d
-	ld a, $5
-	ld hl, $5ffa
-	rst $8
+	callba Function15ffa
 	ret
 ; 0x97843
 
@@ -2410,9 +2340,7 @@
 
 	call Unknown_0x97861
 	call Unknown_0x9786d
-	ld a, $5
-	ld hl, $600b
-	rst $8
+	callba Function1600b
 ; 0x9784f
 
 Unknown_9784f: ; 0x9784f
@@ -2460,9 +2388,7 @@
 ;     coins (CoinByteParam)
 
 	call Function978a0
-	ld a, $5
-	ld hl, $606f
-	rst $8
+	callba Function1606f
 	ret
 ; 0x9788b
 
@@ -2472,9 +2398,7 @@
 ;     coins (CoinByteParam)
 
 	call Function978a0
-	ld a, $5
-	ld hl, $608f
-	rst $8
+	callba Function1608f
 	ret
 ; 0x97895
 
@@ -2484,9 +2408,7 @@
 ;     coins (CoinByteParam)
 
 	call Function978a0
-	ld a, $5
-	ld hl, $60a1
-	rst $8
+	callba Function160a1
 	jr Unknown_9784f
 ; 978a0
 
@@ -2506,9 +2428,7 @@
 
 	xor a
 	ld [$c2dd], a
-	ld a, $3
-	ld hl, $4000
-	rst $8
+	callba Functionc000
 	call GetScriptByte
 	and c
 	ret z
@@ -2543,9 +2463,7 @@
 	ld [$c2dd], a
 	call GetScriptByte
 	ld c, a
-	ld a, $24
-	ld hl, $4000
-	rst $8
+	callba Function90000
 	ret nc
 	ld a, $1
 	ld [$c2dd], a
@@ -2561,9 +2479,7 @@
 	ld [$c2dd], a
 	call GetScriptByte
 	ld c, a
-	ld a, $24
-	ld hl, $400f
-	rst $8
+	callba Function9000f
 	ret nc
 	ld a, $1
 	ld [$c2dd], a
@@ -2579,9 +2495,7 @@
 	ld [$c2dd], a
 	call GetScriptByte
 	ld c, a
-	ld a, $24
-	ld hl, $4019
-	rst $8
+	callba Function90019
 	ret nc
 	ld a, $1
 	ld [$c2dd], a
@@ -2641,9 +2555,7 @@
 	call GetScriptByte
 	call GetScriptByte
 .asm_9795d
-	ld a, $3
-	ld hl, $6277
-	rst $8
+	callba Functione277
 	ld a, b
 	ld [$c2dd], a
 	ret
@@ -2662,9 +2574,7 @@
 	ld [$d108], a
 	call GetScriptByte
 	ld [$d143], a
-	ld a, $3
-	ld hl, $5f8c
-	rst $8
+	callba Functiondf8c
 	ret nc
 	ld a, $2
 	ld [$c2dd], a
@@ -2768,9 +2678,7 @@
 ; 0x979ee
 
 Unknown_0x979ee: ; 0x979ee
-	ld a, $20
-	ld hl, $4430
-	rst $8
+	callba EngineFlagAction
 	ret
 ; 0x979f5
 
@@ -2971,9 +2879,7 @@
 	ld [$ffd4], a
 	call Function2173
 	call Function2914
-	ld a, $41
-	ld hl, $4061
-	rst $8
+	callba Function104061
 	call Function1ad2
 	ret
 ; 0x97af6
@@ -3202,9 +3108,7 @@
 Script_credits: ; 0x97bf3
 ; script command 0xa2
 
-	ld a, $21
-	ld hl, $6455
-	rst $8
+	callba Function86455
 	; fallthrough
 
 DisplayCredits:
@@ -3236,9 +3140,7 @@
 Script_unknown0xa9: ; 0x97c15
 ; script command 0xa9
 
-	ld a, $13
-	ld hl, $4ffe
-	rst $8
+	callba Function4cffe
 	ld a, c
 	ld [$c2dd], a
 	ret
--- a/main.asm
+++ b/main.asm
@@ -17631,6 +17631,7 @@
 	ret
 ; e3fd
 
+Functione3fd: ; e3fd
 	call Functione40a
 	ret c
 	call Functione41c
@@ -18622,21 +18623,15 @@
 ; 10124 (4:4124)
 
 INCBIN "baserom.gbc",$10124,$10159 - $10124
-	ld a, $b
-	ld hl, $47bf
-	rst $8
+	callba Function2c7bf
 	ret c
-	ld a, $b
-	ld hl, $47fb
-	rst $8
+	callba Function2c7fb
 	jr c, .asm_10179
 	ld hl, Options ; $cfcc
 	ld a, [hl]
 	push af
 	res 4, [hl]
-	ld a, $b
-	ld hl, $4867
-	rst $8
+	callba Function2c867
 	pop af
 	ld [Options], a ; $cfcc
 .asm_10179
@@ -18751,9 +18746,7 @@
 ; 10249 (4:4249)
 
 INCBIN "baserom.gbc",$10249,$10311 - $10249
-	ld a, $3
-	ld hl, $5453
-	rst $8
+	callba CheckItemMenu
 	ld a, [$d142]
 	ld hl, $431f
 	rst $28
@@ -18820,15 +18813,9 @@
 	ld a, $8
 	ld [PartyMenuActionText], a ; $d141
 	call WhiteBGMap
-	ld a, $14
-	ld hl, $404f
-	rst $8
-	ld a, $14
-	ld hl, $4405
-	rst $8
-	ld a, $14
-	ld hl, $43e0
-	rst $8
+	callba Function5004f
+	callba Function50405
+	callba Function503e0
 .asm_10427
 	ld a, BANK(WritePartyMenuTilemap)
 	ld hl, WritePartyMenuTilemap
@@ -19086,9 +19073,7 @@
 ; 10601 (4:4601)
 
 INCBIN "baserom.gbc",$10601,$10629 - $10601
-	ld a, $3
-	ld hl, $5448
-	rst $8
+	callba CheckItemContext
 	ld a, [$d142]
 	ld hl, $4637
 	rst $28
@@ -22550,10 +22535,84 @@
 	ret
 ; 129d5
 
+Function129d5: ; 129d5
+	ld a, [NumItems] ; $d892 (aliases: TMsHMsEnd)
+	and a
+	ret nz
+	ld a, [NumKeyItems] ; $d8bc (aliases: ItemsEnd)
+	and a
+	ret nz
+	ld a, [NumBalls] ; $d8d7 (aliases: KeyItemsEnd)
+	and a
+	ret nz
+	ld hl, TMsHMs ; $d859
+	ld b, $39
+.asm_129e9
+	ld a, [hli]
+	and a
+	jr nz, .asm_129f2
+	dec b
+	jr nz, .asm_129e9
+	scf
+	ret
+.asm_129f2
+	and a
+	ret
 
-INCBIN "baserom.gbc",$129d5,$12a60 - $129d5
+Function129f4: ; 129f4
+	push de
+	call PartyMonItemName
+	ld a, BANK(_CheckTossableItem)
+	ld hl, _CheckTossableItem
+	rst $8 ;  ; indirect jump to _CheckTossableItem (d427 (3:5427))
+	ld a, [$d142]
+	and a
+	jr nz, .asm_12a3f
+	ld hl, $6a45
+	call Function1d4f
+	ld a, BANK(Function24fbf)
+	ld hl, Function24fbf
+	rst $8 ;  ; indirect jump to Function24fbf (24fbf (9:4fbf))
+	push af
+	call Function1c17
+	call Function1c07
+	pop af
+	jr c, .asm_12a42
+	ld hl, $6a4a
+	call Function1d4f
+	call Function1dcf
+	push af
+	call Function1c07
+	pop af
+	jr c, .asm_12a42
+	pop hl
+	ld a, [$d107]
+	call TossItem
+	call PartyMonItemName
+	ld hl, $6a4f
+	call Function1d4f
+	call Function1c07
+	and a
+	ret
+.asm_12a3f
+	call Function12a54
+.asm_12a42
+	pop hl
+	scf
+	ret
+; 12a45 (4:6a45)
 
+INCBIN "baserom.gbc",$12a45,$12a54 - $12a45
 
+; known jump sources: 12a3f (4:6a3f)
+Function12a54: ; 12a54 (4:6a54)
+	ld hl, $6a5b
+	call Function1d67
+	ret
+; 12a5b (4:6a5b)
+
+INCBIN "baserom.gbc",$12a5b,$12a60 - $12a5b
+
 CantUseItem: ; 12a60
 	ld hl, CantUseItemText
 	call Function2012
@@ -26567,14 +26626,10 @@
 
 Function14a1a: ; 14a1a
 	call Function1d6e
-	ld a, $1
-	ld hl, $5e9a
-	rst $8
+	callba Function5e9a
 	call SpeechTextBox
 	call Function1ad2
-	ld a, $13
-	ld hl, $4f45
-	rst $8
+	callba Function4cf45
 	ld hl, $5283
 	call Function14baf
 	jr nz, .asm_14a4a
@@ -27719,12 +27774,8 @@
 	ret
 	ld a, $2
 	call Function263b
-	ld a, $9
-	ld hl, $454f
-	rst $8
-	ld a, $2
-	ld hl, $4177
-	rst $8
+	callba Function2454f
+	callba Function8177
 	ret
 ; 154ea (5:54ea)
 
@@ -27735,6 +27786,8 @@
 	ld hl, $d45b
 	set 6, [hl]
 	ret
+
+Function154f7: ; 154f7
 	nop
 	call Function1550c
 	jr c, .asm_15508
@@ -27810,9 +27863,7 @@
 	ld a, $6
 	call Function3cb4
 	ret
-	ld a, $23
-	ld hl, $4070
-	rst $8
+	callba _UpdateTimePals
 	ret
 	ld e, $0
 	ld a, [MusicFadeIDLo] ; $c2a9
@@ -27894,9 +27945,7 @@
 	call Function156c2
 	ld hl, $5a31
 	call Function15a20
-	ld a, $3
-	ld hl, $63fd
-	rst $8
+	callba Functione3fd
 	and a
 	ret
 ; 15679 (5:5679)
@@ -28150,9 +28199,7 @@
 	call Function15985
 	jr c, .asm_15878
 	ld de, PCItems
-	ld a, $4
-	ld hl, $69f4
-	rst $8
+	callba Function129f4
 	jr .asm_15868
 
 .asm_15878
@@ -28205,9 +28252,7 @@
 ; 0x158b8
 
 Function158b8: ; 0x158b8
-	ld a, $4
-	ld hl, $69d5
-	rst $8
+	callba Function129d5
 	ret nc
 	ld hl, Text158c7
 	call Function1d67
@@ -28383,17 +28428,13 @@
 	call Function156c7
 
 .asm_159f2
-	ld a, $9
-	ld hl, $490c
-	rst $8
+	callba Function2490c
 
 .asm_159f8
 	jp $5989
 
 .asm_159fb
-	ld a, $9
-	ld hl, $4706
-	rst $8
+	callba Function24706
 	call Function1bee
 	and a
 	ret
@@ -30942,9 +30983,7 @@
 	push af
 	ld de, $0
 	call StartMusic
-	ld a, $2
-	ld hl, $4000
-	rst $8
+	callba Function8000
 	call DisableLCD
 	ld hl, $7393
 	ld de, $8000
@@ -30951,9 +30990,7 @@
 	ld bc, $20
 	ld a, $5
 	call FarCopyBytes
-	ld a, $23
-	ld hl, $4f53
-	rst $8
+	callba Function8cf53
 	ld de, $9000
 	ld a, [$cf63]
 	call Function1723c
@@ -31062,9 +31099,7 @@
 
 ; known jump sources: 17336 (5:7336)
 Function173b3: ; 173b3 (5:73b3)
-	ld a, $23
-	ld hl, $4f53
-	rst $8
+	callba Function8cf53
 	ld hl, $73ef
 .asm_173bc
 	ld a, [hli]
@@ -32294,6 +32329,8 @@
 ; 24547
 
 INCBIN "baserom.gbc",$24547,$2454f - $24547
+
+Function2454f: ; 2454f
 	ld hl, $d81e
 	xor a
 	ld bc, $10
@@ -32574,9 +32611,19 @@
 	ret
 ; 24706
 
-INCBIN "baserom.gbc",$24706,$2471a - $24706
+Function24706: ; 24706 (9:4706)
+	call Function1cfd
+	ld de, $14
+	add hl, de
+	ld de, $28
+	ld a, [$cf92]
+.asm_24713
+	ld [hl], $7f
+	add hl, de
+	dec a
+	jr nz, .asm_24713
+	ret
 
-
 Function2471a: ; 2471a
 	ld hl, $cf96
 	ld a, [hli]
@@ -34171,9 +34218,7 @@
 	call ClearSprites
 	call ClearTileMap
 	call DisableLCD
-	ld a, $22
-	ld hl, $433e
-	rst $8
+	callba Function8833e
 	ld hl, $65c3
 	ld de, $91c0
 	ld bc, $10
@@ -40014,9 +40059,7 @@
 	cp $3
 	jr z, .asm_2c541
 	jr Function2c545
-	ld a, $d
-	ld hl, $77f5
-	rst $8
+	callba Function0x377f5
 	jr c, .asm_2c541
 	ld a, [PlayerSubStatus1] ; $c668
 	bit 7, a
@@ -40042,9 +40085,7 @@
 	ld a, [EnemyScreens] ; $c700
 	bit 5, a
 	ret
-	ld a, $e
-	ld hl, $5251
-	rst $8
+	callba AICheckEnemyMaxHP
 	jr nc, Function2c545
 .asm_2c541
 	ld a, $1
@@ -40381,6 +40422,8 @@
 	ld a, $f
 	call Predef
 	ret
+
+Function2c7bf: ; 2c7bf (b:47bf)
 	ld hl, Options ; $cfcc
 	ld a, [hl]
 	push af
@@ -40458,7 +40501,7 @@
 	jr .asm_2c821
 ; 2c867
 
-
+Function2c867: ; 2c867
 	ld a, $e
 	call Predef
 	push bc
@@ -40477,9 +40520,7 @@
 	call PrintText
 	jr .asm_2c8b6
 .asm_2c88b
-	ld hl, $79ea
-	ld a, $3
-	rst $8
+	callab Functionf9ea
 	jr c, .asm_2c8b6
 	ld a, $0
 	call Predef
@@ -40486,16 +40527,12 @@
 	ld a, b
 	and a
 	jr z, .asm_2c8b6
-	ld a, $41
-	ld hl, $6049
-	rst $8
+	callba Function106049
 	ld a, [CurItem] ; $d106
 	call IsHM
 	ret c
 	ld c, $5
-	ld hl, $71c2
-	ld a, $1
-	rst $8
+	callab ChangeHappiness
 	call Function2cb0c
 	jr .asm_2c8bd
 .asm_2c8b6
@@ -62043,9 +62080,7 @@
 	call DelayFrame
 	ret
 .asm_4dd49
-	ld a, $34
-	ld hl, $40b4
-	rst $8
+	callba Functiond00b4
 	jr nc, .asm_4dd56
 	ld hl, $cf64
 	res 6, [hl]
@@ -70977,7 +71012,7 @@
 	ret
 ; 8833e
 
-
+Function8833e: ; 8833e
 	ld hl, $4365
 	ld a, [PlayerGender] ; $d472
 	bit 0, a
@@ -76909,6 +76944,7 @@
 	ret
 ; 8c0e5
 
+Function8c0e5: ; 8c0e5
 	ld hl, $410f
 	ld a, [$c2d0]
 	cp $4
@@ -80793,9 +80829,7 @@
 INCBIN "baserom.gbc",$90233,$9026f - $90233
 	call Function9027c
 	call Function9027c
-	ld a, $41
-	ld hl, $60d3
-	rst $8
+	callba Function1060d3
 	ret
 
 ; known jump sources: 9026f (24:426f), 90272 (24:4272)
@@ -81562,9 +81596,7 @@
 	ld a, [hMinutes] ; $ff00+$96
 	ld c, a
 	ld de, $c5b9
-	ld a, $77
-	ld hl, $56bb
-	rst $8
+	callba Function1dd6bb
 	ld hl, $4a83
 	ret
 ; 90a83 (24:4a83)
@@ -81697,9 +81729,7 @@
 	ld a, $7
 	ld [hWX], a ; $ff00+$d1
 	call Function90c4e
-	ld a, $23
-	ld hl, $4f53
-	rst $8
+	callba Function8cf53
 	call Function90d32
 	ld a, $8
 	call Function3cb4
@@ -81877,9 +81907,7 @@
 	push de
 	jp [hl]
 	call Function90eb0
-	ld a, $24
-	ld hl, $5f13
-	rst $8
+	callba TownMapPals
 	ld a, [$cf65]
 	and a
 	jr nz, .asm_90de8
@@ -105515,6 +105543,7 @@
 
 INCLUDE "battle/hidden_power.asm"
 
+Functionfbd54: ; fbd54
 	xor a
 	ld [hBGMapMode], a ; $ff00+$d4
 	ld a, [hBattleTurn] ; $ff00+$e4
@@ -107332,9 +107361,7 @@
 	ld [$FF00+$c5], a
 	ld de, $d851
 	ld bc, $ffc3
-	ld a, $5
-	ld hl, $5ffa
-	rst $8
+	callba Function15ffa
 	ret
 
 
@@ -110457,9 +110484,7 @@
 	call Function2e56
 	ld a, $5
 	call Function263b
-	ld a, $25
-	ld hl, $7df9
-	rst $8
+	callba Function97df9
 	ld a, $3
 	call Function263b
 	call Function2cff
@@ -110687,12 +110712,8 @@
 	res 6, [hl]
 	ld a, $1
 	ld [$c2ce], a
-	ld a, $23
-	ld hl, $40e5
-	rst $8
-	ld a, $23
-	ld hl, $4001
-	rst $8
+	callba Function8c0e5
+	callba Function8c001
 	call Function2173
 	call Function104770
 	call Function1047a3
@@ -110706,9 +110727,7 @@
 	ld [$d152], a
 	ld [hSCY], a ; $ff00+$d0
 	ld [hSCX], a ; $ff00+$cf
-	ld a, $1
-	ld hl, $5958
-	rst $8
+	callba Function5958
 	ld a, [rVBK] ; $ff00+$4f
 	push af
 	ld a, $1
@@ -110763,13 +110782,9 @@
 	ld [$FF00+$de], a
 	xor a
 	ld [hTileAnimFrame], a ; $ff00+$df
-	ld a, $5
-	ld hl, $4168
-	rst $8
+	callba Function14168
 	call Functione5f
-	ld a, $41
-	ld hl, $6594
-	rst $8
+	callba Function106594
 	ret
 
 Function1047eb: ; 1047eb
@@ -110778,16 +110793,10 @@
 ; 1047f0
 
 	call ClearSprites
-	ld a, $2e
-	ld hl, $4000
-	rst $8
+	callba Functionb8000
 	call Function2914
-	ld a, $1
-	ld hl, $579d
-	rst $8
-	ld a, $5
-	ld hl, $54f7
-	rst $8
+	callba Function579d
+	callba Function154f7
 	ld hl, $d45b
 	bit 6, [hl]
 	jr nz, .asm_104817
@@ -113252,6 +113261,8 @@
 ; 10602f (41:602f)
 
 INCBIN "baserom.gbc",$10602f,$106049 - $10602f
+
+Function106049: ; 106049
 	ret
 ; 10604a (41:604a)