summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-30 13:17:47 -0400
committerU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-30 13:17:47 -0400
commit286c160c27e58caad32f776cec684eb8cb2cb22a (patch)
treed89563a88a9674837896d6e88b9c9431b708bf97
parentc8a5720cca08631dcc20d036731e261a09a9a76e (diff)
parent188ac8a9b4816dd98df0108314e58885c3b07452 (diff)
Merge branch 'master' of https://github.com/yenatch/pokered
Conflicts: engine/battle/1c.asm
-rw-r--r--Makefile109
-rw-r--r--blue/audio.asm (renamed from audio_blue.asm)0
-rw-r--r--blue/main.asm (renamed from pokeblue.asm)0
-rw-r--r--blue/text.asm2
-rw-r--r--blue/wram.asm2
-rw-r--r--constants.asm1
-rwxr-xr-xdata/sgb_border.asm4
-rwxr-xr-xengine/HoF_room_pc.asm20
-rwxr-xr-xengine/battle/1c.asm8
-rwxr-xr-xengine/battle/animations.asm30
-rwxr-xr-xengine/battle/core.asm40
-rwxr-xr-xengine/battle/e.asm2
-rwxr-xr-xengine/evolution.asm6
-rwxr-xr-xengine/gamefreak.asm6
-rwxr-xr-xengine/hall_of_fame.asm6
-rwxr-xr-xengine/hidden_object_functions17.asm2
-rwxr-xr-xengine/intro.asm16
-rwxr-xr-xengine/load_pokedex_tiles.asm4
-rw-r--r--engine/menu/bills_pc.asm2
-rwxr-xr-xengine/menu/diploma.asm2
-rwxr-xr-xengine/menu/naming_screen.asm2
-rwxr-xr-xengine/menu/start_sub_menus.asm18
-rwxr-xr-xengine/menu/status_screen.asm8
-rwxr-xr-xengine/mon_party_sprites.asm60
-rwxr-xr-xengine/oak_speech.asm6
-rwxr-xr-xengine/overworld/cut.asm12
-rwxr-xr-xengine/overworld/emotion_bubbles.asm4
-rwxr-xr-xengine/overworld/healing_machine.asm2
-rwxr-xr-xengine/overworld/ledges.asm2
-rwxr-xr-xengine/overworld/map_sprites.asm6
-rwxr-xr-xengine/overworld/player_animations.asm24
-rwxr-xr-xengine/overworld/ssanne.asm2
-rwxr-xr-xengine/palettes.asm4
-rwxr-xr-xengine/slot_machine.asm12
-rwxr-xr-xengine/titlescreen.asm22
-rwxr-xr-xengine/town_map.asm10
-rwxr-xr-xengine/trade.asm14
-rw-r--r--gfx/badges.png (renamed from gfx/badges.w16.png)bin924 -> 924 bytes
-rw-r--r--gfx/blue/blueversion.png (renamed from gfx/blue/blueversion.h8.png)bin136 -> 136 bytes
-rw-r--r--gfx/blue/sgbborder.png (renamed from gfx/blue/sgbborder.w128.png)bin1117 -> 1117 bytes
-rw-r--r--gfx/copyright.png (renamed from gfx/copyright.h8.png)bin220 -> 220 bytes
-rw-r--r--gfx/emotion_bubbles.png (renamed from gfx/emotion_bubbles.w16.png)bin149 -> 149 bytes
-rw-r--r--gfx/font.png (renamed from gfx/font.w128.png)bin719 -> 719 bytes
-rw-r--r--gfx/gamefreak.png (renamed from gfx/gamefreak.h8.png)bin147 -> 147 bytes
-rw-r--r--gfx/gamefreak_intro.png (renamed from gfx/gamefreak_intro.h8.png)bin297 -> 297 bytes
-rw-r--r--gfx/hp_bar_and_status.w80.pngbin257 -> 0 bytes
-rw-r--r--gfx/pokemon_logo.png (renamed from gfx/pokemon_logo.w128.png)bin926 -> 926 bytes
-rw-r--r--gfx/red/redgreenversion.png (renamed from gfx/red/redgreenversion.h8.png)bin145 -> 145 bytes
-rw-r--r--gfx/red/sgbborder.png (renamed from gfx/red/sgbborder.w128.png)bin1048 -> 1048 bytes
-rw-r--r--gfx/theend.interleave.png (renamed from gfx/theend.w40.interleave.png)bin139 -> 139 bytes
-rw-r--r--gfx/tilesets/cavern.t14.png (renamed from gfx/tilesets/cavern.w128.t14.png)bin1022 -> 1022 bytes
-rw-r--r--gfx/tilesets/cemetery.t4.png (renamed from gfx/tilesets/cemetery.w128.t4.png)bin928 -> 928 bytes
-rw-r--r--gfx/tilesets/club.t5.png (renamed from gfx/tilesets/club.w128.t5.png)bin899 -> 899 bytes
-rw-r--r--gfx/tilesets/facility.png (renamed from gfx/tilesets/facility.w128.png)bin1081 -> 1081 bytes
-rw-r--r--gfx/tilesets/forest.png (renamed from gfx/tilesets/forest.w128.png)bin1414 -> 1414 bytes
-rw-r--r--gfx/tilesets/gate.t1.png (renamed from gfx/tilesets/gate.w128.t1.png)bin1119 -> 1119 bytes
-rw-r--r--gfx/tilesets/gym.png (renamed from gfx/tilesets/gym.w128.png)bin1157 -> 1157 bytes
-rw-r--r--gfx/tilesets/house.t2.png (renamed from gfx/tilesets/house.w128.t2.png)bin1163 -> 1163 bytes
-rw-r--r--gfx/tilesets/interior.t1.png (renamed from gfx/tilesets/interior.w128.t1.png)bin1141 -> 1141 bytes
-rw-r--r--gfx/tilesets/lab.t4.png (renamed from gfx/tilesets/lab.w128.t4.png)bin1051 -> 1051 bytes
-rw-r--r--gfx/tilesets/lobby.t2.png (renamed from gfx/tilesets/lobby.w128.t2.png)bin966 -> 966 bytes
-rw-r--r--gfx/tilesets/mansion.t2.png (renamed from gfx/tilesets/mansion.w128.t2.png)bin960 -> 960 bytes
-rw-r--r--gfx/tilesets/overworld.t2.png (renamed from gfx/tilesets/overworld.w128.t2.png)bin1309 -> 1309 bytes
-rw-r--r--gfx/tilesets/plateau.t10.png (renamed from gfx/tilesets/plateau.w128.t10.png)bin1011 -> 1011 bytes
-rw-r--r--gfx/tilesets/pokecenter.png (renamed from gfx/tilesets/pokecenter.w128.png)bin1200 -> 1200 bytes
-rw-r--r--gfx/tilesets/reds_house.t7.png (renamed from gfx/tilesets/reds_house.w128.t7.png)bin845 -> 845 bytes
-rw-r--r--gfx/tilesets/ship.t6.png (renamed from gfx/tilesets/ship.w128.t6.png)bin865 -> 865 bytes
-rw-r--r--gfx/tilesets/ship_port.t2.png (renamed from gfx/tilesets/ship_port.w128.t2.png)bin1125 -> 1125 bytes
-rw-r--r--gfx/tilesets/underground.t7.png (renamed from gfx/tilesets/underground.w128.t7.png)bin272 -> 272 bytes
-rw-r--r--home.asm44
-rwxr-xr-xmain.asm54
-rw-r--r--red/audio.asm (renamed from audio_red.asm)0
-rw-r--r--red/main.asm (renamed from pokered.asm)0
-rw-r--r--red/text.asm2
-rw-r--r--red/wram.asm2
-rwxr-xr-xscripts/rockethideout2.asm120
-rwxr-xr-xscripts/vermiliondock.asm2
-rw-r--r--vram.asm21
-rw-r--r--yellow.asm1
-rw-r--r--yellow/audio.asm2
-rw-r--r--yellow/main.asm2
-rw-r--r--yellow/text.asm2
-rw-r--r--yellow/wram.asm2
83 files changed, 352 insertions, 372 deletions
diff --git a/Makefile b/Makefile
index 7a7ffcdd..4dc35a7a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,94 +1,81 @@
PYTHON := python
+MD5 := md5sum -c --quiet
.SUFFIXES:
.SUFFIXES: .asm .tx .o .gbc
-.PHONY: all clean red blue compare pngs
+.PHONY: all clean red blue yellow compare
.PRECIOUS: %.2bpp
.SECONDEXPANSION:
-POKEMONTOOLS := extras/pokemontools
-GFX := $(PYTHON) $(POKEMONTOOLS)/gfx.py
-PIC := $(PYTHON) $(POKEMONTOOLS)/pic.py
-INCLUDES := $(PYTHON) $(POKEMONTOOLS)/scan_includes.py
-PREPROCESS := $(PYTHON) prequeue.py
+poketools := extras/pokemontools
+gfx := $(PYTHON) $(poketools)/gfx.py
+pic := $(PYTHON) $(poketools)/pic.py
+includes := $(PYTHON) $(poketools)/scan_includes.py
+pre := $(PYTHON) prequeue.py
-TEXTQUEUE :=
-RED_OBJS := \
-pokered.o \
-audio_red.o \
-wram.o \
-text.o
+versions := red blue yellow
-BLUE_OBJS := \
-pokeblue.o \
-audio_blue.o \
-wram.o \
-text.o
+$(foreach ver, $(versions), \
+ $(eval $(ver)_asm := $(shell find $(ver) -iname '*.asm')) \
+ $(eval $(ver)_obj := $($(ver)_asm:.asm=.o)) \
+ $(eval all_obj += $($(ver)_obj)) \
+)
+$(foreach obj, $(all_obj), \
+ $(eval $(obj:.o=)_dep := $(shell $(includes) $(obj:.o=.asm))) \
+)
-OBJS := $(RED_OBJS) $(BLUE_OBJS)
-OBJS := $(sort $(OBJS))
-ROMS := pokered.gbc pokeblue.gbc
+roms := pokered.gbc pokeblue.gbc
-# object dependencies
-$(shell $(foreach obj, $(OBJS), $(eval $(obj:.o=)_DEPENDENCIES := $(shell $(INCLUDES) $(obj:.o=.asm)))))
+all: $(roms)
+red: pokered.gbc
+blue: pokeblue.gbc
+yellow: pokeyellow.gbc
-all: $(ROMS)
-red: pokered.gbc
-blue: pokeblue.gbc
compare:
- @md5sum -c --quiet roms.md5
+ @$(MD5) roms.md5
clean:
- rm -f $(ROMS)
- rm -f $(OBJS)
- find . -iname '*.tx' -exec rm {} +
- find gfx -iname '*.[12]bpp' -exec rm {} +
- find pic -iname '*.pic' -exec rm {} +
- find pic -iname '*.2bpp' -exec rm {} +
- rm -f redrle
-
-
-redrle: extras/redtools/redrle.c
- ${CC} -o $@ $<
+ rm -f $(roms) $(all_obj)
+ find . \( -iname '*.tx' -o -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
%.asm: ;
-.asm.tx:
- $(eval TEXTQUEUE += $<)
+%.tx: %.asm
+ $(eval txq += $<)
@rm -f $@
-$(OBJS): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_DEPENDENCIES))
- @$(PREPROCESS) $(TEXTQUEUE)
- @$(eval TEXTQUEUE :=)
- @$(GFX) 2bpp $(2BPPQUEUE)
- @$(eval 2BPPQUEUE :=)
- @$(GFX) 1bpp $(1BPPQUEUE)
- @$(eval 1BPPQUEUE :=)
- @$(PIC) compress $(PICQUEUE)
- @$(eval PICQUEUE :=)
+$(all_obj): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_dep))
+ @$(pre) $(txq); $(eval txq :=)
+ @$(gfx) 2bpp $(2bppq); $(eval 2bppq :=)
+ @$(gfx) 1bpp $(1bppq); $(eval 1bppq :=)
+ @$(pic) compress $(picq); $(eval picq :=)
rgbasm -o $@ $*.tx
-OPTIONS = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03
+link := rgblink -n $*.sym -m $*.map
+dmg_opt := -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03
+cgb_opt := -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03
+
+pokered.gbc: $(red_obj)
+ $(link) -o $@ $^
+ rgbfix $(dmg_opt) -t "POKEMON RED" $@
-pokered.gbc: $(RED_OBJS)
- rgblink -n $*.sym -m $*.map -o $@ $^
- rgbfix $(OPTIONS) -t "POKEMON RED" $@
+pokeblue.gbc: $(blue_obj)
+ $(link) -o $@ $^
+ rgbfix $(dmg_opt) -t "POKEMON BLUE" $@
-pokeblue.gbc: $(BLUE_OBJS)
- rgblink -n $*.sym -m $*.map -o $@ $^
- rgbfix $(OPTIONS) -t "POKEMON BLUE" $@
+pokeyellow.gbc: $(yellow_obj)
+ $(link) -o $@ $^
+ rgbfix $(cgb_opt) -t "POKEMON YELLOW" $@
%.2bpp: %.png
- $(eval 2BPPQUEUE += $<)
+ $(eval 2bppq += $<)
@rm -f $@
%.1bpp: %.png
- $(eval 1BPPQUEUE += $<)
+ $(eval 1bppq += $<)
@rm -f $@
-%.pic: %.2bpp
- $(eval PICQUEUE += $<)
+%.pic: %.2bpp
+ $(eval picq += $<)
@rm -f $@
-
-
diff --git a/audio_blue.asm b/blue/audio.asm
index 53e37a2d..53e37a2d 100644
--- a/audio_blue.asm
+++ b/blue/audio.asm
diff --git a/pokeblue.asm b/blue/main.asm
index 3fcef980..3fcef980 100644
--- a/pokeblue.asm
+++ b/blue/main.asm
diff --git a/blue/text.asm b/blue/text.asm
new file mode 100644
index 00000000..ec6d7203
--- /dev/null
+++ b/blue/text.asm
@@ -0,0 +1,2 @@
+INCLUDE "blue.asm"
+INCLUDE "text.asm"
diff --git a/blue/wram.asm b/blue/wram.asm
new file mode 100644
index 00000000..70292177
--- /dev/null
+++ b/blue/wram.asm
@@ -0,0 +1,2 @@
+INCLUDE "blue.asm"
+INCLUDE "wram.asm"
diff --git a/constants.asm b/constants.asm
index 26356edd..b427e3c7 100644
--- a/constants.asm
+++ b/constants.asm
@@ -3,6 +3,7 @@ INCLUDE "version.asm"
INCLUDE "macros.asm"
INCLUDE "hram.asm"
+INCLUDE "vram.asm"
INCLUDE "constants/hardware_constants.asm"
INCLUDE "constants/oam_constants.asm"
diff --git a/data/sgb_border.asm b/data/sgb_border.asm
index 716a991e..5a0bbb2d 100755
--- a/data/sgb_border.asm
+++ b/data/sgb_border.asm
@@ -55,8 +55,8 @@ ENDC
SGBBorderGraphics: ; 72fe8 (1c:6fe8)
IF _RED
- INCBIN "gfx/red/sgbborder.w128.2bpp"
+ INCBIN "gfx/red/sgbborder.2bpp"
ENDC
IF _BLUE
- INCBIN "gfx/blue/sgbborder.w128.2bpp"
+ INCBIN "gfx/blue/sgbborder.2bpp"
ENDC
diff --git a/engine/HoF_room_pc.asm b/engine/HoF_room_pc.asm
index 9b5bd8b2..5af7484c 100755
--- a/engine/HoF_room_pc.asm
+++ b/engine/HoF_room_pc.asm
@@ -4,13 +4,13 @@ HallOfFameComputer: ; 7405c (1d:405c)
ld c, $64
call DelayFrames
call DisableLCD
- ld hl, $8800
- ld bc, $400
+ ld hl, vFont
+ ld bc, $800 / 2
call Func_74171
- ld hl, $9600
- ld bc, $100
+ ld hl, vChars2 + $600
+ ld bc, $200 / 2
call Func_74171
- ld hl, $97e0
+ ld hl, vChars2 + $7e0
ld bc, $10
ld a, $ff
call FillMemory
@@ -66,16 +66,16 @@ DisplayCreditsMon: ; 740cb (1d:40cb)
ld hl,Coord
call GetMonHeader
call LoadFrontSpriteByMonIndex
- ld hl,$980C
+ ld hl,vBGMap0 + $c
call Func_74164
xor a
ld [H_AUTOBGTRANSFERENABLED],a
call LoadScreenTilesFromBuffer1
- ld hl,$9800
+ ld hl,vBGMap0
call Func_74164
ld a,$A7
ld [$FF4B],a
- ld hl,$9C00
+ ld hl,vBGMap1
call Func_74164
call FillMiddleOfScreenWithWhite
ld a,$FC
@@ -238,7 +238,7 @@ Credits: ; 7418e (1d:418e)
call FillMiddleOfScreenWithWhite
pop de
ld de, TheEndGfx
- ld hl, $9600
+ ld hl, vChars2 + $600
ld bc, (BANK(TheEndGfx) << 8) + $0a
call CopyVideoData
FuncCoord 4, 8
@@ -260,4 +260,4 @@ INCLUDE "data/credits_order.asm"
INCLUDE "text/credits_text.asm"
TheEndGfx: ; 7473e (1d:473e) ; 473E (473F on blue)
- INCBIN "gfx/theend.w40.interleave.2bpp"
+ INCBIN "gfx/theend.interleave.2bpp"
diff --git a/engine/battle/1c.asm b/engine/battle/1c.asm
index dff505a1..d936c7e5 100755
--- a/engine/battle/1c.asm
+++ b/engine/battle/1c.asm
@@ -45,9 +45,9 @@ Func_708ca: ; 708ca (1c:48ca)
jp ClearSprites
Func_7092a: ; 7092a (1c:492a)
- ld de, $9000
- ld hl, $8000
- ld bc, $31
+ ld de, vFrontPic
+ ld hl, vSprites
+ ld bc, 7 * 7
call CopyVideoData
ld a, $10
ld [W_BASECOORDY], a ; wd082
@@ -261,7 +261,7 @@ DungeonMaps2: ; 70a44 (1c:4a44)
db $FF
LoadBattleTransitionTile: ; 70a4d (1c:4a4d)
- ld hl, $8ff0
+ ld hl, vChars1 + $7f0
ld de, BattleTransitionTile
ld bc, (BANK(BattleTransitionTile) << 8) + $01
jp CopyVideoData
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index a7bda2d2..e3ee4fe0 100755
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -341,7 +341,7 @@ LoadAnimationTileset: ; 781d2 (1e:41d2)
ld e,a
ld a,[hl]
ld d,a ; de = address of tileset
- ld hl,$8310 ; destination address in VRAM
+ ld hl,vSprites + $310
ld b, BANK(AnimationTileset1) ; ROM bank
ld a,[wd07d]
ld c,a ; number of tiles
@@ -1960,17 +1960,17 @@ AnimationSlideMonHalfLeft: ; 79645 (1e:5645)
Func_79652: ; 79652 (1e:5652)
ld a, [H_WHOSETURN] ; $fff3
and a
- ld hl, $9310
+ ld hl, vBackPic
jr z, .asm_7965d
- ld hl, $9000
+ ld hl, vFrontPic
.asm_7965d
ld de, wTempPic
- ld bc, $31
+ ld bc, 7 * 7
jp CopyVideoData
AnimationWavyScreen: ; 79666 (1e:5666)
; used in Psywave/Psychic etc.
- ld hl, $9800
+ ld hl, vBGMap0
call Func_79e0d
call Delay3
xor a
@@ -2005,7 +2005,7 @@ AnimationWavyScreen: ; 79666 (1e:5666)
ld [H_AUTOBGTRANSFERENABLED], a
call Delay3
call LoadScreenTilesFromBuffer2
- ld hl, $9c00
+ ld hl, vBGMap1
call Func_79e0d
ret
@@ -2751,22 +2751,22 @@ Unknown_79d63: ; 79d63 (1e:5d63)
db $00,$84,$06,$81,$02,$88,$01,$83,$05,$89,$09,$80,$07,$87,$03,$82,$04,$85,$08,$86
AnimationShakeEnemyHUD: ; 79d77 (1e:5d77)
- ld de, $9310
- ld hl, $8000
- ld bc, $0031
+ ld de, vBackPic
+ ld hl, vSprites
+ ld bc, 7 * 7
call CopyVideoData
xor a
ld [$ffae], a
- ld hl, $9800
+ ld hl, vBGMap0
call Func_79e0d
ld a, $90
ld [$ffb0], a
- ld hl, $9b20
+ ld hl, vBGMap0 + $320
call Func_79e0d
ld a, $38
ld [$ffb0], a
call Func_792fd
- ld hl, $9800
+ ld hl, vBGMap0
call Func_79e0d
call AnimationHideMonPic
call Delay3
@@ -2776,17 +2776,17 @@ AnimationShakeEnemyHUD: ; 79d77 (1e:5d77)
call ClearSprites
ld a, $90
ld [$ffb0], a
- ld hl, $9c00
+ ld hl, vBGMap1
call Func_79e0d
xor a
ld [$ffb0], a
call SaveScreenTilesToBuffer1
- ld hl, $9800
+ ld hl, vBGMap0
call Func_79e0d
call ClearScreen
call Delay3
call LoadScreenTilesFromBuffer1
- ld hl, $9c00
+ ld hl, vBGMap1
jp Func_79e0d
Func_79dda: ; 79dda (1e:5dda)
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 68c3f892..b6d8b78e 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -103,7 +103,7 @@ Func_3c04c: ; 3c04c (f:404c)
call DisableLCD
call LoadFontTilePatterns
call Func_3ee58
- ld hl, $9800
+ ld hl, vBGMap0
ld bc, $400
.asm_3c06f
ld a, $7f
@@ -113,7 +113,7 @@ Func_3c04c: ; 3c04c (f:404c)
or c
jr nz, .asm_3c06f
ld hl, wTileMap
- ld de, $9800
+ ld de, vBGMap0
ld b, $12
.asm_3c07f
ld c, $14
@@ -1462,7 +1462,7 @@ Func_3c92a: ; 3c92a (f:492a)
ld [wcf91],a
ld [wd0b5],a
call GetMonHeader
- ld de,$9000
+ ld de,vFrontPic
call LoadMonFrontSprite
ld a,$CF
ld [$FFE1],a
@@ -2400,7 +2400,7 @@ Func_3d119: ; 3d119 (f:5119)
ld [wcf91], a
ld [wd0b5], a
call GetMonHeader
- ld de, $9000
+ ld de, vFrontPic
call LoadMonFrontSprite
jr .asm_3d187
.asm_3d182
@@ -6288,17 +6288,17 @@ Func_3ec92: ; 3ec92 (f:6c92)
ld e, a
dec b
jr nz, .asm_3ecb2
- ld de, $9310
+ ld de, vBackPic
call InterlaceMergeSpriteBuffers
ld a, $a
ld [$0], a
xor a
ld [$4000], a
- ld hl, $8000
+ ld hl, vSprites
ld de, S_SPRITEBUFFER1
ld a, [H_LOADEDROMBANK]
ld b, a
- ld c, $31
+ ld c, 7 * 7
call CopyVideoData
xor a
ld [$0], a
@@ -6552,22 +6552,22 @@ Func_3ee5b: ; 3ee5b (f:6e5b)
add a
jr c, .asm_3ee7c
ld hl, BattleHudTiles1 ; $6080
- ld de, $96d0
+ ld de, vChars2 + $6d0
ld bc, $18
ld a, BANK(BattleHudTiles1)
call FarCopyDataDouble
ld hl, BattleHudTiles2 ; $6098
- ld de, $9730
+ ld de, vChars2 + $730
ld bc, $30
ld a, BANK(BattleHudTiles2)
jp FarCopyDataDouble
.asm_3ee7c
ld de, BattleHudTiles1 ; $6080
- ld hl, $96d0
+ ld hl, vChars2 + $6d0
ld bc, (BANK(BattleHudTiles1) << 8) + $03
call CopyVideoDataDouble
ld de, BattleHudTiles2 ; $6098
- ld hl, $9730
+ ld hl, vChars2 + $730
ld bc, (BANK(BattleHudTiles2) << 8) + $06
jp CopyVideoDataDouble
@@ -6751,13 +6751,13 @@ InitWildBattle: ; 3ef8b (f:6f8b)
push af
ld a, MON_GHOST
ld [wcf91], a
- ld de, $9000
+ ld de, vFrontPic
call LoadMonFrontSprite ; load ghost sprite
pop af
ld [wcf91], a
jr .spriteLoaded
.isNoGhost
- ld de, $9000
+ ld de, vFrontPic
call LoadMonFrontSprite ; load mon sprite
.spriteLoaded
xor a
@@ -6825,7 +6825,7 @@ _LoadTrainerPic: ; 3f04b (f:704b)
ld a, Bank(RedPicFront)
.loadSprite
call UncompressSpriteFromDE
- ld de, $9000
+ ld de, vFrontPic
ld a, $77
ld c, a
jp LoadUncompressedSpriteData
@@ -6930,9 +6930,9 @@ asm_3f0d0: ; 3f0d0 (f:70d0)
jr nz, .asm_3f0f4
ret
-; loads back sprite of mon to $8000
-; assumes the corresponding mon header is already loaded
-LoadMonBackSprite: ; 3f103 (f:7103)
+LoadMonBackSprite:
+; Assumes the monster's attributes have
+; been loaded with GetMonHeader.
ld a, [wcfd9]
ld [wcf91], a
FuncCoord 1, 5
@@ -6944,10 +6944,10 @@ LoadMonBackSprite: ; 3f103 (f:7103)
call UncompressMonSprite
ld a, $3
call Predef ; indirect jump to ScaleSpriteByTwo (2fe40 (b:7e40))
- ld de, $9310
+ ld de, vBackPic
call InterlaceMergeSpriteBuffers ; combine the two buffers to a single 2bpp sprite
- ld hl, $8000
- ld de, $9310
+ ld hl, vSprites
+ ld de, vBackPic
ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied
ld a, [H_LOADEDROMBANK]
ld b, a
diff --git a/engine/battle/e.asm b/engine/battle/e.asm
index 77fae4df..fbede5dd 100755
--- a/engine/battle/e.asm
+++ b/engine/battle/e.asm
@@ -1382,7 +1382,7 @@ DrawEnemyPokeballs: ; 0x3a857
LoadPartyPokeballGfx: ; 3a85d (e:685d)
ld de, PokeballTileGraphics ; $697e
- ld hl, $8310
+ ld hl, vSprites + $310
ld bc, (BANK(PokeballTileGraphics) << 8) + $04
jp CopyVideoData
diff --git a/engine/evolution.asm b/engine/evolution.asm
index 37aef792..8e511182 100755
--- a/engine/evolution.asm
+++ b/engine/evolution.asm
@@ -28,9 +28,9 @@ Func_7bde9: ; 7bde9 (1e:7de9)
ld [wcf91], a
ld [wd0b5], a
call Func_7beb9
- ld de, $9000
- ld hl, $9310
- ld bc, $31
+ ld de, vFrontPic
+ ld hl, vBackPic
+ ld bc, 7 * 7
call CopyVideoData
ld a, [wHPBarMaxHP]
ld [wcf91], a
diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm
index 25f0bf5a..d0f1bbac 100755
--- a/engine/gamefreak.asm
+++ b/engine/gamefreak.asm
@@ -4,15 +4,15 @@ LoadShootingStarGraphics: ; 70000 (1c:4000)
ld a, $a4
ld [rOBP1], a ; $ff49
ld de, AnimationTileset2 + $30 ; $471e ; star tile (top left quadrant)
- ld hl, $8a00
+ ld hl, vChars1 + $200
ld bc, (BANK(AnimationTileset2) << 8) + $01
call CopyVideoData
ld de, AnimationTileset2 + $130 ; $481e ; star tile (bottom left quadrant)
- ld hl, $8a10
+ ld hl, vChars1 + $210
ld bc, (BANK(AnimationTileset2) << 8) + $01
call CopyVideoData
ld de, FallingStar ; $4190
- ld hl, $8a20
+ ld hl, vChars1 + $220
ld bc, (BANK(FallingStar) << 8) + $01
call CopyVideoData
ld hl, GameFreakLogoOAMData ; $4140
diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm
index f02107cc..981e1db5 100755
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -6,7 +6,7 @@ AnimateHallOfFame: ; 701a0 (1c:41a0)
call LoadFontTilePatterns
call LoadTextBoxTilePatterns
call DisableLCD
- ld hl, $9800
+ ld hl,vBGMap0
ld bc, $800
ld a, $7f
call FillMemory
@@ -197,14 +197,14 @@ Func_7033e: ; 7033e (1c:433e)
ld de, $a000
ld bc, $310
call CopyData
- ld de, $9000
+ ld de, vFrontPic
call InterlaceMergeSpriteBuffers
ld de, RedPicBack ; $7e0a
ld a, BANK(RedPicBack)
call UncompressSpriteFromDE
ld a, $3
call Predef ; indirect jump to ScaleSpriteByTwo (2fe40 (b:7e40))
- ld de, $9310
+ ld de, vBackPic
call InterlaceMergeSpriteBuffers
ld c, $1
diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm
index 070dde98..bdda042c 100755
--- a/engine/hidden_object_functions17.asm
+++ b/engine/hidden_object_functions17.asm
@@ -73,7 +73,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9)
ld a, [wcf91]
ld [wd0b5], a
call GetMonHeader
- ld de, $8b10
+ ld de, vChars1 + $310
call LoadMonFrontSprite
ld a, $80
ld [$ffe1], a
diff --git a/engine/intro.asm b/engine/intro.asm
index 767522e7..8e344e48 100755
--- a/engine/intro.asm
+++ b/engine/intro.asm
@@ -199,7 +199,7 @@ Func_417c7: ; 417c7 (10:57c7)
ret
Func_417f0: ; 417f0 (10:57f0)
- ld hl, $9c00
+ ld hl, vBGMap1
ld bc, $240
jr asm_417fe
@@ -275,22 +275,22 @@ Func_41849: ; 41849 (10:5849)
LoadIntroGraphics: ; 41852 (10:5852)
ld hl, FightIntroBackMon ; $5a99
- ld de, $9000
+ ld de, vChars2
ld bc, $600
ld a, BANK(FightIntroBackMon)
call FarCopyData2
ld hl, GameFreakIntro ; $5959
- ld de, $9600
+ ld de, vChars2 + $600
ld bc, $140
ld a, BANK(GameFreakIntro)
call FarCopyData2
ld hl, GameFreakIntro ; $5959
- ld de, $8800
+ ld de, vChars1
ld bc, $140
ld a, BANK(GameFreakIntro)
call FarCopyData2
ld hl, FightIntroFrontMon ; $6099
- ld de, $8000
+ ld de, vChars0
ld bc, $6c0
ld a, BANK(FightIntroFrontMon)
jp FarCopyData2
@@ -341,10 +341,10 @@ Func_418e9: ; 418e9 (10:58e9)
ld hl, Coord
ld c, $50
call Func_41807
- ld hl, $9c00
+ ld hl, vBGMap1
ld c, $80
call Func_41807
- ld hl, $9dc0
+ ld hl, vBGMap1 + $1c0
ld c, $80
jp Func_41807
@@ -425,7 +425,7 @@ IntroNidorinoAnimation7: ; 41950 (10:5950)
db $50 ; list terminator
GameFreakIntro: ; 41959 (10:5959)
- INCBIN "gfx/gamefreak_intro.h8.2bpp"
+ INCBIN "gfx/gamefreak_intro.2bpp"
INCBIN "gfx/gamefreak_logo.2bpp"
ds $10 ; blank tile
diff --git a/engine/load_pokedex_tiles.asm b/engine/load_pokedex_tiles.asm
index 7a49adaa..e8205ef8 100755
--- a/engine/load_pokedex_tiles.asm
+++ b/engine/load_pokedex_tiles.asm
@@ -2,10 +2,10 @@
LoadPokedexTilePatterns: ; 17840 (5:7840)
call LoadHpBarAndStatusTilePatterns
ld de,PokedexTileGraphics ; $6488
- ld hl,$9600
+ ld hl,vChars2 + $600
ld bc,(BANK(PokedexTileGraphics) << 8) + $12
call CopyVideoData
ld de,PokeballTileGraphics ; $697e
- ld hl,$9720
+ ld hl,vChars2 + $720
ld bc,(BANK(PokeballTileGraphics) << 8) + $01
jp CopyVideoData ; load pokeball tile for marking caught mons
diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm
index 41210f72..bfcdcb9b 100644
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -137,7 +137,7 @@ Func_214e8: ; 214e8 (8:54e8)
BillsPCMenu:
ld a, [wccd3]
ld [wCurrentMenuItem], a ; wCurrentMenuItem
- ld hl, $9780
+ ld hl, vChars2 + $780
ld de, PokeballTileGraphics ; $697e
ld bc, (BANK(PokeballTileGraphics) << 8) + $01
call CopyVideoData
diff --git a/engine/menu/diploma.asm b/engine/menu/diploma.asm
index bb1a2584..58b613c5 100755
--- a/engine/menu/diploma.asm
+++ b/engine/menu/diploma.asm
@@ -8,7 +8,7 @@ DisplayDiploma: ; 566e2 (15:66e2)
set 6, [hl]
call DisableLCD
ld hl, CircleTile ; $7d88
- ld de, $9700
+ ld de, vChars2 + $700
ld bc, $0010
ld a, BANK(CircleTile)
call FarCopyData2
diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm
index bfafe778..26e7227f 100755
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -325,7 +325,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
LoadEDTile: ; 675b (1:675b)
ld de, ED_Tile
- ld hl, $8f00
+ ld hl, vFont + $700
ld bc, $1
jp CopyVideoDataDouble
diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm
index c495136e..931de340 100755
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -545,39 +545,39 @@ DrawTrainerInfo: ; 1349a (4:749a)
FuncCoord 1,2
ld hl,Coord
call TrainerInfo_DrawVerticalLine
- ld hl,$9070
- ld de,$9000
- ld bc,$01c0
+ ld hl,vChars2 + $70
+ ld de,vChars2
+ ld bc,$70 * 4
call CopyData
ld hl,TrainerInfoTextBoxTileGraphics ; $7b98 ; trainer info text box tile patterns
- ld de,$9770
+ ld de,vChars2 + $770
ld bc,$0080
push bc
call TrainerInfo_FarCopyData
ld hl,BlankLeaderNames ; $7c28
- ld de,$9600
+ ld de,vChars2 + $600
ld bc,$0170
call TrainerInfo_FarCopyData
pop bc
ld hl,BadgeNumbersTileGraphics ; $7d98 ; badge number tile patterns
- ld de,$8d80
+ ld de,vChars1 + $580
call TrainerInfo_FarCopyData
ld hl,GymLeaderFaceAndBadgeTileGraphics ; $6a9e ; gym leader face and badge tile patterns
- ld de,$9200
+ ld de,vChars2 + $200
ld bc,$0400
ld a,$03
call FarCopyData2
ld hl,TextBoxGraphics ; $6288
ld de,$00d0
add hl,de ; hl = colon tile pattern
- ld de,$8d60
+ ld de,vChars1 + $560
ld bc,$0010
ld a,$04
push bc
call FarCopyData2
pop bc
ld hl,TrainerInfoTextBoxTileGraphics + $80 ; $7c18 ; background tile pattern
- ld de,$8d70
+ ld de,vChars1 + $570
call TrainerInfo_FarCopyData
call EnableLCD
ld hl,wWhichTrade
diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm
index a4036bdb..ce5f85ab 100755
--- a/engine/menu/status_screen.asm
+++ b/engine/menu/status_screen.asm
@@ -21,19 +21,19 @@ StatusScreen: ; 12953 (4:6953)
call UpdateSprites ; move sprites (?)
call LoadHpBarAndStatusTilePatterns
ld de, BattleHudTiles1 ; $6080 ; source
- ld hl, $96d0 ; dest
+ ld hl, vChars2 + $6d0 ; dest
ld bc, (BANK(BattleHudTiles1) << 8) + $03 ; bank bytes/8
call CopyVideoDataDouble ; ·│ :L and halfarrow line end
ld de, BattleHudTiles2 ; $6098
- ld hl, $9780
+ ld hl, vChars2 + $780
ld bc, (BANK(BattleHudTiles2) << 8) + $01
call CopyVideoDataDouble ; │
ld de, BattleHudTiles3 ; $60b0
- ld hl, $9760
+ ld hl, vChars2 + $760
ld bc, (BANK(BattleHudTiles3) << 8) + $02
call CopyVideoDataDouble ; ─┘
ld de, PTile
- ld hl, $9720
+ ld hl, vChars2 + $720
ld bc,(BANK(PTile) << 8 | $01)
call CopyVideoDataDouble ; P (for PP), inline
ld a, [$ffd7]
diff --git a/engine/mon_party_sprites.asm b/engine/mon_party_sprites.asm
index 8c8f5406..cfe34512 100755
--- a/engine/mon_party_sprites.asm
+++ b/engine/mon_party_sprites.asm
@@ -156,142 +156,142 @@ MonPartySpritePointers: ; 717c0 (1c:57c0)
dw SlowbroSprite + $c0
db $40 / $10 ; 40 bytes
db BANK(SlowbroSprite)
- dw $8000
+ dw vSprites
dw BallSprite
db $80 / $10 ; $80 bytes
db BANK(BallSprite)
- dw $8040
+ dw vSprites + $40
dw ClefairySprite + $c0
db $40 / $10 ; $40 bytes
db BANK(ClefairySprite)
- dw $80C0
+ dw vSprites + $c0
dw BirdSprite + $c0
db $40 / $10 ; $40 bytes
db BANK(BirdSprite)
- dw $8100
+ dw vSprites + $100
dw SeelSprite
db $40 / $10 ; $40 bytes
db BANK(SeelSprite)
- dw $8140
+ dw vSprites + $140
dw MonPartySprites + $40
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8180
+ dw vSprites + $180
dw MonPartySprites + $50
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $81A0
+ dw vSprites + $1a0
dw MonPartySprites + $60
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $81C0
+ dw vSprites + $1c0
dw MonPartySprites + $70
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $81E0
+ dw vSprites + $1e0
dw MonPartySprites + $80
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8200
+ dw vSprites + $200
dw MonPartySprites + $90
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8220
+ dw vSprites + $220
dw MonPartySprites + $A0
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8240
+ dw vSprites + $240
dw MonPartySprites + $B0
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8260
+ dw vSprites + $260
dw MonPartySprites + $100
db $40 / $10 ; $40 bytes
db BANK(MonPartySprites)
- dw $8380
+ dw vSprites + $380
dw SlowbroSprite
db $40 / $10 ; $40 bytes
db BANK(SlowbroSprite)
- dw $8400
+ dw vSprites + $400
dw BallSprite
db $80 / $10 ; $80 bytes
db BANK(BallSprite)
- dw $8440
+ dw vSprites + $440
dw ClefairySprite
db $40 / $10 ; $40 bytes
db BANK(ClefairySprite)
- dw $84C0
+ dw vSprites + $4c0
dw BirdSprite
db $40 / $10 ; $40 bytes
db BANK(BirdSprite)
- dw $8500
+ dw vSprites + $500
dw SeelSprite + $C0
db $40 / $10 ; $40 bytes
db BANK(SeelSprite)
- dw $8540
+ dw vSprites + $540
dw MonPartySprites
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8580
+ dw vSprites + $580
dw MonPartySprites + $10
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $85A0
+ dw vSprites + $5a0
dw MonPartySprites + $20
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $85C0
+ dw vSprites + $5c0
dw MonPartySprites + $30
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $85E0
+ dw vSprites + $5E0
dw MonPartySprites + $C0
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8600
+ dw vSprites + $600
dw MonPartySprites + $D0
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8620
+ dw vSprites + $620
dw MonPartySprites + $E0
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8640
+ dw vSprites + $640
dw MonPartySprites + $F0
db $10 / $10 ; $10 bytes
db BANK(MonPartySprites)
- dw $8660
+ dw vSprites + $660
dw MonPartySprites + $140
db $40 / $10 ; $40 bytes
db BANK(MonPartySprites)
- dw $8780
+ dw vSprites + $780
Func_71868: ; 71868 (1c:5868)
push hl
@@ -323,11 +323,11 @@ Func_71890: ; 71890 (1c:5890)
ld a, [wcf91]
call GetPartyMonSpriteID
push af
- ld hl, $8000
+ ld hl, vSprites
call Func_718ac
pop af
add $54
- ld hl, $8040
+ ld hl, vSprites + $40
call Func_718ac
xor a
ld [wcd5d], a
diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm
index 60883c54..03c41e12 100755
--- a/engine/oak_speech.asm
+++ b/engine/oak_speech.asm
@@ -117,7 +117,7 @@ Func_61bc: ; 61bc (1:61bc)
ld c,4
call DelayFrames
ld de,RedSprite ; $4180
- ld hl,$8000
+ ld hl,vSprites
ld bc,(BANK(RedSprite) << 8) | $0C
call CopyVideoData
ld de,ShrinkPic1
@@ -219,9 +219,9 @@ IntroPredef3B: ; 62a4 (1:62a4)
call UncompressSpriteFromDE
ld hl,S_SPRITEBUFFER1
ld de,$A000
- ld bc,$0310
+ ld bc,$310
call CopyData
- ld de,$9000
+ ld de,vFrontPic
call InterlaceMergeSpriteBuffers
pop bc
ld a,c
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index 78945c59..922d01e7 100755
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -80,22 +80,22 @@ AnimateCutTree: ; eff7 (3:6ff7)
cp $52
jr z, .asm_f020
ld de, Overworld_GFX + $2d0 ; $42d0 ; cuttable tree sprite top row
- ld hl, $8fc0
+ ld hl, vChars1 + $7c0
ld bc, (BANK(Overworld_GFX) << 8) + $02
call CopyVideoData
ld de, Overworld_GFX + $3d0 ; $43d0 ; cuttable tree sprite bottom row
- ld hl, $8fe0
+ ld hl, vChars1 + $7e0
ld bc, (BANK(Overworld_GFX) << 8) + $02
call CopyVideoData
jr asm_f055
.asm_f020
- ld hl, $8fc0
+ ld hl, vChars1 + $7c0
call LoadCutTreeOAM
- ld hl, $8fd0
+ ld hl, vChars1 + $7d0
call LoadCutTreeOAM
- ld hl, $8fe0
+ ld hl, vChars1 + $7e0
call LoadCutTreeOAM
- ld hl, $8ff0
+ ld hl, vChars1 + $7f0
call LoadCutTreeOAM
call asm_f055
ld hl, wOAMBuffer + $93
diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm
index 12cae862..a8d863df 100755
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -8,7 +8,7 @@ PrintEmotionBubble: ; 17c47 (5:7c47)
ld e, [hl]
inc hl
ld d, [hl]
- ld hl, $8f80
+ ld hl, vChars1 + $780
ld bc, (BANK(EmotionBubblesPointerTable) << 8) + $04
call CopyVideoData
ld a, [wcfcb]
@@ -65,4 +65,4 @@ EmotionBubblesOAM: ; 17cb5 (5:7cb5)
db $FA,$00,$FB,$00
EmotionBubbles: ; 17cbd (5:7cbd)
- INCBIN "gfx/emotion_bubbles.w16.2bpp"
+ INCBIN "gfx/emotion_bubbles.2bpp"
diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm
index 1dcb5054..f9636fcb 100755
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -1,6 +1,6 @@
AnimateHealingMachine: ; 70433 (1c:4433)
ld de, PokeCenterFlashingMonitorAndHealBall ; $44b7
- ld hl, $87c0
+ ld hl, vChars0 + $7c0
ld bc, (BANK(PokeCenterFlashingMonitorAndHealBall) << 8) + $03
call CopyVideoData
ld hl, wcfcb
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index a94f79f6..1da91880 100755
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -69,7 +69,7 @@ LedgeTiles: ; 1a6cf (6:66cf)
db $FF
LoadHoppingShadowOAM: ; 1a6f0 (6:66f0)
- ld hl, $8ff0
+ ld hl, vChars1 + $7f0
ld de, LedgeHoppingShadow ; $6708
ld bc, (BANK(LedgeHoppingShadow) << 8) + $01
call CopyVideoDataDouble
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 297c45b8..81443c9f 100755
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -126,7 +126,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871)
push af
push de
push bc
- ld hl,$8000 ; VRAM base address
+ ld hl,vNPCSprites ; VRAM base address
ld bc,$c0 ; number of bytes per VRAM slot
ld a,[$ff8d]
cp a,11 ; is it a 4-tile sprite?
@@ -141,12 +141,12 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871)
jr nz,.calculateVRAMAddrLoop
jr .loadStillTilePattern
.fourTileSpriteVRAMAddr
- ld hl,$87c0 ; address for second 4-tile sprite
+ ld hl,vSprites + $7c0 ; address for second 4-tile sprite
ld a,[$ff8e] ; 4-tile sprite counter
and a ; is it the first 4-tile sprite?
jr nz,.loadStillTilePattern
; if it's the first 4-tile sprite
- ld hl,$8780 ; address for first 4-tile sprite
+ ld hl,vSprites + $780 ; address for first 4-tile sprite
inc a
ld [$ff8e],a ; 4-tile sprite counter
.loadStillTilePattern
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index 0b654369..45051531 100755
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -45,7 +45,7 @@ Func_70510: ; 70510 (1c:4510)
.asm_70568
pop hl
ld de, BirdSprite ; $4d80
- ld hl, $8000
+ ld hl, vNPCSprites
ld bc, (BANK(BirdSprite) << 8) + $0c
call CopyVideoData
call Func_706d7
@@ -244,11 +244,11 @@ Func_706ae: ; 706ae (1c:46ae)
Func_706d7: ; 706d7 (1c:46d7)
ld de, BirdSprite ; $4d80
- ld hl, $8000
+ ld hl, vNPCSprites
ld bc, (BANK(BirdSprite) << 8) + $0c
call CopyVideoData
ld de, BirdSprite + $c0 ; $4e40 ; moving amination sprite
- ld hl, $8800
+ ld hl, vNPCSprites2
ld bc, (BANK(BirdSprite) << 8) + $0c
jp CopyVideoData
@@ -379,7 +379,7 @@ Func_707b6: ; 707b6 (1c:47b6)
ld hl, wd736
set 6, [hl]
ld de, RedSprite ; $4180
- ld hl, $8000
+ ld hl, vNPCSprites
ld bc, (BANK(RedSprite) << 8) + $0c
call CopyVideoData
ld a, $4
@@ -468,20 +468,20 @@ FishingRodGfxProperties: ; 70856 (1c:4856)
RedFishingTiles: ; 70866 (1c:4866)
dw RedFishingTilesFront
- db $02, $1E
- dw $8020
+ db 2, BANK(RedFishingTilesFront)
+ dw vNPCSprites + $20
dw RedFishingTilesBack
- db $02, $1E
- dw $8060
+ db 2, BANK(RedFishingTilesBack)
+ dw vNPCSprites + $60
dw RedFishingTilesSide
- db $02, $1E
- dw $80A0
+ db 2, BANK(RedFishingTilesSide)
+ dw vNPCSprites + $a0
dw RedFishingRodTiles
- db $03, $1E
- dw $8FD0
+ db 3, BANK(RedFishingRodTiles)
+ dw vNPCSprites2 + $7d0
_HandleMidJump: ; 7087e (1c:487e)
ld a, [wd714]
diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm
index 03114bca..8fd8f99a 100755
--- a/engine/overworld/ssanne.asm
+++ b/engine/overworld/ssanne.asm
@@ -65,7 +65,7 @@ PointerTable_79fb0: ; 79fb0 (1e:5fb0)
dw Func_79337
LoadSmokeTileFourTimes: ; 79fc0 (1e:5fc0)
- ld hl, $8fc0
+ ld hl, vChars1 + $7c0
ld c, $4
.loop
push bc
diff --git a/engine/palettes.asm b/engine/palettes.asm
index b1692415..0a2db277 100755
--- a/engine/palettes.asm
+++ b/engine/palettes.asm
@@ -503,7 +503,7 @@ Func_7210b: ; 7210b (1c:610b)
call DisableLCD
ld a, $e4
ld [rBGP], a ; $ff47
- ld de, $8800
+ ld de, vChars1
ld a, [wcf2d]
and a
jr z, .asm_72122
@@ -513,7 +513,7 @@ Func_7210b: ; 7210b (1c:610b)
ld bc, $1000
call CopyData
.asm_72128
- ld hl, $9800
+ ld hl, vBGMap0
ld de, $c
ld a, $80
ld c, $d
diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm
index ec94dd28..68a15a18 100755
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -824,18 +824,18 @@ SlotMachine_37882: ; 37882 (d:7882)
LoadSlotMachineTiles: ; 378a8 (d:78a8)
call DisableLCD
ld hl, SlotMachineTiles2
- ld de, $8000
- ld bc, $01c0
+ ld de, vChars0
+ ld bc, $1c0
ld a, BANK(SlotMachineTiles2)
call FarCopyData2
ld hl, SlotMachineTiles1
- ld de, $9000
- ld bc, $0250
+ ld de, vChars2
+ ld bc, $250
ld a, BANK(SlotMachineTiles1)
call FarCopyData2
ld hl, SlotMachineTiles2
- ld de, $9250
- ld bc, $01c0
+ ld de, vChars2 + $250
+ ld bc, $1c0
ld a, BANK(SlotMachineTiles2)
call FarCopyData2
ld hl, SlotMachineMap
diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm
index 2d9b27a8..10081d63 100755
--- a/engine/titlescreen.asm
+++ b/engine/titlescreen.asm
@@ -36,33 +36,33 @@ LoadTitlescreenGraphics: ; 42dd (1:42dd)
call DisableLCD
call LoadFontTilePatterns
ld hl, NintendoCopyrightLogoGraphics ; $60c8
- ld de, $9410
+ ld de, vTitleLogo2 + $100
ld bc, $50
ld a, BANK(NintendoCopyrightLogoGraphics)
call FarCopyData2
ld hl, GamefreakLogoGraphics ; $61f8
- ld de, $9460
+ ld de, vTitleLogo2 + $100 + $50
ld bc, $90
ld a, BANK(GamefreakLogoGraphics)
call FarCopyData2
ld hl, PokemonLogoGraphics ; $5380
- ld de, $8800
+ ld de, vTitleLogo
ld bc, $600
ld a, BANK(PokemonLogoGraphics)
call FarCopyData2 ; first chunk
ld hl, PokemonLogoGraphics+$600 ; $5980
- ld de, $9310
+ ld de, vTitleLogo2
ld bc, $100
ld a, BANK(PokemonLogoGraphics)
call FarCopyData2 ; second chunk
ld hl, Version_GFX ; $402f
IF _RED
- ld de,$9600 ; where to put redgreenversion.2bpp in the VRAM
- ld bc,$50 ; how big that file is
+ ld de,vChars2 + $600
+ ld bc,$50
ENDC
IF _BLUE
- ld de,$9610 ; where to put blueversion.2bpp in the VRAM
- ld bc,$40 ; how big that file is
+ ld de,vChars2 + $600 + $10
+ ld bc,$50 - $10
ENDC
ld a, BANK(Version_GFX)
@@ -302,7 +302,7 @@ Func_44cf: ; 44cf (1:44cf)
Func_44dd: ; 44dd (1:44dd)
ld hl, PlayerCharacterTitleGraphics ; $66a8
- ld de, $8000
+ ld de, vSprites
ld bc, $230
ld a, BANK(PlayerCharacterTitleGraphics)
call FarCopyData2
@@ -338,7 +338,7 @@ Func_44dd: ; 44dd (1:44dd)
ret
Func_4519: ; 4519 (1:4519)
- ld hl, $9800
+ ld hl, vBGMap0
ld bc, $800
ld a, $7f
jp FillMemory
@@ -363,7 +363,7 @@ LoadCopyrightAndTextBoxTiles: ; 4538 (1:4538)
LoadCopyrightTiles: ; 4541 (1:4541)
ld de, NintendoCopyrightLogoGraphics ; $60c8
- ld hl, $9600
+ ld hl, vChars2 + $600
ld bc, (BANK(NintendoCopyrightLogoGraphics) << 8) + $1c
call CopyVideoData
FuncCoord 2, 7
diff --git a/engine/town_map.asm b/engine/town_map.asm
index 3be90604..ea2d3171 100755
--- a/engine/town_map.asm
+++ b/engine/town_map.asm
@@ -19,7 +19,7 @@ DisplayTownMap: ; 70e3e (1c:4e3e)
ld de, wTileMapBackup
ld bc, $10
call CopyData
- ld hl, $8040
+ ld hl, vSprites + $40
ld de, TownMapCursor ; $4f40
ld bc, (BANK(TownMapCursor) << 8) + $04
call CopyVideoDataDouble
@@ -143,11 +143,11 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90)
call LoadPlayerSpriteGraphics
call LoadFontTilePatterns
ld de, BirdSprite ; $4d80
- ld hl, $8040
+ ld hl, vSprites + $40
ld bc, (BANK(BirdSprite) << 8) + $0c
call CopyVideoData
ld de, TownMapUpArrow ; $5093
- ld hl, $8ed0
+ ld hl, vChars1 + $6d0
ld bc, (BANK(TownMapUpArrow) << 8) + $01
call CopyVideoDataDouble
call Func_71070
@@ -294,12 +294,12 @@ LoadTownMap: ; 7109b (1c:509b)
call TextBoxBorder
call DisableLCD
ld hl, WorldMapTileGraphics ; $65a8
- ld de, $9600
+ ld de, vChars2 + $600
ld bc, $100
ld a, BANK(WorldMapTileGraphics)
call FarCopyData2
ld hl, MonNestIcon ; $56be
- ld de, $8040
+ ld de, vSprites + $40
ld bc, $8
ld a, BANK(MonNestIcon)
call FarCopyDataDouble
diff --git a/engine/trade.asm b/engine/trade.asm
index 86cf2bca..41f50bde 100755
--- a/engine/trade.asm
+++ b/engine/trade.asm
@@ -104,16 +104,16 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1)
call Func_41196
call DisableLCD
ld hl, TradingAnimationGraphics ; $69be
- ld de, $9310
+ ld de, vChars2 + $310
ld bc, $310
ld a, BANK(TradingAnimationGraphics)
call FarCopyData2
ld hl, TradingAnimationGraphics2 ; $6cce
- ld de, $87c0
+ ld de, vSprites + $7c0
ld bc, $40
ld a, BANK(TradingAnimationGraphics2)
call FarCopyData2
- ld hl, $9800
+ ld hl, vBGMap0
ld bc, $800
ld a, $7f
call FillMemory
@@ -220,7 +220,7 @@ Func_41298: ; 41298 (10:5298)
call CopyScreenTileBufferToVRAM
ld b, $8
call GoPAL_SET
- ld hl, $9c8c
+ ld hl, vBGMap1 + $8c
call Func_414ae
ld a, $a0
ld [$ffae], a
@@ -340,7 +340,7 @@ Func_41376: ; 41376 (10:5376)
call Func_4142d
call Func_41186
call Func_4149f
- ld hl, $9c8c
+ ld hl, vBGMap1 + $8c
call Func_414ae
ld b, $6
call Func_414c5
@@ -371,7 +371,7 @@ Func_413c6: ; 413c6 (10:53c6)
call Func_4145c
call Func_41186
call Func_4149f
- ld hl, $9c94
+ ld hl, vBGMap1 + $94
call Func_414ae
call Func_41525
ld b, $6
@@ -492,7 +492,7 @@ Func_414ae: ; 414ae (10:54ae)
call ScheduleRowRedrawHelper
pop hl
ld a, h
- ld [$ffd2], a
+ ld [H_SCREENEDGEREDRAWADDR + 1], a
ld a, l
ld [H_SCREENEDGEREDRAWADDR], a ; $ffd1
ld a, $2
diff --git a/gfx/badges.w16.png b/gfx/badges.png
index 8b0fc516..8b0fc516 100644
--- a/gfx/badges.w16.png
+++ b/gfx/badges.png
Binary files differ
diff --git a/gfx/blue/blueversion.h8.png b/gfx/blue/blueversion.png
index dd7e2b6f..dd7e2b6f 100644
--- a/gfx/blue/blueversion.h8.png
+++ b/gfx/blue/blueversion.png
Binary files differ
diff --git a/gfx/blue/sgbborder.w128.png b/gfx/blue/sgbborder.png
index 098df2b6..098df2b6 100644
--- a/gfx/blue/sgbborder.w128.png
+++ b/gfx/blue/sgbborder.png
Binary files differ
diff --git a/gfx/copyright.h8.png b/gfx/copyright.png
index 49174349..49174349 100644
--- a/gfx/copyright.h8.png
+++ b/gfx/copyright.png
Binary files differ
diff --git a/gfx/emotion_bubbles.w16.png b/gfx/emotion_bubbles.png
index 31deacf4..31deacf4 100644
--- a/gfx/emotion_bubbles.w16.png
+++ b/gfx/emotion_bubbles.png
Binary files differ
diff --git a/gfx/font.w128.png b/gfx/font.png
index d5548c09..d5548c09 100644
--- a/gfx/font.w128.png
+++ b/gfx/font.png
Binary files differ
diff --git a/gfx/gamefreak.h8.png b/gfx/gamefreak.png
index 509232bd..509232bd 100644
--- a/gfx/gamefreak.h8.png
+++ b/gfx/gamefreak.png
Binary files differ
diff --git a/gfx/gamefreak_intro.h8.png b/gfx/gamefreak_intro.png
index 0fa6832c..0fa6832c 100644
--- a/gfx/gamefreak_intro.h8.png
+++ b/gfx/gamefreak_intro.png
Binary files differ
diff --git a/gfx/hp_bar_and_status.w80.png b/gfx/hp_bar_and_status.w80.png
deleted file mode 100644
index 79830885..00000000
--- a/gfx/hp_bar_and_status.w80.png
+++ /dev/null
Binary files differ
diff --git a/gfx/pokemon_logo.w128.png b/gfx/pokemon_logo.png
index cc7582c5..cc7582c5 100644
--- a/gfx/pokemon_logo.w128.png
+++ b/gfx/pokemon_logo.png
Binary files differ
diff --git a/gfx/red/redgreenversion.h8.png b/gfx/red/redgreenversion.png
index 8b34ec09..8b34ec09 100644
--- a/gfx/red/redgreenversion.h8.png
+++ b/gfx/red/redgreenversion.png
Binary files differ
diff --git a/gfx/red/sgbborder.w128.png b/gfx/red/sgbborder.png
index 7549bb47..7549bb47 100644
--- a/gfx/red/sgbborder.w128.png
+++ b/gfx/red/sgbborder.png
Binary files differ
diff --git a/gfx/theend.w40.interleave.png b/gfx/theend.interleave.png
index 025ebb61..025ebb61 100644
--- a/gfx/theend.w40.interleave.png
+++ b/gfx/theend.interleave.png
Binary files differ
diff --git a/gfx/tilesets/cavern.w128.t14.png b/gfx/tilesets/cavern.t14.png
index 5397fd65..5397fd65 100644
--- a/gfx/tilesets/cavern.w128.t14.png
+++ b/gfx/tilesets/cavern.t14.png
Binary files differ
diff --git a/gfx/tilesets/cemetery.w128.t4.png b/gfx/tilesets/cemetery.t4.png
index b1df015a..b1df015a 100644
--- a/gfx/tilesets/cemetery.w128.t4.png
+++ b/gfx/tilesets/cemetery.t4.png
Binary files differ
diff --git a/gfx/tilesets/club.w128.t5.png b/gfx/tilesets/club.t5.png
index 05a55879..05a55879 100644
--- a/gfx/tilesets/club.w128.t5.png
+++ b/gfx/tilesets/club.t5.png
Binary files differ
diff --git a/gfx/tilesets/facility.w128.png b/gfx/tilesets/facility.png
index 3654900e..3654900e 100644
--- a/gfx/tilesets/facility.w128.png
+++ b/gfx/tilesets/facility.png
Binary files differ
diff --git a/gfx/tilesets/forest.w128.png b/gfx/tilesets/forest.png
index fd534d48..fd534d48 100644
--- a/gfx/tilesets/forest.w128.png
+++ b/gfx/tilesets/forest.png
Binary files differ
diff --git a/gfx/tilesets/gate.w128.t1.png b/gfx/tilesets/gate.t1.png
index 372e6751..372e6751 100644
--- a/gfx/tilesets/gate.w128.t1.png
+++ b/gfx/tilesets/gate.t1.png
Binary files differ
diff --git a/gfx/tilesets/gym.w128.png b/gfx/tilesets/gym.png
index bffb472b..bffb472b 100644
--- a/gfx/tilesets/gym.w128.png
+++ b/gfx/tilesets/gym.png
Binary files differ
diff --git a/gfx/tilesets/house.w128.t2.png b/gfx/tilesets/house.t2.png
index b5d67c95..b5d67c95 100644
--- a/gfx/tilesets/house.w128.t2.png
+++ b/gfx/tilesets/house.t2.png
Binary files differ
diff --git a/gfx/tilesets/interior.w128.t1.png b/gfx/tilesets/interior.t1.png
index 3123d81c..3123d81c 100644
--- a/gfx/tilesets/interior.w128.t1.png
+++ b/gfx/tilesets/interior.t1.png
Binary files differ
diff --git a/gfx/tilesets/lab.w128.t4.png b/gfx/tilesets/lab.t4.png
index 4a114337..4a114337 100644
--- a/gfx/tilesets/lab.w128.t4.png
+++ b/gfx/tilesets/lab.t4.png
Binary files differ
diff --git a/gfx/tilesets/lobby.w128.t2.png b/gfx/tilesets/lobby.t2.png
index f2a1c180..f2a1c180 100644
--- a/gfx/tilesets/lobby.w128.t2.png
+++ b/gfx/tilesets/lobby.t2.png
Binary files differ
diff --git a/gfx/tilesets/mansion.w128.t2.png b/gfx/tilesets/mansion.t2.png
index 557c23b4..557c23b4 100644
--- a/gfx/tilesets/mansion.w128.t2.png
+++ b/gfx/tilesets/mansion.t2.png
Binary files differ
diff --git a/gfx/tilesets/overworld.w128.t2.png b/gfx/tilesets/overworld.t2.png
index c7533e40..c7533e40 100644
--- a/gfx/tilesets/overworld.w128.t2.png
+++ b/gfx/tilesets/overworld.t2.png
Binary files differ
diff --git a/gfx/tilesets/plateau.w128.t10.png b/gfx/tilesets/plateau.t10.png
index b87162d8..b87162d8 100644
--- a/gfx/tilesets/plateau.w128.t10.png
+++ b/gfx/tilesets/plateau.t10.png
Binary files differ
diff --git a/gfx/tilesets/pokecenter.w128.png b/gfx/tilesets/pokecenter.png
index ab4821d9..ab4821d9 100644
--- a/gfx/tilesets/pokecenter.w128.png
+++ b/gfx/tilesets/pokecenter.png
Binary files differ
diff --git a/gfx/tilesets/reds_house.w128.t7.png b/gfx/tilesets/reds_house.t7.png
index 5f210d04..5f210d04 100644
--- a/gfx/tilesets/reds_house.w128.t7.png
+++ b/gfx/tilesets/reds_house.t7.png
Binary files differ
diff --git a/gfx/tilesets/ship.w128.t6.png b/gfx/tilesets/ship.t6.png
index cf5b6b95..cf5b6b95 100644
--- a/gfx/tilesets/ship.w128.t6.png
+++ b/gfx/tilesets/ship.t6.png
Binary files differ
diff --git a/gfx/tilesets/ship_port.w128.t2.png b/gfx/tilesets/ship_port.t2.png
index fa5bbb27..fa5bbb27 100644
--- a/gfx/tilesets/ship_port.w128.t2.png
+++ b/gfx/tilesets/ship_port.t2.png
Binary files differ
diff --git a/gfx/tilesets/underground.w128.t7.png b/gfx/tilesets/underground.t7.png
index baa86c17..baa86c17 100644
--- a/gfx/tilesets/underground.w128.t7.png
+++ b/gfx/tilesets/underground.t7.png
Binary files differ
diff --git a/home.asm b/home.asm
index e09ec535..b13714fe 100644
--- a/home.asm
+++ b/home.asm
@@ -1032,8 +1032,8 @@ LoadTilesetTilePatternData:: ; 09e8 (0:09e8)
ld l,a
ld a,[W_TILESETGFXPTR + 1]
ld h,a
- ld de,$9000
- ld bc,$0600
+ ld de,vTileset
+ ld bc,$600
ld a,[W_TILESETBANK]
jp FarCopyData2
@@ -2165,17 +2165,17 @@ RunMapScript:: ; 101b (0:101b)
LoadWalkingPlayerSpriteGraphics:: ; 104d (0:104d)
ld de,RedSprite ; $4180
- ld hl,$8000
+ ld hl,vNPCSprites
jr LoadPlayerSpriteGraphicsCommon
LoadSurfingPlayerSpriteGraphics:: ; 1055 (0:1055)
ld de,SeelSprite
- ld hl,$8000
+ ld hl,vNPCSprites
jr LoadPlayerSpriteGraphicsCommon
LoadBikePlayerSpriteGraphics:: ; 105d (0:105d)
ld de,RedCyclingSprite
- ld hl,$8000
+ ld hl,vNPCSprites
LoadPlayerSpriteGraphicsCommon:: ; 1063 (0:1063)
push de
@@ -2508,17 +2508,17 @@ LoadMapData:: ; 1241 (0:1241)
call LoadCurrentMapView
; copy current map view to VRAM
ld hl,wTileMap
- ld de,$9800
- ld b,$12
+ ld de,vBGMap0
+ ld b,18
.vramCopyLoop
- ld c,$14
+ ld c,20
.vramCopyInnerLoop
ld a,[hli]
ld [de],a
inc e
dec c
jr nz,.vramCopyInnerLoop
- ld a,$0c
+ ld a,32 - 20
add e
ld e,a
jr nc,.noCarry
@@ -2749,7 +2749,7 @@ LoadFrontSpriteByMonIndex:: ; 1389 (0:1389)
ret
.validDexNumber
push hl
- ld de, $9000
+ ld de, vFrontPic
call LoadMonFrontSprite
pop hl
ld a, [H_LOADEDROMBANK]
@@ -4795,7 +4795,7 @@ UpdateMovingBgTiles::
cp 21
jr z, .flower
- ld hl, $9140
+ ld hl, vTileset + $14 * $10
ld c, $10
ld a, [wd085]
@@ -4839,7 +4839,7 @@ UpdateMovingBgTiles::
jr z, .copy
ld hl, FlowerTile3
.copy
- ld de, $9030
+ ld de, vTileset + $3 * $10
ld c, $10
.loop
ld a, [hli]
@@ -4938,9 +4938,9 @@ rLCDC_DEFAULT EQU %11100011
ld a, $ff
ld [$ffaa], a
- ld h, $9800 / $100 ; bg map 0
+ ld h, vBGMap0 / $100
call ClearBgMap
- ld h, $9c00 / $100 ; bg map 1
+ ld h, vBGMap1 / $100
call ClearBgMap
ld a, rLCDC_DEFAULT
@@ -8471,13 +8471,13 @@ LoadFontTilePatterns:: ; 3680 (0:3680)
jr nz,.lcdEnabled
.lcdDisabled
ld hl,FontGraphics
- ld de,$8800
+ ld de,vFont
ld bc,$400
ld a,BANK(FontGraphics)
jp FarCopyDataDouble ; if LCD is off, transfer all at once
.lcdEnabled
ld de,FontGraphics
- ld hl,$8800
+ ld hl,vFont
ld bc,(BANK(FontGraphics) << 8 | $80)
jp CopyVideoDataDouble ; if LCD is on, transfer during V-blank
@@ -8488,13 +8488,13 @@ LoadTextBoxTilePatterns:: ; 36a0 (0:36a0)
jr nz,.lcdEnabled
.lcdDisabled
ld hl,TextBoxGraphics
- ld de,$9600
- ld bc,$0200
+ ld de,vChars2 + $600
+ ld bc,$200
ld a,BANK(TextBoxGraphics)
jp FarCopyData2 ; if LCD is off, transfer all at once
.lcdEnabled
ld de,TextBoxGraphics
- ld hl,$9600
+ ld hl,vChars2 + $600
ld bc,(BANK(TextBoxGraphics) << 8 | $20)
jp CopyVideoData ; if LCD is on, transfer during V-blank
@@ -8505,13 +8505,13 @@ LoadHpBarAndStatusTilePatterns:: ; 36c0 (0:36c0)
jr nz,.lcdEnabled
.lcdDisabled
ld hl,HpBarAndStatusGraphics
- ld de,$9620
- ld bc,$01e0
+ ld de,vChars2 + $620
+ ld bc,$1e0
ld a,BANK(HpBarAndStatusGraphics)
jp FarCopyData2 ; if LCD is off, transfer all at once
.lcdEnabled
ld de,HpBarAndStatusGraphics
- ld hl,$9620
+ ld hl,vChars2 + $620
ld bc,(BANK(HpBarAndStatusGraphics) << 8 | $1e)
jp CopyVideoData ; if LCD is on, transfer during V-blank
diff --git a/main.asm b/main.asm
index db19a022..4ba797f2 100755
--- a/main.asm
+++ b/main.asm
@@ -500,7 +500,7 @@ INCLUDE "engine/cable_club.asm"
LoadTrainerInfoTextBoxTiles: ; 5ae6 (1:5ae6)
ld de, TrainerInfoTextBoxTileGraphics ; $7b98
- ld hl, $9760
+ ld hl, vChars2 + $760
ld bc, (BANK(TrainerInfoTextBoxTileGraphics) << 8) +$09
jp CopyVideoData
@@ -3044,7 +3044,7 @@ DrawBadges: ; ea03 (3:6a03)
db $20, $28, $30, $38, $40, $48, $50, $58
GymLeaderFaceAndBadgeTileGraphics: ; ea9e (3:6a9e)
- INCBIN "gfx/badges.w16.2bpp"
+ INCBIN "gfx/badges.2bpp"
Func_ee9e: ; ee9e (3:6e9e)
call GetPredefRegisters
@@ -4687,15 +4687,15 @@ SnorlaxSprite: INCBIN "gfx/sprites/snorlax.2bpp"
OldAmberSprite: INCBIN "gfx/sprites/old_amber.2bpp"
LyingOldManSprite: INCBIN "gfx/sprites/lying_old_man.2bpp"
-PokemonLogoGraphics: INCBIN "gfx/pokemon_logo.w128.2bpp"
-FontGraphics: INCBIN "gfx/font.w128.1bpp"
+PokemonLogoGraphics: INCBIN "gfx/pokemon_logo.2bpp"
+FontGraphics: INCBIN "gfx/font.1bpp"
ABTiles: INCBIN "gfx/AB.2bpp"
HpBarAndStatusGraphics: INCBIN "gfx/hp_bar_and_status.2bpp"
BattleHudTiles1: INCBIN "gfx/battle_hud1.1bpp"
BattleHudTiles2: INCBIN "gfx/battle_hud2.1bpp"
BattleHudTiles3: INCBIN "gfx/battle_hud3.1bpp"
-NintendoCopyrightLogoGraphics: INCBIN "gfx/copyright.h8.2bpp"
-GamefreakLogoGraphics: INCBIN "gfx/gamefreak.h8.2bpp"
+NintendoCopyrightLogoGraphics: INCBIN "gfx/copyright.2bpp"
+GamefreakLogoGraphics: INCBIN "gfx/gamefreak.2bpp"
TextBoxGraphics: INCBIN "gfx/text_box.2bpp"
PokedexTileGraphics: INCBIN "gfx/pokedex.2bpp"
WorldMapTileGraphics: INCBIN "gfx/town_map.2bpp"
@@ -6343,23 +6343,23 @@ INCLUDE "engine/hidden_object_functions18.asm"
SECTION "bank19",ROMX,BANK[$19]
-Overworld_GFX: INCBIN "gfx/tilesets/overworld.w128.t2.2bpp"
+Overworld_GFX: INCBIN "gfx/tilesets/overworld.t2.2bpp"
Overworld_Block: INCBIN "gfx/blocksets/overworld.bst"
RedsHouse1_GFX:
-RedsHouse2_GFX: INCBIN "gfx/tilesets/reds_house.w128.t7.2bpp"
+RedsHouse2_GFX: INCBIN "gfx/tilesets/reds_house.t7.2bpp"
RedsHouse1_Block:
RedsHouse2_Block: INCBIN "gfx/blocksets/reds_house.bst"
-House_GFX: INCBIN "gfx/tilesets/house.w128.t2.2bpp"
+House_GFX: INCBIN "gfx/tilesets/house.t2.2bpp"
House_Block: INCBIN "gfx/blocksets/house.bst"
-Mansion_GFX: INCBIN "gfx/tilesets/mansion.w128.t2.2bpp"
+Mansion_GFX: INCBIN "gfx/tilesets/mansion.t2.2bpp"
Mansion_Block: INCBIN "gfx/blocksets/mansion.bst"
-ShipPort_GFX: INCBIN "gfx/tilesets/ship_port.w128.t2.2bpp"
+ShipPort_GFX: INCBIN "gfx/tilesets/ship_port.t2.2bpp"
ShipPort_Block: INCBIN "gfx/blocksets/ship_port.bst"
-Interior_GFX: INCBIN "gfx/tilesets/interior.w128.t1.2bpp"
+Interior_GFX: INCBIN "gfx/tilesets/interior.t1.2bpp"
Interior_Block: INCBIN "gfx/blocksets/interior.bst"
-Plateau_GFX: INCBIN "gfx/tilesets/plateau.w128.t10.2bpp"
+Plateau_GFX: INCBIN "gfx/tilesets/plateau.t10.2bpp"
Plateau_Block: INCBIN "gfx/blocksets/plateau.bst"
@@ -6369,50 +6369,50 @@ INCLUDE "engine/battle/1a.asm"
Version_GFX:
IF _RED
- INCBIN "gfx/red/redgreenversion.h8.1bpp" ; 10 tiles
+ INCBIN "gfx/red/redgreenversion.1bpp" ; 10 tiles
ENDC
IF _BLUE
- INCBIN "gfx/blue/blueversion.h8.1bpp" ; 8 tiles
+ INCBIN "gfx/blue/blueversion.1bpp" ; 8 tiles
ENDC
Dojo_GFX:
-Gym_GFX: INCBIN "gfx/tilesets/gym.w128.2bpp"
+Gym_GFX: INCBIN "gfx/tilesets/gym.2bpp"
Dojo_Block:
Gym_Block: INCBIN "gfx/blocksets/gym.bst"
Mart_GFX:
-Pokecenter_GFX: INCBIN "gfx/tilesets/pokecenter.w128.2bpp"
+Pokecenter_GFX: INCBIN "gfx/tilesets/pokecenter.2bpp"
Mart_Block:
Pokecenter_Block: INCBIN "gfx/blocksets/pokecenter.bst"
ForestGate_GFX:
Museum_GFX:
-Gate_GFX: INCBIN "gfx/tilesets/gate.w128.t1.2bpp"
+Gate_GFX: INCBIN "gfx/tilesets/gate.t1.2bpp"
ForestGate_Block:
Museum_Block:
Gate_Block: INCBIN "gfx/blocksets/gate.bst"
-Forest_GFX: INCBIN "gfx/tilesets/forest.w128.2bpp"
+Forest_GFX: INCBIN "gfx/tilesets/forest.2bpp"
Forest_Block: INCBIN "gfx/blocksets/forest.bst"
-Facility_GFX: INCBIN "gfx/tilesets/facility.w128.2bpp"
+Facility_GFX: INCBIN "gfx/tilesets/facility.2bpp"
Facility_Block: INCBIN "gfx/blocksets/facility.bst"
SECTION "bank1B",ROMX,BANK[$1B]
-Cemetery_GFX: INCBIN "gfx/tilesets/cemetery.w128.t4.2bpp"
+Cemetery_GFX: INCBIN "gfx/tilesets/cemetery.t4.2bpp"
Cemetery_Block: INCBIN "gfx/blocksets/cemetery.bst"
-Cavern_GFX: INCBIN "gfx/tilesets/cavern.w128.t14.2bpp"
+Cavern_GFX: INCBIN "gfx/tilesets/cavern.t14.2bpp"
Cavern_Block: INCBIN "gfx/blocksets/cavern.bst"
-Lobby_GFX: INCBIN "gfx/tilesets/lobby.w128.t2.2bpp"
+Lobby_GFX: INCBIN "gfx/tilesets/lobby.t2.2bpp"
Lobby_Block: INCBIN "gfx/blocksets/lobby.bst"
-Ship_GFX: INCBIN "gfx/tilesets/ship.w128.t6.2bpp"
+Ship_GFX: INCBIN "gfx/tilesets/ship.t6.2bpp"
Ship_Block: INCBIN "gfx/blocksets/ship.bst"
-Lab_GFX: INCBIN "gfx/tilesets/lab.w128.t4.2bpp"
+Lab_GFX: INCBIN "gfx/tilesets/lab.t4.2bpp"
Lab_Block: INCBIN "gfx/blocksets/lab.bst"
-Club_GFX: INCBIN "gfx/tilesets/club.w128.t5.2bpp"
+Club_GFX: INCBIN "gfx/tilesets/club.t5.2bpp"
Club_Block: INCBIN "gfx/blocksets/club.bst"
-Underground_GFX: INCBIN "gfx/tilesets/underground.w128.t7.2bpp"
+Underground_GFX: INCBIN "gfx/tilesets/underground.t7.2bpp"
Underground_Block: INCBIN "gfx/blocksets/underground.bst"
diff --git a/audio_red.asm b/red/audio.asm
index 6c90a7c1..6c90a7c1 100644
--- a/audio_red.asm
+++ b/red/audio.asm
diff --git a/pokered.asm b/red/main.asm
index ff8de04f..ff8de04f 100644
--- a/pokered.asm
+++ b/red/main.asm
diff --git a/red/text.asm b/red/text.asm
new file mode 100644
index 00000000..d5d571d7
--- /dev/null
+++ b/red/text.asm
@@ -0,0 +1,2 @@
+INCLUDE "red.asm"
+INCLUDE "text.asm"
diff --git a/red/wram.asm b/red/wram.asm
new file mode 100644
index 00000000..68c3c803
--- /dev/null
+++ b/red/wram.asm
@@ -0,0 +1,2 @@
+INCLUDE "red.asm"
+INCLUDE "wram.asm"
diff --git a/scripts/rockethideout2.asm b/scripts/rockethideout2.asm
index a476f060..aa8d31a4 100755
--- a/scripts/rockethideout2.asm
+++ b/scripts/rockethideout2.asm
@@ -329,9 +329,9 @@ LoadSpinnerArrowTiles: ; 44fd7 (11:4fd7)
ld [wSpriteStateData1 + 2], a
ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET
cp FACILITY
- ld hl, SpinnerArrowTilePointers1 ; $5023
+ ld hl, FacilitySpinnerArrows ; $5023
jr z, .asm_44ff6
- ld hl, SpinnerArrowTilePointers2 ; $5053
+ ld hl, GymSpinnerArrows ; $5053
.asm_44ff6
ld a, [wcd38]
bit 0, a
@@ -368,87 +368,41 @@ LoadSpinnerArrowTiles: ; 44fd7 (11:4fd7)
jr nz, .asm_45006
ret
-SpinnerArrowTilePointers1: ; 45023 (11:5023)
- dw SpinnerArrowAnimTiles ;address from within tileset graphics
- db 1 ;number of tiles to copy?
- db BANK(SpinnerArrowAnimTiles) ;bank of tileset graphics
- dw $9200 ;where to load in VRAM
-
- dw SpinnerArrowAnimTiles + $10
- db 1
- db BANK(SpinnerArrowAnimTiles)
- dw $9210
-
- dw SpinnerArrowAnimTiles + $20
- db 1
- db BANK(SpinnerArrowAnimTiles)
- dw $9300
-
- dw SpinnerArrowAnimTiles + $30
- db 1
- db BANK(SpinnerArrowAnimTiles)
- dw $9310
-
- dw Facility_GFX + $200
- db 1
- db BANK(Facility_GFX)
- dw $9200
-
- dw Facility_GFX + $210
- db 1
- db BANK(Facility_GFX)
- dw $9210
-
- dw Facility_GFX + $300
- db 1
- db BANK(Facility_GFX)
- dw $9300
-
- dw Facility_GFX + $310
- db 1
- db BANK(Facility_GFX)
- dw $9310
-
-SpinnerArrowTilePointers2: ; 45053 (11:5053)
- dw SpinnerArrowAnimTiles + $10
- db 1
- db BANK(SpinnerArrowAnimTiles)
- dw $93C0
-
- dw SpinnerArrowAnimTiles + $30
- db 1
- db BANK(SpinnerArrowAnimTiles)
- dw $93D0
-
- dw SpinnerArrowAnimTiles
- db 1
- db BANK(SpinnerArrowAnimTiles)
- dw $94C0
-
- dw SpinnerArrowAnimTiles + $20
- db 1
- db BANK(SpinnerArrowAnimTiles)
- dw $94D0
-
- dw Gym_GFX + $3C0
- db 1
- db BANK(Facility_GFX)
- dw $93C0
-
- dw Gym_GFX + $3D0
- db 1
- db BANK(Facility_GFX)
- dw $93D0
-
- dw Gym_GFX + $4C0
- db 1
- db BANK(Facility_GFX)
- dw $94C0
-
- dw Gym_GFX + $4D0
- db 1
- db BANK(Facility_GFX)
- dw $94D0
+spinner: MACRO
+; \1: source
+; \2: offset (BANK() chokes on literals)
+; \3: length
+; \4: dest
+ dw \1 + \2
+ db \3, BANK(\1)
+ dw \4
+ENDM
+
+FacilitySpinnerArrows:
+FACILITY_SPINNER EQU $20 * $10
+vFacilitySpinner EQU vTileset + FACILITY_SPINNER
+
+ spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner
+ spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10
+ spinner SpinnerArrowAnimTiles, $20, 1, vFacilitySpinner + $100
+ spinner SpinnerArrowAnimTiles, $30, 1, vFacilitySpinner + $110
+ spinner Facility_GFX, FACILITY_SPINNER + $000, 1, vFacilitySpinner
+ spinner Facility_GFX, FACILITY_SPINNER + $010, 1, vFacilitySpinner + $10
+ spinner Facility_GFX, FACILITY_SPINNER + $100, 1, vFacilitySpinner + $100
+ spinner Facility_GFX, FACILITY_SPINNER + $110, 1, vFacilitySpinner + $110
+
+GymSpinnerArrows:
+GYM_SPINNER EQU $3c * $10
+vGymSpinner EQU vTileset + GYM_SPINNER
+
+ spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner
+ spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10
+ spinner SpinnerArrowAnimTiles, $00, 1, vGymSpinner + $100
+ spinner SpinnerArrowAnimTiles, $20, 1, vGymSpinner + $110
+ spinner Gym_GFX, GYM_SPINNER + $000, 1, vGymSpinner
+ spinner Gym_GFX, GYM_SPINNER + $010, 1, vGymSpinner + $10
+ spinner Gym_GFX, GYM_SPINNER + $100, 1, vGymSpinner + $100
+ spinner Gym_GFX, GYM_SPINNER + $110, 1, vGymSpinner + $110
SpinnerPlayerFacingDirections: ; 45083 (11:5083)
; This isn't the order of the facing directions. Rather, it's a list of
diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm
index b094878c..215bf467 100755
--- a/scripts/vermiliondock.asm
+++ b/scripts/vermiliondock.asm
@@ -184,7 +184,7 @@ VermilionDock_1dc94: ; 1dc94 (7:5c94)
ld bc, $00b4
ld a, $14
call FillMemory
- ld hl, $9940
+ ld hl, vBGMap0 + 10 * 32
ld de, wcc5b
ld bc, $000c
call CopyVideoData
diff --git a/vram.asm b/vram.asm
new file mode 100644
index 00000000..05f3199e
--- /dev/null
+++ b/vram.asm
@@ -0,0 +1,21 @@
+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
+
diff --git a/yellow.asm b/yellow.asm
new file mode 100644
index 00000000..2dedf586
--- /dev/null
+++ b/yellow.asm
@@ -0,0 +1 @@
+_YELLOW EQU 1
diff --git a/yellow/audio.asm b/yellow/audio.asm
new file mode 100644
index 00000000..e94c7db5
--- /dev/null
+++ b/yellow/audio.asm
@@ -0,0 +1,2 @@
+INCLUDE "yellow.asm"
+INCLUDE "audio.asm"
diff --git a/yellow/main.asm b/yellow/main.asm
new file mode 100644
index 00000000..36c88720
--- /dev/null
+++ b/yellow/main.asm
@@ -0,0 +1,2 @@
+INCLUDE "yellow.asm"
+INCLUDE "main.asm"
diff --git a/yellow/text.asm b/yellow/text.asm
new file mode 100644
index 00000000..a84a633d
--- /dev/null
+++ b/yellow/text.asm
@@ -0,0 +1,2 @@
+INCLUDE "yellow.asm"
+INCLUDE "text.asm"
diff --git a/yellow/wram.asm b/yellow/wram.asm
new file mode 100644
index 00000000..c0b7f781
--- /dev/null
+++ b/yellow/wram.asm
@@ -0,0 +1,2 @@
+INCLUDE "yellow.asm"
+INCLUDE "wram.asm"