diff --git a/Makefile b/Makefile
index ccb21b81ae..12582d24a6 100644
--- a/Makefile
+++ b/Makefile
@@ -486,10 +486,10 @@ endif
ASSET_BIN_DIRS_COMMITTED := $(shell find assets -type d -not -path "assets/xml*" -not -path "assets/audio*" -not -path assets/text)
ASSET_BIN_DIRS := $(ASSET_BIN_DIRS_EXTRACTED) $(ASSET_BIN_DIRS_COMMITTED)
-ASSET_FILES_BIN_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.bin))
-ASSET_FILES_BIN_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.bin))
-ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_BIN_EXTRACTED:.bin=.bin.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
- $(foreach f,$(ASSET_FILES_BIN_COMMITTED:.bin=.bin.inc.c),$(BUILD_DIR)/$f)
+ASSET_FILES_BIN_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.u8.bin))
+ASSET_FILES_BIN_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.u8.bin))
+ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_BIN_EXTRACTED:.bin=.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
+ $(foreach f,$(ASSET_FILES_BIN_COMMITTED:.bin=.inc.c),$(BUILD_DIR)/$f)
# Find all .o files included in the spec
SPEC_O_FILES := $(shell $(CPP) $(CPPFLAGS) -I. $(SPEC) | $(BUILD_DIR_REPLACE) | sed -n -E 's/^[ \t]*include[ \t]*"([a-zA-Z0-9/_.-]+\.o)"/\1/p')
@@ -502,10 +502,10 @@ OVL_RELOC_FILES := $(filter %_reloc.o,$(SPEC_O_FILES))
# (Only asm_processor dependencies and reloc dependencies are handled for now)
DEP_FILES := $(O_FILES:.o=.d) $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d) $(BUILD_DIR)/spec.d
-TEXTURE_FILES_PNG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.png))
-TEXTURE_FILES_PNG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.png))
-TEXTURE_FILES_JPG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.jpg))
-TEXTURE_FILES_JPG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.jpg))
+TEXTURE_FILES_PNG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.u64.png) $(wildcard $(dir)/*.u32.png))
+TEXTURE_FILES_PNG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.u64.png) $(wildcard $(dir)/*.u32.png))
+TEXTURE_FILES_JPG_EXTRACTED := $(foreach dir,$(ASSET_BIN_DIRS_EXTRACTED),$(wildcard $(dir)/*.u64.jpg))
+TEXTURE_FILES_JPG_COMMITTED := $(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.u64.jpg))
TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG_EXTRACTED:.png=.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
$(foreach f,$(TEXTURE_FILES_PNG_COMMITTED:.png=.inc.c),$(BUILD_DIR)/$f) \
$(foreach f,$(TEXTURE_FILES_JPG_EXTRACTED:.jpg=.jpg.inc.c),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
@@ -791,9 +791,9 @@ setup: venv
$(MAKE) -C tools
$(PYTHON) tools/decompress_baserom.py $(VERSION)
$(PYTHON) tools/extract_baserom.py $(BASEROM_DIR)/baserom-decompressed.z64 $(EXTRACTED_DIR)/baserom -v $(VERSION)
+ $(PYTHON) -m tools.assets.extract $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR) -v $(VERSION) -j$(N_THREADS)
$(PYTHON) tools/extract_incbins.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/incbin -v $(VERSION)
$(PYTHON) tools/extract_text.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/text -v $(VERSION)
- $(PYTHON) tools/extract_assets.py $(EXTRACTED_DIR)/baserom $(EXTRACTED_DIR)/assets -v $(VERSION) -j$(N_THREADS)
$(PYTHON) tools/extract_audio.py -b $(EXTRACTED_DIR)/baserom -o $(EXTRACTED_DIR) -v $(VERSION) --read-xml
disasm:
@@ -979,22 +979,26 @@ $(BUILD_DIR)/src/overlays/%_reloc.o: $(BUILD_DIR)/spec
$(POSTPROCESS_OBJ) $(@:.o=.s)
$(AS) $(ASFLAGS) $(@:.o=.s) -o $@
+# Assets from assets/
+
$(BUILD_DIR)/assets/%.inc.c: assets/%.png
- $(N64TEXCONV) $(subst .,,$(suffix $*)) "$(findstring u32,$(subst .,,$(suffix $(basename $*))))" $< $@ $(@:.inc.c=.pal.inc.c)
+ tools/assets/build_from_png/build_from_png $< $(dir $@) assets/$(dir $*) $(wildcard $(EXTRACTED_DIR)/assets/$(dir $*))
-$(BUILD_DIR)/assets/%.inc.c: $(EXTRACTED_DIR)/assets/%.png
- $(N64TEXCONV) $(subst .,,$(suffix $*)) "$(findstring u32,$(subst .,,$(suffix $(basename $*))))" $< $@ $(@:.inc.c=.pal.inc.c)
-
-$(BUILD_DIR)/assets/%.bin.inc.c: assets/%.bin
+$(BUILD_DIR)/assets/%.u8.inc.c: assets/%.u8.bin
$(BIN2C) -t 1 $< $@
-$(BUILD_DIR)/assets/%.bin.inc.c: $(EXTRACTED_DIR)/assets/%.bin
- $(BIN2C) -t 1 $< $@
-
-$(BUILD_DIR)/assets/%.jpg.inc.c: assets/%.jpg
+$(BUILD_DIR)/assets/%.u64.jpg.inc.c: assets/%.u64.jpg
$(N64TEXCONV) JFIF "" $< $@
-$(BUILD_DIR)/assets/%.jpg.inc.c: $(EXTRACTED_DIR)/assets/%.jpg
+# Assets from extracted/
+
+$(BUILD_DIR)/assets/%.inc.c: $(EXTRACTED_DIR)/assets/%.png
+ tools/assets/build_from_png/build_from_png $< $(dir $@) $(wildcard assets/$(dir $*)) $(EXTRACTED_DIR)/assets/$(dir $*)
+
+$(BUILD_DIR)/assets/%.u8.inc.c: $(EXTRACTED_DIR)/assets/%.u8.bin
+ $(BIN2C) -t 1 $< $@
+
+$(BUILD_DIR)/assets/%.u64.jpg.inc.c: $(EXTRACTED_DIR)/assets/%.u64.jpg
$(N64TEXCONV) JFIF "" $< $@
# Audio
diff --git a/assets/xml/code/fbdemo_circle.xml b/assets/xml/code/fbdemo_circle.xml
index 530506369c..618c743314 100644
--- a/assets/xml/code/fbdemo_circle.xml
+++ b/assets/xml/code/fbdemo_circle.xml
@@ -7,7 +7,6 @@
-
-
+
diff --git a/assets/xml/code/fbdemo_wipe1.xml b/assets/xml/code/fbdemo_wipe1.xml
index 74f129776b..87f7e47b6f 100644
--- a/assets/xml/code/fbdemo_wipe1.xml
+++ b/assets/xml/code/fbdemo_wipe1.xml
@@ -4,7 +4,6 @@
-
-
+
diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml
index 008497601a..1a1077f038 100644
--- a/assets/xml/objects/gameplay_keep.xml
+++ b/assets/xml/objects/gameplay_keep.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/gameplay_keep_pal.xml b/assets/xml/objects/gameplay_keep_pal.xml
index c7485d73fd..92a7bb06e0 100644
--- a/assets/xml/objects/gameplay_keep_pal.xml
+++ b/assets/xml/objects/gameplay_keep_pal.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_bdoor.xml b/assets/xml/objects/object_bdoor.xml
index e926ae40bd..e15f0f6294 100644
--- a/assets/xml/objects/object_bdoor.xml
+++ b/assets/xml/objects/object_bdoor.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_demo_6k.xml b/assets/xml/objects/object_demo_6k.xml
index 73058d5e46..e2de93db2e 100644
--- a/assets/xml/objects/object_demo_6k.xml
+++ b/assets/xml/objects/object_demo_6k.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_demo_kekkai.xml b/assets/xml/objects/object_demo_kekkai.xml
index 1b9c9b4027..8b7b739c64 100644
--- a/assets/xml/objects/object_demo_kekkai.xml
+++ b/assets/xml/objects/object_demo_kekkai.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_efc_erupc.xml b/assets/xml/objects/object_efc_erupc.xml
index 800d9535f1..13cc2ab033 100644
--- a/assets/xml/objects/object_efc_erupc.xml
+++ b/assets/xml/objects/object_efc_erupc.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_fish.xml b/assets/xml/objects/object_fish.xml
index f5ad4f6da0..2ce27bac3a 100644
--- a/assets/xml/objects/object_fish.xml
+++ b/assets/xml/objects/object_fish.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_fz.xml b/assets/xml/objects/object_fz.xml
index dad6fec5ce..bbed88b106 100644
--- a/assets/xml/objects/object_fz.xml
+++ b/assets/xml/objects/object_fz.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_arrow.xml b/assets/xml/objects/object_gi_arrow.xml
index 4b58787a9d..4ce9110cc1 100644
--- a/assets/xml/objects/object_gi_arrow.xml
+++ b/assets/xml/objects/object_gi_arrow.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_arrowcase.xml b/assets/xml/objects/object_gi_arrowcase.xml
index 267b0a734d..990576428d 100644
--- a/assets/xml/objects/object_gi_arrowcase.xml
+++ b/assets/xml/objects/object_gi_arrowcase.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bean.xml b/assets/xml/objects/object_gi_bean.xml
index e74247816f..2c6ce0cf12 100644
--- a/assets/xml/objects/object_gi_bean.xml
+++ b/assets/xml/objects/object_gi_bean.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bomb_1.xml b/assets/xml/objects/object_gi_bomb_1.xml
index bae86c11d8..5d7dab6d86 100644
--- a/assets/xml/objects/object_gi_bomb_1.xml
+++ b/assets/xml/objects/object_gi_bomb_1.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bomb_2.xml b/assets/xml/objects/object_gi_bomb_2.xml
index 1400c4a4d4..01f3956803 100644
--- a/assets/xml/objects/object_gi_bomb_2.xml
+++ b/assets/xml/objects/object_gi_bomb_2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bombpouch.xml b/assets/xml/objects/object_gi_bombpouch.xml
index 07134748c3..42620ec94d 100644
--- a/assets/xml/objects/object_gi_bombpouch.xml
+++ b/assets/xml/objects/object_gi_bombpouch.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_boomerang.xml b/assets/xml/objects/object_gi_boomerang.xml
index 3c1a0fe7fc..fef261c489 100644
--- a/assets/xml/objects/object_gi_boomerang.xml
+++ b/assets/xml/objects/object_gi_boomerang.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_boots_2.xml b/assets/xml/objects/object_gi_boots_2.xml
index 8e9cd1028d..e172bd006c 100644
--- a/assets/xml/objects/object_gi_boots_2.xml
+++ b/assets/xml/objects/object_gi_boots_2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bosskey.xml b/assets/xml/objects/object_gi_bosskey.xml
index e5e4bc86c9..8e93c10d1a 100644
--- a/assets/xml/objects/object_gi_bosskey.xml
+++ b/assets/xml/objects/object_gi_bosskey.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bottle.xml b/assets/xml/objects/object_gi_bottle.xml
index 3b0884a03f..0a27562954 100644
--- a/assets/xml/objects/object_gi_bottle.xml
+++ b/assets/xml/objects/object_gi_bottle.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bottle_letter.xml b/assets/xml/objects/object_gi_bottle_letter.xml
index 443219caf5..04b08dd673 100644
--- a/assets/xml/objects/object_gi_bottle_letter.xml
+++ b/assets/xml/objects/object_gi_bottle_letter.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bow.xml b/assets/xml/objects/object_gi_bow.xml
index 946e9c4965..6e9101b413 100644
--- a/assets/xml/objects/object_gi_bow.xml
+++ b/assets/xml/objects/object_gi_bow.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_bracelet.xml b/assets/xml/objects/object_gi_bracelet.xml
index 5a0b62a60a..da35c003f8 100644
--- a/assets/xml/objects/object_gi_bracelet.xml
+++ b/assets/xml/objects/object_gi_bracelet.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_brokensword.xml b/assets/xml/objects/object_gi_brokensword.xml
index 408741ac54..44cae3e100 100644
--- a/assets/xml/objects/object_gi_brokensword.xml
+++ b/assets/xml/objects/object_gi_brokensword.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_butterfly.xml b/assets/xml/objects/object_gi_butterfly.xml
index 76ac706096..9882d27954 100644
--- a/assets/xml/objects/object_gi_butterfly.xml
+++ b/assets/xml/objects/object_gi_butterfly.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_coin.xml b/assets/xml/objects/object_gi_coin.xml
index 22e29f255f..f65993465b 100644
--- a/assets/xml/objects/object_gi_coin.xml
+++ b/assets/xml/objects/object_gi_coin.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_compass.xml b/assets/xml/objects/object_gi_compass.xml
index 076229b11e..10c6fbb63a 100644
--- a/assets/xml/objects/object_gi_compass.xml
+++ b/assets/xml/objects/object_gi_compass.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_dekupouch.xml b/assets/xml/objects/object_gi_dekupouch.xml
index 3d6d95d98a..25cde931f2 100644
--- a/assets/xml/objects/object_gi_dekupouch.xml
+++ b/assets/xml/objects/object_gi_dekupouch.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_egg.xml b/assets/xml/objects/object_gi_egg.xml
index 2b2e2847db..ceae8be407 100644
--- a/assets/xml/objects/object_gi_egg.xml
+++ b/assets/xml/objects/object_gi_egg.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_eye_lotion.xml b/assets/xml/objects/object_gi_eye_lotion.xml
index 5128c5f6ff..86e053cd94 100644
--- a/assets/xml/objects/object_gi_eye_lotion.xml
+++ b/assets/xml/objects/object_gi_eye_lotion.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_fire.xml b/assets/xml/objects/object_gi_fire.xml
index a57fba6e86..3b81815d5f 100644
--- a/assets/xml/objects/object_gi_fire.xml
+++ b/assets/xml/objects/object_gi_fire.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_fish.xml b/assets/xml/objects/object_gi_fish.xml
index edb39dc297..75361b32da 100644
--- a/assets/xml/objects/object_gi_fish.xml
+++ b/assets/xml/objects/object_gi_fish.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_frog.xml b/assets/xml/objects/object_gi_frog.xml
index f180fd267b..8c5d616eb4 100644
--- a/assets/xml/objects/object_gi_frog.xml
+++ b/assets/xml/objects/object_gi_frog.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_gerudo.xml b/assets/xml/objects/object_gi_gerudo.xml
index 3be8d34620..26dc606ce0 100644
--- a/assets/xml/objects/object_gi_gerudo.xml
+++ b/assets/xml/objects/object_gi_gerudo.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ghost.xml b/assets/xml/objects/object_gi_ghost.xml
index 186f4c74b7..e6c631c98e 100644
--- a/assets/xml/objects/object_gi_ghost.xml
+++ b/assets/xml/objects/object_gi_ghost.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_glasses.xml b/assets/xml/objects/object_gi_glasses.xml
index 63d32ab5ac..4a9cacf086 100644
--- a/assets/xml/objects/object_gi_glasses.xml
+++ b/assets/xml/objects/object_gi_glasses.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_gloves.xml b/assets/xml/objects/object_gi_gloves.xml
index 1b4282dcaa..fb273e95f4 100644
--- a/assets/xml/objects/object_gi_gloves.xml
+++ b/assets/xml/objects/object_gi_gloves.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_goddess.xml b/assets/xml/objects/object_gi_goddess.xml
index 50cbdd8918..6339012d47 100644
--- a/assets/xml/objects/object_gi_goddess.xml
+++ b/assets/xml/objects/object_gi_goddess.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_grass.xml b/assets/xml/objects/object_gi_grass.xml
index ae7834201a..2cc465c959 100644
--- a/assets/xml/objects/object_gi_grass.xml
+++ b/assets/xml/objects/object_gi_grass.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_hammer.xml b/assets/xml/objects/object_gi_hammer.xml
index feb5c8659d..49da345a93 100644
--- a/assets/xml/objects/object_gi_hammer.xml
+++ b/assets/xml/objects/object_gi_hammer.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_heart.xml b/assets/xml/objects/object_gi_heart.xml
index 48e78b1b5c..b3576efaad 100644
--- a/assets/xml/objects/object_gi_heart.xml
+++ b/assets/xml/objects/object_gi_heart.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_hearts.xml b/assets/xml/objects/object_gi_hearts.xml
index d2e763e631..122c898571 100644
--- a/assets/xml/objects/object_gi_hearts.xml
+++ b/assets/xml/objects/object_gi_hearts.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_hookshot.xml b/assets/xml/objects/object_gi_hookshot.xml
index a6b3b0fdac..513194fa7d 100644
--- a/assets/xml/objects/object_gi_hookshot.xml
+++ b/assets/xml/objects/object_gi_hookshot.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_hoverboots.xml b/assets/xml/objects/object_gi_hoverboots.xml
index c4a67877b2..9d710662e5 100644
--- a/assets/xml/objects/object_gi_hoverboots.xml
+++ b/assets/xml/objects/object_gi_hoverboots.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_insect.xml b/assets/xml/objects/object_gi_insect.xml
index 7af5b5b3b2..9467605ce2 100644
--- a/assets/xml/objects/object_gi_insect.xml
+++ b/assets/xml/objects/object_gi_insect.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_jewel.xml b/assets/xml/objects/object_gi_jewel.xml
index e83c651164..5dc87f53e2 100644
--- a/assets/xml/objects/object_gi_jewel.xml
+++ b/assets/xml/objects/object_gi_jewel.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_key.xml b/assets/xml/objects/object_gi_key.xml
index a37d45a71c..e38547a32c 100644
--- a/assets/xml/objects/object_gi_key.xml
+++ b/assets/xml/objects/object_gi_key.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ki_tan_mask.xml b/assets/xml/objects/object_gi_ki_tan_mask.xml
index f66535af37..e447c8fadf 100644
--- a/assets/xml/objects/object_gi_ki_tan_mask.xml
+++ b/assets/xml/objects/object_gi_ki_tan_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_liquid.xml b/assets/xml/objects/object_gi_liquid.xml
index 5eeeca0fd2..b3af2b2627 100644
--- a/assets/xml/objects/object_gi_liquid.xml
+++ b/assets/xml/objects/object_gi_liquid.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_longsword.xml b/assets/xml/objects/object_gi_longsword.xml
index 7161e42e38..bdfffe3b16 100644
--- a/assets/xml/objects/object_gi_longsword.xml
+++ b/assets/xml/objects/object_gi_longsword.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_m_arrow.xml b/assets/xml/objects/object_gi_m_arrow.xml
index 0fd659ae95..069a1bf1d4 100644
--- a/assets/xml/objects/object_gi_m_arrow.xml
+++ b/assets/xml/objects/object_gi_m_arrow.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_magicpot.xml b/assets/xml/objects/object_gi_magicpot.xml
index 7623e6353e..070de07fa0 100644
--- a/assets/xml/objects/object_gi_magicpot.xml
+++ b/assets/xml/objects/object_gi_magicpot.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_map.xml b/assets/xml/objects/object_gi_map.xml
index 8887dd22c9..619b0bc845 100644
--- a/assets/xml/objects/object_gi_map.xml
+++ b/assets/xml/objects/object_gi_map.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_medal.xml b/assets/xml/objects/object_gi_medal.xml
index d2cb6191d9..5676a9e316 100644
--- a/assets/xml/objects/object_gi_medal.xml
+++ b/assets/xml/objects/object_gi_medal.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_melody.xml b/assets/xml/objects/object_gi_melody.xml
index b01fca9538..e028bc9463 100644
--- a/assets/xml/objects/object_gi_melody.xml
+++ b/assets/xml/objects/object_gi_melody.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_milk.xml b/assets/xml/objects/object_gi_milk.xml
index 00b9530d95..3e5cb0cb5a 100644
--- a/assets/xml/objects/object_gi_milk.xml
+++ b/assets/xml/objects/object_gi_milk.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_mushroom.xml b/assets/xml/objects/object_gi_mushroom.xml
index 5b19bca743..8ee686263c 100644
--- a/assets/xml/objects/object_gi_mushroom.xml
+++ b/assets/xml/objects/object_gi_mushroom.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_niwatori.xml b/assets/xml/objects/object_gi_niwatori.xml
index 713cc1ce5a..8af44b8708 100644
--- a/assets/xml/objects/object_gi_niwatori.xml
+++ b/assets/xml/objects/object_gi_niwatori.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_nuts.xml b/assets/xml/objects/object_gi_nuts.xml
index 5508fe8569..d1a8454dbc 100644
--- a/assets/xml/objects/object_gi_nuts.xml
+++ b/assets/xml/objects/object_gi_nuts.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ocarina.xml b/assets/xml/objects/object_gi_ocarina.xml
index 7693cc122f..b8714d6e3c 100644
--- a/assets/xml/objects/object_gi_ocarina.xml
+++ b/assets/xml/objects/object_gi_ocarina.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ocarina_0.xml b/assets/xml/objects/object_gi_ocarina_0.xml
index 336d338946..caca8f2002 100644
--- a/assets/xml/objects/object_gi_ocarina_0.xml
+++ b/assets/xml/objects/object_gi_ocarina_0.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_pachinko.xml b/assets/xml/objects/object_gi_pachinko.xml
index 5f808baf92..9967813b3d 100644
--- a/assets/xml/objects/object_gi_pachinko.xml
+++ b/assets/xml/objects/object_gi_pachinko.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_powder.xml b/assets/xml/objects/object_gi_powder.xml
index fb7dc0155d..4e33b58208 100644
--- a/assets/xml/objects/object_gi_powder.xml
+++ b/assets/xml/objects/object_gi_powder.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_prescription.xml b/assets/xml/objects/object_gi_prescription.xml
index 081de301c4..9fa16660c7 100644
--- a/assets/xml/objects/object_gi_prescription.xml
+++ b/assets/xml/objects/object_gi_prescription.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_rabit_mask.xml b/assets/xml/objects/object_gi_rabit_mask.xml
index 75f855550d..a3c07e469c 100644
--- a/assets/xml/objects/object_gi_rabit_mask.xml
+++ b/assets/xml/objects/object_gi_rabit_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_redead_mask.xml b/assets/xml/objects/object_gi_redead_mask.xml
index 7de08487f8..fe601cab64 100644
--- a/assets/xml/objects/object_gi_redead_mask.xml
+++ b/assets/xml/objects/object_gi_redead_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_rupy.xml b/assets/xml/objects/object_gi_rupy.xml
index 0a1af96d0f..07b18b82dd 100644
--- a/assets/xml/objects/object_gi_rupy.xml
+++ b/assets/xml/objects/object_gi_rupy.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_saw.xml b/assets/xml/objects/object_gi_saw.xml
index dcc038b7c1..999b818e8b 100644
--- a/assets/xml/objects/object_gi_saw.xml
+++ b/assets/xml/objects/object_gi_saw.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_scale.xml b/assets/xml/objects/object_gi_scale.xml
index 1cf5de5b99..c6794b6aea 100644
--- a/assets/xml/objects/object_gi_scale.xml
+++ b/assets/xml/objects/object_gi_scale.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_seed.xml b/assets/xml/objects/object_gi_seed.xml
index 82c15c82d2..5d3ef9c03f 100644
--- a/assets/xml/objects/object_gi_seed.xml
+++ b/assets/xml/objects/object_gi_seed.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_shield_1.xml b/assets/xml/objects/object_gi_shield_1.xml
index 2e93695699..867292a4c3 100644
--- a/assets/xml/objects/object_gi_shield_1.xml
+++ b/assets/xml/objects/object_gi_shield_1.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_shield_2.xml b/assets/xml/objects/object_gi_shield_2.xml
index 176ae025fe..364070d101 100644
--- a/assets/xml/objects/object_gi_shield_2.xml
+++ b/assets/xml/objects/object_gi_shield_2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_shield_3.xml b/assets/xml/objects/object_gi_shield_3.xml
index 250bf7fea3..974a2539a9 100644
--- a/assets/xml/objects/object_gi_shield_3.xml
+++ b/assets/xml/objects/object_gi_shield_3.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_skj_mask.xml b/assets/xml/objects/object_gi_skj_mask.xml
index e6c90f76f1..6479015715 100644
--- a/assets/xml/objects/object_gi_skj_mask.xml
+++ b/assets/xml/objects/object_gi_skj_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_soul.xml b/assets/xml/objects/object_gi_soul.xml
index 76ffc56852..ee9dbd9570 100644
--- a/assets/xml/objects/object_gi_soul.xml
+++ b/assets/xml/objects/object_gi_soul.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_stick.xml b/assets/xml/objects/object_gi_stick.xml
index fed89f4659..d974b7ac5d 100644
--- a/assets/xml/objects/object_gi_stick.xml
+++ b/assets/xml/objects/object_gi_stick.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_sutaru.xml b/assets/xml/objects/object_gi_sutaru.xml
index a2606afbe3..343d301868 100644
--- a/assets/xml/objects/object_gi_sutaru.xml
+++ b/assets/xml/objects/object_gi_sutaru.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_sword_1.xml b/assets/xml/objects/object_gi_sword_1.xml
index e1119abca0..3bc15dcaf3 100644
--- a/assets/xml/objects/object_gi_sword_1.xml
+++ b/assets/xml/objects/object_gi_sword_1.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_ticketstone.xml b/assets/xml/objects/object_gi_ticketstone.xml
index 0fa37fe11e..6cdd5ea2f0 100644
--- a/assets/xml/objects/object_gi_ticketstone.xml
+++ b/assets/xml/objects/object_gi_ticketstone.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_gi_truth_mask.xml b/assets/xml/objects/object_gi_truth_mask.xml
index f28c7cbcad..64bd0939c6 100644
--- a/assets/xml/objects/object_gi_truth_mask.xml
+++ b/assets/xml/objects/object_gi_truth_mask.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_god_lgt.xml b/assets/xml/objects/object_god_lgt.xml
index 60df9e4693..b630605364 100644
--- a/assets/xml/objects/object_god_lgt.xml
+++ b/assets/xml/objects/object_god_lgt.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_kanban.xml b/assets/xml/objects/object_kanban.xml
index 9ffc7a2ceb..b989d3572a 100644
--- a/assets/xml/objects/object_kanban.xml
+++ b/assets/xml/objects/object_kanban.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_kusa.xml b/assets/xml/objects/object_kusa.xml
index 67291a5543..5eaaa99c58 100644
--- a/assets/xml/objects/object_kusa.xml
+++ b/assets/xml/objects/object_kusa.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_link_boy.xml b/assets/xml/objects/object_link_boy.xml
index 77254f5557..14917fd165 100644
--- a/assets/xml/objects/object_link_boy.xml
+++ b/assets/xml/objects/object_link_boy.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_link_child.xml b/assets/xml/objects/object_link_child.xml
index 36baf5aa6e..85ed8de950 100644
--- a/assets/xml/objects/object_link_child.xml
+++ b/assets/xml/objects/object_link_child.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_medal.xml b/assets/xml/objects/object_medal.xml
index eeb433c400..94976bd3f9 100644
--- a/assets/xml/objects/object_medal.xml
+++ b/assets/xml/objects/object_medal.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_mori_hineri1.xml b/assets/xml/objects/object_mori_hineri1.xml
index a2033a6f97..572eb6e1f3 100644
--- a/assets/xml/objects/object_mori_hineri1.xml
+++ b/assets/xml/objects/object_mori_hineri1.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_hineri1a.xml b/assets/xml/objects/object_mori_hineri1a.xml
index d7e3489044..23e6f5e665 100644
--- a/assets/xml/objects/object_mori_hineri1a.xml
+++ b/assets/xml/objects/object_mori_hineri1a.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_hineri2.xml b/assets/xml/objects/object_mori_hineri2.xml
index 9f1c892afb..d539cd86f0 100644
--- a/assets/xml/objects/object_mori_hineri2.xml
+++ b/assets/xml/objects/object_mori_hineri2.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_hineri2a.xml b/assets/xml/objects/object_mori_hineri2a.xml
index 6fd6818562..0334488567 100644
--- a/assets/xml/objects/object_mori_hineri2a.xml
+++ b/assets/xml/objects/object_mori_hineri2a.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_mori_objects.xml b/assets/xml/objects/object_mori_objects.xml
index aa24a38d70..1844cf6f69 100644
--- a/assets/xml/objects/object_mori_objects.xml
+++ b/assets/xml/objects/object_mori_objects.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_nwc.xml b/assets/xml/objects/object_nwc.xml
index 96ffa32383..abe2be092b 100644
--- a/assets/xml/objects/object_nwc.xml
+++ b/assets/xml/objects/object_nwc.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_ny.xml b/assets/xml/objects/object_ny.xml
index e2e8187ff8..c81d66ab56 100644
--- a/assets/xml/objects/object_ny.xml
+++ b/assets/xml/objects/object_ny.xml
@@ -1,10 +1,11 @@
+
-
-
+
+
diff --git a/assets/xml/objects/object_owl.xml b/assets/xml/objects/object_owl.xml
index 24be378985..4ea2006678 100644
--- a/assets/xml/objects/object_owl.xml
+++ b/assets/xml/objects/object_owl.xml
@@ -61,7 +61,7 @@
-
+
diff --git a/assets/xml/objects/object_po_composer.xml b/assets/xml/objects/object_po_composer.xml
index 2ab8d64d85..17c04fd18b 100644
--- a/assets/xml/objects/object_po_composer.xml
+++ b/assets/xml/objects/object_po_composer.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_po_field.xml b/assets/xml/objects/object_po_field.xml
index 10b402e2c7..43e1066e3b 100644
--- a/assets/xml/objects/object_po_field.xml
+++ b/assets/xml/objects/object_po_field.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_poh.xml b/assets/xml/objects/object_poh.xml
index 009d0fca3f..33517945e8 100644
--- a/assets/xml/objects/object_poh.xml
+++ b/assets/xml/objects/object_poh.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_ps.xml b/assets/xml/objects/object_ps.xml
index 043e232d64..98f548db1b 100644
--- a/assets/xml/objects/object_ps.xml
+++ b/assets/xml/objects/object_ps.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_sb.xml b/assets/xml/objects/object_sb.xml
index 3adf2c17ee..57a0f7f8f7 100644
--- a/assets/xml/objects/object_sb.xml
+++ b/assets/xml/objects/object_sb.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_siofuki.xml b/assets/xml/objects/object_siofuki.xml
index a23240a728..f8a9e50d83 100644
--- a/assets/xml/objects/object_siofuki.xml
+++ b/assets/xml/objects/object_siofuki.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_sst.xml b/assets/xml/objects/object_sst.xml
index c142c50f43..66cf6c8e02 100644
--- a/assets/xml/objects/object_sst.xml
+++ b/assets/xml/objects/object_sst.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_sst_pal.xml b/assets/xml/objects/object_sst_pal.xml
index 9a9199b58f..138a320324 100644
--- a/assets/xml/objects/object_sst_pal.xml
+++ b/assets/xml/objects/object_sst_pal.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_st.xml b/assets/xml/objects/object_st.xml
index 9556f081d0..e374b4cb4a 100644
--- a/assets/xml/objects/object_st.xml
+++ b/assets/xml/objects/object_st.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_stream.xml b/assets/xml/objects/object_stream.xml
index 59b0838e47..6c65f77c34 100644
--- a/assets/xml/objects/object_stream.xml
+++ b/assets/xml/objects/object_stream.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_syokudai.xml b/assets/xml/objects/object_syokudai.xml
index 11af7e9a3a..6434d923a5 100644
--- a/assets/xml/objects/object_syokudai.xml
+++ b/assets/xml/objects/object_syokudai.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_toki_objects.xml b/assets/xml/objects/object_toki_objects.xml
index 3cada31f89..917d239347 100644
--- a/assets/xml/objects/object_toki_objects.xml
+++ b/assets/xml/objects/object_toki_objects.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_trap.xml b/assets/xml/objects/object_trap.xml
index 56195cf41b..1f8f4b5310 100644
--- a/assets/xml/objects/object_trap.xml
+++ b/assets/xml/objects/object_trap.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_wood02.xml b/assets/xml/objects/object_wood02.xml
index bdcc2d2e38..dcf6d21291 100644
--- a/assets/xml/objects/object_wood02.xml
+++ b/assets/xml/objects/object_wood02.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/objects/object_ydan_objects.xml b/assets/xml/objects/object_ydan_objects.xml
index baf7ca4c9c..70174a1e70 100644
--- a/assets/xml/objects/object_ydan_objects.xml
+++ b/assets/xml/objects/object_ydan_objects.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_zf.xml b/assets/xml/objects/object_zf.xml
index 7f20eb7866..74e9d45915 100644
--- a/assets/xml/objects/object_zf.xml
+++ b/assets/xml/objects/object_zf.xml
@@ -1,4 +1,5 @@
+
@@ -109,7 +110,7 @@
-
+
diff --git a/assets/xml/objects/object_zo.xml b/assets/xml/objects/object_zo.xml
index 77465760ef..8872cc4c9f 100644
--- a/assets/xml/objects/object_zo.xml
+++ b/assets/xml/objects/object_zo.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_Boss_Ganon.xml b/assets/xml/overlays/ovl_Boss_Ganon.xml
index a6ed9c66eb..d09648d8d7 100644
--- a/assets/xml/overlays/ovl_Boss_Ganon.xml
+++ b/assets/xml/overlays/ovl_Boss_Ganon.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_Boss_Ganon2.xml b/assets/xml/overlays/ovl_Boss_Ganon2.xml
index 00f985786c..b922003dfa 100644
--- a/assets/xml/overlays/ovl_Boss_Ganon2.xml
+++ b/assets/xml/overlays/ovl_Boss_Ganon2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_En_Jsjutan.xml b/assets/xml/overlays/ovl_En_Jsjutan.xml
index b3b012b1f5..13bbd82199 100644
--- a/assets/xml/overlays/ovl_En_Jsjutan.xml
+++ b/assets/xml/overlays/ovl_En_Jsjutan.xml
@@ -16,9 +16,6 @@
-
-
-
diff --git a/assets/xml/overlays/ovl_Magic_Dark.xml b/assets/xml/overlays/ovl_Magic_Dark.xml
index 965d140db4..37165cebc2 100644
--- a/assets/xml/overlays/ovl_Magic_Dark.xml
+++ b/assets/xml/overlays/ovl_Magic_Dark.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_Oceff_Storm.xml b/assets/xml/overlays/ovl_Oceff_Storm.xml
index 385f56dbff..d9e1f7e65a 100644
--- a/assets/xml/overlays/ovl_Oceff_Storm.xml
+++ b/assets/xml/overlays/ovl_Oceff_Storm.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/overlays/ovl_Oceff_Wipe4.xml b/assets/xml/overlays/ovl_Oceff_Wipe4.xml
index 6446beedb2..a4ec2c5def 100644
--- a/assets/xml/overlays/ovl_Oceff_Wipe4.xml
+++ b/assets/xml/overlays/ovl_Oceff_Wipe4.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/dungeons/MIZUsin.xml b/assets/xml/scenes/dungeons/MIZUsin.xml
index e48f534d88..12a124cf09 100644
--- a/assets/xml/scenes/dungeons/MIZUsin.xml
+++ b/assets/xml/scenes/dungeons/MIZUsin.xml
@@ -7,6 +7,7 @@
+
diff --git a/assets/xml/scenes/dungeons/MIZUsin_mq.xml b/assets/xml/scenes/dungeons/MIZUsin_mq.xml
index bd0e260ace..cbbe48287e 100644
--- a/assets/xml/scenes/dungeons/MIZUsin_mq.xml
+++ b/assets/xml/scenes/dungeons/MIZUsin_mq.xml
@@ -7,6 +7,7 @@
+
diff --git a/assets/xml/scenes/dungeons/ddan.xml b/assets/xml/scenes/dungeons/ddan.xml
index d78f8dabee..295f651739 100644
--- a/assets/xml/scenes/dungeons/ddan.xml
+++ b/assets/xml/scenes/dungeons/ddan.xml
@@ -19,6 +19,7 @@
+
diff --git a/assets/xml/scenes/dungeons/ddan_mq.xml b/assets/xml/scenes/dungeons/ddan_mq.xml
index d78f8dabee..295f651739 100644
--- a/assets/xml/scenes/dungeons/ddan_mq.xml
+++ b/assets/xml/scenes/dungeons/ddan_mq.xml
@@ -19,6 +19,7 @@
+
diff --git a/baseroms/gc-eu-mq-dbg/config.yml b/baseroms/gc-eu-mq-dbg/config.yml
index 44bbdae424..e457028060 100644
--- a/baseroms/gc-eu-mq-dbg/config.yml
+++ b/baseroms/gc-eu-mq-dbg/config.yml
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0x10ED48
- end_offset: 0x10FF68
+ end_offset: 0x110038
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0x10E1D0
@@ -72,7 +72,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0x10E2A0
- end_offset: 0x10EC30
+ end_offset: 0x10ED28
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-eu-mq/config.yml b/baseroms/gc-eu-mq/config.yml
index e42e48c75f..0093015d7e 100644
--- a/baseroms/gc-eu-mq/config.yml
+++ b/baseroms/gc-eu-mq/config.yml
@@ -56,7 +56,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xE90A8
- end_offset: 0xEA2C8
+ end_offset: 0xEA398
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xE8530
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xE8600
- end_offset: 0xE8F90
+ end_offset: 0xE9088
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-eu/config.yml b/baseroms/gc-eu/config.yml
index b6471875f7..9aef9891f9 100644
--- a/baseroms/gc-eu/config.yml
+++ b/baseroms/gc-eu/config.yml
@@ -56,7 +56,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xE90C8
- end_offset: 0xEA2E8
+ end_offset: 0xEA3B8
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xE8550
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xE8620
- end_offset: 0xE8FB0
+ end_offset: 0xE90A8
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-jp-ce/config.yml b/baseroms/gc-jp-ce/config.yml
index a4592544ff..f3c0541a62 100644
--- a/baseroms/gc-jp-ce/config.yml
+++ b/baseroms/gc-jp-ce/config.yml
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB768
- end_offset: 0xEC988
+ end_offset: 0xECA58
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEABF0
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACC0
- end_offset: 0xEB650
+ end_offset: 0xEB748
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-jp-mq/config.yml b/baseroms/gc-jp-mq/config.yml
index 597e2cff66..41d1721f3d 100644
--- a/baseroms/gc-jp-mq/config.yml
+++ b/baseroms/gc-jp-mq/config.yml
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB768
- end_offset: 0xEC988
+ end_offset: 0xECA58
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEABF0
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACC0
- end_offset: 0xEB650
+ end_offset: 0xEB748
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-jp/config.yml b/baseroms/gc-jp/config.yml
index 582fd894eb..73285664c6 100644
--- a/baseroms/gc-jp/config.yml
+++ b/baseroms/gc-jp/config.yml
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB788
- end_offset: 0xEC9A8
+ end_offset: 0xECA78
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEAC10
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACE0
- end_offset: 0xEB670
+ end_offset: 0xEB768
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-us-mq/config.yml b/baseroms/gc-us-mq/config.yml
index 691aaa1ff9..1057e49b2e 100644
--- a/baseroms/gc-us-mq/config.yml
+++ b/baseroms/gc-us-mq/config.yml
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB748
- end_offset: 0xEC968
+ end_offset: 0xECA38
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEABD0
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACA0
- end_offset: 0xEB630
+ end_offset: 0xEB728
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/gc-us/config.yml b/baseroms/gc-us/config.yml
index 9a64c84646..620d550631 100644
--- a/baseroms/gc-us/config.yml
+++ b/baseroms/gc-us/config.yml
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEB768
- end_offset: 0xEC988
+ end_offset: 0xECA58
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEABF0
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEACC0
- end_offset: 0xEB650
+ end_offset: 0xEB748
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/ique-cn/config.yml b/baseroms/ique-cn/config.yml
index af570e0f0a..6236b0cf51 100644
--- a/baseroms/ique-cn/config.yml
+++ b/baseroms/ique-cn/config.yml
@@ -55,7 +55,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEBD88
- end_offset: 0xECFA8
+ end_offset: 0xED078
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEB210
@@ -63,7 +63,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEB2E0
- end_offset: 0xEBC70
+ end_offset: 0xEBD68
- name: misc/link_animetion
xml_path: assets/xml/misc/link_animetion.xml
- name: misc/z_select_static
diff --git a/baseroms/ntsc-1.0/config.yml b/baseroms/ntsc-1.0/config.yml
index 667845d383..948bbd179a 100644
--- a/baseroms/ntsc-1.0/config.yml
+++ b/baseroms/ntsc-1.0/config.yml
@@ -58,7 +58,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEC0A8
- end_offset: 0xED2C8
+ end_offset: 0xED398
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEB530
@@ -66,7 +66,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEB600
- end_offset: 0xEBF90
+ end_offset: 0xEC088
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC160
diff --git a/baseroms/ntsc-1.1/config.yml b/baseroms/ntsc-1.1/config.yml
index 66e74a17a4..2317ae2dac 100644
--- a/baseroms/ntsc-1.1/config.yml
+++ b/baseroms/ntsc-1.1/config.yml
@@ -58,7 +58,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEC268
- end_offset: 0xED488
+ end_offset: 0xED558
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEB6F0
@@ -66,7 +66,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEB7C0
- end_offset: 0xEC150
+ end_offset: 0xEC248
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC140
diff --git a/baseroms/ntsc-1.2/config.yml b/baseroms/ntsc-1.2/config.yml
index 4b3b33db46..6fc7896db0 100644
--- a/baseroms/ntsc-1.2/config.yml
+++ b/baseroms/ntsc-1.2/config.yml
@@ -58,7 +58,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xEC0B8
- end_offset: 0xED2D8
+ end_offset: 0xED3A8
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xEB540
@@ -66,7 +66,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xEB610
- end_offset: 0xEBFA0
+ end_offset: 0xEC098
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC120
diff --git a/baseroms/pal-1.0/config.yml b/baseroms/pal-1.0/config.yml
index 782e4ce152..37ffb7500b 100644
--- a/baseroms/pal-1.0/config.yml
+++ b/baseroms/pal-1.0/config.yml
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xE99C8
- end_offset: 0xEABE8
+ end_offset: 0xEACB8
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xE8E50
@@ -72,7 +72,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xE8F20
- end_offset: 0xE98B0
+ end_offset: 0xE99A8
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC0E0
diff --git a/baseroms/pal-1.1/config.yml b/baseroms/pal-1.1/config.yml
index c7f278dfe2..45bf82b877 100644
--- a/baseroms/pal-1.1/config.yml
+++ b/baseroms/pal-1.1/config.yml
@@ -64,7 +64,7 @@ assets:
- name: code/fbdemo_circle
xml_path: assets/xml/code/fbdemo_circle.xml
start_offset: 0xE9A08
- end_offset: 0xEAC28
+ end_offset: 0xEACF8
- name: code/fbdemo_triforce
xml_path: assets/xml/code/fbdemo_triforce.xml
start_offset: 0xE8E90
@@ -72,7 +72,7 @@ assets:
- name: code/fbdemo_wipe1
xml_path: assets/xml/code/fbdemo_wipe1.xml
start_offset: 0xE8F60
- end_offset: 0xE98F0
+ end_offset: 0xE99E8
- name: n64dd/error_textures
xml_path: assets/xml/n64dd/error_textures.xml
start_offset: 0xC0E0
diff --git a/docs/assets/extraction.md b/docs/assets/extraction.md
new file mode 100644
index 0000000000..a4c342db3b
--- /dev/null
+++ b/docs/assets/extraction.md
@@ -0,0 +1,18 @@
+Assets are not committed to the repo; instead, they are extracted from the ROM files as part of `make setup`.
+
+Assets are extracted to `extracted/VERSION/assets` (for example `extracted/ntsc-1.0/assets` for the `ntsc-1.0` version), based on the descriptions stored in xml files in `assets/xml/`.
+
+For details on the xml files contents, see [the assets xml specification file](../../tools/assets/descriptor/spec.md).
+
+The extraction tool can use [rich](https://github.com/Textualize/rich) if installed to make output prettier.
+If you are looking at output or errors from during extraction, consider installing rich for a better experience: `.venv/bin/python3 -m pip install rich`
+
+To run the extraction outside of `make setup`, use `./tools/extract_assets.sh VERSION`.
+- Pass `-f` to force extraction: otherwise only assets for which xmls were modified will be extracted.
+- Pass `-j` to use multiprocessing, making extraction quicker. Note that this makes for less readable errors if any error happens.
+- Pass `-s name` to extract assets using baserom file `name`.
+- Pass `-r -s 'name.*'` to extract assets using baserom files whose name match regular expression `name.*`.
+
+There currently are various hacks in place in the extraction tool source code to make extraction of some corner cases possible, or to silence extraction warnings.
+Some of these hacks check for the name of resources, so renaming a few specific resources may need updating the extraction tool's source too.
+The plan is to eventually remove those hardcoded checks from the source and use a `HackMode` attribute in the xmls to trigger the hacks code paths.
diff --git a/docs/assets/images.md b/docs/assets/images.md
new file mode 100644
index 0000000000..3aefcf1da2
--- /dev/null
+++ b/docs/assets/images.md
@@ -0,0 +1,64 @@
+# Images
+
+Images in the rom are in N64 image formats.
+On extraction, they are converted to png and written to `extracted/VERSION/`.
+On build, they are converted back to N64 formats and written as C arrays to `.inc.c` files in `build/VERSION/`.
+
+The build system will also pick up images in `assets/`, allowing modders to add or even [replace](#replacing-images) images.
+
+PNG files have suffixes indicating how they are to be converted. For example, a `gDekuStickTex.i8.u64.png` file will be converted to `i8`. The `.u64` suffix indicates to write the resulting `.inc.c` as an array of `u64` elements.
+
+The valid formats are `rgba32`, `rgba16`, `i4`, `i8`, `ia4`, `ia8`, `ia16`, `ci4` and `ci8`.
+
+The valid array element types are `u64` and `u32`. `u32` is only used for unaligned textures.
+
+The tool implementing png->n64 conversion is [build_from_png](../../tools/assets/build_from_png/build_from_png.c), using [n64texconv](../../tools/assets/n64texconv/) as its backbone.
+
+# Replacing images
+
+The contents of `extracted/` are meant to hold the baserom assets and should not be modified. Instead, replacing an image can be done by creating a png file at the same relative path under `assets/` as the image to replace.
+
+For example, replacing `gLinkHairTex` (`extracted/VERSION/assets/objects/gameplay_keep/gLinkHairTex.rgba16.u64.png`) with the texture for `gHylianMan1BeardedEyeOpenTex` (`extracted/VERSION/assets/objects/object_ahg/gHylianMan1BeardedEyeOpenTex.ci8.tlut_gHylianMan1TLUT_u32.u32.png`):
+
+```sh
+# for VERSION=gc-eu-mq-dbg
+
+mkdir -p assets/objects/gameplay_keep/
+cp \
+ extracted/gc-eu-mq-dbg/assets/objects/object_ahg/gHylianMan1BeardedEyeOpenTex.ci8.tlut_gHylianMan1TLUT_u32.u32.png \
+ assets/objects/gameplay_keep/gLinkHairTex.rgba16.u64.png
+
+# Cause make to rebuild gameplay_keep, where gLinkHairTex is
+touch extracted/gc-eu-mq-dbg/assets/objects/gameplay_keep/gameplay_keep.c
+
+make VERSION=gc-eu-mq-dbg
+```
+
+# CI images
+
+CI (Color Indexed) images also have a palette or TLUT (Texture Look-Up Table).
+
+PNG images to be converted to CI formats may have a `.tlut_gNameTLUT_u64` suffix indicating the name and element type of the TLUT `gNameTLUT.tlut.rgba16.u64.inc.c` file to write the palette to.
+
+If this suffix is omitted, the TLUT will be written to a `gNameTex.tlut.rgba16.u64.inc.c` file named after the CI image.
+
+For example without the `.tlut_` suffix, `gGanonHairFringeTex.ci8.u64.png`:
+
+- extracted to `extracted/VERSION/assets/objects/object_ganon2/gGanonHairFringeTex.ci8.u64.png`
+- texture written to `build/VERSION/assets/objects/object_ganon2/gGanonHairFringeTex.ci8.u64.inc.c`
+- palette written to `build/VERSION/assets/objects/object_ganon2/gGanonHairFringeTex.tlut.rgba16.u64.inc.c`
+
+For example with the `.tlut_` suffix, `gCowNoseTex.ci8.tlut_gCowTLUT_u64.u64.png`:
+
+- extracted to `extracted/gc-eu-mq-dbg/assets/objects/object_cow/gCowNoseTex.ci8.tlut_gCowTLUT_u64.u64.png`
+- texture written to `build/gc-eu-mq-dbg/assets/objects/object_cow/gCowNoseTex.ci8.tlut_gCowTLUT_u64.u64.inc.c`
+- palette written to `build/gc-eu-mq-dbg/assets/objects/object_cow/gCowTLUT.tlut.rgba16.u64.bin`
+
+CI images with a `.tlut_` suffix have a shared palette: there are several CI images using the same palette.
+The build system (`build_from_png`) will find images sharing the same palette by looking at the `.tlut_` suffixes of png files in the same folder and in the corresponding `assets/` folder.
+
+In the matching case of shared palettes, all png files have the same palette, which is written out.
+Otherwise the images are automatically co-quantized and the resulting images and palette are written out.
+
+Note the N64 supports CI images with IA16 palettes instead of RGBA16 palettes, but OoT doesn't have such textures.
+For simplicity, CI images with IA16 palettes are not supported in the build system, and all CI images are assumed to use RGBA16 palettes.
diff --git a/include/z64.h b/include/z64.h
deleted file mode 100644
index bb2518e6ec..0000000000
--- a/include/z64.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef Z64_H
-#define Z64_H
-
-// TODO: This file still exists ONLY to provide neccesary headers to extracted assets.
-// After assets are modified to include the headers they need directly, delete this file.
-
-#include "array_count.h"
-#include "gfx.h"
-#include "sequence.h"
-#include "sys_matrix.h"
-#include "ultra64.h"
-#include "z64play.h"
-#include "z64animation.h"
-#include "z64animation_legacy.h"
-#include "z64curve.h"
-#include "z64skin.h"
-#include "z64player.h"
-#include "z64ocarina.h"
-
-#endif
diff --git a/requirements.txt b/requirements.txt
index c9c4afed64..bea2fe176c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,6 +2,7 @@
crunch64>=0.5.1,<1.0.0
ipl3checksum>=1.2.0,<2.0.0
pyyaml>=6.0.1,<7.0.0
+pygfxd>=1.0.3,<2.0.0
# asm-differ
argcomplete
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 721087332e..83105d23ec 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -35,7 +35,7 @@
#include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "assets/objects/object_bdoor/object_bdoor.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:128" \
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:0" \
"ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
CollisionPoly* sCurCeilingPoly;
diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c
index 614cfa5b5b..6e2023b67d 100644
--- a/src/code/z_eff_blure.c
+++ b/src/code/z_eff_blure.c
@@ -9,7 +9,6 @@
#include "z64effect.h"
#include "z64skin_matrix.h"
-#include "z64.h" // required for gameplay keep, the header doesnt include any external dependencies
#include "assets/objects/gameplay_keep/gameplay_keep.h"
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c
index 499867d570..d8aa81df06 100644
--- a/src/code/z_fbdemo_circle.c
+++ b/src/code/z_fbdemo_circle.c
@@ -3,6 +3,7 @@
#include "color.h"
#include "gfx.h"
#include "sfx.h"
+#include "z64transition.h"
typedef enum TransitionCircleDirection {
/* 0 */ TRANS_CIRCLE_DIR_IN,
@@ -14,34 +15,7 @@ Gfx sTransCircleEmptyDL[] = {
gsSPEndDisplayList(),
};
-#include "assets/code/fbdemo_circle/z_fbdemo_circle.c"
-
-Gfx sTransCircleDL[] = {
- gsDPPipeSync(),
- gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
- G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
- gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH),
- gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
- G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
- gsDPSetCombineMode(G_CC_BLENDPEDECALA, G_CC_BLENDPEDECALA),
- gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
- gsDPLoadTextureBlock(0x08000000, G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMIRROR | G_TX_CLAMP, 4, 6, G_TX_NOLOD, G_TX_NOLOD),
- gsSPDisplayList(0x09000000),
- gsSPVertex(sTransCircleVtx, 32, 0),
- gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0),
- gsSP2Triangles(3, 5, 6, 0, 5, 7, 8, 0),
- gsSP2Triangles(7, 9, 10, 0, 9, 11, 12, 0),
- gsSP2Triangles(11, 13, 14, 0, 13, 15, 16, 0),
- gsSP2Triangles(15, 17, 18, 0, 17, 19, 20, 0),
- gsSP2Triangles(19, 21, 22, 0, 21, 23, 24, 0),
- gsSP2Triangles(23, 25, 26, 0, 25, 27, 28, 0),
- gsSP1Triangle(27, 29, 30, 0),
- gsSPVertex(&sTransCircleVtx[31], 3, 0),
- gsSP1Triangle(0, 1, 2, 0),
- gsSPEndDisplayList(),
-};
+#include "assets/code/fbdemo_circle/code.c"
void TransitionCircle_Start(void* thisx) {
TransitionCircle* this = (TransitionCircle*)thisx;
diff --git a/src/code/z_fbdemo_triforce.c b/src/code/z_fbdemo_triforce.c
index d844644a29..6624a4373c 100644
--- a/src/code/z_fbdemo_triforce.c
+++ b/src/code/z_fbdemo_triforce.c
@@ -1,8 +1,10 @@
#include "transition_triforce.h"
#include "printf.h"
+#include "z64math.h"
+#include "z64transition_instances.h"
-#include "assets/code/fbdemo_triforce/z_fbdemo_triforce.c"
+#include "assets/code/fbdemo_triforce/code.c"
void TransitionTriforce_Start(void* thisx) {
TransitionTriforce* this = (TransitionTriforce*)thisx;
diff --git a/src/code/z_fbdemo_wipe1.c b/src/code/z_fbdemo_wipe1.c
index d876b0b730..25b45e7e2c 100644
--- a/src/code/z_fbdemo_wipe1.c
+++ b/src/code/z_fbdemo_wipe1.c
@@ -9,35 +9,7 @@ typedef enum TransitionWipeDirection {
/* 1 */ TRANS_WIPE_DIR_OUT
} TransitionWipeDirection;
-#include "assets/code/fbdemo_wipe1/z_fbdemo_wipe1.c"
-
-Gfx sTransWipeDL[] = {
- gsDPPipeSync(),
- gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
- G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
- gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
- gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
- G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_1PRIMITIVE,
- G_AC_NONE | G_ZS_PRIM | G_RM_PASS | G_RM_AA_ZB_TEX_EDGE2),
- gsDPSetCombineLERP(TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, COMBINED, 0,
- PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0),
- gsDPSetPrimDepth(0, 0),
- gsDPLoadTextureBlock_4b(sTransWipeTex, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 6,
- 6, 11, G_TX_NOLOD),
- gsDPLoadMultiBlock_4b(sTransWipeTex, 0x0100, 1, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_MIRROR | G_TX_WRAP, 6, 6, 11, 1),
- gsDPSetTextureLUT(G_TT_NONE),
- gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
- gsSPDisplayList(0x08000000),
- gsSPVertex(sTransWipeVtx, 25, 0),
- gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0),
- gsSP2Triangles(5, 6, 7, 0, 6, 8, 9, 0),
- gsSP2Triangles(8, 10, 11, 0, 10, 12, 13, 0),
- gsSP2Triangles(12, 14, 15, 0, 14, 16, 17, 0),
- gsSP2Triangles(16, 18, 19, 0, 18, 20, 21, 0),
- gsSP2Triangles(20, 22, 23, 0, 22, 0, 24, 0),
- gsSPEndDisplayList(),
-};
+#include "assets/code/fbdemo_wipe1/code.c"
// unused.
Gfx sTransWipeSyncDL[] = {
diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c
index 88dcd5e59b..c78fc5de87 100644
--- a/src/code/z_kankyo.c
+++ b/src/code/z_kankyo.c
@@ -1,5 +1,5 @@
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
- "ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
#include "libc64/qrand.h"
#include "libu64/gfxprint.h"
@@ -238,8 +238,8 @@ s16 sLightningFlashAlpha;
s16 sSunDepthTestX;
s16 sSunDepthTestY;
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
- "ique-cn:160 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:192 pal-1.1:192"
LightNode* sNGameOverLightNode;
LightInfo sNGameOverLightInfo;
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 046d3ff886..1d6fee156b 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -27,7 +27,7 @@
#include "assets/textures/parameter_static/parameter_static.h"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:32" \
- "ntsc-1.1:32 ntsc-1.2:32 pal-1.0:128 pal-1.1:128"
+ "ntsc-1.1:32 ntsc-1.2:32 pal-1.0:0 pal-1.1:0"
#if !PLATFORM_IQUE
#define MSG_BUF_DECODED (msgCtx->msgBufDecoded)
diff --git a/src/n64dd/n64dd_error_textures.c b/src/n64dd/n64dd_error_textures.c
index d115fdd6ef..d5252640a9 100644
--- a/src/n64dd/n64dd_error_textures.c
+++ b/src/n64dd/n64dd_error_textures.c
@@ -2,18 +2,18 @@
u64 gN64DDError41Texs[2][0x600 / sizeof(u64)] = {
{
-#include "assets/n64dd/error_textures/n64dd_error_41_jpn.i4.inc.c"
+#include "assets/n64dd/error_textures/gN64DDError41JPNTex.i4.u64.inc.c"
},
{
-#include "assets/n64dd/error_textures/n64dd_error_41_eng.i4.inc.c"
+#include "assets/n64dd/error_textures/gN64DDError41ENGTex.i4.u64.inc.c"
},
};
u64 gN64DDPleaseReadManualTexs[2][0x2800 / sizeof(u64)] = {
{
-#include "assets/n64dd/error_textures/n64dd_please_read_manual_jpn.i4.inc.c"
+#include "assets/n64dd/error_textures/gN64DDPleaseReadManualJPNTex.i4.u64.inc.c"
},
{
-#include "assets/n64dd/error_textures/n64dd_please_read_manual_eng.i4.inc.c"
+#include "assets/n64dd/error_textures/gN64DDPleaseReadManualENGTex.i4.u64.inc.c"
},
};
diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
index 0ca8e3c843..139d684deb 100644
--- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
+++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
@@ -132,8 +132,8 @@ static EnGanonMant* sCape;
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
- "ique-cn:192 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
static s32 sSeed1;
static s32 sSeed2;
diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c
index e2d6eeb3a8..7000900b49 100644
--- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c
+++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c
@@ -26,8 +26,8 @@
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_tw/object_tw.h"
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
- "ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c
index 35ffa63a36..e975163403 100644
--- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c
+++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c
@@ -22,8 +22,8 @@
#include "assets/objects/object_efc_star_field/object_efc_star_field.h"
#include "assets/objects/object_toki_objects/object_toki_objects.h"
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:0" \
- "ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:128" \
+ "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:0 pal-1.1:0"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
index 79f4feca86..dc0f0cb92e 100644
--- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
+++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
@@ -17,8 +17,8 @@
#include "assets/objects/object_warp1/object_warp1.h"
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
- "ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
#define FLAGS 0
diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c
index 13ebc48f3e..fce6c4ef03 100644
--- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c
+++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c
@@ -38,6 +38,8 @@ ActorProfile En_Jsjutan_Profile = {
};
// Shadow texture. 32x64 I8.
+#define sShadowTex_WIDTH 32
+#define sShadowTex_HEIGHT 64
static u8 sShadowTex[0x800];
static Vec3s D_80A8EE10[0x90];
diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c
index 764791e0df..9d2ec13761 100644
--- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c
+++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c
@@ -1415,8 +1415,8 @@ void func_80B3F3D8(void) {
Sfx_PlaySfxCentered2(NA_SE_PL_SKIP);
}
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:64 gc-jp:128 gc-jp-ce:128 gc-jp-mq:64 gc-us:128 gc-us-mq:64" \
- "ique-cn:64 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64 ique-cn:64" \
+ "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
void EnXc_PlayDiveSFX(Vec3f* src, PlayState* play) {
static Vec3f D_80B42DA0;
diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c
index d16fa2fc5f..58929bd248 100644
--- a/src/overlays/actors/ovl_Fishing/z_fishing.c
+++ b/src/overlays/actors/ovl_Fishing/z_fishing.c
@@ -37,7 +37,7 @@
#include "cic6105.h"
#endif
-#pragma increment_block_number "gc-eu:32 gc-eu-mq:32 gc-jp:32 gc-jp-ce:32 gc-jp-mq:32 gc-us:32 gc-us-mq:32 ntsc-1.0:0" \
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.0:0" \
"ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c
index 5f93be1107..e8b9428026 100644
--- a/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/src/overlays/actors/ovl_player_actor/z_player.c
@@ -362,22 +362,22 @@ void Player_Action_CsAction(Player* this, PlayState* play);
// .bss part 1
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:0" \
- "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+ "ique-cn:128 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
static s32 D_80858AA0;
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ique-cn:128 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
+#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
+ "ique-cn:192 ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:192 pal-1.1:192"
static s32 sSavedCurrentMask;
static Vec3f sInteractWallCheckResult;
static Input* sControlInput;
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \
- "ique-cn:160 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
+#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
+ "ique-cn:192 ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
// .data
diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c
index 2e4bda50cb..cf4c408427 100644
--- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c
+++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c
@@ -39,7 +39,7 @@
#endif
#include "assets/textures/icon_item_gameover_static/icon_item_gameover_static.h"
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
#if !PLATFORM_GC
diff --git a/tools/Makefile b/tools/Makefile
index 6e311ab398..7f6eef55a1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -35,7 +35,6 @@ ifneq ($(LLD),0)
endif
all: $(PROGRAMS) $(IDO_RECOMP_5_3_DIR) $(IDO_RECOMP_7_1_DIR) $(EGCS_DIR)
- $(MAKE) -C ZAPD
$(MAKE) -C fado
$(MAKE) -C audio
$(MAKE) -C com-plugin
@@ -44,7 +43,6 @@ all: $(PROGRAMS) $(IDO_RECOMP_5_3_DIR) $(IDO_RECOMP_7_1_DIR) $(EGCS_DIR)
clean:
$(RM) $(PROGRAMS) $(addsuffix .exe,$(PROGRAMS))
$(RM) -r ido_recomp egcs
- $(MAKE) -C ZAPD clean
$(MAKE) -C fado clean
$(MAKE) -C audio clean
$(MAKE) -C com-plugin clean
diff --git a/tools/ZAPD/.clang-format b/tools/ZAPD/.clang-format
deleted file mode 100644
index 5ba1c4a955..0000000000
--- a/tools/ZAPD/.clang-format
+++ /dev/null
@@ -1,84 +0,0 @@
----
-AccessModifierOffset: -4
-AlignAfterOpenBracket: Align
-AlignConsecutiveAssignments: false
-AlignConsecutiveDeclarations: false
-AlignEscapedNewlinesLeft: false
-AlignOperands: true
-AlignTrailingComments: true
-AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
-AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: InlineOnly
-AllowShortIfStatementsOnASingleLine: false
-AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterDefinitionReturnType: None
-AlwaysBreakAfterReturnType: None
-AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: true
-BinPackArguments: true
-BinPackParameters: true
-BraceWrapping:
- AfterCaseLabel: true
- AfterClass: true
- AfterControlStatement: true
- AfterEnum: true
- AfterFunction: true
- AfterNamespace: true
- AfterStruct: true
- AfterUnion: true
- BeforeCatch: true
- BeforeElse: true
- IndentBraces: false
-BreakBeforeBinaryOperators: None
-BreakBeforeBraces: Custom
-BreakBeforeTernaryOperators: false
-BreakConstructorInitializersBeforeComma: false
-ColumnLimit: 100
-CommentPragmas: '^ (IWYU pragma:|NOLINT)'
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
-ConstructorInitializerIndentWidth: 4
-ContinuationIndentWidth: 4
-Cpp11BracedListStyle: true
-DerivePointerAlignment: false
-DisableFormat: false
-ForEachMacros: [ ]
-IncludeCategories:
- - Regex: '^<[Ww]indows\.h>$'
- Priority: 1
- - Regex: '^<'
- Priority: 2
- - Regex: '^"'
- Priority: 3
-IndentCaseLabels: false
-IndentWidth: 4
-IndentWrappedFunctionNames: false
-KeepEmptyLinesAtTheStartOfBlocks: false
-MacroBlockBegin: ''
-MacroBlockEnd: ''
-MaxEmptyLinesToKeep: 1
-NamespaceIndentation: None
-PenaltyBreakBeforeFirstCallParameter: 19
-PenaltyBreakComment: 300
-PenaltyBreakFirstLessLess: 120
-PenaltyBreakString: 1000
-PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 60
-PointerAlignment: Left
-ReflowComments: true
-SortIncludes: false
-SpaceAfterCStyleCast: false
-SpaceBeforeAssignmentOperators: true
-SpaceBeforeParens: ControlStatements
-SpaceInEmptyParentheses: false
-SpacesBeforeTrailingComments: 2
-SpacesInAngles: false
-SpacesInContainerLiterals: true
-SpacesInCStyleCastParentheses: false
-SpacesInParentheses: false
-SpacesInSquareBrackets: false
-Standard: Latest
-TabWidth: 4
-UseTab: AlignWithSpaces
-...
-
diff --git a/tools/ZAPD/.github/workflows/main.yml b/tools/ZAPD/.github/workflows/main.yml
deleted file mode 100644
index 604c18c961..0000000000
--- a/tools/ZAPD/.github/workflows/main.yml
+++ /dev/null
@@ -1,98 +0,0 @@
-name: Build ZAPD
-
-on:
- push:
- pull_request:
- branches:
- - master
-
-jobs:
- build:
- runs-on: self-hosted-runner
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
-
- - name: Build ZAPD
- run: make -j WERROR=1
-
- - name: Checkout Repos
- run: echo "Checkout Repos"
-
- - name: Checkout oot
- run: |
- cd ../
- rm -rf oot/
- git clone https://github.com/zeldaret/oot.git
- cd oot
- echo $(pwd)
- git submodule update --init --recursive
-
- - name: Checkout mm
- run: |
- cd ../
- rm -rf mm/
- git clone https://github.com/zeldaret/mm.git
- cd mm
- echo $(pwd)
-
- - name: Set up repos
- run: echo "Set up repos"
-
- - name: Setup OOT
- run: |
- cd ../
- cd oot
- echo $(pwd)
- mkdir -p baseroms/gc-eu-mq-dbg/segments
- cp ~/baserom_original.z64 ./baseroms/gc-eu-mq-dbg/baserom.z64
- cd tools
- rm -rf ZAPD/
- ln -s ../../ZAPD
- cd ../
- make -j $(nproc) setup
-
- - name: Setup MM
- run: |
- cd ../
- cd mm
- echo $(pwd)
- python3 -m venv .mm-env
- source .mm-env/bin/activate
- python3 -m pip install -r requirements.txt
- cp ~/baserom.mm.us.rev1.z64 ./baserom.mm.us.rev1.z64
- cd tools
- rm -rf ZAPD/
- ln -s ../../ZAPD
- cd ../
- make -C tools -j
- python3 tools/fixbaserom.py
- python3 tools/extract_baserom.py
- python3 tools/decompress_yars.py
- python3 extract_assets.py -j $(nproc)
-
- - name: Build Repos
- run: echo "Build Repos"
-
- - name: Build oot
- run: |
- cd ../
- cd oot
- echo $(pwd)
- make venv
- make -j
-
- - name: Build mm
- run: |
- cd ../
- cd mm
- echo $(pwd)
- python3 -m venv .mm-env
- source .mm-env/bin/activate
- python3 -m pip install -r requirements.txt
- make -j disasm
- make -j
-
- - name: Clean workspace
- run: git clean -fdX
diff --git a/tools/ZAPD/.gitignore b/tools/ZAPD/.gitignore
deleted file mode 100644
index 68c502e36a..0000000000
--- a/tools/ZAPD/.gitignore
+++ /dev/null
@@ -1,341 +0,0 @@
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-##
-## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
-
-# User-specific files
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-*.userprefs
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-bld/
-[Bb]in/
-[Oo]bj/
-[Ll]og/
-
-# Visual Studio 2015/2017 cache/options directory
-.vs/
-# Uncomment if you have tasks that create the project's static files in wwwroot
-#wwwroot/
-
-# Visual Studio 2017 auto generated files
-Generated\ Files/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-# NUNIT
-*.VisualState.xml
-TestResult.xml
-
-# Build Results of an ATL Project
-[Dd]ebugPS/
-[Rr]eleasePS/
-dlldata.c
-
-# Benchmark Results
-BenchmarkDotNet.Artifacts/
-
-# .NET Core
-project.lock.json
-project.fragment.lock.json
-artifacts/
-**/Properties/launchSettings.json
-
-# StyleCop
-StyleCopReport.xml
-
-# Files built by Visual Studio
-*_i.c
-*_p.c
-*_i.h
-*.ilk
-*.meta
-*.obj
-*.iobj
-*.pch
-*.pdb
-*.ipdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.svclog
-*.scc
-
-# Chutzpah Test files
-_Chutzpah*
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opendb
-*.opensdf
-*.sdf
-*.cachefile
-*.VC.db
-*.VC.VC.opendb
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-*.sap
-
-# Visual Studio Trace Files
-*.e2e
-
-# TFS 2012 Local Workspace
-$tf/
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.DotSettings.user
-
-# JustCode is a .NET coding add-in
-.JustCode
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# AxoCover is a Code Coverage Tool
-.axoCover/*
-!.axoCover/settings.json
-
-# Visual Studio code coverage results
-*.coverage
-*.coveragexml
-
-# NCrunch
-_NCrunch_*
-.*crunch*.local.xml
-nCrunchTemp_*
-
-# MightyMoose
-*.mm.*
-AutoTest.Net/
-
-# Web workbench (sass)
-.sass-cache/
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.[Pp]ublish.xml
-*.azurePubxml
-# Note: Comment the next line if you want to checkin your web deploy settings,
-# but database connection strings (with potential passwords) will be unencrypted
-*.pubxml
-*.publishproj
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-PublishScripts/
-
-# NuGet Packages
-*.nupkg
-# The packages folder can be ignored because of Package Restore
-**/[Pp]ackages/*
-# except build/, which is used as an MSBuild target.
-!**/[Pp]ackages/build/
-# Uncomment if necessary however generally it will be regenerated when needed
-#!**/[Pp]ackages/repositories.config
-# NuGet v3's project.json files produces more ignorable files
-*.nuget.props
-*.nuget.targets
-
-# Microsoft Azure Build Output
-csx/
-*.build.csdef
-
-# Microsoft Azure Emulator
-ecf/
-rcf/
-
-# Windows Store app package directories and files
-AppPackages/
-BundleArtifacts/
-Package.StoreAssociation.xml
-_pkginfo.txt
-*.appx
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-*.[Cc]ache
-# but keep track of directories ending in .cache
-!*.[Cc]ache/
-
-# Others
-ClientBin/
-~$*
-*~
-*.dbmdl
-*.dbproj.schemaview
-*.jfm
-*.pfx
-*.publishsettings
-orleans.codegen.cs
-
-# Including strong name files can present a security risk
-# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-#*.snk
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-#bower_components/
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-ServiceFabricBackup/
-*.rptproj.bak
-
-# SQL Server files
-*.mdf
-*.ldf
-*.ndf
-
-# Business Intelligence projects
-*.rdl.data
-*.bim.layout
-*.bim_*.settings
-*.rptproj.rsuser
-
-# Microsoft Fakes
-FakesAssemblies/
-
-# GhostDoc plugin setting file
-*.GhostDoc.xml
-
-# Node.js Tools for Visual Studio
-.ntvs_analysis.dat
-node_modules/
-
-# Visual Studio 6 build log
-*.plg
-
-# Visual Studio 6 workspace options file
-*.opt
-
-# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
-*.vbw
-
-# Visual Studio LightSwitch build output
-**/*.HTMLClient/GeneratedArtifacts
-**/*.DesktopClient/GeneratedArtifacts
-**/*.DesktopClient/ModelManifest.xml
-**/*.Server/GeneratedArtifacts
-**/*.Server/ModelManifest.xml
-_Pvt_Extensions
-
-# Paket dependency manager
-.paket/paket.exe
-paket-files/
-
-# FAKE - F# Make
-.fake/
-
-# JetBrains Rider
-.idea/
-*.sln.iml
-
-# CodeRush
-.cr/
-
-# Python Tools for Visual Studio (PTVS)
-__pycache__/
-*.pyc
-
-# Cake - Uncomment if you are using it
-# tools/**
-# !tools/packages.config
-
-# Tabs Studio
-*.tss
-
-# Telerik's JustMock configuration file
-*.jmconfig
-
-# BizTalk build output
-*.btp.cs
-*.btm.cs
-*.odx.cs
-*.xsd.cs
-
-# OpenCover UI analysis results
-OpenCover/
-
-# Azure Stream Analytics local run output
-ASALocalRun/
-
-# MSBuild Binary and Structured Log
-*.binlog
-
-# NVidia Nsight GPU debugger configuration file
-*.nvuser
-
-# MFractors (Xamarin productivity tool) working folder
-.mfractor/
-
-*.out
-*.o
-*.d
-lib/libgfxd/libgfxd.a
-ExporterTest/ExporterTest.a
-ZAPDUtils/ZAPDUtils.a
-.vscode/
-build/
-ZAPDUtils/build/
-ZAPD/BuildInfo.h
diff --git a/tools/ZAPD/.gitrepo b/tools/ZAPD/.gitrepo
deleted file mode 100644
index 801b2b6383..0000000000
--- a/tools/ZAPD/.gitrepo
+++ /dev/null
@@ -1,12 +0,0 @@
-; DO NOT EDIT (unless you know what you are doing)
-;
-; This subdirectory is a git "subrepo", and this file is maintained by the
-; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
-;
-[subrepo]
- remote = https://github.com/zeldaret/ZAPD.git
- branch = master
- commit = 35ea376daf003fdd3297a2e7355ad82e70ec1e8c
- parent = b97a21c2532622a83e9153996e303c3edc2727a8
- method = merge
- cmdver = 0.4.6
diff --git a/tools/ZAPD/ExporterTest/CollisionExporter.cpp b/tools/ZAPD/ExporterTest/CollisionExporter.cpp
deleted file mode 100644
index 6431a4593c..0000000000
--- a/tools/ZAPD/ExporterTest/CollisionExporter.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-#include "CollisionExporter.h"
-
-void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]] fs::path outPath,
- BinaryWriter* writer)
-{
- ZCollisionHeader* col = (ZCollisionHeader*)res;
-
- writer->Write(col->absMinX);
- writer->Write(col->absMinY);
- writer->Write(col->absMinZ);
-
- writer->Write(col->absMaxX);
- writer->Write(col->absMaxY);
- writer->Write(col->absMaxZ);
-
- writer->Write(col->numVerts);
- writer->Write(col->vtxAddress);
-
- writer->Write(col->numPolygons);
- writer->Write(col->polyAddress);
- writer->Write(col->polyTypeDefAddress);
- writer->Write(col->camDataAddress);
-
- writer->Write(col->numWaterBoxes);
- writer->Write(col->waterBoxAddress);
-
- writer->Write(col->vtxSegmentOffset);
- writer->Write(col->polySegmentOffset);
- writer->Write(col->polyTypeDefSegmentOffset);
- writer->Write(col->camDataSegmentOffset);
- writer->Write(col->waterBoxSegmentOffset);
-
- uint32_t oldOffset = writer->GetBaseAddress();
-
- writer->Seek(col->vtxSegmentOffset, SeekOffsetType::Start);
-
- for (uint16_t i = 0; i < col->vertices.size(); i++)
- {
- for (uint32_t j = 0; j < col->vertices[i].dimensions; j++)
- {
- writer->Write(col->vertices[i].scalars[j].scalarData.s16);
- }
- }
-
- writer->Seek(col->polySegmentOffset, SeekOffsetType::Start);
-
- for (uint16_t i = 0; i < col->polygons.size(); i++)
- {
- writer->Write(col->polygons[i].type);
- writer->Write(col->polygons[i].vtxA);
- writer->Write(col->polygons[i].vtxB);
- writer->Write(col->polygons[i].vtxC);
- writer->Write(col->polygons[i].normX);
- writer->Write(col->polygons[i].normY);
- writer->Write(col->polygons[i].normZ);
- writer->Write(col->polygons[i].dist);
- }
-
- writer->Seek(col->polyTypeDefSegmentOffset, SeekOffsetType::Start);
-
- for (const auto& poly : col->polygonTypes)
- {
- writer->Write(poly.data[0]);
- writer->Write(poly.data[1]);
- }
- writer->Seek(col->camDataSegmentOffset, SeekOffsetType::Start);
-
- for (auto entry : col->camData->entries)
- {
- writer->Write(entry.cameraSType);
- writer->Write(entry.numData);
- writer->Write(entry.cameraPosDataSeg);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
-}
diff --git a/tools/ZAPD/ExporterTest/CollisionExporter.h b/tools/ZAPD/ExporterTest/CollisionExporter.h
deleted file mode 100644
index 5f48e6557e..0000000000
--- a/tools/ZAPD/ExporterTest/CollisionExporter.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-#include "ZCollision.h"
-#include "ZResource.h"
-
-class ExporterExample_Collision : public ZResourceExporter
-{
-public:
- void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
-};
\ No newline at end of file
diff --git a/tools/ZAPD/ExporterTest/ExporterTest.vcxproj b/tools/ZAPD/ExporterTest/ExporterTest.vcxproj
deleted file mode 100644
index 341f72ceb1..0000000000
--- a/tools/ZAPD/ExporterTest/ExporterTest.vcxproj
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- 16.0
- Win32Proj
- {65608eb0-1a47-45ad-ab66-192fb64c762c}
- ExporterTest
- 10.0
- ExporterExample
-
-
-
- Application
- true
- v142
- Unicode
-
-
- Application
- false
- v143
- true
- Unicode
-
-
- StaticLibrary
- true
- v142
- Unicode
-
-
- Application
- false
- v143
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- false
-
-
- true
- $(ProjectDir)..\ZAPD\;$(ProjectDir)..\ZAPDUtils;$(ProjectDir)..\lib\tinyxml2;$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\lib\elfio;$(ProjectDir)..\lib\stb;$(ProjectDir);$(IncludePath)
-
-
- false
-
-
-
- Level3
- true
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
-
-
-
-
- Level3
- true
- true
- true
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
- true
- true
-
-
-
-
- Level3
- true
- _DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- stdcpp17
- stdc11
- MultiThreadedDebug
-
-
- Console
- true
-
-
-
-
- Level3
- true
- true
- true
- NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
-
-
- Console
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tools/ZAPD/ExporterTest/ExporterTest.vcxproj.filters b/tools/ZAPD/ExporterTest/ExporterTest.vcxproj.filters
deleted file mode 100644
index 166f563a17..0000000000
--- a/tools/ZAPD/ExporterTest/ExporterTest.vcxproj.filters
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/tools/ZAPD/ExporterTest/Main.cpp b/tools/ZAPD/ExporterTest/Main.cpp
deleted file mode 100644
index 07fdbeeced..0000000000
--- a/tools/ZAPD/ExporterTest/Main.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-#include "CollisionExporter.h"
-#include "Globals.h"
-#include "RoomExporter.h"
-#include "TextureExporter.h"
-
-enum class ExporterFileMode
-{
- ModeExample1 = (int)ZFileMode::Custom + 1,
- ModeExample2 = (int)ZFileMode::Custom + 2,
- ModeExample3 = (int)ZFileMode::Custom + 3,
-};
-
-static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileMode)
-{
- if (buildMode == "me1")
- fileMode = (ZFileMode)ExporterFileMode::ModeExample1;
- else if (buildMode == "me2")
- fileMode = (ZFileMode)ExporterFileMode::ModeExample2;
- else if (buildMode == "me3")
- fileMode = (ZFileMode)ExporterFileMode::ModeExample3;
-}
-
-static void ExporterParseArgs([[maybe_unused]] int argc, char* argv[], int& i)
-{
- std::string arg = argv[i];
-
- if (arg == "--do-x")
- {
- }
- else if (arg == "--do-y")
- {
- }
-}
-
-static bool ExporterProcessFileMode(ZFileMode fileMode)
-{
- // Do whatever work is associated with these custom file modes...
- // Return true to indicate one of our own file modes is being processed
- if (fileMode == (ZFileMode)ExporterFileMode::ModeExample1)
- return true;
- else if (fileMode == (ZFileMode)ExporterFileMode::ModeExample2)
- return true;
- else if (fileMode == (ZFileMode)ExporterFileMode::ModeExample3)
- return true;
-
- return false;
-}
-
-static void ExporterFileBegin(ZFile* file)
-{
- printf("ExporterFileBegin() called on ZFile %s.\n", file->GetName().c_str());
-}
-
-static void ExporterFileEnd(ZFile* file)
-{
- printf("ExporterFileEnd() called on ZFile %s.\n", file->GetName().c_str());
-}
-
-static void ImportExporters()
-{
- // In this example we set up a new exporter called "EXAMPLE".
- // By running ZAPD with the argument -se EXAMPLE, we tell it that we want to use this exporter
- // for our resources.
- ExporterSet* exporterSet = new ExporterSet();
- exporterSet->processFileModeFunc = ExporterProcessFileMode;
- exporterSet->parseFileModeFunc = ExporterParseFileMode;
- exporterSet->parseArgsFunc = ExporterParseArgs;
- exporterSet->beginFileFunc = ExporterFileBegin;
- exporterSet->endFileFunc = ExporterFileEnd;
- exporterSet->exporters[ZResourceType::Texture] = new ExporterExample_Texture();
- exporterSet->exporters[ZResourceType::Room] = new ExporterExample_Room();
- exporterSet->exporters[ZResourceType::CollisionHeader] = new ExporterExample_Collision();
-
- Globals::AddExporter("EXAMPLE", exporterSet);
-}
-
-// When ZAPD starts up, it will automatically call the below function, which in turn sets up our
-// exporters.
-REGISTER_EXPORTER(ImportExporters);
diff --git a/tools/ZAPD/ExporterTest/Makefile b/tools/ZAPD/ExporterTest/Makefile
deleted file mode 100644
index 98e0475254..0000000000
--- a/tools/ZAPD/ExporterTest/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Only used for standalone compilation, usually inherits these from the main makefile
-CXXFLAGS ?= -Wall -Wextra -O2 -g -std=c++17
-
-SRC_DIRS := $(shell find . -type d -not -path "*build*")
-CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
-H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h))
-
-O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
-LIB := ExporterTest.a
-
-# create build directories
-$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
-
-all: $(LIB)
-
-clean:
- rm -rf build $(LIB)
-
-format:
- clang-format-14 -i $(CPP_FILES) $(H_FILES)
-
-.PHONY: all clean format
-
-build/%.o: %.cpp
- $(CXX) $(CXXFLAGS) $(OPTFLAGS) -I ./ -I ../ZAPD -I ../ZAPDUtils -I ../lib/tinyxml2 -c $(OUTPUT_OPTION) $<
-
-$(LIB): $(O_FILES)
- $(AR) rcs $@ $^
diff --git a/tools/ZAPD/ExporterTest/RoomExporter.cpp b/tools/ZAPD/ExporterTest/RoomExporter.cpp
deleted file mode 100644
index 4cc06b76f5..0000000000
--- a/tools/ZAPD/ExporterTest/RoomExporter.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-#include "RoomExporter.h"
-#include "CollisionExporter.h"
-#include "Utils/BinaryWriter.h"
-#include "Utils/File.h"
-#include "Utils/MemoryStream.h"
-#include "ZRoom/Commands/SetCameraSettings.h"
-#include "ZRoom/Commands/SetCollisionHeader.h"
-#include "ZRoom/Commands/SetCsCamera.h"
-#include "ZRoom/Commands/SetEchoSettings.h"
-#include "ZRoom/Commands/SetEntranceList.h"
-#include "ZRoom/Commands/SetLightingSettings.h"
-#include "ZRoom/Commands/SetMesh.h"
-#include "ZRoom/Commands/SetRoomBehavior.h"
-#include "ZRoom/Commands/SetRoomList.h"
-#include "ZRoom/Commands/SetSkyboxModifier.h"
-#include "ZRoom/Commands/SetSkyboxSettings.h"
-#include "ZRoom/Commands/SetSoundSettings.h"
-#include "ZRoom/Commands/SetSpecialObjects.h"
-#include "ZRoom/Commands/SetStartPositionList.h"
-#include "ZRoom/Commands/SetTimeSettings.h"
-#include "ZRoom/Commands/SetWind.h"
-
-void ExporterExample_Room::Save(ZResource* res, fs::path outPath, BinaryWriter* writer)
-{
- ZRoom* room = dynamic_cast(res);
-
- // MemoryStream* memStream = new MemoryStream();
- // BinaryWriter* writer = new BinaryWriter(memStream);
-
- for (size_t i = 0; i < room->commands.size() * 8; i++)
- writer->Write((uint8_t)0);
-
- for (size_t i = 0; i < room->commands.size(); i++)
- {
- ZRoomCommand* cmd = room->commands[i];
-
- writer->Seek(i * 8, SeekOffsetType::Start);
-
- writer->Write((uint8_t)cmd->cmdID);
-
- switch (cmd->cmdID)
- {
- case RoomCommand::SetWind:
- {
- SetWind* cmdSetWind = (SetWind*)cmd;
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(cmdSetWind->windWest); // 0x04
- writer->Write(cmdSetWind->windVertical); // 0x05
- writer->Write(cmdSetWind->windSouth); // 0x06
- writer->Write(cmdSetWind->clothFlappingStrength); // 0x07
- }
- break;
- case RoomCommand::SetTimeSettings:
- {
- SetTimeSettings* cmdTime = (SetTimeSettings*)cmd;
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(cmdTime->hour); // 0x04
- writer->Write(cmdTime->min); // 0x05
- writer->Write(cmdTime->unk); // 0x06
- writer->Write((uint8_t)0); // 0x07
- }
- break;
- case RoomCommand::SetSkyboxModifier:
- {
- SetSkyboxModifier* cmdSkybox = (SetSkyboxModifier*)cmd;
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(cmdSkybox->disableSky); // 0x04
- writer->Write(cmdSkybox->disableSunMoon); // 0x05
- writer->Write((uint8_t)0); // 0x06
- writer->Write((uint8_t)0); // 0x07
- }
- break;
- case RoomCommand::SetEchoSettings:
- {
- SetEchoSettings* cmdEcho = (SetEchoSettings*)cmd;
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
- writer->Write((uint8_t)0); // 0x06
- writer->Write((uint8_t)cmdEcho->echo); // 0x07
- }
- break;
- case RoomCommand::SetSoundSettings:
- {
- SetSoundSettings* cmdSound = (SetSoundSettings*)cmd;
-
- writer->Write((uint8_t)cmdSound->reverb); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
-
- writer->Write(cmdSound->nightTimeSFX); // 0x06
- writer->Write(cmdSound->musicSequence); // 0x07
- }
- break;
- case RoomCommand::SetSkyboxSettings:
- {
- SetSkyboxSettings* cmdSkybox = (SetSkyboxSettings*)cmd;
-
- writer->Write((uint8_t)cmdSkybox->unk1); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)cmdSkybox->skyboxNumber); // 0x04
- writer->Write((uint8_t)cmdSkybox->cloudsType); // 0x05
- writer->Write((uint8_t)cmdSkybox->isIndoors); // 0x06
- }
- break;
- case RoomCommand::SetRoomBehavior:
- {
- SetRoomBehavior* cmdRoom = (SetRoomBehavior*)cmd;
-
- writer->Write((uint8_t)cmdRoom->gameplayFlags); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(cmdRoom->gameplayFlags2); // 0x04
- }
- break;
- case RoomCommand::SetCsCamera:
- {
- SetCsCamera* cmdCsCam = (SetCsCamera*)cmd;
-
- writer->Write((uint8_t)cmdCsCam->cameras.size()); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(cmdCsCam->segmentOffset); // 0x04
- }
- break;
- case RoomCommand::SetMesh:
- {
- SetMesh* cmdMesh = (SetMesh*)cmd;
-
- int baseStreamEnd = writer->GetStream().get()->GetLength();
-
- writer->Write((uint8_t)cmdMesh->data); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- writer->Write(baseStreamEnd); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(baseStreamEnd, SeekOffsetType::Start);
-
- // TODO: NOT DONE
-
- writer->Write(cmdMesh->meshHeaderType);
-
- if (cmdMesh->meshHeaderType == 0)
- {
- // writer->Write(cmdMesh->)
- }
- else if (cmdMesh->meshHeaderType == 1)
- {
- }
- else if (cmdMesh->meshHeaderType == 2)
- {
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetCameraSettings:
- {
- SetCameraSettings* cmdCam = (SetCameraSettings*)cmd;
-
- writer->Write((uint8_t)cmdCam->cameraMovement); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(cmdCam->mapHighlight); // 0x04
- }
- break;
- case RoomCommand::SetLightingSettings:
- {
- SetLightingSettings* cmdLight = (SetLightingSettings*)cmd;
-
- writer->Write((uint8_t)cmdLight->settings.size()); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(cmdLight->segmentOffset); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(cmdLight->segmentOffset, SeekOffsetType::Start);
-
- for (LightingSettings setting : cmdLight->settings)
- {
- writer->Write(setting.ambientClrR);
- writer->Write(setting.ambientClrG);
- writer->Write(setting.ambientClrB);
-
- writer->Write(setting.diffuseClrA_R);
- writer->Write(setting.diffuseClrA_G);
- writer->Write(setting.diffuseClrA_B);
-
- writer->Write(setting.diffuseDirA_X);
- writer->Write(setting.diffuseDirA_Y);
- writer->Write(setting.diffuseDirA_Z);
-
- writer->Write(setting.diffuseClrB_R);
- writer->Write(setting.diffuseClrB_G);
- writer->Write(setting.diffuseClrB_B);
-
- writer->Write(setting.diffuseDirB_X);
- writer->Write(setting.diffuseDirB_Y);
- writer->Write(setting.diffuseDirB_Z);
-
- writer->Write(setting.fogClrR);
- writer->Write(setting.fogClrG);
- writer->Write(setting.fogClrB);
-
- writer->Write(setting.unk);
- writer->Write(setting.drawDistance);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetRoomList:
- {
- SetRoomList* cmdRoom = (SetRoomList*)cmd;
-
- writer->Write((uint8_t)cmdRoom->romfile->rooms.size()); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
-
- auto baseStreamEnd = writer->GetLength();
- writer->Write(baseStreamEnd); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(baseStreamEnd, SeekOffsetType::Start);
-
- for (const auto& entry : cmdRoom->romfile->rooms)
- {
- writer->Write(entry.virtualAddressStart);
- writer->Write(entry.virtualAddressEnd);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetCollisionHeader:
- {
- SetCollisionHeader* cmdCollHeader = (SetCollisionHeader*)cmd;
-
- int streamEnd = writer->GetStream().get()->GetLength();
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(streamEnd); // 0x04
-
- // TODO: NOT DONE
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(streamEnd, SeekOffsetType::Start);
-
- ExporterExample_Collision colExp = ExporterExample_Collision();
-
- colExp.Save(cmdCollHeader->collisionHeader, outPath, writer);
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetEntranceList:
- {
- SetEntranceList* cmdEntrance = (SetEntranceList*)cmd;
-
- uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(baseStreamEnd); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(baseStreamEnd, SeekOffsetType::Start);
-
- for (Spawn entry : cmdEntrance->entrances)
- {
- writer->Write((uint8_t)entry.startPositionIndex);
- writer->Write((uint8_t)entry.roomToLoad);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::SetSpecialObjects:
- {
- SetSpecialObjects* cmdSpecObj = (SetSpecialObjects*)cmd;
-
- writer->Write((uint8_t)cmdSpecObj->elfMessage); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
- writer->Write((uint16_t)cmdSpecObj->globalObject); // 0x06
- }
- break;
- case RoomCommand::SetStartPositionList:
- {
- SetStartPositionList* cmdStartPos = (SetStartPositionList*)cmd;
-
- uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
-
- writer->Write((uint8_t)cmdStartPos->actors.size()); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write(baseStreamEnd); // 0x04
-
- uint32_t oldOffset = writer->GetBaseAddress();
- writer->Seek(baseStreamEnd, SeekOffsetType::Start);
-
- for (ActorSpawnEntry entry : cmdStartPos->actors)
- {
- writer->Write(entry.actorNum);
- writer->Write(entry.posX);
- writer->Write(entry.posY);
- writer->Write(entry.posZ);
- writer->Write(entry.rotX);
- writer->Write(entry.rotY);
- writer->Write(entry.rotZ);
- writer->Write(entry.params);
- }
-
- writer->Seek(oldOffset, SeekOffsetType::Start);
- }
- break;
- case RoomCommand::EndMarker:
- {
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
- writer->Write((uint8_t)0); // 0x06
- writer->Write((uint8_t)0); // 0x07
- }
- break;
- default:
- printf("UNIMPLEMENTED COMMAND: %i\n", (int)cmd->cmdID);
-
- writer->Write((uint8_t)0); // 0x01
- writer->Write((uint8_t)0); // 0x02
- writer->Write((uint8_t)0); // 0x03
- writer->Write((uint8_t)0); // 0x04
- writer->Write((uint8_t)0); // 0x05
- writer->Write((uint8_t)0); // 0x06
- writer->Write((uint8_t)0); // 0x07
-
- break;
- }
- }
-
- // writer->Close();
- // File::WriteAllBytes(StringHelper::Sprintf("%s", res->GetName().c_str()),
- // memStream->ToVector());
-}
diff --git a/tools/ZAPD/ExporterTest/RoomExporter.h b/tools/ZAPD/ExporterTest/RoomExporter.h
deleted file mode 100644
index ee531dc87b..0000000000
--- a/tools/ZAPD/ExporterTest/RoomExporter.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-#include "ZResource.h"
-#include "ZRoom/ZRoom.h"
-
-class ExporterExample_Room : public ZResourceExporter
-{
-public:
- void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
-};
\ No newline at end of file
diff --git a/tools/ZAPD/ExporterTest/TextureExporter.cpp b/tools/ZAPD/ExporterTest/TextureExporter.cpp
deleted file mode 100644
index 6488bed3a2..0000000000
--- a/tools/ZAPD/ExporterTest/TextureExporter.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "TextureExporter.h"
-#include "../ZAPD/ZFile.h"
-
-void ExporterExample_Texture::Save(ZResource* res, [[maybe_unused]] fs::path outPath,
- BinaryWriter* writer)
-{
- ZTexture* tex = (ZTexture*)res;
-
- auto data = tex->parent->GetRawData();
-
- for (offset_t i = tex->GetRawDataIndex(); i < tex->GetRawDataIndex() + tex->GetRawDataSize();
- i++)
- writer->Write(data[i]);
-}
diff --git a/tools/ZAPD/ExporterTest/TextureExporter.h b/tools/ZAPD/ExporterTest/TextureExporter.h
deleted file mode 100644
index 41c4e79be2..0000000000
--- a/tools/ZAPD/ExporterTest/TextureExporter.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#pragma once
-
-#include "Utils/BinaryWriter.h"
-#include "ZResource.h"
-#include "ZTexture.h"
-
-class ExporterExample_Texture : public ZResourceExporter
-{
-public:
- void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override;
-};
\ No newline at end of file
diff --git a/tools/ZAPD/Jenkinsfile b/tools/ZAPD/Jenkinsfile
deleted file mode 100644
index 48535a51cf..0000000000
--- a/tools/ZAPD/Jenkinsfile
+++ /dev/null
@@ -1,106 +0,0 @@
-pipeline {
- agent {
- label 'ZAPD'
- }
-
- stages {
- // Non-parallel ZAPD stage
- stage('Build ZAPD') {
- steps {
- sh 'make -j WERROR=1'
- }
- }
-
- // CHECKOUT THE REPOS
- stage('Checkout Repos') {
- parallel {
- stage('Checkout oot') {
- steps {
- dir('oot') {
- git url: 'https://github.com/zeldaret/oot.git'
- }
- }
- }
-
- stage('Checkout mm') {
- steps{
- dir('mm') {
- git url: 'https://github.com/zeldaret/mm.git'
- }
- }
- }
- }
- }
-
- // SETUP THE REPOS
- stage('Set up repos') {
- parallel {
- stage('Setup OOT') {
- steps {
- dir('oot') {
- sh 'cp /usr/local/etc/roms/baserom_oot.z64 baserom_original.z64'
-
- // Identical to `make setup` except for copying our newer ZAPD.out into oot
- sh 'git submodule update --init --recursive'
- sh 'make -C tools'
- sh 'cp ../ZAPD.out tools/ZAPD/'
- sh 'python3 fixbaserom.py'
- sh 'python3 extract_baserom.py'
- sh 'python3 extract_assets.py'
- }
- }
- }
-
- stage('Setup MM') {
- steps {
- dir('mm') {
- sh 'cp /usr/local/etc/roms/mm.us.rev1.z64 baserom.mm.us.rev1.z64'
-
- // Identical to `make setup` except for copying our newer ZAPD.out into mm
- sh 'make -C tools'
- sh 'cp ../ZAPD.out tools/ZAPD/'
- sh 'python3 tools/fixbaserom.py'
- sh 'python3 tools/extract_baserom.py'
- sh 'python3 extract_assets.py -j $(nproc)'
- }
- }
- }
- }
- }
-
- // INSTALL PYTHON DEPENDENCIES, currently MM only
- stage('Install Python dependencies') {
- steps {
- dir('mm') {
- sh 'python3 -m pip install -r requirements.txt'
- }
- }
- }
-
- // BUILD THE REPOS
- stage('Build repos') {
- parallel {
- stage('Build oot') {
- steps {
- dir('oot') {
- sh 'make -j'
- }
- }
- }
- stage('Build mm') {
- steps {
- dir('mm') {
- sh 'make -j disasm'
- sh 'make -j'
- }
- }
- }
- }
- }
- }
- post {
- always {
- cleanWs()
- }
- }
-}
diff --git a/tools/ZAPD/LICENSE b/tools/ZAPD/LICENSE
deleted file mode 100644
index 90b734bde8..0000000000
--- a/tools/ZAPD/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2020 Zelda Reverse Engineering Team
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/tools/ZAPD/Makefile b/tools/ZAPD/Makefile
deleted file mode 100644
index 36331937a7..0000000000
--- a/tools/ZAPD/Makefile
+++ /dev/null
@@ -1,151 +0,0 @@
-# use variables in submakes
-export
-OPTIMIZATION_ON ?= 1
-ASAN ?= 0
-DEPRECATION_ON ?= 1
-DEBUG ?= 0
-COPYCHECK_ARGS ?=
-LLD ?= 0
-WERROR ?= 0
-
-# On MacOS 10.14, use boost::filesystem, because
-# the system doesn't supply std::filesystem.
-ifneq ($(OS),Windows_NT)
- ifeq ($(shell uname -s),Darwin)
- MACOS_VERSION := $(shell sw_vers -productVersion | cut -d . -f 1,2)
- ifeq ($(MACOS_VERSION),10.14)
- USE_BOOST_FS ?= 1
- endif
- endif
-endif
-USE_BOOST_FS ?= 0
-
-# Use clang++ if available, else use g++
-ifeq ($(shell command -v clang++ >/dev/null 2>&1; echo $$?),0)
- CXX := clang++
-else
- CXX := g++
-endif
-
-INC := -I ZAPD -I lib/libgfxd -I lib/tinyxml2 -I ZAPDUtils
-CXXFLAGS := -fpic -std=c++17 -Wall -Wextra -fno-omit-frame-pointer
-OPTFLAGS :=
-
-ifneq ($(DEBUG),0)
- OPTIMIZATION_ON = 0
- CXXFLAGS += -g3 -DDEVELOPMENT -D_DEBUG
- COPYCHECK_ARGS += --devel
- DEPRECATION_ON = 0
-endif
-
-ifneq ($(WERROR),0)
- CXXFLAGS += -Werror
-endif
-
-ifeq ($(OPTIMIZATION_ON),0)
- OPTFLAGS := -O0
-else
- OPTFLAGS := -O2
-endif
-
-ifneq ($(ASAN),0)
- CXXFLAGS += -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined
-endif
-ifneq ($(DEPRECATION_ON),0)
- CXXFLAGS += -DDEPRECATION_ON
-endif
-# CXXFLAGS += -DTEXTURE_DEBUG
-
-LDFLAGS := -lm -ldl -lpng
-
-ifneq ($(USE_BOOST_FS),0)
- CXXFLAGS += -DUSE_BOOST_FS
- LDFLAGS += -lboost_filesystem
-endif
-
-# Use LLD if available. Set LLD=0 to not use it
-ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)
- LLD := 1
-endif
-
-ifneq ($(LLD),0)
- LDFLAGS += -fuse-ld=lld
-endif
-
-UNAME := $(shell uname)
-UNAMEM := $(shell uname -m)
-ifneq ($(UNAME), Darwin)
- LDFLAGS += -Wl,-export-dynamic -lstdc++fs
- EXPORTERS := -Wl,--whole-archive ExporterTest/ExporterTest.a -Wl,--no-whole-archive
-else
- EXPORTERS := -Wl,-force_load ExporterTest/ExporterTest.a
- ifeq ($(UNAMEM),arm64)
- ifeq ($(shell brew list libpng > /dev/null 2>&1; echo $$?),0)
- LDFLAGS += -L $(shell brew --prefix)/lib
- INC += -I $(shell brew --prefix)/include
- else
- $(error Please install libpng via Homebrew)
- endif
- endif
-endif
-
-
-ZAPD_SRC_DIRS := $(shell find ZAPD -type d)
-SRC_DIRS = $(ZAPD_SRC_DIRS) lib/tinyxml2
-
-ZAPD_CPP_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.cpp))
-ZAPD_H_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.h))
-
-CPP_FILES += $(ZAPD_CPP_FILES) lib/tinyxml2/tinyxml2.cpp
-O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
-O_FILES += build/ZAPD/BuildInfo.o
-
-# create build directories
-$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
-
-
-# Main targets
-all: ZAPD.out copycheck
-
-build/ZAPD/BuildInfo.o:
- python3 ZAPD/genbuildinfo.py $(COPYCHECK_ARGS)
- $(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) build/ZAPD/BuildInfo.cpp
-
-copycheck: ZAPD.out
- python3 copycheck.py
-
-clean:
- rm -rf build ZAPD.out
- $(MAKE) -C lib/libgfxd clean
- $(MAKE) -C ZAPDUtils clean
- $(MAKE) -C ExporterTest clean
-
-rebuild: clean all
-
-format:
- clang-format-14 -i $(ZAPD_CPP_FILES) $(ZAPD_H_FILES)
- $(MAKE) -C ZAPDUtils format
- $(MAKE) -C ExporterTest format
-
-.PHONY: all build/ZAPD/BuildInfo.o copycheck clean rebuild format
-
-build/%.o: %.cpp
- $(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) $<
-
-
-# Submakes
-lib/libgfxd/libgfxd.a:
- $(MAKE) -C lib/libgfxd
-
-.PHONY: ExporterTest
-ExporterTest:
- $(MAKE) -C ExporterTest
-
-.PHONY: ZAPDUtils
-ZAPDUtils:
- $(MAKE) -C ZAPDUtils
-
-
-# Linking
-ZAPD.out: $(O_FILES) lib/libgfxd/libgfxd.a ExporterTest ZAPDUtils
- $(CXX) $(CXXFLAGS) $(O_FILES) lib/libgfxd/libgfxd.a ZAPDUtils/ZAPDUtils.a $(EXPORTERS) $(LDFLAGS) $(OUTPUT_OPTION)
diff --git a/tools/ZAPD/README.md b/tools/ZAPD/README.md
deleted file mode 100644
index 5006f8d4b5..0000000000
--- a/tools/ZAPD/README.md
+++ /dev/null
@@ -1,174 +0,0 @@
-# ZAPD: Zelda Asset Processor for Decomp
-
-## Compiling
-
-### Dependencies
-
-ZAPD needs a compiler with C++17 support.
-
-ZAPD has the following library dependencies:
-
-- `libpng`
-
-In a Debian/Ubuntu based environment, those could be installed with the following command:
-
-```bash
-sudo apt install libpng-dev
-```
-
-On a Mac, you will need to install libpng with Homebrew or MacPorts; we currently only support Homebrew. You can run
-
-```bash
-brew install libpng
-```
-
-to install it via Homebrew.
-
-### Building
-
-#### Linux / *nix
-
-ZAPD uses the classic `Makefile` approach. To build just run `make` (or even better `make -j` for faster compilations).
-
-You can configure a bit your ZAPD build with the following options:
-
-- `OPTIMIZATION_ON`: If set to `0` optimizations will be disabled (compile with `-O0`). Any other value compiles with `-O2`. Defaults to `1`.
-- `ASAN`: If it is set to a non-zero then ZAPD will be compiled with Address Sanitizer enabled (`-fsanitize=address`). Defaults to `0`.
-- `DEPRECATION_ON`: If it is set to a zero then deprecation warnings will be disabled. Defaults to `1`.
-- `DEBUG`: If non-zero, ZAPD will be compiled in _development mode_. This implies the following:
- - Debugging symbols enabled (`-g3`). They are disabled by default.
- - `OPTIMIZATION_ON=0`: Disables optimizations (`-O0`).
- - `DEPRECATION_ON=0`: Disables deprecation warnings.
-- `LLD=1`: builds with the LLVM linker `ld.lld` instead of the system default.
-
-As an example, if you want to build ZAPD with optimizations disabled and use the address sanitizer, you could use the following command:
-
-```bash
-make -j OPTIMIZATION_ON=0 ASAN=1
-```
-
-#### Windows
-
-This repository contains `vcxproj` files for compiling under Visual Studio environments. See `ZAPD/ZAPD.vcxproj`.
-
-## Invoking ZAPD
-
-ZAPD needs a _File parsing mode_ to be passed as first parameter. The options are:
-
-- `e`: "Extraction" mode.
- - In this mode, ZAPD expects a XML file as input, a folder as ouput and a path to the baserom files.
- - ZAPD will read the XML and use it as a guide to extract the contents of the specified asset file from the baserom folder.
- - For more info of the format of those XMLs, see the [ZAPD extraction XML reference](docs/zapd_extraction_xml_reference.md).
-- `bsf`: "Build source file" mode.
- - This is an experimental mode.
- - It was going to be used to let you have XMLs that aren't just for extraction. Might get used, might not. Still need to experiment on that.
-- `btex`: "Build texture" mode.
- - In this mode, ZAPD expects a PNG file as input, a filename as ouput and a texture type parameter (`-tt`).
- - ZAPD will try to convert the given PNG into the contents of a `uint64_t` C array.
-- `bren`: "Build (render) background" mode.
- - In this mode, ZAPD expects a JPG file as input and a filename as ouput.
- - ZAPD will try to convert the given JPG into the contents of a `uint64_t` C array.
-- `blb`: "Build blob" mode.
- - In this mode, ZAPD expects a BIN file as input and a filename as ouput.
- - ZAPD will try to convert the given BIN into the contents of a `uint8_t` C array.
-
-ZAPD also accepts the following list of extra parameters:
-
-- `-i PATH` / `--inputpath PATH`: Set input path.
-- `-o PATH` / `--outputpath PATH`: Set output path.
-- `-b PATH` / `--baserompath`: Set baserom path.
- - Can be used only in `e` or `bsf` modes.
-- `-osf PATH`: Set source output path. This is the path where the `.c` and `.h` files will be extracted to. If omitted, it will use the value passed to `--outputpath` parameter.
-- `-gsf MODE`: Generate source file during extraction. If `MODE` is `1`, C source files will be generated.
- - Can be used only in `e` mode.
-- `-crc` / `--output-crc`: Outputs a CRC file for each extracted texture.
- - Can be used only in `e` or `bsf` modes.
-- `-ulzdl MODE`: Use "Legacy ZDisplayList" instead of `libgfxd`. Set `MODE` to `1` to enable it.
- - Can be used only in `e` or `bsf` modes.
-- `-profile MODE`: Enable profiling. Set `MODE` to `1` to enable it.
-- `-uer MODE`: Split resources into their individual components (enabled by default). Set `MODE` to non-`1` to disable it.
-- `-tt TYPE`: Set texture type.
- - Can be used only in mode `btex`.
- - Valid values:
- - `rgba32`
- - `rgb5a1`
- - `i4`
- - `i8`
- - `ia4`
- - `ia8`
- - `ia16`
- - `ci4`
- - `ci8`
-- `-rconf PATH` Read Config File.
-- `-eh`: Enable error handler.
- - Only available in non-Windows environments.
-- `-v MODE`: Enable verbosity. Currently there are 3 possible values:
- - `0`: Default. Completely silent (except for warnings and errors).
- - `1`: Information.
- - `2` (and higher): Debug.
-- `-wu` / `--warn-unaccounted`: Enable warnings for each unaccounted block of data found.
- - Can be used only in `e` or `bsf` modes.
-- `-vu` / `--verbose-unaccounted`: Changes how unaccounteds are outputted. Max 4 bytes per line (a word) and add a comment with the offset of each of those lines.
- - Could be useful for looking at raw data or testing.
- - Can be used only in `e` or `bsf` modes.
-- `-tm MODE`: Test Mode (enables certain experimental features). To enable it, set `MODE` to `1`.
-- `-se` / `--set-exporter` : Sets which exporter to use.
-- `--gcc-compat` : Enables GCC compatibly mode. Slower.
-- `-us` / `--unaccounted-static` : Mark unaccounted data as `static`
-- `-s` / `--static` : Mark every asset as `static`.
- - This behaviour can be overridden per asset using `Static=` in the respective XML node.
-- `--cs-float` : How cutscene floats should be extracted.
-- Valid values:
- - `hex`: `0x42280000`
- - `float`: `42.0f`
- - `both`: `CS_FLOAT(0x42280000, 42.0f)`
- - `hex-commented-left`: `/* 42.0f */ 0x42280000`
- - `hex-commented-right`: `0x42280000 /* 42.0f */`
-- `--base-address ADDRESS`: Override base virtual address for input files.
-- `--start-offset OFFSET`: Override start offset for input files.
-- `--end-offset OFFSET`: Override end offset for input files.
-- `-W...`: warning flags, see below
-
-Additionally, you can pass the flag `--version` to see the current ZAPD version. If that flag is passed, ZAPD will ignore any other parameter passed.
-
-### Warning flags
-
-ZAPD contains a variety of warning types, with similar syntax to GCC or Clang's compiler warnings. Warnings can have three levels:
-
-- Off (does not display anything)
-- Warn (print a warning but continue processing)
-- Err (behave like an error, i.e. print and throw an exception to crash ZAPD when occurs)
-
-Each warning type uses one of these by default, but can be modified with flags, similarly to GCC or Clang:
-
-- `-Wfoo` enables warnings of type `foo`
-- `-Wno-foo` disables warnings of type `foo`
-- `-Werror=foo` escalates `foo` to behave like an error
-- `-Weverything` enables all warnings (they may be turned off using `-Wno-` flags afterwards)
-- `-Werror` escalates all enabled warnings to errors
-
-All warning types currently implemented, with their default levels:
-
-| Warning type | Default level | Description |
-| ----------------------------- | ------------- | ------------------------------------------------------------------------ |
-| `-Wdeprecated` | Warn | Deprecated features |
-| `-Whardcoded-generic-pointer` | Off | A generic segmented pointer must be produced |
-| `-Whardcoded-pointer` | Warn | ZAPD lacks the info to make a symbol, so must output a hardcoded pointer |
-| `-Wintersection` | Warn | Two assets intersect |
-| `-Winvalid-attribute-value` | Err | Attribute declared in XML is wrong |
-| `-Winvalid-extracted-data` | Err | Extracted data does not have correct form |
-| `-Winvalid-jpeg` | Err | JPEG file does not conform to the game's format requirements |
-| `-Winvalid-png` | Err | Issues arising when processing PNG data |
-| `-Winvalid-xml` | Err | XML has syntax errors |
-| `-Wmissing-attribute` | Warn | Required attribute missing in XML tag |
-| `-Wmissing-offsets` | Warn | Offset attribute missing in XML tag |
-| `-Wmissing-segment` | Warn | Segment not given in File tag in XML |
-| `-Wnot-implemented` | Warn | ZAPD does not currently support this feature |
-| `-Wunaccounted` | Off | Large blocks of unaccounted |
-| `-Wunknown-attribute` | Warn | Unknown attribute in XML entry tag |
-
-There are also errors that do not have a type, and cannot be disabled.
-
-For example, here we have invoked ZAPD in the usual way to extract using a (rather badly-written) XML, but escalating `-Wintersection` to an error:
-
-
diff --git a/tools/ZAPD/ZAPD.sln b/tools/ZAPD/ZAPD.sln
deleted file mode 100644
index 82538dd9f4..0000000000
--- a/tools/ZAPD/ZAPD.sln
+++ /dev/null
@@ -1,82 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30320.27
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPD", "ZAPD\ZAPD.vcxproj", "{B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExporterExample", "ExporterTest\ExporterTest.vcxproj", "{65608EB0-1A47-45AD-AB66-192FB64C762C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZAPDUtils", "ZAPDUtils\ZAPDUtils.vcxproj", "{A2E01C3E-D647-45D1-9788-043DEBC1A908}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- MinSizeRel|x64 = MinSizeRel|x64
- MinSizeRel|x86 = MinSizeRel|x86
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- RelWithDebInfo|x64 = RelWithDebInfo|x64
- RelWithDebInfo|x86 = RelWithDebInfo|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x64.ActiveCfg = Debug|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x64.Build.0 = Debug|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x86.ActiveCfg = Debug|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Debug|x86.Build.0 = Debug|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x64.ActiveCfg = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x64.Build.0 = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x86.ActiveCfg = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.MinSizeRel|x86.Build.0 = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x64.ActiveCfg = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x64.Build.0 = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x86.ActiveCfg = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.Release|x86.Build.0 = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x64.ActiveCfg = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x64.Build.0 = Release|x64
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
- {B53F9E5B-0A58-4BAE-9AFE-856C8CBB8D36}.RelWithDebInfo|x86.Build.0 = Release|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x64.ActiveCfg = Debug|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x64.Build.0 = Debug|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x86.ActiveCfg = Debug|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Debug|x86.Build.0 = Debug|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x64.ActiveCfg = Debug|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x64.Build.0 = Debug|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x86.ActiveCfg = Debug|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.MinSizeRel|x86.Build.0 = Debug|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x64.ActiveCfg = Release|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x64.Build.0 = Release|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x86.ActiveCfg = Release|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.Release|x86.Build.0 = Release|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x64.ActiveCfg = Release|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x64.Build.0 = Release|x64
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
- {65608EB0-1A47-45AD-AB66-192FB64C762C}.RelWithDebInfo|x86.Build.0 = Release|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.ActiveCfg = Debug|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x64.Build.0 = Debug|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.ActiveCfg = Debug|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Debug|x86.Build.0 = Debug|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x64.ActiveCfg = Debug|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x64.Build.0 = Debug|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x86.ActiveCfg = Debug|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.MinSizeRel|x86.Build.0 = Debug|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.ActiveCfg = Release|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x64.Build.0 = Release|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.ActiveCfg = Release|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.Release|x86.Build.0 = Release|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x64.ActiveCfg = Release|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x64.Build.0 = Release|x64
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
- {A2E01C3E-D647-45D1-9788-043DEBC1A908}.RelWithDebInfo|x86.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {C2E1CC72-7A50-3249-AFD5-DFF6FE25CDCA}
- EndGlobalSection
- GlobalSection(Performance) = preSolution
- HasPerformanceSessions = true
- EndGlobalSection
-EndGlobal
diff --git a/tools/ZAPD/ZAPD/CRC32.h b/tools/ZAPD/ZAPD/CRC32.h
deleted file mode 100644
index 1f82c75c58..0000000000
--- a/tools/ZAPD/ZAPD/CRC32.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-
-static uint32_t CRC32B(const unsigned char* message, int32_t size)
-{
- int32_t byte, crc;
- int32_t mask;
-
- crc = 0xFFFFFFFF;
-
- for (int32_t i = 0; i < size; i++)
- {
- byte = message[i];
- crc = crc ^ byte;
-
- for (int32_t j = 7; j >= 0; j--)
- {
- mask = -(crc & 1);
- crc = (crc >> 1) ^ (0xEDB88320 & mask);
- }
- }
-
- return ~(uint32_t)(crc);
-}
\ No newline at end of file
diff --git a/tools/ZAPD/ZAPD/CrashHandler.cpp b/tools/ZAPD/ZAPD/CrashHandler.cpp
deleted file mode 100644
index 7ddec5a7e8..0000000000
--- a/tools/ZAPD/ZAPD/CrashHandler.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-#include "CrashHandler.h"
-#include "Utils/StringHelper.h"
-
-#if __has_include()
-#define HAS_POSIX 1
-#else
-#define HAS_POSIX 0
-#endif
-
-#include
-#include
-#include
-#include
-#include
-
-#if HAS_POSIX == 1
-#include
-#include // for __cxa_demangle
-#include // for dladdr
-#include
-#include
-#elif defined(_MSC_VER)
-#include
-#include
-
-#include
-
-#pragma comment(lib, "Dbghelp.lib")
-#endif
-
-// Feel free to add more crash messages.
-static std::array crashEasterEgg = {
- "\tYou've met with a terrible fate, haven't you?",
- "\tSEA BEARS FOAM. SLEEP BEARS DREAMS. \n\tBOTH END IN THE SAME WAY: CRASSSH!",
- "\tZAPD has fallen and cannot get up.",
- "\tIT'S A SECRET TO EVERYBODY. \n\tBut it shouldn't be, you'd better ask about it!",
- "\tI AM ERROR.",
- "\tGRUMBLE,GRUMBLE...",
- "\tDODONGO DISLIKES SMOKE \n\tAnd ZAPD dislikes whatever you fed it.",
- "\tMay the way of the Hero lead \n\tto the debugger.",
- "\tTHE WIND FISH SLUMBERS LONG... \n\tTHE HERO'S LIFE GONE... ",
- "\tSEA BEARS FOAM, SLEEP BEARS DREAMS. \n\tBOTH END IN THE SAME WAY CRASSSH!",
- "\tYou've met with a terrible fate, haven't you?",
- "\tMaster, I calculate a 100% probability that ZAPD has crashed. \n\tAdditionally, the "
- "batteries in your Wii Remote are nearly depleted.",
- "\t CONGRATURATIONS! \n"
- "\tAll Pages are displayed.\n"
- "\t THANK YOU! \n"
- "\t You are great debugger!",
- "\tRCP is HUNG UP!!\n"
- "\tOh! MY GOD!!",
-};
-
-#if HAS_POSIX == 1
-void ErrorHandler(int sig)
-{
- std::array arr;
- constexpr size_t nMaxFrames = arr.size();
- size_t size = backtrace(arr.data(), nMaxFrames);
- char** symbols = backtrace_symbols(arr.data(), nMaxFrames);
-
- fprintf(stderr, "\nZAPD crashed. (Signal: %i)\n", sig);
-
- srand(time(nullptr));
- auto easterIndex = rand() % crashEasterEgg.size();
-
- fprintf(stderr, "\n%s\n\n", crashEasterEgg[easterIndex]);
-
- fprintf(stderr, "Traceback:\n");
- for (size_t i = 1; i < size; i++)
- {
- Dl_info info;
- uint32_t gotAddress = dladdr(arr[i], &info);
- std::string functionName(symbols[i]);
-
- if (gotAddress != 0 && info.dli_sname != nullptr)
- {
- int32_t status;
- char* demangled = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, &status);
- const char* nameFound = info.dli_sname;
-
- if (status == 0)
- {
- nameFound = demangled;
- }
-
- functionName = StringHelper::Sprintf("%s (+0x%X)", nameFound,
- (char*)arr[i] - (char*)info.dli_saddr);
- free(demangled);
- }
-
- fprintf(stderr, "%-3zd %s\n", i, functionName.c_str());
- }
-
- fprintf(stderr, "\n");
-
- free(symbols);
- exit(1);
-}
-#elif defined(_MSC_VER)
-
-void printStack(CONTEXT* ctx)
-{
- BOOL result;
- HANDLE process;
- HANDLE thread;
- HMODULE hModule;
- ULONG frame;
- DWORD64 displacement;
- DWORD disp;
-
- srand(time(nullptr));
- auto easterIndex = rand() % crashEasterEgg.size();
-
- fprintf(stderr, "\n%s\n\n", crashEasterEgg[easterIndex]);
-
-#if defined(_M_AMD64)
- STACKFRAME64 stack;
- memset(&stack, 0, sizeof(STACKFRAME64));
-#else
- STACKFRAME stack;
- memset(&stack, 0, sizeof(STACKFRAME));
-#endif
-
- char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME + sizeof(TCHAR)];
- char module[512];
-
- PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
-
- CONTEXT ctx2;
- memcpy(&ctx2, ctx, sizeof(CONTEXT));
-
- process = GetCurrentProcess();
- thread = GetCurrentThread();
- SymInitialize(process, nullptr, TRUE);
-
- constexpr DWORD machineType =
-#if defined(_M_AMD64)
- IMAGE_FILE_MACHINE_AMD64;
-#else
- IMAGE_FILE_MACHINE_I386;
-#endif
-
- displacement = 0;
-
- for (frame = 0;; frame++)
- {
- result = StackWalk(machineType, process, thread, &stack, &ctx2, nullptr,
- SymFunctionTableAccess, SymGetModuleBase, nullptr);
- if (!result)
- {
- break;
- }
- symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
- symbol->MaxNameLen = MAX_SYM_NAME;
- SymFromAddr(process, (ULONG64)stack.AddrPC.Offset, &displacement, symbol);
-#if defined(_M_AMD64)
- IMAGEHLP_LINE64 line;
- line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
-#else
- IMAGEHLP_LINE line;
- line.SizeOfStruct = sizeof(IMAGEHLP_LINE);
-#endif
- if (SymGetLineFromAddr(process, stack.AddrPC.Offset, &disp, &line))
- {
- fprintf(stderr, "%u\t %s in %s: line: %lu: \n", frame, symbol->Name, line.FileName,
- line.LineNumber);
- }
-
- else
- {
- fprintf(stderr, "%u\tat % s\n", frame, symbol->Name);
- hModule = nullptr;
- GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
- GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
- (LPCTSTR)(stack.AddrPC.Offset), &hModule);
-
- if (hModule != nullptr)
- {
- GetModuleFileNameA(hModule, module, 512 - 1);
- }
- fprintf(stderr, "%u\tIn %s\n", frame, module);
- }
- }
-}
-
-LONG seh_filter(_EXCEPTION_POINTERS* ex)
-{
- fprintf(stderr, "EXCEPTION 0x%x occured\n", ex->ExceptionRecord->ExceptionCode);
- printStack(ex->ContextRecord);
- return EXCEPTION_EXECUTE_HANDLER;
-}
-#endif
-
-void CrashHandler_Init()
-{
-#if HAS_POSIX == 1
- signal(SIGSEGV, ErrorHandler);
- signal(SIGABRT, ErrorHandler);
-#elif defined(_MSC_VER)
- SetUnhandledExceptionFilter(seh_filter);
-#else
- HANDLE_WARNING(WarningType::Always,
- "tried to set error handler, but this ZAPD build lacks support for one", "");
-#endif
-}
diff --git a/tools/ZAPD/ZAPD/CrashHandler.h b/tools/ZAPD/ZAPD/CrashHandler.h
deleted file mode 100644
index 102778bec1..0000000000
--- a/tools/ZAPD/ZAPD/CrashHandler.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef CRASH_HANDLER_H
-#define CRASH_HANDLER_H
-
-void CrashHandler_Init();
-
-#endif
diff --git a/tools/ZAPD/ZAPD/Declaration.cpp b/tools/ZAPD/ZAPD/Declaration.cpp
deleted file mode 100644
index 30863803a2..0000000000
--- a/tools/ZAPD/ZAPD/Declaration.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-#include "Declaration.h"
-
-#include "Globals.h"
-#include "Utils/StringHelper.h"
-
-Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
- const std::string& nBody)
-{
- address = nAddress;
- alignment = nAlignment;
- size = nSize;
- declBody = nBody;
-}
-
-Declaration* Declaration::Create(offset_t declAddr, DeclarationAlignment declAlign, size_t declSize,
- const std::string& declType, const std::string& declName,
- const std::string& declBody)
-{
- Declaration* decl = new Declaration(declAddr, declAlign, declSize, declBody);
-
- decl->declType = declType;
- decl->declName = declName;
- decl->declBody = declBody;
-
- return decl;
-}
-
-Declaration* Declaration::CreateArray(offset_t declAddr, DeclarationAlignment declAlign,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& declBody,
- size_t declArrayItemCnt, bool isDeclExternal)
-{
- Declaration* decl = new Declaration(declAddr, declAlign, declSize, declBody);
-
- decl->declName = declName;
- decl->declType = declType;
- decl->arrayItemCnt = declArrayItemCnt;
- decl->isExternal = isDeclExternal;
- decl->isArray = true;
-
- return decl;
-}
-
-Declaration* Declaration::CreateArray(offset_t declAddr, DeclarationAlignment declAlign,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& declBody,
- const std::string& declArrayItemCntStr, bool isDeclExternal)
-{
- Declaration* decl = new Declaration(declAddr, declAlign, declSize, declBody);
-
- decl->declName = declName;
- decl->declType = declType;
- decl->arrayItemCntStr = declArrayItemCntStr;
- decl->isExternal = isDeclExternal;
- decl->isArray = true;
-
- return decl;
-}
-
-Declaration* Declaration::CreateInclude(offset_t declAddr, const std::string& includePath,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& defines)
-{
- Declaration* decl = new Declaration(declAddr, DeclarationAlignment::Align4, declSize, "");
- decl->includePath = includePath;
- decl->declType = declType;
- decl->declName = declName;
- decl->defines = defines;
-
- return decl;
-}
-
-Declaration* Declaration::CreatePlaceholder(offset_t declAddr, const std::string& declName)
-{
- Declaration* decl = new Declaration(declAddr, DeclarationAlignment::Align4, 0, "");
- decl->declName = declName;
- decl->isPlaceholder = true;
-
- return decl;
-}
-
-bool Declaration::IsStatic() const
-{
- switch (staticConf)
- {
- case StaticConfig::Off:
- return false;
-
- case StaticConfig::Global:
- return Globals::Instance->forceStatic;
-
- case StaticConfig::On:
- return true;
- }
-
- return false;
-}
-
-std::string Declaration::GetNormalDeclarationStr() const
-{
- std::string output;
-
- if (IsStatic())
- {
- output += "static ";
- }
-
- if (isArray)
- {
- bool includeArraySize = (IsStatic() || forceArrayCnt);
-
- if (includeArraySize)
- {
- if (arrayItemCntStr != "")
- output += StringHelper::Sprintf("%s %s[%s];\n", declType.c_str(), declName.c_str(),
- arrayItemCntStr.c_str());
- else
- output += StringHelper::Sprintf("%s %s[%i] = {\n", declType.c_str(),
- declName.c_str(), arrayItemCnt);
- }
- else
- {
- output += StringHelper::Sprintf("%s %s[] = {\n", declType.c_str(), declName.c_str());
- }
-
- output += declBody + "\n";
- }
- else
- {
- output += StringHelper::Sprintf("%s %s = { ", declType.c_str(), declName.c_str());
- output += declBody;
- }
-
- if (output.back() == '\n')
- output += "};";
- else
- output += " };";
-
- output += "\n";
-
- output += "\n";
-
- return output;
-}
-
-std::string Declaration::GetExternalDeclarationStr() const
-{
- std::string output;
-
- if (IsStatic())
- output += "static ";
-
- bool includeArraySize = (IsStatic() || forceArrayCnt);
-
- if (includeArraySize)
- {
- if (arrayItemCntStr != "")
- output += StringHelper::Sprintf("%s %s[%s] = ", declType.c_str(), declName.c_str(),
- arrayItemCntStr.c_str());
- else
- output += StringHelper::Sprintf("%s %s[%i] = ", declType.c_str(), declName.c_str(),
- arrayItemCnt);
- }
- else
- {
- output += StringHelper::Sprintf("%s %s[] = ", declType.c_str(), declName.c_str());
- }
-
- output += StringHelper::Sprintf("{\n#include \"%s\"\n};", includePath.c_str());
- output += "\n\n";
-
- return output;
-}
-
-std::string Declaration::GetExternStr() const
-{
- if (IsStatic() || declType == "" || isUnaccounted)
- {
- return "";
- }
-
- if (isArray)
- {
- if (arrayItemCntStr != "" && (IsStatic() || forceArrayCnt))
- {
- return StringHelper::Sprintf("extern %s %s[%s];\n", declType.c_str(), declName.c_str(),
- arrayItemCntStr.c_str());
- }
- else if (arrayItemCnt != 0 && (IsStatic() || forceArrayCnt))
- {
- return StringHelper::Sprintf("extern %s %s[%i];\n", declType.c_str(), declName.c_str(),
- arrayItemCnt);
- }
- else
- return StringHelper::Sprintf("extern %s %s[];\n", declType.c_str(), declName.c_str());
- }
-
- return StringHelper::Sprintf("extern %s %s;\n", declType.c_str(), declName.c_str());
-}
-
-std::string Declaration::GetDefinesStr() const
-{
- if (IsStatic() || (declType == ""))
- {
- return "";
- }
- return StringHelper::Sprintf("%s", defines.c_str());
-}
-
-std::string Declaration::GetStaticForwardDeclarationStr() const
-{
- if (!IsStatic() || isUnaccounted)
- return "";
-
- if (isArray)
- {
- if (arrayItemCntStr == "" && arrayItemCnt == 0)
- {
- // Forward declaring static arrays without specifying the size is not allowed.
- return "";
- }
-
- if (arrayItemCntStr != "")
- {
- return StringHelper::Sprintf("static %s %s[%s];\n", declType.c_str(), declName.c_str(),
- arrayItemCntStr.c_str());
- }
- else
- {
- return StringHelper::Sprintf("static %s %s[%i];\n", declType.c_str(), declName.c_str(),
- arrayItemCnt);
- }
- }
-
- return StringHelper::Sprintf("static %s %s;\n", declType.c_str(), declName.c_str());
-}
diff --git a/tools/ZAPD/ZAPD/Declaration.h b/tools/ZAPD/ZAPD/Declaration.h
deleted file mode 100644
index d079cb8dce..0000000000
--- a/tools/ZAPD/ZAPD/Declaration.h
+++ /dev/null
@@ -1,182 +0,0 @@
-#pragma once
-
-#include
-#include
-#include
-
-// TODO: should we drop the `_t` suffix because of UNIX compliance?
-typedef uint32_t segptr_t;
-typedef uint32_t offset_t;
-
-#define SEGMENTED_NULL ((segptr_t)0)
-
-enum class DeclarationAlignment
-{
- Align4,
- Align8
-};
-
-enum class StaticConfig
-{
- Off,
- Global,
- On
-};
-
-///
-/// A declaration is contains the C contents of a symbol for a file.
-/// It contains at a minimum the address where the symbol would be in the binary file, alignment
-/// settings, the size of the binary data, and the C code that makes it up. Optionally it can also
-/// contain comments.
-///
-class Declaration
-{
-public:
- // Where in the binary file (segment) will this C code end up being?
- offset_t address = 0;
-
- // How is this C code aligned?
- DeclarationAlignment alignment = DeclarationAlignment::Align4;
-
- // How many bytes will this C code take up in the resulting binary when compiled?
- size_t size = 0;
-
- // The C type of this declaration
- std::string declType = "";
-
- // The C variable name of this declaration
- std::string declName = "";
-
- // The body of the declaration containing the data.
- // In "int j = 7;", "7" would be text.
- std::string declBody = "";
-
- // #define's to be included in the header
- std::string defines = "";
-
- std::string includePath = "";
-
- // Is this declaration in an external file? (ie. a gameplay_keep reference being found in
- // another file that wishes to use its data)
- bool isExternal = false;
-
- bool isArray = false;
-
- // If true, will ensure that the arrays size is included in the declaration
- bool forceArrayCnt = false;
-
- // If this declaration is an array, how many items make it up?
- size_t arrayItemCnt = 0;
-
- // Overrides the brackets for the arrays size with a custom string
- std::string arrayItemCntStr = "";
-
- std::vector references;
-
- // If true, this declaration represents data inside the file which we do not understand it's
- // purpose for. It will be outputted as just a byte array.
- bool isUnaccounted = false;
-
- // Is this declaration a placeholder that will be replaced later?
- bool isPlaceholder = false;
-
- // Does this declaration come straight from the XML?
- // If false, this means that the declaration was created by ZAPD when it was parsing the
- // resources.
- bool declaredInXml = false;
-
- StaticConfig staticConf = StaticConfig::Global;
-
- ///
- /// Creates a regular declaration.
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The alignment of this declaration in the compiled
- /// binary file. The size of this declaration when it is compiled
- /// to binary data. The C variable type this declaration will be
- /// declared as. The C variable name this declaration will be
- /// declared as. The contents of the C variable
- /// declaration.
- static Declaration* Create(offset_t declAddr, DeclarationAlignment declAlign, size_t declSize,
- const std::string& declType, const std::string& declName,
- const std::string& declBody);
-
- ///
- /// Creates an array declaration.
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The alignment of this declaration in the compiled
- /// binary file. The size of this declaration when it is compiled
- /// to binary data. The C variable type this declaration will be
- /// declared as. The C variable name this declaration will be
- /// declared as. The contents of the C variable
- /// declaration. The number of items in the
- /// array. (Optional) Is this declaration from another
- /// segment?
- static Declaration* CreateArray(offset_t declAddr, DeclarationAlignment declAlign,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& declBody,
- size_t declArrayItemCnt = 0, bool isDeclExternal = false);
-
- ///
- /// Creates an array declaration who's size in the C code uses a custom string.
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The alignment of this declaration in the compiled
- /// binary file. The size of this declaration when it is compiled
- /// to binary data. The C variable type this declaration will be
- /// declared as. The C variable name this declaration will be
- /// declared as. The contents of the C variable
- /// declaration. The string to be put in the C array's
- /// size inbetween the brackets. (Optional) Is this
- /// declaration from another segment?
- static Declaration* CreateArray(offset_t declAddr, DeclarationAlignment declAlign,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& declBody,
- const std::string& declArrayItemCntStr,
- bool isDeclExternal = false);
-
- ///
- /// Creates a declaration who's body uses a #include to include another file
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The path to the file this declaration will be
- /// #including. The size of this declaration when it is compiled
- /// to binary data. The C variable type this declaration will be
- /// declared as. The C variable name this declaration will be
- /// declared as. (Optional) Any #define's we want to have
- /// outputted by this declaration.
- static Declaration* CreateInclude(offset_t declAddr, const std::string& includePath,
- size_t declSize, const std::string& declType,
- const std::string& declName, const std::string& defines = "");
-
- ///
- /// Creates a placeholder declaration to be replaced later.
- ///
- /// The address inside a binary file this declaration will be in when
- /// compiled. The C variable name this declaration will be
- /// declared as.
- static Declaration* CreatePlaceholder(offset_t declAddr, const std::string& declName);
-
- bool IsStatic() const;
-
- // Returns the declaration as C code as it would be in the code file when the body contains the
- // needed data
- std::string GetNormalDeclarationStr() const;
-
- // Returns the declaration as C code as it would be in the code file when the body #include's
- // another file
- std::string GetExternalDeclarationStr() const;
-
- // Generates the extern for this item to be placed in header files.
- std::string GetExternStr() const;
-
- // Generates any #define's needed
- std::string GetDefinesStr() const;
-
- std::string GetStaticForwardDeclarationStr() const;
-
-protected:
- Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
- const std::string& nBody);
-};
diff --git a/tools/ZAPD/ZAPD/ExporterSet.h b/tools/ZAPD/ZAPD/ExporterSet.h
deleted file mode 100644
index c4dd93445a..0000000000
--- a/tools/ZAPD/ZAPD/ExporterSet.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-typedef void (*ExporterSetFunc)(ZFile*);
-typedef bool (*ExporterSetFuncBool)(ZFileMode fileMode);
-typedef void (*ExporterSetFuncVoid)(int argc, char* argv[], int& i);
-typedef void (*ExporterSetFuncVoid2)(const std::string& buildMode, ZFileMode& fileMode);
-typedef void (*ExporterSetFuncVoid3)();
-typedef void (*ExporterSetResSave)(ZResource* res, BinaryWriter& writer);
-
-class ExporterSet
-{
-public:
- ~ExporterSet();
-
- std::map exporters;
- ExporterSetFuncVoid parseArgsFunc = nullptr;
- ExporterSetFuncVoid2 parseFileModeFunc = nullptr;
- ExporterSetFuncBool processFileModeFunc = nullptr;
- ExporterSetFunc beginFileFunc = nullptr;
- ExporterSetFunc endFileFunc = nullptr;
- ExporterSetFuncVoid3 beginXMLFunc = nullptr;
- ExporterSetFuncVoid3 endXMLFunc = nullptr;
- ExporterSetResSave resSaveFunc = nullptr;
-};
\ No newline at end of file
diff --git a/tools/ZAPD/ZAPD/GameConfig.cpp b/tools/ZAPD/ZAPD/GameConfig.cpp
deleted file mode 100644
index 2140464ec6..0000000000
--- a/tools/ZAPD/ZAPD/GameConfig.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-#include "GameConfig.h"
-
-#include
-#include
-#include
-
-#include "Utils/Directory.h"
-#include "Utils/File.h"
-#include "Utils/Path.h"
-#include "ZFile.h"
-#include "tinyxml2.h"
-
-using ConfigFunc = void (GameConfig::*)(const tinyxml2::XMLElement&);
-
-GameConfig::~GameConfig()
-{
- for (auto& declPair : segmentRefFiles)
- {
- for (auto& file : declPair.second)
- {
- delete file;
- }
- }
-}
-
-void GameConfig::ReadTexturePool(const fs::path& texturePoolXmlPath)
-{
- tinyxml2::XMLDocument doc;
- tinyxml2::XMLError eResult = doc.LoadFile(texturePoolXmlPath.string().c_str());
-
- if (eResult != tinyxml2::XML_SUCCESS)
- {
- fprintf(stderr, "Warning: Unable to read texture pool XML with error code %i\n", eResult);
- return;
- }
-
- tinyxml2::XMLNode* root = doc.FirstChild();
-
- if (root == nullptr)
- return;
-
- for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != nullptr;
- child = child->NextSiblingElement())
- {
- if (std::string_view(child->Name()) == "Texture")
- {
- std::string crcStr = child->Attribute("CRC");
- fs::path texPath = child->Attribute("Path");
- std::string texName;
-
- uint32_t crc = strtoul(crcStr.c_str(), nullptr, 16);
-
- texturePool[crc].path = texPath;
- }
- }
-}
-
-void GameConfig::GenSymbolMap(const fs::path& symbolMapPath)
-{
- auto symbolLines = File::ReadAllLines(symbolMapPath);
-
- for (std::string& symbolLine : symbolLines)
- {
- auto split = StringHelper::Split(symbolLine, " ");
- uint32_t addr = strtoul(split[0].c_str(), nullptr, 16);
- std::string symbolName = split[1];
-
- symbolMap[addr] = std::move(symbolName);
- }
-}
-
-void GameConfig::ConfigFunc_SymbolMap(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- GenSymbolMap(Path::GetDirectoryName(configFilePath) / fileName);
-}
-
-void GameConfig::ConfigFunc_ActorList(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- std::vector lines =
- File::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
-
- for (auto& line : lines)
- actorList.emplace_back(std::move(line));
-}
-
-void GameConfig::ConfigFunc_ObjectList(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- std::vector lines =
- File::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
-
- for (auto& line : lines)
- objectList.emplace_back(std::move(line));
-}
-
-void GameConfig::ConfigFunc_EntranceList(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- std::vector lines =
- File::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
-
- for (auto& line : lines)
- entranceList.emplace_back(std::move(line));
-}
-
-void GameConfig::ConfigFunc_specialEntranceList(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- std::vector lines =
- File::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
-
- for (auto& line : lines)
- specialEntranceList.emplace_back(std::move(line));
-}
-
-void GameConfig::ConfigFunc_TexturePool(const tinyxml2::XMLElement& element)
-{
- std::string fileName = element.Attribute("File");
- ReadTexturePool(Path::GetDirectoryName(configFilePath) / fileName);
-}
-
-void GameConfig::ConfigFunc_BGConfig(const tinyxml2::XMLElement& element)
-{
- bgScreenWidth = element.IntAttribute("ScreenWidth", 320);
- bgScreenHeight = element.IntAttribute("ScreenHeight", 240);
- useScreenWidthHeightConstants = element.BoolAttribute("UseScreenWidthHeightConstants", true);
-}
-
-void GameConfig::ConfigFunc_ExternalXMLFolder(const tinyxml2::XMLElement& element)
-{
- const char* pathValue = element.Attribute("Path");
- if (pathValue == nullptr)
- {
- throw std::runtime_error(
- StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
- "\t Missing 'Path' attribute in `ExternalXMLFolder` element.\n"));
- }
- if (externalXmlFolder != "")
- {
- throw std::runtime_error(StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
- "\t `ExternalXMLFolder` is duplicated.\n"));
- }
- externalXmlFolder = pathValue;
-}
-
-void GameConfig::ConfigFunc_ExternalFile(const tinyxml2::XMLElement& element)
-{
- const char* xmlPathValue = element.Attribute("XmlPath");
- if (xmlPathValue == nullptr)
- {
- throw std::runtime_error(
- StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
- "\t Missing 'XmlPath' attribute in `ExternalFile` element.\n"));
- }
- const char* outPathValue = element.Attribute("OutPath");
- if (outPathValue == nullptr)
- {
- throw std::runtime_error(
- StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
- "\t Missing 'OutPath' attribute in `ExternalFile` element.\n"));
- }
-
- externalFiles.push_back(ExternalFile(fs::path(xmlPathValue), fs::path(outPathValue)));
-}
-
-void GameConfig::ConfigFunc_EnumData(const tinyxml2::XMLElement& element)
-{
- std::string path = Path::GetDirectoryName(configFilePath).string();
- path = path.append("/").append(element.Attribute("File"));
- tinyxml2::XMLDocument doc;
- tinyxml2::XMLError eResult = doc.LoadFile(path.c_str());
-
- if (eResult != tinyxml2::XML_SUCCESS)
- {
- throw std::runtime_error("Error: Unable to read enum data.");
- }
-
- tinyxml2::XMLNode* root = doc.FirstChild();
-
- if (root == nullptr)
- return;
-
- for (tinyxml2::XMLElement* csEnum = root->FirstChildElement(); csEnum != nullptr;
- csEnum = csEnum->NextSiblingElement())
- {
- for (tinyxml2::XMLElement* item = csEnum->FirstChildElement(); item != nullptr;
- item = item->NextSiblingElement())
- {
- std::string enumKey = csEnum->Attribute("Key");
- uint16_t itemIndex = atoi(item->Attribute("Index"));
- const char* itemID = item->Attribute("ID");
-
- // Common
- if (enumKey == "cmd")
- enumData.cutsceneCmd[itemIndex] = itemID;
-
- else if (enumKey == "miscType")
- enumData.miscType[itemIndex] = itemID;
-
- else if (enumKey == "textType")
- enumData.textType[itemIndex] = itemID;
-
- else if (enumKey == "fadeOutSeqPlayer")
- enumData.fadeOutSeqPlayer[itemIndex] = itemID;
-
- else if (enumKey == "transitionType")
- enumData.transitionType[itemIndex] = itemID;
-
- else if (enumKey == "destination")
- enumData.destination[itemIndex] = itemID;
-
- else if (enumKey == "naviQuestHintType")
- enumData.naviQuestHintType[itemIndex] = itemID;
-
- else if (enumKey == "ocarinaSongActionId")
- enumData.ocarinaSongActionId[itemIndex] = itemID;
-
- else if (enumKey == "seqId")
- enumData.seqId[itemIndex] = itemID;
-
- else if (enumKey == "playerCueId")
- enumData.playerCueId[itemIndex] = itemID;
-
- // MM
- else if (enumKey == "modifySeqType")
- enumData.modifySeqType[itemIndex] = itemID;
-
- else if (enumKey == "chooseCreditsSceneType")
- enumData.chooseCreditsSceneType[itemIndex] = itemID;
-
- else if (enumKey == "destinationType")
- enumData.destinationType[itemIndex] = itemID;
-
- else if (enumKey == "motionBlurType")
- enumData.motionBlurType[itemIndex] = itemID;
-
- else if (enumKey == "transitionGeneralType")
- enumData.transitionGeneralType[itemIndex] = itemID;
-
- else if (enumKey == "rumbleType")
- enumData.rumbleType[itemIndex] = itemID;
-
- else if (enumKey == "spawnFlag")
- enumData.spawnFlag[itemIndex] = itemID;
-
- else if (enumKey == "endSfx")
- enumData.endSfx[itemIndex] = itemID;
-
- else if (enumKey == "csSplineInterpType")
- enumData.interpType[itemIndex] = itemID;
-
- else if (enumKey == "csSplineRelTo")
- enumData.relTo[itemIndex] = itemID;
- }
- }
-}
-
-void GameConfig::ReadConfigFile(const fs::path& argConfigFilePath)
-{
- static const std::unordered_map ConfigFuncDictionary = {
- {"SymbolMap", &GameConfig::ConfigFunc_SymbolMap},
- {"ActorList", &GameConfig::ConfigFunc_ActorList},
- {"ObjectList", &GameConfig::ConfigFunc_ObjectList},
- {"EntranceList", &GameConfig::ConfigFunc_EntranceList},
- {"SpecialEntranceList", &GameConfig::ConfigFunc_specialEntranceList},
- {"TexturePool", &GameConfig::ConfigFunc_TexturePool},
- {"BGConfig", &GameConfig::ConfigFunc_BGConfig},
- {"EnumData", &GameConfig::ConfigFunc_EnumData},
- {"ExternalXMLFolder", &GameConfig::ConfigFunc_ExternalXMLFolder},
- {"ExternalFile", &GameConfig::ConfigFunc_ExternalFile},
- };
-
- configFilePath = argConfigFilePath.string();
- tinyxml2::XMLDocument doc;
- tinyxml2::XMLError eResult = doc.LoadFile(configFilePath.c_str());
-
- if (eResult != tinyxml2::XML_SUCCESS)
- {
- throw std::runtime_error("Error: Unable to read config file.");
- }
-
- tinyxml2::XMLNode* root = doc.FirstChild();
-
- if (root == nullptr)
- return;
-
- for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != nullptr;
- child = child->NextSiblingElement())
- {
- auto it = ConfigFuncDictionary.find(child->Name());
- if (it == ConfigFuncDictionary.end())
- {
- fprintf(stderr, "Unsupported configuration variable: %s\n", child->Name());
- continue;
- }
-
- std::invoke(it->second, *this, *child);
- }
-}
diff --git a/tools/ZAPD/ZAPD/GameConfig.h b/tools/ZAPD/ZAPD/GameConfig.h
deleted file mode 100644
index 4f3b91f8c7..0000000000
--- a/tools/ZAPD/ZAPD/GameConfig.h
+++ /dev/null
@@ -1,97 +0,0 @@
-#pragma once
-
-#include
-#include