summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2020-11-06 23:11:17 -0600
committerdannye <33dannye@gmail.com>2020-11-06 23:11:17 -0600
commit989545f0e03b7e32d8ea80d8ab4455576dbd7116 (patch)
treeb12573ca87d345ede7d40f7cf991032ee4b2650e /Makefile
parent338f1276b48ce1394cb9de52b7646e9f8618b1b9 (diff)
Start disassembling debug yellow
non matching
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 21 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 52b6e875..e6ca41ce 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-rom := pokeyellow.gbc
+roms := pokeyellow.gbc pokeyellow_debug.gbc
rom_obj := \
audio.o \
@@ -12,6 +12,9 @@ gfx/pikachu.o \
gfx/sprites.o \
gfx/tilesets.o
+pokeyellow_obj := $(rom_obj)
+pokeyellow_debug_obj := $(rom_obj:.o=_debug.o)
+
### Build tools
@@ -34,20 +37,21 @@ RGBLINK ?= $(RGBDS)rgblink
.SECONDEXPANSION:
.PRECIOUS:
.SECONDARY:
-.PHONY: all yellow clean tidy compare tools
+.PHONY: all yellow yellow_debug clean tidy compare tools
-all: $(rom)
-yellow: $(rom)
+all: $(roms)
+yellow: pokeyellow.gbc
+yellow_debug: pokeyellow_debug.gbc
clean: tidy
find gfx \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -delete
find audio/pikachu_cries \( -iname '*.pcm' \) -delete
tidy:
- rm -f $(rom) $(rom_obj) $(rom:.gbc=.map) $(rom:.gbc=.sym) rgbdscheck.o
+ rm -f $(roms) $(pokeyellow_obj) $(pokeyellow_debug_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) rgbdscheck.o
$(MAKE) clean -C tools/
-compare: $(rom)
+compare: $(roms)
@$(SHA1) -c roms.sha1
tools:
@@ -60,6 +64,8 @@ ifeq ($(DEBUG),1)
RGBASMFLAGS += -E
endif
+$(pokeyellow_debug_obj): RGBASMFLAGS += -D _DEBUG
+
rgbdscheck.o: rgbdscheck.asm
$(RGBASM) -o $@ $<
@@ -78,18 +84,23 @@ ifeq (,$(filter clean tidy tools,$(MAKECMDGOALS)))
$(info $(shell $(MAKE) -C tools))
# Dependencies for objects
-$(foreach obj, $(rom_obj), $(eval $(call DEP,$(obj),$(obj:.o=.asm))))
+$(foreach obj, $(pokeyellow_obj), $(eval $(call DEP,$(obj),$(obj:.o=.asm))))
+$(foreach obj, $(pokeyellow_debug_obj), $(eval $(call DEP,$(obj),$(obj:_debug.o=.asm))))
endif
%.asm: ;
+
+pokeyellow_pad = 0x00
+pokeyellow_debug_pad = 0xff
+
opts = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -t "POKEMON YELLOW"
-$(rom): $(rom_obj) layout.link
- $(RGBLINK) -m $(rom:.gbc=.map) -n $(rom:.gbc=.sym) -l layout.link -o $@ $(filter %.o,$^)
- $(RGBFIX) $(opts) $@
+%.gbc: $$(%_obj) layout.link
+ $(RGBLINK) -p $($*_pad) -m $*.map -n $*.sym -l layout.link -o $@ $(filter %.o,$^)
+ $(RGBFIX) -p $($*_pad) $(opts) $@
### Misc file-specific graphics rules