donut-decomp/asm/libnw4r_g3d/g3d_calcmaterial_800f1470.s

175 lines
8.6 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global CalcMaterialDirectly__Q24nw4r3g3dFQ34nw4r3g3d6ResMdlPQ34nw4r3g3d12AnmObjTexPatPQ34nw4r3g3d12AnmObjTexSrtPQ34nw4r3g3d12AnmObjMatClr
CalcMaterialDirectly__Q24nw4r3g3dFQ34nw4r3g3d6ResMdlPQ34nw4r3g3d12AnmObjTexPatPQ34nw4r3g3d12AnmObjTexSrtPQ34nw4r3g3d12AnmObjMatClr:
/* 800F1470 000ED2B0 94 21 FE 20 */ stwu r1, -0x1e0(r1)
/* 800F1474 000ED2B4 7C 08 02 A6 */ mflr r0
/* 800F1478 000ED2B8 90 01 01 E4 */ stw r0, 0x1e4(r1)
/* 800F147C 000ED2BC 39 61 01 E0 */ addi r11, r1, 0x1e0
/* 800F1480 000ED2C0 4B F1 5E A5 */ bl lbl_80007324
/* 800F1484 000ED2C4 7C 77 1B 78 */ mr r23, r3
/* 800F1488 000ED2C8 7C 98 23 78 */ mr r24, r4
/* 800F148C 000ED2CC 7C B9 2B 78 */ mr r25, r5
/* 800F1490 000ED2D0 7C DA 33 78 */ mr r26, r6
/* 800F1494 000ED2D4 4B FD 98 7D */ bl GetResMatNumEntries__Q34nw4r3g3d6ResMdlCFv
/* 800F1498 000ED2D8 7C 7C 1B 78 */ mr r28, r3
/* 800F149C 000ED2DC 3B E1 00 C8 */ addi r31, r1, 0xc8
/* 800F14A0 000ED2E0 3B A1 00 A8 */ addi r29, r1, 0xa8
/* 800F14A4 000ED2E4 3B 60 00 00 */ li r27, 0x0
/* 800F14A8 000ED2E8 3B C0 00 00 */ li r30, 0x0
/* 800F14AC 000ED2EC 48 00 01 D8 */ b lbl_800F1684
.global lbl_800F14B0
lbl_800F14B0:
/* 800F14B0 000ED2F0 7E E3 BB 78 */ mr r3, r23
/* 800F14B4 000ED2F4 7F 64 DB 78 */ mr r4, r27
/* 800F14B8 000ED2F8 4B FD 97 F9 */ bl GetResMat__Q34nw4r3g3d6ResMdlCFi
/* 800F14BC 000ED2FC 2C 18 00 00 */ cmpwi r24, 0x0
/* 800F14C0 000ED300 7C 76 1B 78 */ mr r22, r3
/* 800F14C4 000ED304 41 82 00 B4 */ beq lbl_800F1578
/* 800F14C8 000ED308 7F 03 C3 78 */ mr r3, r24
/* 800F14CC 000ED30C 7F 64 DB 78 */ mr r4, r27
/* 800F14D0 000ED310 4B FE 35 C1 */ bl TestExistence__Q34nw4r3g3d12AnmObjMatClrCFUl
/* 800F14D4 000ED314 2C 03 00 00 */ cmpwi r3, 0x0
/* 800F14D8 000ED318 41 82 00 A0 */ beq lbl_800F1578
/* 800F14DC 000ED31C 38 61 00 8C */ addi r3, r1, 0x8c
/* 800F14E0 000ED320 93 C1 00 88 */ stw r30, 0x88(r1)
/* 800F14E4 000ED324 7C 03 E8 40 */ cmplw r3, r29
/* 800F14E8 000ED328 40 80 00 24 */ bge lbl_800F150C
/* 800F14EC 000ED32C 38 1D 00 03 */ addi r0, r29, 0x3
/* 800F14F0 000ED330 7C 03 00 50 */ subf r0, r3, r0
/* 800F14F4 000ED334 54 00 F0 BE */ srwi r0, r0, 2
/* 800F14F8 000ED338 7C 09 03 A6 */ mtctr r0
/* 800F14FC 000ED33C 40 80 00 10 */ bge lbl_800F150C
.global lbl_800F1500
lbl_800F1500:
/* 800F1500 000ED340 93 C3 00 00 */ stw r30, 0x0(r3)
/* 800F1504 000ED344 38 63 00 04 */ addi r3, r3, 0x4
/* 800F1508 000ED348 42 00 FF F8 */ bdnz lbl_800F1500
.global lbl_800F150C
lbl_800F150C:
/* 800F150C 000ED34C 38 61 00 AC */ addi r3, r1, 0xac
/* 800F1510 000ED350 93 C1 00 A8 */ stw r30, 0xa8(r1)
/* 800F1514 000ED354 7C 03 F8 40 */ cmplw r3, r31
/* 800F1518 000ED358 40 80 00 24 */ bge lbl_800F153C
/* 800F151C 000ED35C 38 1F 00 03 */ addi r0, r31, 0x3
/* 800F1520 000ED360 7C 03 00 50 */ subf r0, r3, r0
/* 800F1524 000ED364 54 00 F0 BE */ srwi r0, r0, 2
/* 800F1528 000ED368 7C 09 03 A6 */ mtctr r0
/* 800F152C 000ED36C 40 80 00 10 */ bge lbl_800F153C
.global lbl_800F1530
lbl_800F1530:
/* 800F1530 000ED370 93 C3 00 00 */ stw r30, 0x0(r3)
/* 800F1534 000ED374 38 63 00 04 */ addi r3, r3, 0x4
/* 800F1538 000ED378 42 00 FF F8 */ bdnz lbl_800F1530
.global lbl_800F153C
lbl_800F153C:
/* 800F153C 000ED37C 81 98 00 00 */ lwz r12, 0x0(r24)
/* 800F1540 000ED380 7F 03 C3 78 */ mr r3, r24
/* 800F1544 000ED384 7F 65 DB 78 */ mr r5, r27
/* 800F1548 000ED388 38 81 00 84 */ addi r4, r1, 0x84
/* 800F154C 000ED38C 81 8C 00 38 */ lwz r12, 0x38(r12)
/* 800F1550 000ED390 7D 89 03 A6 */ mtctr r12
/* 800F1554 000ED394 4E 80 04 21 */ bctrl
/* 800F1558 000ED398 38 96 01 44 */ addi r4, r22, 0x144
/* 800F155C 000ED39C 38 16 00 40 */ addi r0, r22, 0x40
/* 800F1560 000ED3A0 90 81 00 18 */ stw r4, 0x18(r1)
/* 800F1564 000ED3A4 7C 65 1B 78 */ mr r5, r3
/* 800F1568 000ED3A8 38 61 00 1C */ addi r3, r1, 0x1c
/* 800F156C 000ED3AC 38 81 00 18 */ addi r4, r1, 0x18
/* 800F1570 000ED3B0 90 01 00 1C */ stw r0, 0x1c(r1)
/* 800F1574 000ED3B4 4B FE 55 DD */ bl ApplyTexPatAnmResult__Q24nw4r3g3dFQ34nw4r3g3d9ResTexObjQ34nw4r3g3d10ResTlutObjPCQ34nw4r3g3d15TexPatAnmResult
.global lbl_800F1578
lbl_800F1578:
/* 800F1578 000ED3B8 2C 19 00 00 */ cmpwi r25, 0x0
/* 800F157C 000ED3BC 41 82 00 80 */ beq lbl_800F15FC
/* 800F1580 000ED3C0 7F 23 CB 78 */ mr r3, r25
/* 800F1584 000ED3C4 7F 64 DB 78 */ mr r4, r27
/* 800F1588 000ED3C8 4B FE 35 09 */ bl TestExistence__Q34nw4r3g3d12AnmObjMatClrCFUl
/* 800F158C 000ED3CC 2C 03 00 00 */ cmpwi r3, 0x0
/* 800F1590 000ED3D0 41 82 00 6C */ beq lbl_800F15FC
/* 800F1594 000ED3D4 80 16 00 3C */ lwz r0, 0x3c(r22)
/* 800F1598 000ED3D8 3A B6 01 A8 */ addi r21, r22, 0x1a8
/* 800F159C 000ED3DC 2C 00 00 00 */ cmpwi r0, 0x0
/* 800F15A0 000ED3E0 41 82 00 0C */ beq lbl_800F15AC
/* 800F15A4 000ED3E4 7C 76 02 14 */ add r3, r22, r0
/* 800F15A8 000ED3E8 48 00 00 08 */ b lbl_800F15B0
.global lbl_800F15AC
lbl_800F15AC:
/* 800F15AC 000ED3EC 38 60 00 00 */ li r3, 0x0
.global lbl_800F15B0
lbl_800F15B0:
/* 800F15B0 000ED3F0 38 03 00 A0 */ addi r0, r3, 0xa0
/* 800F15B4 000ED3F4 90 01 00 24 */ stw r0, 0x24(r1)
/* 800F15B8 000ED3F8 7F 23 CB 78 */ mr r3, r25
/* 800F15BC 000ED3FC 7F 65 DB 78 */ mr r5, r27
/* 800F15C0 000ED400 81 99 00 00 */ lwz r12, 0x0(r25)
/* 800F15C4 000ED404 38 81 00 C8 */ addi r4, r1, 0xc8
/* 800F15C8 000ED408 81 8C 00 38 */ lwz r12, 0x38(r12)
/* 800F15CC 000ED40C 7D 89 03 A6 */ mtctr r12
/* 800F15D0 000ED410 4E 80 04 21 */ bctrl
/* 800F15D4 000ED414 80 01 00 24 */ lwz r0, 0x24(r1)
/* 800F15D8 000ED418 7C 65 1B 78 */ mr r5, r3
/* 800F15DC 000ED41C 90 01 00 10 */ stw r0, 0x10(r1)
/* 800F15E0 000ED420 38 61 00 14 */ addi r3, r1, 0x14
/* 800F15E4 000ED424 38 81 00 10 */ addi r4, r1, 0x10
/* 800F15E8 000ED428 92 A1 00 14 */ stw r21, 0x14(r1)
/* 800F15EC 000ED42C 4B FE 63 D5 */ bl ApplyTexSrtAnmResult__Q24nw4r3g3dFQ34nw4r3g3d9ResTexSrtQ34nw4r3g3d20ResMatIndMtxAndScalePCQ34nw4r3g3d15TexSrtAnmResult
/* 800F15F0 000ED430 38 61 00 24 */ addi r3, r1, 0x24
/* 800F15F4 000ED434 38 80 00 00 */ li r4, 0x0
/* 800F15F8 000ED438 4B FD B7 79 */ bl DCStore__Q34nw4r3g3d20ResMatIndMtxAndScaleFb
.global lbl_800F15FC
lbl_800F15FC:
/* 800F15FC 000ED43C 2C 1A 00 00 */ cmpwi r26, 0x0
/* 800F1600 000ED440 41 82 00 80 */ beq lbl_800F1680
/* 800F1604 000ED444 7F 43 D3 78 */ mr r3, r26
/* 800F1608 000ED448 7F 64 DB 78 */ mr r4, r27
/* 800F160C 000ED44C 4B FE 34 85 */ bl TestExistence__Q34nw4r3g3d12AnmObjMatClrCFUl
/* 800F1610 000ED450 2C 03 00 00 */ cmpwi r3, 0x0
/* 800F1614 000ED454 41 82 00 6C */ beq lbl_800F1680
/* 800F1618 000ED458 80 16 00 3C */ lwz r0, 0x3c(r22)
/* 800F161C 000ED45C 2C 00 00 00 */ cmpwi r0, 0x0
/* 800F1620 000ED460 41 82 00 0C */ beq lbl_800F162C
/* 800F1624 000ED464 7C 76 02 14 */ add r3, r22, r0
/* 800F1628 000ED468 48 00 00 08 */ b lbl_800F1630
.global lbl_800F162C
lbl_800F162C:
/* 800F162C 000ED46C 38 60 00 00 */ li r3, 0x0
.global lbl_800F1630
lbl_800F1630:
/* 800F1630 000ED470 38 03 00 20 */ addi r0, r3, 0x20
/* 800F1634 000ED474 90 01 00 20 */ stw r0, 0x20(r1)
/* 800F1638 000ED478 7F 43 D3 78 */ mr r3, r26
/* 800F163C 000ED47C 7F 65 DB 78 */ mr r5, r27
/* 800F1640 000ED480 81 9A 00 00 */ lwz r12, 0x0(r26)
/* 800F1644 000ED484 3A D6 03 F0 */ addi r22, r22, 0x3f0
/* 800F1648 000ED488 38 81 00 28 */ addi r4, r1, 0x28
/* 800F164C 000ED48C 81 8C 00 38 */ lwz r12, 0x38(r12)
/* 800F1650 000ED490 7D 89 03 A6 */ mtctr r12
/* 800F1654 000ED494 4E 80 04 21 */ bctrl
/* 800F1658 000ED498 80 01 00 20 */ lwz r0, 0x20(r1)
/* 800F165C 000ED49C 7C 65 1B 78 */ mr r5, r3
/* 800F1660 000ED4A0 90 01 00 08 */ stw r0, 0x8(r1)
/* 800F1664 000ED4A4 38 61 00 0C */ addi r3, r1, 0xc
/* 800F1668 000ED4A8 38 81 00 08 */ addi r4, r1, 0x8
/* 800F166C 000ED4AC 92 C1 00 0C */ stw r22, 0xc(r1)
/* 800F1670 000ED4B0 4B FE 44 41 */ bl ApplyClrAnmResult__Q24nw4r3g3dFQ34nw4r3g3d10ResMatChanQ34nw4r3g3d14ResMatTevColorPCQ34nw4r3g3d12ClrAnmResult
/* 800F1674 000ED4B4 38 61 00 20 */ addi r3, r1, 0x20
/* 800F1678 000ED4B8 38 80 00 00 */ li r4, 0x0
/* 800F167C 000ED4BC 4B FD B6 D5 */ bl DCStore__Q34nw4r3g3d14ResMatTevColorFb
.global lbl_800F1680
lbl_800F1680:
/* 800F1680 000ED4C0 3B 7B 00 01 */ addi r27, r27, 0x1
.global lbl_800F1684
lbl_800F1684:
/* 800F1684 000ED4C4 7C 1B E0 40 */ cmplw r27, r28
/* 800F1688 000ED4C8 41 80 FE 28 */ blt lbl_800F14B0
/* 800F168C 000ED4CC 39 61 01 E0 */ addi r11, r1, 0x1e0
/* 800F1690 000ED4D0 4B F1 5C E1 */ bl lbl_80007370
/* 800F1694 000ED4D4 80 01 01 E4 */ lwz r0, 0x1e4(r1)
/* 800F1698 000ED4D8 7C 08 03 A6 */ mtlr r0
/* 800F169C 000ED4DC 38 21 01 E0 */ addi r1, r1, 0x1e0
/* 800F16A0 000ED4E0 4E 80 00 20 */ blr
/* 800F16A4 000ED4E4 00 00 00 00 */ .4byte 0x00000000
/* 800F16A8 000ED4E8 00 00 00 00 */ .4byte 0x00000000
/* 800F16AC 000ED4EC 00 00 00 00 */ .4byte 0x00000000