wram labels for graphics requests

This commit is contained in:
yenatch 2013-09-01 15:24:07 -04:00
parent e3da601cee
commit 5b38b377f2
3 changed files with 62 additions and 43 deletions

View File

@ -248,13 +248,13 @@ Request2bpp: ; eba
.asm_edc .asm_edc
ld a, e ld a, e
ld [$cf68], a ld [Requested2bppSource], a
ld a, d ld a, d
ld [$cf69], a ld [Requested2bppSource + 1], a
ld a, l ld a, l
ld [$cf6a], a ld [Requested2bppDest], a
ld a, h ld a, h
ld [$cf6b], a ld [Requested2bppDest + 1], a
.asm_eec .asm_eec
ld a, c ld a, c
@ -262,10 +262,10 @@ Request2bpp: ; eba
cp [hl] cp [hl]
jr nc, .asm_f08 jr nc, .asm_f08
ld [$cf67], a ld [Requested2bpp], a
.wait .wait
call DelayFrame call DelayFrame
ld a, [$cf67] ld a, [Requested2bpp]
and a and a
jr nz, .wait jr nz, .wait
@ -281,10 +281,10 @@ Request2bpp: ; eba
.asm_f08 .asm_f08
ld a, [$ffd3] ld a, [$ffd3]
ld [$cf67], a ld [Requested2bpp], a
.asm_f0d .asm_f0d
call DelayFrame call DelayFrame
ld a, [$cf67] ld a, [Requested2bpp]
and a and a
jr nz, .asm_f0d jr nz, .asm_f0d
ld a, c ld a, c
@ -322,23 +322,23 @@ Request1bpp: ; f1e
.asm_f40 .asm_f40
ld a, e ld a, e
ld [$cf6d], a ld [Requested1bppSource], a
ld a, d ld a, d
ld [$cf6e], a ld [Requested1bppSource + 1], a
ld a, l ld a, l
ld [$cf6f], a ld [Requested1bppDest], a
ld a, h ld a, h
ld [$cf70], a ld [Requested1bppDest + 1], a
.asm_f50 .asm_f50
ld a, c ld a, c
ld hl, $ffd3 ld hl, $ffd3
cp [hl] cp [hl]
jr nc, .asm_f6c jr nc, .asm_f6c
ld [$cf6c], a ld [Requested1bpp], a
.wait .wait
call DelayFrame call DelayFrame
ld a, [$cf6c] ld a, [Requested1bpp]
and a and a
jr nz, .wait jr nz, .wait
@ -354,10 +354,10 @@ Request1bpp: ; f1e
.asm_f6c .asm_f6c
ld a, [$ffd3] ld a, [$ffd3]
ld [$cf6c], a ld [Requested1bpp], a
.asm_f71 .asm_f71
call DelayFrame call DelayFrame
ld a, [$cf6c] ld a, [Requested1bpp]
and a and a
jr nz, .asm_f71 jr nz, .asm_f71
ld a, c ld a, c

View File

@ -425,7 +425,7 @@ endr
Serve1bppRequest: ; 170a Serve1bppRequest: ; 170a
; Only call during the first fifth of VBlank ; Only call during the first fifth of VBlank
ld a, [$cf6c] ld a, [Requested1bpp]
and a and a
ret z ret z
@ -436,29 +436,29 @@ Serve1bppRequest: ; 170a
cp 146 cp 146
ret nc ret nc
; Copy [$cf6c] 1bpp tiles from [$cf6d-e] to [$cf6f-70] ; Copy [Requested1bpp] 1bpp tiles from [Requested1bppSource] to [Requested1bppDest]
ld [hSPBuffer], sp ld [hSPBuffer], sp
; Source ; Source
ld hl, $cf6d ld hl, Requested1bppSource
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld sp, hl ld sp, hl
; Destination ; Destination
ld hl, $cf6f ld hl, Requested1bppDest
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
; # tiles to copy ; # tiles to copy
ld a, [$cf6c] ld a, [Requested1bpp]
ld b, a ld b, a
xor a xor a
ld [$cf6c], a ld [Requested1bpp], a
.next .next
@ -488,11 +488,11 @@ endr
ld a, l ld a, l
ld [$cf6f], a ld [Requested1bppDest], a
ld a, h ld a, h
ld [$cf70], a ld [Requested1bppDest + 1], a
ld [$cf6d], sp ld [Requested1bppSource], sp
ld a, [hSPBuffer] ld a, [hSPBuffer]
ld l, a ld l, a
@ -506,7 +506,7 @@ endr
Serve2bppRequest: ; 1769 Serve2bppRequest: ; 1769
; Only call during the first fifth of VBlank ; Only call during the first fifth of VBlank
ld a, [$cf67] ld a, [Requested2bpp]
and a and a
ret z ret z
@ -521,34 +521,34 @@ Serve2bppRequest: ; 1769
Serve2bppRequest@VBlank: ; 1778 Serve2bppRequest@VBlank: ; 1778
ld a, [$cf67] ld a, [Requested2bpp]
and a and a
ret z ret z
_Serve2bppRequest: ; 177d _Serve2bppRequest: ; 177d
; Copy [$cf67] 2bpp tiles from [$cf68-9] to [$cf6a-b] ; Copy [Requested2bpp] 2bpp tiles from [Requested2bppSource] to [Requested2bppDest]
ld [hSPBuffer], sp ld [hSPBuffer], sp
; Source ; Source
ld hl, $cf68 ld hl, Requested2bppSource
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld sp, hl ld sp, hl
; Destination ; Destination
ld hl, $cf6a ld hl, Requested2bppDest
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
; # tiles to copy ; # tiles to copy
ld a, [$cf67] ld a, [Requested2bpp]
ld b, a ld b, a
xor a xor a
ld [$cf67], a ld [Requested2bpp], a
.next .next
@ -570,11 +570,11 @@ endr
ld a, l ld a, l
ld [$cf6a], a ld [Requested2bppDest], a
ld a, h ld a, h
ld [$cf6b], a ld [Requested2bppDest + 1], a
ld [$cf68], sp ld [Requested2bppSource], sp
ld a, [hSPBuffer] ld a, [hSPBuffer]
ld l, a ld l, a
@ -8209,16 +8209,19 @@ Function3b0c: ; 3b0c
ld a, [hLCDStatCustom] ld a, [hLCDStatCustom]
and a and a
ret z ret z
ld a, $0
ld [$cf68], a ld a, $00
ld [Requested2bppSource], a
ld a, $d2 ld a, $d2
ld [$cf69], a ld [Requested2bppSource + 1], a
ld a, $0
ld [$cf6a], a ld a, $00
ld [Requested2bppDest], a
ld a, $d1 ld a, $d1
ld [$cf6b], a ld [Requested2bppDest + 1], a
ld a, $9 ld a, $9
ld [$cf67], a ld [Requested2bpp], a
ret ret
; 3b2a ; 3b2a

View File

@ -829,7 +829,23 @@ WILDMON EQU 4
CurSpecies: ; cf60 CurSpecies: ; cf60
ds 1 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 MenuSelection:; cf74
ds 1 ds 1