From 956d010d59ad225bea768aec172ccb56977b1775 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 2 Jun 2018 20:16:37 -0400 Subject: Make the repository build all four ROMs --- Makefile | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 86e4925..f9fc269 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,27 @@ -BUILD := build +include config.mk + +BUILDBASE := build +BUILD := $(BUILDBASE)/$(BUILD_NAME) MD5 := md5sum -c PYTHON := python +PYTHON3 := python3.6 -RGBASM := rgbasm +RGBASM := rgbasm -D$(GAME_VERSION)=1 -DDEBUG=$(DEBUG) RGBGFX := rgbgfx RGBLINK := rgblink RGBFIX := rgbfix RGBASMFLAGS := -h -E -i $(BUILD)/ tools/gfx := +tools/make_shim := -ROMS := pokegold-spaceworld.gb -BASEROM := baserom.gb +ROM := poke$(BUILD_NAME)_spaceworld.gb +ROMS := pokegold_spaceworld.gb pokesilver_spaceworld.gb pokegold_debug_spaceworld.gb pokesilver_debug_spaceworld.gb +BASEROM := baserom_$(BUILD_NAME).gb DIRS := home engine data audio OBJS := $(addprefix $(BUILD)/, gfx.o sram.o wram.o hram.o shim.o) +SHIM := shim_$(BUILD_NAME).sym rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2)) OBJS += $(patsubst %.asm, $(BUILD)/%.o, $(call rwildcard, $(DIRS), *.asm)) @@ -28,11 +35,7 @@ GFX := $(patsubst %.png, $(BUILD)/%.2bpp, \ .SECONDEXPANSION: .PHONY: all -all: $(ROMS) compare - -.PHONY: compare -compare: $(ROMS) - $(MD5) roms.md5 +all: $(ROM) .PHONY: tools tools tools/pkmncompress tools/gfx: @@ -41,7 +44,7 @@ tools tools/pkmncompress tools/gfx: # Remove files generated by the build process. .PHONY: clean clean: - rm -rf $(ROMS) $(BUILD) $(ROMS:.gb=.sym) $(ROMS:.gb=.map) + rm -rf $(ROMS) $(BUILDBASE) $(ROMS:.gb=.sym) $(ROMS:.gb=.map) make -C tools clean # Remove files except for graphics. @@ -49,12 +52,13 @@ clean: mostlyclean: rm -rf $(ROMS) $(OBJS) $(ROMS:.gb=.sym) $(ROMS:.gb=.map) -$(ROMS): $(OBJS) +$(ROM): $(OBJS) $(RGBLINK) -d -n $(@:.gb=.sym) -m $(@:.gb=.map) -O $(BASEROM) -o $@ $^ - $(RGBFIX) -f lh -k 01 -l 0x33 -m 0x03 -p 0 -r 3 -t "POKEMON2GOLD" $@ + $(RGBFIX) -f lh -k 01 -l 0x33 -m 0x03 -p 0 -r 3 -t "POKEMON2$(GAME_VERSION)" $@ + -$(PYTHON3) sort_sym.py $(@:.gb=.sym) -$(BUILD)/shim.asm: tools/make_shim.py shim.sym | $$(dir $$@) - $(PYTHON) tools/make_shim.py -w -- $(filter-out $<, $^) > $@ +$(BUILD)/shim.asm: $(SHIM) | $$(dir $$@) + tools/make_shim -w $< > $@ $(BUILD)/gfx.o: | $(GFX) $(BUILD)/%.o: $(BUILD)/%.asm | $$(dir $$@) @@ -63,8 +67,10 @@ $(BUILD)/%.o: %.asm | $$(dir $$@) $(RGBASM) $(RGBASMFLAGS) -M $(@:.o=.d) $(OUTPUT_OPTION) $< $(BUILD)/gfx/sgb/sgb_border_alt.2bpp: tools/gfx += --trim-whitespace -$(BUILD)/gfx/sgb/sgb_border.2bpp: tools/gfx += --trim-whitespace -$(BUILD)/gfx/title/title.2bpp: tools/gfx += --trim-whitespace +$(BUILD)/gfx/sgb/sgb_border_gold.2bpp: tools/gfx += --trim-whitespace +$(BUILD)/gfx/sgb/sgb_border_silver.2bpp: tools/gfx += --trim-whitespace +$(BUILD)/gfx/title/title_gold.2bpp: tools/gfx += --trim-whitespace +$(BUILD)/gfx/title/title_silver.2bpp: tools/gfx += --trim-whitespace $(BUILD)/gfx/trainer_card/leaders.2bpp: tools/gfx += --trim-whitespace $(BUILD)/gfx/minigames/slots.2bpp: tools/gfx += --trim-whitespace $(BUILD)/gfx/minigames/poker.2bpp: tools/gfx += --trim-whitespace @@ -93,3 +99,14 @@ $(BUILD)/%.tilemap: %.png | $$(dir $$@) mkdir -p $@ -include $(call rwildcard, $(BUILD)/, *.d) + +gold: ; @$(MAKE) GAME_VERSION=GOLD +gold_debug: ; @$(MAKE) GAME_VERSION=GOLD DEBUG=1 +silver: ; @$(MAKE) GAME_VERSION=SILVER +silver_debug: ; @$(MAKE) GAME_VERSION=SILVER DEBUG=1 +compare: ; + @$(MAKE) GAME_VERSION=GOLD COMPARE=1 + @$(MAKE) GAME_VERSION=GOLD DEBUG=1 COMPARE=1 + @$(MAKE) GAME_VERSION=SILVER COMPARE=1 + @$(MAKE) GAME_VERSION=SILVER DEBUG=1 COMPARE=1 + @$(MD5) roms.md5 -- cgit v1.2.3 From 04610ffdf98fe3f36f7d33f0c8d09d57af1f2b82 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 2 Jun 2018 22:00:26 -0400 Subject: Fix building --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 367226f..0f3ed3b 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ BASEROM := baserom_$(BUILD_NAME).gb DIRS := home engine data audio OBJS := $(addprefix $(BUILD)/, gfx.o sram.o wram.o hram.o shim.o) SHIM := shim_$(BUILD_NAME).sym +CORRECTEDROM := $(ROM:%.gb=%-correctheader.gb) CORRECTEDROMS := $(ROMS:%.gb=%-correctheader.gb) rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2)) @@ -37,7 +38,7 @@ GFX := $(patsubst %.png, $(BUILD)/%.2bpp, \ .SECONDEXPANSION: .PHONY: all -all: $(ROM) $(CORRECTEDROMS) coverage +all: $(ROM) $(CORRECTEDROM) coverage .PHONY: tools tools tools/pkmncompress tools/gfx: $(MAKE) -C tools/ @@ -61,12 +62,12 @@ $(ROM): $(OBJS) $(BUILD)/shim.asm: $(SHIM) | $$(dir $$@) tools/make_shim -w $< > $@ -$(CORRECTEDROMS): %-correctheader.gb: %.gb +$(CORRECTEDROM): %-correctheader.gb: %.gb cp $< $@ $(RGBFIX) -f h -m 0x10 $@ .PHONY: coverage -coverage: $(ROMS) +coverage: $(ROM) $(PYTHON) tools/disasm_coverage.py -m $(ROM:.gb=.map) -b 0x40 $(BUILD)/gfx.o: | $(GFX) -- cgit v1.2.3 From 917fc32f730f11146fbdb4b2ae29bb8e87cb2dd1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 2 Jun 2018 22:06:02 -0400 Subject: Actually correct the global checksum for the -correctheader.gb ROMs --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0f3ed3b..e6ee492 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ $(BUILD)/shim.asm: $(SHIM) | $$(dir $$@) tools/make_shim -w $< > $@ $(CORRECTEDROM): %-correctheader.gb: %.gb cp $< $@ - $(RGBFIX) -f h -m 0x10 $@ + $(RGBFIX) -f hg -m 0x10 $@ .PHONY: coverage coverage: $(ROM) -- cgit v1.2.3 From 898c863bd46ebc4fdca5329f1ebe64212b079630 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 3 Jun 2018 10:54:49 -0400 Subject: Suspend support for Silver and non-debug ROMs --- Makefile | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 688748f..e32a609 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ include config.mk BUILDBASE := build -BUILD := $(BUILDBASE)/$(BUILD_NAME) +BUILD := $(BUILDBASE) MD5 := md5sum -c PYTHON := python @@ -15,13 +15,15 @@ RGBFIX := rgbfix RGBASMFLAGS := -h -E -i $(BUILD)/ tools/gfx := tools/make_shim := +sort_sym := $(PYTHON3) tools/sort_sym.py -ROM := poke$(BUILD_NAME)_spaceworld.gb -ROMS := pokegold_spaceworld.gb pokesilver_spaceworld.gb pokegold_debug_spaceworld.gb pokesilver_debug_spaceworld.gb -BASEROM := baserom_$(BUILD_NAME).gb +ROM := poke$(BUILD_NAME)-spaceworld.gb +ROMS := $(foreach r, gold gold_debug silver silver_debug, poke$(r)-spaceworld.gb) +# Pokemon Gold Debug +BASEROM := baserom.gb DIRS := home engine data audio OBJS := $(addprefix $(BUILD)/, gfx.o sram.o wram.o hram.o shim.o) -SHIM := shim_$(BUILD_NAME).sym +SHIM := shim.sym CORRECTEDROM := $(ROM:%.gb=%-correctheader.gb) CORRECTEDROMS := $(ROMS:%.gb=%-correctheader.gb) @@ -38,7 +40,7 @@ GFX := $(patsubst %.png, $(BUILD)/%.2bpp, \ .SECONDEXPANSION: .PHONY: all -all: $(ROM) $(CORRECTEDROM) coverage +all: $(ROM) $(CORRECTEDROM) .PHONY: tools tools tools/pkmncompress tools/gfx: $(MAKE) -C tools/ @@ -46,7 +48,7 @@ tools tools/pkmncompress tools/gfx: # Remove files generated by the build process. .PHONY: clean clean: - rm -rf $(ROMS) $(BUILDBASE) $(ROMS:.gb=.sym) $(ROMS:.gb=.map) $(CORRECTEDROMS) + rm -rf $(ROMS) $(CORRECTEDROMS) $(BUILDBASE) $(ROMS:.gb=.sym) $(ROMS:.gb=.map) $(CORRECTEDROMS) make -C tools clean # Remove files except for graphics. @@ -58,10 +60,10 @@ mostlyclean: $(ROM): $(OBJS) $(RGBLINK) -d -n $(@:.gb=.sym) -m $(@:.gb=.map) -O $(BASEROM) -o $@ $^ $(RGBFIX) -f lh -k 01 -l 0x33 -m 0x03 -p 0 -r 3 -t "POKEMON2$(GAME_VERSION)" $@ - -$(PYTHON3) sort_sym.py $(@:.gb=.sym) + -$(sort_sym) $(@:.gb=.sym) -$(BUILD)/shim.asm: $(SHIM) | $$(dir $$@) - tools/make_shim -w $< > $@ +$(BUILD)/shim.asm: tools/make_shim $(SHIM) tools/make_shim | $$(dir $$@) + tools/make_shim -w $(filter-out $<, $^) > $@ $(CORRECTEDROM): %-correctheader.gb: %.gb cp $< $@ $(RGBFIX) -f hg -m 0x10 $@ @@ -111,13 +113,13 @@ $(BUILD)/%.tilemap: %.png | $$(dir $$@) -include $(call rwildcard, $(BUILD)/, *.d) -gold: ; @$(MAKE) GAME_VERSION=GOLD +#gold: ; @$(MAKE) GAME_VERSION=GOLD gold_debug: ; @$(MAKE) GAME_VERSION=GOLD DEBUG=1 -silver: ; @$(MAKE) GAME_VERSION=SILVER -silver_debug: ; @$(MAKE) GAME_VERSION=SILVER DEBUG=1 +#silver: ; @$(MAKE) GAME_VERSION=SILVER +#silver_debug: ; @$(MAKE) GAME_VERSION=SILVER DEBUG=1 compare: ; - @$(MAKE) GAME_VERSION=GOLD COMPARE=1 +# @$(MAKE) GAME_VERSION=GOLD COMPARE=1 @$(MAKE) GAME_VERSION=GOLD DEBUG=1 COMPARE=1 - @$(MAKE) GAME_VERSION=SILVER COMPARE=1 - @$(MAKE) GAME_VERSION=SILVER DEBUG=1 COMPARE=1 +# @$(MAKE) GAME_VERSION=SILVER COMPARE=1 +# @$(MAKE) GAME_VERSION=SILVER DEBUG=1 COMPARE=1 @$(MD5) roms.md5 -- cgit v1.2.3 From 02051b9e0e213fb7d2e349e3cce220bb7a983472 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 3 Jun 2018 14:24:03 -0400 Subject: Fix building --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 03cc448..11977d0 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ sort_sym := tools/sort_symfile.sh #sort_sym := $(PYTHON3) tools/sort_sym.py ROM := poke$(BUILD_NAME)-spaceworld.gb -ROMS := $(foreach r, gold gold_debug silver silver_debug, poke$(r)-spaceworld.gb) +ROMS := $(foreach r, gold gold-debug silver silver-debug, poke$(r)-spaceworld.gb) # Pokemon Gold Debug BASEROM := baserom.gb DIRS := home engine data audio @@ -44,7 +44,7 @@ GFX := $(patsubst %.png, $(BUILD)/%.2bpp, \ all: $(ROM) $(CORRECTEDROM) compare .PHONY: compare -compare: $(ROMS) +compare: $(ROM) $(MD5) roms.md5 .PHONY: tools -- cgit v1.2.3