shithub: pokecrystal

Download patch

ref: c4a764ce1073e5cfc3b2045282c83beda314ca91
parent: 55cd8920263afd82500f6120ef2acea95bdcd2fe
author: yenatch <[email protected]>
date: Thu Aug 29 19:20:09 EDT 2013

use more bank 0 labels in engine/scripting.asm

--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -308,7 +308,7 @@
 	ld h, a
 	ld a, [ScriptBank]
 	ld b, a
-	call $269a
+	call Function269a
 	ret
 ; 0x96eab
 
@@ -323,7 +323,7 @@
 	ld l, a
 	call GetScriptByte
 	ld h, a
-	call $269a
+	call Function269a
 	ret
 ; 0x96ebb
 
@@ -348,7 +348,7 @@
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
-	call $269a
+	call Function269a
 	ret
 .asm_96ed8
 	ret
@@ -357,7 +357,7 @@
 Script_closetext: ; 0x96ed9
 ; script command 0x54
 
-	jp $0a46
+	jp Functiona46
 ; 0x96edc
 
 Script_keeptextopen: ; 0x96edc
@@ -367,8 +367,8 @@
 	push af
 	ld a, $1
 	ld [$ffd8], a
-	call $31f6
-	call $0aaf
+	call WaitBGMap
+	call Functionaaf
 	pop af
 	ld [$ffd8], a
 	ret
@@ -377,7 +377,7 @@
 Script_yesorno: ; 0x96eed
 ; script command 0x4e
 
-	call $1dcf
+	call Function1dcf
 	ld a, $0
 	jr c, .asm_96ef6 ; 0x96ef2 $2
 	ld a, $1
@@ -397,8 +397,8 @@
 	ld h, a
 	ld de, $1d35
 	ld a, [ScriptBank]
-	call $26b7
-	call $1ad2
+	call Function26b7
+	call Function1ad2
 	ret
 ; 0x96f0f
 
@@ -405,8 +405,8 @@
 Script_writebackup: ; 0x96f0f
 ; script command 0x50
 
-	call $1c17
-	call $1ad2
+	call Function1c17
+	call Function1ad2
 	ret
 ; 0x96f16
 
@@ -470,7 +470,7 @@
 ;     pointer (PointerLabelBeforeBank)
 ;     memory (SingleByteParam)
 
-	call $106c
+	call Function106c
 	call GetScriptByte
 	ld c, a
 	ld a, $47
@@ -539,7 +539,7 @@
 	ld a, [de]
 	ld [$d10c], a
 	ld hl, $d892
-	call $2f66
+	call Function2f66
 	ld a, $1
 	jr c, .asm_96fb0 ; 0x96fad $1
 	xor a
@@ -561,7 +561,7 @@
 	call CurItemName
 	ld b, BANK(PutItemInPocketText)
 	ld hl, PutItemInPocketText
-	call $269a
+	call Function269a
 	ret
 ; 0x96fd5
 
@@ -572,7 +572,7 @@
 	call CurItemName
 	ld b, BANK(PocketIsFullText)
 	ld hl, PocketIsFullText
-	call $269a
+	call Function269a
 	ret
 ; 0x96fe4
 
@@ -732,7 +732,7 @@
 ; parameters:
 ;     number (SingleByteParam)
 
-	call $1dcf
+	call Function1dcf
 	jr c, .asm_970d6 ; 0x970c1 $13
 	call GetScriptByte
 	ld c, a
@@ -814,7 +814,7 @@
 	ld l, a
 	ld a, [$d03e]
 	ld b, a
-	call $269a
+	call Function269a
 	ret
 ; 0x97125
 
@@ -907,7 +907,7 @@
 Script_playmapmusic: ; 0x97185
 ; script command 0x82
 
-	call $3cdf
+	call Function3cdf
 	ret
 ; 0x97189
 
@@ -988,7 +988,7 @@
 	jr nz, .asm_971df ; 0x971da $3
 	ld a, [$c2dd]
 .asm_971df
-	call $37ce
+	call Function37ce
 	ret
 ; 0x971e3
 
@@ -1039,7 +1039,7 @@
 	ld h, a
 	ld a, [ScriptBank]
 	ld b, a
