shithub: pokecrystal

Download patch

ref: 47e4f21e62705a8d2c832dad257c421a5cbd5c1b
parent: 5d229dcef2cabe2568491932bb082b0a42b46ed2
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Tue Dec 26 18:18:05 EST 2017

Keep memory map values in hardware_constants.asm

--- a/constants/hardware_constants.asm
+++ b/constants/hardware_constants.asm
@@ -1,4 +1,19 @@
-; Graciously aped from http://nocash.emubase.de/pandocs.htm .
+; Graciously aped from:
+; http://nocash.emubase.de/pandocs.htm
+; http://gameboy.mongenel.com/dmg/asmmemmap.html
+
+; memory map
+VRAM_Begin  EQU $8000
+VRAM_End    EQU $a000
+SRAM_Begin  EQU $a000
+SRAM_End    EQU $c000
+WRAM0_Begin EQU $c000
+WRAM0_End   EQU $d000
+WRAM1_Begin EQU $d000
+WRAM1_End   EQU $e000
+; hardware registers $ff00-$ff80 (see below)
+HRAM_Begin  EQU $ff80
+HRAM_End    EQU $ffff
 
 ; MBC3
 MBC3SRamEnable EQU $0000
--- 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, WRAM1_Start
-	ld bc, WRAM1_End - WRAM1_Start
+	ld hl, WRAM1_Begin
+	ld bc, WRAM1_End - WRAM1_Begin
 	call ByteFill
 	pop af
 	inc a
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -111,8 +111,8 @@
 	xor a
 	call ByteFill
 
-	ld hl, WRAM1_Start
-	ld bc, wGameData - WRAM1_Start
+	ld hl, WRAM1_Begin
+	ld bc, wGameData - WRAM1_Begin
 	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, WRAM0_Start
-	ld bc, WRAM0_End - WRAM0_Start
+	ld hl, WRAM0_Begin
+	ld bc, WRAM0_End - WRAM0_Begin
 .ByteFill:
 	ld [hl], 0
 	inc hl
@@ -87,8 +87,8 @@
 	ld a, [hFFEA]
 	push af
 	xor a
-	ld hl, HRAM_START
-	ld bc, HRAM_END - HRAM_START
+	ld hl, HRAM_Begin
+	ld bc, HRAM_End - HRAM_Begin
 	call ByteFill
 	pop af
 	ld [hFFEA], a
@@ -201,8 +201,8 @@
 	push af
 	ld [rSVBK], a
 	xor a
-	ld hl, WRAM1_Start
-	ld bc, WRAM1_End - WRAM1_Start
+	ld hl, WRAM1_Begin
+	ld bc, WRAM1_End - WRAM1_Begin
 	call ByteFill
 	pop af
 	inc a
--- a/hram.asm
+++ b/hram.asm
@@ -1,4 +1,3 @@
-HRAM_START         EQU $ff80
 hPushOAM           EQU $ff80 ; 10 bytes
 
 hROMBankBackup     EQU $ff8a
@@ -124,5 +123,3 @@
 hMobile            EQU $ffe9
 hFFEA              EQU $ffea
 hClockResetTrigger EQU $ffeb
-
-HRAM_END EQU $ffff
--- a/sram.asm
+++ b/sram.asm
@@ -1,9 +1,3 @@
-SRAM_Begin EQU $a000
-SRAM_End   EQU $c000
-
-GLOBAL SRAM_Begin, SRAM_End
-
-
 SECTION "Scratch", SRAM
 
 sScratch:: ds $600 ; a000
--- a/vram.asm
+++ b/vram.asm
@@ -1,9 +1,3 @@
-VRAM_Begin EQU $8000
-VRAM_End   EQU $a000
-
-GLOBAL VRAM_Begin, VRAM_End
-
-
 SECTION "VRAM0", VRAM
 
 VTiles0:: ds $800
--- a/wram.asm
+++ b/wram.asm
@@ -1,13 +1,8 @@
 INCLUDE "includes.asm"
 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
+INCLUDE "vram.asm"
 
 
 SECTION "Stack", WRAM0