diff --git a/asm/melee/it/items/itmariofireball.s b/asm/melee/it/items/itmariofireball.s deleted file mode 100644 index 7d5e2a59ac..0000000000 --- a/asm/melee/it/items/itmariofireball.s +++ /dev/null @@ -1,313 +0,0 @@ -.include "macros.inc" - -.section .text - -.global it_8029B6F8 -it_8029B6F8: -/* 8029B6F8 002982D8 7C 08 02 A6 */ mflr r0 -/* 8029B6FC 002982DC 90 01 00 04 */ stw r0, 4(r1) -/* 8029B700 002982E0 94 21 FF 88 */ stwu r1, -0x78(r1) -/* 8029B704 002982E4 DB E1 00 70 */ stfd f31, 0x70(r1) -/* 8029B708 002982E8 FF E0 08 90 */ fmr f31, f1 -/* 8029B70C 002982EC 93 E1 00 6C */ stw r31, 0x6c(r1) -/* 8029B710 002982F0 93 C1 00 68 */ stw r30, 0x68(r1) -/* 8029B714 002982F4 7C 7E 1B 78 */ mr r30, r3 -/* 8029B718 002982F8 90 A1 00 20 */ stw r5, 0x20(r1) -/* 8029B71C 002982FC C0 02 D2 B8 */ lfs f0, it_804DCC98@sda21(r2) -/* 8029B720 00298300 80 A4 00 00 */ lwz r5, 0(r4) -/* 8029B724 00298304 80 04 00 04 */ lwz r0, 4(r4) -/* 8029B728 00298308 90 A1 00 38 */ stw r5, 0x38(r1) -/* 8029B72C 0029830C 90 01 00 3C */ stw r0, 0x3c(r1) -/* 8029B730 00298310 80 04 00 08 */ lwz r0, 8(r4) -/* 8029B734 00298314 38 81 00 2C */ addi r4, r1, 0x2c -/* 8029B738 00298318 90 01 00 40 */ stw r0, 0x40(r1) -/* 8029B73C 0029831C D0 01 00 40 */ stfs f0, 0x40(r1) -/* 8029B740 00298320 4B FD 04 29 */ bl it_8026BB68 -/* 8029B744 00298324 D3 E1 00 50 */ stfs f31, 0x50(r1) -/* 8029B748 00298328 38 A0 00 00 */ li r5, 0 -/* 8029B74C 0029832C C0 02 D2 B8 */ lfs f0, it_804DCC98@sda21(r2) -/* 8029B750 00298330 38 80 00 01 */ li r4, 1 -/* 8029B754 00298334 B0 A1 00 54 */ sth r5, 0x54(r1) -/* 8029B758 00298338 38 61 00 18 */ addi r3, r1, 0x18 -/* 8029B75C 0029833C D0 01 00 4C */ stfs f0, 0x4c(r1) -/* 8029B760 00298340 D0 01 00 48 */ stfs f0, 0x48(r1) -/* 8029B764 00298344 D0 01 00 44 */ stfs f0, 0x44(r1) -/* 8029B768 00298348 93 C1 00 18 */ stw r30, 0x18(r1) -/* 8029B76C 0029834C 80 01 00 18 */ lwz r0, 0x18(r1) -/* 8029B770 00298350 90 01 00 1C */ stw r0, 0x1c(r1) -/* 8029B774 00298354 88 01 00 5C */ lbz r0, 0x5c(r1) -/* 8029B778 00298358 50 80 3E 30 */ rlwimi r0, r4, 7, 0x18, 0x18 -/* 8029B77C 0029835C 98 01 00 5C */ stb r0, 0x5c(r1) -/* 8029B780 00298360 90 A1 00 58 */ stw r5, 0x58(r1) -/* 8029B784 00298364 4B FC D3 95 */ bl Item_80268B18 -/* 8029B788 00298368 7C 7F 1B 78 */ mr r31, r3 -/* 8029B78C 0029836C 48 00 00 35 */ bl it_8029B7C0 -/* 8029B790 00298370 38 7F 00 00 */ addi r3, r31, 0 -/* 8029B794 00298374 38 9E 00 00 */ addi r4, r30, 0 -/* 8029B798 00298378 4B F8 A6 41 */ bl db_80225DD8 -/* 8029B79C 0029837C 7F E3 FB 78 */ mr r3, r31 -/* 8029B7A0 00298380 4B FD 99 59 */ bl it_802750F8 -/* 8029B7A4 00298384 80 01 00 7C */ lwz r0, 0x7c(r1) -/* 8029B7A8 00298388 CB E1 00 70 */ lfd f31, 0x70(r1) -/* 8029B7AC 0029838C 83 E1 00 6C */ lwz r31, 0x6c(r1) -/* 8029B7B0 00298390 83 C1 00 68 */ lwz r30, 0x68(r1) -/* 8029B7B4 00298394 38 21 00 78 */ addi r1, r1, 0x78 -/* 8029B7B8 00298398 7C 08 03 A6 */ mtlr r0 -/* 8029B7BC 0029839C 4E 80 00 20 */ blr - -.global it_8029B7C0 -it_8029B7C0: -/* 8029B7C0 002983A0 7C 08 02 A6 */ mflr r0 -/* 8029B7C4 002983A4 90 01 00 04 */ stw r0, 4(r1) -/* 8029B7C8 002983A8 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 8029B7CC 002983AC DB E1 00 28 */ stfd f31, 0x28(r1) -/* 8029B7D0 002983B0 DB C1 00 20 */ stfd f30, 0x20(r1) -/* 8029B7D4 002983B4 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 8029B7D8 002983B8 93 C1 00 18 */ stw r30, 0x18(r1) -/* 8029B7DC 002983BC 93 A1 00 14 */ stw r29, 0x14(r1) -/* 8029B7E0 002983C0 7C 7D 1B 78 */ mr r29, r3 -/* 8029B7E4 002983C4 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 8029B7E8 002983C8 80 7F 00 C4 */ lwz r3, 0xc4(r31) -/* 8029B7EC 002983CC 83 C3 00 04 */ lwz r30, 4(r3) -/* 8029B7F0 002983D0 C3 DE 00 04 */ lfs f30, 4(r30) -/* 8029B7F4 002983D4 C3 FE 00 00 */ lfs f31, 0(r30) -/* 8029B7F8 002983D8 FC 20 F0 90 */ fmr f1, f30 -/* 8029B7FC 002983DC 48 08 AA 45 */ bl cosf -/* 8029B800 002983E0 EC 5F 00 72 */ fmuls f2, f31, f1 -/* 8029B804 002983E4 C0 1F 00 2C */ lfs f0, 0x2c(r31) -/* 8029B808 002983E8 FC 20 F0 90 */ fmr f1, f30 -/* 8029B80C 002983EC EC 00 00 B2 */ fmuls f0, f0, f2 -/* 8029B810 002983F0 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 8029B814 002983F4 48 08 AB C1 */ bl sinf -/* 8029B818 002983F8 EC 1F 00 72 */ fmuls f0, f31, f1 -/* 8029B81C 002983FC 7F A3 EB 78 */ mr r3, r29 -/* 8029B820 00298400 D0 1F 00 44 */ stfs f0, 0x44(r31) -/* 8029B824 00298404 C0 02 D2 B8 */ lfs f0, it_804DCC98@sda21(r2) -/* 8029B828 00298408 D0 1F 00 48 */ stfs f0, 0x48(r31) -/* 8029B82C 0029840C C0 3E 00 08 */ lfs f1, 8(r30) -/* 8029B830 00298410 4B FD 99 29 */ bl it_80275158 -/* 8029B834 00298414 38 7D 00 00 */ addi r3, r29, 0 -/* 8029B838 00298418 38 80 00 00 */ li r4, 0 -/* 8029B83C 0029841C 38 A0 00 02 */ li r5, 2 -/* 8029B840 00298420 4B FC D6 1D */ bl Item_80268E5C -/* 8029B844 00298424 80 01 00 34 */ lwz r0, 0x34(r1) -/* 8029B848 00298428 CB E1 00 28 */ lfd f31, 0x28(r1) -/* 8029B84C 0029842C CB C1 00 20 */ lfd f30, 0x20(r1) -/* 8029B850 00298430 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 8029B854 00298434 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 8029B858 00298438 83 A1 00 14 */ lwz r29, 0x14(r1) -/* 8029B85C 0029843C 38 21 00 30 */ addi r1, r1, 0x30 -/* 8029B860 00298440 7C 08 03 A6 */ mtlr r0 -/* 8029B864 00298444 4E 80 00 20 */ blr - -.global it_8029B868 -it_8029B868: -/* 8029B868 00298448 80 63 00 2C */ lwz r3, 0x2c(r3) -/* 8029B86C 0029844C C0 02 D2 BC */ lfs f0, it_804DCC9C@sda21(r2) -/* 8029B870 00298450 C0 23 0D 44 */ lfs f1, 0xd44(r3) -/* 8029B874 00298454 EC 01 00 28 */ fsubs f0, f1, f0 -/* 8029B878 00298458 D0 03 0D 44 */ stfs f0, 0xd44(r3) -/* 8029B87C 0029845C C0 23 0D 44 */ lfs f1, 0xd44(r3) -/* 8029B880 00298460 C0 02 D2 B8 */ lfs f0, it_804DCC98@sda21(r2) -/* 8029B884 00298464 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 8029B888 00298468 4C 40 13 82 */ cror 2, 0, 2 -/* 8029B88C 0029846C 40 82 00 0C */ bne .L_8029B898 -/* 8029B890 00298470 38 60 00 01 */ li r3, 1 -/* 8029B894 00298474 4E 80 00 20 */ blr -.L_8029B898: -/* 8029B898 00298478 38 60 00 00 */ li r3, 0 -/* 8029B89C 0029847C 4E 80 00 20 */ blr - -.global it_8029B8A0 -it_8029B8A0: -/* 8029B8A0 00298480 7C 08 02 A6 */ mflr r0 -/* 8029B8A4 00298484 90 01 00 04 */ stw r0, 4(r1) -/* 8029B8A8 00298488 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 8029B8AC 0029848C 93 E1 00 14 */ stw r31, 0x14(r1) -/* 8029B8B0 00298490 7C 7F 1B 78 */ mr r31, r3 -/* 8029B8B4 00298494 80 83 00 2C */ lwz r4, 0x2c(r3) -/* 8029B8B8 00298498 80 84 00 CC */ lwz r4, 0xcc(r4) -/* 8029B8BC 0029849C C0 24 00 10 */ lfs f1, 0x10(r4) -/* 8029B8C0 002984A0 C0 44 00 14 */ lfs f2, 0x14(r4) -/* 8029B8C4 002984A4 4B FD 6F 9D */ bl it_80272860 -/* 8029B8C8 002984A8 80 8D B6 88 */ lwz r4, it_804D6D28@sda21(r13) -/* 8029B8CC 002984AC 7F E3 FB 78 */ mr r3, r31 -/* 8029B8D0 002984B0 C0 24 00 68 */ lfs f1, 0x68(r4) -/* 8029B8D4 002984B4 4B FD 8D 85 */ bl it_80274658 -/* 8029B8D8 002984B8 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 8029B8DC 002984BC 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 8029B8E0 002984C0 38 21 00 18 */ addi r1, r1, 0x18 -/* 8029B8E4 002984C4 7C 08 03 A6 */ mtlr r0 -/* 8029B8E8 002984C8 4E 80 00 20 */ blr - -.global it_8029B8EC -it_8029B8EC: -/* 8029B8EC 002984CC 7C 08 02 A6 */ mflr r0 -/* 8029B8F0 002984D0 90 01 00 04 */ stw r0, 4(r1) -/* 8029B8F4 002984D4 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 8029B8F8 002984D8 93 E1 00 2C */ stw r31, 0x2c(r1) -/* 8029B8FC 002984DC 93 C1 00 28 */ stw r30, 0x28(r1) -/* 8029B900 002984E0 7C 7E 1B 78 */ mr r30, r3 -/* 8029B904 002984E4 4B FD 20 9D */ bl it_8026D9A0 -/* 8029B908 002984E8 7F C3 F3 78 */ mr r3, r30 -/* 8029B90C 002984EC 4B FD BF 11 */ bl it_8027781C -/* 8029B910 002984F0 2C 03 00 00 */ cmpwi r3, 0 -/* 8029B914 002984F4 41 82 01 08 */ beq .L_8029BA1C -/* 8029B918 002984F8 80 7E 00 2C */ lwz r3, 0x2c(r30) -/* 8029B91C 002984FC C0 02 D2 B8 */ lfs f0, it_804DCC98@sda21(r2) -/* 8029B920 00298500 C0 43 00 40 */ lfs f2, 0x40(r3) -/* 8029B924 00298504 C0 23 00 44 */ lfs f1, 0x44(r3) -/* 8029B928 00298508 EC 42 00 B2 */ fmuls f2, f2, f2 -/* 8029B92C 0029850C 80 83 00 C4 */ lwz r4, 0xc4(r3) -/* 8029B930 00298510 EC 21 00 72 */ fmuls f1, f1, f1 -/* 8029B934 00298514 83 FE 00 28 */ lwz r31, 0x28(r30) -/* 8029B938 00298518 80 84 00 04 */ lwz r4, 4(r4) -/* 8029B93C 0029851C EC 82 08 2A */ fadds f4, f2, f1 -/* 8029B940 00298520 FC 04 00 40 */ fcmpo cr0, f4, f0 -/* 8029B944 00298524 40 81 00 60 */ ble .L_8029B9A4 -/* 8029B948 00298528 FC 20 20 34 */ frsqrte f1, f4 -/* 8029B94C 0029852C C8 62 D2 C0 */ lfd f3, it_804DCCA0@sda21(r2) -/* 8029B950 00298530 C8 42 D2 C8 */ lfd f2, it_804DCCA8@sda21(r2) -/* 8029B954 00298534 FC 01 00 72 */ fmul f0, f1, f1 -/* 8029B958 00298538 FC 23 00 72 */ fmul f1, f3, f1 -/* 8029B95C 0029853C FC 04 10 3C */ fnmsub f0, f4, f0, f2 -/* 8029B960 00298540 FC 21 00 32 */ fmul f1, f1, f0 -/* 8029B964 00298544 FC 01 00 72 */ fmul f0, f1, f1 -/* 8029B968 00298548 FC 23 00 72 */ fmul f1, f3, f1 -/* 8029B96C 0029854C FC 04 10 3C */ fnmsub f0, f4, f0, f2 -/* 8029B970 00298550 FC 21 00 32 */ fmul f1, f1, f0 -/* 8029B974 00298554 FC 01 00 72 */ fmul f0, f1, f1 -/* 8029B978 00298558 FC 23 00 72 */ fmul f1, f3, f1 -/* 8029B97C 0029855C FC 04 10 3C */ fnmsub f0, f4, f0, f2 -/* 8029B980 00298560 FC 21 00 32 */ fmul f1, f1, f0 -/* 8029B984 00298564 FC 01 00 72 */ fmul f0, f1, f1 -/* 8029B988 00298568 FC 23 00 72 */ fmul f1, f3, f1 -/* 8029B98C 0029856C FC 04 10 3C */ fnmsub f0, f4, f0, f2 -/* 8029B990 00298570 FC 01 00 32 */ fmul f0, f1, f0 -/* 8029B994 00298574 FC 04 00 32 */ fmul f0, f4, f0 -/* 8029B998 00298578 FC 00 00 18 */ frsp f0, f0 -/* 8029B99C 0029857C D0 01 00 20 */ stfs f0, 0x20(r1) -/* 8029B9A0 00298580 C0 81 00 20 */ lfs f4, 0x20(r1) -.L_8029B9A4: -/* 8029B9A4 00298584 C0 04 00 10 */ lfs f0, 0x10(r4) -/* 8029B9A8 00298588 FC 04 00 40 */ fcmpo cr0, f4, f0 -/* 8029B9AC 0029858C 40 80 00 0C */ bge .L_8029B9B8 -/* 8029B9B0 00298590 38 60 00 01 */ li r3, 1 -/* 8029B9B4 00298594 48 00 00 6C */ b .L_8029BA20 -.L_8029B9B8: -/* 8029B9B8 00298598 80 03 00 10 */ lwz r0, 0x10(r3) -/* 8029B9BC 0029859C 2C 00 00 30 */ cmpwi r0, 0x30 -/* 8029B9C0 002985A0 40 82 00 3C */ bne .L_8029B9FC -/* 8029B9C4 002985A4 3C 80 00 03 */ lis r4, 0x0002BF39@ha -/* 8029B9C8 002985A8 38 84 BF 39 */ addi r4, r4, 0x0002BF39@l -/* 8029B9CC 002985AC 38 A0 00 7F */ li r5, 0x7f -/* 8029B9D0 002985B0 38 C0 00 40 */ li r6, 0x40 -/* 8029B9D4 002985B4 4B FC F4 B1 */ bl Item_8026AE84 -/* 8029B9D8 002985B8 80 9E 00 2C */ lwz r4, 0x2c(r30) -/* 8029B9DC 002985BC 38 7E 00 00 */ addi r3, r30, 0 -/* 8029B9E0 002985C0 38 FF 00 00 */ addi r7, r31, 0 -/* 8029B9E4 002985C4 4C C6 31 82 */ crclr 6 -/* 8029B9E8 002985C8 38 84 0B C0 */ addi r4, r4, 0xbc0 -/* 8029B9EC 002985CC 38 A0 00 01 */ li r5, 1 -/* 8029B9F0 002985D0 38 C0 04 7B */ li r6, 0x47b -/* 8029B9F4 002985D4 4B DC BC FD */ bl efAsync_Spawn -/* 8029B9F8 002985D8 48 00 00 24 */ b .L_8029BA1C -.L_8029B9FC: -/* 8029B9FC 002985DC 80 9E 00 2C */ lwz r4, 0x2c(r30) -/* 8029BA00 002985E0 38 7E 00 00 */ addi r3, r30, 0 -/* 8029BA04 002985E4 38 FF 00 00 */ addi r7, r31, 0 -/* 8029BA08 002985E8 4C C6 31 82 */ crclr 6 -/* 8029BA0C 002985EC 38 84 0B C0 */ addi r4, r4, 0xbc0 -/* 8029BA10 002985F0 38 A0 00 01 */ li r5, 1 -/* 8029BA14 002985F4 38 C0 04 A0 */ li r6, 0x4a0 -/* 8029BA18 002985F8 4B DC BC D9 */ bl efAsync_Spawn -.L_8029BA1C: -/* 8029BA1C 002985FC 38 60 00 00 */ li r3, 0 -.L_8029BA20: -/* 8029BA20 00298600 80 01 00 34 */ lwz r0, 0x34(r1) -/* 8029BA24 00298604 83 E1 00 2C */ lwz r31, 0x2c(r1) -/* 8029BA28 00298608 83 C1 00 28 */ lwz r30, 0x28(r1) -/* 8029BA2C 0029860C 38 21 00 30 */ addi r1, r1, 0x30 -/* 8029BA30 00298610 7C 08 03 A6 */ mtlr r0 -/* 8029BA34 00298614 4E 80 00 20 */ blr - -.global it_8029BA38 -it_8029BA38: -/* 8029BA38 00298618 38 60 00 01 */ li r3, 1 -/* 8029BA3C 0029861C 4E 80 00 20 */ blr - -.global it_8029BA40 -it_8029BA40: -/* 8029BA40 00298620 7C 08 02 A6 */ mflr r0 -/* 8029BA44 00298624 90 01 00 04 */ stw r0, 4(r1) -/* 8029BA48 00298628 94 21 FF F8 */ stwu r1, -8(r1) -/* 8029BA4C 0029862C 4B FD 75 E5 */ bl it_80273030 -/* 8029BA50 00298630 80 01 00 0C */ lwz r0, 0xc(r1) -/* 8029BA54 00298634 38 21 00 08 */ addi r1, r1, 8 -/* 8029BA58 00298638 7C 08 03 A6 */ mtlr r0 -/* 8029BA5C 0029863C 4E 80 00 20 */ blr - -.global it_8029BA60 -it_8029BA60: -/* 8029BA60 00298640 38 60 00 01 */ li r3, 1 -/* 8029BA64 00298644 4E 80 00 20 */ blr - -.global it_8029BA68 -it_8029BA68: -/* 8029BA68 00298648 38 60 00 01 */ li r3, 1 -/* 8029BA6C 0029864C 4E 80 00 20 */ blr - -.global it_8029BA70 -it_8029BA70: -/* 8029BA70 00298650 38 60 00 01 */ li r3, 1 -/* 8029BA74 00298654 4E 80 00 20 */ blr - -.global it_8029BA78 -it_8029BA78: -/* 8029BA78 00298658 7C 08 02 A6 */ mflr r0 -/* 8029BA7C 0029865C 90 01 00 04 */ stw r0, 4(r1) -/* 8029BA80 00298660 94 21 FF F8 */ stwu r1, -8(r1) -/* 8029BA84 00298664 4B FD 75 F5 */ bl itColl_BounceOffShield -/* 8029BA88 00298668 80 01 00 0C */ lwz r0, 0xc(r1) -/* 8029BA8C 0029866C 38 21 00 08 */ addi r1, r1, 8 -/* 8029BA90 00298670 7C 08 03 A6 */ mtlr r0 -/* 8029BA94 00298674 4E 80 00 20 */ blr - -.global it_8029BA98 -it_8029BA98: -/* 8029BA98 00298678 7C 08 02 A6 */ mflr r0 -/* 8029BA9C 0029867C 90 01 00 04 */ stw r0, 4(r1) -/* 8029BAA0 00298680 94 21 FF F8 */ stwu r1, -8(r1) -/* 8029BAA4 00298684 4B FC FD F1 */ bl it_8026B894 -/* 8029BAA8 00298688 80 01 00 0C */ lwz r0, 0xc(r1) -/* 8029BAAC 0029868C 38 21 00 08 */ addi r1, r1, 8 -/* 8029BAB0 00298690 7C 08 03 A6 */ mtlr r0 -/* 8029BAB4 00298694 4E 80 00 20 */ blr - - -.section .data - .balign 8 -.global it_803F6788 -it_803F6788: - .4byte 0 - .4byte it_8029B868 - .4byte it_8029B8A0 - .4byte it_8029B8EC - - -.section .sdata2 - .balign 8 -.global it_804DCC98 -it_804DCC98: - .4byte 0x00000000 -.global it_804DCC9C -it_804DCC9C: - .4byte 0x3F800000 -.global it_804DCCA0 -it_804DCCA0: - .4byte 0x3FE00000 - .4byte 0x00000000 -.global it_804DCCA8 -it_804DCCA8: - .4byte 0x40080000 - .4byte 0x00000000 diff --git a/configure.py b/configure.py index 7edc542cfe..c224b5ee9e 100755 --- a/configure.py +++ b/configure.py @@ -905,7 +905,7 @@ def RuntimeLib(lib_name: str, objects: Objects) -> LibDict: Object(NonMatching, "melee/it/items/itfflowerflame.c"), Object(NonMatching, "melee/it/items/itevyoshiegg.c"), # Fighter-related items - Object(NonMatching, "melee/it/items/itmariofireball.c"), + Object(Matching, "melee/it/items/itmariofireball.c"), Object(NonMatching, "melee/it/items/itkirbycutterbeam.c"), Object(Matching, "melee/it/items/itfoxlaser.c"), Object(Matching, "melee/it/items/itfoxillusion.c"), diff --git a/obj_files.mk b/obj_files.mk index 672ee0710c..3d6326feff 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -604,7 +604,7 @@ TEXT_O_FILES +=\ $(BUILD_DIR)/asm/melee/it/items/itevyoshiegg.s.o\ TEXT_O_FILES +=\ - $(BUILD_DIR)/asm/melee/it/items/itmariofireball.s.o\ + $(BUILD_DIR)/src/melee/it/items/itmariofireball.c.o\ $(BUILD_DIR)/asm/melee/it/items/itkirbycutterbeam.s.o\ $(BUILD_DIR)/src/melee/it/items/itfoxlaser.c.o\ $(BUILD_DIR)/src/melee/it/items/itfoxillusion.c.o\ @@ -794,6 +794,7 @@ TEXT_O_FILES +=\ $(BUILD_DIR)/src/MSL/math_1.c.o\ $(BUILD_DIR)/asm/MSL/trigf.s.o\ $(BUILD_DIR)/asm/MSL/math.s.o\ + $(BUILD_DIR)/src/MSL/math_ppc.c.o\ TEXT_O_FILES +=\ $(BUILD_DIR)/asm/MetroTRK/mainloop.s.o\ diff --git a/src/MSL/math.h b/src/MSL/math.h index b2090f47bd..22015fd35b 100644 --- a/src/MSL/math.h +++ b/src/MSL/math.h @@ -22,25 +22,6 @@ static float const rad_to_deg = 180 / M_PI; #define FLT_EPSILON 1.00000001335e-10F -extern inline float sqrtf(float x) -{ - static const double _half = .5; - static const double _three = 3.0; - volatile float y; - if (x > 0.0f) { - double guess = __frsqrte((double) x); // returns an approximation to - guess = _half * guess * - (_three - guess * guess * x); // now have 12 sig bits - guess = _half * guess * - (_three - guess * guess * x); // now have 24 sig bits - guess = _half * guess * - (_three - guess * guess * x); // now have 32 sig bits - y = (float) (x * guess); - return y; - } - return x; -} - #ifdef __MWERKS__ #pragma pop #endif @@ -103,24 +84,6 @@ static inline f32 fabs_inline(f32 x) } } -inline float sqrtf_accurate(float x) -{ - volatile float y; - if (x > 0.0f) { - double guess = __frsqrte((double) x); // returns an approximation to - guess = - 0.5 * guess * (3.0 - guess * guess * x); // now have 12 sig bits - guess = - 0.5 * guess * (3.0 - guess * guess * x); // now have 24 sig bits - guess = - 0.5 * guess * (3.0 - guess * guess * x); // now have 32 sig bits - guess = 0.5 * guess * (3.0 - guess * guess * x); // extra iteration - y = (float) (x * guess); - return y; - } - return x; -} - double frexp(double x, int* exponent); double fabsf__Ff(double); float tanf(float x); diff --git a/src/MSL/math_ppc.c b/src/MSL/math_ppc.c new file mode 100644 index 0000000000..73494cf7dc --- /dev/null +++ b/src/MSL/math_ppc.c @@ -0,0 +1 @@ +#include "math_ppc.h" diff --git a/src/MSL/math_ppc.h b/src/MSL/math_ppc.h new file mode 100644 index 0000000000..934c036eec --- /dev/null +++ b/src/MSL/math_ppc.h @@ -0,0 +1,52 @@ +#ifndef _MATH_PPC_H_ +#define _MATH_PPC_H_ + +#include + +#ifdef __MWERKS__ +#pragma push +#pragma cplusplus on +#endif + +extern inline float sqrtf(float x) +{ + static const double _half = .5; + static const double _three = 3.0; + volatile float y; + if (x > 0.0f) { + double guess = __frsqrte((double) x); // returns an approximation to + guess = _half * guess * + (_three - guess * guess * x); // now have 12 sig bits + guess = _half * guess * + (_three - guess * guess * x); // now have 24 sig bits + guess = _half * guess * + (_three - guess * guess * x); // now have 32 sig bits + y = (float) (x * guess); + return y; + } + return x; +} + +#ifdef __MWERKS__ +#pragma pop +#endif + +inline float sqrtf_accurate(float x) +{ + volatile float y; + if (x > 0.0f) { + double guess = __frsqrte((double) x); // returns an approximation to + guess = + 0.5 * guess * (3.0 - guess * guess * x); // now have 12 sig bits + guess = + 0.5 * guess * (3.0 - guess * guess * x); // now have 24 sig bits + guess = + 0.5 * guess * (3.0 - guess * guess * x); // now have 32 sig bits + guess = 0.5 * guess * (3.0 - guess * guess * x); // extra iteration + y = (float) (x * guess); + return y; + } + return x; +} + +#endif diff --git a/src/melee/cm/camera.c b/src/melee/cm/camera.c index 93653ce712..786a460b26 100644 --- a/src/melee/cm/camera.c +++ b/src/melee/cm/camera.c @@ -8,6 +8,7 @@ #include "pl/player.h" #include +#include #include #include #include diff --git a/src/melee/ft/chara/ftCommon/ftCo_0A01.c b/src/melee/ft/chara/ftCommon/ftCo_0A01.c index a0c1dee3e4..2b84daab0b 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_0A01.c +++ b/src/melee/ft/chara/ftCommon/ftCo_0A01.c @@ -11,6 +11,7 @@ #include "pl/player.h" #include +#include #include #include diff --git a/src/melee/ft/chara/ftCommon/ftCo_Damage.c b/src/melee/ft/chara/ftCommon/ftCo_Damage.c index fe15e1a9e8..39643b7d16 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_Damage.c +++ b/src/melee/ft/chara/ftCommon/ftCo_Damage.c @@ -47,6 +47,7 @@ #include #include +#include #include #include #include diff --git a/src/melee/ft/chara/ftCommon/ftCo_DownBound.c b/src/melee/ft/chara/ftCommon/ftCo_DownBound.c index ae95e56127..b4a9013410 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_DownBound.c +++ b/src/melee/ft/chara/ftCommon/ftCo_DownBound.c @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/src/melee/ft/chara/ftCommon/ftCo_FlyReflect.c b/src/melee/ft/chara/ftCommon/ftCo_FlyReflect.c index 6bdb69a4f3..adb36e8a26 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_FlyReflect.c +++ b/src/melee/ft/chara/ftCommon/ftCo_FlyReflect.c @@ -22,6 +22,7 @@ #include #include +#include #pragma force_active on diff --git a/src/melee/ft/chara/ftCommon/ftCo_Guard.c b/src/melee/ft/chara/ftCommon/ftCo_Guard.c index 7d8496892d..14195ed242 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_Guard.c +++ b/src/melee/ft/chara/ftCommon/ftCo_Guard.c @@ -43,6 +43,7 @@ #include #include +#include #include #include #include diff --git a/src/melee/ft/chara/ftCommon/ftCo_ThrownKirby.c b/src/melee/ft/chara/ftCommon/ftCo_ThrownKirby.c index 9ef2961432..f5e4637964 100644 --- a/src/melee/ft/chara/ftCommon/ftCo_ThrownKirby.c +++ b/src/melee/ft/chara/ftCommon/ftCo_ThrownKirby.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/src/melee/ft/chara/ftMario/ftMr_SpecialN.c b/src/melee/ft/chara/ftMario/ftMr_SpecialN.c index 719caafbe3..5e365e8cd4 100644 --- a/src/melee/ft/chara/ftMario/ftMr_SpecialN.c +++ b/src/melee/ft/chara/ftMario/ftMr_SpecialN.c @@ -14,6 +14,7 @@ #include "ftCommon/ftCo_Wait.h" #include "ftMario/types.h" #include "it/items/it_27CF.h" +#include "it/items/itmariofireball.h" #include "lb/lb_00B0.h" #include @@ -112,7 +113,7 @@ void ftMr_SpecialN_ItemFireSpawn(HSD_GObj* gobj) lb_8000B1CC(fp->parts[ftParts_8007500C(fp, FtPart_L1stNb)].joint, NULL, &coords); if (fp->kind == FTKIND_MARIO) { - it_8029B6F8(fp->facing_dir, gobj, &coords, FtPart_RThumbNa); + it_8029B6F8(gobj, &coords, It_Kind_Mario_Fire, fp->facing_dir); efSync_Spawn(1146, gobj, fp->parts[ftParts_8007500C(fp, FtPart_L1stNb)].joint, &fp->facing_dir); diff --git a/src/melee/ft/chara/ftMewtwo/ftMt_SpecialHi.c b/src/melee/ft/chara/ftMewtwo/ftMt_SpecialHi.c index 9d1e5b023a..7cedf36c1b 100644 --- a/src/melee/ft/chara/ftMewtwo/ftMt_SpecialHi.c +++ b/src/melee/ft/chara/ftMewtwo/ftMt_SpecialHi.c @@ -3,8 +3,6 @@ #include "ftMt_SpecialHi.h" -#include "math.h" - #include "ef/eflib.h" #include "ef/efsync.h" #include "ft/fighter.h" @@ -26,6 +24,8 @@ #include #include +#include +#include /// Create Teleport Start GFX void ftMt_SpecialHi_CreateGFX(HSD_GObj* gobj) diff --git a/src/melee/ft/chara/ftNess/ftNs_SpecialHi.c b/src/melee/ft/chara/ftNess/ftNs_SpecialHi.c index e786f2c951..586eb071f6 100644 --- a/src/melee/ft/chara/ftNess/ftNs_SpecialHi.c +++ b/src/melee/ft/chara/ftNess/ftNs_SpecialHi.c @@ -4,7 +4,6 @@ #include "ftNs_SpecialHi.h" #include "ftNs_Init.h" -#include "math.h" #include "ef/eflib.h" #include "ef/efsync.h" @@ -25,6 +24,8 @@ #include "lb/lbrefract.h" #include "lb/lbvector.h" +#include +#include #include // SpecialHi/SpecialAirHi (PK Thunder) diff --git a/src/melee/ft/chara/ftPikachu/ftPk_SpecialHi.c b/src/melee/ft/chara/ftPikachu/ftPk_SpecialHi.c index 6c6c1a3b1b..1c83897ab0 100644 --- a/src/melee/ft/chara/ftPikachu/ftPk_SpecialHi.c +++ b/src/melee/ft/chara/ftPikachu/ftPk_SpecialHi.c @@ -3,8 +3,6 @@ #include "ftPk_SpecialHi.h" -#include "math.h" - #include "ef/eflib.h" #include "ef/efsync.h" #include "ft/fighter.h" @@ -23,6 +21,8 @@ #include "lb/lbrefract.h" #include "lb/lbvector.h" +#include +#include #include #include #include diff --git a/src/melee/ft/chara/ftSeak/ftSk_SpecialS.c b/src/melee/ft/chara/ftSeak/ftSk_SpecialS.c index 664121ff85..d7103bd6c5 100644 --- a/src/melee/ft/chara/ftSeak/ftSk_SpecialS.c +++ b/src/melee/ft/chara/ftSeak/ftSk_SpecialS.c @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/src/melee/ft/fighter.c b/src/melee/ft/fighter.c index 189048ee6d..9ffb0a48e3 100644 --- a/src/melee/ft/fighter.c +++ b/src/melee/ft/fighter.c @@ -73,7 +73,6 @@ #include "un/un_2FC9.h" #include -#include #include #include #include @@ -89,6 +88,8 @@ #include #include #include +#include +#include #include extern struct UnkCostumeList CostumeListsForeachCharacter[FTKIND_MAX]; diff --git a/src/melee/gr/grdynamicattr.c b/src/melee/gr/grdynamicattr.c index c5140ee4b7..cb0c3e4f8b 100644 --- a/src/melee/gr/grdynamicattr.c +++ b/src/melee/gr/grdynamicattr.c @@ -5,6 +5,7 @@ #include "mp/mplib.h" #include +#include #include static const s32 GC_Id_None = -1; diff --git a/src/melee/it/itCommonItems.h b/src/melee/it/itCommonItems.h index 796f73a35e..d2cc291155 100644 --- a/src/melee/it/itCommonItems.h +++ b/src/melee/it/itCommonItems.h @@ -91,6 +91,7 @@ typedef struct itUnkAttributes { float x4_float; float x8; float xC; + float x10; } itUnkAttributes; typedef struct { diff --git a/src/melee/it/items/it_27CF.dox b/src/melee/it/items/it_27CF.dox index e3c832f918..2edb48715f 100644 --- a/src/melee/it/items/it_27CF.dox +++ b/src/melee/it/items/it_27CF.dox @@ -89,7 +89,6 @@ void it_8028FAF4(Item_GObj*, Vec3*); void it_802C7A84(Item_GObj*); void it_802C7AD0(Item_GObj*); void it_802C7AF0(Item_GObj*); -void it_8029B6F8(f32 facing_dir, HSD_GObj*, Vec3*, s32); void it_802C0510(Item_GObj*, Vec3*, s32, s32, f32 facing_dir); HSD_GObj* it_802B2560(Item_GObj*, f32, Vec3*, long, u32); void it_802B2674(Item_GObj*); diff --git a/src/melee/it/items/it_27CF.h b/src/melee/it/items/it_27CF.h index 4a9ffb589a..820e8c45fc 100644 --- a/src/melee/it/items/it_27CF.h +++ b/src/melee/it/items/it_27CF.h @@ -31,7 +31,6 @@ /* 29A748 */ HSD_GObj* it_8029A748(Item_GObj*, Vec3*, u8, float); /* 29A89C */ void it_8029A89C(Item_GObj*, float); /* 29A8F4 */ void it_8029A8F4(Item_GObj*, Vec3*, float); -/* 29B6F8 */ void it_8029B6F8(float facing_dir, HSD_GObj*, Vec3*, s32); /* 29D968 */ void it_8029D968(Item_GObj*); /* 29DD58 */ HSD_GObj* it_8029DD58(Item_GObj* fighter_gobj, Vec3*, u8, int, float); diff --git a/src/melee/it/items/itluigifireball.c b/src/melee/it/items/itluigifireball.c index 08ba4db40a..0719807d16 100644 --- a/src/melee/it/items/itluigifireball.c +++ b/src/melee/it/items/itluigifireball.c @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/src/melee/it/items/itmariofireball.c b/src/melee/it/items/itmariofireball.c index 8b13789179..9dd06b403c 100644 --- a/src/melee/it/items/itmariofireball.c +++ b/src/melee/it/items/itmariofireball.c @@ -1 +1,133 @@ +#include "itmariofireball.h" +#include "db/db_2253.h" +#include "ef/efasync.h" +#include "it/inlines.h" +#include "it/it_266F.h" +#include "it/it_26B1.h" +#include "it/it_2725.h" +#include "it/itCommonItems.h" +#include "it/item.h" + +#include +#include +#include +#include +#include + +ItemStateTable it_803F6788[] = { + { 0, it_8029B868, it_8029B8A0, it_8029B8EC }, +}; + +void it_8029B6F8(Item_GObj* gobj, Vec3* pos, ItemKind kind, f32 facing_dir) +{ + Item_GObj* spawned_gobj; + + SpawnItem spawn_item; + spawn_item.kind = kind; + spawn_item.prev_pos = *pos; + spawn_item.prev_pos.z = 0.0f; + it_8026BB68(gobj, &spawn_item.pos); + spawn_item.facing_dir = facing_dir; + spawn_item.x3C_damage = 0; + spawn_item.vel.x = spawn_item.vel.y = spawn_item.vel.z = 0.0f; + spawn_item.x0_parent_gobj = gobj; + spawn_item.x4_parent_gobj2 = spawn_item.x0_parent_gobj; + spawn_item.x44_flag.bits.b0 = true; + spawn_item.x40 = 0; + + spawned_gobj = Item_80268B18(&spawn_item); + it_8029B7C0(spawned_gobj); + db_80225DD8(spawned_gobj, gobj); + it_802750F8(spawned_gobj); +} + +void it_8029B7C0(Item_GObj* gobj) +{ + Item* it = GET_ITEM(gobj); + itUnkAttributes* ap = it->xC4_article_data->x4_specialAttributes; + f32 x0 = ap->x0_float; + f32 x4 = ap->x4_float; + + it->x40_vel.x = it->facing_dir * (x0 * cosf(x4)); + it->x40_vel.y = x0 * sinf(x4); + it->x40_vel.z = 0.0f; + + it_80275158(gobj, ap->x8); + Item_80268E5C(gobj, 0, ITEM_ANIM_UPDATE); +} + +bool it_8029B868(Item_GObj* gobj) +{ + Item* item = GET_ITEM(gobj); + --item->xD44_lifeTimer; + return item->xD44_lifeTimer <= 0 ? true : false; +} + +void it_8029B8A0(Item_GObj* gobj) +{ + ItemAttr* attrs = GET_ITEM(gobj)->xCC_item_attr; + it_80272860(gobj, attrs->x10_fall_speed, attrs->x14_fall_speed_max); + it_80274658(gobj, it_804D6D28->x68_float); +} + +static double calc_dist_2d_accurate(Vec3* v) +{ + return sqrtf_accurate(VEC2_SQ_LEN(*v)); +} + +bool it_8029B8EC(Item_GObj* gobj) +{ + it_8026D9A0(gobj); + if (it_8027781C(gobj)) { + Item* it = GET_ITEM(gobj); + HSD_JObj* jobj = GET_JOBJ(gobj); + itUnkAttributes* attrs = it->xC4_article_data->x4_specialAttributes; + if (calc_dist_2d_accurate(&it->x40_vel) < attrs->x10) { + return true; + } + if (it->kind == It_Kind_Mario_Fire) { + Item_8026AE84(it, ~0xFFFD40C6, 0x7f, + 0x40); // What the fuck is this ID? + efAsync_Spawn(gobj, &(GET_ITEM(gobj)->xBC0), 1, 1147, jobj); + } else { + efAsync_Spawn(gobj, &(GET_ITEM(gobj)->xBC0), 1, 1184, jobj); + } + } + return false; +} + +bool it_8029BA38(Item_GObj* gobj) +{ + return true; +} + +bool it_8029BA40(Item_GObj* gobj) +{ + return it_80273030(gobj); +} + +bool it_8029BA60(Item_GObj* gobj) +{ + return true; +} + +bool it_8029BA68(Item_GObj* gobj) +{ + return true; +} + +bool it_8029BA70(Item_GObj* gobj) +{ + return true; +} + +bool it_8029BA78(Item_GObj* gobj) +{ + return itColl_BounceOffShield(gobj); +} + +void it_8029BA98(Item_GObj* gobj, HSD_GObj* referenced_gobj) +{ + it_8026B894(gobj, referenced_gobj); +} diff --git a/src/melee/it/items/itmariofireball.h b/src/melee/it/items/itmariofireball.h index 8020accef7..760a367143 100644 --- a/src/melee/it/items/itmariofireball.h +++ b/src/melee/it/items/itmariofireball.h @@ -3,16 +3,23 @@ #include #include "it/forward.h" +#include +#include #include "it/items/types.h" -/* 29BA38 */ bool it_8029BA38(Item_GObj*); -/* 29BA40 */ bool it_8029BA40(Item_GObj*); -/* 29BA60 */ bool it_8029BA60(Item_GObj*); -/* 29BA68 */ bool it_8029BA68(Item_GObj*); -/* 29BA70 */ bool it_8029BA70(Item_GObj*); -/* 29BA78 */ bool it_8029BA78(Item_GObj*); -/* 29BA98 */ void it_8029BA98(Item_GObj*, Item_GObj*); -/* 3F6788 */ extern ItemStateTable it_803F6788[]; +void it_8029B6F8(Item_GObj*, Vec3*, ItemKind, f32); +void it_8029B7C0(Item_GObj*); +bool it_8029B868(Item_GObj*); +void it_8029B8A0(Item_GObj*); +bool it_8029B8EC(Item_GObj*); +bool it_8029BA38(Item_GObj*); +bool it_8029BA40(Item_GObj*); +bool it_8029BA60(Item_GObj*); +bool it_8029BA68(Item_GObj*); +bool it_8029BA70(Item_GObj*); +bool it_8029BA78(Item_GObj*); +void it_8029BA98(Item_GObj*, Item_GObj*); +extern ItemStateTable it_803F6788[]; #endif diff --git a/src/melee/lb/lbvector.c b/src/melee/lb/lbvector.c index 04f4f66e01..0c0b9a6054 100644 --- a/src/melee/lb/lbvector.c +++ b/src/melee/lb/lbvector.c @@ -5,6 +5,7 @@ #include "lb/lbrefract.h" #include +#include #include #include #include diff --git a/src/sysdolphin/baselib/mtx.h b/src/sysdolphin/baselib/mtx.h index 412e119c43..a7048df07f 100644 --- a/src/sysdolphin/baselib/mtx.h +++ b/src/sysdolphin/baselib/mtx.h @@ -7,6 +7,7 @@ #include "baselib/objalloc.h" #include +#include void HSD_MtxInverse(Mtx src, Mtx dest); void HSD_MtxInverseConcat(Mtx inv, Mtx src, Mtx dest);