shithub: pokecrystal

Download patch

ref: 5d229dcef2cabe2568491932bb082b0a42b46ed2
parent: 172dba3c0b38eeea09342efe297ccc7ea9b4d3d3
author: Remy Oukaour <[email protected]>
date: Tue Dec 26 18:07:46 EST 2017

Copy sram.asm's global start/end constants for wram.asm and vram.asm

--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -1398,8 +1398,8 @@
 	push af
 	ld [rSVBK], a
 	xor a
-	ld hl, wRAM1Start
-	ld bc, $1000
+	ld hl, WRAM1_Start
+	ld bc, WRAM1_End - WRAM1_Start
 	call ByteFill
 	pop af
 	inc a
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -1008,8 +1008,8 @@
 	ret
 
 SGB_ClearVRAM:
-	ld hl, VTiles0
-	ld bc, VRAM_End - VTiles0
+	ld hl, VRAM_Begin
+	ld bc, VRAM_End - VRAM_Begin
 	xor a
 	call ByteFill
 	ret
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -111,8 +111,8 @@
 	xor a
 	call ByteFill
 
-	ld hl, wRAM1Start
-	ld bc, wGameData - wRAM1Start
+	ld hl, WRAM1_Start
+	ld bc, wGameData - WRAM1_Start
 	xor a
 	call ByteFill
 
--- a/home/init.asm
+++ b/home/init.asm
@@ -69,8 +69,8 @@
 	ld [rLCDC], a
 
 ; Clear WRAM bank 0
-	ld hl, wRAM0Start
-	ld bc, wRAM1Start - wRAM0Start
+	ld hl, WRAM0_Start
+	ld bc, WRAM0_End - WRAM0_Start
 .ByteFill:
 	ld [hl], 0
 	inc hl
@@ -201,8 +201,8 @@
 	push af
 	ld [rSVBK], a
 	xor a
-	ld hl, wRAM1Start
-	ld bc, $1000
+	ld hl, WRAM1_Start
+	ld bc, WRAM1_End - WRAM1_Start
 	call ByteFill
 	pop af
 	inc a
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -303,8 +303,8 @@
 	ld a, 1
 	ld [rVBK], a
 
-	ld hl, VTiles0
-	ld bc, VRAM_End - VTiles0
+	ld hl, VRAM_Begin
+	ld bc, VRAM_End - VRAM_Begin
 	xor a
 	call ByteFill
 
--- a/sram.asm
+++ b/sram.asm
@@ -6,7 +6,7 @@
 
 SECTION "Scratch", SRAM
 
-sScratch::
+sScratch:: ds $600 ; a000
 
 
 SECTION "SRAM Bank 0", SRAM
--- a/vram.asm
+++ b/vram.asm
@@ -1,4 +1,11 @@
-SECTION "VRAM0", VRAM, BANK [0]
+VRAM_Begin EQU $8000
+VRAM_End   EQU $a000
+
+GLOBAL VRAM_Begin, VRAM_End
+
+
+SECTION "VRAM0", VRAM
+
 VTiles0:: ds $800
 VTiles1:: ds $800
 VTiles2:: ds $800
@@ -5,10 +12,11 @@
 VBGMap0:: ds $400
 VBGMap1:: ds $400
 
-SECTION "VRAM1", VRAM, BANK [1]
+
+SECTION "VRAM1", VRAM
+
 VTiles3:: ds $800
 VTiles4:: ds $800
 VTiles5:: ds $800
 VBGMap2:: ds $400
 VBGMap3:: ds $400
-VRAM_End::
--- a/wram.asm
+++ b/wram.asm
@@ -2,10 +2,16 @@
 INCLUDE "macros/wram.asm"
 INCLUDE "vram.asm"
 
+WRAM0_Start EQU $c000
+WRAM0_End   EQU $d000
+WRAM1_Start EQU $d000
+WRAM1_End   EQU $e000
 
+GLOBAL WRAM0_Start, WRAM0_End, WRAM1_Start, WRAM1_End
+
+
 SECTION "Stack", WRAM0
 
-wRAM0Start::
 StackBottom::
 	ds $100 - 1
 Stack::
@@ -1503,7 +1509,6 @@
 
 SECTION "WRAM 1", WRAMX
 
-wRAM1Start::
 wd000:: ds 1
 
 DefaultSpawnpoint:: db