diff --git a/Makefile b/Makefile
index e08d983c8c..df9ceaa04f 100644
--- a/Makefile
+++ b/Makefile
@@ -173,14 +173,12 @@ SRC_DIRS := $(shell find src -type d)
ASM_DIRS := $(shell find asm -type d -not -path "asm/non_matchings*") $(shell find data -type d)
## Assets binaries (PNGs, JPGs, etc)
-ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*")
+ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*" -not -path "assets/c/*" -not -name "c")
# Prevents building C files that will be #include'd
ASSET_BIN_DIRS_C_FILES := $(shell find assets/* -type d -not -path "assets/xml*" -not -path "assets/code*" -not -path "assets/overlays*")
-ASSET_FILES_XML := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.xml))
ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin))
-ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \
- $(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f)
+ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f)
TEXTURE_FILES_PNG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.png))
TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg))
@@ -204,7 +202,7 @@ OVL_RELOC_FILES := $(shell $(CPP) $(CPPFLAGS) $(SPEC) | grep -o '[^"]*_reloc.o'
DEP_FILES := $(O_FILES:.o=.asmproc.d) $(OVL_RELOC_FILES:.o=.d)
# create build directories
-$(shell mkdir -p build/baserom $(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(ASSET_BIN_DIRS),build/$(dir)))
+$(shell mkdir -p build/baserom $(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(ASSET_BIN_DIRS) $(ASSET_BIN_DIRS_C_FILES),build/$(dir)))
# directory flags
build/src/boot/O2/%.o: OPTFLAGS := -O2
@@ -353,7 +351,7 @@ build/assets/%.o: assets/%.c
$(OBJCOPY_BIN)
$(RM_MDEBUG)
-build/assets/archives/%.yar.o: build/assets/archives/%.o
+build/%.yar.o: build/%.o
$(MAKEYAR) $< $(@:.yar.o=.yar.bin) $(@:.yar.o=.symbols.o)
$(OBJCOPY) -I binary -O elf32-big $(@:.yar.o=.yar.bin) $@
diff --git a/assets/c/.gitignore b/assets/c/.gitignore
new file mode 100644
index 0000000000..66dbd2b82e
--- /dev/null
+++ b/assets/c/.gitignore
@@ -0,0 +1,2 @@
+!*.c
+!*.h
diff --git a/assets/c/archives/map_grand_static/map_grand_static.c b/assets/c/archives/map_grand_static/map_grand_static.c
new file mode 100644
index 0000000000..582d37e682
--- /dev/null
+++ b/assets/c/archives/map_grand_static/map_grand_static.c
@@ -0,0 +1,394 @@
+#include "map_grand_static.h"
+
+u64 gMapGrandStatic100Tex[] = {
+#include "assets/archives/map_grand_static/map_100.i4.inc.c"
+};
+
+u64 gMapGrandStatic101Tex[] = {
+#include "assets/archives/map_grand_static/map_101.i4.inc.c"
+};
+
+u64 gMapGrandStatic102Tex[] = {
+#include "assets/archives/map_grand_static/map_102.i4.inc.c"
+};
+
+u64 gMapGrandStatic103Tex[] = {
+#include "assets/archives/map_grand_static/map_103.i4.inc.c"
+};
+
+u64 gMapGrandStatic104Tex[] = {
+#include "assets/archives/map_grand_static/map_104.i4.inc.c"
+};
+
+u64 gMapGrandStatic105Tex[] = {
+#include "assets/archives/map_grand_static/map_105.i4.inc.c"
+};
+
+u64 gMapGrandStatic106Tex[] = {
+#include "assets/archives/map_grand_static/map_106.i4.inc.c"
+};
+
+u64 gMapGrandStatic107Tex[] = {
+#include "assets/archives/map_grand_static/map_107.i4.inc.c"
+};
+
+u64 gMapGrandStatic108Tex[] = {
+#include "assets/archives/map_grand_static/map_108.i4.inc.c"
+};
+
+u64 gMapGrandStatic109Tex[] = {
+#include "assets/archives/map_grand_static/map_109.i4.inc.c"
+};
+
+u64 gMapGrandStatic10ATex[] = {
+#include "assets/archives/map_grand_static/map_10A.i4.inc.c"
+};
+
+u64 gMapGrandStatic10BTex[] = {
+#include "assets/archives/map_grand_static/map_10B.i4.inc.c"
+};
+
+u64 gMapGrandStatic10CTex[] = {
+#include "assets/archives/map_grand_static/map_10C.i4.inc.c"
+};
+
+u64 gMapGrandStatic10DTex[] = {
+#include "assets/archives/map_grand_static/map_10D.i4.inc.c"
+};
+
+u64 gMapGrandStatic10ETex[] = {
+#include "assets/archives/map_grand_static/map_10E.i4.inc.c"
+};
+
+u64 gMapGrandStatic10FTex[] = {
+#include "assets/archives/map_grand_static/map_10F.i4.inc.c"
+};
+
+u64 gMapGrandStatic110Tex[] = {
+#include "assets/archives/map_grand_static/map_110.i4.inc.c"
+};
+
+u64 gMapGrandStatic111Tex[] = {
+#include "assets/archives/map_grand_static/map_111.i4.inc.c"
+};
+
+u64 gMapGrandStatic112Tex[] = {
+#include "assets/archives/map_grand_static/map_112.i4.inc.c"
+};
+
+u64 gMapGrandStatic113Tex[] = {
+#include "assets/archives/map_grand_static/map_113.i4.inc.c"
+};
+
+u64 gMapGrandStatic114Tex[] = {
+#include "assets/archives/map_grand_static/map_114.i4.inc.c"
+};
+
+u64 gMapGrandStatic115Tex[] = {
+#include "assets/archives/map_grand_static/map_115.i4.inc.c"
+};
+
+u64 gMapGrandStatic116Tex[] = {
+#include "assets/archives/map_grand_static/map_116.i4.inc.c"
+};
+
+u64 gMapGrandStatic117Tex[] = {
+#include "assets/archives/map_grand_static/map_117.i4.inc.c"
+};
+
+u64 gMapGrandStatic118Tex[] = {
+#include "assets/archives/map_grand_static/map_118.i4.inc.c"
+};
+
+u64 gMapGrandStatic119Tex[] = {
+#include "assets/archives/map_grand_static/map_119.i4.inc.c"
+};
+
+u64 gMapGrandStatic11ATex[] = {
+#include "assets/archives/map_grand_static/map_11A.i4.inc.c"
+};
+
+u64 gMapGrandStatic11BTex[] = {
+#include "assets/archives/map_grand_static/map_11B.i4.inc.c"
+};
+
+u64 gMapGrandStatic11CTex[] = {
+#include "assets/archives/map_grand_static/map_11C.i4.inc.c"
+};
+
+u64 gMapGrandStatic11DTex[] = {
+#include "assets/archives/map_grand_static/map_11D.i4.inc.c"
+};
+
+u64 gMapGrandStatic11ETex[] = {
+#include "assets/archives/map_grand_static/map_11E.i4.inc.c"
+};
+
+u64 gMapGrandStatic11FTex[] = {
+#include "assets/archives/map_grand_static/map_11F.i4.inc.c"
+};
+
+u64 gMapGrandStatic120Tex[] = {
+#include "assets/archives/map_grand_static/map_120.i4.inc.c"
+};
+
+u64 gMapGrandStatic121Tex[] = {
+#include "assets/archives/map_grand_static/map_121.i4.inc.c"
+};
+
+u64 gMapGrandStatic122Tex[] = {
+#include "assets/archives/map_grand_static/map_122.i4.inc.c"
+};
+
+u64 gMapGrandStatic123Tex[] = {
+#include "assets/archives/map_grand_static/map_123.i4.inc.c"
+};
+
+u64 gMapGrandStatic124Tex[] = {
+#include "assets/archives/map_grand_static/map_124.i4.inc.c"
+};
+
+u64 gMapGrandStatic125Tex[] = {
+#include "assets/archives/map_grand_static/map_125.i4.inc.c"
+};
+
+u64 gMapGrandStatic126Tex[] = {
+#include "assets/archives/map_grand_static/map_126.i4.inc.c"
+};
+
+u64 gMapGrandStatic127Tex[] = {
+#include "assets/archives/map_grand_static/map_127.i4.inc.c"
+};
+
+u64 gMapGrandStatic128Tex[] = {
+#include "assets/archives/map_grand_static/map_128.i4.inc.c"
+};
+
+u64 gMapGrandStatic129Tex[] = {
+#include "assets/archives/map_grand_static/map_129.i4.inc.c"
+};
+
+u64 gMapGrandStatic12ATex[] = {
+#include "assets/archives/map_grand_static/map_12A.i4.inc.c"
+};
+
+u64 gMapGrandStatic12BTex[] = {
+#include "assets/archives/map_grand_static/map_12B.i4.inc.c"
+};
+
+u64 gMapGrandStatic12CTex[] = {
+#include "assets/archives/map_grand_static/map_12C.i4.inc.c"
+};
+
+u64 gMapGrandStatic12DTex[] = {
+#include "assets/archives/map_grand_static/map_12D.i4.inc.c"
+};
+
+u64 gMapGrandStatic12ETex[] = {
+#include "assets/archives/map_grand_static/map_12E.i4.inc.c"
+};
+
+u64 gMapGrandStatic12FTex[] = {
+#include "assets/archives/map_grand_static/map_12F.i4.inc.c"
+};
+
+u64 gMapGrandStatic130Tex[] = {
+#include "assets/archives/map_grand_static/map_130.i4.inc.c"
+};
+
+u64 gMapGrandStatic131Tex[] = {
+#include "assets/archives/map_grand_static/map_131.i4.inc.c"
+};
+
+u64 gMapGrandStatic132Tex[] = {
+#include "assets/archives/map_grand_static/map_132.i4.inc.c"
+};
+
+u64 gMapGrandStatic133Tex[] = {
+#include "assets/archives/map_grand_static/map_133.i4.inc.c"
+};
+
+u64 gMapGrandStatic134Tex[] = {
+#include "assets/archives/map_grand_static/map_134.i4.inc.c"
+};
+
+u64 gMapGrandStatic135Tex[] = {
+#include "assets/archives/map_grand_static/map_135.i4.inc.c"
+};
+
+u64 gMapGrandStatic136Tex[] = {
+#include "assets/archives/map_grand_static/map_136.i4.inc.c"
+};
+
+u64 gMapGrandStatic137Tex[] = {
+#include "assets/archives/map_grand_static/map_137.i4.inc.c"
+};
+
+u64 gMapGrandStatic138Tex[] = {
+#include "assets/archives/map_grand_static/map_138.i4.inc.c"
+};
+
+u64 gMapGrandStatic139Tex[] = {
+#include "assets/archives/map_grand_static/map_139.i4.inc.c"
+};
+
+u64 gMapGrandStatic13ATex[] = {
+#include "assets/archives/map_grand_static/map_13A.i4.inc.c"
+};
+
+u64 gMapGrandStatic13BTex[] = {
+#include "assets/archives/map_grand_static/map_13B.i4.inc.c"
+};
+
+u64 gMapGrandStatic13CTex[] = {
+#include "assets/archives/map_grand_static/map_13C.i4.inc.c"
+};
+
+u64 gMapGrandStatic13DTex[] = {
+#include "assets/archives/map_grand_static/map_13D.i4.inc.c"
+};
+
+u64 gMapGrandStatic13ETex[] = {
+#include "assets/archives/map_grand_static/map_13E.i4.inc.c"
+};
+
+u64 gMapGrandStatic13FTex[] = {
+#include "assets/archives/map_grand_static/map_13F.i4.inc.c"
+};
+
+u64 gMapGrandStatic140Tex[] = {
+#include "assets/archives/map_grand_static/map_140.i4.inc.c"
+};
+
+u64 gMapGrandStatic141Tex[] = {
+#include "assets/archives/map_grand_static/map_141.i4.inc.c"
+};
+
+u64 gMapGrandStatic142Tex[] = {
+#include "assets/archives/map_grand_static/map_142.i4.inc.c"
+};
+
+u64 gMapGrandStatic143Tex[] = {
+#include "assets/archives/map_grand_static/map_143.i4.inc.c"
+};
+
+u64 gMapGrandStatic144Tex[] = {
+#include "assets/archives/map_grand_static/map_144.i4.inc.c"
+};
+
+u64 gMapGrandStatic145Tex[] = {
+#include "assets/archives/map_grand_static/map_145.i4.inc.c"
+};
+
+u64 gMapGrandStatic146Tex[] = {
+#include "assets/archives/map_grand_static/map_146.i4.inc.c"
+};
+
+u64 gMapGrandStatic147Tex[] = {
+#include "assets/archives/map_grand_static/map_147.i4.inc.c"
+};
+
+u64 gMapGrandStatic148Tex[] = {
+#include "assets/archives/map_grand_static/map_148.i4.inc.c"
+};
+
+u64 gMapGrandStatic149Tex[] = {
+#include "assets/archives/map_grand_static/map_149.i4.inc.c"
+};
+
+u64 gMapGrandStatic14ATex[] = {
+#include "assets/archives/map_grand_static/map_14A.i4.inc.c"
+};
+
+u64 gMapGrandStatic14BTex[] = {
+#include "assets/archives/map_grand_static/map_14B.i4.inc.c"
+};
+
+u64 gMapGrandStatic14CTex[] = {
+#include "assets/archives/map_grand_static/map_14C.i4.inc.c"
+};
+
+u64 gMapGrandStatic14DTex[] = {
+#include "assets/archives/map_grand_static/map_14D.i4.inc.c"
+};
+
+u64 gMapGrandStatic14ETex[] = {
+#include "assets/archives/map_grand_static/map_14E.i4.inc.c"
+};
+
+u64 gMapGrandStatic14FTex[] = {
+#include "assets/archives/map_grand_static/map_14F.i4.inc.c"
+};
+
+u64 gMapGrandStatic150Tex[] = {
+#include "assets/archives/map_grand_static/map_150.i4.inc.c"
+};
+
+u64 gMapGrandStatic151Tex[] = {
+#include "assets/archives/map_grand_static/map_151.i4.inc.c"
+};
+
+u64 gMapGrandStatic152Tex[] = {
+#include "assets/archives/map_grand_static/map_152.i4.inc.c"
+};
+
+u64 gMapGrandStatic153Tex[] = {
+#include "assets/archives/map_grand_static/map_153.i4.inc.c"
+};
+
+u64 gMapGrandStatic154Tex[] = {
+#include "assets/archives/map_grand_static/map_154.i4.inc.c"
+};
+
+u64 gMapGrandStatic155Tex[] = {
+#include "assets/archives/map_grand_static/map_155.i4.inc.c"
+};
+
+u64 gMapGrandStatic156Tex[] = {
+#include "assets/archives/map_grand_static/map_156.i4.inc.c"
+};
+
+u64 gMapGrandStatic157Tex[] = {
+#include "assets/archives/map_grand_static/map_157.i4.inc.c"
+};
+
+u64 gMapGrandStatic158Tex[] = {
+#include "assets/archives/map_grand_static/map_158.i4.inc.c"
+};
+
+u64 gMapGrandStatic159Tex[] = {
+#include "assets/archives/map_grand_static/map_159.i4.inc.c"
+};
+
+u64 gMapGrandStatic15ATex[] = {
+#include "assets/archives/map_grand_static/map_15A.i4.inc.c"
+};
+
+u64 gMapGrandStatic15BTex[] = {
+#include "assets/archives/map_grand_static/map_15B.i4.inc.c"
+};
+
+u64 gMapGrandStatic15CTex[] = {
+#include "assets/archives/map_grand_static/map_15C.i4.inc.c"
+};
+
+u64 gMapGrandStatic15DTex[] = {
+#include "assets/archives/map_grand_static/map_15D.i4.inc.c"
+};
+
+u64 gMapGrandStatic15ETex[] = {
+#include "assets/archives/map_grand_static/map_15E.i4.inc.c"
+};
+
+u64 gMapGrandStatic15FTex[] = {
+#include "assets/archives/map_grand_static/map_15F.i4.inc.c"
+};
+
+u64 gMapGrandStatic160Tex[] = {
+#include "assets/archives/map_grand_static/map_160.i4.inc.c"
+};
+
+u64 gMapGrandStatic161Tex[] = {
+#include "assets/archives/map_grand_static/map_161.i4.inc.c"
+};
+
diff --git a/assets/c/archives/map_grand_static/map_grand_static.h b/assets/c/archives/map_grand_static/map_grand_static.h
new file mode 100644
index 0000000000..a940d4d422
--- /dev/null
+++ b/assets/c/archives/map_grand_static/map_grand_static.h
@@ -0,0 +1,105 @@
+#ifndef MAP_GRAND_STATIC_H
+#define MAP_GRAND_STATIC_H 1
+
+#include "ultra64.h"
+
+extern u64 gMapGrandStatic100Tex[];
+extern u64 gMapGrandStatic101Tex[];
+extern u64 gMapGrandStatic102Tex[];
+extern u64 gMapGrandStatic103Tex[];
+extern u64 gMapGrandStatic104Tex[];
+extern u64 gMapGrandStatic105Tex[];
+extern u64 gMapGrandStatic106Tex[];
+extern u64 gMapGrandStatic107Tex[];
+extern u64 gMapGrandStatic108Tex[];
+extern u64 gMapGrandStatic109Tex[];
+extern u64 gMapGrandStatic10ATex[];
+extern u64 gMapGrandStatic10BTex[];
+extern u64 gMapGrandStatic10CTex[];
+extern u64 gMapGrandStatic10DTex[];
+extern u64 gMapGrandStatic10ETex[];
+extern u64 gMapGrandStatic10FTex[];
+extern u64 gMapGrandStatic110Tex[];
+extern u64 gMapGrandStatic111Tex[];
+extern u64 gMapGrandStatic112Tex[];
+extern u64 gMapGrandStatic113Tex[];
+extern u64 gMapGrandStatic114Tex[];
+extern u64 gMapGrandStatic115Tex[];
+extern u64 gMapGrandStatic116Tex[];
+extern u64 gMapGrandStatic117Tex[];
+extern u64 gMapGrandStatic118Tex[];
+extern u64 gMapGrandStatic119Tex[];
+extern u64 gMapGrandStatic11ATex[];
+extern u64 gMapGrandStatic11BTex[];
+extern u64 gMapGrandStatic11CTex[];
+extern u64 gMapGrandStatic11DTex[];
+extern u64 gMapGrandStatic11ETex[];
+extern u64 gMapGrandStatic11FTex[];
+extern u64 gMapGrandStatic120Tex[];
+extern u64 gMapGrandStatic121Tex[];
+extern u64 gMapGrandStatic122Tex[];
+extern u64 gMapGrandStatic123Tex[];
+extern u64 gMapGrandStatic124Tex[];
+extern u64 gMapGrandStatic125Tex[];
+extern u64 gMapGrandStatic126Tex[];
+extern u64 gMapGrandStatic127Tex[];
+extern u64 gMapGrandStatic128Tex[];
+extern u64 gMapGrandStatic129Tex[];
+extern u64 gMapGrandStatic12ATex[];
+extern u64 gMapGrandStatic12BTex[];
+extern u64 gMapGrandStatic12CTex[];
+extern u64 gMapGrandStatic12DTex[];
+extern u64 gMapGrandStatic12ETex[];
+extern u64 gMapGrandStatic12FTex[];
+extern u64 gMapGrandStatic130Tex[];
+extern u64 gMapGrandStatic131Tex[];
+extern u64 gMapGrandStatic132Tex[];
+extern u64 gMapGrandStatic133Tex[];
+extern u64 gMapGrandStatic134Tex[];
+extern u64 gMapGrandStatic135Tex[];
+extern u64 gMapGrandStatic136Tex[];
+extern u64 gMapGrandStatic137Tex[];
+extern u64 gMapGrandStatic138Tex[];
+extern u64 gMapGrandStatic139Tex[];
+extern u64 gMapGrandStatic13ATex[];
+extern u64 gMapGrandStatic13BTex[];
+extern u64 gMapGrandStatic13CTex[];
+extern u64 gMapGrandStatic13DTex[];
+extern u64 gMapGrandStatic13ETex[];
+extern u64 gMapGrandStatic13FTex[];
+extern u64 gMapGrandStatic140Tex[];
+extern u64 gMapGrandStatic141Tex[];
+extern u64 gMapGrandStatic142Tex[];
+extern u64 gMapGrandStatic143Tex[];
+extern u64 gMapGrandStatic144Tex[];
+extern u64 gMapGrandStatic145Tex[];
+extern u64 gMapGrandStatic146Tex[];
+extern u64 gMapGrandStatic147Tex[];
+extern u64 gMapGrandStatic148Tex[];
+extern u64 gMapGrandStatic149Tex[];
+extern u64 gMapGrandStatic14ATex[];
+extern u64 gMapGrandStatic14BTex[];
+extern u64 gMapGrandStatic14CTex[];
+extern u64 gMapGrandStatic14DTex[];
+extern u64 gMapGrandStatic14ETex[];
+extern u64 gMapGrandStatic14FTex[];
+extern u64 gMapGrandStatic150Tex[];
+extern u64 gMapGrandStatic151Tex[];
+extern u64 gMapGrandStatic152Tex[];
+extern u64 gMapGrandStatic153Tex[];
+extern u64 gMapGrandStatic154Tex[];
+extern u64 gMapGrandStatic155Tex[];
+extern u64 gMapGrandStatic156Tex[];
+extern u64 gMapGrandStatic157Tex[];
+extern u64 gMapGrandStatic158Tex[];
+extern u64 gMapGrandStatic159Tex[];
+extern u64 gMapGrandStatic15ATex[];
+extern u64 gMapGrandStatic15BTex[];
+extern u64 gMapGrandStatic15CTex[];
+extern u64 gMapGrandStatic15DTex[];
+extern u64 gMapGrandStatic15ETex[];
+extern u64 gMapGrandStatic15FTex[];
+extern u64 gMapGrandStatic160Tex[];
+extern u64 gMapGrandStatic161Tex[];
+
+#endif
diff --git a/assets/c/archives/map_i_static/map_i_static.c b/assets/c/archives/map_i_static/map_i_static.c
new file mode 100644
index 0000000000..7b94327861
--- /dev/null
+++ b/assets/c/archives/map_i_static/map_i_static.c
@@ -0,0 +1,233 @@
+#include "map_i_static.h"
+
+u64 gMapIStatic00Tex[] = {
+#include "assets/archives/map_i_static/map_00.i4.inc.c"
+};
+
+u64 gMapIStatic01Tex[] = {
+#include "assets/archives/map_i_static/map_01.i4.inc.c"
+};
+
+u64 gMapIStatic02Tex[] = {
+#include "assets/archives/map_i_static/map_02.i4.inc.c"
+};
+
+u64 gMapIStatic03Tex[] = {
+#include "assets/archives/map_i_static/map_03.i4.inc.c"
+};
+
+u64 gMapIStatic04Tex[] = {
+#include "assets/archives/map_i_static/map_04.i4.inc.c"
+};
+
+u64 gMapIStatic05Tex[] = {
+#include "assets/archives/map_i_static/map_05.i4.inc.c"
+};
+
+u64 gMapIStatic06Tex[] = {
+#include "assets/archives/map_i_static/map_06.i4.inc.c"
+};
+
+u64 gMapIStatic07Tex[] = {
+#include "assets/archives/map_i_static/map_07.i4.inc.c"
+};
+
+u64 gMapIStatic08Tex[] = {
+#include "assets/archives/map_i_static/map_08.i4.inc.c"
+};
+
+u64 gMapIStatic09Tex[] = {
+#include "assets/archives/map_i_static/map_09.i4.inc.c"
+};
+
+u64 gMapIStatic0ATex[] = {
+#include "assets/archives/map_i_static/map_0A.i4.inc.c"
+};
+
+u64 gMapIStatic0BTex[] = {
+#include "assets/archives/map_i_static/map_0B.i4.inc.c"
+};
+
+u64 gMapIStatic0CTex[] = {
+#include "assets/archives/map_i_static/map_0C.i4.inc.c"
+};
+
+u64 gMapIStatic0DTex[] = {
+#include "assets/archives/map_i_static/map_0D.i4.inc.c"
+};
+
+u64 gMapIStatic0ETex[] = {
+#include "assets/archives/map_i_static/map_0E.i4.inc.c"
+};
+
+u64 gMapIStatic0FTex[] = {
+#include "assets/archives/map_i_static/map_0F.i4.inc.c"
+};
+
+u64 gMapIStatic10Tex[] = {
+#include "assets/archives/map_i_static/map_10.i4.inc.c"
+};
+
+u64 gMapIStatic11Tex[] = {
+#include "assets/archives/map_i_static/map_11.i4.inc.c"
+};
+
+u64 gMapIStatic12Tex[] = {
+#include "assets/archives/map_i_static/map_12.i4.inc.c"
+};
+
+u64 gMapIStatic13Tex[] = {
+#include "assets/archives/map_i_static/map_13.i4.inc.c"
+};
+
+u64 gMapIStatic14Tex[] = {
+#include "assets/archives/map_i_static/map_14.i4.inc.c"
+};
+
+u64 gMapIStatic15Tex[] = {
+#include "assets/archives/map_i_static/map_15.i4.inc.c"
+};
+
+u64 gMapIStatic16Tex[] = {
+#include "assets/archives/map_i_static/map_16.i4.inc.c"
+};
+
+u64 gMapIStatic17Tex[] = {
+#include "assets/archives/map_i_static/map_17.i4.inc.c"
+};
+
+u64 gMapIStatic18Tex[] = {
+#include "assets/archives/map_i_static/map_18.i4.inc.c"
+};
+
+u64 gMapIStatic19Tex[] = {
+#include "assets/archives/map_i_static/map_19.i4.inc.c"
+};
+
+u64 gMapIStatic1ATex[] = {
+#include "assets/archives/map_i_static/map_1A.i4.inc.c"
+};
+
+u64 gMapIStatic1BTex[] = {
+#include "assets/archives/map_i_static/map_1B.i4.inc.c"
+};
+
+u64 gMapIStatic1CTex[] = {
+#include "assets/archives/map_i_static/map_1C.i4.inc.c"
+};
+
+u64 gMapIStatic1DTex[] = {
+#include "assets/archives/map_i_static/map_1D.i4.inc.c"
+};
+
+u64 gMapIStatic1ETex[] = {
+#include "assets/archives/map_i_static/map_1E.i4.inc.c"
+};
+
+u64 gMapIStatic1FTex[] = {
+#include "assets/archives/map_i_static/map_1F.i4.inc.c"
+};
+
+u64 gMapIStatic20Tex[] = {
+#include "assets/archives/map_i_static/map_20.i4.inc.c"
+};
+
+u64 gMapIStatic21Tex[] = {
+#include "assets/archives/map_i_static/map_21.i4.inc.c"
+};
+
+u64 gMapIStatic22Tex[] = {
+#include "assets/archives/map_i_static/map_22.i4.inc.c"
+};
+
+u64 gMapIStatic23Tex[] = {
+#include "assets/archives/map_i_static/map_23.i4.inc.c"
+};
+
+u64 gMapIStatic24Tex[] = {
+#include "assets/archives/map_i_static/map_24.i4.inc.c"
+};
+
+u64 gMapIStatic25Tex[] = {
+#include "assets/archives/map_i_static/map_25.i4.inc.c"
+};
+
+u64 gMapIStatic26Tex[] = {
+#include "assets/archives/map_i_static/map_26.i4.inc.c"
+};
+
+u64 gMapIStatic27Tex[] = {
+#include "assets/archives/map_i_static/map_27.i4.inc.c"
+};
+
+u64 gMapIStatic28Tex[] = {
+#include "assets/archives/map_i_static/map_28.i4.inc.c"
+};
+
+u64 gMapIStatic29Tex[] = {
+#include "assets/archives/map_i_static/map_29.i4.inc.c"
+};
+
+u64 gMapIStatic2ATex[] = {
+#include "assets/archives/map_i_static/map_2A.i4.inc.c"
+};
+
+u64 gMapIStatic2BTex[] = {
+#include "assets/archives/map_i_static/map_2B.i4.inc.c"
+};
+
+u64 gMapIStatic2CTex[] = {
+#include "assets/archives/map_i_static/map_2C.i4.inc.c"
+};
+
+u64 gMapIStatic2DTex[] = {
+#include "assets/archives/map_i_static/map_2D.i4.inc.c"
+};
+
+u64 gMapIStatic2ETex[] = {
+#include "assets/archives/map_i_static/map_2E.i4.inc.c"
+};
+
+u64 gMapIStatic2FTex[] = {
+#include "assets/archives/map_i_static/map_2F.i4.inc.c"
+};
+
+u64 gMapIStatic30Tex[] = {
+#include "assets/archives/map_i_static/map_30.i4.inc.c"
+};
+
+u64 gMapIStatic31Tex[] = {
+#include "assets/archives/map_i_static/map_31.i4.inc.c"
+};
+
+u64 gMapIStatic32Tex[] = {
+#include "assets/archives/map_i_static/map_32.i4.inc.c"
+};
+
+u64 gMapIStatic33Tex[] = {
+#include "assets/archives/map_i_static/map_33.i4.inc.c"
+};
+
+u64 gMapIStatic34Tex[] = {
+#include "assets/archives/map_i_static/map_34.i4.inc.c"
+};
+
+u64 gMapIStatic35Tex[] = {
+#include "assets/archives/map_i_static/map_35.i4.inc.c"
+};
+
+u64 gMapIStatic36Tex[] = {
+#include "assets/archives/map_i_static/map_36.i4.inc.c"
+};
+
+u64 gMapIStatic37Tex[] = {
+#include "assets/archives/map_i_static/map_37.i4.inc.c"
+};
+
+u64 gMapIStatic38Tex[] = {
+#include "assets/archives/map_i_static/map_38.i4.inc.c"
+};
+
+u64 gMapIStatic39Tex[] = {
+#include "assets/archives/map_i_static/map_39.i4.inc.c"
+};
diff --git a/assets/c/archives/map_i_static/map_i_static.h b/assets/c/archives/map_i_static/map_i_static.h
new file mode 100644
index 0000000000..c614bb6f84
--- /dev/null
+++ b/assets/c/archives/map_i_static/map_i_static.h
@@ -0,0 +1,65 @@
+#ifndef MAP_I_STATIC_H
+#define MAP_I_STATIC_H 1
+
+#include "ultra64.h"
+
+extern u64 gMapIStatic00Tex[];
+extern u64 gMapIStatic01Tex[];
+extern u64 gMapIStatic02Tex[];
+extern u64 gMapIStatic03Tex[];
+extern u64 gMapIStatic04Tex[];
+extern u64 gMapIStatic05Tex[];
+extern u64 gMapIStatic06Tex[];
+extern u64 gMapIStatic07Tex[];
+extern u64 gMapIStatic08Tex[];
+extern u64 gMapIStatic09Tex[];
+extern u64 gMapIStatic0ATex[];
+extern u64 gMapIStatic0BTex[];
+extern u64 gMapIStatic0CTex[];
+extern u64 gMapIStatic0DTex[];
+extern u64 gMapIStatic0ETex[];
+extern u64 gMapIStatic0FTex[];
+extern u64 gMapIStatic10Tex[];
+extern u64 gMapIStatic11Tex[];
+extern u64 gMapIStatic12Tex[];
+extern u64 gMapIStatic13Tex[];
+extern u64 gMapIStatic14Tex[];
+extern u64 gMapIStatic15Tex[];
+extern u64 gMapIStatic16Tex[];
+extern u64 gMapIStatic17Tex[];
+extern u64 gMapIStatic18Tex[];
+extern u64 gMapIStatic19Tex[];
+extern u64 gMapIStatic1ATex[];
+extern u64 gMapIStatic1BTex[];
+extern u64 gMapIStatic1CTex[];
+extern u64 gMapIStatic1DTex[];
+extern u64 gMapIStatic1ETex[];
+extern u64 gMapIStatic1FTex[];
+extern u64 gMapIStatic20Tex[];
+extern u64 gMapIStatic21Tex[];
+extern u64 gMapIStatic22Tex[];
+extern u64 gMapIStatic23Tex[];
+extern u64 gMapIStatic24Tex[];
+extern u64 gMapIStatic25Tex[];
+extern u64 gMapIStatic26Tex[];
+extern u64 gMapIStatic27Tex[];
+extern u64 gMapIStatic28Tex[];
+extern u64 gMapIStatic29Tex[];
+extern u64 gMapIStatic2ATex[];
+extern u64 gMapIStatic2BTex[];
+extern u64 gMapIStatic2CTex[];
+extern u64 gMapIStatic2DTex[];
+extern u64 gMapIStatic2ETex[];
+extern u64 gMapIStatic2FTex[];
+extern u64 gMapIStatic30Tex[];
+extern u64 gMapIStatic31Tex[];
+extern u64 gMapIStatic32Tex[];
+extern u64 gMapIStatic33Tex[];
+extern u64 gMapIStatic34Tex[];
+extern u64 gMapIStatic35Tex[];
+extern u64 gMapIStatic36Tex[];
+extern u64 gMapIStatic37Tex[];
+extern u64 gMapIStatic38Tex[];
+extern u64 gMapIStatic39Tex[];
+
+#endif
diff --git a/assets/xml/archives/map_grand_static.xml b/assets/xml/archives/map_grand_static.xml
index d5d80bdd6d..05e5893c1f 100644
--- a/assets/xml/archives/map_grand_static.xml
+++ b/assets/xml/archives/map_grand_static.xml
@@ -1,102 +1,102 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/archives/map_i_static.xml b/assets/xml/archives/map_i_static.xml
index dbb64185d8..fce2cc4375 100644
--- a/assets/xml/archives/map_i_static.xml
+++ b/assets/xml/archives/map_i_static.xml
@@ -1,62 +1,62 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/extract_assets.py b/extract_assets.py
index dda5efaec7..4d64d7d135 100755
--- a/extract_assets.py
+++ b/extract_assets.py
@@ -6,6 +6,11 @@ colorama.init()
EXTRACTED_ASSETS_NAMEFILE = ".extracted-assets.json"
+dontGenerateCFilesList = [
+ "map_grand_static",
+ "map_i_static",
+]
+
def SignalHandler(sig, frame):
print(f'Signal {sig} received. Aborting...')
mainAbort.set()
@@ -16,7 +21,13 @@ def ExtractFile(xmlPath, outputPath, outputSourcePath):
# Don't extract if another file wasn't extracted properly.
return
- execStr = f"tools/ZAPD/ZAPD.out e -eh -i {xmlPath} -b baserom/ -o {outputPath} -osf {outputSourcePath} -gsf 1 -rconf tools/ZAPDConfigs/MM/Config.xml {ZAPDArgs}"
+ generateSourceFile = "1"
+ for name in dontGenerateCFilesList:
+ if name in xmlPath:
+ generateSourceFile = "0"
+ break
+
+ execStr = f"tools/ZAPD/ZAPD.out e -eh -i {xmlPath} -b baserom/ -o {outputPath} -osf {outputSourcePath} -gsf {generateSourceFile} -rconf tools/ZAPDConfigs/MM/Config.xml {ZAPDArgs}"
if globalUnaccounted:
execStr += " -Wunaccounted"
diff --git a/spec b/spec
index 622a496473..f0f1f865fa 100644
--- a/spec
+++ b/spec
@@ -329,12 +329,12 @@ endseg
beginseg
name "map_i_static"
- include "build/assets/archives/map_i_static/map_i_static.yar.o"
+ include "build/assets/c/archives/map_i_static/map_i_static.yar.o"
endseg
beginseg
name "map_grand_static"
- include "build/assets/archives/map_grand_static/map_grand_static.yar.o"
+ include "build/assets/c/archives/map_grand_static/map_grand_static.yar.o"
endseg
beginseg
diff --git a/tools/buildtools/makeyar.c b/tools/buildtools/makeyar.c
index 6a241f6f5b..e94ce3f0c4 100644
--- a/tools/buildtools/makeyar.c
+++ b/tools/buildtools/makeyar.c
@@ -188,20 +188,27 @@ void createArchive(Bytearray *archive, const DataSection *dataSect) {
offset = firstEntryOffset;
for (i = 0; i < dataSect->symbols.len; i++) {
const struct Elf32_Symbol *sym = &dataSect->symbols.symbols[i];
- size_t uncompressedSize = sym->size;
- uint8_t *output = malloc(uncompressedSize * sizeof(uint8_t)); // assume compressed shouldn't be bigger than uncompressed
+ size_t realUncompressedSize = sym->size;
+ size_t alignedUncompressedSize = ALIGN16(realUncompressedSize);
+ uint8_t *inputBuf = malloc(alignedUncompressedSize* sizeof(uint8_t));
+ uint8_t *output = malloc(alignedUncompressedSize * sizeof(uint8_t)); // assume compressed shouldn't be bigger than uncompressed
size_t compressedSize;
+ // Make sure to pad each entry to a 0x10 boundary
+ memcpy(inputBuf, &dataSect->data.bytes[sym->value], realUncompressedSize);
+ if (realUncompressedSize < alignedUncompressedSize) {
+ memset(&inputBuf[realUncompressedSize], 0, alignedUncompressedSize - realUncompressedSize);
+ }
+
output[0] = 'Y';
output[1] = 'a';
output[2] = 'z';
output[3] = '0';
- util_write_uint32_be(&output[4], uncompressedSize);
+ util_write_uint32_be(&output[4], alignedUncompressedSize);
memset(&output[8], 0, 8);
compressedSize = 0x10;
- assert(sym->value + uncompressedSize <= dataSect->data.size);
- compressedSize += yaz0_encode(&dataSect->data.bytes[sym->value], &output[0x10], uncompressedSize);
+ compressedSize += yaz0_encode(inputBuf, &output[0x10], alignedUncompressedSize);
// Pad to 0x10
while (compressedSize % 0x10 != 0) {