diff --git a/Progress.md b/Progress.md index f5dceff175f..072e996a460 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 | 36.706127% | 1320152 | 3596544 +.text | 36.877291% | 1326308 | 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 | 43.378022% | 1744088 | 4020672 +Total | 43.531131% | 1750244 | 4020672 ## Total Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- -main.dol | 43.378022% | 1744088 | 4020672 +main.dol | 43.531131% | 1750244 | 4020672 RELs | 35.305336% | 4060228 | 11500324 -Total | 37.396543% | 5804316 | 15520996 +Total | 37.436206% | 5810472 | 15520996 ## RELs diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__ct__18J3DMaterialFactoryFRC16J3DMaterialBlock.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__ct__18J3DMaterialFactoryFRC16J3DMaterialBlock.s deleted file mode 100644 index 061f4ca115f..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__ct__18J3DMaterialFactoryFRC16J3DMaterialBlock.s +++ /dev/null @@ -1,149 +0,0 @@ -lbl_8032FFEC: -/* 8032FFEC 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8032FFF0 7C 08 02 A6 */ mflr r0 -/* 8032FFF4 90 01 00 14 */ stw r0, 0x14(r1) -/* 8032FFF8 93 E1 00 0C */ stw r31, 0xc(r1) -/* 8032FFFC 93 C1 00 08 */ stw r30, 8(r1) -/* 80330000 7C 7E 1B 78 */ mr r30, r3 -/* 80330004 7C 9F 23 78 */ mr r31, r4 -/* 80330008 A0 04 00 08 */ lhz r0, 8(r4) -/* 8033000C B0 03 00 00 */ sth r0, 0(r3) -/* 80330010 7F E3 FB 78 */ mr r3, r31 -/* 80330014 80 84 00 0C */ lwz r4, 0xc(r4) -/* 80330018 48 00 2D 75 */ bl func_80332D8C -/* 8033001C 90 7E 00 04 */ stw r3, 4(r30) -/* 80330020 7F E3 FB 78 */ mr r3, r31 -/* 80330024 80 9F 00 10 */ lwz r4, 0x10(r31) -/* 80330028 4B FC 42 99 */ bl func_802F42C0 -/* 8033002C 90 7E 00 08 */ stw r3, 8(r30) -/* 80330030 80 9F 00 18 */ lwz r4, 0x18(r31) -/* 80330034 28 04 00 00 */ cmplwi r4, 0 -/* 80330038 41 82 00 24 */ beq lbl_8033005C -/* 8033003C 80 1F 00 14 */ lwz r0, 0x14(r31) -/* 80330040 7C 00 20 50 */ subf r0, r0, r4 -/* 80330044 28 00 00 04 */ cmplwi r0, 4 -/* 80330048 40 81 00 14 */ ble lbl_8033005C -/* 8033004C 7F E3 FB 78 */ mr r3, r31 -/* 80330050 48 00 2D 25 */ bl func_80332D74 -/* 80330054 90 7E 00 0C */ stw r3, 0xc(r30) -/* 80330058 48 00 00 0C */ b lbl_80330064 -lbl_8033005C: -/* 8033005C 38 00 00 00 */ li r0, 0 -/* 80330060 90 1E 00 0C */ stw r0, 0xc(r30) -lbl_80330064: -/* 80330064 7F E3 FB 78 */ mr r3, r31 -/* 80330068 80 9F 00 1C */ lwz r4, 0x1c(r31) -/* 8033006C 4B FC 42 25 */ bl func_802F4290 -/* 80330070 90 7E 00 3C */ stw r3, 0x3c(r30) -/* 80330074 7F E3 FB 78 */ mr r3, r31 -/* 80330078 80 9F 00 20 */ lwz r4, 0x20(r31) -/* 8033007C 4B FC 41 FD */ bl func_802F4278 -/* 80330080 90 7E 00 10 */ stw r3, 0x10(r30) -/* 80330084 7F E3 FB 78 */ mr r3, r31 -/* 80330088 80 9F 00 24 */ lwz r4, 0x24(r31) -/* 8033008C 4B FC 41 D5 */ bl func_802F4260 -/* 80330090 90 7E 00 14 */ stw r3, 0x14(r30) -/* 80330094 7F E3 FB 78 */ mr r3, r31 -/* 80330098 80 9F 00 28 */ lwz r4, 0x28(r31) -/* 8033009C 48 00 2C C1 */ bl func_80332D5C -/* 803300A0 90 7E 00 18 */ stw r3, 0x18(r30) -/* 803300A4 7F E3 FB 78 */ mr r3, r31 -/* 803300A8 80 9F 00 2C */ lwz r4, 0x2c(r31) -/* 803300AC 4B FC 41 CD */ bl func_802F4278 -/* 803300B0 90 7E 00 1C */ stw r3, 0x1c(r30) -/* 803300B4 7F E3 FB 78 */ mr r3, r31 -/* 803300B8 80 9F 00 30 */ lwz r4, 0x30(r31) -/* 803300BC 48 00 2C 89 */ bl func_80332D44 -/* 803300C0 90 7E 00 20 */ stw r3, 0x20(r30) -/* 803300C4 7F E3 FB 78 */ mr r3, r31 -/* 803300C8 80 9F 00 34 */ lwz r4, 0x34(r31) -/* 803300CC 4B FC 41 95 */ bl func_802F4260 -/* 803300D0 90 7E 00 24 */ stw r3, 0x24(r30) -/* 803300D4 7F E3 FB 78 */ mr r3, r31 -/* 803300D8 80 9F 00 38 */ lwz r4, 0x38(r31) -/* 803300DC 48 00 2C 51 */ bl func_80332D2C -/* 803300E0 90 7E 00 28 */ stw r3, 0x28(r30) -/* 803300E4 7F E3 FB 78 */ mr r3, r31 -/* 803300E8 80 9F 00 3C */ lwz r4, 0x3c(r31) -/* 803300EC 48 00 2C 29 */ bl func_80332D14 -/* 803300F0 90 7E 00 2C */ stw r3, 0x2c(r30) -/* 803300F4 7F E3 FB 78 */ mr r3, r31 -/* 803300F8 80 9F 00 40 */ lwz r4, 0x40(r31) -/* 803300FC 48 00 2C 01 */ bl func_80332CFC -/* 80330100 90 7E 00 30 */ stw r3, 0x30(r30) -/* 80330104 7F E3 FB 78 */ mr r3, r31 -/* 80330108 80 9F 00 44 */ lwz r4, 0x44(r31) -/* 8033010C 48 00 2B F1 */ bl func_80332CFC -/* 80330110 90 7E 00 34 */ stw r3, 0x34(r30) -/* 80330114 7F E3 FB 78 */ mr r3, r31 -/* 80330118 80 9F 00 48 */ lwz r4, 0x48(r31) -/* 8033011C 4B FC 41 A5 */ bl func_802F42C0 -/* 80330120 90 7E 00 38 */ stw r3, 0x38(r30) -/* 80330124 7F E3 FB 78 */ mr r3, r31 -/* 80330128 80 9F 00 4C */ lwz r4, 0x4c(r31) -/* 8033012C 48 00 2B B9 */ bl func_80332CE4 -/* 80330130 90 7E 00 40 */ stw r3, 0x40(r30) -/* 80330134 7F E3 FB 78 */ mr r3, r31 -/* 80330138 80 9F 00 50 */ lwz r4, 0x50(r31) -/* 8033013C 4B FC 40 AD */ bl func_802F41E8 -/* 80330140 90 7E 00 44 */ stw r3, 0x44(r30) -/* 80330144 7F E3 FB 78 */ mr r3, r31 -/* 80330148 80 9F 00 54 */ lwz r4, 0x54(r31) -/* 8033014C 4B FC 41 2D */ bl func_802F4278 -/* 80330150 90 7E 00 48 */ stw r3, 0x48(r30) -/* 80330154 7F E3 FB 78 */ mr r3, r31 -/* 80330158 80 9F 00 58 */ lwz r4, 0x58(r31) -/* 8033015C 4B FC 41 05 */ bl func_802F4260 -/* 80330160 90 7E 00 4C */ stw r3, 0x4c(r30) -/* 80330164 7F E3 FB 78 */ mr r3, r31 -/* 80330168 80 9F 00 5C */ lwz r4, 0x5c(r31) -/* 8033016C 48 00 2B 61 */ bl func_80332CCC -/* 80330170 90 7E 00 50 */ stw r3, 0x50(r30) -/* 80330174 7F E3 FB 78 */ mr r3, r31 -/* 80330178 80 9F 00 60 */ lwz r4, 0x60(r31) -/* 8033017C 48 00 2B 39 */ bl func_80332CB4 -/* 80330180 90 7E 00 54 */ stw r3, 0x54(r30) -/* 80330184 7F E3 FB 78 */ mr r3, r31 -/* 80330188 80 9F 00 64 */ lwz r4, 0x64(r31) -/* 8033018C 48 00 2B 11 */ bl func_80332C9C -/* 80330190 90 7E 00 58 */ stw r3, 0x58(r30) -/* 80330194 7F E3 FB 78 */ mr r3, r31 -/* 80330198 80 9F 00 68 */ lwz r4, 0x68(r31) -/* 8033019C 48 00 2A E9 */ bl func_80332C84 -/* 803301A0 90 7E 00 5C */ stw r3, 0x5c(r30) -/* 803301A4 7F E3 FB 78 */ mr r3, r31 -/* 803301A8 80 9F 00 6C */ lwz r4, 0x6c(r31) -/* 803301AC 48 00 2A C1 */ bl func_80332C6C -/* 803301B0 90 7E 00 60 */ stw r3, 0x60(r30) -/* 803301B4 7F E3 FB 78 */ mr r3, r31 -/* 803301B8 80 9F 00 70 */ lwz r4, 0x70(r31) -/* 803301BC 48 00 2A 99 */ bl func_80332C54 -/* 803301C0 90 7E 00 64 */ stw r3, 0x64(r30) -/* 803301C4 7F E3 FB 78 */ mr r3, r31 -/* 803301C8 80 9F 00 74 */ lwz r4, 0x74(r31) -/* 803301CC 48 00 2A 71 */ bl func_80332C3C -/* 803301D0 90 7E 00 68 */ stw r3, 0x68(r30) -/* 803301D4 7F E3 FB 78 */ mr r3, r31 -/* 803301D8 80 9F 00 78 */ lwz r4, 0x78(r31) -/* 803301DC 4B FC 40 85 */ bl func_802F4260 -/* 803301E0 90 7E 00 6C */ stw r3, 0x6c(r30) -/* 803301E4 7F E3 FB 78 */ mr r3, r31 -/* 803301E8 80 9F 00 7C */ lwz r4, 0x7c(r31) -/* 803301EC 4B FC 40 75 */ bl func_802F4260 -/* 803301F0 90 7E 00 70 */ stw r3, 0x70(r30) -/* 803301F4 7F E3 FB 78 */ mr r3, r31 -/* 803301F8 80 9F 00 80 */ lwz r4, 0x80(r31) -/* 803301FC 48 00 2A 29 */ bl func_80332C24 -/* 80330200 90 7E 00 74 */ stw r3, 0x74(r30) -/* 80330204 38 00 00 00 */ li r0, 0 -/* 80330208 90 1E 00 78 */ stw r0, 0x78(r30) -/* 8033020C 90 1E 00 7C */ stw r0, 0x7c(r30) -/* 80330210 90 1E 00 80 */ stw r0, 0x80(r30) -/* 80330214 90 1E 00 84 */ stw r0, 0x84(r30) -/* 80330218 7F C3 F3 78 */ mr r3, r30 -/* 8033021C 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80330220 83 C1 00 08 */ lwz r30, 8(r1) -/* 80330224 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80330228 7C 08 03 A6 */ mtlr r0 -/* 8033022C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80330230 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__ct__18J3DMaterialFactoryFRC18J3DMaterialDLBlock.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__ct__18J3DMaterialFactoryFRC18J3DMaterialDLBlock.s deleted file mode 100644 index 09f58fee2b0..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__ct__18J3DMaterialFactoryFRC18J3DMaterialDLBlock.s +++ /dev/null @@ -1,35 +0,0 @@ -lbl_80330234: -/* 80330234 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80330238 7C 08 02 A6 */ mflr r0 -/* 8033023C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80330240 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80330244 93 C1 00 08 */ stw r30, 8(r1) -/* 80330248 7C 7E 1B 78 */ mr r30, r3 -/* 8033024C 7C 9F 23 78 */ mr r31, r4 -/* 80330250 A0 04 00 08 */ lhz r0, 8(r4) -/* 80330254 B0 03 00 00 */ sth r0, 0(r3) -/* 80330258 38 00 00 00 */ li r0, 0 -/* 8033025C 90 03 00 04 */ stw r0, 4(r3) -/* 80330260 7F E3 FB 78 */ mr r3, r31 -/* 80330264 80 84 00 0C */ lwz r4, 0xc(r4) -/* 80330268 48 00 29 A5 */ bl func_80332C0C -/* 8033026C 90 7E 00 78 */ stw r3, 0x78(r30) -/* 80330270 7F E3 FB 78 */ mr r3, r31 -/* 80330274 80 9F 00 10 */ lwz r4, 0x10(r31) -/* 80330278 48 00 29 7D */ bl func_80332BF4 -/* 8033027C 90 7E 00 7C */ stw r3, 0x7c(r30) -/* 80330280 7F E3 FB 78 */ mr r3, r31 -/* 80330284 80 9F 00 14 */ lwz r4, 0x14(r31) -/* 80330288 48 00 29 55 */ bl func_80332BDC -/* 8033028C 90 7E 00 80 */ stw r3, 0x80(r30) -/* 80330290 7F E3 FB 78 */ mr r3, r31 -/* 80330294 80 9F 00 18 */ lwz r4, 0x18(r31) -/* 80330298 4B FC 3F C9 */ bl func_802F4260 -/* 8033029C 90 7E 00 84 */ stw r3, 0x84(r30) -/* 803302A0 7F C3 F3 78 */ mr r3, r30 -/* 803302A4 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 803302A8 83 C1 00 08 */ lwz r30, 8(r1) -/* 803302AC 80 01 00 14 */ lwz r0, 0x14(r1) -/* 803302B0 7C 08 03 A6 */ mtlr r0 -/* 803302B4 38 21 00 10 */ addi r1, r1, 0x10 -/* 803302B8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s deleted file mode 100644 index 1b93d889f57..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80331D00: -/* 80331D00 38 60 00 00 */ li r3, 0 -/* 80331D04 28 04 00 00 */ cmplwi r4, 0 -/* 80331D08 40 82 00 08 */ bne lbl_80331D10 -/* 80331D0C 38 60 00 64 */ li r3, 0x64 -lbl_80331D10: -/* 80331D10 38 63 00 10 */ addi r3, r3, 0x10 -/* 80331D14 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countStages__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countStages__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 669277e44b4..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countStages__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,39 +0,0 @@ -lbl_8033033C: -/* 8033033C 80 C3 00 04 */ lwz r6, 4(r3) -/* 80330340 80 A3 00 08 */ lwz r5, 8(r3) -/* 80330344 54 80 08 3C */ slwi r0, r4, 1 -/* 80330348 7C 05 02 2E */ lhzx r0, r5, r0 -/* 8033034C 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80330350 7C 86 02 14 */ add r4, r6, r0 -/* 80330354 38 A0 00 00 */ li r5, 0 -/* 80330358 38 C0 00 00 */ li r6, 0 -/* 8033035C 88 04 00 04 */ lbz r0, 4(r4) -/* 80330360 28 00 00 FF */ cmplwi r0, 0xff -/* 80330364 41 82 00 0C */ beq lbl_80330370 -/* 80330368 80 63 00 4C */ lwz r3, 0x4c(r3) -/* 8033036C 7C C3 00 AE */ lbzx r6, r3, r0 -lbl_80330370: -/* 80330370 38 60 00 00 */ li r3, 0 -/* 80330374 38 00 00 08 */ li r0, 8 -/* 80330378 7C 09 03 A6 */ mtctr r0 -lbl_8033037C: -/* 8033037C 38 03 00 84 */ addi r0, r3, 0x84 -/* 80330380 7C 04 02 2E */ lhzx r0, r4, r0 -/* 80330384 28 00 FF FF */ cmplwi r0, 0xffff -/* 80330388 41 82 00 08 */ beq lbl_80330390 -/* 8033038C 38 A5 00 01 */ addi r5, r5, 1 -lbl_80330390: -/* 80330390 38 63 00 02 */ addi r3, r3, 2 -/* 80330394 42 00 FF E8 */ bdnz lbl_8033037C -/* 80330398 7C 06 28 40 */ cmplw r6, r5 -/* 8033039C 41 82 00 20 */ beq lbl_803303BC -/* 803303A0 28 05 00 00 */ cmplwi r5, 0 -/* 803303A4 41 82 00 18 */ beq lbl_803303BC -/* 803303A8 7C 06 28 40 */ cmplw r6, r5 -/* 803303AC 7C A3 2B 78 */ mr r3, r5 -/* 803303B0 4C 81 00 20 */ blelr -/* 803303B4 7C C3 33 78 */ mr r3, r6 -/* 803303B8 4E 80 00 20 */ blr -lbl_803303BC: -/* 803303BC 7C C3 33 78 */ mr r3, r6 -/* 803303C0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countTexGens__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countTexGens__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 5a6050b3194..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countTexGens__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80330304: -/* 80330304 80 C3 00 04 */ lwz r6, 4(r3) -/* 80330308 80 A3 00 08 */ lwz r5, 8(r3) -/* 8033030C 54 80 08 3C */ slwi r0, r4, 1 -/* 80330310 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80330314 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80330318 7C 86 02 14 */ add r4, r6, r0 -/* 8033031C 88 04 00 03 */ lbz r0, 3(r4) -/* 80330320 28 00 00 FF */ cmplwi r0, 0xff -/* 80330324 41 82 00 10 */ beq lbl_80330334 -/* 80330328 80 63 00 24 */ lwz r3, 0x24(r3) -/* 8033032C 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80330330 4E 80 00 20 */ blr -lbl_80330334: -/* 80330334 38 60 00 00 */ li r3, 0 -/* 80330338 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countUniqueMaterials__18J3DMaterialFactoryFv.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countUniqueMaterials__18J3DMaterialFactoryFv.s deleted file mode 100644 index 6783468409b..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countUniqueMaterials__18J3DMaterialFactoryFv.s +++ /dev/null @@ -1,22 +0,0 @@ -lbl_803302BC: -/* 803302BC 38 C0 00 00 */ li r6, 0 -/* 803302C0 38 E0 FF FF */ li r7, -1 -/* 803302C4 39 00 00 00 */ li r8, 0 -/* 803302C8 A0 A3 00 00 */ lhz r5, 0(r3) -/* 803302CC 48 00 00 24 */ b lbl_803302F0 -lbl_803302D0: -/* 803302D0 80 83 00 08 */ lwz r4, 8(r3) -/* 803302D4 55 00 0B FC */ rlwinm r0, r8, 1, 0xf, 0x1e -/* 803302D8 7C 04 02 2E */ lhzx r0, r4, r0 -/* 803302DC 7C 07 00 00 */ cmpw r7, r0 -/* 803302E0 40 80 00 0C */ bge lbl_803302EC -/* 803302E4 7C 07 03 78 */ mr r7, r0 -/* 803302E8 38 C6 00 01 */ addi r6, r6, 1 -lbl_803302EC: -/* 803302EC 39 08 00 01 */ addi r8, r8, 1 -lbl_803302F0: -/* 803302F0 55 00 04 3E */ clrlwi r0, r8, 0x10 -/* 803302F4 7C 00 28 40 */ cmplw r0, r5 -/* 803302F8 41 80 FF D8 */ blt lbl_803302D0 -/* 803302FC 7C C3 33 78 */ mr r3, r6 -/* 80330300 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_803303C4.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_803303C4.s deleted file mode 100644 index 3a95b9a07d8..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_803303C4.s +++ /dev/null @@ -1,37 +0,0 @@ -lbl_803303C4: -/* 803303C4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 803303C8 7C 08 02 A6 */ mflr r0 -/* 803303CC 90 01 00 14 */ stw r0, 0x14(r1) -/* 803303D0 2C 05 00 01 */ cmpwi r5, 1 -/* 803303D4 41 82 00 34 */ beq lbl_80330408 -/* 803303D8 40 80 00 10 */ bge lbl_803303E8 -/* 803303DC 2C 05 00 00 */ cmpwi r5, 0 -/* 803303E0 40 80 00 14 */ bge lbl_803303F4 -/* 803303E4 48 00 00 48 */ b lbl_8033042C -lbl_803303E8: -/* 803303E8 2C 05 00 03 */ cmpwi r5, 3 -/* 803303EC 40 80 00 40 */ bge lbl_8033042C -/* 803303F0 48 00 00 2C */ b lbl_8033041C -lbl_803303F4: -/* 803303F4 7C C5 33 78 */ mr r5, r6 -/* 803303F8 7C E6 3B 78 */ mr r6, r7 -/* 803303FC 48 00 00 45 */ bl createNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl -/* 80330400 7C 64 1B 78 */ mr r4, r3 -/* 80330404 48 00 00 28 */ b lbl_8033042C -lbl_80330408: -/* 80330408 7C C5 33 78 */ mr r5, r6 -/* 8033040C 7C E6 3B 78 */ mr r6, r7 -/* 80330410 48 00 13 C5 */ bl createLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl -/* 80330414 7C 64 1B 78 */ mr r4, r3 -/* 80330418 48 00 00 14 */ b lbl_8033042C -lbl_8033041C: -/* 8033041C 7C C5 33 78 */ mr r5, r6 -/* 80330420 7C E6 3B 78 */ mr r6, r7 -/* 80330424 48 00 09 61 */ bl createPatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl -/* 80330428 7C 64 1B 78 */ mr r4, r3 -lbl_8033042C: -/* 8033042C 7C 83 23 78 */ mr r3, r4 -/* 80330430 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80330434 7C 08 03 A6 */ mtlr r0 -/* 80330438 38 21 00 10 */ addi r1, r1, 0x10 -/* 8033043C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80331A7C.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80331A7C.s deleted file mode 100644 index e23987464a9..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80331A7C.s +++ /dev/null @@ -1,38 +0,0 @@ -lbl_80331A7C: -/* 80331A7C 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80331A80 7C 08 02 A6 */ mflr r0 -/* 80331A84 90 01 00 14 */ stw r0, 0x14(r1) -/* 80331A88 38 00 00 00 */ li r0, 0 -/* 80331A8C 2C 05 00 01 */ cmpwi r5, 1 -/* 80331A90 41 82 00 34 */ beq lbl_80331AC4 -/* 80331A94 40 80 00 10 */ bge lbl_80331AA4 -/* 80331A98 2C 05 00 00 */ cmpwi r5, 0 -/* 80331A9C 40 80 00 14 */ bge lbl_80331AB0 -/* 80331AA0 48 00 00 48 */ b lbl_80331AE8 -lbl_80331AA4: -/* 80331AA4 2C 05 00 03 */ cmpwi r5, 3 -/* 80331AA8 40 80 00 40 */ bge lbl_80331AE8 -/* 80331AAC 48 00 00 2C */ b lbl_80331AD8 -lbl_80331AB0: -/* 80331AB0 7C C5 33 78 */ mr r5, r6 -/* 80331AB4 7C E6 3B 78 */ mr r6, r7 -/* 80331AB8 48 00 00 45 */ bl calcSizeNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl -/* 80331ABC 7C 60 1B 78 */ mr r0, r3 -/* 80331AC0 48 00 00 28 */ b lbl_80331AE8 -lbl_80331AC4: -/* 80331AC4 7C C5 33 78 */ mr r5, r6 -/* 80331AC8 7C E6 3B 78 */ mr r6, r7 -/* 80331ACC 48 00 02 35 */ bl calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl -/* 80331AD0 7C 60 1B 78 */ mr r0, r3 -/* 80331AD4 48 00 00 14 */ b lbl_80331AE8 -lbl_80331AD8: -/* 80331AD8 7C C5 33 78 */ mr r5, r6 -/* 80331ADC 7C E6 3B 78 */ mr r6, r7 -/* 80331AE0 48 00 01 51 */ bl calcSizePatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl -/* 80331AE4 7C 60 1B 78 */ mr r0, r3 -lbl_80331AE8: -/* 80331AE8 7C 03 03 78 */ mr r3, r0 -/* 80331AEC 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80331AF0 7C 08 03 A6 */ mtlr r0 -/* 80331AF4 38 21 00 10 */ addi r1, r1, 0x10 -/* 80331AF8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332BDC.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332BDC.s deleted file mode 100644 index d0c8cc1206f..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332BDC.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332BDC: -/* 80332BDC 28 04 00 00 */ cmplwi r4, 0 -/* 80332BE0 40 82 00 0C */ bne lbl_80332BEC -/* 80332BE4 38 60 00 00 */ li r3, 0 -/* 80332BE8 4E 80 00 20 */ blr -lbl_80332BEC: -/* 80332BEC 7C 63 22 14 */ add r3, r3, r4 -/* 80332BF0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332BF4.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332BF4.s deleted file mode 100644 index e10b6898107..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332BF4.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332BF4: -/* 80332BF4 28 04 00 00 */ cmplwi r4, 0 -/* 80332BF8 40 82 00 0C */ bne lbl_80332C04 -/* 80332BFC 38 60 00 00 */ li r3, 0 -/* 80332C00 4E 80 00 20 */ blr -lbl_80332C04: -/* 80332C04 7C 63 22 14 */ add r3, r3, r4 -/* 80332C08 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C0C.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C0C.s deleted file mode 100644 index a58d6301cbc..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C0C.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332C0C: -/* 80332C0C 28 04 00 00 */ cmplwi r4, 0 -/* 80332C10 40 82 00 0C */ bne lbl_80332C1C -/* 80332C14 38 60 00 00 */ li r3, 0 -/* 80332C18 4E 80 00 20 */ blr -lbl_80332C1C: -/* 80332C1C 7C 63 22 14 */ add r3, r3, r4 -/* 80332C20 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C24.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C24.s deleted file mode 100644 index 965863a4510..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C24.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332C24: -/* 80332C24 28 04 00 00 */ cmplwi r4, 0 -/* 80332C28 40 82 00 0C */ bne lbl_80332C34 -/* 80332C2C 38 60 00 00 */ li r3, 0 -/* 80332C30 4E 80 00 20 */ blr -lbl_80332C34: -/* 80332C34 7C 63 22 14 */ add r3, r3, r4 -/* 80332C38 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C3C.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C3C.s deleted file mode 100644 index f85f32e4432..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C3C.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332C3C: -/* 80332C3C 28 04 00 00 */ cmplwi r4, 0 -/* 80332C40 40 82 00 0C */ bne lbl_80332C4C -/* 80332C44 38 60 00 00 */ li r3, 0 -/* 80332C48 4E 80 00 20 */ blr -lbl_80332C4C: -/* 80332C4C 7C 63 22 14 */ add r3, r3, r4 -/* 80332C50 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C54.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C54.s deleted file mode 100644 index e86218b7d63..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C54.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332C54: -/* 80332C54 28 04 00 00 */ cmplwi r4, 0 -/* 80332C58 40 82 00 0C */ bne lbl_80332C64 -/* 80332C5C 38 60 00 00 */ li r3, 0 -/* 80332C60 4E 80 00 20 */ blr -lbl_80332C64: -/* 80332C64 7C 63 22 14 */ add r3, r3, r4 -/* 80332C68 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C6C.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C6C.s deleted file mode 100644 index 9d4cad1d335..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C6C.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332C6C: -/* 80332C6C 28 04 00 00 */ cmplwi r4, 0 -/* 80332C70 40 82 00 0C */ bne lbl_80332C7C -/* 80332C74 38 60 00 00 */ li r3, 0 -/* 80332C78 4E 80 00 20 */ blr -lbl_80332C7C: -/* 80332C7C 7C 63 22 14 */ add r3, r3, r4 -/* 80332C80 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C84.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C84.s deleted file mode 100644 index 7137cc5e456..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C84.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332C84: -/* 80332C84 28 04 00 00 */ cmplwi r4, 0 -/* 80332C88 40 82 00 0C */ bne lbl_80332C94 -/* 80332C8C 38 60 00 00 */ li r3, 0 -/* 80332C90 4E 80 00 20 */ blr -lbl_80332C94: -/* 80332C94 7C 63 22 14 */ add r3, r3, r4 -/* 80332C98 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C9C.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C9C.s deleted file mode 100644 index 9f4545d92a1..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C9C.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332C9C: -/* 80332C9C 28 04 00 00 */ cmplwi r4, 0 -/* 80332CA0 40 82 00 0C */ bne lbl_80332CAC -/* 80332CA4 38 60 00 00 */ li r3, 0 -/* 80332CA8 4E 80 00 20 */ blr -lbl_80332CAC: -/* 80332CAC 7C 63 22 14 */ add r3, r3, r4 -/* 80332CB0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CB4.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CB4.s deleted file mode 100644 index 27e53413dd7..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CB4.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332CB4: -/* 80332CB4 28 04 00 00 */ cmplwi r4, 0 -/* 80332CB8 40 82 00 0C */ bne lbl_80332CC4 -/* 80332CBC 38 60 00 00 */ li r3, 0 -/* 80332CC0 4E 80 00 20 */ blr -lbl_80332CC4: -/* 80332CC4 7C 63 22 14 */ add r3, r3, r4 -/* 80332CC8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CCC.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CCC.s deleted file mode 100644 index d2535c2b25f..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CCC.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332CCC: -/* 80332CCC 28 04 00 00 */ cmplwi r4, 0 -/* 80332CD0 40 82 00 0C */ bne lbl_80332CDC -/* 80332CD4 38 60 00 00 */ li r3, 0 -/* 80332CD8 4E 80 00 20 */ blr -lbl_80332CDC: -/* 80332CDC 7C 63 22 14 */ add r3, r3, r4 -/* 80332CE0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CE4.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CE4.s deleted file mode 100644 index 9c74d3f1f8f..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CE4.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332CE4: -/* 80332CE4 28 04 00 00 */ cmplwi r4, 0 -/* 80332CE8 40 82 00 0C */ bne lbl_80332CF4 -/* 80332CEC 38 60 00 00 */ li r3, 0 -/* 80332CF0 4E 80 00 20 */ blr -lbl_80332CF4: -/* 80332CF4 7C 63 22 14 */ add r3, r3, r4 -/* 80332CF8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CFC.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CFC.s deleted file mode 100644 index 1efee424a99..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CFC.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332CFC: -/* 80332CFC 28 04 00 00 */ cmplwi r4, 0 -/* 80332D00 40 82 00 0C */ bne lbl_80332D0C -/* 80332D04 38 60 00 00 */ li r3, 0 -/* 80332D08 4E 80 00 20 */ blr -lbl_80332D0C: -/* 80332D0C 7C 63 22 14 */ add r3, r3, r4 -/* 80332D10 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D14.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D14.s deleted file mode 100644 index bde7fc26a53..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D14.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332D14: -/* 80332D14 28 04 00 00 */ cmplwi r4, 0 -/* 80332D18 40 82 00 0C */ bne lbl_80332D24 -/* 80332D1C 38 60 00 00 */ li r3, 0 -/* 80332D20 4E 80 00 20 */ blr -lbl_80332D24: -/* 80332D24 7C 63 22 14 */ add r3, r3, r4 -/* 80332D28 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D2C.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D2C.s deleted file mode 100644 index 3c66aec466a..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D2C.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332D2C: -/* 80332D2C 28 04 00 00 */ cmplwi r4, 0 -/* 80332D30 40 82 00 0C */ bne lbl_80332D3C -/* 80332D34 38 60 00 00 */ li r3, 0 -/* 80332D38 4E 80 00 20 */ blr -lbl_80332D3C: -/* 80332D3C 7C 63 22 14 */ add r3, r3, r4 -/* 80332D40 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D44.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D44.s deleted file mode 100644 index 9853a83eda0..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D44.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332D44: -/* 80332D44 28 04 00 00 */ cmplwi r4, 0 -/* 80332D48 40 82 00 0C */ bne lbl_80332D54 -/* 80332D4C 38 60 00 00 */ li r3, 0 -/* 80332D50 4E 80 00 20 */ blr -lbl_80332D54: -/* 80332D54 7C 63 22 14 */ add r3, r3, r4 -/* 80332D58 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D5C.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D5C.s deleted file mode 100644 index 49a79e0686e..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D5C.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332D5C: -/* 80332D5C 28 04 00 00 */ cmplwi r4, 0 -/* 80332D60 40 82 00 0C */ bne lbl_80332D6C -/* 80332D64 38 60 00 00 */ li r3, 0 -/* 80332D68 4E 80 00 20 */ blr -lbl_80332D6C: -/* 80332D6C 7C 63 22 14 */ add r3, r3, r4 -/* 80332D70 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D74.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D74.s deleted file mode 100644 index fb4d4eb2468..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D74.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332D74: -/* 80332D74 28 04 00 00 */ cmplwi r4, 0 -/* 80332D78 40 82 00 0C */ bne lbl_80332D84 -/* 80332D7C 38 60 00 00 */ li r3, 0 -/* 80332D80 4E 80 00 20 */ blr -lbl_80332D84: -/* 80332D84 7C 63 22 14 */ add r3, r3, r4 -/* 80332D88 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D8C.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D8C.s deleted file mode 100644 index b29f9ffafa0..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D8C.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80332D8C: -/* 80332D8C 28 04 00 00 */ cmplwi r4, 0 -/* 80332D90 40 82 00 0C */ bne lbl_80332D9C -/* 80332D94 38 60 00 00 */ li r3, 0 -/* 80332D98 4E 80 00 20 */ blr -lbl_80332D9C: -/* 80332D9C 7C 63 22 14 */ add r3, r3, r4 -/* 80332DA0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newBlend__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newBlend__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 0bc961b0da5..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newBlend__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,19 +0,0 @@ -lbl_803327E8: -/* 803327E8 80 E4 00 04 */ lwz r7, 4(r4) -/* 803327EC 80 C4 00 08 */ lwz r6, 8(r4) -/* 803327F0 54 A0 08 3C */ slwi r0, r5, 1 -/* 803327F4 7C 06 02 2E */ lhzx r0, r6, r0 -/* 803327F8 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 803327FC 7C A7 02 14 */ add r5, r7, r0 -/* 80332800 A0 05 01 48 */ lhz r0, 0x148(r5) -/* 80332804 28 00 FF FF */ cmplwi r0, 0xffff -/* 80332808 41 82 00 18 */ beq lbl_80332820 -/* 8033280C 80 84 00 64 */ lwz r4, 0x64(r4) -/* 80332810 54 00 13 BA */ rlwinm r0, r0, 2, 0xe, 0x1d -/* 80332814 7C 04 00 2E */ lwzx r0, r4, r0 -/* 80332818 90 03 00 00 */ stw r0, 0(r3) -/* 8033281C 4E 80 00 20 */ blr -lbl_80332820: -/* 80332820 80 02 C9 EC */ lwz r0, j3dDefaultBlendInfo(r2) -/* 80332824 90 03 00 00 */ stw r0, 0(r3) -/* 80332828 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newColorChanNum__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newColorChanNum__18J3DMaterialFactoryCFi.s deleted file mode 100644 index bf3af33e286..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newColorChanNum__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80331D74: -/* 80331D74 80 C3 00 04 */ lwz r6, 4(r3) -/* 80331D78 80 A3 00 08 */ lwz r5, 8(r3) -/* 80331D7C 54 80 08 3C */ slwi r0, r4, 1 -/* 80331D80 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80331D84 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80331D88 7C 86 02 14 */ add r4, r6, r0 -/* 80331D8C 88 04 00 02 */ lbz r0, 2(r4) -/* 80331D90 28 00 00 FF */ cmplwi r0, 0xff -/* 80331D94 41 82 00 10 */ beq lbl_80331DA4 -/* 80331D98 80 63 00 14 */ lwz r3, 0x14(r3) -/* 80331D9C 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80331DA0 4E 80 00 20 */ blr -lbl_80331DA4: -/* 80331DA4 38 60 00 00 */ li r3, 0 -/* 80331DA8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newCullMode__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newCullMode__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 4676deca5a2..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newCullMode__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,18 +0,0 @@ -lbl_803320CC: -/* 803320CC 80 C3 00 04 */ lwz r6, 4(r3) -/* 803320D0 80 A3 00 08 */ lwz r5, 8(r3) -/* 803320D4 54 80 08 3C */ slwi r0, r4, 1 -/* 803320D8 7C 05 02 2E */ lhzx r0, r5, r0 -/* 803320DC 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 803320E0 7C 86 02 14 */ add r4, r6, r0 -/* 803320E4 88 04 00 01 */ lbz r0, 1(r4) -/* 803320E8 28 00 00 FF */ cmplwi r0, 0xff -/* 803320EC 41 82 00 18 */ beq lbl_80332104 -/* 803320F0 80 63 00 3C */ lwz r3, 0x3c(r3) -/* 803320F4 54 00 15 BA */ rlwinm r0, r0, 2, 0x16, 0x1d -/* 803320F8 7C 03 00 2E */ lwzx r0, r3, r0 -/* 803320FC 54 03 06 3E */ clrlwi r3, r0, 0x18 -/* 80332100 4E 80 00 20 */ blr -lbl_80332104: -/* 80332104 38 60 00 FF */ li r3, 0xff -/* 80332108 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newDither__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newDither__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 722828e2461..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newDither__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_803328C4: -/* 803328C4 80 C3 00 04 */ lwz r6, 4(r3) -/* 803328C8 80 A3 00 08 */ lwz r5, 8(r3) -/* 803328CC 54 80 08 3C */ slwi r0, r4, 1 -/* 803328D0 7C 05 02 2E */ lhzx r0, r5, r0 -/* 803328D4 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 803328D8 7C 86 02 14 */ add r4, r6, r0 -/* 803328DC 88 04 00 07 */ lbz r0, 7(r4) -/* 803328E0 28 00 00 FF */ cmplwi r0, 0xff -/* 803328E4 41 82 00 10 */ beq lbl_803328F4 -/* 803328E8 80 63 00 70 */ lwz r3, 0x70(r3) -/* 803328EC 7C 63 00 AE */ lbzx r3, r3, r0 -/* 803328F0 4E 80 00 20 */ blr -lbl_803328F4: -/* 803328F4 38 60 00 01 */ li r3, 1 -/* 803328F8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newFog__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newFog__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 42088ee097d..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newFog__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,59 +0,0 @@ -lbl_8033268C: -/* 8033268C 94 21 FF 90 */ stwu r1, -0x70(r1) -/* 80332690 7C 08 02 A6 */ mflr r0 -/* 80332694 90 01 00 74 */ stw r0, 0x74(r1) -/* 80332698 39 61 00 70 */ addi r11, r1, 0x70 -/* 8033269C 48 02 FB 41 */ bl _savegpr_29 -/* 803326A0 7C 7F 1B 78 */ mr r31, r3 -/* 803326A4 7C 9D 23 78 */ mr r29, r4 -/* 803326A8 7C BE 2B 78 */ mr r30, r5 -/* 803326AC 38 61 00 34 */ addi r3, r1, 0x34 -/* 803326B0 3C 80 80 3A */ lis r4, j3dDefaultFogInfo@ha /* 0x803A1FBC@ha */ -/* 803326B4 38 84 1F BC */ addi r4, r4, j3dDefaultFogInfo@l /* 0x803A1FBC@l */ -/* 803326B8 4B FF 31 49 */ bl __as__10J3DFogInfoFRC10J3DFogInfo -/* 803326BC 80 9D 00 04 */ lwz r4, 4(r29) -/* 803326C0 80 7D 00 08 */ lwz r3, 8(r29) -/* 803326C4 57 C0 08 3C */ slwi r0, r30, 1 -/* 803326C8 7C 03 02 2E */ lhzx r0, r3, r0 -/* 803326CC 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 803326D0 7C 64 02 14 */ add r3, r4, r0 -/* 803326D4 A0 03 01 44 */ lhz r0, 0x144(r3) -/* 803326D8 28 00 FF FF */ cmplwi r0, 0xffff -/* 803326DC 41 82 00 48 */ beq lbl_80332724 -/* 803326E0 80 7D 00 5C */ lwz r3, 0x5c(r29) -/* 803326E4 1C 00 00 2C */ mulli r0, r0, 0x2c -/* 803326E8 38 A1 00 04 */ addi r5, r1, 4 -/* 803326EC 7C 83 02 14 */ add r4, r3, r0 -/* 803326F0 38 00 00 05 */ li r0, 5 -/* 803326F4 7C 09 03 A6 */ mtctr r0 -/* 803326F8 38 84 FF FC */ addi r4, r4, -4 -lbl_803326FC: -/* 803326FC 80 64 00 04 */ lwz r3, 4(r4) -/* 80332700 84 04 00 08 */ lwzu r0, 8(r4) -/* 80332704 90 65 00 04 */ stw r3, 4(r5) -/* 80332708 94 05 00 08 */ stwu r0, 8(r5) -/* 8033270C 42 00 FF F0 */ bdnz lbl_803326FC -/* 80332710 80 04 00 04 */ lwz r0, 4(r4) -/* 80332714 90 05 00 04 */ stw r0, 4(r5) -/* 80332718 38 61 00 34 */ addi r3, r1, 0x34 -/* 8033271C 38 81 00 08 */ addi r4, r1, 8 -/* 80332720 4B FF 30 E1 */ bl __as__10J3DFogInfoFRC10J3DFogInfo -lbl_80332724: -/* 80332724 38 BF FF FC */ addi r5, r31, -4 -/* 80332728 38 81 00 30 */ addi r4, r1, 0x30 -/* 8033272C 38 00 00 05 */ li r0, 5 -/* 80332730 7C 09 03 A6 */ mtctr r0 -lbl_80332734: -/* 80332734 80 64 00 04 */ lwz r3, 4(r4) -/* 80332738 84 04 00 08 */ lwzu r0, 8(r4) -/* 8033273C 90 65 00 04 */ stw r3, 4(r5) -/* 80332740 94 05 00 08 */ stwu r0, 8(r5) -/* 80332744 42 00 FF F0 */ bdnz lbl_80332734 -/* 80332748 80 04 00 04 */ lwz r0, 4(r4) -/* 8033274C 90 05 00 04 */ stw r0, 4(r5) -/* 80332750 39 61 00 70 */ addi r11, r1, 0x70 -/* 80332754 48 02 FA D5 */ bl _restgpr_29 -/* 80332758 80 01 00 74 */ lwz r0, 0x74(r1) -/* 8033275C 7C 08 03 A6 */ mtlr r0 -/* 80332760 38 21 00 70 */ addi r1, r1, 0x70 -/* 80332764 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTevStage__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTevStage__18J3DMaterialFactoryCFii.s deleted file mode 100644 index f6d8497e35c..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTevStage__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,103 +0,0 @@ -lbl_803324B4: -/* 803324B4 3C E0 80 3A */ lis r7, j3dDefaultIndTevStageInfo@ha /* 0x803A1FB0@ha */ -/* 803324B8 39 07 1F B0 */ addi r8, r7, j3dDefaultIndTevStageInfo@l /* 0x803A1FB0@l */ -/* 803324BC 88 08 00 00 */ lbz r0, 0(r8) -/* 803324C0 54 07 07 B6 */ rlwinm r7, r0, 0, 0x1e, 0x1b -/* 803324C4 88 08 00 01 */ lbz r0, 1(r8) -/* 803324C8 54 00 15 BA */ rlwinm r0, r0, 2, 0x16, 0x1d -/* 803324CC 7C E0 03 78 */ or r0, r7, r0 -/* 803324D0 54 07 07 30 */ rlwinm r7, r0, 0, 0x1c, 0x18 -/* 803324D4 88 08 00 02 */ lbz r0, 2(r8) -/* 803324D8 54 00 25 36 */ rlwinm r0, r0, 4, 0x14, 0x1b -/* 803324DC 7C E7 03 78 */ or r7, r7, r0 -/* 803324E0 88 08 00 03 */ lbz r0, 3(r8) -/* 803324E4 54 00 4B EC */ rlwinm r0, r0, 9, 0xf, 0x16 -/* 803324E8 50 E0 05 FE */ rlwimi r0, r7, 0, 0x17, 0x1f -/* 803324EC 54 07 04 DE */ rlwinm r7, r0, 0, 0x13, 0xf -/* 803324F0 88 08 00 04 */ lbz r0, 4(r8) -/* 803324F4 54 00 6A E4 */ rlwinm r0, r0, 0xd, 0xb, 0x12 -/* 803324F8 7C E0 03 78 */ or r0, r7, r0 -/* 803324FC 54 07 04 18 */ rlwinm r7, r0, 0, 0x10, 0xc -/* 80332500 88 08 00 05 */ lbz r0, 5(r8) -/* 80332504 54 00 82 1E */ rlwinm r0, r0, 0x10, 8, 0xf -/* 80332508 7C E0 03 78 */ or r0, r7, r0 -/* 8033250C 54 07 03 14 */ rlwinm r7, r0, 0, 0xc, 0xa -/* 80332510 88 08 00 06 */ lbz r0, 6(r8) -/* 80332514 54 00 A1 16 */ rlwinm r0, r0, 0x14, 4, 0xb -/* 80332518 7C E0 03 78 */ or r0, r7, r0 -/* 8033251C 54 07 03 56 */ rlwinm r7, r0, 0, 0xd, 0xb -/* 80332520 88 08 00 07 */ lbz r0, 7(r8) -/* 80332524 54 00 99 58 */ rlwinm r0, r0, 0x13, 5, 0xc -/* 80332528 7C E0 03 78 */ or r0, r7, r0 -/* 8033252C 54 07 06 6C */ rlwinm r7, r0, 0, 0x19, 0x16 -/* 80332530 88 08 00 08 */ lbz r0, 8(r8) -/* 80332534 54 00 3C 70 */ rlwinm r0, r0, 7, 0x11, 0x18 -/* 80332538 7C E7 03 78 */ or r7, r7, r0 -/* 8033253C 80 84 00 0C */ lwz r4, 0xc(r4) -/* 80332540 1C 05 01 38 */ mulli r0, r5, 0x138 -/* 80332544 7C A4 02 14 */ add r5, r4, r0 -/* 80332548 88 05 00 00 */ lbz r0, 0(r5) -/* 8033254C 28 00 00 01 */ cmplwi r0, 1 -/* 80332550 40 82 00 F0 */ bne lbl_80332640 -/* 80332554 1C 86 00 0C */ mulli r4, r6, 0xc -/* 80332558 38 84 00 78 */ addi r4, r4, 0x78 -/* 8033255C 7C 85 22 14 */ add r4, r5, r4 -/* 80332560 38 00 00 00 */ li r0, 0 -/* 80332564 90 03 00 00 */ stw r0, 0(r3) -/* 80332568 80 03 00 00 */ lwz r0, 0(r3) -/* 8033256C 54 05 00 3A */ rlwinm r5, r0, 0, 0, 0x1d -/* 80332570 88 04 00 00 */ lbz r0, 0(r4) -/* 80332574 7C A0 03 78 */ or r0, r5, r0 -/* 80332578 90 03 00 00 */ stw r0, 0(r3) -/* 8033257C 80 03 00 00 */ lwz r0, 0(r3) -/* 80332580 54 05 07 B6 */ rlwinm r5, r0, 0, 0x1e, 0x1b -/* 80332584 88 04 00 01 */ lbz r0, 1(r4) -/* 80332588 54 00 15 BA */ rlwinm r0, r0, 2, 0x16, 0x1d -/* 8033258C 7C A0 03 78 */ or r0, r5, r0 -/* 80332590 90 03 00 00 */ stw r0, 0(r3) -/* 80332594 80 03 00 00 */ lwz r0, 0(r3) -/* 80332598 54 05 07 30 */ rlwinm r5, r0, 0, 0x1c, 0x18 -/* 8033259C 88 04 00 02 */ lbz r0, 2(r4) -/* 803325A0 54 00 25 36 */ rlwinm r0, r0, 4, 0x14, 0x1b -/* 803325A4 7C A0 03 78 */ or r0, r5, r0 -/* 803325A8 90 03 00 00 */ stw r0, 0(r3) -/* 803325AC 80 03 00 00 */ lwz r0, 0(r3) -/* 803325B0 54 05 05 E4 */ rlwinm r5, r0, 0, 0x17, 0x12 -/* 803325B4 88 04 00 03 */ lbz r0, 3(r4) -/* 803325B8 54 00 4B EC */ rlwinm r0, r0, 9, 0xf, 0x16 -/* 803325BC 7C A0 03 78 */ or r0, r5, r0 -/* 803325C0 90 03 00 00 */ stw r0, 0(r3) -/* 803325C4 80 03 00 00 */ lwz r0, 0(r3) -/* 803325C8 54 05 04 DE */ rlwinm r5, r0, 0, 0x13, 0xf -/* 803325CC 88 04 00 04 */ lbz r0, 4(r4) -/* 803325D0 54 00 6A E4 */ rlwinm r0, r0, 0xd, 0xb, 0x12 -/* 803325D4 7C A0 03 78 */ or r0, r5, r0 -/* 803325D8 90 03 00 00 */ stw r0, 0(r3) -/* 803325DC 80 03 00 00 */ lwz r0, 0(r3) -/* 803325E0 54 05 04 18 */ rlwinm r5, r0, 0, 0x10, 0xc -/* 803325E4 88 04 00 05 */ lbz r0, 5(r4) -/* 803325E8 54 00 82 1E */ rlwinm r0, r0, 0x10, 8, 0xf -/* 803325EC 7C A0 03 78 */ or r0, r5, r0 -/* 803325F0 90 03 00 00 */ stw r0, 0(r3) -/* 803325F4 80 03 00 00 */ lwz r0, 0(r3) -/* 803325F8 54 05 03 14 */ rlwinm r5, r0, 0, 0xc, 0xa -/* 803325FC 88 04 00 06 */ lbz r0, 6(r4) -/* 80332600 54 00 A1 16 */ rlwinm r0, r0, 0x14, 4, 0xb -/* 80332604 7C A0 03 78 */ or r0, r5, r0 -/* 80332608 90 03 00 00 */ stw r0, 0(r3) -/* 8033260C 80 03 00 00 */ lwz r0, 0(r3) -/* 80332610 54 05 03 56 */ rlwinm r5, r0, 0, 0xd, 0xb -/* 80332614 88 04 00 07 */ lbz r0, 7(r4) -/* 80332618 54 00 99 58 */ rlwinm r0, r0, 0x13, 5, 0xc -/* 8033261C 7C A0 03 78 */ or r0, r5, r0 -/* 80332620 90 03 00 00 */ stw r0, 0(r3) -/* 80332624 80 03 00 00 */ lwz r0, 0(r3) -/* 80332628 54 05 06 6C */ rlwinm r5, r0, 0, 0x19, 0x16 -/* 8033262C 88 04 00 08 */ lbz r0, 8(r4) -/* 80332630 54 00 3C 70 */ rlwinm r0, r0, 7, 0x11, 0x18 -/* 80332634 7C A0 03 78 */ or r0, r5, r0 -/* 80332638 90 03 00 00 */ stw r0, 0(r3) -/* 8033263C 4E 80 00 20 */ blr -lbl_80332640: -/* 80332640 90 E3 00 00 */ stw r7, 0(r3) -/* 80332644 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexCoordScale__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexCoordScale__18J3DMaterialFactoryCFii.s deleted file mode 100644 index 4d0a7ed274b..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexCoordScale__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,20 +0,0 @@ -lbl_80332648: -/* 80332648 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8033264C 80 E2 C9 DC */ lwz r7, j3dDefaultIndTexCoordScaleInfo(r2) -/* 80332650 90 E1 00 08 */ stw r7, 8(r1) -/* 80332654 80 84 00 0C */ lwz r4, 0xc(r4) -/* 80332658 1C 05 01 38 */ mulli r0, r5, 0x138 -/* 8033265C 7C A4 02 14 */ add r5, r4, r0 -/* 80332660 88 05 00 00 */ lbz r0, 0(r5) -/* 80332664 28 00 00 01 */ cmplwi r0, 1 -/* 80332668 40 82 00 18 */ bne lbl_80332680 -/* 8033266C 54 C4 10 3A */ slwi r4, r6, 2 -/* 80332670 38 04 00 68 */ addi r0, r4, 0x68 -/* 80332674 7C 05 00 2E */ lwzx r0, r5, r0 -/* 80332678 90 03 00 00 */ stw r0, 0(r3) -/* 8033267C 48 00 00 08 */ b lbl_80332684 -lbl_80332680: -/* 80332680 90 E3 00 00 */ stw r7, 0(r3) -lbl_80332684: -/* 80332684 38 21 00 10 */ addi r1, r1, 0x10 -/* 80332688 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexMtx__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexMtx__18J3DMaterialFactoryCFii.s deleted file mode 100644 index 661cb05518a..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexMtx__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,46 +0,0 @@ -lbl_8033240C: -/* 8033240C 94 21 FF C0 */ stwu r1, -0x40(r1) -/* 80332410 7C 08 02 A6 */ mflr r0 -/* 80332414 90 01 00 44 */ stw r0, 0x44(r1) -/* 80332418 39 61 00 40 */ addi r11, r1, 0x40 -/* 8033241C 48 02 FD BD */ bl _savegpr_28 -/* 80332420 7C 7C 1B 78 */ mr r28, r3 -/* 80332424 7C 9D 23 78 */ mr r29, r4 -/* 80332428 7C BE 2B 78 */ mr r30, r5 -/* 8033242C 7C DF 33 78 */ mr r31, r6 -/* 80332430 38 61 00 08 */ addi r3, r1, 8 -/* 80332434 3C 80 80 3A */ lis r4, j3dDefaultIndTexMtxInfo@ha /* 0x803A1F80@ha */ -/* 80332438 38 84 1F 80 */ addi r4, r4, j3dDefaultIndTexMtxInfo@l /* 0x803A1F80@l */ -/* 8033243C 4B FF 33 A1 */ bl __as__16J3DIndTexMtxInfoFRC16J3DIndTexMtxInfo -/* 80332440 80 7D 00 0C */ lwz r3, 0xc(r29) -/* 80332444 1C 1E 01 38 */ mulli r0, r30, 0x138 -/* 80332448 7C A3 02 14 */ add r5, r3, r0 -/* 8033244C 88 05 00 00 */ lbz r0, 0(r5) -/* 80332450 28 00 00 01 */ cmplwi r0, 1 -/* 80332454 40 82 00 1C */ bne lbl_80332470 -/* 80332458 7F 83 E3 78 */ mr r3, r28 -/* 8033245C 1C 9F 00 1C */ mulli r4, r31, 0x1c -/* 80332460 38 84 00 14 */ addi r4, r4, 0x14 -/* 80332464 7C 85 22 14 */ add r4, r5, r4 -/* 80332468 4B FF 33 75 */ bl __as__16J3DIndTexMtxInfoFRC16J3DIndTexMtxInfo -/* 8033246C 48 00 00 30 */ b lbl_8033249C -lbl_80332470: -/* 80332470 38 BC FF FC */ addi r5, r28, -4 -/* 80332474 38 81 00 04 */ addi r4, r1, 4 -/* 80332478 38 00 00 03 */ li r0, 3 -/* 8033247C 7C 09 03 A6 */ mtctr r0 -lbl_80332480: -/* 80332480 80 64 00 04 */ lwz r3, 4(r4) -/* 80332484 84 04 00 08 */ lwzu r0, 8(r4) -/* 80332488 90 65 00 04 */ stw r3, 4(r5) -/* 8033248C 94 05 00 08 */ stwu r0, 8(r5) -/* 80332490 42 00 FF F0 */ bdnz lbl_80332480 -/* 80332494 80 04 00 04 */ lwz r0, 4(r4) -/* 80332498 90 05 00 04 */ stw r0, 4(r5) -lbl_8033249C: -/* 8033249C 39 61 00 40 */ addi r11, r1, 0x40 -/* 803324A0 48 02 FD 85 */ bl _restgpr_28 -/* 803324A4 80 01 00 44 */ lwz r0, 0x44(r1) -/* 803324A8 7C 08 03 A6 */ mtlr r0 -/* 803324AC 38 21 00 40 */ addi r1, r1, 0x40 -/* 803324B0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexOrder__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexOrder__18J3DMaterialFactoryCFii.s deleted file mode 100644 index c97e50899d4..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexOrder__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,20 +0,0 @@ -lbl_803323C8: -/* 803323C8 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 803323CC 80 E2 C9 D0 */ lwz r7, j3dDefaultIndTexOrderNull(r2) -/* 803323D0 90 E1 00 08 */ stw r7, 8(r1) -/* 803323D4 80 84 00 0C */ lwz r4, 0xc(r4) -/* 803323D8 1C 05 01 38 */ mulli r0, r5, 0x138 -/* 803323DC 7C A4 02 14 */ add r5, r4, r0 -/* 803323E0 88 05 00 00 */ lbz r0, 0(r5) -/* 803323E4 28 00 00 01 */ cmplwi r0, 1 -/* 803323E8 40 82 00 18 */ bne lbl_80332400 -/* 803323EC 54 C4 10 3A */ slwi r4, r6, 2 -/* 803323F0 38 04 00 04 */ addi r0, r4, 4 -/* 803323F4 7C 05 00 2E */ lwzx r0, r5, r0 -/* 803323F8 90 03 00 00 */ stw r0, 0(r3) -/* 803323FC 48 00 00 08 */ b lbl_80332404 -lbl_80332400: -/* 80332400 90 E3 00 00 */ stw r7, 0(r3) -lbl_80332404: -/* 80332404 38 21 00 10 */ addi r1, r1, 0x10 -/* 80332408 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexStageNum__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexStageNum__18J3DMaterialFactoryCFi.s deleted file mode 100644 index cfe8ca4e235..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexStageNum__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,12 +0,0 @@ -lbl_803323A0: -/* 803323A0 80 A3 00 0C */ lwz r5, 0xc(r3) -/* 803323A4 1C 64 01 38 */ mulli r3, r4, 0x138 -/* 803323A8 7C 05 18 AE */ lbzx r0, r5, r3 -/* 803323AC 28 00 00 01 */ cmplwi r0, 1 -/* 803323B0 40 82 00 10 */ bne lbl_803323C0 -/* 803323B4 7C 65 1A 14 */ add r3, r5, r3 -/* 803323B8 88 63 00 01 */ lbz r3, 1(r3) -/* 803323BC 4E 80 00 20 */ blr -lbl_803323C0: -/* 803323C0 38 60 00 00 */ li r3, 0 -/* 803323C4 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newNBTScale__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newNBTScale__18J3DMaterialFactoryCFi.s deleted file mode 100644 index fbd4cb8b40b..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newNBTScale__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,44 +0,0 @@ -lbl_803328FC: -/* 803328FC 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80332900 3C C0 80 3A */ lis r6, j3dDefaultNBTScaleInfo@ha /* 0x803A1FE8@ha */ -/* 80332904 8C 06 1F E8 */ lbzu r0, j3dDefaultNBTScaleInfo@l(r6) /* 0x803A1FE8@l */ -/* 80332908 98 01 00 08 */ stb r0, 8(r1) -/* 8033290C C0 06 00 04 */ lfs f0, 4(r6) -/* 80332910 D0 01 00 0C */ stfs f0, 0xc(r1) -/* 80332914 C0 06 00 08 */ lfs f0, 8(r6) -/* 80332918 D0 01 00 10 */ stfs f0, 0x10(r1) -/* 8033291C C0 06 00 0C */ lfs f0, 0xc(r6) -/* 80332920 D0 01 00 14 */ stfs f0, 0x14(r1) -/* 80332924 80 E4 00 04 */ lwz r7, 4(r4) -/* 80332928 80 C4 00 08 */ lwz r6, 8(r4) -/* 8033292C 54 A0 08 3C */ slwi r0, r5, 1 -/* 80332930 7C 06 02 2E */ lhzx r0, r6, r0 -/* 80332934 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80332938 7C A7 02 14 */ add r5, r7, r0 -/* 8033293C A0 05 01 4A */ lhz r0, 0x14a(r5) -/* 80332940 28 00 FF FF */ cmplwi r0, 0xffff -/* 80332944 41 82 00 34 */ beq lbl_80332978 -/* 80332948 80 84 00 74 */ lwz r4, 0x74(r4) -/* 8033294C 54 00 23 36 */ rlwinm r0, r0, 4, 0xc, 0x1b -/* 80332950 7C 84 02 14 */ add r4, r4, r0 -/* 80332954 88 04 00 00 */ lbz r0, 0(r4) -/* 80332958 98 03 00 00 */ stb r0, 0(r3) -/* 8033295C C0 04 00 04 */ lfs f0, 4(r4) -/* 80332960 D0 03 00 04 */ stfs f0, 4(r3) -/* 80332964 C0 04 00 08 */ lfs f0, 8(r4) -/* 80332968 D0 03 00 08 */ stfs f0, 8(r3) -/* 8033296C C0 04 00 0C */ lfs f0, 0xc(r4) -/* 80332970 D0 03 00 0C */ stfs f0, 0xc(r3) -/* 80332974 48 00 00 24 */ b lbl_80332998 -lbl_80332978: -/* 80332978 80 81 00 08 */ lwz r4, 8(r1) -/* 8033297C 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80332980 90 83 00 00 */ stw r4, 0(r3) -/* 80332984 90 03 00 04 */ stw r0, 4(r3) -/* 80332988 80 81 00 10 */ lwz r4, 0x10(r1) -/* 8033298C 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80332990 90 83 00 08 */ stw r4, 8(r3) -/* 80332994 90 03 00 0C */ stw r0, 0xc(r3) -lbl_80332998: -/* 80332998 38 21 00 20 */ addi r1, r1, 0x20 -/* 8033299C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevColor__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevColor__18J3DMaterialFactoryCFii.s deleted file mode 100644 index 86f0bcee64d..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevColor__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,31 +0,0 @@ -lbl_803321A0: -/* 803321A0 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 803321A4 81 42 D1 B8 */ lwz r10, lit_1897(r2) -/* 803321A8 81 22 D1 BC */ lwz r9, data_80456BBC(r2) -/* 803321AC 91 41 00 08 */ stw r10, 8(r1) -/* 803321B0 91 21 00 0C */ stw r9, 0xc(r1) -/* 803321B4 81 04 00 04 */ lwz r8, 4(r4) -/* 803321B8 80 E4 00 08 */ lwz r7, 8(r4) -/* 803321BC 54 A0 08 3C */ slwi r0, r5, 1 -/* 803321C0 7C 07 02 2E */ lhzx r0, r7, r0 -/* 803321C4 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 803321C8 7C A8 02 14 */ add r5, r8, r0 -/* 803321CC 54 C0 08 3C */ slwi r0, r6, 1 -/* 803321D0 7C A5 02 14 */ add r5, r5, r0 -/* 803321D4 A0 05 00 DC */ lhz r0, 0xdc(r5) -/* 803321D8 28 00 FF FF */ cmplwi r0, 0xffff -/* 803321DC 41 82 00 24 */ beq lbl_80332200 -/* 803321E0 80 84 00 44 */ lwz r4, 0x44(r4) -/* 803321E4 54 00 1B 78 */ rlwinm r0, r0, 3, 0xd, 0x1c -/* 803321E8 7C A4 02 14 */ add r5, r4, r0 -/* 803321EC 80 85 00 00 */ lwz r4, 0(r5) -/* 803321F0 80 05 00 04 */ lwz r0, 4(r5) -/* 803321F4 90 83 00 00 */ stw r4, 0(r3) -/* 803321F8 90 03 00 04 */ stw r0, 4(r3) -/* 803321FC 48 00 00 0C */ b lbl_80332208 -lbl_80332200: -/* 80332200 91 43 00 00 */ stw r10, 0(r3) -/* 80332204 91 23 00 04 */ stw r9, 4(r3) -lbl_80332208: -/* 80332208 38 21 00 10 */ addi r1, r1, 0x10 -/* 8033220C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevOrder__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevOrder__18J3DMaterialFactoryCFii.s deleted file mode 100644 index ef55380b063..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevOrder__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,21 +0,0 @@ -lbl_80332154: -/* 80332154 81 04 00 04 */ lwz r8, 4(r4) -/* 80332158 80 E4 00 08 */ lwz r7, 8(r4) -/* 8033215C 54 A0 08 3C */ slwi r0, r5, 1 -/* 80332160 7C 07 02 2E */ lhzx r0, r7, r0 -/* 80332164 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80332168 7C A8 02 14 */ add r5, r8, r0 -/* 8033216C 54 C0 08 3C */ slwi r0, r6, 1 -/* 80332170 7C A5 02 14 */ add r5, r5, r0 -/* 80332174 A0 05 00 BC */ lhz r0, 0xbc(r5) -/* 80332178 28 00 FF FF */ cmplwi r0, 0xffff -/* 8033217C 41 82 00 18 */ beq lbl_80332194 -/* 80332180 80 84 00 40 */ lwz r4, 0x40(r4) -/* 80332184 54 00 13 BA */ rlwinm r0, r0, 2, 0xe, 0x1d -/* 80332188 7C 04 00 2E */ lwzx r0, r4, r0 -/* 8033218C 90 03 00 00 */ stw r0, 0(r3) -/* 80332190 4E 80 00 20 */ blr -lbl_80332194: -/* 80332194 80 02 C9 CC */ lwz r0, j3dDefaultTevOrderInfoNull(r2) -/* 80332198 90 03 00 00 */ stw r0, 0(r3) -/* 8033219C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevStageNum__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevStageNum__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 92a29cf3f43..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevStageNum__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_8033226C: -/* 8033226C 80 C3 00 04 */ lwz r6, 4(r3) -/* 80332270 80 A3 00 08 */ lwz r5, 8(r3) -/* 80332274 54 80 08 3C */ slwi r0, r4, 1 -/* 80332278 7C 05 02 2E */ lhzx r0, r5, r0 -/* 8033227C 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80332280 7C 86 02 14 */ add r4, r6, r0 -/* 80332284 88 04 00 04 */ lbz r0, 4(r4) -/* 80332288 28 00 00 FF */ cmplwi r0, 0xff -/* 8033228C 41 82 00 10 */ beq lbl_8033229C -/* 80332290 80 63 00 4C */ lwz r3, 0x4c(r3) -/* 80332294 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80332298 4E 80 00 20 */ blr -lbl_8033229C: -/* 8033229C 38 60 00 FF */ li r3, 0xff -/* 803322A0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevStage__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevStage__18J3DMaterialFactoryCFii.s deleted file mode 100644 index 805e07fd9ad..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevStage__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,27 +0,0 @@ -lbl_803322A4: -/* 803322A4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 803322A8 7C 08 02 A6 */ mflr r0 -/* 803322AC 90 01 00 14 */ stw r0, 0x14(r1) -/* 803322B0 81 04 00 04 */ lwz r8, 4(r4) -/* 803322B4 80 E4 00 08 */ lwz r7, 8(r4) -/* 803322B8 54 A0 08 3C */ slwi r0, r5, 1 -/* 803322BC 7C 07 02 2E */ lhzx r0, r7, r0 -/* 803322C0 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 803322C4 7C A8 02 14 */ add r5, r8, r0 -/* 803322C8 54 C0 08 3C */ slwi r0, r6, 1 -/* 803322CC 7C A5 02 14 */ add r5, r5, r0 -/* 803322D0 A0 05 00 E4 */ lhz r0, 0xe4(r5) -/* 803322D4 28 00 FF FF */ cmplwi r0, 0xffff -/* 803322D8 41 82 00 18 */ beq lbl_803322F0 -/* 803322DC 80 84 00 50 */ lwz r4, 0x50(r4) -/* 803322E0 1C 00 00 14 */ mulli r0, r0, 0x14 -/* 803322E4 7C 84 02 14 */ add r4, r4, r0 -/* 803322E8 4B D0 87 E5 */ bl __ct__11J3DTevStageFRC15J3DTevStageInfo -/* 803322EC 48 00 00 08 */ b lbl_803322F4 -lbl_803322F0: -/* 803322F0 4B CD BF 41 */ bl __ct__11J3DTevStageFv -lbl_803322F4: -/* 803322F4 80 01 00 14 */ lwz r0, 0x14(r1) -/* 803322F8 7C 08 03 A6 */ mtlr r0 -/* 803322FC 38 21 00 10 */ addi r1, r1, 0x10 -/* 80332300 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexCoord__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexCoord__18J3DMaterialFactoryCFii.s deleted file mode 100644 index ca6b09584b4..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexCoord__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,26 +0,0 @@ -lbl_80331FE4: -/* 80331FE4 81 04 00 04 */ lwz r8, 4(r4) -/* 80331FE8 80 E4 00 08 */ lwz r7, 8(r4) -/* 80331FEC 54 A0 08 3C */ slwi r0, r5, 1 -/* 80331FF0 7C 07 02 2E */ lhzx r0, r7, r0 -/* 80331FF4 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80331FF8 7C A8 02 14 */ add r5, r8, r0 -/* 80331FFC 54 C0 08 3C */ slwi r0, r6, 1 -/* 80332000 7C A5 02 14 */ add r5, r5, r0 -/* 80332004 A0 05 00 28 */ lhz r0, 0x28(r5) -/* 80332008 28 00 FF FF */ cmplwi r0, 0xffff -/* 8033200C 41 82 00 20 */ beq lbl_8033202C -/* 80332010 80 84 00 28 */ lwz r4, 0x28(r4) -/* 80332014 54 00 13 BA */ rlwinm r0, r0, 2, 0xe, 0x1d -/* 80332018 7C 04 00 2E */ lwzx r0, r4, r0 -/* 8033201C 90 03 00 00 */ stw r0, 0(r3) -/* 80332020 88 03 00 02 */ lbz r0, 2(r3) -/* 80332024 B0 03 00 04 */ sth r0, 4(r3) -/* 80332028 4E 80 00 20 */ blr -lbl_8033202C: -/* 8033202C 3C 80 80 3A */ lis r4, j3dDefaultTexCoordInfo@ha /* 0x803A1EFC@ha */ -/* 80332030 80 04 1E FC */ lwz r0, j3dDefaultTexCoordInfo@l(r4) /* 0x803A1EFC@l */ -/* 80332034 90 03 00 00 */ stw r0, 0(r3) -/* 80332038 88 03 00 02 */ lbz r0, 2(r3) -/* 8033203C B0 03 00 04 */ sth r0, 4(r3) -/* 80332040 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexGenNum__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexGenNum__18J3DMaterialFactoryCFi.s deleted file mode 100644 index ce4edeedb64..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexGenNum__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80331FAC: -/* 80331FAC 80 C3 00 04 */ lwz r6, 4(r3) -/* 80331FB0 80 A3 00 08 */ lwz r5, 8(r3) -/* 80331FB4 54 80 08 3C */ slwi r0, r4, 1 -/* 80331FB8 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80331FBC 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80331FC0 7C 86 02 14 */ add r4, r6, r0 -/* 80331FC4 88 04 00 03 */ lbz r0, 3(r4) -/* 80331FC8 28 00 00 FF */ cmplwi r0, 0xff -/* 80331FCC 41 82 00 10 */ beq lbl_80331FDC -/* 80331FD0 80 63 00 24 */ lwz r3, 0x24(r3) -/* 80331FD4 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80331FD8 4E 80 00 20 */ blr -lbl_80331FDC: -/* 80331FDC 38 60 00 00 */ li r3, 0 -/* 80331FE0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexMtx__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexMtx__18J3DMaterialFactoryCFii.s deleted file mode 100644 index ace0130211c..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexMtx__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,37 +0,0 @@ -lbl_80332044: -/* 80332044 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80332048 7C 08 02 A6 */ mflr r0 -/* 8033204C 90 01 00 24 */ stw r0, 0x24(r1) -/* 80332050 39 61 00 20 */ addi r11, r1, 0x20 -/* 80332054 48 03 01 89 */ bl _savegpr_29 -/* 80332058 7C 7D 1B 78 */ mr r29, r3 -/* 8033205C 38 60 00 00 */ li r3, 0 -/* 80332060 80 FD 00 04 */ lwz r7, 4(r29) -/* 80332064 80 DD 00 08 */ lwz r6, 8(r29) -/* 80332068 54 80 08 3C */ slwi r0, r4, 1 -/* 8033206C 7C 06 02 2E */ lhzx r0, r6, r0 -/* 80332070 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80332074 7C 87 02 14 */ add r4, r7, r0 -/* 80332078 54 A0 08 3C */ slwi r0, r5, 1 -/* 8033207C 7F C4 02 14 */ add r30, r4, r0 -/* 80332080 A0 1E 00 48 */ lhz r0, 0x48(r30) -/* 80332084 28 00 FF FF */ cmplwi r0, 0xffff -/* 80332088 41 82 00 2C */ beq lbl_803320B4 -/* 8033208C 38 60 00 94 */ li r3, 0x94 -/* 80332090 4B F9 CB BD */ bl __nw__FUl -/* 80332094 7C 7F 1B 79 */ or. r31, r3, r3 -/* 80332098 41 82 00 18 */ beq lbl_803320B0 -/* 8033209C 80 9D 00 30 */ lwz r4, 0x30(r29) -/* 803320A0 A0 1E 00 48 */ lhz r0, 0x48(r30) -/* 803320A4 1C 00 00 64 */ mulli r0, r0, 0x64 -/* 803320A8 7C 84 02 14 */ add r4, r4, r0 -/* 803320AC 4B FF 36 6D */ bl __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo -lbl_803320B0: -/* 803320B0 7F E3 FB 78 */ mr r3, r31 -lbl_803320B4: -/* 803320B4 39 61 00 20 */ addi r11, r1, 0x20 -/* 803320B8 48 03 01 71 */ bl _restgpr_29 -/* 803320BC 80 01 00 24 */ lwz r0, 0x24(r1) -/* 803320C0 7C 08 03 A6 */ mtlr r0 -/* 803320C4 38 21 00 20 */ addi r1, r1, 0x20 -/* 803320C8 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexNo__18J3DMaterialFactoryCFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexNo__18J3DMaterialFactoryCFii.s deleted file mode 100644 index 6120bdca801..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexNo__18J3DMaterialFactoryCFii.s +++ /dev/null @@ -1,20 +0,0 @@ -lbl_8033210C: -/* 8033210C 80 E3 00 04 */ lwz r7, 4(r3) -/* 80332110 80 C3 00 08 */ lwz r6, 8(r3) -/* 80332114 54 80 08 3C */ slwi r0, r4, 1 -/* 80332118 7C 06 02 2E */ lhzx r0, r6, r0 -/* 8033211C 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80332120 7C 87 02 14 */ add r4, r7, r0 -/* 80332124 54 A0 08 3C */ slwi r0, r5, 1 -/* 80332128 7C 84 02 14 */ add r4, r4, r0 -/* 8033212C A0 04 00 84 */ lhz r0, 0x84(r4) -/* 80332130 28 00 FF FF */ cmplwi r0, 0xffff -/* 80332134 41 82 00 14 */ beq lbl_80332148 -/* 80332138 80 63 00 38 */ lwz r3, 0x38(r3) -/* 8033213C 54 00 0B FC */ rlwinm r0, r0, 1, 0xf, 0x1e -/* 80332140 7C 63 02 2E */ lhzx r3, r3, r0 -/* 80332144 4E 80 00 20 */ blr -lbl_80332148: -/* 80332148 3C 60 00 01 */ lis r3, 0x0001 /* 0x0000FFFF@ha */ -/* 8033214C 38 63 FF FF */ addi r3, r3, 0xFFFF /* 0x0000FFFF@l */ -/* 80332150 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newZCompLoc__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newZCompLoc__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 088e252df52..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newZCompLoc__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_8033288C: -/* 8033288C 80 C3 00 04 */ lwz r6, 4(r3) -/* 80332890 80 A3 00 08 */ lwz r5, 8(r3) -/* 80332894 54 80 08 3C */ slwi r0, r4, 1 -/* 80332898 7C 05 02 2E */ lhzx r0, r5, r0 -/* 8033289C 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 803328A0 7C 86 02 14 */ add r4, r6, r0 -/* 803328A4 88 04 00 05 */ lbz r0, 5(r4) -/* 803328A8 28 00 00 FF */ cmplwi r0, 0xff -/* 803328AC 41 82 00 10 */ beq lbl_803328BC -/* 803328B0 80 63 00 6C */ lwz r3, 0x6c(r3) -/* 803328B4 7C 63 00 AE */ lbzx r3, r3, r0 -/* 803328B8 4E 80 00 20 */ blr -lbl_803328BC: -/* 803328BC 38 60 00 00 */ li r3, 0 -/* 803328C0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newZMode__18J3DMaterialFactoryCFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newZMode__18J3DMaterialFactoryCFi.s deleted file mode 100644 index 3d5af178f34..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newZMode__18J3DMaterialFactoryCFi.s +++ /dev/null @@ -1,26 +0,0 @@ -lbl_8033282C: -/* 8033282C 80 E4 00 04 */ lwz r7, 4(r4) -/* 80332830 80 C4 00 08 */ lwz r6, 8(r4) -/* 80332834 54 A0 08 3C */ slwi r0, r5, 1 -/* 80332838 7C 06 02 2E */ lhzx r0, r6, r0 -/* 8033283C 1C 00 01 4C */ mulli r0, r0, 0x14c -/* 80332840 7C A7 02 14 */ add r5, r7, r0 -/* 80332844 88 05 00 06 */ lbz r0, 6(r5) -/* 80332848 28 00 00 FF */ cmplwi r0, 0xff -/* 8033284C 41 82 00 34 */ beq lbl_80332880 -/* 80332850 80 84 00 68 */ lwz r4, 0x68(r4) -/* 80332854 54 00 15 BA */ rlwinm r0, r0, 2, 0x16, 0x1d -/* 80332858 7C 84 02 14 */ add r4, r4, r0 -/* 8033285C 88 C4 00 00 */ lbz r6, 0(r4) -/* 80332860 88 A4 00 02 */ lbz r5, 2(r4) -/* 80332864 88 04 00 01 */ lbz r0, 1(r4) -/* 80332868 54 04 0D FC */ rlwinm r4, r0, 1, 0x17, 0x1e -/* 8033286C 54 C0 20 36 */ slwi r0, r6, 4 -/* 80332870 7C 00 2A 14 */ add r0, r0, r5 -/* 80332874 7C 04 02 14 */ add r0, r4, r0 -/* 80332878 B0 03 00 00 */ sth r0, 0(r3) -/* 8033287C 4E 80 00 20 */ blr -lbl_80332880: -/* 80332880 A0 02 C9 FC */ lhz r0, j3dDefaultZModeID(r2) -/* 80332884 B0 03 00 00 */ sth r0, 0(r3) -/* 80332888 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/__ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/__ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21.s deleted file mode 100644 index 4e96b8e1b70..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/__ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21.s +++ /dev/null @@ -1,121 +0,0 @@ -lbl_80332DA4: -/* 80332DA4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80332DA8 7C 08 02 A6 */ mflr r0 -/* 80332DAC 90 01 00 14 */ stw r0, 0x14(r1) -/* 80332DB0 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80332DB4 93 C1 00 08 */ stw r30, 8(r1) -/* 80332DB8 7C 7E 1B 78 */ mr r30, r3 -/* 80332DBC 7C 9F 23 78 */ mr r31, r4 -/* 80332DC0 A0 04 00 08 */ lhz r0, 8(r4) -/* 80332DC4 B0 03 00 00 */ sth r0, 0(r3) -/* 80332DC8 7F E3 FB 78 */ mr r3, r31 -/* 80332DCC 80 84 00 0C */ lwz r4, 0xc(r4) -/* 80332DD0 48 00 13 49 */ bl func_80334118 -/* 80332DD4 90 7E 00 04 */ stw r3, 4(r30) -/* 80332DD8 7F E3 FB 78 */ mr r3, r31 -/* 80332DDC 80 9F 00 10 */ lwz r4, 0x10(r31) -/* 80332DE0 4B FC 14 E1 */ bl func_802F42C0 -/* 80332DE4 90 7E 00 08 */ stw r3, 8(r30) -/* 80332DE8 7F E3 FB 78 */ mr r3, r31 -/* 80332DEC 80 9F 00 18 */ lwz r4, 0x18(r31) -/* 80332DF0 4B FC 14 A1 */ bl func_802F4290 -/* 80332DF4 90 7E 00 30 */ stw r3, 0x30(r30) -/* 80332DF8 7F E3 FB 78 */ mr r3, r31 -/* 80332DFC 80 9F 00 1C */ lwz r4, 0x1c(r31) -/* 80332E00 4B FC 14 79 */ bl func_802F4278 -/* 80332E04 90 7E 00 0C */ stw r3, 0xc(r30) -/* 80332E08 7F E3 FB 78 */ mr r3, r31 -/* 80332E0C 80 9F 00 20 */ lwz r4, 0x20(r31) -/* 80332E10 4B FC 14 51 */ bl func_802F4260 -/* 80332E14 90 7E 00 10 */ stw r3, 0x10(r30) -/* 80332E18 7F E3 FB 78 */ mr r3, r31 -/* 80332E1C 80 9F 00 24 */ lwz r4, 0x24(r31) -/* 80332E20 4B FF FF 3D */ bl func_80332D5C -/* 80332E24 90 7E 00 14 */ stw r3, 0x14(r30) -/* 80332E28 7F E3 FB 78 */ mr r3, r31 -/* 80332E2C 80 9F 00 28 */ lwz r4, 0x28(r31) -/* 80332E30 4B FC 14 31 */ bl func_802F4260 -/* 80332E34 90 7E 00 18 */ stw r3, 0x18(r30) -/* 80332E38 7F E3 FB 78 */ mr r3, r31 -/* 80332E3C 80 9F 00 2C */ lwz r4, 0x2c(r31) -/* 80332E40 4B FF FE ED */ bl func_80332D2C -/* 80332E44 90 7E 00 1C */ stw r3, 0x1c(r30) -/* 80332E48 7F E3 FB 78 */ mr r3, r31 -/* 80332E4C 80 9F 00 30 */ lwz r4, 0x30(r31) -/* 80332E50 4B FF FE C5 */ bl func_80332D14 -/* 80332E54 90 7E 00 20 */ stw r3, 0x20(r30) -/* 80332E58 7F E3 FB 78 */ mr r3, r31 -/* 80332E5C 80 9F 00 34 */ lwz r4, 0x34(r31) -/* 80332E60 4B FF FE 9D */ bl func_80332CFC -/* 80332E64 90 7E 00 24 */ stw r3, 0x24(r30) -/* 80332E68 7F E3 FB 78 */ mr r3, r31 -/* 80332E6C 80 9F 00 38 */ lwz r4, 0x38(r31) -/* 80332E70 4B FF FE 8D */ bl func_80332CFC -/* 80332E74 90 7E 00 28 */ stw r3, 0x28(r30) -/* 80332E78 7F E3 FB 78 */ mr r3, r31 -/* 80332E7C 80 9F 00 3C */ lwz r4, 0x3c(r31) -/* 80332E80 4B FC 14 41 */ bl func_802F42C0 -/* 80332E84 90 7E 00 2C */ stw r3, 0x2c(r30) -/* 80332E88 7F E3 FB 78 */ mr r3, r31 -/* 80332E8C 80 9F 00 40 */ lwz r4, 0x40(r31) -/* 80332E90 4B FF FE 55 */ bl func_80332CE4 -/* 80332E94 90 7E 00 34 */ stw r3, 0x34(r30) -/* 80332E98 7F E3 FB 78 */ mr r3, r31 -/* 80332E9C 80 9F 00 44 */ lwz r4, 0x44(r31) -/* 80332EA0 4B FC 13 49 */ bl func_802F41E8 -/* 80332EA4 90 7E 00 38 */ stw r3, 0x38(r30) -/* 80332EA8 7F E3 FB 78 */ mr r3, r31 -/* 80332EAC 80 9F 00 48 */ lwz r4, 0x48(r31) -/* 80332EB0 4B FC 13 C9 */ bl func_802F4278 -/* 80332EB4 90 7E 00 3C */ stw r3, 0x3c(r30) -/* 80332EB8 7F E3 FB 78 */ mr r3, r31 -/* 80332EBC 80 9F 00 4C */ lwz r4, 0x4c(r31) -/* 80332EC0 4B FC 13 A1 */ bl func_802F4260 -/* 80332EC4 90 7E 00 40 */ stw r3, 0x40(r30) -/* 80332EC8 7F E3 FB 78 */ mr r3, r31 -/* 80332ECC 80 9F 00 50 */ lwz r4, 0x50(r31) -/* 80332ED0 4B FF FD FD */ bl func_80332CCC -/* 80332ED4 90 7E 00 44 */ stw r3, 0x44(r30) -/* 80332ED8 7F E3 FB 78 */ mr r3, r31 -/* 80332EDC 80 9F 00 54 */ lwz r4, 0x54(r31) -/* 80332EE0 4B FF FD D5 */ bl func_80332CB4 -/* 80332EE4 90 7E 00 48 */ stw r3, 0x48(r30) -/* 80332EE8 7F E3 FB 78 */ mr r3, r31 -/* 80332EEC 80 9F 00 58 */ lwz r4, 0x58(r31) -/* 80332EF0 4B FF FD AD */ bl func_80332C9C -/* 80332EF4 90 7E 00 4C */ stw r3, 0x4c(r30) -/* 80332EF8 7F E3 FB 78 */ mr r3, r31 -/* 80332EFC 80 9F 00 5C */ lwz r4, 0x5c(r31) -/* 80332F00 4B FF FD 85 */ bl func_80332C84 -/* 80332F04 90 7E 00 50 */ stw r3, 0x50(r30) -/* 80332F08 7F E3 FB 78 */ mr r3, r31 -/* 80332F0C 80 9F 00 60 */ lwz r4, 0x60(r31) -/* 80332F10 4B FF FD 5D */ bl func_80332C6C -/* 80332F14 90 7E 00 54 */ stw r3, 0x54(r30) -/* 80332F18 7F E3 FB 78 */ mr r3, r31 -/* 80332F1C 80 9F 00 64 */ lwz r4, 0x64(r31) -/* 80332F20 4B FF FD 35 */ bl func_80332C54 -/* 80332F24 90 7E 00 58 */ stw r3, 0x58(r30) -/* 80332F28 7F E3 FB 78 */ mr r3, r31 -/* 80332F2C 80 9F 00 68 */ lwz r4, 0x68(r31) -/* 80332F30 4B FF FD 0D */ bl func_80332C3C -/* 80332F34 90 7E 00 5C */ stw r3, 0x5c(r30) -/* 80332F38 7F E3 FB 78 */ mr r3, r31 -/* 80332F3C 80 9F 00 6C */ lwz r4, 0x6c(r31) -/* 80332F40 4B FC 13 21 */ bl func_802F4260 -/* 80332F44 90 7E 00 60 */ stw r3, 0x60(r30) -/* 80332F48 7F E3 FB 78 */ mr r3, r31 -/* 80332F4C 80 9F 00 70 */ lwz r4, 0x70(r31) -/* 80332F50 4B FC 13 11 */ bl func_802F4260 -/* 80332F54 90 7E 00 64 */ stw r3, 0x64(r30) -/* 80332F58 7F E3 FB 78 */ mr r3, r31 -/* 80332F5C 80 9F 00 74 */ lwz r4, 0x74(r31) -/* 80332F60 4B FF FC C5 */ bl func_80332C24 -/* 80332F64 90 7E 00 68 */ stw r3, 0x68(r30) -/* 80332F68 7F C3 F3 78 */ mr r3, r30 -/* 80332F6C 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80332F70 83 C1 00 08 */ lwz r30, 8(r1) -/* 80332F74 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80332F78 7C 08 03 A6 */ mtlr r0 -/* 80332F7C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80332F80 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countStages__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countStages__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index f8e6a9c920a..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countStages__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,39 +0,0 @@ -lbl_80332FE0: -/* 80332FE0 80 C3 00 04 */ lwz r6, 4(r3) -/* 80332FE4 80 A3 00 08 */ lwz r5, 8(r3) -/* 80332FE8 54 80 08 3C */ slwi r0, r4, 1 -/* 80332FEC 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80332FF0 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80332FF4 7C 86 02 14 */ add r4, r6, r0 -/* 80332FF8 38 A0 00 00 */ li r5, 0 -/* 80332FFC 38 C0 00 00 */ li r6, 0 -/* 80333000 88 04 00 04 */ lbz r0, 4(r4) -/* 80333004 28 00 00 FF */ cmplwi r0, 0xff -/* 80333008 41 82 00 0C */ beq lbl_80333014 -/* 8033300C 80 63 00 40 */ lwz r3, 0x40(r3) -/* 80333010 7C C3 00 AE */ lbzx r6, r3, r0 -lbl_80333014: -/* 80333014 38 60 00 00 */ li r3, 0 -/* 80333018 38 00 00 08 */ li r0, 8 -/* 8033301C 7C 09 03 A6 */ mtctr r0 -lbl_80333020: -/* 80333020 38 03 00 70 */ addi r0, r3, 0x70 -/* 80333024 7C 04 02 2E */ lhzx r0, r4, r0 -/* 80333028 28 00 FF FF */ cmplwi r0, 0xffff -/* 8033302C 41 82 00 08 */ beq lbl_80333034 -/* 80333030 38 A5 00 01 */ addi r5, r5, 1 -lbl_80333034: -/* 80333034 38 63 00 02 */ addi r3, r3, 2 -/* 80333038 42 00 FF E8 */ bdnz lbl_80333020 -/* 8033303C 7C 06 28 40 */ cmplw r6, r5 -/* 80333040 41 82 00 20 */ beq lbl_80333060 -/* 80333044 28 05 00 00 */ cmplwi r5, 0 -/* 80333048 41 82 00 18 */ beq lbl_80333060 -/* 8033304C 7C 06 28 40 */ cmplw r6, r5 -/* 80333050 7C A3 2B 78 */ mr r3, r5 -/* 80333054 4C 81 00 20 */ blelr -/* 80333058 7C C3 33 78 */ mr r3, r6 -/* 8033305C 4E 80 00 20 */ blr -lbl_80333060: -/* 80333060 7C C3 33 78 */ mr r3, r6 -/* 80333064 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countTexGens__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countTexGens__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index db86236fffa..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countTexGens__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80332FA8: -/* 80332FA8 80 C3 00 04 */ lwz r6, 4(r3) -/* 80332FAC 80 A3 00 08 */ lwz r5, 8(r3) -/* 80332FB0 54 80 08 3C */ slwi r0, r4, 1 -/* 80332FB4 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80332FB8 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80332FBC 7C 86 02 14 */ add r4, r6, r0 -/* 80332FC0 88 04 00 03 */ lbz r0, 3(r4) -/* 80332FC4 28 00 00 FF */ cmplwi r0, 0xff -/* 80332FC8 41 82 00 10 */ beq lbl_80332FD8 -/* 80332FCC 80 63 00 18 */ lwz r3, 0x18(r3) -/* 80332FD0 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80332FD4 4E 80 00 20 */ blr -lbl_80332FD8: -/* 80332FD8 38 60 00 00 */ li r3, 0 -/* 80332FDC 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countUniqueMaterials__22J3DMaterialFactory_v21Fv.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countUniqueMaterials__22J3DMaterialFactory_v21Fv.s deleted file mode 100644 index 39d9567ba46..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countUniqueMaterials__22J3DMaterialFactory_v21Fv.s +++ /dev/null @@ -1,12 +0,0 @@ -lbl_80332F84: -/* 80332F84 38 80 00 00 */ li r4, 0 -/* 80332F88 A0 63 00 00 */ lhz r3, 0(r3) -/* 80332F8C 48 00 00 08 */ b lbl_80332F94 -lbl_80332F90: -/* 80332F90 38 84 00 01 */ addi r4, r4, 1 -lbl_80332F94: -/* 80332F94 54 80 04 3E */ clrlwi r0, r4, 0x10 -/* 80332F98 7C 00 18 40 */ cmplw r0, r3 -/* 80332F9C 41 80 FF F4 */ blt lbl_80332F90 -/* 80332FA0 7C 83 23 78 */ mr r3, r4 -/* 80332FA4 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/func_80334118.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/func_80334118.s deleted file mode 100644 index 21411b59d5d..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/func_80334118.s +++ /dev/null @@ -1,8 +0,0 @@ -lbl_80334118: -/* 80334118 28 04 00 00 */ cmplwi r4, 0 -/* 8033411C 40 82 00 0C */ bne lbl_80334128 -/* 80334120 38 60 00 00 */ li r3, 0 -/* 80334124 4E 80 00 20 */ blr -lbl_80334128: -/* 80334128 7C 63 22 14 */ add r3, r3, r4 -/* 8033412C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newBlend__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newBlend__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index cd8a016c1e4..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newBlend__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,19 +0,0 @@ -lbl_80333F60: -/* 80333F60 80 E4 00 04 */ lwz r7, 4(r4) -/* 80333F64 80 C4 00 08 */ lwz r6, 8(r4) -/* 80333F68 54 A0 08 3C */ slwi r0, r5, 1 -/* 80333F6C 7C 06 02 2E */ lhzx r0, r6, r0 -/* 80333F70 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333F74 7C A7 02 14 */ add r5, r7, r0 -/* 80333F78 A0 05 01 34 */ lhz r0, 0x134(r5) -/* 80333F7C 28 00 FF FF */ cmplwi r0, 0xffff -/* 80333F80 41 82 00 18 */ beq lbl_80333F98 -/* 80333F84 80 84 00 58 */ lwz r4, 0x58(r4) -/* 80333F88 54 00 13 BA */ rlwinm r0, r0, 2, 0xe, 0x1d -/* 80333F8C 7C 04 00 2E */ lwzx r0, r4, r0 -/* 80333F90 90 03 00 00 */ stw r0, 0(r3) -/* 80333F94 4E 80 00 20 */ blr -lbl_80333F98: -/* 80333F98 80 02 C9 EC */ lwz r0, j3dDefaultBlendInfo(r2) -/* 80333F9C 90 03 00 00 */ stw r0, 0(r3) -/* 80333FA0 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newColorChanNum__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newColorChanNum__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index 8f4d0169030..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newColorChanNum__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80333834: -/* 80333834 80 C3 00 04 */ lwz r6, 4(r3) -/* 80333838 80 A3 00 08 */ lwz r5, 8(r3) -/* 8033383C 54 80 08 3C */ slwi r0, r4, 1 -/* 80333840 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80333844 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333848 7C 86 02 14 */ add r4, r6, r0 -/* 8033384C 88 04 00 02 */ lbz r0, 2(r4) -/* 80333850 28 00 00 FF */ cmplwi r0, 0xff -/* 80333854 41 82 00 10 */ beq lbl_80333864 -/* 80333858 80 63 00 10 */ lwz r3, 0x10(r3) -/* 8033385C 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80333860 4E 80 00 20 */ blr -lbl_80333864: -/* 80333864 38 60 00 00 */ li r3, 0 -/* 80333868 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newCullMode__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newCullMode__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index fe2c6ed18b1..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newCullMode__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,18 +0,0 @@ -lbl_80333B30: -/* 80333B30 80 C3 00 04 */ lwz r6, 4(r3) -/* 80333B34 80 A3 00 08 */ lwz r5, 8(r3) -/* 80333B38 54 80 08 3C */ slwi r0, r4, 1 -/* 80333B3C 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80333B40 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333B44 7C 86 02 14 */ add r4, r6, r0 -/* 80333B48 88 04 00 01 */ lbz r0, 1(r4) -/* 80333B4C 28 00 00 FF */ cmplwi r0, 0xff -/* 80333B50 41 82 00 18 */ beq lbl_80333B68 -/* 80333B54 80 63 00 30 */ lwz r3, 0x30(r3) -/* 80333B58 54 00 15 BA */ rlwinm r0, r0, 2, 0x16, 0x1d -/* 80333B5C 7C 03 00 2E */ lwzx r0, r3, r0 -/* 80333B60 54 03 06 3E */ clrlwi r3, r0, 0x18 -/* 80333B64 4E 80 00 20 */ blr -lbl_80333B68: -/* 80333B68 38 60 00 FF */ li r3, 0xff -/* 80333B6C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newDither__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newDither__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index 394b4cf01cd..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newDither__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_8033403C: -/* 8033403C 80 C3 00 04 */ lwz r6, 4(r3) -/* 80334040 80 A3 00 08 */ lwz r5, 8(r3) -/* 80334044 54 80 08 3C */ slwi r0, r4, 1 -/* 80334048 7C 05 02 2E */ lhzx r0, r5, r0 -/* 8033404C 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80334050 7C 86 02 14 */ add r4, r6, r0 -/* 80334054 88 04 00 07 */ lbz r0, 7(r4) -/* 80334058 28 00 00 FF */ cmplwi r0, 0xff -/* 8033405C 41 82 00 10 */ beq lbl_8033406C -/* 80334060 80 63 00 64 */ lwz r3, 0x64(r3) -/* 80334064 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80334068 4E 80 00 20 */ blr -lbl_8033406C: -/* 8033406C 38 60 00 01 */ li r3, 1 -/* 80334070 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newFog__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newFog__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index b37fbc1ddf1..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newFog__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,59 +0,0 @@ -lbl_80333E04: -/* 80333E04 94 21 FF 90 */ stwu r1, -0x70(r1) -/* 80333E08 7C 08 02 A6 */ mflr r0 -/* 80333E0C 90 01 00 74 */ stw r0, 0x74(r1) -/* 80333E10 39 61 00 70 */ addi r11, r1, 0x70 -/* 80333E14 48 02 E3 C9 */ bl _savegpr_29 -/* 80333E18 7C 7F 1B 78 */ mr r31, r3 -/* 80333E1C 7C 9D 23 78 */ mr r29, r4 -/* 80333E20 7C BE 2B 78 */ mr r30, r5 -/* 80333E24 38 61 00 34 */ addi r3, r1, 0x34 -/* 80333E28 3C 80 80 3A */ lis r4, j3dDefaultFogInfo@ha /* 0x803A1FBC@ha */ -/* 80333E2C 38 84 1F BC */ addi r4, r4, j3dDefaultFogInfo@l /* 0x803A1FBC@l */ -/* 80333E30 4B FF 19 D1 */ bl __as__10J3DFogInfoFRC10J3DFogInfo -/* 80333E34 80 9D 00 04 */ lwz r4, 4(r29) -/* 80333E38 80 7D 00 08 */ lwz r3, 8(r29) -/* 80333E3C 57 C0 08 3C */ slwi r0, r30, 1 -/* 80333E40 7C 03 02 2E */ lhzx r0, r3, r0 -/* 80333E44 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333E48 7C 64 02 14 */ add r3, r4, r0 -/* 80333E4C A0 03 01 30 */ lhz r0, 0x130(r3) -/* 80333E50 28 00 FF FF */ cmplwi r0, 0xffff -/* 80333E54 41 82 00 48 */ beq lbl_80333E9C -/* 80333E58 80 7D 00 50 */ lwz r3, 0x50(r29) -/* 80333E5C 1C 00 00 2C */ mulli r0, r0, 0x2c -/* 80333E60 38 A1 00 04 */ addi r5, r1, 4 -/* 80333E64 7C 83 02 14 */ add r4, r3, r0 -/* 80333E68 38 00 00 05 */ li r0, 5 -/* 80333E6C 7C 09 03 A6 */ mtctr r0 -/* 80333E70 38 84 FF FC */ addi r4, r4, -4 -lbl_80333E74: -/* 80333E74 80 64 00 04 */ lwz r3, 4(r4) -/* 80333E78 84 04 00 08 */ lwzu r0, 8(r4) -/* 80333E7C 90 65 00 04 */ stw r3, 4(r5) -/* 80333E80 94 05 00 08 */ stwu r0, 8(r5) -/* 80333E84 42 00 FF F0 */ bdnz lbl_80333E74 -/* 80333E88 80 04 00 04 */ lwz r0, 4(r4) -/* 80333E8C 90 05 00 04 */ stw r0, 4(r5) -/* 80333E90 38 61 00 34 */ addi r3, r1, 0x34 -/* 80333E94 38 81 00 08 */ addi r4, r1, 8 -/* 80333E98 4B FF 19 69 */ bl __as__10J3DFogInfoFRC10J3DFogInfo -lbl_80333E9C: -/* 80333E9C 38 BF FF FC */ addi r5, r31, -4 -/* 80333EA0 38 81 00 30 */ addi r4, r1, 0x30 -/* 80333EA4 38 00 00 05 */ li r0, 5 -/* 80333EA8 7C 09 03 A6 */ mtctr r0 -lbl_80333EAC: -/* 80333EAC 80 64 00 04 */ lwz r3, 4(r4) -/* 80333EB0 84 04 00 08 */ lwzu r0, 8(r4) -/* 80333EB4 90 65 00 04 */ stw r3, 4(r5) -/* 80333EB8 94 05 00 08 */ stwu r0, 8(r5) -/* 80333EBC 42 00 FF F0 */ bdnz lbl_80333EAC -/* 80333EC0 80 04 00 04 */ lwz r0, 4(r4) -/* 80333EC4 90 05 00 04 */ stw r0, 4(r5) -/* 80333EC8 39 61 00 70 */ addi r11, r1, 0x70 -/* 80333ECC 48 02 E3 5D */ bl _restgpr_29 -/* 80333ED0 80 01 00 74 */ lwz r0, 0x74(r1) -/* 80333ED4 7C 08 03 A6 */ mtlr r0 -/* 80333ED8 38 21 00 70 */ addi r1, r1, 0x70 -/* 80333EDC 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newNBTScale__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newNBTScale__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index b8054a5785b..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newNBTScale__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,44 +0,0 @@ -lbl_80334074: -/* 80334074 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80334078 3C C0 80 3A */ lis r6, j3dDefaultNBTScaleInfo@ha /* 0x803A1FE8@ha */ -/* 8033407C 8C 06 1F E8 */ lbzu r0, j3dDefaultNBTScaleInfo@l(r6) /* 0x803A1FE8@l */ -/* 80334080 98 01 00 08 */ stb r0, 8(r1) -/* 80334084 C0 06 00 04 */ lfs f0, 4(r6) -/* 80334088 D0 01 00 0C */ stfs f0, 0xc(r1) -/* 8033408C C0 06 00 08 */ lfs f0, 8(r6) -/* 80334090 D0 01 00 10 */ stfs f0, 0x10(r1) -/* 80334094 C0 06 00 0C */ lfs f0, 0xc(r6) -/* 80334098 D0 01 00 14 */ stfs f0, 0x14(r1) -/* 8033409C 80 E4 00 04 */ lwz r7, 4(r4) -/* 803340A0 80 C4 00 08 */ lwz r6, 8(r4) -/* 803340A4 54 A0 08 3C */ slwi r0, r5, 1 -/* 803340A8 7C 06 02 2E */ lhzx r0, r6, r0 -/* 803340AC 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 803340B0 7C A7 02 14 */ add r5, r7, r0 -/* 803340B4 A0 05 01 36 */ lhz r0, 0x136(r5) -/* 803340B8 28 00 FF FF */ cmplwi r0, 0xffff -/* 803340BC 41 82 00 34 */ beq lbl_803340F0 -/* 803340C0 80 84 00 68 */ lwz r4, 0x68(r4) -/* 803340C4 54 00 23 36 */ rlwinm r0, r0, 4, 0xc, 0x1b -/* 803340C8 7C 84 02 14 */ add r4, r4, r0 -/* 803340CC 88 04 00 00 */ lbz r0, 0(r4) -/* 803340D0 98 03 00 00 */ stb r0, 0(r3) -/* 803340D4 C0 04 00 04 */ lfs f0, 4(r4) -/* 803340D8 D0 03 00 04 */ stfs f0, 4(r3) -/* 803340DC C0 04 00 08 */ lfs f0, 8(r4) -/* 803340E0 D0 03 00 08 */ stfs f0, 8(r3) -/* 803340E4 C0 04 00 0C */ lfs f0, 0xc(r4) -/* 803340E8 D0 03 00 0C */ stfs f0, 0xc(r3) -/* 803340EC 48 00 00 24 */ b lbl_80334110 -lbl_803340F0: -/* 803340F0 80 81 00 08 */ lwz r4, 8(r1) -/* 803340F4 80 01 00 0C */ lwz r0, 0xc(r1) -/* 803340F8 90 83 00 00 */ stw r4, 0(r3) -/* 803340FC 90 03 00 04 */ stw r0, 4(r3) -/* 80334100 80 81 00 10 */ lwz r4, 0x10(r1) -/* 80334104 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80334108 90 83 00 08 */ stw r4, 8(r3) -/* 8033410C 90 03 00 0C */ stw r0, 0xc(r3) -lbl_80334110: -/* 80334110 38 21 00 20 */ addi r1, r1, 0x20 -/* 80334114 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevColor__22J3DMaterialFactory_v21CFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevColor__22J3DMaterialFactory_v21CFii.s deleted file mode 100644 index a7c4440b651..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevColor__22J3DMaterialFactory_v21CFii.s +++ /dev/null @@ -1,31 +0,0 @@ -lbl_80333C04: -/* 80333C04 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80333C08 81 42 D1 C0 */ lwz r10, lit_1299(r2) -/* 80333C0C 81 22 D1 C4 */ lwz r9, data_80456BC4(r2) -/* 80333C10 91 41 00 08 */ stw r10, 8(r1) -/* 80333C14 91 21 00 0C */ stw r9, 0xc(r1) -/* 80333C18 81 04 00 04 */ lwz r8, 4(r4) -/* 80333C1C 80 E4 00 08 */ lwz r7, 8(r4) -/* 80333C20 54 A0 08 3C */ slwi r0, r5, 1 -/* 80333C24 7C 07 02 2E */ lhzx r0, r7, r0 -/* 80333C28 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333C2C 7C A8 02 14 */ add r5, r8, r0 -/* 80333C30 54 C0 08 3C */ slwi r0, r6, 1 -/* 80333C34 7C A5 02 14 */ add r5, r5, r0 -/* 80333C38 A0 05 00 C8 */ lhz r0, 0xc8(r5) -/* 80333C3C 28 00 FF FF */ cmplwi r0, 0xffff -/* 80333C40 41 82 00 24 */ beq lbl_80333C64 -/* 80333C44 80 84 00 38 */ lwz r4, 0x38(r4) -/* 80333C48 54 00 1B 78 */ rlwinm r0, r0, 3, 0xd, 0x1c -/* 80333C4C 7C A4 02 14 */ add r5, r4, r0 -/* 80333C50 80 85 00 00 */ lwz r4, 0(r5) -/* 80333C54 80 05 00 04 */ lwz r0, 4(r5) -/* 80333C58 90 83 00 00 */ stw r4, 0(r3) -/* 80333C5C 90 03 00 04 */ stw r0, 4(r3) -/* 80333C60 48 00 00 0C */ b lbl_80333C6C -lbl_80333C64: -/* 80333C64 91 43 00 00 */ stw r10, 0(r3) -/* 80333C68 91 23 00 04 */ stw r9, 4(r3) -lbl_80333C6C: -/* 80333C6C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80333C70 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevOrder__22J3DMaterialFactory_v21CFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevOrder__22J3DMaterialFactory_v21CFii.s deleted file mode 100644 index 512b00b9dfc..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevOrder__22J3DMaterialFactory_v21CFii.s +++ /dev/null @@ -1,21 +0,0 @@ -lbl_80333BB8: -/* 80333BB8 81 04 00 04 */ lwz r8, 4(r4) -/* 80333BBC 80 E4 00 08 */ lwz r7, 8(r4) -/* 80333BC0 54 A0 08 3C */ slwi r0, r5, 1 -/* 80333BC4 7C 07 02 2E */ lhzx r0, r7, r0 -/* 80333BC8 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333BCC 7C A8 02 14 */ add r5, r8, r0 -/* 80333BD0 54 C0 08 3C */ slwi r0, r6, 1 -/* 80333BD4 7C A5 02 14 */ add r5, r5, r0 -/* 80333BD8 A0 05 00 A8 */ lhz r0, 0xa8(r5) -/* 80333BDC 28 00 FF FF */ cmplwi r0, 0xffff -/* 80333BE0 41 82 00 18 */ beq lbl_80333BF8 -/* 80333BE4 80 84 00 34 */ lwz r4, 0x34(r4) -/* 80333BE8 54 00 13 BA */ rlwinm r0, r0, 2, 0xe, 0x1d -/* 80333BEC 7C 04 00 2E */ lwzx r0, r4, r0 -/* 80333BF0 90 03 00 00 */ stw r0, 0(r3) -/* 80333BF4 4E 80 00 20 */ blr -lbl_80333BF8: -/* 80333BF8 80 02 C9 CC */ lwz r0, j3dDefaultTevOrderInfoNull(r2) -/* 80333BFC 90 03 00 00 */ stw r0, 0(r3) -/* 80333C00 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevStageNum__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevStageNum__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index 44a3411c902..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevStageNum__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80333CD0: -/* 80333CD0 80 C3 00 04 */ lwz r6, 4(r3) -/* 80333CD4 80 A3 00 08 */ lwz r5, 8(r3) -/* 80333CD8 54 80 08 3C */ slwi r0, r4, 1 -/* 80333CDC 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80333CE0 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333CE4 7C 86 02 14 */ add r4, r6, r0 -/* 80333CE8 88 04 00 04 */ lbz r0, 4(r4) -/* 80333CEC 28 00 00 FF */ cmplwi r0, 0xff -/* 80333CF0 41 82 00 10 */ beq lbl_80333D00 -/* 80333CF4 80 63 00 40 */ lwz r3, 0x40(r3) -/* 80333CF8 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80333CFC 4E 80 00 20 */ blr -lbl_80333D00: -/* 80333D00 38 60 00 FF */ li r3, 0xff -/* 80333D04 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevStage__22J3DMaterialFactory_v21CFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevStage__22J3DMaterialFactory_v21CFii.s deleted file mode 100644 index fe51ab6c465..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevStage__22J3DMaterialFactory_v21CFii.s +++ /dev/null @@ -1,27 +0,0 @@ -lbl_80333D08: -/* 80333D08 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80333D0C 7C 08 02 A6 */ mflr r0 -/* 80333D10 90 01 00 14 */ stw r0, 0x14(r1) -/* 80333D14 81 04 00 04 */ lwz r8, 4(r4) -/* 80333D18 80 E4 00 08 */ lwz r7, 8(r4) -/* 80333D1C 54 A0 08 3C */ slwi r0, r5, 1 -/* 80333D20 7C 07 02 2E */ lhzx r0, r7, r0 -/* 80333D24 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333D28 7C A8 02 14 */ add r5, r8, r0 -/* 80333D2C 54 C0 08 3C */ slwi r0, r6, 1 -/* 80333D30 7C A5 02 14 */ add r5, r5, r0 -/* 80333D34 A0 05 00 D0 */ lhz r0, 0xd0(r5) -/* 80333D38 28 00 FF FF */ cmplwi r0, 0xffff -/* 80333D3C 41 82 00 18 */ beq lbl_80333D54 -/* 80333D40 80 84 00 44 */ lwz r4, 0x44(r4) -/* 80333D44 1C 00 00 14 */ mulli r0, r0, 0x14 -/* 80333D48 7C 84 02 14 */ add r4, r4, r0 -/* 80333D4C 4B D0 6D 81 */ bl __ct__11J3DTevStageFRC15J3DTevStageInfo -/* 80333D50 48 00 00 08 */ b lbl_80333D58 -lbl_80333D54: -/* 80333D54 4B CD A4 DD */ bl __ct__11J3DTevStageFv -lbl_80333D58: -/* 80333D58 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80333D5C 7C 08 03 A6 */ mtlr r0 -/* 80333D60 38 21 00 10 */ addi r1, r1, 0x10 -/* 80333D64 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexCoord__22J3DMaterialFactory_v21CFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexCoord__22J3DMaterialFactory_v21CFii.s deleted file mode 100644 index 4be54396844..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexCoord__22J3DMaterialFactory_v21CFii.s +++ /dev/null @@ -1,26 +0,0 @@ -lbl_80333A48: -/* 80333A48 81 04 00 04 */ lwz r8, 4(r4) -/* 80333A4C 80 E4 00 08 */ lwz r7, 8(r4) -/* 80333A50 54 A0 08 3C */ slwi r0, r5, 1 -/* 80333A54 7C 07 02 2E */ lhzx r0, r7, r0 -/* 80333A58 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333A5C 7C A8 02 14 */ add r5, r8, r0 -/* 80333A60 54 C0 08 3C */ slwi r0, r6, 1 -/* 80333A64 7C A5 02 14 */ add r5, r5, r0 -/* 80333A68 A0 05 00 14 */ lhz r0, 0x14(r5) -/* 80333A6C 28 00 FF FF */ cmplwi r0, 0xffff -/* 80333A70 41 82 00 20 */ beq lbl_80333A90 -/* 80333A74 80 84 00 1C */ lwz r4, 0x1c(r4) -/* 80333A78 54 00 13 BA */ rlwinm r0, r0, 2, 0xe, 0x1d -/* 80333A7C 7C 04 00 2E */ lwzx r0, r4, r0 -/* 80333A80 90 03 00 00 */ stw r0, 0(r3) -/* 80333A84 88 03 00 02 */ lbz r0, 2(r3) -/* 80333A88 B0 03 00 04 */ sth r0, 4(r3) -/* 80333A8C 4E 80 00 20 */ blr -lbl_80333A90: -/* 80333A90 3C 80 80 3A */ lis r4, j3dDefaultTexCoordInfo@ha /* 0x803A1EFC@ha */ -/* 80333A94 80 04 1E FC */ lwz r0, j3dDefaultTexCoordInfo@l(r4) /* 0x803A1EFC@l */ -/* 80333A98 90 03 00 00 */ stw r0, 0(r3) -/* 80333A9C 88 03 00 02 */ lbz r0, 2(r3) -/* 80333AA0 B0 03 00 04 */ sth r0, 4(r3) -/* 80333AA4 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexGenNum__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexGenNum__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index e7f948dca3e..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexGenNum__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80333A10: -/* 80333A10 80 C3 00 04 */ lwz r6, 4(r3) -/* 80333A14 80 A3 00 08 */ lwz r5, 8(r3) -/* 80333A18 54 80 08 3C */ slwi r0, r4, 1 -/* 80333A1C 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80333A20 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333A24 7C 86 02 14 */ add r4, r6, r0 -/* 80333A28 88 04 00 03 */ lbz r0, 3(r4) -/* 80333A2C 28 00 00 FF */ cmplwi r0, 0xff -/* 80333A30 41 82 00 10 */ beq lbl_80333A40 -/* 80333A34 80 63 00 18 */ lwz r3, 0x18(r3) -/* 80333A38 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80333A3C 4E 80 00 20 */ blr -lbl_80333A40: -/* 80333A40 38 60 00 00 */ li r3, 0 -/* 80333A44 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexMtx__22J3DMaterialFactory_v21CFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexMtx__22J3DMaterialFactory_v21CFii.s deleted file mode 100644 index 0eaf7bc8e52..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexMtx__22J3DMaterialFactory_v21CFii.s +++ /dev/null @@ -1,37 +0,0 @@ -lbl_80333AA8: -/* 80333AA8 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80333AAC 7C 08 02 A6 */ mflr r0 -/* 80333AB0 90 01 00 24 */ stw r0, 0x24(r1) -/* 80333AB4 39 61 00 20 */ addi r11, r1, 0x20 -/* 80333AB8 48 02 E7 25 */ bl _savegpr_29 -/* 80333ABC 7C 7D 1B 78 */ mr r29, r3 -/* 80333AC0 38 60 00 00 */ li r3, 0 -/* 80333AC4 80 FD 00 04 */ lwz r7, 4(r29) -/* 80333AC8 80 DD 00 08 */ lwz r6, 8(r29) -/* 80333ACC 54 80 08 3C */ slwi r0, r4, 1 -/* 80333AD0 7C 06 02 2E */ lhzx r0, r6, r0 -/* 80333AD4 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333AD8 7C 87 02 14 */ add r4, r7, r0 -/* 80333ADC 54 A0 08 3C */ slwi r0, r5, 1 -/* 80333AE0 7F C4 02 14 */ add r30, r4, r0 -/* 80333AE4 A0 1E 00 34 */ lhz r0, 0x34(r30) -/* 80333AE8 28 00 FF FF */ cmplwi r0, 0xffff -/* 80333AEC 41 82 00 2C */ beq lbl_80333B18 -/* 80333AF0 38 60 00 94 */ li r3, 0x94 -/* 80333AF4 4B F9 B1 59 */ bl __nw__FUl -/* 80333AF8 7C 7F 1B 79 */ or. r31, r3, r3 -/* 80333AFC 41 82 00 18 */ beq lbl_80333B14 -/* 80333B00 80 9D 00 24 */ lwz r4, 0x24(r29) -/* 80333B04 A0 1E 00 34 */ lhz r0, 0x34(r30) -/* 80333B08 1C 00 00 64 */ mulli r0, r0, 0x64 -/* 80333B0C 7C 84 02 14 */ add r4, r4, r0 -/* 80333B10 4B FF 1C 09 */ bl __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo -lbl_80333B14: -/* 80333B14 7F E3 FB 78 */ mr r3, r31 -lbl_80333B18: -/* 80333B18 39 61 00 20 */ addi r11, r1, 0x20 -/* 80333B1C 48 02 E7 0D */ bl _restgpr_29 -/* 80333B20 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80333B24 7C 08 03 A6 */ mtlr r0 -/* 80333B28 38 21 00 20 */ addi r1, r1, 0x20 -/* 80333B2C 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexNo__22J3DMaterialFactory_v21CFii.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexNo__22J3DMaterialFactory_v21CFii.s deleted file mode 100644 index 49d78e4a1a1..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexNo__22J3DMaterialFactory_v21CFii.s +++ /dev/null @@ -1,20 +0,0 @@ -lbl_80333B70: -/* 80333B70 80 E3 00 04 */ lwz r7, 4(r3) -/* 80333B74 80 C3 00 08 */ lwz r6, 8(r3) -/* 80333B78 54 80 08 3C */ slwi r0, r4, 1 -/* 80333B7C 7C 06 02 2E */ lhzx r0, r6, r0 -/* 80333B80 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333B84 7C 87 02 14 */ add r4, r7, r0 -/* 80333B88 54 A0 08 3C */ slwi r0, r5, 1 -/* 80333B8C 7C 84 02 14 */ add r4, r4, r0 -/* 80333B90 A0 04 00 70 */ lhz r0, 0x70(r4) -/* 80333B94 28 00 FF FF */ cmplwi r0, 0xffff -/* 80333B98 41 82 00 14 */ beq lbl_80333BAC -/* 80333B9C 80 63 00 2C */ lwz r3, 0x2c(r3) -/* 80333BA0 54 00 0B FC */ rlwinm r0, r0, 1, 0xf, 0x1e -/* 80333BA4 7C 63 02 2E */ lhzx r3, r3, r0 -/* 80333BA8 4E 80 00 20 */ blr -lbl_80333BAC: -/* 80333BAC 3C 60 00 01 */ lis r3, 0x0001 /* 0x0000FFFF@ha */ -/* 80333BB0 38 63 FF FF */ addi r3, r3, 0xFFFF /* 0x0000FFFF@l */ -/* 80333BB4 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newZCompLoc__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newZCompLoc__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index a695872729b..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newZCompLoc__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80334004: -/* 80334004 80 C3 00 04 */ lwz r6, 4(r3) -/* 80334008 80 A3 00 08 */ lwz r5, 8(r3) -/* 8033400C 54 80 08 3C */ slwi r0, r4, 1 -/* 80334010 7C 05 02 2E */ lhzx r0, r5, r0 -/* 80334014 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80334018 7C 86 02 14 */ add r4, r6, r0 -/* 8033401C 88 04 00 05 */ lbz r0, 5(r4) -/* 80334020 28 00 00 FF */ cmplwi r0, 0xff -/* 80334024 41 82 00 10 */ beq lbl_80334034 -/* 80334028 80 63 00 60 */ lwz r3, 0x60(r3) -/* 8033402C 7C 63 00 AE */ lbzx r3, r3, r0 -/* 80334030 4E 80 00 20 */ blr -lbl_80334034: -/* 80334034 38 60 00 00 */ li r3, 0 -/* 80334038 4E 80 00 20 */ blr diff --git a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newZMode__22J3DMaterialFactory_v21CFi.s b/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newZMode__22J3DMaterialFactory_v21CFi.s deleted file mode 100644 index 4b4e08602bf..00000000000 --- a/asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newZMode__22J3DMaterialFactory_v21CFi.s +++ /dev/null @@ -1,26 +0,0 @@ -lbl_80333FA4: -/* 80333FA4 80 E4 00 04 */ lwz r7, 4(r4) -/* 80333FA8 80 C4 00 08 */ lwz r6, 8(r4) -/* 80333FAC 54 A0 08 3C */ slwi r0, r5, 1 -/* 80333FB0 7C 06 02 2E */ lhzx r0, r6, r0 -/* 80333FB4 1C 00 01 38 */ mulli r0, r0, 0x138 -/* 80333FB8 7C A7 02 14 */ add r5, r7, r0 -/* 80333FBC 88 05 00 06 */ lbz r0, 6(r5) -/* 80333FC0 28 00 00 FF */ cmplwi r0, 0xff -/* 80333FC4 41 82 00 34 */ beq lbl_80333FF8 -/* 80333FC8 80 84 00 5C */ lwz r4, 0x5c(r4) -/* 80333FCC 54 00 15 BA */ rlwinm r0, r0, 2, 0x16, 0x1d -/* 80333FD0 7C 84 02 14 */ add r4, r4, r0 -/* 80333FD4 88 C4 00 00 */ lbz r6, 0(r4) -/* 80333FD8 88 A4 00 02 */ lbz r5, 2(r4) -/* 80333FDC 88 04 00 01 */ lbz r0, 1(r4) -/* 80333FE0 54 04 0D FC */ rlwinm r4, r0, 1, 0x17, 0x1e -/* 80333FE4 54 C0 20 36 */ slwi r0, r6, 4 -/* 80333FE8 7C 00 2A 14 */ add r0, r0, r5 -/* 80333FEC 7C 04 02 14 */ add r0, r4, r0 -/* 80333FF0 B0 03 00 00 */ sth r0, 0(r3) -/* 80333FF4 4E 80 00 20 */ blr -lbl_80333FF8: -/* 80333FF8 A0 02 C9 FC */ lhz r0, j3dDefaultZModeID(r2) -/* 80333FFC B0 03 00 00 */ sth r0, 0(r3) -/* 80334000 4E 80 00 20 */ blr diff --git a/include/JSystem/J3DGraphBase/J3DMatBlock.h b/include/JSystem/J3DGraphBase/J3DMatBlock.h index e0520caba59..46f5dc49f7c 100644 --- a/include/JSystem/J3DGraphBase/J3DMatBlock.h +++ b/include/JSystem/J3DGraphBase/J3DMatBlock.h @@ -5,14 +5,17 @@ #include "JSystem/J3DGraphBase/J3DTevs.h" #include "JSystem/J3DGraphBase/J3DTexture.h" #include "dolphin/types.h" -#include "m_Do/m_Do_lib.h" struct J3DGXColorS10 : public GXColorS10 { /* 8000E460 */ J3DGXColorS10() {} + J3DGXColorS10(J3DGXColorS10 const& other) { __memcpy(this, &other, sizeof(J3DGXColorS10)); } + J3DGXColorS10(GXColorS10 const& color) : GXColorS10(color) {} }; struct J3DGXColor : public GXColor { /* 8000E538 */ J3DGXColor() {} + J3DGXColor(J3DGXColor const& other) { __memcpy(this, &other, sizeof(J3DGXColor)); } + J3DGXColor(GXColor const& color) : GXColor(color) {} }; struct J3DNBTScale : public J3DNBTScaleInfo { @@ -52,7 +55,21 @@ class J3DTexGenBlock { /* 80317334 */ virtual J3DNBTScale* getNBTScale(); /* 80317428 */ virtual bool getTexMtxOffset() const; /* 80317430 */ virtual void setTexMtxOffset(u32); - /* 803171DC */ virtual ~J3DTexGenBlock(); + /* 803171DC */ virtual ~J3DTexGenBlock() {} +}; + +struct J3DTexGenBlockNull : public J3DTexGenBlock { + /* 80332AA0 */ virtual void calc(f32 const (*)[4]); // {} + /* 80332AA4 */ virtual void calcWithoutViewMtx(f32 const (*)[4]); // {} + /* 80332AA8 */ virtual void calcPostTexMtx(f32 const (*)[4]); // {} + /* 80332AAC */ virtual void calcPostTexMtxWithoutViewMtx(f32 const (*)[4]); // {} + /* 80332AB0 */ virtual void load(); // {} + /* 80332AB4 */ virtual void patch(); // {} + /* 80332AB8 */ virtual void diff(u32); // {} + /* 80332ABC */ virtual void diffTexMtx(); // {} + /* 80332AC0 */ virtual void diffTexGen(); // {} + /* 80332AC4 */ virtual u32 getType(); // { return 'TGNL'; } + /* 80332AD0 */ virtual ~J3DTexGenBlockNull(); // {} }; class J3DTexGenBlockPatched : public J3DTexGenBlock { @@ -188,14 +205,25 @@ class J3DTevBlock { /* 80322964 */ virtual bool getTevRegOffset() const; /* 80321FE0 */ virtual void setTexNoOffset(u32); /* 8032296C */ virtual void setTevRegOffset(u32); - /* 80317224 */ virtual ~J3DTevBlock(); + /* 80317224 */ virtual ~J3DTevBlock() {} -private: +protected: /* 8031E098 */ void indexToPtr_private(u32); /* 0x4 */ u32 mTexNoOffset; }; +class J3DTevBlockNull : public J3DTevBlock { +public: + J3DTevBlockNull() { initialize(); } + /* 803176D4 */ void initialize(); + /* 80332A0C */ virtual void reset(J3DTevBlock*); // {} + /* 80332A10 */ virtual void ptrToIndex(); // {} + /* 80332A14 */ virtual void indexToPtr(); // { indexToPtr_private(mTexNoOffset); } + /* 80332A38 */ virtual u32 getType(); // { return 'TVNL'; } + /* 80332A44 */ virtual ~J3DTevBlockNull(); // {} +}; + class J3DTevBlockPatched : public J3DTevBlock { public: J3DTevBlockPatched() { @@ -259,10 +287,6 @@ class J3DTevBlockPatched : public J3DTevBlock { /* 0xD4 */ u32 mTevRegOffset; }; // Size: 0xD8 -class J3DTevBlockNull : public J3DTevBlock { - /* 803176D4 */ void initialize(); -}; - class J3DTevBlock4 : public J3DTevBlock { public: J3DTevBlock4() { @@ -532,19 +556,19 @@ class J3DTevBlock1 : public J3DTevBlock { extern const u16 j3dDefaultZModeID; inline u16 calcZModeID(u8 param_0, u8 param_1, u8 param_2) { - return ((param_1 * 2) & 0x1FE) + (param_0 * 0x10) + param_2; + return param_1 * 2 + param_0 * 0x10 + param_2; } struct J3DZModeInfo { /* 0x0 */ u8 field_0x0; /* 0x1 */ u8 field_0x1; /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 pad; }; struct J3DZMode { - J3DZMode() { - mZModeID = j3dDefaultZModeID; - } + J3DZMode() : mZModeID(j3dDefaultZModeID) {} + J3DZMode(J3DZModeInfo const& info) : mZModeID(calcZModeID(info.field_0x0, info.field_0x1, info.field_0x2)) {} void setZModeInfo(const J3DZModeInfo& info) { mZModeID = calcZModeID(info.field_0x0, info.field_0x1, info.field_0x2); @@ -566,18 +590,16 @@ struct J3DBlendInfo { extern const J3DBlendInfo j3dDefaultBlendInfo; struct J3DBlend : public J3DBlendInfo { - J3DBlend() { - *(J3DBlendInfo*)this = j3dDefaultBlendInfo; - } + J3DBlend() : J3DBlendInfo(j3dDefaultBlendInfo) {} + J3DBlend(J3DBlendInfo const& info) : J3DBlendInfo(info) {} }; extern const J3DFogInfo j3dDefaultFogInfo; struct J3DFog : public J3DFogInfo { - J3DFog() { - *getFogInfo() = j3dDefaultFogInfo; - } - J3DFogInfo* getFogInfo() { return (J3DFogInfo*)this; } + J3DFog() { *(J3DFogInfo*)this = j3dDefaultFogInfo; } + J3DFogInfo* getFogInfo() { return this; } + void setFogInfo(J3DFogInfo info) { *(J3DFogInfo*)this = info; } }; struct J3DAlphaCompInfo { @@ -593,25 +615,36 @@ struct J3DAlphaCompInfo { extern const u16 j3dDefaultAlphaCmpID; +inline u32 calcAlphaCmpID(u32 param_1, u32 param_2, u32 param_3) { + return ((param_1 & 0xff) << 5) + ((param_2 & 0xff) << 3) + (param_3 & 0xff); +} + +// matches for `J3DMaterialFactory::newAlphaComp` but fails for `d_resorce::addWarpMaterial` +// inline u32 calcAlphaCmpID(u8 param_1, u8 param_2, u8 param_3) { +// return param_1 * 0x20 + param_2 * 8 + param_3; +// } + struct J3DAlphaComp { - J3DAlphaComp() { - field_0x0 = j3dDefaultAlphaCmpID; - mRef0 = 0; - mRef1 = 0; - } + J3DAlphaComp() : mID(j3dDefaultAlphaCmpID), mRef0(0), mRef1(0) {} + J3DAlphaComp(u16 id) : mID(id), mRef0(0), mRef1(0) {} + J3DAlphaComp(J3DAlphaCompInfo const& info) : + mID(calcAlphaCmpID(info.field_0x0, info.mRef0, info.mRef1)), + mRef0(info.field_0x1), + mRef1(info.field_0x4) + {} void setAlphaCompInfo(const J3DAlphaCompInfo& param_1) { mRef0 = param_1.field_0x1; mRef1 = param_1.field_0x4; u32 p1_mref1 = param_1.mRef1; - field_0x0 = calcAlphaCmpID(param_1.field_0x0, param_1.mRef0, p1_mref1); + mID = calcAlphaCmpID(param_1.field_0x0, param_1.mRef0, p1_mref1); // this matches for `dKy_bg_MAxx_proc` but causes `addWarpMaterial` to fail, // while the above matches for `addWarpMaterial` but causes `dKy_bg_MAxx_proc` to fail? - // field_0x0 = calcAlphaCmpID(param_1.field_0x0, param_1.mRef0, param_1.mRef1); + // mID = calcAlphaCmpID(param_1.field_0x0, param_1.mRef0, param_1.mRef1); } - /* 0x00 */ u16 field_0x0; + /* 0x00 */ u16 mID; /* 0x02 */ u8 mRef0; /* 0x03 */ u8 mRef1; }; // Size: 0x4 @@ -646,7 +679,13 @@ class J3DPEBlock { /* 80317384 */ virtual bool getDither() const; /* 8031738C */ virtual bool getFogOffset() const; /* 80317394 */ virtual void setFogOffset(u32); - virtual ~J3DPEBlock(); + virtual ~J3DPEBlock() {} +}; + +struct J3DPEBlockNull : public J3DPEBlock { + /* 803329A0 */ virtual void load(); // {} + /* 803329A4 */ virtual u32 getType(); // { return 'PENL'; } + /* 803329B0 */ virtual ~J3DPEBlockNull(); // {} }; class J3DPEBlockXlu : public J3DPEBlock { @@ -763,24 +802,22 @@ struct J3DIndTexCoordScaleInfo { /* 0x1 */ u8 mScaleT; /* 0x2 */ u8 field_0x2; /* 0x3 */ u8 field_0x3; -}; +}; // Size: 0x4 -struct J3DIndTexCoordScale { - /* 8000E024 */ ~J3DIndTexCoordScale(); - /* 8000E0E4 */ J3DIndTexCoordScale(); +extern J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo; - /* 0x0 */ u8 mScaleS; - /* 0x1 */ u8 mScaleT; - /* 0x2 */ u8 field_0x2; - /* 0x3 */ u8 field_0x3; -}; +struct J3DIndTexCoordScale : public J3DIndTexCoordScaleInfo { + /* 8000E0E4 */ J3DIndTexCoordScale() : J3DIndTexCoordScaleInfo(j3dDefaultIndTexCoordScaleInfo) {} + J3DIndTexCoordScale(J3DIndTexCoordScaleInfo const& info) : J3DIndTexCoordScaleInfo(info) {} + /* 8000E024 */ ~J3DIndTexCoordScale() {} +}; // Size: 0x4 -struct J3DIndTexMtx { - /* 8000E064 */ ~J3DIndTexMtx(); - /* 8000E0F0 */ J3DIndTexMtx(); +extern J3DIndTexMtxInfo const j3dDefaultIndTexMtxInfo; - /* 0x00 */ Mtx23 mOffsetMtx; - /* 0x18 */ u8 mScaleExp; +struct J3DIndTexMtx : public J3DIndTexMtxInfo { + /* 8000E0F0 */ J3DIndTexMtx() { *(J3DIndTexMtxInfo*)this = j3dDefaultIndTexMtxInfo; } + J3DIndTexMtx(J3DIndTexMtxInfo const& info) { *(J3DIndTexMtxInfo*)this = info; } + /* 8000E064 */ ~J3DIndTexMtx() {} }; // Size: 0x1C struct J3DIndTexOrderInfo { @@ -788,16 +825,14 @@ struct J3DIndTexOrderInfo { /* 0x1 */ u8 mCoord; /* 0x2 */ u8 field_0x2; /* 0x3 */ u8 field_0x3; -}; +}; // Size: 0x04 -struct J3DIndTexOrder { - /* 8000E128 */ J3DIndTexOrder(); +extern J3DIndTexOrderInfo j3dDefaultIndTexOrderNull; - /* 0x0 */ u8 mMap; - /* 0x1 */ u8 mCoord; - /* 0x2 */ u8 field_0x2; - /* 0x3 */ u8 field_0x3; -}; +struct J3DIndTexOrder : public J3DIndTexOrderInfo { + /* 8000E128 */ J3DIndTexOrder() : J3DIndTexOrderInfo(j3dDefaultIndTexOrderNull) {} + J3DIndTexOrder(J3DIndTexOrderInfo const& info) : J3DIndTexOrderInfo(info) {} +}; // Size: 0x04 class J3DIndBlock { public: @@ -820,6 +855,15 @@ class J3DIndBlock { /* 8031726C */ virtual ~J3DIndBlock(); }; +class J3DIndBlockNull : public J3DIndBlock { +public: + /* 803173A0 */ virtual void reset(J3DIndBlock*); + /* 80317398 */ virtual void diff(u32); + /* 8031739C */ virtual void load(); + /* 803173A4 */ virtual u32 getType(); + /* 803173B0 */ virtual ~J3DIndBlockNull(); +}; + class J3DIndBlockFull : public J3DIndBlock { public: J3DIndBlockFull() { @@ -852,15 +896,6 @@ class J3DIndBlockFull : public J3DIndBlock { /* 0x6C */ J3DIndTexCoordScale mIndTexCoordScale[4]; }; // Size: 0x7C -class J3DIndBlockNull : public J3DIndBlock { -public: - /* 803173A0 */ virtual void reset(J3DIndBlock*); - /* 80317398 */ virtual void diff(u32); - /* 8031739C */ virtual void load(); - /* 803173A4 */ virtual u32 getType(); - /* 803173B0 */ virtual ~J3DIndBlockNull(); -}; - struct J3DColorChanInfo { /* 0x0 */ u8 field_0x0; /* 0x1 */ u8 field_0x1; @@ -868,10 +903,41 @@ struct J3DColorChanInfo { /* 0x3 */ u8 field_0x3; /* 0x4 */ u8 field_0x4; /* 0x5 */ u8 field_0x5; + /* 0x6 */ u8 pad[2]; }; +extern J3DColorChanInfo j3dDefaultColorChanInfo; + struct J3DColorChan { - /* 8000E47C */ J3DColorChan(); + /* 8000E47C */ J3DColorChan() { + setColorChanInfo(j3dDefaultColorChanInfo); + } + J3DColorChan(J3DColorChanInfo const& info) { + setColorChanInfo(info); + } + void setColorChanInfo(J3DColorChanInfo const& info) { + mColorChanID = calcColorChanID(info.field_0x0, info.field_0x1, info.field_0x2, + info.field_0x3, info.field_0x4, info.field_0x5 == 0xff ? 0 : info.field_0x5); + } + u16 calcColorChanID(u16 param_0, u8 param_1, u8 param_2, u8 param_3, u8 param_4, u8 param_5) { + // if (param_4 == 0) { + // param_3 = 0; + // } + u32 b0 = ((param_2 & 1) != 0); + u32 b1 = ((param_2 & 2) != 0); + u32 b2 = ((param_2 & 4) != 0); + u32 b3 = ((param_2 & 8) != 0); + u32 b4 = ((param_2 & 0x10) != 0); + u32 b5 = ((param_2 & 0x20) != 0); + u32 b6 = ((param_2 & 0x40) != 0); + u32 b7 = ((param_2 & 0x80) != 0); + return param_1 | (param_0 << 1) | (b0 << 2) | (b1 << 3) | (b2 << 4) | (b3 << 5) | + (param_5 << 6) | (param_3 << 7) | ((param_4 != 2) << 9) | ((param_4 != 0) << 10) | + (b4 << 11) | (b5 << 12) | (b6 << 13) | (b7 << 14); + // return (b7 << 14) | (b6 << 13) | (b5 << 12) | (b4 << 11) | + // ((param_4 != 0) << 10) | ((param_4 != 2) << 9) | ((param_3 != 0) << 7) | ((param_5 != 0) << 6) | + // (b3 << 5) | (b2 << 4) | (b1 << 3) | (b0 << 2) | ((param_0 != 0) << 1) | param_1; + } u8 getLightMask() { return (((mColorChanID & 0x7800) >> 7) | (mColorChanID & 0x3c) >> 2); } void setLightMask(u8 param_1) { mColorChanID = (mColorChanID & ~0x3c) | ((param_1 & 0xf) << 2); @@ -916,7 +982,12 @@ class J3DColorBlock { /* 8031746C */ virtual bool getColorChanOffset() const; /* 80317474 */ virtual void setMatColorOffset(u32); /* 80317478 */ virtual void setColorChanOffset(u32); - /* 80317138 */ virtual ~J3DColorBlock(); + /* 80317138 */ virtual ~J3DColorBlock() {} +}; + +struct J3DColorBlockNull : public J3DColorBlock { + /* 80332B2C */ virtual u32 getType(); // { return 'CLNL'; } + /* 80332B38 */ virtual ~J3DColorBlockNull(); // {} }; class J3DColorBlockLightOn : public J3DColorBlock { diff --git a/include/JSystem/J3DGraphBase/J3DMaterial.h b/include/JSystem/J3DGraphBase/J3DMaterial.h index d6339546916..c7838fb96e9 100644 --- a/include/JSystem/J3DGraphBase/J3DMaterial.h +++ b/include/JSystem/J3DGraphBase/J3DMaterial.h @@ -1,128 +1,129 @@ -#ifndef J3DMATERIAL_H -#define J3DMATERIAL_H - -#include "JSystem/J3DGraphBase/J3DMatBlock.h" -#include "JSystem/J3DGraphBase/J3DPacket.h" -#include "JSystem/J3DGraphBase/J3DShape.h" -#include "JSystem/J3DGraphBase/J3DTexture.h" -#include "dolphin/types.h" - -class J3DJoint; -class J3DMaterialAnm; - -class J3DMaterial { -public: - /* 803157A0 */ static J3DColorBlock* createColorBlock(u32); - /* 803159A0 */ static J3DTexGenBlock* createTexGenBlock(u32); - /* 80315B04 */ static J3DTevBlock* createTevBlock(int); - /* 80315E78 */ static J3DIndBlock* createIndBlock(int); - /* 80315F60 */ static J3DPEBlock* createPEBlock(u32, u32); - /* 80316100 */ static u32 calcSizeColorBlock(u32); - /* 80316150 */ static u32 calcSizeTexGenBlock(u32); - /* 8031617C */ static u32 calcSizeTevBlock(int); - /* 803161C4 */ static u32 calcSizeIndBlock(int); - /* 803161D8 */ static u32 calcSizePEBlock(u32, u32); - /* 80316240 */ void initialize(); - /* 80316290 */ u32 countDLSize(); - /* 80316344 */ void makeDisplayList_private(J3DDisplayListObj*); - /* 80316AB0 */ void setCurrentMtx(); - /* 80316AC8 */ void calcCurrentMtx(); - /* 80316D68 */ void copy(J3DMaterial*); - /* 80316E90 */ s32 newSharedDisplayList(u32); - /* 80316F24 */ s32 newSingleSharedDisplayList(u32); - - /* 803169DC */ virtual void calc(f32 const (*)[4]); - /* 80316A54 */ virtual void calcDiffTexMtx(f32 const (*)[4]); - /* 80316620 */ virtual void makeDisplayList(); - /* 80316668 */ virtual void makeSharedDisplayList(); - /* 8031668C */ virtual void load(); - /* 803166DC */ virtual void loadSharedDL(); - /* 80316740 */ virtual void patch(); - /* 803167D8 */ virtual void diff(u32); - /* 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; } - J3DColorBlock* getColorBlock() const { return mColorBlock; } - J3DTexGenBlock* getTexGenBlock() const { return mTexGenBlock; } - J3DDisplayListObj* getSharedDisplayListObj() const { return mSharedDLObj; } - J3DIndBlock* getIndBlock() const { return mIndBlock; } - J3DShape* getShape() { return mShape; } - J3DJoint* getJoint() { return mJoint; } - J3DMaterialAnm* getMaterialAnm() const { - if ((u32)mMaterialAnm < 0xC0000000) { - return mMaterialAnm; - } else { - return NULL; - } - } - J3DNBTScale* getNBTScale() const { return mTexGenBlock->getNBTScale(); } - u16 getTexNo(u32 idx) const { return mTevBlock->getTexNo(idx); } - GXColor* getTevKColor(u32 param_0) { return mTevBlock->getTevKColor(param_0); } - GXColorS10* getTevColor(u32 param_0) { return mTevBlock->getTevColor(param_0); } - J3DFog* getFog() { return mPEBlock->getFog(); } - J3DTexMtx* getTexMtx(u32 idx) { return mTexGenBlock->getTexMtx(idx); } - u16 getIndex() { return mIndex; } - bool isDrawModeOpaTexEdge() { return (mMaterialMode & 3) == 0; } - J3DPEBlock* getPEBlock() { return mPEBlock; } - void onInvalid() { mInvalid = 1; } - u32 getTexGenNum() const { return mTexGenBlock->getTexGenNum(); } - u8 getTevStageNum() const { return mTevBlock->getTevStageNum(); } - - void setTevColor(u32 i, const J3DGXColorS10* i_color) { mTevBlock->setTevColor(i, i_color); } - void setTevKColor(u32 i, const J3DGXColor* i_color) { mTevBlock->setTevKColor(i, i_color); } - void setMaterialAnm(J3DMaterialAnm* i_anm) { mMaterialAnm = i_anm; } - void setCullMode(u8 i_mode) { mColorBlock->setCullMode(i_mode); } - -public: - /* 0x04 */ J3DMaterial* mNext; - /* 0x08 */ J3DShape* mShape; - /* 0x0C */ J3DJoint* mJoint; - /* 0x10 */ u32 mMaterialMode; - /* 0x14 */ u16 mIndex; - /* 0x18 */ u32 mInvalid; - /* 0x1C */ u32 field_0x1c; - /* 0x20 */ u32 mDiffFlag; - /* 0x24 */ J3DColorBlock* mColorBlock; - /* 0x28 */ J3DTexGenBlock* mTexGenBlock; - /* 0x2C */ J3DTevBlock* mTevBlock; - /* 0x30 */ J3DIndBlock* mIndBlock; - /* 0x34 */ J3DPEBlock* mPEBlock; - /* 0x38 */ J3DMaterial* mpOrigMaterial; - /* 0x3C */ J3DMaterialAnm* mMaterialAnm; - /* 0x40 */ J3DCurrentMtx mCurrentMtx; - /* 0x48 */ J3DDisplayListObj* mSharedDLObj; -}; - -class J3DPatchedMaterial : public J3DMaterial { -public: - /* 80316FB8 */ void initialize(); - - /* 80316FD8 */ virtual void makeDisplayList(); - /* 80316FDC */ virtual void makeSharedDisplayList(); - /* 80316FE0 */ virtual void load(); - /* 80316FFC */ virtual void loadSharedDL(); - /* 8031703C */ virtual void reset(); - /* 80317040 */ virtual void change(); -}; - -class J3DLockedMaterial : public J3DMaterial { -public: - /* 80317044 */ void initialize(); - - /* 803170D0 */ virtual void calc(f32 const (*)[4]); - /* 80317064 */ virtual void makeDisplayList(); - /* 80317068 */ virtual void makeSharedDisplayList(); - /* 8031706C */ virtual void load(); - /* 80317088 */ virtual void loadSharedDL(); - /* 803170C8 */ virtual void patch(); - /* 803170CC */ virtual void diff(u32); - /* 803170D4 */ virtual void reset(); - /* 803170D8 */ virtual void change(); -}; - -#endif /* J3DMATERIAL_H */ +#ifndef J3DMATERIAL_H +#define J3DMATERIAL_H + +#include "JSystem/J3DGraphBase/J3DMatBlock.h" +#include "JSystem/J3DGraphBase/J3DPacket.h" +#include "JSystem/J3DGraphBase/J3DShape.h" +#include "JSystem/J3DGraphBase/J3DTexture.h" +#include "dolphin/types.h" + +class J3DJoint; +class J3DMaterialAnm; + +class J3DMaterial { +public: + /* 803157A0 */ static J3DColorBlock* createColorBlock(u32); + /* 803159A0 */ static J3DTexGenBlock* createTexGenBlock(u32); + /* 80315B04 */ static J3DTevBlock* createTevBlock(int); + /* 80315E78 */ static J3DIndBlock* createIndBlock(int); + /* 80315F60 */ static J3DPEBlock* createPEBlock(u32, u32); + /* 80316100 */ static u32 calcSizeColorBlock(u32); + /* 80316150 */ static u32 calcSizeTexGenBlock(u32); + /* 8031617C */ static u32 calcSizeTevBlock(int); + /* 803161C4 */ static u32 calcSizeIndBlock(int); + /* 803161D8 */ static u32 calcSizePEBlock(u32, u32); + /* 80316240 */ void initialize(); + /* 80316290 */ u32 countDLSize(); + /* 80316344 */ void makeDisplayList_private(J3DDisplayListObj*); + /* 80316AB0 */ void setCurrentMtx(); + /* 80316AC8 */ void calcCurrentMtx(); + /* 80316D68 */ void copy(J3DMaterial*); + /* 80316E90 */ s32 newSharedDisplayList(u32); + /* 80316F24 */ s32 newSingleSharedDisplayList(u32); + + /* 803169DC */ virtual void calc(f32 const (*)[4]); + /* 80316A54 */ virtual void calcDiffTexMtx(f32 const (*)[4]); + /* 80316620 */ virtual void makeDisplayList(); + /* 80316668 */ virtual void makeSharedDisplayList(); + /* 8031668C */ virtual void load(); + /* 803166DC */ virtual void loadSharedDL(); + /* 80316740 */ virtual void patch(); + /* 803167D8 */ virtual void diff(u32); + /* 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; } + J3DColorBlock* getColorBlock() const { return mColorBlock; } + J3DTexGenBlock* getTexGenBlock() const { return mTexGenBlock; } + J3DDisplayListObj* getSharedDisplayListObj() const { return mSharedDLObj; } + J3DIndBlock* getIndBlock() const { return mIndBlock; } + J3DShape* getShape() { return mShape; } + J3DJoint* getJoint() { return mJoint; } + J3DMaterialAnm* getMaterialAnm() const { + if ((u32)mMaterialAnm < 0xC0000000) { + return mMaterialAnm; + } else { + return NULL; + } + } + J3DNBTScale* getNBTScale() const { return mTexGenBlock->getNBTScale(); } + u16 getTexNo(u32 idx) const { return mTevBlock->getTexNo(idx); } + GXColor* getTevKColor(u32 param_0) { return mTevBlock->getTevKColor(param_0); } + GXColorS10* getTevColor(u32 param_0) { return mTevBlock->getTevColor(param_0); } + J3DFog* getFog() { return mPEBlock->getFog(); } + J3DTexMtx* getTexMtx(u32 idx) { return mTexGenBlock->getTexMtx(idx); } + u16 getIndex() { return mIndex; } + bool isDrawModeOpaTexEdge() { return (mMaterialMode & 3) == 0; } + J3DPEBlock* getPEBlock() { return mPEBlock; } + void onInvalid() { mInvalid = 1; } + u32 getTexGenNum() const { return mTexGenBlock->getTexGenNum(); } + u8 getTevStageNum() const { return mTevBlock->getTevStageNum(); } + + void setTevColor(u32 i, const J3DGXColorS10* i_color) { mTevBlock->setTevColor(i, i_color); } + void setTevKColor(u32 i, const J3DGXColor* i_color) { mTevBlock->setTevKColor(i, i_color); } + void setMaterialAnm(J3DMaterialAnm* i_anm) { mMaterialAnm = i_anm; } + void setCullMode(u8 i_mode) { mColorBlock->setCullMode(i_mode); } + +public: + /* 0x04 */ J3DMaterial* mNext; + /* 0x08 */ J3DShape* mShape; + /* 0x0C */ J3DJoint* mJoint; + /* 0x10 */ u32 mMaterialMode; + /* 0x14 */ u16 mIndex; + /* 0x18 */ u32 mInvalid; + /* 0x1C */ u32 field_0x1c; + /* 0x20 */ u32 mDiffFlag; + /* 0x24 */ J3DColorBlock* mColorBlock; + /* 0x28 */ J3DTexGenBlock* mTexGenBlock; + /* 0x2C */ J3DTevBlock* mTevBlock; + /* 0x30 */ J3DIndBlock* mIndBlock; + /* 0x34 */ J3DPEBlock* mPEBlock; + /* 0x38 */ J3DMaterial* mpOrigMaterial; + /* 0x3C */ J3DMaterialAnm* mMaterialAnm; + /* 0x40 */ J3DCurrentMtx mCurrentMtx; + /* 0x48 */ J3DDisplayListObj* mSharedDLObj; +}; + +class J3DPatchedMaterial : public J3DMaterial { +public: + /* 80316FB8 */ void initialize(); + + /* 80316FD8 */ virtual void makeDisplayList(); + /* 80316FDC */ virtual void makeSharedDisplayList(); + /* 80316FE0 */ virtual void load(); + /* 80316FFC */ virtual void loadSharedDL(); + /* 8031703C */ virtual void reset(); + /* 80317040 */ virtual void change(); +}; + +class J3DLockedMaterial : public J3DMaterial { +public: + J3DLockedMaterial() { initialize(); } + /* 80317044 */ void initialize(); + + /* 803170D0 */ virtual void calc(f32 const (*)[4]); + /* 80317064 */ virtual void makeDisplayList(); + /* 80317068 */ virtual void makeSharedDisplayList(); + /* 8031706C */ virtual void load(); + /* 80317088 */ virtual void loadSharedDL(); + /* 803170C8 */ virtual void patch(); + /* 803170CC */ virtual void diff(u32); + /* 803170D4 */ virtual void reset(); + /* 803170D8 */ virtual void change(); +}; + +#endif /* J3DMATERIAL_H */ diff --git a/include/JSystem/J3DGraphBase/J3DShape.h b/include/JSystem/J3DGraphBase/J3DShape.h index 457724a8680..afa53214db4 100644 --- a/include/JSystem/J3DGraphBase/J3DShape.h +++ b/include/JSystem/J3DGraphBase/J3DShape.h @@ -1,152 +1,158 @@ -#ifndef J3DSHAPE_H -#define J3DSHAPE_H - -#include "JSystem/J3DGraphBase/J3DShapeDraw.h" -#include "JSystem/J3DGraphBase/J3DShapeMtx.h" -#include "dolphin/gx/GX.h" -#include "dolphin/types.h" - -class J3DCurrentMtxInfo { -public: - u32 mMtxIdxRegA; - u32 mMtxIdxRegB; -}; - -static inline void J3DFifoWriteCPCmd(u8 cmd, u32 param) { - GFX_FIFO(u8) = GX_CMD_LOAD_CP_REG; - GFX_FIFO(u8) = cmd; - GFX_FIFO(u32) = param; -} - -static inline void J3DFifoWriteXFCmd(u16 cmd, u16 len) { - GFX_FIFO(u8) = GX_CMD_LOAD_XF_REG; - GFX_FIFO(u16) = (len - 1); - GFX_FIFO(u16) = cmd; -} - -class J3DCurrentMtx : public J3DCurrentMtxInfo { -public: - J3DCurrentMtx() { - mMtxIdxRegA = 0x3cf3cf00; - mMtxIdxRegB = 0x00f3cf3c; - } - - u32 getMtxIdxRegA() const { return mMtxIdxRegA; } - u32 getMtxIdxRegB() const { return mMtxIdxRegB; } - - inline void load() const { - J3DFifoWriteCPCmd(0x30, getMtxIdxRegA()); // CP_MATINDEX_A - J3DFifoWriteCPCmd(0x40, getMtxIdxRegB()); // CP_MATINDEX_B - J3DFifoWriteXFCmd(0x1018, 2); - GFX_FIFO(u32) = getMtxIdxRegA(); - GFX_FIFO(u32) = getMtxIdxRegB(); - } - - void setCurrentTexMtx(u8 param_1, u8 param_2, u8 param_3, u8 param_4, - u8 param_5, u8 param_6, u8 param_7, u8 param_8) { - mMtxIdxRegA = ((param_1 & 0xff) << 6) | (param_2 << 0xc)| (param_3 << 0x12) | (param_4 << 0x18); - mMtxIdxRegB = (param_5) | param_6 << 6 | param_7 << 0xc | param_8 << 0x12; - } -}; - -class J3DMaterial; -class J3DVertexData; -class J3DDrawMtxData; - -enum J3DShpFlag { - J3DShpFlag_Visible = 0x0001, - J3DShpFlag_SkinPosCpu = 0x0004, - J3DShpFlag_SkinNrmCpu = 0x0008, - J3DShpFlag_Hidden = 0x0010, - J3DShpFlag_EnableLod = 0x0100, - J3DShpFlag_NoMtx = 0x0200, -}; - -class J3DShape { -public: - J3DShape() { - initialize(); - } - - enum { - kVcdVatDLSize = 0xC0, - }; - - /* 80314B48 */ void initialize(); - /* 80314BB8 */ void addTexMtxIndexInDL(_GXAttr, u32); - /* 80314CBC */ void addTexMtxIndexInVcd(_GXAttr); - /* 80314DA8 */ void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]); - /* 80314E28 */ u32 countBumpMtxNum() const; - /* 80314EEC */ void loadVtxArray() const; - /* 80314F5C */ bool isSameVcdVatCmd(J3DShape*); - /* 80314F98 */ void makeVtxArrayCmd(); - /* 80315260 */ void makeVcdVatCmd(); - /* 80315300 */ void loadPreDrawSetting() const; - /* 80315398 */ void setArrayAndBindPipeline() const; - - /* 803155E0 */ virtual void draw() const; - /* 8031544C */ virtual void drawFast() const; - /* 80315628 */ virtual void simpleDraw() const; - /* 803156AC */ virtual void simpleDrawCache() const; - - void onFlag(u32 flag) { mFlags |= flag; } - void offFlag(u32 flag) { mFlags &= ~flag; } - bool checkFlag(u32 flag) const { return !!(mFlags & flag); } - void setDrawMtxDataPointer(J3DDrawMtxData* pMtxData) { mDrawMtxData = pMtxData; } - void setVertexDataPointer(J3DVertexData* pVtxData) { mVertexData = pVtxData; } - void* getVcdVatCmd() const { return mVcdVatCmd; } - void setVcdVatCmd(void* pVatCmd) { mVcdVatCmd = (u8*)pVatCmd; } - void show() { offFlag(J3DShpFlag_Visible); } - void hide() { onFlag(J3DShpFlag_Visible); } - void setCurrentViewNoPtr(u32* pViewNoPtr) { mCurrentViewNo = pViewNoPtr; } - void setCurrentMtx(J3DCurrentMtx& mtx) { mCurrentMtx = mtx; } - void setScaleFlagArray(u8* pScaleFlagArray) { mScaleFlagArray = pScaleFlagArray; } - void setDrawMtx(Mtx** pDrawMtx) { mDrawMtx = pDrawMtx; } - void setNrmMtx(Mtx33** pNrmMtx) { mNrmMtx = pNrmMtx; } - void setTexMtxLoadType(u32 type) { mFlags = (mFlags & 0xFFFF0FFF) | type; } - bool getNBTFlag() const { return mHasNBT; } - u32 getBumpMtxOffset() const { return mBumpMtxOffset; } - GXVtxDescList* getVtxDesc() const { return mVtxDesc; } - - J3DMaterial* getMaterial() const { return mMaterial; } - u32 getIndex() const { return mIndex; } - u32 getPipeline() const { return (mFlags >> 2) & 0x07; } - u32 getTexMtxLoadType() const { return mFlags & 0xF000; } - u32 getMtxGroupNum() const { return mMtxGroupNum; } - J3DShapeDraw* getShapeDraw(u32 idx) const { return mShapeDraw[idx]; } - J3DShapeMtx* getShapeMtx(u32 idx) const { return mShapeMtx[idx]; } - Vec* getMin() { return &mMin; } - Vec* getMax() { return &mMax; } - - static void resetVcdVatCache() { sOldVcdVatCmd = NULL; } - - static void* sOldVcdVatCmd; - -private: - friend struct J3DShapeFactory; - friend class J3DJointTree; - - /* 0x04 */ J3DMaterial* mMaterial; - /* 0x08 */ u16 mIndex; - /* 0x0A */ u16 mMtxGroupNum; - /* 0x0C */ u32 mFlags; - /* 0x10 */ f32 mRadius; - /* 0x14 */ Vec mMin; - /* 0x20 */ Vec mMax; - /* 0x2C */ u8* mVcdVatCmd; - /* 0x30 */ GXVtxDescList* mVtxDesc; - /* 0x34 */ bool mHasNBT; - /* 0x38 */ J3DShapeMtx** mShapeMtx; - /* 0x3C */ J3DShapeDraw** mShapeDraw; - /* 0x40 */ J3DCurrentMtx mCurrentMtx; - /* 0x48 */ bool mHasPNMTXIdx; - /* 0x4C */ J3DVertexData* mVertexData; - /* 0x50 */ J3DDrawMtxData* mDrawMtxData; - /* 0x54 */ u8* mScaleFlagArray; - /* 0x58 */ Mtx** mDrawMtx; - /* 0x5C */ Mtx33** mNrmMtx; - /* 0x60 */ u32* mCurrentViewNo; - /* 0x64 */ u32 mBumpMtxOffset; -}; - -#endif /* J3DSHAPE_H */ +#ifndef J3DSHAPE_H +#define J3DSHAPE_H + +#include "JSystem/J3DGraphBase/J3DShapeDraw.h" +#include "JSystem/J3DGraphBase/J3DShapeMtx.h" +#include "dolphin/gx/GX.h" +#include "dolphin/types.h" + +class J3DCurrentMtxInfo { +public: + u32 mMtxIdxRegA; + u32 mMtxIdxRegB; +}; + +static inline void J3DFifoWriteCPCmd(u8 cmd, u32 param) { + GFX_FIFO(u8) = GX_CMD_LOAD_CP_REG; + GFX_FIFO(u8) = cmd; + GFX_FIFO(u32) = param; +} + +static inline void J3DFifoWriteXFCmd(u16 cmd, u16 len) { + GFX_FIFO(u8) = GX_CMD_LOAD_XF_REG; + GFX_FIFO(u16) = (len - 1); + GFX_FIFO(u16) = cmd; +} + +class J3DCurrentMtx : public J3DCurrentMtxInfo { +public: + J3DCurrentMtx() { + mMtxIdxRegA = 0x3cf3cf00; + mMtxIdxRegB = 0x00f3cf3c; + } + + J3DCurrentMtx& operator=(J3DCurrentMtxInfo const& info) { + mMtxIdxRegA = info.mMtxIdxRegA; + mMtxIdxRegB = info.mMtxIdxRegB; + return *this; + } + + u32 getMtxIdxRegA() const { return mMtxIdxRegA; } + u32 getMtxIdxRegB() const { return mMtxIdxRegB; } + + inline void load() const { + J3DFifoWriteCPCmd(0x30, getMtxIdxRegA()); // CP_MATINDEX_A + J3DFifoWriteCPCmd(0x40, getMtxIdxRegB()); // CP_MATINDEX_B + J3DFifoWriteXFCmd(0x1018, 2); + GFX_FIFO(u32) = getMtxIdxRegA(); + GFX_FIFO(u32) = getMtxIdxRegB(); + } + + void setCurrentTexMtx(u8 param_1, u8 param_2, u8 param_3, u8 param_4, + u8 param_5, u8 param_6, u8 param_7, u8 param_8) { + mMtxIdxRegA = ((param_1 & 0xff) << 6) | (param_2 << 0xc)| (param_3 << 0x12) | (param_4 << 0x18); + mMtxIdxRegB = (param_5) | param_6 << 6 | param_7 << 0xc | param_8 << 0x12; + } +}; + +class J3DMaterial; +class J3DVertexData; +class J3DDrawMtxData; + +enum J3DShpFlag { + J3DShpFlag_Visible = 0x0001, + J3DShpFlag_SkinPosCpu = 0x0004, + J3DShpFlag_SkinNrmCpu = 0x0008, + J3DShpFlag_Hidden = 0x0010, + J3DShpFlag_EnableLod = 0x0100, + J3DShpFlag_NoMtx = 0x0200, +}; + +class J3DShape { +public: + J3DShape() { + initialize(); + } + + enum { + kVcdVatDLSize = 0xC0, + }; + + /* 80314B48 */ void initialize(); + /* 80314BB8 */ void addTexMtxIndexInDL(_GXAttr, u32); + /* 80314CBC */ void addTexMtxIndexInVcd(_GXAttr); + /* 80314DA8 */ void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]); + /* 80314E28 */ u32 countBumpMtxNum() const; + /* 80314EEC */ void loadVtxArray() const; + /* 80314F5C */ bool isSameVcdVatCmd(J3DShape*); + /* 80314F98 */ void makeVtxArrayCmd(); + /* 80315260 */ void makeVcdVatCmd(); + /* 80315300 */ void loadPreDrawSetting() const; + /* 80315398 */ void setArrayAndBindPipeline() const; + + /* 803155E0 */ virtual void draw() const; + /* 8031544C */ virtual void drawFast() const; + /* 80315628 */ virtual void simpleDraw() const; + /* 803156AC */ virtual void simpleDrawCache() const; + + void onFlag(u32 flag) { mFlags |= flag; } + void offFlag(u32 flag) { mFlags &= ~flag; } + bool checkFlag(u32 flag) const { return !!(mFlags & flag); } + void setDrawMtxDataPointer(J3DDrawMtxData* pMtxData) { mDrawMtxData = pMtxData; } + void setVertexDataPointer(J3DVertexData* pVtxData) { mVertexData = pVtxData; } + void* getVcdVatCmd() const { return mVcdVatCmd; } + void setVcdVatCmd(void* pVatCmd) { mVcdVatCmd = (u8*)pVatCmd; } + void show() { offFlag(J3DShpFlag_Visible); } + void hide() { onFlag(J3DShpFlag_Visible); } + void setCurrentViewNoPtr(u32* pViewNoPtr) { mCurrentViewNo = pViewNoPtr; } + void setCurrentMtx(J3DCurrentMtx& mtx) { mCurrentMtx = mtx; } + void setScaleFlagArray(u8* pScaleFlagArray) { mScaleFlagArray = pScaleFlagArray; } + void setDrawMtx(Mtx** pDrawMtx) { mDrawMtx = pDrawMtx; } + void setNrmMtx(Mtx33** pNrmMtx) { mNrmMtx = pNrmMtx; } + void setTexMtxLoadType(u32 type) { mFlags = (mFlags & 0xFFFF0FFF) | type; } + bool getNBTFlag() const { return mHasNBT; } + u32 getBumpMtxOffset() const { return mBumpMtxOffset; } + GXVtxDescList* getVtxDesc() const { return mVtxDesc; } + + J3DMaterial* getMaterial() const { return mMaterial; } + u32 getIndex() const { return mIndex; } + u32 getPipeline() const { return (mFlags >> 2) & 0x07; } + u32 getTexMtxLoadType() const { return mFlags & 0xF000; } + u32 getMtxGroupNum() const { return mMtxGroupNum; } + J3DShapeDraw* getShapeDraw(u32 idx) const { return mShapeDraw[idx]; } + J3DShapeMtx* getShapeMtx(u32 idx) const { return mShapeMtx[idx]; } + Vec* getMin() { return &mMin; } + Vec* getMax() { return &mMax; } + + static void resetVcdVatCache() { sOldVcdVatCmd = NULL; } + + static void* sOldVcdVatCmd; + +private: + friend struct J3DShapeFactory; + friend class J3DJointTree; + + /* 0x04 */ J3DMaterial* mMaterial; + /* 0x08 */ u16 mIndex; + /* 0x0A */ u16 mMtxGroupNum; + /* 0x0C */ u32 mFlags; + /* 0x10 */ f32 mRadius; + /* 0x14 */ Vec mMin; + /* 0x20 */ Vec mMax; + /* 0x2C */ u8* mVcdVatCmd; + /* 0x30 */ GXVtxDescList* mVtxDesc; + /* 0x34 */ bool mHasNBT; + /* 0x38 */ J3DShapeMtx** mShapeMtx; + /* 0x3C */ J3DShapeDraw** mShapeDraw; + /* 0x40 */ J3DCurrentMtx mCurrentMtx; + /* 0x48 */ bool mHasPNMTXIdx; + /* 0x4C */ J3DVertexData* mVertexData; + /* 0x50 */ J3DDrawMtxData* mDrawMtxData; + /* 0x54 */ u8* mScaleFlagArray; + /* 0x58 */ Mtx** mDrawMtx; + /* 0x5C */ Mtx33** mNrmMtx; + /* 0x60 */ u32* mCurrentViewNo; + /* 0x64 */ u32 mBumpMtxOffset; +}; + +#endif /* J3DSHAPE_H */ diff --git a/include/JSystem/J3DGraphBase/J3DStruct.h b/include/JSystem/J3DGraphBase/J3DStruct.h index 8693afa6484..1932113cb1f 100644 --- a/include/JSystem/J3DGraphBase/J3DStruct.h +++ b/include/JSystem/J3DGraphBase/J3DStruct.h @@ -8,7 +8,7 @@ class J3DLightInfo { public: - /* 803256C4 */ void operator=(J3DLightInfo const&); + /* 803256C4 */ J3DLightInfo& operator=(J3DLightInfo const&); /* 0x00 */ Vec mLightPosition; /* 0x0C */ Vec mLightDirection; @@ -61,7 +61,7 @@ struct J3DTextureSRTInfo { }; // Size: 0x14 struct J3DTexMtxInfo { - /* 80325718 */ void operator=(J3DTexMtxInfo const&); + /* 80325718 */ J3DTexMtxInfo& operator=(J3DTexMtxInfo const&); /* 80325794 */ void setEffectMtx(Mtx); /* 0x00 */ u8 mProjection; @@ -72,14 +72,13 @@ struct J3DTexMtxInfo { }; // Size: 0x64 struct J3DIndTexMtxInfo { - /* 803257DC */ void operator=(J3DIndTexMtxInfo const&); - + J3DIndTexMtxInfo& operator=(J3DIndTexMtxInfo const&); /* 0x00 */ Mtx23 field_0x0; /* 0x18 */ u8 field_0x18; }; // Size: 0x1C struct J3DFogInfo { - /* 80325800 */ void operator=(J3DFogInfo const&); + /* 80325800 */ J3DFogInfo& operator=(J3DFogInfo const&); /* 0x00 */ u8 field_0x0; /* 0x01 */ u8 field_0x1; @@ -88,15 +87,12 @@ struct J3DFogInfo { /* 0x08 */ f32 field_0x8; /* 0x0C */ f32 field_0xc; /* 0x10 */ f32 field_0x10; - /* 0x14 */ u8 field_0x14; - /* 0x15 */ u8 field_0x15; - /* 0x16 */ u8 field_0x16; - /* 0x17 */ u8 field_0x17; - /* 0x18 */ u16 field_0x18[10]; + /* 0x14 */ GXColor field_0x14; + /* 0x18 */ GXFogAdjTable field_0x18; }; // Size: 0x2C struct J3DNBTScaleInfo { - /* 8032587C */ void operator=(J3DNBTScaleInfo const&); + /* 8032587C */ J3DNBTScaleInfo& operator=(J3DNBTScaleInfo const&); /* 0x0 */ bool mbHasScale; /* 0x4 */ Vec mScale; diff --git a/include/JSystem/J3DGraphBase/J3DTevs.h b/include/JSystem/J3DGraphBase/J3DTevs.h index 09081c52775..8d63bd4d923 100644 --- a/include/JSystem/J3DGraphBase/J3DTevs.h +++ b/include/JSystem/J3DGraphBase/J3DTevs.h @@ -12,12 +12,27 @@ struct J3DTevStageInfo { /* 0x5 */ u8 mTevAlphaOp; /* 0x6 */ u8 mTevAlphaAB; /* 0x7 */ u8 mTevSwapModeInfo; + /* 0x8 */ u8 field_0x8[0xc]; }; -struct J3DTevStage : public J3DTevStageInfo { +extern J3DTevStageInfo const j3dDefaultTevStageInfo; + +struct J3DTevStage { /* 8000E230 */ J3DTevStage(); /* 8000E298 */ void setTevStageInfo(J3DTevStageInfo const&); /* 8003AACC */ J3DTevStage(J3DTevStageInfo const&); + + void setRasSel(u8 ras_sel) { mTevSwapModeInfo = (mTevSwapModeInfo & ~3) | ras_sel; } + void setTexSel(u8 tex_sel) { mTevSwapModeInfo = (mTevSwapModeInfo & ~0xc) | (tex_sel << 2); } + + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 mTevColorOp; + /* 0x2 */ u8 mTevColorAB; + /* 0x3 */ u8 mTevColorCD; + /* 0x4 */ u8 field_0x4; + /* 0x5 */ u8 mTevAlphaOp; + /* 0x6 */ u8 mTevAlphaAB; + /* 0x7 */ u8 mTevSwapModeInfo; }; struct J3DIndTevStageInfo { @@ -30,10 +45,34 @@ struct J3DIndTevStageInfo { /* 0x6 */ u8 mPrev; /* 0x7 */ u8 mLod; /* 0x8 */ u8 mAlphaSel; + /* 0x9 */ u8 pad[3]; }; +extern J3DIndTevStageInfo const j3dDefaultIndTevStageInfo; + struct J3DIndTevStage { - /* 8000E14C */ J3DIndTevStage(); + /* 8000E14C */ J3DIndTevStage() : mInfo(0) { setIndTevStageInfo(j3dDefaultIndTevStageInfo); } + J3DIndTevStage(J3DIndTevStageInfo const& info) : mInfo(0) { setIndTevStageInfo(info); } + void setIndTevStageInfo(J3DIndTevStageInfo const& info) { + setIndStage(info.mIndStage); + setIndFormat(info.mIndFormat); + setBiasSel(info.mBiasSel); + setMtxSel(info.mMtxSel); + setWrapS(info.mWrapS); + setWrapT(info.mWrapT); + setPrev(info.mPrev); + setLod(info.mLod); + setAlphaSel(info.mAlphaSel); + } + void setIndStage(u8 indStage) { mInfo = (mInfo & ~3) | indStage; } + void setIndFormat(u8 indFormat) { mInfo = (mInfo & ~0xc) | (indFormat << 2); } + void setBiasSel(u8 biasSel) { mInfo = (mInfo & ~0x70) | (biasSel << 4); } + void setMtxSel(u8 mtxSel) { mInfo = (mInfo & ~0x1e00) | (mtxSel << 9); } + void setWrapS(u8 wrapS) { mInfo = (mInfo & ~0xe000) | (wrapS << 13); } + void setWrapT(u8 wrapT) { mInfo = (mInfo & ~0x70000) | (wrapT << 16); } + void setPrev(u8 prev) { mInfo = (mInfo & ~0x100000) | (prev << 20); } + void setLod(u8 lod) { mInfo = (mInfo & ~0x80000) | (lod << 19); } + void setAlphaSel(u8 alphaSel) { mInfo = (mInfo & ~0x180) | (alphaSel << 7); } /* 0x0 */ u32 mInfo; }; @@ -49,22 +88,42 @@ struct J3DTevOrderInfo { /* 0x3 */ u8 field_0x3; // Maybe padding }; +extern J3DTevOrderInfo j3dDefaultTevOrderInfoNull; + struct J3DTevOrder : public J3DTevOrderInfo { - /* 8000E140 */ J3DTevOrder(); - J3DTevOrder(const J3DTevOrderInfo& info) { - *(J3DTevOrderInfo*)this = info; - } + /* 8000E140 */ J3DTevOrder() : J3DTevOrderInfo(j3dDefaultTevOrderInfoNull) {} + J3DTevOrder(const J3DTevOrderInfo& info) : J3DTevOrderInfo(info) {} u8 getTexMap() { return mTexMap; } }; +struct J3DTevSwapModeTableInfo { + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 field_0x1; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; +}; // Size: 0x4 + +extern J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable; + struct J3DTevSwapModeTable { /* 8000E134 */ J3DTevSwapModeTable(); + J3DTevSwapModeTable(J3DTevSwapModeTableInfo const& info) { + field_0x0 = calcTevSwapTableID(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3); + } + u8 calcTevSwapTableID(u8 param_0, u8 param_1, u8 param_2, u8 param_3) { + return 0x40 * param_0 + 0x10 * param_1 + 4 * param_2 + param_3; + } /* 0x0 */ u8 field_0x0; }; // Size: 0x1 -struct J3DTevSwapModeInfo {}; +struct J3DTevSwapModeInfo { + /* 0x0 */ u8 mRasSel; + /* 0x1 */ u8 mTexSel; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; +}; // Size: 0x4 struct J3DNBTScale; void loadNBTScale(J3DNBTScale& param_0); diff --git a/include/JSystem/J3DGraphBase/J3DTexture.h b/include/JSystem/J3DGraphBase/J3DTexture.h index e2bf0c9052b..a37ceb8006f 100644 --- a/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/include/JSystem/J3DGraphBase/J3DTexture.h @@ -1,86 +1,86 @@ -#ifndef J3DTEXTURE_H -#define J3DTEXTURE_H - -#include "JSystem/J3DGraphBase/J3DStruct.h" -#include "JSystem/JUtility/JUTTexture.h" -#include "dolphin/mtx/mtx.h" -#include "dolphin/types.h" - -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() {} - - u16 getNum() const { return mNum; } - ResTIMG* getResTIMG(u16 entry) const { return &mpRes[entry]; } - void setResTIMG(u16 entry, const ResTIMG& timg) { - mpRes[entry] = timg; - mpRes[entry].imageOffset = ((mpRes[entry].imageOffset + (u32)&timg - (u32)(mpRes + entry))); - mpRes[entry].paletteOffset = ((mpRes[entry].paletteOffset + (u32)&timg - (u32)(mpRes + entry))); - } -}; - -class J3DTexMtx { -public: - J3DTexMtx(const J3DTexMtxInfo& info) { - mTexMtxInfo = info; - } - /* 803238C4 */ void load(u32) const; - /* 80323900 */ void calc(const Mtx); - /* 80323920 */ void calcTexMtx(const Mtx); - /* 80323C0C */ void calcPostTexMtx(const Mtx); - /* 80324358 */ void loadTexMtx(u32) const; - /* 803243BC */ void loadPostTexMtx(u32) const; - - J3DTexMtxInfo& getTexMtxInfo() { return mTexMtxInfo; } - Mtx& getMtx() { return mMtx; } - void setEffectMtx(Mtx effectMtx) { mTexMtxInfo.setEffectMtx(effectMtx); } - -private: - /* 0x00 */ J3DTexMtxInfo mTexMtxInfo; - /* 0x64 */ Mtx mMtx; -}; // Size: 0x94 - -struct J3DTexCoordInfo { - /* 0x0 */ u8 mTexGenType; - /* 0x1 */ u8 mTexGenSrc; - /* 0x2 */ u8 mTexGenMtx; - void operator=(J3DTexCoordInfo const& other) { - *(u32*) this = *(u32*)&other; - } -}; - -struct J3DTexCoord : public J3DTexCoordInfo { - /* 8000E464 */ J3DTexCoord(); - void setTexCoordInfo(J3DTexCoordInfo *param_1) { - *(J3DTexCoordInfo*)this = *param_1; - } - - u8 getTexGenType() { return mTexGenType; } - u8 getTexGenSrc() { return mTexGenSrc; } - u8 getTexGenMtx() { return mTexGenMtx & 0xff; } - u16 getTexMtxReg() { return mTexMtxReg & 0xff; } - - void resetTexMtxReg() { - mTexMtxReg = mTexGenMtx; - } - - /* 0x4 */ u16 mTexMtxReg; -}; // Size: 0x6 - -struct J3DDefaultTexCoordInfo { - /* 0x0 */ u8 mTexGenType; - /* 0x1 */ u8 mTexGenSrc; - /* 0x2 */ u8 mTexGenMtx; - /* 0x3 */ u8 pad; -}; - -#endif /* J3DTEXTURE_H */ +#ifndef J3DTEXTURE_H +#define J3DTEXTURE_H + +#include "JSystem/J3DGraphBase/J3DStruct.h" +#include "JSystem/JUtility/JUTTexture.h" +#include "dolphin/mtx/mtx.h" +#include "dolphin/types.h" + +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() {} + + u16 getNum() const { return mNum; } + ResTIMG* getResTIMG(u16 entry) const { return &mpRes[entry]; } + void setResTIMG(u16 entry, const ResTIMG& timg) { + mpRes[entry] = timg; + mpRes[entry].imageOffset = ((mpRes[entry].imageOffset + (u32)&timg - (u32)(mpRes + entry))); + mpRes[entry].paletteOffset = ((mpRes[entry].paletteOffset + (u32)&timg - (u32)(mpRes + entry))); + } +}; + +class J3DTexMtx { +public: + J3DTexMtx(const J3DTexMtxInfo& info) { + mTexMtxInfo = info; + } + /* 803238C4 */ void load(u32) const; + /* 80323900 */ void calc(const Mtx); + /* 80323920 */ void calcTexMtx(const Mtx); + /* 80323C0C */ void calcPostTexMtx(const Mtx); + /* 80324358 */ void loadTexMtx(u32) const; + /* 803243BC */ void loadPostTexMtx(u32) const; + + J3DTexMtxInfo& getTexMtxInfo() { return mTexMtxInfo; } + Mtx& getMtx() { return mMtx; } + void setEffectMtx(Mtx effectMtx) { mTexMtxInfo.setEffectMtx(effectMtx); } + +private: + /* 0x00 */ J3DTexMtxInfo mTexMtxInfo; + /* 0x64 */ Mtx mMtx; +}; // Size: 0x94 + +struct J3DTexCoordInfo { + /* 0x0 */ u8 mTexGenType; + /* 0x1 */ u8 mTexGenSrc; + /* 0x2 */ u8 mTexGenMtx; + /* 0x3 */ u8 pad; +}; + +extern J3DTexCoordInfo const j3dDefaultTexCoordInfo[8]; + +struct J3DTexCoord : public J3DTexCoordInfo { + /* 8000E464 */ J3DTexCoord() { + setTexCoordInfo(j3dDefaultTexCoordInfo[0]); + resetTexMtxReg(); + } + J3DTexCoord(J3DTexCoordInfo const& info) { + setTexCoordInfo(info); + resetTexMtxReg(); + } + void setTexCoordInfo(J3DTexCoordInfo const& info) { + __memcpy(this, &info, sizeof(J3DTexCoordInfo)); + } + + u8 getTexGenType() { return mTexGenType; } + u8 getTexGenSrc() { return mTexGenSrc; } + u8 getTexGenMtx() { return mTexGenMtx & 0xff; } + u16 getTexMtxReg() { return mTexMtxReg & 0xff; } + + void resetTexMtxReg() { + mTexMtxReg = mTexGenMtx; + } + + /* 0x4 */ u16 mTexMtxReg; +}; // Size: 0x6 + +#endif /* J3DTEXTURE_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h index f0c0e87f0c8..f1786865ee4 100644 --- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h +++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h @@ -1,10 +1,76 @@ #ifndef J3DMATERIALFACTORY_H #define J3DMATERIALFACTORY_H +#include "JSystem/J3DGraphBase/J3DMatBlock.h" #include "JSystem/J3DGraphLoader/J3DModelLoader.h" +#include "dolphin/gx/GXEnum.h" +#include "dolphin/gx/GXStruct.h" class J3DMaterial; +struct J3DMaterialInitData { + /* 0x000 */ u8 mMaterialMode; + /* 0x001 */ u8 mCullModeIdx; + /* 0x002 */ u8 mColorChanNumIdx; + /* 0x003 */ u8 mTexGenNumIdx; + /* 0x004 */ u8 mTevStageNumIdx; + /* 0x005 */ u8 mZCompLocIdx; + /* 0x006 */ u8 mZModeIdx; + /* 0x007 */ u8 mDitherIdx; + /* 0x008 */ u16 mMatColorIdx[2]; + /* 0x00C */ u16 mColorChanIdx[4]; + /* 0x014 */ u16 mAmbColorIdx[2]; + /* 0x018 */ u8 field_0x018[0x10]; + /* 0x028 */ u16 mTexCoordIdx[8]; + /* 0x038 */ u8 field_0x038[0x10]; + /* 0x048 */ u16 mTexMtxIdx[8]; + /* 0x058 */ u8 field_0x058[0x2c]; + /* 0x084 */ u16 mTexNoIdx[8]; + /* 0x094 */ u16 mTevKColorIdx[4]; + /* 0x09C */ u8 mTevKColorSel[0x10]; + /* 0x0AC */ u8 mTevKAlphaSel[0x10]; + /* 0x0BC */ u16 mTevOrderIdx[0x10]; + /* 0x0DC */ u16 mTevColorIdx[4]; + /* 0x0E4 */ u16 mTevStageIdx[0x10]; + /* 0x104 */ u16 mTevSwapModeIdx[0x10]; + /* 0x124 */ u16 mTevSwapModeTableIdx[4]; + /* 0x12C */ u8 field_0x12c[0x18]; + /* 0x144 */ u16 mFogIdx; + /* 0x146 */ u16 mAlphaCompIdx; + /* 0x148 */ u16 mBlendIdx; + /* 0x14A */ u16 mNBTScaleIdx; +}; // size 0x14C + +struct J3DIndInitData { + /* 0x000 */ bool mEnabled; + /* 0x001 */ u8 mIndTexStageNum; + /* 0x002 */ u8 field_0x002[2]; + /* 0x004 */ J3DIndTexOrderInfo mIndTexOrderInfo[3]; + /* 0x010 */ u8 field_0x010[4]; + /* 0x014 */ J3DIndTexMtxInfo mIndTexMtxInfo[3]; + /* 0x068 */ J3DIndTexCoordScaleInfo mIndTexCoordScaleInfo[3]; + /* 0x074 */ u8 field_0x074[4]; + /* 0x078 */ J3DIndTevStageInfo mIndTevStageInfo[0x10]; +}; // size 0x138 + +struct J3DPatchingInfo { + /* 0x0 */ u16 mMatColorOffset; + /* 0x2 */ u16 mColorChanOffset; + /* 0x4 */ u16 mTexMtxOffset; + /* 0x6 */ u16 mTexNoOffset; + /* 0x8 */ u16 mTevRegOffset; + /* 0xA */ u16 mFogOffset; + /* 0xC */ u8 field_0xc[4]; +}; // size 0x10 + +struct J3DDisplayListInit { + /* 0x0 */ u32 mOffset; + /* 0x4 */ u32 field_0x4; +}; // size 8 + +struct J3DTexCoord2Info; +struct J3DCurrentMtxInfo; + class J3DMaterialFactory { public: enum MaterialType { @@ -16,50 +82,87 @@ class J3DMaterialFactory { /* 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; + /* 80330304 */ u32 countTexGens(int) const; + /* 8033033C */ u32 countStages(int) const; + /* 803303C4 */ J3DMaterial* create(J3DMaterial*, MaterialType, int, u32) const; + /* 80330440 */ J3DMaterial* createNormalMaterial(J3DMaterial*, int, u32) const; + /* 80330D84 */ J3DMaterial* 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; + /* 803317D4 */ J3DMaterial* createLockedMaterial(J3DMaterial*, int, u32) const; + /* 80331A7C */ u32 calcSize(J3DMaterial*, MaterialType, int, u32) const; + /* 80331AFC */ u32 calcSizeNormalMaterial(J3DMaterial*, int, u32) const; + /* 80331C30 */ u32 calcSizePatchedMaterial(J3DMaterial*, int, u32) const; + /* 80331D00 */ u32 calcSizeLockedMaterial(J3DMaterial*, int, u32) const; + /* 80331D18 */ J3DGXColor newMatColor(int, int) const; + /* 80331D74 */ u8 newColorChanNum(int) const; + /* 80331DAC */ J3DColorChan newColorChan(int, int) const; + /* 80331F50 */ J3DGXColor newAmbColor(int, int) const; + /* 80331FAC */ u32 newTexGenNum(int) const; + /* 80331FE4 */ J3DTexCoord newTexCoord(int, int) const; + /* 80332044 */ J3DTexMtx* newTexMtx(int, int) const; + /* 803320CC */ u8 newCullMode(int) const; + /* 8033210C */ u16 newTexNo(int, int) const; + /* 80332154 */ J3DTevOrder newTevOrder(int, int) const; + /* 803321A0 */ J3DGXColorS10 newTevColor(int, int) const; + /* 80332210 */ J3DGXColor newTevKColor(int, int) const; + /* 8033226C */ u8 newTevStageNum(int) const; + /* 803322A4 */ J3DTevStage newTevStage(int, int) const; + /* 80332304 */ J3DTevSwapModeTable newTevSwapModeTable(int, int) const; + /* 803323A0 */ u8 newIndTexStageNum(int) const; + /* 803323C8 */ J3DIndTexOrder newIndTexOrder(int, int) const; + /* 8033240C */ J3DIndTexMtx newIndTexMtx(int, int) const; + /* 803324B4 */ J3DIndTevStage newIndTevStage(int, int) const; + /* 80332648 */ J3DIndTexCoordScale newIndTexCoordScale(int, int) const; + /* 8033268C */ J3DFog newFog(int) const; + /* 80332768 */ J3DAlphaComp newAlphaComp(int) const; + /* 803327E8 */ J3DBlend newBlend(int) const; + /* 8033282C */ J3DZMode newZMode(int) const; + /* 8033288C */ u8 newZCompLoc(int) const; + /* 803328C4 */ u8 newDither(int) const; + /* 803328FC */ J3DNBTScale newNBTScale(int) const; - u16 getMaterialID(int i_idx) { return mpMaterialID[i_idx]; } + u16 getMaterialID(int idx) const { return mpMaterialID[idx]; } + u8 getMaterialMode(int idx) const { return mpMaterialInitData[mpMaterialID[idx]].mMaterialMode; } + + static u32 getMdlDataFlag_TevStageNum(u32 flags) { return (flags >> 0x10) & 0x1f; } + static u32 getMdlDataFlag_TexGenFlag(u32 flags) { return flags & 0x0c000000; } + static u32 getMdlDataFlag_ColorFlag(u32 flags) { return flags & 0xc0000000; } + static u32 getMdlDataFlag_PEFlag(u32 flags) { return flags & 0x30000000; } - /* 0x00 */ u8 field_0x00[8]; + /* 0x00 */ u16 mMaterialNum; + /* 0x04 */ J3DMaterialInitData* mpMaterialInitData; /* 0x08 */ u16* mpMaterialID; - /* 0x0C */ u8 field_0x0c[0x7C]; + /* 0x0C */ J3DIndInitData* mpIndInitData; + /* 0x10 */ GXColor* mpMatColor; + /* 0x14 */ u8* mpColorChanNum; + /* 0x18 */ J3DColorChanInfo* mpColorChanInfo; + /* 0x1C */ GXColor* mpAmbColor; + /* 0x20 */ J3DLightInfo* mpLightInfo; + /* 0x24 */ u8* mpTexGenNum; + /* 0x28 */ J3DTexCoordInfo* mpTexCoordInfo; + /* 0x2C */ J3DTexCoord2Info* mpTexCoord2Info; + /* 0x30 */ J3DTexMtxInfo* mpTexMtxInfo; + /* 0x34 */ J3DTexMtxInfo* field_0x34; + /* 0x38 */ u16* mpTexNo; + /* 0x3C */ GXCullMode* mpCullMode; + /* 0x40 */ J3DTevOrderInfo* mpTevOrderInfo; + /* 0x44 */ GXColorS10* mpTevColor; + /* 0x48 */ GXColor* mpTevKColor; + /* 0x4C */ u8* mpTevStageNum; + /* 0x50 */ J3DTevStageInfo* mpTevStageInfo; + /* 0x54 */ J3DTevSwapModeInfo* mpTevSwapModeInfo; + /* 0x58 */ J3DTevSwapModeTableInfo* mpTevSwapModeTableInfo; + /* 0x5C */ J3DFogInfo* mpFogInfo; + /* 0x60 */ J3DAlphaCompInfo* mpAlphaCompInfo; + /* 0x64 */ J3DBlendInfo* mpBlendInfo; + /* 0x68 */ J3DZModeInfo* mpZModeInfo; + /* 0x6C */ u8* mpZCompLoc; + /* 0x70 */ u8* mpDither; + /* 0x74 */ J3DNBTScaleInfo* mpNBTScaleInfo; + /* 0x78 */ J3DDisplayListInit* mpDisplayListInit; + /* 0x7C */ J3DPatchingInfo* mpPatchingInfo; + /* 0x80 */ J3DCurrentMtxInfo* mpCurrentMtxInfo; + /* 0x84 */ u8* mpMaterialMode; }; #endif /* J3DMATERIALFACTORY_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h index a2126d3a1e1..b44d012084f 100644 --- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h +++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h @@ -1,92 +1,107 @@ -#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 */ +#ifndef J3DMATERIALFACTORY_V21_H +#define J3DMATERIALFACTORY_V21_H + +#include "JSystem/J3DGraphBase/J3DMatBlock.h" +#include "JSystem/J3DGraphLoader/J3DModelLoader.h" +#include "dolphin/gx/GXEnum.h" +#include "dolphin/gx/GXStruct.h" + +class J3DMaterial; +struct J3DTexCoord2Info; +struct J3DCurrentMtxInfo; + +struct J3DMaterialInitData_v21 { + /* 0x000 */ u8 mMaterialMode; + /* 0x001 */ u8 mCullModeIdx; + /* 0x002 */ u8 mColorChanNumIdx; + /* 0x003 */ u8 mTexGenNumIdx; + /* 0x004 */ u8 mTevStageNumIdx; + /* 0x005 */ u8 mZCompLocIdx; + /* 0x006 */ u8 mZModeIdx; + /* 0x007 */ u8 mDitherIdx; + /* 0x008 */ u16 mMatColorIdx[2]; + /* 0x00C */ u16 mColorChanIdx[4]; + /* 0x014 */ u16 mTexCoordIdx[8]; + /* 0x024 */ u8 field_0x038[0x10]; + /* 0x034 */ u16 mTexMtxIdx[8]; + /* 0x044 */ u8 field_0x058[0x2c]; + /* 0x070 */ u16 mTexNoIdx[8]; + /* 0x080 */ u16 mTevKColorIdx[4]; + /* 0x088 */ u8 mTevKColorSel[0x10]; + /* 0x098 */ u8 mTevKAlphaSel[0x10]; + /* 0x0A8 */ u16 mTevOrderIdx[0x10]; + /* 0x0C8 */ u16 mTevColorIdx[4]; + /* 0x0D0 */ u16 mTevStageIdx[0x10]; + /* 0x0F0 */ u16 mTevSwapModeIdx[0x10]; + /* 0x110 */ u16 mTevSwapModeTableIdx[4]; + /* 0x118 */ u8 field_0x12c[0x18]; + /* 0x130 */ u16 mFogIdx; + /* 0x132 */ u16 mAlphaCompIdx; + /* 0x134 */ u16 mBlendIdx; + /* 0x136 */ u16 mNBTScaleIdx; +}; // size 0x138 + +class J3DMaterialFactory_v21 { +public: + /* 80332DA4 */ J3DMaterialFactory_v21(J3DMaterialBlock_v21 const&); + /* 80332F84 */ u16 countUniqueMaterials(); + /* 80332FA8 */ u32 countTexGens(int) const; + /* 80332FE0 */ u32 countStages(int) const; + /* 80333068 */ J3DMaterial* create(J3DMaterial*, int, u32) const; + /* 803337D8 */ J3DGXColor newMatColor(int, int) const; + /* 80333834 */ u8 newColorChanNum(int) const; + /* 8033386C */ J3DColorChan newColorChan(int, int) const; + /* 80333A10 */ u32 newTexGenNum(int) const; + /* 80333A48 */ J3DTexCoord newTexCoord(int, int) const; + /* 80333AA8 */ J3DTexMtx* newTexMtx(int, int) const; + /* 80333B30 */ u8 newCullMode(int) const; + /* 80333B70 */ u16 newTexNo(int, int) const; + /* 80333BB8 */ J3DTevOrder newTevOrder(int, int) const; + /* 80333C04 */ J3DGXColorS10 newTevColor(int, int) const; + /* 80333C74 */ J3DGXColor newTevKColor(int, int) const; + /* 80333CD0 */ u8 newTevStageNum(int) const; + /* 80333D08 */ J3DTevStage newTevStage(int, int) const; + /* 80333D68 */ J3DTevSwapModeTable newTevSwapModeTable(int, int) const; + /* 80333E04 */ J3DFog newFog(int) const; + /* 80333EE0 */ J3DAlphaComp newAlphaComp(int) const; + /* 80333F60 */ J3DBlend newBlend(int) const; + /* 80333FA4 */ J3DZMode newZMode(int) const; + /* 80334004 */ u8 newZCompLoc(int) const; + /* 8033403C */ u8 newDither(int) const; + /* 80334074 */ J3DNBTScale newNBTScale(int) const; + + u16 getMaterialID(u16 idx) { return mpMaterialID[idx]; } + + /* 0x00 */ u16 mMaterialNum; + /* 0x04 */ J3DMaterialInitData_v21* mpMaterialInitData; + /* 0x08 */ u16* mpMaterialID; + /* 0x0C */ GXColor* mpMatColor; + /* 0x10 */ u8* mpColorChanNum; + /* 0x14 */ J3DColorChanInfo* mpColorChanInfo; + /* 0x18 */ u8* mpTexGenNum; + /* 0x1C */ J3DTexCoordInfo* mpTexCoordInfo; + /* 0x20 */ J3DTexCoord2Info* mpTexCoord2Info; + /* 0x24 */ J3DTexMtxInfo* mpTexMtxInfo; + /* 0x28 */ J3DTexMtxInfo* field_0x28; + /* 0x2C */ u16* mpTexNo; + /* 0x30 */ GXCullMode* mpCullMode; + /* 0x34 */ J3DTevOrderInfo* mpTevOrderInfo; + /* 0x38 */ GXColorS10* mpTevColor; + /* 0x3C */ GXColor* mpTevKColor; + /* 0x40 */ u8* mpTevStageNum; + /* 0x44 */ J3DTevStageInfo* mpTevStageInfo; + /* 0x48 */ J3DTevSwapModeInfo* mpTevSwapModeInfo; + /* 0x4C */ J3DTevSwapModeTableInfo* mpTevSwapModeTableInfo; + /* 0x50 */ J3DFogInfo* mpFogInfo; + /* 0x54 */ J3DAlphaCompInfo* mpAlphaCompInfo; + /* 0x58 */ J3DBlendInfo* mpBlendInfo; + /* 0x5C */ J3DZModeInfo* mpZModeInfo; + /* 0x60 */ u8* mpZCompLoc; + /* 0x64 */ u8* mpDither; + /* 0x68 */ J3DNBTScaleInfo* mpNBTScaleInfo; + /* 0x6C */ u16 field_0x6c; + /* 0x6E */ u8 field_0x6e; + /* 0x6F */ u8 field_0x6f; +}; + +#endif /* J3DMATERIALFACTORY_V21_H */ diff --git a/include/JSystem/J3DGraphLoader/J3DModelLoader.h b/include/JSystem/J3DGraphLoader/J3DModelLoader.h index 6913516d935..1ebc2614bbb 100644 --- a/include/JSystem/J3DGraphLoader/J3DModelLoader.h +++ b/include/JSystem/J3DGraphLoader/J3DModelLoader.h @@ -1,227 +1,249 @@ -#ifndef J3DMODELLOADER_H -#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 J3DModelData* load(void const* i_data, u32 i_flags); -}; - -#endif /* J3DMODELLOADER_H */ +#ifndef J3DMODELLOADER_H +#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* mpMaterialInitData; + /* 0x10 */ void* mpMaterialID; + /* 0x14 */ void* mpNameTable; + /* 0x18 */ void* mpCullMode; + /* 0x1C */ void* mpMatColor; + /* 0x20 */ void* mpColorChanNum; + /* 0x24 */ void* mpColorChanInfo; + /* 0x28 */ void* mpTexGenNum; + /* 0x2C */ void* mpTexCoordInfo; + /* 0x30 */ void* mpTexCoord2Info; + /* 0x34 */ void* mpTexMtxInfo; + /* 0x38 */ void* field_0x38; + /* 0x3C */ void* mpTexNo; + /* 0x40 */ void* mpTevOrderInfo; + /* 0x44 */ void* mpTevColor; + /* 0x48 */ void* mpTevKColor; + /* 0x4C */ void* mpTevStageNum; + /* 0x50 */ void* mpTevStageInfo; + /* 0x54 */ void* mpTevSwapModeInfo; + /* 0x58 */ void* mpTevSwapModeTableInfo; + /* 0x5C */ void* mpFogInfo; + /* 0x60 */ void* mpAlphaCompInfo; + /* 0x64 */ void* mpBlendInfo; + /* 0x68 */ void* mpZModeInfo; + /* 0x6C */ void* mpZCompLoc; + /* 0x70 */ void* mpDither; + /* 0x74 */ void* mpNBTScaleInfo; +}; + +struct J3DMaterialDLBlock : public J3DModelBlock { + /* 0x08 */ u16 mMaterialNum; + /* 0x0C */ void* mpDisplayListInit; + /* 0x10 */ void* mpPatchingInfo; + /* 0x14 */ void* mpCurrentMtxInfo; + /* 0x18 */ void* mpMaterialMode; + /* 0x1C */ void* field_0x1c; + /* 0x20 */ void* mpNameTable; +}; + +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 J3DModelData* load(void const* i_data, u32 i_flags); +}; + +#endif /* J3DMODELLOADER_H */ diff --git a/include/m_Do/m_Do_lib.h b/include/m_Do/m_Do_lib.h index 7a3d291a4ec..feb722be30e 100644 --- a/include/m_Do/m_Do_lib.h +++ b/include/m_Do/m_Do_lib.h @@ -44,8 +44,4 @@ u8 mDoLib_setResTimgObj(ResTIMG const* res, GXTexObj* o_texObj, u32 tlut_name, GXTlutObj* o_tlutObj); void mDoLib_pos2camera(Vec* src, Vec* dst); -inline u32 calcAlphaCmpID(u32 param_1, u32 param_2, u32 param_3) { - return ((param_1 & 0xff) << 5) + ((param_2 & 0xff) << 3) + (param_3 & 0xff); -} - #endif /* M_DO_M_DO_LIB_H */ diff --git a/libs/JSystem/J3DGraphBase/J3DMaterial.cpp b/libs/JSystem/J3DGraphBase/J3DMaterial.cpp index 16175bd8b84..04e1367dac4 100644 --- a/libs/JSystem/J3DGraphBase/J3DMaterial.cpp +++ b/libs/JSystem/J3DGraphBase/J3DMaterial.cpp @@ -1,1328 +1,1332 @@ -// -// Generated By: dol2asm -// Translation Unit: J3DMaterial -// - -#include "JSystem/J3DGraphBase/J3DMaterial.h" -#include "JSystem/J3DGraphBase/J3DGD.h" -#include "dol2asm.h" - -// -// Forward References: -// - -extern "C" void createColorBlock__11J3DMaterialFUl(); -extern "C" void createTexGenBlock__11J3DMaterialFUl(); -extern "C" void createTevBlock__11J3DMaterialFi(); -extern "C" void createIndBlock__11J3DMaterialFi(); -extern "C" void createPEBlock__11J3DMaterialFUlUl(); -extern "C" void calcSizeColorBlock__11J3DMaterialFUl(); -extern "C" void calcSizeTexGenBlock__11J3DMaterialFUl(); -extern "C" void calcSizeTevBlock__11J3DMaterialFi(); -extern "C" void calcSizeIndBlock__11J3DMaterialFi(); -extern "C" void calcSizePEBlock__11J3DMaterialFUlUl(); -extern "C" void initialize__11J3DMaterialFv(); -extern "C" void countDLSize__11J3DMaterialFv(); -extern "C" void makeDisplayList_private__11J3DMaterialFP17J3DDisplayListObj(); -extern "C" void makeDisplayList__11J3DMaterialFv(); -extern "C" void makeSharedDisplayList__11J3DMaterialFv(); -extern "C" void load__11J3DMaterialFv(); -extern "C" void loadSharedDL__11J3DMaterialFv(); -extern "C" void patch__11J3DMaterialFv(); -extern "C" void diff__11J3DMaterialFUl(); -extern "C" void calc__11J3DMaterialFPA4_Cf(); -extern "C" void calcDiffTexMtx__11J3DMaterialFPA4_Cf(); -extern "C" void setCurrentMtx__11J3DMaterialFv(); -extern "C" void calcCurrentMtx__11J3DMaterialFv(); -extern "C" void copy__11J3DMaterialFP11J3DMaterial(); -extern "C" void reset__11J3DMaterialFv(); -extern "C" void change__11J3DMaterialFv(); -extern "C" void newSharedDisplayList__11J3DMaterialFUl(); -extern "C" void newSingleSharedDisplayList__11J3DMaterialFUl(); -extern "C" void initialize__18J3DPatchedMaterialFv(); -extern "C" void makeDisplayList__18J3DPatchedMaterialFv(); -extern "C" void makeSharedDisplayList__18J3DPatchedMaterialFv(); -extern "C" void load__18J3DPatchedMaterialFv(); -extern "C" void loadSharedDL__18J3DPatchedMaterialFv(); -extern "C" void reset__18J3DPatchedMaterialFv(); -extern "C" void change__18J3DPatchedMaterialFv(); -extern "C" void initialize__17J3DLockedMaterialFv(); -extern "C" void makeDisplayList__17J3DLockedMaterialFv(); -extern "C" void makeSharedDisplayList__17J3DLockedMaterialFv(); -extern "C" void load__17J3DLockedMaterialFv(); -extern "C" void loadSharedDL__17J3DLockedMaterialFv(); -extern "C" void patch__17J3DLockedMaterialFv(); -extern "C" void diff__17J3DLockedMaterialFUl(); -extern "C" void calc__17J3DLockedMaterialFPA4_Cf(); -extern "C" void reset__17J3DLockedMaterialFv(); -extern "C" void change__17J3DLockedMaterialFv(); -extern "C" void __dt__21J3DColorBlockLightOffFv(); -extern "C" void __dt__13J3DColorBlockFv(); -extern "C" void __dt__21J3DTexGenBlockPatchedFv(); -extern "C" void __dt__14J3DTexGenBlockFv(); -extern "C" void __dt__11J3DTevBlockFv(); -extern "C" void __dt__11J3DIndBlockFv(); -extern "C" void __dt__10J3DPEBlockFv(); -extern "C" bool countDLSize__14J3DTexGenBlockFv(); -extern "C" bool countDLSize__13J3DColorBlockFv(); -extern "C" bool countDLSize__11J3DTevBlockFv(); -extern "C" bool countDLSize__11J3DIndBlockFv(); -extern "C" bool countDLSize__10J3DPEBlockFv(); -extern "C" void load__13J3DColorBlockFv(); -extern "C" s32 getCullMode__13J3DColorBlockCFv(); -extern "C" void load__11J3DTevBlockFv(); -extern "C" J3DNBTScale* getNBTScale__14J3DTexGenBlockFv(); -extern "C" void patch__13J3DColorBlockFv(); -extern "C" void diff__13J3DColorBlockFUl(); -extern "C" void diff__10J3DPEBlockFUl(); -extern "C" void reset__10J3DPEBlockFP10J3DPEBlock(); -extern "C" void reset__11J3DIndBlockFP11J3DIndBlock(); -extern "C" void reset__11J3DTevBlockFP11J3DTevBlock(J3DTevBlock* param_0); -extern "C" void reset__14J3DTexGenBlockFP14J3DTexGenBlock(); -extern "C" void reset__13J3DColorBlockFP13J3DColorBlock(); -extern "C" void diffFog__10J3DPEBlockFv(); -extern "C" void diffBlend__10J3DPEBlockFv(); -extern "C" void setFog__10J3DPEBlockFP6J3DFog(); -extern "C" void setFog__10J3DPEBlockF6J3DFog(); -extern "C" void setAlphaComp__10J3DPEBlockFPC12J3DAlphaComp(); -extern "C" void setBlend__10J3DPEBlockFPC8J3DBlend(); -extern "C" void setZMode__10J3DPEBlockFPC8J3DZMode(); -extern "C" void setZCompLoc__10J3DPEBlockFPCUc(); -extern "C" void setDither__10J3DPEBlockFUc(); -extern "C" void setDither__10J3DPEBlockFPCUc(); -extern "C" bool getDither__10J3DPEBlockCFv(); -extern "C" bool getFogOffset__10J3DPEBlockCFv(); -extern "C" void setFogOffset__10J3DPEBlockFUl(); -extern "C" void diff__15J3DIndBlockNullFUl(); -extern "C" void load__15J3DIndBlockNullFv(); -extern "C" void reset__15J3DIndBlockNullFP11J3DIndBlock(); -extern "C" void getType__15J3DIndBlockNullFv(); -extern "C" void __dt__15J3DIndBlockNullFv(); -extern "C" void setIndTexOrder__11J3DIndBlockFUlPC14J3DIndTexOrder(); -extern "C" void setIndTexOrder__11J3DIndBlockFUl14J3DIndTexOrder(); -extern "C" void setIndTexMtx__11J3DIndBlockFUlPC12J3DIndTexMtx(); -extern "C" void setIndTexCoordScale__11J3DIndBlockFUlPC19J3DIndTexCoordScale(); -extern "C" void setTexGenNum__14J3DTexGenBlockFPCUl(); -extern "C" void setNBTScale__14J3DTexGenBlockF11J3DNBTScale(); -extern "C" void setNBTScale__14J3DTexGenBlockFPC11J3DNBTScale(); -extern "C" bool getTexMtxOffset__14J3DTexGenBlockCFv(); -extern "C" void setTexMtxOffset__14J3DTexGenBlockFUl(); -extern "C" void patchMatColor__13J3DColorBlockFv(); -extern "C" void diffAmbColor__13J3DColorBlockFv(); -extern "C" void diffMatColor__13J3DColorBlockFv(); -extern "C" void diffColorChan__13J3DColorBlockFv(); -extern "C" void diffLightObj__13J3DColorBlockFUl(); -extern "C" void setMatColor__13J3DColorBlockFUlPC10J3DGXColor(); -extern "C" void setColorChanNum__13J3DColorBlockFPCUc(); -extern "C" void setColorChan__13J3DColorBlockFUlPC12J3DColorChan(); -extern "C" bool getLight__13J3DColorBlockFUl(); -extern "C" void setCullMode__13J3DColorBlockFUc(); -extern "C" void setCullMode__13J3DColorBlockFPCUc(); -extern "C" bool getMatColorOffset__13J3DColorBlockCFv(); -extern "C" bool getColorChanOffset__13J3DColorBlockCFv(); -extern "C" void setMatColorOffset__13J3DColorBlockFUl(); -extern "C" void setColorChanOffset__13J3DColorBlockFUl(); - -// -// External References: -// - -extern "C" void patch__10J3DPEBlockFv(); -extern "C" void patchLight__13J3DColorBlockFv(); -extern "C" bool getZCompLoc__10J3DPEBlockCFv(); -extern "C" bool getZMode__10J3DPEBlockFv(); -extern "C" bool getBlend__10J3DPEBlockFv(); -extern "C" bool getAlphaComp__10J3DPEBlockFv(); -extern "C" bool getFog__10J3DPEBlockFv(); -extern "C" bool getIndTexCoordScale__11J3DIndBlockFUl(); -extern "C" bool getIndTexMtx__11J3DIndBlockFUl(); -extern "C" bool getIndTexOrder__11J3DIndBlockFUl(); -extern "C" bool getIndTexStageNum__11J3DIndBlockCFv(); -extern "C" bool getTexMtx__14J3DTexGenBlockFUl(); -extern "C" bool getTexCoord__14J3DTexGenBlockFUl(); -extern "C" bool getTexGenNum__14J3DTexGenBlockCFv(); -extern "C" bool getAmbColor__13J3DColorBlockFUl(); -extern "C" bool getColorChan__13J3DColorBlockFUl(); -extern "C" bool getMatColor__13J3DColorBlockFUl(); -extern "C" bool getColorChanNum__13J3DColorBlockCFv(); -extern "C" void setZCompLoc__10J3DPEBlockFUc(); -extern "C" void setZMode__10J3DPEBlockF8J3DZMode(); -extern "C" void setBlend__10J3DPEBlockFRC8J3DBlend(); -extern "C" void setAlphaComp__10J3DPEBlockFRC12J3DAlphaComp(); -extern "C" void setIndTexCoordScale__11J3DIndBlockFUl19J3DIndTexCoordScale(); -extern "C" void __dt__19J3DIndTexCoordScaleFv(); -extern "C" void setIndTexMtx__11J3DIndBlockFUl12J3DIndTexMtx(); -extern "C" void __dt__12J3DIndTexMtxFv(); -extern "C" void setIndTexStageNum__11J3DIndBlockFUc(); -extern "C" void setTexCoord__14J3DTexGenBlockFUlPC11J3DTexCoord(); -extern "C" void setTexGenNum__14J3DTexGenBlockFUl(); -extern "C" void setAmbColor__13J3DColorBlockFUl10J3DGXColor(); -extern "C" void setColorChan__13J3DColorBlockFUlRC12J3DColorChan(); -extern "C" void setMatColor__13J3DColorBlockFUl10J3DGXColor(); -extern "C" void setColorChanNum__13J3DColorBlockFUc(); -extern "C" void __ct__19J3DIndTexCoordScaleFv(); -extern "C" void __ct__12J3DIndTexMtxFv(); -extern "C" void __ct__14J3DIndTexOrderFv(); -extern "C" void __ct__19J3DTevSwapModeTableFv(); -extern "C" void __ct__11J3DTevOrderFv(); -extern "C" void __ct__14J3DIndTevStageFv(); -extern "C" void __ct__11J3DTevStageFv(); -extern "C" void __ct__13J3DGXColorS10Fv(); -extern "C" void __ct__11J3DTexCoordFv(); -extern "C" void __ct__12J3DColorChanFv(); -extern "C" void __ct__10J3DGXColorFv(); -extern "C" void setTexMtx__14J3DTexGenBlockFUlP9J3DTexMtx(); -extern "C" void setLight__13J3DColorBlockFUlP11J3DLightObj(); -extern "C" void setAmbColor__13J3DColorBlockFUlPC10J3DGXColor(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void J3DGDSetGenMode__FUcUcUcUc11_GXCullMode(); -extern "C" void J3DGDSetGenMode_3Param__FUcUcUc(); -extern "C" void newDisplayList__17J3DDisplayListObjFUl(); -extern "C" void newSingleDisplayList__17J3DDisplayListObjFUl(); -extern "C" void callDL__17J3DDisplayListObjCFv(); -extern "C" void beginDL__17J3DDisplayListObjFv(); -extern "C" void endDL__17J3DDisplayListObjFv(); -extern "C" void beginPatch__17J3DDisplayListObjFv(); -extern "C" void endPatch__17J3DDisplayListObjFv(); -extern "C" void beginDiff__12J3DMatPacketFv(); -extern "C" void endDiff__12J3DMatPacketFv(); -extern "C" void initialize__21J3DColorBlockLightOffFv(); -extern "C" void initialize__22J3DColorBlockAmbientOnFv(); -extern "C" void initialize__20J3DColorBlockLightOnFv(); -extern "C" void initialize__21J3DTexGenBlockPatchedFv(); -extern "C" void initialize__15J3DTexGenBlock4Fv(); -extern "C" void initialize__19J3DTexGenBlockBasicFv(); -extern "C" void initialize__12J3DTevBlock1Fv(); -extern "C" void initialize__12J3DTevBlock2Fv(); -extern "C" void initialize__12J3DTevBlock4Fv(); -extern "C" void initialize__13J3DTevBlock16Fv(); -extern "C" void initialize__15J3DIndBlockFullFv(); -extern "C" void initialize__16J3DPEBlockFogOffFv(); -extern "C" void initialize__14J3DPEBlockFullFv(); -extern "C" void loadNBTScale__FR11J3DNBTScale(); -extern "C" void __as__10J3DFogInfoFRC10J3DFogInfo(); -extern "C" void __construct_array(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__14J3DPEBlockFull[31]; -extern "C" extern void* __vt__16J3DPEBlockFogOff[31]; -extern "C" extern void* __vt__13J3DTevBlock16[55]; -extern "C" extern void* __vt__12J3DTevBlock4[55]; -extern "C" extern void* __vt__12J3DTevBlock2[55]; -extern "C" extern void* __vt__12J3DTevBlock1[55]; -extern "C" extern void* __vt__19J3DTexGenBlockBasic[27]; -extern "C" extern void* __vt__15J3DTexGenBlock4[27]; -extern "C" extern void* __vt__21J3DTexGenBlockPatched[27]; -extern "C" extern void* __vt__20J3DColorBlockLightOn[36]; -extern "C" extern void* __vt__22J3DColorBlockAmbientOn[36]; -extern "C" extern void* __vt__13J3DPEBlockXlu[31]; -extern "C" extern void* __vt__17J3DPEBlockTexEdge[31]; -extern "C" extern void* __vt__13J3DPEBlockOpa[31]; -extern "C" extern void* __vt__15J3DIndBlockFull[19]; -extern "C" extern void* __vt__11J3DTevBlock[55]; -extern "C" extern void* __vt__21J3DColorBlockLightOff[36 + 1 /* padding */]; - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 803CDC90-803CDCC0 02ADB0 0030+00 0/0 1/1 0/0 .data __vt__17J3DLockedMaterial */ -SECTION_DATA extern void* __vt__17J3DLockedMaterial[12] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)calc__17J3DLockedMaterialFPA4_Cf, - (void*)calcDiffTexMtx__11J3DMaterialFPA4_Cf, - (void*)makeDisplayList__17J3DLockedMaterialFv, - (void*)makeSharedDisplayList__17J3DLockedMaterialFv, - (void*)load__17J3DLockedMaterialFv, - (void*)loadSharedDL__17J3DLockedMaterialFv, - (void*)patch__17J3DLockedMaterialFv, - (void*)diff__17J3DLockedMaterialFUl, - (void*)reset__17J3DLockedMaterialFv, - (void*)change__17J3DLockedMaterialFv, -}; - -/* 803CDCC0-803CDCF0 02ADE0 0030+00 0/0 1/1 0/0 .data __vt__18J3DPatchedMaterial */ -SECTION_DATA extern void* __vt__18J3DPatchedMaterial[12] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)calc__11J3DMaterialFPA4_Cf, - (void*)calcDiffTexMtx__11J3DMaterialFPA4_Cf, - (void*)makeDisplayList__18J3DPatchedMaterialFv, - (void*)makeSharedDisplayList__18J3DPatchedMaterialFv, - (void*)load__18J3DPatchedMaterialFv, - (void*)loadSharedDL__18J3DPatchedMaterialFv, - (void*)patch__11J3DMaterialFv, - (void*)diff__11J3DMaterialFUl, - (void*)reset__18J3DPatchedMaterialFv, - (void*)change__18J3DPatchedMaterialFv, -}; - -/* 803CDCF0-803CDD20 02AE10 0030+00 0/0 6/6 0/0 .data __vt__11J3DMaterial */ -SECTION_DATA extern void* __vt__11J3DMaterial[12] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)calc__11J3DMaterialFPA4_Cf, - (void*)calcDiffTexMtx__11J3DMaterialFPA4_Cf, - (void*)makeDisplayList__11J3DMaterialFv, - (void*)makeSharedDisplayList__11J3DMaterialFv, - (void*)load__11J3DMaterialFv, - (void*)loadSharedDL__11J3DMaterialFv, - (void*)patch__11J3DMaterialFv, - (void*)diff__11J3DMaterialFUl, - (void*)reset__11J3DMaterialFv, - (void*)change__11J3DMaterialFv, -}; - -/* 803CDD20-803CDD9C 02AE40 007C+00 2/2 7/7 0/0 .data __vt__10J3DPEBlock */ -SECTION_DATA extern void* __vt__10J3DPEBlock[31] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)reset__10J3DPEBlockFP10J3DPEBlock, - (void*)NULL, - (void*)patch__10J3DPEBlockFv, - (void*)diff__10J3DPEBlockFUl, - (void*)diffFog__10J3DPEBlockFv, - (void*)diffBlend__10J3DPEBlockFv, - (void*)countDLSize__10J3DPEBlockFv, - (void*)NULL, - (void*)setFog__10J3DPEBlockF6J3DFog, - (void*)setFog__10J3DPEBlockFP6J3DFog, - (void*)getFog__10J3DPEBlockFv, - (void*)setAlphaComp__10J3DPEBlockFPC12J3DAlphaComp, - (void*)setAlphaComp__10J3DPEBlockFRC12J3DAlphaComp, - (void*)getAlphaComp__10J3DPEBlockFv, - (void*)setBlend__10J3DPEBlockFPC8J3DBlend, - (void*)setBlend__10J3DPEBlockFRC8J3DBlend, - (void*)getBlend__10J3DPEBlockFv, - (void*)setZMode__10J3DPEBlockFPC8J3DZMode, - (void*)setZMode__10J3DPEBlockF8J3DZMode, - (void*)getZMode__10J3DPEBlockFv, - (void*)setZCompLoc__10J3DPEBlockFPCUc, - (void*)setZCompLoc__10J3DPEBlockFUc, - (void*)getZCompLoc__10J3DPEBlockCFv, - (void*)setDither__10J3DPEBlockFPCUc, - (void*)setDither__10J3DPEBlockFUc, - (void*)getDither__10J3DPEBlockCFv, - (void*)getFogOffset__10J3DPEBlockCFv, - (void*)setFogOffset__10J3DPEBlockFUl, - (void*)__dt__10J3DPEBlockFv, -}; - -/* 803CDD9C-803CDDE8 02AEBC 004C+00 2/2 1/1 0/0 .data __vt__15J3DIndBlockNull */ -SECTION_DATA extern void* __vt__15J3DIndBlockNull[19] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)reset__15J3DIndBlockNullFP11J3DIndBlock, - (void*)diff__15J3DIndBlockNullFUl, - (void*)load__15J3DIndBlockNullFv, - (void*)countDLSize__11J3DIndBlockFv, - (void*)getType__15J3DIndBlockNullFv, - (void*)setIndTexStageNum__11J3DIndBlockFUc, - (void*)getIndTexStageNum__11J3DIndBlockCFv, - (void*)setIndTexOrder__11J3DIndBlockFUl14J3DIndTexOrder, - (void*)setIndTexOrder__11J3DIndBlockFUlPC14J3DIndTexOrder, - (void*)getIndTexOrder__11J3DIndBlockFUl, - (void*)setIndTexMtx__11J3DIndBlockFUlPC12J3DIndTexMtx, - (void*)setIndTexMtx__11J3DIndBlockFUl12J3DIndTexMtx, - (void*)getIndTexMtx__11J3DIndBlockFUl, - (void*)setIndTexCoordScale__11J3DIndBlockFUlPC19J3DIndTexCoordScale, - (void*)setIndTexCoordScale__11J3DIndBlockFUl19J3DIndTexCoordScale, - (void*)getIndTexCoordScale__11J3DIndBlockFUl, - (void*)__dt__15J3DIndBlockNullFv, -}; - -/* 803CDDE8-803CDE34 02AF08 004C+00 3/3 2/2 0/0 .data __vt__11J3DIndBlock */ -SECTION_DATA extern void* __vt__11J3DIndBlock[19] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)reset__11J3DIndBlockFP11J3DIndBlock, - (void*)NULL, - (void*)NULL, - (void*)countDLSize__11J3DIndBlockFv, - (void*)NULL, - (void*)setIndTexStageNum__11J3DIndBlockFUc, - (void*)getIndTexStageNum__11J3DIndBlockCFv, - (void*)setIndTexOrder__11J3DIndBlockFUl14J3DIndTexOrder, - (void*)setIndTexOrder__11J3DIndBlockFUlPC14J3DIndTexOrder, - (void*)getIndTexOrder__11J3DIndBlockFUl, - (void*)setIndTexMtx__11J3DIndBlockFUlPC12J3DIndTexMtx, - (void*)setIndTexMtx__11J3DIndBlockFUl12J3DIndTexMtx, - (void*)getIndTexMtx__11J3DIndBlockFUl, - (void*)setIndTexCoordScale__11J3DIndBlockFUlPC19J3DIndTexCoordScale, - (void*)setIndTexCoordScale__11J3DIndBlockFUl19J3DIndTexCoordScale, - (void*)getIndTexCoordScale__11J3DIndBlockFUl, - (void*)__dt__11J3DIndBlockFv, -}; - -/* 803CDE34-803CDEA0 02AF54 006C+00 3/3 5/5 0/0 .data __vt__14J3DTexGenBlock */ -SECTION_DATA extern void* __vt__14J3DTexGenBlock[27] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)reset__14J3DTexGenBlockFP14J3DTexGenBlock, - (void*)NULL, - (void*)NULL, - (void*)NULL, - (void*)NULL, - (void*)NULL, - (void*)NULL, - (void*)NULL, - (void*)NULL, - (void*)NULL, - (void*)countDLSize__14J3DTexGenBlockFv, - (void*)NULL, - (void*)setTexGenNum__14J3DTexGenBlockFPCUl, - (void*)setTexGenNum__14J3DTexGenBlockFUl, - (void*)getTexGenNum__14J3DTexGenBlockCFv, - (void*)setTexCoord__14J3DTexGenBlockFUlPC11J3DTexCoord, - (void*)getTexCoord__14J3DTexGenBlockFUl, - (void*)setTexMtx__14J3DTexGenBlockFUlP9J3DTexMtx, - (void*)getTexMtx__14J3DTexGenBlockFUl, - (void*)setNBTScale__14J3DTexGenBlockFPC11J3DNBTScale, - (void*)setNBTScale__14J3DTexGenBlockF11J3DNBTScale, - (void*)getNBTScale__14J3DTexGenBlockFv, - (void*)getTexMtxOffset__14J3DTexGenBlockCFv, - (void*)setTexMtxOffset__14J3DTexGenBlockFUl, - (void*)__dt__14J3DTexGenBlockFv, -}; - -/* 803CDEA0-803CDF30 02AFC0 0090+00 3/3 4/4 0/0 .data __vt__13J3DColorBlock */ -SECTION_DATA extern void* __vt__13J3DColorBlock[36] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)load__13J3DColorBlockFv, - (void*)reset__13J3DColorBlockFP13J3DColorBlock, - (void*)patch__13J3DColorBlockFv, - (void*)patchMatColor__13J3DColorBlockFv, - (void*)patchLight__13J3DColorBlockFv, - (void*)diff__13J3DColorBlockFUl, - (void*)diffAmbColor__13J3DColorBlockFv, - (void*)diffMatColor__13J3DColorBlockFv, - (void*)diffColorChan__13J3DColorBlockFv, - (void*)diffLightObj__13J3DColorBlockFUl, - (void*)countDLSize__13J3DColorBlockFv, - (void*)NULL, - (void*)setMatColor__13J3DColorBlockFUlPC10J3DGXColor, - (void*)setMatColor__13J3DColorBlockFUl10J3DGXColor, - (void*)getMatColor__13J3DColorBlockFUl, - (void*)setAmbColor__13J3DColorBlockFUlPC10J3DGXColor, - (void*)setAmbColor__13J3DColorBlockFUl10J3DGXColor, - (void*)getAmbColor__13J3DColorBlockFUl, - (void*)setColorChanNum__13J3DColorBlockFUc, - (void*)setColorChanNum__13J3DColorBlockFPCUc, - (void*)getColorChanNum__13J3DColorBlockCFv, - (void*)setColorChan__13J3DColorBlockFUlRC12J3DColorChan, - (void*)setColorChan__13J3DColorBlockFUlPC12J3DColorChan, - (void*)getColorChan__13J3DColorBlockFUl, - (void*)setLight__13J3DColorBlockFUlP11J3DLightObj, - (void*)getLight__13J3DColorBlockFUl, - (void*)setCullMode__13J3DColorBlockFPCUc, - (void*)setCullMode__13J3DColorBlockFUc, - (void*)getCullMode__13J3DColorBlockCFv, - (void*)getMatColorOffset__13J3DColorBlockCFv, - (void*)getColorChanOffset__13J3DColorBlockCFv, - (void*)setMatColorOffset__13J3DColorBlockFUl, - (void*)setColorChanOffset__13J3DColorBlockFUl, - (void*)__dt__13J3DColorBlockFv, -}; - -/* 803157A0-803159A0 3100E0 0200+00 0/0 3/3 0/0 .text createColorBlock__11J3DMaterialFUl - */ -J3DColorBlock* J3DMaterial::createColorBlock(u32 param_0) { - J3DColorBlock* rv = NULL; - switch (param_0) { - case 0: - rv = new J3DColorBlockLightOff(); - break; - case 0x40000000: - rv = new J3DColorBlockLightOn(); - break; - case 0x80000000: - rv = new J3DColorBlockAmbientOn(); - break; - } - - return rv; -} - -/* 803159A0-80315B04 3102E0 0164+00 0/0 2/2 0/0 .text createTexGenBlock__11J3DMaterialFUl - */ -J3DTexGenBlock* J3DMaterial::createTexGenBlock(u32 param_0) { - switch (param_0) { - case 0x8000000: - return new J3DTexGenBlock4(); - case 0: - default: - return new J3DTexGenBlockBasic(); - } -} - -/* 80315B04-80315E78 310444 0374+00 0/0 2/2 0/0 .text createTevBlock__11J3DMaterialFi */ -J3DTevBlock* J3DMaterial::createTevBlock(int param_0) { - J3DTevBlock* rv = NULL; - if (param_0 <= 1) { - rv = new J3DTevBlock1(); - } else if (param_0 == 2) { - rv = new J3DTevBlock2(); - } else if (param_0 <= 4) { - rv = new J3DTevBlock4(); - } else if (param_0 <= 16) { - rv = new J3DTevBlock16(); - } - return rv; -} - -/* 80315E78-80315F60 3107B8 00E8+00 0/0 3/3 0/0 .text createIndBlock__11J3DMaterialFi */ -J3DIndBlock* J3DMaterial::createIndBlock(int param_0) { - if (param_0 != 0) { - return new J3DIndBlockFull(); - } - - return new J3DIndBlockNull(); -} - -/* 80315F60-80316100 3108A0 01A0+00 0/0 3/3 0/0 .text createPEBlock__11J3DMaterialFUlUl - */ -// rv is in r5 for some reason -#ifdef NONMATCHING -J3DPEBlock* J3DMaterial::createPEBlock(u32 param_0, u32 param_1) { - J3DPEBlock* rv = NULL; - if (param_0 == 0) { - if (param_1 & 1) { - return new J3DPEBlockOpa(); - } else if (param_1 & 2) { - return new J3DPEBlockTexEdge(); - } else if (param_1 & 4) { - return new J3DPEBlockXlu(); - } - } - - if (param_0 == 0x10000000) { - rv = new J3DPEBlockFull(); - } else if (param_0 == 0x20000000) { - rv = new J3DPEBlockFogOff(); - } - return rv; -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DPEBlock* J3DMaterial::createPEBlock(u32 param_0, u32 param_1) { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/createPEBlock__11J3DMaterialFUlUl.s" -} -#pragma pop -#endif - -/* 80316100-80316150 310A40 0050+00 0/0 2/2 0/0 .text calcSizeColorBlock__11J3DMaterialFUl */ -u32 J3DMaterial::calcSizeColorBlock(u32 param_0) { - u32 rv = 0; - switch (param_0) { - case 0: - rv = sizeof(J3DColorBlockLightOff); - break; - case 0x40000000: - rv = sizeof(J3DColorBlockLightOn); - break; - case 0x80000000: - rv = sizeof(J3DColorBlockAmbientOn); - break; - } - - return rv; -} - -/* 80316150-8031617C 310A90 002C+00 0/0 1/1 0/0 .text calcSizeTexGenBlock__11J3DMaterialFUl */ -u32 J3DMaterial::calcSizeTexGenBlock(u32 param_0) { - switch (param_0) { - case 0x8000000: - return sizeof(J3DTexGenBlock4); - case 0: - default: - return sizeof(J3DTexGenBlockBasic); - } -} - -/* 8031617C-803161C4 310ABC 0048+00 0/0 1/1 0/0 .text calcSizeTevBlock__11J3DMaterialFi - */ -u32 J3DMaterial::calcSizeTevBlock(int param_0) { - u32 rv = 0; - if (param_0 <= 1) { - rv = sizeof(J3DTevBlock1); - } else if (param_0 == 2) { - rv = sizeof(J3DTevBlock2); - } else if (param_0 <= 4) { - rv = sizeof(J3DTevBlock4); - } else if (param_0 <= 16) { - rv = sizeof(J3DTevBlock16); - } - return rv; -} - -/* 803161C4-803161D8 310B04 0014+00 0/0 2/2 0/0 .text calcSizeIndBlock__11J3DMaterialFi - */ -u32 J3DMaterial::calcSizeIndBlock(int param_0) { - if (param_0 != 0) { - return sizeof(J3DIndBlockFull); - } - - return sizeof(J3DIndBlockNull); -} - -/* 803161D8-80316240 310B18 0068+00 0/0 2/2 0/0 .text calcSizePEBlock__11J3DMaterialFUlUl - */ -u32 J3DMaterial::calcSizePEBlock(u32 param_0, u32 param_1) { - u32 rv = 0; - if (param_0 == 0) { - if (param_1 & 1) { - rv = sizeof(J3DPEBlockOpa); - } else if (param_1 & 2) { - rv = sizeof(J3DPEBlockTexEdge); - } else if (param_1 & 4) { - rv = sizeof(J3DPEBlockXlu); - } - } - else if (param_0 == 0x10000000) { - rv = sizeof(J3DPEBlockFull); - } else if (param_0 == 0x20000000) { - rv = sizeof(J3DPEBlockFogOff); - } - return rv; -} - -/* 80316240-80316290 310B80 0050+00 2/2 5/5 0/0 .text initialize__11J3DMaterialFv */ -void J3DMaterial::initialize() { - mShape = NULL; - mNext = NULL; - mJoint = NULL; - mMaterialMode = 1; - mIndex = -1; - mInvalid = 0; - mDiffFlag = 0; - mColorBlock = NULL; - mTexGenBlock = NULL; - mTevBlock = NULL; - mIndBlock = NULL; - mPEBlock = NULL; - mpOrigMaterial = NULL; - mMaterialAnm = NULL; - mSharedDLObj = NULL; -} - -/* 80316290-80316344 310BD0 00B4+00 0/0 2/2 0/0 .text countDLSize__11J3DMaterialFv */ -u32 J3DMaterial::countDLSize() { - return (mColorBlock->countDLSize() + mTexGenBlock->countDLSize() + mTevBlock->countDLSize() + - mIndBlock->countDLSize() + mPEBlock->countDLSize() + 31) & ~0x1f; -} - -/* 80316344-80316620 310C84 02DC+00 2/2 0/0 0/0 .text - * makeDisplayList_private__11J3DMaterialFP17J3DDisplayListObj */ -void J3DMaterial::makeDisplayList_private(J3DDisplayListObj* param_0) { - param_0->beginDL(); - mTevBlock->load(); - mIndBlock->load(); - mPEBlock->load(); - J3DGDSetGenMode(mTexGenBlock->getTexGenNum(), mColorBlock->getColorChanNum(), mTevBlock->getTevStageNum(), mIndBlock->getIndTexStageNum(), (GXCullMode)(u8)mColorBlock->getCullMode()); - mTexGenBlock->load(); - mColorBlock->load(); - J3DGDSetNumChans(mColorBlock->getColorChanNum()); - J3DGDSetNumTexGens(mTexGenBlock->getTexGenNum()); - param_0->endDL(); -} - -/* 80316620-80316668 310F60 0048+00 1/0 0/0 0/0 .text makeDisplayList__11J3DMaterialFv */ -void J3DMaterial::makeDisplayList() { - if (!j3dSys.getMatPacket()->isLocked()) { - j3dSys.getMatPacket()->mDiffFlag = mDiffFlag; - makeDisplayList_private(j3dSys.getMatPacket()->getDisplayListObj()); - } -} - -/* 80316668-8031668C 310FA8 0024+00 1/0 0/0 0/0 .text makeSharedDisplayList__11J3DMaterialFv */ -void J3DMaterial::makeSharedDisplayList() { - makeDisplayList_private(mSharedDLObj); -} - -/* 8031668C-803166DC 310FCC 0050+00 1/0 0/0 0/0 .text load__11J3DMaterialFv */ -void J3DMaterial::load() { - j3dSys.setMaterialMode(mMaterialMode); - if (!j3dSys.checkFlag(2)) { - loadNBTScale(*mTexGenBlock->getNBTScale()); - } -} - -/* 803166DC-80316740 31101C 0064+00 1/0 0/0 0/0 .text loadSharedDL__11J3DMaterialFv */ -void J3DMaterial::loadSharedDL() { - j3dSys.setMaterialMode(mMaterialMode); - if (!j3dSys.checkFlag(2)) { - mSharedDLObj->callDL(); - loadNBTScale(*mTexGenBlock->getNBTScale()); - } -} - -/* 80316740-803167D8 311080 0098+00 2/0 0/0 0/0 .text patch__11J3DMaterialFv */ -void J3DMaterial::patch() { - j3dSys.getMatPacket()->mDiffFlag = mDiffFlag; - j3dSys.getMatPacket()->beginPatch(); - mTevBlock->patch(); - mColorBlock->patch(); - mTexGenBlock->patch(); - j3dSys.getMatPacket()->endPatch(); -} - -/* 803167D8-803169DC 311118 0204+00 2/0 0/0 0/0 .text diff__11J3DMaterialFUl */ -void J3DMaterial::diff(u32 param_0) { - if (j3dSys.getMatPacket()->isEnabled_Diff()) { - j3dSys.getMatPacket()->beginDiff(); - mTevBlock->diff(param_0); - mIndBlock->diff(param_0); - mPEBlock->diff(param_0); - if (param_0 & 0x2000000) { - J3DGDSetGenMode_3Param(mTexGenBlock->getTexGenNum(), mTevBlock->getTevStageNum(), mIndBlock->getIndTexStageNum()); - J3DGDSetNumTexGens(mTexGenBlock->getTexGenNum()); - } - mTexGenBlock->diff(param_0); - mColorBlock->diff(param_0); - j3dSys.getMatPacket()->endDiff(); - } -} - -/* 803169DC-80316A54 31131C 0078+00 2/0 0/0 0/0 .text calc__11J3DMaterialFPA4_Cf */ -// Matches but changes order of TU vtables (?!) -#ifdef NONMATCHING -void J3DMaterial::calc(f32 const (*param_0)[4]) { - if (j3dSys.checkFlag(0x40000000)) { - mTexGenBlock->calcPostTexMtx(param_0); - } else { - mTexGenBlock->calc(param_0); - } - - calcCurrentMtx(); - setCurrentMtx(); -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void calc__11J3DMaterialFPA4_Cf() { - // asm void J3DMaterial::calc(f32 const (*param_0)[4]) { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/calc__11J3DMaterialFPA4_Cf.s" -} -#pragma pop -#endif - -/* 80316A54-80316AB0 311394 005C+00 3/0 0/0 0/0 .text calcDiffTexMtx__11J3DMaterialFPA4_Cf */ -void J3DMaterial::calcDiffTexMtx(f32 const (*param_0)[4]) { - if (j3dSys.checkFlag(0x40000000)) { - mTexGenBlock->calcPostTexMtxWithoutViewMtx(param_0); - } else { - mTexGenBlock->calcWithoutViewMtx(param_0); - } -} - -/* 80316AB0-80316AC8 3113F0 0018+00 1/1 1/1 0/0 .text setCurrentMtx__11J3DMaterialFv */ -void J3DMaterial::setCurrentMtx() { - mShape->setCurrentMtx(mCurrentMtx); -} - -/* 80316AC8-80316D68 311408 02A0+00 1/1 0/0 0/0 .text calcCurrentMtx__11J3DMaterialFv */ -// Issues with setCurrentTexMtx -#ifdef NONMATCHING -void J3DMaterial::calcCurrentMtx() { - if (!j3dSys.checkFlag(0x40000000)) { - mCurrentMtx.setCurrentTexMtx( - mTexGenBlock->getTexCoord(0)->getTexGenMtx(), - mTexGenBlock->getTexCoord(1)->getTexGenMtx(), - mTexGenBlock->getTexCoord(2)->getTexGenMtx(), - mTexGenBlock->getTexCoord(3)->getTexGenMtx(), - mTexGenBlock->getTexCoord(4)->getTexGenMtx(), - mTexGenBlock->getTexCoord(5)->getTexGenMtx(), - mTexGenBlock->getTexCoord(6)->getTexGenMtx(), - mTexGenBlock->getTexCoord(7)->getTexGenMtx() - ); - } else { - mCurrentMtx.setCurrentTexMtx( - mTexGenBlock->getTexCoord(0)->getTexMtxReg(), - mTexGenBlock->getTexCoord(1)->getTexMtxReg(), - mTexGenBlock->getTexCoord(2)->getTexMtxReg(), - mTexGenBlock->getTexCoord(3)->getTexMtxReg(), - mTexGenBlock->getTexCoord(4)->getTexMtxReg(), - mTexGenBlock->getTexCoord(5)->getTexMtxReg(), - mTexGenBlock->getTexCoord(6)->getTexMtxReg(), - mTexGenBlock->getTexCoord(7)->getTexMtxReg() - ); - } -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterial::calcCurrentMtx() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/calcCurrentMtx__11J3DMaterialFv.s" -} -#pragma pop -#endif - -/* 80316D68-80316E14 3116A8 00AC+00 1/1 0/0 0/0 .text copy__11J3DMaterialFP11J3DMaterial - */ -void J3DMaterial::copy(J3DMaterial* param_0) { - mColorBlock->reset(param_0->mColorBlock); - mTexGenBlock->reset(param_0->mTexGenBlock); - mTevBlock->reset(param_0->mTevBlock); - mIndBlock->reset(param_0->mIndBlock); - mPEBlock->reset(param_0->mPEBlock); -} - -/* 80316E14-80316E70 311754 005C+00 1/0 0/0 0/0 .text reset__11J3DMaterialFv */ -void J3DMaterial::reset() { - if ((~mDiffFlag & 0x80000000) == 0) { - mDiffFlag &= ~0x80000000; - mMaterialMode = mpOrigMaterial->mMaterialMode; - mInvalid = mpOrigMaterial->mInvalid; - mMaterialAnm = NULL; - copy(mpOrigMaterial); - } -} - -/* 80316E70-80316E90 3117B0 0020+00 1/0 0/0 0/0 .text change__11J3DMaterialFv */ -void J3DMaterial::change() { - if ((mDiffFlag & 0xc0000000) == 0) { - mDiffFlag |= 0x80000000; - mMaterialAnm = NULL; - } -} - -/* 80316E90-80316F24 3117D0 0094+00 0/0 2/2 0/0 .text newSharedDisplayList__11J3DMaterialFUl */ -s32 J3DMaterial::newSharedDisplayList(u32 param_0) { - if (mSharedDLObj == NULL) { - mSharedDLObj = new J3DDisplayListObj(); - if (mSharedDLObj == NULL) { - return 4; - } - s32 res = mSharedDLObj->newDisplayList(param_0); - switch (res) { - case kJ3DError_Success: - break; - default: - return res; - } - } - return 0; -} - -/* 80316F24-80316FB8 311864 0094+00 0/0 2/2 0/0 .text newSingleSharedDisplayList__11J3DMaterialFUl - */ -s32 J3DMaterial::newSingleSharedDisplayList(u32 param_0) { - if (mSharedDLObj == NULL) { - mSharedDLObj = new J3DDisplayListObj(); - if (mSharedDLObj == NULL) { - return 4; - } - s32 res = mSharedDLObj->newSingleDisplayList(param_0); - switch (res) { - case kJ3DError_Success: - break; - default: - return res; - } - } - return 0; -} - -/* 80316FB8-80316FD8 3118F8 0020+00 0/0 1/1 0/0 .text initialize__18J3DPatchedMaterialFv - */ -void J3DPatchedMaterial::initialize() { - J3DMaterial::initialize(); -} - -/* 80316FD8-80316FDC 311918 0004+00 1/0 0/0 0/0 .text makeDisplayList__18J3DPatchedMaterialFv */ -extern "C" asm void makeDisplayList__18J3DPatchedMaterialFv() { -//void J3DPatchedMaterial::makeDisplayList() { - /* empty function */ -} - -/* 80316FDC-80316FE0 31191C 0004+00 1/0 0/0 0/0 .text - * makeSharedDisplayList__18J3DPatchedMaterialFv */ -void J3DPatchedMaterial::makeSharedDisplayList() { - /* empty function */ -} - -/* 80316FE0-80316FFC 311920 001C+00 1/0 0/0 0/0 .text load__18J3DPatchedMaterialFv */ -void J3DPatchedMaterial::load() { - j3dSys.setMaterialMode(mMaterialMode); - if (j3dSys.checkFlag(2)) { - return; - } -} - -/* 80316FFC-8031703C 31193C 0040+00 1/0 0/0 0/0 .text loadSharedDL__18J3DPatchedMaterialFv */ -void J3DPatchedMaterial::loadSharedDL() { - j3dSys.setMaterialMode(mMaterialMode); - if (!j3dSys.checkFlag(0x02)) - mSharedDLObj->callDL(); -} - -/* 8031703C-80317040 31197C 0004+00 1/0 0/0 0/0 .text reset__18J3DPatchedMaterialFv */ -void J3DPatchedMaterial::reset() { - /* empty function */ -} - -/* 80317040-80317044 311980 0004+00 1/0 0/0 0/0 .text change__18J3DPatchedMaterialFv */ -void J3DPatchedMaterial::change() { - /* empty function */ -} - -/* 80317044-80317064 311984 0020+00 0/0 1/1 0/0 .text initialize__17J3DLockedMaterialFv - */ -void J3DLockedMaterial::initialize() { - J3DMaterial::initialize(); -} - -/* 80317064-80317068 3119A4 0004+00 1/0 0/0 0/0 .text makeDisplayList__17J3DLockedMaterialFv */ -void J3DLockedMaterial::makeDisplayList() { - /* empty function */ -} - -/* 80317068-8031706C 3119A8 0004+00 1/0 0/0 0/0 .text makeSharedDisplayList__17J3DLockedMaterialFv - */ -void J3DLockedMaterial::makeSharedDisplayList() { - /* empty function */ -} - -/* 8031706C-80317088 3119AC 001C+00 1/0 0/0 0/0 .text load__17J3DLockedMaterialFv */ -void J3DLockedMaterial::load() { - j3dSys.setMaterialMode(mMaterialMode); - if (j3dSys.checkFlag(2)) { - return; - } -} - -/* 80317088-803170C8 3119C8 0040+00 1/0 0/0 0/0 .text loadSharedDL__17J3DLockedMaterialFv - */ -void J3DLockedMaterial::loadSharedDL() { - j3dSys.setMaterialMode(mMaterialMode); - if (!j3dSys.checkFlag(0x02)) - mSharedDLObj->callDL(); -} - -/* 803170C8-803170CC 311A08 0004+00 1/0 0/0 0/0 .text patch__17J3DLockedMaterialFv */ -void J3DLockedMaterial::patch() { - /* empty function */ -} - -/* 803170CC-803170D0 311A0C 0004+00 1/0 0/0 0/0 .text diff__17J3DLockedMaterialFUl */ -void J3DLockedMaterial::diff(u32 param_0) { - /* empty function */ -} - -/* 803170D0-803170D4 311A10 0004+00 1/0 0/0 0/0 .text calc__17J3DLockedMaterialFPA4_Cf */ -extern "C" asm void calc__17J3DLockedMaterialFPA4_Cf() { - /* empty function */ -} - -/* 803170D4-803170D8 311A14 0004+00 1/0 0/0 0/0 .text reset__17J3DLockedMaterialFv */ -void J3DLockedMaterial::reset() { - /* empty function */ -} - -/* 803170D8-803170DC 311A18 0004+00 1/0 0/0 0/0 .text change__17J3DLockedMaterialFv */ -void J3DLockedMaterial::change() { - /* empty function */ -} - -/* 803170DC-80317138 311A1C 005C+00 0/0 1/0 0/0 .text __dt__21J3DColorBlockLightOffFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DColorBlockLightOff::~J3DColorBlockLightOff() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__21J3DColorBlockLightOffFv.s" -} -#pragma pop - -/* 80317138-80317180 311A78 0048+00 1/0 0/0 0/0 .text __dt__13J3DColorBlockFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DColorBlock::~J3DColorBlock() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__13J3DColorBlockFv.s" -} -#pragma pop - -/* 80317180-803171DC 311AC0 005C+00 0/0 1/0 0/0 .text __dt__21J3DTexGenBlockPatchedFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DTexGenBlockPatched::~J3DTexGenBlockPatched() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__21J3DTexGenBlockPatchedFv.s" -} -#pragma pop - -/* 803171DC-80317224 311B1C 0048+00 1/0 0/0 0/0 .text __dt__14J3DTexGenBlockFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DTexGenBlock::~J3DTexGenBlock() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__14J3DTexGenBlockFv.s" -} -#pragma pop - -/* 80317224-8031726C 311B64 0048+00 0/0 1/0 0/0 .text __dt__11J3DTevBlockFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DTevBlock::~J3DTevBlock() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__11J3DTevBlockFv.s" -} -#pragma pop - -/* 8031726C-803172B4 311BAC 0048+00 1/0 0/0 0/0 .text __dt__11J3DIndBlockFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DIndBlock::~J3DIndBlock() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__11J3DIndBlockFv.s" -} -#pragma pop - -/* 803172B4-803172FC 311BF4 0048+00 1/0 0/0 0/0 .text __dt__10J3DPEBlockFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DPEBlock::~J3DPEBlock() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__10J3DPEBlockFv.s" -} -#pragma pop - -/* 803172FC-80317304 311C3C 0008+00 1/0 1/0 0/0 .text countDLSize__14J3DTexGenBlockFv */ -s32 J3DTexGenBlock::countDLSize() { - return false; -} - -/* 80317304-8031730C 311C44 0008+00 1/0 1/0 0/0 .text countDLSize__13J3DColorBlockFv */ -s32 J3DColorBlock::countDLSize() { - return false; -} - -/* 8031730C-80317314 311C4C 0008+00 0/0 2/0 0/0 .text countDLSize__11J3DTevBlockFv */ -s32 J3DTevBlock::countDLSize() { - return false; -} - -/* 80317314-8031731C 311C54 0008+00 2/0 0/0 0/0 .text countDLSize__11J3DIndBlockFv */ -s32 J3DIndBlock::countDLSize() { - return false; -} - -/* 8031731C-80317324 311C5C 0008+00 1/0 1/0 0/0 .text countDLSize__10J3DPEBlockFv */ -s32 J3DPEBlock::countDLSize() { - return false; -} - -/* 80317324-80317328 311C64 0004+00 1/0 1/0 0/0 .text load__13J3DColorBlockFv */ -extern "C" void load__13J3DColorBlockFv() { - /* empty function */ -} - -/* 80317328-80317330 311C68 0008+00 1/0 1/0 0/0 .text getCullMode__13J3DColorBlockCFv */ -s32 J3DColorBlock::getCullMode() const { - return 2; -} - -/* 80317330-80317334 311C70 0004+00 0/0 2/0 0/0 .text load__11J3DTevBlockFv */ -void J3DTevBlock::load() { - /* empty function */ -} - -/* 80317334-8031733C 311C74 0008+00 1/0 2/0 0/0 .text getNBTScale__14J3DTexGenBlockFv */ -J3DNBTScale* J3DTexGenBlock::getNBTScale() { - return NULL; -} - -/* 8031733C-80317340 311C7C 0004+00 1/0 1/0 0/0 .text patch__13J3DColorBlockFv */ -void J3DColorBlock::patch() { - /* empty function */ -} - -/* 80317340-80317344 311C80 0004+00 1/0 1/0 0/0 .text diff__13J3DColorBlockFUl */ -void J3DColorBlock::diff(u32 param_0) { - /* empty function */ -} - -/* 80317344-80317348 311C84 0004+00 1/0 4/0 0/0 .text diff__10J3DPEBlockFUl */ -void J3DPEBlock::diff(u32 param_0) { - /* empty function */ -} - -/* 80317348-8031734C 311C88 0004+00 1/0 4/0 0/0 .text reset__10J3DPEBlockFP10J3DPEBlock - */ -extern "C" void reset__10J3DPEBlockFP10J3DPEBlock() { - /* empty function */ -} - -/* 8031734C-80317350 311C8C 0004+00 1/0 0/0 0/0 .text reset__11J3DIndBlockFP11J3DIndBlock - */ -extern "C" void reset__11J3DIndBlockFP11J3DIndBlock() { - /* empty function */ -} - -/* 80317350-80317354 311C90 0004+00 0/0 1/0 0/0 .text reset__11J3DTevBlockFP11J3DTevBlock - */ -extern "C" void reset__11J3DTevBlockFP11J3DTevBlock(J3DTevBlock* param_0) { - /* empty function */ -} - -/* 80317354-80317358 311C94 0004+00 1/0 1/0 0/0 .text reset__14J3DTexGenBlockFP14J3DTexGenBlock */ -extern "C" void reset__14J3DTexGenBlockFP14J3DTexGenBlock() { - /* empty function */ -} - -/* 80317358-8031735C 311C98 0004+00 1/0 1/0 0/0 .text reset__13J3DColorBlockFP13J3DColorBlock */ -void J3DColorBlock::reset(J3DColorBlock* param_0) { - /* empty function */ -} - -/* 8031735C-80317360 311C9C 0004+00 1/0 5/0 0/0 .text diffFog__10J3DPEBlockFv */ -void J3DPEBlock::diffFog() { - /* empty function */ -} - -/* 80317360-80317364 311CA0 0004+00 1/0 4/0 0/0 .text diffBlend__10J3DPEBlockFv */ -void J3DPEBlock::diffBlend() { - /* empty function */ -} - -/* 80317364-80317368 311CA4 0004+00 1/0 5/0 0/0 .text setFog__10J3DPEBlockFP6J3DFog */ -void J3DPEBlock::setFog(J3DFog* param_0) { - /* empty function */ -} - -/* 80317368-8031736C 311CA8 0004+00 1/0 5/0 0/0 .text setFog__10J3DPEBlockF6J3DFog */ -void J3DPEBlock::setFog(J3DFog param_0) { - /* empty function */ -} - -/* 8031736C-80317370 311CAC 0004+00 1/0 4/0 0/0 .text setAlphaComp__10J3DPEBlockFPC12J3DAlphaComp - */ -void J3DPEBlock::setAlphaComp(J3DAlphaComp const* param_0) { - /* empty function */ -} - -/* 80317370-80317374 311CB0 0004+00 1/0 4/0 0/0 .text setBlend__10J3DPEBlockFPC8J3DBlend - */ -void J3DPEBlock::setBlend(J3DBlend const* param_0) { - /* empty function */ -} - -/* 80317374-80317378 311CB4 0004+00 1/0 4/0 0/0 .text setZMode__10J3DPEBlockFPC8J3DZMode - */ -void J3DPEBlock::setZMode(J3DZMode const* param_0) { - /* empty function */ -} - -/* 80317378-8031737C 311CB8 0004+00 1/0 4/0 0/0 .text setZCompLoc__10J3DPEBlockFPCUc */ -void J3DPEBlock::setZCompLoc(u8 const* param_0) { - /* empty function */ -} - -/* 8031737C-80317380 311CBC 0004+00 1/0 4/0 0/0 .text setDither__10J3DPEBlockFUc */ -void J3DPEBlock::setDither(u8 param_0) { - /* empty function */ -} - -/* 80317380-80317384 311CC0 0004+00 1/0 4/0 0/0 .text setDither__10J3DPEBlockFPCUc */ -void J3DPEBlock::setDither(u8 const* param_0) { - /* empty function */ -} - -/* 80317384-8031738C 311CC4 0008+00 1/0 4/0 0/0 .text getDither__10J3DPEBlockCFv */ -bool J3DPEBlock::getDither() const { - return false; -} - -/* 8031738C-80317394 311CCC 0008+00 1/0 5/0 0/0 .text getFogOffset__10J3DPEBlockCFv */ -bool J3DPEBlock::getFogOffset() const { - return false; -} - -/* 80317394-80317398 311CD4 0004+00 1/0 5/0 0/0 .text setFogOffset__10J3DPEBlockFUl */ -void J3DPEBlock::setFogOffset(u32 param_0) { - /* empty function */ -} - -/* 80317398-8031739C 311CD8 0004+00 1/0 0/0 0/0 .text diff__15J3DIndBlockNullFUl */ -void J3DIndBlockNull::diff(u32 param_0) { - /* empty function */ -} - -/* 8031739C-803173A0 311CDC 0004+00 1/0 0/0 0/0 .text load__15J3DIndBlockNullFv */ -void J3DIndBlockNull::load() { - /* empty function */ -} - -/* 803173A0-803173A4 311CE0 0004+00 1/0 0/0 0/0 .text reset__15J3DIndBlockNullFP11J3DIndBlock */ -extern "C" asm void reset__15J3DIndBlockNullFP11J3DIndBlock() { - /* empty function */ -} - -/* 803173A4-803173B0 311CE4 000C+00 1/0 0/0 0/0 .text getType__15J3DIndBlockNullFv */ -u32 J3DIndBlockNull::getType() { - return 'IBLN'; -} - -/* 803173B0-8031740C 311CF0 005C+00 1/0 0/0 0/0 .text __dt__15J3DIndBlockNullFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DIndBlockNull::~J3DIndBlockNull() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__15J3DIndBlockNullFv.s" -} -#pragma pop - -/* 8031740C-80317410 311D4C 0004+00 2/0 0/0 0/0 .text - * setIndTexOrder__11J3DIndBlockFUlPC14J3DIndTexOrder */ -void J3DIndBlock::setIndTexOrder(u32 param_0, J3DIndTexOrder const* param_1) { - /* empty function */ -} - -/* 80317410-80317414 311D50 0004+00 2/0 0/0 0/0 .text - * setIndTexOrder__11J3DIndBlockFUl14J3DIndTexOrder */ -void J3DIndBlock::setIndTexOrder(u32 param_0, J3DIndTexOrder param_1) { - /* empty function */ -} - -/* 80317414-80317418 311D54 0004+00 2/0 0/0 0/0 .text - * setIndTexMtx__11J3DIndBlockFUlPC12J3DIndTexMtx */ -void J3DIndBlock::setIndTexMtx(u32 param_0, J3DIndTexMtx const* param_1) { - /* empty function */ -} - -/* 80317418-8031741C 311D58 0004+00 2/0 0/0 0/0 .text - * setIndTexCoordScale__11J3DIndBlockFUlPC19J3DIndTexCoordScale */ -void J3DIndBlock::setIndTexCoordScale(u32 param_0, J3DIndTexCoordScale const* param_1) { - /* empty function */ -} - -/* 8031741C-80317420 311D5C 0004+00 1/0 1/0 0/0 .text setTexGenNum__14J3DTexGenBlockFPCUl - */ -void J3DTexGenBlock::setTexGenNum(u32 const* param_0) { - /* empty function */ -} - -/* 80317420-80317424 311D60 0004+00 1/0 2/0 0/0 .text setNBTScale__14J3DTexGenBlockF11J3DNBTScale - */ -void J3DTexGenBlock::setNBTScale(J3DNBTScale param_0) { - /* empty function */ -} - -/* 80317424-80317428 311D64 0004+00 1/0 2/0 0/0 .text - * setNBTScale__14J3DTexGenBlockFPC11J3DNBTScale */ -void J3DTexGenBlock::setNBTScale(J3DNBTScale const* param_0) { - /* empty function */ -} - -/* 80317428-80317430 311D68 0008+00 1/0 1/0 0/0 .text getTexMtxOffset__14J3DTexGenBlockCFv */ -bool J3DTexGenBlock::getTexMtxOffset() const { - return false; -} - -/* 80317430-80317434 311D70 0004+00 1/0 1/0 0/0 .text setTexMtxOffset__14J3DTexGenBlockFUl */ -void J3DTexGenBlock::setTexMtxOffset(u32 param_0) { - /* empty function */ -} - -/* 80317434-80317438 311D74 0004+00 1/0 1/0 0/0 .text patchMatColor__13J3DColorBlockFv */ -void J3DColorBlock::patchMatColor() { - /* empty function */ -} - -/* 80317438-8031743C 311D78 0004+00 1/0 3/0 0/0 .text diffAmbColor__13J3DColorBlockFv */ -void J3DColorBlock::diffAmbColor() { - /* empty function */ -} - -/* 8031743C-80317440 311D7C 0004+00 1/0 1/0 0/0 .text diffMatColor__13J3DColorBlockFv */ -void J3DColorBlock::diffMatColor() { - /* empty function */ -} - -/* 80317440-80317444 311D80 0004+00 1/0 1/0 0/0 .text diffColorChan__13J3DColorBlockFv */ -void J3DColorBlock::diffColorChan() { - /* empty function */ -} - -/* 80317444-80317448 311D84 0004+00 1/0 3/0 0/0 .text diffLightObj__13J3DColorBlockFUl */ -void J3DColorBlock::diffLightObj(u32 param_0) { - /* empty function */ -} - -/* 80317448-8031744C 311D88 0004+00 1/0 1/0 0/0 .text - * setMatColor__13J3DColorBlockFUlPC10J3DGXColor */ -void J3DColorBlock::setMatColor(u32 param_0, J3DGXColor const* param_1) { - /* empty function */ -} - -/* 8031744C-80317450 311D8C 0004+00 1/0 1/0 0/0 .text setColorChanNum__13J3DColorBlockFPCUc */ -void J3DColorBlock::setColorChanNum(u8 const* param_0) { - /* empty function */ -} - -/* 80317450-80317454 311D90 0004+00 1/0 1/0 0/0 .text - * setColorChan__13J3DColorBlockFUlPC12J3DColorChan */ -void J3DColorBlock::setColorChan(u32 param_0, J3DColorChan const* param_1) { - /* empty function */ -} - -/* 80317454-8031745C 311D94 0008+00 1/0 3/0 0/0 .text getLight__13J3DColorBlockFUl */ -bool J3DColorBlock::getLight(u32 param_0) { - return false; -} - -/* 8031745C-80317460 311D9C 0004+00 1/0 1/0 0/0 .text setCullMode__13J3DColorBlockFUc */ -void J3DColorBlock::setCullMode(u8 param_0) { - /* empty function */ -} - -/* 80317460-80317464 311DA0 0004+00 1/0 1/0 0/0 .text setCullMode__13J3DColorBlockFPCUc - */ -void J3DColorBlock::setCullMode(u8 const* param_0) { - /* empty function */ -} - -/* 80317464-8031746C 311DA4 0008+00 1/0 1/0 0/0 .text getMatColorOffset__13J3DColorBlockCFv */ -bool J3DColorBlock::getMatColorOffset() const { - return false; -} - -/* 8031746C-80317474 311DAC 0008+00 1/0 1/0 0/0 .text getColorChanOffset__13J3DColorBlockCFv */ -bool J3DColorBlock::getColorChanOffset() const { - return false; -} - -/* 80317474-80317478 311DB4 0004+00 1/0 1/0 0/0 .text setMatColorOffset__13J3DColorBlockFUl */ -void J3DColorBlock::setMatColorOffset(u32 param_0) { - /* empty function */ -} - -/* 80317478-8031747C 311DB8 0004+00 1/0 1/0 0/0 .text setColorChanOffset__13J3DColorBlockFUl */ -void J3DColorBlock::setColorChanOffset(u32 param_0) { - /* empty function */ -} +// +// Generated By: dol2asm +// Translation Unit: J3DMaterial +// + +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "JSystem/J3DGraphBase/J3DGD.h" +#include "dol2asm.h" + +// +// Forward References: +// + +extern "C" void createColorBlock__11J3DMaterialFUl(); +extern "C" void createTexGenBlock__11J3DMaterialFUl(); +extern "C" void createTevBlock__11J3DMaterialFi(); +extern "C" void createIndBlock__11J3DMaterialFi(); +extern "C" void createPEBlock__11J3DMaterialFUlUl(); +extern "C" void calcSizeColorBlock__11J3DMaterialFUl(); +extern "C" void calcSizeTexGenBlock__11J3DMaterialFUl(); +extern "C" void calcSizeTevBlock__11J3DMaterialFi(); +extern "C" void calcSizeIndBlock__11J3DMaterialFi(); +extern "C" void calcSizePEBlock__11J3DMaterialFUlUl(); +extern "C" void initialize__11J3DMaterialFv(); +extern "C" void countDLSize__11J3DMaterialFv(); +extern "C" void makeDisplayList_private__11J3DMaterialFP17J3DDisplayListObj(); +extern "C" void makeDisplayList__11J3DMaterialFv(); +extern "C" void makeSharedDisplayList__11J3DMaterialFv(); +extern "C" void load__11J3DMaterialFv(); +extern "C" void loadSharedDL__11J3DMaterialFv(); +extern "C" void patch__11J3DMaterialFv(); +extern "C" void diff__11J3DMaterialFUl(); +extern "C" void calc__11J3DMaterialFPA4_Cf(); +extern "C" void calcDiffTexMtx__11J3DMaterialFPA4_Cf(); +extern "C" void setCurrentMtx__11J3DMaterialFv(); +extern "C" void calcCurrentMtx__11J3DMaterialFv(); +extern "C" void copy__11J3DMaterialFP11J3DMaterial(); +extern "C" void reset__11J3DMaterialFv(); +extern "C" void change__11J3DMaterialFv(); +extern "C" void newSharedDisplayList__11J3DMaterialFUl(); +extern "C" void newSingleSharedDisplayList__11J3DMaterialFUl(); +extern "C" void initialize__18J3DPatchedMaterialFv(); +extern "C" void makeDisplayList__18J3DPatchedMaterialFv(); +extern "C" void makeSharedDisplayList__18J3DPatchedMaterialFv(); +extern "C" void load__18J3DPatchedMaterialFv(); +extern "C" void loadSharedDL__18J3DPatchedMaterialFv(); +extern "C" void reset__18J3DPatchedMaterialFv(); +extern "C" void change__18J3DPatchedMaterialFv(); +extern "C" void initialize__17J3DLockedMaterialFv(); +extern "C" void makeDisplayList__17J3DLockedMaterialFv(); +extern "C" void makeSharedDisplayList__17J3DLockedMaterialFv(); +extern "C" void load__17J3DLockedMaterialFv(); +extern "C" void loadSharedDL__17J3DLockedMaterialFv(); +extern "C" void patch__17J3DLockedMaterialFv(); +extern "C" void diff__17J3DLockedMaterialFUl(); +extern "C" void calc__17J3DLockedMaterialFPA4_Cf(); +extern "C" void reset__17J3DLockedMaterialFv(); +extern "C" void change__17J3DLockedMaterialFv(); +extern "C" void __dt__21J3DColorBlockLightOffFv(); +extern "C" void __dt__13J3DColorBlockFv(); +extern "C" void __dt__21J3DTexGenBlockPatchedFv(); +extern "C" void __dt__14J3DTexGenBlockFv(); +extern "C" void __dt__11J3DTevBlockFv(); +extern "C" void __dt__11J3DIndBlockFv(); +extern "C" void __dt__10J3DPEBlockFv(); +extern "C" bool countDLSize__14J3DTexGenBlockFv(); +extern "C" bool countDLSize__13J3DColorBlockFv(); +extern "C" bool countDLSize__11J3DTevBlockFv(); +extern "C" bool countDLSize__11J3DIndBlockFv(); +extern "C" bool countDLSize__10J3DPEBlockFv(); +extern "C" void load__13J3DColorBlockFv(); +extern "C" s32 getCullMode__13J3DColorBlockCFv(); +extern "C" void load__11J3DTevBlockFv(); +extern "C" J3DNBTScale* getNBTScale__14J3DTexGenBlockFv(); +extern "C" void patch__13J3DColorBlockFv(); +extern "C" void diff__13J3DColorBlockFUl(); +extern "C" void diff__10J3DPEBlockFUl(); +extern "C" void reset__10J3DPEBlockFP10J3DPEBlock(); +extern "C" void reset__11J3DIndBlockFP11J3DIndBlock(); +extern "C" void reset__11J3DTevBlockFP11J3DTevBlock(J3DTevBlock* param_0); +extern "C" void reset__14J3DTexGenBlockFP14J3DTexGenBlock(); +extern "C" void reset__13J3DColorBlockFP13J3DColorBlock(); +extern "C" void diffFog__10J3DPEBlockFv(); +extern "C" void diffBlend__10J3DPEBlockFv(); +extern "C" void setFog__10J3DPEBlockFP6J3DFog(); +extern "C" void setFog__10J3DPEBlockF6J3DFog(); +extern "C" void setAlphaComp__10J3DPEBlockFPC12J3DAlphaComp(); +extern "C" void setBlend__10J3DPEBlockFPC8J3DBlend(); +extern "C" void setZMode__10J3DPEBlockFPC8J3DZMode(); +extern "C" void setZCompLoc__10J3DPEBlockFPCUc(); +extern "C" void setDither__10J3DPEBlockFUc(); +extern "C" void setDither__10J3DPEBlockFPCUc(); +extern "C" bool getDither__10J3DPEBlockCFv(); +extern "C" bool getFogOffset__10J3DPEBlockCFv(); +extern "C" void setFogOffset__10J3DPEBlockFUl(); +extern "C" void diff__15J3DIndBlockNullFUl(); +extern "C" void load__15J3DIndBlockNullFv(); +extern "C" void reset__15J3DIndBlockNullFP11J3DIndBlock(); +extern "C" void getType__15J3DIndBlockNullFv(); +extern "C" void __dt__15J3DIndBlockNullFv(); +extern "C" void setIndTexOrder__11J3DIndBlockFUlPC14J3DIndTexOrder(); +extern "C" void setIndTexOrder__11J3DIndBlockFUl14J3DIndTexOrder(); +extern "C" void setIndTexMtx__11J3DIndBlockFUlPC12J3DIndTexMtx(); +extern "C" void setIndTexCoordScale__11J3DIndBlockFUlPC19J3DIndTexCoordScale(); +extern "C" void setTexGenNum__14J3DTexGenBlockFPCUl(); +extern "C" void setNBTScale__14J3DTexGenBlockF11J3DNBTScale(); +extern "C" void setNBTScale__14J3DTexGenBlockFPC11J3DNBTScale(); +extern "C" bool getTexMtxOffset__14J3DTexGenBlockCFv(); +extern "C" void setTexMtxOffset__14J3DTexGenBlockFUl(); +extern "C" void patchMatColor__13J3DColorBlockFv(); +extern "C" void diffAmbColor__13J3DColorBlockFv(); +extern "C" void diffMatColor__13J3DColorBlockFv(); +extern "C" void diffColorChan__13J3DColorBlockFv(); +extern "C" void diffLightObj__13J3DColorBlockFUl(); +extern "C" void setMatColor__13J3DColorBlockFUlPC10J3DGXColor(); +extern "C" void setColorChanNum__13J3DColorBlockFPCUc(); +extern "C" void setColorChan__13J3DColorBlockFUlPC12J3DColorChan(); +extern "C" bool getLight__13J3DColorBlockFUl(); +extern "C" void setCullMode__13J3DColorBlockFUc(); +extern "C" void setCullMode__13J3DColorBlockFPCUc(); +extern "C" bool getMatColorOffset__13J3DColorBlockCFv(); +extern "C" bool getColorChanOffset__13J3DColorBlockCFv(); +extern "C" void setMatColorOffset__13J3DColorBlockFUl(); +extern "C" void setColorChanOffset__13J3DColorBlockFUl(); + +// +// External References: +// + +extern "C" void patch__10J3DPEBlockFv(); +extern "C" void patchLight__13J3DColorBlockFv(); +extern "C" bool getZCompLoc__10J3DPEBlockCFv(); +extern "C" bool getZMode__10J3DPEBlockFv(); +extern "C" bool getBlend__10J3DPEBlockFv(); +extern "C" bool getAlphaComp__10J3DPEBlockFv(); +extern "C" bool getFog__10J3DPEBlockFv(); +extern "C" bool getIndTexCoordScale__11J3DIndBlockFUl(); +extern "C" bool getIndTexMtx__11J3DIndBlockFUl(); +extern "C" bool getIndTexOrder__11J3DIndBlockFUl(); +extern "C" bool getIndTexStageNum__11J3DIndBlockCFv(); +extern "C" bool getTexMtx__14J3DTexGenBlockFUl(); +extern "C" bool getTexCoord__14J3DTexGenBlockFUl(); +extern "C" bool getTexGenNum__14J3DTexGenBlockCFv(); +extern "C" bool getAmbColor__13J3DColorBlockFUl(); +extern "C" bool getColorChan__13J3DColorBlockFUl(); +extern "C" bool getMatColor__13J3DColorBlockFUl(); +extern "C" bool getColorChanNum__13J3DColorBlockCFv(); +extern "C" void setZCompLoc__10J3DPEBlockFUc(); +extern "C" void setZMode__10J3DPEBlockF8J3DZMode(); +extern "C" void setBlend__10J3DPEBlockFRC8J3DBlend(); +extern "C" void setAlphaComp__10J3DPEBlockFRC12J3DAlphaComp(); +extern "C" void setIndTexCoordScale__11J3DIndBlockFUl19J3DIndTexCoordScale(); +extern "C" void __dt__19J3DIndTexCoordScaleFv(); +extern "C" void setIndTexMtx__11J3DIndBlockFUl12J3DIndTexMtx(); +extern "C" void __dt__12J3DIndTexMtxFv(); +extern "C" void setIndTexStageNum__11J3DIndBlockFUc(); +extern "C" void setTexCoord__14J3DTexGenBlockFUlPC11J3DTexCoord(); +extern "C" void setTexGenNum__14J3DTexGenBlockFUl(); +extern "C" void setAmbColor__13J3DColorBlockFUl10J3DGXColor(); +extern "C" void setColorChan__13J3DColorBlockFUlRC12J3DColorChan(); +extern "C" void setMatColor__13J3DColorBlockFUl10J3DGXColor(); +extern "C" void setColorChanNum__13J3DColorBlockFUc(); +extern "C" void __ct__19J3DIndTexCoordScaleFv(); +extern "C" void __ct__12J3DIndTexMtxFv(); +extern "C" void __ct__14J3DIndTexOrderFv(); +extern "C" void __ct__19J3DTevSwapModeTableFv(); +extern "C" void __ct__11J3DTevOrderFv(); +extern "C" void __ct__14J3DIndTevStageFv(); +extern "C" void __ct__11J3DTevStageFv(); +extern "C" void __ct__13J3DGXColorS10Fv(); +extern "C" void __ct__11J3DTexCoordFv(); +extern "C" void __ct__12J3DColorChanFv(); +extern "C" void __ct__10J3DGXColorFv(); +extern "C" void setTexMtx__14J3DTexGenBlockFUlP9J3DTexMtx(); +extern "C" void setLight__13J3DColorBlockFUlP11J3DLightObj(); +extern "C" void setAmbColor__13J3DColorBlockFUlPC10J3DGXColor(); +extern "C" void* __nw__FUl(); +extern "C" void __dl__FPv(); +extern "C" void J3DGDSetGenMode__FUcUcUcUc11_GXCullMode(); +extern "C" void J3DGDSetGenMode_3Param__FUcUcUc(); +extern "C" void newDisplayList__17J3DDisplayListObjFUl(); +extern "C" void newSingleDisplayList__17J3DDisplayListObjFUl(); +extern "C" void callDL__17J3DDisplayListObjCFv(); +extern "C" void beginDL__17J3DDisplayListObjFv(); +extern "C" void endDL__17J3DDisplayListObjFv(); +extern "C" void beginPatch__17J3DDisplayListObjFv(); +extern "C" void endPatch__17J3DDisplayListObjFv(); +extern "C" void beginDiff__12J3DMatPacketFv(); +extern "C" void endDiff__12J3DMatPacketFv(); +extern "C" void initialize__21J3DColorBlockLightOffFv(); +extern "C" void initialize__22J3DColorBlockAmbientOnFv(); +extern "C" void initialize__20J3DColorBlockLightOnFv(); +extern "C" void initialize__21J3DTexGenBlockPatchedFv(); +extern "C" void initialize__15J3DTexGenBlock4Fv(); +extern "C" void initialize__19J3DTexGenBlockBasicFv(); +extern "C" void initialize__12J3DTevBlock1Fv(); +extern "C" void initialize__12J3DTevBlock2Fv(); +extern "C" void initialize__12J3DTevBlock4Fv(); +extern "C" void initialize__13J3DTevBlock16Fv(); +extern "C" void initialize__15J3DIndBlockFullFv(); +extern "C" void initialize__16J3DPEBlockFogOffFv(); +extern "C" void initialize__14J3DPEBlockFullFv(); +extern "C" void loadNBTScale__FR11J3DNBTScale(); +extern "C" void __as__10J3DFogInfoFRC10J3DFogInfo(); +extern "C" void __construct_array(); +extern "C" void _savegpr_24(); +extern "C" void _savegpr_26(); +extern "C" void _savegpr_27(); +extern "C" void _savegpr_29(); +extern "C" void _restgpr_24(); +extern "C" void _restgpr_26(); +extern "C" void _restgpr_27(); +extern "C" void _restgpr_29(); +extern "C" extern void* __vt__14J3DPEBlockFull[31]; +extern "C" extern void* __vt__16J3DPEBlockFogOff[31]; +extern "C" extern void* __vt__13J3DTevBlock16[55]; +extern "C" extern void* __vt__12J3DTevBlock4[55]; +extern "C" extern void* __vt__12J3DTevBlock2[55]; +extern "C" extern void* __vt__12J3DTevBlock1[55]; +extern "C" extern void* __vt__19J3DTexGenBlockBasic[27]; +extern "C" extern void* __vt__15J3DTexGenBlock4[27]; +extern "C" extern void* __vt__21J3DTexGenBlockPatched[27]; +extern "C" extern void* __vt__20J3DColorBlockLightOn[36]; +extern "C" extern void* __vt__22J3DColorBlockAmbientOn[36]; +extern "C" extern void* __vt__13J3DPEBlockXlu[31]; +extern "C" extern void* __vt__17J3DPEBlockTexEdge[31]; +extern "C" extern void* __vt__13J3DPEBlockOpa[31]; +extern "C" extern void* __vt__15J3DIndBlockFull[19]; +extern "C" extern void* __vt__11J3DTevBlock[55]; +extern "C" extern void* __vt__21J3DColorBlockLightOff[36 + 1 /* padding */]; + +// +// Declarations: +// + +/* ############################################################################################## */ +/* 803CDC90-803CDCC0 02ADB0 0030+00 0/0 1/1 0/0 .data __vt__17J3DLockedMaterial */ +SECTION_DATA extern void* __vt__17J3DLockedMaterial[12] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)calc__17J3DLockedMaterialFPA4_Cf, + (void*)calcDiffTexMtx__11J3DMaterialFPA4_Cf, + (void*)makeDisplayList__17J3DLockedMaterialFv, + (void*)makeSharedDisplayList__17J3DLockedMaterialFv, + (void*)load__17J3DLockedMaterialFv, + (void*)loadSharedDL__17J3DLockedMaterialFv, + (void*)patch__17J3DLockedMaterialFv, + (void*)diff__17J3DLockedMaterialFUl, + (void*)reset__17J3DLockedMaterialFv, + (void*)change__17J3DLockedMaterialFv, +}; + +/* 803CDCC0-803CDCF0 02ADE0 0030+00 0/0 1/1 0/0 .data __vt__18J3DPatchedMaterial */ +SECTION_DATA extern void* __vt__18J3DPatchedMaterial[12] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)calc__11J3DMaterialFPA4_Cf, + (void*)calcDiffTexMtx__11J3DMaterialFPA4_Cf, + (void*)makeDisplayList__18J3DPatchedMaterialFv, + (void*)makeSharedDisplayList__18J3DPatchedMaterialFv, + (void*)load__18J3DPatchedMaterialFv, + (void*)loadSharedDL__18J3DPatchedMaterialFv, + (void*)patch__11J3DMaterialFv, + (void*)diff__11J3DMaterialFUl, + (void*)reset__18J3DPatchedMaterialFv, + (void*)change__18J3DPatchedMaterialFv, +}; + +/* 803CDCF0-803CDD20 02AE10 0030+00 0/0 6/6 0/0 .data __vt__11J3DMaterial */ +SECTION_DATA extern void* __vt__11J3DMaterial[12] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)calc__11J3DMaterialFPA4_Cf, + (void*)calcDiffTexMtx__11J3DMaterialFPA4_Cf, + (void*)makeDisplayList__11J3DMaterialFv, + (void*)makeSharedDisplayList__11J3DMaterialFv, + (void*)load__11J3DMaterialFv, + (void*)loadSharedDL__11J3DMaterialFv, + (void*)patch__11J3DMaterialFv, + (void*)diff__11J3DMaterialFUl, + (void*)reset__11J3DMaterialFv, + (void*)change__11J3DMaterialFv, +}; + +/* 803CDD20-803CDD9C 02AE40 007C+00 2/2 7/7 0/0 .data __vt__10J3DPEBlock */ +SECTION_DATA extern void* __vt__10J3DPEBlock[31] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)reset__10J3DPEBlockFP10J3DPEBlock, + (void*)NULL, + (void*)patch__10J3DPEBlockFv, + (void*)diff__10J3DPEBlockFUl, + (void*)diffFog__10J3DPEBlockFv, + (void*)diffBlend__10J3DPEBlockFv, + (void*)countDLSize__10J3DPEBlockFv, + (void*)NULL, + (void*)setFog__10J3DPEBlockF6J3DFog, + (void*)setFog__10J3DPEBlockFP6J3DFog, + (void*)getFog__10J3DPEBlockFv, + (void*)setAlphaComp__10J3DPEBlockFPC12J3DAlphaComp, + (void*)setAlphaComp__10J3DPEBlockFRC12J3DAlphaComp, + (void*)getAlphaComp__10J3DPEBlockFv, + (void*)setBlend__10J3DPEBlockFPC8J3DBlend, + (void*)setBlend__10J3DPEBlockFRC8J3DBlend, + (void*)getBlend__10J3DPEBlockFv, + (void*)setZMode__10J3DPEBlockFPC8J3DZMode, + (void*)setZMode__10J3DPEBlockF8J3DZMode, + (void*)getZMode__10J3DPEBlockFv, + (void*)setZCompLoc__10J3DPEBlockFPCUc, + (void*)setZCompLoc__10J3DPEBlockFUc, + (void*)getZCompLoc__10J3DPEBlockCFv, + (void*)setDither__10J3DPEBlockFPCUc, + (void*)setDither__10J3DPEBlockFUc, + (void*)getDither__10J3DPEBlockCFv, + (void*)getFogOffset__10J3DPEBlockCFv, + (void*)setFogOffset__10J3DPEBlockFUl, + (void*)__dt__10J3DPEBlockFv, +}; + +/* 803CDD9C-803CDDE8 02AEBC 004C+00 2/2 1/1 0/0 .data __vt__15J3DIndBlockNull */ +SECTION_DATA extern void* __vt__15J3DIndBlockNull[19] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)reset__15J3DIndBlockNullFP11J3DIndBlock, + (void*)diff__15J3DIndBlockNullFUl, + (void*)load__15J3DIndBlockNullFv, + (void*)countDLSize__11J3DIndBlockFv, + (void*)getType__15J3DIndBlockNullFv, + (void*)setIndTexStageNum__11J3DIndBlockFUc, + (void*)getIndTexStageNum__11J3DIndBlockCFv, + (void*)setIndTexOrder__11J3DIndBlockFUl14J3DIndTexOrder, + (void*)setIndTexOrder__11J3DIndBlockFUlPC14J3DIndTexOrder, + (void*)getIndTexOrder__11J3DIndBlockFUl, + (void*)setIndTexMtx__11J3DIndBlockFUlPC12J3DIndTexMtx, + (void*)setIndTexMtx__11J3DIndBlockFUl12J3DIndTexMtx, + (void*)getIndTexMtx__11J3DIndBlockFUl, + (void*)setIndTexCoordScale__11J3DIndBlockFUlPC19J3DIndTexCoordScale, + (void*)setIndTexCoordScale__11J3DIndBlockFUl19J3DIndTexCoordScale, + (void*)getIndTexCoordScale__11J3DIndBlockFUl, + (void*)__dt__15J3DIndBlockNullFv, +}; + +/* 803CDDE8-803CDE34 02AF08 004C+00 3/3 2/2 0/0 .data __vt__11J3DIndBlock */ +SECTION_DATA extern void* __vt__11J3DIndBlock[19] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)reset__11J3DIndBlockFP11J3DIndBlock, + (void*)NULL, + (void*)NULL, + (void*)countDLSize__11J3DIndBlockFv, + (void*)NULL, + (void*)setIndTexStageNum__11J3DIndBlockFUc, + (void*)getIndTexStageNum__11J3DIndBlockCFv, + (void*)setIndTexOrder__11J3DIndBlockFUl14J3DIndTexOrder, + (void*)setIndTexOrder__11J3DIndBlockFUlPC14J3DIndTexOrder, + (void*)getIndTexOrder__11J3DIndBlockFUl, + (void*)setIndTexMtx__11J3DIndBlockFUlPC12J3DIndTexMtx, + (void*)setIndTexMtx__11J3DIndBlockFUl12J3DIndTexMtx, + (void*)getIndTexMtx__11J3DIndBlockFUl, + (void*)setIndTexCoordScale__11J3DIndBlockFUlPC19J3DIndTexCoordScale, + (void*)setIndTexCoordScale__11J3DIndBlockFUl19J3DIndTexCoordScale, + (void*)getIndTexCoordScale__11J3DIndBlockFUl, + (void*)__dt__11J3DIndBlockFv, +}; + +/* 803CDE34-803CDEA0 02AF54 006C+00 3/3 5/5 0/0 .data __vt__14J3DTexGenBlock */ +SECTION_DATA extern void* __vt__14J3DTexGenBlock[27] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)reset__14J3DTexGenBlockFP14J3DTexGenBlock, + (void*)NULL, + (void*)NULL, + (void*)NULL, + (void*)NULL, + (void*)NULL, + (void*)NULL, + (void*)NULL, + (void*)NULL, + (void*)NULL, + (void*)countDLSize__14J3DTexGenBlockFv, + (void*)NULL, + (void*)setTexGenNum__14J3DTexGenBlockFPCUl, + (void*)setTexGenNum__14J3DTexGenBlockFUl, + (void*)getTexGenNum__14J3DTexGenBlockCFv, + (void*)setTexCoord__14J3DTexGenBlockFUlPC11J3DTexCoord, + (void*)getTexCoord__14J3DTexGenBlockFUl, + (void*)setTexMtx__14J3DTexGenBlockFUlP9J3DTexMtx, + (void*)getTexMtx__14J3DTexGenBlockFUl, + (void*)setNBTScale__14J3DTexGenBlockFPC11J3DNBTScale, + (void*)setNBTScale__14J3DTexGenBlockF11J3DNBTScale, + (void*)getNBTScale__14J3DTexGenBlockFv, + (void*)getTexMtxOffset__14J3DTexGenBlockCFv, + (void*)setTexMtxOffset__14J3DTexGenBlockFUl, + (void*)__dt__14J3DTexGenBlockFv, +}; + +/* 803CDEA0-803CDF30 02AFC0 0090+00 3/3 4/4 0/0 .data __vt__13J3DColorBlock */ +SECTION_DATA extern void* __vt__13J3DColorBlock[36] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)load__13J3DColorBlockFv, + (void*)reset__13J3DColorBlockFP13J3DColorBlock, + (void*)patch__13J3DColorBlockFv, + (void*)patchMatColor__13J3DColorBlockFv, + (void*)patchLight__13J3DColorBlockFv, + (void*)diff__13J3DColorBlockFUl, + (void*)diffAmbColor__13J3DColorBlockFv, + (void*)diffMatColor__13J3DColorBlockFv, + (void*)diffColorChan__13J3DColorBlockFv, + (void*)diffLightObj__13J3DColorBlockFUl, + (void*)countDLSize__13J3DColorBlockFv, + (void*)NULL, + (void*)setMatColor__13J3DColorBlockFUlPC10J3DGXColor, + (void*)setMatColor__13J3DColorBlockFUl10J3DGXColor, + (void*)getMatColor__13J3DColorBlockFUl, + (void*)setAmbColor__13J3DColorBlockFUlPC10J3DGXColor, + (void*)setAmbColor__13J3DColorBlockFUl10J3DGXColor, + (void*)getAmbColor__13J3DColorBlockFUl, + (void*)setColorChanNum__13J3DColorBlockFUc, + (void*)setColorChanNum__13J3DColorBlockFPCUc, + (void*)getColorChanNum__13J3DColorBlockCFv, + (void*)setColorChan__13J3DColorBlockFUlRC12J3DColorChan, + (void*)setColorChan__13J3DColorBlockFUlPC12J3DColorChan, + (void*)getColorChan__13J3DColorBlockFUl, + (void*)setLight__13J3DColorBlockFUlP11J3DLightObj, + (void*)getLight__13J3DColorBlockFUl, + (void*)setCullMode__13J3DColorBlockFPCUc, + (void*)setCullMode__13J3DColorBlockFUc, + (void*)getCullMode__13J3DColorBlockCFv, + (void*)getMatColorOffset__13J3DColorBlockCFv, + (void*)getColorChanOffset__13J3DColorBlockCFv, + (void*)setMatColorOffset__13J3DColorBlockFUl, + (void*)setColorChanOffset__13J3DColorBlockFUl, + (void*)__dt__13J3DColorBlockFv, +}; + +/* 803157A0-803159A0 3100E0 0200+00 0/0 3/3 0/0 .text createColorBlock__11J3DMaterialFUl + */ +J3DColorBlock* J3DMaterial::createColorBlock(u32 param_0) { + J3DColorBlock* rv = NULL; + switch (param_0) { + case 0: + rv = new J3DColorBlockLightOff(); + break; + case 0x40000000: + rv = new J3DColorBlockLightOn(); + break; + case 0x80000000: + rv = new J3DColorBlockAmbientOn(); + break; + } + + return rv; +} + +/* 803159A0-80315B04 3102E0 0164+00 0/0 2/2 0/0 .text createTexGenBlock__11J3DMaterialFUl + */ +J3DTexGenBlock* J3DMaterial::createTexGenBlock(u32 param_0) { + switch (param_0) { + case 0x8000000: + return new J3DTexGenBlock4(); + case 0: + default: + return new J3DTexGenBlockBasic(); + } +} + +/* 80315B04-80315E78 310444 0374+00 0/0 2/2 0/0 .text createTevBlock__11J3DMaterialFi */ +J3DTevBlock* J3DMaterial::createTevBlock(int param_0) { + J3DTevBlock* rv = NULL; + if (param_0 <= 1) { + rv = new J3DTevBlock1(); + } else if (param_0 == 2) { + rv = new J3DTevBlock2(); + } else if (param_0 <= 4) { + rv = new J3DTevBlock4(); + } else if (param_0 <= 16) { + rv = new J3DTevBlock16(); + } + return rv; +} + +/* 80315E78-80315F60 3107B8 00E8+00 0/0 3/3 0/0 .text createIndBlock__11J3DMaterialFi */ +J3DIndBlock* J3DMaterial::createIndBlock(int param_0) { + if (param_0 != 0) { + return new J3DIndBlockFull(); + } + + return new J3DIndBlockNull(); +} + +/* 80315F60-80316100 3108A0 01A0+00 0/0 3/3 0/0 .text createPEBlock__11J3DMaterialFUlUl + */ +// rv is in r5 for some reason +#ifdef NONMATCHING +J3DPEBlock* J3DMaterial::createPEBlock(u32 param_0, u32 param_1) { + J3DPEBlock* rv = NULL; + if (param_0 == 0) { + if (param_1 & 1) { + return new J3DPEBlockOpa(); + } else if (param_1 & 2) { + return new J3DPEBlockTexEdge(); + } else if (param_1 & 4) { + return new J3DPEBlockXlu(); + } + } + + if (param_0 == 0x10000000) { + rv = new J3DPEBlockFull(); + } else if (param_0 == 0x20000000) { + rv = new J3DPEBlockFogOff(); + } + return rv; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DPEBlock* J3DMaterial::createPEBlock(u32 param_0, u32 param_1) { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/createPEBlock__11J3DMaterialFUlUl.s" +} +#pragma pop +#endif + +/* 80316100-80316150 310A40 0050+00 0/0 2/2 0/0 .text calcSizeColorBlock__11J3DMaterialFUl */ +u32 J3DMaterial::calcSizeColorBlock(u32 param_0) { + u32 rv = 0; + switch (param_0) { + case 0: + rv = sizeof(J3DColorBlockLightOff); + break; + case 0x40000000: + rv = sizeof(J3DColorBlockLightOn); + break; + case 0x80000000: + rv = sizeof(J3DColorBlockAmbientOn); + break; + } + + return rv; +} + +/* 80316150-8031617C 310A90 002C+00 0/0 1/1 0/0 .text calcSizeTexGenBlock__11J3DMaterialFUl */ +u32 J3DMaterial::calcSizeTexGenBlock(u32 param_0) { + switch (param_0) { + case 0x8000000: + return sizeof(J3DTexGenBlock4); + case 0: + default: + return sizeof(J3DTexGenBlockBasic); + } +} + +/* 8031617C-803161C4 310ABC 0048+00 0/0 1/1 0/0 .text calcSizeTevBlock__11J3DMaterialFi + */ +u32 J3DMaterial::calcSizeTevBlock(int param_0) { + u32 rv = 0; + if (param_0 <= 1) { + rv = sizeof(J3DTevBlock1); + } else if (param_0 == 2) { + rv = sizeof(J3DTevBlock2); + } else if (param_0 <= 4) { + rv = sizeof(J3DTevBlock4); + } else if (param_0 <= 16) { + rv = sizeof(J3DTevBlock16); + } + return rv; +} + +/* 803161C4-803161D8 310B04 0014+00 0/0 2/2 0/0 .text calcSizeIndBlock__11J3DMaterialFi + */ +u32 J3DMaterial::calcSizeIndBlock(int param_0) { + if (param_0 != 0) { + return sizeof(J3DIndBlockFull); + } + + return sizeof(J3DIndBlockNull); +} + +/* 803161D8-80316240 310B18 0068+00 0/0 2/2 0/0 .text calcSizePEBlock__11J3DMaterialFUlUl + */ +u32 J3DMaterial::calcSizePEBlock(u32 param_0, u32 param_1) { + u32 rv = 0; + if (param_0 == 0) { + if (param_1 & 1) { + rv = sizeof(J3DPEBlockOpa); + } else if (param_1 & 2) { + rv = sizeof(J3DPEBlockTexEdge); + } else if (param_1 & 4) { + rv = sizeof(J3DPEBlockXlu); + } + } + else if (param_0 == 0x10000000) { + rv = sizeof(J3DPEBlockFull); + } else if (param_0 == 0x20000000) { + rv = sizeof(J3DPEBlockFogOff); + } + return rv; +} + +/* 80316240-80316290 310B80 0050+00 2/2 5/5 0/0 .text initialize__11J3DMaterialFv */ +void J3DMaterial::initialize() { + mShape = NULL; + mNext = NULL; + mJoint = NULL; + mMaterialMode = 1; + mIndex = -1; + mInvalid = 0; + mDiffFlag = 0; + mColorBlock = NULL; + mTexGenBlock = NULL; + mTevBlock = NULL; + mIndBlock = NULL; + mPEBlock = NULL; + mpOrigMaterial = NULL; + mMaterialAnm = NULL; + mSharedDLObj = NULL; +} + +/* 80316290-80316344 310BD0 00B4+00 0/0 2/2 0/0 .text countDLSize__11J3DMaterialFv */ +u32 J3DMaterial::countDLSize() { + return (mColorBlock->countDLSize() + mTexGenBlock->countDLSize() + mTevBlock->countDLSize() + + mIndBlock->countDLSize() + mPEBlock->countDLSize() + 31) & ~0x1f; +} + +/* 80316344-80316620 310C84 02DC+00 2/2 0/0 0/0 .text + * makeDisplayList_private__11J3DMaterialFP17J3DDisplayListObj */ +void J3DMaterial::makeDisplayList_private(J3DDisplayListObj* param_0) { + param_0->beginDL(); + mTevBlock->load(); + mIndBlock->load(); + mPEBlock->load(); + J3DGDSetGenMode(mTexGenBlock->getTexGenNum(), mColorBlock->getColorChanNum(), mTevBlock->getTevStageNum(), mIndBlock->getIndTexStageNum(), (GXCullMode)(u8)mColorBlock->getCullMode()); + mTexGenBlock->load(); + mColorBlock->load(); + J3DGDSetNumChans(mColorBlock->getColorChanNum()); + J3DGDSetNumTexGens(mTexGenBlock->getTexGenNum()); + param_0->endDL(); +} + +/* 80316620-80316668 310F60 0048+00 1/0 0/0 0/0 .text makeDisplayList__11J3DMaterialFv */ +void J3DMaterial::makeDisplayList() { + if (!j3dSys.getMatPacket()->isLocked()) { + j3dSys.getMatPacket()->mDiffFlag = mDiffFlag; + makeDisplayList_private(j3dSys.getMatPacket()->getDisplayListObj()); + } +} + +/* 80316668-8031668C 310FA8 0024+00 1/0 0/0 0/0 .text makeSharedDisplayList__11J3DMaterialFv */ +void J3DMaterial::makeSharedDisplayList() { + makeDisplayList_private(mSharedDLObj); +} + +/* 8031668C-803166DC 310FCC 0050+00 1/0 0/0 0/0 .text load__11J3DMaterialFv */ +void J3DMaterial::load() { + j3dSys.setMaterialMode(mMaterialMode); + if (!j3dSys.checkFlag(2)) { + loadNBTScale(*mTexGenBlock->getNBTScale()); + } +} + +/* 803166DC-80316740 31101C 0064+00 1/0 0/0 0/0 .text loadSharedDL__11J3DMaterialFv */ +void J3DMaterial::loadSharedDL() { + j3dSys.setMaterialMode(mMaterialMode); + if (!j3dSys.checkFlag(2)) { + mSharedDLObj->callDL(); + loadNBTScale(*mTexGenBlock->getNBTScale()); + } +} + +/* 80316740-803167D8 311080 0098+00 2/0 0/0 0/0 .text patch__11J3DMaterialFv */ +void J3DMaterial::patch() { + j3dSys.getMatPacket()->mDiffFlag = mDiffFlag; + j3dSys.getMatPacket()->beginPatch(); + mTevBlock->patch(); + mColorBlock->patch(); + mTexGenBlock->patch(); + j3dSys.getMatPacket()->endPatch(); +} + +/* 803167D8-803169DC 311118 0204+00 2/0 0/0 0/0 .text diff__11J3DMaterialFUl */ +void J3DMaterial::diff(u32 param_0) { + if (j3dSys.getMatPacket()->isEnabled_Diff()) { + j3dSys.getMatPacket()->beginDiff(); + mTevBlock->diff(param_0); + mIndBlock->diff(param_0); + mPEBlock->diff(param_0); + if (param_0 & 0x2000000) { + J3DGDSetGenMode_3Param(mTexGenBlock->getTexGenNum(), mTevBlock->getTevStageNum(), mIndBlock->getIndTexStageNum()); + J3DGDSetNumTexGens(mTexGenBlock->getTexGenNum()); + } + mTexGenBlock->diff(param_0); + mColorBlock->diff(param_0); + j3dSys.getMatPacket()->endDiff(); + } +} + +/* 803169DC-80316A54 31131C 0078+00 2/0 0/0 0/0 .text calc__11J3DMaterialFPA4_Cf */ +// Matches but changes order of TU vtables (?!) +#ifdef NONMATCHING +void J3DMaterial::calc(f32 const (*param_0)[4]) { + if (j3dSys.checkFlag(0x40000000)) { + mTexGenBlock->calcPostTexMtx(param_0); + } else { + mTexGenBlock->calc(param_0); + } + + calcCurrentMtx(); + setCurrentMtx(); +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +extern "C" asm void calc__11J3DMaterialFPA4_Cf() { + // asm void J3DMaterial::calc(f32 const (*param_0)[4]) { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/calc__11J3DMaterialFPA4_Cf.s" +} +#pragma pop +#endif + +/* 80316A54-80316AB0 311394 005C+00 3/0 0/0 0/0 .text calcDiffTexMtx__11J3DMaterialFPA4_Cf */ +void J3DMaterial::calcDiffTexMtx(f32 const (*param_0)[4]) { + if (j3dSys.checkFlag(0x40000000)) { + mTexGenBlock->calcPostTexMtxWithoutViewMtx(param_0); + } else { + mTexGenBlock->calcWithoutViewMtx(param_0); + } +} + +/* 80316AB0-80316AC8 3113F0 0018+00 1/1 1/1 0/0 .text setCurrentMtx__11J3DMaterialFv */ +void J3DMaterial::setCurrentMtx() { + mShape->setCurrentMtx(mCurrentMtx); +} + +/* 80316AC8-80316D68 311408 02A0+00 1/1 0/0 0/0 .text calcCurrentMtx__11J3DMaterialFv */ +// Issues with setCurrentTexMtx +#ifdef NONMATCHING +void J3DMaterial::calcCurrentMtx() { + if (!j3dSys.checkFlag(0x40000000)) { + mCurrentMtx.setCurrentTexMtx( + mTexGenBlock->getTexCoord(0)->getTexGenMtx(), + mTexGenBlock->getTexCoord(1)->getTexGenMtx(), + mTexGenBlock->getTexCoord(2)->getTexGenMtx(), + mTexGenBlock->getTexCoord(3)->getTexGenMtx(), + mTexGenBlock->getTexCoord(4)->getTexGenMtx(), + mTexGenBlock->getTexCoord(5)->getTexGenMtx(), + mTexGenBlock->getTexCoord(6)->getTexGenMtx(), + mTexGenBlock->getTexCoord(7)->getTexGenMtx() + ); + } else { + mCurrentMtx.setCurrentTexMtx( + mTexGenBlock->getTexCoord(0)->getTexMtxReg(), + mTexGenBlock->getTexCoord(1)->getTexMtxReg(), + mTexGenBlock->getTexCoord(2)->getTexMtxReg(), + mTexGenBlock->getTexCoord(3)->getTexMtxReg(), + mTexGenBlock->getTexCoord(4)->getTexMtxReg(), + mTexGenBlock->getTexCoord(5)->getTexMtxReg(), + mTexGenBlock->getTexCoord(6)->getTexMtxReg(), + mTexGenBlock->getTexCoord(7)->getTexMtxReg() + ); + } +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void J3DMaterial::calcCurrentMtx() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/calcCurrentMtx__11J3DMaterialFv.s" +} +#pragma pop +#endif + +/* 80316D68-80316E14 3116A8 00AC+00 1/1 0/0 0/0 .text copy__11J3DMaterialFP11J3DMaterial + */ +void J3DMaterial::copy(J3DMaterial* param_0) { + mColorBlock->reset(param_0->mColorBlock); + mTexGenBlock->reset(param_0->mTexGenBlock); + mTevBlock->reset(param_0->mTevBlock); + mIndBlock->reset(param_0->mIndBlock); + mPEBlock->reset(param_0->mPEBlock); +} + +/* 80316E14-80316E70 311754 005C+00 1/0 0/0 0/0 .text reset__11J3DMaterialFv */ +void J3DMaterial::reset() { + if ((~mDiffFlag & 0x80000000) == 0) { + mDiffFlag &= ~0x80000000; + mMaterialMode = mpOrigMaterial->mMaterialMode; + mInvalid = mpOrigMaterial->mInvalid; + mMaterialAnm = NULL; + copy(mpOrigMaterial); + } +} + +/* 80316E70-80316E90 3117B0 0020+00 1/0 0/0 0/0 .text change__11J3DMaterialFv */ +void J3DMaterial::change() { + if ((mDiffFlag & 0xc0000000) == 0) { + mDiffFlag |= 0x80000000; + mMaterialAnm = NULL; + } +} + +/* 80316E90-80316F24 3117D0 0094+00 0/0 2/2 0/0 .text newSharedDisplayList__11J3DMaterialFUl */ +s32 J3DMaterial::newSharedDisplayList(u32 param_0) { + if (mSharedDLObj == NULL) { + mSharedDLObj = new J3DDisplayListObj(); + if (mSharedDLObj == NULL) { + return 4; + } + s32 res = mSharedDLObj->newDisplayList(param_0); + switch (res) { + case kJ3DError_Success: + break; + default: + return res; + } + } + return 0; +} + +/* 80316F24-80316FB8 311864 0094+00 0/0 2/2 0/0 .text newSingleSharedDisplayList__11J3DMaterialFUl + */ +s32 J3DMaterial::newSingleSharedDisplayList(u32 param_0) { + if (mSharedDLObj == NULL) { + mSharedDLObj = new J3DDisplayListObj(); + if (mSharedDLObj == NULL) { + return 4; + } + s32 res = mSharedDLObj->newSingleDisplayList(param_0); + switch (res) { + case kJ3DError_Success: + break; + default: + return res; + } + } + return 0; +} + +/* 80316FB8-80316FD8 3118F8 0020+00 0/0 1/1 0/0 .text initialize__18J3DPatchedMaterialFv + */ +void J3DPatchedMaterial::initialize() { + J3DMaterial::initialize(); +} + +/* 80316FD8-80316FDC 311918 0004+00 1/0 0/0 0/0 .text makeDisplayList__18J3DPatchedMaterialFv */ +extern "C" asm void makeDisplayList__18J3DPatchedMaterialFv() { +//void J3DPatchedMaterial::makeDisplayList() { + /* empty function */ +} + +/* 80316FDC-80316FE0 31191C 0004+00 1/0 0/0 0/0 .text + * makeSharedDisplayList__18J3DPatchedMaterialFv */ +void J3DPatchedMaterial::makeSharedDisplayList() { + /* empty function */ +} + +/* 80316FE0-80316FFC 311920 001C+00 1/0 0/0 0/0 .text load__18J3DPatchedMaterialFv */ +void J3DPatchedMaterial::load() { + j3dSys.setMaterialMode(mMaterialMode); + if (j3dSys.checkFlag(2)) { + return; + } +} + +/* 80316FFC-8031703C 31193C 0040+00 1/0 0/0 0/0 .text loadSharedDL__18J3DPatchedMaterialFv */ +void J3DPatchedMaterial::loadSharedDL() { + j3dSys.setMaterialMode(mMaterialMode); + if (!j3dSys.checkFlag(0x02)) + mSharedDLObj->callDL(); +} + +/* 8031703C-80317040 31197C 0004+00 1/0 0/0 0/0 .text reset__18J3DPatchedMaterialFv */ +void J3DPatchedMaterial::reset() { + /* empty function */ +} + +/* 80317040-80317044 311980 0004+00 1/0 0/0 0/0 .text change__18J3DPatchedMaterialFv */ +void J3DPatchedMaterial::change() { + /* empty function */ +} + +/* 80317044-80317064 311984 0020+00 0/0 1/1 0/0 .text initialize__17J3DLockedMaterialFv + */ +void J3DLockedMaterial::initialize() { + J3DMaterial::initialize(); +} + +/* 80317064-80317068 3119A4 0004+00 1/0 0/0 0/0 .text makeDisplayList__17J3DLockedMaterialFv */ +void J3DLockedMaterial::makeDisplayList() { + /* empty function */ +} + +/* 80317068-8031706C 3119A8 0004+00 1/0 0/0 0/0 .text makeSharedDisplayList__17J3DLockedMaterialFv + */ +void J3DLockedMaterial::makeSharedDisplayList() { + /* empty function */ +} + +/* 8031706C-80317088 3119AC 001C+00 1/0 0/0 0/0 .text load__17J3DLockedMaterialFv */ +void J3DLockedMaterial::load() { + j3dSys.setMaterialMode(mMaterialMode); + if (j3dSys.checkFlag(2)) { + return; + } +} + +/* 80317088-803170C8 3119C8 0040+00 1/0 0/0 0/0 .text loadSharedDL__17J3DLockedMaterialFv + */ +void J3DLockedMaterial::loadSharedDL() { + j3dSys.setMaterialMode(mMaterialMode); + if (!j3dSys.checkFlag(0x02)) + mSharedDLObj->callDL(); +} + +/* 803170C8-803170CC 311A08 0004+00 1/0 0/0 0/0 .text patch__17J3DLockedMaterialFv */ +void J3DLockedMaterial::patch() { + /* empty function */ +} + +/* 803170CC-803170D0 311A0C 0004+00 1/0 0/0 0/0 .text diff__17J3DLockedMaterialFUl */ +void J3DLockedMaterial::diff(u32 param_0) { + /* empty function */ +} + +/* 803170D0-803170D4 311A10 0004+00 1/0 0/0 0/0 .text calc__17J3DLockedMaterialFPA4_Cf */ +extern "C" asm void calc__17J3DLockedMaterialFPA4_Cf() { + /* empty function */ +} + +/* 803170D4-803170D8 311A14 0004+00 1/0 0/0 0/0 .text reset__17J3DLockedMaterialFv */ +void J3DLockedMaterial::reset() { + /* empty function */ +} + +/* 803170D8-803170DC 311A18 0004+00 1/0 0/0 0/0 .text change__17J3DLockedMaterialFv */ +void J3DLockedMaterial::change() { + /* empty function */ +} + +/* 803170DC-80317138 311A1C 005C+00 0/0 1/0 0/0 .text __dt__21J3DColorBlockLightOffFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DColorBlockLightOff::~J3DColorBlockLightOff() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__21J3DColorBlockLightOffFv.s" +} +#pragma pop + +/* 80317138-80317180 311A78 0048+00 1/0 0/0 0/0 .text __dt__13J3DColorBlockFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +// asm J3DColorBlock::~J3DColorBlock() { +extern "C" asm void __dt__13J3DColorBlockFv() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__13J3DColorBlockFv.s" +} +#pragma pop + +/* 80317180-803171DC 311AC0 005C+00 0/0 1/0 0/0 .text __dt__21J3DTexGenBlockPatchedFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DTexGenBlockPatched::~J3DTexGenBlockPatched() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__21J3DTexGenBlockPatchedFv.s" +} +#pragma pop + +/* 803171DC-80317224 311B1C 0048+00 1/0 0/0 0/0 .text __dt__14J3DTexGenBlockFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +// asm J3DTexGenBlock::~J3DTexGenBlock() { +extern "C" asm void __dt__14J3DTexGenBlockFv() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__14J3DTexGenBlockFv.s" +} +#pragma pop + +/* 80317224-8031726C 311B64 0048+00 0/0 1/0 0/0 .text __dt__11J3DTevBlockFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +// asm J3DTevBlock::~J3DTevBlock() { +extern "C" asm void __dt__11J3DTevBlockFv() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__11J3DTevBlockFv.s" +} +#pragma pop + +/* 8031726C-803172B4 311BAC 0048+00 1/0 0/0 0/0 .text __dt__11J3DIndBlockFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DIndBlock::~J3DIndBlock() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__11J3DIndBlockFv.s" +} +#pragma pop + +/* 803172B4-803172FC 311BF4 0048+00 1/0 0/0 0/0 .text __dt__10J3DPEBlockFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +// asm J3DPEBlock::~J3DPEBlock() { +extern "C" asm void __dt__10J3DPEBlockFv() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__10J3DPEBlockFv.s" +} +#pragma pop + +/* 803172FC-80317304 311C3C 0008+00 1/0 1/0 0/0 .text countDLSize__14J3DTexGenBlockFv */ +s32 J3DTexGenBlock::countDLSize() { + return false; +} + +/* 80317304-8031730C 311C44 0008+00 1/0 1/0 0/0 .text countDLSize__13J3DColorBlockFv */ +s32 J3DColorBlock::countDLSize() { + return false; +} + +/* 8031730C-80317314 311C4C 0008+00 0/0 2/0 0/0 .text countDLSize__11J3DTevBlockFv */ +s32 J3DTevBlock::countDLSize() { + return false; +} + +/* 80317314-8031731C 311C54 0008+00 2/0 0/0 0/0 .text countDLSize__11J3DIndBlockFv */ +s32 J3DIndBlock::countDLSize() { + return false; +} + +/* 8031731C-80317324 311C5C 0008+00 1/0 1/0 0/0 .text countDLSize__10J3DPEBlockFv */ +s32 J3DPEBlock::countDLSize() { + return false; +} + +/* 80317324-80317328 311C64 0004+00 1/0 1/0 0/0 .text load__13J3DColorBlockFv */ +extern "C" void load__13J3DColorBlockFv() { + /* empty function */ +} + +/* 80317328-80317330 311C68 0008+00 1/0 1/0 0/0 .text getCullMode__13J3DColorBlockCFv */ +s32 J3DColorBlock::getCullMode() const { + return 2; +} + +/* 80317330-80317334 311C70 0004+00 0/0 2/0 0/0 .text load__11J3DTevBlockFv */ +void J3DTevBlock::load() { + /* empty function */ +} + +/* 80317334-8031733C 311C74 0008+00 1/0 2/0 0/0 .text getNBTScale__14J3DTexGenBlockFv */ +J3DNBTScale* J3DTexGenBlock::getNBTScale() { + return NULL; +} + +/* 8031733C-80317340 311C7C 0004+00 1/0 1/0 0/0 .text patch__13J3DColorBlockFv */ +void J3DColorBlock::patch() { + /* empty function */ +} + +/* 80317340-80317344 311C80 0004+00 1/0 1/0 0/0 .text diff__13J3DColorBlockFUl */ +void J3DColorBlock::diff(u32 param_0) { + /* empty function */ +} + +/* 80317344-80317348 311C84 0004+00 1/0 4/0 0/0 .text diff__10J3DPEBlockFUl */ +void J3DPEBlock::diff(u32 param_0) { + /* empty function */ +} + +/* 80317348-8031734C 311C88 0004+00 1/0 4/0 0/0 .text reset__10J3DPEBlockFP10J3DPEBlock + */ +extern "C" void reset__10J3DPEBlockFP10J3DPEBlock() { + /* empty function */ +} + +/* 8031734C-80317350 311C8C 0004+00 1/0 0/0 0/0 .text reset__11J3DIndBlockFP11J3DIndBlock + */ +extern "C" void reset__11J3DIndBlockFP11J3DIndBlock() { + /* empty function */ +} + +/* 80317350-80317354 311C90 0004+00 0/0 1/0 0/0 .text reset__11J3DTevBlockFP11J3DTevBlock + */ +extern "C" void reset__11J3DTevBlockFP11J3DTevBlock(J3DTevBlock* param_0) { + /* empty function */ +} + +/* 80317354-80317358 311C94 0004+00 1/0 1/0 0/0 .text reset__14J3DTexGenBlockFP14J3DTexGenBlock */ +extern "C" void reset__14J3DTexGenBlockFP14J3DTexGenBlock() { + /* empty function */ +} + +/* 80317358-8031735C 311C98 0004+00 1/0 1/0 0/0 .text reset__13J3DColorBlockFP13J3DColorBlock */ +void J3DColorBlock::reset(J3DColorBlock* param_0) { + /* empty function */ +} + +/* 8031735C-80317360 311C9C 0004+00 1/0 5/0 0/0 .text diffFog__10J3DPEBlockFv */ +void J3DPEBlock::diffFog() { + /* empty function */ +} + +/* 80317360-80317364 311CA0 0004+00 1/0 4/0 0/0 .text diffBlend__10J3DPEBlockFv */ +void J3DPEBlock::diffBlend() { + /* empty function */ +} + +/* 80317364-80317368 311CA4 0004+00 1/0 5/0 0/0 .text setFog__10J3DPEBlockFP6J3DFog */ +void J3DPEBlock::setFog(J3DFog* param_0) { + /* empty function */ +} + +/* 80317368-8031736C 311CA8 0004+00 1/0 5/0 0/0 .text setFog__10J3DPEBlockF6J3DFog */ +void J3DPEBlock::setFog(J3DFog param_0) { + /* empty function */ +} + +/* 8031736C-80317370 311CAC 0004+00 1/0 4/0 0/0 .text setAlphaComp__10J3DPEBlockFPC12J3DAlphaComp + */ +void J3DPEBlock::setAlphaComp(J3DAlphaComp const* param_0) { + /* empty function */ +} + +/* 80317370-80317374 311CB0 0004+00 1/0 4/0 0/0 .text setBlend__10J3DPEBlockFPC8J3DBlend + */ +void J3DPEBlock::setBlend(J3DBlend const* param_0) { + /* empty function */ +} + +/* 80317374-80317378 311CB4 0004+00 1/0 4/0 0/0 .text setZMode__10J3DPEBlockFPC8J3DZMode + */ +void J3DPEBlock::setZMode(J3DZMode const* param_0) { + /* empty function */ +} + +/* 80317378-8031737C 311CB8 0004+00 1/0 4/0 0/0 .text setZCompLoc__10J3DPEBlockFPCUc */ +void J3DPEBlock::setZCompLoc(u8 const* param_0) { + /* empty function */ +} + +/* 8031737C-80317380 311CBC 0004+00 1/0 4/0 0/0 .text setDither__10J3DPEBlockFUc */ +void J3DPEBlock::setDither(u8 param_0) { + /* empty function */ +} + +/* 80317380-80317384 311CC0 0004+00 1/0 4/0 0/0 .text setDither__10J3DPEBlockFPCUc */ +void J3DPEBlock::setDither(u8 const* param_0) { + /* empty function */ +} + +/* 80317384-8031738C 311CC4 0008+00 1/0 4/0 0/0 .text getDither__10J3DPEBlockCFv */ +bool J3DPEBlock::getDither() const { + return false; +} + +/* 8031738C-80317394 311CCC 0008+00 1/0 5/0 0/0 .text getFogOffset__10J3DPEBlockCFv */ +bool J3DPEBlock::getFogOffset() const { + return false; +} + +/* 80317394-80317398 311CD4 0004+00 1/0 5/0 0/0 .text setFogOffset__10J3DPEBlockFUl */ +void J3DPEBlock::setFogOffset(u32 param_0) { + /* empty function */ +} + +/* 80317398-8031739C 311CD8 0004+00 1/0 0/0 0/0 .text diff__15J3DIndBlockNullFUl */ +void J3DIndBlockNull::diff(u32 param_0) { + /* empty function */ +} + +/* 8031739C-803173A0 311CDC 0004+00 1/0 0/0 0/0 .text load__15J3DIndBlockNullFv */ +void J3DIndBlockNull::load() { + /* empty function */ +} + +/* 803173A0-803173A4 311CE0 0004+00 1/0 0/0 0/0 .text reset__15J3DIndBlockNullFP11J3DIndBlock */ +extern "C" asm void reset__15J3DIndBlockNullFP11J3DIndBlock() { + /* empty function */ +} + +/* 803173A4-803173B0 311CE4 000C+00 1/0 0/0 0/0 .text getType__15J3DIndBlockNullFv */ +u32 J3DIndBlockNull::getType() { + return 'IBLN'; +} + +/* 803173B0-8031740C 311CF0 005C+00 1/0 0/0 0/0 .text __dt__15J3DIndBlockNullFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DIndBlockNull::~J3DIndBlockNull() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DMaterial/__dt__15J3DIndBlockNullFv.s" +} +#pragma pop + +/* 8031740C-80317410 311D4C 0004+00 2/0 0/0 0/0 .text + * setIndTexOrder__11J3DIndBlockFUlPC14J3DIndTexOrder */ +void J3DIndBlock::setIndTexOrder(u32 param_0, J3DIndTexOrder const* param_1) { + /* empty function */ +} + +/* 80317410-80317414 311D50 0004+00 2/0 0/0 0/0 .text + * setIndTexOrder__11J3DIndBlockFUl14J3DIndTexOrder */ +void J3DIndBlock::setIndTexOrder(u32 param_0, J3DIndTexOrder param_1) { + /* empty function */ +} + +/* 80317414-80317418 311D54 0004+00 2/0 0/0 0/0 .text + * setIndTexMtx__11J3DIndBlockFUlPC12J3DIndTexMtx */ +void J3DIndBlock::setIndTexMtx(u32 param_0, J3DIndTexMtx const* param_1) { + /* empty function */ +} + +/* 80317418-8031741C 311D58 0004+00 2/0 0/0 0/0 .text + * setIndTexCoordScale__11J3DIndBlockFUlPC19J3DIndTexCoordScale */ +void J3DIndBlock::setIndTexCoordScale(u32 param_0, J3DIndTexCoordScale const* param_1) { + /* empty function */ +} + +/* 8031741C-80317420 311D5C 0004+00 1/0 1/0 0/0 .text setTexGenNum__14J3DTexGenBlockFPCUl + */ +void J3DTexGenBlock::setTexGenNum(u32 const* param_0) { + /* empty function */ +} + +/* 80317420-80317424 311D60 0004+00 1/0 2/0 0/0 .text setNBTScale__14J3DTexGenBlockF11J3DNBTScale + */ +void J3DTexGenBlock::setNBTScale(J3DNBTScale param_0) { + /* empty function */ +} + +/* 80317424-80317428 311D64 0004+00 1/0 2/0 0/0 .text + * setNBTScale__14J3DTexGenBlockFPC11J3DNBTScale */ +void J3DTexGenBlock::setNBTScale(J3DNBTScale const* param_0) { + /* empty function */ +} + +/* 80317428-80317430 311D68 0008+00 1/0 1/0 0/0 .text getTexMtxOffset__14J3DTexGenBlockCFv */ +bool J3DTexGenBlock::getTexMtxOffset() const { + return false; +} + +/* 80317430-80317434 311D70 0004+00 1/0 1/0 0/0 .text setTexMtxOffset__14J3DTexGenBlockFUl */ +void J3DTexGenBlock::setTexMtxOffset(u32 param_0) { + /* empty function */ +} + +/* 80317434-80317438 311D74 0004+00 1/0 1/0 0/0 .text patchMatColor__13J3DColorBlockFv */ +void J3DColorBlock::patchMatColor() { + /* empty function */ +} + +/* 80317438-8031743C 311D78 0004+00 1/0 3/0 0/0 .text diffAmbColor__13J3DColorBlockFv */ +void J3DColorBlock::diffAmbColor() { + /* empty function */ +} + +/* 8031743C-80317440 311D7C 0004+00 1/0 1/0 0/0 .text diffMatColor__13J3DColorBlockFv */ +void J3DColorBlock::diffMatColor() { + /* empty function */ +} + +/* 80317440-80317444 311D80 0004+00 1/0 1/0 0/0 .text diffColorChan__13J3DColorBlockFv */ +void J3DColorBlock::diffColorChan() { + /* empty function */ +} + +/* 80317444-80317448 311D84 0004+00 1/0 3/0 0/0 .text diffLightObj__13J3DColorBlockFUl */ +void J3DColorBlock::diffLightObj(u32 param_0) { + /* empty function */ +} + +/* 80317448-8031744C 311D88 0004+00 1/0 1/0 0/0 .text + * setMatColor__13J3DColorBlockFUlPC10J3DGXColor */ +void J3DColorBlock::setMatColor(u32 param_0, J3DGXColor const* param_1) { + /* empty function */ +} + +/* 8031744C-80317450 311D8C 0004+00 1/0 1/0 0/0 .text setColorChanNum__13J3DColorBlockFPCUc */ +void J3DColorBlock::setColorChanNum(u8 const* param_0) { + /* empty function */ +} + +/* 80317450-80317454 311D90 0004+00 1/0 1/0 0/0 .text + * setColorChan__13J3DColorBlockFUlPC12J3DColorChan */ +void J3DColorBlock::setColorChan(u32 param_0, J3DColorChan const* param_1) { + /* empty function */ +} + +/* 80317454-8031745C 311D94 0008+00 1/0 3/0 0/0 .text getLight__13J3DColorBlockFUl */ +bool J3DColorBlock::getLight(u32 param_0) { + return false; +} + +/* 8031745C-80317460 311D9C 0004+00 1/0 1/0 0/0 .text setCullMode__13J3DColorBlockFUc */ +void J3DColorBlock::setCullMode(u8 param_0) { + /* empty function */ +} + +/* 80317460-80317464 311DA0 0004+00 1/0 1/0 0/0 .text setCullMode__13J3DColorBlockFPCUc + */ +void J3DColorBlock::setCullMode(u8 const* param_0) { + /* empty function */ +} + +/* 80317464-8031746C 311DA4 0008+00 1/0 1/0 0/0 .text getMatColorOffset__13J3DColorBlockCFv */ +bool J3DColorBlock::getMatColorOffset() const { + return false; +} + +/* 8031746C-80317474 311DAC 0008+00 1/0 1/0 0/0 .text getColorChanOffset__13J3DColorBlockCFv */ +bool J3DColorBlock::getColorChanOffset() const { + return false; +} + +/* 80317474-80317478 311DB4 0004+00 1/0 1/0 0/0 .text setMatColorOffset__13J3DColorBlockFUl */ +void J3DColorBlock::setMatColorOffset(u32 param_0) { + /* empty function */ +} + +/* 80317478-8031747C 311DB8 0004+00 1/0 1/0 0/0 .text setColorChanOffset__13J3DColorBlockFUl */ +void J3DColorBlock::setColorChanOffset(u32 param_0) { + /* empty function */ +} diff --git a/libs/JSystem/J3DGraphBase/J3DStruct.cpp b/libs/JSystem/J3DGraphBase/J3DStruct.cpp index 1ea220f35e1..6b1cec2e2a7 100644 --- a/libs/JSystem/J3DGraphBase/J3DStruct.cpp +++ b/libs/JSystem/J3DGraphBase/J3DStruct.cpp @@ -1,95 +1,97 @@ -// -// Generated By: dol2asm -// Translation Unit: J3DStruct -// - -#include "JSystem/J3DGraphBase/J3DStruct.h" -#include "JSystem/JMath/JMath.h" -#include "dol2asm.h" - -// -// Declarations: -// - -/* 803256C4-80325718 320004 0054+00 0/0 11/11 24/24 .text __as__12J3DLightInfoFRC12J3DLightInfo */ -void J3DLightInfo::operator=(J3DLightInfo const& param_0) { - JMath::gekko_ps_copy6(&mLightPosition, ¶m_0.mLightPosition); - mColor = param_0.mColor; - JMath::gekko_ps_copy6(&mCosAtten, ¶m_0.mCosAtten); -} - -/* 80325718-80325794 320058 007C+00 0/0 4/4 0/0 .text __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo */ -void J3DTexMtxInfo::operator=(J3DTexMtxInfo const& param_0) { - mProjection = param_0.mProjection; - mInfo = param_0.mInfo; - JMath::gekko_ps_copy3(&mCenter, ¶m_0.mCenter); - mSRT = param_0.mSRT; - JMath::gekko_ps_copy16(&mEffectMtx, ¶m_0.mEffectMtx); -} - -/* ############################################################################################## */ -/* 80456410-80456414 004A10 0004+00 1/1 0/0 0/0 .sdata2 @409 */ -SECTION_SDATA2 static f32 lit_409 = 1.0f; - -/* 80456414-80456418 004A14 0004+00 1/1 0/0 0/0 .sdata2 @410 */ -SECTION_SDATA2 static u8 lit_410[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; - -/* 80325794-803257DC 3200D4 0048+00 0/0 2/2 7/7 .text setEffectMtx__13J3DTexMtxInfoFPA4_f - */ -// needs inline asm? -#ifdef NONMATCHING -void J3DTexMtxInfo::setEffectMtx(Mtx param_0) { - JMath::gekko_ps_copy12(&mEffectMtx, param_0); - mEffectMtx[3][0] = 0.0f; - mEffectMtx[3][1] = 0.0f; - mEffectMtx[3][2] = 0.0f; - mEffectMtx[3][3] = 1.0f; -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DTexMtxInfo::setEffectMtx(f32 (*param_0)[4]) { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DStruct/setEffectMtx__13J3DTexMtxInfoFPA4_f.s" -} -#pragma pop -#endif - -/* 803257DC-80325800 32011C 0024+00 0/0 5/5 0/0 .text - * __as__16J3DIndTexMtxInfoFRC16J3DIndTexMtxInfo */ -void J3DIndTexMtxInfo::operator=(J3DIndTexMtxInfo const& param_0) { - JMath::gekko_ps_copy6(field_0x0, param_0.field_0x0); - field_0x18 = param_0.field_0x18; -} - -/* 80325800-8032587C 320140 007C+00 0/0 6/6 0/0 .text __as__10J3DFogInfoFRC10J3DFogInfo - */ -void J3DFogInfo::operator=(J3DFogInfo const& param_0) { - field_0x0 = param_0.field_0x0; - field_0x1 = param_0.field_0x1; - field_0x2 = param_0.field_0x2; - field_0x4 = param_0.field_0x4; - field_0x8 = param_0.field_0x8; - field_0xc = param_0.field_0xc; - field_0x10 = param_0.field_0x10; - field_0x14 = param_0.field_0x14; - field_0x15 = param_0.field_0x15; - field_0x16 = param_0.field_0x16; - field_0x17 = param_0.field_0x17; - for (int i = 0; i < 10; i++) { - field_0x18[i] = param_0.field_0x18[i]; - } -} - -/* 8032587C-803258A0 3201BC 0024+00 0/0 6/6 0/0 .text __as__15J3DNBTScaleInfoFRC15J3DNBTScaleInfo - */ -void J3DNBTScaleInfo::operator=(J3DNBTScaleInfo const& param_0) { - mbHasScale = param_0.mbHasScale; - mScale = param_0.mScale; +// +// Generated By: dol2asm +// Translation Unit: J3DStruct +// + +#include "JSystem/J3DGraphBase/J3DStruct.h" +#include "JSystem/JMath/JMath.h" +#include "dol2asm.h" + +// +// Declarations: +// + +/* 803256C4-80325718 320004 0054+00 0/0 11/11 24/24 .text __as__12J3DLightInfoFRC12J3DLightInfo */ +J3DLightInfo& J3DLightInfo::operator=(J3DLightInfo const& param_0) { + JMath::gekko_ps_copy6(&mLightPosition, ¶m_0.mLightPosition); + mColor = param_0.mColor; + JMath::gekko_ps_copy6(&mCosAtten, ¶m_0.mCosAtten); + return *this; +} + +/* 80325718-80325794 320058 007C+00 0/0 4/4 0/0 .text __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo */ +J3DTexMtxInfo& J3DTexMtxInfo::operator=(J3DTexMtxInfo const& param_0) { + mProjection = param_0.mProjection; + mInfo = param_0.mInfo; + JMath::gekko_ps_copy3(&mCenter, ¶m_0.mCenter); + mSRT = param_0.mSRT; + JMath::gekko_ps_copy16(&mEffectMtx, ¶m_0.mEffectMtx); + return *this; +} + +/* ############################################################################################## */ +/* 80456410-80456414 004A10 0004+00 1/1 0/0 0/0 .sdata2 @409 */ +SECTION_SDATA2 static f32 lit_409 = 1.0f; + +/* 80456414-80456418 004A14 0004+00 1/1 0/0 0/0 .sdata2 @410 */ +SECTION_SDATA2 static u8 lit_410[4] = { + 0x00, + 0x00, + 0x00, + 0x00, +}; + +/* 80325794-803257DC 3200D4 0048+00 0/0 2/2 7/7 .text setEffectMtx__13J3DTexMtxInfoFPA4_f + */ +// needs inline asm? +#ifdef NONMATCHING +void J3DTexMtxInfo::setEffectMtx(Mtx param_0) { + JMath::gekko_ps_copy12(&mEffectMtx, param_0); + mEffectMtx[3][0] = 0.0f; + mEffectMtx[3][1] = 0.0f; + mEffectMtx[3][2] = 0.0f; + mEffectMtx[3][3] = 1.0f; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void J3DTexMtxInfo::setEffectMtx(f32 (*param_0)[4]) { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DStruct/setEffectMtx__13J3DTexMtxInfoFPA4_f.s" +} +#pragma pop +#endif + +/* 803257DC-80325800 32011C 0024+00 0/0 5/5 0/0 .text + * __as__16J3DIndTexMtxInfoFRC16J3DIndTexMtxInfo */ +J3DIndTexMtxInfo& J3DIndTexMtxInfo::operator=(J3DIndTexMtxInfo const& param_0) { + JMath::gekko_ps_copy6(field_0x0, param_0.field_0x0); + field_0x18 = param_0.field_0x18; + return *this; +} + +/* 80325800-8032587C 320140 007C+00 0/0 6/6 0/0 .text __as__10J3DFogInfoFRC10J3DFogInfo + */ +J3DFogInfo& J3DFogInfo::operator=(J3DFogInfo const& param_0) { + field_0x0 = param_0.field_0x0; + field_0x1 = param_0.field_0x1; + field_0x2 = param_0.field_0x2; + field_0x4 = param_0.field_0x4; + field_0x8 = param_0.field_0x8; + field_0xc = param_0.field_0xc; + field_0x10 = param_0.field_0x10; + field_0x14 = param_0.field_0x14; + for (int i = 0; i < 10; i++) { + field_0x18.fogVals[i] = param_0.field_0x18.fogVals[i]; + } + return *this; +} + +/* 8032587C-803258A0 3201BC 0024+00 0/0 6/6 0/0 .text __as__15J3DNBTScaleInfoFRC15J3DNBTScaleInfo + */ +J3DNBTScaleInfo& J3DNBTScaleInfo::operator=(J3DNBTScaleInfo const& param_0) { + mbHasScale = param_0.mbHasScale; + mScale = param_0.mScale; + return *this; } \ No newline at end of file diff --git a/libs/JSystem/J3DGraphBase/J3DSys.cpp b/libs/JSystem/J3DGraphBase/J3DSys.cpp index 5445c572b35..c6a7a07767d 100644 --- a/libs/JSystem/J3DGraphBase/J3DSys.cpp +++ b/libs/JSystem/J3DGraphBase/J3DSys.cpp @@ -1,403 +1,402 @@ -// -// Generated By: dol2asm -// Translation Unit: J3DSys -// - -#include "JSystem/J3DGraphBase/J3DSys.h" - -#include "dol2asm.h" -#include "dolphin/gx/GXPixel.h" -#include "dolphin/os/OS.h" -#include "dolphin/types.h" -#include "global.h" - -#include "JSystem/J3DGraphBase/J3DTevs.h" - -#include "JSystem/J3DGraphBase/J3DTexture.h" -#include "JSystem/J3DGraphBase/J3DGD.h" - -// -// Forward References: -// - -extern void J3DFifoLoadTexCached(GXTexMapID, u32, GXTexCacheSize, u32, GXTexCacheSize); -extern void makeTexCoordTable(); -extern void makeAlphaCmpTable(); -extern void makeZModeTable(); -extern void makeTevSwapTable(); -extern "C" void GXInvalidateVtxCache(); - -extern "C" extern J3DDefaultTexCoordInfo const j3dDefaultTexCoordInfo[8]; -extern "C" extern const GXColor j3dDefaultColInfo; -extern "C" extern u8 data_804563C8; -extern "C" extern const GXColorS10 j3dDefaultTevColor; -extern "C" extern const GXColor j3dDefaultTevKColor; - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80434AC8-80434BE4 0617E8 011C+00 1/1 151/151 486/486 .bss j3dSys */ -J3DSys j3dSys; - -/* 80434BE4-80434C14 061904 0030+00 0/0 17/17 154/154 .bss mCurrentMtx__6J3DSys */ -Mtx J3DSys::mCurrentMtx; - -/* 80434C14-80434C20 061934 000C+00 0/0 6/6 0/0 .bss mCurrentS__6J3DSys */ -Vec J3DSys::mCurrentS; - -/* 80434C20-80434C2C 061940 000C+00 0/0 5/5 0/0 .bss mParentS__6J3DSys */ -Vec J3DSys::mParentS; - -/* 80434C2C-80434C70 06194C 0040+04 1/1 17/17 0/0 .bss sTexCoordScaleTable__6J3DSys */ -J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8]; - -/* 8030FDE8-8030FEC0 30A728 00D8+00 1/1 0/0 0/0 .text __ct__6J3DSysFv */ -J3DSys::J3DSys() { - makeTexCoordTable(); - makeTevSwapTable(); - makeAlphaCmpTable(); - makeZModeTable(); - - mFlags = 0; - MTXIdentity(mViewMtx); - mDrawMode = 1; - mMaterialMode = 0; - mModel = NULL; - mShape = NULL; - for (u32 i = 0; i < ARRAY_SIZE(mDrawBuffer); i++) - mDrawBuffer[i] = NULL; - mTexture = NULL; - mMatPacket = NULL; - mShapePacket = NULL; - mModelDrawMtx = NULL; - mModelNrmMtx = NULL; - mVtxPos = NULL; - mVtxNrm = NULL; - mVtxCol = NULL; - - for (u32 i = 0; i < 8; i++) { - sTexCoordScaleTable[i].field_0x00 = 1; - sTexCoordScaleTable[i].field_0x02 = 1; - sTexCoordScaleTable[i].field_0x04 = 0; - sTexCoordScaleTable[i].field_0x06 = 0; - } -} - -/* 8030FEC0-8030FEE4 30A800 0024+00 0/0 1/1 0/0 .text loadPosMtxIndx__6J3DSysCFiUs */ -void J3DSys::loadPosMtxIndx(int addr, u16 indx) const { - J3DFifoLoadIndx(GX_CMD_LOAD_INDX_A, indx, 0xB000 | ((u16)(addr * 0x0C))); -} - -/* 8030FEE4-8030FF0C 30A824 0028+00 0/0 1/1 0/0 .text loadNrmMtxIndx__6J3DSysCFiUs */ -void J3DSys::loadNrmMtxIndx(int addr, u16 indx) const { - J3DFifoLoadIndx(GX_CMD_LOAD_INDX_B, indx, 0x8000 | ((u16)((addr * 0x09) + 0x400))); -} - -/* 8030FF0C-803100BC 30A84C 01B0+00 1/1 0/0 0/0 .text setTexCacheRegion__6J3DSysF15_GXTexCacheSize - */ -void J3DSys::setTexCacheRegion(GXTexCacheSize size) { - const u32 kSize[] = { - 0x00008000, - 0x00020000, - 0x00080000, - 0x00000000, - }; - const u32 kRegionNum[] = {8, 4, 1, 0}; - - u32 regionNum = kRegionNum[size]; - mTexCacheRegionNum = regionNum; - - if (!!(mFlags & 0x80000000)) { - for (u32 i = 0; i < regionNum; i++) { - if (!!(i & 1)) { - GXInitTexCacheRegion(&mTexCacheRegion[i], GX_FALSE, i * kSize[size] + 0x80000, size, - i * kSize[size], size); - J3DFifoLoadTexCached((GXTexMapID)i, i * kSize[size] + 0x80000, size, - i * kSize[size], size); - } else { - GXInitTexCacheRegion(&mTexCacheRegion[i], GX_FALSE, i * kSize[size], size, - i * kSize[size] + 0x80000, size); - J3DFifoLoadTexCached((GXTexMapID)i, i * kSize[size], size, - i * kSize[size] + 0x80000, size); - } - } - } else { - for (u32 i = 0; i < regionNum; i++) { - GXInitTexCacheRegion(&mTexCacheRegion[i], GX_FALSE, i * kSize[size], size, - i * kSize[size] + 0x80000, size); - J3DFifoLoadTexCached((GXTexMapID)i, i * kSize[size], size, i * kSize[size] + 0x80000, - size); - } - } -} - -/* 803CD8A0-803CD8B0 02A9C0 0010+00 1/1 0/0 0/0 .data NullTexData */ -SECTION_DATA static u8 NullTexData[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 803CD8B0-803CD8E0 02A9D0 0030+00 1/1 0/0 0/0 .data j3dIdentityMtx */ -SECTION_DATA static Mtx j3dIdentityMtx = { - 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, -}; - -/* 803100BC-8031073C 30A9FC 0680+00 0/0 3/3 0/0 .text drawInit__6J3DSysFv */ -void J3DSys::drawInit() { - GXInvalidateVtxCache(); - GXSetCurrentMtx(GX_PNMTX0); - GXSetCullMode(GX_CULL_BACK); - GXSetCoPlanar(GX_FALSE); - GXSetClipMode(GX_CLIP_ENABLE); - GXSetColorUpdate(GX_TRUE); - GXSetDither(GX_TRUE); - GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_NOOP); - GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0); - GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); - GXSetZCompLoc(GX_TRUE); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR1, GX_CLR_RGBA, GX_RGBA8, 0); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 7); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX1, GX_CLR_RGBA, GX_RGBA4, 7); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX2, GX_CLR_RGBA, GX_RGBA4, 7); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX3, GX_CLR_RGBA, GX_RGBA4, 7); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX4, GX_CLR_RGBA, GX_RGBA4, 7); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX5, GX_CLR_RGBA, GX_RGBA4, 7); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX6, GX_CLR_RGBA, GX_RGBA4, 7); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX7, GX_CLR_RGBA, GX_RGBA4, 7); - - GXSetNumIndStages(0); - reinitTexture(); - - GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE4, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE5, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE6, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE7, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE8, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE9, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE10, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE11, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE12, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE13, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE14, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE15, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - - for (u32 i = 0; i < 10; i++) - GXLoadTexMtxImm(j3dIdentityMtx, GX_TEXMTX0 + i * 3, GX_MTX3x4); - - Mtx23 indTexMtx = { - {0.5f, 0.0f, 0.0f}, - {0.0f, 0.5f, 0.0f}, - }; - - u8 i; - for (i = 0; i < 3; i++) - GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + i), (f32*)indTexMtx, 1); - - GXSetChanMatColor(GX_COLOR0A0, j3dDefaultColInfo); - GXSetChanMatColor(GX_COLOR1A1, j3dDefaultColInfo); - - GXSetNumChans(data_804563C8); - GXSetNumTexGens(1); - GXSetNumTevStages(1); - GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_CLAMP, GX_AF_NONE); - GXSetChanCtrl(GX_COLOR1A1, GX_FALSE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_CLAMP, GX_AF_NONE); - - for (i = 0; i < GX_MAX_TEXMAP; i++) - GXSetTexCoordGen2((GXTexCoordID)i, (GXTexGenType)j3dDefaultTexCoordInfo[i].mTexGenType, - (GXTexGenSrc)j3dDefaultTexCoordInfo[i].mTexGenSrc, - j3dDefaultTexCoordInfo[i].mTexGenMtx, GX_FALSE, GX_PTIDENTITY); - - for (i = 0; i < GX_MAX_INDTEXSTAGE; i++) - GXSetIndTexCoordScale((GXIndTexStageID)i, GX_ITS_1, GX_ITS_1); - - for (i = 0; i < GX_MAX_TEVREG; i++) - GXSetTevKColor((GXTevKColorID)i, j3dDefaultTevKColor); - - for (i = 0; i < GX_MAX_TEVREG; i++) - GXSetTevColorS10((GXTevRegID)i, j3dDefaultTevColor); - - for (i = 0; i < GX_MAX_TEVSTAGE; i++) { - GXSetTevColorIn((GXTevStageID)i, GX_CC_RASC, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO); - GXSetTevColorOp((GXTevStageID)i, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, - GX_TEVPREV); - GXSetTevAlphaIn((GXTevStageID)i, GX_CA_RASA, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); - GXSetTevAlphaOp((GXTevStageID)i, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, - GX_TEVPREV); - } - - for (i = 0; i < GX_MAX_TEVSTAGE; i++) - GXSetTevSwapMode((GXTevStageID)i, GX_TEV_SWAP0, GX_TEV_SWAP0); - - GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA); - GXSetTevSwapModeTable(GX_TEV_SWAP1, GX_CH_RED, GX_CH_RED, GX_CH_RED, GX_CH_ALPHA); - GXSetTevSwapModeTable(GX_TEV_SWAP2, GX_CH_GREEN, GX_CH_GREEN, GX_CH_GREEN, GX_CH_ALPHA); - GXSetTevSwapModeTable(GX_TEV_SWAP3, GX_CH_BLUE, GX_CH_BLUE, GX_CH_BLUE, GX_CH_ALPHA); - - for (i = 0; i < GX_MAX_TEVSTAGE; i++) - GXSetTevIndirect((GXTevStageID)i, GX_INDTEXSTAGE0, GX_ITF_8, GX_ITB_NONE, GX_ITM_OFF, - GX_ITW_OFF, GX_ITW_OFF, GX_FALSE, GX_FALSE, GX_ITBA_OFF); - - i_OSInitFastCast(); - setTexCacheRegion(GX_TEXCACHE_32K); -} - -/* 8031073C-8031079C 30B07C 0060+00 0/0 16/16 6/6 .text reinitGX__6J3DSysFv */ -void J3DSys::reinitGX() { - reinitGenMode(); - reinitLighting(); - reinitTransform(); - reinitTexture(); - reinitTevStages(); - reinitIndStages(); - reinitPixelProc(); - GXFlush(); -} - -/* 8031079C-803107E8 30B0DC 004C+00 1/1 0/0 0/0 .text reinitGenMode__6J3DSysFv */ -void J3DSys::reinitGenMode() { - GXSetNumChans(0); - GXSetNumTexGens(1); - GXSetNumTevStages(1); - GXSetNumIndStages(0); - GXSetCullMode(GX_CULL_BACK); - GXSetCoPlanar(GX_FALSE); -} - -/* ############################################################################################## */ -/* 80450950-80450954 0003D0 0004+00 2/2 0/0 0/0 .sdata ColorBlack */ -SECTION_SDATA static GXColor ColorBlack = {0x00, 0x00, 0x00, 0x00}; - -/* 80450954-80450958 0003D4 0004+00 2/2 0/0 0/0 .sdata ColorWhite */ -SECTION_SDATA static GXColor ColorWhite = {0xFF, 0xFF, 0xFF, 0xFF}; - -/* 803107E8-80310894 30B128 00AC+00 1/1 0/0 0/0 .text reinitLighting__6J3DSysFv */ -void J3DSys::reinitLighting() { - GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, - GX_AF_NONE); - GXSetChanCtrl(GX_COLOR1A1, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, - GX_AF_NONE); - GXSetChanAmbColor(GX_COLOR0A0, ColorBlack); - GXSetChanAmbColor(GX_COLOR1A1, ColorBlack); - GXSetChanMatColor(GX_COLOR0A0, ColorWhite); - GXSetChanMatColor(GX_COLOR1A1, ColorWhite); -} - -/* 80310894-80310998 30B1D4 0104+00 1/1 0/0 0/0 .text reinitTransform__6J3DSysFv */ -void J3DSys::reinitTransform() { - GXSetCurrentMtx(GX_PNMTX0); - GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); - GXSetTexCoordGen2(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX1, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); - GXSetTexCoordGen2(GX_TEXCOORD2, GX_TG_MTX2x4, GX_TG_TEX2, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); - GXSetTexCoordGen2(GX_TEXCOORD3, GX_TG_MTX2x4, GX_TG_TEX3, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); - GXSetTexCoordGen2(GX_TEXCOORD4, GX_TG_MTX2x4, GX_TG_TEX4, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); - GXSetTexCoordGen2(GX_TEXCOORD5, GX_TG_MTX2x4, GX_TG_TEX5, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); - GXSetTexCoordGen2(GX_TEXCOORD6, GX_TG_MTX2x4, GX_TG_TEX6, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); - GXSetTexCoordGen2(GX_TEXCOORD7, GX_TG_MTX2x4, GX_TG_TEX7, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); -} - -/* 80310998-80310A3C 30B2D8 00A4+00 2/2 0/0 0/0 .text reinitTexture__6J3DSysFv */ -void J3DSys::reinitTexture() { - GXTexObj texObj; - GXInitTexObj(&texObj, NullTexData, 4, 4, GX_TF_IA8, GX_CLAMP, GX_CLAMP, GX_FALSE); - GXLoadTexObj(&texObj, GX_TEXMAP0); - GXLoadTexObj(&texObj, GX_TEXMAP1); - GXLoadTexObj(&texObj, GX_TEXMAP2); - GXLoadTexObj(&texObj, GX_TEXMAP3); - GXLoadTexObj(&texObj, GX_TEXMAP4); - GXLoadTexObj(&texObj, GX_TEXMAP5); - GXLoadTexObj(&texObj, GX_TEXMAP6); - GXLoadTexObj(&texObj, GX_TEXMAP7); -} - -/* 80310A3C-80310D44 30B37C 0308+00 1/1 0/0 0/0 .text reinitTevStages__6J3DSysFv */ -void J3DSys::reinitTevStages() { - GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE4, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE5, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE6, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE7, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE8, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE9, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE10, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE11, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE12, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE13, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE14, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - GXSetTevOrder(GX_TEVSTAGE15, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); - - GXSetTevColor(GX_TEVREG0, ColorWhite); - GXSetTevColor(GX_TEVREG1, ColorWhite); - GXSetTevColor(GX_TEVREG2, ColorWhite); - GXSetTevKColor(GX_KCOLOR0, ColorWhite); - GXSetTevKColor(GX_KCOLOR1, ColorWhite); - GXSetTevKColor(GX_KCOLOR2, ColorWhite); - GXSetTevKColor(GX_KCOLOR3, ColorWhite); - - for (u32 i = 0; i < GX_MAX_TEVSTAGE; i++) { - GXSetTevColorIn((GXTevStageID)i, GX_CC_RASC, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO); - GXSetTevColorOp((GXTevStageID)i, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, - GX_TEVPREV); - GXSetTevAlphaIn((GXTevStageID)i, GX_CA_RASA, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); - GXSetTevAlphaOp((GXTevStageID)i, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, - GX_TEVPREV); - GXSetTevKColorSel((GXTevStageID)i, GX_TEV_KCSEL_1_4); - GXSetTevKAlphaSel((GXTevStageID)i, GX_TEV_KASEL_1); - GXSetTevSwapMode((GXTevStageID)i, GX_TEV_SWAP0, GX_TEV_SWAP0); - } - - GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA); - GXSetTevSwapModeTable(GX_TEV_SWAP1, GX_CH_RED, GX_CH_RED, GX_CH_RED, GX_CH_ALPHA); - GXSetTevSwapModeTable(GX_TEV_SWAP2, GX_CH_GREEN, GX_CH_GREEN, GX_CH_GREEN, GX_CH_ALPHA); - GXSetTevSwapModeTable(GX_TEV_SWAP3, GX_CH_BLUE, GX_CH_BLUE, GX_CH_BLUE, GX_CH_ALPHA); - GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0); -} - -/* ############################################################################################## */ -/* 803CD8E0-803CD8F8 02AA00 0018+00 1/1 0/0 0/0 .data IndMtx */ -SECTION_DATA static Mtx23 IndMtx = {0.5f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f}; - -/* 80310D44-80310E3C 30B684 00F8+00 1/1 0/0 0/0 .text reinitIndStages__6J3DSysFv */ -void J3DSys::reinitIndStages() { - for (u32 i = 0; i < GX_MAX_TEVSTAGE; i++) { - GXSetTevDirect((GXTevStageID)i); - } - - GXSetIndTexOrder(GX_INDTEXSTAGE0, GX_TEXCOORD0, GX_TEXMAP0); - GXSetIndTexOrder(GX_INDTEXSTAGE1, GX_TEXCOORD1, GX_TEXMAP1); - GXSetIndTexOrder(GX_INDTEXSTAGE2, GX_TEXCOORD2, GX_TEXMAP2); - GXSetIndTexOrder(GX_INDTEXSTAGE3, GX_TEXCOORD3, GX_TEXMAP3); - GXSetIndTexCoordScale(GX_INDTEXSTAGE0, GX_ITS_1, GX_ITS_1); - GXSetIndTexCoordScale(GX_INDTEXSTAGE1, GX_ITS_1, GX_ITS_1); - GXSetIndTexCoordScale(GX_INDTEXSTAGE2, GX_ITS_1, GX_ITS_1); - GXSetIndTexCoordScale(GX_INDTEXSTAGE3, GX_ITS_1, GX_ITS_1); - GXSetIndTexMtx(GX_ITM_0, (f32*)IndMtx, 1); - GXSetIndTexMtx(GX_ITM_1, (f32*)IndMtx, 1); - GXSetIndTexMtx(GX_ITM_2, (f32*)IndMtx, 1); -} - -/* 80310E3C-80310ED0 30B77C 0094+00 1/1 0/0 0/0 .text reinitPixelProc__6J3DSysFv */ -void J3DSys::reinitPixelProc() { - GXSetBlendMode(GX_BM_NONE, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_CLEAR); - GXSetColorUpdate(GX_TRUE); - GXSetAlphaUpdate(GX_FALSE); - GXSetDither(GX_TRUE); - GXSetFog(GX_FOG_NONE, 0.0f, 1.0f, 0.1f, 1.0f, ColorBlack); - GXSetFogRangeAdj(GX_FALSE, 0, NULL); - GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); - GXSetZCompLoc(GX_TRUE); -} - -/* ############################################################################################## */ -/* 80451598-804515A0 000A98 0004+04 0/0 1/1 0/0 .sbss j3dDefaultViewNo */ -u32 j3dDefaultViewNo; +// +// Generated By: dol2asm +// Translation Unit: J3DSys +// + +#include "JSystem/J3DGraphBase/J3DSys.h" + +#include "dol2asm.h" +#include "dolphin/gx/GXPixel.h" +#include "dolphin/os/OS.h" +#include "dolphin/types.h" +#include "global.h" + +#include "JSystem/J3DGraphBase/J3DTevs.h" + +#include "JSystem/J3DGraphBase/J3DTexture.h" +#include "JSystem/J3DGraphBase/J3DGD.h" + +// +// Forward References: +// + +extern void J3DFifoLoadTexCached(GXTexMapID, u32, GXTexCacheSize, u32, GXTexCacheSize); +extern void makeTexCoordTable(); +extern void makeAlphaCmpTable(); +extern void makeZModeTable(); +extern void makeTevSwapTable(); +extern "C" void GXInvalidateVtxCache(); + +extern "C" extern const GXColor j3dDefaultColInfo; +extern "C" extern u8 data_804563C8; +extern "C" extern const GXColorS10 j3dDefaultTevColor; +extern "C" extern const GXColor j3dDefaultTevKColor; + +// +// Declarations: +// + +/* ############################################################################################## */ +/* 80434AC8-80434BE4 0617E8 011C+00 1/1 151/151 486/486 .bss j3dSys */ +J3DSys j3dSys; + +/* 80434BE4-80434C14 061904 0030+00 0/0 17/17 154/154 .bss mCurrentMtx__6J3DSys */ +Mtx J3DSys::mCurrentMtx; + +/* 80434C14-80434C20 061934 000C+00 0/0 6/6 0/0 .bss mCurrentS__6J3DSys */ +Vec J3DSys::mCurrentS; + +/* 80434C20-80434C2C 061940 000C+00 0/0 5/5 0/0 .bss mParentS__6J3DSys */ +Vec J3DSys::mParentS; + +/* 80434C2C-80434C70 06194C 0040+04 1/1 17/17 0/0 .bss sTexCoordScaleTable__6J3DSys */ +J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8]; + +/* 8030FDE8-8030FEC0 30A728 00D8+00 1/1 0/0 0/0 .text __ct__6J3DSysFv */ +J3DSys::J3DSys() { + makeTexCoordTable(); + makeTevSwapTable(); + makeAlphaCmpTable(); + makeZModeTable(); + + mFlags = 0; + MTXIdentity(mViewMtx); + mDrawMode = 1; + mMaterialMode = 0; + mModel = NULL; + mShape = NULL; + for (u32 i = 0; i < ARRAY_SIZE(mDrawBuffer); i++) + mDrawBuffer[i] = NULL; + mTexture = NULL; + mMatPacket = NULL; + mShapePacket = NULL; + mModelDrawMtx = NULL; + mModelNrmMtx = NULL; + mVtxPos = NULL; + mVtxNrm = NULL; + mVtxCol = NULL; + + for (u32 i = 0; i < 8; i++) { + sTexCoordScaleTable[i].field_0x00 = 1; + sTexCoordScaleTable[i].field_0x02 = 1; + sTexCoordScaleTable[i].field_0x04 = 0; + sTexCoordScaleTable[i].field_0x06 = 0; + } +} + +/* 8030FEC0-8030FEE4 30A800 0024+00 0/0 1/1 0/0 .text loadPosMtxIndx__6J3DSysCFiUs */ +void J3DSys::loadPosMtxIndx(int addr, u16 indx) const { + J3DFifoLoadIndx(GX_CMD_LOAD_INDX_A, indx, 0xB000 | ((u16)(addr * 0x0C))); +} + +/* 8030FEE4-8030FF0C 30A824 0028+00 0/0 1/1 0/0 .text loadNrmMtxIndx__6J3DSysCFiUs */ +void J3DSys::loadNrmMtxIndx(int addr, u16 indx) const { + J3DFifoLoadIndx(GX_CMD_LOAD_INDX_B, indx, 0x8000 | ((u16)((addr * 0x09) + 0x400))); +} + +/* 8030FF0C-803100BC 30A84C 01B0+00 1/1 0/0 0/0 .text setTexCacheRegion__6J3DSysF15_GXTexCacheSize + */ +void J3DSys::setTexCacheRegion(GXTexCacheSize size) { + const u32 kSize[] = { + 0x00008000, + 0x00020000, + 0x00080000, + 0x00000000, + }; + const u32 kRegionNum[] = {8, 4, 1, 0}; + + u32 regionNum = kRegionNum[size]; + mTexCacheRegionNum = regionNum; + + if (!!(mFlags & 0x80000000)) { + for (u32 i = 0; i < regionNum; i++) { + if (!!(i & 1)) { + GXInitTexCacheRegion(&mTexCacheRegion[i], GX_FALSE, i * kSize[size] + 0x80000, size, + i * kSize[size], size); + J3DFifoLoadTexCached((GXTexMapID)i, i * kSize[size] + 0x80000, size, + i * kSize[size], size); + } else { + GXInitTexCacheRegion(&mTexCacheRegion[i], GX_FALSE, i * kSize[size], size, + i * kSize[size] + 0x80000, size); + J3DFifoLoadTexCached((GXTexMapID)i, i * kSize[size], size, + i * kSize[size] + 0x80000, size); + } + } + } else { + for (u32 i = 0; i < regionNum; i++) { + GXInitTexCacheRegion(&mTexCacheRegion[i], GX_FALSE, i * kSize[size], size, + i * kSize[size] + 0x80000, size); + J3DFifoLoadTexCached((GXTexMapID)i, i * kSize[size], size, i * kSize[size] + 0x80000, + size); + } + } +} + +/* 803CD8A0-803CD8B0 02A9C0 0010+00 1/1 0/0 0/0 .data NullTexData */ +SECTION_DATA static u8 NullTexData[16] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +/* 803CD8B0-803CD8E0 02A9D0 0030+00 1/1 0/0 0/0 .data j3dIdentityMtx */ +SECTION_DATA static Mtx j3dIdentityMtx = { + 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, +}; + +/* 803100BC-8031073C 30A9FC 0680+00 0/0 3/3 0/0 .text drawInit__6J3DSysFv */ +void J3DSys::drawInit() { + GXInvalidateVtxCache(); + GXSetCurrentMtx(GX_PNMTX0); + GXSetCullMode(GX_CULL_BACK); + GXSetCoPlanar(GX_FALSE); + GXSetClipMode(GX_CLIP_ENABLE); + GXSetColorUpdate(GX_TRUE); + GXSetDither(GX_TRUE); + GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_NOOP); + GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0); + GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); + GXSetZCompLoc(GX_TRUE); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR1, GX_CLR_RGBA, GX_RGBA8, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 7); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX1, GX_CLR_RGBA, GX_RGBA4, 7); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX2, GX_CLR_RGBA, GX_RGBA4, 7); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX3, GX_CLR_RGBA, GX_RGBA4, 7); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX4, GX_CLR_RGBA, GX_RGBA4, 7); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX5, GX_CLR_RGBA, GX_RGBA4, 7); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX6, GX_CLR_RGBA, GX_RGBA4, 7); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX7, GX_CLR_RGBA, GX_RGBA4, 7); + + GXSetNumIndStages(0); + reinitTexture(); + + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE4, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE5, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE6, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE7, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE8, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE9, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE10, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE11, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE12, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE13, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE14, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE15, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + + for (u32 i = 0; i < 10; i++) + GXLoadTexMtxImm(j3dIdentityMtx, GX_TEXMTX0 + i * 3, GX_MTX3x4); + + Mtx23 indTexMtx = { + {0.5f, 0.0f, 0.0f}, + {0.0f, 0.5f, 0.0f}, + }; + + u8 i; + for (i = 0; i < 3; i++) + GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + i), (f32*)indTexMtx, 1); + + GXSetChanMatColor(GX_COLOR0A0, j3dDefaultColInfo); + GXSetChanMatColor(GX_COLOR1A1, j3dDefaultColInfo); + + GXSetNumChans(data_804563C8); + GXSetNumTexGens(1); + GXSetNumTevStages(1); + GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_CLAMP, GX_AF_NONE); + GXSetChanCtrl(GX_COLOR1A1, GX_FALSE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_CLAMP, GX_AF_NONE); + + for (i = 0; i < GX_MAX_TEXMAP; i++) + GXSetTexCoordGen2((GXTexCoordID)i, (GXTexGenType)j3dDefaultTexCoordInfo[i].mTexGenType, + (GXTexGenSrc)j3dDefaultTexCoordInfo[i].mTexGenSrc, + j3dDefaultTexCoordInfo[i].mTexGenMtx, GX_FALSE, GX_PTIDENTITY); + + for (i = 0; i < GX_MAX_INDTEXSTAGE; i++) + GXSetIndTexCoordScale((GXIndTexStageID)i, GX_ITS_1, GX_ITS_1); + + for (i = 0; i < GX_MAX_TEVREG; i++) + GXSetTevKColor((GXTevKColorID)i, j3dDefaultTevKColor); + + for (i = 0; i < GX_MAX_TEVREG; i++) + GXSetTevColorS10((GXTevRegID)i, j3dDefaultTevColor); + + for (i = 0; i < GX_MAX_TEVSTAGE; i++) { + GXSetTevColorIn((GXTevStageID)i, GX_CC_RASC, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO); + GXSetTevColorOp((GXTevStageID)i, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, + GX_TEVPREV); + GXSetTevAlphaIn((GXTevStageID)i, GX_CA_RASA, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); + GXSetTevAlphaOp((GXTevStageID)i, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, + GX_TEVPREV); + } + + for (i = 0; i < GX_MAX_TEVSTAGE; i++) + GXSetTevSwapMode((GXTevStageID)i, GX_TEV_SWAP0, GX_TEV_SWAP0); + + GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA); + GXSetTevSwapModeTable(GX_TEV_SWAP1, GX_CH_RED, GX_CH_RED, GX_CH_RED, GX_CH_ALPHA); + GXSetTevSwapModeTable(GX_TEV_SWAP2, GX_CH_GREEN, GX_CH_GREEN, GX_CH_GREEN, GX_CH_ALPHA); + GXSetTevSwapModeTable(GX_TEV_SWAP3, GX_CH_BLUE, GX_CH_BLUE, GX_CH_BLUE, GX_CH_ALPHA); + + for (i = 0; i < GX_MAX_TEVSTAGE; i++) + GXSetTevIndirect((GXTevStageID)i, GX_INDTEXSTAGE0, GX_ITF_8, GX_ITB_NONE, GX_ITM_OFF, + GX_ITW_OFF, GX_ITW_OFF, GX_FALSE, GX_FALSE, GX_ITBA_OFF); + + i_OSInitFastCast(); + setTexCacheRegion(GX_TEXCACHE_32K); +} + +/* 8031073C-8031079C 30B07C 0060+00 0/0 16/16 6/6 .text reinitGX__6J3DSysFv */ +void J3DSys::reinitGX() { + reinitGenMode(); + reinitLighting(); + reinitTransform(); + reinitTexture(); + reinitTevStages(); + reinitIndStages(); + reinitPixelProc(); + GXFlush(); +} + +/* 8031079C-803107E8 30B0DC 004C+00 1/1 0/0 0/0 .text reinitGenMode__6J3DSysFv */ +void J3DSys::reinitGenMode() { + GXSetNumChans(0); + GXSetNumTexGens(1); + GXSetNumTevStages(1); + GXSetNumIndStages(0); + GXSetCullMode(GX_CULL_BACK); + GXSetCoPlanar(GX_FALSE); +} + +/* ############################################################################################## */ +/* 80450950-80450954 0003D0 0004+00 2/2 0/0 0/0 .sdata ColorBlack */ +SECTION_SDATA static GXColor ColorBlack = {0x00, 0x00, 0x00, 0x00}; + +/* 80450954-80450958 0003D4 0004+00 2/2 0/0 0/0 .sdata ColorWhite */ +SECTION_SDATA static GXColor ColorWhite = {0xFF, 0xFF, 0xFF, 0xFF}; + +/* 803107E8-80310894 30B128 00AC+00 1/1 0/0 0/0 .text reinitLighting__6J3DSysFv */ +void J3DSys::reinitLighting() { + GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, + GX_AF_NONE); + GXSetChanCtrl(GX_COLOR1A1, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, + GX_AF_NONE); + GXSetChanAmbColor(GX_COLOR0A0, ColorBlack); + GXSetChanAmbColor(GX_COLOR1A1, ColorBlack); + GXSetChanMatColor(GX_COLOR0A0, ColorWhite); + GXSetChanMatColor(GX_COLOR1A1, ColorWhite); +} + +/* 80310894-80310998 30B1D4 0104+00 1/1 0/0 0/0 .text reinitTransform__6J3DSysFv */ +void J3DSys::reinitTransform() { + GXSetCurrentMtx(GX_PNMTX0); + GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXSetTexCoordGen2(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX1, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXSetTexCoordGen2(GX_TEXCOORD2, GX_TG_MTX2x4, GX_TG_TEX2, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXSetTexCoordGen2(GX_TEXCOORD3, GX_TG_MTX2x4, GX_TG_TEX3, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXSetTexCoordGen2(GX_TEXCOORD4, GX_TG_MTX2x4, GX_TG_TEX4, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXSetTexCoordGen2(GX_TEXCOORD5, GX_TG_MTX2x4, GX_TG_TEX5, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXSetTexCoordGen2(GX_TEXCOORD6, GX_TG_MTX2x4, GX_TG_TEX6, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXSetTexCoordGen2(GX_TEXCOORD7, GX_TG_MTX2x4, GX_TG_TEX7, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); +} + +/* 80310998-80310A3C 30B2D8 00A4+00 2/2 0/0 0/0 .text reinitTexture__6J3DSysFv */ +void J3DSys::reinitTexture() { + GXTexObj texObj; + GXInitTexObj(&texObj, NullTexData, 4, 4, GX_TF_IA8, GX_CLAMP, GX_CLAMP, GX_FALSE); + GXLoadTexObj(&texObj, GX_TEXMAP0); + GXLoadTexObj(&texObj, GX_TEXMAP1); + GXLoadTexObj(&texObj, GX_TEXMAP2); + GXLoadTexObj(&texObj, GX_TEXMAP3); + GXLoadTexObj(&texObj, GX_TEXMAP4); + GXLoadTexObj(&texObj, GX_TEXMAP5); + GXLoadTexObj(&texObj, GX_TEXMAP6); + GXLoadTexObj(&texObj, GX_TEXMAP7); +} + +/* 80310A3C-80310D44 30B37C 0308+00 1/1 0/0 0/0 .text reinitTevStages__6J3DSysFv */ +void J3DSys::reinitTevStages() { + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE4, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE5, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE6, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE7, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE8, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE9, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE10, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE11, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE12, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE13, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE14, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevOrder(GX_TEVSTAGE15, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + + GXSetTevColor(GX_TEVREG0, ColorWhite); + GXSetTevColor(GX_TEVREG1, ColorWhite); + GXSetTevColor(GX_TEVREG2, ColorWhite); + GXSetTevKColor(GX_KCOLOR0, ColorWhite); + GXSetTevKColor(GX_KCOLOR1, ColorWhite); + GXSetTevKColor(GX_KCOLOR2, ColorWhite); + GXSetTevKColor(GX_KCOLOR3, ColorWhite); + + for (u32 i = 0; i < GX_MAX_TEVSTAGE; i++) { + GXSetTevColorIn((GXTevStageID)i, GX_CC_RASC, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO); + GXSetTevColorOp((GXTevStageID)i, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, + GX_TEVPREV); + GXSetTevAlphaIn((GXTevStageID)i, GX_CA_RASA, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); + GXSetTevAlphaOp((GXTevStageID)i, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, + GX_TEVPREV); + GXSetTevKColorSel((GXTevStageID)i, GX_TEV_KCSEL_1_4); + GXSetTevKAlphaSel((GXTevStageID)i, GX_TEV_KASEL_1); + GXSetTevSwapMode((GXTevStageID)i, GX_TEV_SWAP0, GX_TEV_SWAP0); + } + + GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA); + GXSetTevSwapModeTable(GX_TEV_SWAP1, GX_CH_RED, GX_CH_RED, GX_CH_RED, GX_CH_ALPHA); + GXSetTevSwapModeTable(GX_TEV_SWAP2, GX_CH_GREEN, GX_CH_GREEN, GX_CH_GREEN, GX_CH_ALPHA); + GXSetTevSwapModeTable(GX_TEV_SWAP3, GX_CH_BLUE, GX_CH_BLUE, GX_CH_BLUE, GX_CH_ALPHA); + GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0); +} + +/* ############################################################################################## */ +/* 803CD8E0-803CD8F8 02AA00 0018+00 1/1 0/0 0/0 .data IndMtx */ +SECTION_DATA static Mtx23 IndMtx = {0.5f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f}; + +/* 80310D44-80310E3C 30B684 00F8+00 1/1 0/0 0/0 .text reinitIndStages__6J3DSysFv */ +void J3DSys::reinitIndStages() { + for (u32 i = 0; i < GX_MAX_TEVSTAGE; i++) { + GXSetTevDirect((GXTevStageID)i); + } + + GXSetIndTexOrder(GX_INDTEXSTAGE0, GX_TEXCOORD0, GX_TEXMAP0); + GXSetIndTexOrder(GX_INDTEXSTAGE1, GX_TEXCOORD1, GX_TEXMAP1); + GXSetIndTexOrder(GX_INDTEXSTAGE2, GX_TEXCOORD2, GX_TEXMAP2); + GXSetIndTexOrder(GX_INDTEXSTAGE3, GX_TEXCOORD3, GX_TEXMAP3); + GXSetIndTexCoordScale(GX_INDTEXSTAGE0, GX_ITS_1, GX_ITS_1); + GXSetIndTexCoordScale(GX_INDTEXSTAGE1, GX_ITS_1, GX_ITS_1); + GXSetIndTexCoordScale(GX_INDTEXSTAGE2, GX_ITS_1, GX_ITS_1); + GXSetIndTexCoordScale(GX_INDTEXSTAGE3, GX_ITS_1, GX_ITS_1); + GXSetIndTexMtx(GX_ITM_0, (f32*)IndMtx, 1); + GXSetIndTexMtx(GX_ITM_1, (f32*)IndMtx, 1); + GXSetIndTexMtx(GX_ITM_2, (f32*)IndMtx, 1); +} + +/* 80310E3C-80310ED0 30B77C 0094+00 1/1 0/0 0/0 .text reinitPixelProc__6J3DSysFv */ +void J3DSys::reinitPixelProc() { + GXSetBlendMode(GX_BM_NONE, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_CLEAR); + GXSetColorUpdate(GX_TRUE); + GXSetAlphaUpdate(GX_FALSE); + GXSetDither(GX_TRUE); + GXSetFog(GX_FOG_NONE, 0.0f, 1.0f, 0.1f, 1.0f, ColorBlack); + GXSetFogRangeAdj(GX_FALSE, 0, NULL); + GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); + GXSetZCompLoc(GX_TRUE); +} + +/* ############################################################################################## */ +/* 80451598-804515A0 000A98 0004+04 0/0 1/1 0/0 .sbss j3dDefaultViewNo */ +u32 j3dDefaultViewNo; diff --git a/libs/JSystem/J3DGraphBase/J3DTevs.cpp b/libs/JSystem/J3DGraphBase/J3DTevs.cpp index 879bbac1fd1..e8196589b0d 100644 --- a/libs/JSystem/J3DGraphBase/J3DTevs.cpp +++ b/libs/JSystem/J3DGraphBase/J3DTevs.cpp @@ -1,691 +1,687 @@ -// -// Generated By: dol2asm -// Translation Unit: J3DTevs -// - -#include "JSystem/J3DGraphBase/J3DTevs.h" -#include "JSystem/J3DGraphBase/J3DGD.h" -#include "JSystem/J3DGraphBase/J3DMatBlock.h" -#include "JSystem/J3DGraphBase/J3DSys.h" -#include "JSystem/J3DGraphBase/J3DTexture.h" -#include "JSystem/J3DGraphBase/J3DTransform.h" -#include "dol2asm.h" - -// -// Types: -// - -// -// Forward References: -// - -extern "C" void load__11J3DLightObjCFUl(); -extern "C" void loadTexCoordGens__FUlP11J3DTexCoord(); -extern "C" void load__9J3DTexMtxCFUl(); -extern "C" void calc__9J3DTexMtxFPA4_Cf(); -extern "C" void calcTexMtx__9J3DTexMtxFPA4_Cf(); -extern "C" void calcPostTexMtx__9J3DTexMtxFPA4_Cf(); -extern "C" void isTexNoReg__FPv(); -extern "C" void getTexNoReg__FPv(); -extern "C" void loadTexNo__FUlRCUs(); -extern "C" void patchTexNo_PtrToIdx__FUlRCUs(); -extern "C" void loadNBTScale__FR11J3DNBTScale(); -extern "C" void makeTexCoordTable__Fv(); -extern "C" void makeAlphaCmpTable__Fv(); -extern "C" void makeZModeTable__Fv(); -extern "C" void makeTevSwapTable__Fv(); -extern "C" void loadTexMtx__9J3DTexMtxCFUl(); -extern "C" void loadPostTexMtx__9J3DTexMtxCFUl(); -extern "C" static void J3DGDLoadTexMtxImm__FPA4_fUl13_GXTexMtxType(); -extern "C" static void J3DGDLoadPostTexMtxImm__FPA4_fUl(); -extern "C" extern GXColor j3dDefaultColInfo; -extern "C" extern u32 j3dDefaultAmbInfo; -extern "C" extern u8 data_804563C8; -extern "C" extern u32 j3dDefaultTevOrderInfoNull; -extern "C" extern u32 j3dDefaultIndTexOrderNull; -extern "C" extern GXColorS10 j3dDefaultTevColor; -extern "C" extern u8 j3dDefaultIndTexCoordScaleInfo[4]; -extern "C" extern GXColor j3dDefaultTevKColor; -extern "C" extern u8 j3dDefaultTevSwapMode[4]; -extern "C" extern u32 j3dDefaultTevSwapModeTable; -extern "C" extern u8 j3dDefaultColorChanInfo[8]; -extern "C" extern u16 data_804563F8; - -// -// External References: -// - -extern void J3DGDSetTexImgPtrRaw(_GXTexMapID param_0, u32 param_1); - -extern "C" void J3DGDSetLightAttn__F10_GXLightIDffffff(); -extern "C" void J3DGDSetLightColor__F10_GXLightID8_GXColor(); -extern "C" void J3DGDSetLightPos__F10_GXLightIDfff(); -extern "C" void J3DGDSetLightDir__F10_GXLightIDfff(); -extern "C" void J3DGDSetTexCoordGen__F13_GXTexGenType12_GXTexGenSrc(); -extern "C" void -J3DGDSetTexLookupMode__F11_GXTexMapID14_GXTexWrapMode14_GXTexWrapMode12_GXTexFilter12_GXTexFilterfffUcUc13_GXAnisotropy(); -extern "C" void J3DGDSetTexImgAttr__F11_GXTexMapIDUsUs9_GXTexFmt(); -extern "C" void J3DGDSetTexImgPtr__F11_GXTexMapIDPv(); -extern "C" void J3DGDSetTexTlut__F11_GXTexMapIDUl10_GXTlutFmt(); -extern "C" void J3DGDLoadTlut__FPvUl11_GXTlutSize(); -extern "C" void J3DGetTextureMtx__FRC17J3DTextureSRTInfoRC3VecPA4_f(); -extern "C" void J3DGetTextureMtxOld__FRC17J3DTextureSRTInfoRC3VecPA4_f(); -extern "C" void J3DGetTextureMtxMaya__FRC17J3DTextureSRTInfoPA4_f(); -extern "C" void J3DGetTextureMtxMayaOld__FRC17J3DTextureSRTInfoPA4_f(); -extern "C" void J3DMtxProjConcat__FPA4_fPA4_fPA4_f(); -extern "C" void GDOverflowed(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_28(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_28(); -extern "C" u8 sTexCoordScaleTable__6J3DSys[64 + 4 /* padding */]; - -// -// Declarations: -// - -/* 80323590-80323644 31DED0 00B4+00 0/0 3/3 0/0 .text load__11J3DLightObjCFUl */ -// missing instruction -#ifdef NONMATCHING -void J3DLightObj::load(u32 param_0) const { - GDOverflowCheck(0x48); - J3DGDSetLightPos(GXLightID(param_0 * 2), mInfo.mLightPosition.x, mInfo.mLightPosition.y, mInfo.mLightPosition.z); - J3DGDSetLightAttn(GXLightID(param_0 * 2), mInfo.mCosAtten.x, mInfo.mCosAtten.y, mInfo.mCosAtten.z, mInfo.mDistAtten.x, mInfo.mDistAtten.y, mInfo.mDistAtten.z); - J3DGDSetLightColor(GXLightID(param_0 * 2), mInfo.mColor); - J3DGDSetLightDir(GXLightID(param_0 * 2), mInfo.mLightDirection.x, mInfo.mLightDirection.y, mInfo.mLightDirection.z); -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DLightObj::load(u32 param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DTevs/load__11J3DLightObjCFUl.s" -} -#pragma pop -#endif - -/* 80323644-803238C4 31DF84 0280+00 0/0 3/3 0/0 .text loadTexCoordGens__FUlP11J3DTexCoord - */ -void loadTexCoordGens(u32 param_0, J3DTexCoord* param_1) { - GDOverflowCheck(param_0 * 8 + 10); - J3DGDWriteXFCmdHdr(0x1040, param_0); - for (int i = 0; i < param_0; i++) { - J3DGDSetTexCoordGen( - GXTexGenType(param_1[i].getTexGenType()), - GXTexGenSrc(param_1[i].getTexGenSrc()) - ); - } - J3DGDWriteXFCmdHdr(0x1050, param_0); - if (j3dSys.checkFlag(0x40000000)) { - for (int i = 0; i < param_0; i++) { - J3DGDWrite_u32(param_1[i].getTexGenMtx() == 60 ? 61 : i * 3); - } - } else { - for (int i = 0; i < param_0; i++) { - J3DGDWrite_u32(61); - } - } -} - -/* 803238C4-80323900 31E204 003C+00 0/0 6/6 0/0 .text load__9J3DTexMtxCFUl */ -void J3DTexMtx::load(u32 mtxIdx) const { - if (j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) { - loadPostTexMtx(mtxIdx); - } else { - loadTexMtx(mtxIdx); - } -} - -/* 80323900-80323920 31E240 0020+00 0/0 2/2 0/0 .text calc__9J3DTexMtxFPA4_Cf */ -void J3DTexMtx::calc(f32 const (*param_0)[4]) { - calcTexMtx(param_0); -} - -/* 80323920-80323C0C 31E260 02EC+00 2/1 0/0 0/0 .text calcTexMtx__9J3DTexMtxFPA4_Cf */ -void J3DTexMtx::calcTexMtx(const Mtx param_0) { - Mtx44 mtx1; - Mtx44 mtx2; - - static Mtx qMtx = { - 0.5f, 0.0f, 0.5f, 0.0f, - 0.0f, -0.5f, 0.5f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - }; - static Mtx qMtx2 = { - 0.5f, 0.0f, 0.0f, 0.5f, - 0.0f, -0.5f, 0.0f, 0.5f, - 0.0f, 0.0f, 1.0f, 0.0f, - }; - - u8 r28 = mTexMtxInfo.mInfo & 0x3f; - u32 r30 = (mTexMtxInfo.mInfo >> 7) & 1; - switch (r28) { - case 8: - case 9: - case 11: - if (r30 == 0) { - J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx2); - } - MTXConcat(mtx2, qMtx, mtx2); - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); - MTXConcat(mtx1, param_0, mMtx); - break; - case 7: - if (r30 == 0) { - J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); - } else if (r30 == 1) { - J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx1); - } - MTXConcat(mtx1, qMtx, mtx1); - MTXConcat(mtx1, param_0, mMtx); - break; - case 10: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); - } - MTXConcat(mtx2, qMtx2, mtx2); - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); - MTXConcat(mtx1, param_0, mMtx); - break; - case 6: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx1); - } - MTXConcat(mtx1, qMtx2, mtx1); - MTXConcat(mtx1, param_0, mMtx); - break; - case 1: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx1); - } - MTXConcat(mtx1, param_0, mMtx); - break; - case 2: - case 3: - case 5: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); - } - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); - MTXConcat(mtx1, param_0, mMtx); - break; - case 4: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); - } - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx); - break; - default: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mMtx); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mMtx); - } - break; - } -} - -/* 80323C0C-80323F64 31E54C 0358+00 1/0 2/2 0/0 .text calcPostTexMtx__9J3DTexMtxFPA4_Cf - */ -void J3DTexMtx::calcPostTexMtx(const Mtx param_0) { - Mtx44 mtx1; - Mtx44 mtx2; - - static Mtx qMtx = { - 0.5f, 0.0f, 0.5f, 0.0f, - 0.0f, -0.5f, 0.5f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - }; - static Mtx qMtx2 = { - 0.5f, 0.0f, 0.0f, 0.5f, - 0.0f, -0.5f, 0.0f, 0.5f, - 0.0f, 0.0f, 1.0f, 0.0f, - }; - - u8 r29 = mTexMtxInfo.mInfo & 0x3f; - u32 r30 = (mTexMtxInfo.mInfo >> 7) & 1; - switch (r29) { - case 8: - case 11: - if (r30 == 0) { - J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx2); - } - MTXConcat(mtx2, qMtx, mtx2); - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); - MTXConcat(mtx1, param_0, mMtx); - break; - case 9: - if (r30 == 0) { - J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx2); - } - MTXConcat(mtx2, qMtx, mtx2); - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx); - break; - case 7: - if (r30 == 0) { - J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); - } else if (r30 == 1) { - J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx1); - } - MTXConcat(mtx1, qMtx, mMtx); - break; - case 10: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); - } - MTXConcat(mtx2, qMtx2, mtx2); - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); - MTXConcat(mtx1, param_0, mMtx); - break; - case 6: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx1); - } - MTXConcat(mtx1, qMtx2, mMtx); - break; - case 1: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mMtx); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mMtx); - } - break; - case 2: - case 5: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); - } - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); - MTXConcat(mtx1, param_0, mMtx); - break; - case 3: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); - } - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx); - break; - case 4: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); - } - J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx); - break; - default: - if (r30 == 0) { - J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mMtx); - } else if (r30 == 1) { - J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mMtx); - } - break; - } -} - -/* 80323F64-80323F88 31E8A4 0024+00 0/0 1/1 0/0 .text isTexNoReg__FPv */ -bool isTexNoReg(void* param_0) { - u8 r31 = ((u8*)param_0)[1]; - if (r31 >= 0x80 && r31 <= 0xbb) { - return true; - } - return false; -} - -/* 80323F88-80323F94 31E8C8 000C+00 0/0 1/1 0/0 .text getTexNoReg__FPv */ -u16 getTexNoReg(void* param_0) { - return *(u32*)((u8*)param_0 + 1); -} - -/* ############################################################################################## */ -/* 804563B0-804563B4 0049B0 0004+00 1/1 0/0 0/0 .sdata2 @1167 */ -SECTION_SDATA2 static f32 lit_1167 = 0.125f; - -/* 804563B4-804563B8 0049B4 0004+00 1/1 0/0 0/0 .sdata2 @1168 */ -SECTION_SDATA2 static f32 lit_1168 = 1.0f / 100.0f; - -/* 804563B8-804563C0 0049B8 0008+00 1/1 0/0 0/0 .sdata2 @1171 */ -SECTION_SDATA2 static f64 lit_1171 = 4503601774854144.0 /* cast s32 to float */; - -/* 80323F94-8032413C 31E8D4 01A8+00 0/0 20/20 0/0 .text loadTexNo__FUlRCUs */ -void loadTexNo(u32 param_0, u16 const& param_1) { - ResTIMG* resTIMG = j3dSys.getTexture()->getResTIMG(param_1); - J3DSys::sTexCoordScaleTable[param_0].field_0x00 = resTIMG->width; - J3DSys::sTexCoordScaleTable[param_0].field_0x02 = resTIMG->height; - GDOverflowCheck(0x14); - J3DGDSetTexImgPtr(GXTexMapID(param_0), (u8*)resTIMG + resTIMG->imageOffset); - J3DGDSetTexImgAttr(GXTexMapID(param_0), resTIMG->width, resTIMG->height, GXTexFmt(resTIMG->format & 0x0f)); - J3DGDSetTexLookupMode(GXTexMapID(param_0), GXTexWrapMode(resTIMG->wrapS), GXTexWrapMode(resTIMG->wrapT), GXTexFilter(resTIMG->minFilter), GXTexFilter(resTIMG->magFilter), resTIMG->minLOD * 0.125f, resTIMG->maxLOD * 0.125f, resTIMG->LODBias * 0.01f, resTIMG->biasClamp, resTIMG->doEdgeLOD, GXAnisotropy(resTIMG->maxAnisotropy)); - if (resTIMG->indexTexture == true) { - GXTlutSize tlutSize = resTIMG->numColors > 16 ? GX_TLUT_256 : GX_TLUT_16; - GDOverflowCheck(0x14); - J3DGDLoadTlut((u8*)resTIMG + resTIMG->paletteOffset, (param_0 << 13) + 0xf0000, tlutSize); - J3DGDSetTexTlut(GXTexMapID(param_0), (param_0 << 13) + 0xf0000, GXTlutFmt(resTIMG->colorFormat)); - } -} - -/* 8032413C-80324160 31EA7C 0024+00 0/0 2/2 0/0 .text patchTexNo_PtrToIdx__FUlRCUs */ -void patchTexNo_PtrToIdx(u32 texID, u16 const& idx) { - J3DGDSetTexImgPtrRaw(GXTexMapID(texID), idx); -} - -/* 80324160-80324194 31EAA0 0034+00 0/0 2/2 0/0 .text loadNBTScale__FR11J3DNBTScale */ -void loadNBTScale(J3DNBTScale& param_0) { - if (param_0.mbHasScale == true) { - j3dSys.setNBTScale(¶m_0.mScale); - } else { - j3dSys.setNBTScale(NULL); - } -} - -/* ############################################################################################## */ -/* 803A1EC8-803A1EFC 02E528 0034+00 0/0 9/9 24/24 .rodata j3dDefaultLightInfo */ -SECTION_RODATA extern const J3DLightInfo j3dDefaultLightInfo = { - 0.0f, 0.0f, 0.0f, - 0.0f, -1.0f, 0.0f, - 0xff, 0xff, 0xff, 0xff, - 1.0f, 0.0f, 0.0f, - 1.0f, 0.0f, 0.0f, -}; -COMPILER_STRIP_GATE(0x803A1EC8, &j3dDefaultLightInfo); - -/* 803A1EFC-803A1F1C 02E55C 0020+00 0/0 5/5 0/0 .rodata j3dDefaultTexCoordInfo */ -SECTION_RODATA extern J3DDefaultTexCoordInfo const j3dDefaultTexCoordInfo[8] = { - {GX_MTX2x4, GX_TG_TEX0, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX1, GX_IDENTITY, 0}, - {GX_MTX2x4, GX_TG_TEX2, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX3, GX_IDENTITY, 0}, - {GX_MTX2x4, GX_TG_TEX4, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX5, GX_IDENTITY, 0}, - {GX_MTX2x4, GX_TG_TEX6, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX7, GX_IDENTITY, 0}, -}; -COMPILER_STRIP_GATE(0x803A1EFC, &j3dDefaultTexCoordInfo); - -/* 803A1F1C-803A1F80 02E57C 0064+00 0/0 1/1 0/0 .rodata j3dDefaultTexMtxInfo */ -SECTION_RODATA extern u8 const j3dDefaultTexMtxInfo[100] = { - 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x803A1F1C, &j3dDefaultTexMtxInfo); - -/* 803A1F80-803A1F9C 02E5E0 001C+00 0/0 2/2 0/0 .rodata j3dDefaultIndTexMtxInfo */ -SECTION_RODATA extern u8 const j3dDefaultIndTexMtxInfo[28] = { - 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x803A1F80, &j3dDefaultIndTexMtxInfo); - -/* 803A1F9C-803A1FB0 02E5FC 0014+00 0/0 1/1 0/0 .rodata j3dDefaultTevStageInfo */ -SECTION_RODATA extern u8 const j3dDefaultTevStageInfo[20] = { - 0x04, 0x0A, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x05, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x803A1F9C, &j3dDefaultTevStageInfo); - -/* 803A1FB0-803A1FBC 02E610 000C+00 0/0 2/2 0/0 .rodata j3dDefaultIndTevStageInfo */ -SECTION_RODATA extern u8 const j3dDefaultIndTevStageInfo[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x803A1FB0, &j3dDefaultIndTevStageInfo); - -/* 803A1FBC-803A1FE8 02E61C 002C+00 0/0 3/3 0/0 .rodata j3dDefaultFogInfo */ -SECTION_RODATA extern J3DFogInfo const j3dDefaultFogInfo = { - 0x00, 0x00, 0x0140, 0.0f, 0.0f, 0.1f, 10000.0f, 0xFF, 0xFF, 0xFF, 0x00, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -}; -COMPILER_STRIP_GATE(0x803A1FBC, &j3dDefaultFogInfo); - -/* 803A1FE8-803A1FF8 02E648 0010+00 0/0 3/3 0/0 .rodata j3dDefaultNBTScaleInfo */ -SECTION_RODATA extern J3DNBTScaleInfo const j3dDefaultNBTScaleInfo = { - 0x00, 1.0f, 1.0f, 1.0f, -}; -COMPILER_STRIP_GATE(0x803A1FE8, &j3dDefaultNBTScaleInfo); - -/* 803A1FF8-803A2008 02E658 000B+05 1/1 0/0 0/0 .rodata @1197 */ -SECTION_RODATA static u8 const lit_1197[11 + 5 /* padding */] = { - 0x1E, - 0x21, - 0x24, - 0x27, - 0x2A, - 0x2D, - 0x30, - 0x33, - 0x36, - 0x39, - 0x3C, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x803A1FF8, &lit_1197); - -/* 80434C98-80436A60 0619B8 1DC7+01 1/1 0/0 0/0 .bss j3dTexCoordTable */ -static u8 j3dTexCoordTable[7623 + 1 /* padding */]; - -/* 80324194-8032423C 31EAD4 00A8+00 0/0 1/1 0/0 .text makeTexCoordTable__Fv */ -// regswap -#ifdef NONMATCHING -void makeTexCoordTable() { - u8 bytes[] = { 0x1e, 0x21, 0x24, 0x27, 0x2a, 0x2d, 0x30, 0x33, 0x36, 0x39, 0x3c }; - - u8* table = j3dTexCoordTable; - for (u32 i = 0; i < 11; i++) { - for (u32 j = 0; j < 21; j++) { - for (int k = 0; k < 11; k++) { - u32 idx = i * 0xe7 + j * 11 + k; - table[idx * 3] = i; - table[idx * 3 + 1] = j; - table[idx * 3 + 2] = bytes[k]; - } - } - } -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void makeTexCoordTable() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DTevs/makeTexCoordTable__Fv.s" -} -#pragma pop -#endif - -/* ############################################################################################## */ -/* 80436A60-80436E60 063780 0400+00 1/1 3/3 0/0 .bss j3dTevSwapTableTable */ -extern u8 j3dTevSwapTableTable[1024]; -u8 j3dTevSwapTableTable[1024]; - -/* 80436E60-80437160 063B80 0300+00 1/1 2/2 0/0 .bss j3dAlphaCmpTable */ -extern u8 j3dAlphaCmpTable[768]; -u8 j3dAlphaCmpTable[768]; - -/* 8032423C-803242A8 31EB7C 006C+00 0/0 1/1 0/0 .text makeAlphaCmpTable__Fv */ -void makeAlphaCmpTable() { - u8* table = j3dAlphaCmpTable; - for (u32 i = 0; i < 8; i++) { - for (int j = 0; j < 4; j++) { - for (u32 k = 0; k < 8; k++) { - u32 idx = i * 32 + j * 8 + k; - table[idx * 3] = i; - table[idx * 3 + 1] = j; - table[idx * 3 + 2] = k; - } - } - } -} - -/* ############################################################################################## */ -/* 80437160-804371C0 063E80 0060+00 1/1 4/4 5/5 .bss j3dZModeTable */ -extern u8 j3dZModeTable[96]; -u8 j3dZModeTable[96]; - -/* 803242A8-80324314 31EBE8 006C+00 0/0 1/1 0/0 .text makeZModeTable__Fv */ -// regswap -#ifdef NONMATCHING -void makeZModeTable() { - u8* table = j3dZModeTable; - for (int i = 0; i < 2; i++) { - for (u32 j = 0; j < 8; j++) { - for (int k = 0; k < 2; k++) { - u32 idx = i * 16 + j * 2 + k; - table[idx * 3] = i; - table[idx * 3 + 1] = j; - table[idx * 3 + 2] = k; - } - } - } -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void makeZModeTable() { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DTevs/makeZModeTable__Fv.s" -} -#pragma pop -#endif - -/* 80324314-80324358 31EC54 0044+00 0/0 1/1 0/0 .text makeTevSwapTable__Fv */ -void makeTevSwapTable() { - u8* table = j3dTevSwapTableTable; - int i = 0; - do { - table[0] = i >> 6; - table[1] = (i >> 4) & 3; - table[2] = (i >> 2) & 3; - table[3] = i & 3; - i++; - table += 4; - } while (i < 256); -} - -/* 80324358-803243BC 31EC98 0064+00 1/1 0/0 0/0 .text loadTexMtx__9J3DTexMtxCFUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DTexMtx::loadTexMtx(u32 param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DTevs/loadTexMtx__9J3DTexMtxCFUl.s" -} -#pragma pop - -/* 803243BC-8032441C 31ECFC 0060+00 1/1 0/0 0/0 .text loadPostTexMtx__9J3DTexMtxCFUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DTexMtx::loadPostTexMtx(u32 param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DTevs/loadPostTexMtx__9J3DTexMtxCFUl.s" -} -#pragma pop - -/* 8032441C-8032499C 31ED5C 0580+00 1/1 0/0 0/0 .text J3DGDLoadTexMtxImm__FPA4_fUl13_GXTexMtxType - */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void J3DGDLoadTexMtxImm(f32 (*param_0)[4], u32 param_1, _GXTexMtxType param_2) { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DTevs/J3DGDLoadTexMtxImm__FPA4_fUl13_GXTexMtxType.s" -} -#pragma pop - -/* 8032499C-80324F08 31F2DC 056C+00 1/1 0/0 0/0 .text J3DGDLoadPostTexMtxImm__FPA4_fUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void J3DGDLoadPostTexMtxImm(f32 (*param_0)[4], u32 param_1) { - nofralloc -#include "asm/JSystem/J3DGraphBase/J3DTevs/J3DGDLoadPostTexMtxImm__FPA4_fUl.s" -} -#pragma pop - -/* ############################################################################################## */ -/* 804563C0-804563C4 0049C0 0004+00 0/0 4/4 0/0 .sdata2 j3dDefaultColInfo */ -SECTION_SDATA2 extern GXColor j3dDefaultColInfo = {0xFF, 0xFF, 0xFF, 0xFF}; - -/* 804563C4-804563C8 0049C4 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultAmbInfo */ -SECTION_SDATA2 extern u32 j3dDefaultAmbInfo = 0x32323232; - -/* 804563C8-804563CC 0049C8 0004+00 0/0 1/1 0/0 .sdata2 None */ -SECTION_SDATA2 extern u8 data_804563C8 = 0x01; - -/* 804563CC-804563D0 0049CC 0004+00 0/0 3/3 0/0 .sdata2 j3dDefaultTevOrderInfoNull */ -SECTION_SDATA2 extern u32 j3dDefaultTevOrderInfoNull = 0xFFFFFF00; - -/* 804563D0-804563D4 0049D0 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultIndTexOrderNull */ -SECTION_SDATA2 extern u32 j3dDefaultIndTexOrderNull = 0xFFFF0000; - -/* 804563D4-804563D8 0049D4 0004+00 0/0 5/5 0/0 .sdata2 j3dDefaultTevColor */ -SECTION_SDATA2 extern GXColorS10 j3dDefaultTevColor = {0xFF, 0xFF, 0xFF, 0xFF}; - -/* 804563DC-804563E0 0049DC 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultIndTexCoordScaleInfo */ -SECTION_SDATA2 extern u8 j3dDefaultIndTexCoordScaleInfo[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; - -/* 804563E0-804563E4 0049E0 0004+00 0/0 5/5 0/0 .sdata2 j3dDefaultTevKColor */ -SECTION_SDATA2 extern GXColor j3dDefaultTevKColor = {0xFF, 0xFF, 0xFF, 0xFF}; - -/* 804563E4-804563E8 0049E4 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultTevSwapMode */ -SECTION_SDATA2 extern u8 j3dDefaultTevSwapMode[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; - -/* 804563E8-804563EC 0049E8 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultTevSwapModeTable */ -SECTION_SDATA2 extern u32 j3dDefaultTevSwapModeTable = 0x00010203; - -/* 804563EC-804563F0 0049EC 0004+00 0/0 3/3 0/0 .sdata2 j3dDefaultBlendInfo */ -SECTION_SDATA2 extern const J3DBlendInfo j3dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_NOOP}; - -/* 804563F0-804563F8 0049F0 0008+00 0/0 3/3 0/0 .sdata2 j3dDefaultColorChanInfo */ -SECTION_SDATA2 extern u8 j3dDefaultColorChanInfo[8] = { - 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0xFF, 0xFF, -}; - -/* 804563F8-804563FA 0049F8 0002+00 0/0 1/1 0/0 .sdata2 None */ -SECTION_SDATA2 extern u16 data_804563F8 = 0x1B00; - -/* 804563FA-804563FC 0049FA 0002+00 0/0 1/1 0/0 .sdata2 j3dDefaultAlphaCmpID */ -SECTION_SDATA2 extern const u16 j3dDefaultAlphaCmpID = 0x00E7; - -/* 804563FC-80456400 0049FC 0002+02 0/0 3/3 0/0 .sdata2 j3dDefaultZModeID */ -SECTION_SDATA2 extern const u16 j3dDefaultZModeID = 0x0017; +// +// Generated By: dol2asm +// Translation Unit: J3DTevs +// + +#include "JSystem/J3DGraphBase/J3DTevs.h" +#include "JSystem/J3DGraphBase/J3DGD.h" +#include "JSystem/J3DGraphBase/J3DMatBlock.h" +#include "JSystem/J3DGraphBase/J3DSys.h" +#include "JSystem/J3DGraphBase/J3DTexture.h" +#include "JSystem/J3DGraphBase/J3DTransform.h" +#include "dol2asm.h" + +// +// Types: +// + +// +// Forward References: +// + +extern "C" void load__11J3DLightObjCFUl(); +extern "C" void loadTexCoordGens__FUlP11J3DTexCoord(); +extern "C" void load__9J3DTexMtxCFUl(); +extern "C" void calc__9J3DTexMtxFPA4_Cf(); +extern "C" void calcTexMtx__9J3DTexMtxFPA4_Cf(); +extern "C" void calcPostTexMtx__9J3DTexMtxFPA4_Cf(); +extern "C" void isTexNoReg__FPv(); +extern "C" void getTexNoReg__FPv(); +extern "C" void loadTexNo__FUlRCUs(); +extern "C" void patchTexNo_PtrToIdx__FUlRCUs(); +extern "C" void loadNBTScale__FR11J3DNBTScale(); +extern "C" void makeTexCoordTable__Fv(); +extern "C" void makeAlphaCmpTable__Fv(); +extern "C" void makeZModeTable__Fv(); +extern "C" void makeTevSwapTable__Fv(); +extern "C" void loadTexMtx__9J3DTexMtxCFUl(); +extern "C" void loadPostTexMtx__9J3DTexMtxCFUl(); +extern "C" static void J3DGDLoadTexMtxImm__FPA4_fUl13_GXTexMtxType(); +extern "C" static void J3DGDLoadPostTexMtxImm__FPA4_fUl(); +extern "C" extern GXColor j3dDefaultColInfo; +extern "C" extern u32 j3dDefaultAmbInfo; +extern "C" extern u8 data_804563C8; +extern "C" extern GXColorS10 j3dDefaultTevColor; +extern "C" extern GXColor j3dDefaultTevKColor; +extern "C" extern u8 j3dDefaultTevSwapMode[4]; +extern "C" extern u16 data_804563F8; + +// +// External References: +// + +extern void J3DGDSetTexImgPtrRaw(_GXTexMapID param_0, u32 param_1); + +extern "C" void J3DGDSetLightAttn__F10_GXLightIDffffff(); +extern "C" void J3DGDSetLightColor__F10_GXLightID8_GXColor(); +extern "C" void J3DGDSetLightPos__F10_GXLightIDfff(); +extern "C" void J3DGDSetLightDir__F10_GXLightIDfff(); +extern "C" void J3DGDSetTexCoordGen__F13_GXTexGenType12_GXTexGenSrc(); +extern "C" void +J3DGDSetTexLookupMode__F11_GXTexMapID14_GXTexWrapMode14_GXTexWrapMode12_GXTexFilter12_GXTexFilterfffUcUc13_GXAnisotropy(); +extern "C" void J3DGDSetTexImgAttr__F11_GXTexMapIDUsUs9_GXTexFmt(); +extern "C" void J3DGDSetTexImgPtr__F11_GXTexMapIDPv(); +extern "C" void J3DGDSetTexTlut__F11_GXTexMapIDUl10_GXTlutFmt(); +extern "C" void J3DGDLoadTlut__FPvUl11_GXTlutSize(); +extern "C" void J3DGetTextureMtx__FRC17J3DTextureSRTInfoRC3VecPA4_f(); +extern "C" void J3DGetTextureMtxOld__FRC17J3DTextureSRTInfoRC3VecPA4_f(); +extern "C" void J3DGetTextureMtxMaya__FRC17J3DTextureSRTInfoPA4_f(); +extern "C" void J3DGetTextureMtxMayaOld__FRC17J3DTextureSRTInfoPA4_f(); +extern "C" void J3DMtxProjConcat__FPA4_fPA4_fPA4_f(); +extern "C" void GDOverflowed(); +extern "C" void _savegpr_26(); +extern "C" void _savegpr_28(); +extern "C" void _restgpr_26(); +extern "C" void _restgpr_28(); +extern "C" u8 sTexCoordScaleTable__6J3DSys[64 + 4 /* padding */]; + +// +// Declarations: +// + +/* 80323590-80323644 31DED0 00B4+00 0/0 3/3 0/0 .text load__11J3DLightObjCFUl */ +// missing instruction +#ifdef NONMATCHING +void J3DLightObj::load(u32 param_0) const { + GDOverflowCheck(0x48); + J3DGDSetLightPos(GXLightID(param_0 * 2), mInfo.mLightPosition.x, mInfo.mLightPosition.y, mInfo.mLightPosition.z); + J3DGDSetLightAttn(GXLightID(param_0 * 2), mInfo.mCosAtten.x, mInfo.mCosAtten.y, mInfo.mCosAtten.z, mInfo.mDistAtten.x, mInfo.mDistAtten.y, mInfo.mDistAtten.z); + J3DGDSetLightColor(GXLightID(param_0 * 2), mInfo.mColor); + J3DGDSetLightDir(GXLightID(param_0 * 2), mInfo.mLightDirection.x, mInfo.mLightDirection.y, mInfo.mLightDirection.z); +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void J3DLightObj::load(u32 param_0) const { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DTevs/load__11J3DLightObjCFUl.s" +} +#pragma pop +#endif + +/* 80323644-803238C4 31DF84 0280+00 0/0 3/3 0/0 .text loadTexCoordGens__FUlP11J3DTexCoord + */ +void loadTexCoordGens(u32 param_0, J3DTexCoord* param_1) { + GDOverflowCheck(param_0 * 8 + 10); + J3DGDWriteXFCmdHdr(0x1040, param_0); + for (int i = 0; i < param_0; i++) { + J3DGDSetTexCoordGen( + GXTexGenType(param_1[i].getTexGenType()), + GXTexGenSrc(param_1[i].getTexGenSrc()) + ); + } + J3DGDWriteXFCmdHdr(0x1050, param_0); + if (j3dSys.checkFlag(0x40000000)) { + for (int i = 0; i < param_0; i++) { + J3DGDWrite_u32(param_1[i].getTexGenMtx() == 60 ? 61 : i * 3); + } + } else { + for (int i = 0; i < param_0; i++) { + J3DGDWrite_u32(61); + } + } +} + +/* 803238C4-80323900 31E204 003C+00 0/0 6/6 0/0 .text load__9J3DTexMtxCFUl */ +void J3DTexMtx::load(u32 mtxIdx) const { + if (j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) { + loadPostTexMtx(mtxIdx); + } else { + loadTexMtx(mtxIdx); + } +} + +/* 80323900-80323920 31E240 0020+00 0/0 2/2 0/0 .text calc__9J3DTexMtxFPA4_Cf */ +void J3DTexMtx::calc(f32 const (*param_0)[4]) { + calcTexMtx(param_0); +} + +/* 80323920-80323C0C 31E260 02EC+00 2/1 0/0 0/0 .text calcTexMtx__9J3DTexMtxFPA4_Cf */ +void J3DTexMtx::calcTexMtx(const Mtx param_0) { + Mtx44 mtx1; + Mtx44 mtx2; + + static Mtx qMtx = { + 0.5f, 0.0f, 0.5f, 0.0f, + 0.0f, -0.5f, 0.5f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + }; + static Mtx qMtx2 = { + 0.5f, 0.0f, 0.0f, 0.5f, + 0.0f, -0.5f, 0.0f, 0.5f, + 0.0f, 0.0f, 1.0f, 0.0f, + }; + + u8 r28 = mTexMtxInfo.mInfo & 0x3f; + u32 r30 = (mTexMtxInfo.mInfo >> 7) & 1; + switch (r28) { + case 8: + case 9: + case 11: + if (r30 == 0) { + J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx2); + } + MTXConcat(mtx2, qMtx, mtx2); + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); + MTXConcat(mtx1, param_0, mMtx); + break; + case 7: + if (r30 == 0) { + J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); + } else if (r30 == 1) { + J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx1); + } + MTXConcat(mtx1, qMtx, mtx1); + MTXConcat(mtx1, param_0, mMtx); + break; + case 10: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); + } + MTXConcat(mtx2, qMtx2, mtx2); + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); + MTXConcat(mtx1, param_0, mMtx); + break; + case 6: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx1); + } + MTXConcat(mtx1, qMtx2, mtx1); + MTXConcat(mtx1, param_0, mMtx); + break; + case 1: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx1); + } + MTXConcat(mtx1, param_0, mMtx); + break; + case 2: + case 3: + case 5: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); + } + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); + MTXConcat(mtx1, param_0, mMtx); + break; + case 4: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); + } + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx); + break; + default: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mMtx); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mMtx); + } + break; + } +} + +/* 80323C0C-80323F64 31E54C 0358+00 1/0 2/2 0/0 .text calcPostTexMtx__9J3DTexMtxFPA4_Cf + */ +void J3DTexMtx::calcPostTexMtx(const Mtx param_0) { + Mtx44 mtx1; + Mtx44 mtx2; + + static Mtx qMtx = { + 0.5f, 0.0f, 0.5f, 0.0f, + 0.0f, -0.5f, 0.5f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + }; + static Mtx qMtx2 = { + 0.5f, 0.0f, 0.0f, 0.5f, + 0.0f, -0.5f, 0.0f, 0.5f, + 0.0f, 0.0f, 1.0f, 0.0f, + }; + + u8 r29 = mTexMtxInfo.mInfo & 0x3f; + u32 r30 = (mTexMtxInfo.mInfo >> 7) & 1; + switch (r29) { + case 8: + case 11: + if (r30 == 0) { + J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx2); + } + MTXConcat(mtx2, qMtx, mtx2); + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); + MTXConcat(mtx1, param_0, mMtx); + break; + case 9: + if (r30 == 0) { + J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx2); + } + MTXConcat(mtx2, qMtx, mtx2); + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx); + break; + case 7: + if (r30 == 0) { + J3DGetTextureMtx(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); + } else if (r30 == 1) { + J3DGetTextureMtxMaya(mTexMtxInfo.mSRT, mtx1); + } + MTXConcat(mtx1, qMtx, mMtx); + break; + case 10: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); + } + MTXConcat(mtx2, qMtx2, mtx2); + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); + MTXConcat(mtx1, param_0, mMtx); + break; + case 6: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx1); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx1); + } + MTXConcat(mtx1, qMtx2, mMtx); + break; + case 1: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mMtx); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mMtx); + } + break; + case 2: + case 5: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); + } + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mtx1); + MTXConcat(mtx1, param_0, mMtx); + break; + case 3: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); + } + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx); + break; + case 4: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mtx2); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mtx2); + } + J3DMtxProjConcat(mtx2, mTexMtxInfo.mEffectMtx, mMtx); + break; + default: + if (r30 == 0) { + J3DGetTextureMtxOld(mTexMtxInfo.mSRT, mTexMtxInfo.mCenter, mMtx); + } else if (r30 == 1) { + J3DGetTextureMtxMayaOld(mTexMtxInfo.mSRT, mMtx); + } + break; + } +} + +/* 80323F64-80323F88 31E8A4 0024+00 0/0 1/1 0/0 .text isTexNoReg__FPv */ +bool isTexNoReg(void* param_0) { + u8 r31 = ((u8*)param_0)[1]; + if (r31 >= 0x80 && r31 <= 0xbb) { + return true; + } + return false; +} + +/* 80323F88-80323F94 31E8C8 000C+00 0/0 1/1 0/0 .text getTexNoReg__FPv */ +u16 getTexNoReg(void* param_0) { + return *(u32*)((u8*)param_0 + 1); +} + +/* ############################################################################################## */ +/* 804563B0-804563B4 0049B0 0004+00 1/1 0/0 0/0 .sdata2 @1167 */ +SECTION_SDATA2 static f32 lit_1167 = 0.125f; + +/* 804563B4-804563B8 0049B4 0004+00 1/1 0/0 0/0 .sdata2 @1168 */ +SECTION_SDATA2 static f32 lit_1168 = 1.0f / 100.0f; + +/* 804563B8-804563C0 0049B8 0008+00 1/1 0/0 0/0 .sdata2 @1171 */ +SECTION_SDATA2 static f64 lit_1171 = 4503601774854144.0 /* cast s32 to float */; + +/* 80323F94-8032413C 31E8D4 01A8+00 0/0 20/20 0/0 .text loadTexNo__FUlRCUs */ +void loadTexNo(u32 param_0, u16 const& param_1) { + ResTIMG* resTIMG = j3dSys.getTexture()->getResTIMG(param_1); + J3DSys::sTexCoordScaleTable[param_0].field_0x00 = resTIMG->width; + J3DSys::sTexCoordScaleTable[param_0].field_0x02 = resTIMG->height; + GDOverflowCheck(0x14); + J3DGDSetTexImgPtr(GXTexMapID(param_0), (u8*)resTIMG + resTIMG->imageOffset); + J3DGDSetTexImgAttr(GXTexMapID(param_0), resTIMG->width, resTIMG->height, GXTexFmt(resTIMG->format & 0x0f)); + J3DGDSetTexLookupMode(GXTexMapID(param_0), GXTexWrapMode(resTIMG->wrapS), GXTexWrapMode(resTIMG->wrapT), GXTexFilter(resTIMG->minFilter), GXTexFilter(resTIMG->magFilter), resTIMG->minLOD * 0.125f, resTIMG->maxLOD * 0.125f, resTIMG->LODBias * 0.01f, resTIMG->biasClamp, resTIMG->doEdgeLOD, GXAnisotropy(resTIMG->maxAnisotropy)); + if (resTIMG->indexTexture == true) { + GXTlutSize tlutSize = resTIMG->numColors > 16 ? GX_TLUT_256 : GX_TLUT_16; + GDOverflowCheck(0x14); + J3DGDLoadTlut((u8*)resTIMG + resTIMG->paletteOffset, (param_0 << 13) + 0xf0000, tlutSize); + J3DGDSetTexTlut(GXTexMapID(param_0), (param_0 << 13) + 0xf0000, GXTlutFmt(resTIMG->colorFormat)); + } +} + +/* 8032413C-80324160 31EA7C 0024+00 0/0 2/2 0/0 .text patchTexNo_PtrToIdx__FUlRCUs */ +void patchTexNo_PtrToIdx(u32 texID, u16 const& idx) { + J3DGDSetTexImgPtrRaw(GXTexMapID(texID), idx); +} + +/* 80324160-80324194 31EAA0 0034+00 0/0 2/2 0/0 .text loadNBTScale__FR11J3DNBTScale */ +void loadNBTScale(J3DNBTScale& param_0) { + if (param_0.mbHasScale == true) { + j3dSys.setNBTScale(¶m_0.mScale); + } else { + j3dSys.setNBTScale(NULL); + } +} + +/* ############################################################################################## */ +/* 803A1EC8-803A1EFC 02E528 0034+00 0/0 9/9 24/24 .rodata j3dDefaultLightInfo */ +SECTION_RODATA extern const J3DLightInfo j3dDefaultLightInfo = { + 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + 0xff, 0xff, 0xff, 0xff, + 1.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.0f, +}; +COMPILER_STRIP_GATE(0x803A1EC8, &j3dDefaultLightInfo); + +/* 803A1EFC-803A1F1C 02E55C 0020+00 0/0 5/5 0/0 .rodata j3dDefaultTexCoordInfo */ +SECTION_RODATA extern J3DTexCoordInfo const j3dDefaultTexCoordInfo[8] = { + {GX_MTX2x4, GX_TG_TEX0, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX1, GX_IDENTITY, 0}, + {GX_MTX2x4, GX_TG_TEX2, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX3, GX_IDENTITY, 0}, + {GX_MTX2x4, GX_TG_TEX4, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX5, GX_IDENTITY, 0}, + {GX_MTX2x4, GX_TG_TEX6, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX7, GX_IDENTITY, 0}, +}; +COMPILER_STRIP_GATE(0x803A1EFC, &j3dDefaultTexCoordInfo); + +/* 803A1F1C-803A1F80 02E57C 0064+00 0/0 1/1 0/0 .rodata j3dDefaultTexMtxInfo */ +SECTION_RODATA extern u8 const j3dDefaultTexMtxInfo[100] = { + 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, +}; +COMPILER_STRIP_GATE(0x803A1F1C, &j3dDefaultTexMtxInfo); + +/* 803A1F80-803A1F9C 02E5E0 001C+00 0/0 2/2 0/0 .rodata j3dDefaultIndTexMtxInfo */ +SECTION_RODATA extern J3DIndTexMtxInfo const j3dDefaultIndTexMtxInfo = { + 0.5f, 0.0f, 0.0f, + 0.0f, 0.5f, 0.0f, + 1 +}; +COMPILER_STRIP_GATE(0x803A1F80, &j3dDefaultIndTexMtxInfo); + +/* 803A1F9C-803A1FB0 02E5FC 0014+00 0/0 1/1 0/0 .rodata j3dDefaultTevStageInfo */ +SECTION_RODATA extern J3DTevStageInfo const j3dDefaultTevStageInfo = { + 0x04, 0x0A, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x05, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +}; +COMPILER_STRIP_GATE(0x803A1F9C, &j3dDefaultTevStageInfo); + +/* 803A1FB0-803A1FBC 02E610 000C+00 0/0 2/2 0/0 .rodata j3dDefaultIndTevStageInfo */ +SECTION_RODATA extern J3DIndTevStageInfo const j3dDefaultIndTevStageInfo = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +COMPILER_STRIP_GATE(0x803A1FB0, &j3dDefaultIndTevStageInfo); + +/* 803A1FBC-803A1FE8 02E61C 002C+00 0/0 3/3 0/0 .rodata j3dDefaultFogInfo */ +SECTION_RODATA extern J3DFogInfo const j3dDefaultFogInfo = { + 0x00, 0x00, 0x0140, 0.0f, 0.0f, 0.1f, 10000.0f, 0xFF, 0xFF, 0xFF, 0x00, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +}; +COMPILER_STRIP_GATE(0x803A1FBC, &j3dDefaultFogInfo); + +/* 803A1FE8-803A1FF8 02E648 0010+00 0/0 3/3 0/0 .rodata j3dDefaultNBTScaleInfo */ +SECTION_RODATA extern J3DNBTScaleInfo const j3dDefaultNBTScaleInfo = { + 0x00, 1.0f, 1.0f, 1.0f, +}; +COMPILER_STRIP_GATE(0x803A1FE8, &j3dDefaultNBTScaleInfo); + +/* 803A1FF8-803A2008 02E658 000B+05 1/1 0/0 0/0 .rodata @1197 */ +SECTION_RODATA static u8 const lit_1197[11 + 5 /* padding */] = { + 0x1E, + 0x21, + 0x24, + 0x27, + 0x2A, + 0x2D, + 0x30, + 0x33, + 0x36, + 0x39, + 0x3C, + /* padding */ + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, +}; +COMPILER_STRIP_GATE(0x803A1FF8, &lit_1197); + +/* 80434C98-80436A60 0619B8 1DC7+01 1/1 0/0 0/0 .bss j3dTexCoordTable */ +static u8 j3dTexCoordTable[7623 + 1 /* padding */]; + +/* 80324194-8032423C 31EAD4 00A8+00 0/0 1/1 0/0 .text makeTexCoordTable__Fv */ +// regswap +#ifdef NONMATCHING +void makeTexCoordTable() { + u8 bytes[] = { 0x1e, 0x21, 0x24, 0x27, 0x2a, 0x2d, 0x30, 0x33, 0x36, 0x39, 0x3c }; + + u8* table = j3dTexCoordTable; + for (u32 i = 0; i < 11; i++) { + for (u32 j = 0; j < 21; j++) { + for (int k = 0; k < 11; k++) { + u32 idx = i * 0xe7 + j * 11 + k; + table[idx * 3] = i; + table[idx * 3 + 1] = j; + table[idx * 3 + 2] = bytes[k]; + } + } + } +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void makeTexCoordTable() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DTevs/makeTexCoordTable__Fv.s" +} +#pragma pop +#endif + +/* ############################################################################################## */ +/* 80436A60-80436E60 063780 0400+00 1/1 3/3 0/0 .bss j3dTevSwapTableTable */ +extern u8 j3dTevSwapTableTable[1024]; +u8 j3dTevSwapTableTable[1024]; + +/* 80436E60-80437160 063B80 0300+00 1/1 2/2 0/0 .bss j3dAlphaCmpTable */ +extern u8 j3dAlphaCmpTable[768]; +u8 j3dAlphaCmpTable[768]; + +/* 8032423C-803242A8 31EB7C 006C+00 0/0 1/1 0/0 .text makeAlphaCmpTable__Fv */ +void makeAlphaCmpTable() { + u8* table = j3dAlphaCmpTable; + for (u32 i = 0; i < 8; i++) { + for (int j = 0; j < 4; j++) { + for (u32 k = 0; k < 8; k++) { + u32 idx = i * 32 + j * 8 + k; + table[idx * 3] = i; + table[idx * 3 + 1] = j; + table[idx * 3 + 2] = k; + } + } + } +} + +/* ############################################################################################## */ +/* 80437160-804371C0 063E80 0060+00 1/1 4/4 5/5 .bss j3dZModeTable */ +extern u8 j3dZModeTable[96]; +u8 j3dZModeTable[96]; + +/* 803242A8-80324314 31EBE8 006C+00 0/0 1/1 0/0 .text makeZModeTable__Fv */ +// regswap +#ifdef NONMATCHING +void makeZModeTable() { + u8* table = j3dZModeTable; + for (int i = 0; i < 2; i++) { + for (u32 j = 0; j < 8; j++) { + for (int k = 0; k < 2; k++) { + u32 idx = i * 16 + j * 2 + k; + table[idx * 3] = i; + table[idx * 3 + 1] = j; + table[idx * 3 + 2] = k; + } + } + } +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void makeZModeTable() { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DTevs/makeZModeTable__Fv.s" +} +#pragma pop +#endif + +/* 80324314-80324358 31EC54 0044+00 0/0 1/1 0/0 .text makeTevSwapTable__Fv */ +void makeTevSwapTable() { + u8* table = j3dTevSwapTableTable; + int i = 0; + do { + table[0] = i >> 6; + table[1] = (i >> 4) & 3; + table[2] = (i >> 2) & 3; + table[3] = i & 3; + i++; + table += 4; + } while (i < 256); +} + +/* 80324358-803243BC 31EC98 0064+00 1/1 0/0 0/0 .text loadTexMtx__9J3DTexMtxCFUl */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void J3DTexMtx::loadTexMtx(u32 param_0) const { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DTevs/loadTexMtx__9J3DTexMtxCFUl.s" +} +#pragma pop + +/* 803243BC-8032441C 31ECFC 0060+00 1/1 0/0 0/0 .text loadPostTexMtx__9J3DTexMtxCFUl */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void J3DTexMtx::loadPostTexMtx(u32 param_0) const { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DTevs/loadPostTexMtx__9J3DTexMtxCFUl.s" +} +#pragma pop + +/* 8032441C-8032499C 31ED5C 0580+00 1/1 0/0 0/0 .text J3DGDLoadTexMtxImm__FPA4_fUl13_GXTexMtxType + */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +static asm void J3DGDLoadTexMtxImm(f32 (*param_0)[4], u32 param_1, _GXTexMtxType param_2) { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DTevs/J3DGDLoadTexMtxImm__FPA4_fUl13_GXTexMtxType.s" +} +#pragma pop + +/* 8032499C-80324F08 31F2DC 056C+00 1/1 0/0 0/0 .text J3DGDLoadPostTexMtxImm__FPA4_fUl */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +static asm void J3DGDLoadPostTexMtxImm(f32 (*param_0)[4], u32 param_1) { + nofralloc +#include "asm/JSystem/J3DGraphBase/J3DTevs/J3DGDLoadPostTexMtxImm__FPA4_fUl.s" +} +#pragma pop + +/* ############################################################################################## */ +/* 804563C0-804563C4 0049C0 0004+00 0/0 4/4 0/0 .sdata2 j3dDefaultColInfo */ +SECTION_SDATA2 extern GXColor j3dDefaultColInfo = {0xFF, 0xFF, 0xFF, 0xFF}; + +/* 804563C4-804563C8 0049C4 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultAmbInfo */ +SECTION_SDATA2 extern u32 j3dDefaultAmbInfo = 0x32323232; + +/* 804563C8-804563CC 0049C8 0004+00 0/0 1/1 0/0 .sdata2 None */ +SECTION_SDATA2 extern u8 data_804563C8 = 0x01; + +/* 804563CC-804563D0 0049CC 0004+00 0/0 3/3 0/0 .sdata2 j3dDefaultTevOrderInfoNull */ +SECTION_SDATA2 extern J3DTevOrderInfo j3dDefaultTevOrderInfoNull = {0xFF, 0xFF, 0xFF, 0x00}; + +/* 804563D0-804563D4 0049D0 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultIndTexOrderNull */ +SECTION_SDATA2 extern J3DIndTexOrderInfo j3dDefaultIndTexOrderNull = {0xFF, 0xFF, 0x00, 0x00}; + +/* 804563D4-804563D8 0049D4 0004+00 0/0 5/5 0/0 .sdata2 j3dDefaultTevColor */ +SECTION_SDATA2 extern GXColorS10 j3dDefaultTevColor = {0xFF, 0xFF, 0xFF, 0xFF}; + +/* 804563DC-804563E0 0049DC 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultIndTexCoordScaleInfo */ +SECTION_SDATA2 extern J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo = { + 0x00, + 0x00, + 0x00, + 0x00, +}; + +/* 804563E0-804563E4 0049E0 0004+00 0/0 5/5 0/0 .sdata2 j3dDefaultTevKColor */ +SECTION_SDATA2 extern GXColor j3dDefaultTevKColor = {0xFF, 0xFF, 0xFF, 0xFF}; + +/* 804563E4-804563E8 0049E4 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultTevSwapMode */ +SECTION_SDATA2 extern u8 j3dDefaultTevSwapMode[4] = { + 0x00, + 0x00, + 0x00, + 0x00, +}; + +/* 804563E8-804563EC 0049E8 0004+00 0/0 2/2 0/0 .sdata2 j3dDefaultTevSwapModeTable */ +SECTION_SDATA2 extern J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable = {0x00, 0x01, 0x02, 0x03}; + +/* 804563EC-804563F0 0049EC 0004+00 0/0 3/3 0/0 .sdata2 j3dDefaultBlendInfo */ +SECTION_SDATA2 extern const J3DBlendInfo j3dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_NOOP}; + +/* 804563F0-804563F8 0049F0 0008+00 0/0 3/3 0/0 .sdata2 j3dDefaultColorChanInfo */ +SECTION_SDATA2 extern J3DColorChanInfo j3dDefaultColorChanInfo = { + 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0xFF, 0xFF, +}; + +/* 804563F8-804563FA 0049F8 0002+00 0/0 1/1 0/0 .sdata2 None */ +SECTION_SDATA2 extern u16 data_804563F8 = 0x1B00; + +/* 804563FA-804563FC 0049FA 0002+00 0/0 1/1 0/0 .sdata2 j3dDefaultAlphaCmpID */ +SECTION_SDATA2 extern const u16 j3dDefaultAlphaCmpID = 0x00E7; + +/* 804563FC-80456400 0049FC 0002+02 0/0 3/3 0/0 .sdata2 j3dDefaultZModeID */ +SECTION_SDATA2 extern const u16 j3dDefaultZModeID = 0x0017; diff --git a/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp b/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp index 306e0955904..2c42fd8dee5 100644 --- a/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp +++ b/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp @@ -4,272 +4,11 @@ // #include "JSystem/J3DGraphLoader/J3DMaterialFactory.h" +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "JSystem/J3DGraphBase/J3DSys.h" +#include "JSystem/JSupport/JSupport.h" #include "dol2asm.h" -// -// Types: -// - -struct J3DZMode {}; - -struct J3DTexMtxInfo { - /* 80325718 */ void operator=(J3DTexMtxInfo const&); -}; - -struct J3DTexMtx {}; - -struct J3DTexGenBlockPatched { - /* 80317644 */ void initialize(); -}; - -struct J3DTexGenBlockNull { - /* 80332AA0 */ void calc(f32 const (*)[4]); - /* 80332AA4 */ void calcWithoutViewMtx(f32 const (*)[4]); - /* 80332AA8 */ void calcPostTexMtx(f32 const (*)[4]); - /* 80332AAC */ void calcPostTexMtxWithoutViewMtx(f32 const (*)[4]); - /* 80332AB0 */ void load(); - /* 80332AB4 */ void patch(); - /* 80332AB8 */ void diff(u32); - /* 80332ABC */ void diffTexMtx(); - /* 80332AC0 */ void diffTexGen(); - /* 80332AC4 */ void getType(); - /* 80332AD0 */ ~J3DTexGenBlockNull(); -}; - -struct J3DNBTScale {}; - -struct J3DTexCoord { - /* 8000E464 */ J3DTexCoord(); -}; - -struct J3DTexGenBlock { - /* 8000DFD8 */ bool getTexMtx(u32); - /* 8000DFE0 */ bool getTexCoord(u32); - /* 8000DFE8 */ bool getTexGenNum() const; - /* 8000E0CC */ void setTexCoord(u32, J3DTexCoord const*); - /* 8031741C */ void setTexGenNum(u32 const*); - /* 8000E0D0 */ void setTexGenNum(u32); - /* 8003AB2C */ void setTexMtx(u32, J3DTexMtx*); - /* 803172FC */ bool countDLSize(); - /* 80317334 */ bool getNBTScale(); - /* 80317354 */ void reset(J3DTexGenBlock*); - /* 80317420 */ void setNBTScale(J3DNBTScale); - /* 80317424 */ void setNBTScale(J3DNBTScale const*); - /* 80317428 */ bool getTexMtxOffset() const; - /* 80317430 */ void setTexMtxOffset(u32); -}; - -struct J3DTevSwapModeTable {}; - -struct J3DTevSwapModeInfo {}; - -struct J3DTevStageInfo {}; - -struct J3DTevStage { - /* 8000E230 */ J3DTevStage(); - /* 8003AACC */ J3DTevStage(J3DTevStageInfo const&); -}; - -struct J3DTevOrder { - /* 8000E140 */ J3DTevOrder(); -}; - -struct J3DTevBlockPatched { - /* 803176E0 */ void initialize(); -}; - -struct J3DGXColorS10 { - /* 8000E460 */ J3DGXColorS10(); -}; - -struct J3DIndTevStage { - /* 8000E14C */ J3DIndTevStage(); -}; - -struct J3DGXColor { - /* 8000E538 */ J3DGXColor(); -}; - -struct J3DTevBlock { - /* 8000DBC8 */ void patchTexNoAndTexCoordScale(); - /* 8000DBD4 */ void patch(); - /* 8000DF84 */ bool getIndTevStage(u32); - /* 8000DF8C */ bool getTevStage(u32); - /* 8000DF94 */ void getTexNo(u32) const; - /* 8000DFA0 */ bool getTevSwapModeTable(u32); - /* 8000DFA8 */ bool getTevKAlphaSel(u32); - /* 8000DFB0 */ bool getTevKColorSel(u32); - /* 8000DFB8 */ bool getTevOrder(u32); - /* 8000DFC0 */ bool getTevKColor(u32); - /* 8000DFC8 */ bool getTevColor(u32); - /* 8000DFD0 */ bool getTevStageNum() const; - /* 8000E0A4 */ void setIndTevStage(u32, J3DIndTevStage); - /* 80323554 */ void setIndTevStage(u32, J3DIndTevStage const*); - /* 8000E0A8 */ void setTevStage(u32, J3DTevStage); - /* 80323550 */ void setTevStage(u32, J3DTevStage const*); - /* 8000E0AC */ void setTexNo(u32, u16); - /* 80323544 */ void setTexNo(u32, u16 const*); - /* 8000E0B0 */ void setTevSwapModeTable(u32, J3DTevSwapModeTable); - /* 80322960 */ void setTevSwapModeTable(u32, J3DTevSwapModeTable const*); - /* 8000E0B4 */ void setTevKAlphaSel(u32, u8); - /* 80322954 */ void setTevKAlphaSel(u32, u8 const*); - /* 8000E0B8 */ void setTevKColorSel(u32, u8); - /* 80322950 */ void setTevKColorSel(u32, u8 const*); - /* 8000E0BC */ void setTevOrder(u32, J3DTevOrder); - /* 80323548 */ void setTevOrder(u32, J3DTevOrder const*); - /* 800732AC */ void setTevKColor(u32, J3DGXColor const*); - /* 8000E0C0 */ void setTevKColor(u32, J3DGXColor); - /* 80110E80 */ void setTevColor(u32, J3DGXColorS10 const*); - /* 8000E0C4 */ void setTevColor(u32, J3DGXColorS10); - /* 8000E0C8 */ void setTevStageNum(u8); - /* 8032354C */ void setTevStageNum(u8 const*); - /* 8031730C */ bool countDLSize(); - /* 80317330 */ void load(); - /* 8031CD44 */ void diff(u32); - /* 8031E098 */ void indexToPtr_private(u32); - /* 80321938 */ void diffTevReg(); - /* 8032193C */ void diffTevStageIndirect(); - /* 80321940 */ void diffTevStage(); - /* 80321944 */ void diffTexCoordScale(); - /* 80321948 */ void diffTexNo(); - /* 80322958 */ void setTevSwapModeInfo(u32, J3DTevSwapModeInfo); - /* 8032295C */ void setTevSwapModeInfo(u32, J3DTevSwapModeInfo const*); - /* 80322964 */ bool getTevRegOffset() const; - /* 8032296C */ void setTevRegOffset(u32); - /* 8032353C */ void patchTexNo(); - /* 80323540 */ void patchTevReg(); - /* 80323558 */ bool getTexNoOffset() const; -}; - -struct J3DTevBlockNull { - /* 803176D4 */ void initialize(); - /* 80332A0C */ void reset(J3DTevBlock*); - /* 80332A10 */ void ptrToIndex(); - /* 80332A14 */ void indexToPtr(); - /* 80332A38 */ void getType(); - /* 80332A44 */ ~J3DTevBlockNull(); -}; - -struct J3DPatchedMaterial { - /* 80316FB8 */ void initialize(); -}; - -struct J3DPEBlockNull { - /* 803329A0 */ void load(); - /* 803329A4 */ void getType(); - /* 803329B0 */ ~J3DPEBlockNull(); -}; - -struct J3DFog {}; - -struct J3DAlphaComp {}; - -struct J3DBlend {}; - -struct J3DPEBlock { - /* 8000DBCC */ void patch(); - /* 8000DF3C */ bool getZCompLoc() const; - /* 8000DF44 */ bool getZMode(); - /* 8000DF4C */ bool getBlend(); - /* 8000DF54 */ bool getAlphaComp(); - /* 8000DF5C */ bool getFog(); - /* 8000E010 */ void setZCompLoc(u8); - /* 80317378 */ void setZCompLoc(u8 const*); - /* 8000E014 */ void setZMode(J3DZMode); - /* 80317374 */ void setZMode(J3DZMode const*); - /* 8000E018 */ void setBlend(J3DBlend const&); - /* 80317370 */ void setBlend(J3DBlend const*); - /* 8000E01C */ void setAlphaComp(J3DAlphaComp const&); - /* 8031736C */ void setAlphaComp(J3DAlphaComp const*); - /* 8031731C */ bool countDLSize(); - /* 80317344 */ void diff(u32); - /* 80317348 */ void reset(J3DPEBlock*); - /* 8031735C */ void diffFog(); - /* 80317360 */ void diffBlend(); - /* 80317364 */ void setFog(J3DFog*); - /* 80317368 */ void setFog(J3DFog); - /* 80317380 */ void setDither(u8 const*); - /* 8031737C */ void setDither(u8); - /* 80317384 */ bool getDither() const; - /* 8031738C */ bool getFogOffset() const; - /* 80317394 */ void setFogOffset(u32); -}; - -struct J3DMaterial { - /* 803157A0 */ void createColorBlock(u32); - /* 803159A0 */ void createTexGenBlock(u32); - /* 80315B04 */ void createTevBlock(int); - /* 80315E78 */ void createIndBlock(int); - /* 80315F60 */ void createPEBlock(u32, u32); - /* 80316100 */ void calcSizeColorBlock(u32); - /* 80316150 */ void calcSizeTexGenBlock(u32); - /* 8031617C */ void calcSizeTevBlock(int); - /* 803161C4 */ void calcSizeIndBlock(int); - /* 803161D8 */ void calcSizePEBlock(u32, u32); - /* 80316240 */ void initialize(); - /* 80332B94 */ ~J3DMaterial(); -}; - -struct J3DLockedMaterial { - /* 80317044 */ void initialize(); -}; - -struct J3DLightObj {}; - -struct J3DIndTexMtxInfo { - /* 803257DC */ void operator=(J3DIndTexMtxInfo const&); -}; - -struct J3DFogInfo { - /* 80325800 */ void operator=(J3DFogInfo const&); -}; - -struct J3DDisplayListObj { - /* 803125E4 */ void setSingleDisplayList(void*, u32); -}; - -struct J3DColorChan {}; - -struct J3DColorBlockNull { - /* 80332B2C */ void getType(); - /* 80332B38 */ ~J3DColorBlockNull(); -}; - -struct J3DColorBlock { - /* 8000DBD0 */ void patchLight(); - /* 8000DFF0 */ bool getAmbColor(u32); - /* 8000DFF8 */ bool getColorChan(u32); - /* 8000E000 */ bool getMatColor(u32); - /* 8000E008 */ u8 getColorChanNum() const; - /* 801A4C0C */ void setAmbColor(u32, J3DGXColor const*); - /* 8000E0D4 */ void setAmbColor(u32, J3DGXColor); - /* 80317450 */ void setColorChan(u32, J3DColorChan const*); - /* 8000E0D8 */ void setColorChan(u32, J3DColorChan const&); - /* 80317448 */ void setMatColor(u32, J3DGXColor const*); - /* 8000E0DC */ void setMatColor(u32, J3DGXColor); - /* 8031744C */ void setColorChanNum(u8 const*); - /* 8000E0E0 */ void setColorChanNum(u8); - /* 801A4C08 */ void setLight(u32, J3DLightObj*); - /* 80317304 */ bool countDLSize(); - /* 80317324 */ void load(); - /* 80317328 */ s32 getCullMode() const; - /* 8031733C */ void patch(); - /* 80317340 */ void diff(u32); - /* 80317358 */ void reset(J3DColorBlock*); - /* 80317434 */ void patchMatColor(); - /* 80317438 */ void diffAmbColor(); - /* 8031743C */ void diffMatColor(); - /* 80317440 */ void diffColorChan(); - /* 80317444 */ void diffLightObj(u32); - /* 80317454 */ bool getLight(u32); - /* 8031745C */ void setCullMode(u8); - /* 80317460 */ void setCullMode(u8 const*); - /* 80317464 */ bool getMatColorOffset() const; - /* 8031746C */ bool getColorChanOffset() const; - /* 80317474 */ void setMatColorOffset(u32); - /* 80317478 */ void setColorChanOffset(u32); -}; - // // Forward References: // @@ -423,11 +162,11 @@ extern "C" void setLight__13J3DColorBlockFUlP11J3DLightObj(); extern "C" void setAmbColor__13J3DColorBlockFUlPC10J3DGXColor(); extern "C" void* __nw__FUl(); extern "C" void __dl__FPv(); -extern "C" void func_802F41E8(void* _this, void const*, void const*); -extern "C" void func_802F4260(void* _this, void const*, void const*); -extern "C" void func_802F4278(void* _this, void const*, void const*); -extern "C" void func_802F4290(void* _this, void const*, void const*); -extern "C" void func_802F42C0(void* _this, void const*, void const*); +extern "C" GXColorS10* func_802F41E8(void const*, void const*); +extern "C" u8* func_802F4260(void const*, void const*); +extern "C" GXColor* func_802F4278(void const*, void const*); +extern "C" GXCullMode* func_802F4290(void const*, void const*); +extern "C" u16* func_802F42C0(void const*, void const*); extern "C" void setSingleDisplayList__17J3DDisplayListObjFPvUl(); extern "C" void createColorBlock__11J3DMaterialFUl(); extern "C" void createTexGenBlock__11J3DMaterialFUl(); @@ -531,11 +270,6 @@ extern "C" void _restgpr_24(); extern "C" void _restgpr_26(); extern "C" void _restgpr_28(); extern "C" void _restgpr_29(); -extern "C" extern u8 const j3dDefaultTexCoordInfo[32]; -extern "C" extern u8 const j3dDefaultIndTexMtxInfo[28]; -extern "C" extern u8 const j3dDefaultIndTevStageInfo[12]; -extern "C" extern u8 const j3dDefaultFogInfo[44]; -extern "C" extern u8 const j3dDefaultNBTScaleInfo[16]; extern "C" extern void* __vt__17J3DLockedMaterial[12]; extern "C" extern void* __vt__18J3DPatchedMaterial[12]; extern "C" extern void* __vt__11J3DMaterial[12]; @@ -547,13 +281,6 @@ extern "C" extern void* __vt__13J3DColorBlock[36]; extern "C" extern void* __vt__18J3DTevBlockPatched[55]; extern "C" extern void* __vt__21J3DTexGenBlockPatched[27]; extern "C" extern void* __vt__11J3DTevBlock[55]; -extern "C" extern u32 j3dDefaultTevOrderInfoNull; -extern "C" extern u32 j3dDefaultIndTexOrderNull; -extern "C" extern u8 j3dDefaultIndTexCoordScaleInfo[4]; -extern "C" extern u32 j3dDefaultTevSwapModeTable; -extern "C" extern u32 j3dDefaultBlendInfo; -extern "C" extern u8 j3dDefaultColorChanInfo[8]; -extern "C" extern u16 j3dDefaultZModeID[1 + 1 /* padding */]; // // Declarations: @@ -561,87 +288,271 @@ extern "C" extern u16 j3dDefaultZModeID[1 + 1 /* padding */]; /* 8032FFEC-80330234 32A92C 0248+00 0/0 7/7 0/0 .text * __ct__18J3DMaterialFactoryFRC16J3DMaterialBlock */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DMaterialFactory::J3DMaterialFactory(J3DMaterialBlock const& param_0) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__ct__18J3DMaterialFactoryFRC16J3DMaterialBlock.s" +J3DMaterialFactory::J3DMaterialFactory(J3DMaterialBlock const& i_block) { + mMaterialNum = i_block.mMaterialNum; + mpMaterialInitData = JSUConvertOffsetToPtr(&i_block, i_block.mpMaterialInitData); + // mpMaterialID = JSUConvertOffsetToPtr(&i_block, i_block.mpMaterialID); + mpMaterialID = func_802F42C0(&i_block, i_block.mpMaterialID); + if (i_block.mpIndInitData != NULL && (u32)i_block.mpIndInitData - (u32)i_block.mpNameTable > 4) { + mpIndInitData = JSUConvertOffsetToPtr(&i_block, i_block.mpIndInitData); + } else { + mpIndInitData = NULL; + } + // mpCullMode = JSUConvertOffsetToPtr(&i_block, i_block.mpCullMode); + mpCullMode = func_802F4290(&i_block, i_block.mpCullMode); + // mpMatColor = JSUConvertOffsetToPtr(&i_block, i_block.mpMatColor); + mpMatColor = func_802F4278(&i_block, i_block.mpMatColor); + // mpColorChanNum = JSUConvertOffsetToPtr(&i_block, i_block.mpColorChanNum); + mpColorChanNum = func_802F4260(&i_block, i_block.mpColorChanNum); + mpColorChanInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpColorChanInfo); + // mpAmbColor = JSUConvertOffsetToPtr(&i_block, i_block.mpAmbColor); + mpAmbColor = func_802F4278(&i_block, i_block.mpAmbColor); + mpLightInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpLightInfo); + // mpTexGenNum = JSUConvertOffsetToPtr(&i_block, i_block.mpTexGenNum); + mpTexGenNum = func_802F4260(&i_block, i_block.mpTexGenNum); + mpTexCoordInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTexCoordInfo); + mpTexCoord2Info = JSUConvertOffsetToPtr(&i_block, i_block.mpTexCoord2Info); + mpTexMtxInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTexMtxInfo); + field_0x34 = JSUConvertOffsetToPtr(&i_block, i_block.field_0x44); + // mpTexNo = JSUConvertOffsetToPtr(&i_block, i_block.mpTexNo); + mpTexNo = func_802F42C0(&i_block, i_block.mpTexNo); + mpTevOrderInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTevOrderInfo); + // mpTevColor = JSUConvertOffsetToPtr(&i_block, i_block.mpTevColor); + mpTevColor = func_802F41E8(&i_block, i_block.mpTevColor); + // mpTevKColor = JSUConvertOffsetToPtr(&i_block, i_block.mpTevKColor); + mpTevKColor = func_802F4278(&i_block, i_block.mpTevKColor); + // mpTevStageNum = JSUConvertOffsetToPtr(&i_block, i_block.mpTevStageNum); + mpTevStageNum = func_802F4260(&i_block, i_block.mpTevStageNum); + mpTevStageInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTevStageInfo); + mpTevSwapModeInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTevSwapModeInfo); + mpTevSwapModeTableInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTevSwapModeTableInfo); + mpFogInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpFogInfo); + mpAlphaCompInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpAlphaCompInfo); + mpBlendInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpBlendInfo); + mpZModeInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpZModeInfo); + // mpZCompLoc = JSUConvertOffsetToPtr(&i_block, i_block.mpZCompLoc); + mpZCompLoc = func_802F4260(&i_block, i_block.mpZCompLoc); + // mpDither = JSUConvertOffsetToPtr(&i_block, i_block.mpDither); + mpDither = func_802F4260(&i_block, i_block.mpDither); + mpNBTScaleInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpNBTScaleInfo); + mpDisplayListInit = NULL; + mpPatchingInfo = NULL; + mpCurrentMtxInfo = NULL; + mpMaterialMode = NULL; } -#pragma pop /* 80330234-803302BC 32AB74 0088+00 0/0 2/2 0/0 .text * __ct__18J3DMaterialFactoryFRC18J3DMaterialDLBlock */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DMaterialFactory::J3DMaterialFactory(J3DMaterialDLBlock const& param_0) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__ct__18J3DMaterialFactoryFRC18J3DMaterialDLBlock.s" +J3DMaterialFactory::J3DMaterialFactory(J3DMaterialDLBlock const& i_block) { + mMaterialNum = i_block.mMaterialNum; + mpMaterialInitData = NULL; + mpDisplayListInit = JSUConvertOffsetToPtr(&i_block, i_block.mpDisplayListInit); + mpPatchingInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpPatchingInfo); + mpCurrentMtxInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpCurrentMtxInfo); + // mpMaterialMode = JSUConvertOffsetToPtr(&i_block, i_block.mpMaterialMode); + mpMaterialMode = func_802F4260(&i_block, i_block.mpMaterialMode); } -#pragma pop /* 803302BC-80330304 32ABFC 0048+00 0/0 3/3 0/0 .text countUniqueMaterials__18J3DMaterialFactoryFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm u16 J3DMaterialFactory::countUniqueMaterials() { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countUniqueMaterials__18J3DMaterialFactoryFv.s" +u16 J3DMaterialFactory::countUniqueMaterials() { + u16 count = 0; + s32 id = -1; + for (u16 i = 0; i < mMaterialNum; i++) { + if (id < mpMaterialID[i]) { + count++; + id = mpMaterialID[i]; + } + } + return count; } -#pragma pop /* 80330304-8033033C 32AC44 0038+00 4/4 0/0 0/0 .text countTexGens__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::countTexGens(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countTexGens__18J3DMaterialFactoryCFi.s" +u32 J3DMaterialFactory::countTexGens(int i_idx) const { + u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx; + if (tex_gen_num_index != 0xff) { + return mpTexGenNum[tex_gen_num_index]; + } + return 0; } -#pragma pop /* 8033033C-803303C4 32AC7C 0088+00 2/2 0/0 0/0 .text countStages__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::countStages(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/countStages__18J3DMaterialFactoryCFi.s" +u32 J3DMaterialFactory::countStages(int i_idx) const { + J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + u32 count1 = 0; + u32 count2 = 0; + u8 tev_stage_num_index = init_data->mTevStageNumIdx; + if (tev_stage_num_index != 0xff) { + count2 = mpTevStageNum[tev_stage_num_index]; + } + for (int i = 0; i < 8; i++) { + if (init_data->mTexNoIdx[i] != 0xffff) { + count1++; + } + } + if (count2 != count1 && count1 != 0) { + if (count2 > count1) { + return count2; + } else { + return count1; + } + } + return count2; } -#pragma pop /* 803303C4-80330440 32AD04 007C+00 0/0 4/4 0/0 .text * create__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -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" +J3DMaterial* J3DMaterialFactory::create(J3DMaterial* i_material, MaterialType i_type, + int i_idx, u32 i_flags) const { + switch (i_type) { + case MATERIAL_TYPE_NORMAL: + i_material = createNormalMaterial(i_material, i_idx, i_flags); + break; + case MATERIAL_TYPE_LOCKED: + i_material = createLockedMaterial(i_material, i_idx, i_flags); + break; + case MATERIAL_TYPE_PATCHED: + i_material = createPatchedMaterial(i_material, i_idx, i_flags); + break; + } + return i_material; } -#pragma pop /* 80330440-80330D84 32AD80 0944+00 1/1 0/0 0/0 .text * createNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::createNormalMaterial(J3DMaterial* param_0, int param_1, +#ifdef NONMATCHING +J3DMaterial* J3DMaterialFactory::createNormalMaterial(J3DMaterial* i_material, int i_idx, + u32 i_flags) const { + if (mpDisplayListInit != NULL) { + return createLockedMaterial(i_material, i_idx, i_flags); + } + u32 stages = countStages(i_idx); + u32 tev_stage_num = getMdlDataFlag_TevStageNum(i_flags); + if (stages > tev_stage_num) { + tev_stage_num = stages; + } + u32 u1 = 8; + if (tev_stage_num <= 8) { + u1 = tev_stage_num; + } + u32 texgens = countTexGens(i_idx); + u32 texgen_flag = texgens > 4 ? 0 : getMdlDataFlag_TexGenFlag(i_flags); + u32 color_flag = getMdlDataFlag_ColorFlag(i_flags); + u32 pe_flag = getMdlDataFlag_PEFlag(i_flags); + bool ind_flag = (i_flags & 0x1000000) != 0; + if (i_material == NULL) { + i_material = new J3DMaterial(); + } + i_material->mColorBlock = J3DMaterial::createColorBlock(color_flag); + i_material->mTexGenBlock = J3DMaterial::createTexGenBlock(texgen_flag); + i_material->mTevBlock = J3DMaterial::createTevBlock((u16)tev_stage_num); + i_material->mIndBlock = J3DMaterial::createIndBlock(ind_flag); + i_material->mPEBlock = J3DMaterial::createPEBlock(pe_flag, getMaterialMode(i_idx)); + i_material->mIndex = i_idx; + i_material->mMaterialMode = getMaterialMode(i_idx); + i_material->mColorBlock->setColorChanNum(newColorChanNum(i_idx)); + i_material->mColorBlock->setCullMode(newCullMode(i_idx)); + i_material->mTexGenBlock->setTexGenNum(newTexGenNum(i_idx)); + i_material->mTexGenBlock->setNBTScale(newNBTScale(i_idx)); + i_material->mPEBlock->setFog(newFog(i_idx)); + i_material->mPEBlock->setAlphaComp(newAlphaComp(i_idx)); + i_material->mPEBlock->setBlend(newBlend(i_idx)); + i_material->mPEBlock->setZMode(newZMode(i_idx)); + i_material->mPEBlock->setZCompLoc(newZCompLoc(i_idx)); + i_material->mPEBlock->setDither(newDither(i_idx)); + i_material->mTevBlock->setTevStageNum(newTevStageNum(i_idx)); + for (u8 i = 0; i < u1; i++) { + i_material->mTevBlock->setTexNo(i, newTexNo(i_idx, i)); + } + for (u8 i = 0; i < tev_stage_num; i++) { + i_material->mTevBlock->setTevOrder(i, newTevOrder(i_idx, i)); + } + for (u8 i = 0; i < tev_stage_num; i++) { + J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + i_material->mTevBlock->setTevStage(i, newTevStage(i_idx, i)); + if (material_init_data->mTevSwapModeIdx[i] != 0xffff) { + i_material->mTevBlock->getTevStage(i)->setTexSel( + mpTevSwapModeInfo[material_init_data->mTevSwapModeIdx[i]].mTexSel); + i_material->mTevBlock->getTevStage(i)->setRasSel( + mpTevSwapModeInfo[material_init_data->mTevSwapModeIdx[i]].mRasSel); + } + } + for (u8 i = 0; i < 4; i++) { + i_material->mTevBlock->setTevKColor(i, newTevKColor(i_idx, i)); + } + for (u8 i = 0; i < 4; i++) { + i_material->mTevBlock->setTevColor(i, newTevColor(i_idx, i)); + } + for (u8 i = 0; i < 4; i++) { + i_material->mTevBlock->setTevSwapModeTable(i, newTevSwapModeTable(i_idx, i)); + } + for (u8 i = 0; i < 2; i++) { + i_material->mColorBlock->setAmbColor(i, newAmbColor(i_idx, i)); + } + for (u8 i = 0; i < 2; i++) { + i_material->mColorBlock->setMatColor(i, newMatColor(i_idx, i)); + } + for (u8 i = 0; i < 4; i++) { + i_material->mColorBlock->setColorChan(i, newColorChan(i_idx, i)); + } + for (u8 i = 0; i < texgens; i++) { + J3DTexCoord tex_coord = newTexCoord(i_idx, i); + i_material->mTexGenBlock->setTexCoord(i, &tex_coord); + } + for (u8 i = 0; i < 8; i++) { + i_material->mTexGenBlock->setTexMtx(i, newTexMtx(i_idx, i)); + } + J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + for (u8 i = 0; i < tev_stage_num; i++) { + if (material_init_data->mTevKColorSel[i] != 0xff) { + i_material->mTevBlock->setTevKColorSel(i, material_init_data->mTevKColorSel[i]); + } else { + i_material->mTevBlock->setTevKColorSel(i, 0xc); + } + } + for (u8 i = 0; i < tev_stage_num; i++) { + if (material_init_data->mTevKAlphaSel[i] != 0xff) { + i_material->mTevBlock->setTevKAlphaSel(i, material_init_data->mTevKAlphaSel[i]); + } else { + i_material->mTevBlock->setTevKAlphaSel(i, 0x1c); + } + } + if (mpIndInitData != NULL) { + u8 ind_tex_stage_num = newIndTexStageNum(i_idx); + i_material->mIndBlock->setIndTexStageNum(newIndTexStageNum(i_idx)); + for (u8 i = 0; i < ind_tex_stage_num; i++) { + i_material->mIndBlock->setIndTexMtx(i, newIndTexMtx(i_idx, i)); + } + for (u8 i = 0; i < ind_tex_stage_num; i++) { + i_material->mIndBlock->setIndTexOrder(i, newIndTexOrder(i_idx, i)); + } + for (u8 i = 0; i < ind_tex_stage_num; i++) { + i_material->mIndBlock->setIndTexCoordScale(i, newIndTexCoordScale(i_idx, i)); + } + for (u8 i = 0; i < tev_stage_num; i++) { + i_material->mTevBlock->setIndTevStage(i, newIndTevStage(i_idx, i)); + } + } + return i_material; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DMaterial* J3DMaterialFactory::createNormalMaterial(J3DMaterial* param_0, int param_1, u32 param_2) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/createNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s" } #pragma pop +#endif /* 80330D84-8033168C 32B6C4 0908+00 1/1 0/0 0/0 .text * createPatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::createPatchedMaterial(J3DMaterial* param_0, int param_1, +asm J3DMaterial* J3DMaterialFactory::createPatchedMaterial(J3DMaterial* param_0, int param_1, u32 param_2) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/createPatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s" @@ -659,7 +570,6 @@ asm void J3DMaterialFactory::modifyPatchedCurrentMtx(J3DMaterial* param_0, int p } #pragma pop -/* ############################################################################################## */ /* 803CEE90-803CEF0C 02BFB0 007C+00 2/2 0/0 0/0 .data __vt__14J3DPEBlockNull */ SECTION_DATA extern void* __vt__14J3DPEBlockNull[31] = { (void*)NULL /* RTTI */, @@ -829,368 +739,547 @@ SECTION_DATA extern void* __vt__17J3DColorBlockNull[36 + 1 /* padding */] = { /* 803317D4-80331A7C 32C114 02A8+00 2/2 0/0 0/0 .text * createLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::createLockedMaterial(J3DMaterial* param_0, int param_1, +#ifdef NONMATCHING +// matches but makes the J3DMaterial destructor appear in the wrong place +J3DMaterial* J3DMaterialFactory::createLockedMaterial(J3DMaterial* i_material, int i_idx, + u32 i_flags) const { + if (i_material == NULL) { + i_material = new J3DLockedMaterial(); + i_material->mColorBlock = new J3DColorBlockNull(); + i_material->mTexGenBlock = new J3DTexGenBlockNull(); + i_material->mTevBlock = new J3DTevBlockNull(); + i_material->mIndBlock = new J3DIndBlockNull(); + i_material->mPEBlock = new J3DPEBlockNull(); + i_material->mIndex = i_idx; + i_material->mMaterialMode = mpMaterialMode[i_idx]; + } + + i_material->mCurrentMtx = mpCurrentMtxInfo[i_idx]; + i_material->mColorBlock->setMatColorOffset(mpPatchingInfo[i_idx].mMatColorOffset); + i_material->mColorBlock->setColorChanOffset(mpPatchingInfo[i_idx].mColorChanOffset); + i_material->mTexGenBlock->setTexMtxOffset(mpPatchingInfo[i_idx].mTexMtxOffset); + i_material->mTevBlock->setTexNoOffset(mpPatchingInfo[i_idx].mTexNoOffset); + i_material->mTevBlock->setTevRegOffset(mpPatchingInfo[i_idx].mTevRegOffset); + i_material->mPEBlock->setFogOffset(mpPatchingInfo[i_idx].mFogOffset); + if (i_material->mSharedDLObj == NULL) { + i_material->mSharedDLObj = new J3DDisplayListObj(); + i_material->mSharedDLObj->setSingleDisplayList((void*)( + mpDisplayListInit[i_idx].mOffset + (u32)&mpDisplayListInit[i_idx]), + mpDisplayListInit[i_idx].field_0x4 + ); + } + return i_material; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DMaterial* J3DMaterialFactory::createLockedMaterial(J3DMaterial* param_0, int param_1, u32 param_2) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/createLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s" } #pragma pop +#endif /* 80331A7C-80331AFC 32C3BC 0080+00 0/0 4/4 0/0 .text * calcSize__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::calcSize(J3DMaterial* param_0, - J3DMaterialFactory::MaterialType param_1, int param_2, - u32 param_3) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80331A7C.s" +u32 J3DMaterialFactory::calcSize(J3DMaterial* i_material, J3DMaterialFactory::MaterialType i_type, + int i_idx, u32 i_flags) const { + u32 size = 0; + switch (i_type) { + case MATERIAL_TYPE_NORMAL: + size = calcSizeNormalMaterial(i_material, i_idx, i_flags); + break; + case MATERIAL_TYPE_LOCKED: + size = calcSizeLockedMaterial(i_material, i_idx, i_flags); + break; + case MATERIAL_TYPE_PATCHED: + size = calcSizePatchedMaterial(i_material, i_idx, i_flags); + break; + } + return size; } -#pragma pop /* 80331AFC-80331C30 32C43C 0134+00 1/1 0/0 0/0 .text * calcSizeNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::calcSizeNormalMaterial(J3DMaterial* param_0, int param_1, +#ifdef NONMATCHING +// regalloc +u32 J3DMaterialFactory::calcSizeNormalMaterial(J3DMaterial* i_material, int i_idx, + u32 i_flags) const { + u32 size = 0; + if (mpDisplayListInit != NULL) { + return calcSizeLockedMaterial(i_material, i_idx, i_flags); + } + + u32 stages = countStages(i_idx); + // u32 tev_stage_num = getMdlDataFlag_TevStageNum(i_flags); + u32 tev_stage_num = (i_flags >> 0x10) & 0x1f; + if (stages > tev_stage_num) { + tev_stage_num = stages; + } + u32 tex_gens = countTexGens(i_flags); + u32 tex_gen_flag = tex_gens > 4 ? + getMdlDataFlag_TexGenFlag(0) : getMdlDataFlag_TexGenFlag(i_flags); + u32 color_block_flag = getMdlDataFlag_ColorFlag(i_flags); + u32 pe_flag = getMdlDataFlag_PEFlag(i_flags); + u32 ind_flag = (i_flags >> 0x18) & 1; + if (i_material == NULL) { + size = sizeof(J3DMaterial); + } + size += J3DMaterial::calcSizeColorBlock(color_block_flag); + size += J3DMaterial::calcSizeTexGenBlock(tex_gen_flag); + size += J3DMaterial::calcSizeTevBlock((u16)tev_stage_num); + size += J3DMaterial::calcSizeIndBlock(ind_flag); + size += J3DMaterial::calcSizePEBlock(pe_flag, getMaterialMode(i_idx)); + J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + for (int i = 0; i < 8; i++) { + if (init_data->mTexMtxIdx[i] != 0xffff) { + size += sizeof(J3DTexMtx); + } + } + return size; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm u32 J3DMaterialFactory::calcSizeNormalMaterial(J3DMaterial* param_0, int param_1, u32 param_2) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/calcSizeNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s" } #pragma pop +#endif /* 80331C30-80331D00 32C570 00D0+00 1/1 0/0 0/0 .text * calcSizePatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial* param_0, int param_1, +#ifdef NONMATCHING +u32 J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial* i_material, int i_idx, + u32 i_flags) const { + u32 size = 0; + if (i_material == NULL) { + size = sizeof(J3DPatchedMaterial); + } + int ind_flag = (i_flags & 0x3000000) != 0; + size += J3DMaterial::calcSizeColorBlock(0x40000000); + size += 0x134; // TODO what is this + size += J3DMaterial::calcSizeIndBlock(ind_flag); + size += J3DMaterial::calcSizePEBlock(0x10000000, getMaterialMode(i_idx)); + J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + for (int i = 0; i < 8; i++) { + if (init_data->mTexMtxIdx[i] != 0xffff) { + size += sizeof(J3DTexMtx); + } + } + return size; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm u32 J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial* param_0, int param_1, u32 param_2) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/calcSizePatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s" } #pragma pop +#endif /* 80331D00-80331D18 32C640 0018+00 2/2 0/0 0/0 .text * calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::calcSizeLockedMaterial(J3DMaterial* param_0, int param_1, - u32 param_2) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s" +u32 J3DMaterialFactory::calcSizeLockedMaterial(J3DMaterial* i_material, int i_idx, + u32 i_flags) const { + u32 size = 0; + if (i_material == NULL) { + size = sizeof(J3DLockedMaterial) + sizeof(J3DColorBlockNull) + sizeof(J3DTexGenBlockNull) + + sizeof(J3DTevBlockNull) + sizeof(J3DIndBlockNull) + sizeof(J3DPEBlockNull); + } + return size + sizeof(J3DDisplayListObj); } -#pragma pop -/* ############################################################################################## */ /* 804564A8-804564AC 004AA8 0004+00 1/1 0/0 0/0 .sdata2 @1691 */ +#ifdef NONMATCHING +static GXColor const defaultMatColor = {0xff, 0xff, 0xff, 0xff}; +#else SECTION_SDATA2 static u32 lit_1691 = 0xFFFFFFFF; +#endif /* 80331D18-80331D74 32C658 005C+00 2/2 0/0 0/0 .text newMatColor__18J3DMaterialFactoryCFii */ +#ifdef NONMATCHING +J3DGXColor J3DMaterialFactory::newMatColor(int i_idx, int i_no) const { + J3DGXColor dflt = defaultMatColor; + u16 mat_color_index = mpMaterialInitData[mpMaterialID[i_idx]].mMatColorIdx[i_no]; + if (mat_color_index != 0xffff) { + return mpMatColor[mat_color_index]; + } else { + return dflt; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::newMatColor(int param_0, int param_1) const { +asm J3DGXColor J3DMaterialFactory::newMatColor(int param_0, int param_1) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newMatColor__18J3DMaterialFactoryCFii.s" } #pragma pop +#endif /* 80331D74-80331DAC 32C6B4 0038+00 2/2 0/0 0/0 .text newColorChanNum__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newColorChanNum(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newColorChanNum__18J3DMaterialFactoryCFi.s" +u8 J3DMaterialFactory::newColorChanNum(int i_idx) const { + u8 color_chan_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mColorChanNumIdx; + if (color_chan_num_index != 0xff) { + return mpColorChanNum[color_chan_num_index]; + } else { + return 0; + } } -#pragma pop /* 80331DAC-80331F50 32C6EC 01A4+00 2/2 0/0 0/0 .text newColorChan__18J3DMaterialFactoryCFii */ +#ifdef NONMATCHING +// problem with J3DColorChan inline constructor +J3DColorChan J3DMaterialFactory::newColorChan(int i_idx, int i_no) const { + u16 color_chan_index = mpMaterialInitData[mpMaterialID[i_idx]].mColorChanIdx[i_no]; + if (color_chan_index != 0xffff) { + return J3DColorChan(mpColorChanInfo[color_chan_index]); + } else { + return J3DColorChan(); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::newColorChan(int param_0, int param_1) const { +asm J3DColorChan J3DMaterialFactory::newColorChan(int param_0, int param_1) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newColorChan__18J3DMaterialFactoryCFii.s" } #pragma pop +#endif -/* ############################################################################################## */ /* 804564AC-804564B0 004AAC 0004+00 1/1 0/0 0/0 .sdata2 @1798 */ +#ifdef NONMATCHING +static GXColor const defaultAmbColor = {0x32, 0x32, 0x32, 0x32}; +#else SECTION_SDATA2 static u32 lit_1798 = 0x32323232; +#endif /* 80331F50-80331FAC 32C890 005C+00 1/1 0/0 0/0 .text newAmbColor__18J3DMaterialFactoryCFii */ +#ifdef NONMATCHING +J3DGXColor J3DMaterialFactory::newAmbColor(int i_idx, int i_no) const { + J3DGXColor dflt = defaultAmbColor; + u16 amb_color_index = mpMaterialInitData[mpMaterialID[i_idx]].mAmbColorIdx[i_no]; + if (amb_color_index != 0xffff) { + return mpAmbColor[amb_color_index]; + } else { + return dflt; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::newAmbColor(int param_0, int param_1) const { +asm J3DGXColor J3DMaterialFactory::newAmbColor(int param_0, int param_1) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newAmbColor__18J3DMaterialFactoryCFii.s" } #pragma pop +#endif /* 80331FAC-80331FE4 32C8EC 0038+00 2/2 0/0 0/0 .text newTexGenNum__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newTexGenNum(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexGenNum__18J3DMaterialFactoryCFi.s" +u32 J3DMaterialFactory::newTexGenNum(int i_idx) const { + u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx; + if (tex_gen_num_index != 0xff) { + return mpTexGenNum[tex_gen_num_index]; + } else { + return 0; + } } -#pragma pop /* 80331FE4-80332044 32C924 0060+00 3/3 0/0 0/0 .text newTexCoord__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newTexCoord(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexCoord__18J3DMaterialFactoryCFii.s" +J3DTexCoord J3DMaterialFactory::newTexCoord(int i_idx, int i_no) const { + u16 tex_coord_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexCoordIdx[i_no]; + if (tex_coord_index != 0xffff) { + return J3DTexCoord(mpTexCoordInfo[tex_coord_index]); + } else { + return J3DTexCoord(); + } } -#pragma pop /* 80332044-803320CC 32C984 0088+00 2/2 0/0 0/0 .text newTexMtx__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newTexMtx(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexMtx__18J3DMaterialFactoryCFii.s" +J3DTexMtx* J3DMaterialFactory::newTexMtx(int i_idx, int i_no) const { + J3DTexMtx* tex_mtx = NULL; + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mTexMtxIdx[i_no] != 0xffff) { + tex_mtx = new J3DTexMtx(mpTexMtxInfo[mtl_init_data->mTexMtxIdx[i_no]]); + } + return tex_mtx; } -#pragma pop /* 803320CC-8033210C 32CA0C 0040+00 2/2 0/0 0/0 .text newCullMode__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newCullMode(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newCullMode__18J3DMaterialFactoryCFi.s" +u8 J3DMaterialFactory::newCullMode(int i_idx) const { + u8 cull_mode_index = mpMaterialInitData[mpMaterialID[i_idx]].mCullModeIdx; + if (cull_mode_index != 0xff) { + return mpCullMode[cull_mode_index]; + } else { + return 0xff; + } } -#pragma pop /* 8033210C-80332154 32CA4C 0048+00 2/2 0/0 0/0 .text newTexNo__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newTexNo(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTexNo__18J3DMaterialFactoryCFii.s" +u16 J3DMaterialFactory::newTexNo(int i_idx, int i_no) const { + u16 tex_no_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexNoIdx[i_no]; + if (tex_no_index != 0xffff) { + return mpTexNo[tex_no_index]; + } else { + return 0xffff; + } } -#pragma pop /* 80332154-803321A0 32CA94 004C+00 2/2 0/0 0/0 .text newTevOrder__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newTevOrder(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevOrder__18J3DMaterialFactoryCFii.s" +J3DTevOrder J3DMaterialFactory::newTevOrder(int i_idx, int i_no) const { + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mTevOrderIdx[i_no] != 0xffff) { + return J3DTevOrder(mpTevOrderInfo[mtl_init_data->mTevOrderIdx[i_no]]); + } else { + return J3DTevOrder(); + } } -#pragma pop -/* ############################################################################################## */ /* 80456BB8-80456BBC 000058 0004+00 1/1 0/0 0/0 .sbss2 @1897 */ -SECTION_SBSS2 static u8 lit_1897[4]; - -/* 80456BBC-80456BC0 00005C 0004+00 1/1 0/0 0/0 .sbss2 None */ -SECTION_SBSS2 static u8 data_80456BBC[4]; +SECTION_SBSS2 static GXColorS10 defaultTevColor; /* 803321A0-80332210 32CAE0 0070+00 2/2 0/0 0/0 .text newTevColor__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newTevColor(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevColor__18J3DMaterialFactoryCFii.s" +J3DGXColorS10 J3DMaterialFactory::newTevColor(int i_idx, int i_no) const { + J3DGXColorS10 dflt = defaultTevColor; + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mTevColorIdx[i_no] != 0xffff) { + return mpTevColor[mtl_init_data->mTevColorIdx[i_no]]; + } else { + return dflt; + } } -#pragma pop -/* ############################################################################################## */ /* 804564B0-804564B8 004AB0 0004+04 1/1 0/0 0/0 .sdata2 @1915 */ +#ifdef NONMATCHING +static GXColor const defaultTevKColor = {0xff, 0xff, 0xff, 0xff}; +#else SECTION_SDATA2 static u32 lit_1915[1 + 1 /* padding */] = { 0xFFFFFFFF, /* padding */ 0x00000000, }; +#endif /* 80332210-8033226C 32CB50 005C+00 2/2 0/0 0/0 .text newTevKColor__18J3DMaterialFactoryCFii */ +#ifdef NONMATCHING +J3DGXColor J3DMaterialFactory::newTevKColor(int i_idx, int i_no) const { + J3DGXColor dflt = defaultTevKColor; + u16 tev_kcolor_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevKColorIdx[i_no]; + if (tev_kcolor_index != 0xffff) { + return mpTevKColor[tev_kcolor_index]; + } else { + return dflt; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::newTevKColor(int param_0, int param_1) const { +asm J3DGXColor J3DMaterialFactory::newTevKColor(int param_0, int param_1) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevKColor__18J3DMaterialFactoryCFii.s" } #pragma pop +#endif /* 8033226C-803322A4 32CBAC 0038+00 2/2 0/0 0/0 .text newTevStageNum__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newTevStageNum(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevStageNum__18J3DMaterialFactoryCFi.s" +u8 J3DMaterialFactory::newTevStageNum(int i_idx) const { + u8 tev_stage_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageNumIdx; + if (tev_stage_num_index != 0xff) { + return mpTevStageNum[tev_stage_num_index]; + } else { + return 0xff; + } } -#pragma pop /* 803322A4-80332304 32CBE4 0060+00 2/2 0/0 0/0 .text newTevStage__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newTevStage(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevStage__18J3DMaterialFactoryCFii.s" +J3DTevStage J3DMaterialFactory::newTevStage(int i_idx, int i_no) const { + u16 tev_stage_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageIdx[i_no]; + if (tev_stage_index != 0xffff) { + return J3DTevStage(mpTevStageInfo[tev_stage_index]); + } else { + return J3DTevStage(); + } } -#pragma pop /* 80332304-803323A0 32CC44 009C+00 1/1 0/0 0/0 .text * newTevSwapModeTable__18J3DMaterialFactoryCFii */ +#ifdef NONMATCHING +// J3DTevSwapModeTable inline constructor matches in the first usage but not the second +J3DTevSwapModeTable J3DMaterialFactory::newTevSwapModeTable(int i_idx, int i_no) const { + u16 tev_swap_mode_table_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevSwapModeTableIdx[i_no]; + if (tev_swap_mode_table_index != 0xffff) { + return J3DTevSwapModeTable(mpTevSwapModeTableInfo[tev_swap_mode_table_index]); + } else { + return J3DTevSwapModeTable(j3dDefaultTevSwapModeTable); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::newTevSwapModeTable(int param_0, int param_1) const { +asm J3DTevSwapModeTable J3DMaterialFactory::newTevSwapModeTable(int param_0, int param_1) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevSwapModeTable__18J3DMaterialFactoryCFii.s" } #pragma pop +#endif /* 803323A0-803323C8 32CCE0 0028+00 2/2 0/0 0/0 .text newIndTexStageNum__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newIndTexStageNum(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexStageNum__18J3DMaterialFactoryCFi.s" +u8 J3DMaterialFactory::newIndTexStageNum(int i_idx) const { + if (mpIndInitData[i_idx].mEnabled == true) { + return mpIndInitData[i_idx].mIndTexStageNum; + } else { + return 0; + } } -#pragma pop /* 803323C8-8033240C 32CD08 0044+00 2/2 0/0 0/0 .text newIndTexOrder__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newIndTexOrder(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexOrder__18J3DMaterialFactoryCFii.s" +J3DIndTexOrder J3DMaterialFactory::newIndTexOrder(int i_idx, int i_no) const { + J3DIndTexOrder dflt; + if (mpIndInitData[i_idx].mEnabled == true) { + return J3DIndTexOrder(mpIndInitData[i_idx].mIndTexOrderInfo[i_no]); + } else { + return dflt; + } } -#pragma pop /* 8033240C-803324B4 32CD4C 00A8+00 2/2 0/0 0/0 .text newIndTexMtx__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newIndTexMtx(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexMtx__18J3DMaterialFactoryCFii.s" +J3DIndTexMtx J3DMaterialFactory::newIndTexMtx(int i_idx, int i_no) const { + J3DIndTexMtx dflt; + if (mpIndInitData[i_idx].mEnabled == true) { + return J3DIndTexMtx(mpIndInitData[i_idx].mIndTexMtxInfo[i_no]); + } else { + return dflt; + } } -#pragma pop /* 803324B4-80332648 32CDF4 0194+00 2/2 0/0 0/0 .text newIndTevStage__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newIndTevStage(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTevStage__18J3DMaterialFactoryCFii.s" +J3DIndTevStage J3DMaterialFactory::newIndTevStage(int i_idx, int i_no) const { + J3DIndTevStage dflt; + if (mpIndInitData[i_idx].mEnabled == true) { + return J3DIndTevStage(mpIndInitData[i_idx].mIndTevStageInfo[i_no]); + } else { + return dflt; + } } -#pragma pop /* 80332648-8033268C 32CF88 0044+00 2/2 0/0 0/0 .text * newIndTexCoordScale__18J3DMaterialFactoryCFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newIndTexCoordScale(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newIndTexCoordScale__18J3DMaterialFactoryCFii.s" +J3DIndTexCoordScale J3DMaterialFactory::newIndTexCoordScale(int i_idx, int i_no) const { + J3DIndTexCoordScale dflt; + if (mpIndInitData[i_idx].mEnabled == true) { + return J3DIndTexCoordScale(mpIndInitData[i_idx].mIndTexCoordScaleInfo[i_no]); + } else { + return dflt; + } } -#pragma pop /* 8033268C-80332768 32CFCC 00DC+00 2/2 0/0 0/0 .text newFog__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newFog(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newFog__18J3DMaterialFactoryCFi.s" +J3DFog J3DMaterialFactory::newFog(int i_idx) const { + J3DFog fog; + u16 fog_index = mpMaterialInitData[mpMaterialID[i_idx]].mFogIdx; + if (fog_index != 0xffff) { + fog.setFogInfo(mpFogInfo[fog_index]); + } + return fog; } -#pragma pop /* 80332768-803327E8 32D0A8 0080+00 2/2 0/0 0/0 .text newAlphaComp__18J3DMaterialFactoryCFi */ +#ifdef NONMATCHING +// weird issue with calcAlphaCmpID, see J3DMatBlock.h +J3DAlphaComp J3DMaterialFactory::newAlphaComp(int i_idx) const { + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mAlphaCompIdx != 0xffff) { + return J3DAlphaComp(mpAlphaCompInfo[mtl_init_data->mAlphaCompIdx]); + } else { + return J3DAlphaComp(0xffff); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DMaterialFactory::newAlphaComp(int param_0) const { +asm J3DAlphaComp J3DMaterialFactory::newAlphaComp(int param_0) const { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newAlphaComp__18J3DMaterialFactoryCFi.s" } #pragma pop +#endif /* 803327E8-8033282C 32D128 0044+00 2/2 0/0 0/0 .text newBlend__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newBlend(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newBlend__18J3DMaterialFactoryCFi.s" +J3DBlend J3DMaterialFactory::newBlend(int i_idx) const { + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mBlendIdx != 0xffff) { + return J3DBlend(mpBlendInfo[mtl_init_data->mBlendIdx]); + } else { + return J3DBlend(j3dDefaultBlendInfo); + } } -#pragma pop /* 8033282C-8033288C 32D16C 0060+00 2/2 0/0 0/0 .text newZMode__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newZMode(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newZMode__18J3DMaterialFactoryCFi.s" +J3DZMode J3DMaterialFactory::newZMode(int i_idx) const { + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mZModeIdx != 0xff) { + return J3DZMode(mpZModeInfo[mtl_init_data->mZModeIdx]); + } else { + return J3DZMode(); + } } -#pragma pop /* 8033288C-803328C4 32D1CC 0038+00 2/2 0/0 0/0 .text newZCompLoc__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newZCompLoc(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newZCompLoc__18J3DMaterialFactoryCFi.s" +u8 J3DMaterialFactory::newZCompLoc(int i_idx) const { + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mZCompLocIdx != 0xff){ + return mpZCompLoc[mtl_init_data->mZCompLocIdx]; + } else { + return 0; + } } -#pragma pop /* 803328C4-803328FC 32D204 0038+00 2/2 0/0 0/0 .text newDither__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newDither(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newDither__18J3DMaterialFactoryCFi.s" +u8 J3DMaterialFactory::newDither(int i_idx) const { + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mDitherIdx != 0xff){ + return mpDither[mtl_init_data->mDitherIdx]; + } else { + return 1; + } } -#pragma pop /* 803328FC-803329A0 32D23C 00A4+00 1/1 0/0 0/0 .text newNBTScale__18J3DMaterialFactoryCFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory::newNBTScale(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newNBTScale__18J3DMaterialFactoryCFi.s" +J3DNBTScale J3DMaterialFactory::newNBTScale(int i_idx) const { + J3DNBTScale dflt(j3dDefaultNBTScaleInfo); + J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mNBTScaleIdx != 0xffff) { + return J3DNBTScale(mpNBTScaleInfo[mtl_init_data->mNBTScaleIdx]); + } else { + return dflt; + } } -#pragma pop /* 803329A0-803329A4 32D2E0 0004+00 1/0 0/0 0/0 .text load__14J3DPEBlockNullFv */ -void J3DPEBlockNull::load() { +// void J3DPEBlockNull::load() { +extern "C" void load__14J3DPEBlockNullFv() { /* empty function */ } @@ -1198,7 +1287,8 @@ void J3DPEBlockNull::load() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DPEBlockNull::getType() { +// asm u32 J3DPEBlockNull::getType() { +extern "C" asm void getType__14J3DPEBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/getType__14J3DPEBlockNullFv.s" } @@ -1208,19 +1298,22 @@ asm void J3DPEBlockNull::getType() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DPEBlockNull::~J3DPEBlockNull() { +// asm J3DPEBlockNull::~J3DPEBlockNull() { +extern "C" asm void __dt__14J3DPEBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__14J3DPEBlockNullFv.s" } #pragma pop /* 80332A0C-80332A10 32D34C 0004+00 1/0 0/0 0/0 .text reset__15J3DTevBlockNullFP11J3DTevBlock */ -void J3DTevBlockNull::reset(J3DTevBlock* param_0) { +// void J3DTevBlockNull::reset(J3DTevBlock* param_0) { +extern "C" void reset__15J3DTevBlockNullFP11J3DTevBlock() { /* empty function */ } /* 80332A10-80332A14 32D350 0004+00 1/0 0/0 0/0 .text ptrToIndex__15J3DTevBlockNullFv */ -void J3DTevBlockNull::ptrToIndex() { +// void J3DTevBlockNull::ptrToIndex() { +extern "C" void ptrToIndex__15J3DTevBlockNullFv() { /* empty function */ } @@ -1228,7 +1321,8 @@ void J3DTevBlockNull::ptrToIndex() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DTevBlockNull::indexToPtr() { +// asm void J3DTevBlockNull::indexToPtr() { +extern "C" asm void indexToPtr__15J3DTevBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/indexToPtr__15J3DTevBlockNullFv.s" } @@ -1238,7 +1332,8 @@ asm void J3DTevBlockNull::indexToPtr() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DTevBlockNull::getType() { +// asm u32 J3DTevBlockNull::getType() { +extern "C" asm void getType__15J3DTevBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/getType__15J3DTevBlockNullFv.s" } @@ -1248,7 +1343,8 @@ asm void J3DTevBlockNull::getType() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DTevBlockNull::~J3DTevBlockNull() { +// asm J3DTevBlockNull::~J3DTevBlockNull() { +extern "C" asm void __dt__15J3DTevBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__15J3DTevBlockNullFv.s" } @@ -1256,52 +1352,61 @@ asm J3DTevBlockNull::~J3DTevBlockNull() { /* 80332AA0-80332AA4 32D3E0 0004+00 1/0 0/0 0/0 .text calc__18J3DTexGenBlockNullFPA4_Cf */ -void J3DTexGenBlockNull::calc(f32 const (*param_0)[4]) { +// void J3DTexGenBlockNull::calc(f32 const (*param_0)[4]) { +extern "C" void calc__18J3DTexGenBlockNullFPA4_Cf() { /* empty function */ } /* 80332AA4-80332AA8 32D3E4 0004+00 1/0 0/0 0/0 .text * calcWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf */ -void J3DTexGenBlockNull::calcWithoutViewMtx(f32 const (*param_0)[4]) { +// void J3DTexGenBlockNull::calcWithoutViewMtx(f32 const (*param_0)[4]) { +extern "C" void calcWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf() { /* empty function */ } /* 80332AA8-80332AAC 32D3E8 0004+00 1/0 0/0 0/0 .text calcPostTexMtx__18J3DTexGenBlockNullFPA4_Cf */ -void J3DTexGenBlockNull::calcPostTexMtx(f32 const (*param_0)[4]) { +// void J3DTexGenBlockNull::calcPostTexMtx(f32 const (*param_0)[4]) { +extern "C" void calcPostTexMtx__18J3DTexGenBlockNullFPA4_Cf() { /* empty function */ } /* 80332AAC-80332AB0 32D3EC 0004+00 1/0 0/0 0/0 .text * calcPostTexMtxWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf */ -void J3DTexGenBlockNull::calcPostTexMtxWithoutViewMtx(f32 const (*param_0)[4]) { +// void J3DTexGenBlockNull::calcPostTexMtxWithoutViewMtx(f32 const (*param_0)[4]) { +extern "C" void calcPostTexMtxWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf() { /* empty function */ } /* 80332AB0-80332AB4 32D3F0 0004+00 1/0 0/0 0/0 .text load__18J3DTexGenBlockNullFv */ -void J3DTexGenBlockNull::load() { +// void J3DTexGenBlockNull::load() { +extern "C" void load__18J3DTexGenBlockNullFv() { /* empty function */ } /* 80332AB4-80332AB8 32D3F4 0004+00 1/0 0/0 0/0 .text patch__18J3DTexGenBlockNullFv */ -void J3DTexGenBlockNull::patch() { +// void J3DTexGenBlockNull::patch() { +extern "C" void patch__18J3DTexGenBlockNullFv() { /* empty function */ } /* 80332AB8-80332ABC 32D3F8 0004+00 1/0 0/0 0/0 .text diff__18J3DTexGenBlockNullFUl */ -void J3DTexGenBlockNull::diff(u32 param_0) { +// void J3DTexGenBlockNull::diff(u32 param_0) { +extern "C" void diff__18J3DTexGenBlockNullFUl() { /* empty function */ } /* 80332ABC-80332AC0 32D3FC 0004+00 1/0 0/0 0/0 .text diffTexMtx__18J3DTexGenBlockNullFv */ -void J3DTexGenBlockNull::diffTexMtx() { +// void J3DTexGenBlockNull::diffTexMtx() { +extern "C" void diffTexMtx__18J3DTexGenBlockNullFv() { /* empty function */ } /* 80332AC0-80332AC4 32D400 0004+00 1/0 0/0 0/0 .text diffTexGen__18J3DTexGenBlockNullFv */ -void J3DTexGenBlockNull::diffTexGen() { +// void J3DTexGenBlockNull::diffTexGen() { +extern "C" void diffTexGen__18J3DTexGenBlockNullFv() { /* empty function */ } @@ -1309,7 +1414,8 @@ void J3DTexGenBlockNull::diffTexGen() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DTexGenBlockNull::getType() { +// asm u32 J3DTexGenBlockNull::getType() { +extern "C" asm void getType__18J3DTexGenBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/getType__18J3DTexGenBlockNullFv.s" } @@ -1319,7 +1425,8 @@ asm void J3DTexGenBlockNull::getType() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DTexGenBlockNull::~J3DTexGenBlockNull() { +// asm J3DTexGenBlockNull::~J3DTexGenBlockNull() { +extern "C" asm void __dt__18J3DTexGenBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__18J3DTexGenBlockNullFv.s" } @@ -1329,7 +1436,8 @@ asm J3DTexGenBlockNull::~J3DTexGenBlockNull() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void J3DColorBlockNull::getType() { +// asm u32 J3DColorBlockNull::getType() { +extern "C" asm void getType__17J3DColorBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/getType__17J3DColorBlockNullFv.s" } @@ -1339,7 +1447,8 @@ asm void J3DColorBlockNull::getType() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DColorBlockNull::~J3DColorBlockNull() { +// asm J3DColorBlockNull::~J3DColorBlockNull() { +extern "C" asm void __dt__17J3DColorBlockNullFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__17J3DColorBlockNullFv.s" } @@ -1349,217 +1458,9 @@ asm J3DColorBlockNull::~J3DColorBlockNull() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DMaterial::~J3DMaterial() { +// asm J3DMaterial::~J3DMaterial() { +extern "C" asm void __dt__11J3DMaterialFv() { nofralloc #include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__11J3DMaterialFv.s" } #pragma pop - -/* 80332BDC-80332BF4 32D51C 0018+00 1/1 0/0 0/0 .text - * JSUConvertOffsetToPtr<17J3DCurrentMtxInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332BDC(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332BDC.s" -} -#pragma pop - -/* 80332BF4-80332C0C 32D534 0018+00 1/1 0/0 0/0 .text - * JSUConvertOffsetToPtr<15J3DPatchingInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332BF4(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332BF4.s" -} -#pragma pop - -/* 80332C0C-80332C24 32D54C 0018+00 1/1 0/0 0/0 .text - * JSUConvertOffsetToPtr<18J3DDisplayListInit>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332C0C(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C0C.s" -} -#pragma pop - -/* 80332C24-80332C3C 32D564 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<15J3DNBTScaleInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332C24(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C24.s" -} -#pragma pop - -/* 80332C3C-80332C54 32D57C 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<12J3DZModeInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332C3C(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C3C.s" -} -#pragma pop - -/* 80332C54-80332C6C 32D594 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<12J3DBlendInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332C54(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C54.s" -} -#pragma pop - -/* 80332C6C-80332C84 32D5AC 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<16J3DAlphaCompInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332C6C(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C6C.s" -} -#pragma pop - -/* 80332C84-80332C9C 32D5C4 0018+00 1/1 1/1 0/0 .text JSUConvertOffsetToPtr<10J3DFogInfo>__FPCvPCv - */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332C84(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C84.s" -} -#pragma pop - -/* 80332C9C-80332CB4 32D5DC 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<23J3DTevSwapModeTableInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332C9C(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332C9C.s" -} -#pragma pop - -/* 80332CB4-80332CCC 32D5F4 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<18J3DTevSwapModeInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332CB4(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CB4.s" -} -#pragma pop - -/* 80332CCC-80332CE4 32D60C 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<15J3DTevStageInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332CCC(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CCC.s" -} -#pragma pop - -/* 80332CE4-80332CFC 32D624 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<15J3DTevOrderInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332CE4(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CE4.s" -} -#pragma pop - -/* 80332CFC-80332D14 32D63C 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<13J3DTexMtxInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332CFC(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332CFC.s" -} -#pragma pop - -/* 80332D14-80332D2C 32D654 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<16J3DTexCoord2Info>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332D14(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D14.s" -} -#pragma pop - -/* 80332D2C-80332D44 32D66C 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<15J3DTexCoordInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332D2C(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D2C.s" -} -#pragma pop - -/* 80332D44-80332D5C 32D684 0018+00 1/1 0/0 0/0 .text - * JSUConvertOffsetToPtr<12J3DLightInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332D44(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D44.s" -} -#pragma pop - -/* 80332D5C-80332D74 32D69C 0018+00 1/1 1/1 0/0 .text - * JSUConvertOffsetToPtr<16J3DColorChanInfo>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332D5C(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D5C.s" -} -#pragma pop - -/* 80332D74-80332D8C 32D6B4 0018+00 1/1 0/0 0/0 .text - * JSUConvertOffsetToPtr<14J3DIndInitData>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332D74(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D74.s" -} -#pragma pop - -/* 80332D8C-80332DA4 32D6CC 0018+00 1/1 0/0 0/0 .text - * JSUConvertOffsetToPtr<19J3DMaterialInitData>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80332D8C(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/func_80332D8C.s" -} -#pragma pop diff --git a/libs/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp b/libs/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp index 06dac95a98d..bbb24e16813 100644 --- a/libs/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp +++ b/libs/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp @@ -1,413 +1,409 @@ -// -// Generated By: dol2asm -// Translation Unit: J3DMaterialFactory_v21 -// - -#include "JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h" -#include "dol2asm.h" - -// -// Types: -// - -struct J3DTexMtxInfo { - /* 80325718 */ void operator=(J3DTexMtxInfo const&); -}; - -struct J3DTevStageInfo {}; - -struct J3DTevStage { - /* 8000E230 */ J3DTevStage(); - /* 8003AACC */ J3DTevStage(J3DTevStageInfo const&); -}; - -struct J3DMaterial { - /* 803157A0 */ void createColorBlock(u32); - /* 803159A0 */ void createTexGenBlock(u32); - /* 80315B04 */ void createTevBlock(int); - /* 80315E78 */ void createIndBlock(int); - /* 80315F60 */ void createPEBlock(u32, u32); - /* 80316240 */ void initialize(); -}; - -struct J3DFogInfo { - /* 80325800 */ void operator=(J3DFogInfo const&); -}; - -// -// Forward References: -// - -extern "C" void __ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21(); -extern "C" void countUniqueMaterials__22J3DMaterialFactory_v21Fv(); -extern "C" void countTexGens__22J3DMaterialFactory_v21CFi(); -extern "C" void countStages__22J3DMaterialFactory_v21CFi(); -extern "C" void create__22J3DMaterialFactory_v21CFP11J3DMaterialiUl(); -extern "C" void newMatColor__22J3DMaterialFactory_v21CFii(); -extern "C" void newColorChanNum__22J3DMaterialFactory_v21CFi(); -extern "C" void newColorChan__22J3DMaterialFactory_v21CFii(); -extern "C" void newTexGenNum__22J3DMaterialFactory_v21CFi(); -extern "C" void newTexCoord__22J3DMaterialFactory_v21CFii(); -extern "C" void newTexMtx__22J3DMaterialFactory_v21CFii(); -extern "C" void newCullMode__22J3DMaterialFactory_v21CFi(); -extern "C" void newTexNo__22J3DMaterialFactory_v21CFii(); -extern "C" void newTevOrder__22J3DMaterialFactory_v21CFii(); -extern "C" void newTevColor__22J3DMaterialFactory_v21CFii(); -extern "C" void newTevKColor__22J3DMaterialFactory_v21CFii(); -extern "C" void newTevStageNum__22J3DMaterialFactory_v21CFi(); -extern "C" void newTevStage__22J3DMaterialFactory_v21CFii(); -extern "C" void newTevSwapModeTable__22J3DMaterialFactory_v21CFii(); -extern "C" void newFog__22J3DMaterialFactory_v21CFi(); -extern "C" void newAlphaComp__22J3DMaterialFactory_v21CFi(); -extern "C" void newBlend__22J3DMaterialFactory_v21CFi(); -extern "C" void newZMode__22J3DMaterialFactory_v21CFi(); -extern "C" void newZCompLoc__22J3DMaterialFactory_v21CFi(); -extern "C" void newDither__22J3DMaterialFactory_v21CFi(); -extern "C" void newNBTScale__22J3DMaterialFactory_v21CFi(); -extern "C" void func_80334118(void* _this, void const*, void const*); - -// -// External References: -// - -extern "C" void __ct__11J3DTevStageFv(); -extern "C" void __ct__11J3DTevStageFRC15J3DTevStageInfo(); -extern "C" void* __nw__FUl(); -extern "C" void func_802F41E8(void* _this, void const*, void const*); -extern "C" void func_802F4260(void* _this, void const*, void const*); -extern "C" void func_802F4278(void* _this, void const*, void const*); -extern "C" void func_802F4290(void* _this, void const*, void const*); -extern "C" void func_802F42C0(void* _this, void const*, void const*); -extern "C" void createColorBlock__11J3DMaterialFUl(); -extern "C" void createTexGenBlock__11J3DMaterialFUl(); -extern "C" void createTevBlock__11J3DMaterialFi(); -extern "C" void createIndBlock__11J3DMaterialFi(); -extern "C" void createPEBlock__11J3DMaterialFUlUl(); -extern "C" void initialize__11J3DMaterialFv(); -extern "C" void __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo(); -extern "C" void __as__10J3DFogInfoFRC10J3DFogInfo(); -extern "C" void func_80332C24(void* _this, void const*, void const*); -extern "C" void func_80332C3C(void* _this, void const*, void const*); -extern "C" void func_80332C54(void* _this, void const*, void const*); -extern "C" void func_80332C6C(void* _this, void const*, void const*); -extern "C" void func_80332C84(void* _this, void const*, void const*); -extern "C" void func_80332C9C(void* _this, void const*, void const*); -extern "C" void func_80332CB4(void* _this, void const*, void const*); -extern "C" void func_80332CCC(void* _this, void const*, void const*); -extern "C" void func_80332CE4(void* _this, void const*, void const*); -extern "C" void func_80332CFC(void* _this, void const*, void const*); -extern "C" void func_80332D14(void* _this, void const*, void const*); -extern "C" void func_80332D2C(void* _this, void const*, void const*); -extern "C" void func_80332D5C(void* _this, void const*, void const*); -extern "C" void _savegpr_19(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_19(); -extern "C" void _restgpr_29(); -extern "C" extern u8 const j3dDefaultTexCoordInfo[32]; -extern "C" extern u8 const j3dDefaultFogInfo[44]; -extern "C" extern u8 const j3dDefaultNBTScaleInfo[16]; -extern "C" extern void* __vt__11J3DMaterial[12]; -extern "C" extern u32 j3dDefaultTevOrderInfoNull; -extern "C" extern u32 j3dDefaultTevSwapModeTable; -extern "C" extern u32 j3dDefaultBlendInfo; -extern "C" extern u8 j3dDefaultColorChanInfo[8]; -extern "C" extern u16 j3dDefaultZModeID[1 + 1 /* padding */]; - -// -// Declarations: -// - -/* 80332DA4-80332F84 32D6E4 01E0+00 0/0 2/2 0/0 .text - * __ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21 */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm J3DMaterialFactory_v21::J3DMaterialFactory_v21(J3DMaterialBlock_v21 const& param_0) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/__ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21.s" -} -#pragma pop - -/* 80332F84-80332FA8 32D8C4 0024+00 0/0 1/1 0/0 .text - * countUniqueMaterials__22J3DMaterialFactory_v21Fv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm u16 J3DMaterialFactory_v21::countUniqueMaterials() { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countUniqueMaterials__22J3DMaterialFactory_v21Fv.s" -} -#pragma pop - -/* 80332FA8-80332FE0 32D8E8 0038+00 1/1 0/0 0/0 .text countTexGens__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::countTexGens(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countTexGens__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80332FE0-80333068 32D920 0088+00 1/1 0/0 0/0 .text countStages__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::countStages(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/countStages__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80333068-803337D8 32D9A8 0770+00 0/0 2/2 0/0 .text - * create__22J3DMaterialFactory_v21CFP11J3DMaterialiUl */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -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" -} -#pragma pop - -/* ############################################################################################## */ -/* 804564B8-804564BC 004AB8 0004+00 1/1 0/0 0/0 .sdata2 @1130 */ -SECTION_SDATA2 static u32 lit_1130 = 0xFFFFFFFF; - -/* 803337D8-80333834 32E118 005C+00 1/1 0/0 0/0 .text newMatColor__22J3DMaterialFactory_v21CFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newMatColor(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newMatColor__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* 80333834-8033386C 32E174 0038+00 1/1 0/0 0/0 .text newColorChanNum__22J3DMaterialFactory_v21CFi - */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newColorChanNum(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newColorChanNum__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 8033386C-80333A10 32E1AC 01A4+00 1/1 0/0 0/0 .text newColorChan__22J3DMaterialFactory_v21CFii - */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newColorChan(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newColorChan__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* 80333A10-80333A48 32E350 0038+00 1/1 0/0 0/0 .text newTexGenNum__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTexGenNum(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexGenNum__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80333A48-80333AA8 32E388 0060+00 1/1 0/0 0/0 .text newTexCoord__22J3DMaterialFactory_v21CFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTexCoord(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexCoord__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* 80333AA8-80333B30 32E3E8 0088+00 1/1 0/0 0/0 .text newTexMtx__22J3DMaterialFactory_v21CFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTexMtx(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexMtx__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* 80333B30-80333B70 32E470 0040+00 1/1 0/0 0/0 .text newCullMode__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newCullMode(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newCullMode__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80333B70-80333BB8 32E4B0 0048+00 1/1 0/0 0/0 .text newTexNo__22J3DMaterialFactory_v21CFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTexNo(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTexNo__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* 80333BB8-80333C04 32E4F8 004C+00 1/1 0/0 0/0 .text newTevOrder__22J3DMaterialFactory_v21CFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTevOrder(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevOrder__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* ############################################################################################## */ -/* 80456BC0-80456BC4 000060 0004+00 1/1 0/0 0/0 .sbss2 @1299 */ -SECTION_SBSS2 static u8 lit_1299[4]; - -/* 80456BC4-80456BC8 000064 0004+00 1/1 0/0 0/0 .sbss2 None */ -SECTION_SBSS2 static u8 data_80456BC4[4]; - -/* 80333C04-80333C74 32E544 0070+00 1/1 0/0 0/0 .text newTevColor__22J3DMaterialFactory_v21CFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTevColor(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevColor__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* ############################################################################################## */ -/* 804564BC-804564C0 004ABC 0004+00 1/1 0/0 0/0 .sdata2 @1317 */ -SECTION_SDATA2 static u32 lit_1317 = 0xFFFFFFFF; - -/* 80333C74-80333CD0 32E5B4 005C+00 1/1 0/0 0/0 .text newTevKColor__22J3DMaterialFactory_v21CFii - */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTevKColor(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevKColor__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* 80333CD0-80333D08 32E610 0038+00 1/1 0/0 0/0 .text newTevStageNum__22J3DMaterialFactory_v21CFi - */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTevStageNum(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevStageNum__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80333D08-80333D68 32E648 0060+00 1/1 0/0 0/0 .text newTevStage__22J3DMaterialFactory_v21CFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTevStage(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevStage__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* 80333D68-80333E04 32E6A8 009C+00 1/1 0/0 0/0 .text - * newTevSwapModeTable__22J3DMaterialFactory_v21CFii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newTevSwapModeTable(int param_0, int param_1) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevSwapModeTable__22J3DMaterialFactory_v21CFii.s" -} -#pragma pop - -/* 80333E04-80333EE0 32E744 00DC+00 1/1 0/0 0/0 .text newFog__22J3DMaterialFactory_v21CFi - */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newFog(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newFog__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80333EE0-80333F60 32E820 0080+00 1/1 0/0 0/0 .text newAlphaComp__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newAlphaComp(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newAlphaComp__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80333F60-80333FA4 32E8A0 0044+00 1/1 0/0 0/0 .text newBlend__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newBlend(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newBlend__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80333FA4-80334004 32E8E4 0060+00 1/1 0/0 0/0 .text newZMode__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newZMode(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newZMode__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80334004-8033403C 32E944 0038+00 1/1 0/0 0/0 .text newZCompLoc__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newZCompLoc(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newZCompLoc__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 8033403C-80334074 32E97C 0038+00 1/1 0/0 0/0 .text newDither__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newDither(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newDither__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80334074-80334118 32E9B4 00A4+00 1/1 0/0 0/0 .text newNBTScale__22J3DMaterialFactory_v21CFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void J3DMaterialFactory_v21::newNBTScale(int param_0) const { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newNBTScale__22J3DMaterialFactory_v21CFi.s" -} -#pragma pop - -/* 80334118-80334130 32EA58 0018+00 1/1 0/0 0/0 .text - * JSUConvertOffsetToPtr<23J3DMaterialInitData_v21>__FPCvPCv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -extern "C" asm void func_80334118(void* _this, void const* param_0, void const* param_1) { - nofralloc -#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/func_80334118.s" -} -#pragma pop +// +// Generated By: dol2asm +// Translation Unit: J3DMaterialFactory_v21 +// + +#include "JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h" +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "JSystem/JSupport/JSupport.h" +#include "dol2asm.h" + +// +// Forward References: +// + +extern "C" void __ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21(); +extern "C" void countUniqueMaterials__22J3DMaterialFactory_v21Fv(); +extern "C" void countTexGens__22J3DMaterialFactory_v21CFi(); +extern "C" void countStages__22J3DMaterialFactory_v21CFi(); +extern "C" void create__22J3DMaterialFactory_v21CFP11J3DMaterialiUl(); +extern "C" void newMatColor__22J3DMaterialFactory_v21CFii(); +extern "C" void newColorChanNum__22J3DMaterialFactory_v21CFi(); +extern "C" void newColorChan__22J3DMaterialFactory_v21CFii(); +extern "C" void newTexGenNum__22J3DMaterialFactory_v21CFi(); +extern "C" void newTexCoord__22J3DMaterialFactory_v21CFii(); +extern "C" void newTexMtx__22J3DMaterialFactory_v21CFii(); +extern "C" void newCullMode__22J3DMaterialFactory_v21CFi(); +extern "C" void newTexNo__22J3DMaterialFactory_v21CFii(); +extern "C" void newTevOrder__22J3DMaterialFactory_v21CFii(); +extern "C" void newTevColor__22J3DMaterialFactory_v21CFii(); +extern "C" void newTevKColor__22J3DMaterialFactory_v21CFii(); +extern "C" void newTevStageNum__22J3DMaterialFactory_v21CFi(); +extern "C" void newTevStage__22J3DMaterialFactory_v21CFii(); +extern "C" void newTevSwapModeTable__22J3DMaterialFactory_v21CFii(); +extern "C" void newFog__22J3DMaterialFactory_v21CFi(); +extern "C" void newAlphaComp__22J3DMaterialFactory_v21CFi(); +extern "C" void newBlend__22J3DMaterialFactory_v21CFi(); +extern "C" void newZMode__22J3DMaterialFactory_v21CFi(); +extern "C" void newZCompLoc__22J3DMaterialFactory_v21CFi(); +extern "C" void newDither__22J3DMaterialFactory_v21CFi(); +extern "C" void newNBTScale__22J3DMaterialFactory_v21CFi(); +extern "C" void func_80334118(void* _this, void const*, void const*); + +// +// External References: +// + +extern "C" void __ct__11J3DTevStageFv(); +extern "C" void __ct__11J3DTevStageFRC15J3DTevStageInfo(); +extern "C" void* __nw__FUl(); +extern "C" GXColorS10* func_802F41E8(void const*, void const*); +extern "C" u8* func_802F4260(void const*, void const*); +extern "C" GXColor* func_802F4278(void const*, void const*); +extern "C" GXCullMode* func_802F4290(void const*, void const*); +extern "C" u16* func_802F42C0(void const*, void const*); +extern "C" void createColorBlock__11J3DMaterialFUl(); +extern "C" void createTexGenBlock__11J3DMaterialFUl(); +extern "C" void createTevBlock__11J3DMaterialFi(); +extern "C" void createIndBlock__11J3DMaterialFi(); +extern "C" void createPEBlock__11J3DMaterialFUlUl(); +extern "C" void initialize__11J3DMaterialFv(); +extern "C" void __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo(); +extern "C" void __as__10J3DFogInfoFRC10J3DFogInfo(); +extern "C" void func_80332C24(void* _this, void const*, void const*); +extern "C" void func_80332C3C(void* _this, void const*, void const*); +extern "C" void func_80332C54(void* _this, void const*, void const*); +extern "C" void func_80332C6C(void* _this, void const*, void const*); +extern "C" void func_80332C84(void* _this, void const*, void const*); +extern "C" void func_80332C9C(void* _this, void const*, void const*); +extern "C" void func_80332CB4(void* _this, void const*, void const*); +extern "C" void func_80332CCC(void* _this, void const*, void const*); +extern "C" void func_80332CE4(void* _this, void const*, void const*); +extern "C" void func_80332CFC(void* _this, void const*, void const*); +extern "C" void func_80332D14(void* _this, void const*, void const*); +extern "C" void func_80332D2C(void* _this, void const*, void const*); +extern "C" void func_80332D5C(void* _this, void const*, void const*); +extern "C" void _savegpr_19(); +extern "C" void _savegpr_29(); +extern "C" void _restgpr_19(); +extern "C" void _restgpr_29(); +extern "C" extern void* __vt__11J3DMaterial[12]; + +// +// Declarations: +// + +/* 80332DA4-80332F84 32D6E4 01E0+00 0/0 2/2 0/0 .text + * __ct__22J3DMaterialFactory_v21FRC20J3DMaterialBlock_v21 */ +J3DMaterialFactory_v21::J3DMaterialFactory_v21(J3DMaterialBlock_v21 const& i_block) { + mMaterialNum = i_block.mMaterialNum; + mpMaterialInitData = JSUConvertOffsetToPtr(&i_block, i_block.mpMaterialInitData); + // mpMaterialID = JSUConvertOffsetToPtr(&i_block, i_block.mpMaterialID); + mpMaterialID = func_802F42C0(&i_block, i_block.mpMaterialID); + // mpCullMode = JSUConvertOffsetToPtr(&i_block, i_block.mpCullMode); + mpCullMode = func_802F4290(&i_block, i_block.mpCullMode); + // mpMatColor = JSUConvertOffsetToPtr(&i_block, i_block.mpMatColor); + mpMatColor = func_802F4278(&i_block, i_block.mpMatColor); + // mpColorChanNum = JSUConvertOffsetToPtr(&i_block, i_block.mpColorChanNum); + mpColorChanNum = func_802F4260(&i_block, i_block.mpColorChanNum); + mpColorChanInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpColorChanInfo); + // mpTexGenNum = JSUConvertOffsetToPtr(&i_block, i_block.mpTexGenNum); + mpTexGenNum = func_802F4260(&i_block, i_block.mpTexGenNum); + mpTexCoordInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTexCoordInfo); + mpTexCoord2Info = JSUConvertOffsetToPtr(&i_block, i_block.mpTexCoord2Info); + mpTexMtxInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTexMtxInfo); + field_0x28 = JSUConvertOffsetToPtr(&i_block, i_block.field_0x38); + // mpTexNo = JSUConvertOffsetToPtr(&i_block, i_block.mpTexNo); + mpTexNo = func_802F42C0(&i_block, i_block.mpTexNo); + mpTevOrderInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTevOrderInfo); + // mpTevColor = JSUConvertOffsetToPtr(&i_block, i_block.mpTevColor); + mpTevColor = func_802F41E8(&i_block, i_block.mpTevColor); + // mpTevKColor = JSUConvertOffsetToPtr(&i_block, i_block.mpTevKColor); + mpTevKColor = func_802F4278(&i_block, i_block.mpTevKColor); + // mpTevStageNum = JSUConvertOffsetToPtr(&i_block, i_block.mpTevStageNum); + mpTevStageNum = func_802F4260(&i_block, i_block.mpTevStageNum); + mpTevStageInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTevStageInfo); + mpTevSwapModeInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTevSwapModeInfo); + mpTevSwapModeTableInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpTevSwapModeTableInfo); + mpFogInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpFogInfo); + mpAlphaCompInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpAlphaCompInfo); + mpBlendInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpBlendInfo); + mpZModeInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpZModeInfo); + // mpZCompLoc = JSUConvertOffsetToPtr(&i_block, i_block.mpZCompLoc); + mpZCompLoc = func_802F4260(&i_block, i_block.mpZCompLoc); + // mpDither = JSUConvertOffsetToPtr(&i_block, i_block.mpDither); + mpDither = func_802F4260(&i_block, i_block.mpDither); + mpNBTScaleInfo = JSUConvertOffsetToPtr(&i_block, i_block.mpNBTScaleInfo); +} + +/* 80332F84-80332FA8 32D8C4 0024+00 0/0 1/1 0/0 .text + * countUniqueMaterials__22J3DMaterialFactory_v21Fv */ +u16 J3DMaterialFactory_v21::countUniqueMaterials() { + u16 i; + for (i = 0; i < mMaterialNum; i++) { + } + return i; +} + +/* 80332FA8-80332FE0 32D8E8 0038+00 1/1 0/0 0/0 .text countTexGens__22J3DMaterialFactory_v21CFi */ +u32 J3DMaterialFactory_v21::countTexGens(int i_idx) const { + u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx; + if (tex_gen_num_index != 0xff) { + return mpTexGenNum[tex_gen_num_index]; + } + return 0; +} + +/* 80332FE0-80333068 32D920 0088+00 1/1 0/0 0/0 .text countStages__22J3DMaterialFactory_v21CFi */ +u32 J3DMaterialFactory_v21::countStages(int i_idx) const { + J3DMaterialInitData_v21* init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + u32 count1 = 0; + u32 count2 = 0; + u8 tev_stage_num_index = init_data->mTevStageNumIdx; + if (tev_stage_num_index != 0xff) { + count2 = mpTevStageNum[tev_stage_num_index]; + } + for (int i = 0; i < 8; i++) { + if (init_data->mTexNoIdx[i] != 0xffff) { + count1++; + } + } + if (count2 != count1 && count1 != 0) { + if (count2 > count1) { + return count2; + } else { + return count1; + } + } + return count2; +} + +/* 80333068-803337D8 32D9A8 0770+00 0/0 2/2 0/0 .text + * create__22J3DMaterialFactory_v21CFP11J3DMaterialiUl */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +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" +} +#pragma pop + +/* ############################################################################################## */ +/* 804564B8-804564BC 004AB8 0004+00 1/1 0/0 0/0 .sdata2 @1130 */ +SECTION_SDATA2 static u32 lit_1130 = 0xFFFFFFFF; + +/* 803337D8-80333834 32E118 005C+00 1/1 0/0 0/0 .text newMatColor__22J3DMaterialFactory_v21CFii */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DGXColor J3DMaterialFactory_v21::newMatColor(int param_0, int param_1) const { + nofralloc +#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newMatColor__22J3DMaterialFactory_v21CFii.s" +} +#pragma pop + +/* 80333834-8033386C 32E174 0038+00 1/1 0/0 0/0 .text newColorChanNum__22J3DMaterialFactory_v21CFi + */ +u8 J3DMaterialFactory_v21::newColorChanNum(int i_idx) const { + u8 color_chan_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mColorChanNumIdx; + if (color_chan_num_index != 0xff) { + return mpColorChanNum[color_chan_num_index]; + } else { + return 0; + } +} + +/* 8033386C-80333A10 32E1AC 01A4+00 1/1 0/0 0/0 .text newColorChan__22J3DMaterialFactory_v21CFii + */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DColorChan J3DMaterialFactory_v21::newColorChan(int param_0, int param_1) const { + nofralloc +#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newColorChan__22J3DMaterialFactory_v21CFii.s" +} +#pragma pop + +/* 80333A10-80333A48 32E350 0038+00 1/1 0/0 0/0 .text newTexGenNum__22J3DMaterialFactory_v21CFi */ +u32 J3DMaterialFactory_v21::newTexGenNum(int i_idx) const { + u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx; + if (tex_gen_num_index != 0xff) { + return mpTexGenNum[tex_gen_num_index]; + } else { + return 0; + } +} + +/* 80333A48-80333AA8 32E388 0060+00 1/1 0/0 0/0 .text newTexCoord__22J3DMaterialFactory_v21CFii */ +J3DTexCoord J3DMaterialFactory_v21::newTexCoord(int i_idx, int i_no) const { + u16 tex_coord_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexCoordIdx[i_no]; + if (tex_coord_index != 0xffff) { + return J3DTexCoord(mpTexCoordInfo[tex_coord_index]); + } else { + return J3DTexCoord(); + } +} + +/* 80333AA8-80333B30 32E3E8 0088+00 1/1 0/0 0/0 .text newTexMtx__22J3DMaterialFactory_v21CFii */ +J3DTexMtx* J3DMaterialFactory_v21::newTexMtx(int i_idx, int i_no) const { + J3DTexMtx* tex_mtx = NULL; + J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mTexMtxIdx[i_no] != 0xffff) { + tex_mtx = new J3DTexMtx(mpTexMtxInfo[mtl_init_data->mTexMtxIdx[i_no]]); + } + return tex_mtx; +} + +/* 80333B30-80333B70 32E470 0040+00 1/1 0/0 0/0 .text newCullMode__22J3DMaterialFactory_v21CFi */ +u8 J3DMaterialFactory_v21::newCullMode(int i_idx) const { + u8 cull_mode_index = mpMaterialInitData[mpMaterialID[i_idx]].mCullModeIdx; + if (cull_mode_index != 0xff) { + return mpCullMode[cull_mode_index]; + } else { + return 0xff; + } +} + +/* 80333B70-80333BB8 32E4B0 0048+00 1/1 0/0 0/0 .text newTexNo__22J3DMaterialFactory_v21CFii */ +u16 J3DMaterialFactory_v21::newTexNo(int i_idx, int i_no) const { + u16 tex_no_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexNoIdx[i_no]; + if (tex_no_index != 0xffff) { + return mpTexNo[tex_no_index]; + } else { + return 0xffff; + } +} + +/* 80333BB8-80333C04 32E4F8 004C+00 1/1 0/0 0/0 .text newTevOrder__22J3DMaterialFactory_v21CFii */ +J3DTevOrder J3DMaterialFactory_v21::newTevOrder(int i_idx, int i_no) const { + J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mTevOrderIdx[i_no] != 0xffff) { + return J3DTevOrder(mpTevOrderInfo[mtl_init_data->mTevOrderIdx[i_no]]); + } else { + return J3DTevOrder(); + } +} + +/* 80456BC0-80456BC4 000060 0004+00 1/1 0/0 0/0 .sbss2 @1299 */ +SECTION_SBSS2 static GXColorS10 defaultTevColor; + +/* 80333C04-80333C74 32E544 0070+00 1/1 0/0 0/0 .text newTevColor__22J3DMaterialFactory_v21CFii */ +J3DGXColorS10 J3DMaterialFactory_v21::newTevColor(int i_idx, int i_no) const { + J3DGXColorS10 dflt = defaultTevColor; + J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mTevColorIdx[i_no] != 0xffff) { + return mpTevColor[mtl_init_data->mTevColorIdx[i_no]]; + } else { + return dflt; + } +} + +/* ############################################################################################## */ +/* 804564BC-804564C0 004ABC 0004+00 1/1 0/0 0/0 .sdata2 @1317 */ +SECTION_SDATA2 static u32 lit_1317 = 0xFFFFFFFF; + +/* 80333C74-80333CD0 32E5B4 005C+00 1/1 0/0 0/0 .text newTevKColor__22J3DMaterialFactory_v21CFii + */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DGXColor J3DMaterialFactory_v21::newTevKColor(int param_0, int param_1) const { + nofralloc +#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevKColor__22J3DMaterialFactory_v21CFii.s" +} +#pragma pop + +/* 80333CD0-80333D08 32E610 0038+00 1/1 0/0 0/0 .text newTevStageNum__22J3DMaterialFactory_v21CFi + */ +u8 J3DMaterialFactory_v21::newTevStageNum(int i_idx) const { + u8 tev_stage_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageNumIdx; + if (tev_stage_num_index != 0xff) { + return mpTevStageNum[tev_stage_num_index]; + } else { + return 0xff; + } +} + +/* 80333D08-80333D68 32E648 0060+00 1/1 0/0 0/0 .text newTevStage__22J3DMaterialFactory_v21CFii */ +J3DTevStage J3DMaterialFactory_v21::newTevStage(int i_idx, int i_no) const { + u16 tev_stage_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageIdx[i_no]; + if (tev_stage_index != 0xffff) { + return J3DTevStage(mpTevStageInfo[tev_stage_index]); + } else { + return J3DTevStage(); + } +} + +/* 80333D68-80333E04 32E6A8 009C+00 1/1 0/0 0/0 .text + * newTevSwapModeTable__22J3DMaterialFactory_v21CFii */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DTevSwapModeTable J3DMaterialFactory_v21::newTevSwapModeTable(int param_0, int param_1) const { + nofralloc +#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newTevSwapModeTable__22J3DMaterialFactory_v21CFii.s" +} +#pragma pop + +/* 80333E04-80333EE0 32E744 00DC+00 1/1 0/0 0/0 .text newFog__22J3DMaterialFactory_v21CFi + */ +J3DFog J3DMaterialFactory_v21::newFog(int i_idx) const { + J3DFog fog; + u16 fog_index = mpMaterialInitData[mpMaterialID[i_idx]].mFogIdx; + if (fog_index != 0xffff) { + fog.setFogInfo(mpFogInfo[fog_index]); + } + return fog; +} + +/* 80333EE0-80333F60 32E820 0080+00 1/1 0/0 0/0 .text newAlphaComp__22J3DMaterialFactory_v21CFi */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm J3DAlphaComp J3DMaterialFactory_v21::newAlphaComp(int param_0) const { + nofralloc +#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory_v21/newAlphaComp__22J3DMaterialFactory_v21CFi.s" +} +#pragma pop + +/* 80333F60-80333FA4 32E8A0 0044+00 1/1 0/0 0/0 .text newBlend__22J3DMaterialFactory_v21CFi */ +J3DBlend J3DMaterialFactory_v21::newBlend(int i_idx) const { + J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mBlendIdx != 0xffff) { + return J3DBlend(mpBlendInfo[mtl_init_data->mBlendIdx]); + } else { + return J3DBlend(j3dDefaultBlendInfo); + } +} + +/* 80333FA4-80334004 32E8E4 0060+00 1/1 0/0 0/0 .text newZMode__22J3DMaterialFactory_v21CFi */ +J3DZMode J3DMaterialFactory_v21::newZMode(int i_idx) const { + J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mZModeIdx != 0xff) { + return J3DZMode(mpZModeInfo[mtl_init_data->mZModeIdx]); + } else { + return J3DZMode(); + } +} + +/* 80334004-8033403C 32E944 0038+00 1/1 0/0 0/0 .text newZCompLoc__22J3DMaterialFactory_v21CFi */ +u8 J3DMaterialFactory_v21::newZCompLoc(int i_idx) const { + J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mZCompLocIdx != 0xff){ + return mpZCompLoc[mtl_init_data->mZCompLocIdx]; + } else { + return 0; + } +} + +/* 8033403C-80334074 32E97C 0038+00 1/1 0/0 0/0 .text newDither__22J3DMaterialFactory_v21CFi */ +u8 J3DMaterialFactory_v21::newDither(int i_idx) const { + J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mDitherIdx != 0xff){ + return mpDither[mtl_init_data->mDitherIdx]; + } else { + return 1; + } +} + +/* 80334074-80334118 32E9B4 00A4+00 1/1 0/0 0/0 .text newNBTScale__22J3DMaterialFactory_v21CFi */ +J3DNBTScale J3DMaterialFactory_v21::newNBTScale(int i_idx) const { + J3DNBTScale dflt(j3dDefaultNBTScaleInfo); + J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; + if (mtl_init_data->mNBTScaleIdx != 0xffff) { + return J3DNBTScale(mpNBTScaleInfo[mtl_init_data->mNBTScaleIdx]); + } else { + return dflt; + } +} diff --git a/rel/d/a/d_a_mirror/d_a_mirror.cpp b/rel/d/a/d_a_mirror/d_a_mirror.cpp index 9e6d645bd5c..558775fb598 100644 --- a/rel/d/a/d_a_mirror/d_a_mirror.cpp +++ b/rel/d/a/d_a_mirror/d_a_mirror.cpp @@ -1,795 +1,796 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_mirror -// - -#include "rel/d/a/d_a_mirror/d_a_mirror.h" -#include "dol2asm.h" -#include "d/com/d_com_inf_game.h" -#include "d/d_procname.h" -#include "d/a/d_a_player.h" -#include "JSystem/J3DGraphBase/J3DDrawBuffer.h" -#include "JSystem/JKernel/JKRHeap.h" -#include "JSystem/J3DGraphBase/J3DMaterial.h" - -// -// Types: -// - -// -// Forward References: -// - -extern "C" static void daMirror_c_createHeap__FP10fopAc_ac_c(); -extern "C" void __ct__16dMirror_packet_cFv(); -extern "C" void __dt__4cXyzFv(); -extern "C" void __ct__4cXyzFv(); -extern "C" void reset__16dMirror_packet_cFv(); -extern "C" void calcMinMax__16dMirror_packet_cFv(); -extern "C" void entryModel__16dMirror_packet_cFP8J3DModel(); -extern "C" void mirrorZdraw__16dMirror_packet_cFPfPfffffff(); -extern "C" void modelDraw__16dMirror_packet_cFP8J3DModelPA4_f(); -extern "C" void mainDraw__16dMirror_packet_cFv(); -extern "C" void draw__16dMirror_packet_cFv(); -extern "C" void __ct__10daMirror_cFv(); -extern "C" void __dt__16dMirror_packet_cFv(); -extern "C" void createHeap__10daMirror_cFv(); -extern "C" void setModelMtx__10daMirror_cFv(); -extern "C" static void daMirror_create__FP10daMirror_c(); -extern "C" void create__10daMirror_cFv(); -extern "C" static void daMirror_Delete__FP10daMirror_c(); -extern "C" static void daMirror_execute__FP10daMirror_c(); -extern "C" void execute__10daMirror_cFv(); -extern "C" static void daMirror_draw__FP10daMirror_c(); -extern "C" void entryModel__10daMirror_cFP8J3DModel(); -extern "C" extern char const* const d_a_mirror__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void mDoMtx_ZrotM__FPA4_fs(); -extern "C" void mDoMtx_lookAt__FPA4_fPC3VecPC3VecPC3Vecs(); -extern "C" void scaleS__14mDoMtx_stack_cFRC4cXyz(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void mDoLib_setResTimgObj__FPC7ResTIMGP9_GXTexObjUlP10_GXTlutObj(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_seenActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistance2__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void setLookPos__9daPy_py_cFP4cXyz(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void __pl__4cXyzCFRC3Vec(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void __ml__4cXyzCFf(); -extern "C" void outprod__4cXyzCFRC3Vec(); -extern "C" void normalizeZP__4cXyzFv(); -extern "C" void calcViewFrustum__11J3DUClipperFv(); -extern "C" void clip__11J3DUClipperCFPA4_CfP3VecP3Vec(); -extern "C" void GFSetGenMode2__FUcUcUcUc11_GXCullMode(); -extern "C" void GFSetChanAmbColor__F12_GXChannelID8_GXColor(); -extern "C" void __dl__FPv(); -extern "C" void reinitGX__6J3DSysFv(); -extern "C" void callDL__17J3DDisplayListObjCFv(); -extern "C" bool entry__9J3DPacketFP13J3DDrawBuffer(); -extern "C" void drawFast__14J3DShapePacketFv(); -extern "C" void loadPreDrawSetting__8J3DShapeCFv(); -extern "C" void entryImm__13J3DDrawBufferFP9J3DPacketUs(); - -extern "C" void __destroy_arr(); -extern "C" void __construct_array(); -extern "C" void __cvt_fp2unsigned(); -extern "C" void _savegpr_18(); -extern "C" void _savegpr_21(); -extern "C" void _savegpr_28(); -extern "C" void _restgpr_18(); -extern "C" void _restgpr_21(); -extern "C" void _restgpr_28(); -extern "C" extern void* __vt__9J3DPacket[5]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" u8 mClipper__14mDoLib_clipper[92]; -extern "C" u8 m_entryModel__10daMirror_c[12]; -extern "C" f32 mSystemFar__14mDoLib_clipper; -extern "C" u8 m_myObj__10daMirror_c[4]; -extern "C" u8 sOldVcdVatCmd__8J3DShape[4]; - -// -// Declarations: -// - -/* 80870BB8-80870BD8 000078 0020+00 1/1 0/0 0/0 .text daMirror_c_createHeap__FP10fopAc_ac_c */ -static bool daMirror_c_createHeap(fopAc_ac_c* param_0) { - return ((daMirror_c*)param_0)->createHeap(); -} - -/* ############################################################################################## */ -/* 80872660-80872664 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ -static char* l_arcName = "Mirror"; - -/* 80872664-80872668 -00001 0004+00 2/2 0/0 0/0 .data l_arcName2 */ -static char* l_arcName2 = "MR-Table"; - -/* 808726C4-808726D8 000064 0014+00 2/2 0/0 0/0 .data __vt__16dMirror_packet_c */ -SECTION_DATA extern void* __vt__16dMirror_packet_c[5] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)entry__9J3DPacketFP13J3DDrawBuffer, - (void*)draw__16dMirror_packet_cFv, - (void*)__dt__16dMirror_packet_cFv, -}; - -/* 80870BD8-80870C54 000098 007C+00 1/1 0/0 0/0 .text __ct__16dMirror_packet_cFv */ -dMirror_packet_c::dMirror_packet_c() { - reset(); -} - - -/* 80870C54-80870C90 000114 003C+00 2/2 0/0 0/0 .text __dt__4cXyzFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -//asm cXyz::~cXyz() { -asm void __dt__4cXyzFv() { - nofralloc -#include "asm/rel/d/a/d_a_mirror/d_a_mirror/__dt__4cXyzFv.s" -} -#pragma pop - -/* 80870C90-80870C94 000150 0004+00 1/1 0/0 0/0 .text __ct__4cXyzFv */ -//cXyz::cXyz() { -void __ct__4cXyzFv() { - /* empty function */ -} - -/* 80870C94-80870CA0 000154 000C+00 2/2 0/0 0/0 .text reset__16dMirror_packet_cFv */ -void dMirror_packet_c::reset() { - mModelCount = 0; -} - -/* 80870CA0-80870D58 000160 00B8+00 1/1 0/0 0/0 .text calcMinMax__16dMirror_packet_cFv */ -void dMirror_packet_c::calcMinMax() { - mMinVal.set(FLT_MAX, FLT_MAX, FLT_MAX); - mMaxVal.set(-FLT_MAX, -FLT_MAX, -FLT_MAX); - cXyz* ptr = mQuad; - for (int i = 0; i < 4; i++, ptr++) { - f32 val = ptr->x; - if (val < mMinVal.x) { - mMinVal.x = val; - } - - val = ptr->x; - if (val > mMaxVal.x) { - mMaxVal.x = val; - } - - val = ptr->y; - if (val < mMinVal.y) { - mMinVal.y = val; - } - - val = ptr->y; - if (val > mMaxVal.y) { - mMaxVal.y = val; - } - - val = ptr->z; - if (val < mMinVal.z) { - mMinVal.z = val; - } - - val = ptr->z; - if (val > mMaxVal.z) { - mMaxVal.z = val; - } - } -} - -/* 80870D58-80870D88 000218 0030+00 1/1 0/0 0/0 .text entryModel__16dMirror_packet_cFP8J3DModel */ -int dMirror_packet_c::entryModel(J3DModel* param_0) { - if (mModelCount >= 0x40) { - return 0; - } - - mModels[mModelCount++] = param_0; - return 1; -} - -/* ############################################################################################## */ -/* 8087258C-80872590 000000 0004+00 3/3 0/0 0/0 .rodata @3884 */ -SECTION_RODATA static u32 const lit_3884 = 0x000000FF; -COMPILER_STRIP_GATE(0x8087258C, &lit_3884); - -/* 80872590-80872598 000004 0008+00 0/1 0/0 0/0 .rodata l_texCoord$3899 */ -#pragma push -#pragma force_active on -SECTION_RODATA static s8 const l_texCoord[4][2] = { - {0x00, 0x00}, {0x01, 0x00}, {0x01, 0x01}, {0x00, 0x01}, -}; -COMPILER_STRIP_GATE(0x80872590, &l_texCoord); -#pragma pop - -/* 80872598-8087259C 00000C 0004+00 2/4 0/0 0/0 .rodata @3945 */ -SECTION_RODATA static u8 const lit_3945[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80872598, &lit_3945); - -/* 8087259C-808725A0 000010 0004+00 0/1 0/0 0/0 .rodata @3946 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3946 = 100.0f; -COMPILER_STRIP_GATE(0x8087259C, &lit_3946); -#pragma pop - -/* 808725A0-808725A4 000014 0004+00 0/3 0/0 0/0 .rodata @3947 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3947 = 1.0f; -COMPILER_STRIP_GATE(0x808725A0, &lit_3947); -#pragma pop - -/* 808725A4-808725A8 000018 0004+00 0/1 0/0 0/0 .rodata @3948 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3948 = -100.0f; -COMPILER_STRIP_GATE(0x808725A4, &lit_3948); -#pragma pop - -inline static void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) { - GXSetTexCoordGen2(dst, type, src, mtx, 0, 125); -} - -inline static void damirror_GXEnd() { - i_GXEnd(); -} - -/* 80870D88-80871268 000248 04E0+00 1/1 0/0 0/0 .text mirrorZdraw__16dMirror_packet_cFPfPfffffff - */ -// Matches with literals (Maybe l_texCoord should be inside) -#ifdef NONMATCHING -void dMirror_packet_c::mirrorZdraw(f32* param_0, f32* param_1, f32 param_2, f32 param_3, - f32 param_4, f32 param_5, f32 param_6, f32 param_7) { - GXSetNumChans(1); - GXSetChanCtrl(GX_COLOR0, 0, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE); - GXSetNumTexGens(0); - GXSetNumTevStages(1); - GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0); - GXColor color = {0xff,0,0,0}; - GXSetTevColor(GX_TEVREG0, color); - GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0); - GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); - GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0); - GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); - GXSetZCompLoc(1); - GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_OR); - GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0); - GXSetFog(GX_FOG_NONE, 0.0f, 0.0f, 0.0f, 0.0f, g_clearColor); - GXSetFogRangeAdj(0, 0, NULL); - GXSetCullMode(GX_CULL_BACK); - GXSetNumIndStages(0); - GXClearVtxDesc(); - GXSetVtxDesc(GX_VA_POS, GX_DIRECT); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); - GXSetZMode(1, GX_GEQUAL, 1); - GXLoadPosMtxImm(j3dSys.getViewMtx(), 0); - GXSetCurrentMtx(0); - GXBegin(GX_QUADS, GX_VTXFMT0, 4); - for (int i = 0; i < 4; i++) { - GXPosition3f32(mQuad[i].x, mQuad[i].y, mQuad[i].z); - } - damirror_GXEnd(); - - if (mViewScale.y > 0.0f) { - GXSetZMode(1, GX_ALWAYS, 1); - GXSetColorUpdate(0); - GXSetAlphaUpdate(0); - Mtx44 mtx; - C_MTXOrtho(mtx, param_1[1], param_1[1] + param_1[3], param_1[0], - param_1[0] + param_1[2], 0, 100.0f); - GXSetProjection(mtx, GX_ORTHOGRAPHIC); - GXLoadPosMtxImm(mDoMtx_getIdentity(), 0); - - param_3 -= 1.0f; - param_4 -= 1.0f; - param_5 += 1.0f; - param_6 += 1.0f; - GXBegin(GX_QUADS, GX_VTXFMT0, 4); - GXPosition3f32(param_3, param_4, -100.0f); - GXPosition3f32(param_5, param_4, -100.0f); - GXPosition3f32(param_5, param_6, -100.0f); - GXPosition3f32(param_3, param_6, -100.0f); - damirror_GXEnd(); - GXSetProjectionv(param_0); - GXSetZMode(1, GX_ALWAYS, 1); - GXLoadPosMtxImm(j3dSys.getViewMtx(), 0); - if (GXGetTexObjWidth(&mTexObj)) { - GXLoadTexObj(&mTexObj, GX_TEXMAP0); - GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60); - GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); - GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA); - GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); - GXSetNumChans(0); - GXSetNumTexGens(1); - GXSetZCompLoc(0); - GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_POS_XYZ, GX_S8, 0); - GXBegin(GX_QUADS, GX_VTXFMT0, 4); - cXyz* ptr = mQuad; - s8* texPtr = (s8*)l_texCoord; - for (int i = 0; i < 4; ptr++, texPtr += 2, i++) { - GXPosition3f32(ptr->x, ptr->y, ptr->z); - GXTexCoord2s8(texPtr[0], texPtr[1]); - } - } else { - GXBegin(GX_QUADS, GX_VTXFMT0, 4); - cXyz* ptr = mQuad; - for (int i = 0; i < 4; ptr++, i++) { - GXPosition3f32(ptr->x, ptr->y, ptr->z); - } - } - damirror_GXEnd(); - } else { - GXSetProjectionv(param_0); - } - - GXSetColorUpdate(1); - GXSetAlphaUpdate(0); -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dMirror_packet_c::mirrorZdraw(f32* param_0, f32* param_1, f32 param_2, f32 param_3, - f32 param_4, f32 param_5, f32 param_6, f32 param_7) { - nofralloc -#include "asm/rel/d/a/d_a_mirror/d_a_mirror/mirrorZdraw__16dMirror_packet_cFPfPfffffff.s" -} -#pragma pop -#endif - -/* ############################################################################################## */ -/* 808725A8-808725AC 00001C 0004+00 1/1 0/0 0/0 .rodata @3956 */ -SECTION_RODATA static u8 const lit_3956[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x808725A8, &lit_3956); - -/* 80871268-8087146C 000728 0204+00 1/1 0/0 0/0 .text - * modelDraw__16dMirror_packet_cFP8J3DModelPA4_f */ -// Matches with literals -#ifdef NONMATCHING -void dMirror_packet_c::modelDraw(J3DModel* param_0, f32 (*param_1)[4]) { - Mtx& baseMtx = param_0->getBaseTRMtx(); - cXyz acStack_3c(baseMtx[0][3], baseMtx[1][3], baseMtx[2][3]); - cXyz cStack_48; - cMtx_multVec(param_1, &acStack_3c, &cStack_48); - cXyz cStack_54; - cMtx_multVec(j3dSys.getViewMtx(), &acStack_3c, &cStack_54); - - if (mViewScale.y > 0.0f && cStack_48.z > cStack_54.z) { - return; - } - - GXColor color = {0}; - color.r = i_dKy_getEnvlight()->mTerrainAmbienceBG0.r; - color.g = i_dKy_getEnvlight()->mTerrainAmbienceBG0.g; - color.b = i_dKy_getEnvlight()->mTerrainAmbienceBG0.b; - color.a = i_dKy_getEnvlight()->mTerrainAmbienceBG0.a; - J3DModelData* modelData = param_0->getModelData(); - u16 materialNum = modelData->getMaterialNum(); - for (u16 i = 0; i < materialNum; i++) { - J3DMatPacket* matPacket = param_0->getMatPacket(i); - J3DShapePacket* shapePacket = matPacket->getShapePacket(); - J3DShape* shape = shapePacket->getShape(); - if (!shape->checkFlag(1)) { - J3DMaterial* material = modelData->getMaterialNodePointer(i); - u32 texGenNum = material->getTexGenBlock()->getTexGenNum(); - u8 colorChanNum = material->getColorBlock()->getColorChanNum(); - u8 tevStageNum = material->getTevBlock()->getTevStageNum(); - u8 indTexStageNum = material->getIndBlock()->getIndTexStageNum(); - material->load(); - matPacket->callDL(); - shape->loadPreDrawSetting(); - if (shapePacket->getDisplayListObj() != NULL) { - shapePacket->getDisplayListObj()->callDL(); - } - GFSetGenMode2(texGenNum, (_GXChannelID)colorChanNum, (_GXTevStageID)tevStageNum, indTexStageNum, GX_CULL_FRONT); - GXColor ambColor = *(GXColor*)&color; - GFSetChanAmbColor(GX_COLOR0, ambColor); - shapePacket->setBaseMtxPtr((Mtx*)param_1); - shapePacket->drawFast(); - shapePacket->setBaseMtxPtr((Mtx*)j3dSys.getViewMtx()); - } - shape->resetVcdVatCache(); - } -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dMirror_packet_c::modelDraw(J3DModel* param_0, f32 (*param_1)[4]) { - nofralloc -#include "asm/rel/d/a/d_a_mirror/d_a_mirror/modelDraw__16dMirror_packet_cFP8J3DModelPA4_f.s" -} -#pragma pop -#endif - -/* ############################################################################################## */ -/* 808725AC-808725B0 000020 0004+00 0/1 0/0 0/0 .rodata @4345 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4345 = 0x3C8EFA35; -COMPILER_STRIP_GATE(0x808725AC, &lit_4345); -#pragma pop - -/* 808725B0-808725B4 000024 0004+00 0/1 0/0 0/0 .rodata @4346 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4346 = 0.5f; -COMPILER_STRIP_GATE(0x808725B0, &lit_4346); -#pragma pop - -/* 808725B4-808725B8 000028 0004+00 0/1 0/0 0/0 .rodata @4347 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4347 = 2.0f; -COMPILER_STRIP_GATE(0x808725B4, &lit_4347); -#pragma pop - -/* 808725B8-808725BC 00002C 0004+00 0/1 0/0 0/0 .rodata @4348 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4348 = 304.0f; -COMPILER_STRIP_GATE(0x808725B8, &lit_4348); -#pragma pop - -/* 808725BC-808725C0 000030 0004+00 0/1 0/0 0/0 .rodata @4349 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4349 = 608.0f; -COMPILER_STRIP_GATE(0x808725BC, &lit_4349); -#pragma pop - -/* 808725C0-808725C4 000034 0004+00 0/1 0/0 0/0 .rodata @4350 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4350 = 224.0f; -COMPILER_STRIP_GATE(0x808725C0, &lit_4350); -#pragma pop - -/* 808725C4-808725C8 000038 0004+00 0/1 0/0 0/0 .rodata @4351 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4351 = 448.0f; -COMPILER_STRIP_GATE(0x808725C4, &lit_4351); -#pragma pop - -/* 808725C8-808725CC 00003C 0004+00 0/1 0/0 0/0 .rodata @4352 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4352 = 8.0f; -COMPILER_STRIP_GATE(0x808725C8, &lit_4352); -#pragma pop - -/* 808725CC-808725D4 000040 0004+04 0/2 0/0 0/0 .rodata @4353 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4353[1 + 1 /* padding */] = { - -1.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x808725CC, &lit_4353); -#pragma pop - -/* 808725D4-808725DC 000048 0008+00 0/1 0/0 0/0 .rodata @4355 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4355[8] = { - 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x808725D4, &lit_4355); -#pragma pop - -/* 8087146C-80871D84 00092C 0918+00 1/1 0/0 0/1 .text mainDraw__16dMirror_packet_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dMirror_packet_c::mainDraw() { - nofralloc -#include "asm/rel/d/a/d_a_mirror/d_a_mirror/mainDraw__16dMirror_packet_cFv.s" -} -#pragma pop - -/* 80871D84-80871E24 001244 00A0+00 1/0 0/0 0/0 .text draw__16dMirror_packet_cFv */ -void dMirror_packet_c::draw() { - mDoLib_clipper::changeFar(dComIfGd_getView()->mFar); - s32 clipRes = mDoLib_clipper::clip(j3dSys.getViewMtx(), &mMaxVal, &mMinVal); - if (clipRes == 0) { - mainDraw(); - } - mDoLib_clipper::resetFar(); - reset(); -} - -/* 80871E24-80871E84 0012E4 0060+00 1/1 0/0 0/0 .text __ct__10daMirror_cFv */ -daMirror_c::daMirror_c() { - m_entryModel = &daMirror_c::entryModel; -} - -/* 80871E84-80871F08 001344 0084+00 1/0 0/0 0/0 .text __dt__16dMirror_packet_cFv */ -dMirror_packet_c::~dMirror_packet_c() { -} - -/* 80871F08-80871F78 0013C8 0070+00 1/1 0/0 0/0 .text createHeap__10daMirror_cFv */ -bool daMirror_c::createHeap() { - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); - field_0x6f8 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); - return (field_0x6f8 != NULL); -} - -/* 80871F78-80872018 001438 00A0+00 1/1 0/0 0/0 .text setModelMtx__10daMirror_cFv */ -void daMirror_c::setModelMtx() { - field_0x6f8->setBaseScale(mScale); - mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); - mDoMtx_stack_c::YrotM(shape_angle.y); - mDoMtx_stack_c::XrotM(shape_angle.x); - mDoMtx_stack_c::ZrotM(0x2000); - field_0x6f8->i_setBaseTRMtx(mDoMtx_stack_c::get()); -} - -/* 80872018-8087206C 0014D8 0054+00 1/0 0/0 0/0 .text daMirror_create__FP10daMirror_c */ -static int daMirror_create(daMirror_c* i_this) { - fopAcM_SetupActor(i_this, daMirror_c); - return i_this->daMirror_c::create(); -} - -/* ############################################################################################## */ -/* 808725DC-8087260C 000050 0030+00 0/0 0/0 0/0 .rodata @4406 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4406[48] = { - 0xC2, 0x91, 0x00, 0x00, 0x43, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x91, 0x00, 0x00, - 0x43, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xC2, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x808725DC, &lit_4406); -#pragma pop - -/* 8087260C-8087263C 000080 0030+00 1/1 0/0 0/0 .rodata - * l_mirrorQuad$localstatic3$create__10daMirror_cFv */ -SECTION_RODATA static Vec const data_8087260C[4] = { - {-50.0f, 100.0f, 0.0f}, {50.0f, 100.0f, 0.0f}, - {50.0f, 0.0f, 0.0f}, {-50.0f, 0.0f, 0.0f}, -}; -COMPILER_STRIP_GATE(0x8087260C, &data_8087260C); - -/* 8087263C-80872648 0000B0 000C+00 1/1 0/0 0/0 .rodata - * l_mirrorLook$localstatic4$create__10daMirror_cFv */ -SECTION_RODATA static Vec const data_8087263C = { - 0.0f, 50.0f, 0.0f, -}; -COMPILER_STRIP_GATE(0x8087263C, &data_8087263C); - -/* 80872648-8087264C 0000BC 0004+00 0/1 0/0 0/0 .rodata @4544 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4544 = 10.0f; -COMPILER_STRIP_GATE(0x80872648, &lit_4544); -#pragma pop - -/* 8087206C-80872344 00152C 02D8+00 2/2 0/0 0/0 .text create__10daMirror_cFv */ -// regalloc, static var load -#ifdef NONMATCHING -int daMirror_c::create() { - if (getSw() != 0xff && !i_fopAcM_isSwitch(this, getSw())) { - return 4; - } - - if (m_myObj != NULL) { - return 0; - } - - s32 type = getType(); - if (type == 2) { - request_of_phase_process_class* phase = (request_of_phase_process_class*)this; - if (this) { - phase = &mPhase; - } - int res = dComIfG_resLoad(phase, l_arcName); - switch (res) { - default: - return res; - case cPhs_COMPLEATE_e: - if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)daMirror_c_createHeap, 0x1540)) { - return 5; - } - break; - } - - setModelMtx(); - void* uVar2 = dComIfG_getObjectRes(l_arcName, 7); - GXTexObj& texObj = mPacket.getTexObj(); - mDoLib_setResTimgObj((ResTIMG*)uVar2, &texObj, 0, NULL); - Vec src[4] = { - {-72.5f, 145.0f, 0.0f}, {72.5f, 145.0f, 0.0f}, - {72.5f, 0.0f, 0.0f}, {-72.5f, 0.0f, 0.0f}, - }; - mDoMtx_stack_c::scaleS(mScale); - mDoMtx_stack_c::revConcat(field_0x6f8->getBaseTRMtx()); - cMtx_multVecArray(mDoMtx_stack_c::get(), src, mPacket.getQuad(), 4); - mPacket.getViewScale().set(-1.0f, 1.0f, 1.0f); - } else { - if (type == 1) { - mScale *= 10.0f; - mPacket.getViewScale().set(1.0,-1.0,1.0); - } else { - if (type == 3) { - request_of_phase_process_class* phase = (request_of_phase_process_class*)this; - if (this) { - phase = &mPhase; - } - int res = dComIfG_resLoad(phase, l_arcName2); - switch (res) { - default: - return res; - case cPhs_COMPLEATE_e: - void* objRes = dComIfG_getObjectRes(l_arcName2, 0x25); - mDoLib_setResTimgObj((ResTIMG*)objRes, &mPacket.getTexObj(), 0, NULL); - break; - } - } - mPacket.getViewScale().set(-1.0f, 1.0f, 1.0f); - } - mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); - mDoMtx_stack_c::YrotM(shape_angle.y); - mDoMtx_stack_c::XrotM(shape_angle.x); - mDoMtx_stack_c::scaleM(mScale.x, mScale.y, mScale.z); - static Vec const data_8087260Cb[4] = { - {-50.0f, 100.0f, 0.0f}, {50.0f, 100.0f, 0.0f}, - {50.0f, 0.0f, 0.0f}, {-50.0f, 0.0f, 0.0f}, - }; - mDoMtx_stack_c::multVecArray(data_8087260Cb, - mPacket.getQuad(), 4); - } - m_myObj = this; - mPacket.calcMinMax(); - static Vec const data_8087263C_a = { - 0.0f, 50.0f, 0.0f, - }; - mDoMtx_stack_c::multVec(&data_8087263C_a, &mEyePos); - return 4; -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daMirror_c::create() { - nofralloc -#include "asm/rel/d/a/d_a_mirror/d_a_mirror/create__10daMirror_cFv.s" -} -#pragma pop -#endif - -/* 80872344-808723C4 001804 0080+00 1/0 0/0 0/0 .text daMirror_Delete__FP10daMirror_c */ -static int daMirror_Delete(daMirror_c* param_0) { - s32 mirrorType = param_0->getType(); - if (mirrorType == 2) { - dComIfG_resDelete(param_0 ? ¶m_0->mPhase : (request_of_phase_process_class*)param_0, l_arcName); - } else if (mirrorType == 3) { - dComIfG_resDelete(param_0 ? ¶m_0->mPhase: (request_of_phase_process_class*)param_0, l_arcName2); - } - daMirror_c::m_myObj = NULL; - return 1; -} - -/* 808723C4-808723E4 001884 0020+00 1/0 0/0 0/0 .text daMirror_execute__FP10daMirror_c */ -static int daMirror_execute(daMirror_c* param_0) { - return param_0->execute(); -} - -/* ############################################################################################## */ -/* 8087264C-80872650 0000C0 0004+00 1/1 0/0 0/0 .rodata @4574 */ -SECTION_RODATA static f32 const lit_4574 = 40000.0f; -COMPILER_STRIP_GATE(0x8087264C, &lit_4574); - -/* 808723E4-808724C0 0018A4 00DC+00 1/1 0/0 0/0 .text execute__10daMirror_cFv */ -// Matches with literals -#ifdef NONMATCHING -int daMirror_c::execute() { - if (this != m_myObj) { - if (m_myObj == NULL) { - if (create() == 5) { - fopAcM_delete(this); - } - } - return 1; - } - - daPy_py_c* player = daPy_getLinkPlayerActorClass(); - if (mPacket.getViewScale().y > 0.0f && - player->getKandelaarFlamePos() && - fopAcM_searchActorDistance2(this, player) < 40000.0f) - { - if (fopAcM_seenActorAngleY(this, player) < 0x4000) { - daPy_py_c::setLookPos(&mEyePos); - } - } - return 1; -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daMirror_c::execute() { - nofralloc -#include "asm/rel/d/a/d_a_mirror/d_a_mirror/execute__10daMirror_cFv.s" -} -#pragma pop -#endif - -/* 808724C0-80872560 001980 00A0+00 1/0 0/0 0/0 .text daMirror_draw__FP10daMirror_c */ -static int daMirror_draw(daMirror_c* param_0) { - if (param_0 != daMirror_c::m_myObj) { - return 1; - } - - if (param_0->field_0x6f8) { - g_env_light.settingTevStruct(0x10, ¶m_0->current.pos, ¶m_0->mTevStr); - g_env_light.setLightTevColorType(param_0->field_0x6f8->mModelData, ¶m_0->mTevStr); - mDoExt_modelUpdateDL(param_0->field_0x6f8); - } - - dComIfGd_getOpaListBG()->entryImm(¶m_0->mPacket, 0); - return 1; -} - -/* 80872560-80872584 001A20 0024+00 1/0 0/0 0/0 .text entryModel__10daMirror_cFP8J3DModel - */ -int daMirror_c::entryModel(J3DModel* param_0) { - return mPacket.entryModel(param_0); -} - -/* 80872650-80872650 0000C4 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -/* 80872674-80872694 -00001 0020+00 1/0 0/0 0/0 .data daMirror_METHODS */ -static actor_method_class daMirror_METHODS = { - (process_method_func)daMirror_create, - (process_method_func)daMirror_Delete, - (process_method_func)daMirror_execute, - (process_method_func)NULL, - (process_method_func)daMirror_draw, -}; - -/* 80872694-808726C4 -00001 0030+00 0/0 0/0 1/0 .data g_profile_MIRROR */ -extern actor_process_profile_definition g_profile_MIRROR = { - fpcLy_CURRENT_e, - 7, - fpcPi_CURRENT_e, - PROC_MIRROR, - &g_fpcLf_Method.mBase, - sizeof(daMirror_c), - 0, - 0, - &g_fopAc_Method.base, - 757, - &daMirror_METHODS, - 0x00060000, - 5, - fopAc_CULLBOX_0_e, -}; +// +// Generated By: dol2asm +// Translation Unit: d_a_mirror +// + +#include "rel/d/a/d_a_mirror/d_a_mirror.h" +#include "dol2asm.h" +#include "d/com/d_com_inf_game.h" +#include "d/d_procname.h" +#include "d/a/d_a_player.h" +#include "JSystem/J3DGraphBase/J3DDrawBuffer.h" +#include "JSystem/JKernel/JKRHeap.h" +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "m_Do/m_Do_lib.h" + +// +// Types: +// + +// +// Forward References: +// + +extern "C" static void daMirror_c_createHeap__FP10fopAc_ac_c(); +extern "C" void __ct__16dMirror_packet_cFv(); +extern "C" void __dt__4cXyzFv(); +extern "C" void __ct__4cXyzFv(); +extern "C" void reset__16dMirror_packet_cFv(); +extern "C" void calcMinMax__16dMirror_packet_cFv(); +extern "C" void entryModel__16dMirror_packet_cFP8J3DModel(); +extern "C" void mirrorZdraw__16dMirror_packet_cFPfPfffffff(); +extern "C" void modelDraw__16dMirror_packet_cFP8J3DModelPA4_f(); +extern "C" void mainDraw__16dMirror_packet_cFv(); +extern "C" void draw__16dMirror_packet_cFv(); +extern "C" void __ct__10daMirror_cFv(); +extern "C" void __dt__16dMirror_packet_cFv(); +extern "C" void createHeap__10daMirror_cFv(); +extern "C" void setModelMtx__10daMirror_cFv(); +extern "C" static void daMirror_create__FP10daMirror_c(); +extern "C" void create__10daMirror_cFv(); +extern "C" static void daMirror_Delete__FP10daMirror_c(); +extern "C" static void daMirror_execute__FP10daMirror_c(); +extern "C" void execute__10daMirror_cFv(); +extern "C" static void daMirror_draw__FP10daMirror_c(); +extern "C" void entryModel__10daMirror_cFP8J3DModel(); +extern "C" extern char const* const d_a_mirror__stringBase0; + +// +// External References: +// + +extern "C" void mDoMtx_XrotM__FPA4_fs(); +extern "C" void mDoMtx_YrotM__FPA4_fs(); +extern "C" void mDoMtx_ZrotM__FPA4_fs(); +extern "C" void mDoMtx_lookAt__FPA4_fPC3VecPC3VecPC3Vecs(); +extern "C" void scaleS__14mDoMtx_stack_cFRC4cXyz(); +extern "C" void scaleM__14mDoMtx_stack_cFfff(); +extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); +extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); +extern "C" void mDoLib_setResTimgObj__FPC7ResTIMGP9_GXTexObjUlP10_GXTlutObj(); +extern "C" void __ct__10fopAc_ac_cFv(); +extern "C" void fopAcM_delete__FP10fopAc_ac_c(); +extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); +extern "C" void fopAcM_seenActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void fopAcM_searchActorDistance2__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); +extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); +extern "C" void isSwitch__10dSv_info_cCFii(); +extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); +extern "C" void setLookPos__9daPy_py_cFP4cXyz(); +extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); +extern "C" void setLightTevColorType__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); +extern "C" void __pl__4cXyzCFRC3Vec(); +extern "C" void __mi__4cXyzCFRC3Vec(); +extern "C" void __ml__4cXyzCFf(); +extern "C" void outprod__4cXyzCFRC3Vec(); +extern "C" void normalizeZP__4cXyzFv(); +extern "C" void calcViewFrustum__11J3DUClipperFv(); +extern "C" void clip__11J3DUClipperCFPA4_CfP3VecP3Vec(); +extern "C" void GFSetGenMode2__FUcUcUcUc11_GXCullMode(); +extern "C" void GFSetChanAmbColor__F12_GXChannelID8_GXColor(); +extern "C" void __dl__FPv(); +extern "C" void reinitGX__6J3DSysFv(); +extern "C" void callDL__17J3DDisplayListObjCFv(); +extern "C" bool entry__9J3DPacketFP13J3DDrawBuffer(); +extern "C" void drawFast__14J3DShapePacketFv(); +extern "C" void loadPreDrawSetting__8J3DShapeCFv(); +extern "C" void entryImm__13J3DDrawBufferFP9J3DPacketUs(); + +extern "C" void __destroy_arr(); +extern "C" void __construct_array(); +extern "C" void __cvt_fp2unsigned(); +extern "C" void _savegpr_18(); +extern "C" void _savegpr_21(); +extern "C" void _savegpr_28(); +extern "C" void _restgpr_18(); +extern "C" void _restgpr_21(); +extern "C" void _restgpr_28(); +extern "C" extern void* __vt__9J3DPacket[5]; +extern "C" u8 now__14mDoMtx_stack_c[48]; +extern "C" u8 mClipper__14mDoLib_clipper[92]; +extern "C" u8 m_entryModel__10daMirror_c[12]; +extern "C" f32 mSystemFar__14mDoLib_clipper; +extern "C" u8 m_myObj__10daMirror_c[4]; +extern "C" u8 sOldVcdVatCmd__8J3DShape[4]; + +// +// Declarations: +// + +/* 80870BB8-80870BD8 000078 0020+00 1/1 0/0 0/0 .text daMirror_c_createHeap__FP10fopAc_ac_c */ +static bool daMirror_c_createHeap(fopAc_ac_c* param_0) { + return ((daMirror_c*)param_0)->createHeap(); +} + +/* ############################################################################################## */ +/* 80872660-80872664 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ +static char* l_arcName = "Mirror"; + +/* 80872664-80872668 -00001 0004+00 2/2 0/0 0/0 .data l_arcName2 */ +static char* l_arcName2 = "MR-Table"; + +/* 808726C4-808726D8 000064 0014+00 2/2 0/0 0/0 .data __vt__16dMirror_packet_c */ +SECTION_DATA extern void* __vt__16dMirror_packet_c[5] = { + (void*)NULL /* RTTI */, + (void*)NULL, + (void*)entry__9J3DPacketFP13J3DDrawBuffer, + (void*)draw__16dMirror_packet_cFv, + (void*)__dt__16dMirror_packet_cFv, +}; + +/* 80870BD8-80870C54 000098 007C+00 1/1 0/0 0/0 .text __ct__16dMirror_packet_cFv */ +dMirror_packet_c::dMirror_packet_c() { + reset(); +} + + +/* 80870C54-80870C90 000114 003C+00 2/2 0/0 0/0 .text __dt__4cXyzFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +//asm cXyz::~cXyz() { +asm void __dt__4cXyzFv() { + nofralloc +#include "asm/rel/d/a/d_a_mirror/d_a_mirror/__dt__4cXyzFv.s" +} +#pragma pop + +/* 80870C90-80870C94 000150 0004+00 1/1 0/0 0/0 .text __ct__4cXyzFv */ +//cXyz::cXyz() { +void __ct__4cXyzFv() { + /* empty function */ +} + +/* 80870C94-80870CA0 000154 000C+00 2/2 0/0 0/0 .text reset__16dMirror_packet_cFv */ +void dMirror_packet_c::reset() { + mModelCount = 0; +} + +/* 80870CA0-80870D58 000160 00B8+00 1/1 0/0 0/0 .text calcMinMax__16dMirror_packet_cFv */ +void dMirror_packet_c::calcMinMax() { + mMinVal.set(FLT_MAX, FLT_MAX, FLT_MAX); + mMaxVal.set(-FLT_MAX, -FLT_MAX, -FLT_MAX); + cXyz* ptr = mQuad; + for (int i = 0; i < 4; i++, ptr++) { + f32 val = ptr->x; + if (val < mMinVal.x) { + mMinVal.x = val; + } + + val = ptr->x; + if (val > mMaxVal.x) { + mMaxVal.x = val; + } + + val = ptr->y; + if (val < mMinVal.y) { + mMinVal.y = val; + } + + val = ptr->y; + if (val > mMaxVal.y) { + mMaxVal.y = val; + } + + val = ptr->z; + if (val < mMinVal.z) { + mMinVal.z = val; + } + + val = ptr->z; + if (val > mMaxVal.z) { + mMaxVal.z = val; + } + } +} + +/* 80870D58-80870D88 000218 0030+00 1/1 0/0 0/0 .text entryModel__16dMirror_packet_cFP8J3DModel */ +int dMirror_packet_c::entryModel(J3DModel* param_0) { + if (mModelCount >= 0x40) { + return 0; + } + + mModels[mModelCount++] = param_0; + return 1; +} + +/* ############################################################################################## */ +/* 8087258C-80872590 000000 0004+00 3/3 0/0 0/0 .rodata @3884 */ +SECTION_RODATA static u32 const lit_3884 = 0x000000FF; +COMPILER_STRIP_GATE(0x8087258C, &lit_3884); + +/* 80872590-80872598 000004 0008+00 0/1 0/0 0/0 .rodata l_texCoord$3899 */ +#pragma push +#pragma force_active on +SECTION_RODATA static s8 const l_texCoord[4][2] = { + {0x00, 0x00}, {0x01, 0x00}, {0x01, 0x01}, {0x00, 0x01}, +}; +COMPILER_STRIP_GATE(0x80872590, &l_texCoord); +#pragma pop + +/* 80872598-8087259C 00000C 0004+00 2/4 0/0 0/0 .rodata @3945 */ +SECTION_RODATA static u8 const lit_3945[4] = { + 0x00, + 0x00, + 0x00, + 0x00, +}; +COMPILER_STRIP_GATE(0x80872598, &lit_3945); + +/* 8087259C-808725A0 000010 0004+00 0/1 0/0 0/0 .rodata @3946 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_3946 = 100.0f; +COMPILER_STRIP_GATE(0x8087259C, &lit_3946); +#pragma pop + +/* 808725A0-808725A4 000014 0004+00 0/3 0/0 0/0 .rodata @3947 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_3947 = 1.0f; +COMPILER_STRIP_GATE(0x808725A0, &lit_3947); +#pragma pop + +/* 808725A4-808725A8 000018 0004+00 0/1 0/0 0/0 .rodata @3948 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_3948 = -100.0f; +COMPILER_STRIP_GATE(0x808725A4, &lit_3948); +#pragma pop + +inline static void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) { + GXSetTexCoordGen2(dst, type, src, mtx, 0, 125); +} + +inline static void damirror_GXEnd() { + i_GXEnd(); +} + +/* 80870D88-80871268 000248 04E0+00 1/1 0/0 0/0 .text mirrorZdraw__16dMirror_packet_cFPfPfffffff + */ +// Matches with literals (Maybe l_texCoord should be inside) +#ifdef NONMATCHING +void dMirror_packet_c::mirrorZdraw(f32* param_0, f32* param_1, f32 param_2, f32 param_3, + f32 param_4, f32 param_5, f32 param_6, f32 param_7) { + GXSetNumChans(1); + GXSetChanCtrl(GX_COLOR0, 0, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE); + GXSetNumTexGens(0); + GXSetNumTevStages(1); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0); + GXColor color = {0xff,0,0,0}; + GXSetTevColor(GX_TEVREG0, color); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0); + GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); + GXSetZCompLoc(1); + GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_OR); + GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0); + GXSetFog(GX_FOG_NONE, 0.0f, 0.0f, 0.0f, 0.0f, g_clearColor); + GXSetFogRangeAdj(0, 0, NULL); + GXSetCullMode(GX_CULL_BACK); + GXSetNumIndStages(0); + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_DIRECT); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetZMode(1, GX_GEQUAL, 1); + GXLoadPosMtxImm(j3dSys.getViewMtx(), 0); + GXSetCurrentMtx(0); + GXBegin(GX_QUADS, GX_VTXFMT0, 4); + for (int i = 0; i < 4; i++) { + GXPosition3f32(mQuad[i].x, mQuad[i].y, mQuad[i].z); + } + damirror_GXEnd(); + + if (mViewScale.y > 0.0f) { + GXSetZMode(1, GX_ALWAYS, 1); + GXSetColorUpdate(0); + GXSetAlphaUpdate(0); + Mtx44 mtx; + C_MTXOrtho(mtx, param_1[1], param_1[1] + param_1[3], param_1[0], + param_1[0] + param_1[2], 0, 100.0f); + GXSetProjection(mtx, GX_ORTHOGRAPHIC); + GXLoadPosMtxImm(mDoMtx_getIdentity(), 0); + + param_3 -= 1.0f; + param_4 -= 1.0f; + param_5 += 1.0f; + param_6 += 1.0f; + GXBegin(GX_QUADS, GX_VTXFMT0, 4); + GXPosition3f32(param_3, param_4, -100.0f); + GXPosition3f32(param_5, param_4, -100.0f); + GXPosition3f32(param_5, param_6, -100.0f); + GXPosition3f32(param_3, param_6, -100.0f); + damirror_GXEnd(); + GXSetProjectionv(param_0); + GXSetZMode(1, GX_ALWAYS, 1); + GXLoadPosMtxImm(j3dSys.getViewMtx(), 0); + if (GXGetTexObjWidth(&mTexObj)) { + GXLoadTexObj(&mTexObj, GX_TEXMAP0); + GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); + GXSetNumChans(0); + GXSetNumTexGens(1); + GXSetZCompLoc(0); + GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_POS_XYZ, GX_S8, 0); + GXBegin(GX_QUADS, GX_VTXFMT0, 4); + cXyz* ptr = mQuad; + s8* texPtr = (s8*)l_texCoord; + for (int i = 0; i < 4; ptr++, texPtr += 2, i++) { + GXPosition3f32(ptr->x, ptr->y, ptr->z); + GXTexCoord2s8(texPtr[0], texPtr[1]); + } + } else { + GXBegin(GX_QUADS, GX_VTXFMT0, 4); + cXyz* ptr = mQuad; + for (int i = 0; i < 4; ptr++, i++) { + GXPosition3f32(ptr->x, ptr->y, ptr->z); + } + } + damirror_GXEnd(); + } else { + GXSetProjectionv(param_0); + } + + GXSetColorUpdate(1); + GXSetAlphaUpdate(0); +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void dMirror_packet_c::mirrorZdraw(f32* param_0, f32* param_1, f32 param_2, f32 param_3, + f32 param_4, f32 param_5, f32 param_6, f32 param_7) { + nofralloc +#include "asm/rel/d/a/d_a_mirror/d_a_mirror/mirrorZdraw__16dMirror_packet_cFPfPfffffff.s" +} +#pragma pop +#endif + +/* ############################################################################################## */ +/* 808725A8-808725AC 00001C 0004+00 1/1 0/0 0/0 .rodata @3956 */ +SECTION_RODATA static u8 const lit_3956[4] = { + 0x00, + 0x00, + 0x00, + 0x00, +}; +COMPILER_STRIP_GATE(0x808725A8, &lit_3956); + +/* 80871268-8087146C 000728 0204+00 1/1 0/0 0/0 .text + * modelDraw__16dMirror_packet_cFP8J3DModelPA4_f */ +// Matches with literals +#ifdef NONMATCHING +void dMirror_packet_c::modelDraw(J3DModel* param_0, f32 (*param_1)[4]) { + Mtx& baseMtx = param_0->getBaseTRMtx(); + cXyz acStack_3c(baseMtx[0][3], baseMtx[1][3], baseMtx[2][3]); + cXyz cStack_48; + cMtx_multVec(param_1, &acStack_3c, &cStack_48); + cXyz cStack_54; + cMtx_multVec(j3dSys.getViewMtx(), &acStack_3c, &cStack_54); + + if (mViewScale.y > 0.0f && cStack_48.z > cStack_54.z) { + return; + } + + GXColor color = {0}; + color.r = i_dKy_getEnvlight()->mTerrainAmbienceBG0.r; + color.g = i_dKy_getEnvlight()->mTerrainAmbienceBG0.g; + color.b = i_dKy_getEnvlight()->mTerrainAmbienceBG0.b; + color.a = i_dKy_getEnvlight()->mTerrainAmbienceBG0.a; + J3DModelData* modelData = param_0->getModelData(); + u16 materialNum = modelData->getMaterialNum(); + for (u16 i = 0; i < materialNum; i++) { + J3DMatPacket* matPacket = param_0->getMatPacket(i); + J3DShapePacket* shapePacket = matPacket->getShapePacket(); + J3DShape* shape = shapePacket->getShape(); + if (!shape->checkFlag(1)) { + J3DMaterial* material = modelData->getMaterialNodePointer(i); + u32 texGenNum = material->getTexGenBlock()->getTexGenNum(); + u8 colorChanNum = material->getColorBlock()->getColorChanNum(); + u8 tevStageNum = material->getTevBlock()->getTevStageNum(); + u8 indTexStageNum = material->getIndBlock()->getIndTexStageNum(); + material->load(); + matPacket->callDL(); + shape->loadPreDrawSetting(); + if (shapePacket->getDisplayListObj() != NULL) { + shapePacket->getDisplayListObj()->callDL(); + } + GFSetGenMode2(texGenNum, (_GXChannelID)colorChanNum, (_GXTevStageID)tevStageNum, indTexStageNum, GX_CULL_FRONT); + GXColor ambColor = *(GXColor*)&color; + GFSetChanAmbColor(GX_COLOR0, ambColor); + shapePacket->setBaseMtxPtr((Mtx*)param_1); + shapePacket->drawFast(); + shapePacket->setBaseMtxPtr((Mtx*)j3dSys.getViewMtx()); + } + shape->resetVcdVatCache(); + } +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void dMirror_packet_c::modelDraw(J3DModel* param_0, f32 (*param_1)[4]) { + nofralloc +#include "asm/rel/d/a/d_a_mirror/d_a_mirror/modelDraw__16dMirror_packet_cFP8J3DModelPA4_f.s" +} +#pragma pop +#endif + +/* ############################################################################################## */ +/* 808725AC-808725B0 000020 0004+00 0/1 0/0 0/0 .rodata @4345 */ +#pragma push +#pragma force_active on +SECTION_RODATA static u32 const lit_4345 = 0x3C8EFA35; +COMPILER_STRIP_GATE(0x808725AC, &lit_4345); +#pragma pop + +/* 808725B0-808725B4 000024 0004+00 0/1 0/0 0/0 .rodata @4346 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4346 = 0.5f; +COMPILER_STRIP_GATE(0x808725B0, &lit_4346); +#pragma pop + +/* 808725B4-808725B8 000028 0004+00 0/1 0/0 0/0 .rodata @4347 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4347 = 2.0f; +COMPILER_STRIP_GATE(0x808725B4, &lit_4347); +#pragma pop + +/* 808725B8-808725BC 00002C 0004+00 0/1 0/0 0/0 .rodata @4348 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4348 = 304.0f; +COMPILER_STRIP_GATE(0x808725B8, &lit_4348); +#pragma pop + +/* 808725BC-808725C0 000030 0004+00 0/1 0/0 0/0 .rodata @4349 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4349 = 608.0f; +COMPILER_STRIP_GATE(0x808725BC, &lit_4349); +#pragma pop + +/* 808725C0-808725C4 000034 0004+00 0/1 0/0 0/0 .rodata @4350 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4350 = 224.0f; +COMPILER_STRIP_GATE(0x808725C0, &lit_4350); +#pragma pop + +/* 808725C4-808725C8 000038 0004+00 0/1 0/0 0/0 .rodata @4351 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4351 = 448.0f; +COMPILER_STRIP_GATE(0x808725C4, &lit_4351); +#pragma pop + +/* 808725C8-808725CC 00003C 0004+00 0/1 0/0 0/0 .rodata @4352 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4352 = 8.0f; +COMPILER_STRIP_GATE(0x808725C8, &lit_4352); +#pragma pop + +/* 808725CC-808725D4 000040 0004+04 0/2 0/0 0/0 .rodata @4353 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4353[1 + 1 /* padding */] = { + -1.0f, + /* padding */ + 0.0f, +}; +COMPILER_STRIP_GATE(0x808725CC, &lit_4353); +#pragma pop + +/* 808725D4-808725DC 000048 0008+00 0/1 0/0 0/0 .rodata @4355 */ +#pragma push +#pragma force_active on +SECTION_RODATA static u8 const lit_4355[8] = { + 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +COMPILER_STRIP_GATE(0x808725D4, &lit_4355); +#pragma pop + +/* 8087146C-80871D84 00092C 0918+00 1/1 0/0 0/1 .text mainDraw__16dMirror_packet_cFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void dMirror_packet_c::mainDraw() { + nofralloc +#include "asm/rel/d/a/d_a_mirror/d_a_mirror/mainDraw__16dMirror_packet_cFv.s" +} +#pragma pop + +/* 80871D84-80871E24 001244 00A0+00 1/0 0/0 0/0 .text draw__16dMirror_packet_cFv */ +void dMirror_packet_c::draw() { + mDoLib_clipper::changeFar(dComIfGd_getView()->mFar); + s32 clipRes = mDoLib_clipper::clip(j3dSys.getViewMtx(), &mMaxVal, &mMinVal); + if (clipRes == 0) { + mainDraw(); + } + mDoLib_clipper::resetFar(); + reset(); +} + +/* 80871E24-80871E84 0012E4 0060+00 1/1 0/0 0/0 .text __ct__10daMirror_cFv */ +daMirror_c::daMirror_c() { + m_entryModel = &daMirror_c::entryModel; +} + +/* 80871E84-80871F08 001344 0084+00 1/0 0/0 0/0 .text __dt__16dMirror_packet_cFv */ +dMirror_packet_c::~dMirror_packet_c() { +} + +/* 80871F08-80871F78 0013C8 0070+00 1/1 0/0 0/0 .text createHeap__10daMirror_cFv */ +bool daMirror_c::createHeap() { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); + field_0x6f8 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + return (field_0x6f8 != NULL); +} + +/* 80871F78-80872018 001438 00A0+00 1/1 0/0 0/0 .text setModelMtx__10daMirror_cFv */ +void daMirror_c::setModelMtx() { + field_0x6f8->setBaseScale(mScale); + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::YrotM(shape_angle.y); + mDoMtx_stack_c::XrotM(shape_angle.x); + mDoMtx_stack_c::ZrotM(0x2000); + field_0x6f8->i_setBaseTRMtx(mDoMtx_stack_c::get()); +} + +/* 80872018-8087206C 0014D8 0054+00 1/0 0/0 0/0 .text daMirror_create__FP10daMirror_c */ +static int daMirror_create(daMirror_c* i_this) { + fopAcM_SetupActor(i_this, daMirror_c); + return i_this->daMirror_c::create(); +} + +/* ############################################################################################## */ +/* 808725DC-8087260C 000050 0030+00 0/0 0/0 0/0 .rodata @4406 */ +#pragma push +#pragma force_active on +SECTION_RODATA static u8 const lit_4406[48] = { + 0xC2, 0x91, 0x00, 0x00, 0x43, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x91, 0x00, 0x00, + 0x43, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC2, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +COMPILER_STRIP_GATE(0x808725DC, &lit_4406); +#pragma pop + +/* 8087260C-8087263C 000080 0030+00 1/1 0/0 0/0 .rodata + * l_mirrorQuad$localstatic3$create__10daMirror_cFv */ +SECTION_RODATA static Vec const data_8087260C[4] = { + {-50.0f, 100.0f, 0.0f}, {50.0f, 100.0f, 0.0f}, + {50.0f, 0.0f, 0.0f}, {-50.0f, 0.0f, 0.0f}, +}; +COMPILER_STRIP_GATE(0x8087260C, &data_8087260C); + +/* 8087263C-80872648 0000B0 000C+00 1/1 0/0 0/0 .rodata + * l_mirrorLook$localstatic4$create__10daMirror_cFv */ +SECTION_RODATA static Vec const data_8087263C = { + 0.0f, 50.0f, 0.0f, +}; +COMPILER_STRIP_GATE(0x8087263C, &data_8087263C); + +/* 80872648-8087264C 0000BC 0004+00 0/1 0/0 0/0 .rodata @4544 */ +#pragma push +#pragma force_active on +SECTION_RODATA static f32 const lit_4544 = 10.0f; +COMPILER_STRIP_GATE(0x80872648, &lit_4544); +#pragma pop + +/* 8087206C-80872344 00152C 02D8+00 2/2 0/0 0/0 .text create__10daMirror_cFv */ +// regalloc, static var load +#ifdef NONMATCHING +int daMirror_c::create() { + if (getSw() != 0xff && !i_fopAcM_isSwitch(this, getSw())) { + return 4; + } + + if (m_myObj != NULL) { + return 0; + } + + s32 type = getType(); + if (type == 2) { + request_of_phase_process_class* phase = (request_of_phase_process_class*)this; + if (this) { + phase = &mPhase; + } + int res = dComIfG_resLoad(phase, l_arcName); + switch (res) { + default: + return res; + case cPhs_COMPLEATE_e: + if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)daMirror_c_createHeap, 0x1540)) { + return 5; + } + break; + } + + setModelMtx(); + void* uVar2 = dComIfG_getObjectRes(l_arcName, 7); + GXTexObj& texObj = mPacket.getTexObj(); + mDoLib_setResTimgObj((ResTIMG*)uVar2, &texObj, 0, NULL); + Vec src[4] = { + {-72.5f, 145.0f, 0.0f}, {72.5f, 145.0f, 0.0f}, + {72.5f, 0.0f, 0.0f}, {-72.5f, 0.0f, 0.0f}, + }; + mDoMtx_stack_c::scaleS(mScale); + mDoMtx_stack_c::revConcat(field_0x6f8->getBaseTRMtx()); + cMtx_multVecArray(mDoMtx_stack_c::get(), src, mPacket.getQuad(), 4); + mPacket.getViewScale().set(-1.0f, 1.0f, 1.0f); + } else { + if (type == 1) { + mScale *= 10.0f; + mPacket.getViewScale().set(1.0,-1.0,1.0); + } else { + if (type == 3) { + request_of_phase_process_class* phase = (request_of_phase_process_class*)this; + if (this) { + phase = &mPhase; + } + int res = dComIfG_resLoad(phase, l_arcName2); + switch (res) { + default: + return res; + case cPhs_COMPLEATE_e: + void* objRes = dComIfG_getObjectRes(l_arcName2, 0x25); + mDoLib_setResTimgObj((ResTIMG*)objRes, &mPacket.getTexObj(), 0, NULL); + break; + } + } + mPacket.getViewScale().set(-1.0f, 1.0f, 1.0f); + } + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::YrotM(shape_angle.y); + mDoMtx_stack_c::XrotM(shape_angle.x); + mDoMtx_stack_c::scaleM(mScale.x, mScale.y, mScale.z); + static Vec const data_8087260Cb[4] = { + {-50.0f, 100.0f, 0.0f}, {50.0f, 100.0f, 0.0f}, + {50.0f, 0.0f, 0.0f}, {-50.0f, 0.0f, 0.0f}, + }; + mDoMtx_stack_c::multVecArray(data_8087260Cb, + mPacket.getQuad(), 4); + } + m_myObj = this; + mPacket.calcMinMax(); + static Vec const data_8087263C_a = { + 0.0f, 50.0f, 0.0f, + }; + mDoMtx_stack_c::multVec(&data_8087263C_a, &mEyePos); + return 4; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daMirror_c::create() { + nofralloc +#include "asm/rel/d/a/d_a_mirror/d_a_mirror/create__10daMirror_cFv.s" +} +#pragma pop +#endif + +/* 80872344-808723C4 001804 0080+00 1/0 0/0 0/0 .text daMirror_Delete__FP10daMirror_c */ +static int daMirror_Delete(daMirror_c* param_0) { + s32 mirrorType = param_0->getType(); + if (mirrorType == 2) { + dComIfG_resDelete(param_0 ? ¶m_0->mPhase : (request_of_phase_process_class*)param_0, l_arcName); + } else if (mirrorType == 3) { + dComIfG_resDelete(param_0 ? ¶m_0->mPhase: (request_of_phase_process_class*)param_0, l_arcName2); + } + daMirror_c::m_myObj = NULL; + return 1; +} + +/* 808723C4-808723E4 001884 0020+00 1/0 0/0 0/0 .text daMirror_execute__FP10daMirror_c */ +static int daMirror_execute(daMirror_c* param_0) { + return param_0->execute(); +} + +/* ############################################################################################## */ +/* 8087264C-80872650 0000C0 0004+00 1/1 0/0 0/0 .rodata @4574 */ +SECTION_RODATA static f32 const lit_4574 = 40000.0f; +COMPILER_STRIP_GATE(0x8087264C, &lit_4574); + +/* 808723E4-808724C0 0018A4 00DC+00 1/1 0/0 0/0 .text execute__10daMirror_cFv */ +// Matches with literals +#ifdef NONMATCHING +int daMirror_c::execute() { + if (this != m_myObj) { + if (m_myObj == NULL) { + if (create() == 5) { + fopAcM_delete(this); + } + } + return 1; + } + + daPy_py_c* player = daPy_getLinkPlayerActorClass(); + if (mPacket.getViewScale().y > 0.0f && + player->getKandelaarFlamePos() && + fopAcM_searchActorDistance2(this, player) < 40000.0f) + { + if (fopAcM_seenActorAngleY(this, player) < 0x4000) { + daPy_py_c::setLookPos(&mEyePos); + } + } + return 1; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daMirror_c::execute() { + nofralloc +#include "asm/rel/d/a/d_a_mirror/d_a_mirror/execute__10daMirror_cFv.s" +} +#pragma pop +#endif + +/* 808724C0-80872560 001980 00A0+00 1/0 0/0 0/0 .text daMirror_draw__FP10daMirror_c */ +static int daMirror_draw(daMirror_c* param_0) { + if (param_0 != daMirror_c::m_myObj) { + return 1; + } + + if (param_0->field_0x6f8) { + g_env_light.settingTevStruct(0x10, ¶m_0->current.pos, ¶m_0->mTevStr); + g_env_light.setLightTevColorType(param_0->field_0x6f8->mModelData, ¶m_0->mTevStr); + mDoExt_modelUpdateDL(param_0->field_0x6f8); + } + + dComIfGd_getOpaListBG()->entryImm(¶m_0->mPacket, 0); + return 1; +} + +/* 80872560-80872584 001A20 0024+00 1/0 0/0 0/0 .text entryModel__10daMirror_cFP8J3DModel + */ +int daMirror_c::entryModel(J3DModel* param_0) { + return mPacket.entryModel(param_0); +} + +/* 80872650-80872650 0000C4 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 80872674-80872694 -00001 0020+00 1/0 0/0 0/0 .data daMirror_METHODS */ +static actor_method_class daMirror_METHODS = { + (process_method_func)daMirror_create, + (process_method_func)daMirror_Delete, + (process_method_func)daMirror_execute, + (process_method_func)NULL, + (process_method_func)daMirror_draw, +}; + +/* 80872694-808726C4 -00001 0030+00 0/0 0/0 1/0 .data g_profile_MIRROR */ +extern actor_process_profile_definition g_profile_MIRROR = { + fpcLy_CURRENT_e, + 7, + fpcPi_CURRENT_e, + PROC_MIRROR, + &g_fpcLf_Method.mBase, + sizeof(daMirror_c), + 0, + 0, + &g_fopAc_Method.base, + 757, + &daMirror_METHODS, + 0x00060000, + 5, + fopAc_CULLBOX_0_e, +}; diff --git a/src/d/d_resorce.cpp b/src/d/d_resorce.cpp index 948c4d069ee..fb92cf9df7a 100644 --- a/src/d/d_resorce.cpp +++ b/src/d/d_resorce.cpp @@ -305,7 +305,7 @@ static void addWarpMaterial(J3DModelData* param_1) { u32 texGenNum = texGenBlock->getTexGenNum(); J3DTexCoord* coord = texGenBlock->getTexCoord(texGenNum); l_texCoordInfo.mTexGenMtx = texGenNum * 3 + 0x1e; - coord->setTexCoordInfo(&l_texCoordInfo); + coord->setTexCoordInfo(l_texCoordInfo); coord->resetTexMtxReg(); texGenBlock->setTexGenNum(texGenNum + 1); texGenBlock->setTexMtx(texGenNum, texMtxInfo); diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index c3276162476..d70a85199cd 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -441,10 +441,6 @@ extern "C" void _restgpr_26(); extern "C" void _restgpr_27(); extern "C" void _restgpr_28(); extern "C" void _restgpr_29(); -extern "C" extern u8 const j3dDefaultTexCoordInfo[32]; -extern "C" extern u8 const j3dDefaultIndTexMtxInfo[28]; -extern "C" extern u8 const j3dDefaultTevStageInfo[20]; -extern "C" extern u8 const j3dDefaultIndTevStageInfo[12]; extern "C" extern void* __vt__9J3DPacket[5]; extern "C" extern void* __vt__8J3DModel[9]; extern "C" u8 mCurrentMtx__6J3DSys[48]; @@ -453,11 +449,7 @@ extern "C" u8 sGDLObj__17J3DDisplayListObj[16]; extern "C" u8 sCurrentHeap__7JKRHeap[4]; extern "C" u8 sOldVcdVatCmd__8J3DShape[4]; extern "C" u8 mJoint__10J3DMtxCalc[4]; -extern "C" extern u32 j3dDefaultTevOrderInfoNull; -extern "C" extern u32 j3dDefaultIndTexOrderNull; -extern "C" extern u8 j3dDefaultIndTexCoordScaleInfo[4]; extern "C" extern u8 j3dDefaultTevSwapMode[4]; -extern "C" extern u8 j3dDefaultColorChanInfo[8]; extern "C" extern u16 data_804563F8; // @@ -1859,7 +1851,8 @@ void J3DIndBlock::setIndTexCoordScale(u32 param_0, J3DIndTexCoordScale param_1) #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DIndTexCoordScale::~J3DIndTexCoordScale() { +// asm J3DIndTexCoordScale::~J3DIndTexCoordScale() { +extern "C" asm void __dt__19J3DIndTexCoordScaleFv() { nofralloc #include "asm/m_Do/m_Do_ext/__dt__19J3DIndTexCoordScaleFv.s" } @@ -1875,7 +1868,8 @@ void J3DIndBlock::setIndTexMtx(u32 param_0, J3DIndTexMtx param_1) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DIndTexMtx::~J3DIndTexMtx() { +// asm J3DIndTexMtx::~J3DIndTexMtx() { +extern "C" asm void __dt__12J3DIndTexMtxFv() { nofralloc #include "asm/m_Do/m_Do_ext/__dt__12J3DIndTexMtxFv.s" } @@ -1985,7 +1979,8 @@ void J3DColorBlock::setColorChanNum(u8 param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DIndTexCoordScale::J3DIndTexCoordScale() { +// asm J3DIndTexCoordScale::J3DIndTexCoordScale() { +extern "C" asm void __ct__19J3DIndTexCoordScaleFv() { nofralloc #include "asm/m_Do/m_Do_ext/__ct__19J3DIndTexCoordScaleFv.s" } @@ -1995,7 +1990,8 @@ asm J3DIndTexCoordScale::J3DIndTexCoordScale() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DIndTexMtx::J3DIndTexMtx() { +// asm J3DIndTexMtx::J3DIndTexMtx() { +extern "C" asm void __ct__12J3DIndTexMtxFv() { nofralloc #include "asm/m_Do/m_Do_ext/__ct__12J3DIndTexMtxFv.s" } @@ -2005,7 +2001,8 @@ asm J3DIndTexMtx::J3DIndTexMtx() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DIndTexOrder::J3DIndTexOrder() { +// asm J3DIndTexOrder::J3DIndTexOrder() { +extern "C" asm void __ct__14J3DIndTexOrderFv() { nofralloc #include "asm/m_Do/m_Do_ext/__ct__14J3DIndTexOrderFv.s" } @@ -2025,7 +2022,8 @@ asm J3DTevSwapModeTable::J3DTevSwapModeTable() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DTevOrder::J3DTevOrder() { +// asm J3DTevOrder::J3DTevOrder() { +extern "C" asm void __ct__11J3DTevOrderFv() { nofralloc #include "asm/m_Do/m_Do_ext/__ct__11J3DTevOrderFv.s" } @@ -2035,7 +2033,8 @@ asm J3DTevOrder::J3DTevOrder() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DIndTevStage::J3DIndTevStage() { +// asm J3DIndTevStage::J3DIndTevStage() { +extern "C" asm void __ct__14J3DIndTevStageFv() { nofralloc #include "asm/m_Do/m_Do_ext/__ct__14J3DIndTevStageFv.s" } @@ -2072,7 +2071,8 @@ extern "C" void __ct__13J3DGXColorS10Fv() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DTexCoord::J3DTexCoord() { +// asm J3DTexCoord::J3DTexCoord() { +extern "C" asm void __ct__11J3DTexCoordFv() { nofralloc #include "asm/m_Do/m_Do_ext/__ct__11J3DTexCoordFv.s" } @@ -2082,7 +2082,8 @@ asm J3DTexCoord::J3DTexCoord() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm J3DColorChan::J3DColorChan() { +// asm J3DColorChan::J3DColorChan() { +extern "C" asm void __ct__12J3DColorChanFv() { nofralloc #include "asm/m_Do/m_Do_ext/__ct__12J3DColorChanFv.s" } diff --git a/src/m_Do/m_Do_lib.cpp b/src/m_Do/m_Do_lib.cpp index 449912f8a26..e6fa30cbf85 100644 --- a/src/m_Do/m_Do_lib.cpp +++ b/src/m_Do/m_Do_lib.cpp @@ -1,126 +1,132 @@ -/** - * m_Do_lib.cpp - * View and Projection Matrix Helper Functions - */ - -#include "m_Do/m_Do_lib.h" -#include "JSystem/JUtility/JUTTexture.h" -#include "SSystem/SComponent/c_math.h" -#include "d/com/d_com_inf_game.h" -#include "dolphin/types.h" - -/* 8001513C-8001528C 00FA7C 0150+00 0/0 3/3 2/2 .text - * mDoLib_setResTimgObj__FPC7ResTIMGP9_GXTexObjUlP10_GXTlutObj */ -u8 mDoLib_setResTimgObj(ResTIMG const* res, _GXTexObj* o_texObj, u32 tlut_name, - _GXTlutObj* o_tlutObj) { - ResTIMG* _res = (ResTIMG*)res; - - if (_res->indexTexture) { - GXInitTlutObj(o_tlutObj, (void*)((u8*)_res + _res->paletteOffset), - (GXTlutFmt)_res->colorFormat, _res->numColors); - GXInitTexObjCI(o_texObj, (void*)((u8*)_res + _res->imageOffset), _res->width, _res->height, - (GXCITexFmt)_res->format, (GXTexWrapMode)_res->wrapS, - (GXTexWrapMode)_res->wrapT, _res->mipmapCount > 1, tlut_name); - } else { - GXInitTexObj(o_texObj, (void*)((u8*)_res + _res->imageOffset), _res->width, _res->height, - (GXTexFmt)_res->format, (GXTexWrapMode)_res->wrapS, (GXTexWrapMode)_res->wrapT, - _res->mipmapCount > 1); - } - GXInitTexObjLOD(o_texObj, (GXTexFilter)_res->minFilter, (GXTexFilter)_res->magFilter, - (f32)_res->minLOD * 0.125f, (f32)_res->maxLOD * 0.125f, - (f32)_res->LODBias * 0.01f, (s32)_res->biasClamp, (s32)_res->doEdgeLOD, - (GXAnisotropy)_res->maxAnisotropy); - - return _res->indexTexture; -} - -/* 803DD8E4-803DD940 00A604 005C+00 2/2 5/5 5/5 .bss mClipper__14mDoLib_clipper */ -J3DUClipper mDoLib_clipper::mClipper; - -/* 80450C70-80450C74 000170 0004+00 1/1 2/2 4/4 .sbss mSystemFar__14mDoLib_clipper */ -f32 mDoLib_clipper::mSystemFar; - -/* 80450C74-80450C78 000174 0004+00 1/1 1/1 0/0 .sbss mFovyRate__14mDoLib_clipper */ -f32 mDoLib_clipper::mFovyRate; - -/* 8001528C-80015310 00FBCC 0084+00 0/0 1/1 0/0 .text setup__14mDoLib_clipperFffff */ -void mDoLib_clipper::setup(f32 fovy, f32 aspect, f32 near, f32 far) { - mClipper.setFovy(fovy); - mClipper.setAspect(aspect); - mClipper.setNear(near); - mClipper.setFar(far); - mSystemFar = far; - mClipper.calcViewFrustum(); - - s16 tmp = fovy * 182.04444885253906f; - - mFovyRate = cM_scos(tmp) / cM_ssin(tmp); -} - -/* 80015310-800154EC 00FC50 01DC+00 0/0 21/21 23/23 .text mDoLib_project__FP3VecP3Vec */ -void mDoLib_project(Vec* src, Vec* dst) { - if (dComIfGd_getView() == NULL) { - dst->x = 0.0f; - dst->y = 0.0f; - dst->z = 0.0f; - return; - } - Mtx44* projMtx = dComIfGd_getProjViewMtx(); - Vec multVec; - cMtx_multVec(*projMtx, src, &multVec); - - float calcFloat = (src->x * (*dComIfGd_getProjViewMtx())[3][0]) + - (src->y * (*dComIfGd_getProjViewMtx())[3][1]) + - (src->z * (*dComIfGd_getProjViewMtx())[3][2]) + - (*dComIfGd_getProjViewMtx())[3][3]; - if (multVec.z >= 0.0f) { - multVec.z = 0.0f; - } - float f3; - if (calcFloat <= 0.0f) { - if (calcFloat == 0.0f) { - dst->z = multVec.z * 500000.0f; - } else { - dst->z = multVec.z * (0.5f / calcFloat); - } - f3 = 500000.0f; - } else { - f3 = 0.5f / calcFloat; - dst->z = multVec.z * f3; - } - - view_port_class* viewPort = dComIfGd_getViewport(); - float xOffset; - float yOffset; - float xSize; - float ySize; - if (viewPort->mXOrig != 0.0f) { - xOffset = (0.5f * ((2.0f * viewPort->mXOrig) + viewPort->mWidth)) - 304.0f; - xSize = 608.0f; - } else { - xOffset = viewPort->mXOrig; - xSize = viewPort->mWidth; - } - - if (viewPort->mYOrig != 0.0f) { - yOffset = (0.5f * ((2.0f * viewPort->mYOrig) + viewPort->mHeight)) - 224.0f; - ySize = 448.0f; - } else { - yOffset = viewPort->mYOrig; - ySize = viewPort->mHeight; - } - - dst->x = ((0.5f + (multVec.x * f3)) * xSize) + xOffset; - dst->y = ((0.5f + (multVec.y * (-f3))) * ySize) + yOffset; -} - -/* 800154EC-80015544 00FE2C 0058+00 0/0 2/2 9/9 .text mDoLib_pos2camera__FP3VecP3Vec */ -void mDoLib_pos2camera(Vec* src, Vec* dst) { - if (dComIfGd_getView() == NULL) { - dst->x = 0.0f; - dst->y = 0.0f; - dst->z = 0.0f; - return; - } - cMtx_multVec(dComIfGd_getView()->mViewMtx, src, dst); -} +/** + * m_Do_lib.cpp + * View and Projection Matrix Helper Functions + */ + +#include "m_Do/m_Do_lib.h" +#include "JSystem/J3DGraphBase/J3DMatBlock.h" +#include "JSystem/JUtility/JUTTexture.h" +#include "SSystem/SComponent/c_math.h" +#include "d/com/d_com_inf_game.h" +#include "dolphin/types.h" + +/* 8001513C-8001528C 00FA7C 0150+00 0/0 3/3 2/2 .text + * mDoLib_setResTimgObj__FPC7ResTIMGP9_GXTexObjUlP10_GXTlutObj */ +u8 mDoLib_setResTimgObj(ResTIMG const* res, _GXTexObj* o_texObj, u32 tlut_name, + _GXTlutObj* o_tlutObj) { + ResTIMG* _res = (ResTIMG*)res; + + if (_res->indexTexture) { + GXInitTlutObj(o_tlutObj, (void*)((u8*)_res + _res->paletteOffset), + (GXTlutFmt)_res->colorFormat, _res->numColors); + GXInitTexObjCI(o_texObj, (void*)((u8*)_res + _res->imageOffset), _res->width, _res->height, + (GXCITexFmt)_res->format, (GXTexWrapMode)_res->wrapS, + (GXTexWrapMode)_res->wrapT, _res->mipmapCount > 1, tlut_name); + } else { + GXInitTexObj(o_texObj, (void*)((u8*)_res + _res->imageOffset), _res->width, _res->height, + (GXTexFmt)_res->format, (GXTexWrapMode)_res->wrapS, (GXTexWrapMode)_res->wrapT, + _res->mipmapCount > 1); + } + GXInitTexObjLOD(o_texObj, (GXTexFilter)_res->minFilter, (GXTexFilter)_res->magFilter, + (f32)_res->minLOD * 0.125f, (f32)_res->maxLOD * 0.125f, + (f32)_res->LODBias * 0.01f, (s32)_res->biasClamp, (s32)_res->doEdgeLOD, + (GXAnisotropy)_res->maxAnisotropy); + + return _res->indexTexture; +} + +/* 803DD8E4-803DD940 00A604 005C+00 2/2 5/5 5/5 .bss mClipper__14mDoLib_clipper */ +J3DUClipper mDoLib_clipper::mClipper; + +/* 80450C70-80450C74 000170 0004+00 1/1 2/2 4/4 .sbss mSystemFar__14mDoLib_clipper */ +f32 mDoLib_clipper::mSystemFar; + +/* 80450C74-80450C78 000174 0004+00 1/1 1/1 0/0 .sbss mFovyRate__14mDoLib_clipper */ +f32 mDoLib_clipper::mFovyRate; + +/* 8001528C-80015310 00FBCC 0084+00 0/0 1/1 0/0 .text setup__14mDoLib_clipperFffff */ +void mDoLib_clipper::setup(f32 fovy, f32 aspect, f32 near, f32 far) { + mClipper.setFovy(fovy); + mClipper.setAspect(aspect); + mClipper.setNear(near); + mClipper.setFar(far); + mSystemFar = far; + mClipper.calcViewFrustum(); + + s16 tmp = fovy * 182.04444885253906f; + + mFovyRate = cM_scos(tmp) / cM_ssin(tmp); +} + +/* 80015310-800154EC 00FC50 01DC+00 0/0 21/21 23/23 .text mDoLib_project__FP3VecP3Vec */ +void mDoLib_project(Vec* src, Vec* dst) { + if (dComIfGd_getView() == NULL) { + dst->x = 0.0f; + dst->y = 0.0f; + dst->z = 0.0f; + return; + } + Mtx44* projMtx = dComIfGd_getProjViewMtx(); + Vec multVec; + cMtx_multVec(*projMtx, src, &multVec); + + float calcFloat = (src->x * (*dComIfGd_getProjViewMtx())[3][0]) + + (src->y * (*dComIfGd_getProjViewMtx())[3][1]) + + (src->z * (*dComIfGd_getProjViewMtx())[3][2]) + + (*dComIfGd_getProjViewMtx())[3][3]; + if (multVec.z >= 0.0f) { + multVec.z = 0.0f; + } + float f3; + if (calcFloat <= 0.0f) { + if (calcFloat == 0.0f) { + dst->z = multVec.z * 500000.0f; + } else { + dst->z = multVec.z * (0.5f / calcFloat); + } + f3 = 500000.0f; + } else { + f3 = 0.5f / calcFloat; + dst->z = multVec.z * f3; + } + + view_port_class* viewPort = dComIfGd_getViewport(); + float xOffset; + float yOffset; + float xSize; + float ySize; + if (viewPort->mXOrig != 0.0f) { + xOffset = (0.5f * ((2.0f * viewPort->mXOrig) + viewPort->mWidth)) - 304.0f; + xSize = 608.0f; + } else { + xOffset = viewPort->mXOrig; + xSize = viewPort->mWidth; + } + + if (viewPort->mYOrig != 0.0f) { + yOffset = (0.5f * ((2.0f * viewPort->mYOrig) + viewPort->mHeight)) - 224.0f; + ySize = 448.0f; + } else { + yOffset = viewPort->mYOrig; + ySize = viewPort->mHeight; + } + + dst->x = ((0.5f + (multVec.x * f3)) * xSize) + xOffset; + dst->y = ((0.5f + (multVec.y * (-f3))) * ySize) + yOffset; +} + +/* 800154EC-80015544 00FE2C 0058+00 0/0 2/2 9/9 .text mDoLib_pos2camera__FP3VecP3Vec */ +void mDoLib_pos2camera(Vec* src, Vec* dst) { + if (dComIfGd_getView() == NULL) { + dst->x = 0.0f; + dst->y = 0.0f; + dst->z = 0.0f; + return; + } + cMtx_multVec(dComIfGd_getView()->mViewMtx, src, dst); +} + +// Fake function to make the weak function calcAlphaCmpID appear in this TU +u32 mDoLib_calcAlphaCmpID(u8 param_0, u8 param_1, u8 param_2) { + return calcAlphaCmpID(param_0, param_1, param_2); +}