shithub: pokecrystal

Download patch

ref: 20dc31115e0234eb3819ce5b0d5dcfa7c009f8ea
parent: 597701f168e69a316f18951e3002c322e23cf3ea
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Thu Jan 20 15:16:22 EST 2022

Use `VRAM_End` in place of `sScratch`

--- a/engine/debug/color_picker.asm
+++ b/engine/debug/color_picker.asm
@@ -127,17 +127,17 @@
 	ret
 
 DebugColor_InitVRAM:
-	ld a, BANK(vTiles3)
+	ld a, $1
 	ldh [rVBK], a
-	ld hl, vTiles3
-	ld bc, sScratch - vTiles3
+	ld hl, VRAM_Begin
+	ld bc, VRAM_End - VRAM_Begin
 	xor a
 	call ByteFill
 
-	ld a, BANK(vTiles0)
+	ld a, $0
 	ldh [rVBK], a
-	ld hl, vTiles0
-	ld bc, sScratch - vTiles0
+	ld hl, VRAM_Begin
+	ld bc, VRAM_End - VRAM_Begin
 	xor a
 	call ByteFill
 
--- a/engine/movie/trade_animation.asm
+++ b/engine/movie/trade_animation.asm
@@ -168,7 +168,7 @@
 	ld a, $1
 	ldh [rVBK], a
 	ld hl, vTiles0
-	ld bc, sScratch - vTiles0
+	ld bc, VRAM_End - VRAM_Begin
 	xor a
 	call ByteFill
 	ld a, $0
@@ -176,7 +176,7 @@
 
 .NotCGB:
 	hlbgcoord 0, 0
-	ld bc, sScratch - vBGMap0
+	ld bc, VRAM_End - vBGMap0
 	ld a, " "
 	call ByteFill
 	ld hl, TradeGameBoyLZ
@@ -470,7 +470,7 @@
 	call DisableLCD
 	callfar ClearSpriteAnims
 	hlbgcoord 0, 0
-	ld bc, sScratch - vBGMap0
+	ld bc, VRAM_End - vBGMap0
 	ld a, " "
 	call ByteFill
 	xor a