diff --git a/Progress.md b/Progress.md index a653b5b9c2e..14aa9c26777 100644 --- a/Progress.md +++ b/Progress.md @@ -7,22 +7,22 @@ Section | Percentage | Decompiled (bytes) | Total (bytes) .init | 97.972973% | 9280 | 9472 .extab | 100.000000% | 96 | 96 .extabindex | 100.000000% | 96 | 96 -.text | 34.564182% | 1243116 | 3596544 +.text | 35.014503% | 1259312 | 3596544 .ctors | 100.000000% | 448 | 448 .dtors | 100.000000% | 32 | 32 .rodata | 100.000000% | 193856 | 193856 .data | 100.000000% | 197632 | 197632 .sdata | 100.000000% | 1408 | 1408 .sdata2 | 100.000000% | 20832 | 20832 -Total | 41.462024% | 1667052 | 4020672 +Total | 41.864842% | 1683248 | 4020672 ## Total Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- -main.dol | 41.462024% | 1667052 | 4020672 +main.dol | 41.864842% | 1683248 | 4020672 RELs | 34.759751% | 3997484 | 11500324 -Total | 36.495957% | 5664536 | 15520996 +Total | 36.600306% | 5680732 | 15520996 ## RELs diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/getFmtType__FP17_GXVtxAttrFmtList7_GXAttr.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/getFmtType__FP17_GXVtxAttrFmtList7_GXAttr.s deleted file mode 100644 index 2f249bba3ae..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/getFmtType__FP17_GXVtxAttrFmtList7_GXAttr.s +++ /dev/null @@ -1,15 +0,0 @@ -lbl_803351A4: -/* 803351A4 48 00 00 18 */ b lbl_803351BC -lbl_803351A8: -/* 803351A8 7C 00 20 00 */ cmpw r0, r4 -/* 803351AC 40 82 00 0C */ bne lbl_803351B8 -/* 803351B0 80 63 00 08 */ lwz r3, 8(r3) -/* 803351B4 4E 80 00 20 */ blr -lbl_803351B8: -/* 803351B8 38 63 00 10 */ addi r3, r3, 0x10 -lbl_803351BC: -/* 803351BC 80 03 00 00 */ lwz r0, 0(r3) -/* 803351C0 2C 00 00 FF */ cmpwi r0, 0xff -/* 803351C4 40 82 FF E4 */ bne lbl_803351A8 -/* 803351C8 38 60 00 04 */ li r3, 4 -/* 803351CC 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/modifyMaterial__14J3DModelLoaderFUl.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/modifyMaterial__14J3DModelLoaderFUl.s deleted file mode 100644 index eb52ba4db52..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/modifyMaterial__14J3DModelLoaderFUl.s +++ /dev/null @@ -1,35 +0,0 @@ -lbl_8033631C: -/* 8033631C 94 21 FF 60 */ stwu r1, -0xa0(r1) -/* 80336320 7C 08 02 A6 */ mflr r0 -/* 80336324 90 01 00 A4 */ stw r0, 0xa4(r1) -/* 80336328 93 E1 00 9C */ stw r31, 0x9c(r1) -/* 8033632C 93 C1 00 98 */ stw r30, 0x98(r1) -/* 80336330 7C 7E 1B 78 */ mr r30, r3 -/* 80336334 54 80 04 A5 */ rlwinm. r0, r4, 0, 0x12, 0x12 -/* 80336338 41 82 00 48 */ beq lbl_80336380 -/* 8033633C 38 61 00 08 */ addi r3, r1, 8 -/* 80336340 80 9E 00 10 */ lwz r4, 0x10(r30) -/* 80336344 4B FF 9C A9 */ bl __ct__18J3DMaterialFactoryFRC16J3DMaterialBlock -/* 80336348 3B E0 00 00 */ li r31, 0 -/* 8033634C 48 00 00 20 */ b lbl_8033636C -lbl_80336350: -/* 80336350 38 61 00 08 */ addi r3, r1, 8 -/* 80336354 80 84 00 08 */ lwz r4, 8(r4) -/* 80336358 57 E5 04 3E */ clrlwi r5, r31, 0x10 -/* 8033635C 57 E0 13 BA */ rlwinm r0, r31, 2, 0xe, 0x1d -/* 80336360 7C 84 00 2E */ lwzx r4, r4, r0 -/* 80336364 4B FF B3 29 */ bl modifyPatchedCurrentMtx__18J3DMaterialFactoryCFP11J3DMateriali -/* 80336368 3B FF 00 01 */ addi r31, r31, 1 -lbl_8033636C: -/* 8033636C 57 E3 04 3E */ clrlwi r3, r31, 0x10 -/* 80336370 80 9E 00 08 */ lwz r4, 8(r30) -/* 80336374 A0 04 00 04 */ lhz r0, 4(r4) -/* 80336378 7C 03 00 40 */ cmplw r3, r0 -/* 8033637C 41 80 FF D4 */ blt lbl_80336350 -lbl_80336380: -/* 80336380 83 E1 00 9C */ lwz r31, 0x9c(r1) -/* 80336384 83 C1 00 98 */ lwz r30, 0x98(r1) -/* 80336388 80 01 00 A4 */ lwz r0, 0xa4(r1) -/* 8033638C 7C 08 03 A6 */ mtlr r0 -/* 80336390 38 21 00 A0 */ addi r1, r1, 0xa0 -/* 80336394 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readDraw__14J3DModelLoaderFPC12J3DDrawBlock.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readDraw__14J3DModelLoaderFPC12J3DDrawBlock.s deleted file mode 100644 index 40a48d49a7b..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readDraw__14J3DModelLoaderFPC12J3DDrawBlock.s +++ /dev/null @@ -1,48 +0,0 @@ -lbl_80335480: -/* 80335480 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80335484 7C 08 02 A6 */ mflr r0 -/* 80335488 90 01 00 24 */ stw r0, 0x24(r1) -/* 8033548C 39 61 00 20 */ addi r11, r1, 0x20 -/* 80335490 48 02 CD 4D */ bl _savegpr_29 -/* 80335494 7C 7D 1B 78 */ mr r29, r3 -/* 80335498 7C 9F 23 78 */ mr r31, r4 -/* 8033549C 83 C3 00 04 */ lwz r30, 4(r3) -/* 803354A0 A0 7E 00 2E */ lhz r3, 0x2e(r30) -/* 803354A4 A0 04 00 08 */ lhz r0, 8(r4) -/* 803354A8 7C 03 00 50 */ subf r0, r3, r0 -/* 803354AC B0 1E 00 44 */ sth r0, 0x44(r30) -/* 803354B0 7F E3 FB 78 */ mr r3, r31 -/* 803354B4 80 84 00 0C */ lwz r4, 0xc(r4) -/* 803354B8 4B FB ED A9 */ bl func_802F4260 -/* 803354BC 90 7E 00 48 */ stw r3, 0x48(r30) -/* 803354C0 7F E3 FB 78 */ mr r3, r31 -/* 803354C4 80 9F 00 10 */ lwz r4, 0x10(r31) -/* 803354C8 4B FB ED F9 */ bl func_802F42C0 -/* 803354CC 90 7E 00 4C */ stw r3, 0x4c(r30) -/* 803354D0 38 A0 00 00 */ li r5, 0 -/* 803354D4 A0 9E 00 44 */ lhz r4, 0x44(r30) -/* 803354D8 48 00 00 1C */ b lbl_803354F4 -lbl_803354DC: -/* 803354DC 80 7E 00 48 */ lwz r3, 0x48(r30) -/* 803354E0 54 A0 04 3E */ clrlwi r0, r5, 0x10 -/* 803354E4 7C 03 00 AE */ lbzx r0, r3, r0 -/* 803354E8 28 00 00 01 */ cmplwi r0, 1 -/* 803354EC 41 82 00 14 */ beq lbl_80335500 -/* 803354F0 38 A5 00 01 */ addi r5, r5, 1 -lbl_803354F4: -/* 803354F4 54 A0 04 3E */ clrlwi r0, r5, 0x10 -/* 803354F8 7C 00 20 40 */ cmplw r0, r4 -/* 803354FC 41 80 FF E0 */ blt lbl_803354DC -lbl_80335500: -/* 80335500 B0 BE 00 46 */ sth r5, 0x46(r30) -/* 80335504 83 FD 00 04 */ lwz r31, 4(r29) -/* 80335508 A0 1E 00 44 */ lhz r0, 0x44(r30) -/* 8033550C 54 03 08 3C */ slwi r3, r0, 1 -/* 80335510 4B F9 97 B5 */ bl __nwa__FUl -/* 80335514 90 7F 00 40 */ stw r3, 0x40(r31) -/* 80335518 39 61 00 20 */ addi r11, r1, 0x20 -/* 8033551C 48 02 CD 0D */ bl _restgpr_29 -/* 80335520 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80335524 7C 08 03 A6 */ mtlr r0 -/* 80335528 38 21 00 20 */ addi r1, r1, 0x20 -/* 8033552C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readEnvelop__14J3DModelLoaderFPC16J3DEnvelopeBlock.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readEnvelop__14J3DModelLoaderFPC16J3DEnvelopeBlock.s deleted file mode 100644 index 3363e7fa149..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readEnvelop__14J3DModelLoaderFPC16J3DEnvelopeBlock.s +++ /dev/null @@ -1,37 +0,0 @@ -lbl_803353F0: -/* 803353F0 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 803353F4 7C 08 02 A6 */ mflr r0 -/* 803353F8 90 01 00 24 */ stw r0, 0x24(r1) -/* 803353FC 39 61 00 20 */ addi r11, r1, 0x20 -/* 80335400 48 02 CD DD */ bl _savegpr_29 -/* 80335404 7C 7D 1B 78 */ mr r29, r3 -/* 80335408 7C 9E 23 78 */ mr r30, r4 -/* 8033540C 80 63 00 04 */ lwz r3, 4(r3) -/* 80335410 A0 04 00 08 */ lhz r0, 8(r4) -/* 80335414 B0 03 00 2E */ sth r0, 0x2e(r3) -/* 80335418 83 FD 00 04 */ lwz r31, 4(r29) -/* 8033541C 7F C3 F3 78 */ mr r3, r30 -/* 80335420 80 84 00 0C */ lwz r4, 0xc(r4) -/* 80335424 4B FB EE 3D */ bl func_802F4260 -/* 80335428 90 7F 00 30 */ stw r3, 0x30(r31) -/* 8033542C 83 FD 00 04 */ lwz r31, 4(r29) -/* 80335430 7F C3 F3 78 */ mr r3, r30 -/* 80335434 80 9E 00 10 */ lwz r4, 0x10(r30) -/* 80335438 4B FB EE 89 */ bl func_802F42C0 -/* 8033543C 90 7F 00 34 */ stw r3, 0x34(r31) -/* 80335440 83 FD 00 04 */ lwz r31, 4(r29) -/* 80335444 7F C3 F3 78 */ mr r3, r30 -/* 80335448 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 8033544C 4B FD 51 15 */ bl func_8030A560 -/* 80335450 90 7F 00 38 */ stw r3, 0x38(r31) -/* 80335454 83 FD 00 04 */ lwz r31, 4(r29) -/* 80335458 7F C3 F3 78 */ mr r3, r30 -/* 8033545C 80 9E 00 18 */ lwz r4, 0x18(r30) -/* 80335460 48 00 12 A5 */ bl func_80336704 -/* 80335464 90 7F 00 3C */ stw r3, 0x3c(r31) -/* 80335468 39 61 00 20 */ addi r11, r1, 0x20 -/* 8033546C 48 02 CD BD */ bl _restgpr_29 -/* 80335470 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80335474 7C 08 03 A6 */ mtlr r0 -/* 80335478 38 21 00 20 */ addi r1, r1, 0x20 -/* 8033547C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readJoint__14J3DModelLoaderFPC13J3DJointBlock.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readJoint__14J3DModelLoaderFPC13J3DJointBlock.s deleted file mode 100644 index 52e8e4cd864..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readJoint__14J3DModelLoaderFPC13J3DJointBlock.s +++ /dev/null @@ -1,63 +0,0 @@ -lbl_80335530: -/* 80335530 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80335534 7C 08 02 A6 */ mflr r0 -/* 80335538 90 01 00 24 */ stw r0, 0x24(r1) -/* 8033553C 39 61 00 20 */ addi r11, r1, 0x20 -/* 80335540 48 02 CC 9D */ bl _savegpr_29 -/* 80335544 7C 7F 1B 78 */ mr r31, r3 -/* 80335548 7C 9D 23 78 */ mr r29, r4 -/* 8033554C 38 61 00 08 */ addi r3, r1, 8 -/* 80335550 48 00 1C 29 */ bl __ct__15J3DJointFactoryFRC13J3DJointBlock -/* 80335554 80 7F 00 04 */ lwz r3, 4(r31) -/* 80335558 A0 1D 00 08 */ lhz r0, 8(r29) -/* 8033555C B0 03 00 2C */ sth r0, 0x2c(r3) -/* 80335560 80 1D 00 14 */ lwz r0, 0x14(r29) -/* 80335564 28 00 00 00 */ cmplwi r0, 0 -/* 80335568 41 82 00 3C */ beq lbl_803355A4 -/* 8033556C 38 60 00 10 */ li r3, 0x10 -/* 80335570 4B F9 96 DD */ bl __nw__FUl -/* 80335574 7C 7E 1B 79 */ or. r30, r3, r3 -/* 80335578 41 82 00 20 */ beq lbl_80335598 -/* 8033557C 7F A3 EB 78 */ mr r3, r29 -/* 80335580 80 9D 00 14 */ lwz r4, 0x14(r29) -/* 80335584 4B FD 4F AD */ bl func_8030A530 -/* 80335588 7C 64 1B 78 */ mr r4, r3 -/* 8033558C 7F C3 F3 78 */ mr r3, r30 -/* 80335590 4B FA 94 51 */ bl __ct__10JUTNameTabFPC7ResNTAB -/* 80335594 7C 7E 1B 78 */ mr r30, r3 -lbl_80335598: -/* 80335598 80 7F 00 04 */ lwz r3, 4(r31) -/* 8033559C 93 C3 00 54 */ stw r30, 0x54(r3) -/* 803355A0 48 00 00 10 */ b lbl_803355B0 -lbl_803355A4: -/* 803355A4 80 7F 00 04 */ lwz r3, 4(r31) -/* 803355A8 38 00 00 00 */ li r0, 0 -/* 803355AC 90 03 00 54 */ stw r0, 0x54(r3) -lbl_803355B0: -/* 803355B0 83 DF 00 04 */ lwz r30, 4(r31) -/* 803355B4 A0 1E 00 2C */ lhz r0, 0x2c(r30) -/* 803355B8 54 03 10 3A */ slwi r3, r0, 2 -/* 803355BC 4B F9 97 09 */ bl __nwa__FUl -/* 803355C0 90 7E 00 28 */ stw r3, 0x28(r30) -/* 803355C4 3B A0 00 00 */ li r29, 0 -/* 803355C8 48 00 00 20 */ b lbl_803355E8 -lbl_803355CC: -/* 803355CC 38 61 00 08 */ addi r3, r1, 8 -/* 803355D0 57 A4 04 3E */ clrlwi r4, r29, 0x10 -/* 803355D4 48 00 1B FD */ bl create__15J3DJointFactoryFi -/* 803355D8 80 9E 00 28 */ lwz r4, 0x28(r30) -/* 803355DC 57 A0 13 BA */ rlwinm r0, r29, 2, 0xe, 0x1d -/* 803355E0 7C 64 01 2E */ stwx r3, r4, r0 -/* 803355E4 3B BD 00 01 */ addi r29, r29, 1 -lbl_803355E8: -/* 803355E8 83 DF 00 04 */ lwz r30, 4(r31) -/* 803355EC A0 7E 00 2C */ lhz r3, 0x2c(r30) -/* 803355F0 57 A0 04 3E */ clrlwi r0, r29, 0x10 -/* 803355F4 7C 00 18 40 */ cmplw r0, r3 -/* 803355F8 41 80 FF D4 */ blt lbl_803355CC -/* 803355FC 39 61 00 20 */ addi r11, r1, 0x20 -/* 80335600 48 02 CC 29 */ bl _restgpr_29 -/* 80335604 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80335608 7C 08 03 A6 */ mtlr r0 -/* 8033560C 38 21 00 20 */ addi r1, r1, 0x20 -/* 80335610 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialTable__18J3DModelLoader_v26FPC16J3DMaterialBlockUl.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialTable__18J3DModelLoader_v26FPC16J3DMaterialBlockUl.s deleted file mode 100644 index ee32793a0d5..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialTable__18J3DModelLoader_v26FPC16J3DMaterialBlockUl.s +++ /dev/null @@ -1,87 +0,0 @@ -lbl_80335CE4: -/* 80335CE4 94 21 FF 60 */ stwu r1, -0xa0(r1) -/* 80335CE8 7C 08 02 A6 */ mflr r0 -/* 80335CEC 90 01 00 A4 */ stw r0, 0xa4(r1) -/* 80335CF0 39 61 00 A0 */ addi r11, r1, 0xa0 -/* 80335CF4 48 02 C4 E5 */ bl _savegpr_28 -/* 80335CF8 7C 7E 1B 78 */ mr r30, r3 -/* 80335CFC 7C 9C 23 78 */ mr r28, r4 -/* 80335D00 7C BF 2B 78 */ mr r31, r5 -/* 80335D04 38 61 00 08 */ addi r3, r1, 8 -/* 80335D08 4B FF A2 E5 */ bl __ct__18J3DMaterialFactoryFRC16J3DMaterialBlock -/* 80335D0C A0 1C 00 08 */ lhz r0, 8(r28) -/* 80335D10 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335D14 B0 03 00 04 */ sth r0, 4(r3) -/* 80335D18 80 1C 00 14 */ lwz r0, 0x14(r28) -/* 80335D1C 28 00 00 00 */ cmplwi r0, 0 -/* 80335D20 41 82 00 3C */ beq lbl_80335D5C -/* 80335D24 38 60 00 10 */ li r3, 0x10 -/* 80335D28 4B F9 8F 25 */ bl __nw__FUl -/* 80335D2C 7C 7D 1B 79 */ or. r29, r3, r3 -/* 80335D30 41 82 00 20 */ beq lbl_80335D50 -/* 80335D34 7F 83 E3 78 */ mr r3, r28 -/* 80335D38 80 9C 00 14 */ lwz r4, 0x14(r28) -/* 80335D3C 4B FD 47 F5 */ bl func_8030A530 -/* 80335D40 7C 64 1B 78 */ mr r4, r3 -/* 80335D44 7F A3 EB 78 */ mr r3, r29 -/* 80335D48 4B FA 8C 99 */ bl __ct__10JUTNameTabFPC7ResNTAB -/* 80335D4C 7C 7D 1B 78 */ mr r29, r3 -lbl_80335D50: -/* 80335D50 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335D54 93 A3 00 0C */ stw r29, 0xc(r3) -/* 80335D58 48 00 00 10 */ b lbl_80335D68 -lbl_80335D5C: -/* 80335D5C 38 00 00 00 */ li r0, 0 -/* 80335D60 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335D64 90 03 00 0C */ stw r0, 0xc(r3) -lbl_80335D68: -/* 80335D68 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335D6C A0 03 00 04 */ lhz r0, 4(r3) -/* 80335D70 54 03 10 3A */ slwi r3, r0, 2 -/* 80335D74 4B F9 8F 51 */ bl __nwa__FUl -/* 80335D78 80 9E 00 08 */ lwz r4, 8(r30) -/* 80335D7C 90 64 00 08 */ stw r3, 8(r4) -/* 80335D80 3B A0 00 00 */ li r29, 0 -/* 80335D84 48 00 00 30 */ b lbl_80335DB4 -lbl_80335D88: -/* 80335D88 38 61 00 08 */ addi r3, r1, 8 -/* 80335D8C 38 80 00 00 */ li r4, 0 -/* 80335D90 38 A0 00 00 */ li r5, 0 -/* 80335D94 57 A6 04 3E */ clrlwi r6, r29, 0x10 -/* 80335D98 7F E7 FB 78 */ mr r7, r31 -/* 80335D9C 4B FF A6 29 */ bl create__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl -/* 80335DA0 80 9E 00 08 */ lwz r4, 8(r30) -/* 80335DA4 80 84 00 08 */ lwz r4, 8(r4) -/* 80335DA8 57 A0 13 BA */ rlwinm r0, r29, 2, 0xe, 0x1d -/* 80335DAC 7C 64 01 2E */ stwx r3, r4, r0 -/* 80335DB0 3B BD 00 01 */ addi r29, r29, 1 -lbl_80335DB4: -/* 80335DB4 57 A4 04 3E */ clrlwi r4, r29, 0x10 -/* 80335DB8 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335DBC A0 03 00 04 */ lhz r0, 4(r3) -/* 80335DC0 7C 04 00 40 */ cmplw r4, r0 -/* 80335DC4 41 80 FF C4 */ blt lbl_80335D88 -/* 80335DC8 38 C0 00 00 */ li r6, 0 -/* 80335DCC 48 00 00 28 */ b lbl_80335DF4 -lbl_80335DD0: -/* 80335DD0 80 A4 00 08 */ lwz r5, 8(r4) -/* 80335DD4 80 61 00 10 */ lwz r3, 0x10(r1) -/* 80335DD8 54 C0 0B FC */ rlwinm r0, r6, 1, 0xf, 0x1e -/* 80335DDC 7C 03 02 2E */ lhzx r0, r3, r0 -/* 80335DE0 7C 85 02 14 */ add r4, r5, r0 -/* 80335DE4 54 C0 13 BA */ rlwinm r0, r6, 2, 0xe, 0x1d -/* 80335DE8 7C 65 00 2E */ lwzx r3, r5, r0 -/* 80335DEC 90 83 00 20 */ stw r4, 0x20(r3) -/* 80335DF0 38 C6 00 01 */ addi r6, r6, 1 -lbl_80335DF4: -/* 80335DF4 54 C3 04 3E */ clrlwi r3, r6, 0x10 -/* 80335DF8 80 9E 00 08 */ lwz r4, 8(r30) -/* 80335DFC A0 04 00 04 */ lhz r0, 4(r4) -/* 80335E00 7C 03 00 40 */ cmplw r3, r0 -/* 80335E04 41 80 FF CC */ blt lbl_80335DD0 -/* 80335E08 39 61 00 A0 */ addi r11, r1, 0xa0 -/* 80335E0C 48 02 C4 19 */ bl _restgpr_28 -/* 80335E10 80 01 00 A4 */ lwz r0, 0xa4(r1) -/* 80335E14 7C 08 03 A6 */ mtlr r0 -/* 80335E18 38 21 00 A0 */ addi r1, r1, 0xa0 -/* 80335E1C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialTable_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialTable_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul.s deleted file mode 100644 index 7baed4783b1..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialTable_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul.s +++ /dev/null @@ -1,87 +0,0 @@ -lbl_80335E20: -/* 80335E20 94 21 FF 70 */ stwu r1, -0x90(r1) -/* 80335E24 7C 08 02 A6 */ mflr r0 -/* 80335E28 90 01 00 94 */ stw r0, 0x94(r1) -/* 80335E2C 39 61 00 90 */ addi r11, r1, 0x90 -/* 80335E30 48 02 C3 A9 */ bl _savegpr_28 -/* 80335E34 7C 7E 1B 78 */ mr r30, r3 -/* 80335E38 7C 9C 23 78 */ mr r28, r4 -/* 80335E3C 7C BF 2B 78 */ mr r31, r5 -/* 80335E40 38 61 00 08 */ addi r3, r1, 8 -/* 80335E44 4B FF CF 61 */ bl __ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21 -/* 80335E48 A0 1C 00 08 */ lhz r0, 8(r28) -/* 80335E4C 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335E50 B0 03 00 04 */ sth r0, 4(r3) -/* 80335E54 80 1C 00 14 */ lwz r0, 0x14(r28) -/* 80335E58 28 00 00 00 */ cmplwi r0, 0 -/* 80335E5C 41 82 00 3C */ beq lbl_80335E98 -/* 80335E60 38 60 00 10 */ li r3, 0x10 -/* 80335E64 4B F9 8D E9 */ bl __nw__FUl -/* 80335E68 7C 7D 1B 79 */ or. r29, r3, r3 -/* 80335E6C 41 82 00 20 */ beq lbl_80335E8C -/* 80335E70 7F 83 E3 78 */ mr r3, r28 -/* 80335E74 80 9C 00 14 */ lwz r4, 0x14(r28) -/* 80335E78 4B FD 46 B9 */ bl func_8030A530 -/* 80335E7C 7C 64 1B 78 */ mr r4, r3 -/* 80335E80 7F A3 EB 78 */ mr r3, r29 -/* 80335E84 4B FA 8B 5D */ bl __ct__10JUTNameTabFPC7ResNTAB -/* 80335E88 7C 7D 1B 78 */ mr r29, r3 -lbl_80335E8C: -/* 80335E8C 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335E90 93 A3 00 0C */ stw r29, 0xc(r3) -/* 80335E94 48 00 00 10 */ b lbl_80335EA4 -lbl_80335E98: -/* 80335E98 38 00 00 00 */ li r0, 0 -/* 80335E9C 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335EA0 90 03 00 0C */ stw r0, 0xc(r3) -lbl_80335EA4: -/* 80335EA4 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335EA8 A0 03 00 04 */ lhz r0, 4(r3) -/* 80335EAC 54 03 10 3A */ slwi r3, r0, 2 -/* 80335EB0 4B F9 8E 15 */ bl __nwa__FUl -/* 80335EB4 80 9E 00 08 */ lwz r4, 8(r30) -/* 80335EB8 90 64 00 08 */ stw r3, 8(r4) -/* 80335EBC 3B A0 00 00 */ li r29, 0 -/* 80335EC0 48 00 00 2C */ b lbl_80335EEC -lbl_80335EC4: -/* 80335EC4 38 61 00 08 */ addi r3, r1, 8 -/* 80335EC8 38 80 00 00 */ li r4, 0 -/* 80335ECC 57 A5 04 3E */ clrlwi r5, r29, 0x10 -/* 80335ED0 7F E6 FB 78 */ mr r6, r31 -/* 80335ED4 4B FF D1 95 */ bl create__22J3DMaterialFactory_v21CFP11J3DMaterialiUl -/* 80335ED8 80 9E 00 08 */ lwz r4, 8(r30) -/* 80335EDC 80 84 00 08 */ lwz r4, 8(r4) -/* 80335EE0 57 A0 13 BA */ rlwinm r0, r29, 2, 0xe, 0x1d -/* 80335EE4 7C 64 01 2E */ stwx r3, r4, r0 -/* 80335EE8 3B BD 00 01 */ addi r29, r29, 1 -lbl_80335EEC: -/* 80335EEC 57 A4 04 3E */ clrlwi r4, r29, 0x10 -/* 80335EF0 80 7E 00 08 */ lwz r3, 8(r30) -/* 80335EF4 A0 03 00 04 */ lhz r0, 4(r3) -/* 80335EF8 7C 04 00 40 */ cmplw r4, r0 -/* 80335EFC 41 80 FF C8 */ blt lbl_80335EC4 -/* 80335F00 38 C0 00 00 */ li r6, 0 -/* 80335F04 48 00 00 2C */ b lbl_80335F30 -lbl_80335F08: -/* 80335F08 80 A4 00 08 */ lwz r5, 8(r4) -/* 80335F0C 54 A4 E1 3E */ srwi r4, r5, 4 -/* 80335F10 80 61 00 10 */ lwz r3, 0x10(r1) -/* 80335F14 54 C0 0B FC */ rlwinm r0, r6, 1, 0xf, 0x1e -/* 80335F18 7C 03 02 2E */ lhzx r0, r3, r0 -/* 80335F1C 7C 84 02 14 */ add r4, r4, r0 -/* 80335F20 54 C0 13 BA */ rlwinm r0, r6, 2, 0xe, 0x1d -/* 80335F24 7C 65 00 2E */ lwzx r3, r5, r0 -/* 80335F28 90 83 00 20 */ stw r4, 0x20(r3) -/* 80335F2C 38 C6 00 01 */ addi r6, r6, 1 -lbl_80335F30: -/* 80335F30 54 C3 04 3E */ clrlwi r3, r6, 0x10 -/* 80335F34 80 9E 00 08 */ lwz r4, 8(r30) -/* 80335F38 A0 04 00 04 */ lhz r0, 4(r4) -/* 80335F3C 7C 03 00 40 */ cmplw r3, r0 -/* 80335F40 41 80 FF C8 */ blt lbl_80335F08 -/* 80335F44 39 61 00 90 */ addi r11, r1, 0x90 -/* 80335F48 48 02 C2 DD */ bl _restgpr_28 -/* 80335F4C 80 01 00 94 */ lwz r0, 0x94(r1) -/* 80335F50 7C 08 03 A6 */ mtlr r0 -/* 80335F54 38 21 00 90 */ addi r1, r1, 0x90 -/* 80335F58 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterial__18J3DModelLoader_v26FPC16J3DMaterialBlockUl.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterial__18J3DModelLoader_v26FPC16J3DMaterialBlockUl.s deleted file mode 100644 index a8198249f18..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterial__18J3DModelLoader_v26FPC16J3DMaterialBlockUl.s +++ /dev/null @@ -1,176 +0,0 @@ -lbl_80335614: -/* 80335614 94 21 FF 50 */ stwu r1, -0xb0(r1) -/* 80335618 7C 08 02 A6 */ mflr r0 -/* 8033561C 90 01 00 B4 */ stw r0, 0xb4(r1) -/* 80335620 39 61 00 B0 */ addi r11, r1, 0xb0 -/* 80335624 48 02 CB B1 */ bl _savegpr_27 -/* 80335628 7C 7D 1B 78 */ mr r29, r3 -/* 8033562C 7C 9B 23 78 */ mr r27, r4 -/* 80335630 7C BE 2B 78 */ mr r30, r5 -/* 80335634 38 61 00 08 */ addi r3, r1, 8 -/* 80335638 4B FF A9 B5 */ bl __ct__18J3DMaterialFactoryFRC16J3DMaterialBlock -/* 8033563C A0 1B 00 08 */ lhz r0, 8(r27) -/* 80335640 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335644 B0 03 00 04 */ sth r0, 4(r3) -/* 80335648 38 61 00 08 */ addi r3, r1, 8 -/* 8033564C 4B FF AC 71 */ bl countUniqueMaterials__18J3DMaterialFactoryFv -/* 80335650 80 9D 00 08 */ lwz r4, 8(r29) -/* 80335654 B0 64 00 06 */ sth r3, 6(r4) -/* 80335658 80 1B 00 14 */ lwz r0, 0x14(r27) -/* 8033565C 28 00 00 00 */ cmplwi r0, 0 -/* 80335660 41 82 00 3C */ beq lbl_8033569C -/* 80335664 38 60 00 10 */ li r3, 0x10 -/* 80335668 4B F9 95 E5 */ bl __nw__FUl -/* 8033566C 7C 7C 1B 79 */ or. r28, r3, r3 -/* 80335670 41 82 00 20 */ beq lbl_80335690 -/* 80335674 7F 63 DB 78 */ mr r3, r27 -/* 80335678 80 9B 00 14 */ lwz r4, 0x14(r27) -/* 8033567C 4B FD 4E B5 */ bl func_8030A530 -/* 80335680 7C 64 1B 78 */ mr r4, r3 -/* 80335684 7F 83 E3 78 */ mr r3, r28 -/* 80335688 4B FA 93 59 */ bl __ct__10JUTNameTabFPC7ResNTAB -/* 8033568C 7C 7C 1B 78 */ mr r28, r3 -lbl_80335690: -/* 80335690 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335694 93 83 00 0C */ stw r28, 0xc(r3) -/* 80335698 48 00 00 10 */ b lbl_803356A8 -lbl_8033569C: -/* 8033569C 38 00 00 00 */ li r0, 0 -/* 803356A0 80 7D 00 08 */ lwz r3, 8(r29) -/* 803356A4 90 03 00 0C */ stw r0, 0xc(r3) -lbl_803356A8: -/* 803356A8 80 7D 00 08 */ lwz r3, 8(r29) -/* 803356AC A0 03 00 04 */ lhz r0, 4(r3) -/* 803356B0 54 03 10 3A */ slwi r3, r0, 2 -/* 803356B4 4B F9 96 11 */ bl __nwa__FUl -/* 803356B8 80 9D 00 08 */ lwz r4, 8(r29) -/* 803356BC 90 64 00 08 */ stw r3, 8(r4) -/* 803356C0 57 DF 02 95 */ rlwinm. r31, r30, 0, 0xa, 0xa -/* 803356C4 41 82 00 44 */ beq lbl_80335708 -/* 803356C8 80 7D 00 08 */ lwz r3, 8(r29) -/* 803356CC A3 83 00 06 */ lhz r28, 6(r3) -/* 803356D0 1C 7C 00 4C */ mulli r3, r28, 0x4c -/* 803356D4 38 63 00 10 */ addi r3, r3, 0x10 -/* 803356D8 38 80 00 20 */ li r4, 0x20 -/* 803356DC 4B F9 96 11 */ bl __nwa__FUli -/* 803356E0 3C 80 80 33 */ lis r4, __ct__11J3DMaterialFv@ha /* 0x80336650@ha */ -/* 803356E4 38 84 66 50 */ addi r4, r4, __ct__11J3DMaterialFv@l /* 0x80336650@l */ -/* 803356E8 3C A0 80 33 */ lis r5, __dt__11J3DMaterialFv@ha /* 0x80332B94@ha */ -/* 803356EC 38 A5 2B 94 */ addi r5, r5, __dt__11J3DMaterialFv@l /* 0x80332B94@l */ -/* 803356F0 38 C0 00 4C */ li r6, 0x4c -/* 803356F4 7F 87 E3 78 */ mr r7, r28 -/* 803356F8 48 02 C8 1D */ bl __construct_new_array -/* 803356FC 80 9D 00 08 */ lwz r4, 8(r29) -/* 80335700 90 64 00 10 */ stw r3, 0x10(r4) -/* 80335704 48 00 00 10 */ b lbl_80335714 -lbl_80335708: -/* 80335708 38 00 00 00 */ li r0, 0 -/* 8033570C 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335710 90 03 00 10 */ stw r0, 0x10(r3) -lbl_80335714: -/* 80335714 28 1F 00 00 */ cmplwi r31, 0 -/* 80335718 41 82 00 58 */ beq lbl_80335770 -/* 8033571C 3B 60 00 00 */ li r27, 0 -/* 80335720 48 00 00 3C */ b lbl_8033575C -lbl_80335724: -/* 80335724 38 61 00 08 */ addi r3, r1, 8 -/* 80335728 80 04 00 10 */ lwz r0, 0x10(r4) -/* 8033572C 57 66 04 3E */ clrlwi r6, r27, 0x10 -/* 80335730 1F 86 00 4C */ mulli r28, r6, 0x4c -/* 80335734 7C 80 E2 14 */ add r4, r0, r28 -/* 80335738 38 A0 00 00 */ li r5, 0 -/* 8033573C 7F C7 F3 78 */ mr r7, r30 -/* 80335740 4B FF AC 85 */ bl create__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl -/* 80335744 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335748 80 03 00 10 */ lwz r0, 0x10(r3) -/* 8033574C 7C 60 E2 14 */ add r3, r0, r28 -/* 80335750 54 60 E1 3E */ srwi r0, r3, 4 -/* 80335754 90 03 00 20 */ stw r0, 0x20(r3) -/* 80335758 3B 7B 00 01 */ addi r27, r27, 1 -lbl_8033575C: -/* 8033575C 57 63 04 3E */ clrlwi r3, r27, 0x10 -/* 80335760 80 9D 00 08 */ lwz r4, 8(r29) -/* 80335764 A0 04 00 06 */ lhz r0, 6(r4) -/* 80335768 7C 03 00 40 */ cmplw r3, r0 -/* 8033576C 41 80 FF B8 */ blt lbl_80335724 -lbl_80335770: -/* 80335770 3B 60 00 00 */ li r27, 0 -/* 80335774 48 00 00 30 */ b lbl_803357A4 -lbl_80335778: -/* 80335778 38 61 00 08 */ addi r3, r1, 8 -/* 8033577C 38 80 00 00 */ li r4, 0 -/* 80335780 38 A0 00 00 */ li r5, 0 -/* 80335784 57 66 04 3E */ clrlwi r6, r27, 0x10 -/* 80335788 7F C7 F3 78 */ mr r7, r30 -/* 8033578C 4B FF AC 39 */ bl create__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl -/* 80335790 80 9D 00 08 */ lwz r4, 8(r29) -/* 80335794 80 84 00 08 */ lwz r4, 8(r4) -/* 80335798 57 60 13 BA */ rlwinm r0, r27, 2, 0xe, 0x1d -/* 8033579C 7C 64 01 2E */ stwx r3, r4, r0 -/* 803357A0 3B 7B 00 01 */ addi r27, r27, 1 -lbl_803357A4: -/* 803357A4 57 64 04 3E */ clrlwi r4, r27, 0x10 -/* 803357A8 80 7D 00 08 */ lwz r3, 8(r29) -/* 803357AC A0 03 00 04 */ lhz r0, 4(r3) -/* 803357B0 7C 04 00 40 */ cmplw r4, r0 -/* 803357B4 41 80 FF C4 */ blt lbl_80335778 -/* 803357B8 28 1F 00 00 */ cmplwi r31, 0 -/* 803357BC 41 82 00 78 */ beq lbl_80335834 -/* 803357C0 39 00 00 00 */ li r8, 0 -/* 803357C4 48 00 00 58 */ b lbl_8033581C -lbl_803357C8: -/* 803357C8 80 85 00 10 */ lwz r4, 0x10(r5) -/* 803357CC 80 61 00 10 */ lwz r3, 0x10(r1) -/* 803357D0 55 06 0B FC */ rlwinm r6, r8, 1, 0xf, 0x1e -/* 803357D4 7C 03 32 2E */ lhzx r0, r3, r6 -/* 803357D8 1C 00 00 4C */ mulli r0, r0, 0x4c -/* 803357DC 7C 04 02 14 */ add r0, r4, r0 -/* 803357E0 54 00 E1 3E */ srwi r0, r0, 4 -/* 803357E4 80 65 00 08 */ lwz r3, 8(r5) -/* 803357E8 55 07 13 BA */ rlwinm r7, r8, 2, 0xe, 0x1d -/* 803357EC 7C 63 38 2E */ lwzx r3, r3, r7 -/* 803357F0 90 03 00 20 */ stw r0, 0x20(r3) -/* 803357F4 80 BD 00 08 */ lwz r5, 8(r29) -/* 803357F8 80 85 00 10 */ lwz r4, 0x10(r5) -/* 803357FC 80 61 00 10 */ lwz r3, 0x10(r1) -/* 80335800 7C 03 32 2E */ lhzx r0, r3, r6 -/* 80335804 1C 00 00 4C */ mulli r0, r0, 0x4c -/* 80335808 7C 04 02 14 */ add r0, r4, r0 -/* 8033580C 80 65 00 08 */ lwz r3, 8(r5) -/* 80335810 7C 63 38 2E */ lwzx r3, r3, r7 -/* 80335814 90 03 00 38 */ stw r0, 0x38(r3) -/* 80335818 39 08 00 01 */ addi r8, r8, 1 -lbl_8033581C: -/* 8033581C 55 03 04 3E */ clrlwi r3, r8, 0x10 -/* 80335820 80 BD 00 08 */ lwz r5, 8(r29) -/* 80335824 A0 05 00 04 */ lhz r0, 4(r5) -/* 80335828 7C 03 00 40 */ cmplw r3, r0 -/* 8033582C 41 80 FF 9C */ blt lbl_803357C8 -/* 80335830 48 00 00 48 */ b lbl_80335878 -lbl_80335834: -/* 80335834 38 C0 00 00 */ li r6, 0 -/* 80335838 48 00 00 2C */ b lbl_80335864 -lbl_8033583C: -/* 8033583C 80 A4 00 08 */ lwz r5, 8(r4) -/* 80335840 54 A4 E1 3E */ srwi r4, r5, 4 -/* 80335844 80 61 00 10 */ lwz r3, 0x10(r1) -/* 80335848 54 C0 0B FC */ rlwinm r0, r6, 1, 0xf, 0x1e -/* 8033584C 7C 03 02 2E */ lhzx r0, r3, r0 -/* 80335850 7C 84 02 14 */ add r4, r4, r0 -/* 80335854 54 C0 13 BA */ rlwinm r0, r6, 2, 0xe, 0x1d -/* 80335858 7C 65 00 2E */ lwzx r3, r5, r0 -/* 8033585C 90 83 00 20 */ stw r4, 0x20(r3) -/* 80335860 38 C6 00 01 */ addi r6, r6, 1 -lbl_80335864: -/* 80335864 54 C3 04 3E */ clrlwi r3, r6, 0x10 -/* 80335868 80 9D 00 08 */ lwz r4, 8(r29) -/* 8033586C A0 04 00 04 */ lhz r0, 4(r4) -/* 80335870 7C 03 00 40 */ cmplw r3, r0 -/* 80335874 41 80 FF C8 */ blt lbl_8033583C -lbl_80335878: -/* 80335878 39 61 00 B0 */ addi r11, r1, 0xb0 -/* 8033587C 48 02 C9 A5 */ bl _restgpr_27 -/* 80335880 80 01 00 B4 */ lwz r0, 0xb4(r1) -/* 80335884 7C 08 03 A6 */ mtlr r0 -/* 80335888 38 21 00 B0 */ addi r1, r1, 0xb0 -/* 8033588C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterial_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterial_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul.s deleted file mode 100644 index 8903e573a67..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterial_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul.s +++ /dev/null @@ -1,170 +0,0 @@ -lbl_80335890: -/* 80335890 94 21 FF 70 */ stwu r1, -0x90(r1) -/* 80335894 7C 08 02 A6 */ mflr r0 -/* 80335898 90 01 00 94 */ stw r0, 0x94(r1) -/* 8033589C 39 61 00 90 */ addi r11, r1, 0x90 -/* 803358A0 48 02 C9 35 */ bl _savegpr_27 -/* 803358A4 7C 7D 1B 78 */ mr r29, r3 -/* 803358A8 7C 9B 23 78 */ mr r27, r4 -/* 803358AC 7C BE 2B 78 */ mr r30, r5 -/* 803358B0 38 61 00 08 */ addi r3, r1, 8 -/* 803358B4 4B FF D4 F1 */ bl __ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21 -/* 803358B8 A0 1B 00 08 */ lhz r0, 8(r27) -/* 803358BC 80 7D 00 08 */ lwz r3, 8(r29) -/* 803358C0 B0 03 00 04 */ sth r0, 4(r3) -/* 803358C4 38 61 00 08 */ addi r3, r1, 8 -/* 803358C8 4B FF D6 BD */ bl countUniqueMaterials__22J3DMaterialFactory_v21Fv -/* 803358CC 80 9D 00 08 */ lwz r4, 8(r29) -/* 803358D0 B0 64 00 06 */ sth r3, 6(r4) -/* 803358D4 80 1B 00 14 */ lwz r0, 0x14(r27) -/* 803358D8 28 00 00 00 */ cmplwi r0, 0 -/* 803358DC 41 82 00 3C */ beq lbl_80335918 -/* 803358E0 38 60 00 10 */ li r3, 0x10 -/* 803358E4 4B F9 93 69 */ bl __nw__FUl -/* 803358E8 7C 7C 1B 79 */ or. r28, r3, r3 -/* 803358EC 41 82 00 20 */ beq lbl_8033590C -/* 803358F0 7F 63 DB 78 */ mr r3, r27 -/* 803358F4 80 9B 00 14 */ lwz r4, 0x14(r27) -/* 803358F8 4B FD 4C 39 */ bl func_8030A530 -/* 803358FC 7C 64 1B 78 */ mr r4, r3 -/* 80335900 7F 83 E3 78 */ mr r3, r28 -/* 80335904 4B FA 90 DD */ bl __ct__10JUTNameTabFPC7ResNTAB -/* 80335908 7C 7C 1B 78 */ mr r28, r3 -lbl_8033590C: -/* 8033590C 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335910 93 83 00 0C */ stw r28, 0xc(r3) -/* 80335914 48 00 00 10 */ b lbl_80335924 -lbl_80335918: -/* 80335918 38 00 00 00 */ li r0, 0 -/* 8033591C 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335920 90 03 00 0C */ stw r0, 0xc(r3) -lbl_80335924: -/* 80335924 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335928 A0 03 00 04 */ lhz r0, 4(r3) -/* 8033592C 54 03 10 3A */ slwi r3, r0, 2 -/* 80335930 4B F9 93 95 */ bl __nwa__FUl -/* 80335934 80 9D 00 08 */ lwz r4, 8(r29) -/* 80335938 90 64 00 08 */ stw r3, 8(r4) -/* 8033593C 57 DF 02 95 */ rlwinm. r31, r30, 0, 0xa, 0xa -/* 80335940 41 82 00 44 */ beq lbl_80335984 -/* 80335944 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335948 A3 83 00 06 */ lhz r28, 6(r3) -/* 8033594C 1C 7C 00 4C */ mulli r3, r28, 0x4c -/* 80335950 38 63 00 10 */ addi r3, r3, 0x10 -/* 80335954 38 80 00 20 */ li r4, 0x20 -/* 80335958 4B F9 93 95 */ bl __nwa__FUli -/* 8033595C 3C 80 80 33 */ lis r4, __ct__11J3DMaterialFv@ha /* 0x80336650@ha */ -/* 80335960 38 84 66 50 */ addi r4, r4, __ct__11J3DMaterialFv@l /* 0x80336650@l */ -/* 80335964 3C A0 80 33 */ lis r5, __dt__11J3DMaterialFv@ha /* 0x80332B94@ha */ -/* 80335968 38 A5 2B 94 */ addi r5, r5, __dt__11J3DMaterialFv@l /* 0x80332B94@l */ -/* 8033596C 38 C0 00 4C */ li r6, 0x4c -/* 80335970 7F 87 E3 78 */ mr r7, r28 -/* 80335974 48 02 C5 A1 */ bl __construct_new_array -/* 80335978 80 9D 00 08 */ lwz r4, 8(r29) -/* 8033597C 90 64 00 10 */ stw r3, 0x10(r4) -/* 80335980 48 00 00 10 */ b lbl_80335990 -lbl_80335984: -/* 80335984 38 00 00 00 */ li r0, 0 -/* 80335988 80 7D 00 08 */ lwz r3, 8(r29) -/* 8033598C 90 03 00 10 */ stw r0, 0x10(r3) -lbl_80335990: -/* 80335990 28 1F 00 00 */ cmplwi r31, 0 -/* 80335994 41 82 00 54 */ beq lbl_803359E8 -/* 80335998 3B 60 00 00 */ li r27, 0 -/* 8033599C 48 00 00 38 */ b lbl_803359D4 -lbl_803359A0: -/* 803359A0 38 61 00 08 */ addi r3, r1, 8 -/* 803359A4 80 04 00 10 */ lwz r0, 0x10(r4) -/* 803359A8 57 65 04 3E */ clrlwi r5, r27, 0x10 -/* 803359AC 1F 85 00 4C */ mulli r28, r5, 0x4c -/* 803359B0 7C 80 E2 14 */ add r4, r0, r28 -/* 803359B4 7F C6 F3 78 */ mr r6, r30 -/* 803359B8 4B FF D6 B1 */ bl create__22J3DMaterialFactory_v21CFP11J3DMaterialiUl -/* 803359BC 80 7D 00 08 */ lwz r3, 8(r29) -/* 803359C0 80 03 00 10 */ lwz r0, 0x10(r3) -/* 803359C4 7C 60 E2 14 */ add r3, r0, r28 -/* 803359C8 54 60 E1 3E */ srwi r0, r3, 4 -/* 803359CC 90 03 00 20 */ stw r0, 0x20(r3) -/* 803359D0 3B 7B 00 01 */ addi r27, r27, 1 -lbl_803359D4: -/* 803359D4 57 63 04 3E */ clrlwi r3, r27, 0x10 -/* 803359D8 80 9D 00 08 */ lwz r4, 8(r29) -/* 803359DC A0 04 00 06 */ lhz r0, 6(r4) -/* 803359E0 7C 03 00 40 */ cmplw r3, r0 -/* 803359E4 41 80 FF BC */ blt lbl_803359A0 -lbl_803359E8: -/* 803359E8 3B 60 00 00 */ li r27, 0 -/* 803359EC 48 00 00 2C */ b lbl_80335A18 -lbl_803359F0: -/* 803359F0 38 61 00 08 */ addi r3, r1, 8 -/* 803359F4 38 80 00 00 */ li r4, 0 -/* 803359F8 57 65 04 3E */ clrlwi r5, r27, 0x10 -/* 803359FC 7F C6 F3 78 */ mr r6, r30 -/* 80335A00 4B FF D6 69 */ bl create__22J3DMaterialFactory_v21CFP11J3DMaterialiUl -/* 80335A04 80 9D 00 08 */ lwz r4, 8(r29) -/* 80335A08 80 84 00 08 */ lwz r4, 8(r4) -/* 80335A0C 57 60 13 BA */ rlwinm r0, r27, 2, 0xe, 0x1d -/* 80335A10 7C 64 01 2E */ stwx r3, r4, r0 -/* 80335A14 3B 7B 00 01 */ addi r27, r27, 1 -lbl_80335A18: -/* 80335A18 57 64 04 3E */ clrlwi r4, r27, 0x10 -/* 80335A1C 80 7D 00 08 */ lwz r3, 8(r29) -/* 80335A20 A0 03 00 04 */ lhz r0, 4(r3) -/* 80335A24 7C 04 00 40 */ cmplw r4, r0 -/* 80335A28 41 80 FF C8 */ blt lbl_803359F0 -/* 80335A2C 28 1F 00 00 */ cmplwi r31, 0 -/* 80335A30 41 82 00 78 */ beq lbl_80335AA8 -/* 80335A34 39 00 00 00 */ li r8, 0 -/* 80335A38 48 00 00 58 */ b lbl_80335A90 -lbl_80335A3C: -/* 80335A3C 80 85 00 10 */ lwz r4, 0x10(r5) -/* 80335A40 80 61 00 10 */ lwz r3, 0x10(r1) -/* 80335A44 55 06 0B FC */ rlwinm r6, r8, 1, 0xf, 0x1e -/* 80335A48 7C 03 32 2E */ lhzx r0, r3, r6 -/* 80335A4C 1C 00 00 4C */ mulli r0, r0, 0x4c -/* 80335A50 7C 04 02 14 */ add r0, r4, r0 -/* 80335A54 54 00 E1 3E */ srwi r0, r0, 4 -/* 80335A58 80 65 00 08 */ lwz r3, 8(r5) -/* 80335A5C 55 07 13 BA */ rlwinm r7, r8, 2, 0xe, 0x1d -/* 80335A60 7C 63 38 2E */ lwzx r3, r3, r7 -/* 80335A64 90 03 00 20 */ stw r0, 0x20(r3) -/* 80335A68 80 BD 00 08 */ lwz r5, 8(r29) -/* 80335A6C 80 85 00 10 */ lwz r4, 0x10(r5) -/* 80335A70 80 61 00 10 */ lwz r3, 0x10(r1) -/* 80335A74 7C 03 32 2E */ lhzx r0, r3, r6 -/* 80335A78 1C 00 00 4C */ mulli r0, r0, 0x4c -/* 80335A7C 7C 04 02 14 */ add r0, r4, r0 -/* 80335A80 80 65 00 08 */ lwz r3, 8(r5) -/* 80335A84 7C 63 38 2E */ lwzx r3, r3, r7 -/* 80335A88 90 03 00 38 */ stw r0, 0x38(r3) -/* 80335A8C 39 08 00 01 */ addi r8, r8, 1 -lbl_80335A90: -/* 80335A90 55 03 04 3E */ clrlwi r3, r8, 0x10 -/* 80335A94 80 BD 00 08 */ lwz r5, 8(r29) -/* 80335A98 A0 05 00 04 */ lhz r0, 4(r5) -/* 80335A9C 7C 03 00 40 */ cmplw r3, r0 -/* 80335AA0 41 80 FF 9C */ blt lbl_80335A3C -/* 80335AA4 48 00 00 38 */ b lbl_80335ADC -lbl_80335AA8: -/* 80335AA8 38 C0 00 00 */ li r6, 0 -/* 80335AAC 3C 80 C0 00 */ lis r4, 0xc000 -/* 80335AB0 48 00 00 18 */ b lbl_80335AC8 -lbl_80335AB4: -/* 80335AB4 80 65 00 08 */ lwz r3, 8(r5) -/* 80335AB8 54 C0 13 BA */ rlwinm r0, r6, 2, 0xe, 0x1d -/* 80335ABC 7C 63 00 2E */ lwzx r3, r3, r0 -/* 80335AC0 90 83 00 20 */ stw r4, 0x20(r3) -/* 80335AC4 38 C6 00 01 */ addi r6, r6, 1 -lbl_80335AC8: -/* 80335AC8 54 C3 04 3E */ clrlwi r3, r6, 0x10 -/* 80335ACC 80 BD 00 08 */ lwz r5, 8(r29) -/* 80335AD0 A0 05 00 04 */ lhz r0, 4(r5) -/* 80335AD4 7C 03 00 40 */ cmplw r3, r0 -/* 80335AD8 41 80 FF DC */ blt lbl_80335AB4 -lbl_80335ADC: -/* 80335ADC 39 61 00 90 */ addi r11, r1, 0x90 -/* 80335AE0 48 02 C7 41 */ bl _restgpr_27 -/* 80335AE4 80 01 00 94 */ lwz r0, 0x94(r1) -/* 80335AE8 7C 08 03 A6 */ mtlr r0 -/* 80335AEC 38 21 00 90 */ addi r1, r1, 0x90 -/* 80335AF0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readPatchedMaterial__14J3DModelLoaderFPC16J3DMaterialBlockUl.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readPatchedMaterial__14J3DModelLoaderFPC16J3DMaterialBlockUl.s deleted file mode 100644 index f790fe0ec04..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readPatchedMaterial__14J3DModelLoaderFPC16J3DMaterialBlockUl.s +++ /dev/null @@ -1,86 +0,0 @@ -lbl_80336028: -/* 80336028 94 21 FF 60 */ stwu r1, -0xa0(r1) -/* 8033602C 7C 08 02 A6 */ mflr r0 -/* 80336030 90 01 00 A4 */ stw r0, 0xa4(r1) -/* 80336034 39 61 00 A0 */ addi r11, r1, 0xa0 -/* 80336038 48 02 C1 A1 */ bl _savegpr_28 -/* 8033603C 7C 7D 1B 78 */ mr r29, r3 -/* 80336040 7C 9C 23 78 */ mr r28, r4 -/* 80336044 7C BE 2B 78 */ mr r30, r5 -/* 80336048 38 61 00 08 */ addi r3, r1, 8 -/* 8033604C 4B FF 9F A1 */ bl __ct__18J3DMaterialFactoryFRC16J3DMaterialBlock -/* 80336050 A0 1C 00 08 */ lhz r0, 8(r28) -/* 80336054 80 7D 00 08 */ lwz r3, 8(r29) -/* 80336058 B0 03 00 04 */ sth r0, 4(r3) -/* 8033605C 38 61 00 08 */ addi r3, r1, 8 -/* 80336060 4B FF A2 5D */ bl countUniqueMaterials__18J3DMaterialFactoryFv -/* 80336064 80 9D 00 08 */ lwz r4, 8(r29) -/* 80336068 B0 64 00 06 */ sth r3, 6(r4) -/* 8033606C 80 1C 00 14 */ lwz r0, 0x14(r28) -/* 80336070 28 00 00 00 */ cmplwi r0, 0 -/* 80336074 41 82 00 3C */ beq lbl_803360B0 -/* 80336078 38 60 00 10 */ li r3, 0x10 -/* 8033607C 4B F9 8B D1 */ bl __nw__FUl -/* 80336080 7C 7F 1B 79 */ or. r31, r3, r3 -/* 80336084 41 82 00 20 */ beq lbl_803360A4 -/* 80336088 7F 83 E3 78 */ mr r3, r28 -/* 8033608C 80 9C 00 14 */ lwz r4, 0x14(r28) -/* 80336090 4B FD 44 A1 */ bl func_8030A530 -/* 80336094 7C 64 1B 78 */ mr r4, r3 -/* 80336098 7F E3 FB 78 */ mr r3, r31 -/* 8033609C 4B FA 89 45 */ bl __ct__10JUTNameTabFPC7ResNTAB -/* 803360A0 7C 7F 1B 78 */ mr r31, r3 -lbl_803360A4: -/* 803360A4 80 7D 00 08 */ lwz r3, 8(r29) -/* 803360A8 93 E3 00 0C */ stw r31, 0xc(r3) -/* 803360AC 48 00 00 10 */ b lbl_803360BC -lbl_803360B0: -/* 803360B0 38 00 00 00 */ li r0, 0 -/* 803360B4 80 7D 00 08 */ lwz r3, 8(r29) -/* 803360B8 90 03 00 0C */ stw r0, 0xc(r3) -lbl_803360BC: -/* 803360BC 80 7D 00 08 */ lwz r3, 8(r29) -/* 803360C0 A0 03 00 04 */ lhz r0, 4(r3) -/* 803360C4 54 03 10 3A */ slwi r3, r0, 2 -/* 803360C8 4B F9 8B FD */ bl __nwa__FUl -/* 803360CC 80 9D 00 08 */ lwz r4, 8(r29) -/* 803360D0 90 64 00 08 */ stw r3, 8(r4) -/* 803360D4 38 00 00 00 */ li r0, 0 -/* 803360D8 80 7D 00 08 */ lwz r3, 8(r29) -/* 803360DC 90 03 00 10 */ stw r0, 0x10(r3) -/* 803360E0 3B E0 00 00 */ li r31, 0 -/* 803360E4 48 00 00 58 */ b lbl_8033613C -lbl_803360E8: -/* 803360E8 38 61 00 08 */ addi r3, r1, 8 -/* 803360EC 38 80 00 00 */ li r4, 0 -/* 803360F0 38 A0 00 02 */ li r5, 2 -/* 803360F4 57 FC 04 3E */ clrlwi r28, r31, 0x10 -/* 803360F8 7F 86 E3 78 */ mr r6, r28 -/* 803360FC 7F C7 F3 78 */ mr r7, r30 -/* 80336100 4B FF A2 C5 */ bl create__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl -/* 80336104 80 9D 00 08 */ lwz r4, 8(r29) -/* 80336108 80 84 00 08 */ lwz r4, 8(r4) -/* 8033610C 57 E6 13 BA */ rlwinm r6, r31, 2, 0xe, 0x1d -/* 80336110 7C 64 31 2E */ stwx r3, r4, r6 -/* 80336114 80 7D 00 08 */ lwz r3, 8(r29) -/* 80336118 80 A3 00 08 */ lwz r5, 8(r3) -/* 8033611C 54 A4 E1 3E */ srwi r4, r5, 4 -/* 80336120 80 61 00 10 */ lwz r3, 0x10(r1) -/* 80336124 57 80 08 3C */ slwi r0, r28, 1 -/* 80336128 7C 03 02 2E */ lhzx r0, r3, r0 -/* 8033612C 7C 04 02 14 */ add r0, r4, r0 -/* 80336130 7C 65 30 2E */ lwzx r3, r5, r6 -/* 80336134 90 03 00 20 */ stw r0, 0x20(r3) -/* 80336138 3B FF 00 01 */ addi r31, r31, 1 -lbl_8033613C: -/* 8033613C 57 E4 04 3E */ clrlwi r4, r31, 0x10 -/* 80336140 80 7D 00 08 */ lwz r3, 8(r29) -/* 80336144 A0 03 00 04 */ lhz r0, 4(r3) -/* 80336148 7C 04 00 40 */ cmplw r4, r0 -/* 8033614C 41 80 FF 9C */ blt lbl_803360E8 -/* 80336150 39 61 00 A0 */ addi r11, r1, 0xa0 -/* 80336154 48 02 C0 D1 */ bl _restgpr_28 -/* 80336158 80 01 00 A4 */ lwz r0, 0xa4(r1) -/* 8033615C 7C 08 03 A6 */ mtlr r0 -/* 80336160 38 21 00 A0 */ addi r1, r1, 0xa0 -/* 80336164 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readShape__14J3DModelLoaderFPC13J3DShapeBlockUl.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readShape__14J3DModelLoaderFPC13J3DShapeBlockUl.s deleted file mode 100644 index faa8a92e392..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readShape__14J3DModelLoaderFPC13J3DShapeBlockUl.s +++ /dev/null @@ -1,80 +0,0 @@ -lbl_80335AF4: -/* 80335AF4 94 21 FF C0 */ stwu r1, -0x40(r1) -/* 80335AF8 7C 08 02 A6 */ mflr r0 -/* 80335AFC 90 01 00 44 */ stw r0, 0x44(r1) -/* 80335B00 39 61 00 40 */ addi r11, r1, 0x40 -/* 80335B04 48 02 C6 D1 */ bl _savegpr_27 -/* 80335B08 7C 7B 1B 78 */ mr r27, r3 -/* 80335B0C 7C 9C 23 78 */ mr r28, r4 -/* 80335B10 7C BD 2B 78 */ mr r29, r5 -/* 80335B14 93 83 00 0C */ stw r28, 0xc(r3) -/* 80335B18 83 E3 00 04 */ lwz r31, 4(r3) -/* 80335B1C 38 61 00 08 */ addi r3, r1, 8 -/* 80335B20 48 00 18 31 */ bl __ct__15J3DShapeFactoryFRC13J3DShapeBlock -/* 80335B24 A0 1C 00 08 */ lhz r0, 8(r28) -/* 80335B28 B0 1F 00 7C */ sth r0, 0x7c(r31) -/* 80335B2C 80 1C 00 14 */ lwz r0, 0x14(r28) -/* 80335B30 28 00 00 00 */ cmplwi r0, 0 -/* 80335B34 41 82 00 38 */ beq lbl_80335B6C -/* 80335B38 38 60 00 10 */ li r3, 0x10 -/* 80335B3C 4B F9 91 11 */ bl __nw__FUl -/* 80335B40 7C 7E 1B 79 */ or. r30, r3, r3 -/* 80335B44 41 82 00 20 */ beq lbl_80335B64 -/* 80335B48 7F 83 E3 78 */ mr r3, r28 -/* 80335B4C 80 9C 00 14 */ lwz r4, 0x14(r28) -/* 80335B50 4B FD 49 E1 */ bl func_8030A530 -/* 80335B54 7C 64 1B 78 */ mr r4, r3 -/* 80335B58 7F C3 F3 78 */ mr r3, r30 -/* 80335B5C 4B FA 8E 85 */ bl __ct__10JUTNameTabFPC7ResNTAB -/* 80335B60 7C 7E 1B 78 */ mr r30, r3 -lbl_80335B64: -/* 80335B64 93 DF 00 84 */ stw r30, 0x84(r31) -/* 80335B68 48 00 00 0C */ b lbl_80335B74 -lbl_80335B6C: -/* 80335B6C 38 00 00 00 */ li r0, 0 -/* 80335B70 90 1F 00 84 */ stw r0, 0x84(r31) -lbl_80335B74: -/* 80335B74 A0 1F 00 7C */ lhz r0, 0x7c(r31) -/* 80335B78 54 03 10 3A */ slwi r3, r0, 2 -/* 80335B7C 4B F9 91 49 */ bl __nwa__FUl -/* 80335B80 90 7F 00 80 */ stw r3, 0x80(r31) -/* 80335B84 38 61 00 08 */ addi r3, r1, 8 -/* 80335B88 A0 9F 00 7C */ lhz r4, 0x7c(r31) -/* 80335B8C 48 00 1D 4D */ bl allocVcdVatCmdBuffer__15J3DShapeFactoryFUl -/* 80335B90 80 7B 00 04 */ lwz r3, 4(r27) -/* 80335B94 83 C3 00 14 */ lwz r30, 0x14(r3) -/* 80335B98 38 C0 00 00 */ li r6, 0 -/* 80335B9C 48 00 00 58 */ b lbl_80335BF4 -lbl_80335BA0: -/* 80335BA0 28 00 00 12 */ cmplwi r0, 0x12 -/* 80335BA4 40 82 00 4C */ bne lbl_80335BF0 -/* 80335BA8 38 61 00 08 */ addi r3, r1, 8 -/* 80335BAC A0 9E 00 02 */ lhz r4, 2(r30) -/* 80335BB0 7F A5 EB 78 */ mr r5, r29 -/* 80335BB4 48 00 18 4D */ bl create__15J3DShapeFactoryFiUlP14_GXVtxDescList -/* 80335BB8 80 9F 00 80 */ lwz r4, 0x80(r31) -/* 80335BBC A0 1E 00 02 */ lhz r0, 2(r30) -/* 80335BC0 54 00 10 3A */ slwi r0, r0, 2 -/* 80335BC4 7C 64 01 2E */ stwx r3, r4, r0 -/* 80335BC8 80 A1 00 10 */ lwz r5, 0x10(r1) -/* 80335BCC 80 81 00 08 */ lwz r4, 8(r1) -/* 80335BD0 80 61 00 0C */ lwz r3, 0xc(r1) -/* 80335BD4 A0 1E 00 02 */ lhz r0, 2(r30) -/* 80335BD8 54 00 08 3C */ slwi r0, r0, 1 -/* 80335BDC 7C 03 02 2E */ lhzx r0, r3, r0 -/* 80335BE0 1C 60 00 28 */ mulli r3, r0, 0x28 -/* 80335BE4 38 03 00 04 */ addi r0, r3, 4 -/* 80335BE8 7C 04 02 2E */ lhzx r0, r4, r0 -/* 80335BEC 7C C5 02 14 */ add r6, r5, r0 -lbl_80335BF0: -/* 80335BF0 3B DE 00 04 */ addi r30, r30, 4 -lbl_80335BF4: -/* 80335BF4 A0 1E 00 00 */ lhz r0, 0(r30) -/* 80335BF8 28 00 00 00 */ cmplwi r0, 0 -/* 80335BFC 40 82 FF A4 */ bne lbl_80335BA0 -/* 80335C00 39 61 00 40 */ addi r11, r1, 0x40 -/* 80335C04 48 02 C6 1D */ bl _restgpr_27 -/* 80335C08 80 01 00 44 */ lwz r0, 0x44(r1) -/* 80335C0C 7C 08 03 A6 */ mtlr r0 -/* 80335C10 38 21 00 40 */ addi r1, r1, 0x40 -/* 80335C14 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readVertex__14J3DModelLoaderFPC14J3DVertexBlock.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/readVertex__14J3DModelLoaderFPC14J3DVertexBlock.s deleted file mode 100644 index 45b7259dd2f..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/readVertex__14J3DModelLoaderFPC14J3DVertexBlock.s +++ /dev/null @@ -1,153 +0,0 @@ -lbl_803351D0: -/* 803351D0 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 803351D4 7C 08 02 A6 */ mflr r0 -/* 803351D8 90 01 00 24 */ stw r0, 0x24(r1) -/* 803351DC 39 61 00 20 */ addi r11, r1, 0x20 -/* 803351E0 48 02 CF F9 */ bl _savegpr_28 -/* 803351E4 7C 9E 23 78 */ mr r30, r4 -/* 803351E8 80 63 00 04 */ lwz r3, 4(r3) -/* 803351EC 3B E3 00 88 */ addi r31, r3, 0x88 -/* 803351F0 7F C3 F3 78 */ mr r3, r30 -/* 803351F4 80 84 00 08 */ lwz r4, 8(r4) -/* 803351F8 48 00 15 3D */ bl func_80336734 -/* 803351FC 90 7F 00 14 */ stw r3, 0x14(r31) -/* 80335200 7F C3 F3 78 */ mr r3, r30 -/* 80335204 80 9E 00 0C */ lwz r4, 0xc(r30) -/* 80335208 48 00 15 15 */ bl func_8033671C -/* 8033520C 90 7F 00 18 */ stw r3, 0x18(r31) -/* 80335210 7F C3 F3 78 */ mr r3, r30 -/* 80335214 80 9E 00 10 */ lwz r4, 0x10(r30) -/* 80335218 48 00 15 05 */ bl func_8033671C -/* 8033521C 90 7F 00 1C */ stw r3, 0x1c(r31) -/* 80335220 7F C3 F3 78 */ mr r3, r30 -/* 80335224 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 80335228 48 00 14 F5 */ bl func_8033671C -/* 8033522C 90 7F 00 20 */ stw r3, 0x20(r31) -/* 80335230 3B 80 00 00 */ li r28, 0 -/* 80335234 3B A0 00 00 */ li r29, 0 -lbl_80335238: -/* 80335238 7F C3 F3 78 */ mr r3, r30 -/* 8033523C 38 1D 00 18 */ addi r0, r29, 0x18 -/* 80335240 7C 9E 00 2E */ lwzx r4, r30, r0 -/* 80335244 48 00 14 D9 */ bl func_8033671C -/* 80335248 38 1D 00 24 */ addi r0, r29, 0x24 -/* 8033524C 7C 7F 01 2E */ stwx r3, r31, r0 -/* 80335250 3B 9C 00 01 */ addi r28, r28, 1 -/* 80335254 2C 1C 00 02 */ cmpwi r28, 2 -/* 80335258 3B BD 00 04 */ addi r29, r29, 4 -/* 8033525C 41 80 FF DC */ blt lbl_80335238 -/* 80335260 3B 80 00 00 */ li r28, 0 -/* 80335264 3B A0 00 00 */ li r29, 0 -lbl_80335268: -/* 80335268 7F C3 F3 78 */ mr r3, r30 -/* 8033526C 38 1D 00 20 */ addi r0, r29, 0x20 -/* 80335270 7C 9E 00 2E */ lwzx r4, r30, r0 -/* 80335274 48 00 14 A9 */ bl func_8033671C -/* 80335278 38 1D 00 2C */ addi r0, r29, 0x2c -/* 8033527C 7C 7F 01 2E */ stwx r3, r31, r0 -/* 80335280 3B 9C 00 01 */ addi r28, r28, 1 -/* 80335284 2C 1C 00 08 */ cmpwi r28, 8 -/* 80335288 3B BD 00 04 */ addi r29, r29, 4 -/* 8033528C 41 80 FF DC */ blt lbl_80335268 -/* 80335290 80 7F 00 14 */ lwz r3, 0x14(r31) -/* 80335294 38 80 00 0A */ li r4, 0xa -/* 80335298 4B FF FF 0D */ bl getFmtType__FP17_GXVtxAttrFmtList7_GXAttr -/* 8033529C 2C 03 00 04 */ cmpwi r3, 4 -/* 803352A0 38 80 00 06 */ li r4, 6 -/* 803352A4 40 82 00 08 */ bne lbl_803352AC -/* 803352A8 38 80 00 0C */ li r4, 0xc -lbl_803352AC: -/* 803352AC 38 60 00 00 */ li r3, 0 -/* 803352B0 80 1F 00 20 */ lwz r0, 0x20(r31) -/* 803352B4 28 00 00 00 */ cmplwi r0, 0 -/* 803352B8 41 82 00 0C */ beq lbl_803352C4 -/* 803352BC 7C 03 03 78 */ mr r3, r0 -/* 803352C0 48 00 00 28 */ b lbl_803352E8 -lbl_803352C4: -/* 803352C4 80 1F 00 24 */ lwz r0, 0x24(r31) -/* 803352C8 28 00 00 00 */ cmplwi r0, 0 -/* 803352CC 41 82 00 0C */ beq lbl_803352D8 -/* 803352D0 7C 03 03 78 */ mr r3, r0 -/* 803352D4 48 00 00 14 */ b lbl_803352E8 -lbl_803352D8: -/* 803352D8 80 1F 00 2C */ lwz r0, 0x2c(r31) -/* 803352DC 28 00 00 00 */ cmplwi r0, 0 -/* 803352E0 41 82 00 08 */ beq lbl_803352E8 -/* 803352E4 7C 03 03 78 */ mr r3, r0 -lbl_803352E8: -/* 803352E8 80 1F 00 1C */ lwz r0, 0x1c(r31) -/* 803352EC 28 00 00 00 */ cmplwi r0, 0 -/* 803352F0 40 82 00 10 */ bne lbl_80335300 -/* 803352F4 38 00 00 00 */ li r0, 0 -/* 803352F8 90 1F 00 04 */ stw r0, 4(r31) -/* 803352FC 48 00 00 38 */ b lbl_80335334 -lbl_80335300: -/* 80335300 28 03 00 00 */ cmplwi r3, 0 -/* 80335304 41 82 00 18 */ beq lbl_8033531C -/* 80335308 7C 00 18 50 */ subf r0, r0, r3 -/* 8033530C 7C 60 23 96 */ divwu r3, r0, r4 -/* 80335310 38 03 00 01 */ addi r0, r3, 1 -/* 80335314 90 1F 00 04 */ stw r0, 4(r31) -/* 80335318 48 00 00 1C */ b lbl_80335334 -lbl_8033531C: -/* 8033531C 80 7E 00 10 */ lwz r3, 0x10(r30) -/* 80335320 80 1E 00 04 */ lwz r0, 4(r30) -/* 80335324 7C 03 00 50 */ subf r0, r3, r0 -/* 80335328 7C 60 23 96 */ divwu r3, r0, r4 -/* 8033532C 38 03 00 01 */ addi r0, r3, 1 -/* 80335330 90 1F 00 04 */ stw r0, 4(r31) -lbl_80335334: -/* 80335334 38 60 00 00 */ li r3, 0 -/* 80335338 80 1F 00 28 */ lwz r0, 0x28(r31) -/* 8033533C 28 00 00 00 */ cmplwi r0, 0 -/* 80335340 41 82 00 0C */ beq lbl_8033534C -/* 80335344 7C 03 03 78 */ mr r3, r0 -/* 80335348 48 00 00 14 */ b lbl_8033535C -lbl_8033534C: -/* 8033534C 80 1F 00 2C */ lwz r0, 0x2c(r31) -/* 80335350 28 00 00 00 */ cmplwi r0, 0 -/* 80335354 41 82 00 08 */ beq lbl_8033535C -/* 80335358 7C 03 03 78 */ mr r3, r0 -lbl_8033535C: -/* 8033535C 80 1F 00 24 */ lwz r0, 0x24(r31) -/* 80335360 28 00 00 00 */ cmplwi r0, 0 -/* 80335364 40 82 00 10 */ bne lbl_80335374 -/* 80335368 38 00 00 00 */ li r0, 0 -/* 8033536C 90 1F 00 08 */ stw r0, 8(r31) -/* 80335370 48 00 00 38 */ b lbl_803353A8 -lbl_80335374: -/* 80335374 28 03 00 00 */ cmplwi r3, 0 -/* 80335378 41 82 00 18 */ beq lbl_80335390 -/* 8033537C 7C 00 18 50 */ subf r0, r0, r3 -/* 80335380 54 03 F0 BE */ srwi r3, r0, 2 -/* 80335384 38 03 00 01 */ addi r0, r3, 1 -/* 80335388 90 1F 00 08 */ stw r0, 8(r31) -/* 8033538C 48 00 00 1C */ b lbl_803353A8 -lbl_80335390: -/* 80335390 80 7E 00 18 */ lwz r3, 0x18(r30) -/* 80335394 80 1E 00 04 */ lwz r0, 4(r30) -/* 80335398 7C 03 00 50 */ subf r0, r3, r0 -/* 8033539C 54 03 F0 BE */ srwi r3, r0, 2 -/* 803353A0 38 03 00 01 */ addi r0, r3, 1 -/* 803353A4 90 1F 00 08 */ stw r0, 8(r31) -lbl_803353A8: -/* 803353A8 80 1F 00 2C */ lwz r0, 0x2c(r31) -/* 803353AC 28 00 00 00 */ cmplwi r0, 0 -/* 803353B0 40 82 00 10 */ bne lbl_803353C0 -/* 803353B4 38 00 00 00 */ li r0, 0 -/* 803353B8 90 1F 00 0C */ stw r0, 0xc(r31) -/* 803353BC 48 00 00 1C */ b lbl_803353D8 -lbl_803353C0: -/* 803353C0 80 7E 00 20 */ lwz r3, 0x20(r30) -/* 803353C4 80 1E 00 04 */ lwz r0, 4(r30) -/* 803353C8 7C 03 00 50 */ subf r0, r3, r0 -/* 803353CC 54 03 E8 FE */ srwi r3, r0, 3 -/* 803353D0 38 03 00 01 */ addi r0, r3, 1 -/* 803353D4 90 1F 00 0C */ stw r0, 0xc(r31) -lbl_803353D8: -/* 803353D8 39 61 00 20 */ addi r11, r1, 0x20 -/* 803353DC 48 02 CE 49 */ bl _restgpr_28 -/* 803353E0 80 01 00 24 */ lwz r0, 0x24(r1) -/* 803353E4 7C 08 03 A6 */ mtlr r0 -/* 803353E8 38 21 00 20 */ addi r1, r1, 0x20 -/* 803353EC 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DModelLoader/setupBBoardInfo__14J3DModelLoaderFv.s b/asm/JSystem/J3DGraphLoader/J3DModelLoader/setupBBoardInfo__14J3DModelLoaderFv.s deleted file mode 100644 index 77e53387a50..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DModelLoader/setupBBoardInfo__14J3DModelLoaderFv.s +++ /dev/null @@ -1,100 +0,0 @@ -lbl_80334EE0: -/* 80334EE0 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80334EE4 7C 08 02 A6 */ mflr r0 -/* 80334EE8 90 01 00 24 */ stw r0, 0x24(r1) -/* 80334EEC 39 61 00 20 */ addi r11, r1, 0x20 -/* 80334EF0 48 02 D2 E5 */ bl _savegpr_27 -/* 80334EF4 7C 7D 1B 78 */ mr r29, r3 -/* 80334EF8 3B C0 00 00 */ li r30, 0 -/* 80334EFC 48 00 01 20 */ b lbl_8033501C -lbl_80334F00: -/* 80334F00 80 64 00 28 */ lwz r3, 0x28(r4) -/* 80334F04 57 DF 13 BA */ rlwinm r31, r30, 2, 0xe, 0x1d -/* 80334F08 7C 63 F8 2E */ lwzx r3, r3, r31 -/* 80334F0C 80 63 00 58 */ lwz r3, 0x58(r3) -/* 80334F10 28 03 00 00 */ cmplwi r3, 0 -/* 80334F14 41 82 01 04 */ beq lbl_80335018 -/* 80334F18 80 63 00 08 */ lwz r3, 8(r3) -/* 80334F1C A3 63 00 08 */ lhz r27, 8(r3) -/* 80334F20 80 7D 00 0C */ lwz r3, 0xc(r29) -/* 80334F24 80 83 00 10 */ lwz r4, 0x10(r3) -/* 80334F28 48 00 18 55 */ bl func_8033677C -/* 80334F2C 7C 7C 1B 78 */ mr r28, r3 -/* 80334F30 80 7D 00 0C */ lwz r3, 0xc(r29) -/* 80334F34 80 83 00 0C */ lwz r4, 0xc(r3) -/* 80334F38 48 00 18 2D */ bl func_80336764 -/* 80334F3C 57 60 0B FC */ rlwinm r0, r27, 1, 0xf, 0x1e -/* 80334F40 7C 1C 02 2E */ lhzx r0, r28, r0 -/* 80334F44 1C 00 00 28 */ mulli r0, r0, 0x28 -/* 80334F48 7C 03 00 AE */ lbzx r0, r3, r0 -/* 80334F4C 2C 00 00 02 */ cmpwi r0, 2 -/* 80334F50 41 82 00 6C */ beq lbl_80334FBC -/* 80334F54 40 80 00 14 */ bge lbl_80334F68 -/* 80334F58 2C 00 00 00 */ cmpwi r0, 0 -/* 80334F5C 41 82 00 18 */ beq lbl_80334F74 -/* 80334F60 40 80 00 30 */ bge lbl_80334F90 -/* 80334F64 48 00 00 A0 */ b lbl_80335004 -lbl_80334F68: -/* 80334F68 2C 00 00 04 */ cmpwi r0, 4 -/* 80334F6C 40 80 00 98 */ bge lbl_80335004 -/* 80334F70 48 00 00 78 */ b lbl_80334FE8 -lbl_80334F74: -/* 80334F74 80 7D 00 04 */ lwz r3, 4(r29) -/* 80334F78 80 63 00 28 */ lwz r3, 0x28(r3) -/* 80334F7C 7C 63 F8 2E */ lwzx r3, r3, r31 -/* 80334F80 88 03 00 16 */ lbz r0, 0x16(r3) -/* 80334F84 54 00 07 3E */ clrlwi r0, r0, 0x1c -/* 80334F88 98 03 00 16 */ stb r0, 0x16(r3) -/* 80334F8C 48 00 00 8C */ b lbl_80335018 -lbl_80334F90: -/* 80334F90 80 7D 00 04 */ lwz r3, 4(r29) -/* 80334F94 80 63 00 28 */ lwz r3, 0x28(r3) -/* 80334F98 7C 63 F8 2E */ lwzx r3, r3, r31 -/* 80334F9C 88 03 00 16 */ lbz r0, 0x16(r3) -/* 80334FA0 54 00 07 2E */ rlwinm r0, r0, 0, 0x1c, 0x17 -/* 80334FA4 60 00 00 10 */ ori r0, r0, 0x10 -/* 80334FA8 98 03 00 16 */ stb r0, 0x16(r3) -/* 80334FAC 38 00 00 01 */ li r0, 1 -/* 80334FB0 80 7D 00 04 */ lwz r3, 4(r29) -/* 80334FB4 B0 03 00 0E */ sth r0, 0xe(r3) -/* 80334FB8 48 00 00 60 */ b lbl_80335018 -lbl_80334FBC: -/* 80334FBC 80 7D 00 04 */ lwz r3, 4(r29) -/* 80334FC0 80 63 00 28 */ lwz r3, 0x28(r3) -/* 80334FC4 7C 63 F8 2E */ lwzx r3, r3, r31 -/* 80334FC8 88 03 00 16 */ lbz r0, 0x16(r3) -/* 80334FCC 54 00 07 2E */ rlwinm r0, r0, 0, 0x1c, 0x17 -/* 80334FD0 60 00 00 20 */ ori r0, r0, 0x20 -/* 80334FD4 98 03 00 16 */ stb r0, 0x16(r3) -/* 80334FD8 38 00 00 01 */ li r0, 1 -/* 80334FDC 80 7D 00 04 */ lwz r3, 4(r29) -/* 80334FE0 B0 03 00 0E */ sth r0, 0xe(r3) -/* 80334FE4 48 00 00 34 */ b lbl_80335018 -lbl_80334FE8: -/* 80334FE8 80 7D 00 04 */ lwz r3, 4(r29) -/* 80334FEC 80 63 00 28 */ lwz r3, 0x28(r3) -/* 80334FF0 7C 63 F8 2E */ lwzx r3, r3, r31 -/* 80334FF4 88 03 00 16 */ lbz r0, 0x16(r3) -/* 80334FF8 54 00 07 3E */ clrlwi r0, r0, 0x1c -/* 80334FFC 98 03 00 16 */ stb r0, 0x16(r3) -/* 80335000 48 00 00 18 */ b lbl_80335018 -lbl_80335004: -/* 80335004 3C 60 80 3A */ lis r3, J3DModelLoader__stringBase0@ha /* 0x803A20B0@ha */ -/* 80335008 38 63 20 B0 */ addi r3, r3, J3DModelLoader__stringBase0@l /* 0x803A20B0@l */ -/* 8033500C 38 63 00 14 */ addi r3, r3, 0x14 -/* 80335010 4C C6 31 82 */ crclr 6 -/* 80335014 4B CD 1A A9 */ bl OSReport -lbl_80335018: -/* 80335018 3B DE 00 01 */ addi r30, r30, 1 -lbl_8033501C: -/* 8033501C 80 9D 00 04 */ lwz r4, 4(r29) -/* 80335020 A0 64 00 2C */ lhz r3, 0x2c(r4) -/* 80335024 57 C0 04 3E */ clrlwi r0, r30, 0x10 -/* 80335028 7C 00 18 40 */ cmplw r0, r3 -/* 8033502C 41 80 FE D4 */ blt lbl_80334F00 -/* 80335030 39 61 00 20 */ addi r11, r1, 0x20 -/* 80335034 48 02 D1 ED */ bl _restgpr_27 -/* 80335038 80 01 00 24 */ lwz r0, 0x24(r1) -/* 8033503C 7C 08 03 A6 */ mtlr r0 -/* 80335040 38 21 00 20 */ addi r1, r1, 0x20 -/* 80335044 4E 80 00 20 */ blr diff --git a/include/JSystem/J3DGraphAnimator/J3DJoint.h b/include/JSystem/J3DGraphAnimator/J3DJoint.h index 42bc45d7cc6..093cc448e07 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJoint.h +++ b/include/JSystem/J3DGraphAnimator/J3DJoint.h @@ -69,6 +69,7 @@ class J3DJoint { J3DMtxCalc* getMtxCalc() { return mMtxCalc; } J3DMtxCalc* getCurrentMtxCalc() { return mCurrentMtxCalc; }; J3DJoint* getChild() { return mChild; } + void setMtxType(u8 type) { mKind = (mKind & ~0xf0) | (type << 4); } static J3DMtxCalc* mCurrentMtxCalc; diff --git a/include/JSystem/J3DGraphAnimator/J3DJointTree.h b/include/JSystem/J3DGraphAnimator/J3DJointTree.h index 2dd47be9f86..542d5130069 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJointTree.h +++ b/include/JSystem/J3DGraphAnimator/J3DJointTree.h @@ -35,6 +35,9 @@ class J3DJointTree { /* 80325CAC */ virtual void calc(J3DMtxBuffer*, Vec const&, f32 const (&)[3][4]); /* 80325D24 */ virtual ~J3DJointTree(); + J3DModelHierarchy const* getHierarchy() { return mHierarchy; } + void setHierarchy(J3DModelHierarchy* hierarchy) { mHierarchy = hierarchy; } + void setBasicMtxCalc(J3DMtxCalc* calc) { mBasicMtxCalc = calc; } u16 getWEvlpMtxNum() const { return mWEvlpMtxNum; } u8 getWEvlpMixMtxNum(u16 idx) const { return mWEvlpMixMtxNum[idx]; } u16 * getWEvlpMixIndex() const { return mWEvlpMixIndex; } @@ -45,15 +48,20 @@ class J3DJointTree { u16 getDrawMtxNum() const { return mDrawMtxData.mEntryNum; } u8 getDrawMtxFlag(u16 idx) const { return mDrawMtxData.mDrawMtxFlag[idx]; } u16 getDrawMtxIndex(u16 idx) const { return mDrawMtxData.mDrawMtxIndex[idx]; } + J3DDrawMtxData* getDrawMtxData() { return &mDrawMtxData; } JUTNameTab* getJointName() const { return mJointName; } J3DJoint* getRootNode() { return mRootNode; } J3DJoint* getJointNodePointer(u16 idx) const { return mJointNodePointer[idx]; } J3DMtxCalc* getBasicMtxCalc() const { return mBasicMtxCalc; } Mtx& getInvJointMtx(s32 idx) const { return mInvJointMtx[idx]; } u32 getModelDataType() const { return mModelDataType; } + void setModelDataType(u32 type) { mModelDataType = type; } bool checkFlag(u32 flag) { return mFlags & flag; } + void setFlag(u32 flag) { mFlags = flag; } private: + friend class J3DModelLoader; + /* 0x04 */ J3DModelHierarchy* mHierarchy; /* 0x08 */ u32 mFlags; /* 0x0C */ u32 mModelDataType; diff --git a/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h b/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h index 1891eedb96d..d770e328461 100644 --- a/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h +++ b/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h @@ -38,11 +38,15 @@ class J3DMaterialTable { bool isLocked() const { return field_0x1c == 1; } private: + friend class J3DModelLoader; + friend class J3DModelLoader_v26; + friend class J3DModelLoader_v21; + /* 0x04 */ u16 mMaterialNum; /* 0x06 */ u16 mUniqueMatNum; /* 0x08 */ J3DMaterial** mMaterialNodePointer; /* 0x0C */ JUTNameTab* mMaterialName; - /* 0x10 */ u32 field_0x10; + /* 0x10 */ J3DMaterial* field_0x10; /* 0x14 */ J3DTexture* mTexture; /* 0x18 */ JUTNameTab* mTextureName; /* 0x1C */ u16 field_0x1c; diff --git a/include/JSystem/J3DGraphAnimator/J3DModelData.h b/include/JSystem/J3DGraphAnimator/J3DModelData.h index 3b113258f93..dc1f01d5ce4 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModelData.h +++ b/include/JSystem/J3DGraphAnimator/J3DModelData.h @@ -37,9 +37,14 @@ class J3DModelData { u32 getNrmNum() const { return mVertexData.getNrmNum(); } u8 getDrawMtxFlag(u16 idx) const { return mJointTree.getDrawMtxFlag(idx); } u16 getDrawMtxIndex(u16 idx) const { return mJointTree.getDrawMtxIndex(idx); } + J3DDrawMtxData* getDrawMtxData() { return mJointTree.getDrawMtxData(); } + J3DShapeTable* getShapeTable() { return &mShapeTable; } J3DShape* getShapeNodePointer(u16 idx) const { return mShapeTable.getShapeNodePointer(idx); } J3DJoint* getJointNodePointer(u16 idx) const { return mJointTree.getJointNodePointer(idx); } J3DJointTree& getJointTree() { return mJointTree; } + J3DModelHierarchy const* getHierarchy() { return mJointTree.getHierarchy(); } + void setHierarchy(J3DModelHierarchy* hierarchy) { mJointTree.setHierarchy(hierarchy); } + void setBasicMtxCalc(J3DMtxCalc* calc) { mJointTree.setBasicMtxCalc(calc); } JUTNameTab* getJointName() const { return mJointTree.getJointName(); } Mtx& getInvJointMtx(s32 idx) const { return mJointTree.getInvJointMtx(idx); } J3DTexture* getTexture() const { return mMaterialTable.getTexture(); } @@ -49,12 +54,13 @@ class J3DModelData { f32* getWEvlpMixWeight() const { return mJointTree.getWEvlpMixWeight(); } u8 getWEvlpMixMtxNum(u16 idx) const { return mJointTree.getWEvlpMixMtxNum(idx); } u32 getModelDataType() const { return mJointTree.getModelDataType(); } + void setModelDataType(u32 type) { mJointTree.setModelDataType(type); } void* getVtxPosArray() const { return mVertexData.getVtxPosArray(); } void* getVtxNrmArray() const { return mVertexData.getVtxNrmArray(); } GXColor* getVtxColorArray(u8 idx) const { return mVertexData.getVtxColorArray(idx); } bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; } u32 getFlag() const { return mFlags; } - void* getRawData() const { return mpRawData; } + void const* getRawData() const { return mpRawData; } u16 checkBumpFlag() const { return mbHasBumpArray; } void setBumpFlag(u32 flag) { mbHasBumpArray = flag; } bool checkBBoardFlag() const { return mbHasBillboard == 1; } @@ -78,9 +84,15 @@ class J3DModelData { syncJ3DSysFlags(); syncJ3DSysPointers(); } + void makeHierarchy(J3DJoint* joint, J3DModelHierarchy const** hierarchy) { + mJointTree.makeHierarchy(joint, hierarchy, &mMaterialTable, &mShapeTable); + mShapeTable.initShapeNodes(getDrawMtxData(), &getVertexData()); + } private: - /* 0x04 */ void* mpRawData; + friend class J3DModelLoader; + + /* 0x04 */ void const* mpRawData; /* 0x08 */ u32 mFlags; /* 0x0C */ u16 mbHasBumpArray; /* 0x0E */ u16 mbHasBillboard; diff --git a/include/JSystem/J3DGraphAnimator/J3DShapeTable.h b/include/JSystem/J3DGraphAnimator/J3DShapeTable.h index 4df0f6e0b77..f31cff671c4 100644 --- a/include/JSystem/J3DGraphAnimator/J3DShapeTable.h +++ b/include/JSystem/J3DGraphAnimator/J3DShapeTable.h @@ -25,6 +25,8 @@ class J3DShapeTable { J3DShape* getShapeNodePointer(u16 idx) const { return mShapeNodePointer[idx]; } private: + friend class J3DModelLoader; + /* 0x4 */ u16 mShapeNum; /* 0x8 */ J3DShape** mShapeNodePointer; /* 0xC */ JUTNameTab* mShapeName; diff --git a/include/JSystem/J3DGraphBase/J3DMatBlock.h b/include/JSystem/J3DGraphBase/J3DMatBlock.h index 57fabded474..e0520caba59 100644 --- a/include/JSystem/J3DGraphBase/J3DMatBlock.h +++ b/include/JSystem/J3DGraphBase/J3DMatBlock.h @@ -175,7 +175,7 @@ class J3DTevBlock { /* 8000DFD0 */ virtual u8 getTevStageNum() const; /* 80323550 */ virtual void setTevStage(u32, J3DTevStage const*); /* 8000E0A8 */ virtual void setTevStage(u32, J3DTevStage); - /* 8000DF8C */ virtual bool getTevStage(u32); + /* 8000DF8C */ virtual J3DTevStage* getTevStage(u32); /* 8032295C */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); /* 80322958 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); /* 80322960 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); @@ -238,7 +238,7 @@ class J3DTevBlockPatched : public J3DTevBlock { /* 803229B8 */ virtual u8 getTevStageNum() const; /* 80322A6C */ virtual void setTevStage(u32, J3DTevStage const*); /* 80322A30 */ virtual void setTevStage(u32, J3DTevStage); - /* 80322AA8 */ virtual bool getTevStage(u32); + /* 80322AA8 */ virtual J3DTevStage* getTevStage(u32); /* 80322AD0 */ virtual void setIndTevStage(u32, J3DIndTevStage const*); /* 80322ABC */ virtual void setIndTevStage(u32, J3DIndTevStage); /* 80322AE4 */ virtual bool getIndTevStage(u32); @@ -308,7 +308,7 @@ class J3DTevBlock4 : public J3DTevBlock { /* 803221C8 */ virtual u8 getTevStageNum() const; /* 8032220C */ virtual void setTevStage(u32, J3DTevStage const*); /* 803221D0 */ virtual void setTevStage(u32, J3DTevStage); - /* 80322248 */ virtual bool getTevStage(u32); + /* 80322248 */ virtual J3DTevStage* getTevStage(u32); /* 80322294 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); /* 8032225C */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); /* 803222DC */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); @@ -381,7 +381,7 @@ class J3DTevBlock2 : public J3DTevBlock { /* 8032258C */ virtual u8 getTevStageNum() const; /* 803225D0 */ virtual void setTevStage(u32, J3DTevStage const*); /* 80322594 */ virtual void setTevStage(u32, J3DTevStage); - /* 8032260C */ virtual bool getTevStage(u32); + /* 8032260C */ virtual J3DTevStage* getTevStage(u32); /* 80322658 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); /* 80322620 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); /* 803226A0 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); @@ -454,7 +454,7 @@ class J3DTevBlock16 : public J3DTevBlock { /* 80321DFC */ virtual u8 getTevStageNum() const; /* 80321E40 */ virtual void setTevStage(u32, J3DTevStage const*); /* 80321E04 */ virtual void setTevStage(u32, J3DTevStage); - /* 80321E7C */ virtual bool getTevStage(u32); + /* 80321E7C */ virtual J3DTevStage* getTevStage(u32); /* 80321EC8 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); /* 80321E90 */ virtual void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); /* 80321F10 */ virtual void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); @@ -515,7 +515,7 @@ class J3DTevBlock1 : public J3DTevBlock { /* 8032281C */ virtual u8 getTevStageNum() const; /* 80322860 */ virtual void setTevStage(u32, J3DTevStage const*); /* 80322824 */ virtual void setTevStage(u32, J3DTevStage); - /* 8032289C */ virtual bool getTevStage(u32); + /* 8032289C */ virtual J3DTevStage* getTevStage(u32); /* 803228C4 */ virtual void setIndTevStage(u32, J3DIndTevStage const*); /* 803228B0 */ virtual void setIndTevStage(u32, J3DIndTevStage); /* 803228D8 */ virtual bool getIndTevStage(u32); @@ -758,6 +758,13 @@ class J3DPEBlockFogOff : public J3DPEBlock { /* 0x0F */ u8 mDither; }; // Size: 0x10 +struct J3DIndTexCoordScaleInfo { + /* 0x0 */ u8 mScaleS; + /* 0x1 */ u8 mScaleT; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; +}; + struct J3DIndTexCoordScale { /* 8000E024 */ ~J3DIndTexCoordScale(); /* 8000E0E4 */ J3DIndTexCoordScale(); @@ -776,6 +783,13 @@ struct J3DIndTexMtx { /* 0x18 */ u8 mScaleExp; }; // Size: 0x1C +struct J3DIndTexOrderInfo { + /* 0x0 */ u8 mMap; + /* 0x1 */ u8 mCoord; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; +}; + struct J3DIndTexOrder { /* 8000E128 */ J3DIndTexOrder(); diff --git a/include/JSystem/J3DGraphBase/J3DMaterial.h b/include/JSystem/J3DGraphBase/J3DMaterial.h index 1c5853f7618..d6339546916 100644 --- a/include/JSystem/J3DGraphBase/J3DMaterial.h +++ b/include/JSystem/J3DGraphBase/J3DMaterial.h @@ -42,6 +42,8 @@ class J3DMaterial { /* 80316E14 */ virtual void reset(); /* 80316E70 */ virtual void change(); + J3DMaterial() { initialize(); } + ~J3DMaterial() {} J3DMaterial* getNext() const { return mNext; } J3DShape* getShape() const { return mShape; } J3DTevBlock* getTevBlock() const { return mTevBlock; } diff --git a/include/JSystem/J3DGraphBase/J3DTexture.h b/include/JSystem/J3DGraphBase/J3DTexture.h index adb98ecde70..e2bf0c9052b 100644 --- a/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/include/JSystem/J3DGraphBase/J3DTexture.h @@ -9,13 +9,15 @@ class J3DTexture { private: /* 0x0 */ u16 mNum; + /* 0x2 */ u16 field_0x2; /* 0x4 */ ResTIMG* mpRes; public: + J3DTexture(u16 num, ResTIMG* res) : mNum(num), field_0x2(0), mpRes(res) {} /* 8031204C */ void loadGX(u16, _GXTexMapID) const; /* 803121A4 */ void entryNum(u16); /* 8031221C */ void addResTIMG(u16, ResTIMG const*); - /* 803366A4 */ virtual ~J3DTexture(); + /* 803366A4 */ virtual ~J3DTexture() {} u16 getNum() const { return mNum; } ResTIMG* getResTIMG(u16 entry) const { return &mpRes[entry]; } diff --git a/include/JSystem/J3DGraphBase/J3DVertex.h b/include/JSystem/J3DGraphBase/J3DVertex.h index 0b184b0f035..1f0c7c421bc 100644 --- a/include/JSystem/J3DGraphBase/J3DVertex.h +++ b/include/JSystem/J3DGraphBase/J3DVertex.h @@ -42,6 +42,8 @@ class J3DVertexData { void setVtxNrmType(GXCompType type) { mVtxNrmType = type; } private: + friend class J3DModelLoader; + /* 0x00 */ u32 mVtxNum; /* 0x04 */ u32 mNrmNum; /* 0x08 */ u32 mColNum; diff --git a/include/JSystem/J3DGraphLoader/J3DJointFactory.h b/include/JSystem/J3DGraphLoader/J3DJointFactory.h index 2c7653b26d3..5b6325d1009 100644 --- a/include/JSystem/J3DGraphLoader/J3DJointFactory.h +++ b/include/JSystem/J3DGraphLoader/J3DJointFactory.h @@ -5,7 +5,7 @@ #include "dolphin/types.h" class J3DJoint; -struct ResNTAB; +struct J3DJointBlock; struct J3DJointInitData { /* 0x00 */ u16 mKind; @@ -16,18 +16,6 @@ struct J3DJointInitData { /* 0x2C */ Vec mMax; }; // Size: 0x30 -struct J3DJointBlock { - /* 0x00 */ u8 mMagic[4]; - /* 0x04 */ u32 mSize; - - /* 0x08 */ u16 mJointNum; - /* 0x0A */ u16 _pad; - - /* 0x0C */ J3DJointInitData* mJointInitData; - /* 0x10 */ u16* mIndexTable; - /* 0x14 */ ResNTAB* mNameTable; -}; - struct J3DJointFactory { /* 80337178 */ J3DJointFactory(J3DJointBlock const&); /* 803371D0 */ J3DJoint* create(int); diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h index 50785d4c1ed..f0c0e87f0c8 100644 --- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h +++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h @@ -1,6 +1,65 @@ #ifndef J3DMATERIALFACTORY_H #define J3DMATERIALFACTORY_H -#include "dolphin/types.h" +#include "JSystem/J3DGraphLoader/J3DModelLoader.h" + +class J3DMaterial; + +class J3DMaterialFactory { +public: + enum MaterialType { + MATERIAL_TYPE_NORMAL = 0, + MATERIAL_TYPE_LOCKED = 1, + MATERIAL_TYPE_PATCHED = 2, + }; + + /* 80330234 */ J3DMaterialFactory(J3DMaterialDLBlock const&); + /* 8032FFEC */ J3DMaterialFactory(J3DMaterialBlock const&); + /* 803302BC */ u16 countUniqueMaterials(); + /* 80330304 */ void countTexGens(int) const; + /* 8033033C */ void countStages(int) const; + /* 803303C4 */ J3DMaterial* create(J3DMaterial*, J3DMaterialFactory::MaterialType, int, u32) const; + /* 80330440 */ void createNormalMaterial(J3DMaterial*, int, u32) const; + /* 80330D84 */ void createPatchedMaterial(J3DMaterial*, int, u32) const; + /* 8033168C */ void modifyPatchedCurrentMtx(J3DMaterial*, int) const; + /* 803317D4 */ void createLockedMaterial(J3DMaterial*, int, u32) const; + /* 80331A7C */ void calcSize(J3DMaterial*, J3DMaterialFactory::MaterialType, int, u32) const; + /* 80331AFC */ void calcSizeNormalMaterial(J3DMaterial*, int, u32) const; + /* 80331C30 */ void calcSizePatchedMaterial(J3DMaterial*, int, u32) const; + /* 80331D00 */ void calcSizeLockedMaterial(J3DMaterial*, int, u32) const; + /* 80331D18 */ void newMatColor(int, int) const; + /* 80331D74 */ void newColorChanNum(int) const; + /* 80331DAC */ void newColorChan(int, int) const; + /* 80331F50 */ void newAmbColor(int, int) const; + /* 80331FAC */ void newTexGenNum(int) const; + /* 80331FE4 */ void newTexCoord(int, int) const; + /* 80332044 */ void newTexMtx(int, int) const; + /* 803320CC */ void newCullMode(int) const; + /* 8033210C */ void newTexNo(int, int) const; + /* 80332154 */ void newTevOrder(int, int) const; + /* 803321A0 */ void newTevColor(int, int) const; + /* 80332210 */ void newTevKColor(int, int) const; + /* 8033226C */ void newTevStageNum(int) const; + /* 803322A4 */ void newTevStage(int, int) const; + /* 80332304 */ void newTevSwapModeTable(int, int) const; + /* 803323A0 */ void newIndTexStageNum(int) const; + /* 803323C8 */ void newIndTexOrder(int, int) const; + /* 8033240C */ void newIndTexMtx(int, int) const; + /* 803324B4 */ void newIndTevStage(int, int) const; + /* 80332648 */ void newIndTexCoordScale(int, int) const; + /* 8033268C */ void newFog(int) const; + /* 80332768 */ void newAlphaComp(int) const; + /* 803327E8 */ void newBlend(int) const; + /* 8033282C */ void newZMode(int) const; + /* 8033288C */ void newZCompLoc(int) const; + /* 803328C4 */ void newDither(int) const; + /* 803328FC */ void newNBTScale(int) const; + + u16 getMaterialID(int i_idx) { return mpMaterialID[i_idx]; } + + /* 0x00 */ u8 field_0x00[8]; + /* 0x08 */ u16* mpMaterialID; + /* 0x0C */ u8 field_0x0c[0x7C]; +}; #endif /* J3DMATERIALFACTORY_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h index 41e88bdec84..a2126d3a1e1 100644 --- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h +++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h @@ -1,6 +1,92 @@ #ifndef J3DMATERIALFACTORY_V21_H #define J3DMATERIALFACTORY_V21_H +#include "JSystem/J3DGraphLoader/J3DModelLoader.h" #include "dolphin/types.h" +#include "dolphin/gx/GXEnum.h" +#include "dolphin/gx/GXStruct.h" + +class J3DMaterial; +class J3DMaterialInitData_v21; +class J3DIndInitData; +class J3DColorChanInfo; +class J3DLightInfo; +class J3DTexCoordInfo; +class J3DTexCoord2Info; +class J3DTexMtxInfo; +class J3DTevOrderInfo; +class J3DTevStageInfo; +class J3DTevSwapModeInfo; +class J3DTevSwapModeTableInfo; +class J3DFogInfo; +class J3DAlphaCompInfo; +class J3DBlendInfo; +class J3DZModeInfo; +class J3DNBTScaleInfo; +class J3DDisplayListInit; +class J3DPatchingInfo; +class J3DCurrentMtxInfo; + +class J3DMaterialFactory_v21 { +public: + /* 80332DA4 */ J3DMaterialFactory_v21(J3DMaterialBlock_v21 const&); + /* 80332F84 */ u16 countUniqueMaterials(); + /* 80332FA8 */ void countTexGens(int) const; + /* 80332FE0 */ void countStages(int) const; + /* 80333068 */ J3DMaterial* create(J3DMaterial*, int, u32) const; + /* 803337D8 */ void newMatColor(int, int) const; + /* 80333834 */ void newColorChanNum(int) const; + /* 8033386C */ void newColorChan(int, int) const; + /* 80333A10 */ void newTexGenNum(int) const; + /* 80333A48 */ void newTexCoord(int, int) const; + /* 80333AA8 */ void newTexMtx(int, int) const; + /* 80333B30 */ void newCullMode(int) const; + /* 80333B70 */ void newTexNo(int, int) const; + /* 80333BB8 */ void newTevOrder(int, int) const; + /* 80333C04 */ void newTevColor(int, int) const; + /* 80333C74 */ void newTevKColor(int, int) const; + /* 80333CD0 */ void newTevStageNum(int) const; + /* 80333D08 */ void newTevStage(int, int) const; + /* 80333D68 */ void newTevSwapModeTable(int, int) const; + /* 80333E04 */ void newFog(int) const; + /* 80333EE0 */ void newAlphaComp(int) const; + /* 80333F60 */ void newBlend(int) const; + /* 80333FA4 */ void newZMode(int) const; + /* 80334004 */ void newZCompLoc(int) const; + /* 8033403C */ void newDither(int) const; + /* 80334074 */ void newNBTScale(int) const; + + u16 getMaterialID(u16 idx) { return mpMaterialID[idx]; } + + /* 0x00 */ u16 mMaterialNum; + /* 0x04 */ J3DMaterialInitData_v21* field_0x04; + /* 0x08 */ u16* mpMaterialID; + /* 0x0C */ GXColor* field_0x0c; + /* 0x10 */ u8* field_0x10; + /* 0x14 */ J3DColorChanInfo* field_0x14; + /* 0x18 */ u8* field_0x18; + /* 0x1C */ J3DTexCoordInfo* field_0x1c; + /* 0x20 */ J3DTexCoord2Info* field_0x20; + /* 0x24 */ J3DTexMtxInfo* field_0x24; + /* 0x28 */ J3DTexMtxInfo* field_0x28; + /* 0x2C */ u16* field_0x2c; + /* 0x30 */ GXCullMode* field_0x30; + /* 0x34 */ J3DTevOrderInfo* field_0x34; + /* 0x38 */ GXColorS10* field_0x38; + /* 0x3C */ GXColor* field_0x3c; + /* 0x40 */ u8* field_0x40; + /* 0x44 */ J3DTevStageInfo* field_0x44; + /* 0x48 */ J3DTevSwapModeTableInfo* field_0x48; + /* 0x4C */ J3DFogInfo* field_0x4c; + /* 0x50 */ J3DAlphaCompInfo* field_0x50; + /* 0x54 */ J3DBlendInfo* field_0x54; + /* 0x58 */ J3DZModeInfo* field_0x58; + /* 0x5C */ u8* field_0x5c; + /* 0x60 */ u8* field_0x60; + /* 0x64 */ J3DNBTScaleInfo* field_0x64; + /* 0x68 */ u16 field_0x68; + /* 0x69 */ u8 field_0x69; + /* 0x6A */ u8 field_0x6a; +}; #endif /* J3DMATERIALFACTORY_V21_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DModelLoader.h b/include/JSystem/J3DGraphLoader/J3DModelLoader.h index deff8ed9787..6913516d935 100644 --- a/include/JSystem/J3DGraphLoader/J3DModelLoader.h +++ b/include/JSystem/J3DGraphLoader/J3DModelLoader.h @@ -2,10 +2,226 @@ #define J3DMODELLOADER_H #include "dolphin/types.h" +#include "dolphin/mtx/mtx.h" + +class J3DModelData; +class J3DMaterialTable; +class J3DModelHierarchy; + +struct J3DModelBlock { + /* 0x00 */ u32 mBlockType; + /* 0x04 */ u32 mBlockSize; +}; + +struct J3DModelFileData { + /* 0x00 */ u32 mMagic1; + /* 0x04 */ u32 mMagic2; + /* 0x08 */ u8 field_0x08[4]; + /* 0x0C */ u32 mBlockNum; + /* 0x10 */ u8 field_0x10[0x10]; + /* 0x20 */ J3DModelBlock mBlocks[1]; +}; + +struct J3DModelInfoBlock : public J3DModelBlock { + /* 0x08 */ u16 mFlags; + /* 0x0C */ u32 mPacketNum; + /* 0x10 */ u32 mVtxNum; + /* 0x14 */ void* mpHierarchy; +}; // size 0x18 + +struct J3DVertexBlock : public J3DModelBlock { + /* 0x08 */ void* mpVtxAttrFmtList; + /* 0x0C */ void* mpVtxPosArray; + /* 0x10 */ void* mpVtxNrmArray; + /* 0x14 */ void* mpVtxNBTArray; + /* 0x18 */ void* mpVtxColorArray[2]; + /* 0x20 */ void* mpVtxTexCoordArray[8]; +}; // size 0x40 + +struct J3DEnvelopeBlock : public J3DModelBlock { + /* 0x08 */ u16 mWEvlpMtxNum; + /* 0x0C */ void* mpWEvlpMixMtxNum; + /* 0x10 */ void* mpWEvlpMixIndex; + /* 0x14 */ void* mpWEvlpMixWeight; + /* 0x18 */ void* mpInvJointMtx; +}; // size 0x1C + +struct J3DDrawBlock : public J3DModelBlock { + /* 0x08 */ u16 mMtxNum; + /* 0x0C */ void* mpDrawMtxFlag; + /* 0x10 */ void* mpDrawMtxIndex; +}; // size 0x14 + +struct J3DJointBlock : public J3DModelBlock { + /* 0x08 */ u16 mJointNum; + /* 0x0C */ void* mpJointInitData; + /* 0x10 */ void* mpIndexTable; + /* 0x14 */ void* mpNameTable; +}; // size 0x18 + +struct J3DMaterialBlock : public J3DModelBlock { + /* 0x08 */ u16 mMaterialNum; + /* 0x0C */ void* mpMaterialInitData; + /* 0x10 */ void* mpMaterialID; + /* 0x14 */ void* mpNameTable; + /* 0x18 */ void* mpIndInitData; + /* 0x1C */ void* mpCullMode; + /* 0x20 */ void* mpMatColor; + /* 0x24 */ void* mpColorChanNum; + /* 0x28 */ void* mpColorChanInfo; + /* 0x2C */ void* mpAmbColor; + /* 0x30 */ void* mpLightInfo; + /* 0x34 */ void* mpTexGenNum; + /* 0x38 */ void* mpTexCoordInfo; + /* 0x3C */ void* mpTexCoord2Info; + /* 0x40 */ void* mpTexMtxInfo; + /* 0x44 */ void* field_0x44; + /* 0x48 */ void* mpTexNo; + /* 0x4C */ void* mpTevOrderInfo; + /* 0x50 */ void* mpTevColor; + /* 0x54 */ void* mpTevKColor; + /* 0x58 */ void* mpTevStageNum; + /* 0x5C */ void* mpTevStageInfo; + /* 0x60 */ void* mpTevSwapModeInfo; + /* 0x64 */ void* mpTevSwapModeTableInfo; + /* 0x68 */ void* mpFogInfo; + /* 0x6C */ void* mpAlphaCompInfo; + /* 0x70 */ void* mpBlendInfo; + /* 0x74 */ void* mpZModeInfo; + /* 0x78 */ void* mpZCompLoc; + /* 0x7C */ void* mpDither; + /* 0x80 */ void* mpNBTScaleInfo; +}; + +struct J3DMaterialBlock_v21 : public J3DModelBlock { + /* 0x08 */ u16 mMaterialNum; + /* 0x0C */ void* field_0x0c; + /* 0x10 */ void* field_0x10; + /* 0x14 */ void* mpNameTable; + /* more */ +}; + +struct J3DMaterialDLBlock : public J3DModelBlock { + /* 0x08 */ u16 mMaterialNum; + /* 0x0C */ void* field_0x0c; + /* 0x10 */ void* field_0x10; + /* 0x14 */ void* field_0x14; + /* 0x18 */ void* field_0x18; + /* 0x1C */ void* field_0x1c; + /* 0x20 */ void* mpNameTable; + /* more */ +}; + +struct J3DShapeBlock : public J3DModelBlock { + /* 0x08 */ u16 mShapeNum; + /* 0x0C */ void* mpShapeInitData; + /* 0x10 */ void* mpIndexTable; + /* 0x14 */ void* mpNameTable; + /* 0x18 */ void* mpVtxDescList; + /* 0x1C */ void* mpMtxTable; + /* 0x20 */ void* mpDisplayListData; + /* 0x24 */ void* mpMtxInitData; + /* 0x28 */ void* mpDrawInitData; +}; // size 0x2C + +struct J3DTextureBlock : public J3DModelBlock { + /* 0x08 */ u16 mTextureNum; + /* 0x0C */ void* mpTextureRes; + /* 0x10 */ void* mpNameTable; +}; + +class J3DModelLoader { +public: + /* 8033468C */ J3DModelLoader(); + /* 80335048 */ void readInformation(J3DModelInfoBlock const*, u32); + /* 803351D0 */ void readVertex(J3DVertexBlock const*); + /* 803353F0 */ void readEnvelop(J3DEnvelopeBlock const*); + /* 80335480 */ void readDraw(J3DDrawBlock const*); + /* 80335530 */ void readJoint(J3DJointBlock const*); + /* 80335AF4 */ void readShape(J3DShapeBlock const*, u32); + /* 80335C18 */ void readTexture(J3DTextureBlock const*); + /* 80335F5C */ void readTextureTable(J3DTextureBlock const*); + /* 80336028 */ void readPatchedMaterial(J3DMaterialBlock const*, u32); + /* 80336168 */ void readMaterialDL(J3DMaterialDLBlock const*, u32); + /* 8033631C */ void modifyMaterial(u32); + + /* 80336CD8 */ u32 calcSizeInformation(J3DModelInfoBlock const*, u32); + /* 80336D64 */ u32 calcSizeJoint(J3DJointBlock const*); + /* 80336D90 */ u32 calcSizeEnvelope(J3DEnvelopeBlock const*); + /* 80336DA0 */ u32 calcSizeDraw(J3DDrawBlock const*); + /* 80336EA0 */ u32 calcSizeShape(J3DShapeBlock const*, u32); + /* 80336F44 */ u32 calcSizeTexture(J3DTextureBlock const*); + /* 80336FF0 */ u32 calcSizeTextureTable(J3DTextureBlock const*); + /* 80337010 */ u32 calcSizePatchedMaterial(J3DMaterialBlock const*, u32); + /* 803370A0 */ u32 calcSizeMaterialDL(J3DMaterialDLBlock const*, u32); + + // virtuals + /* 803347E0 */ J3DModelData* load(void const*, u32); + /* 80334ABC */ J3DMaterialTable* loadMaterialTable(void const*); + /* 80334C20 */ J3DModelData* loadBinaryDisplayList(void const*, u32); + /* 803367D4 */ u32 calcLoadSize(void const*, u32); + /* 803369A0 */ u32 calcLoadMaterialTableSize(void const*); + /* 80336A98 */ u32 calcLoadBinaryDisplayListSize(void const*, u32); + /* 80336794 */ u16 countMaterialNum(void const*); + /* 80334EE0 */ void setupBBoardInfo(); + /* 80336450 */ ~J3DModelLoader(); + /* 8033649C */ void readMaterial(J3DMaterialBlock const*, u32); + /* 80336498 */ void readMaterial_v21(J3DMaterialBlock_v21 const*, u32); + /* 803364A4 */ void readMaterialTable(J3DMaterialBlock const*, u32); + /* 803364A0 */ void readMaterialTable_v21(J3DMaterialBlock_v21 const*, u32); + /* 803364A8 */ u32 calcSizeMaterial(J3DMaterialBlock const*, u32); + /* 803364B0 */ u32 calcSizeMaterialTable(J3DMaterialBlock const*, u32); + + /* 0x00 */ void* _vtable; + /* 0x04 */ J3DModelData* mpModelData; + /* 0x08 */ J3DMaterialTable* mpMaterialTable; + /* 0x0C */ J3DShapeBlock const* mpShapeBlock; + /* 0x10 */ J3DMaterialBlock const* mpMaterialBlock; + /* 0x14 */ J3DModelHierarchy* mpModelHierarchy; + /* 0x18 */ u8 field_0x18; + /* 0x19 */ u8 field_0x19; + /* 0x1A */ u16 mEnvelopeSize; +}; + +class J3DModelLoader_v21 { // : public J3DModelLoader { +public: + /* 803363F4 */ ~J3DModelLoader_v21() {} + /* 80335890 */ void readMaterial_v21(J3DMaterialBlock_v21 const*, u32); + /* 80335E20 */ void readMaterialTable_v21(J3DMaterialBlock_v21 const*, u32); + + /* 0x00 */ void* _vtable; + /* 0x04 */ J3DModelData* mpModelData; + /* 0x08 */ J3DMaterialTable* mpMaterialTable; + /* 0x0C */ J3DShapeBlock const* mpShapeBlock; + /* 0x10 */ J3DMaterialBlock const* mpMaterialBlock; + /* 0x14 */ J3DModelHierarchy* mpModelHierarchy; + /* 0x18 */ u8 field_0x18; + /* 0x19 */ u8 field_0x19; + /* 0x1A */ u16 mEnvelopeSize; +}; + +class J3DModelLoader_v26 { // : public J3DModelLoader { +public: + /* 80336398 */ ~J3DModelLoader_v26() {} + /* 80335614 */ void readMaterial(J3DMaterialBlock const*, u32); + /* 80335CE4 */ void readMaterialTable(J3DMaterialBlock const*, u32); + /* 80336DB4 */ u32 calcSizeMaterial(J3DMaterialBlock const*, u32); + /* 80336F60 */ u32 calcSizeMaterialTable(J3DMaterialBlock const*, u32); + + /* 0x00 */ void* _vtable; + /* 0x04 */ J3DModelData* mpModelData; + /* 0x08 */ J3DMaterialTable* mpMaterialTable; + /* 0x0C */ J3DShapeBlock const* mpShapeBlock; + /* 0x10 */ J3DMaterialBlock const* mpMaterialBlock; + /* 0x14 */ J3DModelHierarchy* mpModelHierarchy; + /* 0x18 */ u8 field_0x18; + /* 0x19 */ u8 field_0x19; + /* 0x1A */ u16 mEnvelopeSize; +}; class J3DModelLoaderDataBase { public: - /* 803346BC */ static void* load(void const*, u32); + /* 803346BC */ static J3DModelData* load(void const* i_data, u32 i_flags); }; #endif /* J3DMODELLOADER_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DShapeFactory.h b/include/JSystem/J3DGraphLoader/J3DShapeFactory.h index 63df9092384..16afb484880 100644 --- a/include/JSystem/J3DGraphLoader/J3DShapeFactory.h +++ b/include/JSystem/J3DGraphLoader/J3DShapeFactory.h @@ -1,6 +1,7 @@ #ifndef J3DSHAPEFACTORY_H #define J3DSHAPEFACTORY_H +#include "JSystem/J3DGraphLoader/J3DModelLoader.h" #include "dolphin/gx/GXAttr.h" #include "dolphin/mtx/vec.h" @@ -31,23 +32,6 @@ struct J3DShapeDrawInitData { /* 0x04 */ u32 mDisplayListIndex; }; -struct J3DShapeBlock { - /* 0x00 */ u8 mMagic[4]; - /* 0x04 */ u32 mSize; - - /* 0x08 */ u16 mShapeNum; - /* 0x0A */ u16 _pad; - - /* 0x0C */ J3DShapeInitData* mShapeInitData; - /* 0x10 */ u16* mIndexTable; - /* 0x14 */ ResNTAB* mNameTable; - /* 0x18 */ GXVtxDescList* mVtxDescList; - /* 0x1C */ u16* mMtxTable; - /* 0x20 */ u8* mDisplayListData; - /* 0x24 */ J3DShapeMtxInitData* mMtxInitData; - /* 0x28 */ J3DShapeDrawInitData* mDrawInitData; -}; - struct J3DShapeFactory { /* 80337350 */ J3DShapeFactory(J3DShapeBlock const&); /* 80337400 */ J3DShape* create(int, u32, GXVtxDescList*); diff --git a/libs/JSystem/J3DGraphBase/J3DMatBlock.cpp b/libs/JSystem/J3DGraphBase/J3DMatBlock.cpp index 1ed37bd12f7..0d17fa227d5 100644 --- a/libs/JSystem/J3DGraphBase/J3DMatBlock.cpp +++ b/libs/JSystem/J3DGraphBase/J3DMatBlock.cpp @@ -2799,7 +2799,7 @@ asm void J3DTevBlock16::setTevStage(u32 param_0, J3DTevStage const* param_1) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm bool J3DTevBlock16::getTevStage(u32 param_0) { +asm J3DTevStage* J3DTevBlock16::getTevStage(u32 param_0) { nofralloc #include "asm/JSystem/J3DGraphBase/J3DMatBlock/getTevStage__13J3DTevBlock16FUl.s" } @@ -3853,7 +3853,7 @@ asm void J3DTevBlock4::setTevStage(u32 param_0, J3DTevStage const* param_1) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm bool J3DTevBlock4::getTevStage(u32 param_0) { +asm J3DTevStage* J3DTevBlock4::getTevStage(u32 param_0) { nofralloc #include "asm/JSystem/J3DGraphBase/J3DMatBlock/getTevStage__12J3DTevBlock4FUl.s" } @@ -4246,7 +4246,7 @@ asm void J3DTevBlock2::setTevStage(u32 param_0, J3DTevStage const* param_1) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm bool J3DTevBlock2::getTevStage(u32 param_0) { +asm J3DTevStage* J3DTevBlock2::getTevStage(u32 param_0) { nofralloc #include "asm/JSystem/J3DGraphBase/J3DMatBlock/getTevStage__12J3DTevBlock2FUl.s" } @@ -4503,7 +4503,7 @@ asm void J3DTevBlock1::setTevStage(u32 param_0, J3DTevStage const* param_1) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm bool J3DTevBlock1::getTevStage(u32 param_0) { +asm J3DTevStage* J3DTevBlock1::getTevStage(u32 param_0) { nofralloc #include "asm/JSystem/J3DGraphBase/J3DMatBlock/getTevStage__12J3DTevBlock1FUl.s" } @@ -4739,7 +4739,7 @@ asm void J3DTevBlockPatched::setTevStage(u32 param_0, J3DTevStage const* param_1 #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm bool J3DTevBlockPatched::getTevStage(u32 param_0) { +asm J3DTevStage* J3DTevBlockPatched::getTevStage(u32 param_0) { nofralloc #include "asm/JSystem/J3DGraphBase/J3DMatBlock/getTevStage__18J3DTevBlockPatchedFUl.s" } diff --git a/libs/JSystem/J3DGraphLoader/J3DJointFactory.cpp b/libs/JSystem/J3DGraphLoader/J3DJointFactory.cpp index 03ca3fd6d64..c8c9b091d47 100644 --- a/libs/JSystem/J3DGraphLoader/J3DJointFactory.cpp +++ b/libs/JSystem/J3DGraphLoader/J3DJointFactory.cpp @@ -4,6 +4,7 @@ // #include "JSystem/J3DGraphLoader/J3DJointFactory.h" +#include "JSystem/J3DGraphLoader/J3DModelLoader.h" #include "JSystem/J3DGraphAnimator/J3DJoint.h" #include "JSystem/JSupport/JSupport.h" #include "dolphin/types.h" @@ -16,11 +17,11 @@ extern "C" u16* func_8033677C(const void*, const void*); // JSUConvertOffsetToP /* 80337178-803371D0 331AB8 0058+00 0/0 1/1 0/0 .text __ct__15J3DJointFactoryFRC13J3DJointBlock */ J3DJointFactory::J3DJointFactory(J3DJointBlock const& block) { - mJointInitData = JSUConvertOffsetToPtr(&block, block.mJointInitData); + mJointInitData = JSUConvertOffsetToPtr(&block, block.mpJointInitData); // Fix when we have our ODR working. - // mIndexTable = JSUConvertOffsetToPtr(&block, block.mIndexTable); - mIndexTable = func_8033677C(&block, block.mIndexTable); + // mIndexTable = JSUConvertOffsetToPtr(&block, block.mpIndexTable); + mIndexTable = func_8033677C(&block, block.mpIndexTable); } /* 803371D0-80337338 331B10 0168+00 0/0 1/1 0/0 .text create__15J3DJointFactoryFi */ diff --git a/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp b/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp index 0e8ef2071b3..306e0955904 100644 --- a/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp +++ b/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp @@ -210,56 +210,6 @@ struct J3DMaterial { /* 80332B94 */ ~J3DMaterial(); }; -struct J3DMaterialBlock {}; - -struct J3DMaterialDLBlock {}; - -struct J3DMaterialFactory { - struct MaterialType {}; - - /* 80330234 */ J3DMaterialFactory(J3DMaterialDLBlock const&); - /* 8032FFEC */ J3DMaterialFactory(J3DMaterialBlock const&); - /* 803302BC */ void countUniqueMaterials(); - /* 80330304 */ void countTexGens(int) const; - /* 8033033C */ void countStages(int) const; - /* 803303C4 */ void create(J3DMaterial*, J3DMaterialFactory::MaterialType, int, u32) const; - /* 80330440 */ void createNormalMaterial(J3DMaterial*, int, u32) const; - /* 80330D84 */ void createPatchedMaterial(J3DMaterial*, int, u32) const; - /* 8033168C */ void modifyPatchedCurrentMtx(J3DMaterial*, int) const; - /* 803317D4 */ void createLockedMaterial(J3DMaterial*, int, u32) const; - /* 80331A7C */ void calcSize(J3DMaterial*, J3DMaterialFactory::MaterialType, int, u32) const; - /* 80331AFC */ void calcSizeNormalMaterial(J3DMaterial*, int, u32) const; - /* 80331C30 */ void calcSizePatchedMaterial(J3DMaterial*, int, u32) const; - /* 80331D00 */ void calcSizeLockedMaterial(J3DMaterial*, int, u32) const; - /* 80331D18 */ void newMatColor(int, int) const; - /* 80331D74 */ void newColorChanNum(int) const; - /* 80331DAC */ void newColorChan(int, int) const; - /* 80331F50 */ void newAmbColor(int, int) const; - /* 80331FAC */ void newTexGenNum(int) const; - /* 80331FE4 */ void newTexCoord(int, int) const; - /* 80332044 */ void newTexMtx(int, int) const; - /* 803320CC */ void newCullMode(int) const; - /* 8033210C */ void newTexNo(int, int) const; - /* 80332154 */ void newTevOrder(int, int) const; - /* 803321A0 */ void newTevColor(int, int) const; - /* 80332210 */ void newTevKColor(int, int) const; - /* 8033226C */ void newTevStageNum(int) const; - /* 803322A4 */ void newTevStage(int, int) const; - /* 80332304 */ void newTevSwapModeTable(int, int) const; - /* 803323A0 */ void newIndTexStageNum(int) const; - /* 803323C8 */ void newIndTexOrder(int, int) const; - /* 8033240C */ void newIndTexMtx(int, int) const; - /* 803324B4 */ void newIndTevStage(int, int) const; - /* 80332648 */ void newIndTexCoordScale(int, int) const; - /* 8033268C */ void newFog(int) const; - /* 80332768 */ void newAlphaComp(int) const; - /* 803327E8 */ void newBlend(int) const; - /* 8033282C */ void newZMode(int) const; - /* 8033288C */ void newZCompLoc(int) const; - /* 803328C4 */ void newDither(int) const; - /* 803328FC */ void newNBTScale(int) const; -}; - struct J3DLockedMaterial { /* 80317044 */ void initialize(); }; @@ -636,7 +586,7 @@ asm J3DMaterialFactory::J3DMaterialFactory(J3DMaterialDLBlock const& param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::countUniqueMaterials() { +asm u16 J3DMaterialFactory::countUniqueMaterials() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countUniqueMaterials__18J3DMaterialFactoryFv.s" } @@ -667,7 +617,7 @@ asm void J3DMaterialFactory::countStages(int param_0) const { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::create(J3DMaterial* param_0, J3DMaterialFactory::MaterialType param_1, +asm J3DMaterial* J3DMaterialFactory::create(J3DMaterial* param_0, J3DMaterialFactory::MaterialType param_1, int param_2, u32 param_3) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_803303C4.s" diff --git a/libs/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp b/libs/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp index 28ecf7b8586..06dac95a98d 100644 --- a/libs/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp +++ b/libs/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp @@ -21,8 +21,6 @@ struct J3DTevStage { /* 8003AACC */ J3DTevStage(J3DTevStageInfo const&); }; -struct J3DMaterialBlock_v21 {}; - struct J3DMaterial { /* 803157A0 */ void createColorBlock(u32); /* 803159A0 */ void createTexGenBlock(u32); @@ -32,35 +30,6 @@ struct J3DMaterial { /* 80316240 */ void initialize(); }; -struct J3DMaterialFactory_v21 { - /* 80332DA4 */ J3DMaterialFactory_v21(J3DMaterialBlock_v21 const&); - /* 80332F84 */ void countUniqueMaterials(); - /* 80332FA8 */ void countTexGens(int) const; - /* 80332FE0 */ void countStages(int) const; - /* 80333068 */ void create(J3DMaterial*, int, u32) const; - /* 803337D8 */ void newMatColor(int, int) const; - /* 80333834 */ void newColorChanNum(int) const; - /* 8033386C */ void newColorChan(int, int) const; - /* 80333A10 */ void newTexGenNum(int) const; - /* 80333A48 */ void newTexCoord(int, int) const; - /* 80333AA8 */ void newTexMtx(int, int) const; - /* 80333B30 */ void newCullMode(int) const; - /* 80333B70 */ void newTexNo(int, int) const; - /* 80333BB8 */ void newTevOrder(int, int) const; - /* 80333C04 */ void newTevColor(int, int) const; - /* 80333C74 */ void newTevKColor(int, int) const; - /* 80333CD0 */ void newTevStageNum(int) const; - /* 80333D08 */ void newTevStage(int, int) const; - /* 80333D68 */ void newTevSwapModeTable(int, int) const; - /* 80333E04 */ void newFog(int) const; - /* 80333EE0 */ void newAlphaComp(int) const; - /* 80333F60 */ void newBlend(int) const; - /* 80333FA4 */ void newZMode(int) const; - /* 80334004 */ void newZCompLoc(int) const; - /* 8033403C */ void newDither(int) const; - /* 80334074 */ void newNBTScale(int) const; -}; - struct J3DFogInfo { /* 80325800 */ void operator=(J3DFogInfo const&); }; @@ -164,7 +133,7 @@ asm J3DMaterialFactory_v21::J3DMaterialFactory_v21(J3DMaterialBlock_v21 const& p #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory_v21::countUniqueMaterials() { +asm u16 J3DMaterialFactory_v21::countUniqueMaterials() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countUniqueMaterials__22J3DMaterialFactory_v21Fv.s" } @@ -195,7 +164,7 @@ asm void J3DMaterialFactory_v21::countStages(int param_0) const { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory_v21::create(J3DMaterial* param_0, int param_1, u32 param_2) const { +asm J3DMaterial* J3DMaterialFactory_v21::create(J3DMaterial* param_0, int param_1, u32 param_2) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/create__22J3DMaterialFactory_v21CFP11J3DMaterialiUl.s" } diff --git a/libs/JSystem/J3DGraphLoader/J3DModelLoader.cpp b/libs/JSystem/J3DGraphLoader/J3DModelLoader.cpp index 121bed33747..e3789d86c37 100644 --- a/libs/JSystem/J3DGraphLoader/J3DModelLoader.cpp +++ b/libs/JSystem/J3DGraphLoader/J3DModelLoader.cpp @@ -4,211 +4,26 @@ // #include "JSystem/J3DGraphLoader/J3DModelLoader.h" +#include "JSystem/J3DGraphLoader/J3DJointFactory.h" +#include "JSystem/J3DGraphLoader/J3DMaterialFactory.h" +#include "JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h" +#include "JSystem/J3DGraphLoader/J3DShapeFactory.h" +#include "JSystem/J3DGraphAnimator/J3DJointTree.h" +#include "JSystem/J3DGraphAnimator/J3DModelData.h" +#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h" +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "JSystem/JUtility/JUTNameTab.h" +#include "JSystem/JKernel/JKRHeap.h" +#include "JSystem/JSupport/JSupport.h" +#include "dolphin/os/OS.h" #include "dol2asm.h" // // Types: // -struct _GXVtxDescList {}; - -struct _GXVtxAttrFmtList {}; - -struct _GXAttr {}; - -struct Vec {}; - -struct ResNTAB {}; - -struct JUTNameTab { - /* 802DE9E0 */ JUTNameTab(ResNTAB const*); -}; - -struct JKRHeap { - /* 802CE784 */ void getTotalFreeSize(); - - static u8 sCurrentHeap[4]; -}; - -struct J3DVertexData {}; - -struct J3DVertexBlock {}; - -struct J3DTransformInfo {}; - -struct J3DTextureBlock {}; - -struct J3DTexture { - /* 803366A4 */ ~J3DTexture(); -}; - -struct J3DSys { - static u8 mCurrentMtx[48]; - static f32 mCurrentS[3]; -}; - -struct J3DDrawMtxData {}; - -struct J3DShapeTable { - /* 80325910 */ void initShapeNodes(J3DDrawMtxData*, J3DVertexData*); - /* 8032597C */ void sortVcdVatCmd(); -}; - -struct J3DShapeBlock {}; - -struct J3DShapeFactory { - /* 80337350 */ J3DShapeFactory(J3DShapeBlock const&); - /* 80337400 */ void create(int, u32, _GXVtxDescList*); - /* 803378D8 */ void allocVcdVatCmdBuffer(u32); -}; - -template -struct J3DMtxCalcNoAnm {}; -/* J3DMtxCalcNoAnm */ -struct J3DMtxCalcNoAnm__template1 { - /* 803364B8 */ void func_803364B8(void* _this); - /* 80336524 */ void func_80336524(void* _this, Vec const&, f32 const (&)[3][4]); - /* 8033656C */ void func_8033656C(void* _this); -}; - -/* J3DMtxCalcNoAnm */ -struct J3DMtxCalcNoAnm__template2 { - /* 80336594 */ void func_80336594(void* _this); - /* 80336600 */ void func_80336600(void* _this, Vec const&, f32 const (&)[3][4]); - /* 80336628 */ void func_80336628(void* _this); -}; - -struct J3DMtxCalcJ3DSysInitBasic { - /* 8032EC28 */ void init(Vec const&, f32 const (&)[3][4]); -}; - -struct J3DMtxCalcCalcTransformSoftimage { - /* 8032EE50 */ void calcTransform(J3DTransformInfo const&); -}; - -struct J3DMtxCalcCalcTransformBasic { - /* 8032ED30 */ void calcTransform(J3DTransformInfo const&); -}; - struct J3DAnmTransform {}; -struct J3DMtxCalc { - /* 80014E8C */ void setAnmTransform(u8, J3DAnmTransform*); - /* 80014E90 */ void setAnmTransform(J3DAnmTransform*); - /* 80014E94 */ bool getAnmTransform(u8); - /* 80014E9C */ bool getAnmTransform(); - /* 80014EA4 */ void setWeight(u8, f32); - /* 80014EA8 */ void getWeight(u8) const; - - static u8 mJoint[4]; -}; - -struct J3DMaterialBlock {}; - -struct J3DModelLoader_v26 { - /* 80335614 */ void readMaterial(J3DMaterialBlock const*, u32); - /* 80335CE4 */ void readMaterialTable(J3DMaterialBlock const*, u32); - /* 80336398 */ ~J3DModelLoader_v26(); - /* 80336DB4 */ void calcSizeMaterial(J3DMaterialBlock const*, u32); - /* 80336F60 */ void calcSizeMaterialTable(J3DMaterialBlock const*, u32); -}; - -struct J3DMaterialBlock_v21 {}; - -struct J3DModelLoader_v21 { - /* 80335890 */ void readMaterial_v21(J3DMaterialBlock_v21 const*, u32); - /* 80335E20 */ void readMaterialTable_v21(J3DMaterialBlock_v21 const*, u32); - /* 803363F4 */ ~J3DModelLoader_v21(); -}; - -struct J3DDrawBlock {}; - -struct J3DMaterialDLBlock {}; - -struct J3DJointBlock {}; - -struct J3DEnvelopeBlock {}; - -struct J3DModelInfoBlock {}; - -struct J3DModelLoader { - /* 8033468C */ J3DModelLoader(); - /* 803347E0 */ void load(void const*, u32); - /* 80334ABC */ void loadMaterialTable(void const*); - /* 80334C20 */ void loadBinaryDisplayList(void const*, u32); - /* 80334EE0 */ void setupBBoardInfo(); - /* 80335048 */ void readInformation(J3DModelInfoBlock const*, u32); - /* 803351D0 */ void readVertex(J3DVertexBlock const*); - /* 803353F0 */ void readEnvelop(J3DEnvelopeBlock const*); - /* 80335480 */ void readDraw(J3DDrawBlock const*); - /* 80335530 */ void readJoint(J3DJointBlock const*); - /* 80335AF4 */ void readShape(J3DShapeBlock const*, u32); - /* 80335C18 */ void readTexture(J3DTextureBlock const*); - /* 80335F5C */ void readTextureTable(J3DTextureBlock const*); - /* 80336028 */ void readPatchedMaterial(J3DMaterialBlock const*, u32); - /* 80336168 */ void readMaterialDL(J3DMaterialDLBlock const*, u32); - /* 8033631C */ void modifyMaterial(u32); - /* 80336450 */ ~J3DModelLoader(); - /* 80336498 */ void readMaterial_v21(J3DMaterialBlock_v21 const*, u32); - /* 8033649C */ void readMaterial(J3DMaterialBlock const*, u32); - /* 803364A0 */ void readMaterialTable_v21(J3DMaterialBlock_v21 const*, u32); - /* 803364A4 */ void readMaterialTable(J3DMaterialBlock const*, u32); - /* 803364A8 */ bool calcSizeMaterial(J3DMaterialBlock const*, u32); - /* 803364B0 */ bool calcSizeMaterialTable(J3DMaterialBlock const*, u32); - /* 80336794 */ void countMaterialNum(void const*); - /* 803367D4 */ void calcLoadSize(void const*, u32); - /* 803369A0 */ void calcLoadMaterialTableSize(void const*); - /* 80336A98 */ void calcLoadBinaryDisplayListSize(void const*, u32); -}; - -struct J3DModelHierarchy {}; - -struct J3DModelData { - /* 80325D88 */ void clear(); - /* 80325DA0 */ J3DModelData(); - /* 80325EC8 */ void indexToPtr(); -}; - -struct J3DMaterialTable { - /* 8032F5A8 */ void clear(); - /* 8032F5D0 */ J3DMaterialTable(); -}; - -struct J3DMaterial { - /* 80316240 */ void initialize(); - /* 80332B94 */ ~J3DMaterial(); - /* 80336650 */ J3DMaterial(); -}; - -struct J3DMaterialFactory_v21 { - /* 80332DA4 */ J3DMaterialFactory_v21(J3DMaterialBlock_v21 const&); - /* 80332F84 */ void countUniqueMaterials(); - /* 80333068 */ void create(J3DMaterial*, int, u32) const; -}; - -struct J3DMaterialFactory { - struct MaterialType {}; - - /* 8032FFEC */ J3DMaterialFactory(J3DMaterialBlock const&); - /* 80330234 */ J3DMaterialFactory(J3DMaterialDLBlock const&); - /* 803302BC */ void countUniqueMaterials(); - /* 803303C4 */ void create(J3DMaterial*, J3DMaterialFactory::MaterialType, int, u32) const; - /* 8033168C */ void modifyPatchedCurrentMtx(J3DMaterial*, int) const; -}; - -struct J3DJoint {}; - -struct J3DJointTree { - /* 80325A9C */ void makeHierarchy(J3DJoint*, J3DModelHierarchy const**, J3DMaterialTable*, - J3DShapeTable*); - /* 80325C00 */ void findImportantMtxIndex(); -}; - -struct J3DJointFactory { - /* 80337178 */ J3DJointFactory(J3DJointBlock const&); - /* 803371D0 */ void create(int); -}; - // // Forward References: // @@ -252,20 +67,19 @@ extern "C" void func_80336600(void* _this, Vec const&, f32 const (&)[3][4]); extern "C" void func_80336628(void* _this); extern "C" void __ct__11J3DMaterialFv(); extern "C" void __dt__10J3DTextureFv(); -extern "C" void func_803366EC(void* _this, void const*, void const*); -extern "C" void func_80336704(void* _this, void const*, void const*); -extern "C" void func_8033671C(void* _this, void const*, void const*); -extern "C" void func_80336734(void* _this, void const*, void const*); -extern "C" void func_8033674C(void* _this, void const*, void const*); -extern "C" void func_80336764(void* _this, void const*, u32); -extern "C" void func_8033677C(void* _this, void const*, u32); +extern "C" ResTIMG* func_803366EC(void const*, void const*); +extern "C" Mtx* func_80336704(void const*, void const*); +extern "C" void* func_8033671C(void const*, void const*); +extern "C" _GXVtxAttrFmtList* func_80336734(void const*, void const*); +extern "C" J3DModelHierarchy* func_8033674C(void const*, void const*); +extern "C" J3DShapeInitData* func_80336764(void const*, void const*); +extern "C" u16* func_8033677C(void const*, void const*); extern "C" extern char const* const J3DModelLoader__stringBase0; // // External References: // -extern "C" void OSReport(); extern "C" void setAnmTransform__10J3DMtxCalcFUcP15J3DAnmTransform(); extern "C" void setAnmTransform__10J3DMtxCalcFP15J3DAnmTransform(); extern "C" bool getAnmTransform__10J3DMtxCalcFUc(); @@ -278,10 +92,10 @@ extern "C" void* __nwa__FUl(); extern "C" void* __nwa__FUli(); extern "C" void __dl__FPv(); extern "C" void __ct__10JUTNameTabFPC7ResNTAB(); -extern "C" void func_802F4260(void* _this, void const*, void const*); -extern "C" void func_802F42C0(void* _this, void const*, void const*); -extern "C" void func_8030A530(void* _this, void const*, void const*); -extern "C" void func_8030A560(void* _this, void const*, void const*); +extern "C" u8* func_802F4260(void const*, void const*); +extern "C" u16* func_802F42C0(void const*, void const*); +extern "C" ResNTAB* func_8030A530(void const*, void const*); +extern "C" f32* func_8030A560(void const*, void const*); extern "C" void initialize__11J3DMaterialFv(); extern "C" void initShapeNodes__13J3DShapeTableFP14J3DDrawMtxDataP13J3DVertexData(); extern "C" void sortVcdVatCmd__13J3DShapeTableFv(); @@ -317,7 +131,6 @@ extern "C" void create__15J3DJointFactoryFi(); extern "C" void __ct__15J3DShapeFactoryFRC13J3DShapeBlock(); extern "C" void create__15J3DShapeFactoryFiUlP14_GXVtxDescList(); extern "C" void allocVcdVatCmdBuffer__15J3DShapeFactoryFUl(); -extern "C" void PSMTXCopy(); extern "C" void __construct_new_array(); extern "C" void _savegpr_24(); extern "C" void _savegpr_25(); @@ -446,6 +259,19 @@ SECTION_DATA extern void* __vt__14J3DModelLoader[17] = { }; /* 8033468C-803346BC 32EFCC 0030+00 1/1 0/0 0/0 .text __ct__14J3DModelLoaderFv */ +#ifdef NONMATCHING +// matches once vtable ordering is correct +J3DModelLoader::J3DModelLoader() : + mpModelData(NULL), + mpMaterialTable(NULL), + mpShapeBlock(NULL), + mpMaterialBlock(NULL), + mpModelHierarchy(NULL), + field_0x18(0), + mEnvelopeSize(0) { + /* empty function */ +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -454,16 +280,38 @@ asm J3DModelLoader::J3DModelLoader() { #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/__ct__14J3DModelLoaderFv.s" } #pragma pop +#endif /* 803346BC-803347E0 32EFFC 0124+00 0/0 4/4 0/0 .text load__22J3DModelLoaderDataBaseFPCvUl */ +#ifdef NONMATCHING +// matches once vtable ordering is correct +J3DModelData* J3DModelLoaderDataBase::load(void const* i_data, u32 i_flags) { + if (i_data == NULL) { + return NULL; + } + if (*(u32*)i_data == 'J3D1' && *(u32*)((u32)i_data + 4) == 'bmd1') { + return NULL; + } + if (*(u32*)i_data == 'J3D2' && *(u32*)((u32)i_data + 4) == 'bmd2') { + J3DModelLoader_v21 loader; + return loader.load(i_data, i_flags); + } + if (*(u32*)i_data == 'J3D2' && *(u32*)((u32)i_data + 4) == 'bmd3') { + J3DModelLoader_v26 loader; + return loader.load(i_data, i_flags); + } + return NULL; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void* J3DModelLoaderDataBase::load(void const* param_0, u32 param_1) { +asm J3DModelData* J3DModelLoaderDataBase::load(void const* param_0, u32 param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/load__22J3DModelLoaderDataBaseFPCvUl.s" } #pragma pop +#endif /* ############################################################################################## */ /* 803A20B0-803A20B0 02E710 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ @@ -473,35 +321,187 @@ SECTION_DEAD static char const* const stringBase_803A20B0 = "Unknown data block\ #pragma pop /* 803347E0-80334ABC 32F120 02DC+00 4/1 0/0 0/0 .text load__14J3DModelLoaderFPCvUl */ +#ifdef NONMATCHING +// regalloc +J3DModelData* J3DModelLoader::load(void const* i_data, u32 i_flags) { + JKRGetCurrentHeap()->getTotalFreeSize(); + mpModelData = new J3DModelData(); + mpModelData->clear(); + mpModelData->mpRawData = i_data; + mpModelData->setModelDataType(0); + mpMaterialTable = &mpModelData->mMaterialTable; + J3DModelFileData const* data = (J3DModelFileData*)i_data; + J3DModelBlock const* block = data->mBlocks; + for (u32 block_no = 0; block_no < data->mBlockNum; block_no++) { + switch (block->mBlockType) { + case 'INF1': + readInformation((J3DModelInfoBlock*)block, i_flags); + break; + case 'VTX1': + readVertex((J3DVertexBlock*)block); + break; + case 'EVP1': + readEnvelop((J3DEnvelopeBlock*)block); + break; + case 'DRW1': + readDraw((J3DDrawBlock*)block); + break; + case 'JNT1': + readJoint((J3DJointBlock*)block); + break; + case 'MAT3': + readMaterial((J3DMaterialBlock*)block, i_flags); + break; + case 'MAT2': + readMaterial_v21((J3DMaterialBlock_v21*)block, i_flags); + break; + case 'SHP1': + readShape((J3DShapeBlock*)block, i_flags); + break; + case 'TEX1': + readTexture((J3DTextureBlock*)block); + break; + default: + OSReport("Unknown data block\n"); + break; + } + block = (J3DModelBlock*)((u32)block + block->mBlockSize); + } + J3DModelHierarchy const* hierarchy = mpModelData->getHierarchy(); + mpModelData->makeHierarchy(NULL, &hierarchy); + mpModelData->getShapeTable()->sortVcdVatCmd(); + mpModelData->getJointTree().findImportantMtxIndex(); + setupBBoardInfo(); + if (mpModelData->getFlag() & 0x100) { + for (u16 shape_no = 0; shape_no < mpModelData->getShapeNum(); shape_no++) { + mpModelData->getShapeNodePointer(shape_no)->onFlag(0x200); + } + } + return mpModelData; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DModelLoader::load(void const* param_0, u32 param_1) { +asm J3DModelData* J3DModelLoader::load(void const* param_0, u32 param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/load__14J3DModelLoaderFPCvUl.s" } #pragma pop +#endif /* 80334ABC-80334C20 32F3FC 0164+00 3/0 0/0 0/0 .text loadMaterialTable__14J3DModelLoaderFPCv */ +#ifdef NONMATCHING +// weak fn ordering +J3DMaterialTable* J3DModelLoader::loadMaterialTable(void const* i_data) { + mpMaterialTable = new J3DMaterialTable(); + mpMaterialTable->clear(); + J3DModelFileData const* data = (J3DModelFileData*)i_data; + J3DModelBlock const* block = data->mBlocks; + for (u32 block_no = 0; block_no < data->mBlockNum; block_no++) { + switch (block->mBlockType) { + case 'MAT3': + readMaterialTable((J3DMaterialBlock*)block, 0x51100000); + break; + case 'MAT2': + readMaterialTable_v21((J3DMaterialBlock_v21*)block, 0x51100000); + break; + case 'TEX1': + readTextureTable((J3DTextureBlock*)block); + break; + default: + OSReport("Unknown data block\n"); + break; + } + block = (J3DModelBlock*)((u32)block + block->mBlockSize); + } + if (mpMaterialTable->mTexture == NULL) { + mpMaterialTable->mTexture = new J3DTexture(0, NULL); + } + return mpMaterialTable; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DModelLoader::loadMaterialTable(void const* param_0) { +asm J3DMaterialTable* J3DModelLoader::loadMaterialTable(void const* param_0) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/loadMaterialTable__14J3DModelLoaderFPCv.s" } #pragma pop +#endif /* 80334C20-80334EE0 32F560 02C0+00 3/0 0/0 0/0 .text * loadBinaryDisplayList__14J3DModelLoaderFPCvUl */ +#ifdef NONMATCHING +// regalloc +J3DModelData* J3DModelLoader::loadBinaryDisplayList(void const* i_data, u32 i_flags) { + mpModelData = new J3DModelData(); + mpModelData->clear(); + mpModelData->mpRawData = i_data; + mpModelData->setModelDataType(1); + mpMaterialTable = &mpModelData->mMaterialTable; + J3DModelFileData const* data = (J3DModelFileData*)i_data; + J3DModelBlock const* block = data->mBlocks; + for (u32 block_no = 0; block_no < data->mBlockNum; block_no++) { + switch (block->mBlockType) { + case 'INF1': + readInformation((J3DModelInfoBlock*)block, i_flags); + break; + case 'VTX1': + readVertex((J3DVertexBlock*)block); + break; + case 'EVP1': + readEnvelop((J3DEnvelopeBlock*)block); + break; + case 'DRW1': + readDraw((J3DDrawBlock*)block); + break; + case 'JNT1': + readJoint((J3DJointBlock*)block); + break; + case 'SHP1': + readShape((J3DShapeBlock*)block, i_flags); + break; + case 'TEX1': + readTexture((J3DTextureBlock*)block); + break; + case 'MDL3': + readMaterialDL((J3DMaterialDLBlock*)block, i_flags); + modifyMaterial(i_flags); + break; + case 'MAT3': + mpMaterialBlock = (J3DMaterialBlock*)block; + if ((i_flags & 0x3000) == 0) { + readMaterial((J3DMaterialBlock*)block, i_flags & 0x3000000 | 0x50100000); + } else if ((i_flags & 0x3000) == 0x2000) { + readPatchedMaterial((J3DMaterialBlock*)block, i_flags & 0x3000000 | 0x50100000); + } + break; + default: + OSReport("Unknown data block\n"); + break; + } + block = (J3DModelBlock*)((u32)block + block->mBlockSize); + } + J3DModelHierarchy const* hierarchy = mpModelData->getHierarchy(); + mpModelData->makeHierarchy(NULL, &hierarchy); + mpModelData->getShapeTable()->sortVcdVatCmd(); + mpModelData->getJointTree().findImportantMtxIndex(); + setupBBoardInfo(); + mpModelData->indexToPtr(); + return mpModelData; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DModelLoader::loadBinaryDisplayList(void const* param_0, u32 param_1) { +asm J3DModelData* J3DModelLoader::loadBinaryDisplayList(void const* param_0, u32 param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/loadBinaryDisplayList__14J3DModelLoaderFPCvUl.s" } #pragma pop +#endif /* ############################################################################################## */ /* 803A20B0-803A20B0 02E710 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ @@ -512,115 +512,345 @@ SECTION_DEAD static char const* const stringBase_803A20C4 = "WRONG SHAPE MATRIX /* 80334EE0-80335048 32F820 0168+00 3/0 0/0 0/0 .text setupBBoardInfo__14J3DModelLoaderFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader::setupBBoardInfo() { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/setupBBoardInfo__14J3DModelLoaderFv.s" +void J3DModelLoader::setupBBoardInfo() { + for (u16 i = 0; i < mpModelData->getJointNum(); i++) { + J3DMaterial* mesh = mpModelData->getJointNodePointer(i)->getMesh(); + if (mesh != NULL) { + u16 shape_index = mesh->getShape()->getIndex(); + // u16* index_table = JSUConvertOffsetToPtr(mpShapeBlock, mpShapeBlock->mpIndexTable); + u16* index_table = func_8033677C(mpShapeBlock, mpShapeBlock->mpIndexTable); + J3DShapeInitData* shape_init_data = + // JSUConvertOffsetToPtr(mpShapeBlock, + // mpShapeBlock->mpShapeInitData); + func_80336764(mpShapeBlock, mpShapeBlock->mpShapeInitData); + J3DJoint* joint; + switch (shape_init_data[index_table[shape_index]].mShapeMtxType) { + case 0: + joint = mpModelData->getJointNodePointer(i); + joint->setMtxType(0); + break; + case 1: + joint = mpModelData->getJointNodePointer(i); + joint->setMtxType(1); + mpModelData->mbHasBillboard = true; + break; + case 2: + joint = mpModelData->getJointNodePointer(i); + joint->setMtxType(2); + mpModelData->mbHasBillboard = true; + break; + case 3: + joint = mpModelData->getJointNodePointer(i); + joint->setMtxType(0); + break; + default: + OSReport("WRONG SHAPE MATRIX TYPE (__FILE__)\n"); + break; + } + } + } } -#pragma pop /* 80335048-803351A4 32F988 015C+00 2/2 0/0 0/0 .text * readInformation__14J3DModelLoaderFPC17J3DModelInfoBlockUl */ +#ifdef NONMATCHING +// will match once generics located correctly +void J3DModelLoader::readInformation(J3DModelInfoBlock const* i_block, u32 i_flags) { + mpModelData->mFlags = i_flags | i_block->mFlags; + mpModelData->getJointTree().setFlag(mpModelData->mFlags); + J3DMtxCalc* mtx_calc = NULL; + switch (mpModelData->mFlags & 0xf) { + case 0: + mtx_calc = new J3DMtxCalcNoAnm(); + break; + case 1: + mtx_calc = new J3DMtxCalcNoAnm(); + break; + case 2: + mtx_calc = new J3DMtxCalcNoAnm(); + break; + } + mpModelData->setBasicMtxCalc(mtx_calc); + mpModelData->getVertexData().mPacketNum = i_block->mPacketNum; + mpModelData->getVertexData().mVtxNum = i_block->mVtxNum; + mpModelData->setHierarchy(JSUConvertOffsetToPtr(i_block, i_block->mpHierarchy)); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DModelLoader::readInformation(J3DModelInfoBlock const* param_0, u32 param_1) { +asm void J3DModelLoader::readInformation(J3DModelInfoBlock const* i_block, u32 i_flags) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readInformation__14J3DModelLoaderFPC17J3DModelInfoBlockUl.s" } #pragma pop +#endif /* 803351A4-803351D0 32FAE4 002C+00 1/1 0/0 0/0 .text getFmtType__FP17_GXVtxAttrFmtList7_GXAttr */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void getFmtType(_GXVtxAttrFmtList* param_0, _GXAttr param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/getFmtType__FP17_GXVtxAttrFmtList7_GXAttr.s" +static _GXCompType getFmtType(_GXVtxAttrFmtList* i_fmtList, _GXAttr i_attr) { + for (; i_fmtList->mAttrib != GX_VA_NULL; i_fmtList++) { + if (i_fmtList->mAttrib == i_attr) { + return i_fmtList->mCompType; + } + } + return GX_F32; } -#pragma pop /* 803351D0-803353F0 32FB10 0220+00 2/2 0/0 0/0 .text * readVertex__14J3DModelLoaderFPC14J3DVertexBlock */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader::readVertex(J3DVertexBlock const* param_0) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readVertex__14J3DModelLoaderFPC14J3DVertexBlock.s" +void J3DModelLoader::readVertex(J3DVertexBlock const* i_block) { + J3DVertexData& vertex_data = mpModelData->getVertexData(); + vertex_data.mVtxAttrFmtList = + // JSUConvertOffsetToPtr(i_block, i_block->mpVtxAttrFmtList); + func_80336734(i_block, i_block->mpVtxAttrFmtList); + // vertex_data.mVtxPosArray = JSUConvertOffsetToPtr(i_block, i_block->mpVtxPosArray); + vertex_data.mVtxPosArray = func_8033671C(i_block, i_block->mpVtxPosArray); + // vertex_data.mVtxNrmArray = JSUConvertOffsetToPtr(i_block, i_block->mpVtxNrmArray); + vertex_data.mVtxNrmArray = func_8033671C(i_block, i_block->mpVtxNrmArray); + // vertex_data.mVtxNBTArray = JSUConvertOffsetToPtr(i_block, i_block->mpVtxNBTArray); + vertex_data.mVtxNBTArray = func_8033671C(i_block, i_block->mpVtxNBTArray); + for (int i = 0; i < 2; i++) { + vertex_data.mVtxColorArray[i] = + // (GXColor*)JSUConvertOffsetToPtr(i_block, i_block->mpVtxColorArray[i]); + (GXColor*)func_8033671C(i_block, i_block->mpVtxColorArray[i]); + } + for (int i = 0; i < 8; i++) { + vertex_data.mVtxTexCoordArray[i] = + // JSUConvertOffsetToPtr(i_block, i_block->mpVtxTexCoordArray[i]); + func_8033671C(i_block, i_block->mpVtxTexCoordArray[i]); + } + + _GXCompType nrm_type = getFmtType(vertex_data.mVtxAttrFmtList, GX_VA_NRM); + u32 nrm_size = nrm_type == GX_F32 ? 12 : 6; + + void* nrm_end = NULL; + if (vertex_data.mVtxNBTArray != NULL) { + nrm_end = vertex_data.mVtxNBTArray; + } else if (vertex_data.mVtxColorArray[0] != NULL) { + nrm_end = vertex_data.mVtxColorArray[0]; + } else if (vertex_data.mVtxTexCoordArray[0] != NULL) { + nrm_end = vertex_data.mVtxTexCoordArray[0]; + } + + if (vertex_data.mVtxNrmArray == NULL) { + vertex_data.mNrmNum = 0; + } else if (nrm_end != NULL) { + vertex_data.mNrmNum = ((u32)nrm_end - (u32)vertex_data.mVtxNrmArray) / nrm_size + 1; + } else { + vertex_data.mNrmNum = (i_block->mBlockSize - (u32)i_block->mpVtxNrmArray) / nrm_size + 1; + } + + void* color0_end = NULL; + if (vertex_data.mVtxColorArray[1] != NULL) { + color0_end = vertex_data.mVtxColorArray[1]; + } else if (vertex_data.mVtxTexCoordArray[0] != NULL) { + color0_end = vertex_data.mVtxTexCoordArray[0]; + } + + if (vertex_data.mVtxColorArray[0] == NULL) { + vertex_data.mColNum = 0; + } else if (color0_end != NULL) { + vertex_data.mColNum = ((u32)color0_end - (u32)vertex_data.mVtxColorArray[0]) / 4 + 1; + } else { + vertex_data.mColNum = (i_block->mBlockSize - (u32)i_block->mpVtxColorArray[0]) / 4 + 1; + } + + if (vertex_data.mVtxTexCoordArray[0] == NULL) { + vertex_data.mTexCoordNum = 0; + } else { + vertex_data.mTexCoordNum = (i_block->mBlockSize - (u32)i_block->mpVtxTexCoordArray[0]) / 8 + 1; + } } -#pragma pop /* 803353F0-80335480 32FD30 0090+00 2/2 0/0 0/0 .text * readEnvelop__14J3DModelLoaderFPC16J3DEnvelopeBlock */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader::readEnvelop(J3DEnvelopeBlock const* param_0) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readEnvelop__14J3DModelLoaderFPC16J3DEnvelopeBlock.s" +void J3DModelLoader::readEnvelop(J3DEnvelopeBlock const* i_block) { + mpModelData->getJointTree().mWEvlpMtxNum = i_block->mWEvlpMtxNum; + mpModelData->getJointTree().mWEvlpMixMtxNum = + // JSUConvertOffsetToPtr(i_block, i_block->mpWEvlpMixMtxNum); + func_802F4260(i_block, i_block->mpWEvlpMixMtxNum); + mpModelData->getJointTree().mWEvlpMixIndex = + // JSUConvertOffsetToPtr(i_block, i_block->mpWEvlpMixIndex); + func_802F42C0(i_block, i_block->mpWEvlpMixIndex); + mpModelData->getJointTree().mWEvlpMixWeight = + // JSUConvertOffsetToPtr(i_block, i_block->mpWEvlpMixWeight); + func_8030A560(i_block, i_block->mpWEvlpMixWeight); + mpModelData->getJointTree().mInvJointMtx = + // JSUConvertOffsetToPtr(i_block, i_block->mpInvJointMtx); + func_80336704(i_block, i_block->mpInvJointMtx); } -#pragma pop /* 80335480-80335530 32FDC0 00B0+00 2/2 0/0 0/0 .text readDraw__14J3DModelLoaderFPC12J3DDrawBlock */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader::readDraw(J3DDrawBlock const* param_0) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readDraw__14J3DModelLoaderFPC12J3DDrawBlock.s" +void J3DModelLoader::readDraw(J3DDrawBlock const* i_block) { + J3DJointTree& joint_tree = mpModelData->getJointTree(); + joint_tree.mDrawMtxData.mEntryNum = i_block->mMtxNum - mpModelData->getJointTree().mWEvlpMtxNum; + // joint_tree.mDrawMtxData.mDrawMtxFlag = JSUConvertOffsetToPtr(i_block, i_block->mpDrawMtxFlag); + joint_tree.mDrawMtxData.mDrawMtxFlag = func_802F4260(i_block, i_block->mpDrawMtxFlag); + // joint_tree.mDrawMtxData.mDrawMtxIndex = JSUConvertOffsetToPtr(i_block, i_block->mpDrawMtxIndex); + joint_tree.mDrawMtxData.mDrawMtxIndex = func_802F42C0(i_block, i_block->mpDrawMtxIndex); + u16 i; + for (i = 0; i < joint_tree.mDrawMtxData.mEntryNum; i++) { + if (joint_tree.mDrawMtxData.mDrawMtxFlag[i] == 1) { + break; + } + } + joint_tree.mDrawMtxData.mDrawFullWgtMtxNum = i; + mpModelData->getJointTree().mWEvlpImportantMtxIdx = new u16[joint_tree.mDrawMtxData.mEntryNum]; + } -#pragma pop /* 80335530-80335614 32FE70 00E4+00 2/2 0/0 0/0 .text * readJoint__14J3DModelLoaderFPC13J3DJointBlock */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader::readJoint(J3DJointBlock const* param_0) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readJoint__14J3DModelLoaderFPC13J3DJointBlock.s" +void J3DModelLoader::readJoint(J3DJointBlock const* i_block) { + J3DJointFactory factory(*i_block); + mpModelData->getJointTree().mJointNum = i_block->mJointNum; + if (i_block->mpNameTable != NULL) { + mpModelData->getJointTree().mJointName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpModelData->getJointTree().mJointName = NULL; + } + mpModelData->getJointTree().mJointNodePointer = + new J3DJoint*[mpModelData->getJointTree().mJointNum]; + for (u16 i = 0; i < mpModelData->getJointTree().getJointNum(); i++) { + mpModelData->getJointTree().mJointNodePointer[i] = factory.create(i); + } } -#pragma pop /* 80335614-80335890 32FF54 027C+00 1/0 0/0 0/0 .text * readMaterial__18J3DModelLoader_v26FPC16J3DMaterialBlockUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader_v26::readMaterial(J3DMaterialBlock const* param_0, u32 param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterial__18J3DModelLoader_v26FPC16J3DMaterialBlockUl.s" +void J3DModelLoader_v26::readMaterial(J3DMaterialBlock const* i_block, u32 i_flags) { + J3DMaterialFactory factory(*i_block); + mpMaterialTable->mMaterialNum = i_block->mMaterialNum; + mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials(); + if (i_block->mpNameTable != NULL) { + mpMaterialTable->mMaterialName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpMaterialTable->mMaterialName = NULL; + } + mpMaterialTable->mMaterialNodePointer = new J3DMaterial*[mpMaterialTable->mMaterialNum]; + if (i_flags & 0x200000) { + mpMaterialTable->field_0x10 = new (0x20) J3DMaterial[mpMaterialTable->mUniqueMatNum]; + } else { + mpMaterialTable->field_0x10 = NULL; + } + if (i_flags & 0x200000) { + for (u16 i = 0; i < mpMaterialTable->mUniqueMatNum; i++) { + factory.create(&mpMaterialTable->field_0x10[i], + J3DMaterialFactory::MATERIAL_TYPE_NORMAL, i, i_flags); + mpMaterialTable->field_0x10[i].mDiffFlag = (u32)&mpMaterialTable->field_0x10[i] >> 4; + } + } + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i] = + factory.create(NULL, J3DMaterialFactory::MATERIAL_TYPE_NORMAL, i, i_flags); + } + if (i_flags & 0x200000) { + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = + (u32)&mpMaterialTable->field_0x10[factory.getMaterialID(i)] >> 4; + mpMaterialTable->mMaterialNodePointer[i]->mpOrigMaterial = + &mpMaterialTable->field_0x10[factory.getMaterialID(i)]; + } + } else { + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = + ((u32)mpMaterialTable->mMaterialNodePointer >> 4) + factory.getMaterialID(i); + } + } } -#pragma pop /* 80335890-80335AF4 3301D0 0264+00 1/0 0/0 0/0 .text * readMaterial_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader_v21::readMaterial_v21(J3DMaterialBlock_v21 const* param_0, u32 param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterial_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul.s" +void J3DModelLoader_v21::readMaterial_v21(J3DMaterialBlock_v21 const* i_block, u32 i_flags) { + J3DMaterialFactory_v21 factory(*i_block); + mpMaterialTable->mMaterialNum = i_block->mMaterialNum; + mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials(); + if (i_block->mpNameTable != NULL) { + mpMaterialTable->mMaterialName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpMaterialTable->mMaterialName = NULL; + } + mpMaterialTable->mMaterialNodePointer = new J3DMaterial*[mpMaterialTable->mMaterialNum]; + if (i_flags & 0x200000) { + mpMaterialTable->field_0x10 = new (0x20) J3DMaterial[mpMaterialTable->mUniqueMatNum]; + } else { + mpMaterialTable->field_0x10 = NULL; + } + if (i_flags & 0x200000) { + for (u16 i = 0; i < mpMaterialTable->mUniqueMatNum; i++) { + factory.create(&mpMaterialTable->field_0x10[i], i, i_flags); + mpMaterialTable->field_0x10[i].mDiffFlag = (u32)&mpMaterialTable->field_0x10[i] >> 4; + } + } + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i] = factory.create(NULL, i, i_flags); + } + if (i_flags & 0x200000) { + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = + (u32)&mpMaterialTable->field_0x10[factory.getMaterialID(i)] >> 4; + mpMaterialTable->mMaterialNodePointer[i]->mpOrigMaterial = + &mpMaterialTable->field_0x10[factory.getMaterialID(i)]; + } + } else { + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = 0xc0000000; + } + } } -#pragma pop /* 80335AF4-80335C18 330434 0124+00 2/2 0/0 0/0 .text * readShape__14J3DModelLoaderFPC13J3DShapeBlockUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader::readShape(J3DShapeBlock const* param_0, u32 param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readShape__14J3DModelLoaderFPC13J3DShapeBlockUl.s" +void J3DModelLoader::readShape(J3DShapeBlock const* i_block, u32 i_flags) { + mpShapeBlock = i_block; + J3DShapeTable* shape_table = mpModelData->getShapeTable(); + J3DShapeFactory factory(*i_block); + shape_table->mShapeNum = i_block->mShapeNum; + if (i_block->mpNameTable != NULL) { + shape_table->mShapeName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + shape_table->mShapeName = NULL; + } + shape_table->mShapeNodePointer = new J3DShape*[shape_table->mShapeNum]; + factory.allocVcdVatCmdBuffer(shape_table->mShapeNum); + J3DModelHierarchy const* hierarchy_entry = mpModelData->getHierarchy(); + GXVtxDescList* vtx_desc_list = NULL; + for (; hierarchy_entry->mType != 0; hierarchy_entry++) { + if (hierarchy_entry->mType == 0x12) { + shape_table->mShapeNodePointer[hierarchy_entry->mValue] = + factory.create(hierarchy_entry->mValue, i_flags, vtx_desc_list); + vtx_desc_list = factory.getVtxDescList(hierarchy_entry->mValue); + } + } } -#pragma pop /* 80335C18-80335CE4 330558 00CC+00 2/2 0/0 0/0 .text * readTexture__14J3DModelLoaderFPC15J3DTextureBlock */ +#ifdef NONMATCHING +// weak fn ordering +void J3DModelLoader::readTexture(J3DTextureBlock const* i_block) { + u16 texture_num = i_block->mTextureNum; + // ResTIMG* texture_res = JSUConvertOffsetToPtr(i_block, i_block->mpTextureRes); + ResTIMG* texture_res = func_803366EC(i_block, i_block->mpTextureRes); + if (i_block->mpNameTable != NULL) { + mpMaterialTable->mTextureName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpMaterialTable->mTextureName = NULL; + } + mpMaterialTable->mTexture = new J3DTexture(texture_num, texture_res); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -629,32 +859,72 @@ asm void J3DModelLoader::readTexture(J3DTextureBlock const* param_0) { #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readTexture__14J3DModelLoaderFPC15J3DTextureBlock.s" } #pragma pop +#endif /* 80335CE4-80335E20 330624 013C+00 1/0 0/0 0/0 .text * readMaterialTable__18J3DModelLoader_v26FPC16J3DMaterialBlockUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader_v26::readMaterialTable(J3DMaterialBlock const* param_0, u32 param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialTable__18J3DModelLoader_v26FPC16J3DMaterialBlockUl.s" +void J3DModelLoader_v26::readMaterialTable(J3DMaterialBlock const* i_block, u32 i_flags) { + J3DMaterialFactory factory(*i_block); + mpMaterialTable->mMaterialNum = i_block->mMaterialNum; + if (i_block->mpNameTable != NULL) { + mpMaterialTable->mMaterialName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpMaterialTable->mMaterialName = NULL; + } + mpMaterialTable->mMaterialNodePointer = new J3DMaterial*[mpMaterialTable->mMaterialNum]; + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i] = + factory.create(NULL, J3DMaterialFactory::MATERIAL_TYPE_NORMAL, i, i_flags); + } + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = + (u32)mpMaterialTable->mMaterialNodePointer + factory.getMaterialID(i); + } } -#pragma pop /* 80335E20-80335F5C 330760 013C+00 1/0 0/0 0/0 .text * readMaterialTable_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader_v21::readMaterialTable_v21(J3DMaterialBlock_v21 const* param_0, - u32 param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialTable_v21__18J3DModelLoader_v21FPC20J3DMaterialBlock_v21Ul.s" +void J3DModelLoader_v21::readMaterialTable_v21(J3DMaterialBlock_v21 const* i_block, u32 i_flags) { + J3DMaterialFactory_v21 factory(*i_block); + mpMaterialTable->mMaterialNum = i_block->mMaterialNum; + if (i_block->mpNameTable != NULL) { + mpMaterialTable->mMaterialName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpMaterialTable->mMaterialName = NULL; + } + mpMaterialTable->mMaterialNodePointer = new J3DMaterial*[mpMaterialTable->mMaterialNum]; + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i] = + factory.create(NULL, i, i_flags); + } + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = + ((u32)mpMaterialTable->mMaterialNodePointer >> 4) + factory.getMaterialID(i); + } } -#pragma pop /* 80335F5C-80336028 33089C 00CC+00 1/1 0/0 0/0 .text * readTextureTable__14J3DModelLoaderFPC15J3DTextureBlock */ +#ifdef NONMATCHING +// weak fn ordering +void J3DModelLoader::readTextureTable(J3DTextureBlock const* i_block) { + u16 texture_num = i_block->mTextureNum; + // ResTIMG* texture_res = JSUConvertOffsetToPtr(i_block, i_block->mpTextureRes); + ResTIMG* texture_res = func_803366EC(i_block, i_block->mpTextureRes); + if (i_block->mpNameTable != NULL) { + mpMaterialTable->mTextureName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpMaterialTable->mTextureName = NULL; + } + mpMaterialTable->mTexture = new J3DTexture(texture_num, texture_res); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -663,20 +933,66 @@ asm void J3DModelLoader::readTextureTable(J3DTextureBlock const* param_0) { #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readTextureTable__14J3DModelLoaderFPC15J3DTextureBlock.s" } #pragma pop +#endif /* 80336028-80336168 330968 0140+00 1/1 0/0 0/0 .text * readPatchedMaterial__14J3DModelLoaderFPC16J3DMaterialBlockUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader::readPatchedMaterial(J3DMaterialBlock const* param_0, u32 param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readPatchedMaterial__14J3DModelLoaderFPC16J3DMaterialBlockUl.s" +void J3DModelLoader::readPatchedMaterial(J3DMaterialBlock const* i_block, u32 i_flags) { + J3DMaterialFactory factory(*i_block); + mpMaterialTable->mMaterialNum = i_block->mMaterialNum; + mpMaterialTable->mUniqueMatNum = factory.countUniqueMaterials(); + if (i_block->mpNameTable != NULL) { + mpMaterialTable->mMaterialName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpMaterialTable->mMaterialName = NULL; + } + mpMaterialTable->mMaterialNodePointer = new J3DMaterial*[mpMaterialTable->mMaterialNum]; + mpMaterialTable->field_0x10 = NULL; + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i] = + factory.create(NULL, J3DMaterialFactory::MATERIAL_TYPE_PATCHED, i, i_flags); + mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = + ((u32)mpMaterialTable->mMaterialNodePointer >> 4) + factory.getMaterialID(i); + } } -#pragma pop /* 80336168-8033631C 330AA8 01B4+00 1/1 0/0 0/0 .text * readMaterialDL__14J3DModelLoaderFPC18J3DMaterialDLBlockUl */ +#ifdef NONMATCHING +// regalloc +void J3DModelLoader::readMaterialDL(J3DMaterialDLBlock const* i_block, u32 i_flags) { + J3DMaterialFactory factory(*i_block); + if (mpMaterialTable->mMaterialNum == 0) { + mpMaterialTable->field_0x1c = 1; + mpMaterialTable->mMaterialNum = i_block->mMaterialNum; + mpMaterialTable->mUniqueMatNum = i_block->mMaterialNum; + if (i_block->mpNameTable != NULL) { + mpMaterialTable->mMaterialName = + // new JUTNameTab(JSUConvertOffsetToPtr(i_block, i_block->mpNameTable)); + new JUTNameTab(func_8030A530(i_block, i_block->mpNameTable)); + } else { + mpMaterialTable->mMaterialName = NULL; + } + mpMaterialTable->mMaterialNodePointer = new J3DMaterial*[mpMaterialTable->mMaterialNum]; + mpMaterialTable->field_0x10 = NULL; + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i] = + factory.create(NULL, J3DMaterialFactory::MATERIAL_TYPE_LOCKED, i, i_flags); + } + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i]->mDiffFlag = 0xc0000000; + } + } else { + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + mpMaterialTable->mMaterialNodePointer[i] = + factory.create(mpMaterialTable->mMaterialNodePointer[i], + J3DMaterialFactory::MATERIAL_TYPE_LOCKED, i, i_flags); + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -685,23 +1001,25 @@ asm void J3DModelLoader::readMaterialDL(J3DMaterialDLBlock const* param_0, u32 p #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/readMaterialDL__14J3DModelLoaderFPC18J3DMaterialDLBlockUl.s" } #pragma pop +#endif /* 8033631C-80336398 330C5C 007C+00 1/1 0/0 0/0 .text modifyMaterial__14J3DModelLoaderFUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DModelLoader::modifyMaterial(u32 param_0) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DModelLoader/modifyMaterial__14J3DModelLoaderFUl.s" +void J3DModelLoader::modifyMaterial(u32 i_flags) { + if (i_flags & 0x2000) { + J3DMaterialFactory factory(*mpMaterialBlock); + for (u16 i = 0; i < mpMaterialTable->mMaterialNum; i++) { + factory.modifyPatchedCurrentMtx(mpMaterialTable->mMaterialNodePointer[i], i); + } + } } -#pragma pop /* 80336398-803363F4 330CD8 005C+00 1/0 0/0 0/0 .text __dt__18J3DModelLoader_v26Fv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DModelLoader_v26::~J3DModelLoader_v26() { +// asm J3DModelLoader_v26::~J3DModelLoader_v26() { +extern "C" asm void __dt__18J3DModelLoader_v26Fv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/__dt__18J3DModelLoader_v26Fv.s" } @@ -711,7 +1029,8 @@ asm J3DModelLoader_v26::~J3DModelLoader_v26() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DModelLoader_v21::~J3DModelLoader_v21() { +// asm J3DModelLoader_v21::~J3DModelLoader_v21() { +extern "C" asm void __dt__18J3DModelLoader_v21Fv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/__dt__18J3DModelLoader_v21Fv.s" } @@ -753,13 +1072,13 @@ void J3DModelLoader::readMaterialTable(J3DMaterialBlock const* param_0, u32 para /* 803364A8-803364B0 330DE8 0008+00 2/0 0/0 0/0 .text * calcSizeMaterial__14J3DModelLoaderFPC16J3DMaterialBlockUl */ -bool J3DModelLoader::calcSizeMaterial(J3DMaterialBlock const* param_0, u32 param_1) { +u32 J3DModelLoader::calcSizeMaterial(J3DMaterialBlock const* param_0, u32 param_1) { return false; } /* 803364B0-803364B8 330DF0 0008+00 2/0 0/0 0/0 .text * calcSizeMaterialTable__14J3DModelLoaderFPC16J3DMaterialBlockUl */ -bool J3DModelLoader::calcSizeMaterialTable(J3DMaterialBlock const* param_0, u32 param_1) { +u32 J3DModelLoader::calcSizeMaterialTable(J3DMaterialBlock const* param_0, u32 param_1) { return false; } @@ -835,7 +1154,8 @@ extern "C" asm void func_80336628(void* _this) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DMaterial::J3DMaterial() { +// asm J3DMaterial::J3DMaterial() { +extern "C" asm void __ct__11J3DMaterialFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/__ct__11J3DMaterialFv.s" } @@ -845,7 +1165,8 @@ asm J3DMaterial::J3DMaterial() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DTexture::~J3DTexture() { +// asm J3DTexture::~J3DTexture() { +extern "C" asm void __dt__10J3DTextureFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/__dt__10J3DTextureFv.s" } @@ -855,7 +1176,7 @@ asm J3DTexture::~J3DTexture() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -extern "C" asm void func_803366EC(void* _this, void const* param_0, void const* param_1) { +extern "C" asm ResTIMG* func_803366EC(void const* param_0, void const* param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/func_803366EC.s" } @@ -865,7 +1186,7 @@ extern "C" asm void func_803366EC(void* _this, void const* param_0, void const* #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -extern "C" asm void func_80336704(void* _this, void const* param_0, void const* param_1) { +extern "C" asm Mtx* func_80336704(void const* param_0, void const* param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/func_80336704.s" } @@ -876,7 +1197,7 @@ extern "C" asm void func_80336704(void* _this, void const* param_0, void const* #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -extern "C" asm void func_8033671C(void* _this, void const* param_0, void const* param_1) { +extern "C" asm void* func_8033671C(void const* param_0, void const* param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/func_8033671C.s" } @@ -887,7 +1208,7 @@ extern "C" asm void func_8033671C(void* _this, void const* param_0, void const* #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -extern "C" asm void func_80336734(void* _this, void const* param_0, void const* param_1) { +extern "C" asm _GXVtxAttrFmtList* func_80336734(void const* param_0, void const* param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/func_80336734.s" } @@ -898,7 +1219,7 @@ extern "C" asm void func_80336734(void* _this, void const* param_0, void const* #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -extern "C" asm void func_8033674C(void* _this, void const* param_0, void const* param_1) { +extern "C" asm J3DModelHierarchy* func_8033674C(void const* param_0, void const* param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/func_8033674C.s" } @@ -909,7 +1230,7 @@ extern "C" asm void func_8033674C(void* _this, void const* param_0, void const* #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -extern "C" asm void func_80336764(void* _this, void const* param_0, u32 param_1) { +extern "C" asm J3DShapeInitData* func_80336764(void const* param_0, void const* param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/func_80336764.s" } @@ -920,7 +1241,7 @@ extern "C" asm void func_80336764(void* _this, void const* param_0, u32 param_1) #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -extern "C" asm void func_8033677C(void* _this, void const* param_0, u32 param_1) { +extern "C" asm u16* func_8033677C(void const* param_0, void const* param_1) { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DModelLoader/func_8033677C.s" } diff --git a/libs/JSystem/J3DGraphLoader/J3DShapeFactory.cpp b/libs/JSystem/J3DGraphLoader/J3DShapeFactory.cpp index 52c471359fc..ec1084949d0 100644 --- a/libs/JSystem/J3DGraphLoader/J3DShapeFactory.cpp +++ b/libs/JSystem/J3DGraphLoader/J3DShapeFactory.cpp @@ -28,16 +28,16 @@ extern "C" u16* func_8033677C(const void*, const void*); // JSUConvertOffsetToP /* 80337350-80337400 331C90 00B0+00 0/0 2/2 0/0 .text __ct__15J3DShapeFactoryFRC13J3DShapeBlock */ J3DShapeFactory::J3DShapeFactory(J3DShapeBlock const& block) { - // mShapeInitData = JSUConvertOffsetToPtr(&block, block.mShapeInitData); - mShapeInitData = func_80336764(&block, block.mShapeInitData); - // mIndexTable = JSUConvertOffsetToPtr(&block, block.mIndexTable); - mIndexTable = func_8033677C(&block, block.mIndexTable); - mVtxDescList = JSUConvertOffsetToPtr(&block, block.mVtxDescList); - // mMtxTable = JSUConvertOffsetToPtr(&block, block.mMtxTable); - mMtxTable = func_8033677C(&block, block.mMtxTable); - mDisplayListData = JSUConvertOffsetToPtr(&block, block.mDisplayListData); - mMtxInitData = JSUConvertOffsetToPtr(&block, block.mMtxInitData); - mDrawInitData = JSUConvertOffsetToPtr(&block, block.mDrawInitData); + // mShapeInitData = JSUConvertOffsetToPtr(&block, block.mpShapeInitData); + mShapeInitData = func_80336764(&block, block.mpShapeInitData); + // mIndexTable = JSUConvertOffsetToPtr(&block, block.mpIndexTable); + mIndexTable = func_8033677C(&block, block.mpIndexTable); + mVtxDescList = JSUConvertOffsetToPtr(&block, block.mpVtxDescList); + // mMtxTable = JSUConvertOffsetToPtr(&block, block.mpMtxTable); + mMtxTable = func_8033677C(&block, block.mpMtxTable); + mDisplayListData = JSUConvertOffsetToPtr(&block, block.mpDisplayListData); + mMtxInitData = JSUConvertOffsetToPtr(&block, block.mpMtxInitData); + mDrawInitData = JSUConvertOffsetToPtr(&block, block.mpDrawInitData); mVcdVatCmdBuffer = NULL; } diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index 0293f3eb2be..bbfb89e3d53 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -1730,8 +1730,8 @@ bool J3DTevBlock::getIndTevStage(u32 param_0) { } /* 8000DF8C-8000DF94 0088CC 0008+00 0/0 2/0 0/0 .text getTevStage__11J3DTevBlockFUl */ -bool J3DTevBlock::getTevStage(u32 param_0) { - return false; +J3DTevStage* J3DTevBlock::getTevStage(u32 param_0) { + return NULL; } /* 8000DF94-8000DFA0 0088D4 000C+00 0/0 2/0 0/0 .text getTexNo__11J3DTevBlockCFUl */