Match 3 effects (#797)

* func_80240BD4_EA96B4: Initial c

* func_80240BD4_EA96B4: compiles

* func_80240BD4_EA96B4: Match

* func_8024199C_ECB69C: Initial c

* func_8024199C_ECB69C: Compiled c

* func_8024199C_ECB69C: Non matching

* func_80242260_EE8810: Initial c

* func_80242260_EE8810: Compiled c

* func_80242260_EE8810: Non matching

* smoke_burst_update: Initial c

* smoke_burst_update: Compiled c

* smoke_burst_update: updated SmokeBurstFXData

* smoke_burst_update: Matched

* removed asm match

* Fixed warnings

* PR_796: Comment clean up

* PR_796: Added new line after temp declaration

* hieroglyphs_update: Initial c

* hieroglyphs_update: Compiled c

* hieroglyphs_update: Matched

* huff_puff_breath_update: Initial c

* huff_puff_breath_update: Compiled c

* huff_puff_breath_update: Matched

* hieroglyphs_update: Updated effects.h

* hieroglyphs_update: Updated effects.h

* PR_796: Clean up 3

* PR_796: Updated commented struct sizes and updated bools

* PR_796: Updated bools in EA8AE0

* sweat_update: Initial c

* sweat_update: Complied c

* sweat_update: Matched

* sweat_update: Matched clean up

* huff_puff_breath_update: Updated effects struct size

* hieroglyphs_update: Update effects struct size offset

* hieroglyphs_update: Matched clean up

* huff_puff_breath_update: Matched clean up

* PR_797: Updated struct member names

Co-authored-by: Spencer Vaughn <spencer.vaughn@dws.la>
This commit is contained in:
Spencer Vaughn 2022-10-03 13:12:44 -05:00 committed by GitHub
parent c976e6e6fe
commit 794618569d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 104 additions and 222 deletions

View File

@ -615,8 +615,14 @@ typedef struct SmokeBurstFXData {
} SmokeBurstFXData; // size = 0x24
typedef struct SweatFXData {
/* 0x00 */ char todo[0];
} SweatFXData; // size = unknown
/* 0x00 */ char unk_00[0x4];
/* 0x04 */ Vec3f pos;
/* 0x10 */ char unk_10[0x08];
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ s32 timeLeft;
} SweatFXData; // size = 0x28
typedef struct SleepBubbleFXData {
/* 0x00 */ s32 unk_00;
@ -1518,15 +1524,22 @@ typedef struct ShinyFlareFXData {
} ShinyFlareFXData; // size = unknown
typedef struct HuffPuffBreathFXData {
/* 0x00 */ char unk_00[0x18];
/* 0x00 */ char unk_00[0x10];
/* 0x10 */ s32 timeLeft;
/* 0x14 */ s32 lifeTime;
/* 0x18 */ s32 unk_18;
/* 0x1C */ s32 unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ char unk_24[0x4];
/* 0x24 */ s32 unk_24;
/* 0x28 */ s32 unk_28;
/* 0x2C */ s32 unk_2C;
/* 0x30 */ s32 unk_30;
} HuffPuffBreathFXData; // size = ?
/* 0x34 */ char unk_34[0x04];
/* 0x38 */ f32 unk_38;
/* 0x3C */ f32 unk_3C;
/* 0x40 */ f32 unk_40;
/* 0x44 */ f32 unk_44;
} HuffPuffBreathFXData; // size = 0x48
typedef struct ColdBreathFXData {
/* 0x00 */ s32 unk_00;
@ -1580,8 +1593,12 @@ typedef struct EmbersFXData {
} EmbersFXData; // size = 0x70
typedef struct HieroglyphsFXData {
/* 0x00 */ char todo[0];
} HieroglyphsFXData; // size = unknown
/* 0x00 */ char unk_00[0x10];
/* 0x10 */ s32 timeLeft;
/* 0x14 */ s32 lifeTime;
/* 0x18 */ char unk_18[0x0C];
/* 0x24 */ s32 unk_24;
} HieroglyphsFXData; // size = 0x28
typedef struct MiscParticlesFXData {
char unk_00[0x4];

View File

@ -8,7 +8,30 @@ INCLUDE_ASM(s32, "effects/hieroglyphs", hieroglyphs_main);
void hieroglyphs_init(void) {
}
INCLUDE_ASM(s32, "effects/hieroglyphs", hieroglyphs_update);
void hieroglyphs_update(EffectInstance* effect) {
HieroglyphsFXData* data = effect->data.hieroglyphs;
s32 temp_a2;
if (effect->flags & 16) {
effect->flags &= ~16;
data->timeLeft = 16;
}
if (data->timeLeft < 1000) {
data->timeLeft--;
}
temp_a2 = ++data->lifeTime;
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
if (data->timeLeft < 16) {
data->unk_24 = data->timeLeft * 16;
}
if (temp_a2 < 16) {
data->unk_24 = (temp_a2 * 16) + 15;
}
}
void hieroglyphs_render(EffectInstance* effect) {
RenderTask renderTask;

View File

@ -8,7 +8,44 @@ INCLUDE_ASM(s32, "effects/huff_puff_breath", huff_puff_breath_main);
void huff_puff_breath_init(void) {
}
INCLUDE_ASM(s32, "effects/huff_puff_breath", huff_puff_breath_update);
void huff_puff_breath_update(EffectInstance* effect) {
HuffPuffBreathFXData* data = effect->data.huffPuffBreath;
s32 temp_a2;
if (effect->flags & 16) {
effect->flags &= ~16;
data->timeLeft = 16;
}
if (data->timeLeft < 1000) {
data->timeLeft--;
}
temp_a2 = ++data->lifeTime;
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
if (data->timeLeft < 16) {
data->unk_24 = data->timeLeft * 16;
}
if (temp_a2 < 16) {
data->unk_24 = (temp_a2 * 16) + 15;
}
data->unk_38 += data->unk_3C;
if (data->unk_38 >= 256.0f) {
data->unk_38 -= 256.0f;
}
if (data->unk_38 < 0.0f) {
data->unk_38 += 256.0f;
}
data->unk_40 += data->unk_44;
if (data->unk_40 >= 256.0f) {
data->unk_40 -= 256.0f;
}
if (data->unk_40 < 0.0f) {
data->unk_40 += 256.0f;
}
}
void huff_puff_breath_render(EffectInstance* effect) {
RenderTask renderTask;

View File

@ -8,7 +8,24 @@ INCLUDE_ASM(s32, "effects/sweat", sweat_main);
void sweat_init(void) {
}
INCLUDE_ASM(s32, "effects/sweat", sweat_update);
void sweat_update(EffectInstance *effect) {
SweatFXData* data = effect->data.sweat;
data->timeLeft--;
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
data->pos.x += data->unk_18;
data->pos.y += data->unk_1C;
data->pos.z += data->unk_20;
data->unk_1C -= 0.05;
data->unk_18 *= 0.94;
if (data->unk_1C < -0.1) {
data->unk_1C = -0.1f;
}
data->unk_20 *= 0.94;
}
void sweat_render(EffectInstance* effect) {
RenderTask renderTask;

View File

@ -1,46 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel hieroglyphs_update
/* 3DC444 E00E2134 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 3DC448 E00E2138 AFBF0010 */ sw $ra, 0x10($sp)
/* 3DC44C E00E213C 8C830000 */ lw $v1, ($a0)
/* 3DC450 E00E2140 8C85000C */ lw $a1, 0xc($a0)
/* 3DC454 E00E2144 30620010 */ andi $v0, $v1, 0x10
/* 3DC458 E00E2148 10400005 */ beqz $v0, .LE00E2160
/* 3DC45C E00E214C 2402FFEF */ addiu $v0, $zero, -0x11
/* 3DC460 E00E2150 00621024 */ and $v0, $v1, $v0
/* 3DC464 E00E2154 AC820000 */ sw $v0, ($a0)
/* 3DC468 E00E2158 24020010 */ addiu $v0, $zero, 0x10
/* 3DC46C E00E215C ACA20010 */ sw $v0, 0x10($a1)
.LE00E2160:
/* 3DC470 E00E2160 8CA30010 */ lw $v1, 0x10($a1)
/* 3DC474 E00E2164 286203E8 */ slti $v0, $v1, 0x3e8
/* 3DC478 E00E2168 10400002 */ beqz $v0, .LE00E2174
/* 3DC47C E00E216C 2462FFFF */ addiu $v0, $v1, -1
/* 3DC480 E00E2170 ACA20010 */ sw $v0, 0x10($a1)
.LE00E2174:
/* 3DC484 E00E2174 8CA20014 */ lw $v0, 0x14($a1)
/* 3DC488 E00E2178 8CA30010 */ lw $v1, 0x10($a1)
/* 3DC48C E00E217C 24460001 */ addiu $a2, $v0, 1
/* 3DC490 E00E2180 04610005 */ bgez $v1, .LE00E2198
/* 3DC494 E00E2184 ACA60014 */ sw $a2, 0x14($a1)
/* 3DC498 E00E2188 0C080128 */ jal shim_remove_effect
/* 3DC49C E00E218C 00000000 */ nop
/* 3DC4A0 E00E2190 0803886F */ j .LE00E21BC
/* 3DC4A4 E00E2194 00000000 */ nop
.LE00E2198:
/* 3DC4A8 E00E2198 28620010 */ slti $v0, $v1, 0x10
/* 3DC4AC E00E219C 10400002 */ beqz $v0, .LE00E21A8
/* 3DC4B0 E00E21A0 00031100 */ sll $v0, $v1, 4
/* 3DC4B4 E00E21A4 ACA20024 */ sw $v0, 0x24($a1)
.LE00E21A8:
/* 3DC4B8 E00E21A8 28C20010 */ slti $v0, $a2, 0x10
/* 3DC4BC E00E21AC 10400003 */ beqz $v0, .LE00E21BC
/* 3DC4C0 E00E21B0 00061100 */ sll $v0, $a2, 4
/* 3DC4C4 E00E21B4 2442000F */ addiu $v0, $v0, 0xf
/* 3DC4C8 E00E21B8 ACA20024 */ sw $v0, 0x24($a1)
.LE00E21BC:
/* 3DC4CC E00E21BC 8FBF0010 */ lw $ra, 0x10($sp)
/* 3DC4D0 E00E21C0 03E00008 */ jr $ra
/* 3DC4D4 E00E21C4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,87 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel huff_puff_breath_update
/* 3D7C08 E00DC198 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 3D7C0C E00DC19C AFBF0010 */ sw $ra, 0x10($sp)
/* 3D7C10 E00DC1A0 8C850000 */ lw $a1, ($a0)
/* 3D7C14 E00DC1A4 8C83000C */ lw $v1, 0xc($a0)
/* 3D7C18 E00DC1A8 30A20010 */ andi $v0, $a1, 0x10
/* 3D7C1C E00DC1AC 10400005 */ beqz $v0, .LE00DC1C4
/* 3D7C20 E00DC1B0 2402FFEF */ addiu $v0, $zero, -0x11
/* 3D7C24 E00DC1B4 00A21024 */ and $v0, $a1, $v0
/* 3D7C28 E00DC1B8 AC820000 */ sw $v0, ($a0)
/* 3D7C2C E00DC1BC 24020010 */ addiu $v0, $zero, 0x10
/* 3D7C30 E00DC1C0 AC620010 */ sw $v0, 0x10($v1)
.LE00DC1C4:
/* 3D7C34 E00DC1C4 8C650010 */ lw $a1, 0x10($v1)
/* 3D7C38 E00DC1C8 28A203E8 */ slti $v0, $a1, 0x3e8
/* 3D7C3C E00DC1CC 10400002 */ beqz $v0, .LE00DC1D8
/* 3D7C40 E00DC1D0 24A2FFFF */ addiu $v0, $a1, -1
/* 3D7C44 E00DC1D4 AC620010 */ sw $v0, 0x10($v1)
.LE00DC1D8:
/* 3D7C48 E00DC1D8 8C620014 */ lw $v0, 0x14($v1)
/* 3D7C4C E00DC1DC 8C650010 */ lw $a1, 0x10($v1)
/* 3D7C50 E00DC1E0 24460001 */ addiu $a2, $v0, 1
/* 3D7C54 E00DC1E4 04A10005 */ bgez $a1, .LE00DC1FC
/* 3D7C58 E00DC1E8 AC660014 */ sw $a2, 0x14($v1)
/* 3D7C5C E00DC1EC 0C080128 */ jal shim_remove_effect
/* 3D7C60 E00DC1F0 00000000 */ nop
/* 3D7C64 E00DC1F4 080370AD */ j .LE00DC2B4
/* 3D7C68 E00DC1F8 00000000 */ nop
.LE00DC1FC:
/* 3D7C6C E00DC1FC 28A20010 */ slti $v0, $a1, 0x10
/* 3D7C70 E00DC200 10400002 */ beqz $v0, .LE00DC20C
/* 3D7C74 E00DC204 00051100 */ sll $v0, $a1, 4
/* 3D7C78 E00DC208 AC620024 */ sw $v0, 0x24($v1)
.LE00DC20C:
/* 3D7C7C E00DC20C 28C20010 */ slti $v0, $a2, 0x10
/* 3D7C80 E00DC210 10400003 */ beqz $v0, .LE00DC220
/* 3D7C84 E00DC214 00061100 */ sll $v0, $a2, 4
/* 3D7C88 E00DC218 2442000F */ addiu $v0, $v0, 0xf
/* 3D7C8C E00DC21C AC620024 */ sw $v0, 0x24($v1)
.LE00DC220:
/* 3D7C90 E00DC220 C4620038 */ lwc1 $f2, 0x38($v1)
/* 3D7C94 E00DC224 C460003C */ lwc1 $f0, 0x3c($v1)
/* 3D7C98 E00DC228 46001000 */ add.s $f0, $f2, $f0
/* 3D7C9C E00DC22C 3C014380 */ lui $at, 0x4380
/* 3D7CA0 E00DC230 44812000 */ mtc1 $at, $f4
/* 3D7CA4 E00DC234 00000000 */ nop
/* 3D7CA8 E00DC238 4600203E */ c.le.s $f4, $f0
/* 3D7CAC E00DC23C 00000000 */ nop
/* 3D7CB0 E00DC240 45000003 */ bc1f .LE00DC250
/* 3D7CB4 E00DC244 E4600038 */ swc1 $f0, 0x38($v1)
/* 3D7CB8 E00DC248 46040001 */ sub.s $f0, $f0, $f4
/* 3D7CBC E00DC24C E4600038 */ swc1 $f0, 0x38($v1)
.LE00DC250:
/* 3D7CC0 E00DC250 C4600038 */ lwc1 $f0, 0x38($v1)
/* 3D7CC4 E00DC254 44803000 */ mtc1 $zero, $f6
/* 3D7CC8 E00DC258 00000000 */ nop
/* 3D7CCC E00DC25C 4606003C */ c.lt.s $f0, $f6
/* 3D7CD0 E00DC260 00000000 */ nop
/* 3D7CD4 E00DC264 45000003 */ bc1f .LE00DC274
/* 3D7CD8 E00DC268 00000000 */ nop
/* 3D7CDC E00DC26C 46040000 */ add.s $f0, $f0, $f4
/* 3D7CE0 E00DC270 E4600038 */ swc1 $f0, 0x38($v1)
.LE00DC274:
/* 3D7CE4 E00DC274 C4620040 */ lwc1 $f2, 0x40($v1)
/* 3D7CE8 E00DC278 C4600044 */ lwc1 $f0, 0x44($v1)
/* 3D7CEC E00DC27C 46001000 */ add.s $f0, $f2, $f0
/* 3D7CF0 E00DC280 4600203E */ c.le.s $f4, $f0
/* 3D7CF4 E00DC284 00000000 */ nop
/* 3D7CF8 E00DC288 45000003 */ bc1f .LE00DC298
/* 3D7CFC E00DC28C E4600040 */ swc1 $f0, 0x40($v1)
/* 3D7D00 E00DC290 46040001 */ sub.s $f0, $f0, $f4
/* 3D7D04 E00DC294 E4600040 */ swc1 $f0, 0x40($v1)
.LE00DC298:
/* 3D7D08 E00DC298 C4600040 */ lwc1 $f0, 0x40($v1)
/* 3D7D0C E00DC29C 4606003C */ c.lt.s $f0, $f6
/* 3D7D10 E00DC2A0 00000000 */ nop
/* 3D7D14 E00DC2A4 45000003 */ bc1f .LE00DC2B4
/* 3D7D18 E00DC2A8 00000000 */ nop
/* 3D7D1C E00DC2AC 46040000 */ add.s $f0, $f0, $f4
/* 3D7D20 E00DC2B0 E4600040 */ swc1 $f0, 0x40($v1)
.LE00DC2B4:
/* 3D7D24 E00DC2B4 8FBF0010 */ lw $ra, 0x10($sp)
/* 3D7D28 E00DC2B8 03E00008 */ jr $ra
/* 3D7D2C E00DC2BC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,79 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
dlabel D_E0050560
.double 0.94
dlabel D_E0050568
.double 0.05
dlabel D_E0050570
.double -0.1, 0.0
.section .text
glabel sweat_update
/* 35C1A8 E00501D8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 35C1AC E00501DC AFBF0010 */ sw $ra, 0x10($sp)
/* 35C1B0 E00501E0 8C83000C */ lw $v1, 0xc($a0)
/* 35C1B4 E00501E4 8C620024 */ lw $v0, 0x24($v1)
/* 35C1B8 E00501E8 2442FFFF */ addiu $v0, $v0, -1
/* 35C1BC E00501EC 04410005 */ bgez $v0, .LE0050204
/* 35C1C0 E00501F0 AC620024 */ sw $v0, 0x24($v1)
/* 35C1C4 E00501F4 0C080128 */ jal shim_remove_effect
/* 35C1C8 E00501F8 00000000 */ nop
/* 35C1CC E00501FC 080140AE */ j .LE00502B8
/* 35C1D0 E0050200 00000000 */ nop
.LE0050204:
/* 35C1D4 E0050204 C4620018 */ lwc1 $f2, 0x18($v1)
/* 35C1D8 E0050208 3C01E005 */ lui $at, %hi(D_E0050560)
/* 35C1DC E005020C D42A0560 */ ldc1 $f10, %lo(D_E0050560)($at)
/* 35C1E0 E0050210 460010A1 */ cvt.d.s $f2, $f2
/* 35C1E4 E0050214 462A1082 */ mul.d $f2, $f2, $f10
/* 35C1E8 E0050218 00000000 */ nop
/* 35C1EC E005021C C4640004 */ lwc1 $f4, 4($v1)
/* 35C1F0 E0050220 C4600018 */ lwc1 $f0, 0x18($v1)
/* 35C1F4 E0050224 C4680008 */ lwc1 $f8, 8($v1)
/* 35C1F8 E0050228 46002100 */ add.s $f4, $f4, $f0
/* 35C1FC E005022C C460001C */ lwc1 $f0, 0x1c($v1)
/* 35C200 E0050230 C466000C */ lwc1 $f6, 0xc($v1)
/* 35C204 E0050234 46004200 */ add.s $f8, $f8, $f0
/* 35C208 E0050238 C4600020 */ lwc1 $f0, 0x20($v1)
/* 35C20C E005023C 46003180 */ add.s $f6, $f6, $f0
/* 35C210 E0050240 C460001C */ lwc1 $f0, 0x1c($v1)
/* 35C214 E0050244 E4640004 */ swc1 $f4, 4($v1)
/* 35C218 E0050248 3C01E005 */ lui $at, %hi(D_E0050568)
/* 35C21C E005024C D4240568 */ ldc1 $f4, %lo(D_E0050568)($at)
/* 35C220 E0050250 46000021 */ cvt.d.s $f0, $f0
/* 35C224 E0050254 46240001 */ sub.d $f0, $f0, $f4
/* 35C228 E0050258 E4680008 */ swc1 $f8, 8($v1)
/* 35C22C E005025C E466000C */ swc1 $f6, 0xc($v1)
/* 35C230 E0050260 46200020 */ cvt.s.d $f0, $f0
/* 35C234 E0050264 E460001C */ swc1 $f0, 0x1c($v1)
/* 35C238 E0050268 462010A0 */ cvt.s.d $f2, $f2
/* 35C23C E005026C E4620018 */ swc1 $f2, 0x18($v1)
/* 35C240 E0050270 3C01E005 */ lui $at, %hi(D_E0050570)
/* 35C244 E0050274 D4220570 */ ldc1 $f2, %lo(D_E0050570)($at)
/* 35C248 E0050278 46000021 */ cvt.d.s $f0, $f0
/* 35C24C E005027C 4622003C */ c.lt.d $f0, $f2
/* 35C250 E0050280 00000000 */ nop
/* 35C254 E0050284 45000006 */ bc1f .LE00502A0
/* 35C258 E0050288 00000000 */ nop
/* 35C25C E005028C 3C01BDCC */ lui $at, 0xbdcc
/* 35C260 E0050290 3421CCCD */ ori $at, $at, 0xcccd
/* 35C264 E0050294 44810000 */ mtc1 $at, $f0
/* 35C268 E0050298 00000000 */ nop
/* 35C26C E005029C E460001C */ swc1 $f0, 0x1c($v1)
.LE00502A0:
/* 35C270 E00502A0 C4600020 */ lwc1 $f0, 0x20($v1)
/* 35C274 E00502A4 46000021 */ cvt.d.s $f0, $f0
/* 35C278 E00502A8 462A0002 */ mul.d $f0, $f0, $f10
/* 35C27C E00502AC 00000000 */ nop
/* 35C280 E00502B0 46200020 */ cvt.s.d $f0, $f0
/* 35C284 E00502B4 E4600020 */ swc1 $f0, 0x20($v1)
.LE00502B8:
/* 35C288 E00502B8 8FBF0010 */ lw $ra, 0x10($sp)
/* 35C28C E00502BC 03E00008 */ jr $ra
/* 35C290 E00502C0 27BD0018 */ addiu $sp, $sp, 0x18