shithub: pokecrystal

Download patch

ref: ef4b04f12cd1a47329941a38b8bfa0e1240abb1d
parent: e0ca5a243f871874da90eb9690b16d7e95c43286
author: Bryan Bishop <[email protected]>
date: Thu Feb 28 10:45:34 EST 2013

comments for GetScriptByte

--- a/main.asm
+++ b/main.asm
@@ -85,7 +85,6 @@
 	ret
 ; 0x46f
 
-
 RTC: ; 46f
 ; update time and time-sensitive palettes
 
@@ -2248,25 +2247,34 @@
 INCBIN "baserom.gbc",$2631,$26d4 - $2631
 
 GetScriptByte: ; 0x26d4
+; Return byte at ScriptBank:ScriptPos in a.
+
 	push hl
 	push bc
+
 	ld a, [$ff9d]
 	push af
-	ld a, [$d439]
-	rst $10
-	ld hl, $d43a
+
+	ld a, [ScriptBank]
+	rst Bankswitch
+
+	ld hl, ScriptPos
 	ld c, [hl]
 	inc hl
 	ld b, [hl]
+
 	ld a, [bc]
+
 	inc bc
 	ld [hl], b
 	dec hl
 	ld [hl], c
+
 	ld b, a
 	pop af
-	rst $10
+	rst Bankswitch
 	ld a, b
+
 	pop bc
 	pop hl
 	ret
--- a/wram.asm
+++ b/wram.asm
@@ -1115,6 +1115,12 @@
 OTPartyMon6Nickname: ; d421
 	ds 11
 
+SECTION "Scripting",BSS[$d439]
+
+ScriptBank: ; d439
+	ds 1
+ScriptPos: ; d43a
+	ds 2
 
 SECTION "Player",BSS[$d472]
 PlayerGender: ; d472