From 418e51ca7fbb5ce0ef343836ab9f46a9467c47a4 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sun, 15 Oct 2023 19:35:00 -0300 Subject: [PATCH 1/9] clean linker_scripts --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index c209f6c3..8b8f3b17 100644 --- a/Makefile +++ b/Makefile @@ -229,6 +229,7 @@ clean: @git clean -fdx assets/ @git clean -fdx bin/ @git clean -fdx build/ + @git clean -fdx linker_scripts/ format: @./tools/format.py -j $(nproc) From 0dbc2c0fd49ffe93d246cff6068c07ea5c150344 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sun, 15 Oct 2023 19:47:03 -0300 Subject: [PATCH 2/9] fix compression --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8b8f3b17..878870c7 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ MIPS_BINUTILS_PREFIX ?= mips-linux-gnu- VERSION ?= us BASEROM := baserom.$(VERSION).z64 +BASEROM_UNCOMPRESSED := baserom.$(VERSION).uncompressed.z64 TARGET := starfox64 ### Output ### @@ -197,7 +198,7 @@ init: $(MAKE) clean $(MAKE) decompress $(MAKE) extract -j $(nproc) - $(MAKE) all -j $(nproc) + $(MAKE) all # $(MAKE) compress # TODO: COMPRESS resulting rom. @@ -217,7 +218,7 @@ endif decompress: baserom.us.z64 @echo "Decompressing ROM..." - @$(PYTHON) $(COMPTOOL) -d $(BASEROM) ./baserom.us.uncompressed.z64 + @$(PYTHON) $(COMPTOOL) -d $(BASEROM) $(BASEROM_UNCOMPRESSED) extract: $(RM) -r asm/$(VERSION) bin/$(VERSION) @@ -249,9 +250,9 @@ expected: $(ROM): $(ELF) $(OBJCOPY) -O binary $< $@ -$(ROMC): baserom.us.uncompressed.z64 +$(ROMC): $(BASEROM_UNCOMPRESSED) @echo "Compressing ROM..." - @$(PYTHON) $(COMPTOOL) -c ./baserom.us.uncompressed.z64 ./build/starfox64.us.z64 + @$(PYTHON) $(COMPTOOL) -c ./build/starfox64.us.uncompressed.z64 ./build/starfox64.us.z64 # TODO: update rom header checksum From bc27e726f7a011c8ad1332014569058158a6dd56 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sun, 15 Oct 2023 19:54:57 -0300 Subject: [PATCH 3/9] improve syntax --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 878870c7..fa5631eb 100644 --- a/Makefile +++ b/Makefile @@ -252,7 +252,7 @@ $(ROM): $(ELF) $(ROMC): $(BASEROM_UNCOMPRESSED) @echo "Compressing ROM..." - @$(PYTHON) $(COMPTOOL) -c ./build/starfox64.us.uncompressed.z64 ./build/starfox64.us.z64 + @$(PYTHON) $(COMPTOOL) -c $(ROM) $(ROMC) # TODO: update rom header checksum From dde54193b4f657ae87b000329e22a0b2e5e0417d Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sun, 15 Oct 2023 20:41:23 -0300 Subject: [PATCH 4/9] phony --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fa5631eb..578644f1 100644 --- a/Makefile +++ b/Makefile @@ -199,7 +199,7 @@ init: $(MAKE) decompress $(MAKE) extract -j $(nproc) $(MAKE) all -# $(MAKE) compress +# $(MAKE) $(ROMC) # TODO: COMPRESS resulting rom. uncompressed: $(ROM) @@ -285,4 +285,6 @@ $(BUILD_DIR)/%.o: %.c -include $(DEP_FILES) # Print target for debugging -print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true \ No newline at end of file +print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true + +.PHONY: all uncompressed compressed clean init extract format checkformat decompress \ No newline at end of file From 29df5ad741ff6bb60c070cf1a3b2cda733d075a0 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Mon, 16 Oct 2023 06:04:16 -0300 Subject: [PATCH 5/9] fix multi-threading --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 578644f1..98998d15 100644 --- a/Makefile +++ b/Makefile @@ -192,15 +192,14 @@ build/src/libultra/2D300.o: OPTFLAGS := -O1 -g0 # cc & asm-processor build/src/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(CC) -- $(AS) $(ASFLAGS) -- -all: uncompressed compressed +all: uncompressed init: $(MAKE) clean $(MAKE) decompress - $(MAKE) extract -j $(nproc) - $(MAKE) all -# $(MAKE) $(ROMC) -# TODO: COMPRESS resulting rom. + $(MAKE) extract -j + $(MAKE) all -j + $(MAKE) compressed uncompressed: $(ROM) ifneq ($(COMPARE),0) From 66baed9d91ef51a128d1f9486026883024f188e4 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Mon, 16 Oct 2023 06:12:15 -0300 Subject: [PATCH 6/9] replace literal with var --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 98998d15..27dbb172 100644 --- a/Makefile +++ b/Makefile @@ -215,7 +215,7 @@ endif #### Main Targets ### -decompress: baserom.us.z64 +decompress: $(BASEROM) @echo "Decompressing ROM..." @$(PYTHON) $(COMPTOOL) -d $(BASEROM) $(BASEROM_UNCOMPRESSED) From 46c7b95f9a14a807055dbc800b9cc49bf659b6fb Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Mon, 16 Oct 2023 06:17:33 -0300 Subject: [PATCH 7/9] $(PYTHON) --- Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 27dbb172..26984876 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,8 @@ TARGET := starfox64 ### Output ### BUILD_DIR := build +TOOLS := tools +PYTHON := python3 ROM := $(BUILD_DIR)/$(TARGET).$(VERSION).uncompressed.z64 ROMC := $(BUILD_DIR)/$(TARGET).$(VERSION).z64 ELF := $(BUILD_DIR)/$(TARGET).$(VERSION).elf @@ -80,24 +82,23 @@ endif ### Compiler ### -CC := tools/ido_recomp/$(DETECTED_OS)/5.3/cc +CC := $(TOOLS)/ido_recomp/$(DETECTED_OS)/5.3/cc AS := $(MIPS_BINUTILS_PREFIX)as LD := $(MIPS_BINUTILS_PREFIX)ld OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump CPP := cpp ICONV := iconv -ASM_PROC := python3 tools/asm-processor/build.py +ASM_PROC := $(PYTHON) $(TOOLS)/asm-processor/build.py CAT := cat ASM_PROC_FLAGS := --input-enc=utf-8 --output-enc=euc-jp --convert-statics=global-with-filename -SPLAT ?= tools/splat/split.py +SPLAT ?= $(TOOLS)/splat/split.py SPLAT_YAML ?= $(TARGET).$(VERSION).yaml -COMPTOOL := tools/comptool.py +COMPTOOL := $(TOOLS)/comptool.py -PYTHON := python3 IINC := -Iinclude -Ibin/$(VERSION) -I. IINC += -Ilib/ultralib/include -Ilib/ultralib/include/PR -Ilib/ultralib/include/ido @@ -232,10 +233,10 @@ clean: @git clean -fdx linker_scripts/ format: - @./tools/format.py -j $(nproc) + @$(TOOLS)/format.py -j $(nproc) checkformat: - @./tools/check_format.sh -j $(nproc) + @$(TOOLS)/check_format.sh -j $(nproc) # asm-differ expected object files expected: From 547cff0c43f3876291ce4219fd77e4bca6d4437c Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Mon, 16 Oct 2023 06:44:09 -0300 Subject: [PATCH 8/9] $(N_THREADS) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 26984876..f1295470 100644 --- a/Makefile +++ b/Makefile @@ -198,8 +198,8 @@ all: uncompressed init: $(MAKE) clean $(MAKE) decompress - $(MAKE) extract -j - $(MAKE) all -j + $(MAKE) extract -j $(N_THREADS) + $(MAKE) all -j $(N_THREADS) $(MAKE) compressed uncompressed: $(ROM) From 149316972a3c7e403be663bf279c7e23a0a5f25b Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Mon, 16 Oct 2023 06:46:40 -0300 Subject: [PATCH 9/9] overlays yaml --- Makefile | 6 +++--- yamls/us/overlays.yaml | 0 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 yamls/us/overlays.yaml diff --git a/Makefile b/Makefile index f1295470..49c75f4e 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,7 @@ decompress: $(BASEROM) extract: $(RM) -r asm/$(VERSION) bin/$(VERSION) - $(CAT) yamls/$(VERSION)/header.yaml yamls/$(VERSION)/makerom.yaml yamls/$(VERSION)/main.yaml > $(SPLAT_YAML) + $(CAT) yamls/$(VERSION)/header.yaml yamls/$(VERSION)/makerom.yaml yamls/$(VERSION)/main.yaml yamls/$(VERSION)/overlays.yaml > $(SPLAT_YAML) $(SPLAT) $(SPLAT_YAML) clean: @@ -233,10 +233,10 @@ clean: @git clean -fdx linker_scripts/ format: - @$(TOOLS)/format.py -j $(nproc) + @$(TOOLS)/format.py -j $(N_THREADS) checkformat: - @$(TOOLS)/check_format.sh -j $(nproc) + @$(TOOLS)/check_format.sh -j $(N_THREADS) # asm-differ expected object files expected: diff --git a/yamls/us/overlays.yaml b/yamls/us/overlays.yaml new file mode 100644 index 00000000..e69de29b