From a95558163880dd9569b2bdb668c3eaf31d78eff3 Mon Sep 17 00:00:00 2001 From: Ryan Burns <52847440+r-burns@users.noreply.github.com> Date: Sat, 1 Jul 2023 00:36:56 -0700 Subject: [PATCH] Match ityoshistar (#950) --- asm/melee/it/items/ityoshistar.s | 314 ------------------------------- obj_files.mk | 2 +- src/melee/it/it_266F.h | 4 + src/melee/it/it_803F3100.c | 9 +- src/melee/it/items/itcapsule.c | 7 - src/melee/it/items/ityoshistar.c | 123 ++++++++++++ src/melee/it/items/ityoshistar.h | 23 +++ 7 files changed, 152 insertions(+), 330 deletions(-) delete mode 100644 asm/melee/it/items/ityoshistar.s create mode 100644 src/melee/it/items/ityoshistar.c create mode 100644 src/melee/it/items/ityoshistar.h diff --git a/asm/melee/it/items/ityoshistar.s b/asm/melee/it/items/ityoshistar.s deleted file mode 100644 index ed2922042c..0000000000 --- a/asm/melee/it/items/ityoshistar.s +++ /dev/null @@ -1,314 +0,0 @@ -.include "macros.inc" - -.section .text - -.global it_802B2FC8 -it_802B2FC8: -/* 802B2FC8 002AFBA8 7C 08 02 A6 */ mflr r0 -/* 802B2FCC 002AFBAC 90 01 00 04 */ stw r0, 4(r1) -/* 802B2FD0 002AFBB0 38 00 00 58 */ li r0, 0x58 -/* 802B2FD4 002AFBB4 94 21 FF 90 */ stwu r1, -0x70(r1) -/* 802B2FD8 002AFBB8 DB E1 00 68 */ stfd f31, 0x68(r1) -/* 802B2FDC 002AFBBC FF E0 08 90 */ fmr f31, f1 -/* 802B2FE0 002AFBC0 93 E1 00 64 */ stw r31, 0x64(r1) -/* 802B2FE4 002AFBC4 93 C1 00 60 */ stw r30, 0x60(r1) -/* 802B2FE8 002AFBC8 7C 7E 1B 78 */ mr r30, r3 -/* 802B2FEC 002AFBCC 90 01 00 1C */ stw r0, 0x1c(r1) -/* 802B2FF0 002AFBD0 80 A4 00 00 */ lwz r5, 0(r4) -/* 802B2FF4 002AFBD4 80 04 00 04 */ lwz r0, 4(r4) -/* 802B2FF8 002AFBD8 90 A1 00 34 */ stw r5, 0x34(r1) -/* 802B2FFC 002AFBDC 90 01 00 38 */ stw r0, 0x38(r1) -/* 802B3000 002AFBE0 80 04 00 08 */ lwz r0, 8(r4) -/* 802B3004 002AFBE4 38 81 00 28 */ addi r4, r1, 0x28 -/* 802B3008 002AFBE8 90 01 00 3C */ stw r0, 0x3c(r1) -/* 802B300C 002AFBEC 4B FB 8B 5D */ bl it_8026BB68 -/* 802B3010 002AFBF0 D3 E1 00 4C */ stfs f31, 0x4c(r1) -/* 802B3014 002AFBF4 38 A0 00 00 */ li r5, 0 -/* 802B3018 002AFBF8 C0 02 D5 E8 */ lfs f0, it_804DCFC8@sda21(r2) -/* 802B301C 002AFBFC 38 80 00 01 */ li r4, 1 -/* 802B3020 002AFC00 B0 A1 00 50 */ sth r5, 0x50(r1) -/* 802B3024 002AFC04 38 61 00 14 */ addi r3, r1, 0x14 -/* 802B3028 002AFC08 D0 01 00 48 */ stfs f0, 0x48(r1) -/* 802B302C 002AFC0C D0 01 00 44 */ stfs f0, 0x44(r1) -/* 802B3030 002AFC10 D0 01 00 40 */ stfs f0, 0x40(r1) -/* 802B3034 002AFC14 93 C1 00 14 */ stw r30, 0x14(r1) -/* 802B3038 002AFC18 80 01 00 14 */ lwz r0, 0x14(r1) -/* 802B303C 002AFC1C 90 01 00 18 */ stw r0, 0x18(r1) -/* 802B3040 002AFC20 88 01 00 58 */ lbz r0, 0x58(r1) -/* 802B3044 002AFC24 50 80 3E 30 */ rlwimi r0, r4, 7, 0x18, 0x18 -/* 802B3048 002AFC28 98 01 00 58 */ stb r0, 0x58(r1) -/* 802B304C 002AFC2C 90 A1 00 54 */ stw r5, 0x54(r1) -/* 802B3050 002AFC30 4B FB 5A C9 */ bl Item_80268B18 -/* 802B3054 002AFC34 7C 7F 1B 79 */ or. r31, r3, r3 -/* 802B3058 002AFC38 41 82 00 24 */ beq .L_802B307C -/* 802B305C 002AFC3C 38 7F 00 00 */ addi r3, r31, 0 -/* 802B3060 002AFC40 38 9E 00 00 */ addi r4, r30, 0 -/* 802B3064 002AFC44 48 00 01 C9 */ bl it_802B322C -/* 802B3068 002AFC48 38 7F 00 00 */ addi r3, r31, 0 -/* 802B306C 002AFC4C 38 9E 00 00 */ addi r4, r30, 0 -/* 802B3070 002AFC50 4B F7 2D 69 */ bl db_80225DD8 -/* 802B3074 002AFC54 7F E3 FB 78 */ mr r3, r31 -/* 802B3078 002AFC58 48 00 00 08 */ b .L_802B3080 -.L_802B307C: -/* 802B307C 002AFC5C 38 60 00 00 */ li r3, 0 -.L_802B3080: -/* 802B3080 002AFC60 80 01 00 74 */ lwz r0, 0x74(r1) -/* 802B3084 002AFC64 CB E1 00 68 */ lfd f31, 0x68(r1) -/* 802B3088 002AFC68 83 E1 00 64 */ lwz r31, 0x64(r1) -/* 802B308C 002AFC6C 83 C1 00 60 */ lwz r30, 0x60(r1) -/* 802B3090 002AFC70 38 21 00 70 */ addi r1, r1, 0x70 -/* 802B3094 002AFC74 7C 08 03 A6 */ mtlr r0 -/* 802B3098 002AFC78 4E 80 00 20 */ blr - -.global it_802B309C -it_802B309C: -/* 802B309C 002AFC7C 7C 08 02 A6 */ mflr r0 -/* 802B30A0 002AFC80 90 01 00 04 */ stw r0, 4(r1) -/* 802B30A4 002AFC84 94 21 FF F8 */ stwu r1, -8(r1) -/* 802B30A8 002AFC88 4B FB FA FD */ bl it_80272BA4 -/* 802B30AC 002AFC8C 38 60 00 01 */ li r3, 1 -/* 802B30B0 002AFC90 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802B30B4 002AFC94 38 21 00 08 */ addi r1, r1, 8 -/* 802B30B8 002AFC98 7C 08 03 A6 */ mtlr r0 -/* 802B30BC 002AFC9C 4E 80 00 20 */ blr - -.global it_802B30C0 -it_802B30C0: -/* 802B30C0 002AFCA0 7C 08 02 A6 */ mflr r0 -/* 802B30C4 002AFCA4 90 01 00 04 */ stw r0, 4(r1) -/* 802B30C8 002AFCA8 94 21 FF F8 */ stwu r1, -8(r1) -/* 802B30CC 002AFCAC 4B FB FA D9 */ bl it_80272BA4 -/* 802B30D0 002AFCB0 38 60 00 01 */ li r3, 1 -/* 802B30D4 002AFCB4 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802B30D8 002AFCB8 38 21 00 08 */ addi r1, r1, 8 -/* 802B30DC 002AFCBC 7C 08 03 A6 */ mtlr r0 -/* 802B30E0 002AFCC0 4E 80 00 20 */ blr - -.global it_802B30E4 -it_802B30E4: -/* 802B30E4 002AFCC4 7C 08 02 A6 */ mflr r0 -/* 802B30E8 002AFCC8 90 01 00 04 */ stw r0, 4(r1) -/* 802B30EC 002AFCCC 94 21 FF F8 */ stwu r1, -8(r1) -/* 802B30F0 002AFCD0 4B FB FA B5 */ bl it_80272BA4 -/* 802B30F4 002AFCD4 38 60 00 01 */ li r3, 1 -/* 802B30F8 002AFCD8 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802B30FC 002AFCDC 38 21 00 08 */ addi r1, r1, 8 -/* 802B3100 002AFCE0 7C 08 03 A6 */ mtlr r0 -/* 802B3104 002AFCE4 4E 80 00 20 */ blr - -.global it_802B3108 -it_802B3108: -/* 802B3108 002AFCE8 7C 08 02 A6 */ mflr r0 -/* 802B310C 002AFCEC 90 01 00 04 */ stw r0, 4(r1) -/* 802B3110 002AFCF0 94 21 FF F8 */ stwu r1, -8(r1) -/* 802B3114 002AFCF4 4B FB FA 91 */ bl it_80272BA4 -/* 802B3118 002AFCF8 38 60 00 01 */ li r3, 1 -/* 802B311C 002AFCFC 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802B3120 002AFD00 38 21 00 08 */ addi r1, r1, 8 -/* 802B3124 002AFD04 7C 08 03 A6 */ mtlr r0 -/* 802B3128 002AFD08 4E 80 00 20 */ blr - -.global it_802B312C -it_802B312C: -/* 802B312C 002AFD0C 7C 08 02 A6 */ mflr r0 -/* 802B3130 002AFD10 90 01 00 04 */ stw r0, 4(r1) -/* 802B3134 002AFD14 94 21 FF F8 */ stwu r1, -8(r1) -/* 802B3138 002AFD18 4B FB FF 41 */ bl itColl_BounceOffShield -/* 802B313C 002AFD1C 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802B3140 002AFD20 38 21 00 08 */ addi r1, r1, 8 -/* 802B3144 002AFD24 7C 08 03 A6 */ mtlr r0 -/* 802B3148 002AFD28 4E 80 00 20 */ blr - -.global it_802B314C -it_802B314C: -/* 802B314C 002AFD2C 7C 08 02 A6 */ mflr r0 -/* 802B3150 002AFD30 90 01 00 04 */ stw r0, 4(r1) -/* 802B3154 002AFD34 94 21 FF D8 */ stwu r1, -0x28(r1) -/* 802B3158 002AFD38 DB E1 00 20 */ stfd f31, 0x20(r1) -/* 802B315C 002AFD3C 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 802B3160 002AFD40 93 C1 00 18 */ stw r30, 0x18(r1) -/* 802B3164 002AFD44 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 802B3168 002AFD48 83 C3 00 28 */ lwz r30, 0x28(r3) -/* 802B316C 002AFD4C 4B FB FE C5 */ bl it_80273030 -/* 802B3170 002AFD50 C0 22 D5 EC */ lfs f1, it_804DCFCC@sda21(r2) -/* 802B3174 002AFD54 28 1E 00 00 */ cmplwi r30, 0 -/* 802B3178 002AFD58 C0 1F 00 2C */ lfs f0, 0x2c(r31) -/* 802B317C 002AFD5C EF E1 00 32 */ fmuls f31, f1, f0 -/* 802B3180 002AFD60 40 82 00 14 */ bne .L_802B3194 -/* 802B3184 002AFD64 38 6D 9D F8 */ addi r3, r13, it_804D5498@sda21 -/* 802B3188 002AFD68 38 80 02 94 */ li r4, 0x294 -/* 802B318C 002AFD6C 38 AD 9E 00 */ addi r5, r13, it_804D54A0@sda21 -/* 802B3190 002AFD70 48 0D 50 91 */ bl __assert -.L_802B3194: -/* 802B3194 002AFD74 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802B3198 002AFD78 54 00 03 9D */ rlwinm. r0, r0, 0, 0xe, 0xe -/* 802B319C 002AFD7C 41 82 00 18 */ beq .L_802B31B4 -/* 802B31A0 002AFD80 3C 60 80 3F */ lis r3, it_803F7168@ha -/* 802B31A4 002AFD84 38 A3 71 68 */ addi r5, r3, it_803F7168@l -/* 802B31A8 002AFD88 38 6D 9D F8 */ addi r3, r13, it_804D5498@sda21 -/* 802B31AC 002AFD8C 38 80 02 95 */ li r4, 0x295 -/* 802B31B0 002AFD90 48 0D 50 71 */ bl __assert -.L_802B31B4: -/* 802B31B4 002AFD94 D3 FE 00 20 */ stfs f31, 0x20(r30) -/* 802B31B8 002AFD98 80 1E 00 14 */ lwz r0, 0x14(r30) -/* 802B31BC 002AFD9C 54 00 01 8D */ rlwinm. r0, r0, 0, 6, 6 -/* 802B31C0 002AFDA0 40 82 00 4C */ bne .L_802B320C -/* 802B31C4 002AFDA4 28 1E 00 00 */ cmplwi r30, 0 -/* 802B31C8 002AFDA8 41 82 00 44 */ beq .L_802B320C -/* 802B31CC 002AFDAC 40 82 00 14 */ bne .L_802B31E0 -/* 802B31D0 002AFDB0 38 6D 9D F8 */ addi r3, r13, it_804D5498@sda21 -/* 802B31D4 002AFDB4 38 80 02 34 */ li r4, 0x234 -/* 802B31D8 002AFDB8 38 AD 9E 00 */ addi r5, r13, it_804D54A0@sda21 -/* 802B31DC 002AFDBC 48 0D 50 45 */ bl __assert -.L_802B31E0: -/* 802B31E0 002AFDC0 80 9E 00 14 */ lwz r4, 0x14(r30) -/* 802B31E4 002AFDC4 38 60 00 00 */ li r3, 0 -/* 802B31E8 002AFDC8 54 80 02 11 */ rlwinm. r0, r4, 0, 8, 8 -/* 802B31EC 002AFDCC 40 82 00 10 */ bne .L_802B31FC -/* 802B31F0 002AFDD0 54 80 06 73 */ rlwinm. r0, r4, 0, 0x19, 0x19 -/* 802B31F4 002AFDD4 41 82 00 08 */ beq .L_802B31FC -/* 802B31F8 002AFDD8 38 60 00 01 */ li r3, 1 -.L_802B31FC: -/* 802B31FC 002AFDDC 2C 03 00 00 */ cmpwi r3, 0 -/* 802B3200 002AFDE0 40 82 00 0C */ bne .L_802B320C -/* 802B3204 002AFDE4 7F C3 F3 78 */ mr r3, r30 -/* 802B3208 002AFDE8 48 0C 00 E1 */ bl HSD_JObjSetMtxDirtySub -.L_802B320C: -/* 802B320C 002AFDEC 80 01 00 2C */ lwz r0, 0x2c(r1) -/* 802B3210 002AFDF0 38 60 00 00 */ li r3, 0 -/* 802B3214 002AFDF4 CB E1 00 20 */ lfd f31, 0x20(r1) -/* 802B3218 002AFDF8 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 802B321C 002AFDFC 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 802B3220 002AFE00 38 21 00 28 */ addi r1, r1, 0x28 -/* 802B3224 002AFE04 7C 08 03 A6 */ mtlr r0 -/* 802B3228 002AFE08 4E 80 00 20 */ blr - -.global it_802B322C -it_802B322C: -/* 802B322C 002AFE0C 7C 08 02 A6 */ mflr r0 -/* 802B3230 002AFE10 90 01 00 04 */ stw r0, 4(r1) -/* 802B3234 002AFE14 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 802B3238 002AFE18 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 802B323C 002AFE1C 7C 7F 1B 78 */ mr r31, r3 -/* 802B3240 002AFE20 80 C3 00 2C */ lwz r6, 0x2c(r3) -/* 802B3244 002AFE24 80 A6 00 C4 */ lwz r5, 0xc4(r6) -/* 802B3248 002AFE28 80 A5 00 04 */ lwz r5, 4(r5) -/* 802B324C 002AFE2C 90 86 05 18 */ stw r4, 0x518(r6) -/* 802B3250 002AFE30 C0 25 00 00 */ lfs f1, 0(r5) -/* 802B3254 002AFE34 C0 06 00 2C */ lfs f0, 0x2c(r6) -/* 802B3258 002AFE38 EC 01 00 32 */ fmuls f0, f1, f0 -/* 802B325C 002AFE3C D0 06 00 40 */ stfs f0, 0x40(r6) -/* 802B3260 002AFE40 80 86 00 CC */ lwz r4, 0xcc(r6) -/* 802B3264 002AFE44 C0 04 00 18 */ lfs f0, 0x18(r4) -/* 802B3268 002AFE48 D0 06 00 44 */ stfs f0, 0x44(r6) -/* 802B326C 002AFE4C 4B FB 81 3D */ bl it_8026B3A8 -/* 802B3270 002AFE50 38 7F 00 00 */ addi r3, r31, 0 -/* 802B3274 002AFE54 38 80 00 00 */ li r4, 0 -/* 802B3278 002AFE58 38 A0 00 02 */ li r5, 2 -/* 802B327C 002AFE5C 4B FB 5B E1 */ bl Item_80268E5C -/* 802B3280 002AFE60 80 01 00 24 */ lwz r0, 0x24(r1) -/* 802B3284 002AFE64 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 802B3288 002AFE68 38 21 00 20 */ addi r1, r1, 0x20 -/* 802B328C 002AFE6C 7C 08 03 A6 */ mtlr r0 -/* 802B3290 002AFE70 4E 80 00 20 */ blr - -.global it_802B3294 -it_802B3294: -/* 802B3294 002AFE74 7C 08 02 A6 */ mflr r0 -/* 802B3298 002AFE78 90 01 00 04 */ stw r0, 4(r1) -/* 802B329C 002AFE7C 94 21 FF F8 */ stwu r1, -8(r1) -/* 802B32A0 002AFE80 4B FB F9 CD */ bl it_80272C6C -/* 802B32A4 002AFE84 2C 03 00 00 */ cmpwi r3, 0 -/* 802B32A8 002AFE88 40 82 00 0C */ bne .L_802B32B4 -/* 802B32AC 002AFE8C 38 60 00 01 */ li r3, 1 -/* 802B32B0 002AFE90 48 00 00 08 */ b .L_802B32B8 -.L_802B32B4: -/* 802B32B4 002AFE94 38 60 00 00 */ li r3, 0 -.L_802B32B8: -/* 802B32B8 002AFE98 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802B32BC 002AFE9C 38 21 00 08 */ addi r1, r1, 8 -/* 802B32C0 002AFEA0 7C 08 03 A6 */ mtlr r0 -/* 802B32C4 002AFEA4 4E 80 00 20 */ blr - -.global it_802B32C8 -it_802B32C8: -/* 802B32C8 002AFEA8 7C 08 02 A6 */ mflr r0 -/* 802B32CC 002AFEAC 90 01 00 04 */ stw r0, 4(r1) -/* 802B32D0 002AFEB0 94 21 FF E8 */ stwu r1, -0x18(r1) -/* 802B32D4 002AFEB4 93 E1 00 14 */ stw r31, 0x14(r1) -/* 802B32D8 002AFEB8 93 C1 00 10 */ stw r30, 0x10(r1) -/* 802B32DC 002AFEBC 83 E3 00 2C */ lwz r31, 0x2c(r3) -/* 802B32E0 002AFEC0 80 BF 00 CC */ lwz r5, 0xcc(r31) -/* 802B32E4 002AFEC4 80 9F 00 C4 */ lwz r4, 0xc4(r31) -/* 802B32E8 002AFEC8 C0 25 00 10 */ lfs f1, 0x10(r5) -/* 802B32EC 002AFECC 83 C4 00 04 */ lwz r30, 4(r4) -/* 802B32F0 002AFED0 C0 45 00 14 */ lfs f2, 0x14(r5) -/* 802B32F4 002AFED4 4B FB F5 6D */ bl it_80272860 -/* 802B32F8 002AFED8 C0 5E 00 04 */ lfs f2, 4(r30) -/* 802B32FC 002AFEDC C0 3F 00 2C */ lfs f1, 0x2c(r31) -/* 802B3300 002AFEE0 C0 1F 00 40 */ lfs f0, 0x40(r31) -/* 802B3304 002AFEE4 EC 02 00 7A */ fmadds f0, f2, f1, f0 -/* 802B3308 002AFEE8 D0 1F 00 40 */ stfs f0, 0x40(r31) -/* 802B330C 002AFEEC 80 01 00 1C */ lwz r0, 0x1c(r1) -/* 802B3310 002AFEF0 83 E1 00 14 */ lwz r31, 0x14(r1) -/* 802B3314 002AFEF4 83 C1 00 10 */ lwz r30, 0x10(r1) -/* 802B3318 002AFEF8 38 21 00 18 */ addi r1, r1, 0x18 -/* 802B331C 002AFEFC 7C 08 03 A6 */ mtlr r0 -/* 802B3320 002AFF00 4E 80 00 20 */ blr - -.global it_802B3324 -it_802B3324: -/* 802B3324 002AFF04 7C 08 02 A6 */ mflr r0 -/* 802B3328 002AFF08 90 01 00 04 */ stw r0, 4(r1) -/* 802B332C 002AFF0C 94 21 FF F8 */ stwu r1, -8(r1) -/* 802B3330 002AFF10 4B FB AD C5 */ bl it_8026E0F4 -/* 802B3334 002AFF14 38 60 00 00 */ li r3, 0 -/* 802B3338 002AFF18 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802B333C 002AFF1C 38 21 00 08 */ addi r1, r1, 8 -/* 802B3340 002AFF20 7C 08 03 A6 */ mtlr r0 -/* 802B3344 002AFF24 4E 80 00 20 */ blr - -.global it_802B3348 -it_802B3348: -/* 802B3348 002AFF28 7C 08 02 A6 */ mflr r0 -/* 802B334C 002AFF2C 90 01 00 04 */ stw r0, 4(r1) -/* 802B3350 002AFF30 94 21 FF F8 */ stwu r1, -8(r1) -/* 802B3354 002AFF34 4B FB 85 41 */ bl it_8026B894 -/* 802B3358 002AFF38 80 01 00 0C */ lwz r0, 0xc(r1) -/* 802B335C 002AFF3C 38 21 00 08 */ addi r1, r1, 8 -/* 802B3360 002AFF40 7C 08 03 A6 */ mtlr r0 -/* 802B3364 002AFF44 4E 80 00 20 */ blr - - -.section .data - .balign 8 -.global it_803F7158 -it_803F7158: - .4byte 0 - .4byte it_802B3294 - .4byte it_802B32C8 - .4byte it_802B3324 -.global it_803F7168 -it_803F7168: - .asciz "!(jobj->flags & JOBJ_USE_QUATERNION)" - - -.section .sdata - .balign 8 -.global it_804D5498 -it_804D5498: - .asciz "jobj.h" - .balign 4 -.global it_804D54A0 -it_804D54A0: - .asciz "jobj" - - -.section .sdata2 - .balign 8 -.global it_804DCFC8 -it_804DCFC8: - .4byte 0x00000000 -.global it_804DCFCC -it_804DCFCC: - .4byte 0x3FC90FDB diff --git a/obj_files.mk b/obj_files.mk index 392e6bf10a..447fa5b95a 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -640,7 +640,7 @@ TEXT_O_FILES +=\ $(BUILD_DIR)/asm/melee/it/items/itpikachuthunder.s.o\ $(BUILD_DIR)/asm/melee/it/items/itmariocape.s.o\ $(BUILD_DIR)/asm/melee/it/items/ityoshieggthrow.s.o\ - $(BUILD_DIR)/asm/melee/it/items/ityoshistar.s.o\ + $(BUILD_DIR)/src/melee/it/items/ityoshistar.c.o\ $(BUILD_DIR)/asm/melee/it/items/itpikachutjoltground.s.o\ $(BUILD_DIR)/asm/melee/it/items/itpikachutjoltair.s.o\ $(BUILD_DIR)/asm/melee/it/items/itsamusbomb.s.o\ diff --git a/src/melee/it/it_266F.h b/src/melee/it/it_266F.h index d73af46bfb..9a663d7300 100644 --- a/src/melee/it/it_266F.h +++ b/src/melee/it/it_266F.h @@ -143,5 +143,9 @@ bool it_80272C6C(HSD_GObj*); void it_80279CDC(HSD_GObj*, f32); void it_8027A344(Item_GObj*); void it_8027A160(HSD_JObj* bone, Item*); +bool itColl_BounceOffShield(Item_GObj*); +void it_8026E0F4(Item_GObj*); +void it_80272BA4(Item_GObj*); +void it_80273030(Item_GObj*); #endif diff --git a/src/melee/it/it_803F3100.c b/src/melee/it/it_803F3100.c index f62909e64c..e1f974652a 100644 --- a/src/melee/it/it_803F3100.c +++ b/src/melee/it/it_803F3100.c @@ -3,6 +3,7 @@ #include #include #include +#include void it_8027C8B0(); bool it_8029BA38(); @@ -122,13 +123,6 @@ bool it_802B2E5C(); bool it_802B2E7C(); bool it_802B2F88(); void it_802B2FA8(); -bool it_802B309C(); -bool it_802B30C0(); -bool it_802B30E4(); -bool it_802B3108(); -bool it_802B312C(); -bool it_802B314C(); -void it_802B3348(); void it_802B34E4(); bool it_802B3A94(); bool it_802B3AF8(); @@ -373,7 +367,6 @@ extern ItemStateTable it_803F70A8[]; extern ItemStateTable it_803F70C8[]; extern ItemStateTable it_803F70F8[]; extern ItemStateTable it_803F7118[]; -extern ItemStateTable it_803F7158[]; extern ItemStateTable it_803F7190[]; extern ItemStateTable it_803F71D8[]; extern ItemStateTable it_803F7220[]; diff --git a/src/melee/it/items/itcapsule.c b/src/melee/it/items/itcapsule.c index cf6d66f2e5..24b19e62a9 100644 --- a/src/melee/it/items/itcapsule.c +++ b/src/melee/it/items/itcapsule.c @@ -11,17 +11,10 @@ void it_8026E15C(Item_GObj*, HSD_GObjEvent); void it_8026E414(Item_GObj*, HSD_GObjEvent); void it_8026F3D4(Item_GObj*, int, bool, int); bool it_8026F8B4(Item_GObj*, Vec3*, Vec3*, int); -void it_80272860(Item_GObj*, f32, f32); void it_80272C08(); void it_80273454(); -void it_80274658(Item_GObj*, f32); -void it_8027518C(); void it_80275444(); -void it_802756D0(); -void it_8027D258(Item_GObj*); -void it_8027D2DC(); void it_8026E8C4(Item_GObj*, HSD_GObjEvent, HSD_GObjEvent); -void itColl_BounceOffShield(Item_GObj*); ItemStateTable it_803F5468[] = { { diff --git a/src/melee/it/items/ityoshistar.c b/src/melee/it/items/ityoshistar.c new file mode 100644 index 0000000000..6ce1637cfb --- /dev/null +++ b/src/melee/it/items/ityoshistar.c @@ -0,0 +1,123 @@ +#include "ityoshistar.h" + +#include +#include +#include +#include +#include + +ItemStateTable it_803F7158[] = { + { + 0, + it_802B3294, + it_802B32C8, + it_802B3324, + } +}; + +typedef struct { + f32 speed; + f32 accel; +} StarAttrs; + +Item_GObj* it_802B2FC8(HSD_GObj* parent, Vec3* pos, f32 dir) +{ + SpawnItem spawn; + Item_GObj* item_gobj; + + spawn.kind = It_Kind_Yoshi_Star; + spawn.prev_pos = *pos; + it_8026BB68(parent, &spawn.pos); + spawn.facing_dir = dir; + spawn.x3C_damage = 0; + spawn.vel.x = spawn.vel.y = spawn.vel.z = 0.0F; + spawn.x0_parent_gobj = parent; + spawn.x4_parent_gobj2 = spawn.x0_parent_gobj; + spawn.x44_flag.bits.b0 = true; + spawn.x40 = 0; + item_gobj = Item_80268B18(&spawn); + if (item_gobj != NULL) { + it_802B322C(item_gobj, parent); + db_80225DD8(item_gobj, parent); + return item_gobj; + } + return NULL; +} + +bool it_802B309C(Item_GObj* item_gobj) +{ + it_80272BA4(item_gobj); + return true; +} + +bool it_802B30C0(Item_GObj* item_gobj) +{ + it_80272BA4(item_gobj); + return true; +} + +bool it_802B30E4(Item_GObj* item_gobj) +{ + it_80272BA4(item_gobj); + return true; +} + +bool it_802B3108(Item_GObj* item_gobj) +{ + it_80272BA4(item_gobj); + return true; +} + +bool it_802B312C(Item_GObj* item_gobj) +{ + return itColl_BounceOffShield(item_gobj); +} + +bool it_802B314C(Item_GObj* item_gobj) +{ + const f32 PI_2 = M_PI / 2; + Item* item = GET_ITEM(item_gobj); + HSD_JObj* jobj = GET_JOBJ(item_gobj); + it_80273030(item_gobj); + HSD_JObjSetRotationY(jobj, PI_2 * item->facing_dir); + return false; +} + +void it_802B322C(Item_GObj* item_gobj, HSD_GObj* owner) +{ + Item* item = GET_ITEM(item_gobj); + StarAttrs* star = item->xC4_article_data->x4_specialAttributes; + item->owner = owner; + item->x40_vel.x = star->speed * item->facing_dir; + item->x40_vel.y = item->xCC_item_attr->x18; + it_8026B3A8(item_gobj); + Item_80268E5C(item_gobj, 0, ITEM_ANIM_UPDATE); +} + +bool it_802B3294(Item_GObj* item_gobj) +{ + if (!it_80272C6C(item_gobj)) { + return true; + } + return false; +} + +void it_802B32C8(Item_GObj* item_gobj) +{ + Item* item = GET_ITEM(item_gobj); + ItemAttr* attr = item->xCC_item_attr; + StarAttrs* star = item->xC4_article_data->x4_specialAttributes; + it_80272860(item_gobj, attr->x10_fall_speed, attr->x14_fall_speed_max); + item->x40_vel.x += star->accel * item->facing_dir; +} + +bool it_802B3324(Item_GObj* item_gobj) +{ + it_8026E0F4(item_gobj); + return false; +} + +void it_802B3348(Item_GObj* item_gobj, HSD_GObj* arg1) +{ + it_8026B894(item_gobj, arg1); +} diff --git a/src/melee/it/items/ityoshistar.h b/src/melee/it/items/ityoshistar.h new file mode 100644 index 0000000000..68506ee540 --- /dev/null +++ b/src/melee/it/items/ityoshistar.h @@ -0,0 +1,23 @@ +#ifndef MELEE_IT_ITYOSHISTAR_H +#define MELEE_IT_ITYOSHISTAR_H + +#include +#include +#include + +extern ItemStateTable it_803F7158[]; + +Item_GObj* it_802B2FC8(HSD_GObj* parent, Vec3* pos, f32 dir); +bool it_802B309C(Item_GObj*); +bool it_802B30C0(Item_GObj*); +bool it_802B30E4(Item_GObj*); +bool it_802B3108(Item_GObj*); +bool it_802B312C(Item_GObj*); +bool it_802B314C(Item_GObj*); +void it_802B322C(Item_GObj*, HSD_GObj*); +bool it_802B3294(Item_GObj*); +void it_802B32C8(Item_GObj*); +bool it_802B3324(Item_GObj*); +void it_802B3348(Item_GObj*, HSD_GObj*); + +#endif