diff --git a/include/effects.h b/include/effects.h index 8cb47a880b..d55e175d39 100644 --- a/include/effects.h +++ b/include/effects.h @@ -607,8 +607,12 @@ typedef struct MusicNoteFXData { } MusicNoteFXData; // size = 0x34 typedef struct SmokeBurstFXData { - /* 0x00 */ char todo[0]; -} SmokeBurstFXData; // size = unknown + /* 0x00 */ char unk_00[0x14]; + /* 0x14 */ s32 unk_14; + /* 0x18 */ s32 unk_18; + /* 0x1C */ s32 unk_1C; + /* 0x20 */ f32 unk_20; +} SmokeBurstFXData; // size = 0x24 typedef struct SweatFXData { /* 0x00 */ char todo[0]; diff --git a/src/EA8AE0.c b/src/EA8AE0.c index d25ed2b7e9..3e57d8509c 100644 --- a/src/EA8AE0.c +++ b/src/EA8AE0.c @@ -24,7 +24,28 @@ static char* N(exit_str_2) = "kzn_20"; INCLUDE_ASM(s32, "EA8AE0", func_80240B00_EA95E0); -INCLUDE_ASM(s32, "EA8AE0", func_80240BD4_EA96B4); +typedef struct Unk80240BD4 { + /* 0x00 */ f32 unk_00; + /* 0x04 */ f32 unk_04; + /* 0x08 */ f32 unk_08; +} Unk80240BD4; + +ApiStatus func_80240BD4_EA96B4(Evt *script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32 temp_s3 = dead_evt_get_variable(script, *args++); + s32 temp_s2 = dead_evt_get_variable(script, *args++); + s32 temp_s4 = dead_evt_get_variable(script, *args++); + s32 temp_s1 = dead_evt_get_variable(script, *args++); + s32 temp_s0 = dead_evt_get_variable(script, *args++); + Unk80240BD4* temp_a0 = dead_evt_get_variable(NULL, MapVar(0)) + (temp_s3 * 480) + (temp_s2 * 12); + + temp_a0->unk_00 = temp_s4; + temp_a0->unk_04 = temp_s1; + temp_a0->unk_08 = temp_s0; + + return ApiStatus_DONE2; +} + INCLUDE_ASM(s32, "EA8AE0", func_80240CD8_EA97B8); @@ -70,10 +91,10 @@ ApiStatus func_802417AC_EAA28C(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; if (isInitialCall) { - D_80243DD8_EAC8B8 = 0; + D_80243DD8_EAC8B8 = FALSE; } - if (D_80243DD8_EAC8B8 != 0) { - D_80243DD8_EAC8B8 = 0; + if (D_80243DD8_EAC8B8) { + D_80243DD8_EAC8B8 = FALSE; dead_evt_set_variable(script, *args++, D_80243DDC_EAC8BC); diff --git a/src/ECAA80.c b/src/ECAA80.c index 9ab20f0ee0..d02951e599 100644 --- a/src/ECAA80.c +++ b/src/ECAA80.c @@ -23,15 +23,32 @@ void ECAA80_UnkFloAI_Chase(Evt* script, MobileAISettings* aiSettings, EnemyDetec #include "world/common/AddPlayerHandsOffset.inc.c" -// ECAA80_ItemChoice_WaitForSelection (needs data?) +// Needs data migrated +#ifdef NON_MATCHING +ApiStatus ECAA80_ItemChoice_WaitForSelection(Evt *script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + ECAA80_ItemChoice_HasSelectedItem = FALSE; + } + if (ECAA80_ItemChoice_HasSelectedItem) { + ECAA80_ItemChoice_HasSelectedItem = FALSE; + dead_evt_set_variable(script, *args++, ECAA80_ItemChoice_SelectedItemID); + return ApiStatus_DONE2; + } + return ApiStatus_BLOCK; +} +#else INCLUDE_ASM(s32, "ECAA80", func_8024199C_ECB69C); +#endif // ECAA80_ItemChoice_SaveSelected (needs data?) ApiStatus ECAA80_ItemChoice_SaveSelected(Evt *script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; + ECAA80_ItemChoice_SelectedItemID = dead_evt_get_variable(script, *args++); - ECAA80_ItemChoice_HasSelectedItem = 1; + ECAA80_ItemChoice_HasSelectedItem = TRUE; return ApiStatus_DONE2; } diff --git a/src/EE70C0.c b/src/EE70C0.c index e43ab8118c..2f0bad73f2 100644 --- a/src/EE70C0.c +++ b/src/EE70C0.c @@ -16,18 +16,36 @@ extern s32 D_80244630_EEABE0; #include "world/common/AddPlayerHandsOffset.inc.c" +// Needs data migrated +#ifdef NON_MATCHING +ApiStatus EE70C0_ItemChoice_WaitForSelection(Evt *script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + if (isInitialCall) { + D_8024462C_EEABDC = FALSE; + } + if (D_8024462C_EEABDC) { + D_8024462C_EEABDC = FALSE; + dead_evt_set_variable(script, *args++, D_80244630_EEABE0); + return ApiStatus_DONE2; + } + return ApiStatus_BLOCK; +} +#else INCLUDE_ASM(s32, "EE70C0", func_80242260_EE8810); +#endif ApiStatus EE70C0_ItemChoice_SaveSelected(Evt *script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; + D_80244630_EEABE0 = dead_evt_get_variable(script, *args++); - D_8024462C_EEABDC = 1; + D_8024462C_EEABDC = TRUE; return ApiStatus_DONE2; } ApiStatus func_802422EC_EE889C(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; - s32* ptr = evt_get_variable(script, *args); + s32* ptr = (s32*) evt_get_variable(script, *args); s32 i; if (ptr != NULL) { diff --git a/src/effects/smoke_burst.c b/src/effects/smoke_burst.c index 2e731cbf92..fbdcf097c1 100644 --- a/src/effects/smoke_burst.c +++ b/src/effects/smoke_burst.c @@ -8,7 +8,17 @@ INCLUDE_ASM(s32, "effects/smoke_burst", smoke_burst_main); void smoke_burst_init(void) { } -INCLUDE_ASM(s32, "effects/smoke_burst", smoke_burst_update); +void smoke_burst_update(EffectInstance *effect) { + SmokeBurstFXData* data = effect->data.smokeBurst; + + data->unk_20 = (data->unk_18 * 8.0f) / data->unk_1C; + data->unk_18++; + data->unk_14--; + + if (data->unk_14 < 0) { + shim_remove_effect(effect); + } +} void smoke_burst_render(EffectInstance* effect) { RenderTask renderTask; diff --git a/ver/us/asm/nonmatchings/EA8AE0/func_80240BD4_EA96B4.s b/ver/us/asm/nonmatchings/EA8AE0/func_80240BD4_EA96B4.s deleted file mode 100644 index 1b49318aca..0000000000 --- a/ver/us/asm/nonmatchings/EA8AE0/func_80240BD4_EA96B4.s +++ /dev/null @@ -1,69 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80240BD4_EA96B4 -/* EA96B4 80240BD4 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* EA96B8 80240BD8 AFB10014 */ sw $s1, 0x14($sp) -/* EA96BC 80240BDC 0080882D */ daddu $s1, $a0, $zero -/* EA96C0 80240BE0 AFBF0024 */ sw $ra, 0x24($sp) -/* EA96C4 80240BE4 AFB40020 */ sw $s4, 0x20($sp) -/* EA96C8 80240BE8 AFB3001C */ sw $s3, 0x1c($sp) -/* EA96CC 80240BEC AFB20018 */ sw $s2, 0x18($sp) -/* EA96D0 80240BF0 AFB00010 */ sw $s0, 0x10($sp) -/* EA96D4 80240BF4 8E30000C */ lw $s0, 0xc($s1) -/* EA96D8 80240BF8 8E050000 */ lw $a1, ($s0) -/* EA96DC 80240BFC 0C0B53A3 */ jal dead_evt_get_variable -/* EA96E0 80240C00 26100004 */ addiu $s0, $s0, 4 -/* EA96E4 80240C04 8E050000 */ lw $a1, ($s0) -/* EA96E8 80240C08 26100004 */ addiu $s0, $s0, 4 -/* EA96EC 80240C0C 0220202D */ daddu $a0, $s1, $zero -/* EA96F0 80240C10 0C0B53A3 */ jal dead_evt_get_variable -/* EA96F4 80240C14 0040982D */ daddu $s3, $v0, $zero -/* EA96F8 80240C18 8E050000 */ lw $a1, ($s0) -/* EA96FC 80240C1C 26100004 */ addiu $s0, $s0, 4 -/* EA9700 80240C20 0220202D */ daddu $a0, $s1, $zero -/* EA9704 80240C24 0C0B53A3 */ jal dead_evt_get_variable -/* EA9708 80240C28 0040902D */ daddu $s2, $v0, $zero -/* EA970C 80240C2C 8E050000 */ lw $a1, ($s0) -/* EA9710 80240C30 26100004 */ addiu $s0, $s0, 4 -/* EA9714 80240C34 0220202D */ daddu $a0, $s1, $zero -/* EA9718 80240C38 0C0B53A3 */ jal dead_evt_get_variable -/* EA971C 80240C3C 0040A02D */ daddu $s4, $v0, $zero -/* EA9720 80240C40 0220202D */ daddu $a0, $s1, $zero -/* EA9724 80240C44 8E050000 */ lw $a1, ($s0) -/* EA9728 80240C48 0C0B53A3 */ jal dead_evt_get_variable -/* EA972C 80240C4C 0040882D */ daddu $s1, $v0, $zero -/* EA9730 80240C50 0000202D */ daddu $a0, $zero, $zero -/* EA9734 80240C54 3C05FD05 */ lui $a1, 0xfd05 -/* EA9738 80240C58 34A50F80 */ ori $a1, $a1, 0xf80 -/* EA973C 80240C5C 0C0B53A3 */ jal dead_evt_get_variable -/* EA9740 80240C60 0040802D */ daddu $s0, $v0, $zero -/* EA9744 80240C64 00131900 */ sll $v1, $s3, 4 -/* EA9748 80240C68 00731823 */ subu $v1, $v1, $s3 -/* EA974C 80240C6C 00031940 */ sll $v1, $v1, 5 -/* EA9750 80240C70 00432021 */ addu $a0, $v0, $v1 -/* EA9754 80240C74 24020002 */ addiu $v0, $zero, 2 -/* EA9758 80240C78 00121840 */ sll $v1, $s2, 1 -/* EA975C 80240C7C 00721821 */ addu $v1, $v1, $s2 -/* EA9760 80240C80 00431804 */ sllv $v1, $v1, $v0 -/* EA9764 80240C84 00832021 */ addu $a0, $a0, $v1 -/* EA9768 80240C88 44940000 */ mtc1 $s4, $f0 -/* EA976C 80240C8C 00000000 */ nop -/* EA9770 80240C90 46800020 */ cvt.s.w $f0, $f0 -/* EA9774 80240C94 E4800000 */ swc1 $f0, ($a0) -/* EA9778 80240C98 44910000 */ mtc1 $s1, $f0 -/* EA977C 80240C9C 00000000 */ nop -/* EA9780 80240CA0 46800020 */ cvt.s.w $f0, $f0 -/* EA9784 80240CA4 E4800004 */ swc1 $f0, 4($a0) -/* EA9788 80240CA8 44900000 */ mtc1 $s0, $f0 -/* EA978C 80240CAC 00000000 */ nop -/* EA9790 80240CB0 46800020 */ cvt.s.w $f0, $f0 -/* EA9794 80240CB4 E4800008 */ swc1 $f0, 8($a0) -/* EA9798 80240CB8 8FBF0024 */ lw $ra, 0x24($sp) -/* EA979C 80240CBC 8FB40020 */ lw $s4, 0x20($sp) -/* EA97A0 80240CC0 8FB3001C */ lw $s3, 0x1c($sp) -/* EA97A4 80240CC4 8FB20018 */ lw $s2, 0x18($sp) -/* EA97A8 80240CC8 8FB10014 */ lw $s1, 0x14($sp) -/* EA97AC 80240CCC 8FB00010 */ lw $s0, 0x10($sp) -/* EA97B0 80240CD0 03E00008 */ jr $ra -/* EA97B4 80240CD4 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/effects/smoke_burst/smoke_burst_update.s b/ver/us/asm/nonmatchings/effects/smoke_burst/smoke_burst_update.s deleted file mode 100644 index d224f84536..0000000000 --- a/ver/us/asm/nonmatchings/effects/smoke_burst/smoke_burst_update.s +++ /dev/null @@ -1,32 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel smoke_burst_update -/* 35BB34 E004E164 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 35BB38 E004E168 0080282D */ daddu $a1, $a0, $zero -/* 35BB3C E004E16C AFBF0010 */ sw $ra, 0x10($sp) -/* 35BB40 E004E170 8CA2000C */ lw $v0, 0xc($a1) -/* 35BB44 E004E174 3C014100 */ lui $at, 0x4100 -/* 35BB48 E004E178 44810000 */ mtc1 $at, $f0 -/* 35BB4C E004E17C 8C430018 */ lw $v1, 0x18($v0) -/* 35BB50 E004E180 8C440014 */ lw $a0, 0x14($v0) -/* 35BB54 E004E184 44831000 */ mtc1 $v1, $f2 -/* 35BB58 E004E188 00000000 */ nop -/* 35BB5C E004E18C 468010A0 */ cvt.s.w $f2, $f2 -/* 35BB60 E004E190 24630001 */ addiu $v1, $v1, 1 -/* 35BB64 E004E194 46001082 */ mul.s $f2, $f2, $f0 -/* 35BB68 E004E198 00000000 */ nop -/* 35BB6C E004E19C 2484FFFF */ addiu $a0, $a0, -1 -/* 35BB70 E004E1A0 C440001C */ lwc1 $f0, 0x1c($v0) -/* 35BB74 E004E1A4 46800020 */ cvt.s.w $f0, $f0 -/* 35BB78 E004E1A8 AC430018 */ sw $v1, 0x18($v0) -/* 35BB7C E004E1AC AC440014 */ sw $a0, 0x14($v0) -/* 35BB80 E004E1B0 46001083 */ div.s $f2, $f2, $f0 -/* 35BB84 E004E1B4 04810003 */ bgez $a0, .LE004E1C4 -/* 35BB88 E004E1B8 E4420020 */ swc1 $f2, 0x20($v0) -/* 35BB8C E004E1BC 0C080128 */ jal shim_remove_effect -/* 35BB90 E004E1C0 00A0202D */ daddu $a0, $a1, $zero -.LE004E1C4: -/* 35BB94 E004E1C4 8FBF0010 */ lw $ra, 0x10($sp) -/* 35BB98 E004E1C8 03E00008 */ jr $ra -/* 35BB9C E004E1CC 27BD0018 */ addiu $sp, $sp, 0x18