summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2026-04-30 23:11:21 +0200
committerrobojumper <robojumper@gmail.com>2026-05-10 20:05:47 +0200
commit76ace07831aeade7f71ecbafec767ec09860f1ae (patch)
tree21c51e3fcbd348622c23567cb2a73c1dc28a3bc1
parent0146842436b0a9217c013ad61ab206b9854bc0c8 (diff)
rest of the item_mdls OK
-rw-r--r--config/SOUE01/symbols.txt44
-rw-r--r--configure.py6
-rw-r--r--include/toBeSorted/item_mdl_light_fruit.h30
-rw-r--r--include/toBeSorted/item_mdl_stamina_fruit.h30
-rw-r--r--src/toBeSorted/item_mdl_light_fruit.cpp117
-rw-r--r--src/toBeSorted/item_mdl_stamina_fruit.cpp109
6 files changed, 311 insertions, 25 deletions
diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt
index 8fb46bc8..3475a99b 100644
--- a/config/SOUE01/symbols.txt
+++ b/config/SOUE01/symbols.txt
@@ -9543,26 +9543,26 @@ vt_0x20__15dItemMdlRupee_cFUs = .text:0x80170230; // type:function size:0xAC
setPriorityDraw__15dItemMdlRupee_cFv = .text:0x801702E0; // type:function size:0x48
unsetPriorityDraw__15dItemMdlRupee_cFv = .text:0x80170330; // type:function size:0x48
__dt__15dItemMdlRupee_cFv = .text:0x80170380; // type:function size:0x94
-IsItemLightFruit = .text:0x80170420; // type:function size:0x10
-fn_80170430 = .text:0x80170430; // type:function size:0x214
-fn_80170650 = .text:0x80170650; // type:function size:0x1C
-fn_80170670 = .text:0x80170670; // type:function size:0x48
-fn_801706C0 = .text:0x801706C0; // type:function size:0x48
-fn_80170710 = .text:0x80170710; // type:function size:0x84
-fn_801707A0 = .text:0x801707A0; // type:function size:0x4
-fn_801707B0 = .text:0x801707B0; // type:function size:0x48
-fn_80170800 = .text:0x80170800; // type:function size:0x48
-fn_80170850 = .text:0x80170850; // type:function size:0x94
-isItemStaminaFruit = .text:0x801708F0; // type:function size:0x10
-fn_80170900 = .text:0x80170900; // type:function size:0x204
-fn_80170B10 = .text:0x80170B10; // type:function size:0x1C
-fn_80170B30 = .text:0x80170B30; // type:function size:0x48
-fn_80170B80 = .text:0x80170B80; // type:function size:0x48
-fn_80170BD0 = .text:0x80170BD0; // type:function size:0x84
-fn_80170C60 = .text:0x80170C60; // type:function size:0x4
-fn_80170C70 = .text:0x80170C70; // type:function size:0x48
-fn_80170CC0 = .text:0x80170CC0; // type:function size:0x48
-fn_80170D10 = .text:0x80170D10; // type:function size:0x94
+isMdlForItemId__20dItemMdlLightFruit_cFUs = .text:0x80170420; // type:function size:0x10
+init__20dItemMdlLightFruit_cFUsP9dAcItem_cP12mAllocator_c = .text:0x80170430; // type:function size:0x214
+vt_0x10__20dItemMdlLightFruit_cFUc = .text:0x80170650; // type:function size:0x1C
+setScale__20dItemMdlLightFruit_cFRC7mVec3_c = .text:0x80170670; // type:function size:0x48
+setLocalMtx__20dItemMdlLightFruit_cFRC6mMtx_c = .text:0x801706C0; // type:function size:0x48
+draw__20dItemMdlLightFruit_cFv = .text:0x80170710; // type:function size:0x84
+vt_0x20__20dItemMdlLightFruit_cFUs = .text:0x801707A0; // type:function size:0x4
+setPriorityDraw__20dItemMdlLightFruit_cFv = .text:0x801707B0; // type:function size:0x48
+unsetPriorityDraw__20dItemMdlLightFruit_cFv = .text:0x80170800; // type:function size:0x48
+__dt__20dItemMdlLightFruit_cFv = .text:0x80170850; // type:function size:0x94
+isMdlForItemId__22dItemMdlStaminaFruit_cFUs = .text:0x801708F0; // type:function size:0x10
+init__22dItemMdlStaminaFruit_cFUsP9dAcItem_cP12mAllocator_c = .text:0x80170900; // type:function size:0x204
+vt_0x10__22dItemMdlStaminaFruit_cFUc = .text:0x80170B10; // type:function size:0x1C
+setScale__22dItemMdlStaminaFruit_cFRC7mVec3_c = .text:0x80170B30; // type:function size:0x48
+setLocalMtx__22dItemMdlStaminaFruit_cFRC6mMtx_c = .text:0x80170B80; // type:function size:0x48
+draw__22dItemMdlStaminaFruit_cFv = .text:0x80170BD0; // type:function size:0x84
+vt_0x20__22dItemMdlStaminaFruit_cFUs = .text:0x80170C60; // type:function size:0x4
+setPriorityDraw__22dItemMdlStaminaFruit_cFv = .text:0x80170C70; // type:function size:0x48
+unsetPriorityDraw__22dItemMdlStaminaFruit_cFv = .text:0x80170CC0; // type:function size:0x48
+__dt__22dItemMdlStaminaFruit_cFv = .text:0x80170D10; // type:function size:0x94
fn_80170DB0 = .text:0x80170DB0; // type:function size:0x8
fn_80170DC0 = .text:0x80170DC0; // type:function size:0x8
fn_80170DD0 = .text:0x80170DD0; // type:function size:0x8
@@ -35245,9 +35245,9 @@ __vt__14dItemMdlItem_c = .data:0x80528A38; // type:object size:0x30
lbl_80528A68 = .data:0x80528A68; // type:object size:0x9 data:string
lbl_80528A74 = .data:0x80528A74; // type:object size:0x9 data:string
__vt__15dItemMdlRupee_c = .data:0x80528A80; // type:object size:0x30
-LightFruitModel_vtable = .data:0x80528AB0; // type:object size:0x30
+__vt__20dItemMdlLightFruit_c = .data:0x80528AB0; // type:object size:0x30
lbl_80528AE0 = .data:0x80528AE0; // type:object size:0xA data:string
-StaminaFruitModel_vtable = .data:0x80528AF0; // type:object size:0x30
+__vt__22dItemMdlStaminaFruit_c = .data:0x80528AF0; // type:object size:0x30
lbl_80528B20 = .data:0x80528B20; // type:object size:0x78
lbl_80528B98 = .data:0x80528B98; // type:object size:0x20
lbl_80528BB8 = .data:0x80528BB8; // type:object size:0x1C data:string
diff --git a/configure.py b/configure.py
index 47ababb1..812b59ab 100644
--- a/configure.py
+++ b/configure.py
@@ -595,9 +595,9 @@ config.libs = [
Object(Matching, "toBeSorted/counters/extra_wallet_counter.cpp"),
Object(Matching, "toBeSorted/item_mdl_misc.cpp"),
Object(Matching, "toBeSorted/item_mdl_item.cpp"),
- Object(Matching, "toBeSorted/item_mdl_rupee.cpp"),
- Object(NonMatching, "toBeSorted/item_mdl_light_fruit.cpp"),
- Object(NonMatching, "toBeSorted/item_mdl_stamina_fruit.cpp"),
+ Object(Matching, "toBeSorted/item_mdl_rupee.cpp"), # non-deterministic codegen
+ Object(Matching, "toBeSorted/item_mdl_light_fruit.cpp"),
+ Object(Matching, "toBeSorted/item_mdl_stamina_fruit.cpp"),
Object(NonMatching, "toBeSorted/item_spawn.cpp"), # probably multiple files, see sdata2
Object(NonMatching, "toBeSorted/unk_screen_effect.cpp"),
Object(NonMatching, "toBeSorted/revision_info.cpp"),
diff --git a/include/toBeSorted/item_mdl_light_fruit.h b/include/toBeSorted/item_mdl_light_fruit.h
new file mode 100644
index 00000000..0711ed38
--- /dev/null
+++ b/include/toBeSorted/item_mdl_light_fruit.h
@@ -0,0 +1,30 @@
+#ifndef TOBESORTED_ITEM_MDL_LIGHT_FRUIT_H
+#define TOBESORTED_ITEM_MDL_LIGHT_FRUIT_H
+
+#include "m/m3d/m_smdl.h"
+#include "m/m3d/m_anmtexsrt.h"
+#include "toBeSorted/item_mdl.h"
+
+
+class dItemMdlLightFruit_c : public dItemMdl_c {
+public:
+ /* 0x08 */ virtual ~dItemMdlLightFruit_c() {}
+ /* 0x0C */ virtual bool init(u16 itemId, dAcItem_c *item, mAllocator_c *allocator) override;
+ /* 0x10 */ virtual void vt_0x10(u8) override;
+ /* 0x14 */ virtual void setScale(const mVec3_c &scale) override;
+ /* 0x18 */ virtual void setLocalMtx(const mMtx_c &mtx) override;
+ /* 0x1C */ virtual void draw() override;
+ /* 0x20 */ virtual void vt_0x20(u16 itemId) override;
+ /* 0x24 */ virtual void setPriorityDraw() override;
+ /* 0x28 */ virtual void unsetPriorityDraw() override;
+
+ static bool isMdlForItemId(u16 itemId);
+
+private:
+ /* 0x18 */ m3d::smdl_c mMdl1;
+ /* 0x34 */ m3d::smdl_c mMdl2;
+ /* 0x50 */ m3d::anmTexSrt_c mAnmTexSrt1;
+ /* 0x7C */ m3d::anmTexSrt_c mAnmTexSrt2;
+};
+
+#endif
diff --git a/include/toBeSorted/item_mdl_stamina_fruit.h b/include/toBeSorted/item_mdl_stamina_fruit.h
new file mode 100644
index 00000000..b2b0adf7
--- /dev/null
+++ b/include/toBeSorted/item_mdl_stamina_fruit.h
@@ -0,0 +1,30 @@
+#ifndef TOBESORTED_ITEM_MDL_STAMINA_FRUIT_H
+#define TOBESORTED_ITEM_MDL_STAMINA_FRUIT_H
+
+#include "m/m3d/m_smdl.h"
+#include "m/m3d/m_anmtexsrt.h"
+#include "toBeSorted/item_mdl.h"
+
+
+class dItemMdlStaminaFruit_c : public dItemMdl_c {
+public:
+ /* 0x08 */ virtual ~dItemMdlStaminaFruit_c() {}
+ /* 0x0C */ virtual bool init(u16 itemId, dAcItem_c *item, mAllocator_c *allocator) override;
+ /* 0x10 */ virtual void vt_0x10(u8) override;
+ /* 0x14 */ virtual void setScale(const mVec3_c &scale) override;
+ /* 0x18 */ virtual void setLocalMtx(const mMtx_c &mtx) override;
+ /* 0x1C */ virtual void draw() override;
+ /* 0x20 */ virtual void vt_0x20(u16 itemId) override;
+ /* 0x24 */ virtual void setPriorityDraw() override;
+ /* 0x28 */ virtual void unsetPriorityDraw() override;
+
+ static bool isMdlForItemId(u16 itemId);
+
+private:
+ /* 0x18 */ m3d::smdl_c mMdl1;
+ /* 0x34 */ m3d::smdl_c mMdl2;
+ /* 0x50 */ m3d::anmTexSrt_c mAnmTexSrt1;
+ /* 0x7C */ m3d::anmTexSrt_c mAnmTexSrt2;
+};
+
+#endif
diff --git a/src/toBeSorted/item_mdl_light_fruit.cpp b/src/toBeSorted/item_mdl_light_fruit.cpp
new file mode 100644
index 00000000..2a1e5b7a
--- /dev/null
+++ b/src/toBeSorted/item_mdl_light_fruit.cpp
@@ -0,0 +1,117 @@
+#include "toBeSorted/item_mdl_light_fruit.h"
+
+#include "common.h"
+#include "d/a/d_a_item.h"
+#include "d/a/d_a_itembase.h"
+#include "toBeSorted/arc_managers/oarc_manager.h"
+
+
+bool dItemMdlLightFruit_c::isMdlForItemId(u16 itemId) {
+ return itemId == ITEM_LIGHT_FRUIT;
+}
+
+bool dItemMdlLightFruit_c::init(u16 itemId, dAcItem_c *item, mAllocator_c *allocator) {
+ if (item == nullptr) {
+ return false;
+ }
+
+ {
+ void *resData1 = OarcManager::GetInstance()->getMdlFromArc2("PutHoly");
+ if (resData1 == nullptr) {
+ return false;
+ }
+ nw4r::g3d::ResFile res1(resData1);
+ if (!res1.IsValid()) {
+ return false;
+ }
+
+ nw4r::g3d::ResMdl mdl1 = res1.GetResMdl("PutHoly");
+ if (!mdl1.IsValid()) {
+ return false;
+ }
+ if (!mMdl1.create(mdl1, allocator, 0x324)) {
+ return false;
+ }
+
+ nw4r::g3d::ResAnmTexSrt anmTexSrt1 = res1.GetResAnmTexSrt("Holy");
+ if (!anmTexSrt1.IsValid()) {
+ return false;
+ }
+ TRY_CREATE(mAnmTexSrt1.create(mdl1, anmTexSrt1, allocator, nullptr, 1));
+ mMdl1.setAnm(mAnmTexSrt1);
+ }
+
+ {
+ void *resData2 = OarcManager::GetInstance()->getMdlFromArc2("GetHoly");
+ if (resData2 == nullptr) {
+ // return false;
+ }
+ nw4r::g3d::ResFile res2(resData2);
+ if (!res2.IsValid()) {
+ return false;
+ }
+
+ nw4r::g3d::ResMdl mdl2 = res2.GetResMdl("GetHoly");
+ if (!mdl2.IsValid()) {
+ return false;
+ }
+ if (!mMdl2.create(mdl2, allocator, 0x324)) {
+ return false;
+ }
+
+ nw4r::g3d::ResAnmTexSrt anmTexSrt2 = res2.GetResAnmTexSrt("Holy");
+ if (!anmTexSrt2.IsValid()) {
+ return false;
+ }
+ TRY_CREATE(mAnmTexSrt2.create(mdl2, anmTexSrt2, allocator, nullptr, 1));
+ mMdl2.setAnm(mAnmTexSrt2);
+ }
+
+ mpItem = item;
+ return true;
+}
+
+void dItemMdlLightFruit_c::vt_0x10(u8 arg) {
+ if (arg == ITEM_MDL_UNK0x14_3) {
+ field_0x14 = ITEM_MDL_UNK0x14_1;
+ } else {
+ field_0x14 = arg;
+ }
+}
+
+void dItemMdlLightFruit_c::setScale(const mVec3_c &scale) {
+ mMdl1.setScale(scale);
+ mMdl2.setScale(scale);
+}
+
+void dItemMdlLightFruit_c::setLocalMtx(const mMtx_c &mtx) {
+ mMdl1.setLocalMtx(mtx);
+ mMdl2.setLocalMtx(mtx);
+}
+
+void dItemMdlLightFruit_c::draw() {
+ switch (field_0x14) {
+ case ITEM_MDL_UNK0x14_1:
+ mAnmTexSrt1.play();
+ mpItem->fn_8002ECD0(&mMdl1, 7);
+ break;
+ case ITEM_MDL_UNK0x14_2:
+ mAnmTexSrt2.play();
+ mpItem->fn_8002ECD0(&mMdl2, 6);
+ break;
+ }
+}
+
+void dItemMdlLightFruit_c::vt_0x20(u16 itemId) {
+ // no-op
+}
+
+void dItemMdlLightFruit_c::setPriorityDraw() {
+ mMdl1.setPriorityDraw(0x82, 0x7F);
+ mMdl2.setPriorityDraw(0x82, 0x7F);
+}
+
+void dItemMdlLightFruit_c::unsetPriorityDraw() {
+ mMdl1.setPriorityDraw(0x7F, 0x7F);
+ mMdl2.setPriorityDraw(0x7F, 0x7F);
+}
diff --git a/src/toBeSorted/item_mdl_stamina_fruit.cpp b/src/toBeSorted/item_mdl_stamina_fruit.cpp
new file mode 100644
index 00000000..5aee364d
--- /dev/null
+++ b/src/toBeSorted/item_mdl_stamina_fruit.cpp
@@ -0,0 +1,109 @@
+#include "toBeSorted/item_mdl_stamina_fruit.h"
+
+#include "common.h"
+#include "d/a/d_a_item.h"
+#include "d/a/d_a_itembase.h"
+#include "toBeSorted/arc_managers/oarc_manager.h"
+
+bool dItemMdlStaminaFruit_c::isMdlForItemId(u16 itemId) {
+ return itemId == ITEM_STAMINA_FRUIT;
+}
+
+bool dItemMdlStaminaFruit_c::init(u16 itemId, dAcItem_c *item, mAllocator_c *allocator) {
+ void *resData1 = OarcManager::GetInstance()->getMdlFromArc2("PutGuts");
+ if (resData1 == nullptr) {
+ return false;
+ }
+ nw4r::g3d::ResFile res1(resData1);
+ if (!res1.IsValid()) {
+ return false;
+ }
+
+ nw4r::g3d::ResMdl mdl1 = res1.GetResMdl("PutGuts");
+ if (!mdl1.IsValid()) {
+ return false;
+ }
+ if (!mMdl1.create(mdl1, allocator, 0x324)) {
+ return false;
+ }
+
+ void *resData2 = OarcManager::GetInstance()->getMdlFromArc2("GetGuts");
+ if (resData2 == nullptr) {
+ return false;
+ }
+ nw4r::g3d::ResFile res2(resData2);
+ if (!res2.IsValid()) {
+ return false;
+ }
+
+ nw4r::g3d::ResMdl mdl2 = res2.GetResMdl("GetGuts");
+ if (!mdl2.IsValid()) {
+ return false;
+ }
+ if (!mMdl2.create(mdl2, allocator, 0x324)) {
+ return false;
+ }
+
+ nw4r::g3d::ResAnmTexSrt anmTexSrt1 = res1.GetResAnmTexSrt("GutsLight");
+ if (!anmTexSrt1.IsValid()) {
+ return false;
+ }
+ TRY_CREATE(mAnmTexSrt1.create(mdl1, anmTexSrt1, allocator, nullptr, 1));
+ mMdl1.setAnm(mAnmTexSrt1);
+
+ nw4r::g3d::ResAnmTexSrt anmTexSrt2 = res2.GetResAnmTexSrt("GutsLight");
+ if (!anmTexSrt2.IsValid()) {
+ return false;
+ }
+ TRY_CREATE(mAnmTexSrt2.create(mdl2, anmTexSrt2, allocator, nullptr, 1));
+ mMdl2.setAnm(mAnmTexSrt2);
+
+ mpItem = item;
+
+ return true;
+}
+
+void dItemMdlStaminaFruit_c::vt_0x10(u8 arg) {
+ if (arg == ITEM_MDL_UNK0x14_3) {
+ field_0x14 = ITEM_MDL_UNK0x14_1;
+ } else {
+ field_0x14 = arg;
+ }
+}
+
+void dItemMdlStaminaFruit_c::setScale(const mVec3_c &scale) {
+ mMdl1.setScale(scale);
+ mMdl2.setScale(scale);
+}
+
+void dItemMdlStaminaFruit_c::setLocalMtx(const mMtx_c &mtx) {
+ mMdl1.setLocalMtx(mtx);
+ mMdl2.setLocalMtx(mtx);
+}
+
+void dItemMdlStaminaFruit_c::draw() {
+ switch (field_0x14) {
+ case ITEM_MDL_UNK0x14_1:
+ mAnmTexSrt1.play();
+ mpItem->fn_8002ECD0(&mMdl1, 7);
+ break;
+ case ITEM_MDL_UNK0x14_2:
+ mAnmTexSrt2.play();
+ mpItem->fn_8002ECD0(&mMdl2, 6);
+ break;
+ }
+}
+
+void dItemMdlStaminaFruit_c::vt_0x20(u16 itemId) {
+ // no-op
+}
+
+void dItemMdlStaminaFruit_c::setPriorityDraw() {
+ mMdl1.setPriorityDraw(0x82, 0x7F);
+ mMdl2.setPriorityDraw(0x82, 0x7F);
+}
+
+void dItemMdlStaminaFruit_c::unsetPriorityDraw() {
+ mMdl1.setPriorityDraw(0x7F, 0x7F);
+ mMdl2.setPriorityDraw(0x7F, 0x7F);
+}