snaking_static effect (#876)

* snaking_static_main: Matched

* snaking_static_update: Matched

* snaking_static: PR cleanup
This commit is contained in:
Spencer Vaughn 2022-12-03 20:39:46 -06:00 committed by GitHub
parent d2b436287f
commit 40c2b9be4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 141 additions and 359 deletions

View File

@ -1665,19 +1665,22 @@ typedef struct StatChangeFXData {
} StatChangeFXData; } StatChangeFXData;
typedef struct SnakingStaticFXData { typedef struct SnakingStaticFXData {
/* 0x00 */ char unk_00[4]; /* 0x00 */ s32 unk_00;
/* 0x04 */ Vec3f pos; /* 0x04 */ Vec3f pos;
/* 0x10 */ char unk_10[8]; /* 0x10 */ s32 timeLeft;
/* 0x14 */ s32 lifeTime;
/* 0x18 */ s32 unk_18; /* 0x18 */ s32 unk_18;
/* 0x1C */ s32 unk_1C; /* 0x1C */ s32 unk_1C;
/* 0x20 */ s32 unk_20; /* 0x20 */ s32 unk_20;
/* 0x24 */ char unk_24[4]; /* 0x24 */ s32 unk_24;
/* 0x28 */ s32 unk_28; /* 0x28 */ s32 unk_28;
/* 0x2C */ s32 unk_2C; /* 0x2C */ s32 unk_2C;
/* 0x30 */ s32 unk_30; /* 0x30 */ s32 unk_30;
/* 0x34 */ char unk_34[4]; /* 0x34 */ f32 unk_34;
/* 0x38 */ f32 unk_38; /* 0x38 */ f32 unk_38;
} SnakingStaticFXData; // size = unknown /* 0x3C */ f32 unk_3C;
/* 0x40 */ s32 unk_40;
} SnakingStaticFXData; // size = 0x44
typedef struct ThunderboltRingFXData { typedef struct ThunderboltRingFXData {
/* 0x00 */ s32 unk_00; /* 0x00 */ s32 unk_00;

View File

@ -3,12 +3,142 @@
void snaking_static_appendGfx(void* effect); void snaking_static_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/snaking_static", snaking_static_main); void snaking_static_update(EffectInstance*);
void snaking_static_init(EffectInstance* effect);
void snaking_static_render(EffectInstance* effect);
void snaking_static_init(void) { EffectInstance* snaking_static_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 timeLeft) {
EffectBlueprint effectBp;
EffectInstance* effect;
SnakingStaticFXData* data;
s32 numParts = 22;
s32 i;
effectBp.init = snaking_static_init;
effectBp.update = snaking_static_update;
effectBp.renderWorld = snaking_static_render;
effectBp.unk_00 = 0;
effectBp.unk_14 = 0;
effectBp.effectID = EFFECT_SNAKING_STATIC;
effect = shim_create_effect_instance(&effectBp);
effect->numParts = numParts;
data = effect->data.snakingStatic = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL);
data->unk_00 = arg0;
data->lifeTime = 0;
if (timeLeft <= 0) {
data->timeLeft = 1000;
} else {
data->timeLeft = timeLeft;
} }
INCLUDE_ASM(s32, "effects/snaking_static", snaking_static_update); data->unk_24 = 0;
data->pos.x = posX;
data->pos.y = posY;
data->pos.z = posZ;
data->unk_38 = arg4;
data->unk_18 = 255;
data->unk_1C = 230;
data->unk_20 = 0;
data->unk_28 = 255;
data->unk_2C = 255;
data->unk_30 = 255;
data++;
for(i = 1; i < numParts; i++, data++) {
data->timeLeft = 20;
data->unk_3C = (i - 1) * 360 / (numParts - 1);
data->lifeTime = 0;
data->pos.x = 0;
data->pos.y = 0;
data->unk_34 = 1.0f;
data->unk_40 = i & 15;
}
return effect;
}
void snaking_static_init(EffectInstance* effect) {
}
void snaking_static_update(EffectInstance* effect) {
SnakingStaticFXData* data = effect->data.snakingStatic;
f32 tempOffsetY;
f32 tempOffsetX;
f32 tempPosX;
f32 tempPosY;
s32 lifeTime;
s32 timeLeft;
s32 i;
if (effect->flags & 16) {
effect->flags &= ~16;
data->timeLeft = 16;
}
if (data->timeLeft < 1000) {
data->timeLeft--;
}
timeLeft = data->timeLeft;
data->lifeTime++;
lifeTime = data->lifeTime;
if (timeLeft < 0) {
shim_remove_effect(effect);
return;
}
if (timeLeft < 16) {
data->unk_24 = timeLeft * 16;
}
if (lifeTime < 16) {
data->unk_24 = (lifeTime * 16) + 15;
}
data++;
for (i = 1; i < effect->numParts; i += 3, data += 3) {
if (data->lifeTime >= data->timeLeft) {
data->timeLeft = shim_rand_int(50) + 20;
data->lifeTime = 0;
data->unk_3C = shim_rand_int(360);
data->pos.x = 0.0f;
data->pos.y = 0.0f;
}
if (shim_rand_int(100) < 51) {
tempPosX = data->pos.x;
tempPosY = data->pos.y;
tempOffsetX = shim_rand_int(16) - 8;
tempOffsetY = shim_rand_int(16) - 8;
data[2] = data[1];
data[1] = data[0];
data->pos.x = tempPosX + tempOffsetX;
data->pos.y = tempPosY + tempOffsetY;
data->unk_3C = shim_atan2(0.0f, 0.0f, tempOffsetX, tempOffsetY);
if (tempOffsetX != 0.0f || tempOffsetY != 0.0f) {
data->unk_34 = shim_sqrtf((tempOffsetX * tempOffsetX) + (tempOffsetY * tempOffsetY));
} else {
data->unk_34 = 0.0f;
}
}
data->unk_24 = (shim_sin_deg(((data->lifeTime * 180) / data->timeLeft)) * 1024.0f);
if (data->unk_24 >= 256) {
data->unk_24 = 255;
}
data->lifeTime++;
}
data = effect->data.snakingStatic;
data++;
for (i = 1; i < effect->numParts; i++, data++) {
data->unk_40 = shim_rand_int(15);
}
}
void snaking_static_render(EffectInstance* effect) { void snaking_static_render(EffectInstance* effect) {
RenderTask renderTask; RenderTask renderTask;

View File

@ -1,119 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel snaking_static_main
/* 3B2350 E00AE000 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 3B2354 E00AE004 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 3B2358 E00AE008 4485A000 */ mtc1 $a1, $f20
/* 3B235C E00AE00C F7B60048 */ sdc1 $f22, 0x48($sp)
/* 3B2360 E00AE010 4486B000 */ mtc1 $a2, $f22
/* 3B2364 E00AE014 AFB30034 */ sw $s3, 0x34($sp)
/* 3B2368 E00AE018 0080982D */ daddu $s3, $a0, $zero
/* 3B236C E00AE01C F7B80050 */ sdc1 $f24, 0x50($sp)
/* 3B2370 E00AE020 4487C000 */ mtc1 $a3, $f24
/* 3B2374 E00AE024 27A40010 */ addiu $a0, $sp, 0x10
/* 3B2378 E00AE028 AFB20030 */ sw $s2, 0x30($sp)
/* 3B237C E00AE02C 8FB2006C */ lw $s2, 0x6c($sp)
/* 3B2380 E00AE030 3C02E00B */ lui $v0, %hi(snaking_static_init)
/* 3B2384 E00AE034 2442E1AC */ addiu $v0, $v0, %lo(snaking_static_init)
/* 3B2388 E00AE038 AFA20018 */ sw $v0, 0x18($sp)
/* 3B238C E00AE03C 3C02E00B */ lui $v0, %hi(snaking_static_update)
/* 3B2390 E00AE040 2442E1B4 */ addiu $v0, $v0, %lo(snaking_static_update)
/* 3B2394 E00AE044 AFA2001C */ sw $v0, 0x1c($sp)
/* 3B2398 E00AE048 3C02E00B */ lui $v0, %hi(snaking_static_render)
/* 3B239C E00AE04C 2442E4FC */ addiu $v0, $v0, %lo(snaking_static_render)
/* 3B23A0 E00AE050 AFA20020 */ sw $v0, 0x20($sp)
/* 3B23A4 E00AE054 24020057 */ addiu $v0, $zero, 0x57
/* 3B23A8 E00AE058 AFBF0038 */ sw $ra, 0x38($sp)
/* 3B23AC E00AE05C AFB1002C */ sw $s1, 0x2c($sp)
/* 3B23B0 E00AE060 AFB00028 */ sw $s0, 0x28($sp)
/* 3B23B4 E00AE064 AFA00010 */ sw $zero, 0x10($sp)
/* 3B23B8 E00AE068 AFA00024 */ sw $zero, 0x24($sp)
/* 3B23BC E00AE06C 0C080124 */ jal shim_create_effect_instance
/* 3B23C0 E00AE070 AFA20014 */ sw $v0, 0x14($sp)
/* 3B23C4 E00AE074 240405D8 */ addiu $a0, $zero, 0x5d8
/* 3B23C8 E00AE078 24110016 */ addiu $s1, $zero, 0x16
/* 3B23CC E00AE07C 0040802D */ daddu $s0, $v0, $zero
/* 3B23D0 E00AE080 0C08012C */ jal shim_general_heap_malloc
/* 3B23D4 E00AE084 AE110008 */ sw $s1, 8($s0)
/* 3B23D8 E00AE088 0040202D */ daddu $a0, $v0, $zero
/* 3B23DC E00AE08C 14800003 */ bnez $a0, .LE00AE09C
/* 3B23E0 E00AE090 AE04000C */ sw $a0, 0xc($s0)
.LE00AE094:
/* 3B23E4 E00AE094 0802B825 */ j .LE00AE094
/* 3B23E8 E00AE098 00000000 */ nop
.LE00AE09C:
/* 3B23EC E00AE09C AC930000 */ sw $s3, ($a0)
/* 3B23F0 E00AE0A0 1E400004 */ bgtz $s2, .LE00AE0B4
/* 3B23F4 E00AE0A4 AC800014 */ sw $zero, 0x14($a0)
/* 3B23F8 E00AE0A8 240203E8 */ addiu $v0, $zero, 0x3e8
/* 3B23FC E00AE0AC 0802B82E */ j .LE00AE0B8
/* 3B2400 E00AE0B0 AC820010 */ sw $v0, 0x10($a0)
.LE00AE0B4:
/* 3B2404 E00AE0B4 AC920010 */ sw $s2, 0x10($a0)
.LE00AE0B8:
/* 3B2408 E00AE0B8 240300FF */ addiu $v1, $zero, 0xff
/* 3B240C E00AE0BC 240200E6 */ addiu $v0, $zero, 0xe6
/* 3B2410 E00AE0C0 AC800024 */ sw $zero, 0x24($a0)
/* 3B2414 E00AE0C4 E4940004 */ swc1 $f20, 4($a0)
/* 3B2418 E00AE0C8 E4960008 */ swc1 $f22, 8($a0)
/* 3B241C E00AE0CC E498000C */ swc1 $f24, 0xc($a0)
/* 3B2420 E00AE0D0 C7A00068 */ lwc1 $f0, 0x68($sp)
/* 3B2424 E00AE0D4 24060001 */ addiu $a2, $zero, 1
/* 3B2428 E00AE0D8 AC82001C */ sw $v0, 0x1c($a0)
/* 3B242C E00AE0DC 00D1102A */ slt $v0, $a2, $s1
/* 3B2430 E00AE0E0 AC830018 */ sw $v1, 0x18($a0)
/* 3B2434 E00AE0E4 AC800020 */ sw $zero, 0x20($a0)
/* 3B2438 E00AE0E8 AC830028 */ sw $v1, 0x28($a0)
/* 3B243C E00AE0EC AC83002C */ sw $v1, 0x2c($a0)
/* 3B2440 E00AE0F0 AC830030 */ sw $v1, 0x30($a0)
/* 3B2444 E00AE0F4 E4800038 */ swc1 $f0, 0x38($a0)
/* 3B2448 E00AE0F8 10400021 */ beqz $v0, .LE00AE180
/* 3B244C E00AE0FC 24840044 */ addiu $a0, $a0, 0x44
/* 3B2450 E00AE100 24080014 */ addiu $t0, $zero, 0x14
/* 3B2454 E00AE104 2627FFFF */ addiu $a3, $s1, -1
/* 3B2458 E00AE108 3C013F80 */ lui $at, 0x3f80
/* 3B245C E00AE10C 44811000 */ mtc1 $at, $f2
/* 3B2460 E00AE110 24840040 */ addiu $a0, $a0, 0x40
/* 3B2464 E00AE114 0000282D */ daddu $a1, $zero, $zero
.LE00AE118:
/* 3B2468 E00AE118 14E00002 */ bnez $a3, .LE00AE124
/* 3B246C E00AE11C 00A7001A */ div $zero, $a1, $a3
/* 3B2470 E00AE120 0007000D */ break 7
.LE00AE124:
/* 3B2474 E00AE124 2401FFFF */ addiu $at, $zero, -1
/* 3B2478 E00AE128 14E10004 */ bne $a3, $at, .LE00AE13C
/* 3B247C E00AE12C 3C018000 */ lui $at, 0x8000
/* 3B2480 E00AE130 14A10002 */ bne $a1, $at, .LE00AE13C
/* 3B2484 E00AE134 00000000 */ nop
/* 3B2488 E00AE138 0006000D */ break 6
.LE00AE13C:
/* 3B248C E00AE13C 00001812 */ mflo $v1
/* 3B2490 E00AE140 24A50168 */ addiu $a1, $a1, 0x168
/* 3B2494 E00AE144 30C2000F */ andi $v0, $a2, 0xf
/* 3B2498 E00AE148 24C60001 */ addiu $a2, $a2, 1
/* 3B249C E00AE14C AC820000 */ sw $v0, ($a0)
/* 3B24A0 E00AE150 00D1102A */ slt $v0, $a2, $s1
/* 3B24A4 E00AE154 AC88FFD0 */ sw $t0, -0x30($a0)
/* 3B24A8 E00AE158 AC80FFD4 */ sw $zero, -0x2c($a0)
/* 3B24AC E00AE15C AC80FFC4 */ sw $zero, -0x3c($a0)
/* 3B24B0 E00AE160 AC80FFC8 */ sw $zero, -0x38($a0)
/* 3B24B4 E00AE164 E482FFF4 */ swc1 $f2, -0xc($a0)
/* 3B24B8 E00AE168 44830000 */ mtc1 $v1, $f0
/* 3B24BC E00AE16C 00000000 */ nop
/* 3B24C0 E00AE170 46800020 */ cvt.s.w $f0, $f0
/* 3B24C4 E00AE174 E480FFFC */ swc1 $f0, -4($a0)
/* 3B24C8 E00AE178 1440FFE7 */ bnez $v0, .LE00AE118
/* 3B24CC E00AE17C 24840044 */ addiu $a0, $a0, 0x44
.LE00AE180:
/* 3B24D0 E00AE180 0200102D */ daddu $v0, $s0, $zero
/* 3B24D4 E00AE184 8FBF0038 */ lw $ra, 0x38($sp)
/* 3B24D8 E00AE188 8FB30034 */ lw $s3, 0x34($sp)
/* 3B24DC E00AE18C 8FB20030 */ lw $s2, 0x30($sp)
/* 3B24E0 E00AE190 8FB1002C */ lw $s1, 0x2c($sp)
/* 3B24E4 E00AE194 8FB00028 */ lw $s0, 0x28($sp)
/* 3B24E8 E00AE198 D7B80050 */ ldc1 $f24, 0x50($sp)
/* 3B24EC E00AE19C D7B60048 */ ldc1 $f22, 0x48($sp)
/* 3B24F0 E00AE1A0 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 3B24F4 E00AE1A4 03E00008 */ jr $ra
/* 3B24F8 E00AE1A8 27BD0058 */ addiu $sp, $sp, 0x58

View File

@ -1,232 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel snaking_static_update
/* 3B2504 E00AE1B4 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 3B2508 E00AE1B8 AFB3001C */ sw $s3, 0x1c($sp)
/* 3B250C E00AE1BC 0080982D */ daddu $s3, $a0, $zero
/* 3B2510 E00AE1C0 AFBF0020 */ sw $ra, 0x20($sp)
/* 3B2514 E00AE1C4 AFB20018 */ sw $s2, 0x18($sp)
/* 3B2518 E00AE1C8 AFB10014 */ sw $s1, 0x14($sp)
/* 3B251C E00AE1CC AFB00010 */ sw $s0, 0x10($sp)
/* 3B2520 E00AE1D0 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 3B2524 E00AE1D4 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 3B2528 E00AE1D8 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 3B252C E00AE1DC F7B60030 */ sdc1 $f22, 0x30($sp)
/* 3B2530 E00AE1E0 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 3B2534 E00AE1E4 8E630000 */ lw $v1, ($s3)
/* 3B2538 E00AE1E8 8E71000C */ lw $s1, 0xc($s3)
/* 3B253C E00AE1EC 30620010 */ andi $v0, $v1, 0x10
/* 3B2540 E00AE1F0 10400005 */ beqz $v0, .LE00AE208
/* 3B2544 E00AE1F4 2402FFEF */ addiu $v0, $zero, -0x11
/* 3B2548 E00AE1F8 00621024 */ and $v0, $v1, $v0
/* 3B254C E00AE1FC AE620000 */ sw $v0, ($s3)
/* 3B2550 E00AE200 24020010 */ addiu $v0, $zero, 0x10
/* 3B2554 E00AE204 AE220010 */ sw $v0, 0x10($s1)
.LE00AE208:
/* 3B2558 E00AE208 8E230010 */ lw $v1, 0x10($s1)
/* 3B255C E00AE20C 286203E8 */ slti $v0, $v1, 0x3e8
/* 3B2560 E00AE210 10400002 */ beqz $v0, .LE00AE21C
/* 3B2564 E00AE214 2462FFFF */ addiu $v0, $v1, -1
/* 3B2568 E00AE218 AE220010 */ sw $v0, 0x10($s1)
.LE00AE21C:
/* 3B256C E00AE21C 8E220014 */ lw $v0, 0x14($s1)
/* 3B2570 E00AE220 8E230010 */ lw $v1, 0x10($s1)
/* 3B2574 E00AE224 24440001 */ addiu $a0, $v0, 1
/* 3B2578 E00AE228 04610005 */ bgez $v1, .LE00AE240
/* 3B257C E00AE22C AE240014 */ sw $a0, 0x14($s1)
/* 3B2580 E00AE230 0C080128 */ jal shim_remove_effect
/* 3B2584 E00AE234 0260202D */ daddu $a0, $s3, $zero
/* 3B2588 E00AE238 0802B933 */ j .LE00AE4CC
/* 3B258C E00AE23C 00000000 */ nop
.LE00AE240:
/* 3B2590 E00AE240 28620010 */ slti $v0, $v1, 0x10
/* 3B2594 E00AE244 10400002 */ beqz $v0, .LE00AE250
/* 3B2598 E00AE248 00031100 */ sll $v0, $v1, 4
/* 3B259C E00AE24C AE220024 */ sw $v0, 0x24($s1)
.LE00AE250:
/* 3B25A0 E00AE250 28820010 */ slti $v0, $a0, 0x10
/* 3B25A4 E00AE254 10400003 */ beqz $v0, .LE00AE264
/* 3B25A8 E00AE258 00041100 */ sll $v0, $a0, 4
/* 3B25AC E00AE25C 2442000F */ addiu $v0, $v0, 0xf
/* 3B25B0 E00AE260 AE220024 */ sw $v0, 0x24($s1)
.LE00AE264:
/* 3B25B4 E00AE264 8E620008 */ lw $v0, 8($s3)
/* 3B25B8 E00AE268 24120001 */ addiu $s2, $zero, 1
/* 3B25BC E00AE26C 0242102A */ slt $v0, $s2, $v0
/* 3B25C0 E00AE270 1040008B */ beqz $v0, .LE00AE4A0
/* 3B25C4 E00AE274 26310044 */ addiu $s1, $s1, 0x44
/* 3B25C8 E00AE278 4480E000 */ mtc1 $zero, $f28
/* 3B25CC E00AE27C 26300014 */ addiu $s0, $s1, 0x14
.LE00AE280:
/* 3B25D0 E00AE280 8E020000 */ lw $v0, ($s0)
/* 3B25D4 E00AE284 8E03FFFC */ lw $v1, -4($s0)
/* 3B25D8 E00AE288 0043102A */ slt $v0, $v0, $v1
/* 3B25DC E00AE28C 1440000E */ bnez $v0, .LE00AE2C8
/* 3B25E0 E00AE290 00000000 */ nop
/* 3B25E4 E00AE294 0C080138 */ jal shim_rand_int
/* 3B25E8 E00AE298 24040032 */ addiu $a0, $zero, 0x32
/* 3B25EC E00AE29C 24040168 */ addiu $a0, $zero, 0x168
/* 3B25F0 E00AE2A0 24420014 */ addiu $v0, $v0, 0x14
/* 3B25F4 E00AE2A4 AE02FFFC */ sw $v0, -4($s0)
/* 3B25F8 E00AE2A8 0C080138 */ jal shim_rand_int
/* 3B25FC E00AE2AC AE000000 */ sw $zero, ($s0)
/* 3B2600 E00AE2B0 44820000 */ mtc1 $v0, $f0
/* 3B2604 E00AE2B4 00000000 */ nop
/* 3B2608 E00AE2B8 46800020 */ cvt.s.w $f0, $f0
/* 3B260C E00AE2BC E6000028 */ swc1 $f0, 0x28($s0)
/* 3B2610 E00AE2C0 AE00FFF0 */ sw $zero, -0x10($s0)
/* 3B2614 E00AE2C4 AE00FFF4 */ sw $zero, -0xc($s0)
.LE00AE2C8:
/* 3B2618 E00AE2C8 0C080138 */ jal shim_rand_int
/* 3B261C E00AE2CC 24040064 */ addiu $a0, $zero, 0x64
/* 3B2620 E00AE2D0 28420033 */ slti $v0, $v0, 0x33
/* 3B2624 E00AE2D4 10400047 */ beqz $v0, .LE00AE3F4
/* 3B2628 E00AE2D8 00000000 */ nop
/* 3B262C E00AE2DC C618FFF0 */ lwc1 $f24, -0x10($s0)
/* 3B2630 E00AE2E0 C61AFFF4 */ lwc1 $f26, -0xc($s0)
/* 3B2634 E00AE2E4 0C080138 */ jal shim_rand_int
/* 3B2638 E00AE2E8 24040010 */ addiu $a0, $zero, 0x10
/* 3B263C E00AE2EC 2442FFF8 */ addiu $v0, $v0, -8
/* 3B2640 E00AE2F0 4482B000 */ mtc1 $v0, $f22
/* 3B2644 E00AE2F4 00000000 */ nop
/* 3B2648 E00AE2F8 4680B5A0 */ cvt.s.w $f22, $f22
/* 3B264C E00AE2FC 0C080138 */ jal shim_rand_int
/* 3B2650 E00AE300 24040010 */ addiu $a0, $zero, 0x10
/* 3B2654 E00AE304 2442FFF8 */ addiu $v0, $v0, -8
/* 3B2658 E00AE308 4482A000 */ mtc1 $v0, $f20
/* 3B265C E00AE30C 00000000 */ nop
/* 3B2660 E00AE310 4680A520 */ cvt.s.w $f20, $f20
/* 3B2664 E00AE314 26230088 */ addiu $v1, $s1, 0x88
/* 3B2668 E00AE318 26220044 */ addiu $v0, $s1, 0x44
/* 3B266C E00AE31C 26240084 */ addiu $a0, $s1, 0x84
.LE00AE320:
/* 3B2670 E00AE320 8C450000 */ lw $a1, ($v0)
/* 3B2674 E00AE324 8C480004 */ lw $t0, 4($v0)
/* 3B2678 E00AE328 8C490008 */ lw $t1, 8($v0)
/* 3B267C E00AE32C 8C4A000C */ lw $t2, 0xc($v0)
/* 3B2680 E00AE330 AC650000 */ sw $a1, ($v1)
/* 3B2684 E00AE334 AC680004 */ sw $t0, 4($v1)
/* 3B2688 E00AE338 AC690008 */ sw $t1, 8($v1)
/* 3B268C E00AE33C AC6A000C */ sw $t2, 0xc($v1)
/* 3B2690 E00AE340 24420010 */ addiu $v0, $v0, 0x10
/* 3B2694 E00AE344 1444FFF6 */ bne $v0, $a0, .LE00AE320
/* 3B2698 E00AE348 24630010 */ addiu $v1, $v1, 0x10
/* 3B269C E00AE34C 8C450000 */ lw $a1, ($v0)
/* 3B26A0 E00AE350 AC650000 */ sw $a1, ($v1)
/* 3B26A4 E00AE354 26230044 */ addiu $v1, $s1, 0x44
/* 3B26A8 E00AE358 0220102D */ daddu $v0, $s1, $zero
/* 3B26AC E00AE35C 26240040 */ addiu $a0, $s1, 0x40
.LE00AE360:
/* 3B26B0 E00AE360 8C450000 */ lw $a1, ($v0)
/* 3B26B4 E00AE364 8C480004 */ lw $t0, 4($v0)
/* 3B26B8 E00AE368 8C490008 */ lw $t1, 8($v0)
/* 3B26BC E00AE36C 8C4A000C */ lw $t2, 0xc($v0)
/* 3B26C0 E00AE370 AC650000 */ sw $a1, ($v1)
/* 3B26C4 E00AE374 AC680004 */ sw $t0, 4($v1)
/* 3B26C8 E00AE378 AC690008 */ sw $t1, 8($v1)
/* 3B26CC E00AE37C AC6A000C */ sw $t2, 0xc($v1)
/* 3B26D0 E00AE380 24420010 */ addiu $v0, $v0, 0x10
/* 3B26D4 E00AE384 1444FFF6 */ bne $v0, $a0, .LE00AE360
/* 3B26D8 E00AE388 24630010 */ addiu $v1, $v1, 0x10
/* 3B26DC E00AE38C 4600E306 */ mov.s $f12, $f28
/* 3B26E0 E00AE390 4600E386 */ mov.s $f14, $f28
/* 3B26E4 E00AE394 4616C080 */ add.s $f2, $f24, $f22
/* 3B26E8 E00AE398 4406B000 */ mfc1 $a2, $f22
/* 3B26EC E00AE39C 4407A000 */ mfc1 $a3, $f20
/* 3B26F0 E00AE3A0 4614D000 */ add.s $f0, $f26, $f20
/* 3B26F4 E00AE3A4 8C450000 */ lw $a1, ($v0)
/* 3B26F8 E00AE3A8 AC650000 */ sw $a1, ($v1)
/* 3B26FC E00AE3AC E602FFF0 */ swc1 $f2, -0x10($s0)
/* 3B2700 E00AE3B0 0C080148 */ jal shim_atan2
/* 3B2704 E00AE3B4 E600FFF4 */ swc1 $f0, -0xc($s0)
/* 3B2708 E00AE3B8 461CB032 */ c.eq.s $f22, $f28
/* 3B270C E00AE3BC 00000000 */ nop
/* 3B2710 E00AE3C0 45000005 */ bc1f .LE00AE3D8
/* 3B2714 E00AE3C4 E6000028 */ swc1 $f0, 0x28($s0)
/* 3B2718 E00AE3C8 461CA032 */ c.eq.s $f20, $f28
/* 3B271C E00AE3CC 00000000 */ nop
/* 3B2720 E00AE3D0 45030008 */ bc1tl .LE00AE3F4
/* 3B2724 E00AE3D4 E61C0020 */ swc1 $f28, 0x20($s0)
.LE00AE3D8:
/* 3B2728 E00AE3D8 4616B002 */ mul.s $f0, $f22, $f22
/* 3B272C E00AE3DC 00000000 */ nop
/* 3B2730 E00AE3E0 4614A302 */ mul.s $f12, $f20, $f20
/* 3B2734 E00AE3E4 00000000 */ nop
/* 3B2738 E00AE3E8 0C080154 */ jal shim_sqrtf
/* 3B273C E00AE3EC 460C0300 */ add.s $f12, $f0, $f12
/* 3B2740 E00AE3F0 E6000020 */ swc1 $f0, 0x20($s0)
.LE00AE3F4:
/* 3B2744 E00AE3F4 8E020000 */ lw $v0, ($s0)
/* 3B2748 E00AE3F8 00021840 */ sll $v1, $v0, 1
/* 3B274C E00AE3FC 00621821 */ addu $v1, $v1, $v0
/* 3B2750 E00AE400 00031100 */ sll $v0, $v1, 4
/* 3B2754 E00AE404 00431023 */ subu $v0, $v0, $v1
/* 3B2758 E00AE408 8E03FFFC */ lw $v1, -4($s0)
/* 3B275C E00AE40C 00021080 */ sll $v0, $v0, 2
/* 3B2760 E00AE410 14600002 */ bnez $v1, .LE00AE41C
/* 3B2764 E00AE414 0043001A */ div $zero, $v0, $v1
/* 3B2768 E00AE418 0007000D */ break 7
.LE00AE41C:
/* 3B276C E00AE41C 2401FFFF */ addiu $at, $zero, -1
/* 3B2770 E00AE420 14610004 */ bne $v1, $at, .LE00AE434
/* 3B2774 E00AE424 3C018000 */ lui $at, 0x8000
/* 3B2778 E00AE428 14410002 */ bne $v0, $at, .LE00AE434
/* 3B277C E00AE42C 00000000 */ nop
/* 3B2780 E00AE430 0006000D */ break 6
.LE00AE434:
/* 3B2784 E00AE434 00001012 */ mflo $v0
/* 3B2788 E00AE438 44826000 */ mtc1 $v0, $f12
/* 3B278C E00AE43C 00000000 */ nop
/* 3B2790 E00AE440 0C080140 */ jal shim_sin_deg
/* 3B2794 E00AE444 46806320 */ cvt.s.w $f12, $f12
/* 3B2798 E00AE448 3C014480 */ lui $at, 0x4480
/* 3B279C E00AE44C 44811000 */ mtc1 $at, $f2
/* 3B27A0 E00AE450 00000000 */ nop
/* 3B27A4 E00AE454 46020002 */ mul.s $f0, $f0, $f2
/* 3B27A8 E00AE458 00000000 */ nop
/* 3B27AC E00AE45C 4600010D */ trunc.w.s $f4, $f0
/* 3B27B0 E00AE460 44022000 */ mfc1 $v0, $f4
/* 3B27B4 E00AE464 00000000 */ nop
/* 3B27B8 E00AE468 AE020010 */ sw $v0, 0x10($s0)
/* 3B27BC E00AE46C 28420100 */ slti $v0, $v0, 0x100
/* 3B27C0 E00AE470 14400003 */ bnez $v0, .LE00AE480
/* 3B27C4 E00AE474 26520003 */ addiu $s2, $s2, 3
/* 3B27C8 E00AE478 240200FF */ addiu $v0, $zero, 0xff
/* 3B27CC E00AE47C AE020010 */ sw $v0, 0x10($s0)
.LE00AE480:
/* 3B27D0 E00AE480 8E020000 */ lw $v0, ($s0)
/* 3B27D4 E00AE484 263100CC */ addiu $s1, $s1, 0xcc
/* 3B27D8 E00AE488 24420001 */ addiu $v0, $v0, 1
/* 3B27DC E00AE48C AE020000 */ sw $v0, ($s0)
/* 3B27E0 E00AE490 8E620008 */ lw $v0, 8($s3)
/* 3B27E4 E00AE494 0242102A */ slt $v0, $s2, $v0
/* 3B27E8 E00AE498 1440FF79 */ bnez $v0, .LE00AE280
/* 3B27EC E00AE49C 261000CC */ addiu $s0, $s0, 0xcc
.LE00AE4A0:
/* 3B27F0 E00AE4A0 8E71000C */ lw $s1, 0xc($s3)
/* 3B27F4 E00AE4A4 0802B92F */ j .LE00AE4BC
/* 3B27F8 E00AE4A8 24120001 */ addiu $s2, $zero, 1
.LE00AE4AC:
/* 3B27FC E00AE4AC 0C080138 */ jal shim_rand_int
/* 3B2800 E00AE4B0 2404000F */ addiu $a0, $zero, 0xf
/* 3B2804 E00AE4B4 26520001 */ addiu $s2, $s2, 1
/* 3B2808 E00AE4B8 AE220040 */ sw $v0, 0x40($s1)
.LE00AE4BC:
/* 3B280C E00AE4BC 8E620008 */ lw $v0, 8($s3)
/* 3B2810 E00AE4C0 0242102A */ slt $v0, $s2, $v0
/* 3B2814 E00AE4C4 1440FFF9 */ bnez $v0, .LE00AE4AC
/* 3B2818 E00AE4C8 26310044 */ addiu $s1, $s1, 0x44
.LE00AE4CC:
/* 3B281C E00AE4CC 8FBF0020 */ lw $ra, 0x20($sp)
/* 3B2820 E00AE4D0 8FB3001C */ lw $s3, 0x1c($sp)
/* 3B2824 E00AE4D4 8FB20018 */ lw $s2, 0x18($sp)
/* 3B2828 E00AE4D8 8FB10014 */ lw $s1, 0x14($sp)
/* 3B282C E00AE4DC 8FB00010 */ lw $s0, 0x10($sp)
/* 3B2830 E00AE4E0 D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 3B2834 E00AE4E4 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 3B2838 E00AE4E8 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 3B283C E00AE4EC D7B60030 */ ldc1 $f22, 0x30($sp)
/* 3B2840 E00AE4F0 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 3B2844 E00AE4F4 03E00008 */ jr $ra
/* 3B2848 E00AE4F8 27BD0050 */ addiu $sp, $sp, 0x50