shithub: pokecrystal

Download patch

ref: 5b38b377f2eb4fc412022f1631bd882ba4b3339e
parent: e3da601ceeec1fcb73bd220236969d6dbc64fbca
author: yenatch <[email protected]>
date: Sun Sep 1 11:24:07 EDT 2013

wram labels for graphics requests

--- a/engine/copy.asm
+++ b/engine/copy.asm
@@ -248,13 +248,13 @@
 
 .asm_edc
 	ld a, e
-	ld [$cf68], a
+	ld [Requested2bppSource], a
 	ld a, d
-	ld [$cf69], a
+	ld [Requested2bppSource + 1], a
 	ld a, l
-	ld [$cf6a], a
+	ld [Requested2bppDest], a
 	ld a, h
-	ld [$cf6b], a
+	ld [Requested2bppDest + 1], a
 
 .asm_eec
 	ld a, c
@@ -262,10 +262,10 @@
 	cp [hl]
 	jr nc, .asm_f08
 
-	ld [$cf67], a
+	ld [Requested2bpp], a
 .wait
 	call DelayFrame
-	ld a, [$cf67]
+	ld a, [Requested2bpp]
 	and a
 	jr nz, .wait
 
@@ -281,10 +281,10 @@
 
 .asm_f08
 	ld a, [$ffd3]
-	ld [$cf67], a
+	ld [Requested2bpp], a
 .asm_f0d
 	call DelayFrame
-	ld a, [$cf67]
+	ld a, [Requested2bpp]
 	and a
 	jr nz, .asm_f0d
 	ld a, c
@@ -322,13 +322,13 @@
 
 .asm_f40
 	ld a, e
-	ld [$cf6d], a
+	ld [Requested1bppSource], a
 	ld a, d
-	ld [$cf6e], a
+	ld [Requested1bppSource + 1], a
 	ld a, l
-	ld [$cf6f], a
+	ld [Requested1bppDest], a
 	ld a, h
-	ld [$cf70], a
+	ld [Requested1bppDest + 1], a
 .asm_f50
 	ld a, c
 	ld hl, $ffd3
@@ -335,10 +335,10 @@
 	cp [hl]
 	jr nc, .asm_f6c
 
-	ld [$cf6c], a
+	ld [Requested1bpp], a
 .wait
 	call DelayFrame
-	ld a, [$cf6c]
+	ld a, [Requested1bpp]
 	and a
 	jr nz, .wait
 
@@ -354,10 +354,10 @@
 
 .asm_f6c
 	ld a, [$ffd3]
-	ld [$cf6c], a
+	ld [Requested1bpp], a
 .asm_f71
 	call DelayFrame
-	ld a, [$cf6c]
+	ld a, [Requested1bpp]
 	and a
 	jr nz, .asm_f71
 	ld a, c
--- a/main.asm
+++ b/main.asm
@@ -425,7 +425,7 @@
 Serve1bppRequest: ; 170a
 ; Only call during the first fifth of VBlank
 
-	ld a, [$cf6c]
+	ld a, [Requested1bpp]
 	and a
 	ret z
 
@@ -436,12 +436,12 @@
 	cp 146
 	ret nc
 
-; Copy [$cf6c] 1bpp tiles from [$cf6d-e] to [$cf6f-70]
+; Copy [Requested1bpp] 1bpp tiles from [Requested1bppSource] to [Requested1bppDest]
 
 	ld [hSPBuffer], sp
 
 ; Source
-	ld hl, $cf6d
+	ld hl, Requested1bppSource
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
@@ -448,17 +448,17 @@
 	ld sp, hl
 	
 ; Destination
-	ld hl, $cf6f
+	ld hl, Requested1bppDest
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
 	
 ; # tiles to copy
-	ld a, [$cf6c]
+	ld a, [Requested1bpp]
 	ld b, a
 
 	xor a
-	ld [$cf6c], a
+	ld [Requested1bpp], a
 
 .next
 
@@ -488,11 +488,11 @@
 
 
 	ld a, l
-	ld [$cf6f], a
+	ld [Requested1bppDest], a
 	ld a, h
-	ld [$cf70], a
+	ld [Requested1bppDest + 1], a
 
-	ld [$cf6d], sp
+	ld [Requested1bppSource], sp
 
 	ld a, [hSPBuffer]
 	ld l, a
@@ -506,7 +506,7 @@
 Serve2bppRequest: ; 1769
 ; Only call during the first fifth of VBlank
 
-	ld a, [$cf67]
+	ld a, [Requested2bpp]
 	and a
 	ret z
 
@@ -521,17 +521,17 @@
 
 Serve2bppRequest@VBlank: ; 1778
 
-	ld a, [$cf67]
+	ld a, [Requested2bpp]
 	and a
 	ret z
 
 _Serve2bppRequest: ; 177d
-; Copy [$cf67] 2bpp tiles from [$cf68-9] to [$cf6a-b]
+; Copy [Requested2bpp] 2bpp tiles from [Requested2bppSource] to [Requested2bppDest]
 
 	ld [hSPBuffer], sp
 	
 ; Source
-	ld hl, $cf68
+	ld hl, Requested2bppSource
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
@@ -538,17 +538,17 @@
 	ld sp, hl
 	
 ; Destination
-	ld hl, $cf6a
+	ld hl, Requested2bppDest
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
 	
 ; # tiles to copy
-	ld a, [$cf67]
+	ld a, [Requested2bpp]
 	ld b, a
 
 	xor a
-	ld [$cf67], a
+	ld [Requested2bpp], a
 	
 .next
 
@@ -570,11 +570,11 @@
 
 
 	ld a, l
-	ld [$cf6a], a
+	ld [Requested2bppDest], a
 	ld a, h
-	ld [$cf6b], a
+	ld [Requested2bppDest + 1], a
 
-	ld [$cf68], sp
+	ld [Requested2bppSource], sp
 
 	ld a, [hSPBuffer]
 	ld l, a
@@ -8209,16 +8209,19 @@
 	ld a, [hLCDStatCustom]
 	and a
 	ret z
-	ld a, $0
-	ld [$cf68], a
+
+	ld a, $00
+	ld [Requested2bppSource], a
 	ld a, $d2
-	ld [$cf69], a
-	ld a, $0
-	ld [$cf6a], a
+	ld [Requested2bppSource + 1], a
+
+	ld a, $00
+	ld [Requested2bppDest], a
 	ld a, $d1
-	ld [$cf6b], a
+	ld [Requested2bppDest + 1], a
+
 	ld a, $9
-	ld [$cf67], a
+	ld [Requested2bpp], a
 	ret
 ; 3b2a
 
--- a/wram.asm
+++ b/wram.asm
@@ -829,7 +829,23 @@
 CurSpecies: ; cf60
 	ds 1
 
-	ds $13
+	ds 6
+
+Requested2bpp: ; cf67
+	ds 1
+Requested2bppSource: ; cf68
+	ds 2
+Requested2bppDest: ; cf6a
+	ds 2
+
+Requested1bpp: ; cf6c
+	ds 1
+Requested1bppSource: ; cf6d
+	ds 2
+Requested1bppDest: ; cf6f
+	ds 2
+
+	ds 3
 
 MenuSelection:; cf74
 	ds 1