summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorISSOtm <eldredhabert0@gmail.com>2018-06-08 19:15:55 +0200
committerISSOtm <eldredhabert0@gmail.com>2018-06-08 19:15:55 +0200
commit03279f38fc11f05ac925229102ddaf6433acfa88 (patch)
tree079964f03cd535bf3c607a8444decbe59f55e319
parent7990b32450b833c249734e15a51de4df541bc109 (diff)
Make vram.asm its own object
-rw-r--r--Makefile2
-rw-r--r--home/vcopy.asm1
-rw-r--r--vram.asm78
3 files changed, 59 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 31d49f2..c816896 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ CORRECTEDROM := $(ROM:%.gb=%-correctheader.gb)
rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2))
DIRS := home engine data audio
-OBJS := $(addprefix $(BUILD)/, gfx.o sram.o wram.o hram.o shim.o)
+OBJS := $(addprefix $(BUILD)/, gfx.o vram.o sram.o wram.o hram.o shim.o)
OBJS += $(patsubst %.asm, $(BUILD)/%.o, $(call rwildcard, $(DIRS), *.asm))
GFX := $(patsubst %.png, $(BUILD)/%.2bpp, \
diff --git a/home/vcopy.asm b/home/vcopy.asm
index 8e916f2..72fe062 100644
--- a/home/vcopy.asm
+++ b/home/vcopy.asm
@@ -1,5 +1,4 @@
INCLUDE "constants.asm"
-INCLUDE "vram.asm"
SECTION "Copy Routines used by VBlank ISR", ROM0[$123a]
diff --git a/vram.asm b/vram.asm
index 05f3199..90fd040 100644
--- a/vram.asm
+++ b/vram.asm
@@ -1,21 +1,59 @@
-vChars0 EQU $8000
-vChars1 EQU $8800
-vChars2 EQU $9000
-vBGMap0 EQU $9800
-vBGMap1 EQU $9c00
-
-; Battle/Menu
-vSprites EQU vChars0
-vFont EQU vChars1
-vFrontPic EQU vChars2
-vBackPic EQU vFrontPic + 7 * 7 * $10
-
-; Overworld
-vNPCSprites EQU vChars0
-vNPCSprites2 EQU vChars1
-vTileset EQU vChars2
-
-; Title
-vTitleLogo EQU vChars1
-vTitleLogo2 EQU vFrontPic + 7 * 7 * $10
+INCLUDE "constants.asm"
+SECTION "VRAM", VRAM[$8000],BANK[0] ; Get around a RGBLINK bug. Remove this when it doesn't yield an error about fixing the section
+
+UNION
+
+vChars0:: ; 8000
+ ds $80 tiles
+
+vChars1:: ; 8800
+ ds $80 tiles
+
+vChars2:: ; 9000
+ ds $80 tiles
+
+NEXTU
+
+; Battle/menu
+vSprites:: ; 8000
+ ds $80 tiles
+
+vFont:: ; 8800
+ ds $80 tiles
+
+vFrontPic:: ; 9000
+ ds 7 * 7 tiles
+
+NEXTU
+
+vNPCSprites:: ; 8000
+ ds $80 tiles
+
+vNPCSprites2:: ; 8800
+ ds $80 tiles
+
+vTileset:: ; 9000
+ ds $80 tiles
+
+NEXTU
+
+ ds $80 tiles
+
+vTitleLogo:: ; 8800
+ ds $80 tiles
+
+;vFrontPic:: ; 9000
+ ds 7 * 7 tiles
+
+vTitleLogo2:: ; 9310
+ ; TODO: what size?
+
+ENDU
+
+
+vBGMap0:: ; 9800
+ ds BG_MAP_WIDTH * BG_MAP_HEIGHT
+
+vBGMap1:: ; 9c00
+ ds BG_MAP_WIDTH * BG_MAP_HEIGHT \ No newline at end of file