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

This commit is contained in:
Remy Oukaour 2017-12-26 23:07:46 -05:00
parent 172dba3c0b
commit 5d229dcef2
8 changed files with 31 additions and 18 deletions

View File

@ -1398,8 +1398,8 @@ ClearWRAM:: ; 25a
push af push af
ld [rSVBK], a ld [rSVBK], a
xor a xor a
ld hl, wRAM1Start ld hl, WRAM1_Start
ld bc, $1000 ld bc, WRAM1_End - WRAM1_Start
call ByteFill call ByteFill
pop af pop af
inc a inc a

View File

@ -1008,8 +1008,8 @@ PushSGBBorder:
ret ret
SGB_ClearVRAM: SGB_ClearVRAM:
ld hl, VTiles0 ld hl, VRAM_Begin
ld bc, VRAM_End - VTiles0 ld bc, VRAM_End - VRAM_Begin
xor a xor a
call ByteFill call ByteFill
ret ret

View File

@ -111,8 +111,8 @@ _ResetWRAM: ; 5bae
xor a xor a
call ByteFill call ByteFill
ld hl, wRAM1Start ld hl, WRAM1_Start
ld bc, wGameData - wRAM1Start ld bc, wGameData - WRAM1_Start
xor a xor a
call ByteFill call ByteFill

View File

@ -69,8 +69,8 @@ Init:: ; 17d
ld [rLCDC], a ld [rLCDC], a
; Clear WRAM bank 0 ; Clear WRAM bank 0
ld hl, wRAM0Start ld hl, WRAM0_Start
ld bc, wRAM1Start - wRAM0Start ld bc, WRAM0_End - WRAM0_Start
.ByteFill: .ByteFill:
ld [hl], 0 ld [hl], 0
inc hl inc hl
@ -201,8 +201,8 @@ ClearWRAM:: ; 25a
push af push af
ld [rSVBK], a ld [rSVBK], a
xor a xor a
ld hl, wRAM1Start ld hl, WRAM1_Start
ld bc, $1000 ld bc, WRAM1_End - WRAM1_Start
call ByteFill call ByteFill
pop af pop af
inc a inc a

View File

@ -303,8 +303,8 @@ ClearVBank1:: ; d79
ld a, 1 ld a, 1
ld [rVBK], a ld [rVBK], a
ld hl, VTiles0 ld hl, VRAM_Begin
ld bc, VRAM_End - VTiles0 ld bc, VRAM_End - VRAM_Begin
xor a xor a
call ByteFill call ByteFill

View File

@ -6,7 +6,7 @@ GLOBAL SRAM_Begin, SRAM_End
SECTION "Scratch", SRAM SECTION "Scratch", SRAM
sScratch:: sScratch:: ds $600 ; a000
SECTION "SRAM Bank 0", SRAM SECTION "SRAM Bank 0", SRAM

View File

@ -1,14 +1,22 @@
SECTION "VRAM0", VRAM, BANK [0] VRAM_Begin EQU $8000
VRAM_End EQU $a000
GLOBAL VRAM_Begin, VRAM_End
SECTION "VRAM0", VRAM
VTiles0:: ds $800 VTiles0:: ds $800
VTiles1:: ds $800 VTiles1:: ds $800
VTiles2:: ds $800 VTiles2:: ds $800
VBGMap0:: ds $400 VBGMap0:: ds $400
VBGMap1:: ds $400 VBGMap1:: ds $400
SECTION "VRAM1", VRAM, BANK [1]
SECTION "VRAM1", VRAM
VTiles3:: ds $800 VTiles3:: ds $800
VTiles4:: ds $800 VTiles4:: ds $800
VTiles5:: ds $800 VTiles5:: ds $800
VBGMap2:: ds $400 VBGMap2:: ds $400
VBGMap3:: ds $400 VBGMap3:: ds $400
VRAM_End::

View File

@ -2,10 +2,16 @@ INCLUDE "includes.asm"
INCLUDE "macros/wram.asm" INCLUDE "macros/wram.asm"
INCLUDE "vram.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 SECTION "Stack", WRAM0
wRAM0Start::
StackBottom:: StackBottom::
ds $100 - 1 ds $100 - 1
Stack:: Stack::
@ -1503,7 +1509,6 @@ wDaysSince:: db
SECTION "WRAM 1", WRAMX SECTION "WRAM 1", WRAMX
wRAM1Start::
wd000:: ds 1 wd000:: ds 1
DefaultSpawnpoint:: db DefaultSpawnpoint:: db