-	call $26c7
+	call Function26c7
 	ret c
 	ld a, SCRIPT_WAIT_MOVEMENT
 	ld [ScriptMode], a
@@ -1145,13 +1145,13 @@
 Unknown_0x9728b: ; 0x9728b
 	ld a, d
 	push de
-	call $18de
+	call Function18de
 	jr c, .asm_972b9 ; 0x97290 $27
 	ld hl, $0000
 	add hl, bc
 	ld a, [hl]
 	push bc
-	call $1836
+	call Function1836
 	pop bc
 	jr c, .asm_972b9 ; 0x9729c $1b
 	ld hl, $0004
@@ -1160,13 +1160,13 @@
 	jr nz, .asm_972b9 ; 0x972a4 $13
 	pop de
 	ld a, e
-	call $1af8
+	call Function1af8
 	ld hl, $d0ed
 	bit 6, [hl]
 	jr nz, .asm_972b5 ; 0x972b0 $3
 	call Unknown_0x972bc
 .asm_972b5
-	call $1ad2
+	call Function1ad2
 	ret
 .asm_972b9
 	pop de
@@ -1175,7 +1175,7 @@
 ; 0x972bc
 
 Unknown_0x972bc: ; 0x972bc
-	call $217a
+	call Function217a
 	ld hl, TileMap
 	ld bc, $0168
 .asm_972c5
@@ -1211,7 +1211,7 @@
 
 	call GetScriptByte
 	call Unknown_0x971e3
-	call $1956
+	call Function1956
 	ld a, [$ffaf]
 	ld b, $0
 	call Unknown_0x9730b
@@ -1229,7 +1229,7 @@
 	jr nz, .asm_972fa ; 0x972f6 $2
 	ld a, [$ffe0]
 .asm_972fa
-	call $199f
+	call Function199f
 	ld a, [$ffaf]
 	ld b, $1
 	call Unknown_0x9730b
@@ -1241,7 +1241,7 @@
 
 Unknown_0x9730b: ; 0x9730b
 	push bc
-	call $18d2
+	call GetMapObject
 	ld hl, $000c
 	add hl, bc
 	pop bc
@@ -1513,7 +1513,7 @@
 
 	call GetScriptByte
 	ld [$d230], a
-	call $2879
+	call Function2879
 	ld a, $13
 	ld hl, $6554
 	rst $8
@@ -1559,7 +1559,7 @@
 	ld a, $f3
 	ld [$ff9f], a
 	ld a, $1
-	call $261b
+	call Function261b
 	call StopScript
 	ret
 ; 0x974a2
@@ -1835,7 +1835,7 @@
 Script_checktriggers: ; 0x975c2
 ; script command 0x13
 
-	call $211b
+	call Function211b
 	jr z, .asm_975cb ; 0x975c5 $4
 	ld [$c2dd], a
 	ret
@@ -1855,7 +1855,7 @@
 	ld b, a
 	call GetScriptByte
 	ld c, a
-	call $2147
+	call Function2147
 	ld a, d
 	or e
 	jr z, .asm_975e5 ; 0x975de $5
@@ -1894,7 +1894,7 @@
 	; fallthrough
 
 Unknown_975fd: ; 0x975fd
-	call $2147
+	call Function2147
 	ld a, d
 	or e
 	jr z, .asm_97608 ; 0x97602 $4
@@ -1988,7 +1988,7 @@
 	ld b, a
 .asm_97653
 	push bc
-	call $2f8c
+	call RNG
 	pop bc
 	ld a, [$ffe1]
 	cp b
@@ -1996,7 +1996,7 @@
 	jr .asm_97666 ; 0x9765d $7
 .asm_9765f
 	push bc
-	call $2f8c
+	call RNG
 	pop bc
 	ld a, [$ffe1]
 .asm_97666
@@ -2004,7 +2004,7 @@
 	ld a, [$c2dd]
 	ld c, a
 	pop af
-	call $3110
+	call SimpleDivide
 	ld [$c2dd], a
 	ret
 ; 0x97673
@@ -2091,7 +2091,7 @@
 	ld a, [$c2dd]
 .asm_976b7
 	ld [$d265], a
-	call $343b
+	call GetPokemonName
 	ld de, StringBuffer1
 
 Unknown_976c0: ; 0x976c0
