diff --git a/engine/copy.asm b/engine/copy.asm index c5ba92c65..ad25c96e6 100644 --- a/engine/copy.asm +++ b/engine/copy.asm @@ -248,13 +248,13 @@ Request2bpp: ; eba .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 @@ Request2bpp: ; eba 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 @@ Request2bpp: ; eba .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,23 +322,23 @@ Request1bpp: ; f1e .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 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 @@ Request1bpp: ; f1e .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 diff --git a/main.asm b/main.asm index 736a54ae9..61a6e4119 100644 --- a/main.asm +++ b/main.asm @@ -425,7 +425,7 @@ endr Serve1bppRequest: ; 170a ; Only call during the first fifth of VBlank - ld a, [$cf6c] + ld a, [Requested1bpp] and a ret z @@ -436,29 +436,29 @@ Serve1bppRequest: ; 170a 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 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 @@ endr 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 @@ endr Serve2bppRequest: ; 1769 ; Only call during the first fifth of VBlank - ld a, [$cf67] + ld a, [Requested2bpp] and a ret z @@ -521,34 +521,34 @@ Serve2bppRequest: ; 1769 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 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 @@ endr 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 @@ Function3b0c: ; 3b0c 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 diff --git a/wram.asm b/wram.asm index 1cbc90a88..d1eff3058 100644 --- a/wram.asm +++ b/wram.asm @@ -829,7 +829,23 @@ WILDMON EQU 4 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