diff --git a/asm/melee/it/items/itdkinoko.s b/asm/melee/it/items/itdkinoko.s deleted file mode 100644 index 8aa16e7dba..0000000000 --- a/asm/melee/it/items/itdkinoko.s +++ /dev/null @@ -1,305 +0,0 @@ -.include "macros.inc" - -.section .text - -.global it_80293A08 -it_80293A08: -/* 80293A08 002905E8 7C 08 02 A6 */ mflr r0 -/* 80293A0C 002905EC 90 01 00 04 */ stw r0, 4(r1) -/* 80293A10 002905F0 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293A14 002905F4 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 80293A18 002905F8 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293A1C 002905FC C0 24 00 4C */ lfs f1, 0x4c(r4) -/* 80293A20 00290600 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293A24 00290604 40 81 00 10 */ ble .L_80293A34 -/* 80293A28 00290608 C0 02 D1 44 */ lfs f0, it_804DCB24@sda21(r2) -/* 80293A2C 0029060C D0 04 00 2C */ stfs f0, 0x2c(r4) -/* 80293A30 00290610 48 00 00 0C */ b .L_80293A3C -.L_80293A34: -/* 80293A34 00290614 C0 02 D1 48 */ lfs f0, it_804DCB28@sda21(r2) -/* 80293A38 00290618 D0 04 00 2C */ stfs f0, 0x2c(r4) -.L_80293A3C: -/* 80293A3C 0029061C 38 00 00 00 */ li r0, 0 -/* 80293A40 00290620 90 04 0D 5C */ stw r0, 0xd5c(r4) -/* 80293A44 00290624 C0 22 D1 40 */ lfs f1, it_804DCB20@sda21(r2) -/* 80293A48 00290628 D0 24 0D D4 */ stfs f1, 0xdd4(r4) -/* 80293A4C 0029062C D0 24 0D D8 */ stfs f1, 0xdd8(r4) -/* 80293A50 00290630 C0 02 D1 48 */ lfs f0, it_804DCB28@sda21(r2) -/* 80293A54 00290634 D0 04 0D DC */ stfs f0, 0xddc(r4) -/* 80293A58 00290638 D0 24 0D E0 */ stfs f1, 0xde0(r4) -/* 80293A5C 0029063C 48 00 01 8D */ bl it_80293BE8 -/* 80293A60 00290640 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293A64 00290644 38 21 00 08 */ addi r1, r1, 8 -/* 80293A68 00290648 7C 08 03 A6 */ mtlr r0 -/* 80293A6C 0029064C 4E 80 00 20 */ blr - -.global it_80293A70 -it_80293A70: -/* 80293A70 00290650 7C 08 02 A6 */ mflr r0 -/* 80293A74 00290654 90 01 00 04 */ stw r0, 4(r1) -/* 80293A78 00290658 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80293A7C 0029065C 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80293A80 00290660 93 C1 00 18 */ stw r30, 0x18(r1) -/* 80293A84 00290664 7C 7E 1B 78 */ mr r30, r3 -/* 80293A88 00290668 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293A8C 0029066C C0 1F 0D D4 */ lfs f0, 0xdd4(r31) -/* 80293A90 00290670 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 80293A94 00290674 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293A98 00290678 D0 1F 00 48 */ stfs f0, 0x48(r31) -/* 80293A9C 0029067C D0 1F 00 44 */ stfs f0, 0x44(r31) -/* 80293AA0 00290680 4B FD 78 F1 */ bl it_8026B390 -/* 80293AA4 00290684 38 7F 00 00 */ addi r3, r31, 0 -/* 80293AA8 00290688 38 80 01 07 */ li r4, 0x107 -/* 80293AAC 0029068C 38 A0 00 7F */ li r5, 0x7f -/* 80293AB0 00290690 38 C0 00 40 */ li r6, 0x40 -/* 80293AB4 00290694 4B FD 73 D1 */ bl Item_8026AE84 -/* 80293AB8 00290698 38 7E 00 00 */ addi r3, r30, 0 -/* 80293ABC 0029069C 38 80 00 00 */ li r4, 0 -/* 80293AC0 002906A0 38 A0 00 11 */ li r5, 0x11 -/* 80293AC4 002906A4 4B FD 53 99 */ bl Item_80268E5C -/* 80293AC8 002906A8 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80293ACC 002906AC 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80293AD0 002906B0 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 80293AD4 002906B4 38 21 00 20 */ addi r1, r1, 0x20 -/* 80293AD8 002906B8 7C 08 03 A6 */ mtlr r0 -/* 80293ADC 002906BC 4E 80 00 20 */ blr - -.global it_80293AE0 -it_80293AE0: -/* 80293AE0 002906C0 38 60 00 00 */ li r3, 0 -/* 80293AE4 002906C4 4E 80 00 20 */ blr - -.global it_80293AE8 -it_80293AE8: -/* 80293AE8 002906C8 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 80293AEC 002906CC 80 04 00 C0 */ lwz r0, 0xc0(r4) -/* 80293AF0 002906D0 80 64 00 C4 */ lwz r3, 0xc4(r4) -/* 80293AF4 002906D4 2C 00 00 01 */ cmpwi r0, 1 -/* 80293AF8 002906D8 80 63 00 04 */ lwz r3, 4(r3) -/* 80293AFC 002906DC 4D 82 00 20 */ beqlr -/* 80293B00 002906E0 C0 23 00 00 */ lfs f1, 0(r3) -/* 80293B04 002906E4 C0 04 00 2C */ lfs f0, 0x2c(r4) -/* 80293B08 002906E8 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293B0C 002906EC D0 04 0D D4 */ stfs f0, 0xdd4(r4) -/* 80293B10 002906F0 C0 24 0D D4 */ lfs f1, 0xdd4(r4) -/* 80293B14 002906F4 C0 04 0D DC */ lfs f0, 0xddc(r4) -/* 80293B18 002906F8 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293B1C 002906FC D0 04 00 40 */ stfs f0, 0x40(r4) -/* 80293B20 00290700 4E 80 00 20 */ blr - -.global it_80293B24 -it_80293B24: -/* 80293B24 00290704 7C 08 02 A6 */ mflr r0 -/* 80293B28 00290708 90 01 00 04 */ stw r0, 4(r1) -/* 80293B2C 0029070C 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 80293B30 00290710 93 E1 00 2C */ stw r31, 0x2c(r1) -/* 80293B34 00290714 93 C1 00 28 */ stw r30, 0x28(r1) -/* 80293B38 00290718 93 A1 00 24 */ stw r29, 0x24(r1) -/* 80293B3C 0029071C 7C 7D 1B 78 */ mr r29, r3 -/* 80293B40 00290720 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293B44 00290724 3C 60 80 29 */ lis r3, it_80293C10@ha -/* 80293B48 00290728 38 83 3C 10 */ addi r4, r3, it_80293C10@l -/* 80293B4C 0029072C 38 7D 00 00 */ addi r3, r29, 0 -/* 80293B50 00290730 3B DF 03 78 */ addi r30, r31, 0x378 -/* 80293B54 00290734 4B FD 9C 39 */ bl it_8026D78C -/* 80293B58 00290738 80 1F 00 C0 */ lwz r0, 0xc0(r31) -/* 80293B5C 0029073C 2C 00 00 01 */ cmpwi r0, 1 -/* 80293B60 00290740 41 82 00 68 */ beq .L_80293BC8 -/* 80293B64 00290744 80 1E 01 34 */ lwz r0, 0x134(r30) -/* 80293B68 00290748 54 00 03 E1 */ rlwinm. r0, r0, 0, 0xf, 0x10 -/* 80293B6C 0029074C 41 82 00 18 */ beq .L_80293B84 -/* 80293B70 00290750 38 7D 00 00 */ addi r3, r29, 0 -/* 80293B74 00290754 38 9E 00 00 */ addi r4, r30, 0 -/* 80293B78 00290758 38 BF 0D D8 */ addi r5, r31, 0xdd8 -/* 80293B7C 0029075C 4B FE 28 8D */ bl it_80276408 -/* 80293B80 00290760 48 00 00 0C */ b .L_80293B8C -.L_80293B84: -/* 80293B84 00290764 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293B88 00290768 D0 1F 0D D8 */ stfs f0, 0xdd8(r31) -.L_80293B8C: -/* 80293B8C 0029076C 80 7E 01 34 */ lwz r3, 0x134(r30) -/* 80293B90 00290770 54 60 06 BF */ clrlwi. r0, r3, 0x1a -/* 80293B94 00290774 40 82 00 0C */ bne .L_80293BA0 -/* 80293B98 00290778 54 60 05 33 */ rlwinm. r0, r3, 0, 0x14, 0x19 -/* 80293B9C 0029077C 41 82 00 2C */ beq .L_80293BC8 -.L_80293BA0: -/* 80293BA0 00290780 C0 1F 00 2C */ lfs f0, 0x2c(r31) -/* 80293BA4 00290784 FC 00 00 50 */ fneg f0, f0 -/* 80293BA8 00290788 D0 1F 00 2C */ stfs f0, 0x2c(r31) -/* 80293BAC 0029078C C0 1F 0D D4 */ lfs f0, 0xdd4(r31) -/* 80293BB0 00290790 FC 00 00 50 */ fneg f0, f0 -/* 80293BB4 00290794 D0 1F 0D D4 */ stfs f0, 0xdd4(r31) -/* 80293BB8 00290798 C0 3F 0D D4 */ lfs f1, 0xdd4(r31) -/* 80293BBC 0029079C C0 1F 0D DC */ lfs f0, 0xddc(r31) -/* 80293BC0 002907A0 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80293BC4 002907A4 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_80293BC8: -/* 80293BC8 002907A8 80 01 00 34 */ lwz r0, 0x34(r1) -/* 80293BCC 002907AC 38 60 00 00 */ li r3, 0 -/* 80293BD0 002907B0 83 E1 00 2C */ lwz r31, 0x2c(r1) -/* 80293BD4 002907B4 83 C1 00 28 */ lwz r30, 0x28(r1) -/* 80293BD8 002907B8 83 A1 00 24 */ lwz r29, 0x24(r1) -/* 80293BDC 002907BC 38 21 00 30 */ addi r1, r1, 0x30 -/* 80293BE0 002907C0 7C 08 03 A6 */ mtlr r0 -/* 80293BE4 002907C4 4E 80 00 20 */ blr - -.global it_80293BE8 -it_80293BE8: -/* 80293BE8 002907C8 7C 08 02 A6 */ mflr r0 -/* 80293BEC 002907CC 38 80 00 01 */ li r4, 1 -/* 80293BF0 002907D0 90 01 00 04 */ stw r0, 4(r1) -/* 80293BF4 002907D4 38 A0 00 02 */ li r5, 2 -/* 80293BF8 002907D8 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293BFC 002907DC 4B FD 52 61 */ bl Item_80268E5C -/* 80293C00 002907E0 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293C04 002907E4 38 21 00 08 */ addi r1, r1, 8 -/* 80293C08 002907E8 7C 08 03 A6 */ mtlr r0 -/* 80293C0C 002907EC 4E 80 00 20 */ blr - -.global it_80293C10 -it_80293C10: -/* 80293C10 002907F0 7C 08 02 A6 */ mflr r0 -/* 80293C14 002907F4 38 80 00 01 */ li r4, 1 -/* 80293C18 002907F8 90 01 00 04 */ stw r0, 4(r1) -/* 80293C1C 002907FC 38 A0 00 11 */ li r5, 0x11 -/* 80293C20 00290800 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293C24 00290804 4B FD 52 39 */ bl Item_80268E5C -/* 80293C28 00290808 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293C2C 0029080C 38 21 00 08 */ addi r1, r1, 8 -/* 80293C30 00290810 7C 08 03 A6 */ mtlr r0 -/* 80293C34 00290814 4E 80 00 20 */ blr - -.global it_80293C38 -it_80293C38: -/* 80293C38 00290818 38 60 00 00 */ li r3, 0 -/* 80293C3C 0029081C 4E 80 00 20 */ blr - -.global it_80293C40 -it_80293C40: -/* 80293C40 00290820 7C 08 02 A6 */ mflr r0 -/* 80293C44 00290824 90 01 00 04 */ stw r0, 4(r1) -/* 80293C48 00290828 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 80293C4C 0029082C 93 E1 00 14 */ stw r31, 0x14(r1) -/* 80293C50 00290830 93 C1 00 10 */ stw r30, 0x10(r1) -/* 80293C54 00290834 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293C58 00290838 80 BF 00 CC */ lwz r5, 0xcc(r31) -/* 80293C5C 0029083C 80 9F 00 C4 */ lwz r4, 0xc4(r31) -/* 80293C60 00290840 C0 25 00 10 */ lfs f1, 0x10(r5) -/* 80293C64 00290844 83 C4 00 04 */ lwz r30, 4(r4) -/* 80293C68 00290848 C0 45 00 14 */ lfs f2, 0x14(r5) -/* 80293C6C 0029084C 4B FD EB F5 */ bl it_80272860 -/* 80293C70 00290850 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80293C74 00290854 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293C78 00290858 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293C7C 0029085C 40 80 00 0C */ bge .L_80293C88 -/* 80293C80 00290860 FC 00 08 50 */ fneg f0, f1 -/* 80293C84 00290864 48 00 00 08 */ b .L_80293C8C -.L_80293C88: -/* 80293C88 00290868 FC 00 08 90 */ fmr f0, f1 -.L_80293C8C: -/* 80293C8C 0029086C C0 5E 00 04 */ lfs f2, 4(r30) -/* 80293C90 00290870 FC 00 10 40 */ fcmpo cr0, f0, f2 -/* 80293C94 00290874 40 80 00 10 */ bge .L_80293CA4 -/* 80293C98 00290878 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293C9C 0029087C D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 80293CA0 00290880 48 00 00 38 */ b .L_80293CD8 -.L_80293CA4: -/* 80293CA4 00290884 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293CA8 00290888 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293CAC 0029088C 40 81 00 10 */ ble .L_80293CBC -/* 80293CB0 00290890 C0 1F 00 40 */ lfs f0, 0x40(r31) -/* 80293CB4 00290894 EC 00 10 28 */ fsubs f0, f0, f2 -/* 80293CB8 00290898 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_80293CBC: -/* 80293CBC 0029089C C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80293CC0 002908A0 C0 02 D1 40 */ lfs f0, it_804DCB20@sda21(r2) -/* 80293CC4 002908A4 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80293CC8 002908A8 40 80 00 10 */ bge .L_80293CD8 -/* 80293CCC 002908AC C0 1E 00 04 */ lfs f0, 4(r30) -/* 80293CD0 002908B0 EC 01 00 2A */ fadds f0, f1, f0 -/* 80293CD4 002908B4 D0 1F 00 40 */ stfs f0, 0x40(r31) -.L_80293CD8: -/* 80293CD8 002908B8 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 80293CDC 002908BC 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 80293CE0 002908C0 83 C1 00 10 */ lwz r30, 0x10(r1) -/* 80293CE4 002908C4 38 21 00 18 */ addi r1, r1, 0x18 -/* 80293CE8 002908C8 7C 08 03 A6 */ mtlr r0 -/* 80293CEC 002908CC 4E 80 00 20 */ blr - -.global it_80293CF0 -it_80293CF0: -/* 80293CF0 002908D0 7C 08 02 A6 */ mflr r0 -/* 80293CF4 002908D4 90 01 00 04 */ stw r0, 4(r1) -/* 80293CF8 002908D8 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80293CFC 002908DC 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80293D00 002908E0 93 C1 00 18 */ stw r30, 0x18(r1) -/* 80293D04 002908E4 93 A1 00 14 */ stw r29, 0x14(r1) -/* 80293D08 002908E8 7C 7D 1B 78 */ mr r29, r3 -/* 80293D0C 002908EC 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 80293D10 002908F0 3C 60 80 29 */ lis r3, it_80293A70@ha -/* 80293D14 002908F4 38 83 3A 70 */ addi r4, r3, it_80293A70@l -/* 80293D18 002908F8 38 7D 00 00 */ addi r3, r29, 0 -/* 80293D1C 002908FC 3B DF 03 78 */ addi r30, r31, 0x378 -/* 80293D20 00290900 4B FD A6 F5 */ bl it_8026E414 -/* 80293D24 00290904 80 1F 00 C0 */ lwz r0, 0xc0(r31) -/* 80293D28 00290908 2C 00 00 01 */ cmpwi r0, 1 -/* 80293D2C 0029090C 41 82 00 20 */ beq .L_80293D4C -/* 80293D30 00290910 80 1E 01 34 */ lwz r0, 0x134(r30) -/* 80293D34 00290914 54 00 03 E1 */ rlwinm. r0, r0, 0, 0xf, 0x10 -/* 80293D38 00290918 41 82 00 14 */ beq .L_80293D4C -/* 80293D3C 0029091C 38 7D 00 00 */ addi r3, r29, 0 -/* 80293D40 00290920 38 9E 00 00 */ addi r4, r30, 0 -/* 80293D44 00290924 38 BF 0D D8 */ addi r5, r31, 0xdd8 -/* 80293D48 00290928 4B FE 26 C1 */ bl it_80276408 -.L_80293D4C: -/* 80293D4C 0029092C 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80293D50 00290930 38 60 00 00 */ li r3, 0 -/* 80293D54 00290934 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80293D58 00290938 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 80293D5C 0029093C 83 A1 00 14 */ lwz r29, 0x14(r1) -/* 80293D60 00290940 38 21 00 20 */ addi r1, r1, 0x20 -/* 80293D64 00290944 7C 08 03 A6 */ mtlr r0 -/* 80293D68 00290948 4E 80 00 20 */ blr - -.global it_80293D6C -it_80293D6C: -/* 80293D6C 0029094C 38 60 00 01 */ li r3, 1 -/* 80293D70 00290950 4E 80 00 20 */ blr - -.global it_80293D74 -it_80293D74: -/* 80293D74 00290954 7C 08 02 A6 */ mflr r0 -/* 80293D78 00290958 90 01 00 04 */ stw r0, 4(r1) -/* 80293D7C 0029095C 94 21 FF F8 */ stwu r1, -8(r1) -/* 80293D80 00290960 4B FD 7B 15 */ bl it_8026B894 -/* 80293D84 00290964 80 01 00 0C */ lwz r0, 0xc(r1) -/* 80293D88 00290968 38 21 00 08 */ addi r1, r1, 8 -/* 80293D8C 0029096C 7C 08 03 A6 */ mtlr r0 -/* 80293D90 00290970 4E 80 00 20 */ blr - - -.section .data - .balign 8 -.global it_803F6130 -it_803F6130: - .4byte 0 - .4byte it_80293AE0 - .4byte it_80293AE8 - .4byte it_80293B24 - .4byte 0 - .4byte it_80293C38 - .4byte it_80293C40 - .4byte it_80293CF0 - - -.section .sdata2 - .balign 8 -.global it_804DCB20 -it_804DCB20: - .4byte 0x00000000 -.global it_804DCB24 -it_804DCB24: - .4byte 0xBF800000 -.global it_804DCB28 -it_804DCB28: - .4byte 0x3F800000 diff --git a/configure.py b/configure.py index ec1d3db05f..77a11e5f4b 100755 --- a/configure.py +++ b/configure.py @@ -963,7 +963,7 @@ def RuntimeLib(lib_name: str, objects: Objects) -> LibDict: Object(NonMatching, "melee/it/items/itharisen.c"), Object(Matching, "melee/it/items/itfflower.c"), Object(Matching, "melee/it/items/itkinoko.c"), - Object(NonMatching, "melee/it/items/itdkinoko.c"), + Object(Matching, "melee/it/items/itdkinoko.c"), Object(Matching, "melee/it/items/ithammer.c"), Object(NonMatching, "melee/it/items/itwstar.c"), Object(Matching, "melee/it/items/itscball.c"), diff --git a/obj_files.mk b/obj_files.mk index 87b26324c2..b13f31d9a1 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -586,7 +586,7 @@ TEXT_O_FILES +=\ $(BUILD_DIR)/asm/melee/it/items/itharisen.s.o\ $(BUILD_DIR)/src/melee/it/items/itfflower.c.o\ $(BUILD_DIR)/src/melee/it/items/itkinoko.c.o\ - $(BUILD_DIR)/asm/melee/it/items/itdkinoko.s.o\ + $(BUILD_DIR)/src/melee/it/items/itdkinoko.c.o\ $(BUILD_DIR)/src/melee/it/items/ithammer.c.o\ $(BUILD_DIR)/asm/melee/it/items/itwstar.s.o\ $(BUILD_DIR)/src/melee/it/items/itscball.c.o\ diff --git a/src/melee/it/items/itdkinoko.c b/src/melee/it/items/itdkinoko.c index 8b13789179..2826c4c69e 100644 --- a/src/melee/it/items/itdkinoko.c +++ b/src/melee/it/items/itdkinoko.c @@ -1 +1,148 @@ +#include "itdkinoko.h" +#include "it/inlines.h" +#include "it/it_266F.h" +#include "it/it_26B1.h" +#include "it/it_2725.h" +#include "it/item.h" +#include "it/items/itkinoko.h" + +ItemStateTable it_803F6130[] = { + { 0, it_80293AE0, it_80293AE8, it_80293B24 }, + { 0, it_80293C38, it_80293C40, it_80293CF0 }, +}; + +void it_80293A08(Item_GObj* gobj) +{ + Item* it; + + it = GET_ITEM(gobj); + if (it->pos.x > 0.0f) { + it->facing_dir = -1.0f; + } else { + it->facing_dir = 1.0f; + } + it->xD5C = 0; + it->xDD4_itemVar.kinoko.x0 = 0.0f; + it->xDD4_itemVar.kinoko.x4 = 0.0f; + it->xDD4_itemVar.kinoko.x8 = 1.0f; + it->xDD4_itemVar.kinoko.xC = 0.0f; + it_80293BE8(gobj); +} + +void it_80293A70(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + PAD_STACK(8); + + it->x40_vel.x = it->xDD4_itemVar.kinoko.x0; + it->x40_vel.y = it->x40_vel.z = 0.0f; + + it_8026B390(gobj); + Item_8026AE84(it, 0x107, 0x7F, 0x40); + Item_80268E5C(gobj, 0, ITEM_UNK_0x1 | ITEM_HIT_PRESERVE); +} + +bool it_80293AE0(Item_GObj* gobj) +{ + return false; +} + +void it_80293AE8(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + KinokoAttrs* attrs = it->xC4_article_data->x4_specialAttributes; + if (it->ground_or_air != GA_Air) { + it->xDD4_itemVar.kinoko.x0 = attrs->x0 * it->facing_dir; + it->x40_vel.x = + it->xDD4_itemVar.kinoko.x0 * it->xDD4_itemVar.kinoko.x8; + } +} + +bool it_80293B24(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + CollData* cd = &it->x378_itemColl; + PAD_STACK(16); + + it_8026D78C(gobj, it_80293C10); + if (it->ground_or_air != GA_Air) { + if ((cd->env_flags & MPCOLL_UNK)) { + it_80276408(gobj, cd, &it->xDD4_itemVar.kinoko.x4); + } else { + it->xDD4_itemVar.kinoko.x4 = 0.0f; + } + if ((cd->env_flags & MPCOLL_RIGHTWALL) || + (cd->env_flags & MPCOLL_LEFTWALL)) + { + it->facing_dir = -it->facing_dir; + it->xDD4_itemVar.kinoko.x0 = -it->xDD4_itemVar.kinoko.x0; + it->x40_vel.x = + it->xDD4_itemVar.kinoko.x0 * it->xDD4_itemVar.kinoko.x8; + } + } + return 0; +} + +void it_80293BE8(Item_GObj* gobj) +{ + Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE); +} + +void it_80293C10(Item_GObj* gobj) +{ + Item_80268E5C(gobj, 1, ITEM_UNK_0x1 | ITEM_HIT_PRESERVE); +} + +bool it_80293C38(Item_GObj* gobj) +{ + return false; +} + +void it_80293C40(Item_GObj* gobj) +{ + f32 vel; + Item* it = GET_ITEM(gobj); + ItemAttr* attr = it->xCC_item_attr; + KinokoAttrs* sa = it->xC4_article_data->x4_specialAttributes; + + it_80272860(gobj, attr->x10_fall_speed, attr->x14_fall_speed_max); + + if (it->x40_vel.x < 0.0f) { + vel = -it->x40_vel.x; + } else { + vel = it->x40_vel.x; + } + + if (vel < sa->x4) { + it->x40_vel.x = 0.0f; + return; + } else if (it->x40_vel.x > 0.0f) { + it->x40_vel.x -= sa->x4; + } + if (it->x40_vel.x < 0.0f) { + it->x40_vel.x += sa->x4; + } +} + +bool it_80293CF0(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + CollData* cd = &it->x378_itemColl; + + it_8026E414(gobj, it_80293A70); + if (it->ground_or_air != GA_Air && (cd->env_flags & MPCOLL_UNK)) { + it_80276408(gobj, cd, &it->xDD4_itemVar.kinoko.x4); + } + return false; +} + +bool it_80293D6C(Item_GObj* gobj) +{ + return true; +} + +void it_80293D74(Item_GObj* gobj, HSD_GObj* gobj_2) +{ + it_8026B894(gobj, gobj_2); +} diff --git a/src/melee/it/items/itdkinoko.h b/src/melee/it/items/itdkinoko.h index 9837e43842..0905e04da3 100644 --- a/src/melee/it/items/itdkinoko.h +++ b/src/melee/it/items/itdkinoko.h @@ -6,9 +6,18 @@ #include "it/items/types.h" -/* 293A08 */ void it_80293A08(Item_GObj*); -/* 293D6C */ bool it_80293D6C(Item_GObj*); -/* 293D74 */ void it_80293D74(Item_GObj*, Item_GObj*); -/* 3F6130 */ extern ItemStateTable it_803F6130[]; +void it_80293A08(Item_GObj*); +void it_80293A70(Item_GObj*); +bool it_80293AE0(Item_GObj*); +void it_80293AE8(Item_GObj*); +bool it_80293B24(Item_GObj*); +void it_80293BE8(Item_GObj*); +void it_80293C10(Item_GObj*); +bool it_80293C38(Item_GObj*); +void it_80293C40(Item_GObj*); +bool it_80293CF0(Item_GObj*); +bool it_80293D6C(Item_GObj*); +void it_80293D74(Item_GObj*, Item_GObj*); +extern ItemStateTable it_803F6130[]; #endif