@@ -2205,7 +2205,7 @@
 	call Unknown_0x97861
 	ld hl, StringBuffer1
 	ld bc, $4306
-	call $3198
+	call PrintNum
 	ld de, StringBuffer1
 	jp Unknown_976c0
 ; 0x97747
@@ -2219,7 +2219,7 @@
 	ld hl, StringBuffer1
 	ld de, $d855
 	ld bc, $4206
-	call $3198
+	call PrintNum
 	ld de, StringBuffer1
 	jp Unknown_976c0
 ; 0x9775c
@@ -2233,7 +2233,7 @@
 	ld de, $c2dd
 	ld hl, StringBuffer1
 	ld bc, $4103
-	call $3198
+	call PrintNum
 	ld de, StringBuffer1
 	jp Unknown_976c0
 ; 0x97771
@@ -2320,7 +2320,7 @@
 	call GetScriptByte
 	ld [$d10c], a
 	ld hl, $d892
-	call $2f66
+	call Function2f66
 	jr nc, .asm_977eb ; 0x977e3 $6
 	ld a, $1
 	ld [$c2dd], a
@@ -2346,7 +2346,7 @@
 	ld a, $ff
 	ld [$d107], a
 	ld hl, $d892
-	call $2f53
+	call Function2f53
 	ret nc
 	ld a, $1
 	ld [$c2dd], a
@@ -2363,7 +2363,7 @@
 	call GetScriptByte
 	ld [$d106], a
 	ld hl, $d892
-	call $2f79
+	call Function2f79
 	ret nc
 	ld a, $1
 	ld [$c2dd], a
@@ -2839,7 +2839,7 @@
 	ld a, $f1
 	ld [$ff9f], a
 	ld a, $1
-	call $261b
+	call Function261b
 	call StopScript
 	ret
 .asm_97a4a
@@ -2851,7 +2851,7 @@
 	ld a, $fb
 	ld [$ff9f], a
 	ld a, $1
-	call $261b
+	call Function261b
 	call StopScript
 	ret
 ; 0x97a65
@@ -2935,8 +2935,8 @@
 	ld [$d1a1], a
 	call GetScriptByte
 	ld [$d1a2], a
-	call $24e4
-	call $2879
+	call Function24e4
+	call Function2879
 	ret
 ; 0x97acc
 
@@ -2953,10 +2953,10 @@
 	call GetScriptByte
 	add $4
 	ld e, a
-	call $2a66
+	call Function2a66
 	call GetScriptByte
 	ld [hl], a
-	call $2879
+	call Function2879
 	ret
 ; 0x97ae3
 
@@ -2965,12 +2965,12 @@
 
 	xor a
 	ld [$ffd4], a
-	call $2173
-	call $2914
+	call Function2173
+	call Function2914
 	ld a, $41
 	ld hl, $4061
 	rst $8
-	call $1ad2
+	call Function1ad2
 	ret
 ; 0x97af6
 
@@ -2977,7 +2977,7 @@
 Script_warpcheck: ; 0x97af6
 ; script command 0x8e
 
-	call $224a
+	call Function224a
 	ret nc
 	callba Function966d0
 	ret
@@ -2996,7 +2996,7 @@
 	call GetScriptByte
 	ld [$ff9f], a
 	ld a, $1
-	call $261b
+	call Function261b
 	call StopScript
 	ret
 ; 0x97b16
@@ -3011,7 +3011,7 @@
 Script_loadfont: ; 0x97b1c
 ; script command 0x47
 
-	call $2e08
+	call Function2e08
 	ret
 ; 0x97b20
 
@@ -3020,7 +3020,7 @@
 ; parameters:
 ;     dummy (SingleByteParam)
 
-	call $2dba
+	call ResetWindow
 	call GetScriptByte
 	ret
 ; 0x97b27
@@ -3043,8 +3043,8 @@
 Script_loadmovesprites: ; 0x97b2f
 ; script command 0x49
 
-	call $2e20
-	call $2dcf
+	call Function2e20
+	call Function2dcf
 	ret
 ; 0x97b36
 
@@ -3206,7 +3206,7 @@
 DisplayCredits:
 	call Script_resetfuncs
 	ld a, $3
-	call $261b
+	call Function261b
 	call StopScript
 	ret
 ; 0x97c05