ref: e0c7d3d455e5fb479bdc43011d5a5a2d33ec64f0
parent: 37fac8a71427da5517780739414967273eb011ba
author: Bryan Bishop <[email protected]>
date: Thu Feb 28 15:39:40 EST 2013
use ScriptBank/ScriptPos in scripting.asm
--- a/scripting.asm
+++ b/scripting.asm
@@ -244,7 +244,7 @@
; parameters:
; text_pointer (RawTextPointerLabelParam)
- ld a, [$d439]
+ ld a, [ScriptBank]
ld [$d44e], a
call GetScriptByte
ld [$d44f], a
@@ -260,7 +260,7 @@
; parameters:
; text_pointer (RawTextPointerLabelParam)
- ld a, [$d439]
+ ld a, [ScriptBank]
ld [$d44e], a
call GetScriptByte
ld [$d44f], a
@@ -298,7 +298,7 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
call $269a
ret
@@ -388,7 +388,7 @@
call GetScriptByte
ld h, a
ld de, $1d35
- ld a, [$d439]
+ ld a, [ScriptBank]
call $26b7
call $1ad2
ret
@@ -431,7 +431,7 @@
Script_interpretmenu2: ; 0x96f30
; script command 0x59
- ld a, [$d439]
+ ld a, [ScriptBank]
ld hl, $1d81
rst $8
ld a, [$cfa9]
@@ -445,7 +445,7 @@
Script_interpretmenu: ; 0x96f41
; script command 0x58
- ld a, [$d439]
+ ld a, [ScriptBank]
ld hl, $202a
rst $8
ld a, [$cf88]
@@ -574,7 +574,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
ld a, $5
ld hl, $5a45
@@ -593,7 +593,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
ld a, $4
ld hl, $742d
@@ -626,7 +626,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
ld a, $24
ld hl, $429a
@@ -950,7 +950,7 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
call $26c7
ret c
@@ -1456,7 +1456,7 @@
; parameters:
; pointer (ScriptPointerLabelParam)
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
call GetScriptByte
ld e, a
@@ -1506,16 +1506,16 @@
add hl, de
add hl, de
pop de
- ld a, [$d439]
+ ld a, [ScriptBank]
ld [hli], a
- ld a, [$d43a]
+ ld a, [ScriptPos]
ld [hli], a
ld a, [$d43b]
ld [hl], a
ld a, b
- ld [$d439], a
+ ld [ScriptBank], a
ld a, e
- ld [$d43a], a
+ ld [ScriptPos], a
ld a, d
ld [$d43b], a
ret
@@ -1522,9 +1522,9 @@
; 0x974f3
Unknown_0x974f3: ; 0x974f3
- ld a, [$d439]
+ ld a, [ScriptBank]
or $80
- ld [$d439], a
+ ld [ScriptBank], a
jp $74cb
; 0x974fe
@@ -1537,7 +1537,7 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
jp $759d
; 0x9750d
@@ -1695,9 +1695,9 @@
Unknown_9759d: ; 0x9759d
ld a, b
- ld [$d439], a
+ ld [ScriptBank], a
ld a, l
- ld [$d43a], a
+ ld [ScriptPos], a
ld a, h
ld [$d43b], a
ret
@@ -1708,7 +1708,7 @@
; parameters:
; pointer (ScriptPointerLabelParam)
- ld a, [$d439]
+ ld a, [ScriptBank]
ld [$d44e], a
call GetScriptByte
ld [$d44f], a
@@ -2138,7 +2138,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld hl, $30d6
rst $8
ld de, $d086
@@ -2154,7 +2154,7 @@
ld l, a
call GetScriptByte
ld h, a
- ld a, [$d439]
+ ld a, [ScriptBank]
call GetFarByte
ld b, a
push bc
@@ -2161,7 +2161,7 @@
inc hl
ld bc, $0020
ld de, $d002
- ld a, [$d439]
+ ld a, [ScriptBank]
call FarCopyBytes
pop bc
ld a, $11
@@ -2179,7 +2179,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
ld a, $11
ld hl, $4654
@@ -2507,7 +2507,7 @@
and a
ld b, a
jr z, .asm_9795d ; 0x97949 $12
- ld hl, $d43a
+ ld hl, ScriptPos
ld e, [hl]
inc hl
ld d, [hl]
@@ -2781,7 +2781,7 @@
ld e, a
call GetScriptByte
ld d, a
- ld a, [$d439]
+ ld a, [ScriptBank]
ld b, a
ld a, $25
ld hl, $7e31
@@ -3035,10 +3035,10 @@
ld a, [hli]
ld b, a
and $7f
- ld [$d439], a
+ ld [ScriptBank], a
ld a, [hli]
ld e, a
- ld [$d43a], a
+ ld [ScriptPos], a
ld a, [hl]
ld d, a
ld [$d43b], a