diff --git a/assets/xml/objects/object_fd.xml b/assets/xml/objects/object_fd.xml
index 750f80be4d..b15a22eef1 100644
--- a/assets/xml/objects/object_fd.xml
+++ b/assets/xml/objects/object_fd.xml
@@ -1,35 +1,45 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -48,111 +58,89 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_fd_pal.xml b/assets/xml/objects/object_fd_pal.xml
deleted file mode 100644
index ff91e48e11..0000000000
--- a/assets/xml/objects/object_fd_pal.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_goma.xml b/assets/xml/objects/object_goma.xml
index f2429cd2b9..aba349c478 100644
--- a/assets/xml/objects/object_goma.xml
+++ b/assets/xml/objects/object_goma.xml
@@ -1,240 +1,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -249,10 +20,144 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -263,16 +168,113 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
diff --git a/assets/xml/objects/object_goma_pal.xml b/assets/xml/objects/object_goma_pal.xml
deleted file mode 100644
index dbee83f7ca..0000000000
--- a/assets/xml/objects/object_goma_pal.xml
+++ /dev/null
@@ -1,276 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_kingdodongo.xml b/assets/xml/objects/object_kingdodongo.xml
index 1e0b94cf97..3357d19240 100644
--- a/assets/xml/objects/object_kingdodongo.xml
+++ b/assets/xml/objects/object_kingdodongo.xml
@@ -111,103 +111,111 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_kingdodongo_pal.xml b/assets/xml/objects/object_kingdodongo_pal.xml
deleted file mode 100644
index b9ec4d4387..0000000000
--- a/assets/xml/objects/object_kingdodongo_pal.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_mag.xml b/assets/xml/objects/object_mag.xml
index 59a0613548..9d2c432416 100644
--- a/assets/xml/objects/object_mag.xml
+++ b/assets/xml/objects/object_mag.xml
@@ -1,20 +1,47 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_mag_ique.xml b/assets/xml/objects/object_mag_ique.xml
deleted file mode 100644
index 3a2bed9682..0000000000
--- a/assets/xml/objects/object_mag_ique.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_mag_v2.xml b/assets/xml/objects/object_mag_v2.xml
deleted file mode 100644
index 9897422cbd..0000000000
--- a/assets/xml/objects/object_mag_v2.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_mag_v2_mq.xml b/assets/xml/objects/object_mag_v2_mq.xml
deleted file mode 100644
index 0b14571ca7..0000000000
--- a/assets/xml/objects/object_mag_v2_mq.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_mag_v3.xml b/assets/xml/objects/object_mag_v3.xml
deleted file mode 100644
index eb95e103be..0000000000
--- a/assets/xml/objects/object_mag_v3.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_mag_v3_mq.xml b/assets/xml/objects/object_mag_v3_mq.xml
deleted file mode 100644
index b0b54fe739..0000000000
--- a/assets/xml/objects/object_mag_v3_mq.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_mo.xml b/assets/xml/objects/object_mo.xml
index 9844361f58..b7af7eff47 100644
--- a/assets/xml/objects/object_mo.xml
+++ b/assets/xml/objects/object_mo.xml
@@ -1,184 +1,27 @@
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -189,35 +32,200 @@
+
+
+
+
+
+
+
+
-
+
-
+
-
+
+
+
-
-
+
+
-
-
-
+
-
-
-
+
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_mo_pal.xml b/assets/xml/objects/object_mo_pal.xml
deleted file mode 100644
index 71078c6a95..0000000000
--- a/assets/xml/objects/object_mo_pal.xml
+++ /dev/null
@@ -1,223 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_tw.xml b/assets/xml/objects/object_tw.xml
index 922d28ac65..435a064824 100644
--- a/assets/xml/objects/object_tw.xml
+++ b/assets/xml/objects/object_tw.xml
@@ -192,11 +192,55 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -218,11 +262,55 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -430,9 +518,6 @@
-
-
-
@@ -566,6 +651,7 @@
+
@@ -648,71 +734,77 @@
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
-
+
+
diff --git a/assets/xml/objects/object_tw_pal.xml b/assets/xml/objects/object_tw_pal.xml
deleted file mode 100644
index 2b777f3d3a..0000000000
--- a/assets/xml/objects/object_tw_pal.xml
+++ /dev/null
@@ -1,807 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/assets/xml/objects/object_xc.xml b/assets/xml/objects/object_xc.xml
index f6f30b2f44..f08c91cb8d 100644
--- a/assets/xml/objects/object_xc.xml
+++ b/assets/xml/objects/object_xc.xml
@@ -1,146 +1,157 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_xc_pal.xml b/assets/xml/objects/object_xc_pal.xml
deleted file mode 100644
index 7d20f23661..0000000000
--- a/assets/xml/objects/object_xc_pal.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/baseroms/gc-eu-mq-dbg/config.yml b/baseroms/gc-eu-mq-dbg/config.yml
index e457028060..5a0ecdecb3 100644
--- a/baseroms/gc-eu-mq-dbg/config.yml
+++ b/baseroms/gc-eu-mq-dbg/config.yml
@@ -220,7 +220,7 @@ assets:
- name: objects/object_fa
xml_path: assets/xml/objects/object_fa.xml
- name: objects/object_fd
- xml_path: assets/xml/objects/object_fd_pal.xml
+ xml_path: assets/xml/objects/object_fd.xml
- name: objects/object_fd2
xml_path: assets/xml/objects/object_fd2.xml
- name: objects/object_fhg
@@ -430,7 +430,7 @@ assets:
- name: objects/object_gol
xml_path: assets/xml/objects/object_gol.xml
- name: objects/object_goma
- xml_path: assets/xml/objects/object_goma_pal.xml
+ xml_path: assets/xml/objects/object_goma.xml
- name: objects/object_goroiwa
xml_path: assets/xml/objects/object_goroiwa.xml
- name: objects/object_gr
@@ -498,7 +498,7 @@ assets:
- name: objects/object_kibako2
xml_path: assets/xml/objects/object_kibako2.xml
- name: objects/object_kingdodongo
- xml_path: assets/xml/objects/object_kingdodongo_pal.xml
+ xml_path: assets/xml/objects/object_kingdodongo.xml
- name: objects/object_km1
xml_path: assets/xml/objects/object_km1.xml
- name: objects/object_kusa
@@ -522,7 +522,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_v3_mq.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
@@ -566,7 +566,7 @@ assets:
- name: objects/object_mm
xml_path: assets/xml/objects/object_mm.xml
- name: objects/object_mo
- xml_path: assets/xml/objects/object_mo_pal.xml
+ xml_path: assets/xml/objects/object_mo.xml
- name: objects/object_mori_hineri1
xml_path: assets/xml/objects/object_mori_hineri1.xml
- name: objects/object_mori_hineri1a
@@ -796,7 +796,7 @@ assets:
- name: objects/object_tsubo
xml_path: assets/xml/objects/object_tsubo.xml
- name: objects/object_tw
- xml_path: assets/xml/objects/object_tw_pal.xml
+ xml_path: assets/xml/objects/object_tw.xml
- name: objects/object_umajump
xml_path: assets/xml/objects/object_umajump.xml
- name: objects/object_vali
@@ -816,7 +816,7 @@ assets:
- name: objects/object_wood02
xml_path: assets/xml/objects/object_wood02.xml
- name: objects/object_xc
- xml_path: assets/xml/objects/object_xc_pal.xml
+ xml_path: assets/xml/objects/object_xc.xml
- name: objects/object_yabusame_point
xml_path: assets/xml/objects/object_yabusame_point.xml
- name: objects/object_ydan_objects
diff --git a/baseroms/gc-eu-mq/config.yml b/baseroms/gc-eu-mq/config.yml
index 0093015d7e..c6edfbd17d 100644
--- a/baseroms/gc-eu-mq/config.yml
+++ b/baseroms/gc-eu-mq/config.yml
@@ -212,7 +212,7 @@ assets:
- name: objects/object_fa
xml_path: assets/xml/objects/object_fa.xml
- name: objects/object_fd
- xml_path: assets/xml/objects/object_fd_pal.xml
+ xml_path: assets/xml/objects/object_fd.xml
- name: objects/object_fd2
xml_path: assets/xml/objects/object_fd2.xml
- name: objects/object_fhg
@@ -422,7 +422,7 @@ assets:
- name: objects/object_gol
xml_path: assets/xml/objects/object_gol.xml
- name: objects/object_goma
- xml_path: assets/xml/objects/object_goma_pal.xml
+ xml_path: assets/xml/objects/object_goma.xml
- name: objects/object_goroiwa
xml_path: assets/xml/objects/object_goroiwa.xml
- name: objects/object_gr
@@ -490,7 +490,7 @@ assets:
- name: objects/object_kibako2
xml_path: assets/xml/objects/object_kibako2.xml
- name: objects/object_kingdodongo
- xml_path: assets/xml/objects/object_kingdodongo_pal.xml
+ xml_path: assets/xml/objects/object_kingdodongo.xml
- name: objects/object_km1
xml_path: assets/xml/objects/object_km1.xml
- name: objects/object_kusa
@@ -514,7 +514,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_v3_mq.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
@@ -558,7 +558,7 @@ assets:
- name: objects/object_mm
xml_path: assets/xml/objects/object_mm.xml
- name: objects/object_mo
- xml_path: assets/xml/objects/object_mo_pal.xml
+ xml_path: assets/xml/objects/object_mo.xml
- name: objects/object_mori_hineri1
xml_path: assets/xml/objects/object_mori_hineri1.xml
- name: objects/object_mori_hineri1a
@@ -788,7 +788,7 @@ assets:
- name: objects/object_tsubo
xml_path: assets/xml/objects/object_tsubo.xml
- name: objects/object_tw
- xml_path: assets/xml/objects/object_tw_pal.xml
+ xml_path: assets/xml/objects/object_tw.xml
- name: objects/object_umajump
xml_path: assets/xml/objects/object_umajump.xml
- name: objects/object_vali
@@ -808,7 +808,7 @@ assets:
- name: objects/object_wood02
xml_path: assets/xml/objects/object_wood02.xml
- name: objects/object_xc
- xml_path: assets/xml/objects/object_xc_pal.xml
+ xml_path: assets/xml/objects/object_xc.xml
- name: objects/object_yabusame_point
xml_path: assets/xml/objects/object_yabusame_point.xml
- name: objects/object_ydan_objects
diff --git a/baseroms/gc-eu/config.yml b/baseroms/gc-eu/config.yml
index 9aef9891f9..340de8ee15 100644
--- a/baseroms/gc-eu/config.yml
+++ b/baseroms/gc-eu/config.yml
@@ -212,7 +212,7 @@ assets:
- name: objects/object_fa
xml_path: assets/xml/objects/object_fa.xml
- name: objects/object_fd
- xml_path: assets/xml/objects/object_fd_pal.xml
+ xml_path: assets/xml/objects/object_fd.xml
- name: objects/object_fd2
xml_path: assets/xml/objects/object_fd2.xml
- name: objects/object_fhg
@@ -422,7 +422,7 @@ assets:
- name: objects/object_gol
xml_path: assets/xml/objects/object_gol.xml
- name: objects/object_goma
- xml_path: assets/xml/objects/object_goma_pal.xml
+ xml_path: assets/xml/objects/object_goma.xml
- name: objects/object_goroiwa
xml_path: assets/xml/objects/object_goroiwa.xml
- name: objects/object_gr
@@ -490,7 +490,7 @@ assets:
- name: objects/object_kibako2
xml_path: assets/xml/objects/object_kibako2.xml
- name: objects/object_kingdodongo
- xml_path: assets/xml/objects/object_kingdodongo_pal.xml
+ xml_path: assets/xml/objects/object_kingdodongo.xml
- name: objects/object_km1
xml_path: assets/xml/objects/object_km1.xml
- name: objects/object_kusa
@@ -514,7 +514,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_v3.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
@@ -558,7 +558,7 @@ assets:
- name: objects/object_mm
xml_path: assets/xml/objects/object_mm.xml
- name: objects/object_mo
- xml_path: assets/xml/objects/object_mo_pal.xml
+ xml_path: assets/xml/objects/object_mo.xml
- name: objects/object_mori_hineri1
xml_path: assets/xml/objects/object_mori_hineri1.xml
- name: objects/object_mori_hineri1a
@@ -788,7 +788,7 @@ assets:
- name: objects/object_tsubo
xml_path: assets/xml/objects/object_tsubo.xml
- name: objects/object_tw
- xml_path: assets/xml/objects/object_tw_pal.xml
+ xml_path: assets/xml/objects/object_tw.xml
- name: objects/object_umajump
xml_path: assets/xml/objects/object_umajump.xml
- name: objects/object_vali
@@ -808,7 +808,7 @@ assets:
- name: objects/object_wood02
xml_path: assets/xml/objects/object_wood02.xml
- name: objects/object_xc
- xml_path: assets/xml/objects/object_xc_pal.xml
+ xml_path: assets/xml/objects/object_xc.xml
- name: objects/object_yabusame_point
xml_path: assets/xml/objects/object_yabusame_point.xml
- name: objects/object_ydan_objects
diff --git a/baseroms/gc-jp-ce/config.yml b/baseroms/gc-jp-ce/config.yml
index f3c0541a62..f2c1cb58bc 100644
--- a/baseroms/gc-jp-ce/config.yml
+++ b/baseroms/gc-jp-ce/config.yml
@@ -513,7 +513,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_v3.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
diff --git a/baseroms/gc-jp-mq/config.yml b/baseroms/gc-jp-mq/config.yml
index 41d1721f3d..f50e46293d 100644
--- a/baseroms/gc-jp-mq/config.yml
+++ b/baseroms/gc-jp-mq/config.yml
@@ -513,7 +513,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_v2_mq.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
diff --git a/baseroms/gc-jp/config.yml b/baseroms/gc-jp/config.yml
index 73285664c6..5460cca12d 100644
--- a/baseroms/gc-jp/config.yml
+++ b/baseroms/gc-jp/config.yml
@@ -513,7 +513,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_v2.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
diff --git a/baseroms/gc-us-mq/config.yml b/baseroms/gc-us-mq/config.yml
index 1057e49b2e..9f43ab56fa 100644
--- a/baseroms/gc-us-mq/config.yml
+++ b/baseroms/gc-us-mq/config.yml
@@ -513,7 +513,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_v3_mq.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
diff --git a/baseroms/gc-us/config.yml b/baseroms/gc-us/config.yml
index 620d550631..25e0c52604 100644
--- a/baseroms/gc-us/config.yml
+++ b/baseroms/gc-us/config.yml
@@ -513,7 +513,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_v3.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
diff --git a/baseroms/ique-cn/config.yml b/baseroms/ique-cn/config.yml
index 6236b0cf51..594da76ad0 100644
--- a/baseroms/ique-cn/config.yml
+++ b/baseroms/ique-cn/config.yml
@@ -513,7 +513,7 @@ assets:
- name: objects/object_ma2
xml_path: assets/xml/objects/object_ma2.xml
- name: objects/object_mag
- xml_path: assets/xml/objects/object_mag_ique.xml
+ xml_path: assets/xml/objects/object_mag.xml
- name: objects/object_mamenoki
xml_path: assets/xml/objects/object_mamenoki.xml
- name: objects/object_mastergolon
diff --git a/baseroms/pal-1.0/config.yml b/baseroms/pal-1.0/config.yml
index 37ffb7500b..8e7dafda90 100644
--- a/baseroms/pal-1.0/config.yml
+++ b/baseroms/pal-1.0/config.yml
@@ -224,7 +224,7 @@ assets:
- name: objects/object_fa
xml_path: assets/xml/objects/object_fa.xml
- name: objects/object_fd
- xml_path: assets/xml/objects/object_fd_pal.xml
+ xml_path: assets/xml/objects/object_fd.xml
- name: objects/object_fd2
xml_path: assets/xml/objects/object_fd2.xml
- name: objects/object_fhg
@@ -434,7 +434,7 @@ assets:
- name: objects/object_gol
xml_path: assets/xml/objects/object_gol.xml
- name: objects/object_goma
- xml_path: assets/xml/objects/object_goma_pal.xml
+ xml_path: assets/xml/objects/object_goma.xml
- name: objects/object_goroiwa
xml_path: assets/xml/objects/object_goroiwa.xml
- name: objects/object_gr
@@ -502,7 +502,7 @@ assets:
- name: objects/object_kibako2
xml_path: assets/xml/objects/object_kibako2.xml
- name: objects/object_kingdodongo
- xml_path: assets/xml/objects/object_kingdodongo_pal.xml
+ xml_path: assets/xml/objects/object_kingdodongo.xml
- name: objects/object_km1
xml_path: assets/xml/objects/object_km1.xml
- name: objects/object_kusa
@@ -570,7 +570,7 @@ assets:
- name: objects/object_mm
xml_path: assets/xml/objects/object_mm.xml
- name: objects/object_mo
- xml_path: assets/xml/objects/object_mo_pal.xml
+ xml_path: assets/xml/objects/object_mo.xml
- name: objects/object_mori_hineri1
xml_path: assets/xml/objects/object_mori_hineri1.xml
- name: objects/object_mori_hineri1a
@@ -800,7 +800,7 @@ assets:
- name: objects/object_tsubo
xml_path: assets/xml/objects/object_tsubo.xml
- name: objects/object_tw
- xml_path: assets/xml/objects/object_tw_pal.xml
+ xml_path: assets/xml/objects/object_tw.xml
- name: objects/object_umajump
xml_path: assets/xml/objects/object_umajump.xml
- name: objects/object_vali
@@ -820,7 +820,7 @@ assets:
- name: objects/object_wood02
xml_path: assets/xml/objects/object_wood02.xml
- name: objects/object_xc
- xml_path: assets/xml/objects/object_xc_pal.xml
+ xml_path: assets/xml/objects/object_xc.xml
- name: objects/object_yabusame_point
xml_path: assets/xml/objects/object_yabusame_point.xml
- name: objects/object_ydan_objects
diff --git a/baseroms/pal-1.1/config.yml b/baseroms/pal-1.1/config.yml
index 45bf82b877..4640c8dfdf 100644
--- a/baseroms/pal-1.1/config.yml
+++ b/baseroms/pal-1.1/config.yml
@@ -224,7 +224,7 @@ assets:
- name: objects/object_fa
xml_path: assets/xml/objects/object_fa.xml
- name: objects/object_fd
- xml_path: assets/xml/objects/object_fd_pal.xml
+ xml_path: assets/xml/objects/object_fd.xml
- name: objects/object_fd2
xml_path: assets/xml/objects/object_fd2.xml
- name: objects/object_fhg
@@ -434,7 +434,7 @@ assets:
- name: objects/object_gol
xml_path: assets/xml/objects/object_gol.xml
- name: objects/object_goma
- xml_path: assets/xml/objects/object_goma_pal.xml
+ xml_path: assets/xml/objects/object_goma.xml
- name: objects/object_goroiwa
xml_path: assets/xml/objects/object_goroiwa.xml
- name: objects/object_gr
@@ -502,7 +502,7 @@ assets:
- name: objects/object_kibako2
xml_path: assets/xml/objects/object_kibako2.xml
- name: objects/object_kingdodongo
- xml_path: assets/xml/objects/object_kingdodongo_pal.xml
+ xml_path: assets/xml/objects/object_kingdodongo.xml
- name: objects/object_km1
xml_path: assets/xml/objects/object_km1.xml
- name: objects/object_kusa
@@ -570,7 +570,7 @@ assets:
- name: objects/object_mm
xml_path: assets/xml/objects/object_mm.xml
- name: objects/object_mo
- xml_path: assets/xml/objects/object_mo_pal.xml
+ xml_path: assets/xml/objects/object_mo.xml
- name: objects/object_mori_hineri1
xml_path: assets/xml/objects/object_mori_hineri1.xml
- name: objects/object_mori_hineri1a
@@ -800,7 +800,7 @@ assets:
- name: objects/object_tsubo
xml_path: assets/xml/objects/object_tsubo.xml
- name: objects/object_tw
- xml_path: assets/xml/objects/object_tw_pal.xml
+ xml_path: assets/xml/objects/object_tw.xml
- name: objects/object_umajump
xml_path: assets/xml/objects/object_umajump.xml
- name: objects/object_vali
@@ -820,7 +820,7 @@ assets:
- name: objects/object_wood02
xml_path: assets/xml/objects/object_wood02.xml
- name: objects/object_xc
- xml_path: assets/xml/objects/object_xc_pal.xml
+ xml_path: assets/xml/objects/object_xc.xml
- name: objects/object_yabusame_point
xml_path: assets/xml/objects/object_yabusame_point.xml
- name: objects/object_ydan_objects
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 49427c2096..7f76cb91a1 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: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:0 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: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:128 pal-1.1:128"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
diff --git a/tools/assets/descriptor/__main__.py b/tools/assets/descriptor/__main__.py
index 0d3f4e6dc3..e8698b4b61 100644
--- a/tools/assets/descriptor/__main__.py
+++ b/tools/assets/descriptor/__main__.py
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: © 2025 ZeldaRET
# SPDX-License-Identifier: CC0-1.0
+import argparse
from pprint import pprint as vanilla_pprint
try:
@@ -14,17 +15,37 @@ from . import base
def main():
- vc = version_config.load_version_config("gc-eu-mq-dbg")
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--version", "-v", default="gc-eu-mq-dbg")
+ parser.add_argument("--all", action="store_true")
+ parser.add_argument("-s", dest="single", default=None)
+ args = parser.parse_args()
+
+ if not args.all and args.single is None:
+ parser.error("Must specify --all or -s")
+
+ vc = version_config.load_version_config(args.version)
pools = base.get_resources_desc(vc)
try:
for pool in pools:
+ if not args.all and not any(
+ coll.backing_memory.name == args.single
+ for coll in pool.collections
+ if isinstance(coll.backing_memory, base.BaseromFileBackingMemory)
+ ):
+ continue
if any(coll.out_path.name == "gameplay_keep" for coll in pool.collections):
vanilla_pprint(pool)
else:
pprint(pool)
- input("Press enter for next pool")
+ for coll in pool.collections:
+ print(coll.out_path)
+ for res in coll.resources:
+ print(f"0x{res.offset:06X}", res.symbol_name)
+ if args.all:
+ input("Press enter for next pool")
except KeyboardInterrupt:
print()
diff --git a/tools/assets/descriptor/base.py b/tools/assets/descriptor/base.py
index a0833ec093..320d9101d8 100644
--- a/tools/assets/descriptor/base.py
+++ b/tools/assets/descriptor/base.py
@@ -5,6 +5,7 @@ import abc
import dataclasses
from functools import cache
from pathlib import Path
+import re
from typing import Callable, Optional
from xml.etree import ElementTree
@@ -27,6 +28,10 @@ class NoBackingMemory(BackingMemory):
pass
+class ResourceHasNoSizeError(Exception):
+ pass
+
+
# eq=False so this uses id-based equality and hashing
# Subclasses must also be made to use id-based equality and hashing
@dataclasses.dataclass(eq=False)
@@ -43,6 +48,9 @@ class ResourceDesc(abc.ABC):
hack_modes: set[str] = dataclasses.field(init=False, default_factory=set)
+ def get_size(self) -> int:
+ raise ResourceHasNoSizeError()
+
class StartAddress(abc.ABC):
pass
@@ -197,6 +205,15 @@ def get_resources_desc(vc: version_config.VersionConfig):
return pools
+def _get_version_resources(fileelem: ElementTree.Element, version: str):
+ for reselem in fileelem:
+ if reselem.tag == "Version":
+ if re.fullmatch(reselem.attrib["Pattern"], version):
+ yield from reselem
+ else:
+ yield reselem
+
+
def _get_resources_fileelem_to_resourcescollection_pass1(
vc: version_config.VersionConfig,
pool: list[AssetConfigPiece],
@@ -257,10 +274,31 @@ def _get_resources_fileelem_to_resourcescollection_pass1(
[],
)
needs_pass2_exceptions: list[ResourceHandlerNeedsPass2Exception] = []
- for reselem in fileelem:
+
+ prev_resource_end_offset = 0
+
+ for reselem in _get_version_resources(fileelem, vc.version):
try:
symbol_name = reselem.attrib["Name"]
- offset = int(reselem.attrib["Offset"], 16)
+ if "Offset" in reselem.attrib:
+ offset_str = reselem.attrib["Offset"]
+ if offset_str.startswith(".+"):
+ if prev_resource_end_offset is None:
+ raise Exception(
+ f"Resource {symbol_name} has a relative Offset"
+ " and previous resource has no known end offset"
+ )
+ rel_offset = int(offset_str.removeprefix(".+"), 16)
+ offset = prev_resource_end_offset + rel_offset
+ else:
+ offset = int(offset_str, 16)
+ else:
+ if prev_resource_end_offset is None:
+ raise Exception(
+ f"Resource {symbol_name} has no Offset"
+ " and previous resource has no known end offset"
+ )
+ offset = prev_resource_end_offset
res_handler = _get_resource_handler(reselem.tag)
try:
res = res_handler(symbol_name, offset, collection, reselem)
@@ -269,6 +307,10 @@ def _get_resources_fileelem_to_resourcescollection_pass1(
needs_pass2_exceptions.append(needs_pass2_exc)
assert isinstance(res, ResourceDesc)
resources.append(res)
+ try:
+ prev_resource_end_offset = res.offset + res.get_size()
+ except ResourceHasNoSizeError:
+ prev_resource_end_offset = None
except Exception as e:
raise Exception(
"Error with resource element:\n"
diff --git a/tools/assets/descriptor/n64resources.py b/tools/assets/descriptor/n64resources.py
index fe7c7172da..77616871ca 100644
--- a/tools/assets/descriptor/n64resources.py
+++ b/tools/assets/descriptor/n64resources.py
@@ -3,6 +3,7 @@
import dataclasses
import enum
+from typing import Optional
from xml.etree.ElementTree import Element
from ..n64 import G_IM_FMT, G_IM_SIZ
@@ -13,6 +14,7 @@ from .base import (
ResourcesDescCollectionsPool,
ResourceHandlerNeedsPass2Exception,
BaseromFileBackingMemory,
+ ResourceHasNoSizeError,
)
from . import xml_errors
@@ -27,20 +29,29 @@ class GfxMicroCode(enum.Enum):
@dataclasses.dataclass(eq=False)
class DListResourceDesc(ResourceDesc):
+ length: Optional[int]
ucode: GfxMicroCode
raw_pointers: set[int] = dataclasses.field(default_factory=set)
"""Pointers in the dlist that are fine to keep raw ("in hex") instead of using symbols"""
+ def get_size(self):
+ if self.length is None:
+ raise ResourceHasNoSizeError()
+ return self.length * 8
+
def handler_DList(symbol_name, offset, collection, reselem: Element):
xml_errors.check_attrib(
- reselem, {"Name", "Offset"}, {"Ucode", "RawPointers"} | STATIC_ATTRIB
+ reselem, {"Name"}, {"Offset", "Length", "Ucode", "RawPointers"} | STATIC_ATTRIB
)
+ length = None
+ if "Length" in reselem.attrib:
+ length = int(reselem.attrib["Length"])
if "Ucode" in reselem.attrib:
ucode = GfxMicroCode[reselem.attrib["Ucode"].upper()]
else:
ucode = GfxMicroCode.F3DEX2
- res = DListResourceDesc(symbol_name, offset, collection, reselem, ucode)
+ res = DListResourceDesc(symbol_name, offset, collection, reselem, length, ucode)
raw_pointers_str = reselem.attrib.get("RawPointers")
if raw_pointers_str:
for rp_str in raw_pointers_str.split(","):
@@ -54,7 +65,7 @@ class BlobResourceDesc(ResourceDesc):
def handler_Blob(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset", "Size"}, STATIC_ATTRIB)
+ xml_errors.check_attrib(reselem, {"Name", "Size"}, {"Offset"} | STATIC_ATTRIB)
size = int(reselem.attrib["Size"], 16)
return BlobResourceDesc(symbol_name, offset, collection, reselem, size)
@@ -65,7 +76,7 @@ class MtxResourceDesc(ResourceDesc):
def handler_Mtx(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset"}, STATIC_ATTRIB)
+ xml_errors.check_attrib(reselem, {"Name"}, {"Offset"} | STATIC_ATTRIB)
return MtxResourceDesc(symbol_name, offset, collection, reselem)
@@ -83,9 +94,12 @@ class Vec3sArrayResourceDesc(ResourceDesc):
class VtxArrayResourceDesc(ResourceDesc):
count: int
+ def get_size(self):
+ return self.count * 0x10
+
def handler_Array(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset", "Count"}, STATIC_ATTRIB)
+ xml_errors.check_attrib(reselem, {"Name", "Count"}, {"Offset"} | STATIC_ATTRIB)
count = int(reselem.attrib["Count"])
assert len(reselem) == 1, "Expected exactly one child of Array node"
array_elem = reselem[0]
@@ -126,6 +140,9 @@ class TextureResourceDesc(ResourceDesc):
width: int
height: int
+ def get_size(self):
+ return self.width * self.height * self.format.siz.bpp // 8
+
@dataclasses.dataclass(eq=False)
class CITextureResourceDesc(TextureResourceDesc):
@@ -137,11 +154,13 @@ def handler_Texture(
):
xml_errors.check_attrib(
reselem,
- {"Name", "Offset", "Format", "Width", "Height"},
+ {"Name", "Format", "Width", "Height"},
# TODO remove OutName, SplitTlut
{
+ "Offset",
"OutName",
"SplitTlut",
+ "Tlut",
"TlutOffset",
"ExternalTlut",
"ExternalTlutOffset",
@@ -163,15 +182,39 @@ def handler_Texture(
res.hack_modes.add("hackmode_split_tlut_false")
assert (
- "TlutOffset" in reselem.attrib or "ExternalTlutOffset" in reselem.attrib
- ), f"CI texture {symbol_name} is missing a tlut offset"
+ "Tlut" in reselem.attrib
+ or "TlutOffset" in reselem.attrib
+ or "ExternalTlutOffset" in reselem.attrib
+ ), f"CI texture {symbol_name} is missing tlut information"
- if "TlutOffset" in reselem.attrib:
+ if "Tlut" in reselem.attrib:
xml_errors.check_attrib(
reselem,
- {"Name", "Offset", "Format", "Width", "Height", "TlutOffset"},
+ {"Name", "Format", "Width", "Height", "Tlut"},
# TODO remove OutName, SplitTlut
- {"OutName", "SplitTlut", "HackMode"} | STATIC_ATTRIB,
+ {"Offset", "OutName", "SplitTlut", "HackMode"} | STATIC_ATTRIB,
+ )
+ tlut_name = reselem.attrib["Tlut"]
+
+ def pass2_callback(pool: ResourcesDescCollectionsPool):
+ matching_tlut_resources = [
+ res for res in collection.resources if res.symbol_name == tlut_name
+ ]
+ assert len(matching_tlut_resources) == 1, (
+ f"Found {len(matching_tlut_resources)} resources named "
+ f"{tlut_name} instead of exactly one"
+ )
+ assert isinstance(
+ matching_tlut_resources[0], TextureResourceDesc
+ ), matching_tlut_resources[0]
+ res.tlut = matching_tlut_resources[0]
+
+ elif "TlutOffset" in reselem.attrib:
+ xml_errors.check_attrib(
+ reselem,
+ {"Name", "Format", "Width", "Height", "TlutOffset"},
+ # TODO remove OutName, SplitTlut
+ {"Offset", "OutName", "SplitTlut", "HackMode"} | STATIC_ATTRIB,
)
tlut_offset = int(reselem.attrib["TlutOffset"], 16)
@@ -193,7 +236,6 @@ def handler_Texture(
reselem,
{
"Name",
- "Offset",
"Format",
"Width",
"Height",
@@ -201,7 +243,7 @@ def handler_Texture(
"ExternalTlutOffset",
},
# TODO remove OutName, SplitTlut
- {"OutName", "SplitTlut", "HackMode"} | STATIC_ATTRIB,
+ {"Offset", "OutName", "SplitTlut", "HackMode"} | STATIC_ATTRIB,
)
external_tlut_file = reselem.attrib["ExternalTlut"]
external_tlut_offset = int(reselem.attrib["ExternalTlutOffset"], 16)
@@ -229,9 +271,9 @@ def handler_Texture(
else:
xml_errors.check_attrib(
reselem,
- {"Name", "Offset", "Format", "Width", "Height"},
+ {"Name", "Format", "Width", "Height"},
# TODO remove OutName
- {"OutName", "HackMode"} | STATIC_ATTRIB,
+ {"Offset", "OutName", "HackMode"} | STATIC_ATTRIB,
)
res = TextureResourceDesc(
symbol_name, offset, collection, reselem, format, width, height
diff --git a/tools/assets/descriptor/spec.md b/tools/assets/descriptor/spec.md
index c038a13f82..ba8e4853fd 100644
--- a/tools/assets/descriptor/spec.md
+++ b/tools/assets/descriptor/spec.md
@@ -54,10 +54,17 @@ then `` refers to that ga
Resource elements describe resources. Resources are pieces of data corresponding to a symbol each.
-Two attributes are required on all resource elements: `Name` and `Offset`.
+One attribute is required on all resource elements: `Name`.
- `Name` is the name of the symbol associated to the resource.
-- `Offset` is the location in bytes from the start of the file data.
+
+Another attribute, optional, is common to all resource elements: `Offset`.
+
+If `Offset` is set to a (hexadecimal) number such as `Offset="0x421"`, it specifies the location of the resource in bytes from the start of the file data.
+
+If `Offset` is not set, the resource is assumed to start where the previous resource ended, or at 0 if the resource is the first in the ``.
+
+`Offset` can also be set to be a relative offset like `Offset=".+0x421"`, which makes the resource location be that many bytes after the end of the previous resource.
## `Blob`
@@ -74,12 +81,14 @@ Unstructured binary data.
## `DList`
```xml
-
+
```
A display list.
-- Optional attributes: `Ucode`, `RawPointers`
+- Optional attributes: `Length`, `Ucode`, `RawPointers`
+
+`Length` can be set to indicate the length (amount of `Gfx` double-words) of the dlist. If not set, the dlist length is automatic.
`Ucode` (defaults to `f3dex2`) picks the graphics microcode for which to disassemble the dlist. It may be `f3dex` or `f3dex2`.
@@ -97,6 +106,7 @@ A fixed-point matrix.
```xml
+
```
@@ -104,13 +114,13 @@ A fixed-point matrix.
A texture, an image in one of the native N64 formats.
- Required attributes for all formats: `Format`, `Width`, `Height`
-- Required attributes for CI formats (`ci4`, `ci8`): `TlutOffset`, or `ExternalTlut` and `ExternalTlutOffset`
+- Required attributes for CI formats (`ci4`, `ci8`): `Tlut`, or `TlutOffset`, or `ExternalTlut` and `ExternalTlutOffset`
`Format` is the format of the texture, one of `rgba32`, `rgba16`, `i4`, `i8`, `ia4`, `ia8`, `ia16`, `ci4` or `ci8`.
`Width` and `Height` specify the dimensions of the texture.
-For CI formats, the TLUT (Texture Look Up Table, or palette) must be specified with either `TlutOffset` if the TLUT is in the same file as the texture, or both of `ExternalTlut` and `ExternalTlutOffset` if the TLUT is in a different file. `ExternalTlut` is the name of the baserom file where the TLUT is. In both cases, the TLUT must also be declared as a resource.
+For CI formats, the TLUT (Texture Look Up Table, or palette) must be specified with either `Tlut` or `TlutOffset` if the TLUT is in the same file as the texture, or both of `ExternalTlut` and `ExternalTlutOffset` if the TLUT is in a different file. `ExternalTlut` is the name of the baserom file where the TLUT is. In both cases, the TLUT must also be declared as a resource.
## `Array`
diff --git a/tools/assets/descriptor/z64resources.py b/tools/assets/descriptor/z64resources.py
index fba264151f..9f241c3118 100644
--- a/tools/assets/descriptor/z64resources.py
+++ b/tools/assets/descriptor/z64resources.py
@@ -10,27 +10,30 @@ from .base import (
ResourceDesc,
ResourcesDescCollection,
ResourceHandlerNeedsPass2Exception,
+ ResourceHasNoSizeError,
)
from . import xml_errors
@dataclasses.dataclass(eq=False)
class CollisionResourceDesc(ResourceDesc):
- pass
+ def get_size(self):
+ return 0x2C
def handler_Collision(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset"})
+ xml_errors.check_attrib(reselem, {"Name"}, {"Offset"})
return CollisionResourceDesc(symbol_name, offset, collection, reselem)
@dataclasses.dataclass(eq=False)
class AnimationResourceDesc(ResourceDesc):
- pass
+ def get_size(self):
+ return 0x10
def handler_Animation(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset"})
+ xml_errors.check_attrib(reselem, {"Name"}, {"Offset"})
return AnimationResourceDesc(symbol_name, offset, collection, reselem)
@@ -40,7 +43,7 @@ class PlayerAnimationResourceDesc(ResourceDesc):
def handler_PlayerAnimation(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset"})
+ xml_errors.check_attrib(reselem, {"Name"}, {"Offset"})
return PlayerAnimationResourceDesc(symbol_name, offset, collection, reselem)
@@ -50,7 +53,7 @@ class LegacyAnimationResourceDesc(ResourceDesc):
def handler_LegacyAnimation(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset"})
+ xml_errors.check_attrib(reselem, {"Name"}, {"Offset"})
return LegacyAnimationResourceDesc(symbol_name, offset, collection, reselem)
@@ -60,7 +63,7 @@ class CutsceneResourceDesc(ResourceDesc):
def handler_Cutscene(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset"})
+ xml_errors.check_attrib(reselem, {"Name"}, {"Offset"})
return CutsceneResourceDesc(symbol_name, offset, collection, reselem)
@@ -70,7 +73,7 @@ class SceneResourceDesc(ResourceDesc):
def handler_Scene(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset"})
+ xml_errors.check_attrib(reselem, {"Name"}, {"Offset"})
return SceneResourceDesc(symbol_name, offset, collection, reselem)
@@ -80,7 +83,7 @@ class RoomResourceDesc(ResourceDesc):
def handler_Room(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset"}, {"HackMode"})
+ xml_errors.check_attrib(reselem, {"Name"}, {"Offset", "HackMode"})
res = RoomResourceDesc(symbol_name, offset, collection, reselem)
if reselem.attrib.get("HackMode") == "syotes_room":
res.hack_modes.add("hackmode_syotes_room")
@@ -93,7 +96,7 @@ class PlayerAnimationDataResourceDesc(ResourceDesc):
def handler_PlayerAnimationData(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset", "FrameCount"})
+ xml_errors.check_attrib(reselem, {"Name", "FrameCount"}, {"Offset"})
frame_count = int(reselem.attrib["FrameCount"])
return PlayerAnimationDataResourceDesc(
symbol_name, offset, collection, reselem, frame_count
@@ -106,7 +109,7 @@ class PathListResourceDesc(ResourceDesc):
def handler_PathList(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset", "NumPaths"})
+ xml_errors.check_attrib(reselem, {"Name", "NumPaths"}, {"Offset"})
num_paths = int(reselem.attrib["NumPaths"])
return PathListResourceDesc(symbol_name, offset, collection, reselem, num_paths)
@@ -133,12 +136,21 @@ class SkeletonResourceDesc(ResourceDesc):
limb_enum_none_member_name: Optional[str]
limb_enum_max_member_name: Optional[str]
+ def get_size(self):
+ skel_size = {
+ SkeletonType.NORMAL: 0x8,
+ SkeletonType.FLEX: 0xC,
+ }.get(self.type)
+ if skel_size is None:
+ raise ResourceHasNoSizeError()
+ return skel_size
+
def handler_Skeleton(symbol_name, offset, collection, reselem: Element):
xml_errors.check_attrib(
reselem,
- {"Name", "Offset", "Type", "LimbType"},
- {"EnumName", "LimbNone", "LimbMax"},
+ {"Name", "Type", "LimbType"},
+ {"Offset", "EnumName", "LimbNone", "LimbMax"},
)
skel_type = SkeletonType[reselem.attrib["Type"].upper()]
limb_type = LimbType[reselem.attrib["LimbType"].upper()]
@@ -160,9 +172,17 @@ class LimbResourceDesc(ResourceDesc):
limb_type: LimbType
limb_enum_member_name: Optional[str]
+ def get_size(self):
+ limb_size = {
+ LimbType.STANDARD: 0xC,
+ }.get(self.limb_type)
+ if limb_size is None:
+ raise ResourceHasNoSizeError()
+ return limb_size
+
def handler_Limb(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset", "LimbType"}, {"EnumName"})
+ xml_errors.check_attrib(reselem, {"Name", "LimbType"}, {"Offset", "EnumName"})
limb_type = LimbType[reselem.attrib["LimbType"].upper()]
return LimbResourceDesc(
symbol_name,
@@ -179,9 +199,12 @@ class LimbTableResourceDesc(ResourceDesc):
limb_type: LimbType
count: int
+ def get_size(self):
+ return self.count * 4
+
def handler_LimbTable(symbol_name, offset, collection, reselem: Element):
- xml_errors.check_attrib(reselem, {"Name", "Offset", "LimbType", "Count"})
+ xml_errors.check_attrib(reselem, {"Name", "LimbType", "Count"}, {"Offset"})
limb_type = LimbType[reselem.attrib["LimbType"].upper()]
count = int(reselem.attrib["Count"])
return LimbTableResourceDesc(
@@ -197,7 +220,7 @@ class CurveAnimationResourceDesc(ResourceDesc):
def handler_CurveAnimation(
symbol_name, offset, collection: ResourcesDescCollection, reselem: Element
):
- xml_errors.check_attrib(reselem, {"Name", "Offset", "SkelOffset"})
+ xml_errors.check_attrib(reselem, {"Name", "SkelOffset"}, {"Offset"})
res = CurveAnimationResourceDesc(symbol_name, offset, collection, reselem, None)
skel_offset = int(reselem.attrib["SkelOffset"], 16)
diff --git a/tools/assets/extract/extase_oot64/dlist_resources.py b/tools/assets/extract/extase_oot64/dlist_resources.py
index f80a2f9954..371bb4d151 100644
--- a/tools/assets/extract/extase_oot64/dlist_resources.py
+++ b/tools/assets/extract/extase_oot64/dlist_resources.py
@@ -1215,6 +1215,12 @@ class DListResource(Resource, can_size_be_unknown=True):
self.target_ucode = target_ucode
self.ignored_raw_pointers: set[int] = set()
+ def set_length(self, length: int):
+ if self.range_end is not None:
+ if length != ((self.range_end - self.range_start) // 8):
+ raise ValueError("length already set and different")
+ self.range_end = self.range_start + length * 8
+
def try_parse_data(self, memory_context):
offset = self.range_start
@@ -1332,8 +1338,13 @@ class DListResource(Resource, can_size_be_unknown=True):
return pygfxd.gfxd_macro_dflt()
+ if self.range_end is None:
+ dlist_data = self.file.data[self.range_start :]
+ else:
+ dlist_data = self.file.data[self.range_start : self.range_end]
+
size = gfxdis(
- input_buffer=self.file.data[self.range_start :],
+ input_buffer=dlist_data,
target=self.target_ucode.gfxd_ucode,
vtx_callback=vtx_cb,
timg_callback=timg_cb,
diff --git a/tools/assets/extract/z64_resource_handlers.py b/tools/assets/extract/z64_resource_handlers.py
index d0b6c2067a..c494243b92 100644
--- a/tools/assets/extract/z64_resource_handlers.py
+++ b/tools/assets/extract/z64_resource_handlers.py
@@ -229,6 +229,8 @@ def register_resource_handlers():
n64resources.GfxMicroCode.F3DEX2: dlist_resources.Ucode.f3dex2,
}[resource_desc.ucode],
)
+ if resource_desc.length is not None:
+ res.set_length(resource_desc.length)
res.ignored_raw_pointers |= resource_desc.raw_pointers
return res