diff --git a/include/effects.h b/include/effects.h index 88f00e9989..804f520812 100644 --- a/include/effects.h +++ b/include/effects.h @@ -647,6 +647,19 @@ typedef struct FireBreathFXData { /* 0x78 */ s32 envB; } FireBreathFXData; // size = 0x7C +typedef struct DamageIndicatorFXData { + /* 0x00 */ s32 unk_00; + /* 0x04 */ Vec3f unk_04; + /* 0x10 */ Vec3f unk_10; + /* 0x1C */ Vec3f unk_1C; + /* 0x28 */ f32 unk_28; + /* 0x2C */ s32 alpha; + /* 0x30 */ s32 effectDurationTimer; + /* 0x34 */ s32 unk_34; + /* 0x38 */ f32 unk_38; + /* 0x3C */ s32 numParts; +} DamageIndicatorFXData; // size = 0x40 + // TODO figure out what this actually is // fx_quizmo_stage invokes gEffectTable[78]'s entryPoint function // fx_cold_breath invokes gEffectTable[111]'s entryPoint function diff --git a/include/effects_internal.h b/include/effects_internal.h index 668052bcbc..be34447f88 100644 --- a/include/effects_internal.h +++ b/include/effects_internal.h @@ -59,7 +59,7 @@ FX_MAIN(lens_flare_main); FX_MAIN(got_item_outline_main); FX_MAIN(spiky_white_aura_main); FX_MAIN(smoke_impact_main); -FX_MAIN(damage_indicator_main); +void damage_indicator_main(s32, f32, f32, f32, f32, f32, s32, EffectInstance**); FX_MAIN(purple_ring_main); FX_MAIN(flame_main); FX_MAIN(stars_burst_main); diff --git a/src/effects/damage_indicator.c b/src/effects/damage_indicator.c index dec547a395..d79da5c487 100644 --- a/src/effects/damage_indicator.c +++ b/src/effects/damage_indicator.c @@ -1,16 +1,278 @@ #include "common.h" #include "effects_internal.h" -INCLUDE_ASM(s32, "effects/damage_indicator", damage_indicator_main); +extern Gfx D_09001D40[]; +extern Gfx D_09001DE0[]; +extern Gfx D_09001E50[]; +extern Gfx D_09001E90[]; +extern Gfx D_09001ED0[]; +extern Gfx D_09001F10[]; +extern Gfx D_09001F50[]; +extern Gfx D_09001F90[]; +extern Gfx D_09001FD0[]; +extern Gfx D_09002010[]; +extern Gfx D_09002050[]; +extern Gfx D_09002090[]; +extern Gfx D_090020D0[]; +extern Gfx D_09002110[]; +extern Gfx D_09002150[]; +extern Gfx D_09002160[]; +extern Gfx D_09002170[]; +extern Gfx D_09002180[]; +extern Gfx D_090021A8[]; +extern Gfx D_09002190[]; +extern Gfx D_090021C0[]; +extern Gfx D_090021E0[]; +extern Gfx D_09002200[]; -void damage_indicator_init(void) { +Gfx* D_E003CCA0[] = { + D_09001E50, D_09001E90, D_09001ED0, D_09001F10, + D_09001F50, D_09001F90, D_09001FD0, D_09002010, + D_09002050, D_09002090, D_090020D0, D_09002110 +}; + +u8 D_E003CCD0[] = { + 0x32, 0x37, 0x3C, 0x46, 0x50, 0x64, 0x96, 0xDC, + 0xF0, 0xC8, 0x8C, 0x64, 0x8C, 0xA0, 0x8C, 0x96, + 0x9B, 0x96, 0x94, 0x96, 0x96, 0x96, 0x96, 0x96, + 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x9B, 0xA0, + 0x9B, 0x91, 0x82, 0x6E, 0x55, 0x37, 0x19, 0x00 +}; + +Color_RGB8 D_E003CCF8[] = { + { 254, 172, 172 }, + { 254, 172, 213 }, + { 254, 180, 154 }, + { 213, 180, 254 }, + { 180, 180, 254 }, + { 180, 221, 254 }, + { 180, 254, 254 }, + { 180, 254, 213 }, + { 180, 254, 180 }, + { 213, 254, 180 }, + { 254, 254, 180 }, + { 254, 213, 172 } +}; + +f32 D_E003CD1C[] = { + 0.0f, + 0.1f, + 0.2f, + 0.3f, + 0.4f, + 0.5f, + 0.6f, + 0.7f, + 0.8f +}; + +void damage_indicator_init(EffectInstance* effect); +void damage_indicator_update(EffectInstance* effect); +void damage_indicator_render(EffectInstance* effect); +void func_E003C47C(EffectInstance* effect); +void func_E003C498(EffectInstance* effect); + +void damage_indicator_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, s32 numParts, EffectInstance** effectOut) { + EffectBlueprint bp; + EffectBlueprint* bpPtr = &bp; + EffectInstance* effect; + f32 temp_f20; + DamageIndicatorFXData* part; + s32 origNumParts = numParts; + s32 i; + + if (numParts > 20) { + numParts = 20; + } + numParts++; + + bp.init = damage_indicator_init; + bp.update = damage_indicator_update; + bp.renderWorld = damage_indicator_render; + bp.unk_14 = func_E003C47C; + bp.unk_00 = 0; + bp.effectID = EFFECT_DAMAGE_INDICATOR; + + effect = shim_create_effect_instance(bpPtr); + effect->numParts = numParts; + + effect->data = part = shim_general_heap_malloc(numParts * sizeof(*part)); + ASSERT(effect->data != NULL); + + part->unk_00 = arg0; + part->unk_04.x = arg1; + part->unk_04.y = arg2; + part->unk_04.z = arg3; + part->unk_28 = arg4; + part->effectDurationTimer = 100; + part->unk_34 = 0; + part->numParts = origNumParts; + + part++; + for(i = 1; i < numParts; i++, part++) { + part->unk_04.x = 0.0f; + part->unk_04.y = 0.0f; + part->unk_04.z = 0.0f; + part->unk_10.x = part->unk_04.x; + part->unk_10.y = part->unk_04.y; + part->unk_10.z = part->unk_04.z; + temp_f20 = arg5 + (((s32) ((((i % 2) * 2) - 1) * i) / 2) * (30.0f - numParts)); + part->unk_38 = 0.2f; + part->unk_1C.x = -shim_sin_deg(temp_f20) * arg4 * 1.5; + part->unk_1C.y = shim_cos_deg(temp_f20) * arg4 * 1.5; + part->unk_1C.z = 0; + part->alpha = 255; + } + *effectOut = effect; } -INCLUDE_ASM(s32, "effects/damage_indicator", damage_indicator_update); - -void damage_indicator_render(void) { +void damage_indicator_init(EffectInstance* effect) { } -INCLUDE_ASM(s32, "effects/damage_indicator", func_E003C47C); +void damage_indicator_update(EffectInstance* effect) { + s32 temp_a2; + s32 temp_t0; + s32 duration; + DamageIndicatorFXData* part = effect->data; + f32 phi_f12; + s32 i; + /* decrement duration timer */ + if (part->effectDurationTimer < 100) { + part->effectDurationTimer--; + } + + temp_a2 = part->unk_34++; + temp_t0 = part->unk_34; + duration = part->effectDurationTimer; + + /* if duration is less than 0, remove effect*/ + if (duration < 0) { + shim_remove_effect(effect); + return; + } + + part++; + for(i = 1; i < effect->numParts; i++, part++) { + f32 x, y, z; + + if (duration > 5) { + part->unk_1C.x = part->unk_1C.x * 0.75; + part->unk_1C.y = part->unk_1C.y * 0.75; + part->unk_1C.z = part->unk_1C.z * 0.75; + } + if (duration < 5) { + part->alpha = part->alpha * 0.6; + part->unk_1C.x = part->unk_1C.x * 0.7; + part->unk_1C.y = part->unk_1C.y * 0.7; + part->unk_1C.z = part->unk_1C.z * 0.7; + } + phi_f12 = 1.0f; + if (temp_a2 < 9) { + phi_f12 = D_E003CD1C[temp_a2]; + } + part->unk_10.x = part->unk_04.x * phi_f12; + part->unk_10.y = part->unk_04.y * phi_f12; + part->unk_10.z = part->unk_04.z * phi_f12; + part->unk_04.x += part->unk_1C.x; + part->unk_04.y += part->unk_1C.y; + part->unk_04.z += part->unk_1C.z; + + part->unk_38 = (temp_t0 <= 40) ? (f32)D_E003CCD0[temp_a2] * 0.01 : 0.0f; + } +} + +void damage_indicator_render(EffectInstance* effect) { +} + +void func_E003C47C(EffectInstance* effect) { + func_E003C498(effect); +} + +#ifdef NON_MATCHING +void func_E003C498(EffectInstance* effect) { + Matrix4f sp20; + Matrix4f sp60; + DamageIndicatorFXData* part = effect->data; + s32 i; + s32 numParts; + s32 spA0; + s32 spA4; + s32 spA8; + + spA8 = part->numParts; + gDPPipeSync(gMasterGfxPos++); + gSPSegment(gMasterGfxPos++, 0x09, OS_PHYSICAL_TO_K0(effect->graphics->data)); + shim_guTranslateF(sp20, part->unk_04.x, part->unk_04.y, part->unk_04.z); + shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + shim_guMtxCatF(sp60, sp20, sp20); + shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); + + numParts = effect->numParts; + spA0 = part->unk_34 - 1; + spA4 = numParts - 1; + part = &((DamageIndicatorFXData*)effect->data)[numParts - 1]; + + if (part->alpha == 255) { + gDPSetRenderMode(gMasterGfxPos++, G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2); + gDPSetCombineLERP(gMasterGfxPos++, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0); + } else { + gDPSetRenderMode(gMasterGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); + gDPSetCombineLERP(gMasterGfxPos++, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0); + } + for(i = 1; i < effect->numParts; i++, part--) { + s32 index = (i + spA0); + gDPSetPrimColor(gMasterGfxPos++, 0, 0, D_E003CCF8[index % 12].r, D_E003CCF8[index % 12].g, D_E003CCF8[index % 12].b, part->alpha); + gSPDisplayList(gMasterGfxPos++, D_09001D40); + if (i == spA4) { + shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, part->unk_38, part->unk_10.x, part->unk_10.y, part->unk_10.z); + shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPDisplayList(gMasterGfxPos++, D_09002150); + gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); + shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, part->unk_38, (part->unk_10.x + part->unk_04.x) * 0.5, (part->unk_10.y + part->unk_04.y) * 0.5, (part->unk_10.z + part->unk_04.z) * 0.5); + shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); + gSPDisplayList(gMasterGfxPos++, D_09002160); + gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); + } + gSPDisplayList(gMasterGfxPos++, D_09001D40); + shim_guTranslateF(sp20, part->unk_04.x, part->unk_04.y, part->unk_04.z); + shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); + shim_guScaleF(sp20, part->unk_38, part->unk_38, 1.0f); + shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); + + if (i == spA4) { + gSPDisplayList(gMasterGfxPos++, &D_09002170); + } else { + gSPDisplayList(gMasterGfxPos++, &D_09002180); + } + if (i == spA4) { + gSPDisplayList(gMasterGfxPos++, D_090021A8); + gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); + gSPDisplayList(gMasterGfxPos++, D_09001DE0); + if (spA8 < 10) { + gSPDisplayList(gMasterGfxPos++, D_E003CCA0[i]); + gSPDisplayList(gMasterGfxPos++, D_090021C0); + } else { + s32 temp = spA8 % 10; + s32 temp2 = spA8 / 10; + gSPDisplayList(gMasterGfxPos++, D_E003CCA0[temp]); + gSPDisplayList(gMasterGfxPos++, D_09002200); + gSPDisplayList(gMasterGfxPos++, D_E003CCA0[temp2]); + gSPDisplayList(gMasterGfxPos++, D_090021E0); + } + } else { + gSPDisplayList(gMasterGfxPos++, D_09002190); + gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); + } + gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); + } + gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); +} +#else INCLUDE_ASM(s32, "effects/damage_indicator", func_E003C498); +#endif diff --git a/ver/us/asm/data/effects/350160.data.s b/ver/us/asm/data/effects/350160.data.s deleted file mode 100644 index 3410ae77f9..0000000000 --- a/ver/us/asm/data/effects/350160.data.s +++ /dev/null @@ -1,24 +0,0 @@ -.include "macro.inc" - -.section .data - -dlabel D_E003CCA0 -.word 0x09001E50, 0x09001E90, 0x09001ED0, 0x09001F10, 0x09001F50, 0x09001F90, 0x09001FD0, 0x09002010, 0x09002050, 0x09002090, 0x090020D0, 0x09002110 - -dlabel D_E003CCD0 -.word 0x32373C46, 0x506496DC, 0xF0C88C64, 0x8CA08C96, 0x9B969496, 0x96969696, 0x96969696, 0x96969BA0, 0x9B91826E, 0x55371900 - -dlabel D_E003CCF8 -.word 0xFEACACFE, 0xACD5FEB4, 0x9AD5B4FE, 0xB4B4FEB4, 0xDDFEB4FE, 0xFEB4FED5, 0xB4FEB4D5, 0xFEB4FEFE, 0xB4FED5AC - -dlabel D_E003CD1C -.word 0x00000000, 0x3DCCCCCD, 0x3E4CCCCD, 0x3E99999A, 0x3ECCCCCD, 0x3F000000, 0x3F19999A, 0x3F333333, 0x3F4CCCCD - -dlabel D_E003CD40 -.double 0.6 - -dlabel D_E003CD48 -.double 0.7 - -dlabel D_E003CD50 -.double 0.01, 0.0 diff --git a/ver/us/asm/nonmatchings/effects/damage_indicator/damage_indicator_main.s b/ver/us/asm/nonmatchings/effects/damage_indicator/damage_indicator_main.s deleted file mode 100644 index 07ad1b69fb..0000000000 --- a/ver/us/asm/nonmatchings/effects/damage_indicator/damage_indicator_main.s +++ /dev/null @@ -1,152 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel damage_indicator_main -/* 34F4C0 E003C000 27BDFF98 */ addiu $sp, $sp, -0x68 -/* 34F4C4 E003C004 F7B40040 */ sdc1 $f20, 0x40($sp) -/* 34F4C8 E003C008 4485A000 */ mtc1 $a1, $f20 -/* 34F4CC E003C00C F7B60048 */ sdc1 $f22, 0x48($sp) -/* 34F4D0 E003C010 4486B000 */ mtc1 $a2, $f22 -/* 34F4D4 E003C014 F7BA0058 */ sdc1 $f26, 0x58($sp) -/* 34F4D8 E003C018 4487D000 */ mtc1 $a3, $f26 -/* 34F4DC E003C01C AFB20030 */ sw $s2, 0x30($sp) -/* 34F4E0 E003C020 8FB20080 */ lw $s2, 0x80($sp) -/* 34F4E4 E003C024 F7B80050 */ sdc1 $f24, 0x50($sp) -/* 34F4E8 E003C028 C7B80078 */ lwc1 $f24, 0x78($sp) -/* 34F4EC E003C02C AFB1002C */ sw $s1, 0x2c($sp) -/* 34F4F0 E003C030 0080882D */ daddu $s1, $a0, $zero -/* 34F4F4 E003C034 F7BC0060 */ sdc1 $f28, 0x60($sp) -/* 34F4F8 E003C038 C7BC007C */ lwc1 $f28, 0x7c($sp) -/* 34F4FC E003C03C 27A40010 */ addiu $a0, $sp, 0x10 -/* 34F500 E003C040 AFBF0038 */ sw $ra, 0x38($sp) -/* 34F504 E003C044 AFB30034 */ sw $s3, 0x34($sp) -/* 34F508 E003C048 AFB00028 */ sw $s0, 0x28($sp) -/* 34F50C E003C04C 2A420015 */ slti $v0, $s2, 0x15 -/* 34F510 E003C050 14400002 */ bnez $v0, .LE003C05C -/* 34F514 E003C054 0240802D */ daddu $s0, $s2, $zero -/* 34F518 E003C058 24120014 */ addiu $s2, $zero, 0x14 -.LE003C05C: -/* 34F51C E003C05C 26520001 */ addiu $s2, $s2, 1 -/* 34F520 E003C060 3C02E004 */ lui $v0, %hi(damage_indicator_init) -/* 34F524 E003C064 2442C23C */ addiu $v0, $v0, %lo(damage_indicator_init) -/* 34F528 E003C068 AFA20018 */ sw $v0, 0x18($sp) -/* 34F52C E003C06C 3C02E004 */ lui $v0, %hi(damage_indicator_update) -/* 34F530 E003C070 2442C244 */ addiu $v0, $v0, %lo(damage_indicator_update) -/* 34F534 E003C074 AFA2001C */ sw $v0, 0x1c($sp) -/* 34F538 E003C078 3C02E004 */ lui $v0, %hi(damage_indicator_render) -/* 34F53C E003C07C 2442C474 */ addiu $v0, $v0, %lo(damage_indicator_render) -/* 34F540 E003C080 AFA20020 */ sw $v0, 0x20($sp) -/* 34F544 E003C084 3C02E004 */ lui $v0, %hi(func_E003C47C) -/* 34F548 E003C088 2442C47C */ addiu $v0, $v0, %lo(func_E003C47C) -/* 34F54C E003C08C AFA20024 */ sw $v0, 0x24($sp) -/* 34F550 E003C090 2402001E */ addiu $v0, $zero, 0x1e -/* 34F554 E003C094 AFA00010 */ sw $zero, 0x10($sp) -/* 34F558 E003C098 0C080124 */ jal shim_create_effect_instance -/* 34F55C E003C09C AFA20014 */ sw $v0, 0x14($sp) -/* 34F560 E003C0A0 00122180 */ sll $a0, $s2, 6 -/* 34F564 E003C0A4 0040982D */ daddu $s3, $v0, $zero -/* 34F568 E003C0A8 0C08012C */ jal shim_general_heap_malloc -/* 34F56C E003C0AC AE720008 */ sw $s2, 8($s3) -/* 34F570 E003C0B0 0040182D */ daddu $v1, $v0, $zero -/* 34F574 E003C0B4 14600003 */ bnez $v1, .LE003C0C4 -/* 34F578 E003C0B8 AE63000C */ sw $v1, 0xc($s3) -.LE003C0BC: -/* 34F57C E003C0BC 0800F02F */ j .LE003C0BC -/* 34F580 E003C0C0 00000000 */ nop -.LE003C0C4: -/* 34F584 E003C0C4 24020064 */ addiu $v0, $zero, 0x64 -/* 34F588 E003C0C8 AC710000 */ sw $s1, ($v1) -/* 34F58C E003C0CC E4740004 */ swc1 $f20, 4($v1) -/* 34F590 E003C0D0 E4760008 */ swc1 $f22, 8($v1) -/* 34F594 E003C0D4 E47A000C */ swc1 $f26, 0xc($v1) -/* 34F598 E003C0D8 E4780028 */ swc1 $f24, 0x28($v1) -/* 34F59C E003C0DC AC620030 */ sw $v0, 0x30($v1) -/* 34F5A0 E003C0E0 AC600034 */ sw $zero, 0x34($v1) -/* 34F5A4 E003C0E4 AC70003C */ sw $s0, 0x3c($v1) -/* 34F5A8 E003C0E8 24110001 */ addiu $s1, $zero, 1 -/* 34F5AC E003C0EC 0232102A */ slt $v0, $s1, $s2 -/* 34F5B0 E003C0F0 10400044 */ beqz $v0, .LE003C204 -/* 34F5B4 E003C0F4 24630040 */ addiu $v1, $v1, 0x40 -/* 34F5B8 E003C0F8 2470002C */ addiu $s0, $v1, 0x2c -/* 34F5BC E003C0FC 44920000 */ mtc1 $s2, $f0 -/* 34F5C0 E003C100 00000000 */ nop -/* 34F5C4 E003C104 46800020 */ cvt.s.w $f0, $f0 -/* 34F5C8 E003C108 3C0141F0 */ lui $at, 0x41f0 -/* 34F5CC E003C10C 44811000 */ mtc1 $at, $f2 -/* 34F5D0 E003C110 3C013FF8 */ lui $at, 0x3ff8 -/* 34F5D4 E003C114 4481B800 */ mtc1 $at, $f23 -/* 34F5D8 E003C118 4480B000 */ mtc1 $zero, $f22 -/* 34F5DC E003C11C 46001681 */ sub.s $f26, $f2, $f0 -.LE003C120: -/* 34F5E0 E003C120 001117C2 */ srl $v0, $s1, 0x1f -/* 34F5E4 E003C124 02221021 */ addu $v0, $s1, $v0 -/* 34F5E8 E003C128 00021043 */ sra $v0, $v0, 1 -/* 34F5EC E003C12C 00021040 */ sll $v0, $v0, 1 -/* 34F5F0 E003C130 02221023 */ subu $v0, $s1, $v0 -/* 34F5F4 E003C134 00021040 */ sll $v0, $v0, 1 -/* 34F5F8 E003C138 AE00FFD8 */ sw $zero, -0x28($s0) -/* 34F5FC E003C13C C600FFD8 */ lwc1 $f0, -0x28($s0) -/* 34F600 E003C140 2442FFFF */ addiu $v0, $v0, -1 -/* 34F604 E003C144 AE00FFDC */ sw $zero, -0x24($s0) -/* 34F608 E003C148 00510018 */ mult $v0, $s1 -/* 34F60C E003C14C C602FFDC */ lwc1 $f2, -0x24($s0) -/* 34F610 E003C150 AE00FFE0 */ sw $zero, -0x20($s0) -/* 34F614 E003C154 E600FFE4 */ swc1 $f0, -0x1c($s0) -/* 34F618 E003C158 00001012 */ mflo $v0 -/* 34F61C E003C15C 00021FC2 */ srl $v1, $v0, 0x1f -/* 34F620 E003C160 00431021 */ addu $v0, $v0, $v1 -/* 34F624 E003C164 00021043 */ sra $v0, $v0, 1 -/* 34F628 E003C168 4482A000 */ mtc1 $v0, $f20 -/* 34F62C E003C16C 00000000 */ nop -/* 34F630 E003C170 4680A520 */ cvt.s.w $f20, $f20 -/* 34F634 E003C174 461AA502 */ mul.s $f20, $f20, $f26 -/* 34F638 E003C178 00000000 */ nop -/* 34F63C E003C17C C600FFE0 */ lwc1 $f0, -0x20($s0) -/* 34F640 E003C180 E602FFE8 */ swc1 $f2, -0x18($s0) -/* 34F644 E003C184 3C013E4C */ lui $at, 0x3e4c -/* 34F648 E003C188 3421CCCD */ ori $at, $at, 0xcccd -/* 34F64C E003C18C 44811000 */ mtc1 $at, $f2 -/* 34F650 E003C190 4614E500 */ add.s $f20, $f28, $f20 -/* 34F654 E003C194 E600FFEC */ swc1 $f0, -0x14($s0) -/* 34F658 E003C198 E602000C */ swc1 $f2, 0xc($s0) -/* 34F65C E003C19C 0C080140 */ jal shim_sin_deg -/* 34F660 E003C1A0 4600A306 */ mov.s $f12, $f20 -/* 34F664 E003C1A4 46000007 */ neg.s $f0, $f0 -/* 34F668 E003C1A8 46180002 */ mul.s $f0, $f0, $f24 -/* 34F66C E003C1AC 00000000 */ nop -/* 34F670 E003C1B0 46000021 */ cvt.d.s $f0, $f0 -/* 34F674 E003C1B4 46360002 */ mul.d $f0, $f0, $f22 -/* 34F678 E003C1B8 00000000 */ nop -/* 34F67C E003C1BC 4600A306 */ mov.s $f12, $f20 -/* 34F680 E003C1C0 46200020 */ cvt.s.d $f0, $f0 -/* 34F684 E003C1C4 0C080144 */ jal shim_cos_deg -/* 34F688 E003C1C8 E600FFF0 */ swc1 $f0, -0x10($s0) -/* 34F68C E003C1CC 46180002 */ mul.s $f0, $f0, $f24 -/* 34F690 E003C1D0 00000000 */ nop -/* 34F694 E003C1D4 46000021 */ cvt.d.s $f0, $f0 -/* 34F698 E003C1D8 46360002 */ mul.d $f0, $f0, $f22 -/* 34F69C E003C1DC 00000000 */ nop -/* 34F6A0 E003C1E0 26310001 */ addiu $s1, $s1, 1 -/* 34F6A4 E003C1E4 240200FF */ addiu $v0, $zero, 0xff -/* 34F6A8 E003C1E8 AE020000 */ sw $v0, ($s0) -/* 34F6AC E003C1EC 0232102A */ slt $v0, $s1, $s2 -/* 34F6B0 E003C1F0 AE00FFF8 */ sw $zero, -8($s0) -/* 34F6B4 E003C1F4 46200020 */ cvt.s.d $f0, $f0 -/* 34F6B8 E003C1F8 E600FFF4 */ swc1 $f0, -0xc($s0) -/* 34F6BC E003C1FC 1440FFC8 */ bnez $v0, .LE003C120 -/* 34F6C0 E003C200 26100040 */ addiu $s0, $s0, 0x40 -.LE003C204: -/* 34F6C4 E003C204 8FA20084 */ lw $v0, 0x84($sp) -/* 34F6C8 E003C208 AC530000 */ sw $s3, ($v0) -/* 34F6CC E003C20C 8FBF0038 */ lw $ra, 0x38($sp) -/* 34F6D0 E003C210 8FB30034 */ lw $s3, 0x34($sp) -/* 34F6D4 E003C214 8FB20030 */ lw $s2, 0x30($sp) -/* 34F6D8 E003C218 8FB1002C */ lw $s1, 0x2c($sp) -/* 34F6DC E003C21C 8FB00028 */ lw $s0, 0x28($sp) -/* 34F6E0 E003C220 D7BC0060 */ ldc1 $f28, 0x60($sp) -/* 34F6E4 E003C224 D7BA0058 */ ldc1 $f26, 0x58($sp) -/* 34F6E8 E003C228 D7B80050 */ ldc1 $f24, 0x50($sp) -/* 34F6EC E003C22C D7B60048 */ ldc1 $f22, 0x48($sp) -/* 34F6F0 E003C230 D7B40040 */ ldc1 $f20, 0x40($sp) -/* 34F6F4 E003C234 03E00008 */ jr $ra -/* 34F6F8 E003C238 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/ver/us/asm/nonmatchings/effects/damage_indicator/damage_indicator_update.s b/ver/us/asm/nonmatchings/effects/damage_indicator/damage_indicator_update.s deleted file mode 100644 index 5097d5c808..0000000000 --- a/ver/us/asm/nonmatchings/effects/damage_indicator/damage_indicator_update.s +++ /dev/null @@ -1,153 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel damage_indicator_update -/* 34F704 E003C244 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 34F708 E003C248 AFBF0010 */ sw $ra, 0x10($sp) -/* 34F70C E003C24C F7B40018 */ sdc1 $f20, 0x18($sp) -/* 34F710 E003C250 8C85000C */ lw $a1, 0xc($a0) -/* 34F714 E003C254 8CA30030 */ lw $v1, 0x30($a1) -/* 34F718 E003C258 28620064 */ slti $v0, $v1, 0x64 -/* 34F71C E003C25C 10400002 */ beqz $v0, .LE003C268 -/* 34F720 E003C260 2462FFFF */ addiu $v0, $v1, -1 -/* 34F724 E003C264 ACA20030 */ sw $v0, 0x30($a1) -.LE003C268: -/* 34F728 E003C268 8CA60034 */ lw $a2, 0x34($a1) -/* 34F72C E003C26C 8CA30030 */ lw $v1, 0x30($a1) -/* 34F730 E003C270 24C80001 */ addiu $t0, $a2, 1 -/* 34F734 E003C274 04610005 */ bgez $v1, .LE003C28C -/* 34F738 E003C278 ACA80034 */ sw $t0, 0x34($a1) -/* 34F73C E003C27C 0C080128 */ jal shim_remove_effect -/* 34F740 E003C280 00000000 */ nop -/* 34F744 E003C284 0800F119 */ j .LE003C464 -/* 34F748 E003C288 00000000 */ nop -.LE003C28C: -/* 34F74C E003C28C 8C820008 */ lw $v0, 8($a0) -/* 34F750 E003C290 24070001 */ addiu $a3, $zero, 1 -/* 34F754 E003C294 00E2102A */ slt $v0, $a3, $v0 -/* 34F758 E003C298 10400072 */ beqz $v0, .LE003C464 -/* 34F75C E003C29C 24A50040 */ addiu $a1, $a1, 0x40 -/* 34F760 E003C2A0 286C0006 */ slti $t4, $v1, 6 -/* 34F764 E003C2A4 286B0005 */ slti $t3, $v1, 5 -/* 34F768 E003C2A8 28CA0009 */ slti $t2, $a2, 9 -/* 34F76C E003C2AC 3C02E004 */ lui $v0, %hi(D_E003CD1C) -/* 34F770 E003C2B0 2442CD1C */ addiu $v0, $v0, %lo(D_E003CD1C) -/* 34F774 E003C2B4 00061880 */ sll $v1, $a2, 2 -/* 34F778 E003C2B8 00624821 */ addu $t1, $v1, $v0 -/* 34F77C E003C2BC 29080029 */ slti $t0, $t0, 0x29 -/* 34F780 E003C2C0 3C02E004 */ lui $v0, %hi(D_E003CCD0) -/* 34F784 E003C2C4 2442CCD0 */ addiu $v0, $v0, %lo(D_E003CCD0) -/* 34F788 E003C2C8 00C21821 */ addu $v1, $a2, $v0 -/* 34F78C E003C2CC 24A50038 */ addiu $a1, $a1, 0x38 -/* 34F790 E003C2D0 3C013FE8 */ lui $at, 0x3fe8 -/* 34F794 E003C2D4 44818800 */ mtc1 $at, $f17 -/* 34F798 E003C2D8 44808000 */ mtc1 $zero, $f16 -/* 34F79C E003C2DC 3C01E004 */ lui $at, %hi(D_E003CD40) -/* 34F7A0 E003C2E0 D432CD40 */ ldc1 $f18, %lo(D_E003CD40)($at) -/* 34F7A4 E003C2E4 3C01E004 */ lui $at, %hi(D_E003CD48) -/* 34F7A8 E003C2E8 D42ECD48 */ ldc1 $f14, %lo(D_E003CD48)($at) -.LE003C2EC: -/* 34F7AC E003C2EC 15800013 */ bnez $t4, .LE003C33C -/* 34F7B0 E003C2F0 00000000 */ nop -/* 34F7B4 E003C2F4 C4A4FFE4 */ lwc1 $f4, -0x1c($a1) -/* 34F7B8 E003C2F8 46002121 */ cvt.d.s $f4, $f4 -/* 34F7BC E003C2FC 46302102 */ mul.d $f4, $f4, $f16 -/* 34F7C0 E003C300 00000000 */ nop -/* 34F7C4 E003C304 C4A2FFE8 */ lwc1 $f2, -0x18($a1) -/* 34F7C8 E003C308 460010A1 */ cvt.d.s $f2, $f2 -/* 34F7CC E003C30C 46301082 */ mul.d $f2, $f2, $f16 -/* 34F7D0 E003C310 00000000 */ nop -/* 34F7D4 E003C314 C4A0FFEC */ lwc1 $f0, -0x14($a1) -/* 34F7D8 E003C318 46000021 */ cvt.d.s $f0, $f0 -/* 34F7DC E003C31C 46300002 */ mul.d $f0, $f0, $f16 -/* 34F7E0 E003C320 00000000 */ nop -/* 34F7E4 E003C324 46202120 */ cvt.s.d $f4, $f4 -/* 34F7E8 E003C328 462010A0 */ cvt.s.d $f2, $f2 -/* 34F7EC E003C32C 46200020 */ cvt.s.d $f0, $f0 -/* 34F7F0 E003C330 E4A4FFE4 */ swc1 $f4, -0x1c($a1) -/* 34F7F4 E003C334 E4A2FFE8 */ swc1 $f2, -0x18($a1) -/* 34F7F8 E003C338 E4A0FFEC */ swc1 $f0, -0x14($a1) -.LE003C33C: -/* 34F7FC E003C33C 11600019 */ beqz $t3, .LE003C3A4 -/* 34F800 E003C340 00000000 */ nop -/* 34F804 E003C344 C4A6FFF4 */ lwc1 $f6, -0xc($a1) -/* 34F808 E003C348 468031A1 */ cvt.d.w $f6, $f6 -/* 34F80C E003C34C 46323182 */ mul.d $f6, $f6, $f18 -/* 34F810 E003C350 00000000 */ nop -/* 34F814 E003C354 C4A4FFE4 */ lwc1 $f4, -0x1c($a1) -/* 34F818 E003C358 46002121 */ cvt.d.s $f4, $f4 -/* 34F81C E003C35C 462E2102 */ mul.d $f4, $f4, $f14 -/* 34F820 E003C360 00000000 */ nop -/* 34F824 E003C364 C4A2FFE8 */ lwc1 $f2, -0x18($a1) -/* 34F828 E003C368 460010A1 */ cvt.d.s $f2, $f2 -/* 34F82C E003C36C 462E1082 */ mul.d $f2, $f2, $f14 -/* 34F830 E003C370 00000000 */ nop -/* 34F834 E003C374 C4A0FFEC */ lwc1 $f0, -0x14($a1) -/* 34F838 E003C378 46000021 */ cvt.d.s $f0, $f0 -/* 34F83C E003C37C 462E0002 */ mul.d $f0, $f0, $f14 -/* 34F840 E003C380 00000000 */ nop -/* 34F844 E003C384 4620350D */ trunc.w.d $f20, $f6 -/* 34F848 E003C388 E4B4FFF4 */ swc1 $f20, -0xc($a1) -/* 34F84C E003C38C 46202120 */ cvt.s.d $f4, $f4 -/* 34F850 E003C390 462010A0 */ cvt.s.d $f2, $f2 -/* 34F854 E003C394 46200020 */ cvt.s.d $f0, $f0 -/* 34F858 E003C398 E4A4FFE4 */ swc1 $f4, -0x1c($a1) -/* 34F85C E003C39C E4A2FFE8 */ swc1 $f2, -0x18($a1) -/* 34F860 E003C3A0 E4A0FFEC */ swc1 $f0, -0x14($a1) -.LE003C3A4: -/* 34F864 E003C3A4 3C013F80 */ lui $at, 0x3f80 -/* 34F868 E003C3A8 44816000 */ mtc1 $at, $f12 -/* 34F86C E003C3AC 11400002 */ beqz $t2, .LE003C3B8 -/* 34F870 E003C3B0 00000000 */ nop -/* 34F874 E003C3B4 C52C0000 */ lwc1 $f12, ($t1) -.LE003C3B8: -/* 34F878 E003C3B8 C4AAFFCC */ lwc1 $f10, -0x34($a1) -/* 34F87C E003C3BC 460C5282 */ mul.s $f10, $f10, $f12 -/* 34F880 E003C3C0 00000000 */ nop -/* 34F884 E003C3C4 C4A8FFD0 */ lwc1 $f8, -0x30($a1) -/* 34F888 E003C3C8 460C4202 */ mul.s $f8, $f8, $f12 -/* 34F88C E003C3CC 00000000 */ nop -/* 34F890 E003C3D0 C4A6FFCC */ lwc1 $f6, -0x34($a1) -/* 34F894 E003C3D4 C4A0FFE4 */ lwc1 $f0, -0x1c($a1) -/* 34F898 E003C3D8 C4A4FFD0 */ lwc1 $f4, -0x30($a1) -/* 34F89C E003C3DC 46003180 */ add.s $f6, $f6, $f0 -/* 34F8A0 E003C3E0 C4A0FFE8 */ lwc1 $f0, -0x18($a1) -/* 34F8A4 E003C3E4 C4A2FFD4 */ lwc1 $f2, -0x2c($a1) -/* 34F8A8 E003C3E8 46002100 */ add.s $f4, $f4, $f0 -/* 34F8AC E003C3EC C4A0FFEC */ lwc1 $f0, -0x14($a1) -/* 34F8B0 E003C3F0 46001080 */ add.s $f2, $f2, $f0 -/* 34F8B4 E003C3F4 C4A0FFD4 */ lwc1 $f0, -0x2c($a1) -/* 34F8B8 E003C3F8 E4A6FFCC */ swc1 $f6, -0x34($a1) -/* 34F8BC E003C3FC 460C0002 */ mul.s $f0, $f0, $f12 -/* 34F8C0 E003C400 00000000 */ nop -/* 34F8C4 E003C404 E4A4FFD0 */ swc1 $f4, -0x30($a1) -/* 34F8C8 E003C408 E4A2FFD4 */ swc1 $f2, -0x2c($a1) -/* 34F8CC E003C40C E4AAFFD8 */ swc1 $f10, -0x28($a1) -/* 34F8D0 E003C410 E4A8FFDC */ swc1 $f8, -0x24($a1) -/* 34F8D4 E003C414 1100000D */ beqz $t0, .LE003C44C -/* 34F8D8 E003C418 E4A0FFE0 */ swc1 $f0, -0x20($a1) -/* 34F8DC E003C41C 90620000 */ lbu $v0, ($v1) -/* 34F8E0 E003C420 3C01E004 */ lui $at, %hi(D_E003CD50) -/* 34F8E4 E003C424 D422CD50 */ ldc1 $f2, %lo(D_E003CD50)($at) -/* 34F8E8 E003C428 44820000 */ mtc1 $v0, $f0 -/* 34F8EC E003C42C 00000000 */ nop -/* 34F8F0 E003C430 46800020 */ cvt.s.w $f0, $f0 -/* 34F8F4 E003C434 46000021 */ cvt.d.s $f0, $f0 -/* 34F8F8 E003C438 46220002 */ mul.d $f0, $f0, $f2 -/* 34F8FC E003C43C 00000000 */ nop -/* 34F900 E003C440 46200020 */ cvt.s.d $f0, $f0 -/* 34F904 E003C444 0800F114 */ j .LE003C450 -/* 34F908 E003C448 E4A00000 */ swc1 $f0, ($a1) -.LE003C44C: -/* 34F90C E003C44C ACA00000 */ sw $zero, ($a1) -.LE003C450: -/* 34F910 E003C450 24E70001 */ addiu $a3, $a3, 1 -/* 34F914 E003C454 8C820008 */ lw $v0, 8($a0) -/* 34F918 E003C458 00E2102A */ slt $v0, $a3, $v0 -/* 34F91C E003C45C 1440FFA3 */ bnez $v0, .LE003C2EC -/* 34F920 E003C460 24A50040 */ addiu $a1, $a1, 0x40 -.LE003C464: -/* 34F924 E003C464 8FBF0010 */ lw $ra, 0x10($sp) -/* 34F928 E003C468 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 34F92C E003C46C 03E00008 */ jr $ra -/* 34F930 E003C470 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/effects/damage_indicator/func_E003C47C.s b/ver/us/asm/nonmatchings/effects/damage_indicator/func_E003C47C.s deleted file mode 100644 index f753ee14d1..0000000000 --- a/ver/us/asm/nonmatchings/effects/damage_indicator/func_E003C47C.s +++ /dev/null @@ -1,11 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_E003C47C -/* 34F93C E003C47C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 34F940 E003C480 AFBF0010 */ sw $ra, 0x10($sp) -/* 34F944 E003C484 0C00F126 */ jal func_E003C498 -/* 34F948 E003C488 00000000 */ nop -/* 34F94C E003C48C 8FBF0010 */ lw $ra, 0x10($sp) -/* 34F950 E003C490 03E00008 */ jr $ra -/* 34F954 E003C494 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index ff3c1f6130..0dd320c769 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -2528,7 +2528,8 @@ segments: vram: 0xE003C000 subsegments: - [0x34F4C0, c, damage_indicator] - - [0x350160, data] + - [0x350160, .data, damage_indicator] + - [0x350200, .rodata, damage_indicator] - [0x350220, bin] # damage_indicator gfx - name: effect_purple_ring dir: effects diff --git a/ver/us/undefined_syms.txt b/ver/us/undefined_syms.txt index 05969f3eeb..e264768da6 100644 --- a/ver/us/undefined_syms.txt +++ b/ver/us/undefined_syms.txt @@ -248,6 +248,31 @@ D_09000800 = 0x09000800; D_090008D8 = 0x090008D8; D_090009F0 = 0x090009F0; +// effect_damage_indicator +D_09001D40 = 0x09001D40; +D_09001DE0 = 0x09001DE0; +D_09001E50 = 0x09001E50; +D_09001E90 = 0x09001E90; +D_09001ED0 = 0x09001ED0; +D_09001F10 = 0x09001F10; +D_09001F50 = 0x09001F50; +D_09001F90 = 0x09001F90; +D_09001FD0 = 0x09001FD0; +D_09002010 = 0x09002010; +D_09002050 = 0x09002050; +D_09002090 = 0x09002090; +D_090020D0 = 0x090020D0; +D_09002110 = 0x09002110; +D_09002150 = 0x09002150; +D_09002160 = 0x09002160; +D_09002170 = 0x09002170; +D_09002180 = 0x09002180; +D_090021A8 = 0x090021A8; +D_09002190 = 0x09002190; +D_090021C0 = 0x090021C0; +D_090021E0 = 0x090021E0; +D_09002200 = 0x09002200; + // Invalid pointers from dead code dead_atan2 = 0x8002AF70; dead_gCurrentCamID = 0x800A158C;