text
stringlengths 6.38k
228k
|
---|
### RAW ASSEMBLY INSTRUCTIONS:
glabel VirtualEntityJumpTo
/* F8608 802D3C58 27BDFFB8 */ addiu $sp, $sp, -0x48
/* F860C 802D3C5C AFB20018 */ sw $s2, 0x18($sp)
/* F8610 802D3C60 0080902D */ daddu $s2, $a0, $zero
/* F8614 802D3C64 AFBF001C */ sw $ra, 0x1C($sp)
/* F8618 802D3C68 AFB10014 */ sw $s1, 0x14($sp)
/* F861C 802D3C6C AFB00010 */ sw $s0, 0x10($sp)
/* F8620 802D3C70 F7BC0040 */ sdc1 $f28, 0x40($sp)
/* F8624 802D3C74 F7BA0038 */ sdc1 $f26, 0x38($sp)
/* F8628 802D3C78 F7B80030 */ sdc1 $f24, 0x30($sp)
/* F862C 802D3C7C F7B60028 */ sdc1 $f22, 0x28($sp)
/* F8630 802D3C80 F7B40020 */ sdc1 $f20, 0x20($sp)
/* F8634 802D3C84 8E51000C */ lw $s1, 0xC($s2)
/* F8638 802D3C88 54A00001 */ bnel $a1, $zero, .L802D3C90
/* F863C 802D3C8C AE400070 */ sw $zero, 0x70($s2)
.L802D3C90:
/* F8640 802D3C90 8E420070 */ lw $v0, 0x70($s2)
/* F8644 802D3C94 14400058 */ bnez $v0, .L802D3DF8
/* F8648 802D3C98 00000000 */ nop
/* F864C 802D3C9C 8E250000 */ lw $a1, 0x0($s1)
/* F8650 802D3CA0 26310004 */ addiu $s1, $s1, 0x4
/* F8654 802D3CA4 0C0B1EAF */ jal evt_get_variable
/* F8658 802D3CA8 0240202D */ daddu $a0, $s2, $zero
/* F865C 802D3CAC 8E250000 */ lw $a1, 0x0($s1)
/* F8660 802D3CB0 26310004 */ addiu $s1, $s1, 0x4
/* F8664 802D3CB4 0240202D */ daddu $a0, $s2, $zero
/* F8668 802D3CB8 0C0B1EAF */ jal evt_get_variable
/* F866C 802D3CBC 0040802D */ daddu $s0, $v0, $zero
/* F8670 802D3CC0 4482D000 */ mtc1 $v0, $f26
/* F8674 802D3CC4 00000000 */ nop
/* F8678 802D3CC8 4680D6A0 */ cvt.s.w $f26, $f26
/* F867C 802D3CCC 8E250000 */ lw $a1, 0x0($s1)
/* F8680 802D3CD0 26310004 */ addiu $s1, $s1, 0x4
/* F8684 802D3CD4 0C0B1EAF */ jal evt_get_variable
/* F8688 802D3CD8 0240202D */ daddu $a0, $s2, $zero
/* F868C 802D3CDC 4482E000 */ mtc1 $v0, $f28
/* F8690 802D3CE0 00000000 */ nop
/* F8694 802D3CE4 4680E720 */ cvt.s.w $f28, $f28
/* F8698 802D3CE8 8E250000 */ lw $a1, 0x0($s1)
/* F869C 802D3CEC 26310004 */ addiu $s1, $s1, 0x4
/* F86A0 802D3CF0 0C0B1EAF */ jal evt_get_variable
/* F86A4 802D3CF4 0240202D */ daddu $a0, $s2, $zero
/* F86A8 802D3CF8 4482C000 */ mtc1 $v0, $f24
/* F86AC 802D3CFC 00000000 */ nop
/* F86B0 802D3D00 4680C620 */ cvt.s.w $f24, $f24
/* F86B4 802D3D04 8E250000 */ lw $a1, 0x0($s1)
/* F86B8 802D3D08 0C0B1EAF */ jal evt_get_variable
/* F86BC 802D3D0C 0240202D */ daddu $a0, $s2, $zero
/* F86C0 802D3D10 3C04802E */ lui $a0, %hi(gCurrentVirtualEntityListPtr)
/* F86C4 802D3D14 8C84B7C0 */ lw $a0, %lo(gCurrentVirtualEntityListPtr)($a0)
/* F86C8 802D3D18 00101880 */ sll $v1, $s0, 2
/* F86CC 802D3D1C 00641821 */ addu $v1, $v1, $a0
/* F86D0 802D3D20 8C710000 */ lw $s1, 0x0($v1)
/* F86D4 802D3D24 AE500074 */ sw $s0, 0x74($s2)
/* F86D8 802D3D28 E63A0028 */ swc1 $f26, 0x28($s1)
/* F86DC 802D3D2C C63A0004 */ lwc1 $f26, 0x4($s1)
/* F86E0 802D3D30 E63C002C */ swc1 $f28, 0x2C($s1)
/* F86E4 802D3D34 C63C0008 */ lwc1 $f28, 0x8($s1)
/* F86E8 802D3D38 E6380030 */ swc1 $f24, 0x30($s1)
/* F86EC 802D3D3C C638000C */ lwc1 $f24, 0xC($s1)
/* F86F0 802D3D40 C6360028 */ lwc1 $f22, 0x28($s1)
/* F86F4 802D3D44 C6340030 */ lwc1 $f20, 0x30($s1)
/* F86F8 802D3D48 44820000 */ mtc1 $v0, $f0
/* F86FC 802D3D4C 00000000 */ nop
/* F8700 802D3D50 46800020 */ cvt.s.w $f0, $f0
/* F8704 802D3D54 E6200048 */ swc1 $f0, 0x48($s1)
/* F8708 802D3D58 C620002C */ lwc1 $f0, 0x2C($s1)
/* F870C 802D3D5C 4600D306 */ mov.s $f12, $f26
/* F8710 802D3D60 4600C386 */ mov.s $f14, $f24
/* F8714 802D3D64 4406B000 */ mfc1 $a2, $f22
/* F8718 802D3D68 4407A000 */ mfc1 $a3, $f20
/* F871C 802D3D6C 0C00A720 */ jal atan2
/* F8720 802D3D70 461C0701 */ sub.s $f28, $f0, $f28
/* F8724 802D3D74 4600D306 */ mov.s $f12, $f26
/* F8728 802D3D78 4406B000 */ mfc1 $a2, $f22
/* F872C 802D3D7C 4407A000 */ mfc1 $a3, $f20
/* F8730 802D3D80 4600C386 */ mov.s $f14, $f24
/* F8734 802D3D84 0C00A7B5 */ jal dist2D
/* F8738 802D3D88 E6200038 */ swc1 $f0, 0x38($s1)
/* F873C 802D3D8C C6260048 */ lwc1 $f6, 0x48($s1)
/* F8740 802D3D90 44801000 */ mtc1 $zero, $f2
/* F8744 802D3D94 46000106 */ mov.s $f4, $f0
/* F8748 802D3D98 46023032 */ c.eq.s $f6, $f2
/* F874C 802D3D9C 00000000 */ nop
/* F8750 802D3DA0 45000005 */ bc1f .L802D3DB8
/* F8754 802D3DA4 E6240034 */ swc1 $f4, 0x34($s1)
/* F8758 802D3DA8 C620003C */ lwc1 $f0, 0x3C($s1)
/* F875C 802D3DAC 46002003 */ div.s $f0, $f4, $f0
/* F8760 802D3DB0 080B4F70 */ j .L802D3DC0
/* F8764 802D3DB4 E6200048 */ swc1 $f0, 0x48($s1)
.L802D3DB8:
/* F8768 802D3DB8 46062003 */ div.s $f0, $f4, $f6
/* F876C 802D3DBC E620003C */ swc1 $f0, 0x3C($s1)
.L802D3DC0:
/* F8770 802D3DC0 C6200040 */ lwc1 $f0, 0x40($s1)
/* F8774 802D3DC4 C6220048 */ lwc1 $f2, 0x48($s1)
/* F8778 802D3DC8 46020002 */ mul.s $f0, $f0, $f2
/* F877C 802D3DCC 00000000 */ nop
/* F8780 802D3DD0 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* F8784 802D3DD4 44812000 */ mtc1 $at, $f4
/* F8788 802D3DD8 00000000 */ nop
/* F878C 802D3DDC 46040002 */ mul.s $f0, $f0, $f4
/* F8790 802D3DE0 00000000 */ nop
/* F8794 802D3DE4 4602E083 */ div.s $f2, $f28, $f2
/* F8798 802D3DE8 46020000 */ add.s $f0, $f0, $f2
/* F879C 802D3DEC 24020001 */ addiu $v0, $zero, 0x1
/* F87A0 802D3DF0 E6200044 */ swc1 $f0, 0x44($s1)
/* F87A4 802D3DF4 AE420070 */ sw $v0, 0x70($s2)
.L802D3DF8:
/* F87A8 802D3DF8 8E420074 */ lw $v0, 0x74($s2)
/* F87AC 802D3DFC 3C03802E */ lui $v1, %hi(gCurrentVirtualEntityListPtr)
/* F87B0 802D3E00 8C63B7C0 */ lw $v1, %lo(gCurrentVirtualEntityListPtr)($v1)
/* F87B4 802D3E04 00021080 */ sll $v0, $v0, 2
/* F87B8 802D3E08 00431021 */ addu $v0, $v0, $v1
/* F87BC 802D3E0C 8C510000 */ lw $s1, 0x0($v0)
/* F87C0 802D3E10 C6240008 */ lwc1 $f4, 0x8($s1)
/* F87C4 802D3E14 C6200044 */ lwc1 $f0, 0x44($s1)
/* F87C8 802D3E18 8E25003C */ lw $a1, 0x3C($s1)
/* F87CC 802D3E1C 46002100 */ add.s $f4, $f4, $f0
/* F87D0 802D3E20 C6220040 */ lwc1 $f2, 0x40($s1)
/* F87D4 802D3E24 8E260038 */ lw $a2, 0x38($s1)
/* F87D8 802D3E28 46020001 */ sub.s $f0, $f0, $f2
/* F87DC 802D3E2C 0220202D */ daddu $a0, $s1, $zero
/* F87E0 802D3E30 E6240008 */ swc1 $f4, 0x8($s1)
/* F87E4 802D3E34 0C0B4BCD */ jal virtual_entity_move_polar
/* F87E8 802D3E38 E6200044 */ swc1 $f0, 0x44($s1)
/* F87EC 802D3E3C C6200048 */ lwc1 $f0, 0x48($s1)
/* F87F0 802D3E40 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* F87F4 802D3E44 44811000 */ mtc1 $at, $f2
/* F87F8 802D3E48 00000000 */ nop
/* F87FC 802D3E4C 46020001 */ sub.s $f0, $f0, $f2
/* F8800 802D3E50 44801000 */ mtc1 $zero, $f2
/* F8804 802D3E54 00000000 */ nop
/* F8808 802D3E58 4602003E */ c.le.s $f0, $f2
/* F880C 802D3E5C 00000000 */ nop
/* F8810 802D3E60 45010003 */ bc1t .L802D3E70
/* F8814 802D3E64 E6200048 */ swc1 $f0, 0x48($s1)
/* F8818 802D3E68 080B4FA3 */ j .L802D3E8C
/* F881C 802D3E6C 0000102D */ daddu $v0, $zero, $zero
.L802D3E70:
/* F8820 802D3E70 C6200028 */ lwc1 $f0, 0x28($s1)
/* F8824 802D3E74 C622002C */ lwc1 $f2, 0x2C($s1)
/* F8828 802D3E78 C6240030 */ lwc1 $f4, 0x30($s1)
/* F882C 802D3E7C 24020001 */ addiu $v0, $zero, 0x1
/* F8830 802D3E80 E6200004 */ swc1 $f0, 0x4($s1)
/* F8834 802D3E84 E6220008 */ swc1 $f2, 0x8($s1)
/* F8838 802D3E88 E624000C */ swc1 $f4, 0xC($s1)
.L802D3E8C:
/* F883C 802D3E8C 8FBF001C */ lw $ra, 0x1C($sp)
/* F8840 802D3E90 8FB20018 */ lw $s2, 0x18($sp)
/* F8844 802D3E94 8FB10014 */ lw $s1, 0x14($sp)
/* F8848 802D3E98 8FB00010 */ lw $s0, 0x10($sp)
/* F884C 802D3E9C D7BC0040 */ ldc1 $f28, 0x40($sp)
/* F8850 802D3EA0 D7BA0038 */ ldc1 $f26, 0x38($sp)
/* F8854 802D3EA4 D7B80030 */ ldc1 $f24, 0x30($sp)
/* F8858 802D3EA8 D7B60028 */ ldc1 $f22, 0x28($sp)
/* F885C 802D3EAC D7B40020 */ ldc1 $f20, 0x20($sp)
/* F8860 802D3EB0 03E00008 */ jr $ra
/* F8864 802D3EB4 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
ApiStatus VirtualEntityJumpTo(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
VirtualEntity* virtualEntity;
s32 index;
f32 xTemp;
f32 yTemp;
f32 zTemp;
s32 moveTime;
f32 goalPosX;
f32 goalPosY;
f32 goalPosZ;
if (isInitialCall) {
script->functionTemp[0] = 0;
}
if (script->functionTemp[0] == 0) {
index = evt_get_variable(script, *args++);
xTemp = evt_get_variable(script, *args++);
yTemp = evt_get_variable(script, *args++);
zTemp = evt_get_variable(script, *args++);
moveTime = evt_get_variable(script, *args++);
virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
script->functionTemp[1] = index;
virtualEntity->goalPos.x = xTemp;
virtualEntity->goalPos.y = yTemp;
virtualEntity->goalPos.z = zTemp;
xTemp = virtualEntity->pos.x;
yTemp = virtualEntity->pos.y;
zTemp = virtualEntity->pos.z;
goalPosX = virtualEntity->goalPos.x;
yTemp = virtualEntity->goalPos.y - yTemp;
goalPosZ = virtualEntity->goalPos.z;
virtualEntity->moveTime = moveTime;
virtualEntity->moveAngle = atan2(xTemp, zTemp, goalPosX, goalPosZ);
virtualEntity->moveDist = dist2D(xTemp, zTemp, goalPosX, goalPosZ);
if (virtualEntity->moveTime == 0.0f) {
virtualEntity->moveTime = virtualEntity->moveDist / virtualEntity->moveSpeed;
} else {
virtualEntity->moveSpeed = virtualEntity->moveDist / virtualEntity->moveTime;
}
virtualEntity->jumpVelocity = (virtualEntity->jumpGravity * virtualEntity->moveTime / 2) +
(yTemp / virtualEntity->moveTime);
script->functionTemp[0] = 1;
}
virtualEntity = (*gCurrentVirtualEntityListPtr)[script->functionTemp[1]];
virtualEntity->pos.y += virtualEntity->jumpVelocity;
virtualEntity->jumpVelocity -= virtualEntity->jumpGravity;
virtual_entity_move_polar(virtualEntity, virtualEntity->moveSpeed, virtualEntity->moveAngle);
virtualEntity->moveTime -= 1.0f;
if (virtualEntity->moveTime <= 0.0f) {
virtualEntity->pos.x = virtualEntity->goalPos.x;
virtualEntity->pos.y = virtualEntity->goalPos.y;
virtualEntity->pos.z = virtualEntity->goalPos.z;
return ApiStatus_DONE1;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8025A50C
/* 188DEC 8025A50C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 188DF0 8025A510 AFB20018 */ sw $s2, 0x18($sp)
/* 188DF4 8025A514 0080902D */ daddu $s2, $a0, $zero
/* 188DF8 8025A518 AFB10014 */ sw $s1, 0x14($sp)
/* 188DFC 8025A51C 00A0882D */ daddu $s1, $a1, $zero
/* 188E00 8025A520 AFBF0024 */ sw $ra, 0x24($sp)
/* 188E04 8025A524 AFB40020 */ sw $s4, 0x20($sp)
/* 188E08 8025A528 AFB3001C */ sw $s3, 0x1C($sp)
/* 188E0C 8025A52C AFB00010 */ sw $s0, 0x10($sp)
/* 188E10 8025A530 8E3000C0 */ lw $s0, 0xC0($s1)
/* 188E14 8025A534 00C0982D */ daddu $s3, $a2, $zero
/* 188E18 8025A538 820206C1 */ lb $v0, 0x6C1($s0)
/* 188E1C 8025A53C 10400032 */ beqz $v0, .L8025A608
/* 188E20 8025A540 00E0A02D */ daddu $s4, $a3, $zero
/* 188E24 8025A544 16400016 */ bnez $s2, .L8025A5A0
/* 188E28 8025A548 00000000 */ nop
/* 188E2C 8025A54C 0C0B7830 */ jal spr_get_player_palettes
/* 188E30 8025A550 96240088 */ lhu $a0, 0x88($s1)
/* 188E34 8025A554 AE0206D0 */ sw $v0, 0x6D0($s0)
/* 188E38 8025A558 0040202D */ daddu $a0, $v0, $zero
/* 188E3C 8025A55C A20006CD */ sb $zero, 0x6CD($s0)
/* 188E40 8025A560 8C830000 */ lw $v1, 0x0($a0)
/* 188E44 8025A564 2402FFFF */ addiu $v0, $zero, -0x1
/* 188E48 8025A568 1062000B */ beq $v1, $v0, .L8025A598
/* 188E4C 8025A56C 0080182D */ daddu $v1, $a0, $zero
/* 188E50 8025A570 0040202D */ daddu $a0, $v0, $zero
.L8025A574:
/* 188E54 8025A574 920206CD */ lbu $v0, 0x6CD($s0)
/* 188E58 8025A578 24420001 */ addiu $v0, $v0, 0x1
/* 188E5C 8025A57C A20206CD */ sb $v0, 0x6CD($s0)
/* 188E60 8025A580 00021600 */ sll $v0, $v0, 24
/* 188E64 8025A584 00021583 */ sra $v0, $v0, 22
/* 188E68 8025A588 00431021 */ addu $v0, $v0, $v1
/* 188E6C 8025A58C 8C420000 */ lw $v0, 0x0($v0)
/* 188E70 8025A590 1444FFF8 */ bne $v0, $a0, .L8025A574
/* 188E74 8025A594 00000000 */ nop
.L8025A598:
/* 188E78 8025A598 0809697E */ j .L8025A5F8
/* 188E7C 8025A59C 24020006 */ addiu $v0, $zero, 0x6
.L8025A5A0:
/* 188E80 8025A5A0 96240088 */ lhu $a0, 0x88($s1)
/* 188E84 8025A5A4 0C0B7A90 */ jal spr_get_npc_palettes
/* 188E88 8025A5A8 00000000 */ nop
/* 188E8C 8025A5AC AE0206D0 */ sw $v0, 0x6D0($s0)
/* 188E90 8025A5B0 0040202D */ daddu $a0, $v0, $zero
/* 188E94 8025A5B4 A20006CD */ sb $zero, 0x6CD($s0)
/* 188E98 8025A5B8 8C830000 */ lw $v1, 0x0($a0)
/* 188E9C 8025A5BC 2402FFFF */ addiu $v0, $zero, -0x1
/* 188EA0 8025A5C0 1062000B */ beq $v1, $v0, .L8025A5F0
/* 188EA4 8025A5C4 0080182D */ daddu $v1, $a0, $zero
/* 188EA8 8025A5C8 0040202D */ daddu $a0, $v0, $zero
.L8025A5CC:
/* 188EAC 8025A5CC 920206CD */ lbu $v0, 0x6CD($s0)
/* 188EB0 8025A5D0 24420001 */ addiu $v0, $v0, 0x1
/* 188EB4 8025A5D4 A20206CD */ sb $v0, 0x6CD($s0)
/* 188EB8 8025A5D8 00021600 */ sll $v0, $v0, 24
/* 188EBC 8025A5DC 00021583 */ sra $v0, $v0, 22
/* 188EC0 8025A5E0 00431021 */ addu $v0, $v0, $v1
/* 188EC4 8025A5E4 8C420000 */ lw $v0, 0x0($v0)
/* 188EC8 8025A5E8 1444FFF8 */ bne $v0, $a0, .L8025A5CC
/* 188ECC 8025A5EC 00000000 */ nop
.L8025A5F0:
/* 188ED0 8025A5F0 0C0B7A9B */ jal spr_get_npc_color_variations
/* 188ED4 8025A5F4 96240088 */ lhu $a0, 0x88($s1)
.L8025A5F8:
/* 188ED8 8025A5F8 A20206CC */ sb $v0, 0x6CC($s0)
/* 188EDC 8025A5FC A20006C2 */ sb $zero, 0x6C2($s0)
/* 188EE0 8025A600 A60006CA */ sh $zero, 0x6CA($s0)
/* 188EE4 8025A604 A20006C1 */ sb $zero, 0x6C1($s0)
.L8025A608:
/* 188EE8 8025A608 820206CD */ lb $v0, 0x6CD($s0)
/* 188EEC 8025A60C 18400015 */ blez $v0, .L8025A664
/* 188EF0 8025A610 0000302D */ daddu $a2, $zero, $zero
.L8025A614:
/* 188EF4 8025A614 8E0206D0 */ lw $v0, 0x6D0($s0)
/* 188EF8 8025A618 00061880 */ sll $v1, $a2, 2
/* 188EFC 8025A61C 00621821 */ addu $v1, $v1, $v0
/* 188F00 8025A620 00061140 */ sll $v0, $a2, 5
/* 188F04 8025A624 8C630000 */ lw $v1, 0x0($v1)
/* 188F08 8025A628 10600009 */ beqz $v1, .L8025A650
/* 188F0C 8025A62C 02022821 */ addu $a1, $s0, $v0
/* 188F10 8025A630 0000202D */ daddu $a0, $zero, $zero
.L8025A634:
/* 188F14 8025A634 94620000 */ lhu $v0, 0x0($v1)
/* 188F18 8025A638 24630002 */ addiu $v1, $v1, 0x2
/* 188F1C 8025A63C 24840001 */ addiu $a0, $a0, 0x1
/* 188F20 8025A640 A4A20000 */ sh $v0, 0x0($a1)
/* 188F24 8025A644 28820010 */ slti $v0, $a0, 0x10
/* 188F28 8025A648 1440FFFA */ bnez $v0, .L8025A634
/* 188F2C 8025A64C 24A50002 */ addiu $a1, $a1, 0x2
.L8025A650:
/* 188F30 8025A650 820206CD */ lb $v0, 0x6CD($s0)
/* 188F34 8025A654 24C60001 */ addiu $a2, $a2, 0x1
/* 188F38 8025A658 00C2102A */ slt $v0, $a2, $v0
/* 188F3C 8025A65C 1440FFED */ bnez $v0, .L8025A614
/* 188F40 8025A660 00000000 */ nop
.L8025A664:
/* 188F44 8025A664 820206CC */ lb $v0, 0x6CC($s0)
/* 188F48 8025A668 920306CC */ lbu $v1, 0x6CC($s0)
/* 188F4C 8025A66C 18400019 */ blez $v0, .L8025A6D4
/* 188F50 8025A670 0000302D */ daddu $a2, $zero, $zero
/* 188F54 8025A674 00031600 */ sll $v0, $v1, 24
.L8025A678:
/* 188F58 8025A678 00021603 */ sra $v0, $v0, 24
/* 188F5C 8025A67C 00461021 */ addu $v0, $v0, $a2
/* 188F60 8025A680 8E0306D0 */ lw $v1, 0x6D0($s0)
/* 188F64 8025A684 00021080 */ sll $v0, $v0, 2
/* 188F68 8025A688 00431021 */ addu $v0, $v0, $v1
/* 188F6C 8025A68C 8C430000 */ lw $v1, 0x0($v0)
/* 188F70 8025A690 00061140 */ sll $v0, $a2, 5
/* 188F74 8025A694 10600009 */ beqz $v1, .L8025A6BC
/* 188F78 8025A698 02022821 */ addu $a1, $s0, $v0
/* 188F7C 8025A69C 0000202D */ daddu $a0, $zero, $zero
.L8025A6A0:
/* 188F80 8025A6A0 94620000 */ lhu $v0, 0x0($v1)
/* 188F84 8025A6A4 24630002 */ addiu $v1, $v1, 0x2
/* 188F88 8025A6A8 24840001 */ addiu $a0, $a0, 0x1
/* 188F8C 8025A6AC A4A20000 */ sh $v0, 0x0($a1)
/* 188F90 8025A6B0 28820010 */ slti $v0, $a0, 0x10
/* 188F94 8025A6B4 1440FFFA */ bnez $v0, .L8025A6A0
/* 188F98 8025A6B8 24A50002 */ addiu $a1, $a1, 0x2
.L8025A6BC:
/* 188F9C 8025A6BC 24C60001 */ addiu $a2, $a2, 0x1
/* 188FA0 8025A6C0 820206CC */ lb $v0, 0x6CC($s0)
/* 188FA4 8025A6C4 920306CC */ lbu $v1, 0x6CC($s0)
/* 188FA8 8025A6C8 00C2102A */ slt $v0, $a2, $v0
/* 188FAC 8025A6CC 1440FFEA */ bnez $v0, .L8025A678
/* 188FB0 8025A6D0 00031600 */ sll $v0, $v1, 24
.L8025A6D4:
/* 188FB4 8025A6D4 820206CD */ lb $v0, 0x6CD($s0)
/* 188FB8 8025A6D8 1840000A */ blez $v0, .L8025A704
/* 188FBC 8025A6DC 0000302D */ daddu $a2, $zero, $zero
/* 188FC0 8025A6E0 0200202D */ daddu $a0, $s0, $zero
/* 188FC4 8025A6E4 0200182D */ daddu $v1, $s0, $zero
.L8025A6E8:
/* 188FC8 8025A6E8 AC6406D4 */ sw $a0, 0x6D4($v1)
/* 188FCC 8025A6EC 24840020 */ addiu $a0, $a0, 0x20
/* 188FD0 8025A6F0 820206CD */ lb $v0, 0x6CD($s0)
/* 188FD4 8025A6F4 24C60001 */ addiu $a2, $a2, 0x1
/* 188FD8 8025A6F8 00C2102A */ slt $v0, $a2, $v0
/* 188FDC 8025A6FC 1440FFFA */ bnez $v0, .L8025A6E8
/* 188FE0 8025A700 24630004 */ addiu $v1, $v1, 0x4
.L8025A704:
/* 188FE4 8025A704 16400006 */ bnez $s2, .L8025A720
/* 188FE8 8025A708 0220202D */ daddu $a0, $s1, $zero
/* 188FEC 8025A70C 0260282D */ daddu $a1, $s3, $zero
/* 188FF0 8025A710 0C096657 */ jal func_8025995C
/* 188FF4 8025A714 0280302D */ daddu $a2, $s4, $zero
/* 188FF8 8025A718 080969CB */ j .L8025A72C
/* 188FFC 8025A71C 00000000 */ nop
.L8025A720:
/* 189000 8025A720 0260282D */ daddu $a1, $s3, $zero
/* 189004 8025A724 0C0965B0 */ jal func_802596C0
/* 189008 8025A728 0280302D */ daddu $a2, $s4, $zero
.L8025A72C:
/* 18900C 8025A72C 8FBF0024 */ lw $ra, 0x24($sp)
/* 189010 8025A730 8FB40020 */ lw $s4, 0x20($sp)
/* 189014 8025A734 8FB3001C */ lw $s3, 0x1C($sp)
/* 189018 8025A738 8FB20018 */ lw $s2, 0x18($sp)
/* 18901C 8025A73C 8FB10014 */ lw $s1, 0x14($sp)
/* 189020 8025A740 8FB00010 */ lw $s0, 0x10($sp)
/* 189024 8025A744 03E00008 */ jr $ra
/* 189028 8025A748 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void render_with_poison_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, b32 skipAnimation) {
DecorationTable* decorationTable = part->decorationTable;
PAL_PTR palIn;
PAL_PTR palOut;
s32 i, j;
if (decorationTable->resetPalAdjust) {
if (isNpcSprite == SPRITE_MODE_PLAYER) {
decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16);
decorationTable->originalPalettesCount = 0;
while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) {
decorationTable->originalPalettesCount++;
}
decorationTable->spriteColorVariations = SPR_PLAYER_COLOR_VARIATIONS;
} else {
decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16);
decorationTable->originalPalettesCount = 0;
while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) {
decorationTable->originalPalettesCount++;
}
decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->currentAnimation >> 16);
}
decorationTable->palAnimState = 0;
decorationTable->palBlendAlpha = 0;
decorationTable->resetPalAdjust = FALSE;
}
for (i = 0; i < decorationTable->originalPalettesCount; i++) {
palIn = decorationTable->originalPalettesList[i];
palOut = decorationTable->copiedPalettes[0][i];
if (palIn != NULL) {
for (j = 0; j < SPR_PAL_SIZE; j++) {
*palOut++ = *palIn++;
}
}
}
for (i = 0; i < decorationTable->spriteColorVariations; i++) {
palIn = decorationTable->originalPalettesList[decorationTable->spriteColorVariations + i];
palOut = decorationTable->copiedPalettes[0][i];
if (palIn != NULL) {
for (j = 0; j < SPR_PAL_SIZE; j++) {
*palOut++ = *palIn++;
}
}
}
for (i = 0; i < decorationTable->originalPalettesCount; i++) {
decorationTable->adjustedPalettes[i] = decorationTable->copiedPalettes[0][i];
}
if (isNpcSprite == SPRITE_MODE_PLAYER) {
func_8025995C(part, yaw, mtx);
} else {
func_802596C0(part, yaw, mtx);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel title_screen_draw_copyright
/* 13214 80037E14 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 13218 80037E18 3C07800A */ lui $a3, %hi(gMainGfxPos)
/* 1321C 80037E1C 24E7A66C */ addiu $a3, $a3, %lo(gMainGfxPos)
/* 13220 80037E20 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 13224 80037E24 AFB7001C */ sw $s7, 0x1C($sp)
/* 13228 80037E28 AFB60018 */ sw $s6, 0x18($sp)
/* 1322C 80037E2C AFB50014 */ sw $s5, 0x14($sp)
/* 13230 80037E30 AFB40010 */ sw $s4, 0x10($sp)
/* 13234 80037E34 AFB3000C */ sw $s3, 0xC($sp)
/* 13238 80037E38 AFB20008 */ sw $s2, 0x8($sp)
/* 1323C 80037E3C AFB10004 */ sw $s1, 0x4($sp)
/* 13240 80037E40 AFB00000 */ sw $s0, 0x0($sp)
/* 13244 80037E44 8CE50000 */ lw $a1, 0x0($a3)
/* 13248 80037E48 3C01437F */ lui $at, (0x437F0000 >> 16)
/* 1324C 80037E4C 44810000 */ mtc1 $at, $f0
/* 13250 80037E50 00A0182D */ daddu $v1, $a1, $zero
/* 13254 80037E54 24A50008 */ addiu $a1, $a1, 0x8
/* 13258 80037E58 ACE50000 */ sw $a1, 0x0($a3)
/* 1325C 80037E5C AC620000 */ sw $v0, 0x0($v1)
/* 13260 80037E60 3C028007 */ lui $v0, %hi(D_80077A50)
/* 13264 80037E64 24427A50 */ addiu $v0, $v0, %lo(D_80077A50)
/* 13268 80037E68 46006302 */ mul.s $f12, $f12, $f0
/* 1326C 80037E6C 00000000 */ nop
/* 13270 80037E70 AC620004 */ sw $v0, 0x4($v1)
/* 13274 80037E74 24A20008 */ addiu $v0, $a1, 0x8
/* 13278 80037E78 ACE20000 */ sw $v0, 0x0($a3)
/* 1327C 80037E7C 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 13280 80037E80 460C0001 */ sub.s $f0, $f0, $f12
/* 13284 80037E84 ACA20000 */ sw $v0, 0x0($a1)
/* 13288 80037E88 4600008D */ trunc.w.s $f2, $f0
/* 1328C 80037E8C 44061000 */ mfc1 $a2, $f2
/* 13290 80037E90 00000000 */ nop
/* 13294 80037E94 28C200FF */ slti $v0, $a2, 0xFF
/* 13298 80037E98 10400011 */ beqz $v0, .L80037EE0
/* 1329C 80037E9C ACA00004 */ sw $zero, 0x4($a1)
/* 132A0 80037EA0 04C20001 */ bltzl $a2, .L80037EA8
/* 132A4 80037EA4 0000302D */ daddu $a2, $zero, $zero
.L80037EA8:
/* 132A8 80037EA8 3C04FCFF */ lui $a0, (0xFCFF97FF >> 16)
/* 132AC 80037EAC 348497FF */ ori $a0, $a0, (0xFCFF97FF & 0xFFFF)
/* 132B0 80037EB0 3C03FF2C */ lui $v1, (0xFF2CFE7F >> 16)
/* 132B4 80037EB4 3463FE7F */ ori $v1, $v1, (0xFF2CFE7F & 0xFFFF)
/* 132B8 80037EB8 24A20010 */ addiu $v0, $a1, 0x10
/* 132BC 80037EBC ACE20000 */ sw $v0, 0x0($a3)
/* 132C0 80037EC0 24A20018 */ addiu $v0, $a1, 0x18
/* 132C4 80037EC4 ACA40008 */ sw $a0, 0x8($a1)
/* 132C8 80037EC8 ACA3000C */ sw $v1, 0xC($a1)
/* 132CC 80037ECC ACE20000 */ sw $v0, 0x0($a3)
/* 132D0 80037ED0 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 132D4 80037ED4 ACA20010 */ sw $v0, 0x10($a1)
/* 132D8 80037ED8 30C200FF */ andi $v0, $a2, 0xFF
/* 132DC 80037EDC ACA20014 */ sw $v0, 0x14($a1)
.L80037EE0:
/* 132E0 80037EE0 0000602D */ daddu $t4, $zero, $zero
/* 132E4 80037EE4 3C08800A */ lui $t0, %hi(gMainGfxPos)
/* 132E8 80037EE8 2508A66C */ addiu $t0, $t0, %lo(gMainGfxPos)
/* 132EC 80037EEC 3C10FD68 */ lui $s0, (0xFD68008F >> 16)
/* 132F0 80037EF0 3610008F */ ori $s0, $s0, (0xFD68008F & 0xFFFF)
/* 132F4 80037EF4 3C16800A */ lui $s6, %hi(TitleScreen_ImgList_Copyright)
/* 132F8 80037EF8 26D6097C */ addiu $s6, $s6, %lo(TitleScreen_ImgList_Copyright)
/* 132FC 80037EFC 3C0DF568 */ lui $t5, (0xF5682400 >> 16)
/* 13300 80037F00 35AD2400 */ ori $t5, $t5, (0xF5682400 & 0xFFFF)
/* 13304 80037F04 3C150700 */ lui $s5, (0x7000000 >> 16)
/* 13308 80037F08 3C14E600 */ lui $s4, (0xE6000000 >> 16)
/* 1330C 80037F0C 3C13F400 */ lui $s3, (0xF4000000 >> 16)
/* 13310 80037F10 3C190723 */ lui $t9, (0x723C03C >> 16)
/* 13314 80037F14 3739C03C */ ori $t9, $t9, (0x723C03C & 0xFFFF)
/* 13318 80037F18 3C12E700 */ lui $s2, (0xE7000000 >> 16)
/* 1331C 80037F1C 3C11F200 */ lui $s1, (0xF2000000 >> 16)
/* 13320 80037F20 3C180023 */ lui $t8, (0x23C03C >> 16)
/* 13324 80037F24 3718C03C */ ori $t8, $t8, (0x23C03C & 0xFFFF)
/* 13328 80037F28 3C0FE43A */ lui $t7, (0xE43A4000 >> 16)
/* 1332C 80037F2C 35EF4000 */ ori $t7, $t7, (0xE43A4000 & 0xFFFF)
/* 13330 80037F30 3C0E0016 */ lui $t6, (0x164000 >> 16)
/* 13334 80037F34 35CE4000 */ ori $t6, $t6, (0x164000 & 0xFFFF)
/* 13338 80037F38 240B02FC */ addiu $t3, $zero, 0x2FC
/* 1333C 80037F3C 240A033C */ addiu $t2, $zero, 0x33C
/* 13340 80037F40 0180482D */ daddu $t1, $t4, $zero
.L80037F44:
/* 13344 80037F44 3C070400 */ lui $a3, (0x4000400 >> 16)
/* 13348 80037F48 34E70400 */ ori $a3, $a3, (0x4000400 & 0xFFFF)
/* 1334C 80037F4C 31660FFF */ andi $a2, $t3, 0xFFF
/* 13350 80037F50 256B0040 */ addiu $t3, $t3, 0x40
/* 13354 80037F54 31450FFF */ andi $a1, $t2, 0xFFF
/* 13358 80037F58 254A0040 */ addiu $t2, $t2, 0x40
/* 1335C 80037F5C 258C0001 */ addiu $t4, $t4, 0x1
/* 13360 80037F60 00AF2825 */ or $a1, $a1, $t7
/* 13364 80037F64 00CE3025 */ or $a2, $a2, $t6
/* 13368 80037F68 8D030000 */ lw $v1, 0x0($t0)
/* 1336C 80037F6C 8EC20000 */ lw $v0, 0x0($s6)
/* 13370 80037F70 0060202D */ daddu $a0, $v1, $zero
/* 13374 80037F74 24630008 */ addiu $v1, $v1, 0x8
/* 13378 80037F78 00491021 */ addu $v0, $v0, $t1
/* 1337C 80037F7C 25290900 */ addiu $t1, $t1, 0x900
/* 13380 80037F80 AD030000 */ sw $v1, 0x0($t0)
/* 13384 80037F84 AC820004 */ sw $v0, 0x4($a0)
/* 13388 80037F88 24620008 */ addiu $v0, $v1, 0x8
/* 1338C 80037F8C AC900000 */ sw $s0, 0x0($a0)
/* 13390 80037F90 AD020000 */ sw $v0, 0x0($t0)
/* 13394 80037F94 24620010 */ addiu $v0, $v1, 0x10
/* 13398 80037F98 AC6D0000 */ sw $t5, 0x0($v1)
/* 1339C 80037F9C AC750004 */ sw $s5, 0x4($v1)
/* 133A0 80037FA0 AD020000 */ sw $v0, 0x0($t0)
/* 133A4 80037FA4 24620018 */ addiu $v0, $v1, 0x18
/* 133A8 80037FA8 AC740008 */ sw $s4, 0x8($v1)
/* 133AC 80037FAC AC60000C */ sw $zero, 0xC($v1)
/* 133B0 80037FB0 AD020000 */ sw $v0, 0x0($t0)
/* 133B4 80037FB4 24620020 */ addiu $v0, $v1, 0x20
/* 133B8 80037FB8 AC730010 */ sw $s3, 0x10($v1)
/* 133BC 80037FBC AC790014 */ sw $t9, 0x14($v1)
/* 133C0 80037FC0 AD020000 */ sw $v0, 0x0($t0)
/* 133C4 80037FC4 24620028 */ addiu $v0, $v1, 0x28
/* 133C8 80037FC8 AC720018 */ sw $s2, 0x18($v1)
/* 133CC 80037FCC AC60001C */ sw $zero, 0x1C($v1)
/* 133D0 80037FD0 AD020000 */ sw $v0, 0x0($t0)
/* 133D4 80037FD4 24620030 */ addiu $v0, $v1, 0x30
/* 133D8 80037FD8 AC6D0020 */ sw $t5, 0x20($v1)
/* 133DC 80037FDC AC600024 */ sw $zero, 0x24($v1)
/* 133E0 80037FE0 AD020000 */ sw $v0, 0x0($t0)
/* 133E4 80037FE4 24620038 */ addiu $v0, $v1, 0x38
/* 133E8 80037FE8 AC710028 */ sw $s1, 0x28($v1)
/* 133EC 80037FEC AC78002C */ sw $t8, 0x2C($v1)
/* 133F0 80037FF0 AD020000 */ sw $v0, 0x0($t0)
/* 133F4 80037FF4 24620040 */ addiu $v0, $v1, 0x40
/* 133F8 80037FF8 AC650030 */ sw $a1, 0x30($v1)
/* 133FC 80037FFC AC660034 */ sw $a2, 0x34($v1)
/* 13400 80038000 AD020000 */ sw $v0, 0x0($t0)
/* 13404 80038004 3C02E100 */ lui $v0, (0xE1000000 >> 16)
/* 13408 80038008 AC620038 */ sw $v0, 0x38($v1)
/* 1340C 8003800C 24620048 */ addiu $v0, $v1, 0x48
/* 13410 80038010 AC60003C */ sw $zero, 0x3C($v1)
/* 13414 80038014 AD020000 */ sw $v0, 0x0($t0)
/* 13418 80038018 3C02F100 */ lui $v0, (0xF1000000 >> 16)
/* 1341C 8003801C AC620040 */ sw $v0, 0x40($v1)
/* 13420 80038020 29820002 */ slti $v0, $t4, 0x2
/* 13424 80038024 1440FFC7 */ bnez $v0, .L80037F44
/* 13428 80038028 AC670044 */ sw $a3, 0x44($v1)
/* 1342C 8003802C 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 13430 80038030 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 13434 80038034 8C620000 */ lw $v0, 0x0($v1)
/* 13438 80038038 0040202D */ daddu $a0, $v0, $zero
/* 1343C 8003803C 24420008 */ addiu $v0, $v0, 0x8
/* 13440 80038040 AC620000 */ sw $v0, 0x0($v1)
/* 13444 80038044 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 13448 80038048 AC820000 */ sw $v0, 0x0($a0)
/* 1344C 8003804C AC800004 */ sw $zero, 0x4($a0)
/* 13450 80038050 8FB7001C */ lw $s7, 0x1C($sp)
/* 13454 80038054 8FB60018 */ lw $s6, 0x18($sp)
/* 13458 80038058 8FB50014 */ lw $s5, 0x14($sp)
/* 1345C 8003805C 8FB40010 */ lw $s4, 0x10($sp)
/* 13460 80038060 8FB3000C */ lw $s3, 0xC($sp)
/* 13464 80038064 8FB20008 */ lw $s2, 0x8($sp)
/* 13468 80038068 8FB10004 */ lw $s1, 0x4($sp)
/* 1346C 8003806C 8FB00000 */ lw $s0, 0x0($sp)
/* 13470 80038070 03E00008 */ jr $ra
/* 13474 80038074 27BD0020 */ addiu $sp, $sp, 0x20
/* 13478 80038078 00000000 */ nop
/* 1347C 8003807C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void title_screen_draw_copyright(f32 arg0) {
s32 alpha;
s32 i;
gSPDisplayList(gMainGfxPos++, &D_80077A50);
#if VERSION_JP
gDPSetTextureLUT(gMainGfxPos++, G_TT_RGBA16);
#endif
gDPPipeSync(gMainGfxPos++);
alpha = 255.0f - (arg0 * 255.0f);
if (alpha < 255) {
if (alpha < 0) {
alpha = 0;
}
gDPSetCombineMode(gMainGfxPos++, PM_CC_02, PM_CC_02);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
}
#if VERSION_JP
gDPLoadTLUT_pal16(gMainGfxPos++, 0, TitleScreen_ImgList_CopyrightPalette);
gDPLoadTextureTile_4b(gMainGfxPos++, TitleScreen_ImgList_Copyright, G_IM_FMT_CI,
COPYRIGHT_WIDTH, 0, 0, 0, 127, 31, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPTextureRectangle(gMainGfxPos++, 388, YL_BASE, 900, 892, G_TX_RENDERTILE,
0, 0, 0x0400, 0x0400);
#else
for (i = 0; i < COPYRIGHT_TEX_CHUNKS; i++) {
s32 k = 10 * i;
alpha = 0; // TODO figure out why this is needed
gDPLoadTextureTile(gMainGfxPos++, COPYRIGHT_IMG(k, i), G_IM_FMT_IA, G_IM_SIZ_8b,
COPYRIGHT_WIDTH, 32, 0, 0, 143, LTT_LRT, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPTextureRectangle(gMainGfxPos++, 356, YL_BASE + (RECT_SIZE * i), 932, YH_BASE + (RECT_SIZE * i),
G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
}
#endif
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel ShowKeyChoicePopup
/* FADD0 802D6420 27BDFFD8 */ addiu $sp, $sp, -0x28
/* FADD4 802D6424 AFB00010 */ sw $s0, 0x10($sp)
/* FADD8 802D6428 0080802D */ daddu $s0, $a0, $zero
/* FADDC 802D642C AFB3001C */ sw $s3, 0x1C($sp)
/* FADE0 802D6430 3C138011 */ lui $s3, %hi(gPlayerData)
/* FADE4 802D6434 2673F290 */ addiu $s3, $s3, %lo(gPlayerData)
/* FADE8 802D6438 AFB10014 */ sw $s1, 0x14($sp)
/* FADEC 802D643C 3C11802E */ lui $s1, %hi(D_802DB830)
/* FADF0 802D6440 2631B830 */ addiu $s1, $s1, %lo(D_802DB830)
/* FADF4 802D6444 AFBF0020 */ sw $ra, 0x20($sp)
/* FADF8 802D6448 AFB20018 */ sw $s2, 0x18($sp)
/* FADFC 802D644C 8E12014C */ lw $s2, 0x14C($s0)
/* FAE00 802D6450 54A00001 */ bnel $a1, $zero, .L802D6458
/* FAE04 802D6454 AE000070 */ sw $zero, 0x70($s0)
.L802D6458:
/* FAE08 802D6458 8E030070 */ lw $v1, 0x70($s0)
/* FAE0C 802D645C 10600005 */ beqz $v1, .L802D6474
/* FAE10 802D6460 24020001 */ addiu $v0, $zero, 0x1
/* FAE14 802D6464 1062004B */ beq $v1, $v0, .L802D6594
/* FAE18 802D6468 0000102D */ daddu $v0, $zero, $zero
/* FAE1C 802D646C 080B5988 */ j .L802D6620
/* FAE20 802D6470 00000000 */ nop
.L802D6474:
/* FAE24 802D6474 0C03805E */ jal disable_player_input
/* FAE28 802D6478 00000000 */ nop
/* FAE2C 802D647C 0C038045 */ jal disable_player_static_collisions
/* FAE30 802D6480 00000000 */ nop
/* FAE34 802D6484 0C03BD8A */ jal partner_disable_input
/* FAE38 802D6488 00000000 */ nop
/* FAE3C 802D648C 0C03A5EE */ jal close_status_bar
/* FAE40 802D6490 00000000 */ nop
/* FAE44 802D6494 0000482D */ daddu $t1, $zero, $zero
/* FAE48 802D6498 0120402D */ daddu $t0, $t1, $zero
/* FAE4C 802D649C 3C0C8008 */ lui $t4, %hi(gItemTable)
/* FAE50 802D64A0 258C78E0 */ addiu $t4, $t4, %lo(gItemTable)
/* FAE54 802D64A4 3C0B8009 */ lui $t3, %hi(gItemHudScripts)
/* FAE58 802D64A8 256BA680 */ addiu $t3, $t3, %lo(gItemHudScripts)
/* FAE5C 802D64AC 240A0001 */ addiu $t2, $zero, 0x1
/* FAE60 802D64B0 0260382D */ daddu $a3, $s3, $zero
/* FAE64 802D64B4 3C03800A */ lui $v1, %hi(gOverrideFlags)
/* FAE68 802D64B8 2463A650 */ addiu $v1, $v1, %lo(gOverrideFlags)
/* FAE6C 802D64BC 8C620000 */ lw $v0, 0x0($v1)
/* FAE70 802D64C0 0220302D */ daddu $a2, $s1, $zero
/* FAE74 802D64C4 34420040 */ ori $v0, $v0, 0x40
/* FAE78 802D64C8 AC620000 */ sw $v0, 0x0($v1)
.L802D64CC:
/* FAE7C 802D64CC 84E40074 */ lh $a0, 0x74($a3)
/* FAE80 802D64D0 5080001F */ beql $a0, $zero, .L802D6550
/* FAE84 802D64D4 25080001 */ addiu $t0, $t0, 0x1
/* FAE88 802D64D8 8E430028 */ lw $v1, 0x28($s2)
/* FAE8C 802D64DC 8C620000 */ lw $v0, 0x0($v1)
/* FAE90 802D64E0 18400008 */ blez $v0, .L802D6504
/* FAE94 802D64E4 0000282D */ daddu $a1, $zero, $zero
.L802D64E8:
/* FAE98 802D64E8 54820003 */ bnel $a0, $v0, .L802D64F8
/* FAE9C 802D64EC 24630004 */ addiu $v1, $v1, 0x4
/* FAEA0 802D64F0 080B5941 */ j .L802D6504
/* FAEA4 802D64F4 24050001 */ addiu $a1, $zero, 0x1
.L802D64F8:
/* FAEA8 802D64F8 8C620000 */ lw $v0, 0x0($v1)
/* FAEAC 802D64FC 1C40FFFA */ bgtz $v0, .L802D64E8
/* FAEB0 802D6500 00000000 */ nop
.L802D6504:
/* FAEB4 802D6504 50A00012 */ beql $a1, $zero, .L802D6550
/* FAEB8 802D6508 25080001 */ addiu $t0, $t0, 0x1
/* FAEBC 802D650C 84E30074 */ lh $v1, 0x74($a3)
/* FAEC0 802D6510 00031940 */ sll $v1, $v1, 5
/* FAEC4 802D6514 006C1821 */ addu $v1, $v1, $t4
/* FAEC8 802D6518 84620004 */ lh $v0, 0x4($v1)
/* FAECC 802D651C 000210C0 */ sll $v0, $v0, 3
/* FAED0 802D6520 004B1021 */ addu $v0, $v0, $t3
/* FAED4 802D6524 8C420000 */ lw $v0, 0x0($v0)
/* FAED8 802D6528 ACC80108 */ sw $t0, 0x108($a2)
/* FAEDC 802D652C ACCA018C */ sw $t2, 0x18C($a2)
/* FAEE0 802D6530 ACC20000 */ sw $v0, 0x0($a2)
/* FAEE4 802D6534 8C620000 */ lw $v0, 0x0($v1)
/* FAEE8 802D6538 ACC20084 */ sw $v0, 0x84($a2)
/* FAEEC 802D653C 8C620014 */ lw $v0, 0x14($v1)
/* FAEF0 802D6540 25290001 */ addiu $t1, $t1, 0x1
/* FAEF4 802D6544 ACC20294 */ sw $v0, 0x294($a2)
/* FAEF8 802D6548 24C60004 */ addiu $a2, $a2, 0x4
/* FAEFC 802D654C 25080001 */ addiu $t0, $t0, 0x1
.L802D6550:
/* FAF00 802D6550 29020020 */ slti $v0, $t0, 0x20
/* FAF04 802D6554 1440FFDD */ bnez $v0, .L802D64CC
/* FAF08 802D6558 24E70002 */ addiu $a3, $a3, 0x2
/* FAF0C 802D655C 15200004 */ bnez $t1, .L802D6570
/* FAF10 802D6560 2402000C */ addiu $v0, $zero, 0xC
/* FAF14 802D6564 AE000084 */ sw $zero, 0x84($s0)
/* FAF18 802D6568 080B5988 */ j .L802D6620
/* FAF1C 802D656C 24020001 */ addiu $v0, $zero, 0x1
.L802D6570:
/* FAF20 802D6570 0220202D */ daddu $a0, $s1, $zero
/* FAF24 802D6574 AE220318 */ sw $v0, 0x318($s1)
/* FAF28 802D6578 AE290324 */ sw $t1, 0x324($s1)
/* FAF2C 802D657C 0C03D390 */ jal create_standard_popup_menu
/* FAF30 802D6580 AE200328 */ sw $zero, 0x328($s1)
/* FAF34 802D6584 24020001 */ addiu $v0, $zero, 0x1
/* FAF38 802D6588 AE000074 */ sw $zero, 0x74($s0)
/* FAF3C 802D658C 080B5987 */ j .L802D661C
/* FAF40 802D6590 AE020070 */ sw $v0, 0x70($s0)
.L802D6594:
/* FAF44 802D6594 8E020074 */ lw $v0, 0x74($s0)
/* FAF48 802D6598 14400008 */ bnez $v0, .L802D65BC
/* FAF4C 802D659C 24420001 */ addiu $v0, $v0, 0x1
/* FAF50 802D65A0 8622032C */ lh $v0, 0x32C($s1)
/* FAF54 802D65A4 1040001D */ beqz $v0, .L802D661C
/* FAF58 802D65A8 AE020078 */ sw $v0, 0x78($s0)
/* FAF5C 802D65AC 0C03C4EC */ jal hide_popup_menu
/* FAF60 802D65B0 00000000 */ nop
/* FAF64 802D65B4 8E020074 */ lw $v0, 0x74($s0)
/* FAF68 802D65B8 24420001 */ addiu $v0, $v0, 0x1
.L802D65BC:
/* FAF6C 802D65BC AE020074 */ sw $v0, 0x74($s0)
/* FAF70 802D65C0 2842000F */ slti $v0, $v0, 0xF
/* FAF74 802D65C4 14400016 */ bnez $v0, .L802D6620
/* FAF78 802D65C8 0000102D */ daddu $v0, $zero, $zero
/* FAF7C 802D65CC 0C03C54E */ jal destroy_popup_menu
/* FAF80 802D65D0 00000000 */ nop
/* FAF84 802D65D4 8E030078 */ lw $v1, 0x78($s0)
/* FAF88 802D65D8 240200FF */ addiu $v0, $zero, 0xFF
/* FAF8C 802D65DC 54620005 */ bnel $v1, $v0, .L802D65F4
/* FAF90 802D65E0 2462FFFF */ addiu $v0, $v1, -0x1
/* FAF94 802D65E4 2402FFFF */ addiu $v0, $zero, -0x1
/* FAF98 802D65E8 AE020084 */ sw $v0, 0x84($s0)
/* FAF9C 802D65EC 080B5988 */ j .L802D6620
/* FAFA0 802D65F0 24020001 */ addiu $v0, $zero, 0x1
.L802D65F4:
/* FAFA4 802D65F4 00021080 */ sll $v0, $v0, 2
/* FAFA8 802D65F8 00511021 */ addu $v0, $v0, $s1
/* FAFAC 802D65FC 8C430108 */ lw $v1, 0x108($v0)
/* FAFB0 802D6600 00031040 */ sll $v0, $v1, 1
/* FAFB4 802D6604 00531021 */ addu $v0, $v0, $s3
/* FAFB8 802D6608 AE030088 */ sw $v1, 0x88($s0)
/* FAFBC 802D660C 84430074 */ lh $v1, 0x74($v0)
/* FAFC0 802D6610 24020001 */ addiu $v0, $zero, 0x1
/* FAFC4 802D6614 080B5988 */ j .L802D6620
/* FAFC8 802D6618 AE030084 */ sw $v1, 0x84($s0)
.L802D661C:
/* FAFCC 802D661C 0000102D */ daddu $v0, $zero, $zero
.L802D6620:
/* FAFD0 802D6620 8FBF0020 */ lw $ra, 0x20($sp)
/* FAFD4 802D6624 8FB3001C */ lw $s3, 0x1C($sp)
/* FAFD8 802D6628 8FB20018 */ lw $s2, 0x18($sp)
/* FAFDC 802D662C 8FB10014 */ lw $s1, 0x14($sp)
/* FAFE0 802D6630 8FB00010 */ lw $s0, 0x10($sp)
/* FAFE4 802D6634 03E00008 */ jr $ra
/* FAFE8 802D6638 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
ApiStatus ShowKeyChoicePopup(Evt* script, s32 isInitialCall) {
PlayerData* playerData = &gPlayerData;
PopupMenu* menu = &D_802DB830;
Trigger* trigger = script->owner2.trigger;
s32 numEntries;
s32 t; // TODO required in both places to match
s32 i;
if (isInitialCall) {
script->functionTemp[0] = 0;
}
t = script->functionTemp[0];
switch (t) {
case 0:
disable_player_input();
disable_player_static_collisions();
partner_disable_input();
close_status_bar();
numEntries = 0;
gOverrideFlags |= GLOBAL_OVERRIDES_40;
for (i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
s16 invItem = playerData->keyItems[i];
if (invItem != ITEM_NONE) {
s32 found = FALSE;
s32* itemIt = trigger->itemList;
while (*itemIt > 0) {
if (invItem == *itemIt) {
found = TRUE;
break;
}
itemIt++;
}
if (found) {
ItemData* item = &gItemTable[playerData->keyItems[i]];
menu->ptrIcon[numEntries] = gItemHudScripts[item->hudElemID].enabled;
menu->userIndex[numEntries] = i;
menu->enabled[numEntries] = TRUE;
menu->nameMsg[numEntries] = item->nameMsg;
menu->descMsg[numEntries] = item->shortDescMsg;
numEntries++;
}
}
}
if (numEntries == 0) {
script->varTable[0] = 0;
return ApiStatus_DONE1;
}
menu->popupType = POPUP_MENU_USEKEY;
menu->numEntries = numEntries;
menu->initialPos = 0;
create_standard_popup_menu(menu);
script->functionTemp[1] = 0;
script->functionTemp[0] = 1;
break;
case 1:
if (script->functionTemp[1] == 0) {
script->functionTemp[2] = menu->result;
if (script->functionTemp[2] == 0) {
break;
}
hide_popup_menu();
}
script->functionTemp[1]++;
if (script->functionTemp[1] >= 15) {
destroy_popup_menu();
if (script->functionTemp[2] == 0xFF) {
script->varTable[0] = -1;
return ApiStatus_DONE1;
} else {
t = menu->userIndex[script->functionTemp[2] - 1];
script->varTable[1] = t;
script->varTable[0] = playerData->keyItems[t];
return ApiStatus_DONE1;
}
}
break;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel PlayerTestEnemy
/* 1A2FD0 802746F0 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 1A2FD4 802746F4 AFB20018 */ sw $s2, 0x18($sp)
/* 1A2FD8 802746F8 0080902D */ daddu $s2, $a0, $zero
/* 1A2FDC 802746FC AFBF0020 */ sw $ra, 0x20($sp)
/* 1A2FE0 80274700 AFB3001C */ sw $s3, 0x1C($sp)
/* 1A2FE4 80274704 AFB10014 */ sw $s1, 0x14($sp)
/* 1A2FE8 80274708 AFB00010 */ sw $s0, 0x10($sp)
/* 1A2FEC 8027470C 8E50000C */ lw $s0, 0xC($s2)
/* 1A2FF0 80274710 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 1A2FF4 80274714 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 1A2FF8 80274718 8E130000 */ lw $s3, 0x0($s0)
/* 1A2FFC 8027471C 26100004 */ addiu $s0, $s0, 0x4
/* 1A3000 80274720 8E020000 */ lw $v0, 0x0($s0)
/* 1A3004 80274724 26100004 */ addiu $s0, $s0, 0x4
/* 1A3008 80274728 AE220188 */ sw $v0, 0x188($s1)
/* 1A300C 8027472C 8E020000 */ lw $v0, 0x0($s0)
/* 1A3010 80274730 26100004 */ addiu $s0, $s0, 0x4
/* 1A3014 80274734 AE22018C */ sw $v0, 0x18C($s1)
/* 1A3018 80274738 8E020000 */ lw $v0, 0x0($s0)
/* 1A301C 8027473C 26100004 */ addiu $s0, $s0, 0x4
/* 1A3020 80274740 AE220190 */ sw $v0, 0x190($s1)
/* 1A3024 80274744 8E050000 */ lw $a1, 0x0($s0)
/* 1A3028 80274748 0C0B1EAF */ jal evt_get_variable
/* 1A302C 8027474C 26100004 */ addiu $s0, $s0, 0x4
/* 1A3030 80274750 A622017E */ sh $v0, 0x17E($s1)
/* 1A3034 80274754 A2200198 */ sb $zero, 0x198($s1)
/* 1A3038 80274758 8E100000 */ lw $s0, 0x0($s0)
/* 1A303C 8027475C 24020030 */ addiu $v0, $zero, 0x30
/* 1A3040 80274760 32030030 */ andi $v1, $s0, 0x30
/* 1A3044 80274764 54620004 */ bnel $v1, $v0, .L80274778
/* 1A3048 80274768 32020010 */ andi $v0, $s0, 0x10
/* 1A304C 8027476C 8E220000 */ lw $v0, 0x0($s1)
/* 1A3050 80274770 0809D1EE */ j .L802747B8
/* 1A3054 80274774 34420030 */ ori $v0, $v0, 0x30
.L80274778:
/* 1A3058 80274778 10400004 */ beqz $v0, .L8027478C
/* 1A305C 8027477C 2403FFDF */ addiu $v1, $zero, -0x21
/* 1A3060 80274780 8E220000 */ lw $v0, 0x0($s1)
/* 1A3064 80274784 0809D1ED */ j .L802747B4
/* 1A3068 80274788 34420010 */ ori $v0, $v0, 0x10
.L8027478C:
/* 1A306C 8027478C 32020020 */ andi $v0, $s0, 0x20
/* 1A3070 80274790 10400005 */ beqz $v0, .L802747A8
/* 1A3074 80274794 2403FFEF */ addiu $v1, $zero, -0x11
/* 1A3078 80274798 8E220000 */ lw $v0, 0x0($s1)
/* 1A307C 8027479C 00431024 */ and $v0, $v0, $v1
/* 1A3080 802747A0 0809D1EE */ j .L802747B8
/* 1A3084 802747A4 34420020 */ ori $v0, $v0, 0x20
.L802747A8:
/* 1A3088 802747A8 8E220000 */ lw $v0, 0x0($s1)
/* 1A308C 802747AC 00431024 */ and $v0, $v0, $v1
/* 1A3090 802747B0 2403FFDF */ addiu $v1, $zero, -0x21
.L802747B4:
/* 1A3094 802747B4 00431024 */ and $v0, $v0, $v1
.L802747B8:
/* 1A3098 802747B8 AE220000 */ sw $v0, 0x0($s1)
/* 1A309C 802747BC 32020040 */ andi $v0, $s0, 0x40
/* 1A30A0 802747C0 10400007 */ beqz $v0, .L802747E0
/* 1A30A4 802747C4 2404FFBF */ addiu $a0, $zero, -0x41
/* 1A30A8 802747C8 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1A30AC 802747CC 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1A30B0 802747D0 8C620000 */ lw $v0, 0x0($v1)
/* 1A30B4 802747D4 34420040 */ ori $v0, $v0, 0x40
/* 1A30B8 802747D8 0809D1FD */ j .L802747F4
/* 1A30BC 802747DC AC620000 */ sw $v0, 0x0($v1)
.L802747E0:
/* 1A30C0 802747E0 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1A30C4 802747E4 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1A30C8 802747E8 8C430000 */ lw $v1, 0x0($v0)
/* 1A30CC 802747EC 00641824 */ and $v1, $v1, $a0
/* 1A30D0 802747F0 AC430000 */ sw $v1, 0x0($v0)
.L802747F4:
/* 1A30D4 802747F4 32020200 */ andi $v0, $s0, 0x200
/* 1A30D8 802747F8 10400007 */ beqz $v0, .L80274818
/* 1A30DC 802747FC 2404FDFF */ addiu $a0, $zero, -0x201
/* 1A30E0 80274800 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1A30E4 80274804 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1A30E8 80274808 8C620000 */ lw $v0, 0x0($v1)
/* 1A30EC 8027480C 34420200 */ ori $v0, $v0, 0x200
/* 1A30F0 80274810 0809D20B */ j .L8027482C
/* 1A30F4 80274814 AC620000 */ sw $v0, 0x0($v1)
.L80274818:
/* 1A30F8 80274818 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1A30FC 8027481C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1A3100 80274820 8C430000 */ lw $v1, 0x0($v0)
/* 1A3104 80274824 00641824 */ and $v1, $v1, $a0
/* 1A3108 80274828 AC430000 */ sw $v1, 0x0($v0)
.L8027482C:
/* 1A310C 8027482C 32020080 */ andi $v0, $s0, 0x80
/* 1A3110 80274830 10400007 */ beqz $v0, .L80274850
/* 1A3114 80274834 2404FF7F */ addiu $a0, $zero, -0x81
/* 1A3118 80274838 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1A311C 8027483C 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1A3120 80274840 8C620000 */ lw $v0, 0x0($v1)
/* 1A3124 80274844 34420080 */ ori $v0, $v0, 0x80
/* 1A3128 80274848 0809D219 */ j .L80274864
/* 1A312C 8027484C AC620000 */ sw $v0, 0x0($v1)
.L80274850:
/* 1A3130 80274850 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1A3134 80274854 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1A3138 80274858 8C430000 */ lw $v1, 0x0($v0)
/* 1A313C 8027485C 00641824 */ and $v1, $v1, $a0
/* 1A3140 80274860 AC430000 */ sw $v1, 0x0($v0)
.L80274864:
/* 1A3144 80274864 32020800 */ andi $v0, $s0, 0x800
/* 1A3148 80274868 10400007 */ beqz $v0, .L80274888
/* 1A314C 8027486C 2404F7FF */ addiu $a0, $zero, -0x801
/* 1A3150 80274870 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1A3154 80274874 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1A3158 80274878 8C620000 */ lw $v0, 0x0($v1)
/* 1A315C 8027487C 34420800 */ ori $v0, $v0, 0x800
/* 1A3160 80274880 0809D227 */ j .L8027489C
/* 1A3164 80274884 AC620000 */ sw $v0, 0x0($v1)
.L80274888:
/* 1A3168 80274888 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1A316C 8027488C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1A3170 80274890 8C430000 */ lw $v1, 0x0($v0)
/* 1A3174 80274894 00641824 */ and $v1, $v1, $a0
/* 1A3178 80274898 AC430000 */ sw $v1, 0x0($v0)
.L8027489C:
/* 1A317C 8027489C 0C09A75B */ jal get_actor
/* 1A3180 802748A0 8E440148 */ lw $a0, 0x148($s2)
/* 1A3184 802748A4 94430428 */ lhu $v1, 0x428($v0)
/* 1A3188 802748A8 A62301A0 */ sh $v1, 0x1A0($s1)
/* 1A318C 802748AC 92230193 */ lbu $v1, 0x193($s1)
/* 1A3190 802748B0 90420426 */ lbu $v0, 0x426($v0)
/* 1A3194 802748B4 A2230194 */ sb $v1, 0x194($s1)
gPauseBufferImg2:
/* 1A3198 802748B8 306300FF */ andi $v1, $v1, 0xFF
/* 1A319C 802748BC A22201A2 */ sb $v0, 0x1A2($s1)
/* 1A31A0 802748C0 240200FF */ addiu $v0, $zero, 0xFF
/* 1A31A4 802748C4 50620001 */ beql $v1, $v0, .L802748CC
/* 1A31A8 802748C8 A2200194 */ sb $zero, 0x194($s1)
.L802748CC:
/* 1A31AC 802748CC 8E220190 */ lw $v0, 0x190($s1)
/* 1A31B0 802748D0 30420F00 */ andi $v0, $v0, 0xF00
/* 1A31B4 802748D4 00021203 */ sra $v0, $v0, 8
/* 1A31B8 802748D8 0C09C5D5 */ jal calc_player_test_enemy
/* 1A31BC 802748DC A2220195 */ sb $v0, 0x195($s1)
/* 1A31C0 802748E0 04400006 */ bltz $v0, .L802748FC
/* 1A31C4 802748E4 0240202D */ daddu $a0, $s2, $zero
/* 1A31C8 802748E8 0260282D */ daddu $a1, $s3, $zero
/* 1A31CC 802748EC 0C0B2026 */ jal evt_set_variable
/* 1A31D0 802748F0 0040302D */ daddu $a2, $v0, $zero
/* 1A31D4 802748F4 0809D240 */ j .L80274900
/* 1A31D8 802748F8 24020002 */ addiu $v0, $zero, 0x2
.L802748FC:
/* 1A31DC 802748FC 240200FF */ addiu $v0, $zero, 0xFF
.L80274900:
/* 1A31E0 80274900 8FBF0020 */ lw $ra, 0x20($sp)
/* 1A31E4 80274904 8FB3001C */ lw $s3, 0x1C($sp)
/* 1A31E8 80274908 8FB20018 */ lw $s2, 0x18($sp)
/* 1A31EC 8027490C 8FB10014 */ lw $s1, 0x14($sp)
/* 1A31F0 80274910 8FB00010 */ lw $s0, 0x10($sp)
/* 1A31F4 80274914 03E00008 */ jr $ra
/* 1A31F8 80274918 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
ApiStatus PlayerTestEnemy(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Bytecode* args = script->ptrReadPos;
s32 hitResultOutVar = *args++;
s32 flags;
Actor* target;
HitResult hitResult;
battleStatus->currentAttackElement = *args++;
battleStatus->currentAttackEventSuppression = *args++;
battleStatus->currentAttackStatus = *args++;
battleStatus->currentAttackDamage = evt_get_variable(script, *args++);
battleStatus->powerBounceCounter = 0;
flags = *args++;
if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) {
gBattleStatus.flags1 |= BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE;
} else if (flags & BS_FLAGS1_10) {
gBattleStatus.flags1 |= BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
} else if (flags & BS_FLAGS1_SP_EVT_ACTIVE) {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
}
if (flags & BS_FLAGS1_40) {
gBattleStatus.flags1 |= BS_FLAGS1_40;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_40;
}
if (flags & BS_FLAGS1_200) {
gBattleStatus.flags1 |= BS_FLAGS1_200;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_200;
}
if (flags & BS_FLAGS1_80) {
gBattleStatus.flags1 |= BS_FLAGS1_80;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_80;
}
if (flags & BS_FLAGS1_FORCE_HIT_IMMUNE) {
gBattleStatus.flags1 |= BS_FLAGS1_FORCE_HIT_IMMUNE;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_FORCE_HIT_IMMUNE;
}
target = get_actor(script->owner1.actorID);
battleStatus->currentTargetID = target->targetActorID;
battleStatus->currentTargetPart = target->targetPartIndex;
battleStatus->statusChance = battleStatus->currentAttackStatus;
if (battleStatus->statusChance == STATUS_KEY_NEVER) {
battleStatus->statusChance = 0;
}
battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8;
hitResult = calc_player_test_enemy();
if (hitResult < 0) {
return ApiStatus_FINISH;
}
evt_set_variable(script, hitResultOutVar, hitResult);
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_E008A290
/* 38C880 E008A290 0080402D */ daddu $t0, $a0, $zero
/* 38C884 E008A294 3C04800B */ lui $a0, %hi(gCameras)
/* 38C888 E008A298 24841D80 */ addiu $a0, $a0, %lo(gCameras)
/* 38C88C E008A29C 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 38C890 E008A2A0 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 38C894 E008A2A4 C5000008 */ lwc1 $f0, 0x8($t0)
/* 38C898 E008A2A8 C508000C */ lwc1 $f8, 0xC($t0)
/* 38C89C E008A2AC 00031080 */ sll $v0, $v1, 2
/* 38C8A0 E008A2B0 00431021 */ addu $v0, $v0, $v1
/* 38C8A4 E008A2B4 00021080 */ sll $v0, $v0, 2
/* 38C8A8 E008A2B8 00431023 */ subu $v0, $v0, $v1
/* 38C8AC E008A2BC 000218C0 */ sll $v1, $v0, 3
/* 38C8B0 E008A2C0 00431021 */ addu $v0, $v0, $v1
/* 38C8B4 E008A2C4 000210C0 */ sll $v0, $v0, 3
/* 38C8B8 E008A2C8 00441021 */ addu $v0, $v0, $a0
/* 38C8BC E008A2CC C4420048 */ lwc1 $f2, 0x48($v0)
/* 38C8C0 E008A2D0 C50A0010 */ lwc1 $f10, 0x10($t0)
/* 38C8C4 E008A2D4 46020001 */ sub.s $f0, $f0, $f2
/* 38C8C8 E008A2D8 C444004C */ lwc1 $f4, 0x4C($v0)
/* 38C8CC E008A2DC C4460050 */ lwc1 $f6, 0x50($v0)
/* 38C8D0 E008A2E0 4600030D */ trunc.w.s $f12, $f0
/* 38C8D4 E008A2E4 44046000 */ mfc1 $a0, $f12
/* 38C8D8 E008A2E8 00000000 */ nop
/* 38C8DC E008A2EC 00A4182A */ slt $v1, $a1, $a0
/* 38C8E0 E008A2F0 10600014 */ beqz $v1, .LE008A344
/* 38C8E4 E008A2F4 00051023 */ negu $v0, $a1
/* 38C8E8 E008A2F8 14A00002 */ bnez $a1, .LE008A304
/* 38C8EC E008A2FC 0085001A */ div $zero, $a0, $a1
/* 38C8F0 E008A300 0007000D */ break 7
.LE008A304:
/* 38C8F4 E008A304 2401FFFF */ addiu $at, $zero, -0x1
/* 38C8F8 E008A308 14A10004 */ bne $a1, $at, .LE008A31C
/* 38C8FC E008A30C 3C018000 */ lui $at, (0x80000000 >> 16)
/* 38C900 E008A310 14810002 */ bne $a0, $at, .LE008A31C
/* 38C904 E008A314 00000000 */ nop
/* 38C908 E008A318 0006000D */ break 6
.LE008A31C:
/* 38C90C E008A31C 00002010 */ mfhi $a0
/* 38C910 E008A320 44850000 */ mtc1 $a1, $f0
/* 38C914 E008A324 00000000 */ nop
/* 38C918 E008A328 46800020 */ cvt.s.w $f0, $f0
/* 38C91C E008A32C 46001001 */ sub.s $f0, $f2, $f0
/* 38C920 E008A330 44841000 */ mtc1 $a0, $f2
/* 38C924 E008A334 00000000 */ nop
/* 38C928 E008A338 468010A0 */ cvt.s.w $f2, $f2
/* 38C92C E008A33C 080228E6 */ j .LE008A398
/* 38C930 E008A340 46020000 */ add.s $f0, $f0, $f2
.LE008A344:
/* 38C934 E008A344 0082102A */ slt $v0, $a0, $v0
/* 38C938 E008A348 10400014 */ beqz $v0, .LE008A39C
/* 38C93C E008A34C 00042023 */ negu $a0, $a0
/* 38C940 E008A350 14A00002 */ bnez $a1, .LE008A35C
/* 38C944 E008A354 0085001A */ div $zero, $a0, $a1
/* 38C948 E008A358 0007000D */ break 7
.LE008A35C:
/* 38C94C E008A35C 2401FFFF */ addiu $at, $zero, -0x1
/* 38C950 E008A360 14A10004 */ bne $a1, $at, .LE008A374
/* 38C954 E008A364 3C018000 */ lui $at, (0x80000000 >> 16)
/* 38C958 E008A368 14810002 */ bne $a0, $at, .LE008A374
/* 38C95C E008A36C 00000000 */ nop
/* 38C960 E008A370 0006000D */ break 6
.LE008A374:
/* 38C964 E008A374 00002010 */ mfhi $a0
/* 38C968 E008A378 44850000 */ mtc1 $a1, $f0
/* 38C96C E008A37C 00000000 */ nop
/* 38C970 E008A380 46800020 */ cvt.s.w $f0, $f0
/* 38C974 E008A384 46001000 */ add.s $f0, $f2, $f0
/* 38C978 E008A388 44841000 */ mtc1 $a0, $f2
/* 38C97C E008A38C 00000000 */ nop
/* 38C980 E008A390 468010A0 */ cvt.s.w $f2, $f2
/* 38C984 E008A394 46020001 */ sub.s $f0, $f0, $f2
.LE008A398:
/* 38C988 E008A398 E5000008 */ swc1 $f0, 0x8($t0)
.LE008A39C:
/* 38C98C E008A39C 46044001 */ sub.s $f0, $f8, $f4
/* 38C990 E008A3A0 4600030D */ trunc.w.s $f12, $f0
/* 38C994 E008A3A4 44036000 */ mfc1 $v1, $f12
/* 38C998 E008A3A8 00000000 */ nop
/* 38C99C E008A3AC 00C3102A */ slt $v0, $a2, $v1
/* 38C9A0 E008A3B0 10400014 */ beqz $v0, .LE008A404
/* 38C9A4 E008A3B4 00061023 */ negu $v0, $a2
/* 38C9A8 E008A3B8 14C00002 */ bnez $a2, .LE008A3C4
/* 38C9AC E008A3BC 0066001A */ div $zero, $v1, $a2
/* 38C9B0 E008A3C0 0007000D */ break 7
.LE008A3C4:
/* 38C9B4 E008A3C4 2401FFFF */ addiu $at, $zero, -0x1
/* 38C9B8 E008A3C8 14C10004 */ bne $a2, $at, .LE008A3DC
/* 38C9BC E008A3CC 3C018000 */ lui $at, (0x80000000 >> 16)
/* 38C9C0 E008A3D0 14610002 */ bne $v1, $at, .LE008A3DC
/* 38C9C4 E008A3D4 00000000 */ nop
/* 38C9C8 E008A3D8 0006000D */ break 6
.LE008A3DC:
/* 38C9CC E008A3DC 00001810 */ mfhi $v1
/* 38C9D0 E008A3E0 44860000 */ mtc1 $a2, $f0
/* 38C9D4 E008A3E4 00000000 */ nop
/* 38C9D8 E008A3E8 46800020 */ cvt.s.w $f0, $f0
/* 38C9DC E008A3EC 46002001 */ sub.s $f0, $f4, $f0
/* 38C9E0 E008A3F0 44831000 */ mtc1 $v1, $f2
/* 38C9E4 E008A3F4 00000000 */ nop
/* 38C9E8 E008A3F8 468010A0 */ cvt.s.w $f2, $f2
/* 38C9EC E008A3FC 0802291B */ j .LE008A46C
/* 38C9F0 E008A400 46020000 */ add.s $f0, $f0, $f2
.LE008A404:
/* 38C9F4 E008A404 0062102A */ slt $v0, $v1, $v0
/* 38C9F8 E008A408 10400019 */ beqz $v0, .LE008A470
/* 38C9FC E008A40C 28E20064 */ slti $v0, $a3, 0x64
/* 38CA00 E008A410 10400004 */ beqz $v0, .LE008A424
/* 38CA04 E008A414 00031823 */ negu $v1, $v1
/* 38CA08 E008A418 AD000018 */ sw $zero, 0x18($t0)
/* 38CA0C E008A41C 0802291C */ j .LE008A470
/* 38CA10 E008A420 AD000028 */ sw $zero, 0x28($t0)
.LE008A424:
/* 38CA14 E008A424 14C00002 */ bnez $a2, .LE008A430
/* 38CA18 E008A428 0066001A */ div $zero, $v1, $a2
/* 38CA1C E008A42C 0007000D */ break 7
.LE008A430:
/* 38CA20 E008A430 2401FFFF */ addiu $at, $zero, -0x1
/* 38CA24 E008A434 14C10004 */ bne $a2, $at, .LE008A448
/* 38CA28 E008A438 3C018000 */ lui $at, (0x80000000 >> 16)
/* 38CA2C E008A43C 14610002 */ bne $v1, $at, .LE008A448
/* 38CA30 E008A440 00000000 */ nop
/* 38CA34 E008A444 0006000D */ break 6
.LE008A448:
/* 38CA38 E008A448 00001810 */ mfhi $v1
/* 38CA3C E008A44C 44860000 */ mtc1 $a2, $f0
/* 38CA40 E008A450 00000000 */ nop
/* 38CA44 E008A454 46800020 */ cvt.s.w $f0, $f0
/* 38CA48 E008A458 46002000 */ add.s $f0, $f4, $f0
/* 38CA4C E008A45C 44831000 */ mtc1 $v1, $f2
/* 38CA50 E008A460 00000000 */ nop
/* 38CA54 E008A464 468010A0 */ cvt.s.w $f2, $f2
/* 38CA58 E008A468 46020001 */ sub.s $f0, $f0, $f2
.LE008A46C:
/* 38CA5C E008A46C E500000C */ swc1 $f0, 0xC($t0)
.LE008A470:
/* 38CA60 E008A470 46065001 */ sub.s $f0, $f10, $f6
/* 38CA64 E008A474 4600030D */ trunc.w.s $f12, $f0
/* 38CA68 E008A478 44036000 */ mfc1 $v1, $f12
/* 38CA6C E008A47C 00000000 */ nop
/* 38CA70 E008A480 00A3102A */ slt $v0, $a1, $v1
/* 38CA74 E008A484 10400015 */ beqz $v0, .LE008A4DC
/* 38CA78 E008A488 00051023 */ negu $v0, $a1
/* 38CA7C E008A48C 14A00002 */ bnez $a1, .LE008A498
/* 38CA80 E008A490 0065001A */ div $zero, $v1, $a1
/* 38CA84 E008A494 0007000D */ break 7
.LE008A498:
/* 38CA88 E008A498 2401FFFF */ addiu $at, $zero, -0x1
/* 38CA8C E008A49C 14A10004 */ bne $a1, $at, .LE008A4B0
/* 38CA90 E008A4A0 3C018000 */ lui $at, (0x80000000 >> 16)
/* 38CA94 E008A4A4 14610002 */ bne $v1, $at, .LE008A4B0
/* 38CA98 E008A4A8 00000000 */ nop
/* 38CA9C E008A4AC 0006000D */ break 6
.LE008A4B0:
/* 38CAA0 E008A4B0 00001810 */ mfhi $v1
/* 38CAA4 E008A4B4 44850000 */ mtc1 $a1, $f0
/* 38CAA8 E008A4B8 00000000 */ nop
/* 38CAAC E008A4BC 46800020 */ cvt.s.w $f0, $f0
/* 38CAB0 E008A4C0 46003001 */ sub.s $f0, $f6, $f0
/* 38CAB4 E008A4C4 44831000 */ mtc1 $v1, $f2
/* 38CAB8 E008A4C8 00000000 */ nop
/* 38CABC E008A4CC 468010A0 */ cvt.s.w $f2, $f2
/* 38CAC0 E008A4D0 46020000 */ add.s $f0, $f0, $f2
/* 38CAC4 E008A4D4 03E00008 */ jr $ra
/* 38CAC8 E008A4D8 E5000010 */ swc1 $f0, 0x10($t0)
.LE008A4DC:
/* 38CACC E008A4DC 0062102A */ slt $v0, $v1, $v0
/* 38CAD0 E008A4E0 10400014 */ beqz $v0, .LE008A534
/* 38CAD4 E008A4E4 00031823 */ negu $v1, $v1
/* 38CAD8 E008A4E8 14A00002 */ bnez $a1, .LE008A4F4
/* 38CADC E008A4EC 0065001A */ div $zero, $v1, $a1
/* 38CAE0 E008A4F0 0007000D */ break 7
.LE008A4F4:
/* 38CAE4 E008A4F4 2401FFFF */ addiu $at, $zero, -0x1
/* 38CAE8 E008A4F8 14A10004 */ bne $a1, $at, .LE008A50C
/* 38CAEC E008A4FC 3C018000 */ lui $at, (0x80000000 >> 16)
/* 38CAF0 E008A500 14610002 */ bne $v1, $at, .LE008A50C
/* 38CAF4 E008A504 00000000 */ nop
/* 38CAF8 E008A508 0006000D */ break 6
.LE008A50C:
/* 38CAFC E008A50C 00001810 */ mfhi $v1
/* 38CB00 E008A510 44850000 */ mtc1 $a1, $f0
/* 38CB04 E008A514 00000000 */ nop
/* 38CB08 E008A518 46800020 */ cvt.s.w $f0, $f0
/* 38CB0C E008A51C 46003000 */ add.s $f0, $f6, $f0
/* 38CB10 E008A520 44831000 */ mtc1 $v1, $f2
/* 38CB14 E008A524 00000000 */ nop
/* 38CB18 E008A528 468010A0 */ cvt.s.w $f2, $f2
/* 38CB1C E008A52C 46020001 */ sub.s $f0, $f0, $f2
/* 38CB20 E008A530 E5000010 */ swc1 $f0, 0x10($t0)
.LE008A534:
/* 38CB24 E008A534 03E00008 */ jr $ra
/* 38CB28 E008A538 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void func_E008A290(SnowfallFXData* data, s32 arg1, s32 arg2, s32 arg3) {
Camera* camera = &gCameras[gCurrentCameraID];
f32 unk_08 = data->unk_08;
f32 unk_0C = data->unk_0C;
f32 unk_10 = data->unk_10;
f32 lookX = camera->lookAt_obj.x;
f32 lookY = camera->lookAt_obj.y;
f32 lookZ = camera->lookAt_obj.z;
s32 temp_f12;
s32 temp_f12_2;
s32 temp_f12_3;
temp_f12 = unk_08 - lookX;
if (arg1 < temp_f12) {
temp_f12 = temp_f12 % arg1;
data->unk_08 = (lookX - arg1) + temp_f12;
} else if (-arg1 > temp_f12) {
temp_f12 = -temp_f12;
temp_f12 = temp_f12 % arg1;
data->unk_08 = (lookX + arg1) - temp_f12;
}
temp_f12_2 = unk_0C - lookY;
if (arg2 < temp_f12_2) {
temp_f12_2 = temp_f12_2 % arg2;
data->unk_0C = (lookY - arg2) + temp_f12_2;
} else if (temp_f12_2 < -arg2) {
if (arg3 < 100) {
data->unk_18 = 0;
data->unk_28 = 0;
} else {
temp_f12_2 = -temp_f12_2;
temp_f12_2 = temp_f12_2 % arg2;
data->unk_0C = (lookY + arg2) - temp_f12_2;
}
}
temp_f12_3 = unk_10 - lookZ;
if (arg1 < temp_f12_3) {
temp_f12_3 = temp_f12_3 % arg1;
data->unk_10 = (lookZ - arg1) + temp_f12_3;
} else if (temp_f12_3 < -arg1) {
temp_f12_3 = -temp_f12_3;
temp_f12_3 = temp_f12_3 % arg1;
data->unk_10 = (lookZ + arg1) - temp_f12_3;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel make_transform_group
/* B1A7C 8011B37C 27BDFFC0 */ addiu $sp, $sp, -0x40
/* B1A80 8011B380 3C038015 */ lui $v1, %hi(gCurrentModelTreeRoot)
/* B1A84 8011B384 8C6312FC */ lw $v1, %lo(gCurrentModelTreeRoot)($v1)
/* B1A88 8011B388 0080102D */ daddu $v0, $a0, $zero
/* B1A8C 8011B38C AFB00030 */ sw $s0, 0x30($sp)
/* B1A90 8011B390 3C108015 */ lui $s0, %hi(D_80153370)
/* B1A94 8011B394 26103370 */ addiu $s0, $s0, %lo(D_80153370)
/* B1A98 8011B398 AFBF003C */ sw $ra, 0x3C($sp)
/* B1A9C 8011B39C AFB20038 */ sw $s2, 0x38($sp)
/* B1AA0 8011B3A0 AFB10034 */ sw $s1, 0x34($sp)
/* B1AA4 8011B3A4 3C018015 */ lui $at, %hi(mdl_treeIterPos)
/* B1AA8 8011B3A8 AC203224 */ sw $zero, %lo(mdl_treeIterPos)($at)
/* B1AAC 8011B3AC AE000000 */ sw $zero, 0x0($s0)
/* B1AB0 8011B3B0 3C018015 */ lui $at, %hi(D_8015336E)
/* B1AB4 8011B3B4 A422336E */ sh $v0, %lo(D_8015336E)($at)
/* B1AB8 8011B3B8 3C018015 */ lui $at, %hi(D_80153376)
/* B1ABC 8011B3BC A4203376 */ sh $zero, %lo(D_80153376)($at)
/* B1AC0 8011B3C0 3C018015 */ lui $at, %hi(D_80153374)
/* B1AC4 8011B3C4 A4203374 */ sh $zero, %lo(D_80153374)($at)
/* B1AC8 8011B3C8 8C640000 */ lw $a0, 0x0($v1)
/* B1ACC 8011B3CC 0C046C76 */ jal func_8011B1D8
/* B1AD0 8011B3D0 0040902D */ daddu $s2, $v0, $zero
/* B1AD4 8011B3D4 8E020000 */ lw $v0, 0x0($s0)
/* B1AD8 8011B3D8 10400077 */ beqz $v0, .L8011B5B8
/* B1ADC 8011B3DC 0000802D */ daddu $s0, $zero, $zero
/* B1AE0 8011B3E0 3C118015 */ lui $s1, %hi(gCurrentTransformGroups)
/* B1AE4 8011B3E4 263112E0 */ addiu $s1, $s1, %lo(gCurrentTransformGroups)
/* B1AE8 8011B3E8 8E230000 */ lw $v1, 0x0($s1)
.L8011B3EC:
/* B1AEC 8011B3EC 8C620000 */ lw $v0, 0x0($v1)
/* B1AF0 8011B3F0 10400005 */ beqz $v0, .L8011B408
/* B1AF4 8011B3F4 00000000 */ nop
/* B1AF8 8011B3F8 26100001 */ addiu $s0, $s0, 0x1
/* B1AFC 8011B3FC 2A020004 */ slti $v0, $s0, 0x4
/* B1B00 8011B400 1440FFFA */ bnez $v0, .L8011B3EC
/* B1B04 8011B404 24630004 */ addiu $v1, $v1, 0x4
.L8011B408:
/* B1B08 8011B408 0C00AB39 */ jal heap_malloc
/* B1B0C 8011B40C 240400A0 */ addiu $a0, $zero, 0xA0
/* B1B10 8011B410 00101880 */ sll $v1, $s0, 2
/* B1B14 8011B414 0040802D */ daddu $s0, $v0, $zero
/* B1B18 8011B418 24020001 */ addiu $v0, $zero, 0x1
/* B1B1C 8011B41C 8E250000 */ lw $a1, 0x0($s1)
/* B1B20 8011B420 3C048015 */ lui $a0, %hi(D_80153374)
/* B1B24 8011B424 94843374 */ lhu $a0, %lo(D_80153374)($a0)
/* B1B28 8011B428 00651821 */ addu $v1, $v1, $a1
/* B1B2C 8011B42C AC700000 */ sw $s0, 0x0($v1)
/* B1B30 8011B430 A6020000 */ sh $v0, 0x0($s0)
/* B1B34 8011B434 0C046C04 */ jal get_model_list_index_from_tree_index
/* B1B38 8011B438 A6120002 */ sh $s2, 0x2($s0)
/* B1B3C 8011B43C A202009C */ sb $v0, 0x9C($s0)
/* B1B40 8011B440 3C048015 */ lui $a0, %hi(D_80153376)
/* B1B44 8011B444 94843376 */ lhu $a0, %lo(D_80153376)($a0)
/* B1B48 8011B448 0C046C04 */ jal get_model_list_index_from_tree_index
/* B1B4C 8011B44C 00000000 */ nop
/* B1B50 8011B450 A202009D */ sb $v0, 0x9D($s0)
/* B1B54 8011B454 A200009F */ sb $zero, 0x9F($s0)
/* B1B58 8011B458 3C028015 */ lui $v0, %hi(D_80153370)
/* B1B5C 8011B45C 8C423370 */ lw $v0, %lo(D_80153370)($v0)
/* B1B60 8011B460 26040010 */ addiu $a0, $s0, 0x10
/* B1B64 8011B464 AE000004 */ sw $zero, 0x4($s0)
/* B1B68 8011B468 0C019D10 */ jal guMtxIdent
/* B1B6C 8011B46C AE020008 */ sw $v0, 0x8($s0)
/* B1B70 8011B470 96020000 */ lhu $v0, 0x0($s0)
/* B1B74 8011B474 26040050 */ addiu $a0, $s0, 0x50
/* B1B78 8011B478 34422000 */ ori $v0, $v0, 0x2000
/* B1B7C 8011B47C 0C019D28 */ jal guMtxIdentF
/* B1B80 8011B480 A6020000 */ sh $v0, 0x0($s0)
/* B1B84 8011B484 8E110008 */ lw $s1, 0x8($s0)
/* B1B88 8011B488 8E230000 */ lw $v1, 0x0($s1)
/* B1B8C 8011B48C 24020005 */ addiu $v0, $zero, 0x5
/* B1B90 8011B490 10620005 */ beq $v1, $v0, .L8011B4A8
/* B1B94 8011B494 0220202D */ daddu $a0, $s1, $zero
/* B1B98 8011B498 0C0456C3 */ jal get_model_property
/* B1B9C 8011B49C 2405005C */ addiu $a1, $zero, 0x5C
/* B1BA0 8011B4A0 08046D2E */ j .L8011B4B8
/* B1BA4 8011B4A4 00000000 */ nop
.L8011B4A8:
/* B1BA8 8011B4A8 0C0456C3 */ jal get_model_property
/* B1BAC 8011B4AC 24050060 */ addiu $a1, $zero, 0x60
/* B1BB0 8011B4B0 10400006 */ beqz $v0, .L8011B4CC
/* B1BB4 8011B4B4 2442000C */ addiu $v0, $v0, 0xC
.L8011B4B8:
/* B1BB8 8011B4B8 50400005 */ beql $v0, $zero, .L8011B4D0
/* B1BBC 8011B4BC 24020001 */ addiu $v0, $zero, 0x1
/* B1BC0 8011B4C0 9042000B */ lbu $v0, 0xB($v0)
/* B1BC4 8011B4C4 08046D35 */ j .L8011B4D4
/* B1BC8 8011B4C8 A202009E */ sb $v0, 0x9E($s0)
.L8011B4CC:
/* B1BCC 8011B4CC 24020001 */ addiu $v0, $zero, 0x1
.L8011B4D0:
/* B1BD0 8011B4D0 A202009E */ sb $v0, 0x9E($s0)
.L8011B4D4:
/* B1BD4 8011B4D4 0220202D */ daddu $a0, $s1, $zero
/* B1BD8 8011B4D8 0C0456C3 */ jal get_model_property
/* B1BDC 8011B4DC 24050061 */ addiu $a1, $zero, 0x61
/* B1BE0 8011B4E0 10400017 */ beqz $v0, .L8011B540
/* B1BE4 8011B4E4 00000000 */ nop
/* B1BE8 8011B4E8 C4460008 */ lwc1 $f6, 0x8($v0)
/* B1BEC 8011B4EC C440002C */ lwc1 $f0, 0x2C($v0)
/* B1BF0 8011B4F0 46003180 */ add.s $f6, $f6, $f0
/* B1BF4 8011B4F4 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* B1BF8 8011B4F8 44814000 */ mtc1 $at, $f8
/* B1BFC 8011B4FC 00000000 */ nop
/* B1C00 8011B500 46083182 */ mul.s $f6, $f6, $f8
/* B1C04 8011B504 00000000 */ nop
/* B1C08 8011B508 C4440014 */ lwc1 $f4, 0x14($v0)
/* B1C0C 8011B50C C4400038 */ lwc1 $f0, 0x38($v0)
/* B1C10 8011B510 46002100 */ add.s $f4, $f4, $f0
/* B1C14 8011B514 46082102 */ mul.s $f4, $f4, $f8
/* B1C18 8011B518 00000000 */ nop
/* B1C1C 8011B51C C4420044 */ lwc1 $f2, 0x44($v0)
/* B1C20 8011B520 C4400020 */ lwc1 $f0, 0x20($v0)
/* B1C24 8011B524 46020000 */ add.s $f0, $f0, $f2
/* B1C28 8011B528 46080002 */ mul.s $f0, $f0, $f8
/* B1C2C 8011B52C 00000000 */ nop
/* B1C30 8011B530 E7A60020 */ swc1 $f6, 0x20($sp)
/* B1C34 8011B534 E7A40024 */ swc1 $f4, 0x24($sp)
/* B1C38 8011B538 08046D55 */ j .L8011B554
/* B1C3C 8011B53C E7A00028 */ swc1 $f0, 0x28($sp)
.L8011B540:
/* B1C40 8011B540 44800000 */ mtc1 $zero, $f0
/* B1C44 8011B544 00000000 */ nop
/* B1C48 8011B548 E7A00028 */ swc1 $f0, 0x28($sp)
/* B1C4C 8011B54C E7A00024 */ swc1 $f0, 0x24($sp)
/* B1C50 8011B550 E7A00020 */ swc1 $f0, 0x20($sp)
.L8011B554:
/* B1C54 8011B554 8E020004 */ lw $v0, 0x4($s0)
/* B1C58 8011B558 1040000F */ beqz $v0, .L8011B598
/* B1C5C 8011B55C 27A20020 */ addiu $v0, $sp, 0x20
/* B1C60 8011B560 C7A00020 */ lwc1 $f0, 0x20($sp)
/* B1C64 8011B564 C7A20024 */ lwc1 $f2, 0x24($sp)
/* B1C68 8011B568 C7A40028 */ lwc1 $f4, 0x28($sp)
/* B1C6C 8011B56C AFA20010 */ sw $v0, 0x10($sp)
/* B1C70 8011B570 27A20024 */ addiu $v0, $sp, 0x24
/* B1C74 8011B574 AFA20014 */ sw $v0, 0x14($sp)
/* B1C78 8011B578 27A20028 */ addiu $v0, $sp, 0x28
/* B1C7C 8011B57C AFA20018 */ sw $v0, 0x18($sp)
/* B1C80 8011B580 8E040004 */ lw $a0, 0x4($s0)
/* B1C84 8011B584 44050000 */ mfc1 $a1, $f0
/* B1C88 8011B588 44061000 */ mfc1 $a2, $f2
/* B1C8C 8011B58C 44072000 */ mfc1 $a3, $f4
/* B1C90 8011B590 0C019E78 */ jal guMtxXFML
/* B1C94 8011B594 00000000 */ nop
.L8011B598:
/* B1C98 8011B598 C7A00020 */ lwc1 $f0, 0x20($sp)
/* B1C9C 8011B59C C7A20024 */ lwc1 $f2, 0x24($sp)
/* B1CA0 8011B5A0 C7A40028 */ lwc1 $f4, 0x28($sp)
/* B1CA4 8011B5A4 3244FFFF */ andi $a0, $s2, 0xFFFF
/* B1CA8 8011B5A8 E6000090 */ swc1 $f0, 0x90($s0)
/* B1CAC 8011B5AC E6020094 */ swc1 $f2, 0x94($s0)
/* B1CB0 8011B5B0 0C046D74 */ jal enable_transform_group
/* B1CB4 8011B5B4 E6040098 */ swc1 $f4, 0x98($s0)
.L8011B5B8:
/* B1CB8 8011B5B8 8FBF003C */ lw $ra, 0x3C($sp)
/* B1CBC 8011B5BC 8FB20038 */ lw $s2, 0x38($sp)
/* B1CC0 8011B5C0 8FB10034 */ lw $s1, 0x34($sp)
/* B1CC4 8011B5C4 8FB00030 */ lw $s0, 0x30($sp)
/* B1CC8 8011B5C8 03E00008 */ jr $ra
/* B1CCC 8011B5CC 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
void make_transform_group(u16 modelID) {
mdl_treeIterPos = 0;
D_80153370 = NULL;
D_8015336E = modelID;
D_80153376 = 0;
D_80153374 = 0;
func_8011B1D8(*gCurrentModelTreeRoot);
if (D_80153370 != 0) {
ModelTransformGroup* newMtg;
ModelNode* node;
ModelNodeProperty* prop;
ModelBoundingBox* bb;
f32 x, y, z;
s32 i;
for (i = 0; i < ARRAY_COUNT(*gCurrentTransformGroups); i++) {
if ((*gCurrentTransformGroups)[i] == NULL) {
break;
}
}
(*gCurrentTransformGroups)[i] = newMtg = heap_malloc(sizeof(*newMtg));
newMtg->flags = MODEL_TRANSFORM_GROUP_FLAG_1;
newMtg->groupModelID = modelID;
newMtg->minChildModelIndex = get_model_list_index_from_tree_index(D_80153374);
newMtg->maxChildModelIndex = get_model_list_index_from_tree_index(D_80153376);
newMtg->matrixMode = 0;
newMtg->matrixRDP_N = NULL;
newMtg->modelNode = D_80153370;
guMtxIdent(&newMtg->matrixA);
newMtg->flags |= 0x2000;
guMtxIdentF(newMtg->matrixB);
node = newMtg->modelNode;
if (node->type != SHAPE_TYPE_GROUP) {
prop = get_model_property(node, MODEL_PROP_KEY_RENDER_MODE);
} else {
prop = get_model_property(node, MODEL_PROP_KEY_GROUP_TYPE);
if (prop != NULL) {
prop = &prop[1];
}
}
if (prop != NULL) {
newMtg->renderMode = prop->data.s;
} else {
newMtg->renderMode = 1;
}
bb = (ModelBoundingBox*)get_model_property(node, MODEL_PROP_KEY_BOUNDING_BOX);
if (bb != NULL) {
x = (bb->minX + bb->maxX) * 0.5f;
y = (bb->minY + bb->maxY) * 0.5f;
z = (bb->minZ + bb->maxZ) * 0.5f;
} else {
x = y = z = 0.0f;
}
if (newMtg->matrixRDP_N != NULL) {
guMtxXFML(newMtg->matrixRDP_N, x, y, z, &x, &y, &z);
}
newMtg->center.x = x;
newMtg->center.y = y;
newMtg->center.z = z;
enable_transform_group(modelID);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel calculate_line_segment_intersection
/* D9E4 800325E4 27BDFFC0 */ addiu $sp, $sp, -0x40
/* D9E8 800325E8 F7BC0030 */ sdc1 $f28, 0x30($sp)
/* D9EC 800325EC 4486E000 */ mtc1 $a2, $f28
/* D9F0 800325F0 F7B60018 */ sdc1 $f22, 0x18($sp)
/* D9F4 800325F4 C7B60050 */ lwc1 $f22, 0x50($sp)
/* D9F8 800325F8 F7B40010 */ sdc1 $f20, 0x10($sp)
/* D9FC 800325FC 46006506 */ mov.s $f20, $f12
/* DA00 80032600 F7BA0028 */ sdc1 $f26, 0x28($sp)
/* DA04 80032604 46007686 */ mov.s $f26, $f14
/* DA08 80032608 F7B80020 */ sdc1 $f24, 0x20($sp)
/* DA0C 8003260C 4614E481 */ sub.s $f18, $f28, $f20
/* DA10 80032610 C7B80054 */ lwc1 $f24, 0x54($sp)
/* DA14 80032614 C7A0005C */ lwc1 $f0, 0x5C($sp)
/* DA18 80032618 461AC181 */ sub.s $f6, $f24, $f26
/* DA1C 8003261C F7BE0038 */ sdc1 $f30, 0x38($sp)
/* DA20 80032620 461A0781 */ sub.s $f30, $f0, $f26
/* DA24 80032624 C7A20058 */ lwc1 $f2, 0x58($sp)
/* DA28 80032628 46161401 */ sub.s $f16, $f2, $f22
/* DA2C 8003262C 4487E000 */ mtc1 $a3, $f28
/* DA30 80032630 00000000 */ nop
/* DA34 80032634 461AE301 */ sub.s $f12, $f28, $f26
/* DA38 80032638 4614B701 */ sub.s $f28, $f22, $f20
/* DA3C 8003263C 46180381 */ sub.s $f14, $f0, $f24
/* DA40 80032640 E7BC0008 */ swc1 $f28, 0x8($sp)
/* DA44 80032644 46141701 */ sub.s $f28, $f2, $f20
/* DA48 80032648 44802000 */ mtc1 $zero, $f4
/* DA4C 8003264C 46009286 */ mov.s $f10, $f18
/* DA50 80032650 46049032 */ c.eq.s $f18, $f4
/* DA54 80032654 46006207 */ neg.s $f8, $f12
/* DA58 80032658 45000005 */ bc1f .L80032670
/* DA5C 8003265C E7BC0000 */ swc1 $f28, 0x0($sp)
/* DA60 80032660 46046032 */ c.eq.s $f12, $f4
/* DA64 80032664 00000000 */ nop
/* DA68 80032668 45010086 */ bc1t .L80032884
/* DA6C 8003266C 0000102D */ daddu $v0, $zero, $zero
.L80032670:
/* DA70 80032670 44800000 */ mtc1 $zero, $f0
/* DA74 80032674 00000000 */ nop
/* DA78 80032678 46008032 */ c.eq.s $f16, $f0
/* DA7C 8003267C 00000000 */ nop
/* DA80 80032680 45000005 */ bc1f .L80032698
/* DA84 80032684 00000000 */ nop
/* DA88 80032688 46007032 */ c.eq.s $f14, $f0
/* DA8C 8003268C 00000000 */ nop
/* DA90 80032690 4501007C */ bc1t .L80032884
/* DA94 80032694 0000102D */ daddu $v0, $zero, $zero
.L80032698:
/* DA98 80032698 46065002 */ mul.s $f0, $f10, $f6
/* DA9C 8003269C 00000000 */ nop
/* DAA0 800326A0 C7BC0008 */ lwc1 $f28, 0x8($sp)
/* DAA4 800326A4 461C4082 */ mul.s $f2, $f8, $f28
/* DAA8 800326A8 00000000 */ nop
/* DAAC 800326AC 46001180 */ add.s $f6, $f2, $f0
/* DAB0 800326B0 44800000 */ mtc1 $zero, $f0
/* DAB4 800326B4 00000000 */ nop
/* DAB8 800326B8 4600303C */ c.lt.s $f6, $f0
/* DABC 800326BC 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* DAC0 800326C0 44812000 */ mtc1 $at, $f4
/* DAC4 800326C4 45010007 */ bc1t .L800326E4
/* DAC8 800326C8 00000000 */ nop
/* DACC 800326CC 4606003C */ c.lt.s $f0, $f6
/* DAD0 800326D0 00000000 */ nop
/* DAD4 800326D4 45000003 */ bc1f .L800326E4
/* DAD8 800326D8 46000106 */ mov.s $f4, $f0
/* DADC 800326DC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* DAE0 800326E0 44812000 */ mtc1 $at, $f4
.L800326E4:
/* DAE4 800326E4 461E5002 */ mul.s $f0, $f10, $f30
/* DAE8 800326E8 00000000 */ nop
/* DAEC 800326EC C7BC0000 */ lwc1 $f28, 0x0($sp)
/* DAF0 800326F0 461C4082 */ mul.s $f2, $f8, $f28
/* DAF4 800326F4 00000000 */ nop
/* DAF8 800326F8 46001080 */ add.s $f2, $f2, $f0
/* DAFC 800326FC 44800000 */ mtc1 $zero, $f0
/* DB00 80032700 00000000 */ nop
/* DB04 80032704 4600103C */ c.lt.s $f2, $f0
/* DB08 80032708 00000000 */ nop
/* DB0C 8003270C 45000005 */ bc1f .L80032724
/* DB10 80032710 46002186 */ mov.s $f6, $f4
/* DB14 80032714 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* DB18 80032718 44810000 */ mtc1 $at, $f0
/* DB1C 8003271C 0800C9D0 */ j .L80032740
/* DB20 80032720 00000000 */ nop
.L80032724:
/* DB24 80032724 4602003C */ c.lt.s $f0, $f2
/* DB28 80032728 00000000 */ nop
/* DB2C 8003272C 45000004 */ bc1f .L80032740
/* DB30 80032730 00000000 */ nop
/* DB34 80032734 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* DB38 80032738 44810000 */ mtc1 $at, $f0
/* DB3C 8003273C 00000000 */ nop
.L80032740:
/* DB40 80032740 46003032 */ c.eq.s $f6, $f0
/* DB44 80032744 00000000 */ nop
/* DB48 80032748 4501004E */ bc1t .L80032884
/* DB4C 8003274C 0000102D */ daddu $v0, $zero, $zero
/* DB50 80032750 46009085 */ abs.s $f2, $f18
/* DB54 80032754 46008005 */ abs.s $f0, $f16
/* DB58 80032758 4602003C */ c.lt.s $f0, $f2
/* DB5C 8003275C 00000000 */ nop
/* DB60 80032760 4500001E */ bc1f .L800327DC
/* DB64 80032764 00000000 */ nop
/* DB68 80032768 460CA002 */ mul.s $f0, $f20, $f12
/* DB6C 8003276C 00000000 */ nop
/* DB70 80032770 4612D182 */ mul.s $f6, $f26, $f18
/* DB74 80032774 00000000 */ nop
/* DB78 80032778 46189202 */ mul.s $f8, $f18, $f24
/* DB7C 8003277C 00000000 */ nop
/* DB80 80032780 46166282 */ mul.s $f10, $f12, $f22
/* DB84 80032784 00000000 */ nop
/* DB88 80032788 46106082 */ mul.s $f2, $f12, $f16
/* DB8C 8003278C 00000000 */ nop
/* DB90 80032790 460E9102 */ mul.s $f4, $f18, $f14
/* DB94 80032794 00000000 */ nop
/* DB98 80032798 46060001 */ sub.s $f0, $f0, $f6
/* DB9C 8003279C 46041081 */ sub.s $f2, $f2, $f4
/* DBA0 800327A0 46080000 */ add.s $f0, $f0, $f8
/* DBA4 800327A4 460A0181 */ sub.s $f6, $f0, $f10
/* DBA8 800327A8 46023183 */ div.s $f6, $f6, $f2
/* DBAC 800327AC 46068002 */ mul.s $f0, $f16, $f6
/* DBB0 800327B0 00000000 */ nop
/* DBB4 800327B4 4600B000 */ add.s $f0, $f22, $f0
/* DBB8 800327B8 46140001 */ sub.s $f0, $f0, $f20
/* DBBC 800327BC 46120183 */ div.s $f6, $f0, $f18
/* DBC0 800327C0 46069002 */ mul.s $f0, $f18, $f6
/* DBC4 800327C4 00000000 */ nop
/* DBC8 800327C8 46066082 */ mul.s $f2, $f12, $f6
/* DBCC 800327CC 00000000 */ nop
/* DBD0 800327D0 4600A300 */ add.s $f12, $f20, $f0
/* DBD4 800327D4 0800CA13 */ j .L8003284C
/* DBD8 800327D8 4602D180 */ add.s $f6, $f26, $f2
.L800327DC:
/* DBDC 800327DC 4610C002 */ mul.s $f0, $f24, $f16
/* DBE0 800327E0 00000000 */ nop
/* DBE4 800327E4 460EA182 */ mul.s $f6, $f20, $f14
/* DBE8 800327E8 00000000 */ nop
/* DBEC 800327EC 460EC202 */ mul.s $f8, $f24, $f14
/* DBF0 800327F0 00000000 */ nop
/* DBF4 800327F4 4610D282 */ mul.s $f10, $f26, $f16
/* DBF8 800327F8 00000000 */ nop
/* DBFC 800327FC 46106082 */ mul.s $f2, $f12, $f16
/* DC00 80032800 00000000 */ nop
/* DC04 80032804 460E9102 */ mul.s $f4, $f18, $f14
/* DC08 80032808 00000000 */ nop
/* DC0C 8003280C 46060000 */ add.s $f0, $f0, $f6
/* DC10 80032810 46041081 */ sub.s $f2, $f2, $f4
/* DC14 80032814 46080001 */ sub.s $f0, $f0, $f8
/* DC18 80032818 460A0181 */ sub.s $f6, $f0, $f10
/* DC1C 8003281C 46023183 */ div.s $f6, $f6, $f2
/* DC20 80032820 46069002 */ mul.s $f0, $f18, $f6
/* DC24 80032824 00000000 */ nop
/* DC28 80032828 4600A000 */ add.s $f0, $f20, $f0
/* DC2C 8003282C 46160001 */ sub.s $f0, $f0, $f22
/* DC30 80032830 46100183 */ div.s $f6, $f0, $f16
/* DC34 80032834 46068002 */ mul.s $f0, $f16, $f6
/* DC38 80032838 00000000 */ nop
/* DC3C 8003283C 46067082 */ mul.s $f2, $f14, $f6
/* DC40 80032840 00000000 */ nop
/* DC44 80032844 4600B300 */ add.s $f12, $f22, $f0
/* DC48 80032848 4602C180 */ add.s $f6, $f24, $f2
.L8003284C:
/* DC4C 8003284C 46166081 */ sub.s $f2, $f12, $f22
/* DC50 80032850 46021082 */ mul.s $f2, $f2, $f2
/* DC54 80032854 00000000 */ nop
/* DC58 80032858 46183001 */ sub.s $f0, $f6, $f24
/* DC5C 8003285C 8FA30060 */ lw $v1, 0x60($sp)
/* DC60 80032860 46000002 */ mul.s $f0, $f0, $f0
/* DC64 80032864 00000000 */ nop
/* DC68 80032868 E46C0000 */ swc1 $f12, 0x0($v1)
/* DC6C 8003286C 8FA30064 */ lw $v1, 0x64($sp)
/* DC70 80032870 E4660000 */ swc1 $f6, 0x0($v1)
/* DC74 80032874 46001080 */ add.s $f2, $f2, $f0
/* DC78 80032878 8FA30068 */ lw $v1, 0x68($sp)
/* DC7C 8003287C 24020001 */ addiu $v0, $zero, 0x1
/* DC80 80032880 E4620000 */ swc1 $f2, 0x0($v1)
.L80032884:
/* DC84 80032884 D7BE0038 */ ldc1 $f30, 0x38($sp)
/* DC88 80032888 D7BC0030 */ ldc1 $f28, 0x30($sp)
/* DC8C 8003288C D7BA0028 */ ldc1 $f26, 0x28($sp)
/* DC90 80032890 D7B80020 */ ldc1 $f24, 0x20($sp)
/* DC94 80032894 D7B60018 */ ldc1 $f22, 0x18($sp)
/* DC98 80032898 D7B40010 */ ldc1 $f20, 0x10($sp)
/* DC9C 8003289C 03E00008 */ jr $ra
/* DCA0 800328A0 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
s32 calculate_line_segment_intersection(f32 A1x, f32 A1z, f32 A2x, f32 A2z, f32 B1x, f32 B1z, f32 B2x, f32 B2z, f32* interX, f32* interZ, f32* squared_dist) {
f32 dx14;
f32 dx13;
f32 dz;
f32 dz12;
f32 dx34;
f32 dx12;
f32 dx;
f32 alpha;
f32 minus_dz12;
f32 B2_side;
f32 x;
f32 B1_side;
f32 z;
f32 dx12_copy;
f32 dz13;
f32 dz14;
f32 dz34;
f32 B1_side_;
dx12_copy = A2x - A1x;
dx12 = dx12_copy;
dz12 = A2z - A1z;
dx13 = B1x - A1x;
dz13 = B1z - A1z;
dx14 = B2x - A1x;
dz14 = B2z - A1z;
minus_dz12 = -dz12;
dx34 = B2x - B1x;
dz34 = B2z - B1z;
if (dx12_copy == 0.0f && dz12 == 0.0f) {
return FALSE;
}
if (dx34 == 0.0f && dz34 == 0.0f) {
return FALSE;
}
B1_side_ = minus_dz12 * dx13 + dx12_copy * dz13;
if (B1_side_ < 0.0f) {
B1_side = -1.0f;
} else if (B1_side_ > 0.0f) {
B1_side = 1.0f;
} else {
B1_side = 0.0f;
}
B1_side_ = B1_side;
dx = minus_dz12 * dx14 + dx12_copy * dz14;
if (dx < 0.0f) {
B2_side = -1.0f;
} else if (dx > 0.0f) {
B2_side = 1.0f;
} else {
B2_side = 0.0f;
}
if (B1_side_ == B2_side) {
return FALSE;
}
if (fabsf(dx12) > fabsf(dx34)) {
alpha = A1x * dz12 - A1z * dx12 + dx12 * B1z - dz12 * B1x;
alpha /= dz12 * dx34 - dx12 * dz34;
alpha = (B1x + dx34 * alpha - A1x) / dx12;
x = A1x + dx12 * alpha;
z = A1z + dz12 * alpha;
} else {
alpha = B1z * dx34 + A1x * dz34 - B1z * dz34 - A1z * dx34;
alpha /= dz12 * dx34 - dx12 * dz34;
alpha = (A1x + dx12 * alpha - B1x) / dx34;
x = B1x + dx34 * alpha;
z = B1z + dz34 * alpha;
}
dx = x - B1x;
dz = z - B1z;
*interX = x;
*interZ = z;
*squared_dist = SQ(dx) + SQ(dz);
return TRUE;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel FetchPushedBlockProperties
/* 7E3CB0 80282E30 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 7E3CB4 80282E34 AFB00010 */ sw $s0, 0x10($sp)
/* 7E3CB8 80282E38 0080802D */ daddu $s0, $a0, $zero
/* 7E3CBC 80282E3C AFBF0018 */ sw $ra, 0x18($sp)
/* 7E3CC0 80282E40 AFB10014 */ sw $s1, 0x14($sp)
/* 7E3CC4 80282E44 8E0400B0 */ lw $a0, 0xB0($s0)
/* 7E3CC8 80282E48 0C04417A */ jal get_entity_by_index
/* 7E3CCC 80282E4C 8E1100AC */ lw $s1, 0xAC($s0)
/* 7E3CD0 80282E50 3C038011 */ lui $v1, %hi(gPlayerStatus)
/* 7E3CD4 80282E54 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus)
/* 7E3CD8 80282E58 0040502D */ daddu $t2, $v0, $zero
/* 7E3CDC 80282E5C C4600028 */ lwc1 $f0, 0x28($v1)
/* 7E3CE0 80282E60 C462002C */ lwc1 $f2, 0x2C($v1)
/* 7E3CE4 80282E64 8E2D0008 */ lw $t5, 0x8($s1)
/* 7E3CE8 80282E68 8E2B000C */ lw $t3, 0xC($s1)
/* 7E3CEC 80282E6C 8E2C0010 */ lw $t4, 0x10($s1)
/* 7E3CF0 80282E70 4600010D */ trunc.w.s $f4, $f0
/* 7E3CF4 80282E74 44042000 */ mfc1 $a0, $f4
/* 7E3CF8 80282E78 4600110D */ trunc.w.s $f4, $f2
/* 7E3CFC 80282E7C 44092000 */ mfc1 $t1, $f4
/* 7E3D00 80282E80 008D2023 */ subu $a0, $a0, $t5
/* 7E3D04 80282E84 C4600030 */ lwc1 $f0, 0x30($v1)
/* 7E3D08 80282E88 012B4823 */ subu $t1, $t1, $t3
/* 7E3D0C 80282E8C 4600010D */ trunc.w.s $f4, $f0
/* 7E3D10 80282E90 44082000 */ mfc1 $t0, $f4
/* 7E3D14 80282E94 04810002 */ bgez $a0, .L80282EA0
/* 7E3D18 80282E98 010C4023 */ subu $t0, $t0, $t4
/* 7E3D1C 80282E9C 2484FFE7 */ addiu $a0, $a0, -0x19
.L80282EA0:
/* 7E3D20 80282EA0 05020001 */ bltzl $t0, .L80282EA8
/* 7E3D24 80282EA4 2508FFE7 */ addiu $t0, $t0, -0x19
.L80282EA8:
/* 7E3D28 80282EA8 3C0551EB */ lui $a1, (0x51EB851F >> 16)
/* 7E3D2C 80282EAC 34A5851F */ ori $a1, $a1, (0x51EB851F & 0xFFFF)
/* 7E3D30 80282EB0 00850018 */ mult $a0, $a1
/* 7E3D34 80282EB4 00001810 */ mfhi $v1
/* 7E3D38 80282EB8 00000000 */ nop
/* 7E3D3C 80282EBC 00000000 */ nop
/* 7E3D40 80282EC0 01250018 */ mult $t1, $a1
/* 7E3D44 80282EC4 000417C3 */ sra $v0, $a0, 31
/* 7E3D48 80282EC8 00003010 */ mfhi $a2
/* 7E3D4C 80282ECC 000318C3 */ sra $v1, $v1, 3
/* 7E3D50 80282ED0 00622023 */ subu $a0, $v1, $v0
/* 7E3D54 80282ED4 01050018 */ mult $t0, $a1
/* 7E3D58 80282ED8 000917C3 */ sra $v0, $t1, 31
/* 7E3D5C 80282EDC 000618C3 */ sra $v1, $a2, 3
/* 7E3D60 80282EE0 00624823 */ subu $t1, $v1, $v0
/* 7E3D64 80282EE4 000817C3 */ sra $v0, $t0, 31
bActorOffsets:
/* 7E3D68 80282EE8 00003810 */ mfhi $a3
/* 7E3D6C 80282EEC 000718C3 */ sra $v1, $a3, 3
/* 7E3D70 80282EF0 00624023 */ subu $t0, $v1, $v0
/* 7E3D74 80282EF4 0080382D */ daddu $a3, $a0, $zero
/* 7E3D78 80282EF8 00041040 */ sll $v0, $a0, 1
/* 7E3D7C 80282EFC 00441021 */ addu $v0, $v0, $a0
/* 7E3D80 80282F00 000210C0 */ sll $v0, $v0, 3
/* 7E3D84 80282F04 00822021 */ addu $a0, $a0, $v0
/* 7E3D88 80282F08 00091040 */ sll $v0, $t1, 1
/* 7E3D8C 80282F0C 00491021 */ addu $v0, $v0, $t1
/* 7E3D90 80282F10 000210C0 */ sll $v0, $v0, 3
/* 7E3D94 80282F14 01224821 */ addu $t1, $t1, $v0
/* 7E3D98 80282F18 0100302D */ daddu $a2, $t0, $zero
/* 7E3D9C 80282F1C 00081040 */ sll $v0, $t0, 1
/* 7E3DA0 80282F20 00481021 */ addu $v0, $v0, $t0
/* 7E3DA4 80282F24 000210C0 */ sll $v0, $v0, 3
/* 7E3DA8 80282F28 01024021 */ addu $t0, $t0, $v0
/* 7E3DAC 80282F2C 2482000C */ addiu $v0, $a0, 0xC
/* 7E3DB0 80282F30 004D2021 */ addu $a0, $v0, $t5
/* 7E3DB4 80282F34 012B4821 */ addu $t1, $t1, $t3
/* 7E3DB8 80282F38 2502000C */ addiu $v0, $t0, 0xC
/* 7E3DBC 80282F3C 004C4021 */ addu $t0, $v0, $t4
/* 7E3DC0 80282F40 AE040084 */ sw $a0, 0x84($s0)
/* 7E3DC4 80282F44 AE090088 */ sw $t1, 0x88($s0)
/* 7E3DC8 80282F48 AE08008C */ sw $t0, 0x8C($s0)
/* 7E3DCC 80282F4C C5400048 */ lwc1 $f0, 0x48($t2)
/* 7E3DD0 80282F50 4600010D */ trunc.w.s $f4, $f0
/* 7E3DD4 80282F54 44042000 */ mfc1 $a0, $f4
/* 7E3DD8 80282F58 00000000 */ nop
/* 7E3DDC 80282F5C AE040090 */ sw $a0, 0x90($s0)
/* 7E3DE0 80282F60 C540004C */ lwc1 $f0, 0x4C($t2)
/* 7E3DE4 80282F64 4600010D */ trunc.w.s $f4, $f0
/* 7E3DE8 80282F68 E6040094 */ swc1 $f4, 0x94($s0)
/* 7E3DEC 80282F6C C5400050 */ lwc1 $f0, 0x50($t2)
/* 7E3DF0 80282F70 4600010D */ trunc.w.s $f4, $f0
/* 7E3DF4 80282F74 44032000 */ mfc1 $v1, $f4
/* 7E3DF8 80282F78 00000000 */ nop
/* 7E3DFC 80282F7C AE030098 */ sw $v1, 0x98($s0)
/* 7E3E00 80282F80 8E220008 */ lw $v0, 0x8($s1)
/* 7E3E04 80282F84 00822023 */ subu $a0, $a0, $v0
/* 7E3E08 80282F88 00850018 */ mult $a0, $a1
/* 7E3E0C 80282F8C 8E220010 */ lw $v0, 0x10($s1)
/* 7E3E10 80282F90 00005010 */ mfhi $t2
/* 7E3E14 80282F94 00624023 */ subu $t0, $v1, $v0
/* 7E3E18 80282F98 000417C3 */ sra $v0, $a0, 31
/* 7E3E1C 80282F9C 01050018 */ mult $t0, $a1
/* 7E3E20 80282FA0 000A18C3 */ sra $v1, $t2, 3
/* 7E3E24 80282FA4 00625023 */ subu $t2, $v1, $v0
/* 7E3E28 80282FA8 01472823 */ subu $a1, $t2, $a3
/* 7E3E2C 80282FAC 000817C3 */ sra $v0, $t0, 31
/* 7E3E30 80282FB0 00004810 */ mfhi $t1
/* 7E3E34 80282FB4 000918C3 */ sra $v1, $t1, 3
/* 7E3E38 80282FB8 00621023 */ subu $v0, $v1, $v0
/* 7E3E3C 80282FBC 10A00005 */ beqz $a1, .L80282FD4
/* 7E3E40 80282FC0 00462023 */ subu $a0, $v0, $a2
/* 7E3E44 80282FC4 10800004 */ beqz $a0, .L80282FD8
/* 7E3E48 80282FC8 01453021 */ addu $a2, $t2, $a1
/* 7E3E4C 80282FCC 0000202D */ daddu $a0, $zero, $zero
/* 7E3E50 80282FD0 0080282D */ daddu $a1, $a0, $zero
.L80282FD4:
/* 7E3E54 80282FD4 01453021 */ addu $a2, $t2, $a1
.L80282FD8:
/* 7E3E58 80282FD8 00441821 */ addu $v1, $v0, $a0
/* 7E3E5C 80282FDC AE05009C */ sw $a1, 0x9C($s0)
/* 7E3E60 80282FE0 AE0000A0 */ sw $zero, 0xA0($s0)
/* 7E3E64 80282FE4 14A00005 */ bnez $a1, .L80282FFC
/* 7E3E68 80282FE8 AE0400A4 */ sw $a0, 0xA4($s0)
/* 7E3E6C 80282FEC 14800003 */ bnez $a0, .L80282FFC
/* 7E3E70 80282FF0 24020002 */ addiu $v0, $zero, 0x2
/* 7E3E74 80282FF4 080A0C1B */ j .L8028306C
/* 7E3E78 80282FF8 AE0200A8 */ sw $v0, 0xA8($s0)
.L80282FFC:
/* 7E3E7C 80282FFC 92240004 */ lbu $a0, 0x4($s1)
/* 7E3E80 80283000 00C4102A */ slt $v0, $a2, $a0
/* 7E3E84 80283004 10400017 */ beqz $v0, .L80283064
/* 7E3E88 80283008 24020001 */ addiu $v0, $zero, 0x1
/* 7E3E8C 8028300C 04C20016 */ bltzl $a2, .L80283068
/* 7E3E90 80283010 AE0200A8 */ sw $v0, 0xA8($s0)
/* 7E3E94 80283014 92220005 */ lbu $v0, 0x5($s1)
/* 7E3E98 80283018 0062102A */ slt $v0, $v1, $v0
/* 7E3E9C 8028301C 10400011 */ beqz $v0, .L80283064
/* 7E3EA0 80283020 24020001 */ addiu $v0, $zero, 0x1
/* 7E3EA4 80283024 0460000F */ bltz $v1, .L80283064
/* 7E3EA8 80283028 00640018 */ mult $v1, $a0
/* 7E3EAC 8028302C 8E220000 */ lw $v0, 0x0($s1)
/* 7E3EB0 80283030 00007012 */ mflo $t6
/* 7E3EB4 80283034 00CE1821 */ addu $v1, $a2, $t6
/* 7E3EB8 80283038 00431021 */ addu $v0, $v0, $v1
/* 7E3EBC 8028303C 90420000 */ lbu $v0, 0x0($v0)
/* 7E3EC0 80283040 14400008 */ bnez $v0, .L80283064
/* 7E3EC4 80283044 24020001 */ addiu $v0, $zero, 0x1
/* 7E3EC8 80283048 3C038016 */ lui $v1, %hi(gCollisionStatus)
/* 7E3ECC 8028304C 8463A550 */ lh $v1, %lo(gCollisionStatus)($v1)
/* 7E3ED0 80283050 2402FFFF */ addiu $v0, $zero, -0x1
/* 7E3ED4 80283054 10620003 */ beq $v1, $v0, .L80283064
/* 7E3ED8 80283058 24020001 */ addiu $v0, $zero, 0x1
/* 7E3EDC 8028305C 080A0C1A */ j .L80283068
/* 7E3EE0 80283060 AE0000A8 */ sw $zero, 0xA8($s0)
.L80283064:
/* 7E3EE4 80283064 AE0200A8 */ sw $v0, 0xA8($s0)
.L80283068:
/* 7E3EE8 80283068 24020002 */ addiu $v0, $zero, 0x2
.L8028306C:
/* 7E3EEC 8028306C 8FBF0018 */ lw $ra, 0x18($sp)
/* 7E3EF0 80283070 8FB10014 */ lw $s1, 0x14($sp)
/* 7E3EF4 80283074 8FB00010 */ lw $s0, 0x10($sp)
/* 7E3EF8 80283078 03E00008 */ jr $ra
/* 7E3EFC 8028307C 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(FetchPushedBlockProperties) {
PushBlockGrid* grid = (PushBlockGrid*) script->varTable[10];
Entity* entity = get_entity_by_index(script->varTable[11]);
s32 gridCenterX, gridCenterY, gridCenterZ;
s32 xThing, yThing, zThing;
s32 entityX, entityY, entityZ;
s32 varX, varZ;
s32 deltaX, deltaZ;
s32 cellX, cellZ;
s32 x2, z2;
gridCenterX = grid->centerPos.x;
gridCenterY = grid->centerPos.y;
gridCenterZ = grid->centerPos.z;
xThing = gPlayerStatus.position.x;
yThing = gPlayerStatus.position.y;
zThing = gPlayerStatus.position.z;
xThing -= gridCenterX;
yThing -= gridCenterY;
zThing -= gridCenterZ;
if (xThing < 0) {
xThing -= BLOCK_GRID_SIZE;
}
if (zThing < 0) {
zThing -= BLOCK_GRID_SIZE;
}
xThing /= BLOCK_GRID_SIZE;
yThing /= BLOCK_GRID_SIZE;
zThing /= BLOCK_GRID_SIZE;
varX = xThing;
varZ = zThing;
xThing *= BLOCK_GRID_SIZE;
yThing *= BLOCK_GRID_SIZE;
zThing *= BLOCK_GRID_SIZE;
xThing += (BLOCK_GRID_SIZE / 2) + gridCenterX;
yThing += gridCenterY;
zThing += (BLOCK_GRID_SIZE / 2) + gridCenterZ;
script->varTable[0] = xThing;
script->varTable[1] = yThing;
script->varTable[2] = zThing;
script->varTable[3] = entityX = entity->position.x;
script->varTable[4] = entityY = entity->position.y;
script->varTable[5] = entityZ = entity->position.z;
xThing = entityX - grid->centerPos.x;
zThing = entityZ - grid->centerPos.z;
x2 = xThing / BLOCK_GRID_SIZE;
z2 = zThing / BLOCK_GRID_SIZE;
deltaX = x2 - varX;
deltaZ = z2 - varZ;
if (deltaX != 0 && deltaZ != 0) {
deltaX = deltaZ = 0;
}
script->varTable[6] = deltaX;
script->varTable[7] = 0;
script->varTable[8] = deltaZ;
cellX = x2 + deltaX;
cellZ = z2 + deltaZ;
if (deltaX == 0 && deltaZ == 0) {
do {
script->varTable[9] = 2;
} while (0);
return ApiStatus_DONE2;
}
if (cellX < grid->numCellsX && cellX >= 0
&& cellZ < grid->numCellsZ && cellZ >= 0
&& grid->cells[cellX + (cellZ * grid->numCellsX)] == PUSH_GRID_EMPTY
&& gCollisionStatus.pushingAgainstWall != NO_COLLIDER)
{
script->varTable[9] = 0;
} else {
script->varTable[9] = 1;
}
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel title_screen_draw_press_start
/* 12FC8 80037BC8 3C048007 */ lui $a0, %hi(TitleScreen_PressStart_isVisibile)
/* 12FCC 80037BCC 24847A2C */ addiu $a0, $a0, %lo(TitleScreen_PressStart_isVisibile)
/* 12FD0 80037BD0 8C830000 */ lw $v1, 0x0($a0)
/* 12FD4 80037BD4 10600005 */ beqz $v1, .L80037BEC
/* 12FD8 80037BD8 24020001 */ addiu $v0, $zero, 0x1
/* 12FDC 80037BDC 10620016 */ beq $v1, $v0, .L80037C38
/* 12FE0 80037BE0 3C07FC11 */ lui $a3, (0xFC119623 >> 16)
/* 12FE4 80037BE4 0800DF22 */ j .L80037C88
/* 12FE8 80037BE8 34E79623 */ ori $a3, $a3, (0xFC119623 & 0xFFFF)
.L80037BEC:
/* 12FEC 80037BEC 3C038007 */ lui $v1, %hi(TitleScreen_PressStart_Alpha)
/* 12FF0 80037BF0 24637A28 */ addiu $v1, $v1, %lo(TitleScreen_PressStart_Alpha)
/* 12FF4 80037BF4 8C620000 */ lw $v0, 0x0($v1)
/* 12FF8 80037BF8 2442FF80 */ addiu $v0, $v0, -0x80
/* 12FFC 80037BFC 04410002 */ bgez $v0, .L80037C08
/* 13000 80037C00 AC620000 */ sw $v0, 0x0($v1)
/* 13004 80037C04 AC600000 */ sw $zero, 0x0($v1)
.L80037C08:
/* 13008 80037C08 3C038007 */ lui $v1, %hi(TitleScreen_PressStart_BlinkCounter)
/* 1300C 80037C0C 24637A30 */ addiu $v1, $v1, %lo(TitleScreen_PressStart_BlinkCounter)
/* 13010 80037C10 8C620000 */ lw $v0, 0x0($v1)
/* 13014 80037C14 24420001 */ addiu $v0, $v0, 0x1
/* 13018 80037C18 AC620000 */ sw $v0, 0x0($v1)
/* 1301C 80037C1C 28420010 */ slti $v0, $v0, 0x10
/* 13020 80037C20 14400018 */ bnez $v0, .L80037C84
/* 13024 80037C24 3C07FC11 */ lui $a3, (0xFC119623 >> 16)
/* 13028 80037C28 24020001 */ addiu $v0, $zero, 0x1
/* 1302C 80037C2C AC600000 */ sw $zero, 0x0($v1)
/* 13030 80037C30 0800DF21 */ j .L80037C84
/* 13034 80037C34 AC820000 */ sw $v0, 0x0($a0)
.L80037C38:
/* 13038 80037C38 3C038007 */ lui $v1, %hi(TitleScreen_PressStart_Alpha)
/* 1303C 80037C3C 24637A28 */ addiu $v1, $v1, %lo(TitleScreen_PressStart_Alpha)
/* 13040 80037C40 8C620000 */ lw $v0, 0x0($v1)
/* 13044 80037C44 24420080 */ addiu $v0, $v0, 0x80
/* 13048 80037C48 AC620000 */ sw $v0, 0x0($v1)
/* 1304C 80037C4C 28420100 */ slti $v0, $v0, 0x100
/* 13050 80037C50 14400002 */ bnez $v0, .L80037C5C
/* 13054 80037C54 240200FF */ addiu $v0, $zero, 0xFF
/* 13058 80037C58 AC620000 */ sw $v0, 0x0($v1)
.L80037C5C:
/* 1305C 80037C5C 3C038007 */ lui $v1, %hi(TitleScreen_PressStart_BlinkCounter)
/* 13060 80037C60 24637A30 */ addiu $v1, $v1, %lo(TitleScreen_PressStart_BlinkCounter)
/* 13064 80037C64 8C620000 */ lw $v0, 0x0($v1)
/* 13068 80037C68 24420001 */ addiu $v0, $v0, 0x1
/* 1306C 80037C6C AC620000 */ sw $v0, 0x0($v1)
/* 13070 80037C70 28420010 */ slti $v0, $v0, 0x10
/* 13074 80037C74 14400003 */ bnez $v0, .L80037C84
/* 13078 80037C78 3C07FC11 */ lui $a3, (0xFC119623 >> 16)
/* 1307C 80037C7C AC600000 */ sw $zero, 0x0($v1)
/* 13080 80037C80 AC800000 */ sw $zero, 0x0($a0)
.L80037C84:
/* 13084 80037C84 34E79623 */ ori $a3, $a3, (0xFC119623 & 0xFFFF)
.L80037C88:
/* 13088 80037C88 3C06FF2F */ lui $a2, (0xFF2FFFFF >> 16)
/* 1308C 80037C8C 34C6FFFF */ ori $a2, $a2, (0xFF2FFFFF & 0xFFFF)
/* 13090 80037C90 3C08F8F0 */ lui $t0, (0xF8F09800 >> 16)
/* 13094 80037C94 35089800 */ ori $t0, $t0, (0xF8F09800 & 0xFFFF)
/* 13098 80037C98 3C09077F */ lui $t1, (0x77FF080 >> 16)
/* 1309C 80037C9C 3529F080 */ ori $t1, $t1, (0x77FF080 & 0xFFFF)
/* 130A0 80037CA0 3C0AF568 */ lui $t2, (0xF5682000 >> 16)
/* 130A4 80037CA4 354A2000 */ ori $t2, $t2, (0xF5682000 & 0xFFFF)
/* 130A8 80037CA8 3C0B001F */ lui $t3, (0x1FC07C >> 16)
/* 130AC 80037CAC 356BC07C */ ori $t3, $t3, (0x1FC07C & 0xFFFF)
/* 130B0 80037CB0 3C0DE438 */ lui $t5, (0xE43802A4 >> 16)
/* 130B4 80037CB4 35AD02A4 */ ori $t5, $t5, (0xE43802A4 & 0xFFFF)
/* 130B8 80037CB8 3C0C0018 */ lui $t4, (0x180224 >> 16)
/* 130BC 80037CBC 358C0224 */ ori $t4, $t4, (0x180224 & 0xFFFF)
/* 130C0 80037CC0 3C0E0400 */ lui $t6, (0x4000400 >> 16)
/* 130C4 80037CC4 3C05800A */ lui $a1, %hi(gMainGfxPos)
/* 130C8 80037CC8 24A5A66C */ addiu $a1, $a1, %lo(gMainGfxPos)
/* 130CC 80037CCC 35CE0400 */ ori $t6, $t6, (0x4000400 & 0xFFFF)
/* 130D0 80037CD0 8CA20000 */ lw $v0, 0x0($a1)
/* 130D4 80037CD4 3C03DE00 */ lui $v1, (0xDE000000 >> 16)
/* 130D8 80037CD8 0040202D */ daddu $a0, $v0, $zero
/* 130DC 80037CDC 24420008 */ addiu $v0, $v0, 0x8
/* 130E0 80037CE0 ACA20000 */ sw $v0, 0x0($a1)
/* 130E4 80037CE4 AC830000 */ sw $v1, 0x0($a0)
/* 130E8 80037CE8 3C038007 */ lui $v1, %hi(D_80077A50)
/* 130EC 80037CEC 24637A50 */ addiu $v1, $v1, %lo(D_80077A50)
/* 130F0 80037CF0 AC830004 */ sw $v1, 0x4($a0)
/* 130F4 80037CF4 24430008 */ addiu $v1, $v0, 0x8
/* 130F8 80037CF8 ACA30000 */ sw $v1, 0x0($a1)
/* 130FC 80037CFC 24430010 */ addiu $v1, $v0, 0x10
/* 13100 80037D00 3C04FA00 */ lui $a0, (0xFA000000 >> 16)
/* 13104 80037D04 AC470000 */ sw $a3, 0x0($v0)
/* 13108 80037D08 AC460004 */ sw $a2, 0x4($v0)
/* 1310C 80037D0C ACA30000 */ sw $v1, 0x0($a1)
/* 13110 80037D10 3C038007 */ lui $v1, %hi(D_80077A2B)
/* 13114 80037D14 90637A2B */ lbu $v1, %lo(D_80077A2B)($v1)
/* 13118 80037D18 3C06E700 */ lui $a2, (0xE7000000 >> 16)
/* 1311C 80037D1C AC440008 */ sw $a0, 0x8($v0)
/* 13120 80037D20 00681825 */ or $v1, $v1, $t0
/* 13124 80037D24 AC43000C */ sw $v1, 0xC($v0)
/* 13128 80037D28 24430018 */ addiu $v1, $v0, 0x18
/* 1312C 80037D2C ACA30000 */ sw $v1, 0x0($a1)
/* 13130 80037D30 24430020 */ addiu $v1, $v0, 0x20
/* 13134 80037D34 AC460010 */ sw $a2, 0x10($v0)
/* 13138 80037D38 AC400014 */ sw $zero, 0x14($v0)
/* 1313C 80037D3C ACA30000 */ sw $v1, 0x0($a1)
/* 13140 80037D40 3C04800A */ lui $a0, %hi(TitleScreen_ImgList_PressStart)
/* 13144 80037D44 8C840980 */ lw $a0, %lo(TitleScreen_ImgList_PressStart)($a0)
/* 13148 80037D48 3C03FD70 */ lui $v1, (0xFD700000 >> 16)
/* 1314C 80037D4C AC430018 */ sw $v1, 0x18($v0)
/* 13150 80037D50 24430028 */ addiu $v1, $v0, 0x28
/* 13154 80037D54 AC44001C */ sw $a0, 0x1C($v0)
/* 13158 80037D58 ACA30000 */ sw $v1, 0x0($a1)
/* 1315C 80037D5C 3C03F570 */ lui $v1, (0xF5700000 >> 16)
/* 13160 80037D60 AC430020 */ sw $v1, 0x20($v0)
/* 13164 80037D64 3C030700 */ lui $v1, (0x7000000 >> 16)
/* 13168 80037D68 AC430024 */ sw $v1, 0x24($v0)
/* 1316C 80037D6C 24430030 */ addiu $v1, $v0, 0x30
/* 13170 80037D70 ACA30000 */ sw $v1, 0x0($a1)
/* 13174 80037D74 3C03E600 */ lui $v1, (0xE6000000 >> 16)
/* 13178 80037D78 AC430028 */ sw $v1, 0x28($v0)
/* 1317C 80037D7C 24430038 */ addiu $v1, $v0, 0x38
/* 13180 80037D80 AC40002C */ sw $zero, 0x2C($v0)
/* 13184 80037D84 ACA30000 */ sw $v1, 0x0($a1)
/* 13188 80037D88 3C03F300 */ lui $v1, (0xF3000000 >> 16)
/* 1318C 80037D8C AC430030 */ sw $v1, 0x30($v0)
/* 13190 80037D90 24430040 */ addiu $v1, $v0, 0x40
/* 13194 80037D94 AC490034 */ sw $t1, 0x34($v0)
/* 13198 80037D98 ACA30000 */ sw $v1, 0x0($a1)
/* 1319C 80037D9C 24430048 */ addiu $v1, $v0, 0x48
/* 131A0 80037DA0 AC460038 */ sw $a2, 0x38($v0)
/* 131A4 80037DA4 AC40003C */ sw $zero, 0x3C($v0)
/* 131A8 80037DA8 ACA30000 */ sw $v1, 0x0($a1)
/* 131AC 80037DAC 24430050 */ addiu $v1, $v0, 0x50
/* 131B0 80037DB0 AC4A0040 */ sw $t2, 0x40($v0)
/* 131B4 80037DB4 AC400044 */ sw $zero, 0x44($v0)
/* 131B8 80037DB8 ACA30000 */ sw $v1, 0x0($a1)
/* 131BC 80037DBC 3C03F200 */ lui $v1, (0xF2000000 >> 16)
/* 131C0 80037DC0 AC430048 */ sw $v1, 0x48($v0)
/* 131C4 80037DC4 24430058 */ addiu $v1, $v0, 0x58
/* 131C8 80037DC8 AC4B004C */ sw $t3, 0x4C($v0)
/* 131CC 80037DCC ACA30000 */ sw $v1, 0x0($a1)
/* 131D0 80037DD0 24430060 */ addiu $v1, $v0, 0x60
/* 131D4 80037DD4 AC4D0050 */ sw $t5, 0x50($v0)
/* 131D8 80037DD8 AC4C0054 */ sw $t4, 0x54($v0)
/* 131DC 80037DDC ACA30000 */ sw $v1, 0x0($a1)
/* 131E0 80037DE0 3C03E100 */ lui $v1, (0xE1000000 >> 16)
/* 131E4 80037DE4 AC430058 */ sw $v1, 0x58($v0)
/* 131E8 80037DE8 24430068 */ addiu $v1, $v0, 0x68
/* 131EC 80037DEC AC40005C */ sw $zero, 0x5C($v0)
/* 131F0 80037DF0 ACA30000 */ sw $v1, 0x0($a1)
/* 131F4 80037DF4 3C03F100 */ lui $v1, (0xF1000000 >> 16)
/* 131F8 80037DF8 AC430060 */ sw $v1, 0x60($v0)
/* 131FC 80037DFC 24430070 */ addiu $v1, $v0, 0x70
/* 13200 80037E00 AC4E0064 */ sw $t6, 0x64($v0)
/* 13204 80037E04 ACA30000 */ sw $v1, 0x0($a1)
/* 13208 80037E08 AC460068 */ sw $a2, 0x68($v0)
/* 1320C 80037E0C 03E00008 */ jr $ra
/* 13210 80037E10 AC40006C */ sw $zero, 0x6C($v0)
### DECOMPILED C INSTRUCTIONS:
void title_screen_draw_press_start(void) {
switch (TitleScreen_PressStart_IsVisible) {
case FALSE:
TitleScreen_PressStart_Alpha -= 128;
if (TitleScreen_PressStart_Alpha < 0) {
TitleScreen_PressStart_Alpha = 0;
}
TitleScreen_PressStart_BlinkCounter++;
if (TitleScreen_PressStart_BlinkCounter >= 16) {
TitleScreen_PressStart_BlinkCounter = 0;
TitleScreen_PressStart_IsVisible = TRUE;
}
break;
case TRUE:
TitleScreen_PressStart_Alpha += 128;
if (TitleScreen_PressStart_Alpha > 255) {
TitleScreen_PressStart_Alpha = 255;
}
TitleScreen_PressStart_BlinkCounter++;
if (TitleScreen_PressStart_BlinkCounter >= 16) {
TitleScreen_PressStart_BlinkCounter = 0;
TitleScreen_PressStart_IsVisible = FALSE;
}
}
gSPDisplayList(gMainGfxPos++, D_80077A50);
gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 152, TitleScreen_PressStart_Alpha);
gDPPipeSync(gMainGfxPos++);
gDPLoadTextureBlock(gMainGfxPos++, TitleScreen_ImgList_PressStart, G_IM_FMT_IA, G_IM_SIZ_8b, 128, VAR_1, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPTextureRectangle(gMainGfxPos++, 384, 548, 896, VAR_2, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel gather_magic_update
/* 38F064 E008E204 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 38F068 E008E208 AFB3001C */ sw $s3, 0x1C($sp)
/* 38F06C E008E20C 0080982D */ daddu $s3, $a0, $zero
/* 38F070 E008E210 AFBF0020 */ sw $ra, 0x20($sp)
/* 38F074 E008E214 AFB20018 */ sw $s2, 0x18($sp)
/* 38F078 E008E218 AFB10014 */ sw $s1, 0x14($sp)
/* 38F07C E008E21C AFB00010 */ sw $s0, 0x10($sp)
/* 38F080 E008E220 F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 38F084 E008E224 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 38F088 E008E228 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 38F08C E008E22C F7B80038 */ sdc1 $f24, 0x38($sp)
/* 38F090 E008E230 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 38F094 E008E234 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 38F098 E008E238 8E64000C */ lw $a0, 0xC($s3)
/* 38F09C E008E23C 8C830018 */ lw $v1, 0x18($a0)
/* 38F0A0 E008E240 28620064 */ slti $v0, $v1, 0x64
/* 38F0A4 E008E244 10400002 */ beqz $v0, .LE008E250
/* 38F0A8 E008E248 2462FFFF */ addiu $v0, $v1, -0x1
/* 38F0AC E008E24C AC820018 */ sw $v0, 0x18($a0)
.LE008E250:
/* 38F0B0 E008E250 8C82001C */ lw $v0, 0x1C($a0)
/* 38F0B4 E008E254 8C830018 */ lw $v1, 0x18($a0)
/* 38F0B8 E008E258 24420001 */ addiu $v0, $v0, 0x1
/* 38F0BC E008E25C 04610005 */ bgez $v1, .LE008E274
/* 38F0C0 E008E260 AC82001C */ sw $v0, 0x1C($a0)
/* 38F0C4 E008E264 0C080128 */ jal shim_remove_effect
/* 38F0C8 E008E268 0260202D */ daddu $a0, $s3, $zero
/* 38F0CC E008E26C 08023919 */ j .LE008E464
/* 38F0D0 E008E270 00000000 */ nop
.LE008E274:
/* 38F0D4 E008E274 0040182D */ daddu $v1, $v0, $zero
/* 38F0D8 E008E278 28620015 */ slti $v0, $v1, 0x15
/* 38F0DC E008E27C 10400004 */ beqz $v0, .LE008E290
/* 38F0E0 E008E280 00031040 */ sll $v0, $v1, 1
/* 38F0E4 E008E284 00431021 */ addu $v0, $v0, $v1
/* 38F0E8 E008E288 080238A5 */ j .LE008E294
/* 38F0EC E008E28C 00021080 */ sll $v0, $v0, 2
.LE008E290:
/* 38F0F0 E008E290 240200FF */ addiu $v0, $zero, 0xFF
.LE008E294:
/* 38F0F4 E008E294 AC820014 */ sw $v0, 0x14($a0)
/* 38F0F8 E008E298 30620001 */ andi $v0, $v1, 0x1
/* 38F0FC E008E29C 1040000A */ beqz $v0, .LE008E2C8
/* 38F100 E008E2A0 00000000 */ nop
/* 38F104 E008E2A4 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 38F108 E008E2A8 44811800 */ mtc1 $at, $f3
/* 38F10C E008E2AC 44801000 */ mtc1 $zero, $f2
/* 38F110 E008E2B0 C4800014 */ lwc1 $f0, 0x14($a0)
/* 38F114 E008E2B4 46800021 */ cvt.d.w $f0, $f0
/* 38F118 E008E2B8 46220002 */ mul.d $f0, $f0, $f2
/* 38F11C E008E2BC 00000000 */ nop
/* 38F120 E008E2C0 4620018D */ trunc.w.d $f6, $f0
/* 38F124 E008E2C4 E4860014 */ swc1 $f6, 0x14($a0)
.LE008E2C8:
/* 38F128 E008E2C8 8C83001C */ lw $v1, 0x1C($a0)
/* 38F12C E008E2CC 8E620008 */ lw $v0, 0x8($s3)
/* 38F130 E008E2D0 24110001 */ addiu $s1, $zero, 0x1
/* 38F134 E008E2D4 0222102A */ slt $v0, $s1, $v0
/* 38F138 E008E2D8 10400062 */ beqz $v0, .LE008E464
/* 38F13C E008E2DC 24840048 */ addiu $a0, $a0, 0x48
/* 38F140 E008E2E0 00719024 */ and $s2, $v1, $s1
/* 38F144 E008E2E4 24900024 */ addiu $s0, $a0, 0x24
/* 38F148 E008E2E8 4480E000 */ mtc1 $zero, $f28
/* 38F14C E008E2EC 3C014000 */ lui $at, (0x40000000 >> 16)
/* 38F150 E008E2F0 4481F000 */ mtc1 $at, $f30
.LE008E2F4:
/* 38F154 E008E2F4 C614FFFC */ lwc1 $f20, -0x4($s0)
/* 38F158 E008E2F8 C6180008 */ lwc1 $f24, 0x8($s0)
/* 38F15C E008E2FC C61A0000 */ lwc1 $f26, 0x0($s0)
/* 38F160 E008E300 0C080140 */ jal shim_sin_deg
/* 38F164 E008E304 4600A306 */ mov.s $f12, $f20
/* 38F168 E008E308 4600A306 */ mov.s $f12, $f20
/* 38F16C E008E30C 0C080144 */ jal shim_cos_deg
/* 38F170 E008E310 46000586 */ mov.s $f22, $f0
/* 38F174 E008E314 4600D306 */ mov.s $f12, $f26
/* 38F178 E008E318 0C080140 */ jal shim_sin_deg
/* 38F17C E008E31C 46000506 */ mov.s $f20, $f0
/* 38F180 E008E320 4600D306 */ mov.s $f12, $f26
/* 38F184 E008E324 0C080144 */ jal shim_cos_deg
/* 38F188 E008E328 46000686 */ mov.s $f26, $f0
/* 38F18C E008E32C 4616C582 */ mul.s $f22, $f24, $f22
/* 38F190 E008E330 00000000 */ nop
/* 38F194 E008E334 4614C502 */ mul.s $f20, $f24, $f20
/* 38F198 E008E338 00000000 */ nop
/* 38F19C E008E33C 461AC602 */ mul.s $f24, $f24, $f26
/* 38F1A0 E008E340 00000000 */ nop
/* 38F1A4 E008E344 4600B582 */ mul.s $f22, $f22, $f0
/* 38F1A8 E008E348 00000000 */ nop
/* 38F1AC E008E34C 4600A502 */ mul.s $f20, $f20, $f0
/* 38F1B0 E008E350 00000000 */ nop
/* 38F1B4 E008E354 3C0142C8 */ lui $at, (0x42C80000 >> 16)
/* 38F1B8 E008E358 44813000 */ mtc1 $at, $f6
/* 38F1BC E008E35C C6000008 */ lwc1 $f0, 0x8($s0)
/* 38F1C0 E008E360 46003001 */ sub.s $f0, $f6, $f0
/* 38F1C4 E008E364 3C01437F */ lui $at, (0x437F0000 >> 16)
/* 38F1C8 E008E368 44811000 */ mtc1 $at, $f2
/* 38F1CC E008E36C 00000000 */ nop
/* 38F1D0 E008E370 46020002 */ mul.s $f0, $f0, $f2
/* 38F1D4 E008E374 00000000 */ nop
/* 38F1D8 E008E378 E618FFEC */ swc1 $f24, -0x14($s0)
/* 38F1DC E008E37C 46000000 */ add.s $f0, $f0, $f0
/* 38F1E0 E008E380 E616FFE4 */ swc1 $f22, -0x1C($s0)
/* 38F1E4 E008E384 E614FFE8 */ swc1 $f20, -0x18($s0)
/* 38F1E8 E008E388 46060003 */ div.s $f0, $f0, $f6
/* 38F1EC E008E38C 4600018D */ trunc.w.s $f6, $f0
/* 38F1F0 E008E390 44023000 */ mfc1 $v0, $f6
/* 38F1F4 E008E394 00000000 */ nop
/* 38F1F8 E008E398 AE02FFF0 */ sw $v0, -0x10($s0)
/* 38F1FC E008E39C 28420100 */ slti $v0, $v0, 0x100
/* 38F200 E008E3A0 14400004 */ bnez $v0, .LE008E3B4
/* 38F204 E008E3A4 32220003 */ andi $v0, $s1, 0x3
/* 38F208 E008E3A8 240200FF */ addiu $v0, $zero, 0xFF
/* 38F20C E008E3AC AE02FFF0 */ sw $v0, -0x10($s0)
/* 38F210 E008E3B0 32220003 */ andi $v0, $s1, 0x3
.LE008E3B4:
/* 38F214 E008E3B4 00021040 */ sll $v0, $v0, 1
/* 38F218 E008E3B8 C6000008 */ lwc1 $f0, 0x8($s0)
/* 38F21C E008E3BC 3C0142A0 */ lui $at, (0x42A00000 >> 16)
/* 38F220 E008E3C0 44811000 */ mtc1 $at, $f2
/* 38F224 E008E3C4 24420002 */ addiu $v0, $v0, 0x2
/* 38F228 E008E3C8 46020003 */ div.s $f0, $f0, $f2
/* 38F22C E008E3CC 3C01E009 */ lui $at, (0xE0090000 >> 16)
/* 38F230 E008E3D0 D422E8A0 */ ldc1 $f2, -0x1760($at)
/* 38F234 E008E3D4 46000021 */ cvt.d.s $f0, $f0
/* 38F238 E008E3D8 46220000 */ add.d $f0, $f0, $f2
/* 38F23C E008E3DC C6040008 */ lwc1 $f4, 0x8($s0)
/* 38F240 E008E3E0 44821000 */ mtc1 $v0, $f2
/* 38F244 E008E3E4 00000000 */ nop
/* 38F248 E008E3E8 468010A0 */ cvt.s.w $f2, $f2
/* 38F24C E008E3EC 46022101 */ sub.s $f4, $f4, $f2
/* 38F250 E008E3F0 46200020 */ cvt.s.d $f0, $f0
/* 38F254 E008E3F4 461C203C */ c.lt.s $f4, $f28
/* 38F258 E008E3F8 E6000004 */ swc1 $f0, 0x4($s0)
/* 38F25C E008E3FC 45000003 */ bc1f .LE008E40C
/* 38F260 E008E400 E6040008 */ swc1 $f4, 0x8($s0)
/* 38F264 E008E404 E61C0008 */ swc1 $f28, 0x8($s0)
/* 38F268 E008E408 E61C0004 */ swc1 $f28, 0x4($s0)
.LE008E40C:
/* 38F26C E008E40C C600FFFC */ lwc1 $f0, -0x4($s0)
/* 38F270 E008E410 52400005 */ beql $s2, $zero, .LE008E428
/* 38F274 E008E414 461E0000 */ add.s $f0, $f0, $f30
/* 38F278 E008E418 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 38F27C E008E41C 44813000 */ mtc1 $at, $f6
/* 38F280 E008E420 00000000 */ nop
/* 38F284 E008E424 46060000 */ add.s $f0, $f0, $f6
.LE008E428:
/* 38F288 E008E428 E600FFFC */ swc1 $f0, -0x4($s0)
/* 38F28C E008E42C 12400003 */ beqz $s2, .LE008E43C
/* 38F290 E008E430 C6000000 */ lwc1 $f0, 0x0($s0)
/* 38F294 E008E434 08023913 */ j .LE008E44C
/* 38F298 E008E438 461E0000 */ add.s $f0, $f0, $f30
.LE008E43C:
/* 38F29C E008E43C 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 38F2A0 E008E440 44813000 */ mtc1 $at, $f6
/* 38F2A4 E008E444 00000000 */ nop
/* 38F2A8 E008E448 46060000 */ add.s $f0, $f0, $f6
.LE008E44C:
/* 38F2AC E008E44C E6000000 */ swc1 $f0, 0x0($s0)
/* 38F2B0 E008E450 26310001 */ addiu $s1, $s1, 0x1
/* 38F2B4 E008E454 8E620008 */ lw $v0, 0x8($s3)
/* 38F2B8 E008E458 0222102A */ slt $v0, $s1, $v0
/* 38F2BC E008E45C 1440FFA5 */ bnez $v0, .LE008E2F4
/* 38F2C0 E008E460 26100048 */ addiu $s0, $s0, 0x48
.LE008E464:
/* 38F2C4 E008E464 8FBF0020 */ lw $ra, 0x20($sp)
/* 38F2C8 E008E468 8FB3001C */ lw $s3, 0x1C($sp)
/* 38F2CC E008E46C 8FB20018 */ lw $s2, 0x18($sp)
/* 38F2D0 E008E470 8FB10014 */ lw $s1, 0x14($sp)
/* 38F2D4 E008E474 8FB00010 */ lw $s0, 0x10($sp)
/* 38F2D8 E008E478 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 38F2DC E008E47C D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 38F2E0 E008E480 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 38F2E4 E008E484 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 38F2E8 E008E488 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 38F2EC E008E48C D7B40028 */ ldc1 $f20, 0x28($sp)
/* 38F2F0 E008E490 03E00008 */ jr $ra
/* 38F2F4 E008E494 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
void gather_magic_update(EffectInstance* effect) {
GatherMagicFXData* part = effect->data.gatherMagic;
s32 unk_1C;
s32 i;
if (part->unk_18 < 100) {
part->unk_18--;
}
part->unk_1C++;
if (part->unk_18 < 0) {
shim_remove_effect(effect);
return;
}
unk_1C = part->unk_1C;
if (unk_1C < 21) {
part->unk_14 = unk_1C * 12;
} else {
part->unk_14 = 255;
}
if (unk_1C % 2) {
part->unk_14 *= 0.5;
}
unk_1C = part->unk_1C;
part++;
for (i = 1; i < effect->numParts; i++, part++) {
f32 unk_20 = part->unk_20;
f32 unk_2C = part->unk_2C;
f32 unk_24 = part->unk_24;
f32 sin_20 = shim_sin_deg(unk_20);
f32 cos_20 = shim_cos_deg(unk_20);
f32 sin_24 = shim_sin_deg(unk_24);
f32 cos_24 = shim_cos_deg(unk_24);
part->unk_08 = unk_2C * sin_20 * cos_24;
part->unk_0C = unk_2C * cos_20 * cos_24;
part->unk_10 = unk_2C * sin_24;
part->unk_14 = ((100.0f - part->unk_2C) * 255.0f * 2.0f) / 100.0f;
if (part->unk_14 >= 256) {
part->unk_14 = 255;
}
part->unk_28 = part->unk_2C / 80.0f + 0.2;
part->unk_2C -= (i & 3) * 2 + 2;
if (part->unk_2C < 0.0f) {
part->unk_2C = 0.0f;
part->unk_28 = 0.0f;
}
part->unk_20 += (unk_1C % 2) ? 5.0f : 2.0f;
part->unk_24 += (unk_1C % 2) ? 2.0f : 5.0f;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel hud_element_clear_cache
/* D7800 80141100 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* D7804 80141104 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* D7808 80141108 27BDFFE8 */ addiu $sp, $sp, -0x18
/* D780C 8014110C AFBF0010 */ sw $ra, 0x10($sp)
/* D7810 80141110 80420070 */ lb $v0, 0x70($v0)
/* D7814 80141114 14400011 */ bnez $v0, .L8014115C
/* D7818 80141118 00000000 */ nop
/* D781C 8014111C 3C028015 */ lui $v0, %hi(gHudElementsWorld)
/* D7820 80141120 24426F60 */ addiu $v0, $v0, %lo(gHudElementsWorld)
/* D7824 80141124 3C018015 */ lui $at, %hi(gHudElements)
/* D7828 80141128 AC227960 */ sw $v0, %lo(gHudElements)($at)
/* D782C 8014112C 3C028015 */ lui $v0, %hi(gHudElementCacheSizeWorld)
/* D7830 80141130 24427968 */ addiu $v0, $v0, %lo(gHudElementCacheSizeWorld)
/* D7834 80141134 3C018015 */ lui $at, %hi(gHudElementCacheSize)
/* D7838 80141138 AC22133C */ sw $v0, %lo(gHudElementCacheSize)($at)
/* D783C 8014113C 3C028015 */ lui $v0, %hi(gHudElementCacheTableRasterWorld)
/* D7840 80141140 24427970 */ addiu $v0, $v0, %lo(gHudElementCacheTableRasterWorld)
/* D7844 80141144 3C018015 */ lui $at, %hi(gHudElementCacheTableRaster)
/* D7848 80141148 AC2212C8 */ sw $v0, %lo(gHudElementCacheTableRaster)($at)
/* D784C 8014114C 3C028015 */ lui $v0, %hi(gHudElementCacheTablePaletteWorld)
/* D7850 80141150 24427F70 */ addiu $v0, $v0, %lo(gHudElementCacheTablePaletteWorld)
/* D7854 80141154 08050465 */ j .L80141194
/* D7858 80141158 00000000 */ nop
.L8014115C:
/* D785C 8014115C 3C028015 */ lui $v0, %hi(gHudElementsBattle)
/* D7860 80141160 24427460 */ addiu $v0, $v0, %lo(gHudElementsBattle)
/* D7864 80141164 3C018015 */ lui $at, %hi(gHudElements)
/* D7868 80141168 AC227960 */ sw $v0, %lo(gHudElements)($at)
/* D786C 8014116C 3C028016 */ lui $v0, %hi(gHudElementCacheSizeBattle)
/* D7870 80141170 24428574 */ addiu $v0, $v0, %lo(gHudElementCacheSizeBattle)
/* D7874 80141174 3C018015 */ lui $at, %hi(gHudElementCacheSize)
/* D7878 80141178 AC22133C */ sw $v0, %lo(gHudElementCacheSize)($at)
/* D787C 8014117C 3C028016 */ lui $v0, %hi(gHudElementCacheTableRasterBattle)
/* D7880 80141180 24428580 */ addiu $v0, $v0, %lo(gHudElementCacheTableRasterBattle)
/* D7884 80141184 3C018015 */ lui $at, %hi(gHudElementCacheTableRaster)
/* D7888 80141188 AC2212C8 */ sw $v0, %lo(gHudElementCacheTableRaster)($at)
/* D788C 8014118C 3C028016 */ lui $v0, %hi(gHudElementCacheTablePaletteBattle)
/* D7890 80141190 24428B80 */ addiu $v0, $v0, %lo(gHudElementCacheTablePaletteBattle)
.L80141194:
/* D7894 80141194 3C018015 */ lui $at, %hi(gHudElementCacheTablePalette)
/* D7898 80141198 AC2212D0 */ sw $v0, %lo(gHudElementCacheTablePalette)($at)
/* D789C 8014119C 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* D78A0 801411A0 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* D78A4 801411A4 80420070 */ lb $v0, 0x70($v0)
/* D78A8 801411A8 1440001F */ bnez $v0, .L80141228
/* D78AC 801411AC 00000000 */ nop
/* D78B0 801411B0 3C048015 */ lui $a0, %hi(gHudElementCacheCapacity)
/* D78B4 801411B4 0C00AB0A */ jal general_heap_malloc
/* D78B8 801411B8 8C84EFC4 */ lw $a0, %lo(gHudElementCacheCapacity)($a0)
/* D78BC 801411BC 3C018015 */ lui $at, %hi(gHudElementCacheBuffer)
/* D78C0 801411C0 AC221314 */ sw $v0, %lo(gHudElementCacheBuffer)($at)
/* D78C4 801411C4 14400003 */ bnez $v0, .L801411D4
/* D78C8 801411C8 0000202D */ daddu $a0, $zero, $zero
.L801411CC:
/* D78CC 801411CC 08050473 */ j .L801411CC
/* D78D0 801411D0 00000000 */ nop
.L801411D4:
/* D78D4 801411D4 3C028015 */ lui $v0, %hi(gHudElementCacheBuffer)
/* D78D8 801411D8 8C421314 */ lw $v0, %lo(gHudElementCacheBuffer)($v0)
/* D78DC 801411DC 3C038015 */ lui $v1, %hi(gHudElementCacheSize)
/* D78E0 801411E0 8C63133C */ lw $v1, %lo(gHudElementCacheSize)($v1)
/* D78E4 801411E4 2406FFFF */ addiu $a2, $zero, -0x1
/* D78E8 801411E8 3C018015 */ lui $at, %hi(gHudElementCacheBufferWorld)
/* D78EC 801411EC AC227964 */ sw $v0, %lo(gHudElementCacheBufferWorld)($at)
/* D78F0 801411F0 AC600000 */ sw $zero, 0x0($v1)
/* D78F4 801411F4 3C058015 */ lui $a1, %hi(gHudElementCacheTablePalette)
/* D78F8 801411F8 8CA512D0 */ lw $a1, %lo(gHudElementCacheTablePalette)($a1)
/* D78FC 801411FC 3C038015 */ lui $v1, %hi(gHudElementCacheTableRaster)
/* D7900 80141200 8C6312C8 */ lw $v1, %lo(gHudElementCacheTableRaster)($v1)
.L80141204:
/* D7904 80141204 AC660000 */ sw $a2, 0x0($v1)
/* D7908 80141208 ACA60000 */ sw $a2, 0x0($a1)
/* D790C 8014120C 24A50008 */ addiu $a1, $a1, 0x8
/* D7910 80141210 24840001 */ addiu $a0, $a0, 0x1
/* D7914 80141214 288200C0 */ slti $v0, $a0, 0xC0
/* D7918 80141218 1440FFFA */ bnez $v0, .L80141204
/* D791C 8014121C 24630008 */ addiu $v1, $v1, 0x8
/* D7920 80141220 080504AF */ j .L801412BC
/* D7924 80141224 00000000 */ nop
.L80141228:
/* D7928 80141228 3C028015 */ lui $v0, %hi(gHudElementAuxCache)
/* D792C 8014122C 8C42EFC0 */ lw $v0, %lo(gHudElementAuxCache)($v0)
/* D7930 80141230 5440000D */ bnel $v0, $zero, .L80141268
/* D7934 80141234 0000202D */ daddu $a0, $zero, $zero
/* D7938 80141238 3C048015 */ lui $a0, %hi(gHudElementCacheCapacity)
/* D793C 8014123C 8C84EFC4 */ lw $a0, %lo(gHudElementCacheCapacity)($a0)
/* D7940 80141240 000417C2 */ srl $v0, $a0, 31
/* D7944 80141244 00822021 */ addu $a0, $a0, $v0
/* D7948 80141248 0C00AB0A */ jal general_heap_malloc
/* D794C 8014124C 00042043 */ sra $a0, $a0, 1
/* D7950 80141250 3C018015 */ lui $at, %hi(gHudElementCacheBuffer)
/* D7954 80141254 AC221314 */ sw $v0, %lo(gHudElementCacheBuffer)($at)
/* D7958 80141258 54400005 */ bnel $v0, $zero, .L80141270
/* D795C 8014125C 0000202D */ daddu $a0, $zero, $zero
.L80141260:
/* D7960 80141260 08050498 */ j .L80141260
/* D7964 80141264 00000000 */ nop
.L80141268:
/* D7968 80141268 3C018015 */ lui $at, %hi(gHudElementCacheBuffer)
/* D796C 8014126C AC221314 */ sw $v0, %lo(gHudElementCacheBuffer)($at)
.L80141270:
/* D7970 80141270 3C028015 */ lui $v0, %hi(gHudElementCacheBuffer)
/* D7974 80141274 8C421314 */ lw $v0, %lo(gHudElementCacheBuffer)($v0)
/* D7978 80141278 3C038015 */ lui $v1, %hi(gHudElementCacheSize)
/* D797C 8014127C 8C63133C */ lw $v1, %lo(gHudElementCacheSize)($v1)
/* D7980 80141280 2406FFFF */ addiu $a2, $zero, -0x1
/* D7984 80141284 3C018016 */ lui $at, %hi(gHudElementCacheBufferBattle)
/* D7988 80141288 AC228570 */ sw $v0, %lo(gHudElementCacheBufferBattle)($at)
/* D798C 8014128C AC600000 */ sw $zero, 0x0($v1)
/* D7990 80141290 3C058015 */ lui $a1, %hi(gHudElementCacheTablePalette)
/* D7994 80141294 8CA512D0 */ lw $a1, %lo(gHudElementCacheTablePalette)($a1)
/* D7998 80141298 3C038015 */ lui $v1, %hi(gHudElementCacheTableRaster)
/* D799C 8014129C 8C6312C8 */ lw $v1, %lo(gHudElementCacheTableRaster)($v1)
.L801412A0:
/* D79A0 801412A0 AC660000 */ sw $a2, 0x0($v1)
/* D79A4 801412A4 ACA60000 */ sw $a2, 0x0($a1)
/* D79A8 801412A8 24A50008 */ addiu $a1, $a1, 0x8
/* D79AC 801412AC 24840001 */ addiu $a0, $a0, 0x1
/* D79B0 801412B0 288200C0 */ slti $v0, $a0, 0xC0
/* D79B4 801412B4 1440FFFA */ bnez $v0, .L801412A0
/* D79B8 801412B8 24630008 */ addiu $v1, $v1, 0x8
.L801412BC:
/* D79BC 801412BC 3C028015 */ lui $v0, %hi(gHudElements)
/* D79C0 801412C0 8C427960 */ lw $v0, %lo(gHudElements)($v0)
/* D79C4 801412C4 2404013F */ addiu $a0, $zero, 0x13F
/* D79C8 801412C8 244204FC */ addiu $v0, $v0, 0x4FC
.L801412CC:
/* D79CC 801412CC AC400000 */ sw $zero, 0x0($v0)
/* D79D0 801412D0 2484FFFF */ addiu $a0, $a0, -0x1
/* D79D4 801412D4 0481FFFD */ bgez $a0, .L801412CC
/* D79D8 801412D8 2442FFFC */ addiu $v0, $v0, -0x4
/* D79DC 801412DC 3C018015 */ lui $at, %hi(gHudElementsNumber)
/* D79E0 801412E0 AC2012B4 */ sw $zero, %lo(gHudElementsNumber)($at)
/* D79E4 801412E4 3C018016 */ lui $at, %hi(D_80159180)
/* D79E8 801412E8 AC209180 */ sw $zero, %lo(D_80159180)($at)
/* D79EC 801412EC 0C0504FE */ jal func_801413F8
/* D79F0 801412F0 00000000 */ nop
/* D79F4 801412F4 8FBF0010 */ lw $ra, 0x10($sp)
/* D79F8 801412F8 03E00008 */ jr $ra
/* D79FC 801412FC 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void hud_element_clear_cache(void) {
s32 i;
HudCacheEntry* entryRaster;
HudCacheEntry* entryPalette;
if (!gGameStatusPtr->isBattle) {
gHudElements = &gHudElementsWorld;
gHudElementCacheSize = &gHudElementCacheSizeWorld;
gHudElementCacheTableRaster = gHudElementCacheTableRasterWorld;
gHudElementCacheTablePalette = gHudElementCacheTablePaletteWorld;
} else {
gHudElements = &gHudElementsBattle;
gHudElementCacheSize = &gHudElementCacheSizeBattle;
gHudElementCacheTableRaster = gHudElementCacheTableRasterBattle;
gHudElementCacheTablePalette = gHudElementCacheTablePaletteBattle;
}
if (!gGameStatusPtr->isBattle) {
gHudElementCacheBuffer = general_heap_malloc(gHudElementCacheCapacity);
ASSERT(gHudElementCacheBuffer);
gHudElementCacheBufferWorld = gHudElementCacheBuffer;
*gHudElementCacheSize = 0;
entryRaster = gHudElementCacheTableRaster;
entryPalette = gHudElementCacheTablePalette;
for (i = 0; i < MAX_HUD_CACHE_ENTRIES; i++) {
entryRaster[i].id = -1;
entryPalette[i].id = -1;
}
} else {
if (gHudElementAuxCache == NULL) {
gHudElementCacheBuffer = general_heap_malloc(gHudElementCacheCapacity / 2);
ASSERT(gHudElementCacheBuffer);
} else {
gHudElementCacheBuffer = gHudElementAuxCache;
}
gHudElementCacheBufferBattle = gHudElementCacheBuffer;
*gHudElementCacheSize = 0;
entryRaster = gHudElementCacheTableRaster;
entryPalette = gHudElementCacheTablePalette;
for (i = 0; i < MAX_HUD_CACHE_ENTRIES; i++) {
entryRaster[i].id = -1;
entryPalette[i].id = -1;
}
}
for (i = 0; i < ARRAY_COUNT(*gHudElements); i++) {
(*gHudElements)[i] = NULL;
}
gHudElementsNumber = 0;
D_80159180 = 0;
func_801413F8();
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_80244550
/* A2E790 80244550 27BDFFB8 */ addiu $sp, $sp, -0x48
/* A2E794 80244554 AFB60028 */ sw $s6, 0x28($sp)
/* A2E798 80244558 0080B02D */ daddu $s6, $a0, $zero
.L8024455C:
/* A2E79C 8024455C AFB00010 */ sw $s0, 0x10($sp)
D_80244560:
/* A2E7A0 80244560 00A0802D */ daddu $s0, $a1, $zero
/* A2E7A4 80244564 AFBF002C */ sw $ra, 0x2C($sp)
/* A2E7A8 80244568 AFB50024 */ sw $s5, 0x24($sp)
.L8024456C:
/* A2E7AC 8024456C AFB40020 */ sw $s4, 0x20($sp)
/* A2E7B0 80244570 AFB3001C */ sw $s3, 0x1C($sp)
/* A2E7B4 80244574 AFB20018 */ sw $s2, 0x18($sp)
D_80244578:
/* A2E7B8 80244578 AFB10014 */ sw $s1, 0x14($sp)
/* A2E7BC 8024457C F7B80040 */ sdc1 $f24, 0x40($sp)
/* A2E7C0 80244580 F7B60038 */ sdc1 $f22, 0x38($sp)
/* A2E7C4 80244584 F7B40030 */ sdc1 $f20, 0x30($sp)
/* A2E7C8 80244588 0C0B36B0 */ jal resolve_npc
/* A2E7CC 8024458C 24050009 */ addiu $a1, $zero, 0x9
D_80244590:
/* A2E7D0 80244590 02C0202D */ daddu $a0, $s6, $zero
/* A2E7D4 80244594 3C05F4AC */ lui $a1, (0xF4ACD480 >> 16)
/* A2E7D8 80244598 34A5D480 */ ori $a1, $a1, (0xF4ACD480 & 0xFFFF)
D_8024459C:
/* A2E7DC 8024459C 0C0B1EAF */ jal evt_get_variable
.L802445A0:
/* A2E7E0 802445A0 0040A02D */ daddu $s4, $v0, $zero
D_802445A4:
/* A2E7E4 802445A4 1200002B */ beqz $s0, D_80244654
D_802445A8:
/* A2E7E8 802445A8 0040A82D */ daddu $s5, $v0, $zero
/* A2E7EC 802445AC 0000802D */ daddu $s0, $zero, $zero
/* A2E7F0 802445B0 3C138025 */ lui $s3, %hi(D_8024F358)
/* A2E7F4 802445B4 2673F358 */ addiu $s3, $s3, %lo(D_8024F358)
/* A2E7F8 802445B8 3C128025 */ lui $s2, %hi(D_8024F338)
/* A2E7FC 802445BC 2652F338 */ addiu $s2, $s2, %lo(D_8024F338)
D_802445C0:
/* A2E800 802445C0 C6800038 */ lwc1 $f0, 0x38($s4)
.L802445C4:
/* A2E804 802445C4 C682003C */ lwc1 $f2, 0x3C($s4)
jtbl_802445C8:
/* A2E808 802445C8 C6840040 */ lwc1 $f4, 0x40($s4)
/* A2E80C 802445CC 3C118025 */ lui $s1, %hi(D_8024F318)
D_802445D0:
/* A2E810 802445D0 2631F318 */ addiu $s1, $s1, %lo(D_8024F318)
D_802445D4:
/* A2E814 802445D4 3C018025 */ lui $at, %hi(D_8024F2FC)
.L802445D8:
/* A2E818 802445D8 E420F2FC */ swc1 $f0, %lo(D_8024F2FC)($at)
/* A2E81C 802445DC 3C018025 */ lui $at, %hi(D_8024F300)
/* A2E820 802445E0 E422F300 */ swc1 $f2, %lo(D_8024F300)($at)
.L802445E4:
/* A2E824 802445E4 3C018025 */ lui $at, %hi(D_8024F304)
/* A2E828 802445E8 E424F304 */ swc1 $f4, %lo(D_8024F304)($at)
.L802445EC:
/* A2E82C 802445EC 02C0202D */ daddu $a0, $s6, $zero
D_802445F0:
/* A2E830 802445F0 0C0B36B0 */ jal resolve_npc
/* A2E834 802445F4 0200282D */ daddu $a1, $s0, $zero
D_802445F8:
/* A2E838 802445F8 C4400038 */ lwc1 $f0, 0x38($v0)
D_802445FC:
/* A2E83C 802445FC 26100001 */ addiu $s0, $s0, 0x1
D_80244600:
/* A2E840 80244600 E6200000 */ swc1 $f0, 0x0($s1)
D_80244604:
/* A2E844 80244604 C440003C */ lwc1 $f0, 0x3C($v0)
/* A2E848 80244608 26310004 */ addiu $s1, $s1, 0x4
/* A2E84C 8024460C E6400000 */ swc1 $f0, 0x0($s2)
D_80244610:
/* A2E850 80244610 26520004 */ addiu $s2, $s2, 0x4
/* A2E854 80244614 C4400040 */ lwc1 $f0, 0x40($v0)
/* A2E858 80244618 2A020007 */ slti $v0, $s0, 0x7
.L8024461C:
/* A2E85C 8024461C E6600000 */ swc1 $f0, 0x0($s3)
D_80244620:
/* A2E860 80244620 1440FFF2 */ bnez $v0, .L802445EC
/* A2E864 80244624 26730004 */ addiu $s3, $s3, 0x4
D_80244628:
/* A2E868 80244628 8EA2000C */ lw $v0, 0xC($s5)
D_8024462C_EEABDC:
/* A2E86C 8024462C 0040182D */ daddu $v1, $v0, $zero
D_80244630_EEABE0:
/* A2E870 80244630 C4440004 */ lwc1 $f4, 0x4($v0)
/* A2E874 80244634 C4400008 */ lwc1 $f0, 0x8($v0)
jtbl_80244638:
/* A2E878 80244638 C462000C */ lwc1 $f2, 0xC($v1)
/* A2E87C 8024463C 3C018025 */ lui $at, %hi(D_8024F308)
.L80244640:
/* A2E880 80244640 E424F308 */ swc1 $f4, %lo(D_8024F308)($at)
D_80244644:
/* A2E884 80244644 3C018025 */ lui $at, %hi(D_8024F30C)
/* A2E888 80244648 E420F30C */ swc1 $f0, %lo(D_8024F30C)($at)
/* A2E88C 8024464C 3C018025 */ lui $at, %hi(D_8024F310)
/* A2E890 80244650 E422F310 */ swc1 $f2, %lo(D_8024F310)($at)
D_80244654:
/* A2E894 80244654 0000802D */ daddu $s0, $zero, $zero
.L80244658:
/* A2E898 80244658 C6820038 */ lwc1 $f2, 0x38($s4)
D_8024465C:
/* A2E89C 8024465C 3C018025 */ lui $at, %hi(D_8024F2FC)
/* A2E8A0 80244660 C420F2FC */ lwc1 $f0, %lo(D_8024F2FC)($at)
/* A2E8A4 80244664 3C138025 */ lui $s3, %hi(D_8024F358)
/* A2E8A8 80244668 2673F358 */ addiu $s3, $s3, %lo(D_8024F358)
/* A2E8AC 8024466C 46001501 */ sub.s $f20, $f2, $f0
.L80244670:
/* A2E8B0 80244670 C682003C */ lwc1 $f2, 0x3C($s4)
.L80244674:
/* A2E8B4 80244674 3C018025 */ lui $at, %hi(D_8024F300)
jtbl_80244678:
/* A2E8B8 80244678 C420F300 */ lwc1 $f0, %lo(D_8024F300)($at)
/* A2E8BC 8024467C 3C128025 */ lui $s2, %hi(D_8024F338)
D_80244680:
/* A2E8C0 80244680 2652F338 */ addiu $s2, $s2, %lo(D_8024F338)
/* A2E8C4 80244684 46001581 */ sub.s $f22, $f2, $f0
D_80244688:
/* A2E8C8 80244688 C6820040 */ lwc1 $f2, 0x40($s4)
D_8024468C:
/* A2E8CC 8024468C 3C018025 */ lui $at, %hi(D_8024F304)
/* A2E8D0 80244690 C420F304 */ lwc1 $f0, %lo(D_8024F304)($at)
/* A2E8D4 80244694 3C118025 */ lui $s1, %hi(D_8024F318)
D_80244698:
/* A2E8D8 80244698 2631F318 */ addiu $s1, $s1, %lo(D_8024F318)
/* A2E8DC 8024469C 46001601 */ sub.s $f24, $f2, $f0
.L802446A0:
/* A2E8E0 802446A0 02C0202D */ daddu $a0, $s6, $zero
.L802446A4:
/* A2E8E4 802446A4 0C0B36B0 */ jal resolve_npc
/* A2E8E8 802446A8 0200282D */ daddu $a1, $s0, $zero
D_802446AC:
/* A2E8EC 802446AC C6200000 */ lwc1 $f0, 0x0($s1)
.L802446B0:
/* A2E8F0 802446B0 46140000 */ add.s $f0, $f0, $f20
/* A2E8F4 802446B4 E4400038 */ swc1 $f0, 0x38($v0)
/* A2E8F8 802446B8 C6400000 */ lwc1 $f0, 0x0($s2)
D_802446BC:
/* A2E8FC 802446BC 46160000 */ add.s $f0, $f0, $f22
D_802446C0:
/* A2E900 802446C0 26100001 */ addiu $s0, $s0, 0x1
/* A2E904 802446C4 E440003C */ swc1 $f0, 0x3C($v0)
.L802446C8:
/* A2E908 802446C8 C6600000 */ lwc1 $f0, 0x0($s3)
.L802446CC:
/* A2E90C 802446CC 26310004 */ addiu $s1, $s1, 0x4
/* A2E910 802446D0 46180000 */ add.s $f0, $f0, $f24
.L802446D4:
/* A2E914 802446D4 C442003C */ lwc1 $f2, 0x3C($v0)
D_802446D8:
/* A2E918 802446D8 26520004 */ addiu $s2, $s2, 0x4
/* A2E91C 802446DC E4400040 */ swc1 $f0, 0x40($v0)
glabel func_802446E0
/* A2E920 802446E0 C4400038 */ lwc1 $f0, 0x38($v0)
/* A2E924 802446E4 C4440040 */ lwc1 $f4, 0x40($v0)
/* A2E928 802446E8 E4420070 */ swc1 $f2, 0x70($v0)
/* A2E92C 802446EC E440006C */ swc1 $f0, 0x6C($v0)
/* A2E930 802446F0 E4440074 */ swc1 $f4, 0x74($v0)
/* A2E934 802446F4 2A020007 */ slti $v0, $s0, 0x7
/* A2E938 802446F8 1440FFE9 */ bnez $v0, .L802446A0
/* A2E93C 802446FC 26730004 */ addiu $s3, $s3, 0x4
jtbl_80244700:
/* A2E940 80244700 3C018025 */ lui $at, %hi(D_8024F308)
D_80244704:
/* A2E944 80244704 C420F308 */ lwc1 $f0, %lo(D_8024F308)($at)
glabel func_80244708
/* A2E948 80244708 46140000 */ add.s $f0, $f0, $f20
/* A2E94C 8024470C 3C018025 */ lui $at, %hi(D_8024F30C)
glabel func_80244710
/* A2E950 80244710 C422F30C */ lwc1 $f2, %lo(D_8024F30C)($at)
/* A2E954 80244714 8EA2000C */ lw $v0, 0xC($s5)
D_80244718:
/* A2E958 80244718 46161080 */ add.s $f2, $f2, $f22
/* A2E95C 8024471C E4400004 */ swc1 $f0, 0x4($v0)
jtbl_80244720:
/* A2E960 80244720 3C018025 */ lui $at, %hi(D_8024F310)
.L80244724:
/* A2E964 80244724 C420F310 */ lwc1 $f0, %lo(D_8024F310)($at)
/* A2E968 80244728 8EA2000C */ lw $v0, 0xC($s5)
/* A2E96C 8024472C 46180000 */ add.s $f0, $f0, $f24
/* A2E970 80244730 E4420008 */ swc1 $f2, 0x8($v0)
flo_25_pad_4734:
/* A2E974 80244734 8EA3000C */ lw $v1, 0xC($s5)
D_80244738:
/* A2E978 80244738 E460000C */ swc1 $f0, 0xC($v1)
D_8024473C:
/* A2E97C 8024473C 8FBF002C */ lw $ra, 0x2C($sp)
D_80244740:
/* A2E980 80244740 8FB60028 */ lw $s6, 0x28($sp)
/* A2E984 80244744 8FB50024 */ lw $s5, 0x24($sp)
/* A2E988 80244748 8FB40020 */ lw $s4, 0x20($sp)
/* A2E98C 8024474C 8FB3001C */ lw $s3, 0x1C($sp)
D_80244750:
/* A2E990 80244750 8FB20018 */ lw $s2, 0x18($sp)
/* A2E994 80244754 8FB10014 */ lw $s1, 0x14($sp)
D_80244758:
/* A2E998 80244758 8FB00010 */ lw $s0, 0x10($sp)
.L8024475C:
/* A2E99C 8024475C D7B80040 */ ldc1 $f24, 0x40($sp)
/* A2E9A0 80244760 D7B60038 */ ldc1 $f22, 0x38($sp)
/* A2E9A4 80244764 D7B40030 */ ldc1 $f20, 0x30($sp)
/* A2E9A8 80244768 0000102D */ daddu $v0, $zero, $zero
D_8024476C:
/* A2E9AC 8024476C 03E00008 */ jr $ra
/* A2E9B0 80244770 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(func_80244550_A2E790) {
Npc* kammy = resolve_npc(script, NPC_Kammy);
EffectInstance* effect = (EffectInstance*) evt_get_variable(script, ArrayVar(0));
Npc* npc2;
f32 x, y, z;
f32* x2;
f32* y2;
f32* z2;
s32 i;
if (isInitialCall) {
N(D_8024F2FC) = kammy->pos.x;
N(D_8024F300) = kammy->pos.y;
N(D_8024F304) = kammy->pos.z;
for (i = NPC_Eldstar; i < ARRAY_COUNT(N(StarSpiritsPosX)); i++) {
npc2 = resolve_npc(script, i);
N(StarSpiritsPosX)[i] = npc2->pos.x;
N(StarSpiritsPosY)[i] = npc2->pos.y;
N(StarSpiritsPosZ)[i] = npc2->pos.z;
}
N(D_8024F308) = effect->data.somethingRotating->pos.x;
N(D_8024F30C) = effect->data.somethingRotating->pos.y;
N(D_8024F310) = effect->data.somethingRotating->pos.z;
}
x = kammy->pos.x - N(D_8024F2FC);
y = kammy->pos.y - N(D_8024F300);
z = kammy->pos.z - N(D_8024F304);
i = 0;
z2 = N(StarSpiritsPosZ);
y2 = N(StarSpiritsPosY);
x2 = N(StarSpiritsPosX);
for (; i < ARRAY_COUNT(N(StarSpiritsPosX)); ) {
npc2 = resolve_npc(script, i);
i++;
npc2->pos.x = *x2++ + x;
npc2->pos.y = *y2++ + y;
npc2->pos.z = *z2++ + z;
npc2->colliderPos.x = npc2->pos.x;
npc2->colliderPos.y = npc2->pos.y;
npc2->colliderPos.z = npc2->pos.z;
}
effect->data.somethingRotating->pos.x = N(D_8024F308) + x;
effect->data.somethingRotating->pos.y = N(D_8024F30C) + y;
effect->data.somethingRotating->pos.z = N(D_8024F310) + z;
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel load_model_transforms
/* B14C8 8011ADC8 27BDFF00 */ addiu $sp, $sp, -0x100
/* B14CC 8011ADCC AFB100E4 */ sw $s1, 0xE4($sp)
/* B14D0 8011ADD0 0080882D */ daddu $s1, $a0, $zero
/* B14D4 8011ADD4 AFB500F4 */ sw $s5, 0xF4($sp)
/* B14D8 8011ADD8 00A0A82D */ daddu $s5, $a1, $zero
/* B14DC 8011ADDC AFB300EC */ sw $s3, 0xEC($sp)
/* B14E0 8011ADE0 00C0982D */ daddu $s3, $a2, $zero
/* B14E4 8011ADE4 AFB400F0 */ sw $s4, 0xF0($sp)
/* B14E8 8011ADE8 00E0A02D */ daddu $s4, $a3, $zero
/* B14EC 8011ADEC AFBF00F8 */ sw $ra, 0xF8($sp)
/* B14F0 8011ADF0 AFB200E8 */ sw $s2, 0xE8($sp)
/* B14F4 8011ADF4 AFB000E0 */ sw $s0, 0xE0($sp)
/* B14F8 8011ADF8 8E250010 */ lw $a1, 0x10($s1)
/* B14FC 8011ADFC 10A00041 */ beqz $a1, .L8011AF04
/* B1500 8011AE00 27B20090 */ addiu $s2, $sp, 0x90
/* B1504 8011AE04 8CA2000C */ lw $v0, 0xC($a1)
/* B1508 8011AE08 5040003F */ beql $v0, $zero, .L8011AF08
/* B150C 8011AE0C 0260202D */ daddu $a0, $s3, $zero
/* B1510 8011AE10 8CA50000 */ lw $a1, 0x0($a1)
/* B1514 8011AE14 10A00007 */ beqz $a1, .L8011AE34
/* B1518 8011AE18 27B000A0 */ addiu $s0, $sp, 0xA0
/* B151C 8011AE1C 0C019D60 */ jal guMtxL2F
/* B1520 8011AE20 0200202D */ daddu $a0, $s0, $zero
/* B1524 8011AE24 0200202D */ daddu $a0, $s0, $zero
/* B1528 8011AE28 0260282D */ daddu $a1, $s3, $zero
/* B152C 8011AE2C 0C019D80 */ jal guMtxCatF
/* B1530 8011AE30 27A60010 */ addiu $a2, $sp, 0x10
.L8011AE34:
/* B1534 8011AE34 0220202D */ daddu $a0, $s1, $zero
/* B1538 8011AE38 0C0456C3 */ jal get_model_property
/* B153C 8011AE3C 24050060 */ addiu $a1, $zero, 0x60
/* B1540 8011AE40 10400002 */ beqz $v0, .L8011AE4C
/* B1544 8011AE44 0000202D */ daddu $a0, $zero, $zero
/* B1548 8011AE48 8C440008 */ lw $a0, 0x8($v0)
.L8011AE4C:
/* B154C 8011AE4C 8E230000 */ lw $v1, 0x0($s1)
/* B1550 8011AE50 24020005 */ addiu $v0, $zero, 0x5
/* B1554 8011AE54 14620003 */ bne $v1, $v0, .L8011AE64
/* B1558 8011AE58 00000000 */ nop
/* B155C 8011AE5C 1480002A */ bnez $a0, .L8011AF08
/* B1560 8011AE60 0260202D */ daddu $a0, $s3, $zero
.L8011AE64:
/* B1564 8011AE64 8E240010 */ lw $a0, 0x10($s1)
/* B1568 8011AE68 8C82000C */ lw $v0, 0xC($a0)
/* B156C 8011AE6C 18400012 */ blez $v0, .L8011AEB8
/* B1570 8011AE70 0000802D */ daddu $s0, $zero, $zero
/* B1574 8011AE74 0260302D */ daddu $a2, $s3, $zero
.L8011AE78:
/* B1578 8011AE78 00101080 */ sll $v0, $s0, 2
/* B157C 8011AE7C 8C830010 */ lw $v1, 0x10($a0)
/* B1580 8011AE80 8C840000 */ lw $a0, 0x0($a0)
/* B1584 8011AE84 10800002 */ beqz $a0, .L8011AE90
/* B1588 8011AE88 00431021 */ addu $v0, $v0, $v1
/* B158C 8011AE8C 27A60010 */ addiu $a2, $sp, 0x10
.L8011AE90:
/* B1590 8011AE90 0220282D */ daddu $a1, $s1, $zero
/* B1594 8011AE94 8C440000 */ lw $a0, 0x0($v0)
/* B1598 8011AE98 0C046B72 */ jal load_model_transforms
/* B159C 8011AE9C 26870001 */ addiu $a3, $s4, 0x1
/* B15A0 8011AEA0 8E240010 */ lw $a0, 0x10($s1)
/* B15A4 8011AEA4 8C82000C */ lw $v0, 0xC($a0)
/* B15A8 8011AEA8 26100001 */ addiu $s0, $s0, 0x1
/* B15AC 8011AEAC 0202102A */ slt $v0, $s0, $v0
/* B15B0 8011AEB0 1440FFF1 */ bnez $v0, .L8011AE78
/* B15B4 8011AEB4 0260302D */ daddu $a2, $s3, $zero
.L8011AEB8:
/* B15B8 8011AEB8 3C048015 */ lui $a0, %hi(mdl_treeIterPos)
/* B15BC 8011AEBC 24843224 */ addiu $a0, $a0, %lo(mdl_treeIterPos)
/* B15C0 8011AEC0 3C05800A */ lui $a1, %hi(mdl_currentModelTreeNodeInfo)
/* B15C4 8011AEC4 24A5A5F4 */ addiu $a1, $a1, %lo(mdl_currentModelTreeNodeInfo)
/* B15C8 8011AEC8 8C820000 */ lw $v0, 0x0($a0)
/* B15CC 8011AECC 8CA30000 */ lw $v1, 0x0($a1)
/* B15D0 8011AED0 00021080 */ sll $v0, $v0, 2
/* B15D4 8011AED4 00431021 */ addu $v0, $v0, $v1
/* B15D8 8011AED8 240300FF */ addiu $v1, $zero, 0xFF
/* B15DC 8011AEDC A0430000 */ sb $v1, 0x0($v0)
/* B15E0 8011AEE0 8C820000 */ lw $v0, 0x0($a0)
/* B15E4 8011AEE4 8CA30000 */ lw $v1, 0x0($a1)
/* B15E8 8011AEE8 00021080 */ sll $v0, $v0, 2
/* B15EC 8011AEEC 00431021 */ addu $v0, $v0, $v1
/* B15F0 8011AEF0 A0540001 */ sb $s4, 0x1($v0)
/* B15F4 8011AEF4 8C820000 */ lw $v0, 0x0($a0)
/* B15F8 8011AEF8 24420001 */ addiu $v0, $v0, 0x1
/* B15FC 8011AEFC 08046BFB */ j .L8011AFEC
/* B1600 8011AF00 AC820000 */ sw $v0, 0x0($a0)
.L8011AF04:
/* B1604 8011AF04 0260202D */ daddu $a0, $s3, $zero
.L8011AF08:
/* B1608 8011AF08 27B00050 */ addiu $s0, $sp, 0x50
/* B160C 8011AF0C 0C019D40 */ jal guMtxF2L
/* B1610 8011AF10 0200282D */ daddu $a1, $s0, $zero
/* B1614 8011AF14 A6400000 */ sh $zero, 0x0($s2)
/* B1618 8011AF18 AE510004 */ sw $s1, 0x4($s2)
/* B161C 8011AF1C 8EA20010 */ lw $v0, 0x10($s5)
/* B1620 8011AF20 AE50000C */ sw $s0, 0xC($s2)
/* B1624 8011AF24 AE420008 */ sw $v0, 0x8($s2)
/* B1628 8011AF28 8E230000 */ lw $v1, 0x0($s1)
/* B162C 8011AF2C 24020005 */ addiu $v0, $zero, 0x5
/* B1630 8011AF30 14620021 */ bne $v1, $v0, .L8011AFB8
/* B1634 8011AF34 0240202D */ daddu $a0, $s2, $zero
/* B1638 8011AF38 0C04572A */ jal mdl_get_child_count
/* B163C 8011AF3C 0220202D */ daddu $a0, $s1, $zero
/* B1640 8011AF40 3C078015 */ lui $a3, %hi(mdl_treeIterPos)
/* B1644 8011AF44 24E73224 */ addiu $a3, $a3, %lo(mdl_treeIterPos)
/* B1648 8011AF48 8CF00000 */ lw $s0, 0x0($a3)
/* B164C 8011AF4C 0040202D */ daddu $a0, $v0, $zero
/* B1650 8011AF50 02041021 */ addu $v0, $s0, $a0
/* B1654 8011AF54 0202102A */ slt $v0, $s0, $v0
/* B1658 8011AF58 10400011 */ beqz $v0, .L8011AFA0
/* B165C 8011AF5C 240800FF */ addiu $t0, $zero, 0xFF
/* B1660 8011AF60 3C05800A */ lui $a1, %hi(mdl_currentModelTreeNodeInfo)
/* B1664 8011AF64 24A5A5F4 */ addiu $a1, $a1, %lo(mdl_currentModelTreeNodeInfo)
/* B1668 8011AF68 26860001 */ addiu $a2, $s4, 0x1
.L8011AF6C:
/* B166C 8011AF6C 8CA20000 */ lw $v0, 0x0($a1)
/* B1670 8011AF70 00101880 */ sll $v1, $s0, 2
/* B1674 8011AF74 00621021 */ addu $v0, $v1, $v0
/* B1678 8011AF78 A0480000 */ sb $t0, 0x0($v0)
/* B167C 8011AF7C 8CA20000 */ lw $v0, 0x0($a1)
/* B1680 8011AF80 00621821 */ addu $v1, $v1, $v0
/* B1684 8011AF84 A0660001 */ sb $a2, 0x1($v1)
/* B1688 8011AF88 8CE20000 */ lw $v0, 0x0($a3)
/* B168C 8011AF8C 26100001 */ addiu $s0, $s0, 0x1
/* B1690 8011AF90 00441021 */ addu $v0, $v0, $a0
/* B1694 8011AF94 0202102A */ slt $v0, $s0, $v0
/* B1698 8011AF98 1440FFF4 */ bnez $v0, .L8011AF6C
/* B169C 8011AF9C 00000000 */ nop
.L8011AFA0:
/* B16A0 8011AFA0 3C038015 */ lui $v1, %hi(mdl_treeIterPos)
/* B16A4 8011AFA4 24633224 */ addiu $v1, $v1, %lo(mdl_treeIterPos)
/* B16A8 8011AFA8 8C620000 */ lw $v0, 0x0($v1)
/* B16AC 8011AFAC 00441021 */ addu $v0, $v0, $a0
/* B16B0 8011AFB0 AC620000 */ sw $v0, 0x0($v1)
/* B16B4 8011AFB4 0240202D */ daddu $a0, $s2, $zero
.L8011AFB8:
/* B16B8 8011AFB8 0C045883 */ jal mdl_create_model
/* B16BC 8011AFBC 24050004 */ addiu $a1, $zero, 0x4
/* B16C0 8011AFC0 3C038015 */ lui $v1, %hi(mdl_treeIterPos)
/* B16C4 8011AFC4 24633224 */ addiu $v1, $v1, %lo(mdl_treeIterPos)
/* B16C8 8011AFC8 8C620000 */ lw $v0, 0x0($v1)
/* B16CC 8011AFCC 3C04800A */ lui $a0, %hi(mdl_currentModelTreeNodeInfo)
/* B16D0 8011AFD0 8C84A5F4 */ lw $a0, %lo(mdl_currentModelTreeNodeInfo)($a0)
/* B16D4 8011AFD4 00021080 */ sll $v0, $v0, 2
/* B16D8 8011AFD8 00441021 */ addu $v0, $v0, $a0
/* B16DC 8011AFDC A0540001 */ sb $s4, 0x1($v0)
/* B16E0 8011AFE0 8C620000 */ lw $v0, 0x0($v1)
/* B16E4 8011AFE4 24420001 */ addiu $v0, $v0, 0x1
/* B16E8 8011AFE8 AC620000 */ sw $v0, 0x0($v1)
.L8011AFEC:
/* B16EC 8011AFEC 8FBF00F8 */ lw $ra, 0xF8($sp)
/* B16F0 8011AFF0 8FB500F4 */ lw $s5, 0xF4($sp)
/* B16F4 8011AFF4 8FB400F0 */ lw $s4, 0xF0($sp)
/* B16F8 8011AFF8 8FB300EC */ lw $s3, 0xEC($sp)
/* B16FC 8011AFFC 8FB200E8 */ lw $s2, 0xE8($sp)
/* B1700 8011B000 8FB100E4 */ lw $s1, 0xE4($sp)
/* B1704 8011B004 8FB000E0 */ lw $s0, 0xE0($sp)
/* B1708 8011B008 03E00008 */ jr $ra
/* B170C 8011B00C 27BD0100 */ addiu $sp, $sp, 0x100
### DECOMPILED C INSTRUCTIONS:
void load_model_transforms(ModelNode* model, ModelNode* parent, Matrix4f mdlTxMtx, s32 treeDepth) {
Matrix4f sp10;
Mtx sp50;
ModelBlueprint modelBP;
ModelBlueprint* modelBPptr = &modelBP;
ModelNodeProperty* groupTypeProperty;
ModelNode* modelTemp;
s32 i;
if (model->groupData != NULL && model->groupData->numChildren != 0) {
s32 groupType;
if (model->groupData->transformMatrix != NULL) {
Matrix4f spA0;
guMtxL2F(spA0, model->groupData->transformMatrix);
guMtxCatF(spA0, mdlTxMtx, sp10);
}
groupTypeProperty = get_model_property(model, MODEL_PROP_KEY_GROUP_TYPE);
if (groupTypeProperty == NULL) {
groupType = 0;
} else {
groupType = groupTypeProperty->data.s;
}
if (model->type != SHAPE_TYPE_GROUP || groupType == 0) {
for (i = 0; i < model->groupData->numChildren; i++) {
load_model_transforms(model->groupData->childList[i], model,
model->groupData->transformMatrix != NULL ? sp10 : mdlTxMtx, treeDepth + 1);
}
(*mdl_currentModelTreeNodeInfo)[mdl_treeIterPos].modelIndex = -1;
(*mdl_currentModelTreeNodeInfo)[mdl_treeIterPos].treeDepth = treeDepth;
mdl_treeIterPos += 1;
return;
}
}
guMtxF2L(mdlTxMtx, &sp50);
modelBPptr->flags = 0;
modelBPptr->mdlNode = model;
modelBPptr->groupData = parent->groupData;
modelBPptr->mtx = &sp50;
if (model->type == SHAPE_TYPE_GROUP) {
s32 childCount = mdl_get_child_count(model);
for (i = mdl_treeIterPos; i < mdl_treeIterPos + childCount; i++) {
(*mdl_currentModelTreeNodeInfo)[i].modelIndex = -1;
(*mdl_currentModelTreeNodeInfo)[i].treeDepth = treeDepth + 1;
}
mdl_treeIterPos += childCount;
}
mdl_create_model(modelBPptr, 4);
(*mdl_currentModelTreeNodeInfo)[mdl_treeIterPos].treeDepth = treeDepth;
mdl_treeIterPos += 1;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel render_npcs
/* 15BF0 8003A7F0 27BDFF78 */ addiu $sp, $sp, -0x88
/* 15BF4 8003A7F4 F7BA0080 */ sdc1 $f26, 0x80($sp)
/* 15BF8 8003A7F8 3C01459C */ lui $at, (0x459C4000 >> 16)
/* 15BFC 8003A7FC 34214000 */ ori $at, $at, (0x459C4000 & 0xFFFF)
/* 15C00 8003A800 4481D000 */ mtc1 $at, $f26
/* 15C04 8003A804 F7B80078 */ sdc1 $f24, 0x78($sp)
/* 15C08 8003A808 4480C000 */ mtc1 $zero, $f24
/* 15C0C 8003A80C AFB10054 */ sw $s1, 0x54($sp)
/* 15C10 8003A810 27B10028 */ addiu $s1, $sp, 0x28
/* 15C14 8003A814 AFB20058 */ sw $s2, 0x58($sp)
/* 15C18 8003A818 0000902D */ daddu $s2, $zero, $zero
/* 15C1C 8003A81C AFB3005C */ sw $s3, 0x5C($sp)
/* 15C20 8003A820 241300FF */ addiu $s3, $zero, 0xFF
/* 15C24 8003A824 F7B60070 */ sdc1 $f22, 0x70($sp)
/* 15C28 8003A828 3C01461C */ lui $at, (0x461C4000 >> 16)
/* 15C2C 8003A82C 34214000 */ ori $at, $at, (0x461C4000 & 0xFFFF)
/* 15C30 8003A830 4481B000 */ mtc1 $at, $f22
/* 15C34 8003A834 3C03800A */ lui $v1, %hi(gCurrentCamID)
/* 15C38 8003A838 8463A634 */ lh $v1, %lo(gCurrentCamID)($v1)
/* 15C3C 8003A83C 3C04800B */ lui $a0, %hi(gCameras)
/* 15C40 8003A840 24841D80 */ addiu $a0, $a0, %lo(gCameras)
/* 15C44 8003A844 AFBF0064 */ sw $ra, 0x64($sp)
/* 15C48 8003A848 AFB40060 */ sw $s4, 0x60($sp)
/* 15C4C 8003A84C AFB00050 */ sw $s0, 0x50($sp)
/* 15C50 8003A850 F7B40068 */ sdc1 $f20, 0x68($sp)
/* 15C54 8003A854 00031080 */ sll $v0, $v1, 2
/* 15C58 8003A858 00431021 */ addu $v0, $v0, $v1
/* 15C5C 8003A85C 00021080 */ sll $v0, $v0, 2
/* 15C60 8003A860 00431023 */ subu $v0, $v0, $v1
/* 15C64 8003A864 000218C0 */ sll $v1, $v0, 3
/* 15C68 8003A868 00431021 */ addu $v0, $v0, $v1
/* 15C6C 8003A86C 000210C0 */ sll $v0, $v0, 3
/* 15C70 8003A870 0044A021 */ addu $s4, $v0, $a0
.L8003A874:
/* 15C74 8003A874 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr)
/* 15C78 8003A878 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1)
/* 15C7C 8003A87C 00121080 */ sll $v0, $s2, 2
/* 15C80 8003A880 00431021 */ addu $v0, $v0, $v1
/* 15C84 8003A884 8C500000 */ lw $s0, 0x0($v0)
/* 15C88 8003A888 52000063 */ beql $s0, $zero, .L8003AA18
/* 15C8C 8003A88C 26520001 */ addiu $s2, $s2, 0x1
/* 15C90 8003A890 8E030000 */ lw $v1, 0x0($s0)
/* 15C94 8003A894 50600060 */ beql $v1, $zero, .L8003AA18
/* 15C98 8003A898 26520001 */ addiu $s2, $s2, 0x1
/* 15C9C 8003A89C 3C028100 */ lui $v0, (0x81000006 >> 16)
/* 15CA0 8003A8A0 34420006 */ ori $v0, $v0, (0x81000006 & 0xFFFF)
/* 15CA4 8003A8A4 00621024 */ and $v0, $v1, $v0
/* 15CA8 8003A8A8 5440005B */ bnel $v0, $zero, .L8003AA18
/* 15CAC 8003A8AC 26520001 */ addiu $s2, $s2, 0x1
/* 15CB0 8003A8B0 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 15CB4 8003A8B4 44810000 */ mtc1 $at, $f0
/* 15CB8 8003A8B8 27A20038 */ addiu $v0, $sp, 0x38
/* 15CBC 8003A8BC AFA20014 */ sw $v0, 0x14($sp)
/* 15CC0 8003A8C0 27A2003C */ addiu $v0, $sp, 0x3C
/* 15CC4 8003A8C4 AFA20018 */ sw $v0, 0x18($sp)
/* 15CC8 8003A8C8 27A20040 */ addiu $v0, $sp, 0x40
/* 15CCC 8003A8CC AFA2001C */ sw $v0, 0x1C($sp)
/* 15CD0 8003A8D0 27A20044 */ addiu $v0, $sp, 0x44
/* 15CD4 8003A8D4 AFA20020 */ sw $v0, 0x20($sp)
/* 15CD8 8003A8D8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 15CDC 8003A8DC 8E050038 */ lw $a1, 0x38($s0)
/* 15CE0 8003A8E0 8E06003C */ lw $a2, 0x3C($s0)
/* 15CE4 8003A8E4 8E070040 */ lw $a3, 0x40($s0)
/* 15CE8 8003A8E8 0C00A588 */ jal transform_point
/* 15CEC 8003A8EC 268400D4 */ addiu $a0, $s4, 0xD4
/* 15CF0 8003A8F0 C7A40044 */ lwc1 $f4, 0x44($sp)
/* 15CF4 8003A8F4 3C01800A */ lui $at, %hi(D_800984B0)
/* 15CF8 8003A8F8 D42084B0 */ ldc1 $f0, %lo(D_800984B0)($at)
/* 15CFC 8003A8FC 460020A1 */ cvt.d.s $f2, $f4
/* 15D00 8003A900 4620103C */ c.lt.d $f2, $f0
/* 15D04 8003A904 00000000 */ nop
/* 15D08 8003A908 45000007 */ bc1f .L8003A928
/* 15D0C 8003A90C 00000000 */ nop
/* 15D10 8003A910 3C01800A */ lui $at, %hi(D_800984B8)
/* 15D14 8003A914 D42084B8 */ ldc1 $f0, %lo(D_800984B8)($at)
/* 15D18 8003A918 4622003C */ c.lt.d $f0, $f2
/* 15D1C 8003A91C 00000000 */ nop
/* 15D20 8003A920 4503003D */ bc1tl .L8003AA18
/* 15D24 8003A924 26520001 */ addiu $s2, $s2, 0x1
.L8003A928:
/* 15D28 8003A928 C7A00040 */ lwc1 $f0, 0x40($sp)
/* 15D2C 8003A92C 461A0002 */ mul.s $f0, $f0, $f26
/* 15D30 8003A930 00000000 */ nop
/* 15D34 8003A934 46040003 */ div.s $f0, $f0, $f4
/* 15D38 8003A938 461A0500 */ add.s $f20, $f0, $f26
/* 15D3C 8003A93C 4618A03C */ c.lt.s $f20, $f24
/* 15D40 8003A940 00000000 */ nop
/* 15D44 8003A944 45000003 */ bc1f .L8003A954
/* 15D48 8003A948 00000000 */ nop
/* 15D4C 8003A94C 0800EA59 */ j .L8003A964
/* 15D50 8003A950 4600C506 */ mov.s $f20, $f24
.L8003A954:
/* 15D54 8003A954 4614B03C */ c.lt.s $f22, $f20
/* 15D58 8003A958 00000000 */ nop
/* 15D5C 8003A95C 45030001 */ bc1tl .L8003A964
/* 15D60 8003A960 4600B506 */ mov.s $f20, $f22
.L8003A964:
/* 15D64 8003A964 4600A007 */ neg.s $f0, $f20
/* 15D68 8003A968 4600018D */ trunc.w.s $f6, $f0
/* 15D6C 8003A96C E6260004 */ swc1 $f6, 0x4($s1)
/* 15D70 8003A970 3C028004 */ lui $v0, %hi(appendGfx_npc)
/* 15D74 8003A974 24429FD0 */ addiu $v0, $v0, %lo(appendGfx_npc)
/* 15D78 8003A978 AE300008 */ sw $s0, 0x8($s1)
/* 15D7C 8003A97C AE22000C */ sw $v0, 0xC($s1)
/* 15D80 8003A980 820200AA */ lb $v0, 0xAA($s0)
/* 15D84 8003A984 AE220000 */ sw $v0, 0x0($s1)
/* 15D88 8003A988 8E020000 */ lw $v0, 0x0($s0)
/* 15D8C 8003A98C 3C030080 */ lui $v1, (0x800000 >> 16)
/* 15D90 8003A990 00431024 */ and $v0, $v0, $v1
/* 15D94 8003A994 10400009 */ beqz $v0, .L8003A9BC
/* 15D98 8003A998 27A40048 */ addiu $a0, $sp, 0x48
/* 15D9C 8003A99C 27A50049 */ addiu $a1, $sp, 0x49
/* 15DA0 8003A9A0 27A6004A */ addiu $a2, $sp, 0x4A
/* 15DA4 8003A9A4 0C046FA0 */ jal get_background_color_blend
/* 15DA8 8003A9A8 27A7004B */ addiu $a3, $sp, 0x4B
/* 15DAC 8003A9AC 93A2004B */ lbu $v0, 0x4B($sp)
/* 15DB0 8003A9B0 02621023 */ subu $v0, $s3, $v0
/* 15DB4 8003A9B4 0800EA70 */ j .L8003A9C0
/* 15DB8 8003A9B8 A20200AD */ sb $v0, 0xAD($s0)
.L8003A9BC:
/* 15DBC 8003A9BC A21300AD */ sb $s3, 0xAD($s0)
.L8003A9C0:
/* 15DC0 8003A9C0 920200AD */ lbu $v0, 0xAD($s0)
/* 15DC4 8003A9C4 10400003 */ beqz $v0, .L8003A9D4
/* 15DC8 8003A9C8 00000000 */ nop
/* 15DCC 8003A9CC 0C047644 */ jal queue_render_task
/* 15DD0 8003A9D0 0220202D */ daddu $a0, $s1, $zero
.L8003A9D4:
/* 15DD4 8003A9D4 8E020000 */ lw $v0, 0x0($s0)
/* 15DD8 8003A9D8 3C030010 */ lui $v1, (0x100000 >> 16)
/* 15DDC 8003A9DC 00431024 */ and $v0, $v0, $v1
/* 15DE0 8003A9E0 5040000D */ beql $v0, $zero, .L8003AA18
/* 15DE4 8003A9E4 26520001 */ addiu $s2, $s2, 0x1
/* 15DE8 8003A9E8 4600A007 */ neg.s $f0, $f20
/* 15DEC 8003A9EC 4600018D */ trunc.w.s $f6, $f0
/* 15DF0 8003A9F0 E6260004 */ swc1 $f6, 0x4($s1)
/* 15DF4 8003A9F4 0220202D */ daddu $a0, $s1, $zero
/* 15DF8 8003A9F8 3C028004 */ lui $v0, %hi(appendGfx_npc_blur)
/* 15DFC 8003A9FC 2442AE38 */ addiu $v0, $v0, %lo(appendGfx_npc_blur)
/* 15E00 8003AA00 AE22000C */ sw $v0, 0xC($s1)
/* 15E04 8003AA04 24020011 */ addiu $v0, $zero, 0x11
/* 15E08 8003AA08 AE300008 */ sw $s0, 0x8($s1)
/* 15E0C 8003AA0C 0C047644 */ jal queue_render_task
/* 15E10 8003AA10 AE220000 */ sw $v0, 0x0($s1)
/* 15E14 8003AA14 26520001 */ addiu $s2, $s2, 0x1
.L8003AA18:
/* 15E18 8003AA18 2A420040 */ slti $v0, $s2, 0x40
/* 15E1C 8003AA1C 1440FF95 */ bnez $v0, .L8003A874
/* 15E20 8003AA20 00000000 */ nop
/* 15E24 8003AA24 8FBF0064 */ lw $ra, 0x64($sp)
/* 15E28 8003AA28 8FB40060 */ lw $s4, 0x60($sp)
/* 15E2C 8003AA2C 8FB3005C */ lw $s3, 0x5C($sp)
/* 15E30 8003AA30 8FB20058 */ lw $s2, 0x58($sp)
/* 15E34 8003AA34 8FB10054 */ lw $s1, 0x54($sp)
/* 15E38 8003AA38 8FB00050 */ lw $s0, 0x50($sp)
/* 15E3C 8003AA3C D7BA0080 */ ldc1 $f26, 0x80($sp)
/* 15E40 8003AA40 D7B80078 */ ldc1 $f24, 0x78($sp)
/* 15E44 8003AA44 D7B60070 */ ldc1 $f22, 0x70($sp)
/* 15E48 8003AA48 D7B40068 */ ldc1 $f20, 0x68($sp)
/* 15E4C 8003AA4C 03E00008 */ jr $ra
/* 15E50 8003AA50 27BD0088 */ addiu $sp, $sp, 0x88
### DECOMPILED C INSTRUCTIONS:
void render_npcs(void) {
Npc* npc;
RenderTask renderTask;
RenderTask* renderTaskPtr = &renderTask;
Camera* cam = &gCameras[gCurrentCamID];
f32 x, y, z, s;
f32 renderDist;
s32 i;
for (i = 0; i < MAX_NPCS; i++) {
Npc* npc = (*gCurrentNpcListPtr)[i];
if ((npc != NULL)
&& (npc->flags != 0)
&& !(npc->flags & (NPC_FLAG_SUSPENDED | NPC_FLAG_HAS_NO_SPRITE | NPC_FLAG_INACTIVE | NPC_FLAG_INVISIBLE))
) {
transform_point(cam->perspectiveMatrix, npc->pos.x, npc->pos.y, npc->pos.z, 1.0f, &x, &y, &z, &s);
if (!(s < 0.01) || !(s > -0.01)) {
renderDist = ((z * 5000.0f) / s) + 5000.0f;
if (renderDist < 0.0f) {
renderDist = 0.0f;
} else if (renderDist > 10000.0f) {
renderDist = 10000.0f;
}
renderTaskPtr->distance = -renderDist;
renderTaskPtr->appendGfxArg = npc;
renderTaskPtr->appendGfx = appendGfx_npc;
renderTaskPtr->renderMode = npc->renderMode;
if (npc->flags & NPC_FLAG_HIDING) {
u8 r, g, b, a;
get_background_color_blend(&r, &g, &b, &a);
npc->alpha2 = 255 - a;
} else {
npc->alpha2 = 255;
}
if (npc->alpha2 != 0) {
queue_render_task(renderTaskPtr);
}
if (npc->flags & NPC_FLAG_MOTION_BLUR) {
renderTaskPtr->distance = -renderDist;
renderTaskPtr->appendGfx = appendGfx_npc_blur;
renderTaskPtr->appendGfxArg = npc;
renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1;
queue_render_task(renderTaskPtr);
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel npc_raycast_down
/* 759B0 800DC500 27BDFF60 */ addiu $sp, $sp, -0xA0
/* 759B4 800DC504 AFB00070 */ sw $s0, 0x70($sp)
/* 759B8 800DC508 0080802D */ daddu $s0, $a0, $zero
/* 759BC 800DC50C AFB20078 */ sw $s2, 0x78($sp)
/* 759C0 800DC510 00A0902D */ daddu $s2, $a1, $zero
/* 759C4 800DC514 AFB3007C */ sw $s3, 0x7C($sp)
/* 759C8 800DC518 00C0982D */ daddu $s3, $a2, $zero
/* 759CC 800DC51C AFB40080 */ sw $s4, 0x80($sp)
/* 759D0 800DC520 00E0A02D */ daddu $s4, $a3, $zero
/* 759D4 800DC524 AFB50084 */ sw $s5, 0x84($sp)
/* 759D8 800DC528 8FB500B0 */ lw $s5, 0xB0($sp)
/* 759DC 800DC52C 27A20038 */ addiu $v0, $sp, 0x38
/* 759E0 800DC530 AFBF0088 */ sw $ra, 0x88($sp)
/* 759E4 800DC534 AFB10074 */ sw $s1, 0x74($sp)
/* 759E8 800DC538 F7B60098 */ sdc1 $f22, 0x98($sp)
/* 759EC 800DC53C F7B40090 */ sdc1 $f20, 0x90($sp)
/* 759F0 800DC540 C6A00000 */ lwc1 $f0, 0x0($s5)
/* 759F4 800DC544 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* 759F8 800DC548 4481A000 */ mtc1 $at, $f20
/* 759FC 800DC54C 46000005 */ abs.s $f0, $f0
/* 75A00 800DC550 E7A00044 */ swc1 $f0, 0x44($sp)
/* 75A04 800DC554 E7A00060 */ swc1 $f0, 0x60($sp)
/* 75A08 800DC558 C6440000 */ lwc1 $f4, 0x0($s2)
/* 75A0C 800DC55C C6600000 */ lwc1 $f0, 0x0($s3)
/* 75A10 800DC560 C6820000 */ lwc1 $f2, 0x0($s4)
/* 75A14 800DC564 AFA2001C */ sw $v0, 0x1C($sp)
/* 75A18 800DC568 27A2003C */ addiu $v0, $sp, 0x3C
/* 75A1C 800DC56C AFA20020 */ sw $v0, 0x20($sp)
/* 75A20 800DC570 27A20040 */ addiu $v0, $sp, 0x40
/* 75A24 800DC574 AFA20024 */ sw $v0, 0x24($sp)
/* 75A28 800DC578 27A20044 */ addiu $v0, $sp, 0x44
/* 75A2C 800DC57C AFA20028 */ sw $v0, 0x28($sp)
/* 75A30 800DC580 27A20048 */ addiu $v0, $sp, 0x48
/* 75A34 800DC584 AFA2002C */ sw $v0, 0x2C($sp)
/* 75A38 800DC588 27A2004C */ addiu $v0, $sp, 0x4C
/* 75A3C 800DC58C AFA20030 */ sw $v0, 0x30($sp)
/* 75A40 800DC590 44060000 */ mfc1 $a2, $f0
/* 75A44 800DC594 44071000 */ mfc1 $a3, $f2
/* 75A48 800DC598 44052000 */ mfc1 $a1, $f4
/* 75A4C 800DC59C 27A20050 */ addiu $v0, $sp, 0x50
/* 75A50 800DC5A0 AFA00010 */ sw $zero, 0x10($sp)
/* 75A54 800DC5A4 E7B40014 */ swc1 $f20, 0x14($sp)
/* 75A58 800DC5A8 AFA00018 */ sw $zero, 0x18($sp)
/* 75A5C 800DC5AC 0C017334 */ jal test_ray_colliders
/* 75A60 800DC5B0 AFA20034 */ sw $v0, 0x34($sp)
/* 75A64 800DC5B4 0040882D */ daddu $s1, $v0, $zero
/* 75A68 800DC5B8 3C020004 */ lui $v0, (0x40000 >> 16)
/* 75A6C 800DC5BC 02028024 */ and $s0, $s0, $v0
/* 75A70 800DC5C0 1600002E */ bnez $s0, .L800DC67C
/* 75A74 800DC5C4 27A20054 */ addiu $v0, $sp, 0x54
/* 75A78 800DC5C8 44800000 */ mtc1 $zero, $f0
/* 75A7C 800DC5CC AFA20018 */ sw $v0, 0x18($sp)
/* 75A80 800DC5D0 27A20058 */ addiu $v0, $sp, 0x58
/* 75A84 800DC5D4 AFA2001C */ sw $v0, 0x1C($sp)
/* 75A88 800DC5D8 27A2005C */ addiu $v0, $sp, 0x5C
/* 75A8C 800DC5DC AFA20020 */ sw $v0, 0x20($sp)
/* 75A90 800DC5E0 27A20060 */ addiu $v0, $sp, 0x60
/* 75A94 800DC5E4 AFA20024 */ sw $v0, 0x24($sp)
/* 75A98 800DC5E8 27A20064 */ addiu $v0, $sp, 0x64
/* 75A9C 800DC5EC AFA20028 */ sw $v0, 0x28($sp)
/* 75AA0 800DC5F0 27A20068 */ addiu $v0, $sp, 0x68
/* 75AA4 800DC5F4 AFA2002C */ sw $v0, 0x2C($sp)
/* 75AA8 800DC5F8 27A2006C */ addiu $v0, $sp, 0x6C
/* 75AAC 800DC5FC E7B40010 */ swc1 $f20, 0x10($sp)
/* 75AB0 800DC600 AFA20030 */ sw $v0, 0x30($sp)
/* 75AB4 800DC604 E7A00014 */ swc1 $f0, 0x14($sp)
/* 75AB8 800DC608 C64C0000 */ lwc1 $f12, 0x0($s2)
/* 75ABC 800DC60C C66E0000 */ lwc1 $f14, 0x0($s3)
/* 75AC0 800DC610 8E860000 */ lw $a2, 0x0($s4)
/* 75AC4 800DC614 44070000 */ mfc1 $a3, $f0
/* 75AC8 800DC618 0C017512 */ jal test_ray_entities
/* 75ACC 800DC61C 00000000 */ nop
/* 75AD0 800DC620 04400014 */ bltz $v0, .L800DC674
/* 75AD4 800DC624 00000000 */ nop
/* 75AD8 800DC628 C7AC0060 */ lwc1 $f12, 0x60($sp)
/* 75ADC 800DC62C C7A00044 */ lwc1 $f0, 0x44($sp)
/* 75AE0 800DC630 4600603C */ c.lt.s $f12, $f0
/* 75AE4 800DC634 00000000 */ nop
/* 75AE8 800DC638 4500000E */ bc1f .L800DC674
/* 75AEC 800DC63C 34514000 */ ori $s1, $v0, 0x4000
/* 75AF0 800DC640 C7A00054 */ lwc1 $f0, 0x54($sp)
/* 75AF4 800DC644 C7A20058 */ lwc1 $f2, 0x58($sp)
/* 75AF8 800DC648 C7A4005C */ lwc1 $f4, 0x5C($sp)
/* 75AFC 800DC64C C7A60064 */ lwc1 $f6, 0x64($sp)
/* 75B00 800DC650 C7A80068 */ lwc1 $f8, 0x68($sp)
/* 75B04 800DC654 C7AA006C */ lwc1 $f10, 0x6C($sp)
/* 75B08 800DC658 E7AC0044 */ swc1 $f12, 0x44($sp)
/* 75B0C 800DC65C E7A00038 */ swc1 $f0, 0x38($sp)
/* 75B10 800DC660 E7A2003C */ swc1 $f2, 0x3C($sp)
/* 75B14 800DC664 E7A40040 */ swc1 $f4, 0x40($sp)
/* 75B18 800DC668 E7A60048 */ swc1 $f6, 0x48($sp)
/* 75B1C 800DC66C E7A8004C */ swc1 $f8, 0x4C($sp)
/* 75B20 800DC670 E7AA0050 */ swc1 $f10, 0x50($sp)
.L800DC674:
/* 75B24 800DC674 06200035 */ bltz $s1, .L800DC74C
/* 75B28 800DC678 0220102D */ daddu $v0, $s1, $zero
.L800DC67C:
/* 75B2C 800DC67C C7A00044 */ lwc1 $f0, 0x44($sp)
/* 75B30 800DC680 E6A00000 */ swc1 $f0, 0x0($s5)
/* 75B34 800DC684 C7A00038 */ lwc1 $f0, 0x38($sp)
/* 75B38 800DC688 E6400000 */ swc1 $f0, 0x0($s2)
/* 75B3C 800DC68C C7A0003C */ lwc1 $f0, 0x3C($sp)
/* 75B40 800DC690 E6600000 */ swc1 $f0, 0x0($s3)
/* 75B44 800DC694 C7A00040 */ lwc1 $f0, 0x40($sp)
/* 75B48 800DC698 0620002B */ bltz $s1, .L800DC748
/* 75B4C 800DC69C E6800000 */ swc1 $f0, 0x0($s4)
/* 75B50 800DC6A0 C7A40050 */ lwc1 $f4, 0x50($sp)
/* 75B54 800DC6A4 3C0142C8 */ lui $at, (0x42C80000 >> 16)
/* 75B58 800DC6A8 4481A000 */ mtc1 $at, $f20
/* 75B5C 800DC6AC 00000000 */ nop
/* 75B60 800DC6B0 46142402 */ mul.s $f16, $f4, $f20
/* 75B64 800DC6B4 00000000 */ nop
/* 75B68 800DC6B8 3C108007 */ lui $s0, %hi(gGameStatusPtr)
/* 75B6C 800DC6BC 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr)
/* 75B70 800DC6C0 C7A2004C */ lwc1 $f2, 0x4C($sp)
/* 75B74 800DC6C4 44068000 */ mfc1 $a2, $f16
/* 75B78 800DC6C8 46141402 */ mul.s $f16, $f2, $f20
/* 75B7C 800DC6CC 00000000 */ nop
/* 75B80 800DC6D0 4480B000 */ mtc1 $zero, $f22
/* 75B84 800DC6D4 8E020000 */ lw $v0, 0x0($s0)
/* 75B88 800DC6D8 C7A00048 */ lwc1 $f0, 0x48($sp)
/* 75B8C 800DC6DC 4600B306 */ mov.s $f12, $f22
/* 75B90 800DC6E0 44078000 */ mfc1 $a3, $f16
/* 75B94 800DC6E4 4600B386 */ mov.s $f14, $f22
/* 75B98 800DC6E8 E4400128 */ swc1 $f0, 0x128($v0)
/* 75B9C 800DC6EC E442012C */ swc1 $f2, 0x12C($v0)
/* 75BA0 800DC6F0 0C00A720 */ jal atan2
/* 75BA4 800DC6F4 E4440130 */ swc1 $f4, 0x130($v0)
/* 75BA8 800DC6F8 C7A20048 */ lwc1 $f2, 0x48($sp)
/* 75BAC 800DC6FC 46141082 */ mul.s $f2, $f2, $f20
/* 75BB0 800DC700 00000000 */ nop
/* 75BB4 800DC704 44061000 */ mfc1 $a2, $f2
/* 75BB8 800DC708 C7A2004C */ lwc1 $f2, 0x4C($sp)
/* 75BBC 800DC70C 46141082 */ mul.s $f2, $f2, $f20
/* 75BC0 800DC710 00000000 */ nop
/* 75BC4 800DC714 4600B306 */ mov.s $f12, $f22
/* 75BC8 800DC718 46006386 */ mov.s $f14, $f12
/* 75BCC 800DC71C 8E020000 */ lw $v0, 0x0($s0)
/* 75BD0 800DC720 44071000 */ mfc1 $a3, $f2
/* 75BD4 800DC724 46000007 */ neg.s $f0, $f0
/* 75BD8 800DC728 E440011C */ swc1 $f0, 0x11C($v0)
/* 75BDC 800DC72C 0C00A720 */ jal atan2
/* 75BE0 800DC730 E44C0120 */ swc1 $f12, 0x120($v0)
/* 75BE4 800DC734 0220102D */ daddu $v0, $s1, $zero
/* 75BE8 800DC738 8E030000 */ lw $v1, 0x0($s0)
/* 75BEC 800DC73C 46000007 */ neg.s $f0, $f0
/* 75BF0 800DC740 080371D3 */ j .L800DC74C
/* 75BF4 800DC744 E4600124 */ swc1 $f0, 0x124($v1)
.L800DC748:
/* 75BF8 800DC748 0220102D */ daddu $v0, $s1, $zero
.L800DC74C:
/* 75BFC 800DC74C 8FBF0088 */ lw $ra, 0x88($sp)
/* 75C00 800DC750 8FB50084 */ lw $s5, 0x84($sp)
/* 75C04 800DC754 8FB40080 */ lw $s4, 0x80($sp)
/* 75C08 800DC758 8FB3007C */ lw $s3, 0x7C($sp)
/* 75C0C 800DC75C 8FB20078 */ lw $s2, 0x78($sp)
/* 75C10 800DC760 8FB10074 */ lw $s1, 0x74($sp)
/* 75C14 800DC764 8FB00070 */ lw $s0, 0x70($sp)
/* 75C18 800DC768 D7B60098 */ ldc1 $f22, 0x98($sp)
/* 75C1C 800DC76C D7B40090 */ ldc1 $f20, 0x90($sp)
/* 75C20 800DC770 03E00008 */ jr $ra
/* 75C24 800DC774 27BD00A0 */ addiu $sp, $sp, 0xA0
### DECOMPILED C INSTRUCTIONS:
s32 npc_raycast_down(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32* hitDepth) {
f32 cHitX;
f32 cHitY;
f32 cHitZ;
f32 cHitDepth;
f32 cHitNx;
f32 cHitNy;
f32 cHitNz;
f32 eHitX;
f32 eHitY;
f32 eHitZ;
f32 eHitDepth;
f32 eHitNx;
f32 eHitNy;
f32 eHitNz;
s32 entityID;
s32 colliderID;
f32 sx, sy, sz;
eHitDepth = cHitDepth = fabsf(*hitDepth);
sx = *startX;
sy = *startY;
sz = *startZ;
colliderID = test_ray_colliders(ignoreFlags, sx, sy, sz, 0.0f, -1.0f, 0.0f, &cHitX, &cHitY, &cHitZ, &cHitDepth, &cHitNx, &cHitNy, &cHitNz);
if ((ignoreFlags & COLLISION_IGNORE_ENTITIES) == 0) {
entityID = test_ray_entities(*startX, *startY, *startZ, 0.0f, -1.0f, 0.0f, &eHitX, &eHitY, &eHitZ, &eHitDepth, &eHitNx, &eHitNy, &eHitNz);
if (entityID >= 0) {
colliderID = entityID | COLLISION_WITH_ENTITY_BIT;
if (eHitDepth < cHitDepth) {
cHitDepth = eHitDepth;
cHitX = eHitX;
cHitY = eHitY;
cHitZ = eHitZ;
cHitNx = eHitNx;
cHitNy = eHitNy;
cHitNz = eHitNz;
}
}
if (colliderID < 0) {
return colliderID;
}
}
*hitDepth = cHitDepth;
*startX = cHitX;
*startY = cHitY;
*startZ = cHitZ;
if (colliderID < 0) {
return colliderID;
}
gGameStatusPtr->playerGroundTraceNormal.x = cHitNx;
gGameStatusPtr->playerGroundTraceNormal.y = cHitNy;
gGameStatusPtr->playerGroundTraceNormal.z = cHitNz;
gGameStatusPtr->playerGroundTraceAngles.x = -atan2(0.0f, 0.0f, cHitNz * 100.0f, cHitNy * 100.0f);
gGameStatusPtr->playerGroundTraceAngles.y = 0.0f;
gGameStatusPtr->playerGroundTraceAngles.z = -atan2(0.0f, 0.0f, cHitNx * 100.0f, cHitNy * 100.0f);
return colliderID;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel UseExitHeading
/* F6B1C 802D216C 27BDFF98 */ addiu $sp, $sp, -0x68
/* F6B20 802D2170 AFB30024 */ sw $s3, 0x24($sp)
/* F6B24 802D2174 0080982D */ daddu $s3, $a0, $zero
/* F6B28 802D2178 AFBF0030 */ sw $ra, 0x30($sp)
/* F6B2C 802D217C AFB5002C */ sw $s5, 0x2C($sp)
/* F6B30 802D2180 AFB40028 */ sw $s4, 0x28($sp)
/* F6B34 802D2184 AFB20020 */ sw $s2, 0x20($sp)
/* F6B38 802D2188 AFB1001C */ sw $s1, 0x1C($sp)
/* F6B3C 802D218C AFB00018 */ sw $s0, 0x18($sp)
/* F6B40 802D2190 F7BE0060 */ sdc1 $f30, 0x60($sp)
/* F6B44 802D2194 F7BC0058 */ sdc1 $f28, 0x58($sp)
/* F6B48 802D2198 F7BA0050 */ sdc1 $f26, 0x50($sp)
/* F6B4C 802D219C F7B80048 */ sdc1 $f24, 0x48($sp)
/* F6B50 802D21A0 F7B60040 */ sdc1 $f22, 0x40($sp)
/* F6B54 802D21A4 F7B40038 */ sdc1 $f20, 0x38($sp)
/* F6B58 802D21A8 8E70000C */ lw $s0, 0xC($s3)
/* F6B5C 802D21AC 0C016AFA */ jal get_current_map_settings
/* F6B60 802D21B0 26750098 */ addiu $s5, $s3, 0x98
/* F6B64 802D21B4 3C128011 */ lui $s2, %hi(gPlayerStatus)
/* F6B68 802D21B8 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus)
/* F6B6C 802D21BC 0C0389B1 */ jal can_trigger_loading_zone
/* F6B70 802D21C0 0040A02D */ daddu $s4, $v0, $zero
/* F6B74 802D21C4 1040007D */ beqz $v0, .L802D23BC
/* F6B78 802D21C8 0000102D */ daddu $v0, $zero, $zero
/* F6B7C 802D21CC 8E050000 */ lw $a1, 0x0($s0)
/* F6B80 802D21D0 26100004 */ addiu $s0, $s0, 0x4
/* F6B84 802D21D4 0C0B1EAF */ jal evt_get_variable
/* F6B88 802D21D8 0260202D */ daddu $a0, $s3, $zero
/* F6B8C 802D21DC 0040882D */ daddu $s1, $v0, $zero
/* F6B90 802D21E0 8E050000 */ lw $a1, 0x0($s0)
/* F6B94 802D21E4 0C0B1EAF */ jal evt_get_variable
/* F6B98 802D21E8 0260202D */ daddu $a0, $s3, $zero
/* F6B9C 802D21EC 0040802D */ daddu $s0, $v0, $zero
/* F6BA0 802D21F0 00101100 */ sll $v0, $s0, 4
/* F6BA4 802D21F4 4491C000 */ mtc1 $s1, $f24
/* F6BA8 802D21F8 00000000 */ nop
/* F6BAC 802D21FC 4680C620 */ cvt.s.w $f24, $f24
/* F6BB0 802D2200 8E460028 */ lw $a2, 0x28($s2)
/* F6BB4 802D2204 8E830014 */ lw $v1, 0x14($s4)
/* F6BB8 802D2208 3C014120 */ lui $at, (0x41200000 >> 16)
/* F6BBC 802D220C 44810000 */ mtc1 $at, $f0
/* F6BC0 802D2210 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* F6BC4 802D2214 4481D000 */ mtc1 $at, $f26
/* F6BC8 802D2218 8E470030 */ lw $a3, 0x30($s2)
/* F6BCC 802D221C 4600C580 */ add.s $f22, $f24, $f0
/* F6BD0 802D2220 00431021 */ addu $v0, $v0, $v1
/* F6BD4 802D2224 C45C0000 */ lwc1 $f28, 0x0($v0)
/* F6BD8 802D2228 461AB502 */ mul.s $f20, $f22, $f26
/* F6BDC 802D222C 00000000 */ nop
/* F6BE0 802D2230 C45E0008 */ lwc1 $f30, 0x8($v0)
/* F6BE4 802D2234 4600E306 */ mov.s $f12, $f28
/* F6BE8 802D2238 0C00A7B5 */ jal dist2D
/* F6BEC 802D223C 4600F386 */ mov.s $f14, $f30
/* F6BF0 802D2240 46140081 */ sub.s $f2, $f0, $f20
/* F6BF4 802D2244 44800000 */ mtc1 $zero, $f0
/* F6BF8 802D2248 00000000 */ nop
/* F6BFC 802D224C 4602003C */ c.lt.s $f0, $f2
/* F6C00 802D2250 00000000 */ nop
/* F6C04 802D2254 4502000B */ bc1fl .L802D2284
/* F6C08 802D2258 00108100 */ sll $s0, $s0, 4
/* F6C0C 802D225C 4602B03C */ c.lt.s $f22, $f2
/* F6C10 802D2260 00000000 */ nop
/* F6C14 802D2264 45030001 */ bc1tl .L802D226C
/* F6C18 802D2268 4600B086 */ mov.s $f2, $f22
.L802D226C:
/* F6C1C 802D226C 461A1002 */ mul.s $f0, $f2, $f26
/* F6C20 802D2270 00000000 */ nop
/* F6C24 802D2274 4600C001 */ sub.s $f0, $f24, $f0
/* F6C28 802D2278 4600040D */ trunc.w.s $f16, $f0
/* F6C2C 802D227C 44118000 */ mfc1 $s1, $f16
/* F6C30 802D2280 00108100 */ sll $s0, $s0, 4
.L802D2284:
/* F6C34 802D2284 8E820014 */ lw $v0, 0x14($s4)
/* F6C38 802D2288 3C014334 */ lui $at, (0x43340000 >> 16)
/* F6C3C 802D228C 44816000 */ mtc1 $at, $f12
/* F6C40 802D2290 02021021 */ addu $v0, $s0, $v0
/* F6C44 802D2294 C440000C */ lwc1 $f0, 0xC($v0)
/* F6C48 802D2298 0C00A6C9 */ jal clamp_angle
/* F6C4C 802D229C 460C0300 */ add.s $f12, $f0, $f12
/* F6C50 802D22A0 46000306 */ mov.s $f12, $f0
/* F6C54 802D22A4 27A50010 */ addiu $a1, $sp, 0x10
/* F6C58 802D22A8 0C00A88D */ jal sin_cos_deg
/* F6C5C 802D22AC 27A60014 */ addiu $a2, $sp, 0x14
/* F6C60 802D22B0 C7AA0010 */ lwc1 $f10, 0x10($sp)
/* F6C64 802D22B4 44913000 */ mtc1 $s1, $f6
/* F6C68 802D22B8 00000000 */ nop
/* F6C6C 802D22BC 468031A0 */ cvt.s.w $f6, $f6
/* F6C70 802D22C0 460A3302 */ mul.s $f12, $f6, $f10
/* F6C74 802D22C4 00000000 */ nop
/* F6C78 802D22C8 C7A80014 */ lwc1 $f8, 0x14($sp)
/* F6C7C 802D22CC 46083182 */ mul.s $f6, $f6, $f8
/* F6C80 802D22D0 00000000 */ nop
/* F6C84 802D22D4 C6420028 */ lwc1 $f2, 0x28($s2)
/* F6C88 802D22D8 461C1081 */ sub.s $f2, $f2, $f28
/* F6C8C 802D22DC 46024082 */ mul.s $f2, $f8, $f2
/* F6C90 802D22E0 00000000 */ nop
/* F6C94 802D22E4 C6400030 */ lwc1 $f0, 0x30($s2)
/* F6C98 802D22E8 4600F001 */ sub.s $f0, $f30, $f0
/* F6C9C 802D22EC 46005002 */ mul.s $f0, $f10, $f0
/* F6CA0 802D22F0 00000000 */ nop
/* F6CA4 802D22F4 46001081 */ sub.s $f2, $f2, $f0
/* F6CA8 802D22F8 3C013E99 */ lui $at, (0x3E99999A >> 16)
/* F6CAC 802D22FC 3421999A */ ori $at, $at, (0x3E99999A & 0xFFFF)
/* F6CB0 802D2300 44812000 */ mtc1 $at, $f4
/* F6CB4 802D2304 00000000 */ nop
/* F6CB8 802D2308 46041102 */ mul.s $f4, $f2, $f4
/* F6CBC 802D230C 00000000 */ nop
/* F6CC0 802D2310 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* F6CC4 802D2314 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* F6CC8 802D2318 46082382 */ mul.s $f14, $f4, $f8
/* F6CCC 802D231C 00000000 */ nop
/* F6CD0 802D2320 E4420094 */ swc1 $f2, 0x94($v0)
/* F6CD4 802D2324 C6400028 */ lwc1 $f0, 0x28($s2)
/* F6CD8 802D2328 460C0000 */ add.s $f0, $f0, $f12
/* F6CDC 802D232C 460E0001 */ sub.s $f0, $f0, $f14
/* F6CE0 802D2330 460A2102 */ mul.s $f4, $f4, $f10
/* F6CE4 802D2334 00000000 */ nop
/* F6CE8 802D2338 4600040D */ trunc.w.s $f16, $f0
/* F6CEC 802D233C E6700088 */ swc1 $f16, 0x88($s3)
/* F6CF0 802D2340 C6400030 */ lwc1 $f0, 0x30($s2)
/* F6CF4 802D2344 46060001 */ sub.s $f0, $f0, $f6
/* F6CF8 802D2348 3C038888 */ lui $v1, (0x88888889 >> 16)
/* F6CFC 802D234C 46040001 */ sub.s $f0, $f0, $f4
/* F6D00 802D2350 34638889 */ ori $v1, $v1, (0x88888889 & 0xFFFF)
/* F6D04 802D2354 001127C3 */ sra $a0, $s1, 31
/* F6D08 802D2358 4600040D */ trunc.w.s $f16, $f0
/* F6D0C 802D235C E6700090 */ swc1 $f16, 0x90($s3)
/* F6D10 802D2360 8E820014 */ lw $v0, 0x14($s4)
/* F6D14 802D2364 02230018 */ mult $s1, $v1
/* F6D18 802D2368 02028021 */ addu $s0, $s0, $v0
/* F6D1C 802D236C C6000004 */ lwc1 $f0, 0x4($s0)
/* F6D20 802D2370 24020002 */ addiu $v0, $zero, 0x2
/* F6D24 802D2374 4600040D */ trunc.w.s $f16, $f0
/* F6D28 802D2378 E670008C */ swc1 $f16, 0x8C($s3)
/* F6D2C 802D237C 00004010 */ mfhi $t0
/* F6D30 802D2380 01111821 */ addu $v1, $t0, $s1
/* F6D34 802D2384 000318C3 */ sra $v1, $v1, 3
/* F6D38 802D2388 00641823 */ subu $v1, $v1, $a0
/* F6D3C 802D238C 44830000 */ mtc1 $v1, $f0
/* F6D40 802D2390 00000000 */ nop
/* F6D44 802D2394 46800020 */ cvt.s.w $f0, $f0
/* F6D48 802D2398 E6A00000 */ swc1 $f0, 0x0($s5)
/* F6D4C 802D239C 8E430004 */ lw $v1, 0x4($s2)
/* F6D50 802D23A0 3C040010 */ lui $a0, (0x100000 >> 16)
/* F6D54 802D23A4 00641825 */ or $v1, $v1, $a0
/* F6D58 802D23A8 AE430004 */ sw $v1, 0x4($s2)
/* F6D5C 802D23AC 8E430000 */ lw $v1, 0x0($s2)
/* F6D60 802D23B0 3C040400 */ lui $a0, (0x4000000 >> 16)
/* F6D64 802D23B4 00641825 */ or $v1, $v1, $a0
/* F6D68 802D23B8 AE430000 */ sw $v1, 0x0($s2)
.L802D23BC:
/* F6D6C 802D23BC 8FBF0030 */ lw $ra, 0x30($sp)
/* F6D70 802D23C0 8FB5002C */ lw $s5, 0x2C($sp)
/* F6D74 802D23C4 8FB40028 */ lw $s4, 0x28($sp)
/* F6D78 802D23C8 8FB30024 */ lw $s3, 0x24($sp)
/* F6D7C 802D23CC 8FB20020 */ lw $s2, 0x20($sp)
/* F6D80 802D23D0 8FB1001C */ lw $s1, 0x1C($sp)
/* F6D84 802D23D4 8FB00018 */ lw $s0, 0x18($sp)
/* F6D88 802D23D8 D7BE0060 */ ldc1 $f30, 0x60($sp)
/* F6D8C 802D23DC D7BC0058 */ ldc1 $f28, 0x58($sp)
/* F6D90 802D23E0 D7BA0050 */ ldc1 $f26, 0x50($sp)
/* F6D94 802D23E4 D7B80048 */ ldc1 $f24, 0x48($sp)
/* F6D98 802D23E8 D7B60040 */ ldc1 $f22, 0x40($sp)
/* F6D9C 802D23EC D7B40038 */ ldc1 $f20, 0x38($sp)
/* F6DA0 802D23F0 03E00008 */ jr $ra
/* F6DA4 802D23F4 27BD0068 */ addiu $sp, $sp, 0x68
### DECOMPILED C INSTRUCTIONS:
ApiStatus UseExitHeading(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
PlayerStatus* playerStatus = &gPlayerStatus;
MapSettings* mapSettings = get_current_map_settings();
f32* varTableVar5 = &script->varTableF[5];
if (can_trigger_loading_zone()) {
s32 var1 = evt_get_variable(script, *args++);
s32 entryID = evt_get_variable(script, *args++);
f32 entryX = (*mapSettings->entryList)[entryID].x;
f32 entryZ = (*mapSettings->entryList)[entryID].z;
f32 temp = (var1 + 10.0f) / 2;
f32 temp_f2 = dist2D(entryX, entryZ, playerStatus->position.x, playerStatus->position.z) - temp;
f32 sinTheta;
f32 cosTheta;
f32 exitTangentFrac;
if (temp_f2 > 0.0f) {
if (temp_f2 > var1 + 10.0f) {
temp_f2 = var1 + 10.0f;
}
var1 -= temp_f2 / 2;
}
sin_cos_deg(clamp_angle((*mapSettings->entryList)[entryID].yaw + 180.0f), &sinTheta, &cosTheta);
gGameStatusPtr->exitTangent = (cosTheta * (playerStatus->position.x - entryX)) - (sinTheta * (entryZ - playerStatus->position.z));
exitTangentFrac = gGameStatusPtr->exitTangent * 0.3f;
script->varTable[1] = (playerStatus->position.x + (var1 * sinTheta)) - (exitTangentFrac * cosTheta);
script->varTable[3] = (playerStatus->position.z - (var1 * cosTheta)) - (exitTangentFrac * sinTheta);
script->varTable[2] = (*mapSettings->entryList)[entryID].y;
*varTableVar5 = var1 / 15;
playerStatus->animFlags |= PA_FLAG_CHANGING_MAP;
playerStatus->flags |= PS_FLAG_CAMERA_DOESNT_FOLLOW;
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_E0082A84
/* 3860C4 E0082A84 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 3860C8 E0082A88 AFB60028 */ sw $s6, 0x28($sp)
/* 3860CC E0082A8C 0080B02D */ daddu $s6, $a0, $zero
/* 3860D0 E0082A90 3C06DB06 */ lui $a2, (0xDB060024 >> 16)
/* 3860D4 E0082A94 34C60024 */ ori $a2, $a2, (0xDB060024 & 0xFFFF)
/* 3860D8 E0082A98 AFB40020 */ sw $s4, 0x20($sp)
/* 3860DC E0082A9C 24140001 */ addiu $s4, $zero, 0x1
/* 3860E0 E0082AA0 AFB00010 */ sw $s0, 0x10($sp)
/* 3860E4 E0082AA4 3C10800A */ lui $s0, %hi(gMainGfxPos)
/* 3860E8 E0082AA8 2610A66C */ addiu $s0, $s0, %lo(gMainGfxPos)
/* 3860EC E0082AAC 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3860F0 E0082AB0 AFBF0034 */ sw $ra, 0x34($sp)
/* 3860F4 E0082AB4 AFBE0030 */ sw $fp, 0x30($sp)
/* 3860F8 E0082AB8 AFB7002C */ sw $s7, 0x2C($sp)
/* 3860FC E0082ABC AFB50024 */ sw $s5, 0x24($sp)
/* 386100 E0082AC0 AFB3001C */ sw $s3, 0x1C($sp)
/* 386104 E0082AC4 AFB20018 */ sw $s2, 0x18($sp)
/* 386108 E0082AC8 AFB10014 */ sw $s1, 0x14($sp)
/* 38610C E0082ACC 8E050000 */ lw $a1, 0x0($s0)
/* 386110 E0082AD0 8ED3000C */ lw $s3, 0xC($s6)
/* 386114 E0082AD4 00A0182D */ daddu $v1, $a1, $zero
/* 386118 E0082AD8 24A50008 */ addiu $a1, $a1, 0x8
/* 38611C E0082ADC 0260202D */ daddu $a0, $s3, $zero
/* 386120 E0082AE0 AE050000 */ sw $a1, 0x0($s0)
/* 386124 E0082AE4 AC620000 */ sw $v0, 0x0($v1)
/* 386128 E0082AE8 AC600004 */ sw $zero, 0x4($v1)
/* 38612C E0082AEC ACA60000 */ sw $a2, 0x0($a1)
/* 386130 E0082AF0 8EC30010 */ lw $v1, 0x10($s6)
/* 386134 E0082AF4 24A20008 */ addiu $v0, $a1, 0x8
/* 386138 E0082AF8 AE020000 */ sw $v0, 0x0($s0)
/* 38613C E0082AFC 8C62001C */ lw $v0, 0x1C($v1)
/* 386140 E0082B00 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 386144 E0082B04 00431021 */ addu $v0, $v0, $v1
/* 386148 E0082B08 0C020960 */ jal func_E0082580
/* 38614C E0082B0C ACA20004 */ sw $v0, 0x4($a1)
/* 386150 E0082B10 8E720038 */ lw $s2, 0x38($s3)
/* 386154 E0082B14 8EC20008 */ lw $v0, 0x8($s6)
/* 386158 E0082B18 0282102A */ slt $v0, $s4, $v0
/* 38615C E0082B1C 10400059 */ beqz $v0, .LE0082C84
/* 386160 E0082B20 26730048 */ addiu $s3, $s3, 0x48
/* 386164 E0082B24 3C026666 */ lui $v0, (0x66666667 >> 16)
/* 386168 E0082B28 34426667 */ ori $v0, $v0, (0x66666667 & 0xFFFF)
/* 38616C E0082B2C 02420018 */ mult $s2, $v0
/* 386170 E0082B30 3C11DE00 */ lui $s1, (0xDE000000 >> 16)
/* 386174 E0082B34 3C15E008 */ lui $s5, %hi(D_E0082D00)
/* 386178 E0082B38 26B52D00 */ addiu $s5, $s5, %lo(D_E0082D00)
/* 38617C E0082B3C 00121080 */ sll $v0, $s2, 2
/* 386180 E0082B40 0055F021 */ addu $fp, $v0, $s5
/* 386184 E0082B44 00003810 */ mfhi $a3
/* 386188 E0082B48 0007B883 */ sra $s7, $a3, 2
.LE0082B4C:
/* 38618C E0082B4C 0C0209B1 */ jal func_E00826C4
/* 386190 E0082B50 0260202D */ daddu $a0, $s3, $zero
/* 386194 E0082B54 1A40003E */ blez $s2, .LE0082C50
/* 386198 E0082B58 3C02D838 */ lui $v0, (0xD8380002 >> 16)
/* 38619C E0082B5C 8E050000 */ lw $a1, 0x0($s0)
/* 3861A0 E0082B60 3C030900 */ lui $v1, %hi(D_090022B0_40F540)
/* 3861A4 E0082B64 246322B0 */ addiu $v1, $v1, %lo(D_090022B0_40F540)
/* 3861A8 E0082B68 00A0102D */ daddu $v0, $a1, $zero
/* 3861AC E0082B6C 24A50008 */ addiu $a1, $a1, 0x8
/* 3861B0 E0082B70 AE050000 */ sw $a1, 0x0($s0)
/* 3861B4 E0082B74 AC510000 */ sw $s1, 0x0($v0)
/* 3861B8 E0082B78 AC430004 */ sw $v1, 0x4($v0)
/* 3861BC E0082B7C 2A42000A */ slti $v0, $s2, 0xA
/* 3861C0 E0082B80 1040000C */ beqz $v0, .LE0082BB4
/* 3861C4 E0082B84 24A20008 */ addiu $v0, $a1, 0x8
/* 3861C8 E0082B88 AE020000 */ sw $v0, 0x0($s0)
/* 3861CC E0082B8C ACB10000 */ sw $s1, 0x0($a1)
/* 3861D0 E0082B90 8FC30000 */ lw $v1, 0x0($fp)
/* 3861D4 E0082B94 24A20010 */ addiu $v0, $a1, 0x10
/* 3861D8 E0082B98 AE020000 */ sw $v0, 0x0($s0)
/* 3861DC E0082B9C 3C020900 */ lui $v0, %hi(D_09002250_40F4E0)
/* 3861E0 E0082BA0 24422250 */ addiu $v0, $v0, %lo(D_09002250_40F4E0)
/* 3861E4 E0082BA4 ACB10008 */ sw $s1, 0x8($a1)
/* 3861E8 E0082BA8 ACA2000C */ sw $v0, 0xC($a1)
/* 3861EC E0082BAC 08020B13 */ j .LE0082C4C
/* 3861F0 E0082BB0 ACA30004 */ sw $v1, 0x4($a1)
.LE0082BB4:
/* 3861F4 E0082BB4 001217C3 */ sra $v0, $s2, 31
/* 3861F8 E0082BB8 02E22023 */ subu $a0, $s7, $v0
/* 3861FC E0082BBC 0080182D */ daddu $v1, $a0, $zero
/* 386200 E0082BC0 00031080 */ sll $v0, $v1, 2
/* 386204 E0082BC4 00431021 */ addu $v0, $v0, $v1
/* 386208 E0082BC8 00021040 */ sll $v0, $v0, 1
/* 38620C E0082BCC 02422023 */ subu $a0, $s2, $v0
/* 386210 E0082BD0 24A20008 */ addiu $v0, $a1, 0x8
/* 386214 E0082BD4 AE020000 */ sw $v0, 0x0($s0)
/* 386218 E0082BD8 00041080 */ sll $v0, $a0, 2
/* 38621C E0082BDC 00551021 */ addu $v0, $v0, $s5
/* 386220 E0082BE0 ACB10000 */ sw $s1, 0x0($a1)
/* 386224 E0082BE4 8C440000 */ lw $a0, 0x0($v0)
/* 386228 E0082BE8 24A20010 */ addiu $v0, $a1, 0x10
/* 38622C E0082BEC AE020000 */ sw $v0, 0x0($s0)
/* 386230 E0082BF0 24A20018 */ addiu $v0, $a1, 0x18
/* 386234 E0082BF4 00031880 */ sll $v1, $v1, 2
/* 386238 E0082BF8 00751821 */ addu $v1, $v1, $s5
/* 38623C E0082BFC ACB10008 */ sw $s1, 0x8($a1)
/* 386240 E0082C00 AE020000 */ sw $v0, 0x0($s0)
/* 386244 E0082C04 ACA40004 */ sw $a0, 0x4($a1)
/* 386248 E0082C08 8C640000 */ lw $a0, 0x0($v1)
/* 38624C E0082C0C 24A20020 */ addiu $v0, $a1, 0x20
/* 386250 E0082C10 AE020000 */ sw $v0, 0x0($s0)
/* 386254 E0082C14 3C020900 */ lui $v0, %hi(D_09002290_40F520)
/* 386258 E0082C18 24422290 */ addiu $v0, $v0, %lo(D_09002290_40F520)
/* 38625C E0082C1C ACB10010 */ sw $s1, 0x10($a1)
/* 386260 E0082C20 ACA20014 */ sw $v0, 0x14($a1)
/* 386264 E0082C24 ACB10018 */ sw $s1, 0x18($a1)
/* 386268 E0082C28 ACA4000C */ sw $a0, 0xC($a1)
/* 38626C E0082C2C 8C630000 */ lw $v1, 0x0($v1)
/* 386270 E0082C30 24A20028 */ addiu $v0, $a1, 0x28
/* 386274 E0082C34 AE020000 */ sw $v0, 0x0($s0)
/* 386278 E0082C38 3C020900 */ lui $v0, %hi(D_09002270_40F500)
/* 38627C E0082C3C 24422270 */ addiu $v0, $v0, %lo(D_09002270_40F500)
/* 386280 E0082C40 ACB10020 */ sw $s1, 0x20($a1)
/* 386284 E0082C44 ACA20024 */ sw $v0, 0x24($a1)
/* 386288 E0082C48 ACA3001C */ sw $v1, 0x1C($a1)
.LE0082C4C:
/* 38628C E0082C4C 3C02D838 */ lui $v0, (0xD8380002 >> 16)
.LE0082C50:
/* 386290 E0082C50 34420002 */ ori $v0, $v0, (0xD8380002 & 0xFFFF)
/* 386294 E0082C54 26940001 */ addiu $s4, $s4, 0x1
/* 386298 E0082C58 8E040000 */ lw $a0, 0x0($s0)
/* 38629C E0082C5C 26730048 */ addiu $s3, $s3, 0x48
/* 3862A0 E0082C60 0080182D */ daddu $v1, $a0, $zero
/* 3862A4 E0082C64 AC620000 */ sw $v0, 0x0($v1)
/* 3862A8 E0082C68 24020040 */ addiu $v0, $zero, 0x40
/* 3862AC E0082C6C AC620004 */ sw $v0, 0x4($v1)
/* 3862B0 E0082C70 8EC20008 */ lw $v0, 0x8($s6)
/* 3862B4 E0082C74 24840008 */ addiu $a0, $a0, 0x8
/* 3862B8 E0082C78 0282102A */ slt $v0, $s4, $v0
/* 3862BC E0082C7C 1440FFB3 */ bnez $v0, .LE0082B4C
/* 3862C0 E0082C80 AE040000 */ sw $a0, 0x0($s0)
.LE0082C84:
/* 3862C4 E0082C84 3C03D838 */ lui $v1, (0xD8380002 >> 16)
/* 3862C8 E0082C88 3C04800A */ lui $a0, %hi(gMainGfxPos)
/* 3862CC E0082C8C 2484A66C */ addiu $a0, $a0, %lo(gMainGfxPos)
/* 3862D0 E0082C90 8C820000 */ lw $v0, 0x0($a0)
/* 3862D4 E0082C94 34630002 */ ori $v1, $v1, (0xD8380002 & 0xFFFF)
/* 3862D8 E0082C98 0040282D */ daddu $a1, $v0, $zero
/* 3862DC E0082C9C 24420008 */ addiu $v0, $v0, 0x8
/* 3862E0 E0082CA0 AC820000 */ sw $v0, 0x0($a0)
/* 3862E4 E0082CA4 ACA30000 */ sw $v1, 0x0($a1)
/* 3862E8 E0082CA8 24030040 */ addiu $v1, $zero, 0x40
/* 3862EC E0082CAC ACA30004 */ sw $v1, 0x4($a1)
/* 3862F0 E0082CB0 24430008 */ addiu $v1, $v0, 0x8
/* 3862F4 E0082CB4 AC830000 */ sw $v1, 0x0($a0)
/* 3862F8 E0082CB8 3C03E700 */ lui $v1, (0xE7000000 >> 16)
/* 3862FC E0082CBC AC430000 */ sw $v1, 0x0($v0)
/* 386300 E0082CC0 AC400004 */ sw $zero, 0x4($v0)
/* 386304 E0082CC4 8FBF0034 */ lw $ra, 0x34($sp)
/* 386308 E0082CC8 8FBE0030 */ lw $fp, 0x30($sp)
/* 38630C E0082CCC 8FB7002C */ lw $s7, 0x2C($sp)
/* 386310 E0082CD0 8FB60028 */ lw $s6, 0x28($sp)
/* 386314 E0082CD4 8FB50024 */ lw $s5, 0x24($sp)
/* 386318 E0082CD8 8FB40020 */ lw $s4, 0x20($sp)
/* 38631C E0082CDC 8FB3001C */ lw $s3, 0x1C($sp)
/* 386320 E0082CE0 8FB20018 */ lw $s2, 0x18($sp)
/* 386324 E0082CE4 8FB10014 */ lw $s1, 0x14($sp)
/* 386328 E0082CE8 8FB00010 */ lw $s0, 0x10($sp)
/* 38632C E0082CEC 03E00008 */ jr $ra
/* 386330 E0082CF0 27BD0038 */ addiu $sp, $sp, 0x38
/* 386334 E0082CF4 00000000 */ nop
/* 386338 E0082CF8 00000000 */ nop
/* 38633C E0082CFC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void func_E0082A84(EffectInstance* effect) {
DisableXFXData* data = effect->data.disableX;
s32 unk_38;
s32 i;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data));
func_E0082580(data);
unk_38 = data->unk_38;
data++;
for (i = 1; i < effect->numParts; i++, data++) {
func_E00826C4(data);
if (unk_38 > 0) {
gSPDisplayList(gMainGfxPos++, D_090022B0_388660);
if (unk_38 < 10) {
gSPDisplayList(gMainGfxPos++, D_E0082D00[unk_38]);
gSPDisplayList(gMainGfxPos++, D_09002250_388600);
} else {
s32 ones = unk_38 % 10;
s32 tens = unk_38 / 10;
gSPDisplayList(gMainGfxPos++, D_E0082D00[ones]);
gSPDisplayList(gMainGfxPos++, D_E0082D00[tens]);
gSPDisplayList(gMainGfxPos++, D_09002290_388640);
gSPDisplayList(gMainGfxPos++, D_E0082D00[tens]);
gSPDisplayList(gMainGfxPos++, D_09002270_388620);
}
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel drop_leaves_update
/* 33D038 E0028248 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 33D03C E002824C AFB3001C */ sw $s3, 0x1C($sp)
/* 33D040 E0028250 0080982D */ daddu $s3, $a0, $zero
/* 33D044 E0028254 AFBF0024 */ sw $ra, 0x24($sp)
/* 33D048 E0028258 AFB40020 */ sw $s4, 0x20($sp)
/* 33D04C E002825C AFB20018 */ sw $s2, 0x18($sp)
/* 33D050 E0028260 AFB10014 */ sw $s1, 0x14($sp)
/* 33D054 E0028264 AFB00010 */ sw $s0, 0x10($sp)
/* 33D058 E0028268 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 33D05C E002826C F7B40028 */ sdc1 $f20, 0x28($sp)
/* 33D060 E0028270 8E64000C */ lw $a0, 0xC($s3)
/* 33D064 E0028274 8C820028 */ lw $v0, 0x28($a0)
/* 33D068 E0028278 8C85002C */ lw $a1, 0x2C($a0)
/* 33D06C E002827C 2442FFFF */ addiu $v0, $v0, -0x1
/* 33D070 E0028280 AC820028 */ sw $v0, 0x28($a0)
/* 33D074 E0028284 0040302D */ daddu $a2, $v0, $zero
/* 33D078 E0028288 24A20001 */ addiu $v0, $a1, 0x1
/* 33D07C E002828C 04C10005 */ bgez $a2, .LE00282A4
/* 33D080 E0028290 AC82002C */ sw $v0, 0x2C($a0)
/* 33D084 E0028294 0C080128 */ jal shim_remove_effect
/* 33D088 E0028298 0260202D */ daddu $a0, $s3, $zero
/* 33D08C E002829C 0800A130 */ j .LE00284C0
/* 33D090 E00282A0 00000000 */ nop
.LE00282A4:
/* 33D094 E00282A4 8C940000 */ lw $s4, 0x0($a0)
/* 33D098 E00282A8 2842000A */ slti $v0, $v0, 0xA
/* 33D09C E00282AC 10400010 */ beqz $v0, .LE00282F0
/* 33D0A0 E00282B0 240200FF */ addiu $v0, $zero, 0xFF
/* 33D0A4 E00282B4 8C830024 */ lw $v1, 0x24($a0)
/* 33D0A8 E00282B8 3C01E003 */ lui $at, (0xE0030000 >> 16)
/* 33D0AC E00282BC D42087E0 */ ldc1 $f0, -0x7820($at)
/* 33D0B0 E00282C0 00431023 */ subu $v0, $v0, $v1
/* 33D0B4 E00282C4 44821000 */ mtc1 $v0, $f2
/* 33D0B8 E00282C8 00000000 */ nop
/* 33D0BC E00282CC 468010A1 */ cvt.d.w $f2, $f2
/* 33D0C0 E00282D0 46201082 */ mul.d $f2, $f2, $f0
/* 33D0C4 E00282D4 00000000 */ nop
/* 33D0C8 E00282D8 44830000 */ mtc1 $v1, $f0
/* 33D0CC E00282DC 00000000 */ nop
/* 33D0D0 E00282E0 46800021 */ cvt.d.w $f0, $f0
/* 33D0D4 E00282E4 46220000 */ add.d $f0, $f0, $f2
/* 33D0D8 E00282E8 4620020D */ trunc.w.d $f8, $f0
/* 33D0DC E00282EC E4880024 */ swc1 $f8, 0x24($a0)
.LE00282F0:
/* 33D0E0 E00282F0 28C2000A */ slti $v0, $a2, 0xA
/* 33D0E4 E00282F4 10400009 */ beqz $v0, .LE002831C
/* 33D0E8 E00282F8 00000000 */ nop
/* 33D0EC E00282FC 3C01E003 */ lui $at, (0xE0030000 >> 16)
/* 33D0F0 E0028300 D42287E8 */ ldc1 $f2, -0x7818($at)
/* 33D0F4 E0028304 C4800024 */ lwc1 $f0, 0x24($a0)
/* 33D0F8 E0028308 46800021 */ cvt.d.w $f0, $f0
/* 33D0FC E002830C 46220002 */ mul.d $f0, $f0, $f2
/* 33D100 E0028310 00000000 */ nop
/* 33D104 E0028314 4620020D */ trunc.w.d $f8, $f0
/* 33D108 E0028318 E4880024 */ swc1 $f8, 0x24($a0)
.LE002831C:
/* 33D10C E002831C 8E620008 */ lw $v0, 0x8($s3)
/* 33D110 E0028320 24110001 */ addiu $s1, $zero, 0x1
/* 33D114 E0028324 0222102A */ slt $v0, $s1, $v0
/* 33D118 E0028328 10400065 */ beqz $v0, .LE00284C0
/* 33D11C E002832C 24840030 */ addiu $a0, $a0, 0x30
/* 33D120 E0028330 24900008 */ addiu $s0, $a0, 0x8
/* 33D124 E0028334 24B20015 */ addiu $s2, $a1, 0x15
/* 33D128 E0028338 3C01BD4C */ lui $at, (0xBD4CCCCD >> 16)
/* 33D12C E002833C 3421CCCD */ ori $at, $at, (0xBD4CCCCD & 0xFFFF)
/* 33D130 E0028340 4481B000 */ mtc1 $at, $f22
/* 33D134 E0028344 3C014120 */ lui $at, (0x41200000 >> 16)
/* 33D138 E0028348 4481A000 */ mtc1 $at, $f20
.LE002834C:
/* 33D13C E002834C C60C0010 */ lwc1 $f12, 0x10($s0)
/* 33D140 E0028350 0C080140 */ jal shim_sin_deg
/* 33D144 E0028354 460C6300 */ add.s $f12, $f12, $f12
/* 33D148 E0028358 3C01E003 */ lui $at, (0xE0030000 >> 16)
/* 33D14C E002835C D42287F0 */ ldc1 $f2, -0x7810($at)
/* 33D150 E0028360 46000021 */ cvt.d.s $f0, $f0
/* 33D154 E0028364 46220002 */ mul.d $f0, $f0, $f2
/* 33D158 E0028368 00000000 */ nop
/* 33D15C E002836C C602000C */ lwc1 $f2, 0xC($s0)
/* 33D160 E0028370 46161080 */ add.s $f2, $f2, $f22
/* 33D164 E0028374 C6040008 */ lwc1 $f4, 0x8($s0)
/* 33D168 E0028378 46200020 */ cvt.s.d $f0, $f0
/* 33D16C E002837C 46002000 */ add.s $f0, $f4, $f0
/* 33D170 E0028380 E602000C */ swc1 $f2, 0xC($s0)
/* 33D174 E0028384 16800019 */ bnez $s4, .LE00283EC
/* 33D178 E0028388 E6000008 */ swc1 $f0, 0x8($s0)
/* 33D17C E002838C 3C01E003 */ lui $at, (0xE0030000 >> 16)
/* 33D180 E0028390 D42287F8 */ ldc1 $f2, -0x7808($at)
/* 33D184 E0028394 46000021 */ cvt.d.s $f0, $f0
/* 33D188 E0028398 46220002 */ mul.d $f0, $f0, $f2
/* 33D18C E002839C 00000000 */ nop
/* 33D190 E00283A0 C60C0010 */ lwc1 $f12, 0x10($s0)
/* 33D194 E00283A4 46200020 */ cvt.s.d $f0, $f0
/* 33D198 E00283A8 0C080140 */ jal shim_sin_deg
/* 33D19C E00283AC E6000008 */ swc1 $f0, 0x8($s0)
/* 33D1A0 E00283B0 3C01E003 */ lui $at, (0xE0030000 >> 16)
/* 33D1A4 E00283B4 D4228800 */ ldc1 $f2, -0x7800($at)
/* 33D1A8 E00283B8 46000021 */ cvt.d.s $f0, $f0
/* 33D1AC E00283BC 46220002 */ mul.d $f0, $f0, $f2
/* 33D1B0 E00283C0 00000000 */ nop
/* 33D1B4 E00283C4 3C01E003 */ lui $at, (0xE0030000 >> 16)
/* 33D1B8 E00283C8 D4248808 */ ldc1 $f4, -0x77F8($at)
/* 33D1BC E00283CC C602000C */ lwc1 $f2, 0xC($s0)
/* 33D1C0 E00283D0 46240000 */ add.d $f0, $f0, $f4
/* 33D1C4 E00283D4 460010A1 */ cvt.d.s $f2, $f2
/* 33D1C8 E00283D8 46201082 */ mul.d $f2, $f2, $f0
/* 33D1CC E00283DC 00000000 */ nop
/* 33D1D0 E00283E0 462010A0 */ cvt.s.d $f2, $f2
/* 33D1D4 E00283E4 0800A106 */ j .LE0028418
/* 33D1D8 E00283E8 E602000C */ swc1 $f2, 0xC($s0)
.LE00283EC:
/* 33D1DC E00283EC C6000008 */ lwc1 $f0, 0x8($s0)
/* 33D1E0 E00283F0 3C01E003 */ lui $at, (0xE0030000 >> 16)
/* 33D1E4 E00283F4 D4228810 */ ldc1 $f2, -0x77F0($at)
/* 33D1E8 E00283F8 46000021 */ cvt.d.s $f0, $f0
/* 33D1EC E00283FC 46220002 */ mul.d $f0, $f0, $f2
/* 33D1F0 E0028400 00000000 */ nop
/* 33D1F4 E0028404 C602000C */ lwc1 $f2, 0xC($s0)
/* 33D1F8 E0028408 46161080 */ add.s $f2, $f2, $f22
/* 33D1FC E002840C E602000C */ swc1 $f2, 0xC($s0)
/* 33D200 E0028410 46200020 */ cvt.s.d $f0, $f0
/* 33D204 E0028414 E6000008 */ swc1 $f0, 0x8($s0)
.LE0028418:
/* 33D208 E0028418 24040032 */ addiu $a0, $zero, 0x32
/* 33D20C E002841C 0C080011 */ jal func_E0200044
/* 33D210 E0028420 0240282D */ daddu $a1, $s2, $zero
/* 33D214 E0028424 2442FFE7 */ addiu $v0, $v0, -0x19
/* 33D218 E0028428 C60C0014 */ lwc1 $f12, 0x14($s0)
/* 33D21C E002842C 44820000 */ mtc1 $v0, $f0
/* 33D220 E0028430 00000000 */ nop
/* 33D224 E0028434 46800020 */ cvt.s.w $f0, $f0
/* 33D228 E0028438 46006300 */ add.s $f12, $f12, $f0
/* 33D22C E002843C 0C080140 */ jal shim_sin_deg
/* 33D230 E0028440 E60C0014 */ swc1 $f12, 0x14($s0)
/* 33D234 E0028444 46140002 */ mul.s $f0, $f0, $f20
/* 33D238 E0028448 00000000 */ nop
/* 33D23C E002844C C6020014 */ lwc1 $f2, 0x14($s0)
/* 33D240 E0028450 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 33D244 E0028454 44816000 */ mtc1 $at, $f12
/* 33D248 E0028458 00000000 */ nop
/* 33D24C E002845C 460C1302 */ mul.s $f12, $f2, $f12
/* 33D250 E0028460 00000000 */ nop
/* 33D254 E0028464 C6020010 */ lwc1 $f2, 0x10($s0)
/* 33D258 E0028468 46001080 */ add.s $f2, $f2, $f0
/* 33D25C E002846C 0C080144 */ jal shim_cos_deg
/* 33D260 E0028470 E6020010 */ swc1 $f2, 0x10($s0)
/* 33D264 E0028474 46140002 */ mul.s $f0, $f0, $f20
/* 33D268 E0028478 00000000 */ nop
/* 33D26C E002847C C606FFFC */ lwc1 $f6, -0x4($s0)
/* 33D270 E0028480 C6020008 */ lwc1 $f2, 0x8($s0)
/* 33D274 E0028484 C6040000 */ lwc1 $f4, 0x0($s0)
/* 33D278 E0028488 46023180 */ add.s $f6, $f6, $f2
/* 33D27C E002848C C602000C */ lwc1 $f2, 0xC($s0)
/* 33D280 E0028490 26520014 */ addiu $s2, $s2, 0x14
/* 33D284 E0028494 46022100 */ add.s $f4, $f4, $f2
/* 33D288 E0028498 C6020018 */ lwc1 $f2, 0x18($s0)
/* 33D28C E002849C 26310001 */ addiu $s1, $s1, 0x1
/* 33D290 E00284A0 46001080 */ add.s $f2, $f2, $f0
/* 33D294 E00284A4 E606FFFC */ swc1 $f6, -0x4($s0)
/* 33D298 E00284A8 E6040000 */ swc1 $f4, 0x0($s0)
/* 33D29C E00284AC E6020018 */ swc1 $f2, 0x18($s0)
/* 33D2A0 E00284B0 8E620008 */ lw $v0, 0x8($s3)
/* 33D2A4 E00284B4 0222102A */ slt $v0, $s1, $v0
/* 33D2A8 E00284B8 1440FFA4 */ bnez $v0, .LE002834C
/* 33D2AC E00284BC 26100030 */ addiu $s0, $s0, 0x30
.LE00284C0:
/* 33D2B0 E00284C0 8FBF0024 */ lw $ra, 0x24($sp)
/* 33D2B4 E00284C4 8FB40020 */ lw $s4, 0x20($sp)
/* 33D2B8 E00284C8 8FB3001C */ lw $s3, 0x1C($sp)
/* 33D2BC E00284CC 8FB20018 */ lw $s2, 0x18($sp)
/* 33D2C0 E00284D0 8FB10014 */ lw $s1, 0x14($sp)
/* 33D2C4 E00284D4 8FB00010 */ lw $s0, 0x10($sp)
/* 33D2C8 E00284D8 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 33D2CC E00284DC D7B40028 */ ldc1 $f20, 0x28($sp)
/* 33D2D0 E00284E0 03E00008 */ jr $ra
/* 33D2D4 E00284E4 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void drop_leaves_update(EffectInstance *effect) {
DropLeavesFXData* part = effect->data.dropLeaves;
s32 unk_00;
s32 unk_28;
s32 unk_2C;
f32 temp;
s32 i;
part->unk_28--;
part->unk_2C++;
if (part->unk_28 < 0) {
shim_remove_effect(effect);
return;
}
unk_00 = part->unk_00;
unk_28 = part->unk_28;
unk_2C = part->unk_2C;
if (unk_2C < 10) {
part->unk_24 += (255 - part->unk_24) * 0.3;
}
if (unk_28 < 10) {
part->unk_24 *= 0.8;
}
part++;
for (i = 1; i < effect->numParts; i++, part++) {
temp = shim_sin_deg(2.0f * part->unk_18) * 0.2;
part->unk_14 += -0.05f;
part->unk_10 += temp;
if (unk_00 == 0) {
part->unk_10 *= 0.94;
part->unk_14 *= shim_sin_deg(part->unk_18) * 0.05 + 0.95;
} else {
part->unk_14 += -0.05f;
part->unk_10 *= 0.92;
}
part->unk_1C += func_E0200044(50, unk_2C + i * 20) - 25;
part->unk_18 += shim_sin_deg(part->unk_1C) * 10.0f;
part->unk_20 += shim_cos_deg(part->unk_1C * 0.5f) * 10.0f;
part->unk_04 += part->unk_10;
part->unk_08 += part->unk_14;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel floating_cloud_puff_appendGfx
/* 3D4BF4 E00D2284 27BDFF48 */ addiu $sp, $sp, -0xB8
/* 3D4BF8 E00D2288 0080302D */ daddu $a2, $a0, $zero
/* 3D4BFC E00D228C 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 3D4C00 E00D2290 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3D4C04 E00D2294 27A40010 */ addiu $a0, $sp, 0x10
/* 3D4C08 E00D2298 AFB600A8 */ sw $s6, 0xA8($sp)
/* 3D4C0C E00D229C 3C160001 */ lui $s6, (0x11630 >> 16)
/* 3D4C10 E00D22A0 AFB3009C */ sw $s3, 0x9C($sp)
/* 3D4C14 E00D22A4 3C13800A */ lui $s3, %hi(gMainGfxPos)
/* 3D4C18 E00D22A8 2673A66C */ addiu $s3, $s3, %lo(gMainGfxPos)
/* 3D4C1C E00D22AC 36D61630 */ ori $s6, $s6, (0x11630 & 0xFFFF)
/* 3D4C20 E00D22B0 AFBF00AC */ sw $ra, 0xAC($sp)
/* 3D4C24 E00D22B4 AFB500A4 */ sw $s5, 0xA4($sp)
/* 3D4C28 E00D22B8 AFB400A0 */ sw $s4, 0xA0($sp)
/* 3D4C2C E00D22BC AFB20098 */ sw $s2, 0x98($sp)
/* 3D4C30 E00D22C0 AFB10094 */ sw $s1, 0x94($sp)
/* 3D4C34 E00D22C4 AFB00090 */ sw $s0, 0x90($sp)
/* 3D4C38 E00D22C8 F7B400B0 */ sdc1 $f20, 0xB0($sp)
/* 3D4C3C E00D22CC 8E650000 */ lw $a1, 0x0($s3)
/* 3D4C40 E00D22D0 8CD2000C */ lw $s2, 0xC($a2)
/* 3D4C44 E00D22D4 00A0182D */ daddu $v1, $a1, $zero
/* 3D4C48 E00D22D8 24A50008 */ addiu $a1, $a1, 0x8
/* 3D4C4C E00D22DC AE650000 */ sw $a1, 0x0($s3)
/* 3D4C50 E00D22E0 8E550024 */ lw $s5, 0x24($s2)
/* 3D4C54 E00D22E4 C6540034 */ lwc1 $f20, 0x34($s2)
/* 3D4C58 E00D22E8 C6400038 */ lwc1 $f0, 0x38($s2)
/* 3D4C5C E00D22EC 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3D4C60 E00D22F0 AC620000 */ sw $v0, 0x0($v1)
/* 3D4C64 E00D22F4 AC600004 */ sw $zero, 0x4($v1)
/* 3D4C68 E00D22F8 ACA70000 */ sw $a3, 0x0($a1)
/* 3D4C6C E00D22FC 8CC30010 */ lw $v1, 0x10($a2)
/* 3D4C70 E00D2300 24A20008 */ addiu $v0, $a1, 0x8
/* 3D4C74 E00D2304 AE620000 */ sw $v0, 0x0($s3)
/* 3D4C78 E00D2308 8C62001C */ lw $v0, 0x1C($v1)
/* 3D4C7C E00D230C 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 3D4C80 E00D2310 4600A502 */ mul.s $f20, $f20, $f0
/* 3D4C84 E00D2314 00000000 */ nop
/* 3D4C88 E00D2318 00431021 */ addu $v0, $v0, $v1
/* 3D4C8C E00D231C 3C03800B */ lui $v1, %hi(gCameras)
/* 3D4C90 E00D2320 24631D80 */ addiu $v1, $v1, %lo(gCameras)
/* 3D4C94 E00D2324 ACA20004 */ sw $v0, 0x4($a1)
/* 3D4C98 E00D2328 8E450004 */ lw $a1, 0x4($s2)
/* 3D4C9C E00D232C 8E460008 */ lw $a2, 0x8($s2)
/* 3D4CA0 E00D2330 3C028007 */ lui $v0, %hi(gCurrentCameraID)
/* 3D4CA4 E00D2334 8C427410 */ lw $v0, %lo(gCurrentCameraID)($v0)
/* 3D4CA8 E00D2338 8E47000C */ lw $a3, 0xC($s2)
/* 3D4CAC E00D233C 00028880 */ sll $s1, $v0, 2
/* 3D4CB0 E00D2340 02228821 */ addu $s1, $s1, $v0
/* 3D4CB4 E00D2344 00118880 */ sll $s1, $s1, 2
/* 3D4CB8 E00D2348 02228823 */ subu $s1, $s1, $v0
/* 3D4CBC E00D234C 001110C0 */ sll $v0, $s1, 3
/* 3D4CC0 E00D2350 02228821 */ addu $s1, $s1, $v0
/* 3D4CC4 E00D2354 001188C0 */ sll $s1, $s1, 3
/* 3D4CC8 E00D2358 0C080108 */ jal shim_guTranslateF
/* 3D4CCC E00D235C 02238821 */ addu $s1, $s1, $v1
/* 3D4CD0 E00D2360 27B00050 */ addiu $s0, $sp, 0x50
/* 3D4CD4 E00D2364 4405A000 */ mfc1 $a1, $f20
/* 3D4CD8 E00D2368 0200202D */ daddu $a0, $s0, $zero
/* 3D4CDC E00D236C 00A0302D */ daddu $a2, $a1, $zero
/* 3D4CE0 E00D2370 0C080110 */ jal shim_guScaleF
/* 3D4CE4 E00D2374 00A0382D */ daddu $a3, $a1, $zero
/* 3D4CE8 E00D2378 0200202D */ daddu $a0, $s0, $zero
/* 3D4CEC E00D237C 27A50010 */ addiu $a1, $sp, 0x10
/* 3D4CF0 E00D2380 0C080114 */ jal shim_guMtxCatF
/* 3D4CF4 E00D2384 00A0302D */ daddu $a2, $a1, $zero
/* 3D4CF8 E00D2388 27A40010 */ addiu $a0, $sp, 0x10
/* 3D4CFC E00D238C 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 3D4D00 E00D2390 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 3D4D04 E00D2394 3C14800A */ lui $s4, %hi(gDisplayContext)
/* 3D4D08 E00D2398 2694A674 */ addiu $s4, $s4, %lo(gDisplayContext)
/* 3D4D0C E00D239C 96050000 */ lhu $a1, 0x0($s0)
/* 3D4D10 E00D23A0 8E820000 */ lw $v0, 0x0($s4)
/* 3D4D14 E00D23A4 00052980 */ sll $a1, $a1, 6
/* 3D4D18 E00D23A8 00B62821 */ addu $a1, $a1, $s6
/* 3D4D1C E00D23AC 0C080118 */ jal shim_guMtxF2L
/* 3D4D20 E00D23B0 00452821 */ addu $a1, $v0, $a1
/* 3D4D24 E00D23B4 3C03DA38 */ lui $v1, (0xDA380002 >> 16)
/* 3D4D28 E00D23B8 34630002 */ ori $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3D4D2C E00D23BC 3C06DA38 */ lui $a2, (0xDA380001 >> 16)
/* 3D4D30 E00D23C0 34C60001 */ ori $a2, $a2, (0xDA380001 & 0xFFFF)
/* 3D4D34 E00D23C4 3C08D838 */ lui $t0, (0xD8380002 >> 16)
/* 3D4D38 E00D23C8 35080002 */ ori $t0, $t0, (0xD8380002 & 0xFFFF)
/* 3D4D3C E00D23CC 32B500FF */ andi $s5, $s5, 0xFF
/* 3D4D40 E00D23D0 8E640000 */ lw $a0, 0x0($s3)
/* 3D4D44 E00D23D4 96020000 */ lhu $v0, 0x0($s0)
/* 3D4D48 E00D23D8 0080282D */ daddu $a1, $a0, $zero
/* 3D4D4C E00D23DC 24840008 */ addiu $a0, $a0, 0x8
/* 3D4D50 E00D23E0 AE640000 */ sw $a0, 0x0($s3)
/* 3D4D54 E00D23E4 ACA30000 */ sw $v1, 0x0($a1)
/* 3D4D58 E00D23E8 24430001 */ addiu $v1, $v0, 0x1
/* 3D4D5C E00D23EC 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 3D4D60 E00D23F0 00021180 */ sll $v0, $v0, 6
/* 3D4D64 E00D23F4 A6030000 */ sh $v1, 0x0($s0)
/* 3D4D68 E00D23F8 8E830000 */ lw $v1, 0x0($s4)
/* 3D4D6C E00D23FC 00561021 */ addu $v0, $v0, $s6
/* 3D4D70 E00D2400 00621821 */ addu $v1, $v1, $v0
/* 3D4D74 E00D2404 24820008 */ addiu $v0, $a0, 0x8
/* 3D4D78 E00D2408 ACA30004 */ sw $v1, 0x4($a1)
/* 3D4D7C E00D240C AE620000 */ sw $v0, 0x0($s3)
/* 3D4D80 E00D2410 24820010 */ addiu $v0, $a0, 0x10
/* 3D4D84 E00D2414 AC860000 */ sw $a2, 0x0($a0)
/* 3D4D88 E00D2418 AE620000 */ sw $v0, 0x0($s3)
/* 3D4D8C E00D241C 8E230204 */ lw $v1, 0x204($s1)
/* 3D4D90 E00D2420 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 3D4D94 E00D2424 AC820008 */ sw $v0, 0x8($a0)
/* 3D4D98 E00D2428 AC830004 */ sw $v1, 0x4($a0)
/* 3D4D9C E00D242C 9242001B */ lbu $v0, 0x1B($s2)
/* 3D4DA0 E00D2430 9245001F */ lbu $a1, 0x1F($s2)
/* 3D4DA4 E00D2434 92460023 */ lbu $a2, 0x23($s2)
/* 3D4DA8 E00D2438 24830018 */ addiu $v1, $a0, 0x18
/* 3D4DAC E00D243C AE630000 */ sw $v1, 0x0($s3)
/* 3D4DB0 E00D2440 3C03FB00 */ lui $v1, (0xFB000000 >> 16)
/* 3D4DB4 E00D2444 AC830010 */ sw $v1, 0x10($a0)
/* 3D4DB8 E00D2448 00021600 */ sll $v0, $v0, 24
/* 3D4DBC E00D244C 00052C00 */ sll $a1, $a1, 16
/* 3D4DC0 E00D2450 00451025 */ or $v0, $v0, $a1
/* 3D4DC4 E00D2454 00063200 */ sll $a2, $a2, 8
/* 3D4DC8 E00D2458 00461025 */ or $v0, $v0, $a2
/* 3D4DCC E00D245C 00551025 */ or $v0, $v0, $s5
/* 3D4DD0 E00D2460 AC82000C */ sw $v0, 0xC($a0)
/* 3D4DD4 E00D2464 24820020 */ addiu $v0, $a0, 0x20
/* 3D4DD8 E00D2468 9243002B */ lbu $v1, 0x2B($s2)
/* 3D4DDC E00D246C 9246002F */ lbu $a2, 0x2F($s2)
/* 3D4DE0 E00D2470 92470033 */ lbu $a3, 0x33($s2)
/* 3D4DE4 E00D2474 3C05DE00 */ lui $a1, (0xDE000000 >> 16)
/* 3D4DE8 E00D2478 AE620000 */ sw $v0, 0x0($s3)
/* 3D4DEC E00D247C 3C020900 */ lui $v0, %hi(D_09000080_4150E0)
/* 3D4DF0 E00D2480 24420080 */ addiu $v0, $v0, %lo(D_09000080_4150E0)
/* 3D4DF4 E00D2484 AC82001C */ sw $v0, 0x1C($a0)
/* 3D4DF8 E00D2488 24820028 */ addiu $v0, $a0, 0x28
/* 3D4DFC E00D248C AC850018 */ sw $a1, 0x18($a0)
/* 3D4E00 E00D2490 AE620000 */ sw $v0, 0x0($s3)
/* 3D4E04 E00D2494 3C020900 */ lui $v0, %hi(D_09000168_4151C8)
/* 3D4E08 E00D2498 24420168 */ addiu $v0, $v0, %lo(D_09000168_4151C8)
/* 3D4E0C E00D249C AC820024 */ sw $v0, 0x24($a0)
/* 3D4E10 E00D24A0 24820030 */ addiu $v0, $a0, 0x30
/* 3D4E14 E00D24A4 AC850020 */ sw $a1, 0x20($a0)
/* 3D4E18 E00D24A8 AE620000 */ sw $v0, 0x0($s3)
/* 3D4E1C E00D24AC 24020040 */ addiu $v0, $zero, 0x40
/* 3D4E20 E00D24B0 AC880028 */ sw $t0, 0x28($a0)
/* 3D4E24 E00D24B4 AC82002C */ sw $v0, 0x2C($a0)
/* 3D4E28 E00D24B8 00031E00 */ sll $v1, $v1, 24
/* 3D4E2C E00D24BC 00063400 */ sll $a2, $a2, 16
/* 3D4E30 E00D24C0 00661825 */ or $v1, $v1, $a2
/* 3D4E34 E00D24C4 00073A00 */ sll $a3, $a3, 8
/* 3D4E38 E00D24C8 00671825 */ or $v1, $v1, $a3
/* 3D4E3C E00D24CC AC830014 */ sw $v1, 0x14($a0)
/* 3D4E40 E00D24D0 8FBF00AC */ lw $ra, 0xAC($sp)
/* 3D4E44 E00D24D4 8FB600A8 */ lw $s6, 0xA8($sp)
/* 3D4E48 E00D24D8 8FB500A4 */ lw $s5, 0xA4($sp)
/* 3D4E4C E00D24DC 8FB400A0 */ lw $s4, 0xA0($sp)
/* 3D4E50 E00D24E0 8FB3009C */ lw $s3, 0x9C($sp)
/* 3D4E54 E00D24E4 8FB20098 */ lw $s2, 0x98($sp)
/* 3D4E58 E00D24E8 8FB10094 */ lw $s1, 0x94($sp)
/* 3D4E5C E00D24EC 8FB00090 */ lw $s0, 0x90($sp)
/* 3D4E60 E00D24F0 D7B400B0 */ ldc1 $f20, 0xB0($sp)
/* 3D4E64 E00D24F4 03E00008 */ jr $ra
/* 3D4E68 E00D24F8 27BD00B8 */ addiu $sp, $sp, 0xB8
/* 3D4E6C E00D24FC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void floating_cloud_puff_appendGfx(void* effect) {
FloatingCloudPuffFXData* data = ((EffectInstance*)effect)->data.floatingCloudPuff;
Camera* camera = &gCameras[gCurrentCameraID];
s32 unk_24 = data->unk_24;
f32 scale = data->unk_34 * data->unk_38;
Matrix4f sp10;
Matrix4f sp50;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
shim_guScaleF(sp50, scale, scale, scale);
shim_guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_18, data->unk_1C, data->unk_20, unk_24);
gDPSetEnvColor(gMainGfxPos++, data->unk_28, data->unk_2C, data->unk_30, 0);
gSPDisplayList(gMainGfxPos++, D_09000080_3D4F10);
gSPDisplayList(gMainGfxPos++, D_09000168_3D4FF8);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_802437F4
/* 136B34 802437F4 27BDFEE0 */ addiu $sp, $sp, -0x120
.L802437F8:
/* 136B38 802437F8 0000202D */ daddu $a0, $zero, $zero
/* 136B3C 802437FC AFA50124 */ sw $a1, 0x124($sp)
D_80243800:
/* 136B40 80243800 3C05F840 */ lui $a1, (0xF8405BDE >> 16)
D_80243804:
/* 136B44 80243804 34A55BDE */ ori $a1, $a1, (0xF8405BDE & 0xFFFF)
glabel func_80243808
/* 136B48 80243808 AFBF00FC */ sw $ra, 0xFC($sp)
/* 136B4C 8024380C AFBE00F8 */ sw $fp, 0xF8($sp)
/* 136B50 80243810 AFB700F4 */ sw $s7, 0xF4($sp)
D_80243814:
/* 136B54 80243814 AFB600F0 */ sw $s6, 0xF0($sp)
/* 136B58 80243818 AFB500EC */ sw $s5, 0xEC($sp)
glabel func_8024381C
/* 136B5C 8024381C AFB400E8 */ sw $s4, 0xE8($sp)
D_80243820:
/* 136B60 80243820 AFB300E4 */ sw $s3, 0xE4($sp)
.L80243824:
/* 136B64 80243824 AFB200E0 */ sw $s2, 0xE0($sp)
glabel .L80243828
/* 136B68 80243828 AFB100DC */ sw $s1, 0xDC($sp)
D_8024382C:
/* 136B6C 8024382C AFB000D8 */ sw $s0, 0xD8($sp)
D_80243830:
/* 136B70 80243830 F7BA0118 */ sdc1 $f26, 0x118($sp)
.L80243834:
/* 136B74 80243834 F7B80110 */ sdc1 $f24, 0x110($sp)
jtbl_80243838:
/* 136B78 80243838 F7B60108 */ sdc1 $f22, 0x108($sp)
/* 136B7C 8024383C F7B40100 */ sdc1 $f20, 0x100($sp)
D_80243840:
/* 136B80 80243840 AFA60128 */ sw $a2, 0x128($sp)
/* 136B84 80243844 0C0B1EAF */ jal evt_get_variable
glabel .L80243848
/* 136B88 80243848 AFA7012C */ sw $a3, 0x12C($sp)
.L8024384C:
/* 136B8C 8024384C 104001F4 */ beqz $v0, D_80244020
.L80243850:
/* 136B90 80243850 3C08E300 */ lui $t0, (0xE3000A01 >> 16)
D_80243854:
/* 136B94 80243854 35080A01 */ ori $t0, $t0, (0xE3000A01 & 0xFFFF)
.L80243858:
/* 136B98 80243858 3C0BE200 */ lui $t3, (0xE200001C >> 16)
.L8024385C:
/* 136B9C 8024385C 356B001C */ ori $t3, $t3, (0xE200001C & 0xFFFF)
.L80243860:
/* 136BA0 80243860 3C090050 */ lui $t1, (0x504340 >> 16)
.L80243864:
/* 136BA4 80243864 35294340 */ ori $t1, $t1, (0x504340 & 0xFFFF)
glabel .L80243868
/* 136BA8 80243868 3C0CFCFF */ lui $t4, (0xFCFFFFFF >> 16)
glabel func_8024386C
/* 136BAC 8024386C 358CFFFF */ ori $t4, $t4, (0xFCFFFFFF & 0xFFFF)
D_80243870:
/* 136BB0 80243870 3C0AFFFD */ lui $t2, (0xFFFDF6FB >> 16)
D_80243874:
/* 136BB4 80243874 354AF6FB */ ori $t2, $t2, (0xFFFDF6FB & 0xFFFF)
glabel .L80243878
/* 136BB8 80243878 3C0D3737 */ lui $t5, (0x373737FF >> 16)
D_8024387C:
/* 136BBC 8024387C 35AD37FF */ ori $t5, $t5, (0x373737FF & 0xFFFF)
D_80243880:
/* 136BC0 80243880 3C140001 */ lui $s4, (0x11630 >> 16)
/* 136BC4 80243884 36941630 */ ori $s4, $s4, (0x11630 & 0xFFFF)
D_80243888:
/* 136BC8 80243888 0000B82D */ daddu $s7, $zero, $zero
D_8024388C:
/* 136BCC 8024388C 27B50068 */ addiu $s5, $sp, 0x68
D_80243890:
/* 136BD0 80243890 3C028007 */ lui $v0, %hi(gMatrixListPos)
/* 136BD4 80243894 244241F0 */ addiu $v0, $v0, %lo(gMatrixListPos)
D_80243898:
/* 136BD8 80243898 0040F02D */ daddu $fp, $v0, $zero
/* 136BDC 8024389C 3C02800A */ lui $v0, %hi(gMainGfxPos)
.L802438A0:
/* 136BE0 802438A0 2442A66C */ addiu $v0, $v0, %lo(gMainGfxPos)
glabel func_802438A4
/* 136BE4 802438A4 0040B02D */ daddu $s6, $v0, $zero
D_802438A8:
/* 136BE8 802438A8 3C12FA00 */ lui $s2, (0xFA000000 >> 16)
/* 136BEC 802438AC 8FAE0124 */ lw $t6, 0x124($sp)
D_802438B0:
/* 136BF0 802438B0 8FAF0128 */ lw $t7, 0x128($sp)
/* 136BF4 802438B4 3C013F4C */ lui $at, (0x3F4CCCCD >> 16)
/* 136BF8 802438B8 3421CCCD */ ori $at, $at, (0x3F4CCCCD & 0xFFFF)
/* 136BFC 802438BC 4481D000 */ mtc1 $at, $f26
.L802438C0:
/* 136C00 802438C0 3C014334 */ lui $at, (0x43340000 >> 16)
/* 136C04 802438C4 4481C000 */ mtc1 $at, $f24
D_802438C8:
/* 136C08 802438C8 000E9880 */ sll $s3, $t6, 2
D_802438CC:
/* 136C0C 802438CC 000F2880 */ sll $a1, $t7, 2
glabel func_802438D0
/* 136C10 802438D0 8FAF012C */ lw $t7, 0x12C($sp)
D_802438D4:
/* 136C14 802438D4 0260202D */ daddu $a0, $s3, $zero
D_802438D8:
/* 136C18 802438D8 01CF8821 */ addu $s1, $t6, $t7
.L802438DC:
/* 136C1C 802438DC 00118880 */ sll $s1, $s1, 2
D_802438E0:
/* 136C20 802438E0 0220302D */ daddu $a2, $s1, $zero
/* 136C24 802438E4 3C0F0001 */ lui $t7, (0x11630 >> 16)
pra_13_802438E8:
/* 136C28 802438E8 8FAE0128 */ lw $t6, 0x128($sp)
D_802438EC:
/* 136C2C 802438EC 35EF1630 */ ori $t7, $t7, (0x11630 & 0xFFFF)
glabel func_802438F0
/* 136C30 802438F0 AFAF00D0 */ sw $t7, 0xD0($sp)
.L802438F4:
/* 136C34 802438F4 8EC20000 */ lw $v0, 0x0($s6)
D_802438F8:
/* 136C38 802438F8 25D0000C */ addiu $s0, $t6, 0xC
/* 136C3C 802438FC 00108080 */ sll $s0, $s0, 2
jtbl_80243900:
/* 136C40 80243900 0200382D */ daddu $a3, $s0, $zero
/* 136C44 80243904 0040182D */ daddu $v1, $v0, $zero
glabel func_80243908
/* 136C48 80243908 24420008 */ addiu $v0, $v0, 0x8
/* 136C4C 8024390C AEC20000 */ sw $v0, 0x0($s6)
glabel func_80243910
/* 136C50 80243910 AC680000 */ sw $t0, 0x0($v1)
/* 136C54 80243914 AC600004 */ sw $zero, 0x4($v1)
dgb_09_pad_3918:
/* 136C58 80243918 24430008 */ addiu $v1, $v0, 0x8
.L8024391C:
/* 136C5C 8024391C AEC30000 */ sw $v1, 0x0($s6)
D_80243920:
/* 136C60 80243920 24430010 */ addiu $v1, $v0, 0x10
/* 136C64 80243924 AC4B0000 */ sw $t3, 0x0($v0)
D_80243928:
/* 136C68 80243928 AC490004 */ sw $t1, 0x4($v0)
.L8024392C:
/* 136C6C 8024392C AEC30000 */ sw $v1, 0x0($s6)
jtbl_80243930:
/* 136C70 80243930 24430018 */ addiu $v1, $v0, 0x18
.L80243934:
/* 136C74 80243934 AC4C0008 */ sw $t4, 0x8($v0)
.L80243938:
/* 136C78 80243938 AC4A000C */ sw $t2, 0xC($v0)
.L8024393C:
/* 136C7C 8024393C AEC30000 */ sw $v1, 0x0($s6)
.L80243940:
/* 136C80 80243940 AC520010 */ sw $s2, 0x10($v0)
### DECOMPILED C INSTRUCTIONS:
void pause_tutorial_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
Matrix4f matrix1;
Matrix4f matrix2;
f32 (*matrix2ptr)[4];
s32 msgHeight;
s32 msgWidth;
s32 msgMaxLineChars;
s32 msgNumLines;
s32 msgMaxLinesPerPage;
s32 msgHeight2;
u32 msgWidth2;
s32 msgMaxLineChars2;
s32 msgNumLines2;
s32 msgMaxLinesPerPage2;
s32 i;
s32 margin, margin2;
s32 state;
if (evt_get_variable(NULL, GF_Tutorial_Badges) == FALSE) {
return;
}
gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 55, 55, 55, 255);
pause_draw_rect(baseX * 4, baseY * 4, (baseX + width) * 4, (baseY + 12) * 4, 0, 0, 0, 0, 0);
gDPPipeSync(gMainGfxPos++);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 185, 185, 185, 255);
pause_draw_rect(baseX * 4, (baseY + 12) * 4, (baseX + width) * 4, (baseY + height) * 4, 0, 0, 0, 0, 0);
gDPPipeSync(gMainGfxPos++);
gSPViewport(gMainGfxPos++, &gPauseTutorialViewport);
guOrthoF(matrix1, 0.0f, 320.0f, 240.0f, 0.0f, -100.0f, 100.0f, 1.0f);
guMtxF2L(matrix1, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
for (i = 0; i < 3; i++) {
//needed to match
matrix2ptr = matrix2;
switch (i) {
case 0:
guTranslateF(matrix1, 40.0f, 223.0f, 0);
guScaleF(matrix2ptr, -0.8f, 0.8f, 1.0f);
break;
case 1:
guTranslateF(matrix1, 60.0f, 223.0f, 0);
guScaleF(matrix2ptr, -0.8f, 0.8f, 1.0f);
break;
default:
guTranslateF(matrix1, 280.0f, 223.0f, 0);
guScaleF(matrix2ptr, 0.8f, 0.8f, 1.0f);
break;
}
guMtxCatF(matrix2ptr, matrix1, matrix1);
guRotateF(matrix2ptr, 180.0f, 0.0f, 0.0f, 1.0f);
guMtxCatF(matrix2ptr, matrix1, matrix1);
guRotateF(matrix2ptr, 180.0f, 0.0f, 1.0f, 0.0f);
guMtxCatF(matrix2ptr, matrix1, matrix1);
guMtxF2L(matrix1, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
set_npc_imgfx_all(gPauseTutorialSprites[i], IMGFX_SET_COLOR, 255, 255, 255, 255, 64);
spr_draw_npc_sprite(gPauseTutorialSprites[i], 0, 0, 0, matrix1);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
get_msg_properties(pause_get_menu_msg(PAUSE_MSG_TUT_NAME_BADGES), &msgHeight, &msgWidth, &msgMaxLineChars, &msgNumLines, &msgMaxLinesPerPage, NULL, 1);
margin = (s32)(width - msgWidth) >> 1;
draw_msg(pause_get_menu_msg(PAUSE_MSG_TUT_NAME_BADGES), baseX + margin, baseY, 255, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
gPauseTutorialScrollPos += pause_interp_text_scroll(gPauseTutorialState * 140 - gPauseTutorialScrollPos);
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, baseX + 1, baseY + 1, baseX + width - 1, baseY + height - 1);
state = gPauseTutorialState;
get_msg_properties(pause_get_menu_msg(gPauseTutorialDescMessages[state]), &msgHeight2, &msgWidth2, &msgMaxLineChars2, &msgNumLines2, &msgMaxLinesPerPage2, NULL, 1);
margin2 = (s32)(width - msgWidth2) >> 1;
draw_msg(pause_get_menu_msg(gPauseTutorialDescMessages[state]), baseX + margin2, baseY + 13 + state * 140 - gPauseTutorialScrollPos, 255, MSG_PAL_STANDARD, DRAW_MSG_STYLE_MENU);
hud_element_set_render_pos(gPauseCommonIconIDs[gPauseTutorialIconIDs[gPauseTutorialState]], baseX + width / 2 - 2, baseY + 52);
hud_element_set_flags(gPauseCommonIconIDs[gPauseTutorialIconIDs[gPauseTutorialState]], HUD_ELEMENT_FLAG_FILTER_TEX);
hud_element_set_scale(gPauseCommonIconIDs[gPauseTutorialIconIDs[gPauseTutorialState]], 0.5f);
hud_element_draw_without_clipping(gPauseCommonIconIDs[gPauseTutorialIconIDs[gPauseTutorialState]]);
if (gPauseTutorialIconIDs[gPauseTutorialState] == 6) {
hud_element_set_render_pos(gPauseCommonIconIDs[7], baseX + width / 2 + 1, baseY + 50);
hud_element_draw_without_clipping(gPauseCommonIconIDs[7]);
}
draw_msg(pause_get_menu_msg(gPauseTutorialCmdMessages[gPauseTutorialState]), baseX + width / 2 + 10, baseY + 44, 255, MSG_PAL_STANDARD, 0);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel phys_update_jump
/* 7C1C8 800E2D18 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 7C1CC 800E2D1C AFB00010 */ sw $s0, 0x10($sp)
/* 7C1D0 800E2D20 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* 7C1D4 800E2D24 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* 7C1D8 800E2D28 AFBF0014 */ sw $ra, 0x14($sp)
/* 7C1DC 800E2D2C F7B40018 */ sdc1 $f20, 0x18($sp)
/* 7C1E0 800E2D30 860200C0 */ lh $v0, 0xC0($s0)
/* 7C1E4 800E2D34 1040006A */ beqz $v0, .L800E2EE0
/* 7C1E8 800E2D38 00000000 */ nop
/* 7C1EC 800E2D3C 920200B4 */ lbu $v0, 0xB4($s0)
/* 7C1F0 800E2D40 2442FFFC */ addiu $v0, $v0, -0x4
/* 7C1F4 800E2D44 00021600 */ sll $v0, $v0, 24
/* 7C1F8 800E2D48 00021E03 */ sra $v1, $v0, 24
/* 7C1FC 800E2D4C 2C620014 */ sltiu $v0, $v1, 0x14
/* 7C200 800E2D50 10400045 */ beqz $v0, .L800E2E68
/* 7C204 800E2D54 00031080 */ sll $v0, $v1, 2
/* 7C208 800E2D58 3C018011 */ lui $at, %hi(jtbl_8010BD98)
/* 7C20C 800E2D5C 00220821 */ addu $at, $at, $v0
/* 7C210 800E2D60 8C22BD98 */ lw $v0, %lo(jtbl_8010BD98)($at)
/* 7C214 800E2D64 00400008 */ jr $v0
/* 7C218 800E2D68 00000000 */ nop
glabel .L800E2D6C
/* 7C21C 800E2D6C 0C038AEC */ jal func_800E2BB0
/* 7C220 800E2D70 00000000 */ nop
/* 7C224 800E2D74 08038BD3 */ j .L800E2F4C
/* 7C228 800E2D78 00000000 */ nop
glabel .L800E2D7C
/* 7C22C 800E2D7C 0C038A72 */ jal func_800E29C8
/* 7C230 800E2D80 00000000 */ nop
/* 7C234 800E2D84 08038BD3 */ j .L800E2F4C
/* 7C238 800E2D88 00000000 */ nop
glabel .L800E2D8C
/* 7C23C 800E2D8C 0C038D12 */ jal integrate_gravity
/* 7C240 800E2D90 00000000 */ nop
/* 7C244 800E2D94 C600002C */ lwc1 $f0, 0x2C($s0)
/* 7C248 800E2D98 C6020070 */ lwc1 $f2, 0x70($s0)
/* 7C24C 800E2D9C 46020000 */ add.s $f0, $f0, $f2
/* 7C250 800E2DA0 4480A000 */ mtc1 $zero, $f20
/* 7C254 800E2DA4 00000000 */ nop
/* 7C258 800E2DA8 4614103E */ c.le.s $f2, $f20
/* 7C25C 800E2DAC 00000000 */ nop
/* 7C260 800E2DB0 45000066 */ bc1f .L800E2F4C
/* 7C264 800E2DB4 E600002C */ swc1 $f0, 0x2C($s0)
/* 7C268 800E2DB8 0C0389AC */ jal record_jump_apex
/* 7C26C 800E2DBC 00000000 */ nop
/* 7C270 800E2DC0 0C011052 */ jal is_starting_conversation
/* 7C274 800E2DC4 00000000 */ nop
/* 7C278 800E2DC8 1040001F */ beqz $v0, .L800E2E48
/* 7C27C 800E2DCC 00000000 */ nop
/* 7C280 800E2DD0 3C013E1E */ lui $at, (0x3E1E0C17 >> 16)
/* 7C284 800E2DD4 34210C17 */ ori $at, $at, (0x3E1E0C17 & 0xFFFF)
/* 7C288 800E2DD8 44810000 */ mtc1 $at, $f0
/* 7C28C 800E2DDC 3C01BEB3 */ lui $at, (0xBEB33DB0 >> 16)
/* 7C290 800E2DE0 34213DB0 */ ori $at, $at, (0xBEB33DB0 & 0xFFFF)
/* 7C294 800E2DE4 44811000 */ mtc1 $at, $f2
/* 7C298 800E2DE8 E6140078 */ swc1 $f20, 0x78($s0)
/* 7C29C 800E2DEC E614007C */ swc1 $f20, 0x7C($s0)
/* 7C2A0 800E2DF0 E6000070 */ swc1 $f0, 0x70($s0)
/* 7C2A4 800E2DF4 08038B94 */ j .L800E2E50
/* 7C2A8 800E2DF8 E6020074 */ swc1 $f2, 0x74($s0)
glabel .L800E2DFC
/* 7C2AC 800E2DFC C6000070 */ lwc1 $f0, 0x70($s0)
/* 7C2B0 800E2E00 3C014012 */ lui $at, (0x40120000 >> 16)
/* 7C2B4 800E2E04 44811800 */ mtc1 $at, $f3
/* 7C2B8 800E2E08 44801000 */ mtc1 $zero, $f2
/* 7C2BC 800E2E0C 46000021 */ cvt.d.s $f0, $f0
/* 7C2C0 800E2E10 46220001 */ sub.d $f0, $f0, $f2
/* 7C2C4 800E2E14 C602002C */ lwc1 $f2, 0x2C($s0)
/* 7C2C8 800E2E18 46200020 */ cvt.s.d $f0, $f0
/* 7C2CC 800E2E1C E6000070 */ swc1 $f0, 0x70($s0)
/* 7C2D0 800E2E20 46000106 */ mov.s $f4, $f0
/* 7C2D4 800E2E24 46001080 */ add.s $f2, $f2, $f0
/* 7C2D8 800E2E28 44800000 */ mtc1 $zero, $f0
/* 7C2DC 800E2E2C 00000000 */ nop
/* 7C2E0 800E2E30 4600203E */ c.le.s $f4, $f0
/* 7C2E4 800E2E34 00000000 */ nop
/* 7C2E8 800E2E38 45000044 */ bc1f .L800E2F4C
/* 7C2EC 800E2E3C E602002C */ swc1 $f2, 0x2C($s0)
/* 7C2F0 800E2E40 0C0389AC */ jal record_jump_apex
/* 7C2F4 800E2E44 00000000 */ nop
.L800E2E48:
/* 7C2F8 800E2E48 0C038C1B */ jal gravity_use_fall_parms
/* 7C2FC 800E2E4C 00000000 */ nop
.L800E2E50:
/* 7C300 800E2E50 0C038D12 */ jal integrate_gravity
/* 7C304 800E2E54 00000000 */ nop
/* 7C308 800E2E58 0C039769 */ jal set_action_state
/* 7C30C 800E2E5C 24040008 */ addiu $a0, $zero, 0x8
/* 7C310 800E2E60 08038BD3 */ j .L800E2F4C
/* 7C314 800E2E64 00000000 */ nop
glabel .L800E2E68
/* 7C318 800E2E68 8E0200DC */ lw $v0, 0xDC($s0)
/* 7C31C 800E2E6C 30428000 */ andi $v0, $v0, 0x8000
/* 7C320 800E2E70 1440001B */ bnez $v0, .L800E2EE0
/* 7C324 800E2E74 00000000 */ nop
/* 7C328 800E2E78 0C0389AC */ jal record_jump_apex
/* 7C32C 800E2E7C 00000000 */ nop
/* 7C330 800E2E80 0C039769 */ jal set_action_state
/* 7C334 800E2E84 24040005 */ addiu $a0, $zero, 0x5
/* 7C338 800E2E88 0C038D12 */ jal integrate_gravity
/* 7C33C 800E2E8C 00000000 */ nop
/* 7C340 800E2E90 8E020000 */ lw $v0, 0x0($s0)
/* 7C344 800E2E94 3C030004 */ lui $v1, (0x40000 >> 16)
/* 7C348 800E2E98 00431024 */ and $v0, $v0, $v1
/* 7C34C 800E2E9C 10400010 */ beqz $v0, .L800E2EE0
/* 7C350 800E2EA0 00000000 */ nop
/* 7C354 800E2EA4 C6060074 */ lwc1 $f6, 0x74($s0)
/* 7C358 800E2EA8 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 7C35C 800E2EAC 44811000 */ mtc1 $at, $f2
/* 7C360 800E2EB0 00000000 */ nop
/* 7C364 800E2EB4 46023182 */ mul.s $f6, $f6, $f2
/* 7C368 800E2EB8 00000000 */ nop
/* 7C36C 800E2EBC C6040078 */ lwc1 $f4, 0x78($s0)
/* 7C370 800E2EC0 46022102 */ mul.s $f4, $f4, $f2
/* 7C374 800E2EC4 00000000 */ nop
/* 7C378 800E2EC8 C600007C */ lwc1 $f0, 0x7C($s0)
/* 7C37C 800E2ECC 46020002 */ mul.s $f0, $f0, $f2
/* 7C380 800E2ED0 00000000 */ nop
/* 7C384 800E2ED4 E6060074 */ swc1 $f6, 0x74($s0)
/* 7C388 800E2ED8 E6040078 */ swc1 $f4, 0x78($s0)
/* 7C38C 800E2EDC E600007C */ swc1 $f0, 0x7C($s0)
.L800E2EE0:
/* 7C390 800E2EE0 0C038D12 */ jal integrate_gravity
/* 7C394 800E2EE4 00000000 */ nop
/* 7C398 800E2EE8 C6020070 */ lwc1 $f2, 0x70($s0)
/* 7C39C 800E2EEC 44800000 */ mtc1 $zero, $f0
/* 7C3A0 800E2EF0 00000000 */ nop
/* 7C3A4 800E2EF4 4600103E */ c.le.s $f2, $f0
/* 7C3A8 800E2EF8 00000000 */ nop
/* 7C3AC 800E2EFC 45000009 */ bc1f .L800E2F24
/* 7C3B0 800E2F00 00000000 */ nop
/* 7C3B4 800E2F04 0C0389AC */ jal record_jump_apex
/* 7C3B8 800E2F08 00000000 */ nop
/* 7C3BC 800E2F0C 0C038C1B */ jal gravity_use_fall_parms
/* 7C3C0 800E2F10 00000000 */ nop
/* 7C3C4 800E2F14 0C038D12 */ jal integrate_gravity
/* 7C3C8 800E2F18 00000000 */ nop
/* 7C3CC 800E2F1C 0C039769 */ jal set_action_state
/* 7C3D0 800E2F20 24040008 */ addiu $a0, $zero, 0x8
.L800E2F24:
/* 7C3D4 800E2F24 C6000070 */ lwc1 $f0, 0x70($s0)
/* 7C3D8 800E2F28 C602006C */ lwc1 $f2, 0x6C($s0)
/* 7C3DC 800E2F2C 4600103C */ c.lt.s $f2, $f0
/* 7C3E0 800E2F30 00000000 */ nop
/* 7C3E4 800E2F34 45030001 */ bc1tl .L800E2F3C
/* 7C3E8 800E2F38 E6020070 */ swc1 $f2, 0x70($s0)
.L800E2F3C:
/* 7C3EC 800E2F3C C600002C */ lwc1 $f0, 0x2C($s0)
/* 7C3F0 800E2F40 C6020070 */ lwc1 $f2, 0x70($s0)
/* 7C3F4 800E2F44 46020000 */ add.s $f0, $f0, $f2
/* 7C3F8 800E2F48 E600002C */ swc1 $f0, 0x2C($s0)
glabel .L800E2F4C
/* 7C3FC 800E2F4C 8FBF0014 */ lw $ra, 0x14($sp)
/* 7C400 800E2F50 8FB00010 */ lw $s0, 0x10($sp)
/* 7C404 800E2F54 D7B40018 */ ldc1 $f20, 0x18($sp)
/* 7C408 800E2F58 03E00008 */ jr $ra
/* 7C40C 800E2F5C 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void phys_update_jump(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
if (playerStatus->timeInAir != 0) {
switch (playerStatus->actionState) {
case ACTION_STATE_LAUNCH:
func_800E2BB0();
return;
case ACTION_STATE_LANDING_ON_SWITCH:
handle_switch_hit();
return;
case ACTION_STATE_BOUNCE:
integrate_gravity();
playerStatus->position.y += playerStatus->gravityIntegrator[0];
if (playerStatus->gravityIntegrator[0] <= 0.0f) {
record_jump_apex();
if (is_starting_conversation()) {
playerStatus->gravityIntegrator[0] = 0.154343f;
playerStatus->gravityIntegrator[1] = -0.35008f;
playerStatus->gravityIntegrator[2] = 0.0f;
playerStatus->gravityIntegrator[3] = 0.0f;
} else {
gravity_use_fall_parms();
}
integrate_gravity();
set_action_state(ACTION_STATE_FALLING);
}
return;
case ACTION_STATE_HOP:
playerStatus->gravityIntegrator[0] -= 4.5;
playerStatus->position.y += playerStatus->gravityIntegrator[0];
if (playerStatus->gravityIntegrator[0] <= 0.0f) {
record_jump_apex();
gravity_use_fall_parms();
integrate_gravity();
set_action_state(ACTION_STATE_FALLING);
}
return;
case ACTION_STATE_HIT_FIRE:
case ACTION_STATE_HIT_LAVA:
return;
default:
if (!(playerStatus->currentButtons & BUTTON_A)) {
record_jump_apex();
set_action_state(ACTION_STATE_HOP);
integrate_gravity();
if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
playerStatus->gravityIntegrator[1] *= 0.5f;
playerStatus->gravityIntegrator[2] *= 0.5f;
playerStatus->gravityIntegrator[3] *= 0.5f;
}
}
break;
}
}
integrate_gravity();
if (playerStatus->gravityIntegrator[0] <= 0.0f) {
record_jump_apex();
gravity_use_fall_parms();
integrate_gravity();
set_action_state(ACTION_STATE_FALLING);
}
if (playerStatus->gravityIntegrator[0] > playerStatus->maxJumpSpeed) {
playerStatus->gravityIntegrator[0] = playerStatus->maxJumpSpeed;
}
playerStatus->position.y += playerStatus->gravityIntegrator[0];
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel squirt_update
/* 3B4974 E00B21E4 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 3B4978 E00B21E8 AFBF0028 */ sw $ra, 0x28($sp)
/* 3B497C E00B21EC AFB50024 */ sw $s5, 0x24($sp)
/* 3B4980 E00B21F0 AFB40020 */ sw $s4, 0x20($sp)
/* 3B4984 E00B21F4 AFB3001C */ sw $s3, 0x1C($sp)
/* 3B4988 E00B21F8 AFB20018 */ sw $s2, 0x18($sp)
/* 3B498C E00B21FC AFB10014 */ sw $s1, 0x14($sp)
/* 3B4990 E00B2200 AFB00010 */ sw $s0, 0x10($sp)
/* 3B4994 E00B2204 F7B80040 */ sdc1 $f24, 0x40($sp)
/* 3B4998 E00B2208 F7B60038 */ sdc1 $f22, 0x38($sp)
/* 3B499C E00B220C F7B40030 */ sdc1 $f20, 0x30($sp)
/* 3B49A0 E00B2210 8C830000 */ lw $v1, 0x0($a0)
/* 3B49A4 E00B2214 8C90000C */ lw $s0, 0xC($a0)
/* 3B49A8 E00B2218 30620010 */ andi $v0, $v1, 0x10
/* 3B49AC E00B221C 8E140000 */ lw $s4, 0x0($s0)
/* 3B49B0 E00B2220 10400005 */ beqz $v0, .LE00B2238
/* 3B49B4 E00B2224 2402FFEF */ addiu $v0, $zero, -0x11
/* 3B49B8 E00B2228 00621024 */ and $v0, $v1, $v0
/* 3B49BC E00B222C AC820000 */ sw $v0, 0x0($a0)
/* 3B49C0 E00B2230 24020010 */ addiu $v0, $zero, 0x10
/* 3B49C4 E00B2234 AE02002C */ sw $v0, 0x2C($s0)
.LE00B2238:
/* 3B49C8 E00B2238 8E03002C */ lw $v1, 0x2C($s0)
/* 3B49CC E00B223C 286203E8 */ slti $v0, $v1, 0x3E8
/* 3B49D0 E00B2240 10400002 */ beqz $v0, .LE00B224C
/* 3B49D4 E00B2244 2462FFFF */ addiu $v0, $v1, -0x1
/* 3B49D8 E00B2248 AE02002C */ sw $v0, 0x2C($s0)
.LE00B224C:
/* 3B49DC E00B224C 8E020030 */ lw $v0, 0x30($s0)
/* 3B49E0 E00B2250 8E03002C */ lw $v1, 0x2C($s0)
/* 3B49E4 E00B2254 24420001 */ addiu $v0, $v0, 0x1
/* 3B49E8 E00B2258 04610005 */ bgez $v1, .LE00B2270
/* 3B49EC E00B225C AE020030 */ sw $v0, 0x30($s0)
/* 3B49F0 E00B2260 0C080128 */ jal shim_remove_effect
/* 3B49F4 E00B2264 00000000 */ nop
/* 3B49F8 E00B2268 0802C90C */ j .LE00B2430
/* 3B49FC E00B226C 00000000 */ nop
.LE00B2270:
/* 3B4A00 E00B2270 8E020054 */ lw $v0, 0x54($s0)
/* 3B4A04 E00B2274 8E130028 */ lw $s3, 0x28($s0)
/* 3B4A08 E00B2278 24420001 */ addiu $v0, $v0, 0x1
/* 3B4A0C E00B227C AE020054 */ sw $v0, 0x54($s0)
/* 3B4A10 E00B2280 2842000D */ slti $v0, $v0, 0xD
/* 3B4A14 E00B2284 14400003 */ bnez $v0, .LE00B2294
/* 3B4A18 E00B2288 0000902D */ daddu $s2, $zero, $zero
/* 3B4A1C E00B228C 2402000C */ addiu $v0, $zero, 0xC
/* 3B4A20 E00B2290 AE020054 */ sw $v0, 0x54($s0)
.LE00B2294:
/* 3B4A24 E00B2294 3C158000 */ lui $s5, (0x80000000 >> 16)
/* 3B4A28 E00B2298 0200882D */ daddu $s1, $s0, $zero
/* 3B4A2C E00B229C 3C01437F */ lui $at, (0x437F0000 >> 16)
/* 3B4A30 E00B22A0 4481C000 */ mtc1 $at, $f24
/* 3B4A34 E00B22A4 3C014F00 */ lui $at, (0x4F000000 >> 16)
/* 3B4A38 E00B22A8 4481B000 */ mtc1 $at, $f22
.LE00B22AC:
/* 3B4A3C E00B22AC 8E220178 */ lw $v0, 0x178($s1)
/* 3B4A40 E00B22B0 10400003 */ beqz $v0, .LE00B22C0
/* 3B4A44 E00B22B4 2442FFFF */ addiu $v0, $v0, -0x1
/* 3B4A48 E00B22B8 14400059 */ bnez $v0, .LE00B2420
/* 3B4A4C E00B22BC AE220178 */ sw $v0, 0x178($s1)
.LE00B22C0:
/* 3B4A50 E00B22C0 8E2201A8 */ lw $v0, 0x1A8($s1)
/* 3B4A54 E00B22C4 24420001 */ addiu $v0, $v0, 0x1
/* 3B4A58 E00B22C8 0040182D */ daddu $v1, $v0, $zero
/* 3B4A5C E00B22CC 0073102A */ slt $v0, $v1, $s3
/* 3B4A60 E00B22D0 14400002 */ bnez $v0, .LE00B22DC
/* 3B4A64 E00B22D4 AE2301A8 */ sw $v1, 0x1A8($s1)
/* 3B4A68 E00B22D8 0260182D */ daddu $v1, $s3, $zero
.LE00B22DC:
/* 3B4A6C E00B22DC 44831000 */ mtc1 $v1, $f2
/* 3B4A70 E00B22E0 00000000 */ nop
/* 3B4A74 E00B22E4 468010A0 */ cvt.s.w $f2, $f2
/* 3B4A78 E00B22E8 44930000 */ mtc1 $s3, $f0
/* 3B4A7C E00B22EC 00000000 */ nop
/* 3B4A80 E00B22F0 46800020 */ cvt.s.w $f0, $f0
/* 3B4A84 E00B22F4 16800017 */ bnez $s4, .LE00B2354
/* 3B4A88 E00B22F8 46001503 */ div.s $f20, $f2, $f0
/* 3B4A8C E00B22FC C600001C */ lwc1 $f0, 0x1C($s0)
/* 3B4A90 E00B2300 C6020010 */ lwc1 $f2, 0x10($s0)
/* 3B4A94 E00B2304 46020001 */ sub.s $f0, $f0, $f2
/* 3B4A98 E00B2308 46140002 */ mul.s $f0, $f0, $f20
/* 3B4A9C E00B230C 00000000 */ nop
/* 3B4AA0 E00B2310 46001080 */ add.s $f2, $f2, $f0
/* 3B4AA4 E00B2314 E62200E8 */ swc1 $f2, 0xE8($s1)
/* 3B4AA8 E00B2318 C6000020 */ lwc1 $f0, 0x20($s0)
/* 3B4AAC E00B231C C6020014 */ lwc1 $f2, 0x14($s0)
/* 3B4AB0 E00B2320 46020001 */ sub.s $f0, $f0, $f2
/* 3B4AB4 E00B2324 46140002 */ mul.s $f0, $f0, $f20
/* 3B4AB8 E00B2328 00000000 */ nop
/* 3B4ABC E00B232C 46001080 */ add.s $f2, $f2, $f0
/* 3B4AC0 E00B2330 E6220118 */ swc1 $f2, 0x118($s1)
/* 3B4AC4 E00B2334 C6000024 */ lwc1 $f0, 0x24($s0)
/* 3B4AC8 E00B2338 C6020018 */ lwc1 $f2, 0x18($s0)
/* 3B4ACC E00B233C 46020001 */ sub.s $f0, $f0, $f2
/* 3B4AD0 E00B2340 46140002 */ mul.s $f0, $f0, $f20
/* 3B4AD4 E00B2344 00000000 */ nop
/* 3B4AD8 E00B2348 46001080 */ add.s $f2, $f2, $f0
/* 3B4ADC E00B234C 0802C908 */ j .LE00B2420
/* 3B4AE0 E00B2350 E6220148 */ swc1 $f2, 0x148($s1)
.LE00B2354:
/* 3B4AE4 E00B2354 3C014334 */ lui $at, (0x43340000 >> 16)
/* 3B4AE8 E00B2358 44816000 */ mtc1 $at, $f12
/* 3B4AEC E00B235C 00000000 */ nop
/* 3B4AF0 E00B2360 460CA302 */ mul.s $f12, $f20, $f12
/* 3B4AF4 E00B2364 00000000 */ nop
/* 3B4AF8 E00B2368 C600001C */ lwc1 $f0, 0x1C($s0)
/* 3B4AFC E00B236C C6020010 */ lwc1 $f2, 0x10($s0)
/* 3B4B00 E00B2370 46020001 */ sub.s $f0, $f0, $f2
/* 3B4B04 E00B2374 46140002 */ mul.s $f0, $f0, $f20
/* 3B4B08 E00B2378 00000000 */ nop
/* 3B4B0C E00B237C 46001080 */ add.s $f2, $f2, $f0
/* 3B4B10 E00B2380 0C080140 */ jal shim_sin_deg
/* 3B4B14 E00B2384 E62200E8 */ swc1 $f2, 0xE8($s1)
/* 3B4B18 E00B2388 3C0142F0 */ lui $at, (0x42F00000 >> 16)
/* 3B4B1C E00B238C 44811000 */ mtc1 $at, $f2
/* 3B4B20 E00B2390 00000000 */ nop
/* 3B4B24 E00B2394 46020002 */ mul.s $f0, $f0, $f2
/* 3B4B28 E00B2398 00000000 */ nop
/* 3B4B2C E00B239C C6040020 */ lwc1 $f4, 0x20($s0)
/* 3B4B30 E00B23A0 C6060014 */ lwc1 $f6, 0x14($s0)
/* 3B4B34 E00B23A4 46062101 */ sub.s $f4, $f4, $f6
/* 3B4B38 E00B23A8 46142102 */ mul.s $f4, $f4, $f20
/* 3B4B3C E00B23AC 00000000 */ nop
/* 3B4B40 E00B23B0 46043180 */ add.s $f6, $f6, $f4
/* 3B4B44 E00B23B4 46003180 */ add.s $f6, $f6, $f0
/* 3B4B48 E00B23B8 4618A102 */ mul.s $f4, $f20, $f24
/* 3B4B4C E00B23BC 00000000 */ nop
/* 3B4B50 E00B23C0 E6260118 */ swc1 $f6, 0x118($s1)
/* 3B4B54 E00B23C4 C6000024 */ lwc1 $f0, 0x24($s0)
/* 3B4B58 E00B23C8 C6020018 */ lwc1 $f2, 0x18($s0)
/* 3B4B5C E00B23CC 46020001 */ sub.s $f0, $f0, $f2
/* 3B4B60 E00B23D0 46140002 */ mul.s $f0, $f0, $f20
/* 3B4B64 E00B23D4 00000000 */ nop
/* 3B4B68 E00B23D8 46001080 */ add.s $f2, $f2, $f0
/* 3B4B6C E00B23DC 02121021 */ addu $v0, $s0, $s2
/* 3B4B70 E00B23E0 4604C001 */ sub.s $f0, $f24, $f4
/* 3B4B74 E00B23E4 244201D8 */ addiu $v0, $v0, 0x1D8
/* 3B4B78 E00B23E8 4600B03E */ c.le.s $f22, $f0
/* 3B4B7C E00B23EC 00000000 */ nop
/* 3B4B80 E00B23F0 45010005 */ bc1t .LE00B2408
/* 3B4B84 E00B23F4 E6220148 */ swc1 $f2, 0x148($s1)
/* 3B4B88 E00B23F8 4600020D */ trunc.w.s $f8, $f0
/* 3B4B8C E00B23FC 44034000 */ mfc1 $v1, $f8
/* 3B4B90 E00B2400 0802C908 */ j .LE00B2420
/* 3B4B94 E00B2404 A0430000 */ sb $v1, 0x0($v0)
.LE00B2408:
/* 3B4B98 E00B2408 46160001 */ sub.s $f0, $f0, $f22
/* 3B4B9C E00B240C 4600020D */ trunc.w.s $f8, $f0
/* 3B4BA0 E00B2410 44034000 */ mfc1 $v1, $f8
/* 3B4BA4 E00B2414 00000000 */ nop
/* 3B4BA8 E00B2418 00751825 */ or $v1, $v1, $s5
/* 3B4BAC E00B241C A0430000 */ sb $v1, 0x0($v0)
.LE00B2420:
/* 3B4BB0 E00B2420 26520001 */ addiu $s2, $s2, 0x1
/* 3B4BB4 E00B2424 2A42000C */ slti $v0, $s2, 0xC
/* 3B4BB8 E00B2428 1440FFA0 */ bnez $v0, .LE00B22AC
/* 3B4BBC E00B242C 26310004 */ addiu $s1, $s1, 0x4
.LE00B2430:
/* 3B4BC0 E00B2430 8FBF0028 */ lw $ra, 0x28($sp)
/* 3B4BC4 E00B2434 8FB50024 */ lw $s5, 0x24($sp)
/* 3B4BC8 E00B2438 8FB40020 */ lw $s4, 0x20($sp)
/* 3B4BCC E00B243C 8FB3001C */ lw $s3, 0x1C($sp)
/* 3B4BD0 E00B2440 8FB20018 */ lw $s2, 0x18($sp)
/* 3B4BD4 E00B2444 8FB10014 */ lw $s1, 0x14($sp)
/* 3B4BD8 E00B2448 8FB00010 */ lw $s0, 0x10($sp)
/* 3B4BDC E00B244C D7B80040 */ ldc1 $f24, 0x40($sp)
/* 3B4BE0 E00B2450 D7B60038 */ ldc1 $f22, 0x38($sp)
/* 3B4BE4 E00B2454 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 3B4BE8 E00B2458 03E00008 */ jr $ra
/* 3B4BEC E00B245C 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
void squirt_update(EffectInstance* effect) {
SquirtFXData* data = effect->data.squirt;
s32 unk_00 = data->unk_00;
s32 unk_28;
s32 var_v1;
f32 factor;
s32 i;
if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
data->unk_2C = 16;
}
if (data->unk_2C < 1000) {
data->unk_2C--;
}
data->unk_30++;
if (data->unk_2C < 0) {
shim_remove_effect(effect);
return;
}
unk_28 = data->unk_28;
data->unk_54++;
if (data->unk_54 > 12) {
data->unk_54 = 12;
}
for (i = 0; i < 12; i++) {
if (data->unk_178[i] == 0 || --data->unk_178[i] == 0) {
data->unk_1A8[i]++;
if (data->unk_1A8[i] >= unk_28) {
var_v1 = unk_28;
} else {
var_v1 = data->unk_1A8[i];
}
factor = (f32) var_v1 / unk_28;
if (unk_00 == 0) {
data->unk_E8[i] = data->unk_10 + (data->unk_1C - data->unk_10) * factor;
data->unk_118[i] = data->unk_14 + (data->unk_20 - data->unk_14) * factor;
data->unk_148[i] = data->unk_18 + (data->unk_24 - data->unk_18) * factor;
} else {
data->unk_E8[i] = data->unk_10 + (data->unk_1C - data->unk_10) * factor;
data->unk_118[i] = data->unk_14 + (data->unk_20 - data->unk_14) * factor + shim_sin_deg(factor * 180.0f) * 120.0f;
data->unk_148[i] = data->unk_18 + (data->unk_24 - data->unk_18) * factor;
data->unk_1D8[i] = 255.0f - factor * 255.0f;
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel dispatch_damage_event_actor
/* 1A6FB4 802786D4 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 1A6FB8 802786D8 AFB00018 */ sw $s0, 0x18($sp)
/* 1A6FBC 802786DC 0080802D */ daddu $s0, $a0, $zero
/* 1A6FC0 802786E0 AFB20020 */ sw $s2, 0x20($sp)
/* 1A6FC4 802786E4 00C0902D */ daddu $s2, $a2, $zero
/* 1A6FC8 802786E8 AFB30024 */ sw $s3, 0x24($sp)
/* 1A6FCC 802786EC 3C13800E */ lui $s3, %hi(gBattleStatus)
/* 1A6FD0 802786F0 2673C070 */ addiu $s3, $s3, %lo(gBattleStatus)
/* 1A6FD4 802786F4 AFBF0028 */ sw $ra, 0x28($sp)
/* 1A6FD8 802786F8 AFB1001C */ sw $s1, 0x1C($sp)
/* 1A6FDC 802786FC A665017E */ sh $a1, 0x17E($s3)
/* 1A6FE0 80278700 00052C00 */ sll $a1, $a1, 16
/* 1A6FE4 80278704 00052C03 */ sra $a1, $a1, 16
/* 1A6FE8 80278708 960301FA */ lhu $v1, 0x1FA($s0)
/* 1A6FEC 8027870C 960201FC */ lhu $v0, 0x1FC($s0)
/* 1A6FF0 80278710 00651821 */ addu $v1, $v1, $a1
/* 1A6FF4 80278714 A60301FA */ sh $v1, 0x1FA($s0)
/* 1A6FF8 80278718 00031C00 */ sll $v1, $v1, 16
/* 1A6FFC 8027871C 00031C03 */ sra $v1, $v1, 16
/* 1A7000 80278720 960401FA */ lhu $a0, 0x1FA($s0)
/* 1A7004 80278724 00431021 */ addu $v0, $v0, $v1
/* 1A7008 80278728 A60201FC */ sh $v0, 0x1FC($s0)
/* 1A700C 8027872C 00832023 */ subu $a0, $a0, $v1
/* 1A7010 80278730 A60401FA */ sh $a0, 0x1FA($s0)
/* 1A7014 80278734 A6600180 */ sh $zero, 0x180($s3)
/* 1A7018 80278738 920201B8 */ lbu $v0, 0x1B8($s0)
/* 1A701C 8027873C 0060282D */ daddu $a1, $v1, $zero
/* 1A7020 80278740 00451023 */ subu $v0, $v0, $a1
/* 1A7024 80278744 A20201B8 */ sb $v0, 0x1B8($s0)
/* 1A7028 80278748 00021600 */ sll $v0, $v0, 24
/* 1A702C 8027874C 00021E03 */ sra $v1, $v0, 24
/* 1A7030 80278750 1C600006 */ bgtz $v1, .L8027876C
/* 1A7034 80278754 2611000C */ addiu $s1, $s0, 0xC
/* 1A7038 80278758 96620180 */ lhu $v0, 0x180($s3)
/* 1A703C 8027875C 24120020 */ addiu $s2, $zero, 0x20
/* 1A7040 80278760 00431021 */ addu $v0, $v0, $v1
/* 1A7044 80278764 A6620180 */ sh $v0, 0x180($s3)
/* 1A7048 80278768 A20001B8 */ sb $zero, 0x1B8($s0)
.L8027876C:
/* 1A704C 8027876C 96620180 */ lhu $v0, 0x180($s3)
/* 1A7050 80278770 00451021 */ addu $v0, $v0, $a1
/* 1A7054 80278774 A6620180 */ sh $v0, 0x180($s3)
/* 1A7058 80278778 A60201F8 */ sh $v0, 0x1F8($s0)
/* 1A705C 8027877C 8E620000 */ lw $v0, 0x0($s3)
/* 1A7060 80278780 30420020 */ andi $v0, $v0, 0x20
/* 1A7064 80278784 10400007 */ beqz $v0, .L802787A4
/* 1A7068 80278788 A260019A */ sb $zero, 0x19A($s3)
/* 1A706C 8027878C 24020009 */ addiu $v0, $zero, 0x9
/* 1A7070 80278790 52420001 */ beql $s2, $v0, .L80278798
/* 1A7074 80278794 2412000A */ addiu $s2, $zero, 0xA
.L80278798:
/* 1A7078 80278798 24020017 */ addiu $v0, $zero, 0x17
/* 1A707C 8027879C 52420001 */ beql $s2, $v0, .L802787A4
/* 1A7080 802787A0 24120019 */ addiu $s2, $zero, 0x19
.L802787A4:
/* 1A7084 802787A4 24020020 */ addiu $v0, $zero, 0x20
/* 1A7088 802787A8 16420006 */ bne $s2, $v0, .L802787C4
/* 1A708C 802787AC 24020011 */ addiu $v0, $zero, 0x11
/* 1A7090 802787B0 50C20001 */ beql $a2, $v0, .L802787B8
/* 1A7094 802787B4 24120025 */ addiu $s2, $zero, 0x25
.L802787B8:
/* 1A7098 802787B8 2402002F */ addiu $v0, $zero, 0x2F
/* 1A709C 802787BC 50C20001 */ beql $a2, $v0, .L802787C4
/* 1A70A0 802787C0 24120026 */ addiu $s2, $zero, 0x26
.L802787C4:
/* 1A70A4 802787C4 54E0002C */ bnel $a3, $zero, .L80278878
/* 1A70A8 802787C8 AFA00010 */ sw $zero, 0x10($sp)
/* 1A70AC 802787CC 0200202D */ daddu $a0, $s0, $zero
/* 1A70B0 802787D0 86110428 */ lh $s1, 0x428($s0)
/* 1A70B4 802787D4 0C098C8C */ jal func_80263230
/* 1A70B8 802787D8 0200282D */ daddu $a1, $s0, $zero
/* 1A70BC 802787DC 50400032 */ beql $v0, $zero, .L802788A8
/* 1A70C0 802787E0 A6110428 */ sh $s1, 0x428($s0)
/* 1A70C4 802787E4 86020230 */ lh $v0, 0x230($s0)
/* 1A70C8 802787E8 86030232 */ lh $v1, 0x232($s0)
/* 1A70CC 802787EC 86040234 */ lh $a0, 0x234($s0)
/* 1A70D0 802787F0 AFA00010 */ sw $zero, 0x10($sp)
/* 1A70D4 802787F4 86670180 */ lh $a3, 0x180($s3)
/* 1A70D8 802787F8 44826000 */ mtc1 $v0, $f12
/* 1A70DC 802787FC 00000000 */ nop
/* 1A70E0 80278800 46806320 */ cvt.s.w $f12, $f12
/* 1A70E4 80278804 44840000 */ mtc1 $a0, $f0
/* 1A70E8 80278808 00000000 */ nop
/* 1A70EC 8027880C 46800020 */ cvt.s.w $f0, $f0
/* 1A70F0 80278810 44060000 */ mfc1 $a2, $f0
/* 1A70F4 80278814 44837000 */ mtc1 $v1, $f14
/* 1A70F8 80278818 00000000 */ nop
/* 1A70FC 8027881C 0C09996B */ jal show_next_damage_popup
/* 1A7100 80278820 468073A0 */ cvt.s.w $f14, $f14
/* 1A7104 80278824 86020230 */ lh $v0, 0x230($s0)
/* 1A7108 80278828 86030232 */ lh $v1, 0x232($s0)
/* 1A710C 8027882C 44820000 */ mtc1 $v0, $f0
/* 1A7110 80278830 00000000 */ nop
/* 1A7114 80278834 46800020 */ cvt.s.w $f0, $f0
/* 1A7118 80278838 44050000 */ mfc1 $a1, $f0
/* 1A711C 8027883C 44830000 */ mtc1 $v1, $f0
/* 1A7120 80278840 00000000 */ nop
/* 1A7124 80278844 46800020 */ cvt.s.w $f0, $f0
/* 1A7128 80278848 44060000 */ mfc1 $a2, $f0
/* 1A712C 8027884C 86020234 */ lh $v0, 0x234($s0)
/* 1A7130 80278850 86630180 */ lh $v1, 0x180($s3)
/* 1A7134 80278854 44820000 */ mtc1 $v0, $f0
/* 1A7138 80278858 00000000 */ nop
/* 1A713C 8027885C 46800020 */ cvt.s.w $f0, $f0
/* 1A7140 80278860 44070000 */ mfc1 $a3, $f0
/* 1A7144 80278864 0200202D */ daddu $a0, $s0, $zero
/* 1A7148 80278868 0C0999B9 */ jal show_damage_fx
/* 1A714C 8027886C AFA30010 */ sw $v1, 0x10($sp)
/* 1A7150 80278870 0809E22A */ j .L802788A8
/* 1A7154 80278874 A6110428 */ sh $s1, 0x428($s0)
.L80278878:
/* 1A7158 80278878 C62C000C */ lwc1 $f12, 0xC($s1)
/* 1A715C 8027887C C62E0010 */ lwc1 $f14, 0x10($s1)
/* 1A7160 80278880 86670180 */ lh $a3, 0x180($s3)
/* 1A7164 80278884 0C09996B */ jal show_next_damage_popup
/* 1A7168 80278888 8E260014 */ lw $a2, 0x14($s1)
/* 1A716C 8027888C 86620180 */ lh $v0, 0x180($s3)
/* 1A7170 80278890 AFA20010 */ sw $v0, 0x10($sp)
/* 1A7174 80278894 8E25000C */ lw $a1, 0xC($s1)
/* 1A7178 80278898 8E260010 */ lw $a2, 0x10($s1)
/* 1A717C 8027889C 8E270014 */ lw $a3, 0x14($s1)
/* 1A7180 802788A0 0C0999B9 */ jal show_damage_fx
/* 1A7184 802788A4 0200202D */ daddu $a0, $s0, $zero
.L802788A8:
/* 1A7188 802788A8 86620180 */ lh $v0, 0x180($s3)
/* 1A718C 802788AC 18400003 */ blez $v0, .L802788BC
/* 1A7190 802788B0 0200202D */ daddu $a0, $s0, $zero
/* 1A7194 802788B4 0C099C06 */ jal func_80267018
/* 1A7198 802788B8 24050001 */ addiu $a1, $zero, 0x1
.L802788BC:
/* 1A719C 802788BC 0200202D */ daddu $a0, $s0, $zero
/* 1A71A0 802788C0 0240282D */ daddu $a1, $s2, $zero
/* 1A71A4 802788C4 8C820000 */ lw $v0, 0x0($a0)
/* 1A71A8 802788C8 3C030008 */ lui $v1, (0x80000 >> 16)
/* 1A71AC 802788CC 00431025 */ or $v0, $v0, $v1
/* 1A71B0 802788D0 0C09DC58 */ jal dispatch_event_actor
/* 1A71B4 802788D4 AC820000 */ sw $v0, 0x0($a0)
/* 1A71B8 802788D8 8FBF0028 */ lw $ra, 0x28($sp)
/* 1A71BC 802788DC 8FB30024 */ lw $s3, 0x24($sp)
/* 1A71C0 802788E0 8FB20020 */ lw $s2, 0x20($sp)
/* 1A71C4 802788E4 8FB1001C */ lw $s1, 0x1C($sp)
/* 1A71C8 802788E8 8FB00018 */ lw $s0, 0x18($sp)
/* 1A71CC 802788EC 0000102D */ daddu $v0, $zero, $zero
/* 1A71D0 802788F0 03E00008 */ jr $ra
/* 1A71D4 802788F4 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
s32 dispatch_damage_event_actor(Actor* actor, s32 damageAmount, s32 originalEvent, s32 stopMotion) {
BattleStatus* battleStatus = &gBattleStatus;
ActorState* state = &actor->state;
s32 dispatchEvent = originalEvent;
s32 currentAttackDamage;
s32 hpChangeCounter;
s32 hpChange;
s32 flagCheck;
s32 new_var;
battleStatus->currentAttackDamage = damageAmount;
hpChange = (s16) damageAmount;
actor->hpChangeCounter += hpChange;
new_var = actor->hpChangeCounter;
hpChange = new_var;
actor->damageCounter += hpChange;
actor->hpChangeCounter -= hpChange;
battleStatus->lastAttackDamage = 0;
actor->currentHP -= hpChange;
if (actor->currentHP <= 0) {
dispatchEvent = EVENT_DEATH;
battleStatus->lastAttackDamage += actor->currentHP;
actor->currentHP = 0;
}
battleStatus->lastAttackDamage += hpChange;
actor->lastDamageTaken = battleStatus->lastAttackDamage;
battleStatus->currentDamageSource = DMG_SRC_DEFAULT;
if (battleStatus->flags1 & BS_FLAGS1_SP_EVT_ACTIVE) {
if (dispatchEvent == EVENT_HIT_COMBO) {
dispatchEvent = EVENT_HIT;
}
if (dispatchEvent == EVENT_ZERO_DAMAGE) {
dispatchEvent = EVENT_IMMUNE;
}
}
if (dispatchEvent == EVENT_DEATH) {
if (originalEvent == EVENT_SPIN_SMASH_LAUNCH_HIT) {
dispatchEvent = EVENT_SPIN_SMASH_LAUNCH_DEATH;
}
if (originalEvent == EVENT_SHOCK_HIT) {
dispatchEvent = EVENT_SHOCK_DEATH;
}
}
if (!stopMotion) {
s32 oldTargetActorID = actor->targetActorID;
if (func_80263230(actor, actor) != 0) {
show_next_damage_popup(actor->targetData[0].posA.x, actor->targetData[0].posA.y, actor->targetData[0].posA.z, battleStatus->lastAttackDamage, 0);
show_damage_fx(actor, actor->targetData[0].posA.x, actor->targetData[0].posA.y, actor->targetData[0].posA.z, battleStatus->lastAttackDamage);
actor->targetActorID = oldTargetActorID;
} else {
actor->targetActorID = oldTargetActorID;
}
} else {
show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0);
show_damage_fx(actor, state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage);
}
if (battleStatus->lastAttackDamage > 0) {
func_80267018(actor, 1);
}
actor->flags |= ACTOR_FLAG_HEALTH_BAR_HIDDEN;
dispatch_event_actor(actor, dispatchEvent);
return 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_802542CC
/* 182BAC 802542CC 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 182BB0 802542D0 AFB3001C */ sw $s3, 0x1C($sp)
/* 182BB4 802542D4 0080982D */ daddu $s3, $a0, $zero
/* 182BB8 802542D8 AFBF0030 */ sw $ra, 0x30($sp)
/* 182BBC 802542DC AFB7002C */ sw $s7, 0x2C($sp)
/* 182BC0 802542E0 AFB60028 */ sw $s6, 0x28($sp)
/* 182BC4 802542E4 AFB50024 */ sw $s5, 0x24($sp)
/* 182BC8 802542E8 AFB40020 */ sw $s4, 0x20($sp)
/* 182BCC 802542EC AFB20018 */ sw $s2, 0x18($sp)
/* 182BD0 802542F0 AFB10014 */ sw $s1, 0x14($sp)
/* 182BD4 802542F4 AFB00010 */ sw $s0, 0x10($sp)
/* 182BD8 802542F8 F7B60040 */ sdc1 $f22, 0x40($sp)
/* 182BDC 802542FC F7B40038 */ sdc1 $f20, 0x38($sp)
/* 182BE0 80254300 8E7201F4 */ lw $s2, 0x1F4($s3)
/* 182BE4 80254304 8E4300C0 */ lw $v1, 0xC0($s2)
/* 182BE8 80254308 906207DB */ lbu $v0, 0x7DB($v1)
/* 182BEC 8025430C 0000A82D */ daddu $s5, $zero, $zero
/* 182BF0 80254310 A06008AC */ sb $zero, 0x8AC($v1)
/* 182BF4 80254314 24420001 */ addiu $v0, $v0, 0x1
/* 182BF8 80254318 A06207DB */ sb $v0, 0x7DB($v1)
/* 182BFC 8025431C 3C031000 */ lui $v1, (0x10000000 >> 16)
/* 182C00 80254320 8E7201F4 */ lw $s2, 0x1F4($s3)
/* 182C04 80254324 8E620000 */ lw $v0, 0x0($s3)
/* 182C08 80254328 827701F3 */ lb $s7, 0x1F3($s3)
/* 182C0C 8025432C 00431025 */ or $v0, $v0, $v1
/* 182C10 80254330 1AE0007D */ blez $s7, .L80254528
/* 182C14 80254334 AE620000 */ sw $v0, 0x0($s3)
/* 182C18 80254338 3C168000 */ lui $s6, (0x80000000 >> 16)
/* 182C1C 8025433C 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 182C20 80254340 4481B000 */ mtc1 $at, $f22
/* 182C24 80254344 3C014F00 */ lui $at, (0x4F000000 >> 16)
/* 182C28 80254348 4481A000 */ mtc1 $at, $f20
.L8025434C:
/* 182C2C 8025434C 8E420094 */ lw $v0, 0x94($s2)
/* 182C30 80254350 10400070 */ beqz $v0, .L80254514
/* 182C34 80254354 00000000 */ nop
/* 182C38 80254358 8E420000 */ lw $v0, 0x0($s2)
/* 182C3C 8025435C 30420002 */ andi $v0, $v0, 0x2
/* 182C40 80254360 1440006C */ bnez $v0, .L80254514
/* 182C44 80254364 00000000 */ nop
/* 182C48 80254368 8E4300C0 */ lw $v1, 0xC0($s2)
/* 182C4C 8025436C 0000A02D */ daddu $s4, $zero, $zero
/* 182C50 80254370 0060802D */ daddu $s0, $v1, $zero
/* 182C54 80254374 0060882D */ daddu $s1, $v1, $zero
/* 182C58 80254378 A20007D8 */ sb $zero, 0x7D8($s0)
/* 182C5C 8025437C A20007D9 */ sb $zero, 0x7D9($s0)
.L80254380:
/* 182C60 80254380 C6400058 */ lwc1 $f0, 0x58($s2)
/* 182C64 80254384 4600010D */ trunc.w.s $f4, $f0
/* 182C68 80254388 44022000 */ mfc1 $v0, $f4
/* 182C6C 8025438C 00000000 */ nop
/* 182C70 80254390 A60207FC */ sh $v0, 0x7FC($s0)
/* 182C74 80254394 C640005C */ lwc1 $f0, 0x5C($s2)
/* 182C78 80254398 4600010D */ trunc.w.s $f4, $f0
/* 182C7C 8025439C 44022000 */ mfc1 $v0, $f4
/* 182C80 802543A0 00000000 */ nop
/* 182C84 802543A4 A602081C */ sh $v0, 0x81C($s0)
/* 182C88 802543A8 C6400060 */ lwc1 $f0, 0x60($s2)
/* 182C8C 802543AC 4600010D */ trunc.w.s $f4, $f0
/* 182C90 802543B0 44022000 */ mfc1 $v0, $f4
/* 182C94 802543B4 00000000 */ nop
/* 182C98 802543B8 A602083C */ sh $v0, 0x83C($s0)
/* 182C9C 802543BC C660018C */ lwc1 $f0, 0x18C($s3)
/* 182CA0 802543C0 4600010D */ trunc.w.s $f4, $f0
/* 182CA4 802543C4 44022000 */ mfc1 $v0, $f4
/* 182CA8 802543C8 00000000 */ nop
/* 182CAC 802543CC A60207DC */ sh $v0, 0x7DC($s0)
/* 182CB0 802543D0 86620168 */ lh $v0, 0x168($s3)
/* 182CB4 802543D4 C6620188 */ lwc1 $f2, 0x188($s3)
/* 182CB8 802543D8 44820000 */ mtc1 $v0, $f0
/* 182CBC 802543DC 00000000 */ nop
/* 182CC0 802543E0 46800020 */ cvt.s.w $f0, $f0
/* 182CC4 802543E4 46020002 */ mul.s $f0, $f0, $f2
/* 182CC8 802543E8 00000000 */ nop
/* 182CCC 802543EC 4600010D */ trunc.w.s $f4, $f0
/* 182CD0 802543F0 44022000 */ mfc1 $v0, $f4
/* 182CD4 802543F4 00000000 */ nop
/* 182CD8 802543F8 A222085C */ sb $v0, 0x85C($s1)
/* 182CDC 802543FC 8662016A */ lh $v0, 0x16A($s3)
/* 182CE0 80254400 C6620188 */ lwc1 $f2, 0x188($s3)
/* 182CE4 80254404 44820000 */ mtc1 $v0, $f0
/* 182CE8 80254408 00000000 */ nop
/* 182CEC 8025440C 46800020 */ cvt.s.w $f0, $f0
/* 182CF0 80254410 46020002 */ mul.s $f0, $f0, $f2
/* 182CF4 80254414 00000000 */ nop
/* 182CF8 80254418 4600010D */ trunc.w.s $f4, $f0
D_8025441C:
/* 182CFC 8025441C 44022000 */ mfc1 $v0, $f4
/* 182D00 80254420 00000000 */ nop
/* 182D04 80254424 A222086C */ sb $v0, 0x86C($s1)
/* 182D08 80254428 0C00A6C9 */ jal clamp_angle
/* 182D0C 8025442C C66C015C */ lwc1 $f12, 0x15C($s3)
/* 182D10 80254430 46160002 */ mul.s $f0, $f0, $f22
/* 182D14 80254434 00000000 */ nop
/* 182D18 80254438 4600A03E */ c.le.s $f20, $f0
/* 182D1C 8025443C 00000000 */ nop
/* 182D20 80254440 45010005 */ bc1t .L80254458
/* 182D24 80254444 2623087C */ addiu $v1, $s1, 0x87C
/* 182D28 80254448 4600010D */ trunc.w.s $f4, $f0
/* 182D2C 8025444C 44022000 */ mfc1 $v0, $f4
/* 182D30 80254450 0809511C */ j .L80254470
/* 182D34 80254454 A0620000 */ sb $v0, 0x0($v1)
.L80254458:
/* 182D38 80254458 46140001 */ sub.s $f0, $f0, $f20
/* 182D3C 8025445C 4600010D */ trunc.w.s $f4, $f0
/* 182D40 80254460 44022000 */ mfc1 $v0, $f4
/* 182D44 80254464 00000000 */ nop
/* 182D48 80254468 00561025 */ or $v0, $v0, $s6
/* 182D4C 8025446C A0620000 */ sb $v0, 0x0($v1)
.L80254470:
/* 182D50 80254470 0C00A6C9 */ jal clamp_angle
/* 182D54 80254474 C66C0160 */ lwc1 $f12, 0x160($s3)
/* 182D58 80254478 46160002 */ mul.s $f0, $f0, $f22
/* 182D5C 8025447C 00000000 */ nop
/* 182D60 80254480 4600A03E */ c.le.s $f20, $f0
/* 182D64 80254484 00000000 */ nop
/* 182D68 80254488 45010005 */ bc1t .L802544A0
/* 182D6C 8025448C 2623088C */ addiu $v1, $s1, 0x88C
/* 182D70 80254490 4600010D */ trunc.w.s $f4, $f0
/* 182D74 80254494 44022000 */ mfc1 $v0, $f4
/* 182D78 80254498 0809512E */ j .L802544B8
/* 182D7C 8025449C A0620000 */ sb $v0, 0x0($v1)
.L802544A0:
/* 182D80 802544A0 46140001 */ sub.s $f0, $f0, $f20
/* 182D84 802544A4 4600010D */ trunc.w.s $f4, $f0
/* 182D88 802544A8 44022000 */ mfc1 $v0, $f4
/* 182D8C 802544AC 00000000 */ nop
/* 182D90 802544B0 00561025 */ or $v0, $v0, $s6
/* 182D94 802544B4 A0620000 */ sb $v0, 0x0($v1)
.L802544B8:
/* 182D98 802544B8 0C00A6C9 */ jal clamp_angle
/* 182D9C 802544BC C66C0164 */ lwc1 $f12, 0x164($s3)
/* 182DA0 802544C0 46160002 */ mul.s $f0, $f0, $f22
/* 182DA4 802544C4 00000000 */ nop
/* 182DA8 802544C8 4600A03E */ c.le.s $f20, $f0
/* 182DAC 802544CC 00000000 */ nop
/* 182DB0 802544D0 45010005 */ bc1t .L802544E8
/* 182DB4 802544D4 2623089C */ addiu $v1, $s1, 0x89C
/* 182DB8 802544D8 4600010D */ trunc.w.s $f4, $f0
/* 182DBC 802544DC 44022000 */ mfc1 $v0, $f4
/* 182DC0 802544E0 08095140 */ j .L80254500
/* 182DC4 802544E4 A0620000 */ sb $v0, 0x0($v1)
.L802544E8:
/* 182DC8 802544E8 46140001 */ sub.s $f0, $f0, $f20
/* 182DCC 802544EC 4600010D */ trunc.w.s $f4, $f0
/* 182DD0 802544F0 44022000 */ mfc1 $v0, $f4
/* 182DD4 802544F4 00000000 */ nop
/* 182DD8 802544F8 00561025 */ or $v0, $v0, $s6
/* 182DDC 802544FC A0620000 */ sb $v0, 0x0($v1)
.L80254500:
/* 182DE0 80254500 26310001 */ addiu $s1, $s1, 0x1
/* 182DE4 80254504 26940001 */ addiu $s4, $s4, 0x1
/* 182DE8 80254508 2A820010 */ slti $v0, $s4, 0x10
/* 182DEC 8025450C 1440FF9C */ bnez $v0, .L80254380
/* 182DF0 80254510 26100002 */ addiu $s0, $s0, 0x2
.L80254514:
/* 182DF4 80254514 8E52000C */ lw $s2, 0xC($s2)
/* 182DF8 80254518 26B50001 */ addiu $s5, $s5, 0x1
/* 182DFC 8025451C 02B7102A */ slt $v0, $s5, $s7
/* 182E00 80254520 1440FF8A */ bnez $v0, .L8025434C
/* 182E04 80254524 00000000 */ nop
.L80254528:
/* 182E08 80254528 8FBF0030 */ lw $ra, 0x30($sp)
/* 182E0C 8025452C 8FB7002C */ lw $s7, 0x2C($sp)
/* 182E10 80254530 8FB60028 */ lw $s6, 0x28($sp)
/* 182E14 80254534 8FB50024 */ lw $s5, 0x24($sp)
/* 182E18 80254538 8FB40020 */ lw $s4, 0x20($sp)
/* 182E1C 8025453C 8FB3001C */ lw $s3, 0x1C($sp)
/* 182E20 80254540 8FB20018 */ lw $s2, 0x18($sp)
/* 182E24 80254544 8FB10014 */ lw $s1, 0x14($sp)
/* 182E28 80254548 8FB00010 */ lw $s0, 0x10($sp)
/* 182E2C 8025454C D7B60040 */ ldc1 $f22, 0x40($sp)
/* 182E30 80254550 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 182E34 80254554 03E00008 */ jr $ra
/* 182E38 80254558 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
void enable_actor_blur(Actor* actor) {
ActorPart* partsTable = actor->partsTable;
DecorationTable* decorationTable = partsTable->decorationTable;
s32 i, j;
s32 numParts;
decorationTable->effectType = 0;
decorationTable->unk_7DB++;
actor->flags |= ACTOR_FLAG_BLUR_ENABLED;
partsTable = actor->partsTable;
numParts = actor->numParts;
for (i = 0; i < numParts; i++) {
if (partsTable->idleAnimations != NULL && !(partsTable->flags & ACTOR_PART_FLAG_2)) {
decorationTable = partsTable->decorationTable;
decorationTable->unk_7D8 = 0;
decorationTable->unk_7D9 = 0;
for (j = 0; j < ARRAY_COUNT(decorationTable->posX); j++) {
decorationTable->posX[j] = partsTable->currentPos.x;
decorationTable->posY[j] = partsTable->currentPos.y;
decorationTable->posZ[j] = partsTable->currentPos.z;
decorationTable->yaw[j] = actor->yaw;
decorationTable->rotationPivotOffsetX[j] = (s32)(actor->rotationPivotOffset.x * actor->scalingFactor);
decorationTable->rotationPivotOffsetY[j] = (s32)(actor->rotationPivotOffset.y * actor->scalingFactor);
decorationTable->rotX[j] = clamp_angle(actor->rotation.x) * 0.5f;
decorationTable->rotY[j] = clamp_angle(actor->rotation.y) * 0.5f;
decorationTable->rotZ[j] = clamp_angle(actor->rotation.z) * 0.5f;
}
}
partsTable = partsTable->nextPart;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel SetCamProperties
/* F0D9C 802CC3EC 27BDFF60 */ addiu $sp, $sp, -0xA0
/* F0DA0 802CC3F0 AFB1005C */ sw $s1, 0x5C($sp)
/* F0DA4 802CC3F4 0080882D */ daddu $s1, $a0, $zero
/* F0DA8 802CC3F8 AFB20060 */ sw $s2, 0x60($sp)
/* F0DAC 802CC3FC 00A0902D */ daddu $s2, $a1, $zero
/* F0DB0 802CC400 AFBF0068 */ sw $ra, 0x68($sp)
/* F0DB4 802CC404 AFB30064 */ sw $s3, 0x64($sp)
/* F0DB8 802CC408 AFB00058 */ sw $s0, 0x58($sp)
/* F0DBC 802CC40C F7BE0098 */ sdc1 $f30, 0x98($sp)
/* F0DC0 802CC410 F7BC0090 */ sdc1 $f28, 0x90($sp)
/* F0DC4 802CC414 F7BA0088 */ sdc1 $f26, 0x88($sp)
/* F0DC8 802CC418 F7B80080 */ sdc1 $f24, 0x80($sp)
/* F0DCC 802CC41C F7B60078 */ sdc1 $f22, 0x78($sp)
/* F0DD0 802CC420 F7B40070 */ sdc1 $f20, 0x70($sp)
/* F0DD4 802CC424 8E30000C */ lw $s0, 0xC($s1)
/* F0DD8 802CC428 8E050000 */ lw $a1, 0x0($s0)
/* F0DDC 802CC42C 0C0B1EAF */ jal evt_get_variable
/* F0DE0 802CC430 26100004 */ addiu $s0, $s0, 0x4
/* F0DE4 802CC434 8E050000 */ lw $a1, 0x0($s0)
/* F0DE8 802CC438 26100004 */ addiu $s0, $s0, 0x4
/* F0DEC 802CC43C 0220202D */ daddu $a0, $s1, $zero
/* F0DF0 802CC440 3C06800B */ lui $a2, %hi(gCameras)
/* F0DF4 802CC444 24C61D80 */ addiu $a2, $a2, %lo(gCameras)
/* F0DF8 802CC448 00021880 */ sll $v1, $v0, 2
/* F0DFC 802CC44C 00621821 */ addu $v1, $v1, $v0
/* F0E00 802CC450 00031880 */ sll $v1, $v1, 2
/* F0E04 802CC454 00621823 */ subu $v1, $v1, $v0
/* F0E08 802CC458 000310C0 */ sll $v0, $v1, 3
/* F0E0C 802CC45C 00621821 */ addu $v1, $v1, $v0
/* F0E10 802CC460 000318C0 */ sll $v1, $v1, 3
/* F0E14 802CC464 0C0B210B */ jal evt_get_float_variable
/* F0E18 802CC468 00669821 */ addu $s3, $v1, $a2
/* F0E1C 802CC46C 8E050000 */ lw $a1, 0x0($s0)
/* F0E20 802CC470 26100004 */ addiu $s0, $s0, 0x4
/* F0E24 802CC474 0220202D */ daddu $a0, $s1, $zero
/* F0E28 802CC478 0C0B210B */ jal evt_get_float_variable
/* F0E2C 802CC47C E7A00054 */ swc1 $f0, 0x54($sp)
/* F0E30 802CC480 8E050000 */ lw $a1, 0x0($s0)
/* F0E34 802CC484 26100004 */ addiu $s0, $s0, 0x4
/* F0E38 802CC488 0220202D */ daddu $a0, $s1, $zero
/* F0E3C 802CC48C 0C0B210B */ jal evt_get_float_variable
/* F0E40 802CC490 46000606 */ mov.s $f24, $f0
/* F0E44 802CC494 8E050000 */ lw $a1, 0x0($s0)
/* F0E48 802CC498 26100004 */ addiu $s0, $s0, 0x4
/* F0E4C 802CC49C 0220202D */ daddu $a0, $s1, $zero
/* F0E50 802CC4A0 0C0B210B */ jal evt_get_float_variable
/* F0E54 802CC4A4 46000586 */ mov.s $f22, $f0
/* F0E58 802CC4A8 8E050000 */ lw $a1, 0x0($s0)
/* F0E5C 802CC4AC 26100004 */ addiu $s0, $s0, 0x4
/* F0E60 802CC4B0 0220202D */ daddu $a0, $s1, $zero
/* F0E64 802CC4B4 0C0B210B */ jal evt_get_float_variable
/* F0E68 802CC4B8 46000506 */ mov.s $f20, $f0
/* F0E6C 802CC4BC 8E050000 */ lw $a1, 0x0($s0)
/* F0E70 802CC4C0 26100004 */ addiu $s0, $s0, 0x4
/* F0E74 802CC4C4 0220202D */ daddu $a0, $s1, $zero
/* F0E78 802CC4C8 0C0B210B */ jal evt_get_float_variable
/* F0E7C 802CC4CC 46000786 */ mov.s $f30, $f0
/* F0E80 802CC4D0 0220202D */ daddu $a0, $s1, $zero
/* F0E84 802CC4D4 8E050000 */ lw $a1, 0x0($s0)
/* F0E88 802CC4D8 0C0B210B */ jal evt_get_float_variable
/* F0E8C 802CC4DC 46000706 */ mov.s $f28, $f0
/* F0E90 802CC4E0 12400049 */ beqz $s2, .L802CC608
/* F0E94 802CC4E4 46000686 */ mov.s $f26, $f0
/* F0E98 802CC4E8 27A20038 */ addiu $v0, $sp, 0x38
/* F0E9C 802CC4EC 3C0146FF */ lui $at, (0x46FFFE00 >> 16)
/* F0EA0 802CC4F0 3421FE00 */ ori $at, $at, (0x46FFFE00 & 0xFFFF)
/* F0EA4 802CC4F4 44811000 */ mtc1 $at, $f2
/* F0EA8 802CC4F8 44802000 */ mtc1 $zero, $f4
/* F0EAC 802CC4FC 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* F0EB0 802CC500 44810000 */ mtc1 $at, $f0
/* F0EB4 802CC504 3C014120 */ lui $at, (0x41200000 >> 16)
/* F0EB8 802CC508 44817000 */ mtc1 $at, $f14
/* F0EBC 802CC50C 4406A000 */ mfc1 $a2, $f20
/* F0EC0 802CC510 4600C306 */ mov.s $f12, $f24
/* F0EC4 802CC514 E7A20044 */ swc1 $f2, 0x44($sp)
/* F0EC8 802CC518 AFA20018 */ sw $v0, 0x18($sp)
/* F0ECC 802CC51C 27A2003C */ addiu $v0, $sp, 0x3C
/* F0ED0 802CC520 AFA2001C */ sw $v0, 0x1C($sp)
/* F0ED4 802CC524 27A20040 */ addiu $v0, $sp, 0x40
/* F0ED8 802CC528 AFA20020 */ sw $v0, 0x20($sp)
/* F0EDC 802CC52C 27A20044 */ addiu $v0, $sp, 0x44
/* F0EE0 802CC530 AFA20024 */ sw $v0, 0x24($sp)
/* F0EE4 802CC534 27A20048 */ addiu $v0, $sp, 0x48
/* F0EE8 802CC538 AFA20028 */ sw $v0, 0x28($sp)
/* F0EEC 802CC53C 27A2004C */ addiu $v0, $sp, 0x4C
/* F0EF0 802CC540 AFA2002C */ sw $v0, 0x2C($sp)
/* F0EF4 802CC544 27A20050 */ addiu $v0, $sp, 0x50
/* F0EF8 802CC548 44072000 */ mfc1 $a3, $f4
/* F0EFC 802CC54C 460EB380 */ add.s $f14, $f22, $f14
/* F0F00 802CC550 E7A00010 */ swc1 $f0, 0x10($sp)
/* F0F04 802CC554 E7A40014 */ swc1 $f4, 0x14($sp)
/* F0F08 802CC558 0C017449 */ jal test_ray_zones
/* F0F0C 802CC55C AFA20030 */ sw $v0, 0x30($sp)
/* F0F10 802CC560 0040182D */ daddu $v1, $v0, $zero
/* F0F14 802CC564 0460001A */ bltz $v1, .L802CC5D0
/* F0F18 802CC568 000310C0 */ sll $v0, $v1, 3
/* F0F1C 802CC56C 00431023 */ subu $v0, $v0, $v1
/* F0F20 802CC570 3C03800E */ lui $v1, %hi(D_800D91D4)
/* F0F24 802CC574 8C6391D4 */ lw $v1, %lo(D_800D91D4)($v1)
/* F0F28 802CC578 00021080 */ sll $v0, $v0, 2
/* F0F2C 802CC57C 00431021 */ addu $v0, $v0, $v1
/* F0F30 802CC580 8C420010 */ lw $v0, 0x10($v0)
/* F0F34 802CC584 266304D8 */ addiu $v1, $s3, 0x4D8
/* F0F38 802CC588 24440020 */ addiu $a0, $v0, 0x20
.L802CC58C:
/* F0F3C 802CC58C 8C480000 */ lw $t0, 0x0($v0)
/* F0F40 802CC590 8C490004 */ lw $t1, 0x4($v0)
/* F0F44 802CC594 8C4A0008 */ lw $t2, 0x8($v0)
/* F0F48 802CC598 8C4B000C */ lw $t3, 0xC($v0)
/* F0F4C 802CC59C AC680000 */ sw $t0, 0x0($v1)
/* F0F50 802CC5A0 AC690004 */ sw $t1, 0x4($v1)
/* F0F54 802CC5A4 AC6A0008 */ sw $t2, 0x8($v1)
/* F0F58 802CC5A8 AC6B000C */ sw $t3, 0xC($v1)
/* F0F5C 802CC5AC 24420010 */ addiu $v0, $v0, 0x10
/* F0F60 802CC5B0 1444FFF6 */ bne $v0, $a0, .L802CC58C
/* F0F64 802CC5B4 24630010 */ addiu $v1, $v1, 0x10
/* F0F68 802CC5B8 8C480000 */ lw $t0, 0x0($v0)
/* F0F6C 802CC5BC 8C490004 */ lw $t1, 0x4($v0)
/* F0F70 802CC5C0 8C4A0008 */ lw $t2, 0x8($v0)
/* F0F74 802CC5C4 AC680000 */ sw $t0, 0x0($v1)
/* F0F78 802CC5C8 AC690004 */ sw $t1, 0x4($v1)
/* F0F7C 802CC5CC AC6A0008 */ sw $t2, 0x8($v1)
.L802CC5D0:
/* F0F80 802CC5D0 0000102D */ daddu $v0, $zero, $zero
/* F0F84 802CC5D4 E67804B0 */ swc1 $f24, 0x4B0($s3)
/* F0F88 802CC5D8 E67604B4 */ swc1 $f22, 0x4B4($s3)
/* F0F8C 802CC5DC E67404B8 */ swc1 $f20, 0x4B8($s3)
/* F0F90 802CC5E0 E67E04DC */ swc1 $f30, 0x4DC($s3)
/* F0F94 802CC5E4 E67C04E0 */ swc1 $f28, 0x4E0($s3)
/* F0F98 802CC5E8 E67A04FC */ swc1 $f26, 0x4FC($s3)
/* F0F9C 802CC5EC C7A60054 */ lwc1 $f6, 0x54($sp)
/* F0FA0 802CC5F0 24030001 */ addiu $v1, $zero, 0x1
/* F0FA4 802CC5F4 E6660490 */ swc1 $f6, 0x490($s3)
/* F0FA8 802CC5F8 A6630506 */ sh $v1, 0x506($s3)
/* F0FAC 802CC5FC A6630504 */ sh $v1, 0x504($s3)
/* F0FB0 802CC600 080B318B */ j .L802CC62C
/* F0FB4 802CC604 AE600508 */ sw $zero, 0x508($s3)
.L802CC608:
/* F0FB8 802CC608 C6620484 */ lwc1 $f2, 0x484($s3)
/* F0FBC 802CC60C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* F0FC0 802CC610 44810000 */ mtc1 $at, $f0
/* F0FC4 802CC614 00000000 */ nop
/* F0FC8 802CC618 4602003E */ c.le.s $f0, $f2
/* F0FCC 802CC61C 00000000 */ nop
/* F0FD0 802CC620 45010002 */ bc1t .L802CC62C
/* F0FD4 802CC624 24020002 */ addiu $v0, $zero, 0x2
/* F0FD8 802CC628 0000102D */ daddu $v0, $zero, $zero
.L802CC62C:
/* F0FDC 802CC62C 8FBF0068 */ lw $ra, 0x68($sp)
/* F0FE0 802CC630 8FB30064 */ lw $s3, 0x64($sp)
/* F0FE4 802CC634 8FB20060 */ lw $s2, 0x60($sp)
/* F0FE8 802CC638 8FB1005C */ lw $s1, 0x5C($sp)
/* F0FEC 802CC63C 8FB00058 */ lw $s0, 0x58($sp)
/* F0FF0 802CC640 D7BE0098 */ ldc1 $f30, 0x98($sp)
/* F0FF4 802CC644 D7BC0090 */ ldc1 $f28, 0x90($sp)
/* F0FF8 802CC648 D7BA0088 */ ldc1 $f26, 0x88($sp)
/* F0FFC 802CC64C D7B80080 */ ldc1 $f24, 0x80($sp)
/* F1000 802CC650 D7B60078 */ ldc1 $f22, 0x78($sp)
/* F1004 802CC654 D7B40070 */ ldc1 $f20, 0x70($sp)
/* F1008 802CC658 03E00008 */ jr $ra
/* F100C 802CC65C 27BD00A0 */ addiu $sp, $sp, 0xA0
### DECOMPILED C INSTRUCTIONS:
ApiStatus SetCamProperties(Evt* script, s32 isInitialCall) {
f32 hitX, hitY, hitZ, hitDepth, nX, nY, nZ;
s32 zoneID;
Bytecode* args = script->ptrReadPos;
Camera* camera = &gCameras[evt_get_variable(script, *args++)];
f32 moveSpeed = evt_get_float_variable(script, *args++);
f32 posX = evt_get_float_variable(script, *args++);
f32 posY = evt_get_float_variable(script, *args++);
f32 posZ = evt_get_float_variable(script, *args++);
f32 boomLength = evt_get_float_variable(script, *args++);
f32 boomPitch = evt_get_float_variable(script, *args++);
f32 viewPitch = evt_get_float_variable(script, *args++);
if (isInitialCall) {
hitDepth = 32767.0f;
zoneID = test_ray_zones(posX, posY + 10.0f, posZ, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &nX, &nY, &nZ);
if (zoneID >= 0) {
camera->controlSettings = *gZoneCollisionData.colliderList[zoneID].camSettings;
}
camera->movePos.x = posX;
camera->movePos.y = posY;
camera->movePos.z = posZ;
camera->controlSettings.boomLength = boomLength;
camera->controlSettings.boomPitch = boomPitch;
camera->controlSettings.viewPitch = viewPitch;
camera->moveSpeed = moveSpeed;
camera->panActive = TRUE;
camera->followPlayer = TRUE;
camera->panPhase = 0.0f;
return ApiStatus_BLOCK;
}
if (camera->interpAlpha >= 1.0f) {
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel btl_init_menu_partner
/* 1921F4 80263914 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 1921F8 80263918 AFBE0030 */ sw $fp, 0x30($sp)
/* 1921FC 8026391C 3C1E8011 */ lui $fp, %hi(gPlayerData)
/* 192200 80263920 27DEF290 */ addiu $fp, $fp, %lo(gPlayerData)
/* 192204 80263924 AFB10014 */ sw $s1, 0x14($sp)
/* 192208 80263928 24110017 */ addiu $s1, $zero, 0x17
/* 19220C 8026392C AFB40020 */ sw $s4, 0x20($sp)
/* 192210 80263930 3C14800E */ lui $s4, %hi(gBattleStatus)
/* 192214 80263934 2694C070 */ addiu $s4, $s4, %lo(gBattleStatus)
/* 192218 80263938 02911021 */ addu $v0, $s4, $s1
/* 19221C 8026393C AFBF0034 */ sw $ra, 0x34($sp)
/* 192220 80263940 AFB7002C */ sw $s7, 0x2C($sp)
/* 192224 80263944 AFB60028 */ sw $s6, 0x28($sp)
/* 192228 80263948 AFB50024 */ sw $s5, 0x24($sp)
/* 19222C 8026394C AFB3001C */ sw $s3, 0x1C($sp)
/* 192230 80263950 AFB20018 */ sw $s2, 0x18($sp)
/* 192234 80263954 AFB00010 */ sw $s0, 0x10($sp)
/* 192238 80263958 8E9700D8 */ lw $s7, 0xD8($s4)
/* 19223C 8026395C 8E9500DC */ lw $s5, 0xDC($s4)
.L80263960:
/* 192240 80263960 A04001DE */ sb $zero, 0x1DE($v0)
/* 192244 80263964 2631FFFF */ addiu $s1, $s1, -0x1
/* 192248 80263968 0621FFFD */ bgez $s1, .L80263960
/* 19224C 8026396C 2442FFFF */ addiu $v0, $v0, -0x1
/* 192250 80263970 8EA20008 */ lw $v0, 0x8($s5)
/* 192254 80263974 24110001 */ addiu $s1, $zero, 0x1
/* 192258 80263978 90420006 */ lbu $v0, 0x6($v0)
/* 19225C 8026397C 83C30012 */ lb $v1, 0x12($fp)
/* 192260 80263980 24420002 */ addiu $v0, $v0, 0x2
/* 192264 80263984 A282020E */ sb $v0, 0x20E($s4)
/* 192268 80263988 02231004 */ sllv $v0, $v1, $s1
/* 19226C 8026398C 00431021 */ addu $v0, $v0, $v1
/* 192270 80263990 02221004 */ sllv $v0, $v0, $s1
/* 192274 80263994 2442007D */ addiu $v0, $v0, 0x7D
/* 192278 80263998 8EA30008 */ lw $v1, 0x8($s5)
/* 19227C 8026399C 9284020E */ lbu $a0, 0x20E($s4)
/* 192280 802639A0 90630006 */ lbu $v1, 0x6($v1)
/* 192284 802639A4 0224202A */ slt $a0, $s1, $a0
/* 192288 802639A8 00621821 */ addu $v1, $v1, $v0
/* 19228C 802639AC 1080000E */ beqz $a0, .L802639E8
/* 192290 802639B0 A28301DE */ sb $v1, 0x1DE($s4)
.L802639B4:
/* 192294 802639B4 83C30012 */ lb $v1, 0x12($fp)
/* 192298 802639B8 02912021 */ addu $a0, $s4, $s1
/* 19229C 802639BC 00031040 */ sll $v0, $v1, 1
/* 1922A0 802639C0 00431021 */ addu $v0, $v0, $v1
/* 1922A4 802639C4 00021040 */ sll $v0, $v0, 1
/* 1922A8 802639C8 2442007F */ addiu $v0, $v0, 0x7F
/* 1922AC 802639CC 00511021 */ addu $v0, $v0, $s1
/* 1922B0 802639D0 A08201DE */ sb $v0, 0x1DE($a0)
/* 1922B4 802639D4 9282020E */ lbu $v0, 0x20E($s4)
/* 1922B8 802639D8 26310001 */ addiu $s1, $s1, 0x1
/* 1922BC 802639DC 0222102A */ slt $v0, $s1, $v0
/* 1922C0 802639E0 1440FFF4 */ bnez $v0, .L802639B4
/* 1922C4 802639E4 00000000 */ nop
.L802639E8:
/* 1922C8 802639E8 0000882D */ daddu $s1, $zero, $zero
/* 1922CC 802639EC 9282020E */ lbu $v0, 0x20E($s4)
/* 1922D0 802639F0 10400037 */ beqz $v0, .L80263AD0
/* 1922D4 802639F4 0220B02D */ daddu $s6, $s1, $zero
/* 1922D8 802639F8 0280902D */ daddu $s2, $s4, $zero
.L802639FC:
/* 1922DC 802639FC 924301DE */ lbu $v1, 0x1DE($s2)
/* 1922E0 80263A00 3C068009 */ lui $a2, %hi(gMoveTable)
/* 1922E4 80263A04 24C6F060 */ addiu $a2, $a2, %lo(gMoveTable)
/* 1922E8 80263A08 00031080 */ sll $v0, $v1, 2
/* 1922EC 80263A0C 00431021 */ addu $v0, $v0, $v1
/* 1922F0 80263A10 00021080 */ sll $v0, $v0, 2
/* 1922F4 80263A14 00469821 */ addu $s3, $v0, $a2
/* 1922F8 80263A18 82700011 */ lb $s0, 0x11($s3)
/* 1922FC 80263A1C 1200000B */ beqz $s0, .L80263A4C
/* 192300 80263A20 02E0202D */ daddu $a0, $s7, $zero
/* 192304 80263A24 0C099CAB */ jal player_team_is_ability_active
/* 192308 80263A28 24050018 */ addiu $a1, $zero, 0x18
/* 19230C 80263A2C 02028023 */ subu $s0, $s0, $v0
/* 192310 80263A30 02E0202D */ daddu $a0, $s7, $zero
/* 192314 80263A34 0C099CAB */ jal player_team_is_ability_active
/* 192318 80263A38 24050026 */ addiu $a1, $zero, 0x26
/* 19231C 80263A3C 00021040 */ sll $v0, $v0, 1
/* 192320 80263A40 02028023 */ subu $s0, $s0, $v0
/* 192324 80263A44 5A000001 */ blezl $s0, .L80263A4C
/* 192328 80263A48 24100001 */ addiu $s0, $zero, 0x1
.L80263A4C:
/* 19232C 80263A4C 24020005 */ addiu $v0, $zero, 0x5
/* 192330 80263A50 A2820178 */ sb $v0, 0x178($s4)
/* 192334 80263A54 8EA20008 */ lw $v0, 0x8($s5)
/* 192338 80263A58 90420006 */ lbu $v0, 0x6($v0)
/* 19233C 80263A5C A682017A */ sh $v0, 0x17A($s4)
/* 192340 80263A60 8E620004 */ lw $v0, 0x4($s3)
/* 192344 80263A64 02A0202D */ daddu $a0, $s5, $zero
/* 192348 80263A68 0C098C0B */ jal func_8026302C
/* 19234C 80263A6C AE820184 */ sw $v0, 0x184($s4)
/* 192350 80263A70 82A2040C */ lb $v0, 0x40C($s5)
/* 192354 80263A74 10400006 */ beqz $v0, .L80263A90
/* 192358 80263A78 2402FFFE */ addiu $v0, $zero, -0x2
/* 19235C 80263A7C 24160001 */ addiu $s6, $zero, 0x1
/* 192360 80263A80 A25601F6 */ sb $s6, 0x1F6($s2)
/* 192364 80263A84 82A2040C */ lb $v0, 0x40C($s5)
/* 192368 80263A88 14400002 */ bnez $v0, .L80263A94
/* 19236C 80263A8C 2402FFFE */ addiu $v0, $zero, -0x2
.L80263A90:
/* 192370 80263A90 A24201F6 */ sb $v0, 0x1F6($s2)
.L80263A94:
/* 192374 80263A94 83C20005 */ lb $v0, 0x5($fp)
/* 192378 80263A98 0050102A */ slt $v0, $v0, $s0
/* 19237C 80263A9C 54400001 */ bnel $v0, $zero, .L80263AA4
/* 192380 80263AA0 A24001F6 */ sb $zero, 0x1F6($s2)
.L80263AA4:
/* 192384 80263AA4 3C02800E */ lui $v0, %hi(gBattleStatus + 0x4)
/* 192388 80263AA8 8C42C074 */ lw $v0, %lo(gBattleStatus + 0x4)($v0)
/* 19238C 80263AAC 30421000 */ andi $v0, $v0, 0x1000
/* 192390 80263AB0 10400002 */ beqz $v0, .L80263ABC
/* 192394 80263AB4 2402FFFF */ addiu $v0, $zero, -0x1
/* 192398 80263AB8 A24201F6 */ sb $v0, 0x1F6($s2)
.L80263ABC:
/* 19239C 80263ABC 9282020E */ lbu $v0, 0x20E($s4)
/* 1923A0 80263AC0 26310001 */ addiu $s1, $s1, 0x1
/* 1923A4 80263AC4 0222102A */ slt $v0, $s1, $v0
/* 1923A8 80263AC8 1440FFCC */ bnez $v0, .L802639FC
/* 1923AC 80263ACC 26520001 */ addiu $s2, $s2, 0x1
.L80263AD0:
/* 1923B0 80263AD0 16C00002 */ bnez $s6, .L80263ADC
/* 1923B4 80263AD4 24020001 */ addiu $v0, $zero, 0x1
/* 1923B8 80263AD8 2402FFFF */ addiu $v0, $zero, -0x1
.L80263ADC:
/* 1923BC 80263ADC A2820080 */ sb $v0, 0x80($s4)
/* 1923C0 80263AE0 8FBF0034 */ lw $ra, 0x34($sp)
/* 1923C4 80263AE4 8FBE0030 */ lw $fp, 0x30($sp)
/* 1923C8 80263AE8 8FB7002C */ lw $s7, 0x2C($sp)
/* 1923CC 80263AEC 8FB60028 */ lw $s6, 0x28($sp)
/* 1923D0 80263AF0 8FB50024 */ lw $s5, 0x24($sp)
/* 1923D4 80263AF4 8FB40020 */ lw $s4, 0x20($sp)
/* 1923D8 80263AF8 8FB3001C */ lw $s3, 0x1C($sp)
/* 1923DC 80263AFC 8FB20018 */ lw $s2, 0x18($sp)
/* 1923E0 80263B00 8FB10014 */ lw $s1, 0x14($sp)
/* 1923E4 80263B04 8FB00010 */ lw $s0, 0x10($sp)
/* 1923E8 80263B08 03E00008 */ jr $ra
/* 1923EC 80263B0C 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void btl_init_menu_partner(void) {
PlayerData* playerData = &gPlayerData;
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
Actor* partner = battleStatus->partnerActor;
s32 fpCost;
s32 i;
s32 hasAnyBadgeMoves;
for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) {
battleStatus->submenuMoves[i] = 0;
}
// In the move table (enum MoveIDs), partners get move IDs set up like this:
//
// Move ID offset | Description | Goombario example
// ----------------+----------------------+-------------------
// 0 | No rank only | Headbonk
// 1 | Super rank only | Headbonk (2)
// 2 | Ultra rank only | Headbonk (3)
// 3 | Always unlocked | Tattle
// 4 | Unlocked after super | Charge
// 5 | Unlocked after ultra | Multibonk
battleStatus->submenuMoveCount = partner->actorBlueprint->level + 2;
// Offsets 0,1,2
battleStatus->submenuMoves[0] =
playerData->currentPartner * 6
+ (MOVE_HEADBONK1 - 6)
+ partner->actorBlueprint->level;
// Offsets 3,4,5
for (i = 1; i < battleStatus->submenuMoveCount; i++) {
battleStatus->submenuMoves[i] =
playerData->currentPartner * 6
+ (MOVE_TATTLE - 6)
+ (i - 1);
}
hasAnyBadgeMoves = FALSE;
for (i = 0; i < battleStatus->submenuMoveCount; i++){
MoveData* move = &gMoveTable[battleStatus->submenuMoves[i]];
fpCost = move->costFP;
if (fpCost != 0) {
fpCost -= player_team_is_ability_active(player, ABILITY_FLOWER_SAVER);
fpCost -= player_team_is_ability_active(player, ABILITY_FLOWER_FANATIC) * 2;
if (fpCost < 1) {
fpCost = 1;
}
}
battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER;
battleStatus->moveArgument = partner->actorBlueprint->level;
battleStatus->currentTargetListFlags = move->flags;
player_create_target_list(partner);
if (partner->targetListLength != 0){
hasAnyBadgeMoves = TRUE;
battleStatus->submenuStatus[i] = BATTLE_SUBMENU_STATUS_ENABLED;
}
if (partner->targetListLength == 0) {
battleStatus->submenuStatus[i] = BATTLE_SUBMENU_STATUS_NO_TARGETS_2;
}
if (playerData->curFP < fpCost) {
battleStatus->submenuStatus[i] = BATTLE_SUBMENU_STATUS_NOT_ENOUGH_FP;
}
if (gBattleStatus.flags2 & BS_FLAGS2_NO_TARGET_AVAILABLE) {
battleStatus->submenuStatus[i] = BATTLE_SUBMENU_STATUS_NO_TARGETS;
}
}
if (!hasAnyBadgeMoves) {
battleStatus->menuStatus[3] = -1;
} else {
battleStatus->menuStatus[3] = 1;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel EnemyDamageTarget
/* 1AB594 8027CCB4 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 1AB598 8027CCB8 AFB3001C */ sw $s3, 0x1C($sp)
/* 1AB59C 8027CCBC 0080982D */ daddu $s3, $a0, $zero
/* 1AB5A0 8027CCC0 AFBF0024 */ sw $ra, 0x24($sp)
/* 1AB5A4 8027CCC4 AFB40020 */ sw $s4, 0x20($sp)
/* 1AB5A8 8027CCC8 AFB20018 */ sw $s2, 0x18($sp)
/* 1AB5AC 8027CCCC AFB10014 */ sw $s1, 0x14($sp)
/* 1AB5B0 8027CCD0 AFB00010 */ sw $s0, 0x10($sp)
/* 1AB5B4 8027CCD4 8E70000C */ lw $s0, 0xC($s3)
/* 1AB5B8 8027CCD8 8E050000 */ lw $a1, 0x0($s0)
/* 1AB5BC 8027CCDC 0C0B1EAF */ jal evt_get_variable
/* 1AB5C0 8027CCE0 26100004 */ addiu $s0, $s0, 0x4
/* 1AB5C4 8027CCE4 0040202D */ daddu $a0, $v0, $zero
/* 1AB5C8 8027CCE8 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 1AB5CC 8027CCEC 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 1AB5D0 8027CCF0 2402FF81 */ addiu $v0, $zero, -0x7F
/* 1AB5D4 8027CCF4 14820002 */ bne $a0, $v0, .L8027CD00
/* 1AB5D8 8027CCF8 00000000 */ nop
/* 1AB5DC 8027CCFC 8E640148 */ lw $a0, 0x148($s3)
.L8027CD00:
/* 1AB5E0 8027CD00 0C09A75B */ jal get_actor
/* 1AB5E4 8027CD04 00000000 */ nop
/* 1AB5E8 8027CD08 8E140000 */ lw $s4, 0x0($s0)
/* 1AB5EC 8027CD0C 26100004 */ addiu $s0, $s0, 0x4
/* 1AB5F0 8027CD10 8E030000 */ lw $v1, 0x0($s0)
/* 1AB5F4 8027CD14 26100004 */ addiu $s0, $s0, 0x4
/* 1AB5F8 8027CD18 0260202D */ daddu $a0, $s3, $zero
/* 1AB5FC 8027CD1C 0040902D */ daddu $s2, $v0, $zero
/* 1AB600 8027CD20 AE230188 */ sw $v1, 0x188($s1)
/* 1AB604 8027CD24 8E030000 */ lw $v1, 0x0($s0)
/* 1AB608 8027CD28 26100004 */ addiu $s0, $s0, 0x4
/* 1AB60C 8027CD2C AE23018C */ sw $v1, 0x18C($s1)
/* 1AB610 8027CD30 8E030000 */ lw $v1, 0x0($s0)
/* 1AB614 8027CD34 26100004 */ addiu $s0, $s0, 0x4
/* 1AB618 8027CD38 AE230190 */ sw $v1, 0x190($s1)
/* 1AB61C 8027CD3C 8E050000 */ lw $a1, 0x0($s0)
/* 1AB620 8027CD40 0C0B1EAF */ jal evt_get_variable
/* 1AB624 8027CD44 26100004 */ addiu $s0, $s0, 0x4
/* 1AB628 8027CD48 A622017E */ sh $v0, 0x17E($s1)
/* 1AB62C 8027CD4C 8E050000 */ lw $a1, 0x0($s0)
/* 1AB630 8027CD50 30A20010 */ andi $v0, $a1, 0x10
/* 1AB634 8027CD54 10400004 */ beqz $v0, .L8027CD68
/* 1AB638 8027CD58 2403FFDF */ addiu $v1, $zero, -0x21
/* 1AB63C 8027CD5C 8E220000 */ lw $v0, 0x0($s1)
/* 1AB640 8027CD60 0809F364 */ j .L8027CD90
/* 1AB644 8027CD64 34420010 */ ori $v0, $v0, 0x10
.L8027CD68:
/* 1AB648 8027CD68 30A20020 */ andi $v0, $a1, 0x20
/* 1AB64C 8027CD6C 10400005 */ beqz $v0, .L8027CD84
/* 1AB650 8027CD70 2403FFEF */ addiu $v1, $zero, -0x11
/* 1AB654 8027CD74 8E220000 */ lw $v0, 0x0($s1)
/* 1AB658 8027CD78 00431024 */ and $v0, $v0, $v1
/* 1AB65C 8027CD7C 0809F365 */ j .L8027CD94
/* 1AB660 8027CD80 34420020 */ ori $v0, $v0, 0x20
.L8027CD84:
/* 1AB664 8027CD84 8E220000 */ lw $v0, 0x0($s1)
/* 1AB668 8027CD88 00431024 */ and $v0, $v0, $v1
/* 1AB66C 8027CD8C 2403FFDF */ addiu $v1, $zero, -0x21
.L8027CD90:
/* 1AB670 8027CD90 00431024 */ and $v0, $v0, $v1
.L8027CD94:
/* 1AB674 8027CD94 AE220000 */ sw $v0, 0x0($s1)
/* 1AB678 8027CD98 30A20040 */ andi $v0, $a1, 0x40
/* 1AB67C 8027CD9C 10400007 */ beqz $v0, .L8027CDBC
/* 1AB680 8027CDA0 2404FFBF */ addiu $a0, $zero, -0x41
/* 1AB684 8027CDA4 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1AB688 8027CDA8 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1AB68C 8027CDAC 8C620000 */ lw $v0, 0x0($v1)
/* 1AB690 8027CDB0 34420040 */ ori $v0, $v0, 0x40
/* 1AB694 8027CDB4 0809F374 */ j .L8027CDD0
/* 1AB698 8027CDB8 AC620000 */ sw $v0, 0x0($v1)
.L8027CDBC:
/* 1AB69C 8027CDBC 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1AB6A0 8027CDC0 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1AB6A4 8027CDC4 8C430000 */ lw $v1, 0x0($v0)
/* 1AB6A8 8027CDC8 00641824 */ and $v1, $v1, $a0
/* 1AB6AC 8027CDCC AC430000 */ sw $v1, 0x0($v0)
.L8027CDD0:
/* 1AB6B0 8027CDD0 30A20200 */ andi $v0, $a1, 0x200
/* 1AB6B4 8027CDD4 10400007 */ beqz $v0, .L8027CDF4
/* 1AB6B8 8027CDD8 2404FDFF */ addiu $a0, $zero, -0x201
/* 1AB6BC 8027CDDC 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1AB6C0 8027CDE0 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1AB6C4 8027CDE4 8C620000 */ lw $v0, 0x0($v1)
/* 1AB6C8 8027CDE8 34420200 */ ori $v0, $v0, 0x200
/* 1AB6CC 8027CDEC 0809F382 */ j .L8027CE08
/* 1AB6D0 8027CDF0 AC620000 */ sw $v0, 0x0($v1)
.L8027CDF4:
/* 1AB6D4 8027CDF4 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1AB6D8 8027CDF8 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1AB6DC 8027CDFC 8C430000 */ lw $v1, 0x0($v0)
/* 1AB6E0 8027CE00 00641824 */ and $v1, $v1, $a0
/* 1AB6E4 8027CE04 AC430000 */ sw $v1, 0x0($v0)
.L8027CE08:
/* 1AB6E8 8027CE08 30A20080 */ andi $v0, $a1, 0x80
/* 1AB6EC 8027CE0C 10400007 */ beqz $v0, .L8027CE2C
/* 1AB6F0 8027CE10 2404FF7F */ addiu $a0, $zero, -0x81
/* 1AB6F4 8027CE14 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1AB6F8 8027CE18 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1AB6FC 8027CE1C 8C620000 */ lw $v0, 0x0($v1)
/* 1AB700 8027CE20 34420080 */ ori $v0, $v0, 0x80
/* 1AB704 8027CE24 0809F390 */ j .L8027CE40
/* 1AB708 8027CE28 AC620000 */ sw $v0, 0x0($v1)
.L8027CE2C:
/* 1AB70C 8027CE2C 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1AB710 8027CE30 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1AB714 8027CE34 8C430000 */ lw $v1, 0x0($v0)
/* 1AB718 8027CE38 00641824 */ and $v1, $v1, $a0
/* 1AB71C 8027CE3C AC430000 */ sw $v1, 0x0($v0)
.L8027CE40:
/* 1AB720 8027CE40 96420428 */ lhu $v0, 0x428($s2)
/* 1AB724 8027CE44 92230193 */ lbu $v1, 0x193($s1)
/* 1AB728 8027CE48 A62201A0 */ sh $v0, 0x1A0($s1)
/* 1AB72C 8027CE4C 92420426 */ lbu $v0, 0x426($s2)
/* 1AB730 8027CE50 A2230194 */ sb $v1, 0x194($s1)
/* 1AB734 8027CE54 306300FF */ andi $v1, $v1, 0xFF
/* 1AB738 8027CE58 A22201A2 */ sb $v0, 0x1A2($s1)
/* 1AB73C 8027CE5C 240200FF */ addiu $v0, $zero, 0xFF
/* 1AB740 8027CE60 50620001 */ beql $v1, $v0, .L8027CE68
/* 1AB744 8027CE64 A2200194 */ sb $zero, 0x194($s1)
.L8027CE68:
/* 1AB748 8027CE68 8E220190 */ lw $v0, 0x190($s1)
/* 1AB74C 8027CE6C 0240202D */ daddu $a0, $s2, $zero
/* 1AB750 8027CE70 30420F00 */ andi $v0, $v0, 0xF00
/* 1AB754 8027CE74 00021203 */ sra $v0, $v0, 8
/* 1AB758 8027CE78 0C09DD0B */ jal calc_enemy_damage_target
/* 1AB75C 8027CE7C A2220195 */ sb $v0, 0x195($s1)
/* 1AB760 8027CE80 0440000B */ bltz $v0, .L8027CEB0
/* 1AB764 8027CE84 0260202D */ daddu $a0, $s3, $zero
/* 1AB768 8027CE88 0280282D */ daddu $a1, $s4, $zero
/* 1AB76C 8027CE8C 0C0B2026 */ jal evt_set_variable
/* 1AB770 8027CE90 0040302D */ daddu $a2, $v0, $zero
/* 1AB774 8027CE94 0C0B1069 */ jal does_script_exist_by_ref
/* 1AB778 8027CE98 0260202D */ daddu $a0, $s3, $zero
/* 1AB77C 8027CE9C 0040182D */ daddu $v1, $v0, $zero
/* 1AB780 8027CEA0 10600004 */ beqz $v1, .L8027CEB4
/* 1AB784 8027CEA4 240200FF */ addiu $v0, $zero, 0xFF
/* 1AB788 8027CEA8 0809F3AD */ j .L8027CEB4
/* 1AB78C 8027CEAC 24020002 */ addiu $v0, $zero, 0x2
.L8027CEB0:
/* 1AB790 8027CEB0 240200FF */ addiu $v0, $zero, 0xFF
.L8027CEB4:
/* 1AB794 8027CEB4 8FBF0024 */ lw $ra, 0x24($sp)
/* 1AB798 8027CEB8 8FB40020 */ lw $s4, 0x20($sp)
/* 1AB79C 8027CEBC 8FB3001C */ lw $s3, 0x1C($sp)
/* 1AB7A0 8027CEC0 8FB20018 */ lw $s2, 0x18($sp)
/* 1AB7A4 8027CEC4 8FB10014 */ lw $s1, 0x14($sp)
/* 1AB7A8 8027CEC8 8FB00010 */ lw $s0, 0x10($sp)
/* 1AB7AC 8027CECC 03E00008 */ jr $ra
/* 1AB7B0 8027CED0 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
ApiStatus EnemyDamageTarget(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
BattleStatus* battleStatus = &gBattleStatus;
s32 actorID = evt_get_variable(script, *args++);
Actor* actor;
s32 outVar;
s32 hitResult;
s32 battleStatusFlags1Temp;
s32 battleFlagsModifier;
if (actorID == ACTOR_SELF) {
actorID = script->owner1.enemyID;
}
actor = get_actor(actorID);
outVar = *args++;
battleStatus->currentAttackElement = *args++;
battleStatus->currentAttackEventSuppression = *args++;
battleStatus->currentAttackStatus = *args++;
battleStatus->currentAttackDamage = evt_get_variable(script, *args++);
battleFlagsModifier = *args++;
if (battleFlagsModifier & BS_FLAGS1_10) {
gBattleStatus.flags1 |= BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
} else if (battleFlagsModifier & BS_FLAGS1_SP_EVT_ACTIVE) {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
}
if (battleFlagsModifier & BS_FLAGS1_40) {
gBattleStatus.flags1 |= BS_FLAGS1_40;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_40;
}
if (battleFlagsModifier & BS_FLAGS1_200) {
gBattleStatus.flags1 |= BS_FLAGS1_200;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_200;
}
if (battleFlagsModifier & BS_FLAGS1_80) {
gBattleStatus.flags1 |= BS_FLAGS1_80;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_80;
}
battleStatus->currentTargetID = actor->targetActorID;
battleStatus->currentTargetPart = actor->targetPartIndex;
battleStatus->statusChance = battleStatus->currentAttackStatus & 0xFF;
if (battleStatus->statusChance == STATUS_KEY_NEVER) {
battleStatus->statusChance = 0;
}
battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8;
hitResult = calc_enemy_damage_target(actor);
if (hitResult < 0) {
return ApiStatus_FINISH;
}
evt_set_variable(script, outVar, hitResult);
if (!(does_script_exist_by_ref(script))) {
return ApiStatus_FINISH;
}
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel ice_pillar_appendGfx
/* 409F08 E011E578 27BDFF50 */ addiu $sp, $sp, -0xB0
/* 409F0C E011E57C 0080302D */ daddu $a2, $a0, $zero
/* 409F10 E011E580 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 409F14 E011E584 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 409F18 E011E588 27A40010 */ addiu $a0, $sp, 0x10
/* 409F1C E011E58C AFB500A4 */ sw $s5, 0xA4($sp)
/* 409F20 E011E590 3C150001 */ lui $s5, (0x11630 >> 16)
/* 409F24 E011E594 36B51630 */ ori $s5, $s5, (0x11630 & 0xFFFF)
/* 409F28 E011E598 AFB3009C */ sw $s3, 0x9C($sp)
/* 409F2C E011E59C 3C13800A */ lui $s3, %hi(gMainGfxPos)
/* 409F30 E011E5A0 2673A66C */ addiu $s3, $s3, %lo(gMainGfxPos)
/* 409F34 E011E5A4 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 409F38 E011E5A8 AFBF00AC */ sw $ra, 0xAC($sp)
/* 409F3C E011E5AC AFB600A8 */ sw $s6, 0xA8($sp)
/* 409F40 E011E5B0 AFB400A0 */ sw $s4, 0xA0($sp)
/* 409F44 E011E5B4 AFB20098 */ sw $s2, 0x98($sp)
/* 409F48 E011E5B8 AFB10094 */ sw $s1, 0x94($sp)
/* 409F4C E011E5BC AFB00090 */ sw $s0, 0x90($sp)
/* 409F50 E011E5C0 8E650000 */ lw $a1, 0x0($s3)
/* 409F54 E011E5C4 8CD2000C */ lw $s2, 0xC($a2)
/* 409F58 E011E5C8 00A0182D */ daddu $v1, $a1, $zero
/* 409F5C E011E5CC 9256001B */ lbu $s6, 0x1B($s2)
/* 409F60 E011E5D0 24A50008 */ addiu $a1, $a1, 0x8
/* 409F64 E011E5D4 AE650000 */ sw $a1, 0x0($s3)
/* 409F68 E011E5D8 AC620000 */ sw $v0, 0x0($v1)
/* 409F6C E011E5DC AC600004 */ sw $zero, 0x4($v1)
/* 409F70 E011E5E0 ACA70000 */ sw $a3, 0x0($a1)
/* 409F74 E011E5E4 8CC30010 */ lw $v1, 0x10($a2)
/* 409F78 E011E5E8 24A20008 */ addiu $v0, $a1, 0x8
/* 409F7C E011E5EC AE620000 */ sw $v0, 0x0($s3)
/* 409F80 E011E5F0 8C62001C */ lw $v0, 0x1C($v1)
/* 409F84 E011E5F4 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 409F88 E011E5F8 00431021 */ addu $v0, $v0, $v1
/* 409F8C E011E5FC 3C03800B */ lui $v1, %hi(gCameras)
/* 409F90 E011E600 24631D80 */ addiu $v1, $v1, %lo(gCameras)
/* 409F94 E011E604 ACA20004 */ sw $v0, 0x4($a1)
/* 409F98 E011E608 8E450004 */ lw $a1, 0x4($s2)
/* 409F9C E011E60C 8E460008 */ lw $a2, 0x8($s2)
/* 409FA0 E011E610 3C028007 */ lui $v0, %hi(gCurrentCameraID)
/* 409FA4 E011E614 8C427410 */ lw $v0, %lo(gCurrentCameraID)($v0)
/* 409FA8 E011E618 8E47000C */ lw $a3, 0xC($s2)
/* 409FAC E011E61C 00028080 */ sll $s0, $v0, 2
/* 409FB0 E011E620 02028021 */ addu $s0, $s0, $v0
/* 409FB4 E011E624 00108080 */ sll $s0, $s0, 2
/* 409FB8 E011E628 02028023 */ subu $s0, $s0, $v0
/* 409FBC E011E62C 001010C0 */ sll $v0, $s0, 3
/* 409FC0 E011E630 02028021 */ addu $s0, $s0, $v0
/* 409FC4 E011E634 001080C0 */ sll $s0, $s0, 3
/* 409FC8 E011E638 0C080108 */ jal shim_guTranslateF
/* 409FCC E011E63C 02038021 */ addu $s0, $s0, $v1
/* 409FD0 E011E640 27B10050 */ addiu $s1, $sp, 0x50
/* 409FD4 E011E644 8E450020 */ lw $a1, 0x20($s2)
/* 409FD8 E011E648 0220202D */ daddu $a0, $s1, $zero
/* 409FDC E011E64C 00A0302D */ daddu $a2, $a1, $zero
/* 409FE0 E011E650 0C080110 */ jal shim_guScaleF
/* 409FE4 E011E654 00A0382D */ daddu $a3, $a1, $zero
/* 409FE8 E011E658 0220202D */ daddu $a0, $s1, $zero
/* 409FEC E011E65C 27A50010 */ addiu $a1, $sp, 0x10
/* 409FF0 E011E660 0C080114 */ jal shim_guMtxCatF
/* 409FF4 E011E664 00A0302D */ daddu $a2, $a1, $zero
/* 409FF8 E011E668 27A40010 */ addiu $a0, $sp, 0x10
/* 409FFC E011E66C 3C118007 */ lui $s1, %hi(gMatrixListPos)
/* 40A000 E011E670 263141F0 */ addiu $s1, $s1, %lo(gMatrixListPos)
/* 40A004 E011E674 3C14800A */ lui $s4, %hi(gDisplayContext)
/* 40A008 E011E678 2694A674 */ addiu $s4, $s4, %lo(gDisplayContext)
/* 40A00C E011E67C 96250000 */ lhu $a1, 0x0($s1)
/* 40A010 E011E680 8E820000 */ lw $v0, 0x0($s4)
/* 40A014 E011E684 00052980 */ sll $a1, $a1, 6
/* 40A018 E011E688 00B52821 */ addu $a1, $a1, $s5
/* 40A01C E011E68C 0C080118 */ jal shim_guMtxF2L
/* 40A020 E011E690 00452821 */ addu $a1, $v0, $a1
/* 40A024 E011E694 3C03DA38 */ lui $v1, (0xDA380002 >> 16)
/* 40A028 E011E698 34630002 */ ori $v1, $v1, (0xDA380002 & 0xFFFF)
/* 40A02C E011E69C 3C06DA38 */ lui $a2, (0xDA380001 >> 16)
/* 40A030 E011E6A0 34C60001 */ ori $a2, $a2, (0xDA380001 & 0xFFFF)
/* 40A034 E011E6A4 3C07DE00 */ lui $a3, (0xDE000000 >> 16)
/* 40A038 E011E6A8 8E640000 */ lw $a0, 0x0($s3)
/* 40A03C E011E6AC 96220000 */ lhu $v0, 0x0($s1)
/* 40A040 E011E6B0 0080282D */ daddu $a1, $a0, $zero
/* 40A044 E011E6B4 24840008 */ addiu $a0, $a0, 0x8
/* 40A048 E011E6B8 AE640000 */ sw $a0, 0x0($s3)
/* 40A04C E011E6BC ACA30000 */ sw $v1, 0x0($a1)
/* 40A050 E011E6C0 24430001 */ addiu $v1, $v0, 0x1
/* 40A054 E011E6C4 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 40A058 E011E6C8 00021180 */ sll $v0, $v0, 6
/* 40A05C E011E6CC A6230000 */ sh $v1, 0x0($s1)
/* 40A060 E011E6D0 8E830000 */ lw $v1, 0x0($s4)
/* 40A064 E011E6D4 00551021 */ addu $v0, $v0, $s5
/* 40A068 E011E6D8 00621821 */ addu $v1, $v1, $v0
/* 40A06C E011E6DC 24820008 */ addiu $v0, $a0, 0x8
/* 40A070 E011E6E0 ACA30004 */ sw $v1, 0x4($a1)
/* 40A074 E011E6E4 AE620000 */ sw $v0, 0x0($s3)
/* 40A078 E011E6E8 24820010 */ addiu $v0, $a0, 0x10
/* 40A07C E011E6EC AC860000 */ sw $a2, 0x0($a0)
/* 40A080 E011E6F0 AE620000 */ sw $v0, 0x0($s3)
/* 40A084 E011E6F4 8E030204 */ lw $v1, 0x204($s0)
/* 40A088 E011E6F8 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 40A08C E011E6FC AC820008 */ sw $v0, 0x8($a0)
/* 40A090 E011E700 AC830004 */ sw $v1, 0x4($a0)
/* 40A094 E011E704 92420018 */ lbu $v0, 0x18($s2)
/* 40A098 E011E708 92450019 */ lbu $a1, 0x19($s2)
/* 40A09C E011E70C 9246001A */ lbu $a2, 0x1A($s2)
/* 40A0A0 E011E710 24830018 */ addiu $v1, $a0, 0x18
/* 40A0A4 E011E714 AE630000 */ sw $v1, 0x0($s3)
/* 40A0A8 E011E718 3C03FB00 */ lui $v1, (0xFB000000 >> 16)
/* 40A0AC E011E71C AC830010 */ sw $v1, 0x10($a0)
/* 40A0B0 E011E720 00021600 */ sll $v0, $v0, 24
/* 40A0B4 E011E724 00052C00 */ sll $a1, $a1, 16
/* 40A0B8 E011E728 00451025 */ or $v0, $v0, $a1
/* 40A0BC E011E72C 00063200 */ sll $a2, $a2, 8
/* 40A0C0 E011E730 00461025 */ or $v0, $v0, $a2
/* 40A0C4 E011E734 00561025 */ or $v0, $v0, $s6
/* 40A0C8 E011E738 AC82000C */ sw $v0, 0xC($a0)
/* 40A0CC E011E73C 9242001C */ lbu $v0, 0x1C($s2)
/* 40A0D0 E011E740 9245001D */ lbu $a1, 0x1D($s2)
/* 40A0D4 E011E744 9246001E */ lbu $a2, 0x1E($s2)
/* 40A0D8 E011E748 9248001F */ lbu $t0, 0x1F($s2)
/* 40A0DC E011E74C 24830020 */ addiu $v1, $a0, 0x20
/* 40A0E0 E011E750 AE630000 */ sw $v1, 0x0($s3)
/* 40A0E4 E011E754 AC870018 */ sw $a3, 0x18($a0)
/* 40A0E8 E011E758 00021600 */ sll $v0, $v0, 24
/* 40A0EC E011E75C 00052C00 */ sll $a1, $a1, 16
/* 40A0F0 E011E760 00451025 */ or $v0, $v0, $a1
/* 40A0F4 E011E764 00063200 */ sll $a2, $a2, 8
/* 40A0F8 E011E768 00461025 */ or $v0, $v0, $a2
/* 40A0FC E011E76C 00481025 */ or $v0, $v0, $t0
/* 40A100 E011E770 AC820014 */ sw $v0, 0x14($a0)
/* 40A104 E011E774 3C03E012 */ lui $v1, (0xE0120000 >> 16)
/* 40A108 E011E778 8C63E800 */ lw $v1, -0x1800($v1)
/* 40A10C E011E77C 24820028 */ addiu $v0, $a0, 0x28
/* 40A110 E011E780 AE620000 */ sw $v0, 0x0($s3)
/* 40A114 E011E784 AC870020 */ sw $a3, 0x20($a0)
/* 40A118 E011E788 AC83001C */ sw $v1, 0x1C($a0)
/* 40A11C E011E78C 82420024 */ lb $v0, 0x24($s2)
/* 40A120 E011E790 3C03D838 */ lui $v1, (0xD8380002 >> 16)
/* 40A124 E011E794 00021080 */ sll $v0, $v0, 2
/* 40A128 E011E798 3C01E012 */ lui $at, (0xE0120000 >> 16)
/* 40A12C E011E79C 00220821 */ addu $at, $at, $v0
/* 40A130 E011E7A0 8C22E7F0 */ lw $v0, -0x1810($at)
/* 40A134 E011E7A4 34630002 */ ori $v1, $v1, (0xD8380002 & 0xFFFF)
/* 40A138 E011E7A8 AC820024 */ sw $v0, 0x24($a0)
/* 40A13C E011E7AC 24820030 */ addiu $v0, $a0, 0x30
/* 40A140 E011E7B0 AE620000 */ sw $v0, 0x0($s3)
/* 40A144 E011E7B4 24020040 */ addiu $v0, $zero, 0x40
/* 40A148 E011E7B8 AC830028 */ sw $v1, 0x28($a0)
/* 40A14C E011E7BC AC82002C */ sw $v0, 0x2C($a0)
/* 40A150 E011E7C0 8FBF00AC */ lw $ra, 0xAC($sp)
/* 40A154 E011E7C4 8FB600A8 */ lw $s6, 0xA8($sp)
/* 40A158 E011E7C8 8FB500A4 */ lw $s5, 0xA4($sp)
/* 40A15C E011E7CC 8FB400A0 */ lw $s4, 0xA0($sp)
/* 40A160 E011E7D0 8FB3009C */ lw $s3, 0x9C($sp)
/* 40A164 E011E7D4 8FB20098 */ lw $s2, 0x98($sp)
/* 40A168 E011E7D8 8FB10094 */ lw $s1, 0x94($sp)
/* 40A16C E011E7DC 8FB00090 */ lw $s0, 0x90($sp)
/* 40A170 E011E7E0 03E00008 */ jr $ra
/* 40A174 E011E7E4 27BD00B0 */ addiu $sp, $sp, 0xB0
/* 40A178 E011E7E8 00000000 */ nop
/* 40A17C E011E7EC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void ice_pillar_appendGfx(void* effect) {
IcePillarFXData* data = ((EffectInstance*)effect)->data.icePillar;
s32 alpha = data->prim.a;
Matrix4f sp10, sp50;
Camera* camera;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
camera = &gCameras[gCurrentCameraID];
shim_guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp50, data->scale, data->scale, data->scale);
shim_guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->prim.r, data->prim.g, data->prim.b, alpha);
gDPSetEnvColor(gMainGfxPos++, data->env.r, data->env.g, data->env.b, data->env.a);
gSPDisplayList(gMainGfxPos++, D_E011E800[0]);
gSPDisplayList(gMainGfxPos++, D_E011E7F0[data->unk_24]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel flower_trail_main
/* 32DF14 E0012204 27BDFF90 */ addiu $sp, $sp, -0x70
/* 32DF18 E0012208 F7BE0068 */ sdc1 $f30, 0x68($sp)
/* 32DF1C E001220C 4485F000 */ mtc1 $a1, $f30
/* 32DF20 E0012210 AFB40038 */ sw $s4, 0x38($sp)
/* 32DF24 E0012214 0080A02D */ daddu $s4, $a0, $zero
/* 32DF28 E0012218 F7BA0058 */ sdc1 $f26, 0x58($sp)
/* 32DF2C E001221C C7BA0080 */ lwc1 $f26, 0x80($sp)
/* 32DF30 E0012220 27A40010 */ addiu $a0, $sp, 0x10
/* 32DF34 E0012224 F7BC0060 */ sdc1 $f28, 0x60($sp)
/* 32DF38 E0012228 C7BC0084 */ lwc1 $f28, 0x84($sp)
/* 32DF3C E001222C 3C02E001 */ lui $v0, %hi(flower_trail_init)
/* 32DF40 E0012230 24422440 */ addiu $v0, $v0, %lo(flower_trail_init)
/* 32DF44 E0012234 AFA20018 */ sw $v0, 0x18($sp)
/* 32DF48 E0012238 3C02E001 */ lui $v0, %hi(flower_trail_update)
/* 32DF4C E001223C 24422448 */ addiu $v0, $v0, %lo(flower_trail_update)
/* 32DF50 E0012240 AFA2001C */ sw $v0, 0x1C($sp)
/* 32DF54 E0012244 3C02E001 */ lui $v0, %hi(flower_trail_render)
/* 32DF58 E0012248 24422504 */ addiu $v0, $v0, %lo(flower_trail_render)
/* 32DF5C E001224C AFA20020 */ sw $v0, 0x20($sp)
/* 32DF60 E0012250 24020009 */ addiu $v0, $zero, 0x9
/* 32DF64 E0012254 AFBF003C */ sw $ra, 0x3C($sp)
/* 32DF68 E0012258 AFB30034 */ sw $s3, 0x34($sp)
/* 32DF6C E001225C AFB20030 */ sw $s2, 0x30($sp)
/* 32DF70 E0012260 AFB1002C */ sw $s1, 0x2C($sp)
/* 32DF74 E0012264 AFB00028 */ sw $s0, 0x28($sp)
/* 32DF78 E0012268 F7B80050 */ sdc1 $f24, 0x50($sp)
/* 32DF7C E001226C F7B60048 */ sdc1 $f22, 0x48($sp)
/* 32DF80 E0012270 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 32DF84 E0012274 AFA60078 */ sw $a2, 0x78($sp)
/* 32DF88 E0012278 AFA7007C */ sw $a3, 0x7C($sp)
/* 32DF8C E001227C AFA00010 */ sw $zero, 0x10($sp)
/* 32DF90 E0012280 AFA00024 */ sw $zero, 0x24($sp)
/* 32DF94 E0012284 0C080124 */ jal shim_create_effect_instance
/* 32DF98 E0012288 AFA20014 */ sw $v0, 0x14($sp)
/* 32DF9C E001228C 24040098 */ addiu $a0, $zero, 0x98
/* 32DFA0 E0012290 24130001 */ addiu $s3, $zero, 0x1
/* 32DFA4 E0012294 0040802D */ daddu $s0, $v0, $zero
/* 32DFA8 E0012298 0C08012C */ jal shim_general_heap_malloc
/* 32DFAC E001229C AE130008 */ sw $s3, 0x8($s0)
/* 32DFB0 E00122A0 0040882D */ daddu $s1, $v0, $zero
/* 32DFB4 E00122A4 16200003 */ bnez $s1, .LE00122B4
/* 32DFB8 E00122A8 AE11000C */ sw $s1, 0xC($s0)
.LE00122AC:
/* 32DFBC E00122AC 080048AB */ j .LE00122AC
/* 32DFC0 E00122B0 00000000 */ nop
.LE00122B4:
/* 32DFC4 E00122B4 0220202D */ daddu $a0, $s1, $zero
/* 32DFC8 E00122B8 00132880 */ sll $a1, $s3, 2
/* 32DFCC E00122BC 00B32821 */ addu $a1, $a1, $s3
/* 32DFD0 E00122C0 00052880 */ sll $a1, $a1, 2
/* 32DFD4 E00122C4 00B32823 */ subu $a1, $a1, $s3
/* 32DFD8 E00122C8 0C080130 */ jal shim_mem_clear
/* 32DFDC E00122CC 000528C0 */ sll $a1, $a1, 3
/* 32DFE0 E00122D0 0000902D */ daddu $s2, $zero, $zero
/* 32DFE4 E00122D4 0253102A */ slt $v0, $s2, $s3
/* 32DFE8 E00122D8 1040004B */ beqz $v0, .LE0012408
/* 32DFEC E00122DC 26300094 */ addiu $s0, $s1, 0x94
/* 32DFF0 E00122E0 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 32DFF4 E00122E4 4481B000 */ mtc1 $at, $f22
/* 32DFF8 E00122E8 4480C000 */ mtc1 $zero, $f24
.LE00122EC:
/* 32DFFC E00122EC 24020001 */ addiu $v0, $zero, 0x1
/* 32E000 E00122F0 AE220000 */ sw $v0, 0x0($s1)
/* 32E004 E00122F4 A614FF70 */ sh $s4, -0x90($s0)
/* 32E008 E00122F8 AE00FFE8 */ sw $zero, -0x18($s0)
/* 32E00C E00122FC E61EFF78 */ swc1 $f30, -0x88($s0)
/* 32E010 E0012300 C7A60078 */ lwc1 $f6, 0x78($sp)
/* 32E014 E0012304 3C0140AC */ lui $at, (0x40ACCCCD >> 16)
/* 32E018 E0012308 3421CCCD */ ori $at, $at, (0x40ACCCCD & 0xFFFF)
/* 32E01C E001230C 44810000 */ mtc1 $at, $f0
/* 32E020 E0012310 240200FF */ addiu $v0, $zero, 0xFF
/* 32E024 E0012314 E606FF7C */ swc1 $f6, -0x84($s0)
/* 32E028 E0012318 C7A6007C */ lwc1 $f6, 0x7C($sp)
/* 32E02C E001231C 4618E032 */ c.eq.s $f28, $f24
/* 32E030 E0012320 E616FF84 */ swc1 $f22, -0x7C($s0)
/* 32E034 E0012324 E616FF88 */ swc1 $f22, -0x78($s0)
/* 32E038 E0012328 E616FF8C */ swc1 $f22, -0x74($s0)
/* 32E03C E001232C A202FF74 */ sb $v0, -0x8C($s0)
/* 32E040 E0012330 E616FFE4 */ swc1 $f22, -0x1C($s0)
/* 32E044 E0012334 E600FFE0 */ swc1 $f0, -0x20($s0)
/* 32E048 E0012338 45010005 */ bc1t .LE0012350
/* 32E04C E001233C E606FF80 */ swc1 $f6, -0x80($s0)
/* 32E050 E0012340 3C01C120 */ lui $at, (0xC1200000 >> 16)
/* 32E054 E0012344 44810000 */ mtc1 $at, $f0
/* 32E058 E0012348 080048D8 */ j .LE0012360
/* 32E05C E001234C E600FFDC */ swc1 $f0, -0x24($s0)
.LE0012350:
/* 32E060 E0012350 3C014120 */ lui $at, (0x41200000 >> 16)
/* 32E064 E0012354 44810000 */ mtc1 $at, $f0
/* 32E068 E0012358 00000000 */ nop
/* 32E06C E001235C E600FFDC */ swc1 $f0, -0x24($s0)
.LE0012360:
/* 32E070 E0012360 24040064 */ addiu $a0, $zero, 0x64
/* 32E074 E0012364 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 32E078 E0012368 44810000 */ mtc1 $at, $f0
/* 32E07C E001236C 3C01BD8F */ lui $at, (0xBD8F5C29 >> 16)
/* 32E080 E0012370 34215C29 */ ori $at, $at, (0xBD8F5C29 & 0xFFFF)
/* 32E084 E0012374 44811000 */ mtc1 $at, $f2
/* 32E088 E0012378 3C013B44 */ lui $at, (0x3B449BA6 >> 16)
/* 32E08C E001237C 34219BA6 */ ori $at, $at, (0x3B449BA6 & 0xFFFF)
/* 32E090 E0012380 44812000 */ mtc1 $at, $f4
/* 32E094 E0012384 2402000F */ addiu $v0, $zero, 0xF
/* 32E098 E0012388 AE00FFF8 */ sw $zero, -0x8($s0)
/* 32E09C E001238C A602FF72 */ sh $v0, -0x8E($s0)
/* 32E0A0 E0012390 E61AFF94 */ swc1 $f26, -0x6C($s0)
/* 32E0A4 E0012394 AE00FF90 */ sw $zero, -0x70($s0)
/* 32E0A8 E0012398 AE00FF98 */ sw $zero, -0x68($s0)
/* 32E0AC E001239C E600FFEC */ swc1 $f0, -0x14($s0)
/* 32E0B0 E00123A0 E602FFF0 */ swc1 $f2, -0x10($s0)
/* 32E0B4 E00123A4 0C080138 */ jal shim_rand_int
/* 32E0B8 E00123A8 E604FFF4 */ swc1 $f4, -0xC($s0)
/* 32E0BC E00123AC 00021103 */ sra $v0, $v0, 4
/* 32E0C0 E00123B0 30420001 */ andi $v0, $v0, 0x1
/* 32E0C4 E00123B4 4618E032 */ c.eq.s $f28, $f24
/* 32E0C8 E00123B8 3C0142B4 */ lui $at, (0x42B40000 >> 16)
/* 32E0CC E00123BC 44810000 */ mtc1 $at, $f0
/* 32E0D0 E00123C0 45010003 */ bc1t .LE00123D0
/* 32E0D4 E00123C4 A202FF75 */ sb $v0, -0x8B($s0)
/* 32E0D8 E00123C8 3C01C2B4 */ lui $at, (0xC2B40000 >> 16)
/* 32E0DC E00123CC 44810000 */ mtc1 $at, $f0
.LE00123D0:
/* 32E0E0 E00123D0 0C08013C */ jal shim_clamp_angle
/* 32E0E4 E00123D4 4600D300 */ add.s $f12, $f26, $f0
/* 32E0E8 E00123D8 46000506 */ mov.s $f20, $f0
/* 32E0EC E00123DC 0C080140 */ jal shim_sin_deg
/* 32E0F0 E00123E0 4600A306 */ mov.s $f12, $f20
/* 32E0F4 E00123E4 4600A306 */ mov.s $f12, $f20
/* 32E0F8 E00123E8 0C080144 */ jal shim_cos_deg
/* 32E0FC E00123EC E600FFFC */ swc1 $f0, -0x4($s0)
/* 32E100 E00123F0 26520001 */ addiu $s2, $s2, 0x1
/* 32E104 E00123F4 E6000000 */ swc1 $f0, 0x0($s0)
/* 32E108 E00123F8 26100098 */ addiu $s0, $s0, 0x98
/* 32E10C E00123FC 0253102A */ slt $v0, $s2, $s3
/* 32E110 E0012400 1440FFBA */ bnez $v0, .LE00122EC
/* 32E114 E0012404 26310098 */ addiu $s1, $s1, 0x98
.LE0012408:
/* 32E118 E0012408 8FBF003C */ lw $ra, 0x3C($sp)
/* 32E11C E001240C 8FB40038 */ lw $s4, 0x38($sp)
/* 32E120 E0012410 8FB30034 */ lw $s3, 0x34($sp)
/* 32E124 E0012414 8FB20030 */ lw $s2, 0x30($sp)
/* 32E128 E0012418 8FB1002C */ lw $s1, 0x2C($sp)
/* 32E12C E001241C 8FB00028 */ lw $s0, 0x28($sp)
/* 32E130 E0012420 D7BE0068 */ ldc1 $f30, 0x68($sp)
/* 32E134 E0012424 D7BC0060 */ ldc1 $f28, 0x60($sp)
/* 32E138 E0012428 D7BA0058 */ ldc1 $f26, 0x58($sp)
/* 32E13C E001242C D7B80050 */ ldc1 $f24, 0x50($sp)
/* 32E140 E0012430 D7B60048 */ ldc1 $f22, 0x48($sp)
/* 32E144 E0012434 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 32E148 E0012438 03E00008 */ jr $ra
/* 32E14C E001243C 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void flower_trail_main(s32 triggeredByNpc, f32 posX, f32 posY, f32 posZ, f32 angle, f32 direction) {
EffectBlueprint bp;
EffectInstance* effect;
FlowerFXData* part;
s32 numParts = 1;
f32 partAngle;
f32 angleOffset;
s32 i;
bp.init = flower_trail_init;
bp.update = flower_trail_update;
bp.renderWorld = flower_trail_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_FLOWER_TRAIL;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
part = effect->data.flowerTrail = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.flowerTrail != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
for (i = 0; i < numParts; i++, part++) {
part->alive = TRUE;
part->triggeredByNpc = triggeredByNpc;
part->unk_7C = 0.0f;
part->pos.x = posX;
part->pos.y = posY;
part->pos.z = posZ;
part->scale.x = 1.0f;
part->scale.y = 1.0f;
part->scale.z = 1.0f;
part->primAlpha = 255;
part->visibilityAmt = 1.0f;
part->velocityScaleB = 5.4f;
if (direction != 0.0f) {
part->velocityScaleA = -10.0f;
} else {
part->velocityScaleA = 10.0f;
}
part->integrator[0] = 0.5f;
part->integrator[1] = -0.07f;
part->integrator[2] = 0.003f;
part->integrator[3] = 0;
part->timeLeft = 15;
part->rot.y = angle;
part->rot.x = 0.0f;
part->rot.z = 0.0f;
part->useAltColor = (shim_rand_int(100) >> 4) & 1;
if (direction != 0.0f) {
angleOffset = -90.0f;
partAngle = shim_clamp_angle(angle + angleOffset);
} else {
angleOffset = 90.0f;
partAngle = shim_clamp_angle(angle + angleOffset);
}
part->velocity.x = shim_sin_deg(partAngle);
part->velocity.z = shim_cos_deg(partAngle);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel nuScCreateScheduler
/* 39DB0 8005E9B0 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 39DB4 8005E9B4 AFB40028 */ sw $s4, 0x28($sp)
/* 39DB8 8005E9B8 0080A02D */ daddu $s4, $a0, $zero
/* 39DBC 8005E9BC AFB30024 */ sw $s3, 0x24($sp)
/* 39DC0 8005E9C0 00A0982D */ daddu $s3, $a1, $zero
/* 39DC4 8005E9C4 3C04800E */ lui $a0, %hi(D_800DAAAC)
/* 39DC8 8005E9C8 2484AAAC */ addiu $a0, $a0, %lo(D_800DAAAC)
/* 39DCC 8005E9CC 24020001 */ addiu $v0, $zero, 0x1
/* 39DD0 8005E9D0 24030002 */ addiu $v1, $zero, 0x2
/* 39DD4 8005E9D4 AFBF002C */ sw $ra, 0x2C($sp)
/* 39DD8 8005E9D8 AFB20020 */ sw $s2, 0x20($sp)
/* 39DDC 8005E9DC AFB1001C */ sw $s1, 0x1C($sp)
/* 39DE0 8005E9E0 AFB00018 */ sw $s0, 0x18($sp)
/* 39DE4 8005E9E4 A482F994 */ sh $v0, -0x66C($a0)
/* 39DE8 8005E9E8 326200FF */ andi $v0, $s3, 0xFF
/* 39DEC 8005E9EC AC82000C */ sw $v0, 0xC($a0)
/* 39DF0 8005E9F0 A0830011 */ sb $v1, 0x11($a0)
/* 39DF4 8005E9F4 3C028000 */ lui $v0, %hi(osTvType)
/* 39DF8 8005E9F8 8C420300 */ lw $v0, %lo(osTvType)($v0)
/* 39DFC 8005E9FC A483F996 */ sh $v1, -0x66A($a0)
/* 39E00 8005EA00 2483F994 */ addiu $v1, $a0, -0x66C
/* 39E04 8005EA04 AC800000 */ sw $zero, 0x0($a0)
/* 39E08 8005EA08 AC800004 */ sw $zero, 0x4($a0)
/* 39E0C 8005EA0C AC800008 */ sw $zero, 0x8($a0)
/* 39E10 8005EA10 14400004 */ bnez $v0, .L8005EA24
/* 39E14 8005EA14 AC80FFFC */ sw $zero, -0x4($a0)
/* 39E18 8005EA18 24020032 */ addiu $v0, $zero, 0x32
/* 39E1C 8005EA1C 08017A8B */ j .L8005EA2C
/* 39E20 8005EA20 A062067C */ sb $v0, 0x67C($v1)
.L8005EA24:
/* 39E24 8005EA24 2402003C */ addiu $v0, $zero, 0x3C
/* 39E28 8005EA28 A0820010 */ sb $v0, 0x10($a0)
.L8005EA2C:
/* 39E2C 8005EA2C 3C10800E */ lui $s0, %hi(D_800DA4B4)
/* 39E30 8005EA30 2610A4B4 */ addiu $s0, $s0, %lo(D_800DA4B4)
/* 39E34 8005EA34 0200202D */ daddu $a0, $s0, $zero
/* 39E38 8005EA38 26050018 */ addiu $a1, $s0, 0x18
/* 39E3C 8005EA3C 3C01800A */ lui $at, %hi(nuScPreNMIFlag)
/* 39E40 8005EA40 A020A5B0 */ sb $zero, %lo(nuScPreNMIFlag)($at)
/* 39E44 8005EA44 0C019560 */ jal osCreateMesgQueue
/* 39E48 8005EA48 24060008 */ addiu $a2, $zero, 0x8
/* 39E4C 8005EA4C 26120038 */ addiu $s2, $s0, 0x38
/* 39E50 8005EA50 0240202D */ daddu $a0, $s2, $zero
/* 39E54 8005EA54 26050050 */ addiu $a1, $s0, 0x50
/* 39E58 8005EA58 0C019560 */ jal osCreateMesgQueue
/* 39E5C 8005EA5C 24060008 */ addiu $a2, $zero, 0x8
/* 39E60 8005EA60 26110070 */ addiu $s1, $s0, 0x70
/* 39E64 8005EA64 0220202D */ daddu $a0, $s1, $zero
/* 39E68 8005EA68 26050088 */ addiu $a1, $s0, 0x88
/* 39E6C 8005EA6C 0C019560 */ jal osCreateMesgQueue
/* 39E70 8005EA70 24060008 */ addiu $a2, $zero, 0x8
/* 39E74 8005EA74 2604FFC8 */ addiu $a0, $s0, -0x38
/* 39E78 8005EA78 2605FFE0 */ addiu $a1, $s0, -0x20
/* 39E7C 8005EA7C 0C019560 */ jal osCreateMesgQueue
/* 39E80 8005EA80 24060008 */ addiu $a2, $zero, 0x8
/* 39E84 8005EA84 2604FF90 */ addiu $a0, $s0, -0x70
/* 39E88 8005EA88 2605FFA8 */ addiu $a1, $s0, -0x58
/* 39E8C 8005EA8C 0C019560 */ jal osCreateMesgQueue
/* 39E90 8005EA90 24060008 */ addiu $a2, $zero, 0x8
/* 39E94 8005EA94 260400A8 */ addiu $a0, $s0, 0xA8
/* 39E98 8005EA98 260500C0 */ addiu $a1, $s0, 0xC0
/* 39E9C 8005EA9C 0C019560 */ jal osCreateMesgQueue
/* 39EA0 8005EAA0 24060008 */ addiu $a2, $zero, 0x8
/* 39EA4 8005EAA4 0C019A9C */ jal osCreateViManager
/* 39EA8 8005EAA8 240400FE */ addiu $a0, $zero, 0xFE
/* 39EAC 8005EAAC 328200FF */ andi $v0, $s4, 0xFF
/* 39EB0 8005EAB0 00022080 */ sll $a0, $v0, 2
/* 39EB4 8005EAB4 00822021 */ addu $a0, $a0, $v0
/* 39EB8 8005EAB8 00042100 */ sll $a0, $a0, 4
/* 39EBC 8005EABC 3C028009 */ lui $v0, %hi(osViModeTable)
/* 39EC0 8005EAC0 244246A0 */ addiu $v0, $v0, %lo(osViModeTable)
/* 39EC4 8005EAC4 0C019B84 */ jal osViSetMode
/* 39EC8 8005EAC8 00822021 */ addu $a0, $a0, $v0
/* 39ECC 8005EACC 0C019CE0 */ jal osViBlack
/* 39ED0 8005EAD0 24040001 */ addiu $a0, $zero, 0x1
/* 39ED4 8005EAD4 0200202D */ daddu $a0, $s0, $zero
/* 39ED8 8005EAD8 2405029A */ addiu $a1, $zero, 0x29A
/* 39EDC 8005EADC 0C019B6C */ jal osViSetEvent
/* 39EE0 8005EAE0 326600FF */ andi $a2, $s3, 0xFF
/* 39EE4 8005EAE4 24040004 */ addiu $a0, $zero, 0x4
/* 39EE8 8005EAE8 0240282D */ daddu $a1, $s2, $zero
/* 39EEC 8005EAEC 0C019654 */ jal osSetEventMesg
/* 39EF0 8005EAF0 2406029B */ addiu $a2, $zero, 0x29B
/* 39EF4 8005EAF4 24040009 */ addiu $a0, $zero, 0x9
/* 39EF8 8005EAF8 0220282D */ daddu $a1, $s1, $zero
/* 39EFC 8005EAFC 0C019654 */ jal osSetEventMesg
/* 39F00 8005EB00 2406029C */ addiu $a2, $zero, 0x29C
/* 39F04 8005EB04 2404000E */ addiu $a0, $zero, 0xE
/* 39F08 8005EB08 0200282D */ daddu $a1, $s0, $zero
/* 39F0C 8005EB0C 0C019654 */ jal osSetEventMesg
/* 39F10 8005EB10 2406029D */ addiu $a2, $zero, 0x29D
/* 39F14 8005EB14 261200E4 */ addiu $s2, $s0, 0xE4
/* 39F18 8005EB18 0240202D */ daddu $a0, $s2, $zero
/* 39F1C 8005EB1C 24050013 */ addiu $a1, $zero, 0x13
/* 39F20 8005EB20 3C068006 */ lui $a2, %hi(nuScEventHandler)
/* 39F24 8005EB24 24C6EFA8 */ addiu $a2, $a2, %lo(nuScEventHandler)
/* 39F28 8005EB28 2611FF8C */ addiu $s1, $s0, -0x74
/* 39F2C 8005EB2C 0220382D */ daddu $a3, $s1, $zero
/* 39F30 8005EB30 3C02800B */ lui $v0, %hi(nuScAudioStack)
/* 39F34 8005EB34 244285D0 */ addiu $v0, $v0, %lo(nuScAudioStack)
/* 39F38 8005EB38 AFA20010 */ sw $v0, 0x10($sp)
/* 39F3C 8005EB3C 24020078 */ addiu $v0, $zero, 0x78
/* 39F40 8005EB40 0C019798 */ jal osCreateThread
/* 39F44 8005EB44 AFA20014 */ sw $v0, 0x14($sp)
/* 39F48 8005EB48 0C019808 */ jal osStartThread
/* 39F4C 8005EB4C 0240202D */ daddu $a0, $s2, $zero
/* 39F50 8005EB50 26120294 */ addiu $s2, $s0, 0x294
/* 39F54 8005EB54 0240202D */ daddu $a0, $s2, $zero
/* 39F58 8005EB58 24050012 */ addiu $a1, $zero, 0x12
/* 39F5C 8005EB5C 3C068006 */ lui $a2, %hi(nuScExecuteAudio)
/* 39F60 8005EB60 24C6EBE0 */ addiu $a2, $a2, %lo(nuScExecuteAudio)
/* 39F64 8005EB64 0220382D */ daddu $a3, $s1, $zero
/* 39F68 8005EB68 3C02800B */ lui $v0, %hi(nuScGraphicsStack)
/* 39F6C 8005EB6C 2442A5D0 */ addiu $v0, $v0, %lo(nuScGraphicsStack)
/* 39F70 8005EB70 AFA20010 */ sw $v0, 0x10($sp)
/* 39F74 8005EB74 2402006E */ addiu $v0, $zero, 0x6E
/* 39F78 8005EB78 0C019798 */ jal osCreateThread
/* 39F7C 8005EB7C AFA20014 */ sw $v0, 0x14($sp)
/* 39F80 8005EB80 0C019808 */ jal osStartThread
/* 39F84 8005EB84 0240202D */ daddu $a0, $s2, $zero
/* 39F88 8005EB88 26100444 */ addiu $s0, $s0, 0x444
/* 39F8C 8005EB8C 0200202D */ daddu $a0, $s0, $zero
/* 39F90 8005EB90 24050011 */ addiu $a1, $zero, 0x11
/* 39F94 8005EB94 3C068006 */ lui $a2, %hi(nuScExecuteGraphics)
/* 39F98 8005EB98 24C6ED14 */ addiu $a2, $a2, %lo(nuScExecuteGraphics)
/* 39F9C 8005EB9C 0220382D */ daddu $a3, $s1, $zero
/* 39FA0 8005EBA0 3C02800B */ lui $v0, %hi(D_800AC5D0)
/* 39FA4 8005EBA4 2442C5D0 */ addiu $v0, $v0, %lo(D_800AC5D0)
/* 39FA8 8005EBA8 AFA20010 */ sw $v0, 0x10($sp)
/* 39FAC 8005EBAC 24020064 */ addiu $v0, $zero, 0x64
/* 39FB0 8005EBB0 0C019798 */ jal osCreateThread
/* 39FB4 8005EBB4 AFA20014 */ sw $v0, 0x14($sp)
/* 39FB8 8005EBB8 0C019808 */ jal osStartThread
/* 39FBC 8005EBBC 0200202D */ daddu $a0, $s0, $zero
/* 39FC0 8005EBC0 8FBF002C */ lw $ra, 0x2C($sp)
/* 39FC4 8005EBC4 8FB40028 */ lw $s4, 0x28($sp)
/* 39FC8 8005EBC8 8FB30024 */ lw $s3, 0x24($sp)
/* 39FCC 8005EBCC 8FB20020 */ lw $s2, 0x20($sp)
/* 39FD0 8005EBD0 8FB1001C */ lw $s1, 0x1C($sp)
/* 39FD4 8005EBD4 8FB00018 */ lw $s0, 0x18($sp)
/* 39FD8 8005EBD8 03E00008 */ jr $ra
/* 39FDC 8005EBDC 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void nuScCreateScheduler(u8 videoMode, u8 numFields) {
nusched.curGraphicsTask = NULL;
nusched.curAudioTask = NULL;
nusched.graphicsTaskSuspended = NULL;
nusched.clientList = NULL;
nusched.retraceMsg = NU_SC_RETRACE_MSG;
nusched.prenmiMsg = NU_SC_PRENMI_MSG;
nusched.retraceCount = numFields;
nusched.frameBufferNum = 2;
if (osTvType == OS_TV_PAL) {
nusched.frameRate = 50;
} else {
nusched.frameRate = 60;
}
nuScPreNMIFlag = NU_SC_PRENMI_YET;
osCreateMesgQueue(&nusched.retraceMQ, nusched.retraceMsgBuf, NU_SC_MAX_MESGS);
osCreateMesgQueue(&nusched.rspMQ, nusched.rspMsgBuf, NU_SC_MAX_MESGS);
osCreateMesgQueue(&nusched.rdpMQ, nusched.rdpMsgBuf, NU_SC_MAX_MESGS);
osCreateMesgQueue(&nusched.graphicsRequestMQ, nusched.graphicsRequestBuf, NU_SC_MAX_MESGS);
osCreateMesgQueue(&nusched.audioRequestMQ, nusched.audioRequestBuf, NU_SC_MAX_MESGS);
osCreateMesgQueue(&nusched.waitMQ, nusched.waitMsgBuf, NU_SC_MAX_MESGS);
osCreateViManager(0xFE);
osViSetMode(&osViModeTable[videoMode]);
osViBlack(TRUE);
osViSetEvent(&nusched.retraceMQ, (OSMesg) 0x29A, numFields);
osSetEventMesg(OS_EVENT_SP, &nusched.rspMQ, (OSMesg) 0x29B);
osSetEventMesg(OS_EVENT_DP, &nusched.rdpMQ, (OSMesg) 0x29C);
osSetEventMesg(OS_EVENT_PRENMI, &nusched.retraceMQ, (OSMesg) 0x29D);
osCreateThread(&nusched.schedulerThread, 19, (void(*)) nuScEventHandler, &nusched,
nuScStack + NU_SC_STACK_SIZE / sizeof(u64), NU_SC_HANDLER_PRI);
osStartThread(&nusched.schedulerThread);
osCreateThread(&nusched.audioThread, 18, (void(*)) nuScExecuteAudio, &nusched,
nuScAudioStack + NU_SC_STACK_SIZE / sizeof(u64), NU_SC_AUDIO_PRI);
osStartThread(&nusched.audioThread);
osCreateThread(&nusched.graphicsThread, 17, (void(*)) nuScExecuteGraphics, &nusched,
nuScGraphicsStack + NU_SC_STACK_SIZE / sizeof(u64), NU_SC_GRAPHICS_PRI);
osStartThread(&nusched.graphicsThread);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80252B3C
/* 18141C 80252B3C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 181420 80252B40 AFB20018 */ sw $s2, 0x18($sp)
/* 181424 80252B44 0080902D */ daddu $s2, $a0, $zero
/* 181428 80252B48 AFBF0020 */ sw $ra, 0x20($sp)
/* 18142C 80252B4C AFB3001C */ sw $s3, 0x1C($sp)
/* 181430 80252B50 AFB10014 */ sw $s1, 0x14($sp)
/* 181434 80252B54 AFB00010 */ sw $s0, 0x10($sp)
dgb_01_D_80252B58_C103D8:
/* 181438 80252B58 8E50000C */ lw $s0, 0xC($s2)
/* 18143C 80252B5C 3C11800E */ lui $s1, %hi(gBattleStatus)
D_80252B60:
/* 181440 80252B60 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 181444 80252B64 8E130000 */ lw $s3, 0x0($s0)
/* 181448 80252B68 26100004 */ addiu $s0, $s0, 0x4
/* 18144C 80252B6C 8E020000 */ lw $v0, 0x0($s0)
/* 181450 80252B70 26100004 */ addiu $s0, $s0, 0x4
/* 181454 80252B74 AE20018C */ sw $zero, 0x18C($s1)
/* 181458 80252B78 AE220188 */ sw $v0, 0x188($s1)
/* 18145C 80252B7C 8E050000 */ lw $a1, 0x0($s0)
/* 181460 80252B80 0C0B1EAF */ jal evt_get_variable
dgb_01_D_80252B84_C10404:
/* 181464 80252B84 26100004 */ addiu $s0, $s0, 0x4
/* 181468 80252B88 AE220190 */ sw $v0, 0x190($s1)
/* 18146C 80252B8C 8E050000 */ lw $a1, 0x0($s0)
/* 181470 80252B90 26100004 */ addiu $s0, $s0, 0x4
/* 181474 80252B94 0C0B1EAF */ jal evt_get_variable
/* 181478 80252B98 0240202D */ daddu $a0, $s2, $zero
/* 18147C 80252B9C A622017E */ sh $v0, 0x17E($s1)
/* 181480 80252BA0 8E100000 */ lw $s0, 0x0($s0)
/* 181484 80252BA4 24020030 */ addiu $v0, $zero, 0x30
/* 181488 80252BA8 32030030 */ andi $v1, $s0, 0x30
/* 18148C 80252BAC 54620004 */ bnel $v1, $v0, .L80252BC0
dgb_01_D_80252BB0_C10430:
/* 181490 80252BB0 32020010 */ andi $v0, $s0, 0x10
/* 181494 80252BB4 8E220000 */ lw $v0, 0x0($s1)
/* 181498 80252BB8 08094B00 */ j .L80252C00
/* 18149C 80252BBC 34420030 */ ori $v0, $v0, 0x30
.L80252BC0:
/* 1814A0 80252BC0 10400004 */ beqz $v0, .L80252BD4
/* 1814A4 80252BC4 2403FFDF */ addiu $v1, $zero, -0x21
mac_05_D_80252BC8:
/* 1814A8 80252BC8 8E220000 */ lw $v0, 0x0($s1)
/* 1814AC 80252BCC 08094AFF */ j .L80252BFC
/* 1814B0 80252BD0 34420010 */ ori $v0, $v0, 0x10
.L80252BD4:
/* 1814B4 80252BD4 32020020 */ andi $v0, $s0, 0x20
/* 1814B8 80252BD8 10400005 */ beqz $v0, .L80252BF0
dgb_01_D_80252BDC_C1045C:
/* 1814BC 80252BDC 2403FFEF */ addiu $v1, $zero, -0x11
/* 1814C0 80252BE0 8E220000 */ lw $v0, 0x0($s1)
/* 1814C4 80252BE4 00431024 */ and $v0, $v0, $v1
/* 1814C8 80252BE8 08094B00 */ j .L80252C00
/* 1814CC 80252BEC 34420020 */ ori $v0, $v0, 0x20
.L80252BF0:
/* 1814D0 80252BF0 8E220000 */ lw $v0, 0x0($s1)
/* 1814D4 80252BF4 00431024 */ and $v0, $v0, $v1
/* 1814D8 80252BF8 2403FFDF */ addiu $v1, $zero, -0x21
.L80252BFC:
/* 1814DC 80252BFC 00431024 */ and $v0, $v0, $v1
.L80252C00:
/* 1814E0 80252C00 AE220000 */ sw $v0, 0x0($s1)
/* 1814E4 80252C04 32020040 */ andi $v0, $s0, 0x40
dgb_01_D_80252C08_C10488:
/* 1814E8 80252C08 10400007 */ beqz $v0, .L80252C28
/* 1814EC 80252C0C 2404FFBF */ addiu $a0, $zero, -0x41
/* 1814F0 80252C10 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1814F4 80252C14 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1814F8 80252C18 8C620000 */ lw $v0, 0x0($v1)
/* 1814FC 80252C1C 34420040 */ ori $v0, $v0, 0x40
/* 181500 80252C20 08094B0F */ j .L80252C3C
/* 181504 80252C24 AC620000 */ sw $v0, 0x0($v1)
.L80252C28:
/* 181508 80252C28 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 18150C 80252C2C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 181510 80252C30 8C430000 */ lw $v1, 0x0($v0)
dgb_01_D_80252C34_C104B4:
/* 181514 80252C34 00641824 */ and $v1, $v1, $a0
/* 181518 80252C38 AC430000 */ sw $v1, 0x0($v0)
.L80252C3C:
/* 18151C 80252C3C 32020200 */ andi $v0, $s0, 0x200
/* 181520 80252C40 10400007 */ beqz $v0, dgb_01_D_80252C60_C104E0
/* 181524 80252C44 2404FDFF */ addiu $a0, $zero, -0x201
/* 181528 80252C48 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 18152C 80252C4C 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 181530 80252C50 8C620000 */ lw $v0, 0x0($v1)
/* 181534 80252C54 34420200 */ ori $v0, $v0, 0x200
/* 181538 80252C58 08094B1D */ j .L80252C74
/* 18153C 80252C5C AC620000 */ sw $v0, 0x0($v1)
dgb_01_D_80252C60_C104E0:
/* 181540 80252C60 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181544 80252C64 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 181548 80252C68 8C430000 */ lw $v1, 0x0($v0)
/* 18154C 80252C6C 00641824 */ and $v1, $v1, $a0
/* 181550 80252C70 AC430000 */ sw $v1, 0x0($v0)
.L80252C74:
/* 181554 80252C74 32020080 */ andi $v0, $s0, 0x80
/* 181558 80252C78 10400007 */ beqz $v0, .L80252C98
/* 18155C 80252C7C 2404FF7F */ addiu $a0, $zero, -0x81
/* 181560 80252C80 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 181564 80252C84 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 181568 80252C88 8C620000 */ lw $v0, 0x0($v1)
dgb_01_D_80252C8C_C1050C:
/* 18156C 80252C8C 34420080 */ ori $v0, $v0, 0x80
/* 181570 80252C90 08094B2B */ j .L80252CAC
/* 181574 80252C94 AC620000 */ sw $v0, 0x0($v1)
.L80252C98:
/* 181578 80252C98 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 18157C 80252C9C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 181580 80252CA0 8C430000 */ lw $v1, 0x0($v0)
/* 181584 80252CA4 00641824 */ and $v1, $v1, $a0
/* 181588 80252CA8 AC430000 */ sw $v1, 0x0($v0)
.L80252CAC:
/* 18158C 80252CAC 0C09A75B */ jal get_actor
/* 181590 80252CB0 8E440148 */ lw $a0, 0x148($s2)
/* 181594 80252CB4 94430428 */ lhu $v1, 0x428($v0)
dgb_01_D_80252CB8_C10538:
/* 181598 80252CB8 A62301A0 */ sh $v1, 0x1A0($s1)
/* 18159C 80252CBC 92230193 */ lbu $v1, 0x193($s1)
/* 1815A0 80252CC0 90420426 */ lbu $v0, 0x426($v0)
/* 1815A4 80252CC4 A2230194 */ sb $v1, 0x194($s1)
/* 1815A8 80252CC8 306300FF */ andi $v1, $v1, 0xFF
/* 1815AC 80252CCC A22201A2 */ sb $v0, 0x1A2($s1)
/* 1815B0 80252CD0 240200FF */ addiu $v0, $zero, 0xFF
/* 1815B4 80252CD4 50620001 */ beql $v1, $v0, .L80252CDC
/* 1815B8 80252CD8 A2200194 */ sb $zero, 0x194($s1)
.L80252CDC:
/* 1815BC 80252CDC 8E220190 */ lw $v0, 0x190($s1)
/* 1815C0 80252CE0 30420F00 */ andi $v0, $v0, 0xF00
dgb_01_D_80252CE4_C10564:
/* 1815C4 80252CE4 00021203 */ sra $v0, $v0, 8
/* 1815C8 80252CE8 0C0945BA */ jal func_802516E8
/* 1815CC 80252CEC A2220195 */ sb $v0, 0x195($s1)
/* 1815D0 80252CF0 0440000B */ bltz $v0, .L80252D20
/* 1815D4 80252CF4 0240202D */ daddu $a0, $s2, $zero
/* 1815D8 80252CF8 0260282D */ daddu $a1, $s3, $zero
/* 1815DC 80252CFC 0C0B2026 */ jal evt_set_variable
/* 1815E0 80252D00 0040302D */ daddu $a2, $v0, $zero
/* 1815E4 80252D04 0C0B1069 */ jal does_script_exist_by_ref
/* 1815E8 80252D08 0240202D */ daddu $a0, $s2, $zero
/* 1815EC 80252D0C 0040182D */ daddu $v1, $v0, $zero
dgb_01_D_80252D10_C10590:
/* 1815F0 80252D10 10600004 */ beqz $v1, .L80252D24
/* 1815F4 80252D14 240200FF */ addiu $v0, $zero, 0xFF
/* 1815F8 80252D18 08094B49 */ j .L80252D24
/* 1815FC 80252D1C 24020002 */ addiu $v0, $zero, 0x2
.L80252D20:
/* 181600 80252D20 240200FF */ addiu $v0, $zero, 0xFF
.L80252D24:
/* 181604 80252D24 8FBF0020 */ lw $ra, 0x20($sp)
/* 181608 80252D28 8FB3001C */ lw $s3, 0x1C($sp)
/* 18160C 80252D2C 8FB20018 */ lw $s2, 0x18($sp)
/* 181610 80252D30 8FB10014 */ lw $s1, 0x14($sp)
/* 181614 80252D34 8FB00010 */ lw $s0, 0x10($sp)
mac_05_LetterDelivery_SavedNpcAnim:
/* 181618 80252D38 03E00008 */ jr $ra
dgb_01_D_80252D3C_C105BC:
/* 18161C 80252D3C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
ApiStatus ItemAfflictEnemy(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Bytecode* args = script->ptrReadPos;
s32 hitResultVarOut = *args++;
s32 flags;
Actor* actor;
HitResult hitResult;
battleStatus->currentAttackElement = *args++;
battleStatus->currentAttackEventSuppression = 0;
battleStatus->currentAttackStatus = evt_get_variable(script, *args++);
battleStatus->currentAttackDamage = evt_get_variable(script, *args++);
flags = *args++;
if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) {
gBattleStatus.flags1 |= BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE;
} else if (flags & BS_FLAGS1_10) {
gBattleStatus.flags1 |= BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
} else if (flags & BS_FLAGS1_SP_EVT_ACTIVE) {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
}
if (flags & BS_FLAGS1_40) {
gBattleStatus.flags1 |= BS_FLAGS1_40;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_40;
}
if (flags & BS_FLAGS1_200) {
gBattleStatus.flags1 |= BS_FLAGS1_200;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_200;
}
if (flags & BS_FLAGS1_80) {
gBattleStatus.flags1 |= BS_FLAGS1_80;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_80;
}
actor = get_actor(script->owner1.actorID);
battleStatus->currentTargetID = actor->targetActorID;
battleStatus->currentTargetPart = actor->targetPartIndex;
battleStatus->statusChance = battleStatus->currentAttackStatus;
if (battleStatus->statusChance == STATUS_KEY_NEVER) {
battleStatus->statusChance = 0;
}
battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8;
hitResult = calc_item_damage_enemy();
if (hitResult < 0) {
return ApiStatus_FINISH;
}
evt_set_variable(script, hitResultVarOut, hitResult);
if (!does_script_exist_by_ref(script)) {
return ApiStatus_FINISH;
}
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel render_messages
/* BA904 80124204 27BDFFD0 */ addiu $sp, $sp, -0x30
/* BA908 80124208 AFB10024 */ sw $s1, 0x24($sp)
/* BA90C 8012420C 0000882D */ daddu $s1, $zero, $zero
/* BA910 80124210 AFB00020 */ sw $s0, 0x20($sp)
/* BA914 80124214 3C10800A */ lui $s0, %hi(gMainGfxPos)
/* BA918 80124218 2610A66C */ addiu $s0, $s0, %lo(gMainGfxPos)
/* BA91C 8012421C 3C058015 */ lui $a1, %hi(gMessagePrinters)
/* BA920 80124220 24A54C30 */ addiu $a1, $a1, %lo(gMessagePrinters)
/* BA924 80124224 44803000 */ mtc1 $zero, $f6
/* BA928 80124228 3C028007 */ lui $v0, %hi(gCurrentDisplayContextIndex)
/* BA92C 8012422C 8C4241F4 */ lw $v0, %lo(gCurrentDisplayContextIndex)($v0)
/* BA930 80124230 3C038015 */ lui $v1, %hi(gMessageWindowProjMatrix)
/* BA934 80124234 24635CA0 */ addiu $v1, $v1, %lo(gMessageWindowProjMatrix)
/* BA938 80124238 AFBF002C */ sw $ra, 0x2C($sp)
/* BA93C 8012423C AFB20028 */ sw $s2, 0x28($sp)
/* BA940 80124240 00021180 */ sll $v0, $v0, 6
/* BA944 80124244 00432021 */ addu $a0, $v0, $v1
/* BA948 80124248 3C028000 */ lui $v0, (0x80000000 >> 16)
/* BA94C 8012424C 00829021 */ addu $s2, $a0, $v0
.L80124250:
/* BA950 80124250 8CA204FC */ lw $v0, 0x4FC($a1)
/* BA954 80124254 30420002 */ andi $v0, $v0, 0x2
/* BA958 80124258 1040003B */ beqz $v0, .L80124348
/* BA95C 8012425C 3C03DC08 */ lui $v1, (0xDC080008 >> 16)
/* BA960 80124260 34630008 */ ori $v1, $v1, (0xDC080008 & 0xFFFF)
/* BA964 80124264 8E020000 */ lw $v0, 0x0($s0)
/* BA968 80124268 3C01C3FA */ lui $at, (0xC3FA0000 >> 16)
/* BA96C 8012426C 44810000 */ mtc1 $at, $f0
/* BA970 80124270 3C0143FA */ lui $at, (0x43FA0000 >> 16)
/* BA974 80124274 44811000 */ mtc1 $at, $f2
/* BA978 80124278 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* BA97C 8012427C 44812000 */ mtc1 $at, $f4
/* BA980 80124280 44053000 */ mfc1 $a1, $f6
/* BA984 80124284 3C06439F */ lui $a2, (0x439F8000 >> 16)
/* BA988 80124288 34C68000 */ ori $a2, $a2, (0x439F8000 & 0xFFFF)
/* BA98C 8012428C 3C07C370 */ lui $a3, (0xC3700000 >> 16)
/* BA990 80124290 0040402D */ daddu $t0, $v0, $zero
/* BA994 80124294 24420008 */ addiu $v0, $v0, 0x8
/* BA998 80124298 AE020000 */ sw $v0, 0x0($s0)
/* BA99C 8012429C 3C028015 */ lui $v0, %hi(D_8014C280)
/* BA9A0 801242A0 2442C280 */ addiu $v0, $v0, %lo(D_8014C280)
/* BA9A4 801242A4 AD030000 */ sw $v1, 0x0($t0)
/* BA9A8 801242A8 AD020004 */ sw $v0, 0x4($t0)
/* BA9AC 801242AC AFA50010 */ sw $a1, 0x10($sp)
/* BA9B0 801242B0 E7A00014 */ swc1 $f0, 0x14($sp)
/* BA9B4 801242B4 E7A20018 */ swc1 $f2, 0x18($sp)
/* BA9B8 801242B8 0C018E90 */ jal guOrtho
/* BA9BC 801242BC E7A4001C */ swc1 $f4, 0x1C($sp)
/* BA9C0 801242C0 3C04DA38 */ lui $a0, (0xDA380007 >> 16)
/* BA9C4 801242C4 34840007 */ ori $a0, $a0, (0xDA380007 & 0xFFFF)
/* BA9C8 801242C8 3C05E300 */ lui $a1, (0xE3000A01 >> 16)
/* BA9CC 801242CC 34A50A01 */ ori $a1, $a1, (0xE3000A01 & 0xFFFF)
/* BA9D0 801242D0 3C06D9C0 */ lui $a2, (0xD9C0F9FB >> 16)
/* BA9D4 801242D4 34C6F9FB */ ori $a2, $a2, (0xD9C0F9FB & 0xFFFF)
/* BA9D8 801242D8 3C08D9FF */ lui $t0, (0xD9FFFFFF >> 16)
/* BA9DC 801242DC 3508FFFF */ ori $t0, $t0, (0xD9FFFFFF & 0xFFFF)
/* BA9E0 801242E0 3C070020 */ lui $a3, (0x200004 >> 16)
/* BA9E4 801242E4 8E030000 */ lw $v1, 0x0($s0)
/* BA9E8 801242E8 34E70004 */ ori $a3, $a3, (0x200004 & 0xFFFF)
/* BA9EC 801242EC 0060102D */ daddu $v0, $v1, $zero
/* BA9F0 801242F0 24630008 */ addiu $v1, $v1, 0x8
/* BA9F4 801242F4 AE030000 */ sw $v1, 0x0($s0)
/* BA9F8 801242F8 AC440000 */ sw $a0, 0x0($v0)
/* BA9FC 801242FC AC520004 */ sw $s2, 0x4($v0)
/* BAA00 80124300 24620008 */ addiu $v0, $v1, 0x8
/* BAA04 80124304 AE020000 */ sw $v0, 0x0($s0)
/* BAA08 80124308 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* BAA0C 8012430C AC620000 */ sw $v0, 0x0($v1)
/* BAA10 80124310 24620010 */ addiu $v0, $v1, 0x10
/* BAA14 80124314 AC600004 */ sw $zero, 0x4($v1)
/* BAA18 80124318 AE020000 */ sw $v0, 0x0($s0)
/* BAA1C 8012431C 24620018 */ addiu $v0, $v1, 0x18
/* BAA20 80124320 AC650008 */ sw $a1, 0x8($v1)
/* BAA24 80124324 AC60000C */ sw $zero, 0xC($v1)
/* BAA28 80124328 AE020000 */ sw $v0, 0x0($s0)
/* BAA2C 8012432C 24620020 */ addiu $v0, $v1, 0x20
/* BAA30 80124330 AC660010 */ sw $a2, 0x10($v1)
/* BAA34 80124334 AC600014 */ sw $zero, 0x14($v1)
/* BAA38 80124338 AE020000 */ sw $v0, 0x0($s0)
/* BAA3C 8012433C AC680018 */ sw $t0, 0x18($v1)
/* BAA40 80124340 080490D6 */ j .L80124358
/* BAA44 80124344 AC67001C */ sw $a3, 0x1C($v1)
.L80124348:
/* BAA48 80124348 26310001 */ addiu $s1, $s1, 0x1
/* BAA4C 8012434C 2A220003 */ slti $v0, $s1, 0x3
/* BAA50 80124350 1440FFBF */ bnez $v0, .L80124250
/* BAA54 80124354 24A50558 */ addiu $a1, $a1, 0x558
.L80124358:
/* BAA58 80124358 0000882D */ daddu $s1, $zero, $zero
/* BAA5C 8012435C 24120005 */ addiu $s2, $zero, 0x5
/* BAA60 80124360 3C108015 */ lui $s0, %hi(gMessagePrinters)
/* BAA64 80124364 26104C30 */ addiu $s0, $s0, %lo(gMessagePrinters)
.L80124368:
/* BAA68 80124368 8E0204FC */ lw $v0, 0x4FC($s0)
/* BAA6C 8012436C 30420002 */ andi $v0, $v0, 0x2
/* BAA70 80124370 50400026 */ beql $v0, $zero, .L8012440C
/* BAA74 80124374 26100558 */ addiu $s0, $s0, 0x558
/* BAA78 80124378 0C049EE9 */ jal draw_message_window
/* BAA7C 8012437C 0200202D */ daddu $a0, $s0, $zero
/* BAA80 80124380 920404F8 */ lbu $a0, 0x4F8($s0)
/* BAA84 80124384 308300FF */ andi $v1, $a0, 0xFF
/* BAA88 80124388 1472000C */ bne $v1, $s2, .L801243BC
/* BAA8C 8012438C 2402000C */ addiu $v0, $zero, 0xC
/* BAA90 80124390 8E0304FC */ lw $v1, 0x4FC($s0)
/* BAA94 80124394 30628000 */ andi $v0, $v1, 0x8000
/* BAA98 80124398 5440001C */ bnel $v0, $zero, .L8012440C
/* BAA9C 8012439C 26100558 */ addiu $s0, $s0, 0x558
/* BAAA0 801243A0 30620040 */ andi $v0, $v1, 0x40
/* BAAA4 801243A4 54400019 */ bnel $v0, $zero, .L8012440C
/* BAAA8 801243A8 26100558 */ addiu $s0, $s0, 0x558
/* BAAAC 801243AC 0C0499E4 */ jal msg_update_rewind_arrow
/* BAAB0 801243B0 0220202D */ daddu $a0, $s1, $zero
/* BAAB4 801243B4 08049103 */ j .L8012440C
/* BAAB8 801243B8 26100558 */ addiu $s0, $s0, 0x558
.L801243BC:
/* BAABC 801243BC 14620005 */ bne $v1, $v0, .L801243D4
/* BAAC0 801243C0 2482FFF9 */ addiu $v0, $a0, -0x7
/* BAAC4 801243C4 0C049BAB */ jal msg_draw_rewind_arrow
/* BAAC8 801243C8 0220202D */ daddu $a0, $s1, $zero
/* BAACC 801243CC 08049103 */ j .L8012440C
/* BAAD0 801243D0 26100558 */ addiu $s0, $s0, 0x558
.L801243D4:
/* BAAD4 801243D4 304200FF */ andi $v0, $v0, 0xFF
/* BAAD8 801243D8 2C420002 */ sltiu $v0, $v0, 0x2
/* BAADC 801243DC 14400008 */ bnez $v0, .L80124400
/* BAAE0 801243E0 3C020001 */ lui $v0, (0x10000 >> 16)
/* BAAE4 801243E4 8E0304FC */ lw $v1, 0x4FC($s0)
/* BAAE8 801243E8 00621024 */ and $v0, $v1, $v0
/* BAAEC 801243EC 14400004 */ bnez $v0, .L80124400
/* BAAF0 801243F0 3C020002 */ lui $v0, (0x20000 >> 16)
/* BAAF4 801243F4 00621024 */ and $v0, $v1, $v0
/* BAAF8 801243F8 50400004 */ beql $v0, $zero, .L8012440C
/* BAAFC 801243FC 26100558 */ addiu $s0, $s0, 0x558
.L80124400:
/* BAB00 80124400 0C049BDE */ jal msg_draw_choice_pointer
/* BAB04 80124404 0200202D */ daddu $a0, $s0, $zero
/* BAB08 80124408 26100558 */ addiu $s0, $s0, 0x558
.L8012440C:
/* BAB0C 8012440C 26310001 */ addiu $s1, $s1, 0x1
/* BAB10 80124410 2A220003 */ slti $v0, $s1, 0x3
/* BAB14 80124414 1440FFD4 */ bnez $v0, .L80124368
/* BAB18 80124418 00000000 */ nop
/* BAB1C 8012441C 8FBF002C */ lw $ra, 0x2C($sp)
/* BAB20 80124420 8FB20028 */ lw $s2, 0x28($sp)
/* BAB24 80124424 8FB10024 */ lw $s1, 0x24($sp)
/* BAB28 80124428 8FB00020 */ lw $s0, 0x20($sp)
/* BAB2C 8012442C 03E00008 */ jr $ra
/* BAB30 80124430 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void render_messages(void) {
Mtx* matrix = &gMessageWindowProjMatrix[gCurrentDisplayContextIndex];
s32 i;
for (i = 0; i < ARRAY_COUNT(gMessagePrinters); i++) {
if (gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_2) {
gSPViewport(gMainGfxPos++, D_8014C280);
guOrtho(matrix, 0.0f, 319.0f, -240.0f, 0.0f, -500.0f, 500.0f, 1.0f);
gSPMatrix(gMainGfxPos++, OS_K0_TO_PHYSICAL(matrix), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
gDPPipeSync(gMainGfxPos++);
gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
gSPClearGeometryMode(gMainGfxPos++, G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH);
break;
}
}
for (i = 0; i < ARRAY_COUNT(gMessagePrinters); i++) {
if (gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_2) {
draw_message_window(&gMessagePrinters[i]);
if (gMessagePrinters[i].windowState == MSG_WINDOW_STATE_WAITING) {
if (!(gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_8000) &&
!(gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_40))
{
msg_update_rewind_arrow(i);
}
} else if (gMessagePrinters[i].windowState == MSG_WINDOW_STATE_C) {
msg_draw_rewind_arrow(i);
} else if (gMessagePrinters[i].windowState == MSG_WINDOW_STATE_WAITING_FOR_CHOICE ||
gMessagePrinters[i].windowState == MSG_WINDOW_STATE_SCROLLING_BACK ||
gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_10000 ||
gMessagePrinters[i].stateFlags & MSG_STATE_FLAG_20000)
{
msg_draw_choice_pointer(&gMessagePrinters[i]);
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel AdjustCam
/* F1010 802CC660 27BDFF58 */ addiu $sp, $sp, -0xA8
/* F1014 802CC664 AFB10064 */ sw $s1, 0x64($sp)
/* F1018 802CC668 0080882D */ daddu $s1, $a0, $zero
/* F101C 802CC66C AFB20068 */ sw $s2, 0x68($sp)
/* F1020 802CC670 00A0902D */ daddu $s2, $a1, $zero
/* F1024 802CC674 AFBF0070 */ sw $ra, 0x70($sp)
/* F1028 802CC678 AFB3006C */ sw $s3, 0x6C($sp)
/* F102C 802CC67C AFB00060 */ sw $s0, 0x60($sp)
/* F1030 802CC680 F7BE00A0 */ sdc1 $f30, 0xA0($sp)
/* F1034 802CC684 F7BC0098 */ sdc1 $f28, 0x98($sp)
/* F1038 802CC688 F7BA0090 */ sdc1 $f26, 0x90($sp)
/* F103C 802CC68C F7B80088 */ sdc1 $f24, 0x88($sp)
/* F1040 802CC690 F7B60080 */ sdc1 $f22, 0x80($sp)
/* F1044 802CC694 F7B40078 */ sdc1 $f20, 0x78($sp)
/* F1048 802CC698 8E30000C */ lw $s0, 0xC($s1)
/* F104C 802CC69C 8E050000 */ lw $a1, 0x0($s0)
/* F1050 802CC6A0 0C0B1EAF */ jal evt_get_variable
/* F1054 802CC6A4 26100004 */ addiu $s0, $s0, 0x4
/* F1058 802CC6A8 8E050000 */ lw $a1, 0x0($s0)
/* F105C 802CC6AC 26100004 */ addiu $s0, $s0, 0x4
/* F1060 802CC6B0 0220202D */ daddu $a0, $s1, $zero
/* F1064 802CC6B4 3C06800B */ lui $a2, %hi(gCameras)
/* F1068 802CC6B8 24C61D80 */ addiu $a2, $a2, %lo(gCameras)
/* F106C 802CC6BC 00021880 */ sll $v1, $v0, 2
/* F1070 802CC6C0 00621821 */ addu $v1, $v1, $v0
/* F1074 802CC6C4 00031880 */ sll $v1, $v1, 2
/* F1078 802CC6C8 00621823 */ subu $v1, $v1, $v0
/* F107C 802CC6CC 000310C0 */ sll $v0, $v1, 3
/* F1080 802CC6D0 00621821 */ addu $v1, $v1, $v0
/* F1084 802CC6D4 000318C0 */ sll $v1, $v1, 3
/* F1088 802CC6D8 0C0B210B */ jal evt_get_float_variable
/* F108C 802CC6DC 00669821 */ addu $s3, $v1, $a2
/* F1090 802CC6E0 8E050000 */ lw $a1, 0x0($s0)
/* F1094 802CC6E4 26100004 */ addiu $s0, $s0, 0x4
/* F1098 802CC6E8 0220202D */ daddu $a0, $s1, $zero
/* F109C 802CC6EC 0C0B210B */ jal evt_get_float_variable
/* F10A0 802CC6F0 E7A00054 */ swc1 $f0, 0x54($sp)
/* F10A4 802CC6F4 8E050000 */ lw $a1, 0x0($s0)
/* F10A8 802CC6F8 26100004 */ addiu $s0, $s0, 0x4
/* F10AC 802CC6FC 0220202D */ daddu $a0, $s1, $zero
/* F10B0 802CC700 0C0B210B */ jal evt_get_float_variable
/* F10B4 802CC704 E7A00058 */ swc1 $f0, 0x58($sp)
/* F10B8 802CC708 8E050000 */ lw $a1, 0x0($s0)
/* F10BC 802CC70C 26100004 */ addiu $s0, $s0, 0x4
/* F10C0 802CC710 0220202D */ daddu $a0, $s1, $zero
/* F10C4 802CC714 0C0B210B */ jal evt_get_float_variable
/* F10C8 802CC718 46000786 */ mov.s $f30, $f0
/* F10CC 802CC71C 0220202D */ daddu $a0, $s1, $zero
/* F10D0 802CC720 8E050000 */ lw $a1, 0x0($s0)
/* F10D4 802CC724 0C0B210B */ jal evt_get_float_variable
/* F10D8 802CC728 46000706 */ mov.s $f28, $f0
/* F10DC 802CC72C 3C038011 */ lui $v1, %hi(gPlayerStatus)
/* F10E0 802CC730 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus)
/* F10E4 802CC734 1240004E */ beqz $s2, .L802CC870
/* F10E8 802CC738 46000686 */ mov.s $f26, $f0
/* F10EC 802CC73C 3C0146FF */ lui $at, (0x46FFFE00 >> 16)
/* F10F0 802CC740 3421FE00 */ ori $at, $at, (0x46FFFE00 & 0xFFFF)
/* F10F4 802CC744 44811000 */ mtc1 $at, $f2
/* F10F8 802CC748 44802000 */ mtc1 $zero, $f4
/* F10FC 802CC74C 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* F1100 802CC750 44810000 */ mtc1 $at, $f0
/* F1104 802CC754 3C014120 */ lui $at, (0x41200000 >> 16)
/* F1108 802CC758 44817000 */ mtc1 $at, $f14
/* F110C 802CC75C 27A20038 */ addiu $v0, $sp, 0x38
/* F1110 802CC760 E7A20044 */ swc1 $f2, 0x44($sp)
/* F1114 802CC764 AFA20018 */ sw $v0, 0x18($sp)
/* F1118 802CC768 27A2003C */ addiu $v0, $sp, 0x3C
/* F111C 802CC76C AFA2001C */ sw $v0, 0x1C($sp)
/* F1120 802CC770 27A20040 */ addiu $v0, $sp, 0x40
/* F1124 802CC774 AFA20020 */ sw $v0, 0x20($sp)
/* F1128 802CC778 27A20044 */ addiu $v0, $sp, 0x44
/* F112C 802CC77C AFA20024 */ sw $v0, 0x24($sp)
/* F1130 802CC780 27A20048 */ addiu $v0, $sp, 0x48
/* F1134 802CC784 AFA20028 */ sw $v0, 0x28($sp)
/* F1138 802CC788 27A2004C */ addiu $v0, $sp, 0x4C
/* F113C 802CC78C E7A00010 */ swc1 $f0, 0x10($sp)
/* F1140 802CC790 E7A40014 */ swc1 $f4, 0x14($sp)
/* F1144 802CC794 AFA2002C */ sw $v0, 0x2C($sp)
/* F1148 802CC798 C476002C */ lwc1 $f22, 0x2C($v1)
/* F114C 802CC79C 27A20050 */ addiu $v0, $sp, 0x50
/* F1150 802CC7A0 AFA20030 */ sw $v0, 0x30($sp)
/* F1154 802CC7A4 C4740030 */ lwc1 $f20, 0x30($v1)
/* F1158 802CC7A8 C4780028 */ lwc1 $f24, 0x28($v1)
/* F115C 802CC7AC 44072000 */ mfc1 $a3, $f4
/* F1160 802CC7B0 460EB380 */ add.s $f14, $f22, $f14
/* F1164 802CC7B4 4406A000 */ mfc1 $a2, $f20
/* F1168 802CC7B8 0C017449 */ jal test_ray_zones
/* F116C 802CC7BC 4600C306 */ mov.s $f12, $f24
/* F1170 802CC7C0 0040182D */ daddu $v1, $v0, $zero
/* F1174 802CC7C4 0460001A */ bltz $v1, .L802CC830
/* F1178 802CC7C8 000310C0 */ sll $v0, $v1, 3
/* F117C 802CC7CC 00431023 */ subu $v0, $v0, $v1
/* F1180 802CC7D0 3C03800E */ lui $v1, %hi(D_800D91D4)
/* F1184 802CC7D4 8C6391D4 */ lw $v1, %lo(D_800D91D4)($v1)
/* F1188 802CC7D8 00021080 */ sll $v0, $v0, 2
/* F118C 802CC7DC 00431021 */ addu $v0, $v0, $v1
/* F1190 802CC7E0 8C420010 */ lw $v0, 0x10($v0)
/* F1194 802CC7E4 266304D8 */ addiu $v1, $s3, 0x4D8
/* F1198 802CC7E8 24440020 */ addiu $a0, $v0, 0x20
.L802CC7EC:
/* F119C 802CC7EC 8C480000 */ lw $t0, 0x0($v0)
/* F11A0 802CC7F0 8C490004 */ lw $t1, 0x4($v0)
/* F11A4 802CC7F4 8C4A0008 */ lw $t2, 0x8($v0)
/* F11A8 802CC7F8 8C4B000C */ lw $t3, 0xC($v0)
/* F11AC 802CC7FC AC680000 */ sw $t0, 0x0($v1)
/* F11B0 802CC800 AC690004 */ sw $t1, 0x4($v1)
/* F11B4 802CC804 AC6A0008 */ sw $t2, 0x8($v1)
/* F11B8 802CC808 AC6B000C */ sw $t3, 0xC($v1)
/* F11BC 802CC80C 24420010 */ addiu $v0, $v0, 0x10
/* F11C0 802CC810 1444FFF6 */ bne $v0, $a0, .L802CC7EC
/* F11C4 802CC814 24630010 */ addiu $v1, $v1, 0x10
/* F11C8 802CC818 8C480000 */ lw $t0, 0x0($v0)
/* F11CC 802CC81C 8C490004 */ lw $t1, 0x4($v0)
/* F11D0 802CC820 8C4A0008 */ lw $t2, 0x8($v0)
/* F11D4 802CC824 AC680000 */ sw $t0, 0x0($v1)
/* F11D8 802CC828 AC690004 */ sw $t1, 0x4($v1)
/* F11DC 802CC82C AC6A0008 */ sw $t2, 0x8($v1)
.L802CC830:
/* F11E0 802CC830 E67604B4 */ swc1 $f22, 0x4B4($s3)
/* F11E4 802CC834 E67404B8 */ swc1 $f20, 0x4B8($s3)
/* F11E8 802CC838 E67E04DC */ swc1 $f30, 0x4DC($s3)
/* F11EC 802CC83C E67C04E0 */ swc1 $f28, 0x4E0($s3)
/* F11F0 802CC840 E67A04FC */ swc1 $f26, 0x4FC($s3)
/* F11F4 802CC844 C7A60054 */ lwc1 $f6, 0x54($sp)
/* F11F8 802CC848 24030001 */ addiu $v1, $zero, 0x1
/* F11FC 802CC84C E6660490 */ swc1 $f6, 0x490($s3)
/* F1200 802CC850 A6630506 */ sh $v1, 0x506($s3)
/* F1204 802CC854 C7A60058 */ lwc1 $f6, 0x58($sp)
/* F1208 802CC858 0000102D */ daddu $v0, $zero, $zero
/* F120C 802CC85C 4606C000 */ add.s $f0, $f24, $f6
/* F1210 802CC860 A6630504 */ sh $v1, 0x504($s3)
/* F1214 802CC864 AE600508 */ sw $zero, 0x508($s3)
/* F1218 802CC868 080B3225 */ j .L802CC894
/* F121C 802CC86C E66004B0 */ swc1 $f0, 0x4B0($s3)
.L802CC870:
/* F1220 802CC870 C6620484 */ lwc1 $f2, 0x484($s3)
/* F1224 802CC874 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* F1228 802CC878 44810000 */ mtc1 $at, $f0
/* F122C 802CC87C 00000000 */ nop
/* F1230 802CC880 4602003E */ c.le.s $f0, $f2
/* F1234 802CC884 00000000 */ nop
/* F1238 802CC888 45010002 */ bc1t .L802CC894
/* F123C 802CC88C 24020002 */ addiu $v0, $zero, 0x2
/* F1240 802CC890 0000102D */ daddu $v0, $zero, $zero
.L802CC894:
/* F1244 802CC894 8FBF0070 */ lw $ra, 0x70($sp)
/* F1248 802CC898 8FB3006C */ lw $s3, 0x6C($sp)
/* F124C 802CC89C 8FB20068 */ lw $s2, 0x68($sp)
/* F1250 802CC8A0 8FB10064 */ lw $s1, 0x64($sp)
/* F1254 802CC8A4 8FB00060 */ lw $s0, 0x60($sp)
/* F1258 802CC8A8 D7BE00A0 */ ldc1 $f30, 0xA0($sp)
/* F125C 802CC8AC D7BC0098 */ ldc1 $f28, 0x98($sp)
/* F1260 802CC8B0 D7BA0090 */ ldc1 $f26, 0x90($sp)
/* F1264 802CC8B4 D7B80088 */ ldc1 $f24, 0x88($sp)
/* F1268 802CC8B8 D7B60080 */ ldc1 $f22, 0x80($sp)
/* F126C 802CC8BC D7B40078 */ ldc1 $f20, 0x78($sp)
/* F1270 802CC8C0 03E00008 */ jr $ra
/* F1274 802CC8C4 27BD00A8 */ addiu $sp, $sp, 0xA8
### DECOMPILED C INSTRUCTIONS:
ApiStatus AdjustCam(Evt* script, s32 isInitialCall) {
f32 hitX, hitY, hitZ, hitDepth, nX, nY, nZ;
f32 posX, posY, posZ;
s32 zoneID;
Bytecode* args = script->ptrReadPos;
Camera* camera = &gCameras[evt_get_variable(script, *args++)];
f32 moveSpeed = evt_get_float_variable(script, *args++);
f32 deltaPosX = evt_get_float_variable(script, *args++);
f32 boomLength = evt_get_float_variable(script, *args++);
f32 boomPitch = evt_get_float_variable(script, *args++);
f32 viewPitch = evt_get_float_variable(script, *args++);
PlayerStatus* playerStatus = &gPlayerStatus;
if (isInitialCall) {
hitDepth = 32767.0f;
posX = playerStatus->position.x;
posY = playerStatus->position.y;
posZ = playerStatus->position.z;
zoneID = test_ray_zones(posX, posY + 10.0f, posZ, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &nX, &nY, &nZ);
if (zoneID >= 0) {
camera->controlSettings = *gZoneCollisionData.colliderList[zoneID].camSettings;
}
camera->movePos.x = posX + deltaPosX;
camera->movePos.y = posY;
camera->movePos.z = posZ;
camera->controlSettings.boomLength = boomLength;
camera->controlSettings.boomPitch = boomPitch;
camera->controlSettings.viewPitch = viewPitch;
camera->moveSpeed = moveSpeed;
camera->panActive = TRUE;
camera->followPlayer = TRUE;
camera->panPhase = 0.0f;
return ApiStatus_BLOCK;
}
if (camera->interpAlpha >= 1.0f) {
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel ispy_notification_update
/* E2290C 802B735C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* E22910 802B7360 3C058011 */ lui $a1, %hi(gPlayerStatus)
/* E22914 802B7364 24A5EFC8 */ addiu $a1, $a1, %lo(gPlayerStatus)
/* E22918 802B7368 AFBF0010 */ sw $ra, 0x10($sp)
/* E2291C 802B736C 84A200B0 */ lh $v0, 0xB0($a1)
/* E22920 802B7370 C4A0002C */ lwc1 $f0, 0x2C($a1)
/* E22924 802B7374 44821000 */ mtc1 $v0, $f2
/* E22928 802B7378 00000000 */ nop
/* E2292C 802B737C 468010A0 */ cvt.s.w $f2, $f2
/* E22930 802B7380 46020000 */ add.s $f0, $f0, $f2
/* E22934 802B7384 3C014120 */ lui $at, (0x41200000 >> 16)
/* E22938 802B7388 44811000 */ mtc1 $at, $f2
/* E2293C 802B738C 3C04802B */ lui $a0, %hi(ISpyPtr)
.L802B7390:
/* E22940 802B7390 8C847C78 */ lw $a0, %lo(ISpyPtr)($a0)
/* E22944 802B7394 46020000 */ add.s $f0, $f0, $f2
/* E22948 802B7398 C4820004 */ lwc1 $f2, 0x4($a0)
/* E2294C 802B739C 46020001 */ sub.s $f0, $f0, $f2
/* E22950 802B73A0 3C013FC0 */ lui $at, (0x3FC00000 >> 16)
/* E22954 802B73A4 44812000 */ mtc1 $at, $f4
/* E22958 802B73A8 00000000 */ nop
/* E2295C 802B73AC 46040003 */ div.s $f0, $f0, $f4
/* E22960 802B73B0 46001080 */ add.s $f2, $f2, $f0
/* E22964 802B73B4 8C830024 */ lw $v1, 0x24($a0)
/* E22968 802B73B8 E4820004 */ swc1 $f2, 0x4($a0)
/* E2296C 802B73BC C4A00028 */ lwc1 $f0, 0x28($a1)
glabel .L802B73C0
/* E22970 802B73C0 3C068011 */ lui $a2, %hi(gPartnerStatus)
/* E22974 802B73C4 24C6EBB0 */ addiu $a2, $a2, %lo(gPartnerStatus)
glabel .L802B73C8
/* E22978 802B73C8 E4800000 */ swc1 $f0, 0x0($a0)
/* E2297C 802B73CC C4A00030 */ lwc1 $f0, 0x30($a1)
glabel .L802B73D0
/* E22980 802B73D0 24020001 */ addiu $v0, $zero, 0x1
/* E22984 802B73D4 10620022 */ beq $v1, $v0, .L802B7460
glabel .L802B73D8
/* E22988 802B73D8 E4800008 */ swc1 $f0, 0x8($a0)
/* E2298C 802B73DC 28620002 */ slti $v0, $v1, 0x2
glabel .L802B73E0
/* E22990 802B73E0 50400005 */ beql $v0, $zero, .L802B73F8
/* E22994 802B73E4 24020002 */ addiu $v0, $zero, 0x2
glabel .L802B73E8
/* E22998 802B73E8 10600009 */ beqz $v1, .L802B7410
/* E2299C 802B73EC 00000000 */ nop
.L802B73F0:
/* E229A0 802B73F0 080ADD5A */ j .L802B7568
/* E229A4 802B73F4 00000000 */ nop
.L802B73F8:
/* E229A8 802B73F8 1062002D */ beq $v1, $v0, .L802B74B0
.L802B73FC:
/* E229AC 802B73FC 24020003 */ addiu $v0, $zero, 0x3
/* E229B0 802B7400 10620037 */ beq $v1, $v0, .L802B74E0
/* E229B4 802B7404 00000000 */ nop
.L802B7408:
/* E229B8 802B7408 080ADD5A */ j .L802B7568
/* E229BC 802B740C 00000000 */ nop
.L802B7410:
/* E229C0 802B7410 80C20000 */ lb $v0, 0x0($a2)
/* E229C4 802B7414 10400008 */ beqz $v0, .L802B7438
/* E229C8 802B7418 24020008 */ addiu $v0, $zero, 0x8
/* E229CC 802B741C 80C30003 */ lb $v1, 0x3($a2)
/* E229D0 802B7420 14620005 */ bne $v1, $v0, .L802B7438
/* E229D4 802B7424 00000000 */ nop
/* E229D8 802B7428 3C028007 */ lui $v0, %hi(gGameStatusPtr)
glabel interact_speech_update
/* E229DC 802B742C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* E229E0 802B7430 080ADD10 */ j .L802B7440
/* E229E4 802B7434 8042007D */ lb $v0, 0x7D($v0)
.L802B7438:
/* E229E8 802B7438 8CA20000 */ lw $v0, 0x0($a1)
/* E229EC 802B743C 30423000 */ andi $v0, $v0, 0x3000
.L802B7440:
/* E229F0 802B7440 14400049 */ bnez $v0, .L802B7568
.L802B7444:
/* E229F4 802B7444 00000000 */ nop
/* E229F8 802B7448 3C03802B */ lui $v1, %hi(ISpyPtr)
/* E229FC 802B744C 8C637C78 */ lw $v1, %lo(ISpyPtr)($v1)
glabel should_continue_inspect
/* E22A00 802B7450 8C620024 */ lw $v0, 0x24($v1)
/* E22A04 802B7454 24420001 */ addiu $v0, $v0, 0x1
/* E22A08 802B7458 080ADD5A */ j .L802B7568
/* E22A0C 802B745C AC620024 */ sw $v0, 0x24($v1)
.L802B7460:
/* E22A10 802B7460 8CA20000 */ lw $v0, 0x0($a1)
.L802B7464:
/* E22A14 802B7464 30420020 */ andi $v0, $v0, 0x20
/* E22A18 802B7468 10400003 */ beqz $v0, .L802B7478
/* E22A1C 802B746C 24020003 */ addiu $v0, $zero, 0x3
/* E22A20 802B7470 080ADD5A */ j .L802B7568
/* E22A24 802B7474 AC820024 */ sw $v0, 0x24($a0)
.L802B7478:
/* E22A28 802B7478 8C820018 */ lw $v0, 0x18($a0)
/* E22A2C 802B747C 0040182D */ daddu $v1, $v0, $zero
/* E22A30 802B7480 24420001 */ addiu $v0, $v0, 0x1
/* E22A34 802B7484 28630010 */ slti $v1, $v1, 0x10
/* E22A38 802B7488 14600037 */ bnez $v1, .L802B7568
/* E22A3C 802B748C AC820018 */ sw $v0, 0x18($a0)
/* E22A40 802B7490 8C820024 */ lw $v0, 0x24($a0)
/* E22A44 802B7494 3C013EB8 */ lui $at, (0x3EB851EC >> 16)
.L802B7498:
/* E22A48 802B7498 342151EC */ ori $at, $at, (0x3EB851EC & 0xFFFF)
/* E22A4C 802B749C 44810000 */ mtc1 $at, $f0
/* E22A50 802B74A0 24420001 */ addiu $v0, $v0, 0x1
/* E22A54 802B74A4 E480000C */ swc1 $f0, 0xC($a0)
.L802B74A8:
/* E22A58 802B74A8 080ADD5A */ j .L802B7568
/* E22A5C 802B74AC AC820024 */ sw $v0, 0x24($a0)
.L802B74B0:
/* E22A60 802B74B0 0000282D */ daddu $a1, $zero, $zero
/* E22A64 802B74B4 8C820024 */ lw $v0, 0x24($a0)
/* E22A68 802B74B8 3C013F11 */ lui $at, (0x3F11EB85 >> 16)
/* E22A6C 802B74BC 3421EB85 */ ori $at, $at, (0x3F11EB85 & 0xFFFF)
/* E22A70 802B74C0 44810000 */ mtc1 $at, $f0
/* E22A74 802B74C4 24420001 */ addiu $v0, $v0, 0x1
glabel .L802B74C8
/* E22A78 802B74C8 E480000C */ swc1 $f0, 0xC($a0)
/* E22A7C 802B74CC AC820024 */ sw $v0, 0x24($a0)
.L802B74D0:
/* E22A80 802B74D0 0C052736 */ jal sfx_play_sound_at_player
.L802B74D4:
/* E22A84 802B74D4 2404017B */ addiu $a0, $zero, 0x17B
/* E22A88 802B74D8 080ADD5A */ j .L802B7568
.L802B74DC:
/* E22A8C 802B74DC 00000000 */ nop
.L802B74E0:
/* E22A90 802B74E0 8C820018 */ lw $v0, 0x18($a0)
/* E22A94 802B74E4 3C013F07 */ lui $at, (0x3F07AE14 >> 16)
/* E22A98 802B74E8 3421AE14 */ ori $at, $at, (0x3F07AE14 & 0xFFFF)
/* E22A9C 802B74EC 44810000 */ mtc1 $at, $f0
glabel pulse_stone_notification_update
/* E22AA0 802B74F0 2842002F */ slti $v0, $v0, 0x2F
.L802B74F4:
/* E22AA4 802B74F4 10400005 */ beqz $v0, .L802B750C
/* E22AA8 802B74F8 E480000C */ swc1 $f0, 0xC($a0)
/* E22AAC 802B74FC 8CA20000 */ lw $v0, 0x0($a1)
/* E22AB0 802B7500 30420020 */ andi $v0, $v0, 0x20
/* E22AB4 802B7504 10400008 */ beqz $v0, .L802B7528
/* E22AB8 802B7508 00000000 */ nop
.L802B750C:
/* E22ABC 802B750C 8C820028 */ lw $v0, 0x28($a0)
/* E22AC0 802B7510 2442FFC0 */ addiu $v0, $v0, -0x40
/* E22AC4 802B7514 04410004 */ bgez $v0, .L802B7528
/* E22AC8 802B7518 AC820028 */ sw $v0, 0x28($a0)
/* E22ACC 802B751C 24020033 */ addiu $v0, $zero, 0x33
.L802B7520:
/* E22AD0 802B7520 AC800028 */ sw $zero, 0x28($a0)
.L802B7524:
/* E22AD4 802B7524 AC820018 */ sw $v0, 0x18($a0)
.L802B7528:
/* E22AD8 802B7528 3C02802B */ lui $v0, %hi(ISpyPtr)
/* E22ADC 802B752C 8C427C78 */ lw $v0, %lo(ISpyPtr)($v0)
/* E22AE0 802B7530 8C430018 */ lw $v1, 0x18($v0)
/* E22AE4 802B7534 0060202D */ daddu $a0, $v1, $zero
/* E22AE8 802B7538 24630001 */ addiu $v1, $v1, 0x1
/* E22AEC 802B753C 28840033 */ slti $a0, $a0, 0x33
/* E22AF0 802B7540 14800009 */ bnez $a0, .L802B7568
.L802B7544:
/* E22AF4 802B7544 AC430018 */ sw $v1, 0x18($v0)
/* E22AF8 802B7548 3C018016 */ lui $at, %hi(D_8015A57A)
/* E22AFC 802B754C A020A57A */ sb $zero, %lo(D_8015A57A)($at)
/* E22B00 802B7550 8CA20004 */ lw $v0, 0x4($a1)
/* E22B04 802B7554 2403FEFF */ addiu $v1, $zero, -0x101
.L802B7558:
/* E22B08 802B7558 3C018011 */ lui $at, %hi(ISpyNotificationCallback)
/* E22B0C 802B755C AC20C93C */ sw $zero, %lo(ISpyNotificationCallback)($at)
/* E22B10 802B7560 00431024 */ and $v0, $v0, $v1
.L802B7564:
/* E22B14 802B7564 ACA20004 */ sw $v0, 0x4($a1)
.L802B7568:
/* E22B18 802B7568 8FBF0010 */ lw $ra, 0x10($sp)
.L802B756C:
/* E22B1C 802B756C 03E00008 */ jr $ra
/* E22B20 802B7570 27BD0018 */ addiu $sp, $sp, 0x18
/* E22B24 802B7574 00000000 */ nop
/* E22B28 802B7578 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void ispy_notification_update(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PartnerStatus* partnerStatus = &gPartnerStatus;
s32 cond;
ISpyPtr->pos.y +=
(playerStatus->position.y + playerStatus->colliderHeight + 10.0f - ISpyPtr->pos.y) / 1.5f;
ISpyPtr->pos.x = playerStatus->position.x;
ISpyPtr->pos.z = playerStatus->position.z;
switch (ISpyPtr->state) {
case I_SPY_DELAY:
if (partnerStatus->partnerActionState != PARTNER_ACTION_NONE
&& partnerStatus->actingPartner == PARTNER_LAKILESTER
) {
cond = gGameStatusPtr->keepUsingPartnerOnMapChange;
} else {
cond = playerStatus->flags & (PS_FLAG_INPUT_DISABLED | PS_FLAG_NO_STATIC_COLLISION);
}
if (!cond) {
ISpyPtr->state++;
}
break;
case I_SPY_APPEAR:
if (playerStatus->flags & PS_FLAG_PAUSED) {
ISpyPtr->state = I_SPY_ANIMATE;
return;
}
if (ISpyPtr->time++ >= 16) {
ISpyPtr->scale = 0.36f;
ISpyPtr->state++;
}
break;
case I_SPY_OVERSHOOT:
ISpyPtr->scale = 0.57f;
ISpyPtr->state++;
sfx_play_sound_at_player(SOUND_17B, SOUND_SPACE_MODE_0);
break;
case I_SPY_ANIMATE:
ISpyPtr->scale = 0.53f;
if (ISpyPtr->time >= 47 || playerStatus->flags & PS_FLAG_PAUSED) {
ISpyPtr->alpha -= 64;
if (ISpyPtr->alpha < 0) {
ISpyPtr->alpha = 0;
ISpyPtr->time = 51;
}
}
if (ISpyPtr->time++ > 50) {
gCurrentHiddenPanels.activateISpy = FALSE;
ISpyNotificationCallback = NULL;
playerStatus->animFlags &= ~PA_FLAG_ISPY_VISIBLE;
}
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel moving_cloud_appendGfx
/* 3E1A4C E00E83BC 27BDFF50 */ addiu $sp, $sp, -0xB0
/* 3E1A50 E00E83C0 0080302D */ daddu $a2, $a0, $zero
/* 3E1A54 E00E83C4 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 3E1A58 E00E83C8 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3E1A5C E00E83CC 27A40010 */ addiu $a0, $sp, 0x10
/* 3E1A60 E00E83D0 AFB600A8 */ sw $s6, 0xA8($sp)
/* 3E1A64 E00E83D4 3C160001 */ lui $s6, (0x11630 >> 16)
/* 3E1A68 E00E83D8 AFB3009C */ sw $s3, 0x9C($sp)
/* 3E1A6C E00E83DC 3C13800A */ lui $s3, %hi(gMainGfxPos)
/* 3E1A70 E00E83E0 2673A66C */ addiu $s3, $s3, %lo(gMainGfxPos)
/* 3E1A74 E00E83E4 36D61630 */ ori $s6, $s6, (0x11630 & 0xFFFF)
/* 3E1A78 E00E83E8 AFBF00AC */ sw $ra, 0xAC($sp)
/* 3E1A7C E00E83EC AFB500A4 */ sw $s5, 0xA4($sp)
/* 3E1A80 E00E83F0 AFB400A0 */ sw $s4, 0xA0($sp)
/* 3E1A84 E00E83F4 AFB20098 */ sw $s2, 0x98($sp)
/* 3E1A88 E00E83F8 AFB10094 */ sw $s1, 0x94($sp)
/* 3E1A8C E00E83FC AFB00090 */ sw $s0, 0x90($sp)
/* 3E1A90 E00E8400 8E650000 */ lw $a1, 0x0($s3)
/* 3E1A94 E00E8404 8CD2000C */ lw $s2, 0xC($a2)
/* 3E1A98 E00E8408 00A0182D */ daddu $v1, $a1, $zero
/* 3E1A9C E00E840C 24A50008 */ addiu $a1, $a1, 0x8
/* 3E1AA0 E00E8410 AE650000 */ sw $a1, 0x0($s3)
/* 3E1AA4 E00E8414 8E550030 */ lw $s5, 0x30($s2)
/* 3E1AA8 E00E8418 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3E1AAC E00E841C AC620000 */ sw $v0, 0x0($v1)
/* 3E1AB0 E00E8420 AC600004 */ sw $zero, 0x4($v1)
/* 3E1AB4 E00E8424 ACA70000 */ sw $a3, 0x0($a1)
/* 3E1AB8 E00E8428 8CC30010 */ lw $v1, 0x10($a2)
/* 3E1ABC E00E842C 24A20008 */ addiu $v0, $a1, 0x8
/* 3E1AC0 E00E8430 AE620000 */ sw $v0, 0x0($s3)
/* 3E1AC4 E00E8434 8C62001C */ lw $v0, 0x1C($v1)
/* 3E1AC8 E00E8438 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 3E1ACC E00E843C 00431021 */ addu $v0, $v0, $v1
/* 3E1AD0 E00E8440 3C03800B */ lui $v1, %hi(gCameras)
/* 3E1AD4 E00E8444 24631D80 */ addiu $v1, $v1, %lo(gCameras)
/* 3E1AD8 E00E8448 ACA20004 */ sw $v0, 0x4($a1)
/* 3E1ADC E00E844C 8E450004 */ lw $a1, 0x4($s2)
/* 3E1AE0 E00E8450 8E460008 */ lw $a2, 0x8($s2)
/* 3E1AE4 E00E8454 3C028007 */ lui $v0, %hi(gCurrentCameraID)
/* 3E1AE8 E00E8458 8C427410 */ lw $v0, %lo(gCurrentCameraID)($v0)
/* 3E1AEC E00E845C 8E47000C */ lw $a3, 0xC($s2)
/* 3E1AF0 E00E8460 00028080 */ sll $s0, $v0, 2
/* 3E1AF4 E00E8464 02028021 */ addu $s0, $s0, $v0
/* 3E1AF8 E00E8468 00108080 */ sll $s0, $s0, 2
/* 3E1AFC E00E846C 02028023 */ subu $s0, $s0, $v0
/* 3E1B00 E00E8470 001010C0 */ sll $v0, $s0, 3
/* 3E1B04 E00E8474 02028021 */ addu $s0, $s0, $v0
/* 3E1B08 E00E8478 001080C0 */ sll $s0, $s0, 3
/* 3E1B0C E00E847C 0C080108 */ jal shim_guTranslateF
/* 3E1B10 E00E8480 02038021 */ addu $s0, $s0, $v1
/* 3E1B14 E00E8484 27B10050 */ addiu $s1, $sp, 0x50
/* 3E1B18 E00E8488 8E450044 */ lw $a1, 0x44($s2)
/* 3E1B1C E00E848C 0220202D */ daddu $a0, $s1, $zero
/* 3E1B20 E00E8490 00A0302D */ daddu $a2, $a1, $zero
/* 3E1B24 E00E8494 0C080110 */ jal shim_guScaleF
/* 3E1B28 E00E8498 00A0382D */ daddu $a3, $a1, $zero
/* 3E1B2C E00E849C 0220202D */ daddu $a0, $s1, $zero
/* 3E1B30 E00E84A0 27A50010 */ addiu $a1, $sp, 0x10
/* 3E1B34 E00E84A4 0C080114 */ jal shim_guMtxCatF
/* 3E1B38 E00E84A8 00A0302D */ daddu $a2, $a1, $zero
/* 3E1B3C E00E84AC 27A40010 */ addiu $a0, $sp, 0x10
/* 3E1B40 E00E84B0 3C118007 */ lui $s1, %hi(gMatrixListPos)
/* 3E1B44 E00E84B4 263141F0 */ addiu $s1, $s1, %lo(gMatrixListPos)
/* 3E1B48 E00E84B8 3C14800A */ lui $s4, %hi(gDisplayContext)
/* 3E1B4C E00E84BC 2694A674 */ addiu $s4, $s4, %lo(gDisplayContext)
/* 3E1B50 E00E84C0 96250000 */ lhu $a1, 0x0($s1)
/* 3E1B54 E00E84C4 8E820000 */ lw $v0, 0x0($s4)
/* 3E1B58 E00E84C8 00052980 */ sll $a1, $a1, 6
/* 3E1B5C E00E84CC 00B62821 */ addu $a1, $a1, $s6
/* 3E1B60 E00E84D0 0C080118 */ jal shim_guMtxF2L
/* 3E1B64 E00E84D4 00452821 */ addu $a1, $v0, $a1
/* 3E1B68 E00E84D8 3C03DA38 */ lui $v1, (0xDA380002 >> 16)
/* 3E1B6C E00E84DC 34630002 */ ori $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3E1B70 E00E84E0 3C06DA38 */ lui $a2, (0xDA380001 >> 16)
/* 3E1B74 E00E84E4 34C60001 */ ori $a2, $a2, (0xDA380001 & 0xFFFF)
/* 3E1B78 E00E84E8 3C09D838 */ lui $t1, (0xD8380002 >> 16)
/* 3E1B7C E00E84EC 35290002 */ ori $t1, $t1, (0xD8380002 & 0xFFFF)
/* 3E1B80 E00E84F0 32B500FF */ andi $s5, $s5, 0xFF
/* 3E1B84 E00E84F4 3C07DE00 */ lui $a3, (0xDE000000 >> 16)
/* 3E1B88 E00E84F8 8E640000 */ lw $a0, 0x0($s3)
/* 3E1B8C E00E84FC 96220000 */ lhu $v0, 0x0($s1)
/* 3E1B90 E00E8500 0080282D */ daddu $a1, $a0, $zero
/* 3E1B94 E00E8504 24840008 */ addiu $a0, $a0, 0x8
/* 3E1B98 E00E8508 AE640000 */ sw $a0, 0x0($s3)
/* 3E1B9C E00E850C ACA30000 */ sw $v1, 0x0($a1)
/* 3E1BA0 E00E8510 24430001 */ addiu $v1, $v0, 0x1
/* 3E1BA4 E00E8514 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 3E1BA8 E00E8518 00021180 */ sll $v0, $v0, 6
/* 3E1BAC E00E851C A6230000 */ sh $v1, 0x0($s1)
/* 3E1BB0 E00E8520 8E830000 */ lw $v1, 0x0($s4)
/* 3E1BB4 E00E8524 00561021 */ addu $v0, $v0, $s6
/* 3E1BB8 E00E8528 00621821 */ addu $v1, $v1, $v0
/* 3E1BBC E00E852C 24820008 */ addiu $v0, $a0, 0x8
/* 3E1BC0 E00E8530 ACA30004 */ sw $v1, 0x4($a1)
/* 3E1BC4 E00E8534 AE620000 */ sw $v0, 0x0($s3)
/* 3E1BC8 E00E8538 24820010 */ addiu $v0, $a0, 0x10
/* 3E1BCC E00E853C AC860000 */ sw $a2, 0x0($a0)
/* 3E1BD0 E00E8540 AE620000 */ sw $v0, 0x0($s3)
/* 3E1BD4 E00E8544 8E030204 */ lw $v1, 0x204($s0)
/* 3E1BD8 E00E8548 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 3E1BDC E00E854C AC820008 */ sw $v0, 0x8($a0)
/* 3E1BE0 E00E8550 AC830004 */ sw $v1, 0x4($a0)
/* 3E1BE4 E00E8554 92420027 */ lbu $v0, 0x27($s2)
/* 3E1BE8 E00E8558 9245002B */ lbu $a1, 0x2B($s2)
/* 3E1BEC E00E855C 9246002F */ lbu $a2, 0x2F($s2)
/* 3E1BF0 E00E8560 24830018 */ addiu $v1, $a0, 0x18
/* 3E1BF4 E00E8564 AE630000 */ sw $v1, 0x0($s3)
/* 3E1BF8 E00E8568 3C03FB00 */ lui $v1, (0xFB000000 >> 16)
/* 3E1BFC E00E856C AC830010 */ sw $v1, 0x10($a0)
/* 3E1C00 E00E8570 00021600 */ sll $v0, $v0, 24
/* 3E1C04 E00E8574 00052C00 */ sll $a1, $a1, 16
/* 3E1C08 E00E8578 00451025 */ or $v0, $v0, $a1
/* 3E1C0C E00E857C 00063200 */ sll $a2, $a2, 8
/* 3E1C10 E00E8580 00461025 */ or $v0, $v0, $a2
/* 3E1C14 E00E8584 00551025 */ or $v0, $v0, $s5
/* 3E1C18 E00E8588 AC82000C */ sw $v0, 0xC($a0)
/* 3E1C1C E00E858C 92420037 */ lbu $v0, 0x37($s2)
/* 3E1C20 E00E8590 9245003B */ lbu $a1, 0x3B($s2)
/* 3E1C24 E00E8594 9246003F */ lbu $a2, 0x3F($s2)
/* 3E1C28 E00E8598 92480043 */ lbu $t0, 0x43($s2)
/* 3E1C2C E00E859C 24830020 */ addiu $v1, $a0, 0x20
/* 3E1C30 E00E85A0 AE630000 */ sw $v1, 0x0($s3)
/* 3E1C34 E00E85A4 AC870018 */ sw $a3, 0x18($a0)
/* 3E1C38 E00E85A8 00021600 */ sll $v0, $v0, 24
/* 3E1C3C E00E85AC 00052C00 */ sll $a1, $a1, 16
/* 3E1C40 E00E85B0 00451025 */ or $v0, $v0, $a1
/* 3E1C44 E00E85B4 00063200 */ sll $a2, $a2, 8
/* 3E1C48 E00E85B8 00461025 */ or $v0, $v0, $a2
/* 3E1C4C E00E85BC 00481025 */ or $v0, $v0, $t0
/* 3E1C50 E00E85C0 AC820014 */ sw $v0, 0x14($a0)
/* 3E1C54 E00E85C4 3C03E00F */ lui $v1, (0xE00F0000 >> 16)
/* 3E1C58 E00E85C8 8C638634 */ lw $v1, -0x79CC($v1)
/* 3E1C5C E00E85CC 24820028 */ addiu $v0, $a0, 0x28
/* 3E1C60 E00E85D0 AE620000 */ sw $v0, 0x0($s3)
/* 3E1C64 E00E85D4 AC870020 */ sw $a3, 0x20($a0)
/* 3E1C68 E00E85D8 AC83001C */ sw $v1, 0x1C($a0)
/* 3E1C6C E00E85DC 3C03E00F */ lui $v1, (0xE00F0000 >> 16)
/* 3E1C70 E00E85E0 8C638630 */ lw $v1, -0x79D0($v1)
/* 3E1C74 E00E85E4 24820030 */ addiu $v0, $a0, 0x30
/* 3E1C78 E00E85E8 AE620000 */ sw $v0, 0x0($s3)
/* 3E1C7C E00E85EC 24020040 */ addiu $v0, $zero, 0x40
/* 3E1C80 E00E85F0 AC830024 */ sw $v1, 0x24($a0)
/* 3E1C84 E00E85F4 AC890028 */ sw $t1, 0x28($a0)
/* 3E1C88 E00E85F8 AC82002C */ sw $v0, 0x2C($a0)
/* 3E1C8C E00E85FC 8FBF00AC */ lw $ra, 0xAC($sp)
/* 3E1C90 E00E8600 8FB600A8 */ lw $s6, 0xA8($sp)
/* 3E1C94 E00E8604 8FB500A4 */ lw $s5, 0xA4($sp)
/* 3E1C98 E00E8608 8FB400A0 */ lw $s4, 0xA0($sp)
/* 3E1C9C E00E860C 8FB3009C */ lw $s3, 0x9C($sp)
/* 3E1CA0 E00E8610 8FB20098 */ lw $s2, 0x98($sp)
/* 3E1CA4 E00E8614 8FB10094 */ lw $s1, 0x94($sp)
/* 3E1CA8 E00E8618 8FB00090 */ lw $s0, 0x90($sp)
/* 3E1CAC E00E861C 03E00008 */ jr $ra
/* 3E1CB0 E00E8620 27BD00B0 */ addiu $sp, $sp, 0xB0
/* 3E1CB4 E00E8624 00000000 */ nop
/* 3E1CB8 E00E8628 00000000 */ nop
/* 3E1CBC E00E862C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void moving_cloud_appendGfx(void* effect) {
MovingCloudFXData* data = ((EffectInstance*)effect)->data.movingCloud;
Camera* camera = &gCameras[gCurrentCameraID];
s32 unk_30 = data->unk_30;
Matrix4f sp10;
Matrix4f sp50;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
shim_guScaleF(sp50, data->unk_44, data->unk_44, data->unk_44);
shim_guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_24, data->unk_28, data->unk_2C, unk_30);
gDPSetEnvColor(gMainGfxPos++, data->unk_34, data->unk_38, data->unk_3C, data->unk_40);
gSPDisplayList(gMainGfxPos++, D_E00E8634[0]);
gSPDisplayList(gMainGfxPos++, D_E00E8630[0]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel ShakeCam
/* EFC58 802CB2A8 27BDFFC0 */ addiu $sp, $sp, -0x40
/* EFC5C 802CB2AC AFB5002C */ sw $s5, 0x2C($sp)
/* EFC60 802CB2B0 0080A82D */ daddu $s5, $a0, $zero
/* EFC64 802CB2B4 AFB20020 */ sw $s2, 0x20($sp)
/* EFC68 802CB2B8 00A0902D */ daddu $s2, $a1, $zero
/* EFC6C 802CB2BC AFBF0030 */ sw $ra, 0x30($sp)
/* EFC70 802CB2C0 AFB40028 */ sw $s4, 0x28($sp)
/* EFC74 802CB2C4 AFB30024 */ sw $s3, 0x24($sp)
/* EFC78 802CB2C8 AFB1001C */ sw $s1, 0x1C($sp)
/* EFC7C 802CB2CC AFB00018 */ sw $s0, 0x18($sp)
/* EFC80 802CB2D0 F7B40038 */ sdc1 $f20, 0x38($sp)
/* EFC84 802CB2D4 8EB0000C */ lw $s0, 0xC($s5)
/* EFC88 802CB2D8 8E050000 */ lw $a1, 0x0($s0)
/* EFC8C 802CB2DC 0C0B1EAF */ jal evt_get_variable
/* EFC90 802CB2E0 26100004 */ addiu $s0, $s0, 0x4
/* EFC94 802CB2E4 8E050000 */ lw $a1, 0x0($s0)
/* EFC98 802CB2E8 26100004 */ addiu $s0, $s0, 0x4
/* EFC9C 802CB2EC 02A0202D */ daddu $a0, $s5, $zero
/* EFCA0 802CB2F0 0C0B1EAF */ jal evt_get_variable
/* EFCA4 802CB2F4 0040882D */ daddu $s1, $v0, $zero
/* EFCA8 802CB2F8 8E050000 */ lw $a1, 0x0($s0)
/* EFCAC 802CB2FC 26100004 */ addiu $s0, $s0, 0x4
/* EFCB0 802CB300 02A0202D */ daddu $a0, $s5, $zero
/* EFCB4 802CB304 0C0B1EAF */ jal evt_get_variable
/* EFCB8 802CB308 0040982D */ daddu $s3, $v0, $zero
/* EFCBC 802CB30C 0040A02D */ daddu $s4, $v0, $zero
/* EFCC0 802CB310 8E050000 */ lw $a1, 0x0($s0)
/* EFCC4 802CB314 0C0B210B */ jal evt_get_float_variable
/* EFCC8 802CB318 02A0202D */ daddu $a0, $s5, $zero
/* EFCCC 802CB31C 3C04800B */ lui $a0, %hi(gCameras)
/* EFCD0 802CB320 24841D80 */ addiu $a0, $a0, %lo(gCameras)
/* EFCD4 802CB324 00111080 */ sll $v0, $s1, 2
/* EFCD8 802CB328 00511021 */ addu $v0, $v0, $s1
/* EFCDC 802CB32C 00021080 */ sll $v0, $v0, 2
/* EFCE0 802CB330 00511023 */ subu $v0, $v0, $s1
/* EFCE4 802CB334 000218C0 */ sll $v1, $v0, 3
/* EFCE8 802CB338 00431021 */ addu $v0, $v0, $v1
/* EFCEC 802CB33C 000210C0 */ sll $v0, $v0, 3
/* EFCF0 802CB340 00448021 */ addu $s0, $v0, $a0
/* EFCF4 802CB344 12400031 */ beqz $s2, .L802CB40C
/* EFCF8 802CB348 46000500 */ add.s $f20, $f0, $f0
/* EFCFC 802CB34C 06600005 */ bltz $s3, .L802CB364
/* EFD00 802CB350 2A620002 */ slti $v0, $s3, 0x2
/* EFD04 802CB354 14400003 */ bnez $v0, .L802CB364
/* EFD08 802CB358 24020002 */ addiu $v0, $zero, 0x2
/* EFD0C 802CB35C 52620001 */ beql $s3, $v0, .L802CB364
/* EFD10 802CB360 0054A004 */ sllv $s4, $s4, $v0
.L802CB364:
/* EFD14 802CB364 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* EFD18 802CB368 44810000 */ mtc1 $at, $f0
/* EFD1C 802CB36C 00000000 */ nop
/* EFD20 802CB370 E6A0007C */ swc1 $f0, 0x7C($s5)
/* EFD24 802CB374 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* EFD28 802CB378 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* EFD2C 802CB37C AEB40074 */ sw $s4, 0x74($s5)
/* EFD30 802CB380 80420070 */ lb $v0, 0x70($v0)
/* EFD34 802CB384 14400021 */ bnez $v0, .L802CB40C
/* EFD38 802CB388 00000000 */ nop
/* EFD3C 802CB38C 3C014120 */ lui $at, (0x41200000 >> 16)
/* EFD40 802CB390 44810000 */ mtc1 $at, $f0
/* EFD44 802CB394 00000000 */ nop
/* EFD48 802CB398 4614003C */ c.lt.s $f0, $f20
/* EFD4C 802CB39C 00000000 */ nop
/* EFD50 802CB3A0 45030001 */ bc1tl .L802CB3A8
/* EFD54 802CB3A4 46000506 */ mov.s $f20, $f0
.L802CB3A8:
/* EFD58 802CB3A8 3C0140C0 */ lui $at, (0x40C00000 >> 16)
/* EFD5C 802CB3AC 44810000 */ mtc1 $at, $f0
/* EFD60 802CB3B0 00000000 */ nop
/* EFD64 802CB3B4 4614003C */ c.lt.s $f0, $f20
/* EFD68 802CB3B8 00000000 */ nop
/* EFD6C 802CB3BC 45000002 */ bc1f .L802CB3C8
/* EFD70 802CB3C0 4600A086 */ mov.s $f2, $f20
/* EFD74 802CB3C4 46000086 */ mov.s $f2, $f0
.L802CB3C8:
/* EFD78 802CB3C8 3C014200 */ lui $at, (0x42000000 >> 16)
/* EFD7C 802CB3CC 44810000 */ mtc1 $at, $f0
/* EFD80 802CB3D0 00000000 */ nop
/* EFD84 802CB3D4 46001002 */ mul.s $f0, $f2, $f0
/* EFD88 802CB3D8 00000000 */ nop
/* EFD8C 802CB3DC 0280282D */ daddu $a1, $s4, $zero
/* EFD90 802CB3E0 3C014280 */ lui $at, (0x42800000 >> 16)
/* EFD94 802CB3E4 44811000 */ mtc1 $at, $f2
/* EFD98 802CB3E8 2A820005 */ slti $v0, $s4, 0x5
/* EFD9C 802CB3EC 10400002 */ beqz $v0, .L802CB3F8
/* EFDA0 802CB3F0 46020080 */ add.s $f2, $f0, $f2
/* EFDA4 802CB3F4 24050005 */ addiu $a1, $zero, 0x5
.L802CB3F8:
/* EFDA8 802CB3F8 4600110D */ trunc.w.s $f4, $f2
/* EFDAC 802CB3FC 44042000 */ mfc1 $a0, $f4
/* EFDB0 802CB400 30A5FFFF */ andi $a1, $a1, 0xFFFF
/* EFDB4 802CB404 0C00A3C2 */ jal start_rumble
/* EFDB8 802CB408 00052840 */ sll $a1, $a1, 1
.L802CB40C:
/* EFDBC 802CB40C 96020000 */ lhu $v0, 0x0($s0)
/* EFDC0 802CB410 34420008 */ ori $v0, $v0, 0x8
/* EFDC4 802CB414 A6020000 */ sh $v0, 0x0($s0)
/* EFDC8 802CB418 24020001 */ addiu $v0, $zero, 0x1
/* EFDCC 802CB41C C6A2007C */ lwc1 $f2, 0x7C($s5)
/* EFDD0 802CB420 12620016 */ beq $s3, $v0, .L802CB47C
/* EFDD4 802CB424 2A620002 */ slti $v0, $s3, 0x2
/* EFDD8 802CB428 10400005 */ beqz $v0, .L802CB440
/* EFDDC 802CB42C 24020002 */ addiu $v0, $zero, 0x2
/* EFDE0 802CB430 52600007 */ beql $s3, $zero, .L802CB450
/* EFDE4 802CB434 46001007 */ neg.s $f0, $f2
/* EFDE8 802CB438 080B2D47 */ j .L802CB51C
/* EFDEC 802CB43C 00000000 */ nop
.L802CB440:
/* EFDF0 802CB440 5262001B */ beql $s3, $v0, .L802CB4B0
/* EFDF4 802CB444 46001007 */ neg.s $f0, $f2
/* EFDF8 802CB448 080B2D47 */ j .L802CB51C
/* EFDFC 802CB44C 00000000 */ nop
.L802CB450:
/* EFE00 802CB450 46140002 */ mul.s $f0, $f0, $f20
/* EFE04 802CB454 00000000 */ nop
/* EFE08 802CB458 44060000 */ mfc1 $a2, $f0
/* EFE0C 802CB45C 44800000 */ mtc1 $zero, $f0
/* EFE10 802CB460 00000000 */ nop
/* EFE14 802CB464 44050000 */ mfc1 $a1, $f0
/* EFE18 802CB468 26040194 */ addiu $a0, $s0, 0x194
/* EFE1C 802CB46C 0C019E40 */ jal guTranslateF
/* EFE20 802CB470 00A0382D */ daddu $a3, $a1, $zero
/* EFE24 802CB474 080B2D44 */ j .L802CB510
/* EFE28 802CB478 00000000 */ nop
.L802CB47C:
/* EFE2C 802CB47C 46141082 */ mul.s $f2, $f2, $f20
/* EFE30 802CB480 00000000 */ nop
/* EFE34 802CB484 44800000 */ mtc1 $zero, $f0
/* EFE38 802CB488 26040194 */ addiu $a0, $s0, 0x194
/* EFE3C 802CB48C 44060000 */ mfc1 $a2, $f0
/* EFE40 802CB490 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* EFE44 802CB494 44810000 */ mtc1 $at, $f0
/* EFE48 802CB498 44051000 */ mfc1 $a1, $f2
/* EFE4C 802CB49C 00C0382D */ daddu $a3, $a2, $zero
/* EFE50 802CB4A0 0C019EC8 */ jal guRotateF
/* EFE54 802CB4A4 E7A00010 */ swc1 $f0, 0x10($sp)
/* EFE58 802CB4A8 080B2D44 */ j .L802CB510
/* EFE5C 802CB4AC 00000000 */ nop
.L802CB4B0:
/* EFE60 802CB4B0 46140002 */ mul.s $f0, $f0, $f20
/* EFE64 802CB4B4 00000000 */ nop
/* EFE68 802CB4B8 44060000 */ mfc1 $a2, $f0
/* EFE6C 802CB4BC 44800000 */ mtc1 $zero, $f0
/* EFE70 802CB4C0 00000000 */ nop
/* EFE74 802CB4C4 44050000 */ mfc1 $a1, $f0
/* EFE78 802CB4C8 26040194 */ addiu $a0, $s0, 0x194
/* EFE7C 802CB4CC 0C019E40 */ jal guTranslateF
/* EFE80 802CB4D0 00A0382D */ daddu $a3, $a1, $zero
/* EFE84 802CB4D4 8EA30074 */ lw $v1, 0x74($s5)
/* EFE88 802CB4D8 00141040 */ sll $v0, $s4, 1
/* EFE8C 802CB4DC 0062102A */ slt $v0, $v1, $v0
/* EFE90 802CB4E0 1040000B */ beqz $v0, .L802CB510
/* EFE94 802CB4E4 0283102A */ slt $v0, $s4, $v1
/* EFE98 802CB4E8 10400009 */ beqz $v0, .L802CB510
/* EFE9C 802CB4EC 00000000 */ nop
/* EFEA0 802CB4F0 C6A0007C */ lwc1 $f0, 0x7C($s5)
/* EFEA4 802CB4F4 3C01802E */ lui $at, %hi(D_802DA1D0)
/* EFEA8 802CB4F8 D422A1D0 */ ldc1 $f2, %lo(D_802DA1D0)($at)
/* EFEAC 802CB4FC 46000021 */ cvt.d.s $f0, $f0
/* EFEB0 802CB500 46220002 */ mul.d $f0, $f0, $f2
/* EFEB4 802CB504 00000000 */ nop
/* EFEB8 802CB508 080B2D46 */ j .L802CB518
/* EFEBC 802CB50C 46200020 */ cvt.s.d $f0, $f0
.L802CB510:
/* EFEC0 802CB510 C6A0007C */ lwc1 $f0, 0x7C($s5)
/* EFEC4 802CB514 46000007 */ neg.s $f0, $f0
.L802CB518:
/* EFEC8 802CB518 E6A0007C */ swc1 $f0, 0x7C($s5)
.L802CB51C:
/* EFECC 802CB51C 8EA20074 */ lw $v0, 0x74($s5)
/* EFED0 802CB520 10400004 */ beqz $v0, .L802CB534
/* EFED4 802CB524 2442FFFF */ addiu $v0, $v0, -0x1
/* EFED8 802CB528 AEA20074 */ sw $v0, 0x74($s5)
/* EFEDC 802CB52C 080B2D51 */ j .L802CB544
/* EFEE0 802CB530 0000102D */ daddu $v0, $zero, $zero
.L802CB534:
/* EFEE4 802CB534 96030000 */ lhu $v1, 0x0($s0)
/* EFEE8 802CB538 24020002 */ addiu $v0, $zero, 0x2
/* EFEEC 802CB53C 3063FFF7 */ andi $v1, $v1, 0xFFF7
/* EFEF0 802CB540 A6030000 */ sh $v1, 0x0($s0)
.L802CB544:
/* EFEF4 802CB544 8FBF0030 */ lw $ra, 0x30($sp)
/* EFEF8 802CB548 8FB5002C */ lw $s5, 0x2C($sp)
/* EFEFC 802CB54C 8FB40028 */ lw $s4, 0x28($sp)
/* EFF00 802CB550 8FB30024 */ lw $s3, 0x24($sp)
/* EFF04 802CB554 8FB20020 */ lw $s2, 0x20($sp)
/* EFF08 802CB558 8FB1001C */ lw $s1, 0x1C($sp)
/* EFF0C 802CB55C 8FB00018 */ lw $s0, 0x18($sp)
/* EFF10 802CB560 D7B40038 */ ldc1 $f20, 0x38($sp)
/* EFF14 802CB564 03E00008 */ jr $ra
/* EFF18 802CB568 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
EvtScript ShakeCam1 = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, LVar0, LVar1, LVar2, EVT_FLOAT(1.0))
EVT_RETURN
EVT_END
};
EvtScript ShakeCamX = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(ShakeCam, LVar0, LVar1, LVar2, LVar3)
EVT_RETURN
EVT_END
};
ApiStatus SetCamEnabled(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 id = evt_get_variable(script, *args++);
s32 enabled = evt_get_variable(script, *args++);
if (!enabled) {
gCameras[id].flags |= CAMERA_FLAG_DISABLED;
} else {
gCameras[id].flags &= ~CAMERA_FLAG_DISABLED;
}
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel start_child_script
/* E8178 802C37C8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* E817C 802C37CC AFB10014 */ sw $s1, 0x14($sp)
/* E8180 802C37D0 0080882D */ daddu $s1, $a0, $zero
/* E8184 802C37D4 AFB20018 */ sw $s2, 0x18($sp)
/* E8188 802C37D8 00A0902D */ daddu $s2, $a1, $zero
/* E818C 802C37DC AFB40020 */ sw $s4, 0x20($sp)
/* E8190 802C37E0 00C0A02D */ daddu $s4, $a2, $zero
/* E8194 802C37E4 3C04802E */ lui $a0, %hi(gCurrentScriptListPtr)
/* E8198 802C37E8 8C84A890 */ lw $a0, %lo(gCurrentScriptListPtr)($a0)
/* E819C 802C37EC 0000182D */ daddu $v1, $zero, $zero
/* E81A0 802C37F0 AFBF0024 */ sw $ra, 0x24($sp)
/* E81A4 802C37F4 AFB3001C */ sw $s3, 0x1C($sp)
/* E81A8 802C37F8 AFB00010 */ sw $s0, 0x10($sp)
.L802C37FC:
/* E81AC 802C37FC 8C820000 */ lw $v0, 0x0($a0)
/* E81B0 802C3800 10400006 */ beqz $v0, .L802C381C
/* E81B4 802C3804 28620080 */ slti $v0, $v1, 0x80
/* E81B8 802C3808 24630001 */ addiu $v1, $v1, 0x1
/* E81BC 802C380C 28620080 */ slti $v0, $v1, 0x80
/* E81C0 802C3810 1440FFFA */ bnez $v0, .L802C37FC
/* E81C4 802C3814 24840004 */ addiu $a0, $a0, 0x4
/* E81C8 802C3818 28620080 */ slti $v0, $v1, 0x80
.L802C381C:
/* E81CC 802C381C 54400003 */ bnel $v0, $zero, .L802C382C
/* E81D0 802C3820 24040168 */ addiu $a0, $zero, 0x168
.L802C3824:
/* E81D4 802C3824 080B0E09 */ j .L802C3824
/* E81D8 802C3828 00000000 */ nop
.L802C382C:
/* E81DC 802C382C 0C00AB39 */ jal heap_malloc
/* E81E0 802C3830 0060982D */ daddu $s3, $v1, $zero
/* E81E4 802C3834 00132080 */ sll $a0, $s3, 2
/* E81E8 802C3838 3C03802E */ lui $v1, %hi(gCurrentScriptListPtr)
/* E81EC 802C383C 8C63A890 */ lw $v1, %lo(gCurrentScriptListPtr)($v1)
/* E81F0 802C3840 3C05802E */ lui $a1, %hi(gNumScripts)
/* E81F4 802C3844 24A5A488 */ addiu $a1, $a1, %lo(gNumScripts)
/* E81F8 802C3848 00832021 */ addu $a0, $a0, $v1
/* E81FC 802C384C 8CA30000 */ lw $v1, 0x0($a1)
/* E8200 802C3850 0040802D */ daddu $s0, $v0, $zero
/* E8204 802C3854 AC900000 */ sw $s0, 0x0($a0)
/* E8208 802C3858 24630001 */ addiu $v1, $v1, 0x1
/* E820C 802C385C 16000003 */ bnez $s0, .L802C386C
/* E8210 802C3860 ACA30000 */ sw $v1, 0x0($a1)
.L802C3864:
/* E8214 802C3864 080B0E19 */ j .L802C3864
/* E8218 802C3868 00000000 */ nop
.L802C386C:
/* E821C 802C386C 92220000 */ lbu $v0, 0x0($s1)
/* E8220 802C3870 AE300068 */ sw $s0, 0x68($s1)
/* E8224 802C3874 34420010 */ ori $v0, $v0, 0x10
/* E8228 802C3878 A2220000 */ sb $v0, 0x0($s1)
/* E822C 802C387C 36820001 */ ori $v0, $s4, 0x1
/* E8230 802C3880 A2020000 */ sb $v0, 0x0($s0)
/* E8234 802C3884 AE120008 */ sw $s2, 0x8($s0)
/* E8238 802C3888 AE12015C */ sw $s2, 0x15C($s0)
/* E823C 802C388C AE120164 */ sw $s2, 0x164($s0)
/* E8240 802C3890 A2000002 */ sb $zero, 0x2($s0)
/* E8244 802C3894 AE000060 */ sw $zero, 0x60($s0)
/* E8248 802C3898 AE110064 */ sw $s1, 0x64($s0)
/* E824C 802C389C AE000068 */ sw $zero, 0x68($s0)
/* E8250 802C38A0 AE00006C */ sw $zero, 0x6C($s0)
/* E8254 802C38A4 92220003 */ lbu $v0, 0x3($s1)
/* E8258 802C38A8 3C04802E */ lui $a0, %hi(gStaticScriptCounter)
/* E825C 802C38AC 24849CA0 */ addiu $a0, $a0, %lo(gStaticScriptCounter)
/* E8260 802C38B0 24420001 */ addiu $v0, $v0, 0x1
/* E8264 802C38B4 A2020003 */ sb $v0, 0x3($s0)
/* E8268 802C38B8 8C820000 */ lw $v0, 0x0($a0)
/* E826C 802C38BC AE020144 */ sw $v0, 0x144($s0)
/* E8270 802C38C0 8E230148 */ lw $v1, 0x148($s1)
/* E8274 802C38C4 24420001 */ addiu $v0, $v0, 0x1
/* E8278 802C38C8 AC820000 */ sw $v0, 0x0($a0)
/* E827C 802C38CC AE030148 */ sw $v1, 0x148($s0)
/* E8280 802C38D0 8E23014C */ lw $v1, 0x14C($s1)
/* E8284 802C38D4 2402FFFF */ addiu $v0, $zero, -0x1
/* E8288 802C38D8 A2020006 */ sb $v0, 0x6($s0)
/* E828C 802C38DC A2020007 */ sb $v0, 0x7($s0)
/* E8290 802C38E0 AE03014C */ sw $v1, 0x14C($s0)
/* E8294 802C38E4 92220004 */ lbu $v0, 0x4($s1)
/* E8298 802C38E8 0220282D */ daddu $a1, $s1, $zero
/* E829C 802C38EC AE000160 */ sw $zero, 0x160($s0)
/* E82A0 802C38F0 A2020004 */ sb $v0, 0x4($s0)
/* E82A4 802C38F4 8E22013C */ lw $v0, 0x13C($s1)
/* E82A8 802C38F8 3C01802E */ lui $at, %hi(gGlobalTimeSpace)
/* E82AC 802C38FC C4209CA8 */ lwc1 $f0, %lo(gGlobalTimeSpace)($at)
/* E82B0 802C3900 0200202D */ daddu $a0, $s0, $zero
/* E82B4 802C3904 AE02013C */ sw $v0, 0x13C($s0)
/* E82B8 802C3908 8E220140 */ lw $v0, 0x140($s1)
/* E82BC 802C390C 0000182D */ daddu $v1, $zero, $zero
/* E82C0 802C3910 E6000150 */ swc1 $f0, 0x150($s0)
/* E82C4 802C3914 AE000154 */ sw $zero, 0x154($s0)
/* E82C8 802C3918 AE020140 */ sw $v0, 0x140($s0)
/* E82CC 802C391C AE000158 */ sw $zero, 0x158($s0)
.L802C3920:
/* E82D0 802C3920 8CA20084 */ lw $v0, 0x84($a1)
/* E82D4 802C3924 24A50004 */ addiu $a1, $a1, 0x4
/* E82D8 802C3928 24630001 */ addiu $v1, $v1, 0x1
/* E82DC 802C392C AC820084 */ sw $v0, 0x84($a0)
/* E82E0 802C3930 28620010 */ slti $v0, $v1, 0x10
/* E82E4 802C3934 1440FFFA */ bnez $v0, .L802C3920
/* E82E8 802C3938 24840004 */ addiu $a0, $a0, 0x4
/* E82EC 802C393C 0000182D */ daddu $v1, $zero, $zero
/* E82F0 802C3940 0220202D */ daddu $a0, $s1, $zero
/* E82F4 802C3944 0200282D */ daddu $a1, $s0, $zero
.L802C3948:
/* E82F8 802C3948 8C8200C4 */ lw $v0, 0xC4($a0)
/* E82FC 802C394C 24840004 */ addiu $a0, $a0, 0x4
/* E8300 802C3950 24630001 */ addiu $v1, $v1, 0x1
/* E8304 802C3954 ACA200C4 */ sw $v0, 0xC4($a1)
/* E8308 802C3958 28620003 */ slti $v0, $v1, 0x3
/* E830C 802C395C 1440FFFA */ bnez $v0, .L802C3948
/* E8310 802C3960 24A50004 */ addiu $a1, $a1, 0x4
/* E8314 802C3964 0C0B0C52 */ jal find_script_labels
/* E8318 802C3968 0200202D */ daddu $a0, $s0, $zero
/* E831C 802C396C 3C02802E */ lui $v0, %hi(gIsUpdatingScripts)
/* E8320 802C3970 8C429CA4 */ lw $v0, %lo(gIsUpdatingScripts)($v0)
/* E8324 802C3974 1040000E */ beqz $v0, .L802C39B0
/* E8328 802C3978 00000000 */ nop
/* E832C 802C397C 3C05802E */ lui $a1, %hi(gScriptListCount)
/* E8330 802C3980 24A5AC98 */ addiu $a1, $a1, %lo(gScriptListCount)
/* E8334 802C3984 8CA20000 */ lw $v0, 0x0($a1)
/* E8338 802C3988 00022080 */ sll $a0, $v0, 2
/* E833C 802C398C 3C01802E */ lui $at, %hi(gScriptIndexList)
/* E8340 802C3990 00240821 */ addu $at, $at, $a0
/* E8344 802C3994 AC33A898 */ sw $s3, %lo(gScriptIndexList)($at)
/* E8348 802C3998 8E030144 */ lw $v1, 0x144($s0)
/* E834C 802C399C 24420001 */ addiu $v0, $v0, 0x1
/* E8350 802C39A0 ACA20000 */ sw $v0, 0x0($a1)
/* E8354 802C39A4 3C01802E */ lui $at, %hi(gScriptIdList)
/* E8358 802C39A8 00240821 */ addu $at, $at, $a0
/* E835C 802C39AC AC23AA98 */ sw $v1, %lo(gScriptIdList)($at)
.L802C39B0:
/* E8360 802C39B0 0C0B0CE4 */ jal suspend_frozen_scripts
/* E8364 802C39B4 0200202D */ daddu $a0, $s0, $zero
/* E8368 802C39B8 3C03802E */ lui $v1, %hi(gStaticScriptCounter)
/* E836C 802C39BC 24639CA0 */ addiu $v1, $v1, %lo(gStaticScriptCounter)
/* E8370 802C39C0 8C620000 */ lw $v0, 0x0($v1)
/* E8374 802C39C4 14400004 */ bnez $v0, .L802C39D8
/* E8378 802C39C8 0200102D */ daddu $v0, $s0, $zero
/* E837C 802C39CC 24020001 */ addiu $v0, $zero, 0x1
/* E8380 802C39D0 AC620000 */ sw $v0, 0x0($v1)
/* E8384 802C39D4 0200102D */ daddu $v0, $s0, $zero
.L802C39D8:
/* E8388 802C39D8 8FBF0024 */ lw $ra, 0x24($sp)
/* E838C 802C39DC 8FB40020 */ lw $s4, 0x20($sp)
/* E8390 802C39E0 8FB3001C */ lw $s3, 0x1C($sp)
/* E8394 802C39E4 8FB20018 */ lw $s2, 0x18($sp)
/* E8398 802C39E8 8FB10014 */ lw $s1, 0x14($sp)
/* E839C 802C39EC 8FB00010 */ lw $s0, 0x10($sp)
/* E83A0 802C39F0 03E00008 */ jr $ra
/* E83A4 802C39F4 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
Evt* start_child_script(Evt* parentScript, EvtScript* source, s32 flags) {
s32 curScriptIndex;
s32 scriptListCount;
Evt* child;
s32 i;
for (i = 0; i < MAX_SCRIPTS; i++) {
if ((*gCurrentScriptListPtr)[i] == NULL) {
break;
}
}
ASSERT(i < MAX_SCRIPTS);
curScriptIndex = i;
(*gCurrentScriptListPtr)[curScriptIndex] = child = heap_malloc(sizeof(*child));
gNumScripts++;
ASSERT(child != NULL);
parentScript->childScript = child;
parentScript->stateFlags |= EVT_FLAG_BLOCKED_BY_CHILD;
child->stateFlags = flags | EVT_FLAG_ACTIVE;
child->ptrCurrentLine = child->ptrFirstLine = child->ptrNextLine = (Bytecode*)source;
child->currentOpcode = EVT_OP_INTERNAL_FETCH;
child->userData = NULL;
child->blockingParent = parentScript;
child->childScript = NULL;
child->parentScript = NULL;
child->priority = parentScript->priority + 1;
child->id = gStaticScriptCounter++;
child->owner1 = parentScript->owner1;
child->owner2 = parentScript->owner2;
child->loopDepth = -1;
child->switchDepth = -1;
child->groupFlags = parentScript->groupFlags;
child->ptrSavedPos = NULL;
child->array = parentScript->array;
child->flagArray = parentScript->flagArray;
child->timeScale = gGlobalTimeSpace;
child->frameCounter = 0.0f;
child->unk_158 = 0;
scriptListCount = 0;
for (i = 0; i < ARRAY_COUNT(child->varTable); i++) {
child->varTable[i] = parentScript->varTable[i];
}
for (i = 0; i < ARRAY_COUNT(child->varFlags); i++) {
child->varFlags[i] = parentScript->varFlags[i];
}
find_script_labels(child);
if (gIsUpdatingScripts) {
scriptListCount = gScriptListCount++;
gScriptIndexList[scriptListCount] = curScriptIndex;
gScriptIdList[scriptListCount] = child->id;
}
suspend_frozen_scripts(child);
if (gStaticScriptCounter == 0) {
gStaticScriptCounter = 1;
}
return child;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80252728
/* 181008 80252728 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 18100C 8025272C AFB20018 */ sw $s2, 0x18($sp)
/* 181010 80252730 0080902D */ daddu $s2, $a0, $zero
/* 181014 80252734 AFBF0020 */ sw $ra, 0x20($sp)
dgb_01_D_80252738_C0FFB8:
/* 181018 80252738 AFB3001C */ sw $s3, 0x1C($sp)
/* 18101C 8025273C AFB10014 */ sw $s1, 0x14($sp)
/* 181020 80252740 AFB00010 */ sw $s0, 0x10($sp)
D_80252744:
/* 181024 80252744 8E50000C */ lw $s0, 0xC($s2)
/* 181028 80252748 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 18102C 8025274C 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 181030 80252750 8E130000 */ lw $s3, 0x0($s0)
/* 181034 80252754 26100004 */ addiu $s0, $s0, 0x4
/* 181038 80252758 8E020000 */ lw $v0, 0x0($s0)
/* 18103C 8025275C 26100004 */ addiu $s0, $s0, 0x4
/* 181040 80252760 AE20018C */ sw $zero, 0x18C($s1)
dgb_01_D_80252764_C0FFE4:
/* 181044 80252764 AE220188 */ sw $v0, 0x188($s1)
/* 181048 80252768 8E020000 */ lw $v0, 0x0($s0)
/* 18104C 8025276C 26100004 */ addiu $s0, $s0, 0x4
/* 181050 80252770 AE220190 */ sw $v0, 0x190($s1)
/* 181054 80252774 8E050000 */ lw $a1, 0x0($s0)
/* 181058 80252778 0C0B1EAF */ jal evt_get_variable
/* 18105C 8025277C 26100004 */ addiu $s0, $s0, 0x4
/* 181060 80252780 A622017E */ sh $v0, 0x17E($s1)
D_80252784:
/* 181064 80252784 8E100000 */ lw $s0, 0x0($s0)
/* 181068 80252788 24020030 */ addiu $v0, $zero, 0x30
/* 18106C 8025278C 32030030 */ andi $v1, $s0, 0x30
dgb_01_D_80252790_C10010:
/* 181070 80252790 54620004 */ bnel $v1, $v0, .L802527A4
D_80252794:
/* 181074 80252794 32020010 */ andi $v0, $s0, 0x10
D_80252798:
/* 181078 80252798 8E220000 */ lw $v0, 0x0($s1)
D_8025279C:
/* 18107C 8025279C 080949F9 */ j .L802527E4
/* 181080 802527A0 34420030 */ ori $v0, $v0, 0x30
.L802527A4:
/* 181084 802527A4 10400004 */ beqz $v0, D_802527B8
/* 181088 802527A8 2403FFDF */ addiu $v1, $zero, -0x21
/* 18108C 802527AC 8E220000 */ lw $v0, 0x0($s1)
D_802527B0:
/* 181090 802527B0 080949F8 */ j .L802527E0
/* 181094 802527B4 34420010 */ ori $v0, $v0, 0x10
D_802527B8:
/* 181098 802527B8 32020020 */ andi $v0, $s0, 0x20
dgb_01_D_802527BC_C1003C:
/* 18109C 802527BC 10400005 */ beqz $v0, .L802527D4
jtbl_802527C0:
/* 1810A0 802527C0 2403FFEF */ addiu $v1, $zero, -0x11
/* 1810A4 802527C4 8E220000 */ lw $v0, 0x0($s1)
/* 1810A8 802527C8 00431024 */ and $v0, $v0, $v1
/* 1810AC 802527CC 080949F9 */ j .L802527E4
/* 1810B0 802527D0 34420020 */ ori $v0, $v0, 0x20
.L802527D4:
/* 1810B4 802527D4 8E220000 */ lw $v0, 0x0($s1)
/* 1810B8 802527D8 00431024 */ and $v0, $v0, $v1
/* 1810BC 802527DC 2403FFDF */ addiu $v1, $zero, -0x21
.L802527E0:
/* 1810C0 802527E0 00431024 */ and $v0, $v0, $v1
.L802527E4:
/* 1810C4 802527E4 AE220000 */ sw $v0, 0x0($s1)
dgb_01_D_802527E8_C10068:
/* 1810C8 802527E8 32020040 */ andi $v0, $s0, 0x40
/* 1810CC 802527EC 10400007 */ beqz $v0, .L8025280C
/* 1810D0 802527F0 2404FFBF */ addiu $a0, $zero, -0x41
/* 1810D4 802527F4 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1810D8 802527F8 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1810DC 802527FC 8C620000 */ lw $v0, 0x0($v1)
/* 1810E0 80252800 34420040 */ ori $v0, $v0, 0x40
/* 1810E4 80252804 08094A08 */ j .L80252820
/* 1810E8 80252808 AC620000 */ sw $v0, 0x0($v1)
.L8025280C:
/* 1810EC 8025280C 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1810F0 80252810 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
dgb_01_D_80252814_C10094:
/* 1810F4 80252814 8C430000 */ lw $v1, 0x0($v0)
/* 1810F8 80252818 00641824 */ and $v1, $v1, $a0
/* 1810FC 8025281C AC430000 */ sw $v1, 0x0($v0)
.L80252820:
/* 181100 80252820 32020200 */ andi $v0, $s0, 0x200
/* 181104 80252824 10400007 */ beqz $v0, .L80252844
/* 181108 80252828 2404FDFF */ addiu $a0, $zero, -0x201
/* 18110C 8025282C 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 181110 80252830 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 181114 80252834 8C620000 */ lw $v0, 0x0($v1)
/* 181118 80252838 34420200 */ ori $v0, $v0, 0x200
/* 18111C 8025283C 08094A16 */ j .L80252858
dgb_01_D_80252840_C100C0:
/* 181120 80252840 AC620000 */ sw $v0, 0x0($v1)
.L80252844:
/* 181124 80252844 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181128 80252848 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 18112C 8025284C 8C430000 */ lw $v1, 0x0($v0)
/* 181130 80252850 00641824 */ and $v1, $v1, $a0
/* 181134 80252854 AC430000 */ sw $v1, 0x0($v0)
.L80252858:
/* 181138 80252858 32020080 */ andi $v0, $s0, 0x80
/* 18113C 8025285C 10400007 */ beqz $v0, .L8025287C
/* 181140 80252860 2404FF7F */ addiu $a0, $zero, -0x81
/* 181144 80252864 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 181148 80252868 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
dgb_01_D_8025286C_C100EC:
/* 18114C 8025286C 8C620000 */ lw $v0, 0x0($v1)
/* 181150 80252870 34420080 */ ori $v0, $v0, 0x80
/* 181154 80252874 08094A24 */ j .L80252890
/* 181158 80252878 AC620000 */ sw $v0, 0x0($v1)
.L8025287C:
/* 18115C 8025287C 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181160 80252880 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 181164 80252884 8C430000 */ lw $v1, 0x0($v0)
/* 181168 80252888 00641824 */ and $v1, $v1, $a0
/* 18116C 8025288C AC430000 */ sw $v1, 0x0($v0)
.L80252890:
/* 181170 80252890 0C09A75B */ jal get_actor
/* 181174 80252894 8E440148 */ lw $a0, 0x148($s2)
dgb_01_D_80252898_C10118:
/* 181178 80252898 94430428 */ lhu $v1, 0x428($v0)
/* 18117C 8025289C A62301A0 */ sh $v1, 0x1A0($s1)
/* 181180 802528A0 92230193 */ lbu $v1, 0x193($s1)
/* 181184 802528A4 90420426 */ lbu $v0, 0x426($v0)
/* 181188 802528A8 A2230194 */ sb $v1, 0x194($s1)
/* 18118C 802528AC 306300FF */ andi $v1, $v1, 0xFF
/* 181190 802528B0 A22201A2 */ sb $v0, 0x1A2($s1)
/* 181194 802528B4 240200FF */ addiu $v0, $zero, 0xFF
/* 181198 802528B8 50620001 */ beql $v1, $v0, .L802528C0
/* 18119C 802528BC A2200194 */ sb $zero, 0x194($s1)
.L802528C0:
/* 1811A0 802528C0 8E220190 */ lw $v0, 0x190($s1)
dgb_01_D_802528C4_C10144:
/* 1811A4 802528C4 30420F00 */ andi $v0, $v0, 0xF00
/* 1811A8 802528C8 00021203 */ sra $v0, $v0, 8
/* 1811AC 802528CC 0C0945BA */ jal func_802516E8
/* 1811B0 802528D0 A2220195 */ sb $v0, 0x195($s1)
/* 1811B4 802528D4 0440000B */ bltz $v0, .L80252904
/* 1811B8 802528D8 0240202D */ daddu $a0, $s2, $zero
/* 1811BC 802528DC 0260282D */ daddu $a1, $s3, $zero
/* 1811C0 802528E0 0C0B2026 */ jal evt_set_variable
/* 1811C4 802528E4 0040302D */ daddu $a2, $v0, $zero
/* 1811C8 802528E8 0C0B1069 */ jal does_script_exist_by_ref
/* 1811CC 802528EC 0240202D */ daddu $a0, $s2, $zero
dgb_01_D_802528F0_C10170:
/* 1811D0 802528F0 0040182D */ daddu $v1, $v0, $zero
/* 1811D4 802528F4 10600004 */ beqz $v1, .L80252908
/* 1811D8 802528F8 240200FF */ addiu $v0, $zero, 0xFF
/* 1811DC 802528FC 08094A42 */ j .L80252908
/* 1811E0 80252900 24020002 */ addiu $v0, $zero, 0x2
.L80252904:
/* 1811E4 80252904 240200FF */ addiu $v0, $zero, 0xFF
.L80252908:
/* 1811E8 80252908 8FBF0020 */ lw $ra, 0x20($sp)
/* 1811EC 8025290C 8FB3001C */ lw $s3, 0x1C($sp)
/* 1811F0 80252910 8FB20018 */ lw $s2, 0x18($sp)
/* 1811F4 80252914 8FB10014 */ lw $s1, 0x14($sp)
/* 1811F8 80252918 8FB00010 */ lw $s0, 0x10($sp)
dgb_01_D_8025291C_C1019C:
/* 1811FC 8025291C 03E00008 */ jr $ra
/* 181200 80252920 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
ApiStatus ItemDamageEnemy(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Bytecode* args = script->ptrReadPos;
s32 hitResultVarOut = *args++;
s32 flags;
Actor* actor;
HitResult hitResult;
battleStatus->currentAttackElement = *args++;
battleStatus->currentAttackEventSuppression = 0;
battleStatus->currentAttackStatus = *args++;
battleStatus->currentAttackDamage = evt_get_variable(script, *args++);
flags = *args++;
if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) {
gBattleStatus.flags1 |= BS_FLAGS1_10;
gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
} else if (flags & BS_FLAGS1_10) {
gBattleStatus.flags1 |= BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
} else if (flags & BS_FLAGS1_SP_EVT_ACTIVE) {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
}
if (flags & BS_FLAGS1_40) {
gBattleStatus.flags1 |= BS_FLAGS1_40;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_40;
}
if (flags & BS_FLAGS1_200) {
gBattleStatus.flags1 |= BS_FLAGS1_200;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_200;
}
if (flags & BS_FLAGS1_80) {
gBattleStatus.flags1 |= BS_FLAGS1_80;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_80;
}
actor = get_actor(script->owner1.actorID);
battleStatus->currentTargetID = actor->targetActorID;
battleStatus->currentTargetPart = actor->targetPartIndex;
battleStatus->statusChance = battleStatus->currentAttackStatus;
if (battleStatus->statusChance == STATUS_KEY_NEVER) {
battleStatus->statusChance = 0;
}
battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8;
hitResult = calc_item_damage_enemy();
if (hitResult < 0) {
return ApiStatus_FINISH;
}
evt_set_variable(script, hitResultVarOut, hitResult);
if (!does_script_exist_by_ref(script)) {
return ApiStatus_FINISH;
}
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel attack_result_text_update
/* 38FAC8 E00901C8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 38FACC E00901CC AFBF0010 */ sw $ra, 0x10($sp)
/* 38FAD0 E00901D0 8C85000C */ lw $a1, 0xC($a0)
/* 38FAD4 E00901D4 8CA30018 */ lw $v1, 0x18($a1)
/* 38FAD8 E00901D8 8CA70000 */ lw $a3, 0x0($a1)
/* 38FADC E00901DC 28620064 */ slti $v0, $v1, 0x64
/* 38FAE0 E00901E0 10400002 */ beqz $v0, .LE00901EC
/* 38FAE4 E00901E4 2462FFFF */ addiu $v0, $v1, -0x1
/* 38FAE8 E00901E8 ACA20018 */ sw $v0, 0x18($a1)
.LE00901EC:
/* 38FAEC E00901EC 8CA3001C */ lw $v1, 0x1C($a1)
/* 38FAF0 E00901F0 8CA80018 */ lw $t0, 0x18($a1)
/* 38FAF4 E00901F4 24660001 */ addiu $a2, $v1, 0x1
/* 38FAF8 E00901F8 05010007 */ bgez $t0, .LE0090218
/* 38FAFC E00901FC ACA6001C */ sw $a2, 0x1C($a1)
/* 38FB00 E0090200 2402FFFF */ addiu $v0, $zero, -0x1
/* 38FB04 E0090204 ACA00024 */ sw $zero, 0x24($a1)
/* 38FB08 E0090208 0C080128 */ jal shim_remove_effect
/* 38FB0C E009020C ACA20018 */ sw $v0, 0x18($a1)
/* 38FB10 E0090210 08024105 */ j .LE0090414
/* 38FB14 E0090214 00000000 */ nop
.LE0090218:
/* 38FB18 E0090218 28E20005 */ slti $v0, $a3, 0x5
/* 38FB1C E009021C 10400048 */ beqz $v0, .LE0090340
/* 38FB20 E0090220 28C20009 */ slti $v0, $a2, 0x9
/* 38FB24 E0090224 1040000F */ beqz $v0, .LE0090264
/* 38FB28 E0090228 2402000A */ addiu $v0, $zero, 0xA
/* 38FB2C E009022C 3C02E009 */ lui $v0, (0xE0090A68 >> 16)
/* 38FB30 E0090230 00431021 */ addu $v0, $v0, $v1
/* 38FB34 E0090234 90420A68 */ lbu $v0, (0xE0090A68 & 0xFFFF)($v0)
/* 38FB38 E0090238 3C01E009 */ lui $at, (0xE0090AA0 >> 16)
/* 38FB3C E009023C D4220AA0 */ ldc1 $f2, (0xE0090AA0 & 0xFFFF)($at)
/* 38FB40 E0090240 44820000 */ mtc1 $v0, $f0
/* 38FB44 E0090244 00000000 */ nop
/* 38FB48 E0090248 46800020 */ cvt.s.w $f0, $f0
/* 38FB4C E009024C 46000021 */ cvt.d.s $f0, $f0
/* 38FB50 E0090250 46220002 */ mul.d $f0, $f0, $f2
/* 38FB54 E0090254 00000000 */ nop
/* 38FB58 E0090258 46200020 */ cvt.s.d $f0, $f0
/* 38FB5C E009025C E4A00028 */ swc1 $f0, 0x28($a1)
/* 38FB60 E0090260 2402000A */ addiu $v0, $zero, 0xA
.LE0090264:
/* 38FB64 E0090264 14C20003 */ bne $a2, $v0, .LE0090274
/* 38FB68 E0090268 2463FF9C */ addiu $v1, $v1, -0x64
/* 38FB6C E009026C 24020009 */ addiu $v0, $zero, 0x9
/* 38FB70 E0090270 ACA2001C */ sw $v0, 0x1C($a1)
.LE0090274:
/* 38FB74 E0090274 2C620007 */ sltiu $v0, $v1, 0x7
/* 38FB78 E0090278 1040000F */ beqz $v0, .LE00902B8
/* 38FB7C E009027C 2402006D */ addiu $v0, $zero, 0x6D
/* 38FB80 E0090280 3C02E009 */ lui $v0, (0xE0090A70 >> 16)
/* 38FB84 E0090284 00431021 */ addu $v0, $v0, $v1
/* 38FB88 E0090288 90420A70 */ lbu $v0, (0xE0090A70 & 0xFFFF)($v0)
/* 38FB8C E009028C 3C01E009 */ lui $at, (0xE0090AA8 >> 16)
/* 38FB90 E0090290 D4220AA8 */ ldc1 $f2, (0xE0090AA8 & 0xFFFF)($at)
/* 38FB94 E0090294 44820000 */ mtc1 $v0, $f0
/* 38FB98 E0090298 00000000 */ nop
/* 38FB9C E009029C 46800020 */ cvt.s.w $f0, $f0
/* 38FBA0 E00902A0 46000021 */ cvt.d.s $f0, $f0
/* 38FBA4 E00902A4 46220002 */ mul.d $f0, $f0, $f2
/* 38FBA8 E00902A8 00000000 */ nop
/* 38FBAC E00902AC 46200020 */ cvt.s.d $f0, $f0
/* 38FBB0 E00902B0 E4A00028 */ swc1 $f0, 0x28($a1)
/* 38FBB4 E00902B4 2402006D */ addiu $v0, $zero, 0x6D
.LE00902B8:
/* 38FBB8 E00902B8 14C20004 */ bne $a2, $v0, .LE00902CC
/* 38FBBC E00902BC 28C203E9 */ slti $v0, $a2, 0x3E9
/* 38FBC0 E00902C0 2402006C */ addiu $v0, $zero, 0x6C
/* 38FBC4 E00902C4 ACA2001C */ sw $v0, 0x1C($a1)
/* 38FBC8 E00902C8 28C203E9 */ slti $v0, $a2, 0x3E9
.LE00902CC:
/* 38FBCC E00902CC 14400004 */ bnez $v0, .LE00902E0
/* 38FBD0 E00902D0 29020006 */ slti $v0, $t0, 0x6
/* 38FBD4 E00902D4 240203E8 */ addiu $v0, $zero, 0x3E8
/* 38FBD8 E00902D8 ACA2001C */ sw $v0, 0x1C($a1)
/* 38FBDC E00902DC 29020006 */ slti $v0, $t0, 0x6
.LE00902E0:
/* 38FBE0 E00902E0 14400010 */ bnez $v0, .LE0090324
/* 38FBE4 E00902E4 29020005 */ slti $v0, $t0, 0x5
/* 38FBE8 E00902E8 C4A00030 */ lwc1 $f0, 0x30($a1)
/* 38FBEC E00902EC 3C013FE8 */ lui $at, (0x3FE80000 >> 16)
/* 38FBF0 E00902F0 44812800 */ mtc1 $at, $f5
/* 38FBF4 E00902F4 44802000 */ mtc1 $zero, $f4
/* 38FBF8 E00902F8 46000021 */ cvt.d.s $f0, $f0
/* 38FBFC E00902FC 46240002 */ mul.d $f0, $f0, $f4
/* 38FC00 E0090300 00000000 */ nop
/* 38FC04 E0090304 C4A20034 */ lwc1 $f2, 0x34($a1)
/* 38FC08 E0090308 460010A1 */ cvt.d.s $f2, $f2
/* 38FC0C E009030C 46241082 */ mul.d $f2, $f2, $f4
/* 38FC10 E0090310 00000000 */ nop
/* 38FC14 E0090314 46200020 */ cvt.s.d $f0, $f0
/* 38FC18 E0090318 462010A0 */ cvt.s.d $f2, $f2
/* 38FC1C E009031C E4A00030 */ swc1 $f0, 0x30($a1)
/* 38FC20 E0090320 E4A20034 */ swc1 $f2, 0x34($a1)
.LE0090324:
/* 38FC24 E0090324 10400027 */ beqz $v0, .LE00903C4
/* 38FC28 E0090328 00000000 */ nop
/* 38FC2C E009032C C4A00030 */ lwc1 $f0, 0x30($a1)
/* 38FC30 E0090330 3C01E009 */ lui $at, (0xE0090AB0 >> 16)
/* 38FC34 E0090334 D4240AB0 */ ldc1 $f4, (0xE0090AB0 & 0xFFFF)($at)
/* 38FC38 E0090338 080240E7 */ j .LE009039C
/* 38FC3C E009033C 46000021 */ cvt.d.s $f0, $f0
.LE0090340:
/* 38FC40 E0090340 29020006 */ slti $v0, $t0, 0x6
/* 38FC44 E0090344 1440000F */ bnez $v0, .LE0090384
/* 38FC48 E0090348 29020005 */ slti $v0, $t0, 0x5
/* 38FC4C E009034C C4A00030 */ lwc1 $f0, 0x30($a1)
/* 38FC50 E0090350 3C01E009 */ lui $at, (0xE0090AB8 >> 16)
/* 38FC54 E0090354 D4240AB8 */ ldc1 $f4, (0xE0090AB8 & 0xFFFF)($at)
/* 38FC58 E0090358 46000021 */ cvt.d.s $f0, $f0
/* 38FC5C E009035C 46240002 */ mul.d $f0, $f0, $f4
/* 38FC60 E0090360 00000000 */ nop
/* 38FC64 E0090364 C4A20034 */ lwc1 $f2, 0x34($a1)
/* 38FC68 E0090368 460010A1 */ cvt.d.s $f2, $f2
/* 38FC6C E009036C 46241082 */ mul.d $f2, $f2, $f4
/* 38FC70 E0090370 00000000 */ nop
/* 38FC74 E0090374 46200020 */ cvt.s.d $f0, $f0
/* 38FC78 E0090378 462010A0 */ cvt.s.d $f2, $f2
/* 38FC7C E009037C E4A00030 */ swc1 $f0, 0x30($a1)
/* 38FC80 E0090380 E4A20034 */ swc1 $f2, 0x34($a1)
.LE0090384:
/* 38FC84 E0090384 1040000F */ beqz $v0, .LE00903C4
/* 38FC88 E0090388 00000000 */ nop
/* 38FC8C E009038C C4A00030 */ lwc1 $f0, 0x30($a1)
/* 38FC90 E0090390 3C01E009 */ lui $at, (0xE0090AC0 >> 16)
/* 38FC94 E0090394 D4240AC0 */ ldc1 $f4, (0xE0090AC0 & 0xFFFF)($at)
/* 38FC98 E0090398 46000021 */ cvt.d.s $f0, $f0
.LE009039C:
/* 38FC9C E009039C 46240002 */ mul.d $f0, $f0, $f4
/* 38FCA0 E00903A0 00000000 */ nop
/* 38FCA4 E00903A4 C4A20034 */ lwc1 $f2, 0x34($a1)
/* 38FCA8 E00903A8 460010A1 */ cvt.d.s $f2, $f2
/* 38FCAC E00903AC 46241082 */ mul.d $f2, $f2, $f4
/* 38FCB0 E00903B0 00000000 */ nop
/* 38FCB4 E00903B4 46200020 */ cvt.s.d $f0, $f0
/* 38FCB8 E00903B8 462010A0 */ cvt.s.d $f2, $f2
/* 38FCBC E00903BC E4A00030 */ swc1 $f0, 0x30($a1)
/* 38FCC0 E00903C0 E4A20034 */ swc1 $f2, 0x34($a1)
.LE00903C4:
/* 38FCC4 E00903C4 C4A40008 */ lwc1 $f4, 0x8($a1)
/* 38FCC8 E00903C8 C4A00030 */ lwc1 $f0, 0x30($a1)
/* 38FCCC E00903CC C4A2000C */ lwc1 $f2, 0xC($a1)
/* 38FCD0 E00903D0 46002100 */ add.s $f4, $f4, $f0
/* 38FCD4 E00903D4 C4A00034 */ lwc1 $f0, 0x34($a1)
/* 38FCD8 E00903D8 8CA20020 */ lw $v0, 0x20($a1)
/* 38FCDC E00903DC 46001080 */ add.s $f2, $f2, $f0
/* 38FCE0 E00903E0 E4A40008 */ swc1 $f4, 0x8($a1)
/* 38FCE4 E00903E4 1040000B */ beqz $v0, .LE0090414
/* 38FCE8 E00903E8 E4A2000C */ swc1 $f2, 0xC($a1)
/* 38FCEC E00903EC 8CA20004 */ lw $v0, 0x4($a1)
/* 38FCF0 E00903F0 24030064 */ addiu $v1, $zero, 0x64
/* 38FCF4 E00903F4 ACA00020 */ sw $zero, 0x20($a1)
/* 38FCF8 E00903F8 ACA3001C */ sw $v1, 0x1C($a1)
/* 38FCFC E00903FC 24420001 */ addiu $v0, $v0, 0x1
/* 38FD00 E0090400 ACA20004 */ sw $v0, 0x4($a1)
/* 38FD04 E0090404 28420003 */ slti $v0, $v0, 0x3
/* 38FD08 E0090408 14400002 */ bnez $v0, .LE0090414
/* 38FD0C E009040C 24020002 */ addiu $v0, $zero, 0x2
/* 38FD10 E0090410 ACA20004 */ sw $v0, 0x4($a1)
.LE0090414:
/* 38FD14 E0090414 8FBF0010 */ lw $ra, 0x10($sp)
/* 38FD18 E0090418 03E00008 */ jr $ra
/* 38FD1C E009041C 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void attack_result_text_update(EffectInstance* effect) {
AttackResultTextFXData* data = effect->data.attackResultText;
s32 type = data->type;
s32 prevTime;
s32 curTime;
s32 timeLeft;
u32 temp1C;
if (data->timeLeft < 100) {
data->timeLeft--;
}
prevTime = data->lifetime;
data->lifetime++;
curTime = data->lifetime;
if (data->timeLeft < 0) {
data->isVisible = FALSE;
data->timeLeft = -1;
shim_remove_effect(effect);
return;
}
timeLeft = data->timeLeft;
if (type < 5) {
if (data->lifetime < 9) {
data->scale = (f32) D_E0090A68[prevTime] * 0.01;
}
temp1C = prevTime - 100;
if (curTime == 10) {
data->lifetime = 9;
}
if (temp1C < 7) {
data->scale = (f32) D_E0090A70[temp1C] * 0.01;
}
if (curTime == 109) {
data->lifetime = 108;
}
if (curTime > 1000) {
data->lifetime = 1000;
}
if (timeLeft >= 6) {
data->vel.x *= 0.75;
data->vel.y *= 0.75;
}
if (timeLeft < 5) {
data->vel.x *= 0.7;
data->vel.y *= 0.7;
}
} else {
if (timeLeft >= 6) {
data->vel.x *= 0.7;
data->vel.y *= 0.7;
}
if (timeLeft < 5) {
data->vel.x *= 0.6;
data->vel.y *= 0.6;
}
}
data->pos.x += data->vel.x;
data->pos.y += data->vel.y;
if (data->unk_20 != 0) {
data->unk_20 = 0;
data->lifetime = 100;
data->unk_04++;
if (data->unk_04 > 2) {
data->unk_04 = 2;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_80240E60
/* 16F740 80240E60 27BDFFD8 */ addiu $sp, $sp, -0x28
glabel dead_11_FlyingAI_Chase
/* 16F744 80240E64 AFB40020 */ sw $s4, 0x20($sp)
D_80240E68:
/* 16F748 80240E68 3C14800E */ lui $s4, %hi(gBattleStatus)
glabel func_80240E6C
/* 16F74C 80240E6C 2694C070 */ addiu $s4, $s4, %lo(gBattleStatus)
glabel func_80240E70
/* 16F750 80240E70 AFB3001C */ sw $s3, 0x1C($sp)
glabel func_80240E74
/* 16F754 80240E74 3C13800B */ lui $s3, %hi(gCurrentEncounter)
glabel .L80240E78
/* 16F758 80240E78 26730F10 */ addiu $s3, $s3, %lo(gCurrentEncounter)
glabel .L80240E7C
/* 16F75C 80240E7C AFB00010 */ sw $s0, 0x10($sp)
glabel func_80240E80
/* 16F760 80240E80 3C108011 */ lui $s0, %hi(gPlayerData)
glabel dead_flo_13_FlyingAI_ChaseInit
/* 16F764 80240E84 2610F290 */ addiu $s0, $s0, %lo(gPlayerData)
flo_18_pad_E88:
/* 16F768 80240E88 AFBF0024 */ sw $ra, 0x24($sp)
glabel sam_02_Quizmo_RenderInit
/* 16F76C 80240E8C AFB20018 */ sw $s2, 0x18($sp)
D_80240E90:
/* 16F770 80240E90 AFB10014 */ sw $s1, 0x14($sp)
glabel func_80240E94
/* 16F774 80240E94 8E820004 */ lw $v0, 0x4($s4)
glabel func_80240E98
/* 16F778 80240E98 30420040 */ andi $v0, $v0, 0x40
glabel func_80240E9C
/* 16F77C 80240E9C 14400047 */ bnez $v0, func_80240FBC
glabel .L80240EA0
/* 16F780 80240EA0 24110003 */ addiu $s1, $zero, 0x3
glabel flo_03_pad_EA4
/* 16F784 80240EA4 8282008A */ lb $v0, 0x8A($s4)
glabel func_80240EA8
/* 16F788 80240EA8 10510044 */ beq $v0, $s1, func_80240FBC
glabel func_80240EAC
/* 16F78C 80240EAC 24120004 */ addiu $s2, $zero, 0x4
glabel func_80240EB0
/* 16F790 80240EB0 10520042 */ beq $v0, $s2, func_80240FBC
glabel func_80240EB4
/* 16F794 80240EB4 00000000 */ nop
glabel func_80240EB8
/* 16F798 80240EB8 8202028A */ lb $v0, 0x28A($s0)
glabel sam_11_Quizmo_UpdateRecords
/* 16F79C 80240EBC 1840003F */ blez $v0, func_80240FBC
glabel end_01_CharAnim_FadeIn_5
/* 16F7A0 80240EC0 00000000 */ nop
glabel .L80240EC4
/* 16F7A4 80240EC4 8602028C */ lh $v0, 0x28C($s0)
glabel dead_11_FlyingAI_LosePlayer
/* 16F7A8 80240EC8 1C400030 */ bgtz $v0, func_80240F8C
glabel func_80240ECC
/* 16F7AC 80240ECC 00000000 */ nop
glabel func_80240ED0
/* 16F7B0 80240ED0 0C00A67F */ jal rand_int
glabel .L80240ED4
/* 16F7B4 80240ED4 24040064 */ addiu $a0, $zero, 0x64
glabel sam_02_Quizmo_NPC_Aux_Impl
/* 16F7B8 80240ED8 8E63008C */ lw $v1, 0x8C($s3)
glabel omo_02_GuardAI_IdleInit
/* 16F7BC 80240EDC 10600018 */ beqz $v1, func_80240F40_EB9D90
D_80240EE0:
/* 16F7C0 80240EE0 0040202D */ daddu $a0, $v0, $zero
glabel .L80240EE4
/* 16F7C4 80240EE4 8C620000 */ lw $v0, 0x0($v1)
glabel pra_39_worker_reflect_partner_floor
/* 16F7C8 80240EE8 3C030004 */ lui $v1, (0x40000 >> 16)
glabel func_80240EEC
/* 16F7CC 80240EEC 00431024 */ and $v0, $v0, $v1
D_80240EF0:
/* 16F7D0 80240EF0 10400008 */ beqz $v0, func_80240F14
glabel sam_08_MeleeHitbox_33
/* 16F7D4 80240EF4 2882002E */ slti $v0, $a0, 0x2E
glabel func_80240EF8
/* 16F7D8 80240EF8 14400014 */ bnez $v0, func_80240F4C
glabel dead_flo_09_FlyingAI_JumpInit
/* 16F7DC 80240EFC 24020001 */ addiu $v0, $zero, 0x1
glabel func_80240F00
/* 16F7E0 80240F00 2882005B */ slti $v0, $a0, 0x5B
glabel func_80240F04
/* 16F7E4 80240F04 14400016 */ bnez $v0, func_80240F60_D4DFA0
flo_03_varStash:
/* 16F7E8 80240F08 24020002 */ addiu $v0, $zero, 0x2
D_80240F0C:
/* 16F7EC 80240F0C 080903DE */ j func_80240F78
glabel func_80240F10
/* 16F7F0 80240F10 A2110289 */ sb $s1, 0x289($s0)
glabel func_80240F14
/* 16F7F4 80240F14 2882001F */ slti $v0, $a0, 0x1F
glabel func_80240F18
/* 16F7F8 80240F18 1440000C */ bnez $v0, func_80240F4C
glabel func_80240F1C
/* 16F7FC 80240F1C 24020001 */ addiu $v0, $zero, 0x1
glabel func_80240F20
/* 16F800 80240F20 2882003D */ slti $v0, $a0, 0x3D
glabel .L80240F24
/* 16F804 80240F24 1440000E */ bnez $v0, func_80240F60_D4DFA0
dead_flo_03_varStash:
/* 16F808 80240F28 24020002 */ addiu $v0, $zero, 0x2
glabel func_80240F2C_D7FC8C
/* 16F80C 80240F2C 28820051 */ slti $v0, $a0, 0x51
glabel func_80240F30
/* 16F810 80240F30 54400011 */ bnel $v0, $zero, func_80240F78
glabel .L80240F34
/* 16F814 80240F34 A2110289 */ sb $s1, 0x289($s0)
glabel func_80240F38
/* 16F818 80240F38 080903DE */ j func_80240F78
D_80240F3C:
/* 16F81C 80240F3C A2120289 */ sb $s2, 0x289($s0)
glabel func_80240F40_EB9D90
/* 16F820 80240F40 2882001F */ slti $v0, $a0, 0x1F
glabel func_80240F44
/* 16F824 80240F44 10400003 */ beqz $v0, func_80240F54_DE33E4
glabel func_80240F48
/* 16F828 80240F48 24020001 */ addiu $v0, $zero, 0x1
glabel func_80240F4C
/* 16F82C 80240F4C 080903DE */ j func_80240F78
glabel pra_39_SwooperAI_Main
/* 16F830 80240F50 A2020289 */ sb $v0, 0x289($s0)
glabel func_80240F54_DE33E4
/* 16F834 80240F54 2882003D */ slti $v0, $a0, 0x3D
glabel func_80240F58
/* 16F838 80240F58 10400003 */ beqz $v0, func_80240F68
.L80240F5C:
/* 16F83C 80240F5C 24020002 */ addiu $v0, $zero, 0x2
glabel func_80240F60_D4DFA0
/* 16F840 80240F60 080903DE */ j func_80240F78
D_80240F64:
/* 16F844 80240F64 A2020289 */ sb $v0, 0x289($s0)
glabel func_80240F68
/* 16F848 80240F68 28820051 */ slti $v0, $a0, 0x51
D_80240F6C:
/* 16F84C 80240F6C 50400002 */ beql $v0, $zero, func_80240F78
glabel func_80240F70
/* 16F850 80240F70 A2120289 */ sb $s2, 0x289($s0)
glabel dead_flo_09lo_09_FlyingAI_Jump
/* 16F854 80240F74 A2110289 */ sb $s1, 0x289($s0)
glabel func_80240F78
/* 16F858 80240F78 0C00A67F */ jal rand_int
glabel omo_04_FlyingAI_JumpInit
/* 16F85C 80240F7C 2404000A */ addiu $a0, $zero, 0xA
glabel func_80240F80
/* 16F860 80240F80 24440006 */ addiu $a0, $v0, 0x6
glabel func_80240F84
/* 16F864 80240F84 A604028C */ sh $a0, 0x28C($s0)
glabel kzn_04_SuperBlock_PartnerSparkles2
/* 16F868 80240F88 8602028C */ lh $v0, 0x28C($s0)
glabel func_80240F8C
/* 16F86C 80240F8C 9603028C */ lhu $v1, 0x28C($s0)
glabel func_80240F90
/* 16F870 80240F90 28420002 */ slti $v0, $v0, 0x2
glabel func_80240F94
/* 16F874 80240F94 14400003 */ bnez $v0, func_80240FA4
glabel .L80240F98
/* 16F878 80240F98 2462FFFF */ addiu $v0, $v1, -0x1
glabel func_80240F9C
/* 16F87C 80240F9C 080903EF */ j func_80240FBC
glabel func_80240FA0
/* 16F880 80240FA0 A602028C */ sh $v0, 0x28C($s0)
glabel func_80240FA4
/* 16F884 80240FA4 92030289 */ lbu $v1, 0x289($s0)
glabel func_80240FA8
/* 16F888 80240FA8 9202028A */ lbu $v0, 0x28A($s0)
glabel func_80240FAC
/* 16F88C 80240FAC A600028C */ sh $zero, 0x28C($s0)
glabel func_80240FB0_EB9E00
/* 16F890 80240FB0 2442FFFF */ addiu $v0, $v0, -0x1
glabel omo_17_FlyingAI_WanderInit
/* 16F894 80240FB4 A283008A */ sb $v1, 0x8A($s4)
glabel func_80240FB8
/* 16F898 80240FB8 A202028A */ sb $v0, 0x28A($s0)
glabel func_80240FBC
/* 16F89C 80240FBC 8FBF0024 */ lw $ra, 0x24($sp)
glabel func_80240FC0
/* 16F8A0 80240FC0 8FB40020 */ lw $s4, 0x20($sp)
glabel func_80240FC4
/* 16F8A4 80240FC4 8FB3001C */ lw $s3, 0x1C($sp)
.L80240FC8:
/* 16F8A8 80240FC8 8FB20018 */ lw $s2, 0x18($sp)
glabel func_80240FCC
/* 16F8AC 80240FCC 8FB10014 */ lw $s1, 0x14($sp)
tst_04_B_80240FD0:
/* 16F8B0 80240FD0 8FB00010 */ lw $s0, 0x10($sp)
glabel func_80240FD4
/* 16F8B4 80240FD4 03E00008 */ jr $ra
glabel omo_07_PatrolAI_LosePlayer
/* 16F8B8 80240FD8 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void btl_merlee_on_start_turn(void) {
BattleStatus* battleStatus = &gBattleStatus;
EncounterStatus* currentEncounter = &gCurrentEncounter;
PlayerData* playerData = &gPlayerData;
do {
if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE)
&& battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST
&& battleStatus->nextMerleeSpellType != MERLEE_SPELL_COIN_BOOST
&& playerData->merleeCastsLeft > 0
) {
if (playerData->merleeTurnCount <= 0) {
s32 temp = rand_int(100);
if (currentEncounter->currentEnemy != NULL) {
if (currentEncounter->currentEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) {
if (temp <= 45) {
playerData->merleeSpellType = MERLEE_SPELL_1;
} else if (temp <= 90) {
playerData->merleeSpellType = MERLEE_SPELL_2;
} else {
playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST;
}
} else if (temp <= 30) {
playerData->merleeSpellType = MERLEE_SPELL_1;
} else if (temp <= 60) {
playerData->merleeSpellType = MERLEE_SPELL_2;
} else if (temp <= 80) {
playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST;
} else {
playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST;
}
} else if (temp <= 30) {
playerData->merleeSpellType = MERLEE_SPELL_1;
} else if (temp <= 60) {
playerData->merleeSpellType = MERLEE_SPELL_2;
} else if (temp <= 80) {
playerData->merleeSpellType = MERLEE_SPELL_EXP_BOOST;
} else {
playerData->merleeSpellType = MERLEE_SPELL_COIN_BOOST;
}
temp = rand_int(10) + 6;
playerData->merleeTurnCount = temp;
}
if (playerData->merleeTurnCount >= 2) {
playerData->merleeTurnCount--;
} else {
playerData->merleeTurnCount = 0;
battleStatus->nextMerleeSpellType = playerData->merleeSpellType;
playerData->merleeCastsLeft--;
}
}
} while (0); // TODO: required to match
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel smoke_ring_main
/* 3419E0 E002E000 27BDFF90 */ addiu $sp, $sp, -0x70
/* 3419E4 E002E004 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 3419E8 E002E008 4485A000 */ mtc1 $a1, $f20
/* 3419EC E002E00C F7B80050 */ sdc1 $f24, 0x50($sp)
/* 3419F0 E002E010 4486C000 */ mtc1 $a2, $f24
/* 3419F4 E002E014 AFB20030 */ sw $s2, 0x30($sp)
/* 3419F8 E002E018 0080902D */ daddu $s2, $a0, $zero
/* 3419FC E002E01C F7BA0058 */ sdc1 $f26, 0x58($sp)
/* 341A00 E002E020 4487D000 */ mtc1 $a3, $f26
/* 341A04 E002E024 AFBF003C */ sw $ra, 0x3C($sp)
/* 341A08 E002E028 AFB40038 */ sw $s4, 0x38($sp)
/* 341A0C E002E02C AFB30034 */ sw $s3, 0x34($sp)
/* 341A10 E002E030 AFB1002C */ sw $s1, 0x2C($sp)
/* 341A14 E002E034 AFB00028 */ sw $s0, 0x28($sp)
/* 341A18 E002E038 F7BE0068 */ sdc1 $f30, 0x68($sp)
/* 341A1C E002E03C F7BC0060 */ sdc1 $f28, 0x60($sp)
/* 341A20 E002E040 F7B60048 */ sdc1 $f22, 0x48($sp)
/* 341A24 E002E044 12400006 */ beqz $s2, .LE002E060
/* 341A28 E002E048 27A40010 */ addiu $a0, $sp, 0x10
/* 341A2C E002E04C 24020001 */ addiu $v0, $zero, 0x1
/* 341A30 E002E050 12420007 */ beq $s2, $v0, .LE002E070
/* 341A34 E002E054 2413000B */ addiu $s3, $zero, 0xB
/* 341A38 E002E058 0800B820 */ j .LE002E080
/* 341A3C E002E05C 00000000 */ nop
.LE002E060:
/* 341A40 E002E060 3C014160 */ lui $at, (0x41600000 >> 16)
/* 341A44 E002E064 4481B000 */ mtc1 $at, $f22
/* 341A48 E002E068 0800B822 */ j .LE002E088
/* 341A4C E002E06C 24130007 */ addiu $s3, $zero, 0x7
.LE002E070:
/* 341A50 E002E070 3C0141E0 */ lui $at, (0x41E00000 >> 16)
/* 341A54 E002E074 4481B000 */ mtc1 $at, $f22
/* 341A58 E002E078 0800B822 */ j .LE002E088
/* 341A5C E002E07C 24130009 */ addiu $s3, $zero, 0x9
.LE002E080:
/* 341A60 E002E080 3C014228 */ lui $at, (0x42280000 >> 16)
/* 341A64 E002E084 4481B000 */ mtc1 $at, $f22
.LE002E088:
/* 341A68 E002E088 3C02E003 */ lui $v0, %hi(smoke_ring_init)
/* 341A6C E002E08C 2442E248 */ addiu $v0, $v0, %lo(smoke_ring_init)
/* 341A70 E002E090 AC820008 */ sw $v0, 0x8($a0)
/* 341A74 E002E094 3C02E003 */ lui $v0, %hi(smoke_ring_update)
/* 341A78 E002E098 2442E250 */ addiu $v0, $v0, %lo(smoke_ring_update)
/* 341A7C E002E09C AC82000C */ sw $v0, 0xC($a0)
/* 341A80 E002E0A0 3C02E003 */ lui $v0, %hi(smoke_ring_render)
/* 341A84 E002E0A4 2442E330 */ addiu $v0, $v0, %lo(smoke_ring_render)
/* 341A88 E002E0A8 AC820010 */ sw $v0, 0x10($a0)
/* 341A8C E002E0AC 24020017 */ addiu $v0, $zero, 0x17
/* 341A90 E002E0B0 AC800000 */ sw $zero, 0x0($a0)
/* 341A94 E002E0B4 AC800014 */ sw $zero, 0x14($a0)
/* 341A98 E002E0B8 0C080124 */ jal shim_create_effect_instance
/* 341A9C E002E0BC AC820004 */ sw $v0, 0x4($a0)
/* 341AA0 E002E0C0 00132100 */ sll $a0, $s3, 4
/* 341AA4 E002E0C4 00932021 */ addu $a0, $a0, $s3
/* 341AA8 E002E0C8 00042080 */ sll $a0, $a0, 2
/* 341AAC E002E0CC 0040802D */ daddu $s0, $v0, $zero
/* 341AB0 E002E0D0 0C08012C */ jal shim_general_heap_malloc
/* 341AB4 E002E0D4 AE130008 */ sw $s3, 0x8($s0)
/* 341AB8 E002E0D8 0040882D */ daddu $s1, $v0, $zero
/* 341ABC E002E0DC 16200003 */ bnez $s1, .LE002E0EC
/* 341AC0 E002E0E0 AE11000C */ sw $s1, 0xC($s0)
.LE002E0E4:
/* 341AC4 E002E0E4 0800B839 */ j .LE002E0E4
/* 341AC8 E002E0E8 00000000 */ nop
.LE002E0EC:
/* 341ACC E002E0EC 0220202D */ daddu $a0, $s1, $zero
/* 341AD0 E002E0F0 00132900 */ sll $a1, $s3, 4
/* 341AD4 E002E0F4 00B32821 */ addu $a1, $a1, $s3
/* 341AD8 E002E0F8 0C080130 */ jal shim_mem_clear
/* 341ADC E002E0FC 00052880 */ sll $a1, $a1, 2
/* 341AE0 E002E100 AE200038 */ sw $zero, 0x38($s1)
/* 341AE4 E002E104 AE20003C */ sw $zero, 0x3C($s1)
/* 341AE8 E002E108 A6320000 */ sh $s2, 0x0($s1)
/* 341AEC E002E10C E6340004 */ swc1 $f20, 0x4($s1)
/* 341AF0 E002E110 E6380008 */ swc1 $f24, 0x8($s1)
/* 341AF4 E002E114 E63A000C */ swc1 $f26, 0xC($s1)
/* 341AF8 E002E118 24120001 */ addiu $s2, $zero, 0x1
/* 341AFC E002E11C 0253102A */ slt $v0, $s2, $s3
/* 341B00 E002E120 1040003B */ beqz $v0, .LE002E210
/* 341B04 E002E124 26310044 */ addiu $s1, $s1, 0x44
/* 341B08 E002E128 2674FFFF */ addiu $s4, $s3, -0x1
/* 341B0C E002E12C 26300034 */ addiu $s0, $s1, 0x34
/* 341B10 E002E130 0000882D */ daddu $s1, $zero, $zero
/* 341B14 E002E134 3C01C040 */ lui $at, (0xC0400000 >> 16)
/* 341B18 E002E138 4481F000 */ mtc1 $at, $f30
/* 341B1C E002E13C 3C013E4C */ lui $at, (0x3E4CCCCC >> 16)
/* 341B20 E002E140 3421CCCC */ ori $at, $at, (0x3E4CCCCC & 0xFFFF)
/* 341B24 E002E144 4481E000 */ mtc1 $at, $f28
/* 341B28 E002E148 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 341B2C E002E14C 4481D000 */ mtc1 $at, $f26
/* 341B30 E002E150 3C01BE23 */ lui $at, (0xBE23D70A >> 16)
/* 341B34 E002E154 3421D70A */ ori $at, $at, (0xBE23D70A & 0xFFFF)
/* 341B38 E002E158 4481C000 */ mtc1 $at, $f24
.LE002E15C:
/* 341B3C E002E15C 16800002 */ bnez $s4, .LE002E168
/* 341B40 E002E160 0234001A */ div $zero, $s1, $s4
/* 341B44 E002E164 0007000D */ break 7
.LE002E168:
/* 341B48 E002E168 2401FFFF */ addiu $at, $zero, -0x1
/* 341B4C E002E16C 16810004 */ bne $s4, $at, .LE002E180
/* 341B50 E002E170 3C018000 */ lui $at, (0x80000000 >> 16)
/* 341B54 E002E174 16210002 */ bne $s1, $at, .LE002E180
/* 341B58 E002E178 00000000 */ nop
/* 341B5C E002E17C 0006000D */ break 6
.LE002E180:
/* 341B60 E002E180 00001812 */ mflo $v1
/* 341B64 E002E184 E61EFFDC */ swc1 $f30, -0x24($s0)
/* 341B68 E002E188 E61CFFE0 */ swc1 $f28, -0x20($s0)
/* 341B6C E002E18C AE00FFE4 */ sw $zero, -0x1C($s0)
/* 341B70 E002E190 AE00FFE8 */ sw $zero, -0x18($s0)
/* 341B74 E002E194 E61AFFEC */ swc1 $f26, -0x14($s0)
/* 341B78 E002E198 E618FFF0 */ swc1 $f24, -0x10($s0)
/* 341B7C E002E19C AE00FFF4 */ sw $zero, -0xC($s0)
/* 341B80 E002E1A0 AE00FFF8 */ sw $zero, -0x8($s0)
/* 341B84 E002E1A4 4483A000 */ mtc1 $v1, $f20
/* 341B88 E002E1A8 00000000 */ nop
/* 341B8C E002E1AC 4680A520 */ cvt.s.w $f20, $f20
/* 341B90 E002E1B0 0C080140 */ jal shim_sin_deg
/* 341B94 E002E1B4 4600A306 */ mov.s $f12, $f20
/* 341B98 E002E1B8 46000007 */ neg.s $f0, $f0
/* 341B9C E002E1BC 46160002 */ mul.s $f0, $f0, $f22
/* 341BA0 E002E1C0 00000000 */ nop
/* 341BA4 E002E1C4 4600A306 */ mov.s $f12, $f20
/* 341BA8 E002E1C8 0C080144 */ jal shim_cos_deg
/* 341BAC E002E1CC E600FFD0 */ swc1 $f0, -0x30($s0)
/* 341BB0 E002E1D0 46000007 */ neg.s $f0, $f0
/* 341BB4 E002E1D4 46160002 */ mul.s $f0, $f0, $f22
/* 341BB8 E002E1D8 00000000 */ nop
/* 341BBC E002E1DC 26310168 */ addiu $s1, $s1, 0x168
/* 341BC0 E002E1E0 26520001 */ addiu $s2, $s2, 0x1
/* 341BC4 E002E1E4 4600A306 */ mov.s $f12, $f20
/* 341BC8 E002E1E8 AE00FFD8 */ sw $zero, -0x28($s0)
/* 341BCC E002E1EC 0C080140 */ jal shim_sin_deg
/* 341BD0 E002E1F0 E600FFD4 */ swc1 $f0, -0x2C($s0)
/* 341BD4 E002E1F4 4600A306 */ mov.s $f12, $f20
/* 341BD8 E002E1F8 0C080144 */ jal shim_cos_deg
/* 341BDC E002E1FC E600FFFC */ swc1 $f0, -0x4($s0)
/* 341BE0 E002E200 E6000000 */ swc1 $f0, 0x0($s0)
/* 341BE4 E002E204 0253102A */ slt $v0, $s2, $s3
/* 341BE8 E002E208 1440FFD4 */ bnez $v0, .LE002E15C
/* 341BEC E002E20C 26100044 */ addiu $s0, $s0, 0x44
.LE002E210:
/* 341BF0 E002E210 8FBF003C */ lw $ra, 0x3C($sp)
/* 341BF4 E002E214 8FB40038 */ lw $s4, 0x38($sp)
/* 341BF8 E002E218 8FB30034 */ lw $s3, 0x34($sp)
/* 341BFC E002E21C 8FB20030 */ lw $s2, 0x30($sp)
/* 341C00 E002E220 8FB1002C */ lw $s1, 0x2C($sp)
/* 341C04 E002E224 8FB00028 */ lw $s0, 0x28($sp)
/* 341C08 E002E228 D7BE0068 */ ldc1 $f30, 0x68($sp)
/* 341C0C E002E22C D7BC0060 */ ldc1 $f28, 0x60($sp)
/* 341C10 E002E230 D7BA0058 */ ldc1 $f26, 0x58($sp)
/* 341C14 E002E234 D7B80050 */ ldc1 $f24, 0x50($sp)
/* 341C18 E002E238 D7B60048 */ ldc1 $f22, 0x48($sp)
/* 341C1C E002E23C D7B40040 */ ldc1 $f20, 0x40($sp)
/* 341C20 E002E240 03E00008 */ jr $ra
/* 341C24 E002E244 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void smoke_ring_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
EffectInstance* effect;
SmokeRingFXData* part;
s32 numParts;
f32 factor;
s32 i;
switch (arg0) {
case 0:
numParts = 7;
factor = 14.0f;
break;
case 1:
numParts = 9;
factor = 28.0f;
break;
default:
numParts = 11;
factor = 42.0f;
break;
}
bpPtr->init = smoke_ring_init;
bpPtr->update = smoke_ring_update;
bpPtr->renderWorld = smoke_ring_render;
bpPtr->unk_00 = 0;
bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_SMOKE_RING;
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data.smokeRing = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.smokeRing != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
part->unk_38 = 0;
part->unk_3C = 0;
part->unk_00 = arg0;
part->unk_04 = arg1;
part->unk_08 = arg2;
part->unk_0C = arg3;
part++;
for (i = 1; i < numParts; i++, part++) {
f32 angle = (i - 1) * 360 / (numParts - 1);
part->unk_10 = -3.0f;
part->unk_14 = 0.19999999f;
part->unk_18 = 0;
part->unk_1C = 0;
part->unk_20 = 1.75f;
part->unk_24 = -0.16f;
part->unk_28 = 0;
part->unk_2C = 0;
part->unk_04 = -shim_sin_deg(angle) * factor;
part->unk_08 = -shim_cos_deg(angle) * factor;
part->unk_0C = 0;
part->unk_30 = shim_sin_deg(angle);
part->unk_34 = shim_cos_deg(angle);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel evt_set_float_variable
/* ECFF0 802C8640 27BDFFE0 */ addiu $sp, $sp, -0x20
/* ECFF4 802C8644 AFB10014 */ sw $s1, 0x14($sp)
/* ECFF8 802C8648 0080882D */ daddu $s1, $a0, $zero
/* ECFFC 802C864C 3C02EFE8 */ lui $v0, (0xEFE82080 >> 16)
/* ED000 802C8650 34422080 */ ori $v0, $v0, (0xEFE82080 & 0xFFFF)
/* ED004 802C8654 44866000 */ mtc1 $a2, $f12
/* ED008 802C8658 0045102A */ slt $v0, $v0, $a1
/* ED00C 802C865C AFBF001C */ sw $ra, 0x1C($sp)
/* ED010 802C8660 AFB20018 */ sw $s2, 0x18($sp)
/* ED014 802C8664 1040003D */ beqz $v0, .L802C875C
/* ED018 802C8668 AFB00010 */ sw $s0, 0x10($sp)
/* ED01C 802C866C 3C02F2E3 */ lui $v0, (0xF2E31100 >> 16)
/* ED020 802C8670 34421100 */ ori $v0, $v0, (0xF2E31100 & 0xFFFF)
/* ED024 802C8674 0045102A */ slt $v0, $v0, $a1
/* ED028 802C8678 10400038 */ beqz $v0, .L802C875C
/* ED02C 802C867C 3C02F545 */ lui $v0, (0xF5456B00 >> 16)
/* ED030 802C8680 34426B00 */ ori $v0, $v0, (0xF5456B00 & 0xFFFF)
/* ED034 802C8684 0045102A */ slt $v0, $v0, $a1
/* ED038 802C8688 1440000E */ bnez $v0, .L802C86C4
/* ED03C 802C868C 3C02FB3B */ lui $v0, (0xFB3B4C00 >> 16)
/* ED040 802C8690 3C020B53 */ lui $v0, (0xB532B80 >> 16)
/* ED044 802C8694 34422B80 */ ori $v0, $v0, (0xB532B80 & 0xFFFF)
/* ED048 802C8698 00A22821 */ addu $a1, $a1, $v0
/* ED04C 802C869C 8E22013C */ lw $v0, 0x13C($s1)
/* ED050 802C86A0 00058080 */ sll $s0, $a1, 2
/* ED054 802C86A4 02021021 */ addu $v0, $s0, $v0
/* ED058 802C86A8 0C0B125B */ jal evt_float_to_fixed_var
/* ED05C 802C86AC 8C520000 */ lw $s2, 0x0($v0)
/* ED060 802C86B0 8E23013C */ lw $v1, 0x13C($s1)
/* ED064 802C86B4 0240202D */ daddu $a0, $s2, $zero
/* ED068 802C86B8 02038021 */ addu $s0, $s0, $v1
/* ED06C 802C86BC 080B221C */ j .L802C8870
/* ED070 802C86C0 AE020000 */ sw $v0, 0x0($s0)
.L802C86C4:
/* ED074 802C86C4 34424C00 */ ori $v0, $v0, (0xFB3B4C00 & 0xFFFF)
/* ED078 802C86C8 0045102A */ slt $v0, $v0, $a1
/* ED07C 802C86CC 54400025 */ bnel $v0, $zero, .L802C8764
/* ED080 802C86D0 3C02FC6C */ lui $v0, (0xFC6C7900 >> 16)
/* ED084 802C86D4 3C02055D */ lui $v0, (0x55D4A80 >> 16)
/* ED088 802C86D8 34424A80 */ ori $v0, $v0, (0x55D4A80 & 0xFFFF)
/* ED08C 802C86DC 00A22821 */ addu $a1, $a1, $v0
/* ED090 802C86E0 04A10002 */ bgez $a1, .L802C86EC
/* ED094 802C86E4 00A0102D */ daddu $v0, $a1, $zero
/* ED098 802C86E8 24A2001F */ addiu $v0, $a1, 0x1F
.L802C86EC:
/* ED09C 802C86EC 00023143 */ sra $a2, $v0, 5
/* ED0A0 802C86F0 00C0202D */ daddu $a0, $a2, $zero
/* ED0A4 802C86F4 00041140 */ sll $v0, $a0, 5
/* ED0A8 802C86F8 44800000 */ mtc1 $zero, $f0
/* ED0AC 802C86FC 00000000 */ nop
/* ED0B0 802C8700 46006032 */ c.eq.s $f12, $f0
/* ED0B4 802C8704 00000000 */ nop
/* ED0B8 802C8708 4501000A */ bc1t .L802C8734
/* ED0BC 802C870C 00A23023 */ subu $a2, $a1, $v0
/* ED0C0 802C8710 3C02802E */ lui $v0, %hi(gMapFlags)
/* ED0C4 802C8714 8C42A480 */ lw $v0, %lo(gMapFlags)($v0)
/* ED0C8 802C8718 00042080 */ sll $a0, $a0, 2
/* ED0CC 802C871C 00822021 */ addu $a0, $a0, $v0
/* ED0D0 802C8720 24020001 */ addiu $v0, $zero, 0x1
/* ED0D4 802C8724 8C830000 */ lw $v1, 0x0($a0)
/* ED0D8 802C8728 00C21004 */ sllv $v0, $v0, $a2
/* ED0DC 802C872C 080B21D6 */ j .L802C8758
/* ED0E0 802C8730 00621825 */ or $v1, $v1, $v0
.L802C8734:
/* ED0E4 802C8734 3C02802E */ lui $v0, %hi(gMapFlags)
/* ED0E8 802C8738 8C42A480 */ lw $v0, %lo(gMapFlags)($v0)
/* ED0EC 802C873C 00042080 */ sll $a0, $a0, 2
/* ED0F0 802C8740 00822021 */ addu $a0, $a0, $v0
/* ED0F4 802C8744 24020001 */ addiu $v0, $zero, 0x1
/* ED0F8 802C8748 00C21004 */ sllv $v0, $v0, $a2
/* ED0FC 802C874C 8C830000 */ lw $v1, 0x0($a0)
/* ED100 802C8750 00021027 */ nor $v0, $zero, $v0
/* ED104 802C8754 00621824 */ and $v1, $v1, $v0
.L802C8758:
/* ED108 802C8758 AC830000 */ sw $v1, 0x0($a0)
.L802C875C:
/* ED10C 802C875C 080B221E */ j .L802C8878
/* ED110 802C8760 46006006 */ mov.s $f0, $f12
.L802C8764:
/* ED114 802C8764 34427900 */ ori $v0, $v0, (0xFC6C7900 & 0xFFFF)
/* ED118 802C8768 0045102A */ slt $v0, $v0, $a1
/* ED11C 802C876C 54400020 */ bnel $v0, $zero, .L802C87F0
/* ED120 802C8770 3C02FD9D */ lui $v0, (0xFD9DA600 >> 16)
/* ED124 802C8774 3C02042C */ lui $v0, (0x42C1D80 >> 16)
/* ED128 802C8778 34421D80 */ ori $v0, $v0, (0x42C1D80 & 0xFFFF)
/* ED12C 802C877C 00A22821 */ addu $a1, $a1, $v0
/* ED130 802C8780 04A10002 */ bgez $a1, .L802C878C
/* ED134 802C8784 00A0102D */ daddu $v0, $a1, $zero
/* ED138 802C8788 24A2001F */ addiu $v0, $a1, 0x1F
.L802C878C:
/* ED13C 802C878C 00023143 */ sra $a2, $v0, 5
/* ED140 802C8790 00C0182D */ daddu $v1, $a2, $zero
/* ED144 802C8794 00031140 */ sll $v0, $v1, 5
/* ED148 802C8798 44800000 */ mtc1 $zero, $f0
/* ED14C 802C879C 00000000 */ nop
/* ED150 802C87A0 46006032 */ c.eq.s $f12, $f0
/* ED154 802C87A4 00000000 */ nop
/* ED158 802C87A8 45010008 */ bc1t .L802C87CC
/* ED15C 802C87AC 00A23023 */ subu $a2, $a1, $v0
/* ED160 802C87B0 00031080 */ sll $v0, $v1, 2
/* ED164 802C87B4 02221021 */ addu $v0, $s1, $v0
/* ED168 802C87B8 24030001 */ addiu $v1, $zero, 0x1
/* ED16C 802C87BC 8C4400C4 */ lw $a0, 0xC4($v0)
/* ED170 802C87C0 00C31804 */ sllv $v1, $v1, $a2
/* ED174 802C87C4 080B21FA */ j .L802C87E8
/* ED178 802C87C8 00832025 */ or $a0, $a0, $v1
.L802C87CC:
/* ED17C 802C87CC 00031080 */ sll $v0, $v1, 2
/* ED180 802C87D0 02221021 */ addu $v0, $s1, $v0
/* ED184 802C87D4 24030001 */ addiu $v1, $zero, 0x1
/* ED188 802C87D8 00C31804 */ sllv $v1, $v1, $a2
/* ED18C 802C87DC 8C4400C4 */ lw $a0, 0xC4($v0)
/* ED190 802C87E0 00031827 */ nor $v1, $zero, $v1
/* ED194 802C87E4 00832024 */ and $a0, $a0, $v1
.L802C87E8:
/* ED198 802C87E8 080B21D7 */ j .L802C875C
/* ED19C 802C87EC AC4400C4 */ sw $a0, 0xC4($v0)
.L802C87F0:
/* ED1A0 802C87F0 3442A600 */ ori $v0, $v0, (0xFD9DA600 & 0xFFFF)
/* ED1A4 802C87F4 0045102A */ slt $v0, $v0, $a1
/* ED1A8 802C87F8 14400010 */ bnez $v0, .L802C883C
/* ED1AC 802C87FC 3C02FECE */ lui $v0, (0xFECED300 >> 16)
/* ED1B0 802C8800 3C0202FA */ lui $v0, (0x2FAF080 >> 16)
/* ED1B4 802C8804 3442F080 */ ori $v0, $v0, (0x2FAF080 & 0xFFFF)
/* ED1B8 802C8808 00A22821 */ addu $a1, $a1, $v0
/* ED1BC 802C880C 3C11802E */ lui $s1, %hi(gMapVars)
/* ED1C0 802C8810 2631A484 */ addiu $s1, $s1, %lo(gMapVars)
/* ED1C4 802C8814 8E220000 */ lw $v0, 0x0($s1)
/* ED1C8 802C8818 00058080 */ sll $s0, $a1, 2
/* ED1CC 802C881C 02021021 */ addu $v0, $s0, $v0
/* ED1D0 802C8820 0C0B125B */ jal evt_float_to_fixed_var
/* ED1D4 802C8824 8C520000 */ lw $s2, 0x0($v0)
/* ED1D8 802C8828 8E230000 */ lw $v1, 0x0($s1)
/* ED1DC 802C882C 0240202D */ daddu $a0, $s2, $zero
/* ED1E0 802C8830 02038021 */ addu $s0, $s0, $v1
/* ED1E4 802C8834 080B221C */ j .L802C8870
/* ED1E8 802C8838 AE020000 */ sw $v0, 0x0($s0)
.L802C883C:
/* ED1EC 802C883C 3442D300 */ ori $v0, $v0, (0xFECED300 & 0xFFFF)
/* ED1F0 802C8840 0045102A */ slt $v0, $v0, $a1
/* ED1F4 802C8844 1440000C */ bnez $v0, .L802C8878
/* ED1F8 802C8848 46006006 */ mov.s $f0, $f12
/* ED1FC 802C884C 3C0201C9 */ lui $v0, (0x1C9C380 >> 16)
/* ED200 802C8850 3442C380 */ ori $v0, $v0, (0x1C9C380 & 0xFFFF)
/* ED204 802C8854 00A22821 */ addu $a1, $a1, $v0
/* ED208 802C8858 00058080 */ sll $s0, $a1, 2
/* ED20C 802C885C 02308021 */ addu $s0, $s1, $s0
/* ED210 802C8860 0C0B125B */ jal evt_float_to_fixed_var
/* ED214 802C8864 8E120084 */ lw $s2, 0x84($s0)
/* ED218 802C8868 AE020084 */ sw $v0, 0x84($s0)
/* ED21C 802C886C 0240202D */ daddu $a0, $s2, $zero
.L802C8870:
/* ED220 802C8870 0C0B1248 */ jal evt_fixed_var_to_float
/* ED224 802C8874 00000000 */ nop
.L802C8878:
/* ED228 802C8878 8FBF001C */ lw $ra, 0x1C($sp)
/* ED22C 802C887C 8FB20018 */ lw $s2, 0x18($sp)
/* ED230 802C8880 8FB10014 */ lw $s1, 0x14($sp)
/* ED234 802C8884 8FB00010 */ lw $s0, 0x10($sp)
/* ED238 802C8888 03E00008 */ jr $ra
/* ED23C 802C888C 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
f32 evt_set_float_variable(Evt* script, Bytecode var, f32 value) {
s32 temp;
s32 oldValue;
if (var <= EVT_LIMIT) {
return value;
} else if (var <= EVT_FIXED_CUTOFF) {
return value;
} else if (var <= EVT_ARRAY_VAR_CUTOFF) {
var = EVT_INDEX_OF_ARRAY_VAR(var);
oldValue = script->array[var];
script->array[var] = evt_float_to_fixed_var(value);
return evt_fixed_var_to_float(oldValue);
} else if (var <= EVT_MAP_FLAG_CUTOFF) {
var = EVT_INDEX_OF_MAP_FLAG(var);
temp = var % 32;
if (value) {
gMapFlags[var / 32] |= 1 << temp;
} else {
gMapFlags[var / 32] &= ~(1 << temp);
}
return value;
} else if (var <= EVT_LOCAL_FLAG_CUTOFF) {
var = EVT_INDEX_OF_LOCAL_FLAG(var);
temp = var % 32;
if (value) {
script->varFlags[var / 32] |= 1 << temp;
} else {
script->varFlags[var / 32] &= ~(1 << temp);
}
return value;
} else if (var <= EVT_MAP_VAR_CUTOFF) {
var = EVT_INDEX_OF_MAP_VAR(var);
oldValue = gMapVars[var];
gMapVars[var] = evt_float_to_fixed_var(value);
return evt_fixed_var_to_float(oldValue);
} else if (var <= EVT_LOCAL_VAR_CUTOFF) {
var = EVT_INDEX_OF_LOCAL_VAR(var);
oldValue = script->varTable[var];
script->varTable[var] = evt_float_to_fixed_var(value);
return evt_fixed_var_to_float(oldValue);
} else {
return value;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel state_init_logos
/* F270 80033E70 27BDFFD0 */ addiu $sp, $sp, -0x30
/* F274 80033E74 AFBF0024 */ sw $ra, 0x24($sp)
/* F278 80033E78 AFB20020 */ sw $s2, 0x20($sp)
/* F27C 80033E7C AFB1001C */ sw $s1, 0x1C($sp)
/* F280 80033E80 AFB00018 */ sw $s0, 0x18($sp)
/* F284 80033E84 0C00AB00 */ jal general_heap_create
/* F288 80033E88 F7B40028 */ sdc1 $f20, 0x28($sp)
/* F28C 80033E8C 3C128007 */ lui $s2, %hi(gGameStatusPtr)
/* F290 80033E90 2652419C */ addiu $s2, $s2, %lo(gGameStatusPtr)
/* F294 80033E94 8E420000 */ lw $v0, 0x0($s2)
/* F298 80033E98 A04000AC */ sb $zero, 0xAC($v0)
/* F29C 80033E9C 8E420000 */ lw $v0, 0x0($s2)
/* F2A0 80033EA0 A04000AD */ sb $zero, 0xAD($v0)
/* F2A4 80033EA4 8E420000 */ lw $v0, 0x0($s2)
/* F2A8 80033EA8 240400FF */ addiu $a0, $zero, 0xFF
/* F2AC 80033EAC 0C00CDF4 */ jal intro_logos_set_fade_alpha
/* F2B0 80033EB0 A04000AE */ sb $zero, 0xAE($v0)
/* F2B4 80033EB4 0C00CDF8 */ jal intro_logos_set_fade_color
/* F2B8 80033EB8 0000202D */ daddu $a0, $zero, $zero
/* F2BC 80033EBC 3C110022 */ lui $s1, %hi(D_2191B0)
/* F2C0 80033EC0 263191B0 */ addiu $s1, $s1, %lo(D_2191B0)
/* F2C4 80033EC4 3C100020 */ lui $s0, %hi(D_1FE1B0)
/* F2C8 80033EC8 2610E1B0 */ addiu $s0, $s0, %lo(D_1FE1B0)
/* F2CC 80033ECC 0C00AB39 */ jal heap_malloc
/* F2D0 80033ED0 02302023 */ subu $a0, $s1, $s0
/* F2D4 80033ED4 0200202D */ daddu $a0, $s0, $zero
/* F2D8 80033ED8 0220282D */ daddu $a1, $s1, $zero
/* F2DC 80033EDC 0040302D */ daddu $a2, $v0, $zero
/* F2E0 80033EE0 3C10800A */ lui $s0, %hi(gLogosImages)
/* F2E4 80033EE4 26100910 */ addiu $s0, $s0, %lo(gLogosImages)
/* F2E8 80033EE8 0C00A5CF */ jal dma_copy
/* F2EC 80033EEC AE060000 */ sw $a2, 0x0($s0)
/* F2F0 80033EF0 3C040001 */ lui $a0, (0x15000 >> 16)
/* F2F4 80033EF4 8E020000 */ lw $v0, 0x0($s0)
/* F2F8 80033EF8 34845000 */ ori $a0, $a0, (0x15000 & 0xFFFF)
/* F2FC 80033EFC 24437000 */ addiu $v1, $v0, 0x7000
/* F300 80033F00 3C01800A */ lui $at, %hi(gLogosImage1)
/* F304 80033F04 AC220918 */ sw $v0, %lo(gLogosImage1)($at)
/* F308 80033F08 00441021 */ addu $v0, $v0, $a0
/* F30C 80033F0C 3C01800A */ lui $at, %hi(gLogosImage3)
/* F310 80033F10 AC230914 */ sw $v1, %lo(gLogosImage3)($at)
/* F314 80033F14 3C01800A */ lui $at, %hi(gLogosImage2)
/* F318 80033F18 AC22091C */ sw $v0, %lo(gLogosImage2)($at)
/* F31C 80033F1C 0C018028 */ jal nuContRmbForceStop
/* F320 80033F20 00000000 */ nop
/* F324 80033F24 0C00B7BD */ jal create_cameras_a
/* F328 80033F28 00000000 */ nop
/* F32C 80033F2C 0000202D */ daddu $a0, $zero, $zero
/* F330 80033F30 2405000C */ addiu $a1, $zero, 0xC
/* F334 80033F34 2406001C */ addiu $a2, $zero, 0x1C
/* F338 80033F38 3C10800B */ lui $s0, %hi(gCameras)
/* F33C 80033F3C 26101D80 */ addiu $s0, $s0, %lo(gCameras)
/* F340 80033F40 24020006 */ addiu $v0, $zero, 0x6
/* F344 80033F44 A6020004 */ sh $v0, 0x4($s0)
/* F348 80033F48 24020001 */ addiu $v0, $zero, 0x1
/* F34C 80033F4C A6020006 */ sh $v0, 0x6($s0)
/* F350 80033F50 24020010 */ addiu $v0, $zero, 0x10
/* F354 80033F54 A6020012 */ sh $v0, 0x12($s0)
/* F358 80033F58 24021000 */ addiu $v0, $zero, 0x1000
/* F35C 80033F5C A6020014 */ sh $v0, 0x14($s0)
/* F360 80033F60 240200B8 */ addiu $v0, $zero, 0xB8
/* F364 80033F64 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* F368 80033F68 4481A000 */ mtc1 $at, $f20
/* F36C 80033F6C 24070128 */ addiu $a3, $zero, 0x128
/* F370 80033F70 3C018007 */ lui $at, %hi(gCurrentCameraID)
/* F374 80033F74 AC207410 */ sw $zero, %lo(gCurrentCameraID)($at)
/* F378 80033F78 E6140018 */ swc1 $f20, 0x18($s0)
/* F37C 80033F7C AFA20010 */ sw $v0, 0x10($sp)
/* F380 80033F80 96020000 */ lhu $v0, 0x0($s0)
/* F384 80033F84 96030558 */ lhu $v1, 0x558($s0)
/* F388 80033F88 34420002 */ ori $v0, $v0, 0x2
/* F38C 80033F8C A6020000 */ sh $v0, 0x0($s0)
/* F390 80033F90 96020AB0 */ lhu $v0, 0xAB0($s0)
/* F394 80033F94 34630002 */ ori $v1, $v1, 0x2
/* F398 80033F98 A6030558 */ sh $v1, 0x558($s0)
/* F39C 80033F9C 96031008 */ lhu $v1, 0x1008($s0)
/* F3A0 80033FA0 34420002 */ ori $v0, $v0, 0x2
/* F3A4 80033FA4 34630002 */ ori $v1, $v1, 0x2
/* F3A8 80033FA8 A6020AB0 */ sh $v0, 0xAB0($s0)
/* F3AC 80033FAC 0C00B8C5 */ jal set_cam_viewport
/* F3B0 80033FB0 A6031008 */ sh $v1, 0x1008($s0)
/* F3B4 80033FB4 3C0143FA */ lui $at, (0x43FA0000 >> 16)
/* F3B8 80033FB8 44810000 */ mtc1 $at, $f0
/* F3BC 80033FBC 3C01447A */ lui $at, (0x447A0000 >> 16)
/* F3C0 80033FC0 44811000 */ mtc1 $at, $f2
/* F3C4 80033FC4 3C0144BB */ lui $at, (0x44BB8000 >> 16)
/* F3C8 80033FC8 34218000 */ ori $at, $at, (0x44BB8000 & 0xFFFF)
/* F3CC 80033FCC 44812000 */ mtc1 $at, $f4
/* F3D0 80033FD0 3C014316 */ lui $at, (0x43160000 >> 16)
/* F3D4 80033FD4 44813000 */ mtc1 $at, $f6
/* F3D8 80033FD8 24020028 */ addiu $v0, $zero, 0x28
/* F3DC 80033FDC A602001E */ sh $v0, 0x1E($s0)
/* F3E0 80033FE0 24020064 */ addiu $v0, $zero, 0x64
/* F3E4 80033FE4 A600002C */ sh $zero, 0x2C($s0)
/* F3E8 80033FE8 A600002E */ sh $zero, 0x2E($s0)
/* F3EC 80033FEC A6000030 */ sh $zero, 0x30($s0)
/* F3F0 80033FF0 E6140054 */ swc1 $f20, 0x54($s0)
/* F3F4 80033FF4 E6140058 */ swc1 $f20, 0x58($s0)
/* F3F8 80033FF8 A600001C */ sh $zero, 0x1C($s0)
/* F3FC 80033FFC A6020020 */ sh $v0, 0x20($s0)
/* F400 80034000 A6000022 */ sh $zero, 0x22($s0)
/* F404 80034004 E600003C */ swc1 $f0, 0x3C($s0)
/* F408 80034008 E6020040 */ swc1 $f2, 0x40($s0)
/* F40C 8003400C E6040044 */ swc1 $f4, 0x44($s0)
/* F410 80034010 0C0B0C77 */ jal clear_script_list
/* F414 80034014 E606005C */ swc1 $f6, 0x5C($s0)
/* F418 80034018 0C048C2E */ jal clear_worker_list
/* F41C 8003401C 00000000 */ nop
/* F420 80034020 0C047624 */ jal clear_render_tasks
/* F424 80034024 00000000 */ nop
/* F428 80034028 0C0B763E */ jal spr_init_sprites
/* F42C 8003402C 0000202D */ daddu $a0, $zero, $zero
/* F430 80034030 0C047889 */ jal clear_animator_list
/* F434 80034034 00000000 */ nop
/* F438 80034038 0C0482EC */ jal clear_entity_models
/* F43C 8003403C 00000000 */ nop
/* F440 80034040 0C00E12F */ jal clear_npcs
/* F444 80034044 00000000 */ nop
/* F448 80034048 0C050440 */ jal hud_element_clear_cache
/* F44C 8003404C 00000000 */ nop
/* F450 80034050 0C05177E */ jal reset_background_settings
/* F454 80034054 00000000 */ nop
/* F458 80034058 0C04432E */ jal clear_entity_data
/* F45C 8003405C 24040001 */ addiu $a0, $zero, 0x1
/* F460 80034060 0C016727 */ jal clear_effect_data
/* F464 80034064 00000000 */ nop
/* F468 80034068 3C03800A */ lui $v1, %hi(gOverrideFlags)
/* F46C 8003406C 2463A650 */ addiu $v1, $v1, %lo(gOverrideFlags)
/* F470 80034070 8C620000 */ lw $v0, 0x0($v1)
/* F474 80034074 34420002 */ ori $v0, $v0, 0x2
/* F478 80034078 0C00CE1D */ jal intro_logos_update_fade
/* F47C 8003407C AC620000 */ sw $v0, 0x0($v1)
/* F480 80034080 8E420000 */ lw $v0, 0x0($s2)
/* F484 80034084 A4400148 */ sh $zero, 0x148($v0)
/* F488 80034088 8FBF0024 */ lw $ra, 0x24($sp)
/* F48C 8003408C 8FB20020 */ lw $s2, 0x20($sp)
/* F490 80034090 8FB1001C */ lw $s1, 0x1C($sp)
/* F494 80034094 8FB00018 */ lw $s0, 0x18($sp)
/* F498 80034098 D7B40028 */ ldc1 $f20, 0x28($sp)
/* F49C 8003409C 03E00008 */ jr $ra
/* F4A0 800340A0 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void state_init_logos(void) {
s8* romStart;
s8* romEnd;
general_heap_create();
gGameStatusPtr->introState = INTRO_STATE_0;
gGameStatusPtr->introCounter = 0;
gGameStatusPtr->bSkipIntro = FALSE;
intro_logos_set_fade_alpha(255);
intro_logos_set_fade_color(0);
romEnd = logos_ROM_END;
romStart = logos_ROM_START;
gLogosImages = heap_malloc(romEnd - romStart);
dma_copy(romStart, romEnd, gLogosImages);
gLogosImage1 = gLogosImages + 0x0;
gLogosImage3 = gLogosImages + 0x7000;
gLogosImage2 = gLogosImages + 0x15000;
nuContRmbForceStop();
create_cameras_a();
gCameras[CAM_DEFAULT].updateMode = CAM_UPDATE_MODE_6;
gCameras[CAM_DEFAULT].needsInit = TRUE;
gCameras[CAM_DEFAULT].nearClip = 16;
gCameras[CAM_DEFAULT].farClip = 4096;
gCurrentCameraID = CAM_DEFAULT;
gCameras[CAM_DEFAULT].vfov = 25.0f;
gCameras[CAM_DEFAULT].flags |= CAMERA_FLAG_DISABLED;
gCameras[CAM_BATTLE].flags |= CAMERA_FLAG_DISABLED;
gCameras[CAM_TATTLE].flags |= CAMERA_FLAG_DISABLED;
gCameras[CAM_3].flags |= CAMERA_FLAG_DISABLED;
set_cam_viewport(0, 12, 28, 296, 184);
gCameras[CAM_DEFAULT].auxBoomLength = 40;
gCameras[CAM_DEFAULT].bgColor[0] = 0;
gCameras[CAM_DEFAULT].bgColor[1] = 0;
gCameras[CAM_DEFAULT].bgColor[2] = 0;
gCameras[CAM_DEFAULT].lookAt_obj_target.x = 25.0f;
gCameras[CAM_DEFAULT].lookAt_obj_target.y = 25.0f;
gCameras[CAM_DEFAULT].auxPitch = 0;
gCameras[CAM_DEFAULT].lookAt_dist = 100;
gCameras[CAM_DEFAULT].auxBoomPitch = 0;
gCameras[CAM_DEFAULT].lookAt_eye.x = 500.0f;
gCameras[CAM_DEFAULT].lookAt_eye.y = 1000.0f;
gCameras[CAM_DEFAULT].lookAt_eye.z = 1500.0f;
gCameras[CAM_DEFAULT].lookAt_obj_target.z = 150.0f;
clear_script_list();
clear_worker_list();
clear_render_tasks();
spr_init_sprites(PLAYER_SPRITES_MARIO_WORLD);
clear_animator_list();
clear_entity_models();
clear_npcs();
hud_element_clear_cache();
reset_background_settings();
clear_entity_data(1);
clear_effect_data();
gOverrideFlags |= GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD;
intro_logos_update_fade();
gGameStatusPtr->backgroundFlags = 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_8024C944
/* 17B224 8024C944 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 17B228 8024C948 AFB00030 */ sw $s0, 0x30($sp)
/* 17B22C 8024C94C 3C10800B */ lui $s0, %hi(gCameras + 0x558)
/* 17B230 8024C950 261022D8 */ addiu $s0, $s0, %lo(gCameras + 0x558)
/* 17B234 8024C954 3C06800E */ lui $a2, %hi(gBattleStatus)
/* 17B238 8024C958 24C6C070 */ addiu $a2, $a2, %lo(gBattleStatus)
/* 17B23C 8024C95C AFBF0034 */ sw $ra, 0x34($sp)
/* 17B240 8024C960 10A0001C */ beqz $a1, .L8024C9D4
.L8024C964:
/* 17B244 8024C964 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 17B248 8024C968 C6000054 */ lwc1 $f0, 0x54($s0)
/* 17B24C 8024C96C C6020058 */ lwc1 $f2, 0x58($s0)
/* 17B250 8024C970 C604005C */ lwc1 $f4, 0x5C($s0)
/* 17B254 8024C974 8602001E */ lh $v0, 0x1E($s0)
/* 17B258 8024C978 86030022 */ lh $v1, 0x22($s0)
/* 17B25C 8024C97C 3C01802A */ lui $at, %hi(BattleCam_PosX)
/* 17B260 8024C980 E420F270 */ swc1 $f0, %lo(BattleCam_PosX)($at)
glabel func_8024C984
/* 17B264 8024C984 44820000 */ mtc1 $v0, $f0
/* 17B268 8024C988 00000000 */ nop
/* 17B26C 8024C98C 46800020 */ cvt.s.w $f0, $f0
/* 17B270 8024C990 86020024 */ lh $v0, 0x24($s0)
/* 17B274 8024C994 3C01802A */ lui $at, %hi(BattleCam_PosY)
D_8024C998_C0A218:
/* 17B278 8024C998 E422F274 */ swc1 $f2, %lo(BattleCam_PosY)($at)
/* 17B27C 8024C99C 3C01802A */ lui $at, %hi(BattleCam_PosZ)
.L8024C9A0:
/* 17B280 8024C9A0 E424F278 */ swc1 $f4, %lo(BattleCam_PosZ)($at)
/* 17B284 8024C9A4 3C01802A */ lui $at, %hi(D_8029F288)
/* 17B288 8024C9A8 E420F288 */ swc1 $f0, %lo(D_8029F288)($at)
/* 17B28C 8024C9AC 44820000 */ mtc1 $v0, $f0
/* 17B290 8024C9B0 00000000 */ nop
/* 17B294 8024C9B4 46800020 */ cvt.s.w $f0, $f0
/* 17B298 8024C9B8 3C01802A */ lui $at, %hi(BattleCam_InitialBoomYaw)
/* 17B29C 8024C9BC E420F290 */ swc1 $f0, %lo(BattleCam_InitialBoomYaw)($at)
D_8024C9C0:
/* 17B2A0 8024C9C0 44830000 */ mtc1 $v1, $f0
/* 17B2A4 8024C9C4 00000000 */ nop
.L8024C9C8:
/* 17B2A8 8024C9C8 46800020 */ cvt.s.w $f0, $f0
/* 17B2AC 8024C9CC 3C01802A */ lui $at, %hi(BattleCam_InitialBoomPitch)
/* 17B2B0 8024C9D0 E420F294 */ swc1 $f0, %lo(BattleCam_InitialBoomPitch)($at)
.L8024C9D4:
/* 17B2B4 8024C9D4 3C02802A */ lui $v0, %hi(BattleCam_TargetActor)
/* 17B2B8 8024C9D8 9442F27C */ lhu $v0, %lo(BattleCam_TargetActor)($v0)
/* 17B2BC 8024C9DC 4480A000 */ mtc1 $zero, $f20
/* 17B2C0 8024C9E0 30430700 */ andi $v1, $v0, 0x700
/* 17B2C4 8024C9E4 304400FF */ andi $a0, $v0, 0xFF
/* 17B2C8 8024C9E8 24020100 */ addiu $v0, $zero, 0x100
/* 17B2CC 8024C9EC 1062001C */ beq $v1, $v0, .L8024CA60
/* 17B2D0 8024C9F0 28620101 */ slti $v0, $v1, 0x101
/* 17B2D4 8024C9F4 50400005 */ beql $v0, $zero, .L8024CA0C
/* 17B2D8 8024C9F8 24020200 */ addiu $v0, $zero, 0x200
/* 17B2DC 8024C9FC 10600007 */ beqz $v1, .L8024CA1C
glabel func_8024CA00
/* 17B2E0 8024CA00 27A20020 */ addiu $v0, $sp, 0x20
/* 17B2E4 8024CA04 080932A3 */ j .L8024CA8C
/* 17B2E8 8024CA08 AFA20010 */ sw $v0, 0x10($sp)
.L8024CA0C:
/* 17B2EC 8024CA0C 10620017 */ beq $v1, $v0, .L8024CA6C
/* 17B2F0 8024CA10 27A20020 */ addiu $v0, $sp, 0x20
/* 17B2F4 8024CA14 080932A3 */ j .L8024CA8C
/* 17B2F8 8024CA18 AFA20010 */ sw $v0, 0x10($sp)
.L8024CA1C:
/* 17B2FC 8024CA1C 8CC400D8 */ lw $a0, 0xD8($a2)
/* 17B300 8024CA20 1080004C */ beqz $a0, .L8024CB54
/* 17B304 8024CA24 0000102D */ daddu $v0, $zero, $zero
/* 17B308 8024CA28 3C028011 */ lui $v0, %hi(gPlayerStatus)
/* 17B30C 8024CA2C 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus)
/* 17B310 8024CA30 944200B0 */ lhu $v0, 0xB0($v0)
/* 17B314 8024CA34 C4820148 */ lwc1 $f2, 0x148($a0)
/* 17B318 8024CA38 00021400 */ sll $v0, $v0, 16
/* 17B31C 8024CA3C 00021C03 */ sra $v1, $v0, 16
/* 17B320 8024CA40 000217C2 */ srl $v0, $v0, 31
/* 17B324 8024CA44 00621821 */ addu $v1, $v1, $v0
/* 17B328 8024CA48 00031843 */ sra $v1, $v1, 1
/* 17B32C 8024CA4C 44830000 */ mtc1 $v1, $f0
/* 17B330 8024CA50 00000000 */ nop
/* 17B334 8024CA54 46800020 */ cvt.s.w $f0, $f0
/* 17B338 8024CA58 080932A1 */ j .L8024CA84
/* 17B33C 8024CA5C 46001500 */ add.s $f20, $f2, $f0
.L8024CA60:
/* 17B340 8024CA60 8CC600DC */ lw $a2, 0xDC($a2)
/* 17B344 8024CA64 0809329E */ j .L8024CA78
/* 17B348 8024CA68 00000000 */ nop
.L8024CA6C:
/* 17B34C 8024CA6C 00041080 */ sll $v0, $a0, 2
/* 17B350 8024CA70 00461021 */ addu $v0, $v0, $a2
/* 17B354 8024CA74 8C4600E0 */ lw $a2, 0xE0($v0)
.L8024CA78:
/* 17B358 8024CA78 10C00036 */ beqz $a2, .L8024CB54
/* 17B35C 8024CA7C 0000102D */ daddu $v0, $zero, $zero
/* 17B360 8024CA80 C4D40148 */ lwc1 $f20, 0x148($a2)
.L8024CA84:
/* 17B364 8024CA84 27A20020 */ addiu $v0, $sp, 0x20
/* 17B368 8024CA88 AFA20010 */ sw $v0, 0x10($sp)
.L8024CA8C:
/* 17B36C 8024CA8C 27A20024 */ addiu $v0, $sp, 0x24
/* 17B370 8024CA90 AFA20014 */ sw $v0, 0x14($sp)
/* 17B374 8024CA94 27A20028 */ addiu $v0, $sp, 0x28
/* 17B378 8024CA98 3C05802A */ lui $a1, %hi(BattleCam_PosX)
/* 17B37C 8024CA9C 8CA5F270 */ lw $a1, %lo(BattleCam_PosX)($a1)
/* 17B380 8024CAA0 4406A000 */ mfc1 $a2, $f20
/* 17B384 8024CAA4 3C07802A */ lui $a3, %hi(BattleCam_PosZ)
D_8024CAA8_C0A328:
/* 17B388 8024CAA8 8CE7F278 */ lw $a3, %lo(BattleCam_PosZ)($a3)
/* 17B38C 8024CAAC 24040001 */ addiu $a0, $zero, 0x1
/* 17B390 8024CAB0 0C00B94E */ jal get_screen_coords
/* 17B394 8024CAB4 AFA20018 */ sw $v0, 0x18($sp)
/* 17B398 8024CAB8 8FA20024 */ lw $v0, 0x24($sp)
/* 17B39C 8024CABC 28420064 */ slti $v0, $v0, 0x64
/* 17B3A0 8024CAC0 10400005 */ beqz $v0, .L8024CAD8
/* 17B3A4 8024CAC4 00000000 */ nop
/* 17B3A8 8024CAC8 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 17B3AC 8024CACC 44810000 */ mtc1 $at, $f0
/* 17B3B0 8024CAD0 00000000 */ nop
/* 17B3B4 8024CAD4 4600A500 */ add.s $f20, $f20, $f0
.L8024CAD8:
/* 17B3B8 8024CAD8 3C01802A */ lui $at, %hi(BattleCam_PosY)
.L8024CADC:
/* 17B3BC 8024CADC C420F274 */ lwc1 $f0, %lo(BattleCam_PosY)($at)
/* 17B3C0 8024CAE0 4600A03C */ c.lt.s $f20, $f0
/* 17B3C4 8024CAE4 00000000 */ nop
/* 17B3C8 8024CAE8 45030001 */ bc1tl D_8024CAF0_C0A370
/* 17B3CC 8024CAEC 46000506 */ mov.s $f20, $f0
D_8024CAF0_C0A370:
/* 17B3D0 8024CAF0 C6060058 */ lwc1 $f6, 0x58($s0)
/* 17B3D4 8024CAF4 4606A101 */ sub.s $f4, $f20, $f6
/* 17B3D8 8024CAF8 3C01802A */ lui $at, %hi(D_8029CC28)
/* 17B3DC 8024CAFC D422CC28 */ ldc1 $f2, %lo(D_8029CC28)($at)
/* 17B3E0 8024CB00 46002005 */ abs.s $f0, $f4
/* 17B3E4 8024CB04 46000021 */ cvt.d.s $f0, $f0
/* 17B3E8 8024CB08 4622003C */ c.lt.d $f0, $f2
/* 17B3EC 8024CB0C 00000000 */ nop
/* 17B3F0 8024CB10 45000009 */ bc1f .L8024CB38
/* 17B3F4 8024CB14 00000000 */ nop
/* 17B3F8 8024CB18 44800000 */ mtc1 $zero, $f0
/* 17B3FC 8024CB1C 00000000 */ nop
/* 17B400 8024CB20 46002032 */ c.eq.s $f4, $f0
/* 17B404 8024CB24 00000000 */ nop
/* 17B408 8024CB28 45020009 */ bc1fl .L8024CB50
/* 17B40C 8024CB2C E6140058 */ swc1 $f20, 0x58($s0)
/* 17B410 8024CB30 080932D5 */ j .L8024CB54
/* 17B414 8024CB34 0000102D */ daddu $v0, $zero, $zero
.L8024CB38:
/* 17B418 8024CB38 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 17B41C 8024CB3C 44810000 */ mtc1 $at, $f0
/* 17B420 8024CB40 00000000 */ nop
/* 17B424 8024CB44 46002003 */ div.s $f0, $f4, $f0
/* 17B428 8024CB48 46003000 */ add.s $f0, $f6, $f0
/* 17B42C 8024CB4C E6000058 */ swc1 $f0, 0x58($s0)
.L8024CB50:
/* 17B430 8024CB50 0000102D */ daddu $v0, $zero, $zero
.L8024CB54:
/* 17B434 8024CB54 8FBF0034 */ lw $ra, 0x34($sp)
/* 17B438 8024CB58 8FB00030 */ lw $s0, 0x30($sp)
/* 17B43C 8024CB5C D7B40038 */ ldc1 $f20, 0x38($sp)
/* 17B440 8024CB60 03E00008 */ jr $ra
/* 17B444 8024CB64 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
ApiStatus CamPresetUpdate_K(Evt* script, s32 isInitialCall) {
Camera* camera = &gCameras[CAM_BATTLE];
BattleStatus* battleStatus = &gBattleStatus;
PlayerStatus* playerStatus = &gPlayerStatus;
s32 screenX, screenY, screenZ;
f32 deltaY;
f32 y;
s32 actorID;
s32 actorClass;
if (isInitialCall) {
BattleCam_PosX = camera->lookAt_obj_target.x;
BattleCam_PosY = camera->lookAt_obj_target.y;
BattleCam_PosZ = camera->lookAt_obj_target.z;
D_8029F288 = camera->auxBoomLength;
BattleCam_InitialBoomYaw = camera->auxBoomYaw;
BattleCam_InitialBoomPitch = camera->auxBoomPitch;
}
y = 0.0f;
actorClass = BattleCam_TargetActor & ACTOR_CLASS_MASK;
actorID = BattleCam_TargetActor & 0xFF;
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
if (battleStatus->playerActor == NULL) {
return ApiStatus_BLOCK;
}
y = battleStatus->playerActor->currentPos.y + (playerStatus->colliderHeight / 2);
break;
case ACTOR_CLASS_PARTNER:
if (battleStatus->partnerActor == NULL) {
return ApiStatus_BLOCK;
}
y = battleStatus->partnerActor->currentPos.y;
break;
case ACTOR_CLASS_ENEMY:
if (battleStatus->enemyActors[actorID] == NULL) {
return ApiStatus_BLOCK;
}
y = battleStatus->enemyActors[actorID]->currentPos.y;
break;
}
get_screen_coords(1, BattleCam_PosX, y, BattleCam_PosZ, &screenX, &screenY, &screenZ);
if (screenY < 100) {
y += 25.0f;
}
if (y < BattleCam_PosY) {
y = BattleCam_PosY;
}
deltaY = y - camera->lookAt_obj_target.y;
if (fabsf(deltaY) < 0.01) {
if (deltaY != 0.0f) {
camera->lookAt_obj_target.y = y;
}
} else {
camera->lookAt_obj_target.y += deltaY / 5.0f;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_80240BBC
/* 16F49C 80240BBC 27BDFFD0 */ addiu $sp, $sp, -0x30
glabel func_80240BC0
/* 16F4A0 80240BC0 AFB10024 */ sw $s1, 0x24($sp)
glabel func_80240BC4
/* 16F4A4 80240BC4 0080882D */ daddu $s1, $a0, $zero
glabel func_80240BC8
/* 16F4A8 80240BC8 AFB00020 */ sw $s0, 0x20($sp)
D_80240BCC:
/* 16F4AC 80240BCC 0000802D */ daddu $s0, $zero, $zero
glabel func_80240BD0
/* 16F4B0 80240BD0 AFBF002C */ sw $ra, 0x2C($sp)
glabel func_80240BD4
/* 16F4B4 80240BD4 AFB20028 */ sw $s2, 0x28($sp)
glabel func_80240BD8
/* 16F4B8 80240BD8 0220202D */ daddu $a0, $s1, $zero
arn_10_pad_BDC:
/* 16F4BC 80240BDC 0C099C8D */ jal remove_actor_decoration
glabel func_80240BE0
/* 16F4C0 80240BE0 0200282D */ daddu $a1, $s0, $zero
D_80240BE4:
/* 16F4C4 80240BE4 26100001 */ addiu $s0, $s0, 0x1
glabel func_80240BE8
/* 16F4C8 80240BE8 2A020002 */ slti $v0, $s0, 0x2
glabel func_80240BEC
/* 16F4CC 80240BEC 1440FFFB */ bnez $v0, arn_10_pad_BDC
D_80240BF0:
/* 16F4D0 80240BF0 0220202D */ daddu $a0, $s1, $zero
glabel mgm_01_EndPanelAnimation
/* 16F4D4 80240BF4 8E2201D0 */ lw $v0, 0x1D0($s1)
D_80240BF8:
/* 16F4D8 80240BF8 10400003 */ beqz $v0, func_80240C08
glabel func_80240BFC
/* 16F4DC 80240BFC 00000000 */ nop
glabel func_80240C00
/* 16F4E0 80240C00 0C0B102B */ jal kill_script_by_ID
glabel func_80240C04
/* 16F4E4 80240C04 8E2401E0 */ lw $a0, 0x1E0($s1)
glabel func_80240C08
/* 16F4E8 80240C08 8E2201D8 */ lw $v0, 0x1D8($s1)
glabel func_80240C0C
/* 16F4EC 80240C0C 10400003 */ beqz $v0, func_80240C1C
glabel func_80240C10
/* 16F4F0 80240C10 00000000 */ nop
.L80240C14:
/* 16F4F4 80240C14 0C0B102B */ jal kill_script_by_ID
glabel func_80240C18
/* 16F4F8 80240C18 8E2401E8 */ lw $a0, 0x1E8($s1)
glabel func_80240C1C
/* 16F4FC 80240C1C 8E2201D4 */ lw $v0, 0x1D4($s1)
D_80240C20:
/* 16F500 80240C20 10400005 */ beqz $v0, omo_04_FlyingAI_Loiter
D_80240C24:
/* 16F504 80240C24 0220202D */ daddu $a0, $s1, $zero
D_80240C28:
/* 16F508 80240C28 8E2401E4 */ lw $a0, 0x1E4($s1)
glabel func_80240C2C
/* 16F50C 80240C2C 0C0B102B */ jal kill_script_by_ID
glabel func_80240C30
/* 16F510 80240C30 00000000 */ nop
glabel func_80240C34
/* 16F514 80240C34 0220202D */ daddu $a0, $s1, $zero
glabel omo_04_FlyingAI_Loiter
/* 16F518 80240C38 0C099BBA */ jal func_80266EE8
.L80240C3C:
/* 16F51C 80240C3C 0000282D */ daddu $a1, $zero, $zero
glabel func_80240C40
/* 16F520 80240C40 8E3001F4 */ lw $s0, 0x1F4($s1)
glabel func_80240C44
/* 16F524 80240C44 1200002B */ beqz $s0, func_80240CF4
.L80240C48:
/* 16F528 80240C48 00000000 */ nop
glabel dead_11_FlyingAI_JumpInit
/* 16F52C 80240C4C 3C128000 */ lui $s2, (0x80000000 >> 16)
glabel .L80240C50
/* 16F530 80240C50 8E020000 */ lw $v0, 0x0($s0)
glabel mgm_01_UpdateRecords
/* 16F534 80240C54 30420004 */ andi $v0, $v0, 0x4
glabel func_80240C58
/* 16F538 80240C58 14400003 */ bnez $v0, func_80240C68
glabel dead_kzn_17_PiranhaPlantAI_00
/* 16F53C 80240C5C 00000000 */ nop
glabel func_80240C60
/* 16F540 80240C60 0C0448CA */ jal delete_shadow
glabel kzn_03_MeleeHitbox_31
/* 16F544 80240C64 8E04009C */ lw $a0, 0x9C($s0)
glabel func_80240C68
/* 16F548 80240C68 8E020094 */ lw $v0, 0x94($s0)
glabel sam_07_WanderMeleeAI_Main
/* 16F54C 80240C6C 1040001C */ beqz $v0, omo_17_GrooveGuyAI_Main
glabel func_80240C70
/* 16F550 80240C70 0000282D */ daddu $a1, $zero, $zero
dgb_09_ClubbaNappingAI_LoiterInit:
/* 16F554 80240C74 00A0302D */ daddu $a2, $a1, $zero
glabel func_80240C78
/* 16F558 80240C78 AFA00010 */ sw $zero, 0x10($sp)
glabel func_80240C7C
/* 16F55C 80240C7C AFA00014 */ sw $zero, 0x14($sp)
glabel func_80240C80
/* 16F560 80240C80 AFA00018 */ sw $zero, 0x18($sp)
glabel func_80240C84
/* 16F564 80240C84 8E040084 */ lw $a0, 0x84($s0)
glabel func_80240C88
/* 16F568 80240C88 0C0B7A25 */ jal set_npc_imgfx_all
glabel func_80240C8C
/* 16F56C 80240C8C 00A0382D */ daddu $a3, $a1, $zero
glabel arn_02_CleftAI_Main
/* 16F570 80240C90 8E040084 */ lw $a0, 0x84($s0)
glabel func_80240C94
/* 16F574 80240C94 0C0B797A */ jal spr_free_sprite
.L80240C98:
/* 16F578 80240C98 00000000 */ nop
glabel omo_07_PatrolAI_JumpInit
/* 16F57C 80240C9C 10400003 */ beqz $v0, func_80240CAC
glabel func_80240CA0
/* 16F580 80240CA0 00000000 */ nop
glabel .L80240CA4
/* 16F584 80240CA4 08090329 */ j .L80240CA4
glabel func_80240CA8
/* 16F588 80240CA8 00000000 */ nop
glabel func_80240CAC
/* 16F58C 80240CAC 8E020000 */ lw $v0, 0x0($s0)
glabel func_80240CB0
/* 16F590 80240CB0 00521024 */ and $v0, $v0, $s2
glabel arn_08_pad_CB4
/* 16F594 80240CB4 14400003 */ bnez $v0, dead_11_FlyingAI_Jump
glabel func_80240CB8
/* 16F598 80240CB8 00000000 */ nop
D_80240CBC:
/* 16F59C 80240CBC 0C00AB4B */ jal heap_free
glabel dead_flo_14_FlyingAI_Wander
/* 16F5A0 80240CC0 8E040010 */ lw $a0, 0x10($s0)
glabel dead_11_FlyingAI_Jump
/* 16F5A4 80240CC4 8E020000 */ lw $v0, 0x0($s0)
glabel func_80240CC8
/* 16F5A8 80240CC8 30420002 */ andi $v0, $v0, 0x2
glabel func_80240CCC
/* 16F5AC 80240CCC 14400005 */ bnez $v0, .L80240CE4
glabel func_80240CD0
/* 16F5B0 80240CD0 0200202D */ daddu $a0, $s0, $zero
glabel func_80240CD4
/* 16F5B4 80240CD4 8E0400C0 */ lw $a0, 0xC0($s0)
glabel func_80240CD8_EA97B8
/* 16F5B8 80240CD8 0C00AB4B */ jal heap_free
glabel func_80240CDC
/* 16F5BC 80240CDC 00000000 */ nop
glabel omo_17_GrooveGuyAI_Main
/* 16F5C0 80240CE0 0200202D */ daddu $a0, $s0, $zero
.L80240CE4:
/* 16F5C4 80240CE4 0C00AB4B */ jal heap_free
glabel func_80240CE8
/* 16F5C8 80240CE8 8C90000C */ lw $s0, 0xC($a0)
glabel func_80240CEC
/* 16F5CC 80240CEC 1600FFD8 */ bnez $s0, .L80240C50
D_80240CF0:
/* 16F5D0 80240CF0 00000000 */ nop
glabel func_80240CF4
/* 16F5D4 80240CF4 0C0448CA */ jal delete_shadow
glabel func_80240CF8
/* 16F5D8 80240CF8 8E24042C */ lw $a0, 0x42C($s1)
glabel func_80240CFC
/* 16F5DC 80240CFC 0C011DBD */ jal remove_all_status_icons
glabel func_80240D00
/* 16F5E0 80240D00 86240436 */ lh $a0, 0x436($s1)
glabel .L80240D04
/* 16F5E4 80240D04 0C016914 */ jal remove_effect
glabel func_80240D08
/* 16F5E8 80240D08 8E240440 */ lw $a0, 0x440($s1)
glabel func_80240D0C
/* 16F5EC 80240D0C 8E220200 */ lw $v0, 0x200($s1)
glabel func_80240D10
/* 16F5F0 80240D10 10400003 */ beqz $v0, .L80240D20
glabel func_80240D14
/* 16F5F4 80240D14 0000802D */ daddu $s0, $zero, $zero
glabel func_80240D18
/* 16F5F8 80240D18 8C42000C */ lw $v0, 0xC($v0)
glabel func_80240D1C
/* 16F5FC 80240D1C AC400024 */ sw $zero, 0x24($v0)
.L80240D20:
/* 16F600 80240D20 3C03800E */ lui $v1, %hi(gBattleStatus)
D_80240D24:
/* 16F604 80240D24 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
glabel func_80240D28
/* 16F608 80240D28 8C6200E0 */ lw $v0, 0xE0($v1)
glabel .L80240D2C
/* 16F60C 80240D2C 14510003 */ bne $v0, $s1, pra_40_EnablePartnerReflection
glabel dead_11_FlyingAI_ChaseInit
/* 16F610 80240D30 26100001 */ addiu $s0, $s0, 0x1
glabel .L80240D34
/* 16F614 80240D34 08090352 */ j func_80240D48
flo_24_pad_D38:
/* 16F618 80240D38 AC6000E0 */ sw $zero, 0xE0($v1)
glabel pra_40_EnablePartnerReflection
/* 16F61C 80240D3C 2A020018 */ slti $v0, $s0, 0x18
glabel dead_flo_08_DeadUnkFunc1
/* 16F620 80240D40 1440FFF9 */ bnez $v0, func_80240D28
glabel func_80240D44
/* 16F624 80240D44 24630004 */ addiu $v1, $v1, 0x4
glabel func_80240D48
/* 16F628 80240D48 0C00AB4B */ jal heap_free
glabel mgm_00_PatrolAI_LosePlayer
/* 16F62C 80240D4C 0220202D */ daddu $a0, $s1, $zero
glabel func_80240D50
/* 16F630 80240D50 8FBF002C */ lw $ra, 0x2C($sp)
glabel func_80240D54
/* 16F634 80240D54 8FB20028 */ lw $s2, 0x28($sp)
glabel dead_flo_16_SuperBlock_PartnerSparkles2
/* 16F638 80240D58 8FB10024 */ lw $s1, 0x24($sp)
glabel func_80240D5C
/* 16F63C 80240D5C 8FB00020 */ lw $s0, 0x20($sp)
glabel mim_08_FlyingAI_ChaseInit
/* 16F640 80240D60 03E00008 */ jr $ra
glabel .L80240D64
/* 16F644 80240D64 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void btl_delete_actor(Actor* actor) {
ActorPart* part;
ActorPart* actorPartTemp;
BattleStatus* battleStatus;
s32 i;
// TODO hard-coded
for (i = 0; i < 2; i++) {
remove_actor_decoration(actor, i);
}
if (actor->idleScript != NULL) {
kill_script_by_ID(actor->idleScriptID);
}
if (actor->handleEventScript != NULL) {
kill_script_by_ID(actor->handleEventScriptID);
}
if (actor->takeTurnScript != NULL) {
kill_script_by_ID(actor->takeTurnScriptID);
}
func_80266EE8(actor, UNK_PAL_EFFECT_0);
part = actor->partsTable;
while (part != NULL) {
if (!(part->flags & ACTOR_PART_FLAG_4)) {
delete_shadow(part->shadowIndex);
}
if (part->idleAnimations != NULL) {
set_npc_imgfx_all(part->spriteInstanceID, IMGFX_CLEAR, 0, 0, 0, 0, 0);
ASSERT(spr_free_sprite(part->spriteInstanceID) == 0);
if (!(part->flags & ACTOR_PART_FLAG_80000000)) {
heap_free(part->movement);
}
if (!(part->flags & ACTOR_PART_FLAG_2)) {
heap_free(part->decorationTable);
}
}
actorPartTemp = part->nextPart;
heap_free(part);
part = actorPartTemp;
}
delete_shadow(actor->shadow.id);
remove_all_status_icons(actor->hudElementDataIndex);
remove_effect(actor->disableEffect);
if (actor->attackResultEffect != NULL) {
actor->attackResultEffect->data.attackResultText->isVisible = FALSE;
}
battleStatus = &gBattleStatus;
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
if (battleStatus->enemyActors[i] == actor) {
battleStatus->enemyActors[i] = NULL;
break;
}
}
heap_free(actor);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel sun_update
/* 40B52C E012013C 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 40B530 E0120140 AFBF0020 */ sw $ra, 0x20($sp)
/* 40B534 E0120144 AFB3001C */ sw $s3, 0x1C($sp)
/* 40B538 E0120148 AFB20018 */ sw $s2, 0x18($sp)
/* 40B53C E012014C AFB10014 */ sw $s1, 0x14($sp)
/* 40B540 E0120150 AFB00010 */ sw $s0, 0x10($sp)
/* 40B544 E0120154 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 40B548 E0120158 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 40B54C E012015C F7B60030 */ sdc1 $f22, 0x30($sp)
/* 40B550 E0120160 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 40B554 E0120164 8C830000 */ lw $v1, 0x0($a0)
/* 40B558 E0120168 8C85000C */ lw $a1, 0xC($a0)
/* 40B55C E012016C 30620010 */ andi $v0, $v1, 0x10
/* 40B560 E0120170 10400005 */ beqz $v0, .LE0120188
/* 40B564 E0120174 2402FFEF */ addiu $v0, $zero, -0x11
/* 40B568 E0120178 00621024 */ and $v0, $v1, $v0
/* 40B56C E012017C AC820000 */ sw $v0, 0x0($a0)
/* 40B570 E0120180 24020010 */ addiu $v0, $zero, 0x10
/* 40B574 E0120184 ACA20010 */ sw $v0, 0x10($a1)
.LE0120188:
/* 40B578 E0120188 8CA30010 */ lw $v1, 0x10($a1)
/* 40B57C E012018C 286203E8 */ slti $v0, $v1, 0x3E8
/* 40B580 E0120190 10400002 */ beqz $v0, .LE012019C
/* 40B584 E0120194 2462FFFF */ addiu $v0, $v1, -0x1
/* 40B588 E0120198 ACA20010 */ sw $v0, 0x10($a1)
.LE012019C:
/* 40B58C E012019C 3C030004 */ lui $v1, (0x4F1A0 >> 16)
/* 40B590 E01201A0 8CA20014 */ lw $v0, 0x14($a1)
/* 40B594 E01201A4 3463F1A0 */ ori $v1, $v1, (0x4F1A0 & 0xFFFF)
/* 40B598 E01201A8 24420001 */ addiu $v0, $v0, 0x1
/* 40B59C E01201AC 0062182A */ slt $v1, $v1, $v0
/* 40B5A0 E01201B0 10600003 */ beqz $v1, .LE01201C0
/* 40B5A4 E01201B4 ACA20014 */ sw $v0, 0x14($a1)
/* 40B5A8 E01201B8 24020100 */ addiu $v0, $zero, 0x100
/* 40B5AC E01201BC ACA20014 */ sw $v0, 0x14($a1)
.LE01201C0:
/* 40B5B0 E01201C0 8CA20010 */ lw $v0, 0x10($a1)
/* 40B5B4 E01201C4 04410005 */ bgez $v0, .LE01201DC
/* 40B5B8 E01201C8 28420010 */ slti $v0, $v0, 0x10
/* 40B5BC E01201CC 0C080128 */ jal shim_remove_effect
/* 40B5C0 E01201D0 00000000 */ nop
/* 40B5C4 E01201D4 080480DC */ j .LE0120370
/* 40B5C8 E01201D8 00000000 */ nop
.LE01201DC:
/* 40B5CC E01201DC 10400006 */ beqz $v0, .LE01201F8
/* 40B5D0 E01201E0 8CB30014 */ lw $s3, 0x14($a1)
/* 40B5D4 E01201E4 8CA20038 */ lw $v0, 0x38($a1)
/* 40B5D8 E01201E8 2442FFF0 */ addiu $v0, $v0, -0x10
/* 40B5DC E01201EC 04410002 */ bgez $v0, .LE01201F8
/* 40B5E0 E01201F0 ACA20038 */ sw $v0, 0x38($a1)
/* 40B5E4 E01201F4 ACA00038 */ sw $zero, 0x38($a1)
.LE01201F8:
/* 40B5E8 E01201F8 8CA2003C */ lw $v0, 0x3C($a1)
/* 40B5EC E01201FC 04410003 */ bgez $v0, .LE012020C
/* 40B5F0 E0120200 28420100 */ slti $v0, $v0, 0x100
/* 40B5F4 E0120204 08048086 */ j .LE0120218
/* 40B5F8 E0120208 ACA0003C */ sw $zero, 0x3C($a1)
.LE012020C:
/* 40B5FC E012020C 14400002 */ bnez $v0, .LE0120218
/* 40B600 E0120210 240200FF */ addiu $v0, $zero, 0xFF
/* 40B604 E0120214 ACA2003C */ sw $v0, 0x3C($a1)
.LE0120218:
/* 40B608 E0120218 8CA30038 */ lw $v1, 0x38($a1)
/* 40B60C E012021C 8CA4003C */ lw $a0, 0x3C($a1)
/* 40B610 E0120220 0083102A */ slt $v0, $a0, $v1
/* 40B614 E0120224 10400004 */ beqz $v0, .LE0120238
/* 40B618 E0120228 2462FFF8 */ addiu $v0, $v1, -0x8
/* 40B61C E012022C ACA20038 */ sw $v0, 0x38($a1)
/* 40B620 E0120230 08048094 */ j .LE0120250
/* 40B624 E0120234 0044102A */ slt $v0, $v0, $a0
.LE0120238:
/* 40B628 E0120238 0064102A */ slt $v0, $v1, $a0
/* 40B62C E012023C 10400006 */ beqz $v0, .LE0120258
/* 40B630 E0120240 24620008 */ addiu $v0, $v1, 0x8
/* 40B634 E0120244 8CA4003C */ lw $a0, 0x3C($a1)
/* 40B638 E0120248 ACA20038 */ sw $v0, 0x38($a1)
/* 40B63C E012024C 0082102A */ slt $v0, $a0, $v0
.LE0120250:
/* 40B640 E0120250 54400001 */ bnel $v0, $zero, .LE0120258
/* 40B644 E0120254 ACA40038 */ sw $a0, 0x38($a1)
.LE0120258:
/* 40B648 E0120258 0000882D */ daddu $s1, $zero, $zero
/* 40B64C E012025C 00A0802D */ daddu $s0, $a1, $zero
/* 40B650 E0120260 00139040 */ sll $s2, $s3, 1
/* 40B654 E0120264 3C013FD0 */ lui $at, (0x3FD00000 >> 16)
/* 40B658 E0120268 4481D800 */ mtc1 $at, $f27
/* 40B65C E012026C 4480D000 */ mtc1 $zero, $f26
/* 40B660 E0120270 3C01E012 */ lui $at, (0xE01207A0 >> 16)
/* 40B664 E0120274 D43807A0 */ ldc1 $f24, (0xE01207A0 & 0xFFFF)($at)
/* 40B668 E0120278 3C014380 */ lui $at, (0x43800000 >> 16)
/* 40B66C E012027C 4481B000 */ mtc1 $at, $f22
.LE0120280:
/* 40B670 E0120280 44926000 */ mtc1 $s2, $f12
/* 40B674 E0120284 00000000 */ nop
/* 40B678 E0120288 0C080140 */ jal shim_sin_deg
/* 40B67C E012028C 46806320 */ cvt.s.w $f12, $f12
/* 40B680 E0120290 44936000 */ mtc1 $s3, $f12
/* 40B684 E0120294 00000000 */ nop
/* 40B688 E0120298 46806320 */ cvt.s.w $f12, $f12
/* 40B68C E012029C 46006321 */ cvt.d.s $f12, $f12
/* 40B690 E01202A0 463A6302 */ mul.d $f12, $f12, $f26
/* 40B694 E01202A4 00000000 */ nop
/* 40B698 E01202A8 02310018 */ mult $s1, $s1
/* 40B69C E01202AC 00001812 */ mflo $v1
/* 40B6A0 E01202B0 00031080 */ sll $v0, $v1, 2
/* 40B6A4 E01202B4 00431021 */ addu $v0, $v0, $v1
/* 40B6A8 E01202B8 00021080 */ sll $v0, $v0, 2
/* 40B6AC E01202BC 44821000 */ mtc1 $v0, $f2
/* 40B6B0 E01202C0 00000000 */ nop
/* 40B6B4 E01202C4 468010A1 */ cvt.d.w $f2, $f2
/* 40B6B8 E01202C8 46226300 */ add.d $f12, $f12, $f2
/* 40B6BC E01202CC 46000506 */ mov.s $f20, $f0
/* 40B6C0 E01202D0 0C080140 */ jal shim_sin_deg
/* 40B6C4 E01202D4 46206320 */ cvt.s.d $f12, $f12
/* 40B6C8 E01202D8 4600A521 */ cvt.d.s $f20, $f20
/* 40B6CC E01202DC 4638A502 */ mul.d $f20, $f20, $f24
/* 40B6D0 E01202E0 00000000 */ nop
/* 40B6D4 E01202E4 3C01E012 */ lui $at, (0xE01207A8 >> 16)
/* 40B6D8 E01202E8 D42207A8 */ ldc1 $f2, (0xE01207A8 & 0xFFFF)($at)
/* 40B6DC E01202EC 4622A500 */ add.d $f20, $f20, $f2
/* 40B6E0 E01202F0 3C014010 */ lui $at, (0x40100000 >> 16)
/* 40B6E4 E01202F4 44811800 */ mtc1 $at, $f3
/* 40B6E8 E01202F8 44801000 */ mtc1 $zero, $f2
/* 40B6EC E01202FC 00000000 */ nop
/* 40B6F0 E0120300 4622A502 */ mul.d $f20, $f20, $f2
/* 40B6F4 E0120304 00000000 */ nop
/* 40B6F8 E0120308 46000021 */ cvt.d.s $f0, $f0
/* 40B6FC E012030C 4620A502 */ mul.d $f20, $f20, $f0
/* 40B700 E0120310 00000000 */ nop
/* 40B704 E0120314 C6000020 */ lwc1 $f0, 0x20($s0)
/* 40B708 E0120318 46000021 */ cvt.d.s $f0, $f0
/* 40B70C E012031C 46340001 */ sub.d $f0, $f0, $f20
/* 40B710 E0120320 44801000 */ mtc1 $zero, $f2
/* 40B714 E0120324 46200020 */ cvt.s.d $f0, $f0
/* 40B718 E0120328 4602003C */ c.lt.s $f0, $f2
/* 40B71C E012032C 00000000 */ nop
/* 40B720 E0120330 45000003 */ bc1f .LE0120340
/* 40B724 E0120334 E6000020 */ swc1 $f0, 0x20($s0)
/* 40B728 E0120338 46160000 */ add.s $f0, $f0, $f22
/* 40B72C E012033C E6000020 */ swc1 $f0, 0x20($s0)
.LE0120340:
/* 40B730 E0120340 C6000020 */ lwc1 $f0, 0x20($s0)
/* 40B734 E0120344 4600B03C */ c.lt.s $f22, $f0
/* 40B738 E0120348 00000000 */ nop
/* 40B73C E012034C 45020004 */ bc1fl .LE0120360
/* 40B740 E0120350 26100004 */ addiu $s0, $s0, 0x4
/* 40B744 E0120354 46160001 */ sub.s $f0, $f0, $f22
/* 40B748 E0120358 E6000020 */ swc1 $f0, 0x20($s0)
/* 40B74C E012035C 26100004 */ addiu $s0, $s0, 0x4
.LE0120360:
/* 40B750 E0120360 26310001 */ addiu $s1, $s1, 0x1
/* 40B754 E0120364 2A220005 */ slti $v0, $s1, 0x5
/* 40B758 E0120368 1440FFC5 */ bnez $v0, .LE0120280
/* 40B75C E012036C 26520014 */ addiu $s2, $s2, 0x14
.LE0120370:
/* 40B760 E0120370 8FBF0020 */ lw $ra, 0x20($sp)
/* 40B764 E0120374 8FB3001C */ lw $s3, 0x1C($sp)
/* 40B768 E0120378 8FB20018 */ lw $s2, 0x18($sp)
/* 40B76C E012037C 8FB10014 */ lw $s1, 0x14($sp)
/* 40B770 E0120380 8FB00010 */ lw $s0, 0x10($sp)
/* 40B774 E0120384 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 40B778 E0120388 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 40B77C E012038C D7B60030 */ ldc1 $f22, 0x30($sp)
/* 40B780 E0120390 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 40B784 E0120394 03E00008 */ jr $ra
/* 40B788 E0120398 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
void sun_update(EffectInstance* effect) {
SunFXData* data = effect->data.sun;
s32 time;
s32 i;
if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
data->timeLeft = 16;
}
if (data->timeLeft < 1000) {
data->timeLeft--;
}
data->lifeTime++;
if (data->lifeTime > 90*60*60) {
data->lifeTime = 256;
}
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
time = data->lifeTime;
if (data->timeLeft < 16) {
data->alpha -= 16;
if (data->alpha < 0) {
data->alpha = 0;
}
}
if (data->targetAlpha < 0) {
data->targetAlpha = 0;
} else if (data->targetAlpha > 255) {
data->targetAlpha = 255;
}
if (data->alpha > data->targetAlpha) {
data->alpha -= 8;
if (data->alpha < data->targetAlpha) {
data->alpha = data->targetAlpha;
}
} else if (data->alpha < data->targetAlpha) {
data->alpha += 8;
if (data->targetAlpha < data->alpha) {
data->alpha = data->targetAlpha;
}
}
for (i = 0; i < 5; i++) {
data->texScrollAmt[i] -= 4.0
* ((shim_sin_deg((time * 2 + (20 * i))) * 0.01) + 0.05)
* shim_sin_deg(((f32) time * 0.25) + (SQ(i) * 20));
if (data->texScrollAmt[i] < 0.0f) {
data->texScrollAmt[i] += 256.0f;
}
if (data->texScrollAmt[i] > 256.0f) {
data->texScrollAmt[i] -= 256.0f;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel chomp_drop_update
/* 3966F0 E009A140 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 3966F4 E009A144 AFBF0020 */ sw $ra, 0x20($sp)
/* 3966F8 E009A148 AFB1001C */ sw $s1, 0x1C($sp)
/* 3966FC E009A14C AFB00018 */ sw $s0, 0x18($sp)
/* 396700 E009A150 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 396704 E009A154 8C91000C */ lw $s1, 0xC($a0)
/* 396708 E009A158 8E220040 */ lw $v0, 0x40($s1)
/* 39670C E009A15C 2442FFFF */ addiu $v0, $v0, -0x1
/* 396710 E009A160 AE220040 */ sw $v0, 0x40($s1)
/* 396714 E009A164 8E220044 */ lw $v0, 0x44($s1)
/* 396718 E009A168 8E230040 */ lw $v1, 0x40($s1)
/* 39671C E009A16C 24420001 */ addiu $v0, $v0, 0x1
/* 396720 E009A170 04610005 */ bgez $v1, .LE009A188
/* 396724 E009A174 AE220044 */ sw $v0, 0x44($s1)
/* 396728 E009A178 0C080128 */ jal shim_remove_effect
/* 39672C E009A17C 00000000 */ nop
/* 396730 E009A180 080268E0 */ j .LE009A380
/* 396734 E009A184 00000000 */ nop
.LE009A188:
/* 396738 E009A188 8E24002C */ lw $a0, 0x2C($s1)
/* 39673C E009A18C 2C820006 */ sltiu $v0, $a0, 0x6
/* 396740 E009A190 1040007B */ beqz $v0, .LE009A380
/* 396744 E009A194 00041080 */ sll $v0, $a0, 2
/* 396748 E009A198 3C01E00A */ lui $at, (0xE00A0000 >> 16)
/* 39674C E009A19C 00220821 */ addu $at, $at, $v0
/* 396750 E009A1A0 8C22AA60 */ lw $v0, -0x55A0($at)
/* 396754 E009A1A4 00400008 */ jr $v0
/* 396758 E009A1A8 00000000 */ nop
/* 39675C E009A1AC 8E23003C */ lw $v1, 0x3C($s1)
/* 396760 E009A1B0 8E220020 */ lw $v0, 0x20($s1)
/* 396764 E009A1B4 C6200028 */ lwc1 $f0, 0x28($s1)
/* 396768 E009A1B8 00431023 */ subu $v0, $v0, $v1
/* 39676C E009A1BC 44822000 */ mtc1 $v0, $f4
/* 396770 E009A1C0 00000000 */ nop
/* 396774 E009A1C4 46802120 */ cvt.s.w $f4, $f4
/* 396778 E009A1C8 46002102 */ mul.s $f4, $f4, $f0
/* 39677C E009A1CC 00000000 */ nop
/* 396780 E009A1D0 C6220018 */ lwc1 $f2, 0x18($s1)
/* 396784 E009A1D4 C6260024 */ lwc1 $f6, 0x24($s1)
/* 396788 E009A1D8 46061081 */ sub.s $f2, $f2, $f6
/* 39678C E009A1DC 46001082 */ mul.s $f2, $f2, $f0
/* 396790 E009A1E0 00000000 */ nop
/* 396794 E009A1E4 C6200034 */ lwc1 $f0, 0x34($s1)
/* 396798 E009A1E8 46023180 */ add.s $f6, $f6, $f2
/* 39679C E009A1EC 3C01E00A */ lui $at, (0xE00A0000 >> 16)
/* 3967A0 E009A1F0 D422AA78 */ ldc1 $f2, -0x5588($at)
/* 3967A4 E009A1F4 46000021 */ cvt.d.s $f0, $f0
/* 3967A8 E009A1F8 46220001 */ sub.d $f0, $f0, $f2
/* 3967AC E009A1FC 44804000 */ mtc1 $zero, $f8
/* 3967B0 E009A200 44831000 */ mtc1 $v1, $f2
/* 3967B4 E009A204 00000000 */ nop
/* 3967B8 E009A208 468010A0 */ cvt.s.w $f2, $f2
/* 3967BC E009A20C 46041080 */ add.s $f2, $f2, $f4
/* 3967C0 E009A210 E6260024 */ swc1 $f6, 0x24($s1)
/* 3967C4 E009A214 46200020 */ cvt.s.d $f0, $f0
/* 3967C8 E009A218 4600128D */ trunc.w.s $f10, $f2
/* 3967CC E009A21C E62A003C */ swc1 $f10, 0x3C($s1)
/* 3967D0 E009A220 4608003C */ c.lt.s $f0, $f8
/* 3967D4 E009A224 00000000 */ nop
/* 3967D8 E009A228 45000055 */ bc1f .LE009A380
/* 3967DC E009A22C E6200034 */ swc1 $f0, 0x34($s1)
/* 3967E0 E009A230 2402000A */ addiu $v0, $zero, 0xA
/* 3967E4 E009A234 AE220030 */ sw $v0, 0x30($s1)
/* 3967E8 E009A238 24020001 */ addiu $v0, $zero, 0x1
/* 3967EC E009A23C E6280034 */ swc1 $f8, 0x34($s1)
/* 3967F0 E009A240 E6280010 */ swc1 $f8, 0x10($s1)
/* 3967F4 E009A244 080268E0 */ j .LE009A380
/* 3967F8 E009A248 AE22002C */ sw $v0, 0x2C($s1)
/* 3967FC E009A24C 8E220030 */ lw $v0, 0x30($s1)
/* 396800 E009A250 2442FFFF */ addiu $v0, $v0, -0x1
/* 396804 E009A254 1C40004A */ bgtz $v0, .LE009A380
/* 396808 E009A258 AE220030 */ sw $v0, 0x30($s1)
/* 39680C E009A25C 24020002 */ addiu $v0, $zero, 0x2
/* 396810 E009A260 AE22002C */ sw $v0, 0x2C($s1)
/* 396814 E009A264 2402000A */ addiu $v0, $zero, 0xA
/* 396818 E009A268 080268E0 */ j .LE009A380
/* 39681C E009A26C AE220030 */ sw $v0, 0x30($s1)
/* 396820 E009A270 8E220030 */ lw $v0, 0x30($s1)
/* 396824 E009A274 2442FFFF */ addiu $v0, $v0, -0x1
/* 396828 E009A278 1C400041 */ bgtz $v0, .LE009A380
/* 39682C E009A27C AE220030 */ sw $v0, 0x30($s1)
/* 396830 E009A280 24020003 */ addiu $v0, $zero, 0x3
/* 396834 E009A284 080268E0 */ j .LE009A380
/* 396838 E009A288 AE22002C */ sw $v0, 0x2C($s1)
/* 39683C E009A28C C6200010 */ lwc1 $f0, 0x10($s1)
/* 396840 E009A290 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 396844 E009A294 44811000 */ mtc1 $at, $f2
/* 396848 E009A298 00000000 */ nop
/* 39684C E009A29C 46020001 */ sub.s $f0, $f0, $f2
/* 396850 E009A2A0 C6220008 */ lwc1 $f2, 0x8($s1)
/* 396854 E009A2A4 44802000 */ mtc1 $zero, $f4
/* 396858 E009A2A8 46001080 */ add.s $f2, $f2, $f0
/* 39685C E009A2AC E6200010 */ swc1 $f0, 0x10($s1)
/* 396860 E009A2B0 4604103C */ c.lt.s $f2, $f4
/* 396864 E009A2B4 00000000 */ nop
/* 396868 E009A2B8 45000031 */ bc1f .LE009A380
/* 39686C E009A2BC E6220008 */ swc1 $f2, 0x8($s1)
/* 396870 E009A2C0 24040015 */ addiu $a0, $zero, 0x15
/* 396874 E009A2C4 0C080150 */ jal shim_load_effect
/* 396878 E009A2C8 E6240008 */ swc1 $f4, 0x8($s1)
/* 39687C E009A2CC C6200004 */ lwc1 $f0, 0x4($s1)
/* 396880 E009A2D0 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 396884 E009A2D4 4481A000 */ mtc1 $at, $f20
/* 396888 E009A2D8 2410001E */ addiu $s0, $zero, 0x1E
/* 39688C E009A2DC AFB00010 */ sw $s0, 0x10($sp)
/* 396890 E009A2E0 46140000 */ add.s $f0, $f0, $f20
/* 396894 E009A2E4 8E260008 */ lw $a2, 0x8($s1)
/* 396898 E009A2E8 8E27000C */ lw $a3, 0xC($s1)
/* 39689C E009A2EC 44050000 */ mfc1 $a1, $f0
/* 3968A0 E009A2F0 0C00A800 */ jal dust_main
/* 3968A4 E009A2F4 24040002 */ addiu $a0, $zero, 0x2
/* 3968A8 E009A2F8 C6200004 */ lwc1 $f0, 0x4($s1)
/* 3968AC E009A2FC AFB00010 */ sw $s0, 0x10($sp)
/* 3968B0 E009A300 46140001 */ sub.s $f0, $f0, $f20
/* 3968B4 E009A304 8E260008 */ lw $a2, 0x8($s1)
/* 3968B8 E009A308 8E27000C */ lw $a3, 0xC($s1)
/* 3968BC E009A30C 44050000 */ mfc1 $a1, $f0
/* 3968C0 E009A310 0C00A800 */ jal dust_main
/* 3968C4 E009A314 24040002 */ addiu $a0, $zero, 0x2
/* 3968C8 E009A318 24020004 */ addiu $v0, $zero, 0x4
/* 3968CC E009A31C AE22002C */ sw $v0, 0x2C($s1)
/* 3968D0 E009A320 24020014 */ addiu $v0, $zero, 0x14
/* 3968D4 E009A324 080268E0 */ j .LE009A380
/* 3968D8 E009A328 AE220030 */ sw $v0, 0x30($s1)
/* 3968DC E009A32C 8E220030 */ lw $v0, 0x30($s1)
/* 3968E0 E009A330 2442FFFF */ addiu $v0, $v0, -0x1
/* 3968E4 E009A334 1C400012 */ bgtz $v0, .LE009A380
/* 3968E8 E009A338 AE220030 */ sw $v0, 0x30($s1)
/* 3968EC E009A33C 24020005 */ addiu $v0, $zero, 0x5
/* 3968F0 E009A340 080268E0 */ j .LE009A380
/* 3968F4 E009A344 AE22002C */ sw $v0, 0x2C($s1)
/* 3968F8 E009A348 2862000A */ slti $v0, $v1, 0xA
/* 3968FC E009A34C 10400005 */ beqz $v0, .LE009A364
/* 396900 E009A350 00031040 */ sll $v0, $v1, 1
/* 396904 E009A354 00431021 */ addu $v0, $v0, $v1
/* 396908 E009A358 000210C0 */ sll $v0, $v0, 3
/* 39690C E009A35C 00431021 */ addu $v0, $v0, $v1
/* 396910 E009A360 AE22003C */ sw $v0, 0x3C($s1)
.LE009A364:
/* 396914 E009A364 C6200034 */ lwc1 $f0, 0x34($s1)
/* 396918 E009A368 3C01E00A */ lui $at, (0xE00A0000 >> 16)
/* 39691C E009A36C D422AA80 */ ldc1 $f2, -0x5580($at)
/* 396920 E009A370 46000021 */ cvt.d.s $f0, $f0
/* 396924 E009A374 46220001 */ sub.d $f0, $f0, $f2
/* 396928 E009A378 46200020 */ cvt.s.d $f0, $f0
/* 39692C E009A37C E6200034 */ swc1 $f0, 0x34($s1)
.LE009A380:
/* 396930 E009A380 8FBF0020 */ lw $ra, 0x20($sp)
/* 396934 E009A384 8FB1001C */ lw $s1, 0x1C($sp)
/* 396938 E009A388 8FB00018 */ lw $s0, 0x18($sp)
/* 39693C E009A38C D7B40028 */ ldc1 $f20, 0x28($sp)
/* 396940 E009A390 03E00008 */ jr $ra
/* 396944 E009A394 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void chomp_drop_update(EffectInstance* effect) {
ChompDropFXData* data = effect->data.chompDrop;
s32 unk40;
data->unk_40--;
data->unk_44++;
if (data->unk_40 < 0) {
shim_remove_effect(effect);
return;
}
unk40 = data->unk_40;
switch (data->unk_2C) {
case 0:
data->unk_24 += (data->unk_18 - data->unk_24) * data->unk_28;
data->unk_3C += (data->unk_20 - data->unk_3C) * data->unk_28;
data->unk_34 -= 0.02;
if (data->unk_34 < 0.0f) {
data->unk_30 = 10;
data->unk_34 = 0.0f;
data->unk_10 = 0.0f;
data->unk_2C = 1;
}
break;
case 1:
data->unk_30--;
if (data->unk_30 <= 0) {
data->unk_2C = 2;
data->unk_30 = 10;
}
break;
case 2:
data->unk_30--;
if (data->unk_30 <= 0) {
data->unk_2C = 3;
}
break;
case 3:
data->unk_10 -= 1.0f;
data->unk_08 += data->unk_10;
if (data->unk_08 < 0.0f) {
data->unk_08 = 0.0f;
shim_load_effect(EFFECT_DUST);
dust_main(2, data->unk_04 + 5.0f, data->unk_08, data->unk_0C, 30);
dust_main(2, data->unk_04 - 5.0f, data->unk_08, data->unk_0C, 30);
data->unk_2C = 4;
data->unk_30 = 20;
}
break;
case 4:
data->unk_30--;
if (data->unk_30 <= 0) {
data->unk_2C = 5;
}
break;
case 5:
if (unk40 < 10) {
data->unk_3C = unk40 * 25;
}
data->unk_34 -= 0.05;
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_802A16F4_7A9094
/* 7907C4 802A16F4 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 7907C8 802A16F8 AFBF001C */ sw $ra, 0x1C($sp)
.L802A16FC_7A909C:
/* 7907CC 802A16FC AFB00018 */ sw $s0, 0x18($sp)
.L802A1700_7A90A0:
/* 7907D0 802A1700 0C09A75B */ jal get_actor
D_802A1704_7A90A4:
/* 7907D4 802A1704 8C840148 */ lw $a0, 0x148($a0)
.L802A1708_7A90A8:
/* 7907D8 802A1708 0040802D */ daddu $s0, $v0, $zero
D_802A170C_7A90AC:
/* 7907DC 802A170C 0C09A75B */ jal get_actor
D_802A1710_7A90B0:
/* 7907E0 802A1710 86040428 */ lh $a0, 0x428($s0)
/* 7907E4 802A1714 82050426 */ lb $a1, 0x426($s0)
/* 7907E8 802A1718 0040802D */ daddu $s0, $v0, $zero
.L802A171C_7A90BC:
/* 7907EC 802A171C 0C099117 */ jal get_actor_part
/* 7907F0 802A1720 0200202D */ daddu $a0, $s0, $zero
D_802A1724_7A90C4:
/* 7907F4 802A1724 8E030000 */ lw $v1, 0x0($s0)
/* 7907F8 802A1728 0040202D */ daddu $a0, $v0, $zero
/* 7907FC 802A172C 30624000 */ andi $v0, $v1, 0x4000
/* 790800 802A1730 14400069 */ bnez $v0, func_802A18D8_7A9278
glabel .L802A1734_7A90D4
/* 790804 802A1734 24020002 */ addiu $v0, $zero, 0x2
.L802A1738_7A90D8:
/* 790808 802A1738 3C020040 */ lui $v0, (0x400000 >> 16)
/* 79080C 802A173C 00621024 */ and $v0, $v1, $v0
D_802A1740_7A90E0:
/* 790810 802A1740 10400003 */ beqz $v0, .L802A1750_7A90F0
D_802A1744_7A90E4:
/* 790814 802A1744 30622000 */ andi $v0, $v1, 0x2000
/* 790818 802A1748 080A8636 */ j func_802A18D8_7A9278
D_802A174C_7A90EC:
/* 79081C 802A174C 24020002 */ addiu $v0, $zero, 0x2
.L802A1750_7A90F0:
/* 790820 802A1750 14400061 */ bnez $v0, func_802A18D8_7A9278
glabel .L802A1754_7A90F4
/* 790824 802A1754 24020002 */ addiu $v0, $zero, 0x2
.L802A1758_7A90F8:
/* 790828 802A1758 8C83007C */ lw $v1, 0x7C($a0)
.L802A175C_7A90FC:
/* 79082C 802A175C 3C020004 */ lui $v0, (0x40000 >> 16)
/* 790830 802A1760 00621024 */ and $v0, $v1, $v0
/* 790834 802A1764 1440005C */ bnez $v0, func_802A18D8_7A9278
/* 790838 802A1768 24020002 */ addiu $v0, $zero, 0x2
D_802A176C_7A910C:
/* 79083C 802A176C 3C020008 */ lui $v0, (0x80000 >> 16)
D_802A1770_7A9110:
/* 790840 802A1770 00621024 */ and $v0, $v1, $v0
.L802A1774_7A9114:
/* 790844 802A1774 14400058 */ bnez $v0, func_802A18D8_7A9278
/* 790848 802A1778 24020002 */ addiu $v0, $zero, 0x2
.L802A177C_7A911C:
/* 79084C 802A177C 0200202D */ daddu $a0, $s0, $zero
/* 790850 802A1780 0000282D */ daddu $a1, $zero, $zero
D_802A1784_7A9124:
/* 790854 802A1784 2406000A */ addiu $a2, $zero, 0xA
.L802A1788_7A9128:
/* 790858 802A1788 24020004 */ addiu $v0, $zero, 0x4
/* 79085C 802A178C A2020224 */ sb $v0, 0x224($s0)
D_802A1790_7A9130:
/* 790860 802A1790 24020003 */ addiu $v0, $zero, 0x3
.L802A1794_7A9134:
/* 790864 802A1794 0C09E23E */ jal dispatch_damage_event_actor_0
.L802A1798_7A9138:
/* 790868 802A1798 A2020223 */ sb $v0, 0x223($s0)
.L802A179C_7A913C:
/* 79086C 802A179C 86020150 */ lh $v0, 0x150($s0)
D_802A17A0_7A9140:
/* 790870 802A17A0 C6000144 */ lwc1 $f0, 0x144($s0)
D_802A17A4_7A9144:
/* 790874 802A17A4 8E030000 */ lw $v1, 0x0($s0)
/* 790878 802A17A8 44821000 */ mtc1 $v0, $f2
D_802A17AC_7A914C:
/* 79087C 802A17AC 00000000 */ nop
.L802A17B0_7A9150:
/* 790880 802A17B0 468010A0 */ cvt.s.w $f2, $f2
.L802A17B4_7A9154:
/* 790884 802A17B4 92020190 */ lbu $v0, 0x190($s0)
.L802A17B8_7A9158:
/* 790888 802A17B8 46020000 */ add.s $f0, $f0, $f2
.L802A17BC_7A915C:
/* 79088C 802A17BC 00021042 */ srl $v0, $v0, 1
/* 790890 802A17C0 44821000 */ mtc1 $v0, $f2
D_802A17C4_7A9164:
/* 790894 802A17C4 00000000 */ nop
/* 790898 802A17C8 468010A0 */ cvt.s.w $f2, $f2
D_802A17CC_7A916C:
/* 79089C 802A17CC 30620800 */ andi $v0, $v1, 0x800
D_802A17D0_7A9170:
/* 7908A0 802A17D0 1040000D */ beqz $v0, .L802A1808_7A91A8
glabel func_802A17D4_7A9174
/* 7908A4 802A17D4 46020100 */ add.s $f4, $f0, $f2
/* 7908A8 802A17D8 86020152 */ lh $v0, 0x152($s0)
D_802A17DC_7A917C:
/* 7908AC 802A17DC C6000148 */ lwc1 $f0, 0x148($s0)
/* 7908B0 802A17E0 44821000 */ mtc1 $v0, $f2
D_802A17E4_7A9184:
/* 7908B4 802A17E4 00000000 */ nop
.L802A17E8_7A9188:
/* 7908B8 802A17E8 468010A0 */ cvt.s.w $f2, $f2
/* 7908BC 802A17EC 92020191 */ lbu $v0, 0x191($s0)
.L802A17F0_7A9190:
/* 7908C0 802A17F0 46020000 */ add.s $f0, $f0, $f2
.L802A17F4_7A9194:
/* 7908C4 802A17F4 44821000 */ mtc1 $v0, $f2
.L802A17F8_7A9198:
/* 7908C8 802A17F8 00000000 */ nop
D_802A17FC_7A919C:
/* 7908CC 802A17FC 468010A0 */ cvt.s.w $f2, $f2
D_802A1800_7A91A0:
/* 7908D0 802A1800 080A861D */ j .L802A1874_7A9214
D_802A1804_7A91A4:
/* 7908D4 802A1804 46020001 */ sub.s $f0, $f0, $f2
.L802A1808_7A91A8:
/* 7908D8 802A1808 30628000 */ andi $v0, $v1, 0x8000
D_802A180C_7A91AC:
/* 7908DC 802A180C 1440000D */ bnez $v0, D_802A1844_7A91E4
/* 7908E0 802A1810 00000000 */ nop
D_802A1814_7A91B4:
/* 7908E4 802A1814 86020152 */ lh $v0, 0x152($s0)
glabel func_802A1818_7A91B8
/* 7908E8 802A1818 C6000148 */ lwc1 $f0, 0x148($s0)
.L802A181C_7A91BC:
/* 7908EC 802A181C 44821000 */ mtc1 $v0, $f2
/* 7908F0 802A1820 00000000 */ nop
D_802A1824_7A91C4:
/* 7908F4 802A1824 468010A0 */ cvt.s.w $f2, $f2
/* 7908F8 802A1828 92020191 */ lbu $v0, 0x191($s0)
D_802A182C_7A91CC:
/* 7908FC 802A182C 46020000 */ add.s $f0, $f0, $f2
D_802A1830_7A91D0:
/* 790900 802A1830 44821000 */ mtc1 $v0, $f2
D_802A1834_7A91D4:
/* 790904 802A1834 00000000 */ nop
/* 790908 802A1838 468010A0 */ cvt.s.w $f2, $f2
D_802A183C_7A91DC:
/* 79090C 802A183C 080A861D */ j .L802A1874_7A9214
glabel func_802A1840_7A91E0
/* 790910 802A1840 46001000 */ add.s $f0, $f2, $f0
D_802A1844_7A91E4:
/* 790914 802A1844 86020152 */ lh $v0, 0x152($s0)
glabel func_802A1848_7A91E8
/* 790918 802A1848 C6020148 */ lwc1 $f2, 0x148($s0)
/* 79091C 802A184C 44820000 */ mtc1 $v0, $f0
D_802A1850_7A91F0:
/* 790920 802A1850 00000000 */ nop
D_802A1854_7A91F4:
/* 790924 802A1854 46800020 */ cvt.s.w $f0, $f0
.L802A1858_7A91F8:
/* 790928 802A1858 92020191 */ lbu $v0, 0x191($s0)
D_802A185C_7A91FC:
/* 79092C 802A185C 46001080 */ add.s $f2, $f2, $f0
/* 790930 802A1860 00021040 */ sll $v0, $v0, 1
/* 790934 802A1864 44820000 */ mtc1 $v0, $f0
/* 790938 802A1868 00000000 */ nop
D_802A186C_7A920C:
/* 79093C 802A186C 46800020 */ cvt.s.w $f0, $f0
D_802A1870_7A9210:
/* 790940 802A1870 46001000 */ add.s $f0, $f2, $f0
.L802A1874_7A9214:
/* 790944 802A1874 86020154 */ lh $v0, 0x154($s0)
.L802A1878_7A9218:
/* 790948 802A1878 44060000 */ mfc1 $a2, $f0
.L802A187C_7A921C:
/* 79094C 802A187C C600014C */ lwc1 $f0, 0x14C($s0)
/* 790950 802A1880 44821000 */ mtc1 $v0, $f2
D_802A1884_7A9224:
/* 790954 802A1884 00000000 */ nop
/* 790958 802A1888 468010A0 */ cvt.s.w $f2, $f2
glabel func_802A188C_7A922C
/* 79095C 802A188C 46020000 */ add.s $f0, $f0, $f2
.L802A1890_7A9230:
/* 790960 802A1890 3C0140A0 */ lui $at, (0x40A00000 >> 16)
glabel func_802A1894_7A9234
/* 790964 802A1894 44811000 */ mtc1 $at, $f2
/* 790968 802A1898 24040005 */ addiu $a0, $zero, 0x5
D_802A189C_7A923C:
/* 79096C 802A189C 46020000 */ add.s $f0, $f0, $f2
.L802A18A0_7A9240:
/* 790970 802A18A0 44052000 */ mfc1 $a1, $f4
D_802A18A4_7A9244:
/* 790974 802A18A4 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 790978 802A18A8 44812000 */ mtc1 $at, $f4
D_802A18AC_7A924C:
/* 79097C 802A18AC 44070000 */ mfc1 $a3, $f0
glabel .L802A18B0_7A9250
/* 790980 802A18B0 2402003C */ addiu $v0, $zero, 0x3C
/* 790984 802A18B4 AFA20014 */ sw $v0, 0x14($sp)
D_802A18B8_7A9258:
/* 790988 802A18B8 0C01C634 */ jal fx_stat_change
/* 79098C 802A18BC E7A40010 */ swc1 $f4, 0x10($sp)
/* 790990 802A18C0 0C05272D */ jal sfx_play_sound
/* 790994 802A18C4 24042106 */ addiu $a0, $zero, 0x2106
D_802A18C8_7A9268:
/* 790998 802A18C8 24020002 */ addiu $v0, $zero, 0x2
D_802A18CC_7A926C:
/* 79099C 802A18CC 24030001 */ addiu $v1, $zero, 0x1
D_802A18D0_7A9270:
/* 7909A0 802A18D0 3C01802A */ lui $at, %hi(func_802A2C84_7AA624 + 0x3C)
/* 7909A4 802A18D4 AC232CC0 */ sw $v1, %lo(func_802A2C84_7AA624 + 0x3C)($at)
glabel func_802A18D8_7A9278
/* 7909A8 802A18D8 8FBF001C */ lw $ra, 0x1C($sp)
/* 7909AC 802A18DC 8FB00018 */ lw $s0, 0x18($sp)
D_802A18E0_7A9280:
/* 7909B0 802A18E0 03E00008 */ jr $ra
D_802A18E4_7A9284:
/* 7909B4 802A18E4 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(func_802A16F4_7907C4) {
Actor* enemy = get_actor(script->owner1.enemyID);
Actor* target = get_actor(enemy->targetActorID);
ActorPart* targetPart = get_actor_part(target, enemy->targetPartIndex);
f32 x, y, z;
if (target->flags & ACTOR_FLAG_TARGET_ONLY) {
return ApiStatus_DONE2;
}
if (target->flags & ACTOR_FLAG_NO_DMG_APPLY) {
return ApiStatus_DONE2;
}
if (target->flags & ACTOR_FLAG_2000) {
return ApiStatus_DONE2;
}
if (targetPart->eventFlags & ACTOR_PART_FLAG_40000) {
return ApiStatus_DONE2;
}
if (targetPart->eventFlags & ACTOR_PART_FLAG_80000) {
return ApiStatus_DONE2;
}
target->chillOutTurns = 4;
target->chillOutAmount = 3;
dispatch_damage_event_actor_0(target, 0, 10);
x = target->currentPos.x + target->headOffset.x + (target->size.x / 2);
if (target->flags & ACTOR_FLAG_UPSIDE_DOWN) {
y = target->currentPos.y + target->headOffset.y - target->size.y;
} else if (!(target->flags & ACTOR_FLAG_8000)) {
y = target->currentPos.y + target->headOffset.y + target->size.y;
} else {
y = target->currentPos.y + target->headOffset.y + target->size.y * 2;
}
z = target->currentPos.z + target->headOffset.z + 5.0f;
fx_stat_change(5, x, y, z, 1.0f, 60);
sfx_play_sound(SOUND_2106);
D_802A2CC0 = 1;
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8024F394
/* 17DC74 8024F394 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 17DC78 8024F398 AFB40020 */ sw $s4, 0x20($sp)
/* 17DC7C 8024F39C 0080A02D */ daddu $s4, $a0, $zero
D_8024F3A0:
/* 17DC80 8024F3A0 AFB3001C */ sw $s3, 0x1C($sp)
/* 17DC84 8024F3A4 0000982D */ daddu $s3, $zero, $zero
/* 17DC88 8024F3A8 AFB50024 */ sw $s5, 0x24($sp)
/* 17DC8C 8024F3AC AFBF0028 */ sw $ra, 0x28($sp)
D_8024F3B0:
/* 17DC90 8024F3B0 AFB20018 */ sw $s2, 0x18($sp)
/* 17DC94 8024F3B4 AFB10014 */ sw $s1, 0x14($sp)
D_8024F3B8:
/* 17DC98 8024F3B8 AFB00010 */ sw $s0, 0x10($sp)
/* 17DC9C 8024F3BC F7B40030 */ sdc1 $f20, 0x30($sp)
D_8024F3C0_C0CC40:
/* 17DCA0 8024F3C0 86820012 */ lh $v0, 0x12($s4)
/* 17DCA4 8024F3C4 8E920018 */ lw $s2, 0x18($s4)
/* 17DCA8 8024F3C8 18400067 */ blez $v0, .L8024F568
/* 17DCAC 8024F3CC 0260A82D */ daddu $s5, $s3, $zero
/* 17DCB0 8024F3D0 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 17DCB4 8024F3D4 4481A800 */ mtc1 $at, $f21
/* 17DCB8 8024F3D8 4480A000 */ mtc1 $zero, $f20
/* 17DCBC 8024F3DC 26500044 */ addiu $s0, $s2, 0x44
.L8024F3E0:
/* 17DCC0 8024F3E0 8E420000 */ lw $v0, 0x0($s2)
/* 17DCC4 8024F3E4 5040005B */ beql $v0, $zero, .L8024F554
/* 17DCC8 8024F3E8 26730001 */ addiu $s3, $s3, 0x1
/* 17DCCC 8024F3EC 8E02FFE0 */ lw $v0, -0x20($s0)
/* 17DCD0 8024F3F0 8E11FFC0 */ lw $s1, -0x40($s0)
/* 17DCD4 8024F3F4 1040000B */ beqz $v0, .L8024F424
D_8024F3F8:
/* 17DCD8 8024F3F8 24150001 */ addiu $s5, $zero, 0x1
/* 17DCDC 8024F3FC 2442FFFF */ addiu $v0, $v0, -0x1
/* 17DCE0 8024F400 14400004 */ bnez $v0, .L8024F414
D_8024F404:
/* 17DCE4 8024F404 AE02FFE0 */ sw $v0, -0x20($s0)
/* 17DCE8 8024F408 0220202D */ daddu $a0, $s1, $zero
/* 17DCEC 8024F40C 0C048BC9 */ jal clear_entity_model_flags
/* 17DCF0 8024F410 24050020 */ addiu $a1, $zero, 0x20
.L8024F414:
/* 17DCF4 8024F414 0C0483C1 */ jal exec_entity_model_commandlist
/* 17DCF8 8024F418 0220202D */ daddu $a0, $s1, $zero
/* 17DCFC 8024F41C 08093D5A */ j .L8024F568
D_8024F420_C0CCA0:
/* 17DD00 8024F420 00000000 */ nop
.L8024F424:
/* 17DD04 8024F424 0C0483C1 */ jal exec_entity_model_commandlist
D_8024F428:
/* 17DD08 8024F428 0220202D */ daddu $a0, $s1, $zero
/* 17DD0C 8024F42C 8E02FFDC */ lw $v0, -0x24($s0)
/* 17DD10 8024F430 0440000D */ bltz $v0, .L8024F468
D_8024F434:
/* 17DD14 8024F434 00000000 */ nop
/* 17DD18 8024F438 C606FFF4 */ lwc1 $f6, -0xC($s0)
/* 17DD1C 8024F43C C600FFD0 */ lwc1 $f0, -0x30($s0)
/* 17DD20 8024F440 C604FFF8 */ lwc1 $f4, -0x8($s0)
/* 17DD24 8024F444 46003180 */ add.s $f6, $f6, $f0
D_8024F448:
/* 17DD28 8024F448 C600FFD4 */ lwc1 $f0, -0x2C($s0)
/* 17DD2C 8024F44C C602FFFC */ lwc1 $f2, -0x4($s0)
D_8024F450:
/* 17DD30 8024F450 46002100 */ add.s $f4, $f4, $f0
/* 17DD34 8024F454 C600FFD8 */ lwc1 $f0, -0x28($s0)
D_8024F458_C0CCD8:
/* 17DD38 8024F458 46001080 */ add.s $f2, $f2, $f0
/* 17DD3C 8024F45C E606FFF4 */ swc1 $f6, -0xC($s0)
/* 17DD40 8024F460 E604FFF8 */ swc1 $f4, -0x8($s0)
/* 17DD44 8024F464 E602FFFC */ swc1 $f2, -0x4($s0)
.L8024F468:
/* 17DD48 8024F468 3C01800B */ lui $at, %hi(gCameras + 0x5C4)
D_8024F46C:
/* 17DD4C 8024F46C C4202344 */ lwc1 $f0, %lo(gCameras + 0x5C4)($at)
D_8024F470:
/* 17DD50 8024F470 3C014334 */ lui $at, (0x43340000 >> 16)
D_8024F474:
/* 17DD54 8024F474 44816000 */ mtc1 $at, $f12
D_8024F478:
/* 17DD58 8024F478 0C00A6C9 */ jal clamp_angle
D_8024F47C:
/* 17DD5C 8024F47C 46006301 */ sub.s $f12, $f12, $f0
D_8024F480:
/* 17DD60 8024F480 C60CFFE4 */ lwc1 $f12, -0x1C($s0)
D_8024F484:
/* 17DD64 8024F484 C602FFE8 */ lwc1 $f2, -0x18($s0)
D_8024F488:
/* 17DD68 8024F488 46026300 */ add.s $f12, $f12, $f2
/* 17DD6C 8024F48C E600FFEC */ swc1 $f0, -0x14($s0)
/* 17DD70 8024F490 0C00A6C9 */ jal clamp_angle
/* 17DD74 8024F494 E60CFFE4 */ swc1 $f12, -0x1C($s0)
D_8024F498:
/* 17DD78 8024F498 C602FFE8 */ lwc1 $f2, -0x18($s0)
/* 17DD7C 8024F49C 3C01802A */ lui $at, %hi(D_8029CD90)
/* 17DD80 8024F4A0 D424CD90 */ ldc1 $f4, %lo(D_8029CD90)($at)
/* 17DD84 8024F4A4 460010A1 */ cvt.d.s $f2, $f2
/* 17DD88 8024F4A8 46241082 */ mul.d $f2, $f2, $f4
D_8024F4AC:
/* 17DD8C 8024F4AC 00000000 */ nop
/* 17DD90 8024F4B0 8E02FFDC */ lw $v0, -0x24($s0)
/* 17DD94 8024F4B4 E600FFE4 */ swc1 $f0, -0x1C($s0)
/* 17DD98 8024F4B8 2842000A */ slti $v0, $v0, 0xA
/* 17DD9C 8024F4BC 462010A0 */ cvt.s.d $f2, $f2
D_8024F4C0_C0CD40:
/* 17DDA0 8024F4C0 10400018 */ beqz $v0, .L8024F524
/* 17DDA4 8024F4C4 E602FFE8 */ swc1 $f2, -0x18($s0)
/* 17DDA8 8024F4C8 C604FFC4 */ lwc1 $f4, -0x3C($s0)
/* 17DDAC 8024F4CC 46002121 */ cvt.d.s $f4, $f4
D_8024F4D0:
/* 17DDB0 8024F4D0 46342102 */ mul.d $f4, $f4, $f20
/* 17DDB4 8024F4D4 00000000 */ nop
/* 17DDB8 8024F4D8 C600FFCC */ lwc1 $f0, -0x34($s0)
/* 17DDBC 8024F4DC 46000021 */ cvt.d.s $f0, $f0
/* 17DDC0 8024F4E0 46340002 */ mul.d $f0, $f0, $f20
/* 17DDC4 8024F4E4 00000000 */ nop
D_8024F4E8:
/* 17DDC8 8024F4E8 C602FFC8 */ lwc1 $f2, -0x38($s0)
/* 17DDCC 8024F4EC 460010A1 */ cvt.d.s $f2, $f2
/* 17DDD0 8024F4F0 46341082 */ mul.d $f2, $f2, $f20
/* 17DDD4 8024F4F4 00000000 */ nop
/* 17DDD8 8024F4F8 46202120 */ cvt.s.d $f4, $f4
/* 17DDDC 8024F4FC 46200020 */ cvt.s.d $f0, $f0
/* 17DDE0 8024F500 E604FFC4 */ swc1 $f4, -0x3C($s0)
/* 17DDE4 8024F504 E600FFCC */ swc1 $f0, -0x34($s0)
/* 17DDE8 8024F508 46002006 */ mov.s $f0, $f4
/* 17DDEC 8024F50C C604FFCC */ lwc1 $f4, -0x34($s0)
/* 17DDF0 8024F510 462010A0 */ cvt.s.d $f2, $f2
/* 17DDF4 8024F514 E602FFC8 */ swc1 $f2, -0x38($s0)
/* 17DDF8 8024F518 E600FFD0 */ swc1 $f0, -0x30($s0)
/* 17DDFC 8024F51C E602FFD4 */ swc1 $f2, -0x2C($s0)
D_8024F520_C0CDA0:
/* 17DE00 8024F520 E604FFD8 */ swc1 $f4, -0x28($s0)
.L8024F524:
/* 17DE04 8024F524 8E02FFDC */ lw $v0, -0x24($s0)
D_8024F528:
/* 17DE08 8024F528 2442FFFF */ addiu $v0, $v0, -0x1
/* 17DE0C 8024F52C 04410008 */ bgez $v0, D_8024F550
/* 17DE10 8024F530 AE02FFDC */ sw $v0, -0x24($s0)
/* 17DE14 8024F534 8E020000 */ lw $v0, 0x0($s0)
/* 17DE18 8024F538 2442FFFF */ addiu $v0, $v0, -0x1
/* 17DE1C 8024F53C 04410004 */ bgez $v0, D_8024F550
/* 17DE20 8024F540 AE020000 */ sw $v0, 0x0($s0)
/* 17DE24 8024F544 0C048B7F */ jal free_entity_model_by_index
/* 17DE28 8024F548 0220202D */ daddu $a0, $s1, $zero
D_8024F54C:
/* 17DE2C 8024F54C AE400000 */ sw $zero, 0x0($s2)
D_8024F550:
/* 17DE30 8024F550 26730001 */ addiu $s3, $s3, 0x1
.L8024F554:
/* 17DE34 8024F554 2610004C */ addiu $s0, $s0, 0x4C
D_8024F558_C0CDD8:
/* 17DE38 8024F558 86820012 */ lh $v0, 0x12($s4)
/* 17DE3C 8024F55C 0262102A */ slt $v0, $s3, $v0
/* 17DE40 8024F560 1440FF9F */ bnez $v0, .L8024F3E0
/* 17DE44 8024F564 2652004C */ addiu $s2, $s2, 0x4C
.L8024F568:
/* 17DE48 8024F568 16A00006 */ bnez $s5, .L8024F584
/* 17DE4C 8024F56C 00000000 */ nop
D_8024F570:
/* 17DE50 8024F570 0C00AB4B */ jal heap_free
/* 17DE54 8024F574 8E840018 */ lw $a0, 0x18($s4)
/* 17DE58 8024F578 0280202D */ daddu $a0, $s4, $zero
/* 17DE5C 8024F57C 0C093BE9 */ jal dro_02_pad_D_8024EFA4
D_8024F580:
/* 17DE60 8024F580 AC800018 */ sw $zero, 0x18($a0)
.L8024F584:
/* 17DE64 8024F584 8FBF0028 */ lw $ra, 0x28($sp)
D_8024F588:
/* 17DE68 8024F588 8FB50024 */ lw $s5, 0x24($sp)
D_8024F58C:
/* 17DE6C 8024F58C 8FB40020 */ lw $s4, 0x20($sp)
D_8024F590:
/* 17DE70 8024F590 8FB3001C */ lw $s3, 0x1C($sp)
D_8024F594:
/* 17DE74 8024F594 8FB20018 */ lw $s2, 0x18($sp)
D_8024F598:
/* 17DE78 8024F598 8FB10014 */ lw $s1, 0x14($sp)
D_8024F59C:
/* 17DE7C 8024F59C 8FB00010 */ lw $s0, 0x10($sp)
mac_04_Quizmo_Worker:
/* 17DE80 8024F5A0 D7B40030 */ ldc1 $f20, 0x30($sp)
D_8024F5A4:
/* 17DE84 8024F5A4 03E00008 */ jr $ra
/* 17DE88 8024F5A8 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void btl_bonk_update(void* data) {
PopupMessage* popup = data;
Message* message = popup->message;
s32 found = FALSE;
s32 i;
for (i = 0; i < popup->messageIndex; i++, message++) {
if (message->unk_00) {
s32 modelIdx = message->entityModelIndex;
found = TRUE;
if (message->unk_24 != 0) {
message->unk_24--;
if (message->unk_24 == 0) {
clear_entity_model_flags(modelIdx, MODEL_FLAG_FLAG_20);
}
exec_entity_model_commandlist(modelIdx);
break;
}
exec_entity_model_commandlist(modelIdx);
if (message->appearTime >= 0) {
message->pos.x += message->vel.x;
message->pos.y += message->vel.y;
message->pos.z += message->vel.z;
}
message->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].currentYaw);
message->rotZ += message->rotVelZ;
message->rotZ = clamp_angle(message->rotZ);
message->rotVelZ *= 0.8;
if (message->appearTime < 10) {
message->accel.x *= 0.5;
message->accel.y *= 0.5;
message->accel.z *= 0.5;
message->vel.x = message->accel.x;
message->vel.y = message->accel.y;
message->vel.z = message->accel.z;
}
message->appearTime--;
if (message->appearTime < 0) {
message->deleteTime--;
if (message->deleteTime < 0) {
free_entity_model_by_index(modelIdx);
message->unk_00 = FALSE;
}
}
}
}
if (!found) {
heap_free(popup->message);
popup->message = NULL;
free_popup(popup);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel bombette_breaking_update
/* 389030 E0084660 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 389034 E0084664 AFBF0010 */ sw $ra, 0x10($sp)
/* 389038 E0084668 F7B80028 */ sdc1 $f24, 0x28($sp)
/* 38903C E008466C F7B60020 */ sdc1 $f22, 0x20($sp)
/* 389040 E0084670 F7B40018 */ sdc1 $f20, 0x18($sp)
/* 389044 E0084674 8C85000C */ lw $a1, 0xC($a0)
/* 389048 E0084678 8CA20048 */ lw $v0, 0x48($a1)
/* 38904C E008467C 8CA30044 */ lw $v1, 0x44($a1)
/* 389050 E0084680 24420001 */ addiu $v0, $v0, 0x1
/* 389054 E0084684 2463FFFF */ addiu $v1, $v1, -0x1
/* 389058 E0084688 ACA20048 */ sw $v0, 0x48($a1)
/* 38905C E008468C 04610005 */ bgez $v1, .LE00846A4
/* 389060 E0084690 ACA30044 */ sw $v1, 0x44($a1)
/* 389064 E0084694 0C080128 */ jal shim_remove_effect
/* 389068 E0084698 00000000 */ nop
/* 38906C E008469C 08021233 */ j .LE00848CC
/* 389070 E00846A0 00000000 */ nop
.LE00846A4:
/* 389074 E00846A4 44831000 */ mtc1 $v1, $f2
/* 389078 E00846A8 00000000 */ nop
/* 38907C E00846AC 468010A0 */ cvt.s.w $f2, $f2
/* 389080 E00846B0 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 389084 E00846B4 44810000 */ mtc1 $at, $f0
/* 389088 E00846B8 C4AA0004 */ lwc1 $f10, 0x4($a1)
/* 38908C E00846BC 4600103C */ c.lt.s $f2, $f0
/* 389090 E00846C0 00000000 */ nop
/* 389094 E00846C4 45000008 */ bc1f .LE00846E8
/* 389098 E00846C8 00000000 */ nop
/* 38909C E00846CC 3C014120 */ lui $at, (0x41200000 >> 16)
/* 3890A0 E00846D0 44810000 */ mtc1 $at, $f0
/* 3890A4 E00846D4 00000000 */ nop
/* 3890A8 E00846D8 46001002 */ mul.s $f0, $f2, $f0
/* 3890AC E00846DC 00000000 */ nop
/* 3890B0 E00846E0 4600060D */ trunc.w.s $f24, $f0
/* 3890B4 E00846E4 E4B8004C */ swc1 $f24, 0x4C($a1)
.LE00846E8:
/* 3890B8 E00846E8 C4A20038 */ lwc1 $f2, 0x38($a1)
/* 3890BC E00846EC C4A0003C */ lwc1 $f0, 0x3C($a1)
/* 3890C0 E00846F0 46020001 */ sub.s $f0, $f0, $f2
/* 3890C4 E00846F4 3C01E008 */ lui $at, (0xE0084E50 >> 16)
/* 3890C8 E00846F8 D4244E50 */ ldc1 $f4, (0xE0084E50 & 0xFFFF)($at)
/* 3890CC E00846FC 46000021 */ cvt.d.s $f0, $f0
/* 3890D0 E0084700 46240002 */ mul.d $f0, $f0, $f4
/* 3890D4 E0084704 00000000 */ nop
/* 3890D8 E0084708 460010A1 */ cvt.d.s $f2, $f2
/* 3890DC E008470C 46201080 */ add.d $f2, $f2, $f0
/* 3890E0 E0084710 24060001 */ addiu $a2, $zero, 0x1
/* 3890E4 E0084714 462010A0 */ cvt.s.d $f2, $f2
/* 3890E8 E0084718 E4A20038 */ swc1 $f2, 0x38($a1)
/* 3890EC E008471C 8C820008 */ lw $v0, 0x8($a0)
/* 3890F0 E0084720 00C2102A */ slt $v0, $a2, $v0
/* 3890F4 E0084724 10400069 */ beqz $v0, .LE00848CC
/* 3890F8 E0084728 24A50050 */ addiu $a1, $a1, 0x50
/* 3890FC E008472C 24A30030 */ addiu $v1, $a1, 0x30
/* 389100 E0084730 3C01E008 */ lui $at, (0xE0084E58 >> 16)
/* 389104 E0084734 D42C4E58 */ ldc1 $f12, (0xE0084E58 & 0xFFFF)($at)
/* 389108 E0084738 44808000 */ mtc1 $zero, $f16
/* 38910C E008473C 3C01E008 */ lui $at, (0xE0084E60 >> 16)
/* 389110 E0084740 D4364E60 */ ldc1 $f22, (0xE0084E60 & 0xFFFF)($at)
/* 389114 E0084744 3C01E008 */ lui $at, (0xE0084E68 >> 16)
/* 389118 E0084748 D42E4E68 */ ldc1 $f14, (0xE0084E68 & 0xFFFF)($at)
/* 38911C E008474C 3C01E008 */ lui $at, (0xE0084E70 >> 16)
/* 389120 E0084750 D4344E70 */ ldc1 $f20, (0xE0084E70 & 0xFFFF)($at)
/* 389124 E0084754 3C01E008 */ lui $at, (0xE0084E78 >> 16)
/* 389128 E0084758 D4324E78 */ ldc1 $f18, (0xE0084E78 & 0xFFFF)($at)
.LE008475C:
/* 38912C E008475C C460FFF0 */ lwc1 $f0, -0x10($v1)
/* 389130 E0084760 46000021 */ cvt.d.s $f0, $f0
/* 389134 E0084764 462C0002 */ mul.d $f0, $f0, $f12
/* 389138 E0084768 00000000 */ nop
/* 38913C E008476C C462FFF4 */ lwc1 $f2, -0xC($v1)
/* 389140 E0084770 460010A1 */ cvt.d.s $f2, $f2
/* 389144 E0084774 462C1082 */ mul.d $f2, $f2, $f12
/* 389148 E0084778 00000000 */ nop
/* 38914C E008477C C464FFF8 */ lwc1 $f4, -0x8($v1)
/* 389150 E0084780 46002121 */ cvt.d.s $f4, $f4
/* 389154 E0084784 462C2102 */ mul.d $f4, $f4, $f12
/* 389158 E0084788 00000000 */ nop
/* 38915C E008478C C468FFD8 */ lwc1 $f8, -0x28($v1)
/* 389160 E0084790 C466FFDC */ lwc1 $f6, -0x24($v1)
/* 389164 E0084794 46200020 */ cvt.s.d $f0, $f0
/* 389168 E0084798 462010A0 */ cvt.s.d $f2, $f2
/* 38916C E008479C E460FFF0 */ swc1 $f0, -0x10($v1)
/* 389170 E00847A0 46004200 */ add.s $f8, $f8, $f0
/* 389174 E00847A4 E462FFF4 */ swc1 $f2, -0xC($v1)
/* 389178 E00847A8 46001006 */ mov.s $f0, $f2
/* 38917C E00847AC 46003180 */ add.s $f6, $f6, $f0
/* 389180 E00847B0 C460FFE0 */ lwc1 $f0, -0x20($v1)
/* 389184 E00847B4 46202120 */ cvt.s.d $f4, $f4
/* 389188 E00847B8 E464FFF8 */ swc1 $f4, -0x8($v1)
/* 38918C E00847BC 46002086 */ mov.s $f2, $f4
/* 389190 E00847C0 46020000 */ add.s $f0, $f0, $f2
/* 389194 E00847C4 E466FFDC */ swc1 $f6, -0x24($v1)
/* 389198 E00847C8 46003086 */ mov.s $f2, $f6
/* 38919C E00847CC E468FFD8 */ swc1 $f8, -0x28($v1)
/* 3891A0 E00847D0 460A103C */ c.lt.s $f2, $f10
/* 3891A4 E00847D4 00000000 */ nop
/* 3891A8 E00847D8 4500000C */ bc1f .LE008480C
/* 3891AC E00847DC E460FFE0 */ swc1 $f0, -0x20($v1)
/* 3891B0 E00847E0 C460FFF4 */ lwc1 $f0, -0xC($v1)
/* 3891B4 E00847E4 4610003C */ c.lt.s $f0, $f16
/* 3891B8 E00847E8 00000000 */ nop
/* 3891BC E00847EC 45000007 */ bc1f .LE008480C
/* 3891C0 E00847F0 00000000 */ nop
/* 3891C4 E00847F4 46000021 */ cvt.d.s $f0, $f0
/* 3891C8 E00847F8 46360002 */ mul.d $f0, $f0, $f22
/* 3891CC E00847FC 00000000 */ nop
/* 3891D0 E0084800 E46AFFDC */ swc1 $f10, -0x24($v1)
/* 3891D4 E0084804 46200020 */ cvt.s.d $f0, $f0
/* 3891D8 E0084808 E460FFF4 */ swc1 $f0, -0xC($v1)
.LE008480C:
/* 3891DC E008480C C460FFFC */ lwc1 $f0, -0x4($v1)
/* 3891E0 E0084810 46000021 */ cvt.d.s $f0, $f0
/* 3891E4 E0084814 462E0002 */ mul.d $f0, $f0, $f14
/* 3891E8 E0084818 00000000 */ nop
/* 3891EC E008481C C4640004 */ lwc1 $f4, 0x4($v1)
/* 3891F0 E0084820 46002121 */ cvt.d.s $f4, $f4
/* 3891F4 E0084824 462E2102 */ mul.d $f4, $f4, $f14
/* 3891F8 E0084828 00000000 */ nop
/* 3891FC E008482C C4620000 */ lwc1 $f2, 0x0($v1)
/* 389200 E0084830 460010A1 */ cvt.d.s $f2, $f2
/* 389204 E0084834 46341081 */ sub.d $f2, $f2, $f20
/* 389208 E0084838 C466FFE4 */ lwc1 $f6, -0x1C($v1)
/* 38920C E008483C 462010A0 */ cvt.s.d $f2, $f2
/* 389210 E0084840 E4620000 */ swc1 $f2, 0x0($v1)
/* 389214 E0084844 C462FFE8 */ lwc1 $f2, -0x18($v1)
/* 389218 E0084848 46200020 */ cvt.s.d $f0, $f0
/* 38921C E008484C 46003180 */ add.s $f6, $f6, $f0
/* 389220 E0084850 E460FFFC */ swc1 $f0, -0x4($v1)
/* 389224 E0084854 C4600000 */ lwc1 $f0, 0x0($v1)
/* 389228 E0084858 46202120 */ cvt.s.d $f4, $f4
/* 38922C E008485C E4640004 */ swc1 $f4, 0x4($v1)
/* 389230 E0084860 C464FFEC */ lwc1 $f4, -0x14($v1)
/* 389234 E0084864 46001080 */ add.s $f2, $f2, $f0
/* 389238 E0084868 C4600004 */ lwc1 $f0, 0x4($v1)
/* 38923C E008486C 46002100 */ add.s $f4, $f4, $f0
/* 389240 E0084870 E466FFE4 */ swc1 $f6, -0x1C($v1)
/* 389244 E0084874 E462FFE8 */ swc1 $f2, -0x18($v1)
/* 389248 E0084878 46001006 */ mov.s $f0, $f2
/* 38924C E008487C 460A003C */ c.lt.s $f0, $f10
/* 389250 E0084880 00000000 */ nop
/* 389254 E0084884 4500000C */ bc1f .LE00848B8
/* 389258 E0084888 E464FFEC */ swc1 $f4, -0x14($v1)
/* 38925C E008488C C4600000 */ lwc1 $f0, 0x0($v1)
/* 389260 E0084890 4610003C */ c.lt.s $f0, $f16
/* 389264 E0084894 00000000 */ nop
/* 389268 E0084898 45020008 */ bc1fl .LE00848BC
/* 38926C E008489C 24C60001 */ addiu $a2, $a2, 0x1
/* 389270 E00848A0 46000021 */ cvt.d.s $f0, $f0
/* 389274 E00848A4 46320002 */ mul.d $f0, $f0, $f18
/* 389278 E00848A8 00000000 */ nop
/* 38927C E00848AC E46AFFE8 */ swc1 $f10, -0x18($v1)
/* 389280 E00848B0 46200020 */ cvt.s.d $f0, $f0
/* 389284 E00848B4 E4600000 */ swc1 $f0, 0x0($v1)
.LE00848B8:
/* 389288 E00848B8 24C60001 */ addiu $a2, $a2, 0x1
.LE00848BC:
/* 38928C E00848BC 8C820008 */ lw $v0, 0x8($a0)
/* 389290 E00848C0 00C2102A */ slt $v0, $a2, $v0
/* 389294 E00848C4 1440FFA5 */ bnez $v0, .LE008475C
/* 389298 E00848C8 24630050 */ addiu $v1, $v1, 0x50
.LE00848CC:
/* 38929C E00848CC 8FBF0010 */ lw $ra, 0x10($sp)
/* 3892A0 E00848D0 D7B80028 */ ldc1 $f24, 0x28($sp)
/* 3892A4 E00848D4 D7B60020 */ ldc1 $f22, 0x20($sp)
/* 3892A8 E00848D8 D7B40018 */ ldc1 $f20, 0x18($sp)
/* 3892AC E00848DC 03E00008 */ jr $ra
/* 3892B0 E00848E0 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void bombette_breaking_update(EffectInstance* effect) {
BombetteBreakingFXData* data = effect->data.bombetteBreaking;
f32 unk_04;
s32 i;
data->unk_48++;
data->timeLeft--;
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
unk_04 = data->unk_04;
if (data->timeLeft < 25.0f) {
data->alpha = data->timeLeft * 10.0f;
}
data->unk_38 += (data->unk_3C - data->unk_38) * 0.1;
data++;
for (i = 1; i < effect->numParts; i++, data++) {
data->unk_20.x *= 0.9;
data->unk_20.y *= 0.9;
data->unk_20.z *= 0.9;
data->center.x += data->unk_20.x;
data->center.y += data->unk_20.y;
data->center.z += data->unk_20.z;
if (data->center.y < unk_04 && data->unk_20.y < 0.0f) {
data->center.y = unk_04;
data->unk_20.y *= -0.7;
}
data->unk_2C.x *= 0.95;
data->unk_2C.y -= 0.4;
data->unk_2C.z *= 0.95;
data->unk_14.x += data->unk_2C.x;
data->unk_14.y += data->unk_2C.y;
data->unk_14.z += data->unk_2C.z;
if (data->unk_14.y < unk_04 && data->unk_2C.y < 0.0f) {
data->unk_14.y = unk_04;
data->unk_2C.y *= -0.4;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_sfx_init
/* 26840 8004B440 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 26844 8004B444 AFB00010 */ sw $s0, 0x10($sp)
/* 26848 8004B448 0080802D */ daddu $s0, $a0, $zero
/* 2684C 8004B44C 3C030006 */ lui $v1, (0x6A25E >> 16)
/* 26850 8004B450 3463A25E */ ori $v1, $v1, (0x6A25E & 0xFFFF)
/* 26854 8004B454 3C020004 */ lui $v0, (0x4C4B4 >> 16)
/* 26858 8004B458 8FA40028 */ lw $a0, 0x28($sp)
/* 2685C 8004B45C 3442C4B4 */ ori $v0, $v0, (0x4C4B4 & 0xFFFF)
/* 26860 8004B460 AFBF0014 */ sw $ra, 0x14($sp)
/* 26864 8004B464 AE070000 */ sw $a3, 0x0($s0)
/* 26868 8004B468 AE020034 */ sw $v0, 0x34($s0)
/* 2686C 8004B46C AE03003C */ sw $v1, 0x3C($s0)
/* 26870 8004B470 AE030038 */ sw $v1, 0x38($s0)
/* 26874 8004B474 A20500BC */ sb $a1, 0xBC($s0)
/* 26878 8004B478 308200FF */ andi $v0, $a0, 0xFF
/* 2687C 8004B47C 2C420011 */ sltiu $v0, $v0, 0x11
/* 26880 8004B480 14400004 */ bnez $v0, .L8004B494
/* 26884 8004B484 A20600BE */ sb $a2, 0xBE($s0)
/* 26888 8004B488 24020010 */ addiu $v0, $zero, 0x10
/* 2688C 8004B48C 08012D26 */ j .L8004B498
/* 26890 8004B490 A20200BD */ sb $v0, 0xBD($s0)
.L8004B494:
/* 26894 8004B494 A20400BD */ sb $a0, 0xBD($s0)
.L8004B498:
/* 26898 8004B498 0000202D */ daddu $a0, $zero, $zero
/* 2689C 8004B49C 24060040 */ addiu $a2, $zero, 0x40
/* 268A0 8004B4A0 240500B0 */ addiu $a1, $zero, 0xB0
/* 268A4 8004B4A4 2403016C */ addiu $v1, $zero, 0x16C
/* 268A8 8004B4A8 34028000 */ ori $v0, $zero, 0x8000
/* 268AC 8004B4AC AE02005C */ sw $v0, 0x5C($s0)
/* 268B0 8004B4B0 A60200B8 */ sh $v0, 0xB8($s0)
/* 268B4 8004B4B4 AE000030 */ sw $zero, 0x30($s0)
/* 268B8 8004B4B8 AE000060 */ sw $zero, 0x60($s0)
.L8004B4BC:
/* 268BC 8004B4BC 02031021 */ addu $v0, $s0, $v1
/* 268C0 8004B4C0 24840001 */ addiu $a0, $a0, 0x1
/* 268C4 8004B4C4 AC400000 */ sw $zero, 0x0($v0)
/* 268C8 8004B4C8 A440005C */ sh $zero, 0x5C($v0)
/* 268CC 8004B4CC A440008E */ sh $zero, 0x8E($v0)
/* 268D0 8004B4D0 A4400090 */ sh $zero, 0x90($v0)
/* 268D4 8004B4D4 A4400092 */ sh $zero, 0x92($v0)
/* 268D8 8004B4D8 A0400094 */ sb $zero, 0x94($v0)
/* 268DC 8004B4DC A040009B */ sb $zero, 0x9B($v0)
/* 268E0 8004B4E0 A040009C */ sb $zero, 0x9C($v0)
/* 268E4 8004B4E4 A040009D */ sb $zero, 0x9D($v0)
/* 268E8 8004B4E8 A040009E */ sb $zero, 0x9E($v0)
/* 268EC 8004B4EC A040009F */ sb $zero, 0x9F($v0)
/* 268F0 8004B4F0 A0400099 */ sb $zero, 0x99($v0)
/* 268F4 8004B4F4 A0400078 */ sb $zero, 0x78($v0)
/* 268F8 8004B4F8 A0400079 */ sb $zero, 0x79($v0)
/* 268FC 8004B4FC A040007A */ sb $zero, 0x7A($v0)
/* 26900 8004B500 A046007B */ sb $a2, 0x7B($v0)
/* 26904 8004B504 A040007C */ sb $zero, 0x7C($v0)
/* 26908 8004B508 A045007D */ sb $a1, 0x7D($v0)
/* 2690C 8004B50C A040007E */ sb $zero, 0x7E($v0)
/* 26910 8004B510 A040007F */ sb $zero, 0x7F($v0)
/* 26914 8004B514 2C820008 */ sltiu $v0, $a0, 0x8
/* 26918 8004B518 1440FFE8 */ bnez $v0, .L8004B4BC
/* 2691C 8004B51C 246300AC */ addiu $v1, $v1, 0xAC
/* 26920 8004B520 0000202D */ daddu $a0, $zero, $zero
/* 26924 8004B524 0200182D */ daddu $v1, $s0, $zero
.L8004B528:
/* 26928 8004B528 AC600090 */ sw $zero, 0x90($v1)
/* 2692C 8004B52C 24840001 */ addiu $a0, $a0, 0x1
/* 26930 8004B530 2C820004 */ sltiu $v0, $a0, 0x4
/* 26934 8004B534 1440FFFC */ bnez $v0, .L8004B528
/* 26938 8004B538 24630004 */ addiu $v1, $v1, 0x4
/* 2693C 8004B53C 0000202D */ daddu $a0, $zero, $zero
/* 26940 8004B540 0200182D */ daddu $v1, $s0, $zero
.L8004B544:
/* 26944 8004B544 A46000A0 */ sh $zero, 0xA0($v1)
/* 26948 8004B548 24840001 */ addiu $a0, $a0, 0x1
/* 2694C 8004B54C 2C820004 */ sltiu $v0, $a0, 0x4
/* 26950 8004B550 1440FFFC */ bnez $v0, .L8004B544
/* 26954 8004B554 24630006 */ addiu $v1, $v1, 0x6
/* 26958 8004B558 0200202D */ daddu $a0, $s0, $zero
/* 2695C 8004B55C 0000282D */ daddu $a1, $zero, $zero
/* 26960 8004B560 0C012E95 */ jal au_sfx_set_state
/* 26964 8004B564 AE000168 */ sw $zero, 0x168($s0)
/* 26968 8004B568 0C012DA6 */ jal au_sfx_clear_queue
/* 2696C 8004B56C 0200202D */ daddu $a0, $s0, $zero
/* 26970 8004B570 26040040 */ addiu $a0, $s0, 0x40
/* 26974 8004B574 0000282D */ daddu $a1, $zero, $zero
/* 26978 8004B578 24067FFF */ addiu $a2, $zero, 0x7FFF
/* 2697C 8004B57C 0C014E5D */ jal au_fade_init
/* 26980 8004B580 00C0382D */ daddu $a3, $a2, $zero
/* 26984 8004B584 920400BE */ lbu $a0, 0xBE($s0)
/* 26988 8004B588 96050040 */ lhu $a1, 0x40($s0)
/* 2698C 8004B58C 0C014EA6 */ jal au_fade_set_volume
/* 26990 8004B590 8E06005C */ lw $a2, 0x5C($s0)
/* 26994 8004B594 0200202D */ daddu $a0, $s0, $zero
/* 26998 8004B598 0000282D */ daddu $a1, $zero, $zero
/* 2699C 8004B59C 240200FF */ addiu $v0, $zero, 0xFF
/* 269A0 8004B5A0 A082008C */ sb $v0, 0x8C($a0)
/* 269A4 8004B5A4 3C028008 */ lui $v0, %hi(D_80078290)
/* 269A8 8004B5A8 24428290 */ addiu $v0, $v0, %lo(D_80078290)
/* 269AC 8004B5AC AC820064 */ sw $v0, 0x64($a0)
/* 269B0 8004B5B0 3C028008 */ lui $v0, %hi(D_800782F8)
/* 269B4 8004B5B4 244282F8 */ addiu $v0, $v0, %lo(D_800782F8)
/* 269B8 8004B5B8 AC820068 */ sw $v0, 0x68($a0)
/* 269BC 8004B5BC 3C028008 */ lui $v0, %hi(D_80078320)
/* 269C0 8004B5C0 24428320 */ addiu $v0, $v0, %lo(D_80078320)
/* 269C4 8004B5C4 AC82006C */ sw $v0, 0x6C($a0)
/* 269C8 8004B5C8 3C028008 */ lui $v0, %hi(D_80078348)
/* 269CC 8004B5CC 24428348 */ addiu $v0, $v0, %lo(D_80078348)
/* 269D0 8004B5D0 AC820070 */ sw $v0, 0x70($a0)
/* 269D4 8004B5D4 AC820074 */ sw $v0, 0x74($a0)
/* 269D8 8004B5D8 AC820078 */ sw $v0, 0x78($a0)
/* 269DC 8004B5DC AC82007C */ sw $v0, 0x7C($a0)
/* 269E0 8004B5E0 AC820080 */ sw $v0, 0x80($a0)
/* 269E4 8004B5E4 24020010 */ addiu $v0, $zero, 0x10
/* 269E8 8004B5E8 A0820084 */ sb $v0, 0x84($a0)
/* 269EC 8004B5EC 24020020 */ addiu $v0, $zero, 0x20
/* 269F0 8004B5F0 A0820085 */ sb $v0, 0x85($a0)
/* 269F4 8004B5F4 A0820086 */ sb $v0, 0x86($a0)
/* 269F8 8004B5F8 A0820087 */ sb $v0, 0x87($a0)
/* 269FC 8004B5FC A0820088 */ sb $v0, 0x88($a0)
/* 26A00 8004B600 24020030 */ addiu $v0, $zero, 0x30
/* 26A04 8004B604 A0820089 */ sb $v0, 0x89($a0)
/* 26A08 8004B608 24020040 */ addiu $v0, $zero, 0x40
/* 26A0C 8004B60C A082008A */ sb $v0, 0x8A($a0)
/* 26A10 8004B610 24020050 */ addiu $v0, $zero, 0x50
/* 26A14 8004B614 0C012E79 */ jal au_sfx_set_reverb_type
/* 26A18 8004B618 A082008B */ sb $v0, 0x8B($a0)
/* 26A1C 8004B61C 8FBF0014 */ lw $ra, 0x14($sp)
/* 26A20 8004B620 8FB00010 */ lw $s0, 0x10($sp)
/* 26A24 8004B624 03E00008 */ jr $ra
/* 26A28 8004B628 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void au_sfx_init(SoundManager* manager, u8 priority, u8 busId, AuGlobals* globals, u8 minVoiceIdx) {
u32 i;
s32 c = 434782;
manager->globals = globals;
manager->nextUpdateStep = 312500;
manager->nextUpdateCounter = c;
manager->nextUpdateInterval = c;
manager->priority = priority;
manager->busId = busId;
if (minVoiceIdx > 16) {
manager->sfxPlayerSelector = 16;
} else {
manager->sfxPlayerSelector = minVoiceIdx;
}
manager->busVolume = 0x8000;
manager->baseVolume = 0x8000;
manager->playCounter = 0;
manager->randomValue = 0;
for (i = 0; i < ARRAY_COUNT(manager->players); i++) {
SoundPlayer* player = &manager->players[i];
player->sefDataReadPos = NULL;
player->sfxVolume = 0;
player->delay = 0;
player->playLength = 0;
player->coarseTune = 0;
player->fineTune = 0;
player->sfxPan = 0;
player->reverb = 0;
player->instrumentIndex = 0;
player->envelopePreset = 0;
player->playVelocity = 0;
player->exclusiveID = 0;
player->cmdList_mode2[0] = 0;
player->cmdList_mode2[1] = 0;
player->cmdList_mode2[2] = 0;
player->cmdList_mode2[3] = 64; // default pan
player->cmdList_mode2[4] = 0;
player->cmdList_mode2[5] = 0x80 + 48; // default tune, higher bit is meaningless
player->cmdList_mode2[6] = 0;
player->cmdList_mode2[7] = 0;
}
for (i = 0; i < ARRAY_COUNT(manager->bgmSounds); i++) {
manager->bgmSounds[i].s32 = 0;
}
for (i = 0; i < ARRAY_COUNT(manager->customCmdList); i++) {
manager->customCmdList[i].data[0] = 0;
}
manager->resetPending = FALSE;
au_sfx_set_state(manager, SND_MANAGER_STATE_ENABLED);
au_sfx_clear_queue(manager);
au_fade_init(&manager->fadeInfo, 0, 0x7FFF, 0x7FFF);
au_fade_set_volume(manager->busId, manager->fadeInfo.currentVolume.u16, manager->busVolume);
manager->lastCustomEffectIdx = 0xFF;
manager->customReverbParams[0] = CUSTOM_SMALL_ROOM_PARAMS;
manager->customReverbParams[1] = CUSTOM_ECHO_PARAMS_1;
manager->customReverbParams[2] = CUSTOM_ECHO_PARAMS_2;
manager->customReverbParams[3] = CUSTOM_ECHO_PARAMS_3;
manager->customReverbParams[4] = CUSTOM_ECHO_PARAMS_3;
manager->customReverbParams[5] = CUSTOM_ECHO_PARAMS_3;
manager->customReverbParams[6] = CUSTOM_ECHO_PARAMS_3;
manager->customReverbParams[7] = CUSTOM_ECHO_PARAMS_3;
manager->customReverbAmounts[0] = 0x10;
manager->customReverbAmounts[1] = 0x20;
manager->customReverbAmounts[2] = 0x20;
manager->customReverbAmounts[3] = 0x20;
manager->customReverbAmounts[4] = 0x20;
manager->customReverbAmounts[5] = 0x30;
manager->customReverbAmounts[6] = 0x40;
manager->customReverbAmounts[7] = 0x50;
au_sfx_set_reverb_type(manager, 0);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel cloud_puff_main
/* 32E490 E0014000 27BDFF90 */ addiu $sp, $sp, -0x70
/* 32E494 E0014004 F7BA0058 */ sdc1 $f26, 0x58($sp)
/* 32E498 E0014008 46006686 */ mov.s $f26, $f12
/* 32E49C E001400C F7BC0060 */ sdc1 $f28, 0x60($sp)
/* 32E4A0 E0014010 46007706 */ mov.s $f28, $f14
/* 32E4A4 E0014014 27A40010 */ addiu $a0, $sp, 0x10
/* 32E4A8 E0014018 F7BE0068 */ sdc1 $f30, 0x68($sp)
/* 32E4AC E001401C 4486F000 */ mtc1 $a2, $f30
/* 32E4B0 E0014020 3C02E001 */ lui $v0, %hi(cloud_puff_init)
/* 32E4B4 E0014024 24424258 */ addiu $v0, $v0, %lo(cloud_puff_init)
/* 32E4B8 E0014028 AFA20018 */ sw $v0, 0x18($sp)
/* 32E4BC E001402C 3C02E001 */ lui $v0, %hi(cloud_puff_update)
/* 32E4C0 E0014030 24424260 */ addiu $v0, $v0, %lo(cloud_puff_update)
/* 32E4C4 E0014034 AFA2001C */ sw $v0, 0x1C($sp)
/* 32E4C8 E0014038 3C02E001 */ lui $v0, %hi(cloud_puff_render)
/* 32E4CC E001403C 2442449C */ addiu $v0, $v0, %lo(cloud_puff_render)
/* 32E4D0 E0014040 AFA20020 */ sw $v0, 0x20($sp)
/* 32E4D4 E0014044 2402000A */ addiu $v0, $zero, 0xA
/* 32E4D8 E0014048 AFBF003C */ sw $ra, 0x3C($sp)
/* 32E4DC E001404C AFB40038 */ sw $s4, 0x38($sp)
/* 32E4E0 E0014050 AFB30034 */ sw $s3, 0x34($sp)
/* 32E4E4 E0014054 AFB20030 */ sw $s2, 0x30($sp)
/* 32E4E8 E0014058 AFB1002C */ sw $s1, 0x2C($sp)
/* 32E4EC E001405C AFB00028 */ sw $s0, 0x28($sp)
/* 32E4F0 E0014060 F7B80050 */ sdc1 $f24, 0x50($sp)
/* 32E4F4 E0014064 F7B60048 */ sdc1 $f22, 0x48($sp)
/* 32E4F8 E0014068 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 32E4FC E001406C AFA7007C */ sw $a3, 0x7C($sp)
/* 32E500 E0014070 AFA00010 */ sw $zero, 0x10($sp)
/* 32E504 E0014074 AFA00024 */ sw $zero, 0x24($sp)
/* 32E508 E0014078 0C080124 */ jal shim_create_effect_instance
/* 32E50C E001407C AFA20014 */ sw $v0, 0x14($sp)
/* 32E510 E0014080 24040260 */ addiu $a0, $zero, 0x260
/* 32E514 E0014084 24140008 */ addiu $s4, $zero, 0x8
/* 32E518 E0014088 0040802D */ daddu $s0, $v0, $zero
/* 32E51C E001408C 0C08012C */ jal shim_general_heap_malloc
/* 32E520 E0014090 AE140008 */ sw $s4, 0x8($s0)
/* 32E524 E0014094 0040882D */ daddu $s1, $v0, $zero
/* 32E528 E0014098 16200003 */ bnez $s1, .LE00140A8
/* 32E52C E001409C AE11000C */ sw $s1, 0xC($s0)
.LE00140A0:
/* 32E530 E00140A0 08005028 */ j .LE00140A0
/* 32E534 E00140A4 00000000 */ nop
.LE00140A8:
/* 32E538 E00140A8 0220202D */ daddu $a0, $s1, $zero
/* 32E53C E00140AC 00142880 */ sll $a1, $s4, 2
/* 32E540 E00140B0 00B42821 */ addu $a1, $a1, $s4
/* 32E544 E00140B4 00052880 */ sll $a1, $a1, 2
/* 32E548 E00140B8 00B42823 */ subu $a1, $a1, $s4
/* 32E54C E00140BC 0C080130 */ jal shim_mem_clear
/* 32E550 E00140C0 00052880 */ sll $a1, $a1, 2
/* 32E554 E00140C4 12800056 */ beqz $s4, .LE0014220
/* 32E558 E00140C8 0000902D */ daddu $s2, $zero, $zero
/* 32E55C E00140CC 26300048 */ addiu $s0, $s1, 0x48
/* 32E560 E00140D0 0240982D */ daddu $s3, $s2, $zero
/* 32E564 E00140D4 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 32E568 E00140D8 4481C000 */ mtc1 $at, $f24
/* 32E56C E00140DC 3C01E001 */ lui $at, (0xE0014780 >> 16)
/* 32E570 E00140E0 D4364780 */ ldc1 $f22, (0xE0014780 & 0xFFFF)($at)
.LE00140E4:
/* 32E574 E00140E4 2404000A */ addiu $a0, $zero, 0xA
/* 32E578 E00140E8 24020001 */ addiu $v0, $zero, 0x1
/* 32E57C E00140EC AE220000 */ sw $v0, 0x0($s1)
/* 32E580 E00140F0 240200FF */ addiu $v0, $zero, 0xFF
/* 32E584 E00140F4 AE00FFF8 */ sw $zero, -0x8($s0)
/* 32E588 E00140F8 E61AFFC4 */ swc1 $f26, -0x3C($s0)
/* 32E58C E00140FC E61CFFC8 */ swc1 $f28, -0x38($s0)
/* 32E590 E0014100 E61EFFCC */ swc1 $f30, -0x34($s0)
/* 32E594 E0014104 E618FFD0 */ swc1 $f24, -0x30($s0)
/* 32E598 E0014108 E618FFD4 */ swc1 $f24, -0x2C($s0)
/* 32E59C E001410C E618FFD8 */ swc1 $f24, -0x28($s0)
/* 32E5A0 E0014110 0C080138 */ jal shim_rand_int
/* 32E5A4 E0014114 A202FFC0 */ sb $v0, -0x40($s0)
/* 32E5A8 E0014118 44820000 */ mtc1 $v0, $f0
/* 32E5AC E001411C 00000000 */ nop
/* 32E5B0 E0014120 46800021 */ cvt.d.w $f0, $f0
/* 32E5B4 E0014124 46360002 */ mul.d $f0, $f0, $f22
/* 32E5B8 E0014128 00000000 */ nop
/* 32E5BC E001412C 3C013FF0 */ lui $at, (0x3FF00000 >> 16)
/* 32E5C0 E0014130 44811800 */ mtc1 $at, $f3
/* 32E5C4 E0014134 44801000 */ mtc1 $zero, $f2
/* 32E5C8 E0014138 00000000 */ nop
/* 32E5CC E001413C 46220000 */ add.d $f0, $f0, $f2
/* 32E5D0 E0014140 2404000A */ addiu $a0, $zero, 0xA
/* 32E5D4 E0014144 46200020 */ cvt.s.d $f0, $f0
/* 32E5D8 E0014148 0C080138 */ jal shim_rand_int
/* 32E5DC E001414C E600FFDC */ swc1 $f0, -0x24($s0)
/* 32E5E0 E0014150 44820000 */ mtc1 $v0, $f0
/* 32E5E4 E0014154 00000000 */ nop
/* 32E5E8 E0014158 46800021 */ cvt.d.w $f0, $f0
/* 32E5EC E001415C 46360002 */ mul.d $f0, $f0, $f22
/* 32E5F0 E0014160 00000000 */ nop
/* 32E5F4 E0014164 3C01E001 */ lui $at, (0xE0014788 >> 16)
/* 32E5F8 E0014168 D4224788 */ ldc1 $f2, (0xE0014788 & 0xFFFF)($at)
/* 32E5FC E001416C 26520001 */ addiu $s2, $s2, 0x1
/* 32E600 E0014170 46220000 */ add.d $f0, $f0, $f2
/* 32E604 E0014174 2631004C */ addiu $s1, $s1, 0x4C
/* 32E608 E0014178 2404003C */ addiu $a0, $zero, 0x3C
/* 32E60C E001417C 46200020 */ cvt.s.d $f0, $f0
/* 32E610 E0014180 0C080000 */ jal effect_rand_int
/* 32E614 E0014184 E600FFE0 */ swc1 $f0, -0x20($s0)
/* 32E618 E0014188 44936000 */ mtc1 $s3, $f12
/* 32E61C E001418C 00000000 */ nop
/* 32E620 E0014190 46806320 */ cvt.s.w $f12, $f12
/* 32E624 E0014194 2673002D */ addiu $s3, $s3, 0x2D
/* 32E628 E0014198 C7A8007C */ lwc1 $f8, 0x7C($sp)
/* 32E62C E001419C 44820000 */ mtc1 $v0, $f0
/* 32E630 E00141A0 00000000 */ nop
/* 32E634 E00141A4 46800020 */ cvt.s.w $f0, $f0
/* 32E638 E00141A8 E600FFE4 */ swc1 $f0, -0x1C($s0)
/* 32E63C E00141AC 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 32E640 E00141B0 44810000 */ mtc1 $at, $f0
/* 32E644 E00141B4 3C01BCA3 */ lui $at, (0xBCA3D70A >> 16)
/* 32E648 E00141B8 3421D70A */ ori $at, $at, (0xBCA3D70A & 0xFFFF)
/* 32E64C E00141BC 44811000 */ mtc1 $at, $f2
/* 32E650 E00141C0 3C013851 */ lui $at, (0x3851B717 >> 16)
/* 32E654 E00141C4 3421B717 */ ori $at, $at, (0x3851B717 & 0xFFFF)
/* 32E658 E00141C8 44812000 */ mtc1 $at, $f4
/* 32E65C E00141CC 3C01C079 */ lui $at, (0xC079999A >> 16)
/* 32E660 E00141D0 3421999A */ ori $at, $at, (0xC079999A & 0xFFFF)
/* 32E664 E00141D4 44813000 */ mtc1 $at, $f6
/* 32E668 E00141D8 2402001E */ addiu $v0, $zero, 0x1E
/* 32E66C E00141DC A602FFBE */ sh $v0, -0x42($s0)
/* 32E670 E00141E0 460C4300 */ add.s $f12, $f8, $f12
/* 32E674 E00141E4 E600FFEC */ swc1 $f0, -0x14($s0)
/* 32E678 E00141E8 E602FFF0 */ swc1 $f2, -0x10($s0)
/* 32E67C E00141EC E604FFF4 */ swc1 $f4, -0xC($s0)
/* 32E680 E00141F0 0C08013C */ jal shim_clamp_angle
/* 32E684 E00141F4 E606FFE8 */ swc1 $f6, -0x18($s0)
/* 32E688 E00141F8 46000506 */ mov.s $f20, $f0
/* 32E68C E00141FC 0C080140 */ jal shim_sin_deg
/* 32E690 E0014200 4600A306 */ mov.s $f12, $f20
/* 32E694 E0014204 4600A306 */ mov.s $f12, $f20
/* 32E698 E0014208 0C080144 */ jal shim_cos_deg
/* 32E69C E001420C E600FFFC */ swc1 $f0, -0x4($s0)
/* 32E6A0 E0014210 E6000000 */ swc1 $f0, 0x0($s0)
/* 32E6A4 E0014214 0254102A */ slt $v0, $s2, $s4
/* 32E6A8 E0014218 1440FFB2 */ bnez $v0, .LE00140E4
/* 32E6AC E001421C 2610004C */ addiu $s0, $s0, 0x4C
.LE0014220:
/* 32E6B0 E0014220 8FBF003C */ lw $ra, 0x3C($sp)
/* 32E6B4 E0014224 8FB40038 */ lw $s4, 0x38($sp)
/* 32E6B8 E0014228 8FB30034 */ lw $s3, 0x34($sp)
/* 32E6BC E001422C 8FB20030 */ lw $s2, 0x30($sp)
/* 32E6C0 E0014230 8FB1002C */ lw $s1, 0x2C($sp)
/* 32E6C4 E0014234 8FB00028 */ lw $s0, 0x28($sp)
/* 32E6C8 E0014238 D7BE0068 */ ldc1 $f30, 0x68($sp)
/* 32E6CC E001423C D7BC0060 */ ldc1 $f28, 0x60($sp)
/* 32E6D0 E0014240 D7BA0058 */ ldc1 $f26, 0x58($sp)
/* 32E6D4 E0014244 D7B80050 */ ldc1 $f24, 0x50($sp)
/* 32E6D8 E0014248 D7B60048 */ ldc1 $f22, 0x48($sp)
/* 32E6DC E001424C D7B40040 */ ldc1 $f20, 0x40($sp)
/* 32E6E0 E0014250 03E00008 */ jr $ra
/* 32E6E4 E0014254 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void cloud_puff_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
EffectInstance* effect;
f32 temp_f20;
CloudPuffFXData* part;
s32 numParts = 8;
s32 i;
bp.unk_00 = 0;
bp.init = cloud_puff_init;
bp.update = cloud_puff_update;
bp.renderWorld = cloud_puff_render;
bp.renderUI = NULL;
bp.effectID = EFFECT_CLOUD_PUFF;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
part = shim_general_heap_malloc(numParts * sizeof(*part));
effect->data.cloudPuff = part;
ASSERT(effect->data.cloudPuff != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
for (i = 0; i < numParts; i++, part++) {
part->alive = TRUE;
part->unk_40 = 0;
part->unk_0C = arg0;
part->unk_10 = arg1;
part->unk_14 = arg2;
part->unk_18 = 1.0f;
part->unk_1C = 1.0f;
part->unk_20 = 1.0f;
part->alpha = 255;
part->unk_24 = (shim_rand_int(10) * 0.03) + 1.0;
part->unk_28 = (shim_rand_int(10) * 0.03) + 1.7;
part->unk_2C = effect_rand_int(60);
part->timeLeft = 30;
part->unk_34 = 0.5f;
part->unk_38 = -0.02f;
part->unk_3C = 0.00005f;
part->unk_30 = -3.9f;
temp_f20 = shim_clamp_angle(arg3 + i * 45);
part->unk_44 = shim_sin_deg(temp_f20);
part->unk_48 = shim_cos_deg(temp_f20);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel entity_raycast_down
/* A8CE8 801125E8 27BDFF70 */ addiu $sp, $sp, -0x90
/* A8CEC 801125EC AFBE0078 */ sw $fp, 0x78($sp)
/* A8CF0 801125F0 8FBE00A0 */ lw $fp, 0xA0($sp)
/* A8CF4 801125F4 AFB60070 */ sw $s6, 0x70($sp)
/* A8CF8 801125F8 8FB600A4 */ lw $s6, 0xA4($sp)
/* A8CFC 801125FC 3C0146FF */ lui $at, (0x46FFFE00 >> 16)
/* A8D00 80112600 3421FE00 */ ori $at, $at, (0x46FFFE00 & 0xFFFF)
/* A8D04 80112604 44810000 */ mtc1 $at, $f0
/* A8D08 80112608 AFB5006C */ sw $s5, 0x6C($sp)
/* A8D0C 8011260C 0080A82D */ daddu $s5, $a0, $zero
/* A8D10 80112610 AFB30064 */ sw $s3, 0x64($sp)
/* A8D14 80112614 00A0982D */ daddu $s3, $a1, $zero
/* A8D18 80112618 AFB40068 */ sw $s4, 0x68($sp)
/* A8D1C 8011261C 00C0A02D */ daddu $s4, $a2, $zero
/* A8D20 80112620 AFB70074 */ sw $s7, 0x74($sp)
/* A8D24 80112624 00E0B82D */ daddu $s7, $a3, $zero
/* A8D28 80112628 AFB1005C */ sw $s1, 0x5C($sp)
/* A8D2C 8011262C 2411FFFF */ addiu $s1, $zero, -0x1
/* A8D30 80112630 F7B40080 */ sdc1 $f20, 0x80($sp)
/* A8D34 80112634 4480A000 */ mtc1 $zero, $f20
/* A8D38 80112638 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* A8D3C 8011263C 44811000 */ mtc1 $at, $f2
/* A8D40 80112640 27A20038 */ addiu $v0, $sp, 0x38
/* A8D44 80112644 AFBF007C */ sw $ra, 0x7C($sp)
/* A8D48 80112648 AFB20060 */ sw $s2, 0x60($sp)
/* A8D4C 8011264C AFB00058 */ sw $s0, 0x58($sp)
/* A8D50 80112650 F7B60088 */ sdc1 $f22, 0x88($sp)
/* A8D54 80112654 E7A00044 */ swc1 $f0, 0x44($sp)
/* A8D58 80112658 E6C00000 */ swc1 $f0, 0x0($s6)
/* A8D5C 8011265C AFA20018 */ sw $v0, 0x18($sp)
/* A8D60 80112660 27A2003C */ addiu $v0, $sp, 0x3C
/* A8D64 80112664 AFA2001C */ sw $v0, 0x1C($sp)
/* A8D68 80112668 27A20040 */ addiu $v0, $sp, 0x40
/* A8D6C 8011266C AFA20020 */ sw $v0, 0x20($sp)
/* A8D70 80112670 27A20044 */ addiu $v0, $sp, 0x44
/* A8D74 80112674 AFA20024 */ sw $v0, 0x24($sp)
/* A8D78 80112678 27A20048 */ addiu $v0, $sp, 0x48
/* A8D7C 8011267C AFA20028 */ sw $v0, 0x28($sp)
/* A8D80 80112680 27A2004C */ addiu $v0, $sp, 0x4C
/* A8D84 80112684 AFA2002C */ sw $v0, 0x2C($sp)
/* A8D88 80112688 27A20050 */ addiu $v0, $sp, 0x50
/* A8D8C 8011268C E7A20010 */ swc1 $f2, 0x10($sp)
/* A8D90 80112690 E7B40014 */ swc1 $f20, 0x14($sp)
/* A8D94 80112694 AFA20030 */ sw $v0, 0x30($sp)
/* A8D98 80112698 C6AC0000 */ lwc1 $f12, 0x0($s5)
/* A8D9C 8011269C C66E0000 */ lwc1 $f14, 0x0($s3)
/* A8DA0 801126A0 8E860000 */ lw $a2, 0x0($s4)
/* A8DA4 801126A4 4407A000 */ mfc1 $a3, $f20
/* A8DA8 801126A8 0C017512 */ jal test_ray_entities
/* A8DAC 801126AC 0000902D */ daddu $s2, $zero, $zero
/* A8DB0 801126B0 0040802D */ daddu $s0, $v0, $zero
/* A8DB4 801126B4 06000019 */ bltz $s0, .L8011271C
/* A8DB8 801126B8 00000000 */ nop
/* A8DBC 801126BC 0C0441A9 */ jal get_entity_type
/* A8DC0 801126C0 0200202D */ daddu $a0, $s0, $zero
/* A8DC4 801126C4 2403000C */ addiu $v1, $zero, 0xC
/* A8DC8 801126C8 54430014 */ bnel $v0, $v1, .L8011271C
/* A8DCC 801126CC 36114000 */ ori $s1, $s0, 0x4000
/* A8DD0 801126D0 C7A00048 */ lwc1 $f0, 0x48($sp)
/* A8DD4 801126D4 46140032 */ c.eq.s $f0, $f20
/* A8DD8 801126D8 00000000 */ nop
/* A8DDC 801126DC 4500000F */ bc1f .L8011271C
/* A8DE0 801126E0 00000000 */ nop
/* A8DE4 801126E4 C7A00050 */ lwc1 $f0, 0x50($sp)
/* A8DE8 801126E8 46140032 */ c.eq.s $f0, $f20
/* A8DEC 801126EC 00000000 */ nop
/* A8DF0 801126F0 4500000A */ bc1f .L8011271C
/* A8DF4 801126F4 00000000 */ nop
/* A8DF8 801126F8 C7A0004C */ lwc1 $f0, 0x4C($sp)
/* A8DFC 801126FC 3C013FF0 */ lui $at, (0x3FF00000 >> 16)
/* A8E00 80112700 44811800 */ mtc1 $at, $f3
/* A8E04 80112704 44801000 */ mtc1 $zero, $f2
/* A8E08 80112708 46000021 */ cvt.d.s $f0, $f0
/* A8E0C 8011270C 46220032 */ c.eq.d $f0, $f2
/* A8E10 80112710 00000000 */ nop
/* A8E14 80112714 45030001 */ bc1tl .L8011271C
/* A8E18 80112718 36114000 */ ori $s1, $s0, 0x4000
.L8011271C:
/* A8E1C 8011271C 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* A8E20 80112720 44810000 */ mtc1 $at, $f0
/* A8E24 80112724 27A20038 */ addiu $v0, $sp, 0x38
/* A8E28 80112728 AFA2001C */ sw $v0, 0x1C($sp)
/* A8E2C 8011272C 27A2003C */ addiu $v0, $sp, 0x3C
/* A8E30 80112730 AFA20020 */ sw $v0, 0x20($sp)
/* A8E34 80112734 27A20040 */ addiu $v0, $sp, 0x40
/* A8E38 80112738 AFA20024 */ sw $v0, 0x24($sp)
/* A8E3C 8011273C 27A20044 */ addiu $v0, $sp, 0x44
/* A8E40 80112740 AFA20028 */ sw $v0, 0x28($sp)
/* A8E44 80112744 27A20048 */ addiu $v0, $sp, 0x48
/* A8E48 80112748 AFA2002C */ sw $v0, 0x2C($sp)
/* A8E4C 8011274C 27A2004C */ addiu $v0, $sp, 0x4C
/* A8E50 80112750 AFA20030 */ sw $v0, 0x30($sp)
/* A8E54 80112754 27A20050 */ addiu $v0, $sp, 0x50
/* A8E58 80112758 AFA00010 */ sw $zero, 0x10($sp)
/* A8E5C 8011275C AFA00018 */ sw $zero, 0x18($sp)
/* A8E60 80112760 AFA20034 */ sw $v0, 0x34($sp)
/* A8E64 80112764 E7A00014 */ swc1 $f0, 0x14($sp)
/* A8E68 80112768 8E660000 */ lw $a2, 0x0($s3)
/* A8E6C 8011276C 8E870000 */ lw $a3, 0x0($s4)
/* A8E70 80112770 8EA50000 */ lw $a1, 0x0($s5)
/* A8E74 80112774 0C017334 */ jal test_ray_colliders
/* A8E78 80112778 3C040001 */ lui $a0, (0x10000 >> 16)
/* A8E7C 8011277C 04430001 */ bgezl $v0, .L80112784
/* A8E80 80112780 0040882D */ daddu $s1, $v0, $zero
.L80112784:
/* A8E84 80112784 06220025 */ bltzl $s1, .L8011281C
/* A8E88 80112788 AEE00000 */ sw $zero, 0x0($s7)
/* A8E8C 8011278C C7A00044 */ lwc1 $f0, 0x44($sp)
/* A8E90 80112790 3C0142C8 */ lui $at, (0x42C80000 >> 16)
/* A8E94 80112794 4481A000 */ mtc1 $at, $f20
/* A8E98 80112798 E6C00000 */ swc1 $f0, 0x0($s6)
/* A8E9C 8011279C C7A0003C */ lwc1 $f0, 0x3C($sp)
/* A8EA0 801127A0 E6600000 */ swc1 $f0, 0x0($s3)
/* A8EA4 801127A4 C7A00050 */ lwc1 $f0, 0x50($sp)
/* A8EA8 801127A8 46140002 */ mul.s $f0, $f0, $f20
/* A8EAC 801127AC 00000000 */ nop
/* A8EB0 801127B0 44060000 */ mfc1 $a2, $f0
/* A8EB4 801127B4 C7A0004C */ lwc1 $f0, 0x4C($sp)
/* A8EB8 801127B8 46140002 */ mul.s $f0, $f0, $f20
/* A8EBC 801127BC 00000000 */ nop
/* A8EC0 801127C0 4480B000 */ mtc1 $zero, $f22
/* A8EC4 801127C4 00000000 */ nop
/* A8EC8 801127C8 4600B306 */ mov.s $f12, $f22
/* A8ECC 801127CC 44070000 */ mfc1 $a3, $f0
/* A8ED0 801127D0 0C00A720 */ jal atan2
/* A8ED4 801127D4 4600B386 */ mov.s $f14, $f22
/* A8ED8 801127D8 46000007 */ neg.s $f0, $f0
/* A8EDC 801127DC E6E00000 */ swc1 $f0, 0x0($s7)
/* A8EE0 801127E0 C7A00048 */ lwc1 $f0, 0x48($sp)
/* A8EE4 801127E4 46140002 */ mul.s $f0, $f0, $f20
/* A8EE8 801127E8 00000000 */ nop
/* A8EEC 801127EC 44060000 */ mfc1 $a2, $f0
/* A8EF0 801127F0 C7A0004C */ lwc1 $f0, 0x4C($sp)
/* A8EF4 801127F4 46140002 */ mul.s $f0, $f0, $f20
/* A8EF8 801127F8 00000000 */ nop
/* A8EFC 801127FC 24120001 */ addiu $s2, $zero, 0x1
/* A8F00 80112800 4600B306 */ mov.s $f12, $f22
/* A8F04 80112804 44070000 */ mfc1 $a3, $f0
/* A8F08 80112808 0C00A720 */ jal atan2
/* A8F0C 8011280C 46006386 */ mov.s $f14, $f12
/* A8F10 80112810 46000007 */ neg.s $f0, $f0
/* A8F14 80112814 08044A08 */ j .L80112820
/* A8F18 80112818 E7C00000 */ swc1 $f0, 0x0($fp)
.L8011281C:
/* A8F1C 8011281C AFC00000 */ sw $zero, 0x0($fp)
.L80112820:
/* A8F20 80112820 0240102D */ daddu $v0, $s2, $zero
/* A8F24 80112824 8FBF007C */ lw $ra, 0x7C($sp)
/* A8F28 80112828 8FBE0078 */ lw $fp, 0x78($sp)
/* A8F2C 8011282C 8FB70074 */ lw $s7, 0x74($sp)
/* A8F30 80112830 8FB60070 */ lw $s6, 0x70($sp)
/* A8F34 80112834 8FB5006C */ lw $s5, 0x6C($sp)
/* A8F38 80112838 8FB40068 */ lw $s4, 0x68($sp)
/* A8F3C 8011283C 8FB30064 */ lw $s3, 0x64($sp)
/* A8F40 80112840 8FB20060 */ lw $s2, 0x60($sp)
/* A8F44 80112844 8FB1005C */ lw $s1, 0x5C($sp)
/* A8F48 80112848 8FB00058 */ lw $s0, 0x58($sp)
/* A8F4C 8011284C D7B60088 */ ldc1 $f22, 0x88($sp)
/* A8F50 80112850 D7B40080 */ ldc1 $f20, 0x80($sp)
/* A8F54 80112854 03E00008 */ jr $ra
/* A8F58 80112858 27BD0090 */ addiu $sp, $sp, 0x90
### DECOMPILED C INSTRUCTIONS:
if (!entity_raycast_down(&rayX, &rayY, &rayZ, &hitYaw, &hitPitch, &hitLength) && hitLength == 32767.0f) {
hitLength = 0.0f;
}
origHitLength = hitLength;
if (shadow->flags & ENTITY_FLAG_FIXED_SHADOW_SIZE) {
hitLength = 212.5f;
shadow->scale.x = entity->aabb.x / hitLength;
shadow->scale.z = entity->aabb.z / hitLength;
} else {
hitLength = ((hitLength / 150.0f) + 0.95) * 250.0;
shadow->scale.x = (entity->aabb.x / hitLength) * entity->scale.x;
shadow->scale.z = (entity->aabb.z / hitLength) * entity->scale.z;
}
shadow->position.x = entity->position.x;
shadow->position.z = entity->position.z;
shadow->position.y = rayY;
entity->shadowPosY = rayY;
shadow->rotation.x = hitYaw;
shadow->rotation.z = hitPitch;
shadow->rotation.y = entity->rotation.y;
if (entity->position.y < rayY) {
shadow->flags |= ENTITY_FLAG_SKIP_UPDATE;
entity->position.y = rayY + 10.0f;
} else {
shadow->flags &= ~ENTITY_FLAG_SKIP_UPDATE;
}
shadow->flags = (shadow->flags & ~ENTITY_FLAG_HIDDEN) | ((u16)entity->flags & ENTITY_FLAG_HIDDEN);
if (!(entity->flags & ENTITY_FLAG_400) && origHitLength == 0.0f) {
shadow->flags |= ENTITY_FLAG_HIDDEN;
}
} else {
entity->shadowPosY = 0.0f;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel set_part_goal_to_actor_part
/* 1982B8 802699D8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1982BC 802699DC 00A0202D */ daddu $a0, $a1, $zero
/* 1982C0 802699E0 AFB20018 */ sw $s2, 0x18($sp)
/* 1982C4 802699E4 00C0902D */ daddu $s2, $a2, $zero
/* 1982C8 802699E8 AFB00010 */ sw $s0, 0x10($sp)
/* 1982CC 802699EC 30900700 */ andi $s0, $a0, 0x700
/* 1982D0 802699F0 AFBF001C */ sw $ra, 0x1C($sp)
/* 1982D4 802699F4 0C09A75B */ jal get_actor
/* 1982D8 802699F8 AFB10014 */ sw $s1, 0x14($sp)
/* 1982DC 802699FC 0040882D */ daddu $s1, $v0, $zero
/* 1982E0 80269A00 24020100 */ addiu $v0, $zero, 0x100
/* 1982E4 80269A04 12020028 */ beq $s0, $v0, .L80269AA8
/* 1982E8 80269A08 2A020101 */ slti $v0, $s0, 0x101
/* 1982EC 80269A0C 50400005 */ beql $v0, $zero, .L80269A24
/* 1982F0 80269A10 24020200 */ addiu $v0, $zero, 0x200
/* 1982F4 80269A14 12000007 */ beqz $s0, .L80269A34
/* 1982F8 80269A18 0220202D */ daddu $a0, $s1, $zero
/* 1982FC 80269A1C 0809A703 */ j .L80269C0C
/* 198300 80269A20 00000000 */ nop
.L80269A24:
/* 198304 80269A24 12020021 */ beq $s0, $v0, .L80269AAC
/* 198308 80269A28 0220202D */ daddu $a0, $s1, $zero
/* 19830C 80269A2C 0809A703 */ j .L80269C0C
/* 198310 80269A30 00000000 */ nop
.L80269A34:
/* 198314 80269A34 0C099117 */ jal get_actor_part
/* 198318 80269A38 0000282D */ daddu $a1, $zero, $zero
/* 19831C 80269A3C 0040202D */ daddu $a0, $v0, $zero
/* 198320 80269A40 84820014 */ lh $v0, 0x14($a0)
/* 198324 80269A44 C6220188 */ lwc1 $f2, 0x188($s1)
/* 198328 80269A48 44820000 */ mtc1 $v0, $f0
/* 19832C 80269A4C 00000000 */ nop
/* 198330 80269A50 46800020 */ cvt.s.w $f0, $f0
/* 198334 80269A54 46020002 */ mul.s $f0, $f0, $f2
/* 198338 80269A58 00000000 */ nop
/* 19833C 80269A5C C6220144 */ lwc1 $f2, 0x144($s1)
/* 198340 80269A60 46001080 */ add.s $f2, $f2, $f0
/* 198344 80269A64 8C820010 */ lw $v0, 0x10($a0)
/* 198348 80269A68 E442000C */ swc1 $f2, 0xC($v0)
/* 19834C 80269A6C 84820016 */ lh $v0, 0x16($a0)
/* 198350 80269A70 C6220188 */ lwc1 $f2, 0x188($s1)
/* 198354 80269A74 44820000 */ mtc1 $v0, $f0
/* 198358 80269A78 00000000 */ nop
/* 19835C 80269A7C 46800020 */ cvt.s.w $f0, $f0
/* 198360 80269A80 46020002 */ mul.s $f0, $f0, $f2
/* 198364 80269A84 00000000 */ nop
/* 198368 80269A88 C6220148 */ lwc1 $f2, 0x148($s1)
/* 19836C 80269A8C 46001080 */ add.s $f2, $f2, $f0
/* 198370 80269A90 8C820010 */ lw $v0, 0x10($a0)
/* 198374 80269A94 E4420010 */ swc1 $f2, 0x10($v0)
/* 198378 80269A98 8C820010 */ lw $v0, 0x10($a0)
/* 19837C 80269A9C C620014C */ lwc1 $f0, 0x14C($s1)
/* 198380 80269AA0 0809A703 */ j .L80269C0C
/* 198384 80269AA4 E4400014 */ swc1 $f0, 0x14($v0)
.L80269AA8:
/* 198388 80269AA8 0220202D */ daddu $a0, $s1, $zero
.L80269AAC:
/* 19838C 80269AAC 0C099117 */ jal get_actor_part
/* 198390 80269AB0 0240282D */ daddu $a1, $s2, $zero
/* 198394 80269AB4 0040202D */ daddu $a0, $v0, $zero
/* 198398 80269AB8 8C820000 */ lw $v0, 0x0($a0)
/* 19839C 80269ABC 3C030010 */ lui $v1, (0x100000 >> 16)
/* 1983A0 80269AC0 00431024 */ and $v0, $v0, $v1
/* 1983A4 80269AC4 1440002D */ bnez $v0, .L80269B7C
/* 1983A8 80269AC8 00000000 */ nop
/* 1983AC 80269ACC 84820014 */ lh $v0, 0x14($a0)
/* 1983B0 80269AD0 8483006C */ lh $v1, 0x6C($a0)
/* 1983B4 80269AD4 C6220188 */ lwc1 $f2, 0x188($s1)
/* 1983B8 80269AD8 00431021 */ addu $v0, $v0, $v1
/* 1983BC 80269ADC 44820000 */ mtc1 $v0, $f0
/* 1983C0 80269AE0 00000000 */ nop
/* 1983C4 80269AE4 46800020 */ cvt.s.w $f0, $f0
/* 1983C8 80269AE8 46020002 */ mul.s $f0, $f0, $f2
/* 1983CC 80269AEC 00000000 */ nop
/* 1983D0 80269AF0 C6220144 */ lwc1 $f2, 0x144($s1)
/* 1983D4 80269AF4 46001080 */ add.s $f2, $f2, $f0
/* 1983D8 80269AF8 8C820010 */ lw $v0, 0x10($a0)
/* 1983DC 80269AFC E442000C */ swc1 $f2, 0xC($v0)
/* 1983E0 80269B00 8E220000 */ lw $v0, 0x0($s1)
/* 1983E4 80269B04 30420800 */ andi $v0, $v0, 0x800
/* 1983E8 80269B08 14400006 */ bnez $v0, .L80269B24
/* 1983EC 80269B0C 00000000 */ nop
/* 1983F0 80269B10 84820016 */ lh $v0, 0x16($a0)
/* 1983F4 80269B14 8483006E */ lh $v1, 0x6E($a0)
/* 1983F8 80269B18 C6220188 */ lwc1 $f2, 0x188($s1)
/* 1983FC 80269B1C 0809A6CE */ j .L80269B38
/* 198400 80269B20 00431021 */ addu $v0, $v0, $v1
.L80269B24:
/* 198404 80269B24 84820016 */ lh $v0, 0x16($a0)
/* 198408 80269B28 8483006E */ lh $v1, 0x6E($a0)
/* 19840C 80269B2C C6220188 */ lwc1 $f2, 0x188($s1)
/* 198410 80269B30 00021023 */ negu $v0, $v0
/* 198414 80269B34 00431023 */ subu $v0, $v0, $v1
.L80269B38:
/* 198418 80269B38 44820000 */ mtc1 $v0, $f0
/* 19841C 80269B3C 00000000 */ nop
/* 198420 80269B40 46800020 */ cvt.s.w $f0, $f0
/* 198424 80269B44 46020002 */ mul.s $f0, $f0, $f2
/* 198428 80269B48 00000000 */ nop
/* 19842C 80269B4C C6220148 */ lwc1 $f2, 0x148($s1)
/* 198430 80269B50 46001080 */ add.s $f2, $f2, $f0
/* 198434 80269B54 8C820010 */ lw $v0, 0x10($a0)
/* 198438 80269B58 E4420010 */ swc1 $f2, 0x10($v0)
/* 19843C 80269B5C 84820018 */ lh $v0, 0x18($a0)
/* 198440 80269B60 C620014C */ lwc1 $f0, 0x14C($s1)
/* 198444 80269B64 44821000 */ mtc1 $v0, $f2
/* 198448 80269B68 00000000 */ nop
/* 19844C 80269B6C 468010A0 */ cvt.s.w $f2, $f2
/* 198450 80269B70 8C820010 */ lw $v0, 0x10($a0)
/* 198454 80269B74 0809A702 */ j .L80269C08
/* 198458 80269B78 46020000 */ add.s $f0, $f0, $f2
.L80269B7C:
/* 19845C 80269B7C 8482006C */ lh $v0, 0x6C($a0)
/* 198460 80269B80 C480002C */ lwc1 $f0, 0x2C($a0)
/* 198464 80269B84 44821000 */ mtc1 $v0, $f2
/* 198468 80269B88 00000000 */ nop
/* 19846C 80269B8C 468010A0 */ cvt.s.w $f2, $f2
/* 198470 80269B90 46020000 */ add.s $f0, $f0, $f2
/* 198474 80269B94 8C820010 */ lw $v0, 0x10($a0)
/* 198478 80269B98 E440000C */ swc1 $f0, 0xC($v0)
/* 19847C 80269B9C 8E220000 */ lw $v0, 0x0($s1)
/* 198480 80269BA0 30420800 */ andi $v0, $v0, 0x800
/* 198484 80269BA4 1440000B */ bnez $v0, .L80269BD4
/* 198488 80269BA8 00000000 */ nop
/* 19848C 80269BAC 8482006E */ lh $v0, 0x6E($a0)
/* 198490 80269BB0 C6220188 */ lwc1 $f2, 0x188($s1)
/* 198494 80269BB4 44820000 */ mtc1 $v0, $f0
/* 198498 80269BB8 00000000 */ nop
/* 19849C 80269BBC 46800020 */ cvt.s.w $f0, $f0
/* 1984A0 80269BC0 46020002 */ mul.s $f0, $f0, $f2
/* 1984A4 80269BC4 00000000 */ nop
/* 1984A8 80269BC8 C4820030 */ lwc1 $f2, 0x30($a0)
/* 1984AC 80269BCC 0809A6FE */ j .L80269BF8
/* 1984B0 80269BD0 46001080 */ add.s $f2, $f2, $f0
.L80269BD4:
/* 1984B4 80269BD4 8482006E */ lh $v0, 0x6E($a0)
/* 1984B8 80269BD8 C6220188 */ lwc1 $f2, 0x188($s1)
/* 1984BC 80269BDC 44820000 */ mtc1 $v0, $f0
/* 1984C0 80269BE0 00000000 */ nop
/* 1984C4 80269BE4 46800020 */ cvt.s.w $f0, $f0
/* 1984C8 80269BE8 46020002 */ mul.s $f0, $f0, $f2
/* 1984CC 80269BEC 00000000 */ nop
/* 1984D0 80269BF0 C4820030 */ lwc1 $f2, 0x30($a0)
/* 1984D4 80269BF4 46001081 */ sub.s $f2, $f2, $f0
.L80269BF8:
/* 1984D8 80269BF8 8C820010 */ lw $v0, 0x10($a0)
/* 1984DC 80269BFC E4420010 */ swc1 $f2, 0x10($v0)
/* 1984E0 80269C00 8C820010 */ lw $v0, 0x10($a0)
/* 1984E4 80269C04 C4800034 */ lwc1 $f0, 0x34($a0)
.L80269C08:
/* 1984E8 80269C08 E4400014 */ swc1 $f0, 0x14($v0)
.L80269C0C:
/* 1984EC 80269C0C 8FBF001C */ lw $ra, 0x1C($sp)
/* 1984F0 80269C10 8FB20018 */ lw $s2, 0x18($sp)
/* 1984F4 80269C14 8FB10014 */ lw $s1, 0x14($sp)
/* 1984F8 80269C18 8FB00010 */ lw $s0, 0x10($sp)
/* 1984FC 80269C1C 03E00008 */ jr $ra
/* 198500 80269C20 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void set_part_goal_to_actor_part(ActorPartMovement* movement, s32 actorID, s32 partID) {
s32 actorClass = actorID & ACTOR_CLASS_MASK;
Actor* actor = get_actor(actorID);
ActorPart* part;
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
part = get_actor_part(actor, 0);
part->movement->goalPos.x = actor->currentPos.x + part->partOffset.x * actor->scalingFactor;
part->movement->goalPos.y = actor->currentPos.y + part->partOffset.y * actor->scalingFactor;
part->movement->goalPos.z = actor->currentPos.z;
break;
case ACTOR_CLASS_PARTNER:
case ACTOR_CLASS_ENEMY:
part = get_actor_part(actor, partID);
if (!(part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) {
part->movement->goalPos.x = actor->currentPos.x + (part->partOffset.x + part->targetOffset.x) * actor->scalingFactor;
if (!(actor->flags & ACTOR_PART_FLAG_800)) {
part->movement->goalPos.y = actor->currentPos.y + (part->partOffset.y + part->targetOffset.y) * actor->scalingFactor;
} else {
part->movement->goalPos.y = actor->currentPos.y + (-part->partOffset.y - part->targetOffset.y) * actor->scalingFactor;
}
part->movement->goalPos.z = actor->currentPos.z + part->partOffset.z;
} else {
part->movement->goalPos.x = part->absolutePosition.x + part->targetOffset.x;
if (!(actor->flags & ACTOR_PART_FLAG_800)) {
part->movement->goalPos.y = part->absolutePosition.y + part->targetOffset.y * actor->scalingFactor;
} else {
part->movement->goalPos.y = part->absolutePosition.y - part->targetOffset.y * actor->scalingFactor;
}
part->movement->goalPos.z = part->absolutePosition.z;
}
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel debuff_update
/* 364520 E0062220 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 364524 E0062224 AFB3001C */ sw $s3, 0x1C($sp)
/* 364528 E0062228 0080982D */ daddu $s3, $a0, $zero
/* 36452C E006222C AFBF0020 */ sw $ra, 0x20($sp)
/* 364530 E0062230 AFB20018 */ sw $s2, 0x18($sp)
/* 364534 E0062234 AFB10014 */ sw $s1, 0x14($sp)
/* 364538 E0062238 AFB00010 */ sw $s0, 0x10($sp)
/* 36453C E006223C F7B80038 */ sdc1 $f24, 0x38($sp)
/* 364540 E0062240 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 364544 E0062244 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 364548 E0062248 8E64000C */ lw $a0, 0xC($s3)
/* 36454C E006224C 8C820028 */ lw $v0, 0x28($a0)
/* 364550 E0062250 8C830024 */ lw $v1, 0x24($a0)
/* 364554 E0062254 24420001 */ addiu $v0, $v0, 0x1
/* 364558 E0062258 2463FFFF */ addiu $v1, $v1, -0x1
/* 36455C E006225C AC820028 */ sw $v0, 0x28($a0)
/* 364560 E0062260 04610005 */ bgez $v1, .LE0062278
/* 364564 E0062264 AC830024 */ sw $v1, 0x24($a0)
/* 364568 E0062268 0C080128 */ jal shim_remove_effect
/* 36456C E006226C 0260202D */ daddu $a0, $s3, $zero
/* 364570 E0062270 08018920 */ j .LE0062480
/* 364574 E0062274 00000000 */ nop
.LE0062278:
/* 364578 E0062278 8C920028 */ lw $s2, 0x28($a0)
/* 36457C E006227C 2A42000B */ slti $v0, $s2, 0xB
/* 364580 E0062280 14400009 */ bnez $v0, .LE00622A8
/* 364584 E0062284 00000000 */ nop
/* 364588 E0062288 3C01E006 */ lui $at, (0xE00628D0 >> 16)
/* 36458C E006228C D42228D0 */ ldc1 $f2, (0xE00628D0 & 0xFFFF)($at)
/* 364590 E0062290 C4800034 */ lwc1 $f0, 0x34($a0)
/* 364594 E0062294 46800021 */ cvt.d.w $f0, $f0
/* 364598 E0062298 46220002 */ mul.d $f0, $f0, $f2
/* 36459C E006229C 00000000 */ nop
/* 3645A0 E00622A0 4620038D */ trunc.w.d $f14, $f0
/* 3645A4 E00622A4 E48E0034 */ swc1 $f14, 0x34($a0)
.LE00622A8:
/* 3645A8 E00622A8 8E620008 */ lw $v0, 0x8($s3)
/* 3645AC E00622AC 24110001 */ addiu $s1, $zero, 0x1
/* 3645B0 E00622B0 0222102A */ slt $v0, $s1, $v0
/* 3645B4 E00622B4 10400072 */ beqz $v0, .LE0062480
/* 3645B8 E00622B8 24840040 */ addiu $a0, $a0, 0x40
/* 3645BC E00622BC 24900008 */ addiu $s0, $a0, 0x8
/* 3645C0 E00622C0 3C01E006 */ lui $at, (0xE00628D8 >> 16)
/* 3645C4 E00622C4 D43428D8 */ ldc1 $f20, (0xE00628D8 & 0xFFFF)($at)
/* 3645C8 E00622C8 3C01E006 */ lui $at, (0xE00628E0 >> 16)
/* 3645CC E00622CC D43628E0 */ ldc1 $f22, (0xE00628E0 & 0xFFFF)($at)
/* 3645D0 E00622D0 3C0142B4 */ lui $at, (0x42B40000 >> 16)
/* 3645D4 E00622D4 4481C000 */ mtc1 $at, $f24
.LE00622D8:
/* 3645D8 E00622D8 2A42000B */ slti $v0, $s2, 0xB
/* 3645DC E00622DC 1440002B */ bnez $v0, .LE006238C
/* 3645E0 E00622E0 2A42000A */ slti $v0, $s2, 0xA
/* 3645E4 E00622E4 C60A0014 */ lwc1 $f10, 0x14($s0)
/* 3645E8 E00622E8 3C013FF0 */ lui $at, (0x3FF00000 >> 16)
/* 3645EC E00622EC 44816800 */ mtc1 $at, $f13
/* 3645F0 E00622F0 44806000 */ mtc1 $zero, $f12
/* 3645F4 E00622F4 460052A1 */ cvt.d.s $f10, $f10
/* 3645F8 E00622F8 462A6301 */ sub.d $f12, $f12, $f10
/* 3645FC E00622FC 46346302 */ mul.d $f12, $f12, $f20
/* 364600 E0062300 00000000 */ nop
/* 364604 E0062304 C6080018 */ lwc1 $f8, 0x18($s0)
/* 364608 E0062308 3C014019 */ lui $at, (0x4019999A >> 16)
/* 36460C E006230C 3421999A */ ori $at, $at, (0x4019999A & 0xFFFF)
/* 364610 E0062310 44812000 */ mtc1 $at, $f4
/* 364614 E0062314 00000000 */ nop
/* 364618 E0062318 46082101 */ sub.s $f4, $f4, $f8
/* 36461C E006231C 46002121 */ cvt.d.s $f4, $f4
/* 364620 E0062320 46342102 */ mul.d $f4, $f4, $f20
/* 364624 E0062324 00000000 */ nop
/* 364628 E0062328 C6060028 */ lwc1 $f6, 0x28($s0)
/* 36462C E006232C 3C0142C8 */ lui $at, (0x42C80000 >> 16)
/* 364630 E0062330 44811000 */ mtc1 $at, $f2
/* 364634 E0062334 00000000 */ nop
/* 364638 E0062338 46061081 */ sub.s $f2, $f2, $f6
/* 36463C E006233C 3C01E006 */ lui $at, (0xE00628E8 >> 16)
/* 364640 E0062340 D42028E8 */ ldc1 $f0, (0xE00628E8 & 0xFFFF)($at)
/* 364644 E0062344 460010A1 */ cvt.d.s $f2, $f2
/* 364648 E0062348 46201082 */ mul.d $f2, $f2, $f0
/* 36464C E006234C 00000000 */ nop
/* 364650 E0062350 3C01E006 */ lui $at, (0xE00628F0 >> 16)
/* 364654 E0062354 D42028F0 */ ldc1 $f0, (0xE00628F0 & 0xFFFF)($at)
/* 364658 E0062358 46201082 */ mul.d $f2, $f2, $f0
/* 36465C E006235C 00000000 */ nop
/* 364660 E0062360 462C5280 */ add.d $f10, $f10, $f12
/* 364664 E0062364 46004221 */ cvt.d.s $f8, $f8
/* 364668 E0062368 46244200 */ add.d $f8, $f8, $f4
/* 36466C E006236C 460031A1 */ cvt.d.s $f6, $f6
/* 364670 E0062370 462052A0 */ cvt.s.d $f10, $f10
/* 364674 E0062374 46204220 */ cvt.s.d $f8, $f8
/* 364678 E0062378 46223180 */ add.d $f6, $f6, $f2
/* 36467C E006237C E60A0014 */ swc1 $f10, 0x14($s0)
/* 364680 E0062380 E6080018 */ swc1 $f8, 0x18($s0)
/* 364684 E0062384 462031A0 */ cvt.s.d $f6, $f6
/* 364688 E0062388 E6060028 */ swc1 $f6, 0x28($s0)
.LE006238C:
/* 36468C E006238C 10400029 */ beqz $v0, .LE0062434
/* 364690 E0062390 00000000 */ nop
/* 364694 E0062394 C60C0014 */ lwc1 $f12, 0x14($s0)
/* 364698 E0062398 3C0140E0 */ lui $at, (0x40E00000 >> 16)
/* 36469C E006239C 44814000 */ mtc1 $at, $f8
/* 3646A0 E00623A0 00000000 */ nop
/* 3646A4 E00623A4 460C4201 */ sub.s $f8, $f8, $f12
/* 3646A8 E00623A8 46004221 */ cvt.d.s $f8, $f8
/* 3646AC E00623AC 46364202 */ mul.d $f8, $f8, $f22
/* 3646B0 E00623B0 00000000 */ nop
/* 3646B4 E00623B4 C60A0018 */ lwc1 $f10, 0x18($s0)
/* 3646B8 E00623B8 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3646BC E00623BC 44812000 */ mtc1 $at, $f4
/* 3646C0 E00623C0 00000000 */ nop
/* 3646C4 E00623C4 460A2101 */ sub.s $f4, $f4, $f10
/* 3646C8 E00623C8 46002121 */ cvt.d.s $f4, $f4
/* 3646CC E00623CC 46342102 */ mul.d $f4, $f4, $f20
/* 3646D0 E00623D0 00000000 */ nop
/* 3646D4 E00623D4 C6060028 */ lwc1 $f6, 0x28($s0)
/* 3646D8 E00623D8 3C014120 */ lui $at, (0x41200000 >> 16)
/* 3646DC E00623DC 44811000 */ mtc1 $at, $f2
/* 3646E0 E00623E0 00000000 */ nop
/* 3646E4 E00623E4 46061081 */ sub.s $f2, $f2, $f6
/* 3646E8 E00623E8 460010A1 */ cvt.d.s $f2, $f2
/* 3646EC E00623EC 46361082 */ mul.d $f2, $f2, $f22
/* 3646F0 E00623F0 00000000 */ nop
/* 3646F4 E00623F4 3C01E006 */ lui $at, (0xE00628F8 >> 16)
/* 3646F8 E00623F8 D42028F8 */ ldc1 $f0, (0xE00628F8 & 0xFFFF)($at)
/* 3646FC E00623FC 46201082 */ mul.d $f2, $f2, $f0
/* 364700 E0062400 00000000 */ nop
/* 364704 E0062404 46006321 */ cvt.d.s $f12, $f12
/* 364708 E0062408 46286300 */ add.d $f12, $f12, $f8
/* 36470C E006240C 460052A1 */ cvt.d.s $f10, $f10
/* 364710 E0062410 46245280 */ add.d $f10, $f10, $f4
/* 364714 E0062414 460031A1 */ cvt.d.s $f6, $f6
/* 364718 E0062418 46206320 */ cvt.s.d $f12, $f12
/* 36471C E006241C 462052A0 */ cvt.s.d $f10, $f10
/* 364720 E0062420 46223180 */ add.d $f6, $f6, $f2
/* 364724 E0062424 E60C0014 */ swc1 $f12, 0x14($s0)
/* 364728 E0062428 E60A0018 */ swc1 $f10, 0x18($s0)
/* 36472C E006242C 462031A0 */ cvt.s.d $f6, $f6
/* 364730 E0062430 E6060028 */ swc1 $f6, 0x28($s0)
.LE0062434:
/* 364734 E0062434 C60C0024 */ lwc1 $f12, 0x24($s0)
/* 364738 E0062438 0C080144 */ jal shim_cos_deg
/* 36473C E006243C 46186300 */ add.s $f12, $f12, $f24
/* 364740 E0062440 C6020028 */ lwc1 $f2, 0x28($s0)
/* 364744 E0062444 46020002 */ mul.s $f0, $f0, $f2
/* 364748 E0062448 00000000 */ nop
/* 36474C E006244C C60C0024 */ lwc1 $f12, 0x24($s0)
/* 364750 E0062450 46186300 */ add.s $f12, $f12, $f24
/* 364754 E0062454 0C080140 */ jal shim_sin_deg
/* 364758 E0062458 E600FFFC */ swc1 $f0, -0x4($s0)
/* 36475C E006245C C6020028 */ lwc1 $f2, 0x28($s0)
/* 364760 E0062460 46020002 */ mul.s $f0, $f0, $f2
/* 364764 E0062464 00000000 */ nop
/* 364768 E0062468 26310001 */ addiu $s1, $s1, 0x1
/* 36476C E006246C E6000000 */ swc1 $f0, 0x0($s0)
/* 364770 E0062470 8E620008 */ lw $v0, 0x8($s3)
/* 364774 E0062474 0222102A */ slt $v0, $s1, $v0
/* 364778 E0062478 1440FF97 */ bnez $v0, .LE00622D8
/* 36477C E006247C 26100040 */ addiu $s0, $s0, 0x40
.LE0062480:
/* 364780 E0062480 8FBF0020 */ lw $ra, 0x20($sp)
/* 364784 E0062484 8FB3001C */ lw $s3, 0x1C($sp)
/* 364788 E0062488 8FB20018 */ lw $s2, 0x18($sp)
/* 36478C E006248C 8FB10014 */ lw $s1, 0x14($sp)
/* 364790 E0062490 8FB00010 */ lw $s0, 0x10($sp)
/* 364794 E0062494 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 364798 E0062498 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 36479C E006249C D7B40028 */ ldc1 $f20, 0x28($sp)
/* 3647A0 E00624A0 03E00008 */ jr $ra
/* 3647A4 E00624A4 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
void debuff_update(EffectInstance* effect) {
DebuffFXData* data = effect->data.debuff;
s32 time;
s32 i;
data->lifetime++;
data->timeLeft--;
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
time = data->lifetime;
if (time > 10) {
data->alpha *= 0.9;
}
data++;
for (i = 1; i < effect->numParts; i++, data++) {
if (time > 10) {
data->scaleY += (1.0 - data->scaleY) * 0.1;
data->scaleX += (2.4f - data->scaleX) * 0.1;
data->unk_30 += ((100.0f - data->unk_30) * 0.07) * 0.2;
}
if (time < 10) {
data->scaleY += (7.0f - data->scaleY) * 0.05;
data->scaleX += (1.0f - data->scaleX) * 0.1;
data->unk_30 += ((10.0f - data->unk_30) * 0.05) * 0.6;
}
data->pos.x = shim_cos_deg(data->rotZ + 90.0f) * data->unk_30;
data->pos.y = shim_sin_deg(data->rotZ + 90.0f) * data->unk_30;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8025FF8C
/* 18E86C 8025FF8C 27BDFF78 */ addiu $sp, $sp, -0x88
/* 18E870 8025FF90 AFBF007C */ sw $ra, 0x7C($sp)
/* 18E874 8025FF94 AFBE0078 */ sw $fp, 0x78($sp)
/* 18E878 8025FF98 AFB70074 */ sw $s7, 0x74($sp)
/* 18E87C 8025FF9C AFB60070 */ sw $s6, 0x70($sp)
/* 18E880 8025FFA0 AFB5006C */ sw $s5, 0x6C($sp)
/* 18E884 8025FFA4 AFB40068 */ sw $s4, 0x68($sp)
/* 18E888 8025FFA8 AFB30064 */ sw $s3, 0x64($sp)
/* 18E88C 8025FFAC AFB20060 */ sw $s2, 0x60($sp)
/* 18E890 8025FFB0 AFB1005C */ sw $s1, 0x5C($sp)
/* 18E894 8025FFB4 AFB00058 */ sw $s0, 0x58($sp)
/* 18E898 8025FFB8 F7B40080 */ sdc1 $f20, 0x80($sp)
/* 18E89C 8025FFBC 10800014 */ beqz $a0, .L80260010
/* 18E8A0 8025FFC0 24020001 */ addiu $v0, $zero, 0x1
/* 18E8A4 8025FFC4 14820013 */ bne $a0, $v0, .L80260014
/* 18E8A8 8025FFC8 24110064 */ addiu $s1, $zero, 0x64
/* 18E8AC 8025FFCC 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 18E8B0 8025FFD0 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 18E8B4 8025FFD4 80420048 */ lb $v0, 0x48($v0)
/* 18E8B8 8025FFD8 10400005 */ beqz $v0, .L8025FFF0
/* 18E8BC 8025FFDC 0000882D */ daddu $s1, $zero, $zero
/* 18E8C0 8025FFE0 10440006 */ beq $v0, $a0, .L8025FFFC
/* 18E8C4 8025FFE4 24110064 */ addiu $s1, $zero, 0x64
/* 18E8C8 8025FFE8 08098002 */ j .L80260008
/* 18E8CC 8025FFEC 0220B82D */ daddu $s7, $s1, $zero
.L8025FFF0:
/* 18E8D0 8025FFF0 24170064 */ addiu $s7, $zero, 0x64
/* 18E8D4 8025FFF4 08098007 */ j .L8026001C
/* 18E8D8 8025FFF8 241E0064 */ addiu $fp, $zero, 0x64
.L8025FFFC:
/* 18E8DC 8025FFFC 0000B82D */ daddu $s7, $zero, $zero
/* 18E8E0 80260000 08098007 */ j .L8026001C
/* 18E8E4 80260004 241E0064 */ addiu $fp, $zero, 0x64
.L80260008:
/* 18E8E8 80260008 08098007 */ j .L8026001C
/* 18E8EC 8026000C 0000F02D */ daddu $fp, $zero, $zero
.L80260010:
/* 18E8F0 80260010 24110064 */ addiu $s1, $zero, 0x64
.L80260014:
/* 18E8F4 80260014 0220B82D */ daddu $s7, $s1, $zero
/* 18E8F8 80260018 0220F02D */ daddu $fp, $s1, $zero
.L8026001C:
/* 18E8FC 8026001C 27B60050 */ addiu $s6, $sp, 0x50
/* 18E900 80260020 02C0282D */ daddu $a1, $s6, $zero
/* 18E904 80260024 3C15802A */ lui $s5, %hi(LevelUpStatEmblemIDs)
/* 18E908 80260028 26B5FA80 */ addiu $s5, $s5, %lo(LevelUpStatEmblemIDs)
/* 18E90C 8026002C 27B40054 */ addiu $s4, $sp, 0x54
/* 18E910 80260030 8EA40000 */ lw $a0, 0x0($s5)
/* 18E914 80260034 0C05126B */ jal hud_element_get_render_pos
D_80260038:
/* 18E918 80260038 0280302D */ daddu $a2, $s4, $zero
/* 18E91C 8026003C 0000202D */ daddu $a0, $zero, $zero
/* 18E920 80260040 2405000F */ addiu $a1, $zero, 0xF
/* 18E924 80260044 2410002C */ addiu $s0, $zero, 0x2C
/* 18E928 80260048 241300FF */ addiu $s3, $zero, 0xFF
/* 18E92C 8026004C 8FA60050 */ lw $a2, 0x50($sp)
/* 18E930 80260050 8FA70054 */ lw $a3, 0x54($sp)
/* 18E934 80260054 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 18E938 80260058 4481A000 */ mtc1 $at, $f20
D_8026005C:
/* 18E93C 8026005C 24120140 */ addiu $s2, $zero, 0x140
/* 18E940 80260060 AFB10020 */ sw $s1, 0x20($sp)
/* 18E944 80260064 241100F0 */ addiu $s1, $zero, 0xF0
/* 18E948 80260068 AFA00010 */ sw $zero, 0x10($sp)
D_8026006C:
/* 18E94C 8026006C AFB00014 */ sw $s0, 0x14($sp)
/* 18E950 80260070 AFB00018 */ sw $s0, 0x18($sp)
/* 18E954 80260074 AFB3001C */ sw $s3, 0x1C($sp)
/* 18E958 80260078 AFA0002C */ sw $zero, 0x2C($sp)
D_8026007C:
/* 18E95C 8026007C AFA00030 */ sw $zero, 0x30($sp)
/* 18E960 80260080 AFA00034 */ sw $zero, 0x34($sp)
/* 18E964 80260084 AFA00038 */ sw $zero, 0x38($sp)
/* 18E968 80260088 AFA0003C */ sw $zero, 0x3C($sp)
D_8026008C:
/* 18E96C 8026008C AFA00040 */ sw $zero, 0x40($sp)
/* 18E970 80260090 AFB20044 */ sw $s2, 0x44($sp)
/* 18E974 80260094 AFB10048 */ sw $s1, 0x48($sp)
/* 18E978 80260098 AFA0004C */ sw $zero, 0x4C($sp)
D_8026009C:
/* 18E97C 8026009C 24C6FFEA */ addiu $a2, $a2, -0x16
/* 18E980 802600A0 24E7FFEA */ addiu $a3, $a3, -0x16
/* 18E984 802600A4 E7B40024 */ swc1 $f20, 0x24($sp)
/* 18E988 802600A8 0C03D4B8 */ jal draw_box
D_802600AC:
/* 18E98C 802600AC E7B40028 */ swc1 $f20, 0x28($sp)
/* 18E990 802600B0 02C0282D */ daddu $a1, $s6, $zero
/* 18E994 802600B4 8EA4000C */ lw $a0, 0xC($s5)
/* 18E998 802600B8 0C05126B */ jal hud_element_get_render_pos
/* 18E99C 802600BC 0280302D */ daddu $a2, $s4, $zero
/* 18E9A0 802600C0 0000202D */ daddu $a0, $zero, $zero
/* 18E9A4 802600C4 8FA60050 */ lw $a2, 0x50($sp)
/* 18E9A8 802600C8 8FA70054 */ lw $a3, 0x54($sp)
/* 18E9AC 802600CC 2405000F */ addiu $a1, $zero, 0xF
/* 18E9B0 802600D0 AFA00010 */ sw $zero, 0x10($sp)
/* 18E9B4 802600D4 AFB00014 */ sw $s0, 0x14($sp)
/* 18E9B8 802600D8 AFB00018 */ sw $s0, 0x18($sp)
/* 18E9BC 802600DC AFB3001C */ sw $s3, 0x1C($sp)
/* 18E9C0 802600E0 AFB70020 */ sw $s7, 0x20($sp)
/* 18E9C4 802600E4 E7B40024 */ swc1 $f20, 0x24($sp)
/* 18E9C8 802600E8 E7B40028 */ swc1 $f20, 0x28($sp)
/* 18E9CC 802600EC AFA0002C */ sw $zero, 0x2C($sp)
/* 18E9D0 802600F0 AFA00030 */ sw $zero, 0x30($sp)
/* 18E9D4 802600F4 AFA00034 */ sw $zero, 0x34($sp)
/* 18E9D8 802600F8 AFA00038 */ sw $zero, 0x38($sp)
/* 18E9DC 802600FC AFA0003C */ sw $zero, 0x3C($sp)
/* 18E9E0 80260100 AFA00040 */ sw $zero, 0x40($sp)
/* 18E9E4 80260104 AFB20044 */ sw $s2, 0x44($sp)
/* 18E9E8 80260108 AFB10048 */ sw $s1, 0x48($sp)
/* 18E9EC 8026010C AFA0004C */ sw $zero, 0x4C($sp)
/* 18E9F0 80260110 24C6FFEA */ addiu $a2, $a2, -0x16
/* 18E9F4 80260114 0C03D4B8 */ jal draw_box
/* 18E9F8 80260118 24E7FFEA */ addiu $a3, $a3, -0x16
/* 18E9FC 8026011C 02C0282D */ daddu $a1, $s6, $zero
/* 18EA00 80260120 8EA40008 */ lw $a0, 0x8($s5)
/* 18EA04 80260124 0C05126B */ jal hud_element_get_render_pos
/* 18EA08 80260128 0280302D */ daddu $a2, $s4, $zero
/* 18EA0C 8026012C 0000202D */ daddu $a0, $zero, $zero
/* 18EA10 80260130 8FA60050 */ lw $a2, 0x50($sp)
/* 18EA14 80260134 8FA70054 */ lw $a3, 0x54($sp)
/* 18EA18 80260138 2405000F */ addiu $a1, $zero, 0xF
/* 18EA1C 8026013C AFA00010 */ sw $zero, 0x10($sp)
/* 18EA20 80260140 AFB00014 */ sw $s0, 0x14($sp)
/* 18EA24 80260144 AFB00018 */ sw $s0, 0x18($sp)
/* 18EA28 80260148 AFB3001C */ sw $s3, 0x1C($sp)
/* 18EA2C 8026014C AFBE0020 */ sw $fp, 0x20($sp)
/* 18EA30 80260150 E7B40024 */ swc1 $f20, 0x24($sp)
/* 18EA34 80260154 E7B40028 */ swc1 $f20, 0x28($sp)
/* 18EA38 80260158 AFA0002C */ sw $zero, 0x2C($sp)
/* 18EA3C 8026015C AFA00030 */ sw $zero, 0x30($sp)
/* 18EA40 80260160 AFA00034 */ sw $zero, 0x34($sp)
/* 18EA44 80260164 AFA00038 */ sw $zero, 0x38($sp)
/* 18EA48 80260168 AFA0003C */ sw $zero, 0x3C($sp)
/* 18EA4C 8026016C AFA00040 */ sw $zero, 0x40($sp)
/* 18EA50 80260170 AFB20044 */ sw $s2, 0x44($sp)
/* 18EA54 80260174 AFB10048 */ sw $s1, 0x48($sp)
/* 18EA58 80260178 AFA0004C */ sw $zero, 0x4C($sp)
/* 18EA5C 8026017C 24C6FFEA */ addiu $a2, $a2, -0x16
/* 18EA60 80260180 0C03D4B8 */ jal draw_box
/* 18EA64 80260184 24E7FFEA */ addiu $a3, $a3, -0x16
/* 18EA68 80260188 8FBF007C */ lw $ra, 0x7C($sp)
/* 18EA6C 8026018C 8FBE0078 */ lw $fp, 0x78($sp)
/* 18EA70 80260190 8FB70074 */ lw $s7, 0x74($sp)
/* 18EA74 80260194 8FB60070 */ lw $s6, 0x70($sp)
/* 18EA78 80260198 8FB5006C */ lw $s5, 0x6C($sp)
/* 18EA7C 8026019C 8FB40068 */ lw $s4, 0x68($sp)
/* 18EA80 802601A0 8FB30064 */ lw $s3, 0x64($sp)
/* 18EA84 802601A4 8FB20060 */ lw $s2, 0x60($sp)
/* 18EA88 802601A8 8FB1005C */ lw $s1, 0x5C($sp)
/* 18EA8C 802601AC 8FB00058 */ lw $s0, 0x58($sp)
/* 18EA90 802601B0 D7B40080 */ ldc1 $f20, 0x80($sp)
/* 18EA94 802601B4 03E00008 */ jr $ra
/* 18EA98 802601B8 27BD0088 */ addiu $sp, $sp, 0x88
### DECOMPILED C INSTRUCTIONS:
void btl_draw_upgrade_windows(s32 phase) {
BattleStatus* battleStatus = &gBattleStatus;
s32 x;
s32 y;
s32 d1;
s32 d2;
s32 d3;
switch (phase) {
case 0: // before choice
d1 = 100;
d2 = 100;
d3 = 100;
break;
case 1: // choosing
switch (battleStatus->currentSubmenu) {
case MENU_HP:
d1 = 0;
d2 = 100;
d3 = 100;
break;
case MENU_FP:
d1 = 100;
d2 = 0;
d3 = 100;
break;
default:
d1 = 100;
d2 = 100;
d3 = 0;
break;
}
break;
default: // after choice
d1 = 100;
d2 = 100;
d3 = 100;
break;
}
hud_element_get_render_pos(LevelUpStatEmblemIDs[0], &x, &y);
draw_box(0, WINDOW_STYLE_15, x - 22, y - 22, 0, 44, 44, 255, d1, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL,
SCREEN_WIDTH, SCREEN_HEIGHT, NULL);
hud_element_get_render_pos(LevelUpStatEmblemIDs[3], &x, &y);
draw_box(0, WINDOW_STYLE_15, x - 22, y - 22, 0, 44, 44, 255, d2, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL,
SCREEN_WIDTH, SCREEN_HEIGHT, NULL);
hud_element_get_render_pos(LevelUpStatEmblemIDs[2], &x, &y);
draw_box(0, WINDOW_STYLE_15, x - 22, y - 22, 0, 44, 44, 255, d3, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL,
SCREEN_WIDTH, SCREEN_HEIGHT, NULL);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel action_command_free
/* 19757C 80268C9C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 197580 80268CA0 AFB00010 */ sw $s0, 0x10($sp)
/* 197584 80268CA4 3C10802A */ lui $s0, %hi(gActionCommandStatus)
/* 197588 80268CA8 2610FBE0 */ addiu $s0, $s0, %lo(gActionCommandStatus)
/* 19758C 80268CAC AFBF0014 */ sw $ra, 0x14($sp)
/* 197590 80268CB0 8603004A */ lh $v1, 0x4A($s0)
/* 197594 80268CB4 2C620018 */ sltiu $v0, $v1, 0x18
/* 197598 80268CB8 10400060 */ beqz $v0, .L80268E3C
/* 19759C 80268CBC 00031080 */ sll $v0, $v1, 2
/* 1975A0 80268CC0 3C01802A */ lui $at, %hi(jtbl_8029D760)
/* 1975A4 80268CC4 00220821 */ addu $at, $at, $v0
/* 1975A8 80268CC8 8C22D760 */ lw $v0, %lo(jtbl_8029D760)($at)
/* 1975AC 80268CCC 00400008 */ jr $v0
/* 1975B0 80268CD0 00000000 */ nop
glabel .L80268CD4
/* 1975B4 80268CD4 0C0AA564 */ jal func_802A9590
/* 1975B8 80268CD8 00000000 */ nop
/* 1975BC 80268CDC 0809A390 */ j .L80268E40
/* 1975C0 80268CE0 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268CE4
/* 1975C4 80268CE4 0C0AA68C */ jal func_802A9A30
/* 1975C8 80268CE8 00000000 */ nop
/* 1975CC 80268CEC 0809A390 */ j .L80268E40
/* 1975D0 80268CF0 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268CF4
/* 1975D4 80268CF4 0C0AA625 */ jal func_802A9894
/* 1975D8 80268CF8 00000000 */ nop
/* 1975DC 80268CFC 0809A390 */ j .L80268E40
/* 1975E0 80268D00 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D04
/* 1975E4 80268D04 0C0AA5FF */ jal func_802A97FC
/* 1975E8 80268D08 00000000 */ nop
/* 1975EC 80268D0C 0809A390 */ j .L80268E40
/* 1975F0 80268D10 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D14
/* 1975F4 80268D14 0C0AA626 */ jal func_802A9898
/* 1975F8 80268D18 00000000 */ nop
/* 1975FC 80268D1C 0809A390 */ j .L80268E40
/* 197600 80268D20 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D24
/* 197604 80268D24 0C0AA551 */ jal func_802A9544
/* 197608 80268D28 00000000 */ nop
/* 19760C 80268D2C 0809A390 */ j .L80268E40
/* 197610 80268D30 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D34
/* 197614 80268D34 0C0AA567 */ jal func_802A959C
/* 197618 80268D38 00000000 */ nop
/* 19761C 80268D3C 0809A390 */ j .L80268E40
/* 197620 80268D40 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D44
/* 197624 80268D44 0C0AA5EF */ jal func_802A97BC
/* 197628 80268D48 00000000 */ nop
/* 19762C 80268D4C 0809A390 */ j .L80268E40
/* 197630 80268D50 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D54
/* 197634 80268D54 0C0AA645 */ jal func_802A9914
/* 197638 80268D58 00000000 */ nop
/* 19763C 80268D5C 0809A390 */ j .L80268E40
/* 197640 80268D60 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D64
/* 197644 80268D64 0C0AA58F */ jal func_802A963C
/* 197648 80268D68 00000000 */ nop
/* 19764C 80268D6C 0809A390 */ j .L80268E40
/* 197650 80268D70 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D74
/* 197654 80268D74 0C0AA5F3 */ jal func_802A97CC
/* 197658 80268D78 00000000 */ nop
/* 19765C 80268D7C 0809A390 */ j .L80268E40
/* 197660 80268D80 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D84
/* 197664 80268D84 0C0AA5C2 */ jal func_802A9708
/* 197668 80268D88 00000000 */ nop
/* 19766C 80268D8C 0809A390 */ j .L80268E40
/* 197670 80268D90 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268D94
/* 197674 80268D94 0C0AA604 */ jal func_802A9810
/* 197678 80268D98 00000000 */ nop
/* 19767C 80268D9C 0809A390 */ j .L80268E40
/* 197680 80268DA0 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268DA4
/* 197684 80268DA4 0C0AA64B */ jal func_802A992C
/* 197688 80268DA8 00000000 */ nop
/* 19768C 80268DAC 0809A390 */ j .L80268E40
/* 197690 80268DB0 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268DB4
/* 197694 80268DB4 0C0AA5C8 */ jal func_802A9720
/* 197698 80268DB8 00000000 */ nop
/* 19769C 80268DBC 0809A390 */ j .L80268E40
/* 1976A0 80268DC0 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268DC4
/* 1976A4 80268DC4 0C0AA695 */ jal func_802A9A54
/* 1976A8 80268DC8 00000000 */ nop
/* 1976AC 80268DCC 0809A390 */ j .L80268E40
/* 1976B0 80268DD0 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268DD4
/* 1976B4 80268DD4 0C0AA638 */ jal func_802A98E0
/* 1976B8 80268DD8 00000000 */ nop
/* 1976BC 80268DDC 0809A390 */ j .L80268E40
/* 1976C0 80268DE0 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268DE4
/* 1976C4 80268DE4 0C0AA664 */ jal func_802A9990
/* 1976C8 80268DE8 00000000 */ nop
/* 1976CC 80268DEC 0809A390 */ j .L80268E40
/* 1976D0 80268DF0 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268DF4
/* 1976D4 80268DF4 0C0AA607 */ jal func_802A981C
/* 1976D8 80268DF8 00000000 */ nop
/* 1976DC 80268DFC 0809A390 */ j .L80268E40
/* 1976E0 80268E00 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268E04
/* 1976E4 80268E04 0C0AA625 */ jal func_802A9894
/* 1976E8 80268E08 00000000 */ nop
/* 1976EC 80268E0C 0809A390 */ j .L80268E40
/* 1976F0 80268E10 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268E14
/* 1976F4 80268E14 0C0AA637 */ jal func_802A98DC
/* 1976F8 80268E18 00000000 */ nop
/* 1976FC 80268E1C 0809A390 */ j .L80268E40
/* 197700 80268E20 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268E24
/* 197704 80268E24 0C0AA836 */ jal func_802AA0D8
/* 197708 80268E28 00000000 */ nop
/* 19770C 80268E2C 0809A390 */ j .L80268E40
/* 197710 80268E30 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
glabel .L80268E34
/* 197714 80268E34 0C0AA5D9 */ jal func_802A9764
/* 197718 80268E38 00000000 */ nop
glabel .L80268E3C
/* 19771C 80268E3C 3C05FFFF */ lui $a1, (0xFFFF7FFF >> 16)
.L80268E40:
/* 197720 80268E40 34A57FFF */ ori $a1, $a1, (0xFFFF7FFF & 0xFFFF)
/* 197724 80268E44 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 197728 80268E48 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 19772C 80268E4C A600004A */ sh $zero, 0x4A($s0)
/* 197730 80268E50 8C820000 */ lw $v0, 0x0($a0)
/* 197734 80268E54 2403DFFF */ addiu $v1, $zero, -0x2001
/* 197738 80268E58 00431024 */ and $v0, $v0, $v1
/* 19773C 80268E5C 00451024 */ and $v0, $v0, $a1
/* 197740 80268E60 2403BFFF */ addiu $v1, $zero, -0x4001
/* 197744 80268E64 00431024 */ and $v0, $v0, $v1
/* 197748 80268E68 0C093EC3 */ jal func_8024FB0C
/* 19774C 80268E6C AC820000 */ sw $v0, 0x0($a0)
/* 197750 80268E70 0C093EB1 */ jal func_8024FAC4
/* 197754 80268E74 0000202D */ daddu $a0, $zero, $zero
/* 197758 80268E78 8FBF0014 */ lw $ra, 0x14($sp)
/* 19775C 80268E7C 8FB00010 */ lw $s0, 0x10($sp)
/* 197760 80268E80 03E00008 */ jr $ra
/* 197764 80268E84 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void action_command_free(void) {
ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
switch (actionCommandStatus->actionCommandID) {
case ACTION_COMMAND_NONE:
break;
case ACTION_COMMAND_JUMP:
action_command_jump_free();
break;
case ACTION_COMMAND_SMASH:
action_command_hammer_free();
break;
case ACTION_COMMAND_FLEE:
action_command_flee_free();
break;
case ACTION_COMMAND_BREAK_FREE:
action_command_break_free_free();
break;
case ACTION_COMMAND_WHIRLWIND:
action_command_whirlwind_free();
break;
case ACTION_COMMAND_STOP_LEECH:
action_command_jump_draw();
break;
case ACTION_COMMAND_07:
action_command_07_free();
break;
case ACTION_COMMAND_DIZZY_SHELL:
action_command_dizzy_shell_free();
break;
case ACTION_COMMAND_FIRE_SHELL:
action_command_fire_shell_free();
break;
case ACTION_COMMAND_0A:
action_command_0A_free();
break;
case ACTION_COMMAND_BOMB:
action_command_bomb_free();
break;
case ACTION_COMMAND_BODY_SLAM:
action_command_body_slam_free();
break;
case ACTION_COMMAND_AIR_LIFT:
action_command_air_lift_free();
break;
case ACTION_COMMAND_AIR_RAID:
action_command_air_raid_free();
break;
case ACTION_COMMAND_SQUIRT:
action_command_squirt_free();
break;
case ACTION_COMMAND_POWER_SHOCK:
action_command_power_shock_free();
break;
case ACTION_COMMAND_MEGA_SHOCK:
action_command_mega_shock_free();
break;
case ACTION_COMMAND_SMACK:
action_command_smack_free();
break;
case ACTION_COMMAND_SPINY_SURGE:
action_command_spiny_surge_free();
break;
case ACTION_COMMAND_HURRICANE:
action_command_hurricane_free();
break;
case ACTION_COMMAND_SPOOK:
action_command_spook_free();
break;
case ACTION_COMMAND_WATER_BLOCK:
action_command_water_block_free();
break;
case ACTION_COMMAND_TIDAL_WAVE:
action_command_tidal_wave_free();
break;
}
actionCommandStatus->actionCommandID = ACTION_COMMAND_NONE;
gBattleStatus.flags1 &= ~BS_FLAGS1_2000;
gBattleStatus.flags1 &= ~BS_FLAGS1_8000;
gBattleStatus.flags1 &= ~BS_FLAGS1_4000;
close_action_command_instruction_popup();
btl_set_popup_duration(0);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
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, 0x1
/* 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(damage_indicator_render_ui)
/* 34F548 E003C088 2442C47C */ addiu $v0, $v0, %lo(damage_indicator_render_ui)
/* 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, 0x8($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, 0x0($v1)
/* 34F58C E003C0CC E4740004 */ swc1 $f20, 0x4($v1)
/* 34F590 E003C0D0 E4760008 */ swc1 $f22, 0x8($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, 0x1
/* 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, (0x41F00000 >> 16)
/* 34F5CC E003C10C 44811000 */ mtc1 $at, $f2
/* 34F5D0 E003C110 3C013FF8 */ lui $at, (0x3FF80000 >> 16)
/* 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, 31
/* 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, -0x1
/* 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, 31
/* 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, (0x3E4CCCCD >> 16)
/* 34F648 E003C188 3421CCCD */ ori $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 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, 0x1
/* 34F6A4 E003C1E4 240200FF */ addiu $v0, $zero, 0xFF
/* 34F6A8 E003C1E8 AE020000 */ sw $v0, 0x0($s0)
/* 34F6AC E003C1EC 0232102A */ slt $v0, $s1, $s2
/* 34F6B0 E003C1F0 AE00FFF8 */ sw $zero, -0x8($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, 0x0($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
### DECOMPILED C INSTRUCTIONS:
void damage_indicator_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 starsRadius, f32 starsAngle, s32 damageAmt, EffectInstance** effectOut) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
EffectInstance* effect;
f32 angle;
DamageIndicatorFXData* part;
s32 trueDamageAmt = damageAmt;
s32 i;
// limit number of stars that can appear
if (damageAmt > 20) {
damageAmt = 20;
}
damageAmt++;
bp.init = damage_indicator_init;
bp.update = damage_indicator_update;
bp.renderWorld = damage_indicator_render;
bp.renderUI = damage_indicator_render_ui;
bp.unk_00 = 0;
bp.effectID = EFFECT_DAMAGE_INDICATOR;
effect = shim_create_effect_instance(bpPtr);
effect->numParts = damageAmt;
effect->data.damageIndicator = part = shim_general_heap_malloc(damageAmt * sizeof(*part));
ASSERT(effect->data.damageIndicator != NULL);
part->unk_00 = arg0;
part->basePos.x = posX;
part->basePos.y = posY;
part->basePos.z = posZ;
part->radius = starsRadius;
part->timeLeft = 100;
part->lifetime = 0;
part->damageAmt = trueDamageAmt;
part++;
for (i = 1; i < damageAmt; i++, part++) {
part->basePos.x = 0.0f;
part->basePos.y = 0.0f;
part->basePos.z = 0.0f;
part->curPos.x = part->basePos.x;
part->curPos.y = part->basePos.y;
part->curPos.z = part->basePos.z;
angle = starsAngle + (((s32) ((((i % 2) * 2) - 1) * i) / 2) * (30.0f - damageAmt));
part->scale = 0.2f;
part->relPos.x = -shim_sin_deg(angle) * starsRadius * 1.5;
part->relPos.y = shim_cos_deg(angle) * starsRadius * 1.5;
part->relPos.z = 0;
part->alpha = 255;
}
*effectOut = effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_80027BAC
/* 2FAC 80027BAC 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 2FB0 80027BB0 3C06D700 */ lui $a2, (0xD7000002 >> 16)
/* 2FB4 80027BB4 34C60002 */ ori $a2, $a2, (0xD7000002 & 0xFFFF)
/* 2FB8 80027BB8 3C07FF10 */ lui $a3, (0xFF10013F >> 16)
/* 2FBC 80027BBC 34E7013F */ ori $a3, $a3, (0xFF10013F & 0xFFFF)
/* 2FC0 80027BC0 3C08E300 */ lui $t0, (0xE3000A01 >> 16)
/* 2FC4 80027BC4 35080A01 */ ori $t0, $t0, (0xE3000A01 & 0xFFFF)
/* 2FC8 80027BC8 3C09E300 */ lui $t1, (0xE3000C00 >> 16)
/* 2FCC 80027BCC 35290C00 */ ori $t1, $t1, (0xE3000C00 & 0xFFFF)
/* 2FD0 80027BD0 3C0AE300 */ lui $t2, (0xE3001001 >> 16)
/* 2FD4 80027BD4 354A1001 */ ori $t2, $t2, (0xE3001001 & 0xFFFF)
/* 2FD8 80027BD8 3C0BE200 */ lui $t3, (0xE200001C >> 16)
/* 2FDC 80027BDC 356B001C */ ori $t3, $t3, (0xE200001C & 0xFFFF)
/* 2FE0 80027BE0 3C0CE300 */ lui $t4, (0xE3001201 >> 16)
/* 2FE4 80027BE4 358C1201 */ ori $t4, $t4, (0xE3001201 & 0xFFFF)
/* 2FE8 80027BE8 0000C82D */ daddu $t9, $zero, $zero
/* 2FEC 80027BEC 3C02800A */ lui $v0, %hi(gMainGfxPos)
/* 2FF0 80027BF0 2442A66C */ addiu $v0, $v0, %lo(gMainGfxPos)
/* 2FF4 80027BF4 0040682D */ daddu $t5, $v0, $zero
/* 2FF8 80027BF8 AFB5001C */ sw $s5, 0x1C($sp)
/* 2FFC 80027BFC 3C15FD10 */ lui $s5, (0xFD10013F >> 16)
/* 3000 80027C00 36B5013F */ ori $s5, $s5, (0xFD10013F & 0xFFFF)
/* 3004 80027C04 AFB00008 */ sw $s0, 0x8($sp)
/* 3008 80027C08 3C10F510 */ lui $s0, (0xF510A000 >> 16)
/* 300C 80027C0C 3610A000 */ ori $s0, $s0, (0xF510A000 & 0xFFFF)
/* 3010 80027C10 AFB40018 */ sw $s4, 0x18($sp)
/* 3014 80027C14 3C14074F */ lui $s4, (0x74FC014 >> 16)
/* 3018 80027C18 3694C014 */ ori $s4, $s4, (0x74FC014 & 0xFFFF)
/* 301C 80027C1C AFB1000C */ sw $s1, 0xC($sp)
/* 3020 80027C20 3C11E700 */ lui $s1, (0xE7000000 >> 16)
/* 3024 80027C24 AFBE0028 */ sw $fp, 0x28($sp)
/* 3028 80027C28 3C1EF200 */ lui $fp, (0xF2000000 >> 16)
/* 302C 80027C2C AFB30014 */ sw $s3, 0x14($sp)
/* 3030 80027C30 3C13004F */ lui $s3, (0x4FC014 >> 16)
/* 3034 80027C34 3673C014 */ ori $s3, $s3, (0x4FC014 & 0xFFFF)
/* 3038 80027C38 AFB20010 */ sw $s2, 0x10($sp)
/* 303C 80027C3C 3C12E44F */ lui $s2, (0xE44FC000 >> 16)
/* 3040 80027C40 3652C000 */ ori $s2, $s2, (0xE44FC000 & 0xFFFF)
/* 3044 80027C44 AFB70024 */ sw $s7, 0x24($sp)
/* 3048 80027C48 3C17E100 */ lui $s7, (0xE1000000 >> 16)
/* 304C 80027C4C AFB60020 */ sw $s6, 0x20($sp)
/* 3050 80027C50 3C16F100 */ lui $s6, (0xF1000000 >> 16)
/* 3054 80027C54 0320C02D */ daddu $t8, $t9, $zero
/* 3058 80027C58 240F0014 */ addiu $t7, $zero, 0x14
/* 305C 80027C5C 0080702D */ daddu $t6, $a0, $zero
/* 3060 80027C60 8DA20000 */ lw $v0, 0x0($t5)
/* 3064 80027C64 0220182D */ daddu $v1, $s1, $zero
/* 3068 80027C68 0040202D */ daddu $a0, $v0, $zero
/* 306C 80027C6C 24420008 */ addiu $v0, $v0, 0x8
/* 3070 80027C70 ADA20000 */ sw $v0, 0x0($t5)
/* 3074 80027C74 AC830000 */ sw $v1, 0x0($a0)
/* 3078 80027C78 24430008 */ addiu $v1, $v0, 0x8
/* 307C 80027C7C AC800004 */ sw $zero, 0x4($a0)
/* 3080 80027C80 ADA30000 */ sw $v1, 0x0($t5)
/* 3084 80027C84 2403FFFF */ addiu $v1, $zero, -0x1
/* 3088 80027C88 AC430004 */ sw $v1, 0x4($v0)
/* 308C 80027C8C 24430010 */ addiu $v1, $v0, 0x10
/* 3090 80027C90 AC460000 */ sw $a2, 0x0($v0)
/* 3094 80027C94 ADA30000 */ sw $v1, 0x0($t5)
/* 3098 80027C98 24430018 */ addiu $v1, $v0, 0x18
/* 309C 80027C9C AC470008 */ sw $a3, 0x8($v0)
/* 30A0 80027CA0 AC45000C */ sw $a1, 0xC($v0)
/* 30A4 80027CA4 ADA30000 */ sw $v1, 0x0($t5)
/* 30A8 80027CA8 3C030020 */ lui $v1, (0x200000 >> 16)
/* 30AC 80027CAC AC430014 */ sw $v1, 0x14($v0)
/* 30B0 80027CB0 24430020 */ addiu $v1, $v0, 0x20
/* 30B4 80027CB4 AC480010 */ sw $t0, 0x10($v0)
/* 30B8 80027CB8 ADA30000 */ sw $v1, 0x0($t5)
/* 30BC 80027CBC 24430028 */ addiu $v1, $v0, 0x28
/* 30C0 80027CC0 AC490018 */ sw $t1, 0x18($v0)
/* 30C4 80027CC4 AC40001C */ sw $zero, 0x1C($v0)
/* 30C8 80027CC8 ADA30000 */ sw $v1, 0x0($t5)
/* 30CC 80027CCC 24430030 */ addiu $v1, $v0, 0x30
/* 30D0 80027CD0 AC4A0020 */ sw $t2, 0x20($v0)
/* 30D4 80027CD4 AC400024 */ sw $zero, 0x24($v0)
/* 30D8 80027CD8 ADA30000 */ sw $v1, 0x0($t5)
/* 30DC 80027CDC 24430038 */ addiu $v1, $v0, 0x38
/* 30E0 80027CE0 AC4B0028 */ sw $t3, 0x28($v0)
/* 30E4 80027CE4 AC40002C */ sw $zero, 0x2C($v0)
/* 30E8 80027CE8 ADA30000 */ sw $v1, 0x0($t5)
/* 30EC 80027CEC AC4C0030 */ sw $t4, 0x30($v0)
/* 30F0 80027CF0 AC400034 */ sw $zero, 0x34($v0)
.L80027CF4:
/* 30F4 80027CF4 3C061000 */ lui $a2, (0x10000400 >> 16)
/* 30F8 80027CF8 34C60400 */ ori $a2, $a2, (0x10000400 & 0xFFFF)
/* 30FC 80027CFC 33050FFF */ andi $a1, $t8, 0xFFF
/* 3100 80027D00 27180018 */ addiu $t8, $t8, 0x18
/* 3104 80027D04 31E40FFF */ andi $a0, $t7, 0xFFF
/* 3108 80027D08 25EF0018 */ addiu $t7, $t7, 0x18
/* 310C 80027D0C 27390001 */ addiu $t9, $t9, 0x1
/* 3110 80027D10 8DA20000 */ lw $v0, 0x0($t5)
/* 3114 80027D14 00922025 */ or $a0, $a0, $s2
/* 3118 80027D18 0040182D */ daddu $v1, $v0, $zero
/* 311C 80027D1C 24420008 */ addiu $v0, $v0, 0x8
/* 3120 80027D20 AC6E0004 */ sw $t6, 0x4($v1)
/* 3124 80027D24 ADA20000 */ sw $v0, 0x0($t5)
/* 3128 80027D28 AC750000 */ sw $s5, 0x0($v1)
/* 312C 80027D2C 24430008 */ addiu $v1, $v0, 0x8
/* 3130 80027D30 3C070700 */ lui $a3, (0x7000000 >> 16)
/* 3134 80027D34 ADA30000 */ sw $v1, 0x0($t5)
/* 3138 80027D38 24430010 */ addiu $v1, $v0, 0x10
/* 313C 80027D3C AC470004 */ sw $a3, 0x4($v0)
/* 3140 80027D40 3C07E600 */ lui $a3, (0xE6000000 >> 16)
/* 3144 80027D44 AC500000 */ sw $s0, 0x0($v0)
/* 3148 80027D48 ADA30000 */ sw $v1, 0x0($t5)
/* 314C 80027D4C 24430018 */ addiu $v1, $v0, 0x18
/* 3150 80027D50 AC470008 */ sw $a3, 0x8($v0)
/* 3154 80027D54 3C07F400 */ lui $a3, (0xF4000000 >> 16)
/* 3158 80027D58 AC40000C */ sw $zero, 0xC($v0)
/* 315C 80027D5C ADA30000 */ sw $v1, 0x0($t5)
/* 3160 80027D60 24430020 */ addiu $v1, $v0, 0x20
/* 3164 80027D64 AC470010 */ sw $a3, 0x10($v0)
/* 3168 80027D68 AC540014 */ sw $s4, 0x14($v0)
/* 316C 80027D6C ADA30000 */ sw $v1, 0x0($t5)
/* 3170 80027D70 24430028 */ addiu $v1, $v0, 0x28
/* 3174 80027D74 AC510018 */ sw $s1, 0x18($v0)
/* 3178 80027D78 AC40001C */ sw $zero, 0x1C($v0)
/* 317C 80027D7C ADA30000 */ sw $v1, 0x0($t5)
/* 3180 80027D80 24430030 */ addiu $v1, $v0, 0x30
/* 3184 80027D84 AC500020 */ sw $s0, 0x20($v0)
/* 3188 80027D88 AC400024 */ sw $zero, 0x24($v0)
/* 318C 80027D8C ADA30000 */ sw $v1, 0x0($t5)
/* 3190 80027D90 24430038 */ addiu $v1, $v0, 0x38
/* 3194 80027D94 AC5E0028 */ sw $fp, 0x28($v0)
/* 3198 80027D98 AC53002C */ sw $s3, 0x2C($v0)
/* 319C 80027D9C ADA30000 */ sw $v1, 0x0($t5)
/* 31A0 80027DA0 24430040 */ addiu $v1, $v0, 0x40
/* 31A4 80027DA4 AC440030 */ sw $a0, 0x30($v0)
/* 31A8 80027DA8 AC450034 */ sw $a1, 0x34($v0)
/* 31AC 80027DAC ADA30000 */ sw $v1, 0x0($t5)
/* 31B0 80027DB0 24430048 */ addiu $v1, $v0, 0x48
/* 31B4 80027DB4 AC570038 */ sw $s7, 0x38($v0)
/* 31B8 80027DB8 AC40003C */ sw $zero, 0x3C($v0)
/* 31BC 80027DBC ADA30000 */ sw $v1, 0x0($t5)
/* 31C0 80027DC0 24430050 */ addiu $v1, $v0, 0x50
/* 31C4 80027DC4 AC560040 */ sw $s6, 0x40($v0)
/* 31C8 80027DC8 AC460044 */ sw $a2, 0x44($v0)
/* 31CC 80027DCC ADA30000 */ sw $v1, 0x0($t5)
/* 31D0 80027DD0 AC510048 */ sw $s1, 0x48($v0)
/* 31D4 80027DD4 AC40004C */ sw $zero, 0x4C($v0)
/* 31D8 80027DD8 2B220028 */ slti $v0, $t9, 0x28
/* 31DC 80027DDC 1440FFC5 */ bnez $v0, .L80027CF4
/* 31E0 80027DE0 25CE0F00 */ addiu $t6, $t6, 0xF00
/* 31E4 80027DE4 8FBE0028 */ lw $fp, 0x28($sp)
/* 31E8 80027DE8 8FB70024 */ lw $s7, 0x24($sp)
/* 31EC 80027DEC 8FB60020 */ lw $s6, 0x20($sp)
/* 31F0 80027DF0 8FB5001C */ lw $s5, 0x1C($sp)
/* 31F4 80027DF4 8FB40018 */ lw $s4, 0x18($sp)
/* 31F8 80027DF8 8FB30014 */ lw $s3, 0x14($sp)
/* 31FC 80027DFC 8FB20010 */ lw $s2, 0x10($sp)
/* 3200 80027E00 8FB1000C */ lw $s1, 0xC($sp)
/* 3204 80027E04 8FB00008 */ lw $s0, 0x8($sp)
/* 3208 80027E08 03E00008 */ jr $ra
/* 320C 80027E0C 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void func_80027BAC(s32 arg0, s32 arg1) {
s32 i;
s32 temp = 24; // todo figure out why this is needed and can't be used elsewhere
gDPPipeSync(gMainGfxPos++);
gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, arg1);
gDPSetCycleType(gMainGfxPos++, G_CYC_COPY);
gDPSetTexturePersp(gMainGfxPos++, G_TP_NONE);
gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE);
gDPSetRenderMode(gMainGfxPos++, G_RM_NOOP, G_RM_NOOP2);
gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT);
for (i = 0; i < 40; i++) {
gDPLoadTextureTile(gMainGfxPos++, arg0 + (0xF00 * i), G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH,
SCREEN_HEIGHT, 0, 0, SCREEN_WIDTH - 1, 5, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(gMainGfxPos++, 0, i * temp, 0x04FC, (i * 24) + 20, G_TX_RENDERTILE, 0, 0, 0x1000, 0x0400);
gDPPipeSync(gMainGfxPos++);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel sweat_appendGfx
/* 35C2D8 E0050308 27BDFF40 */ addiu $sp, $sp, -0xC0
/* 35C2DC E005030C 0080282D */ daddu $a1, $a0, $zero
/* 35C2E0 E0050310 3C06DB06 */ lui $a2, (0xDB060024 >> 16)
/* 35C2E4 E0050314 34C60024 */ ori $a2, $a2, (0xDB060024 & 0xFFFF)
/* 35C2E8 E0050318 27A40018 */ addiu $a0, $sp, 0x18
/* 35C2EC E005031C AFB400A8 */ sw $s4, 0xA8($sp)
/* 35C2F0 E0050320 3C14800A */ lui $s4, %hi(gMainGfxPos)
/* 35C2F4 E0050324 2694A66C */ addiu $s4, $s4, %lo(gMainGfxPos)
/* 35C2F8 E0050328 AFB200A0 */ sw $s2, 0xA0($sp)
/* 35C2FC E005032C 3C120001 */ lui $s2, (0x11630 >> 16)
/* 35C300 E0050330 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 35C304 E0050334 AFBF00AC */ sw $ra, 0xAC($sp)
/* 35C308 E0050338 AFB300A4 */ sw $s3, 0xA4($sp)
/* 35C30C E005033C AFB1009C */ sw $s1, 0x9C($sp)
/* 35C310 E0050340 AFB00098 */ sw $s0, 0x98($sp)
/* 35C314 E0050344 F7B600B8 */ sdc1 $f22, 0xB8($sp)
/* 35C318 E0050348 F7B400B0 */ sdc1 $f20, 0xB0($sp)
/* 35C31C E005034C 8E880000 */ lw $t0, 0x0($s4)
/* 35C320 E0050350 8CB3000C */ lw $s3, 0xC($a1)
/* 35C324 E0050354 0100182D */ daddu $v1, $t0, $zero
/* 35C328 E0050358 25080008 */ addiu $t0, $t0, 0x8
/* 35C32C E005035C AC620000 */ sw $v0, 0x0($v1)
/* 35C330 E0050360 AC600004 */ sw $zero, 0x4($v1)
/* 35C334 E0050364 AD060000 */ sw $a2, 0x0($t0)
/* 35C338 E0050368 8CA20010 */ lw $v0, 0x10($a1)
/* 35C33C E005036C 36521630 */ ori $s2, $s2, (0x11630 & 0xFFFF)
/* 35C340 E0050370 AE880000 */ sw $t0, 0x0($s4)
/* 35C344 E0050374 8C42001C */ lw $v0, 0x1C($v0)
/* 35C348 E0050378 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 35C34C E005037C 00431021 */ addu $v0, $v0, $v1
/* 35C350 E0050380 AD020004 */ sw $v0, 0x4($t0)
/* 35C354 E0050384 8E650004 */ lw $a1, 0x4($s3)
/* 35C358 E0050388 8E660008 */ lw $a2, 0x8($s3)
/* 35C35C E005038C 8E67000C */ lw $a3, 0xC($s3)
/* 35C360 E0050390 25080008 */ addiu $t0, $t0, 0x8
/* 35C364 E0050394 0C080108 */ jal shim_guTranslateF
/* 35C368 E0050398 AE880000 */ sw $t0, 0x0($s4)
/* 35C36C E005039C 27B00058 */ addiu $s0, $sp, 0x58
/* 35C370 E00503A0 4480A000 */ mtc1 $zero, $f20
/* 35C374 E00503A4 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 35C378 E00503A8 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 35C37C E00503AC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 35C380 E00503B0 4481B000 */ mtc1 $at, $f22
/* 35C384 E00503B4 00031080 */ sll $v0, $v1, 2
/* 35C388 E00503B8 00431021 */ addu $v0, $v0, $v1
/* 35C38C E00503BC 00021080 */ sll $v0, $v0, 2
/* 35C390 E00503C0 00431023 */ subu $v0, $v0, $v1
/* 35C394 E00503C4 000218C0 */ sll $v1, $v0, 3
/* 35C398 E00503C8 00431021 */ addu $v0, $v0, $v1
/* 35C39C E00503CC 000210C0 */ sll $v0, $v0, 3
/* 35C3A0 E00503D0 4406A000 */ mfc1 $a2, $f20
/* 35C3A4 E00503D4 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 35C3A8 E00503D8 00220821 */ addu $at, $at, $v0
/* 35C3AC E00503DC C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 35C3B0 E00503E0 4407B000 */ mfc1 $a3, $f22
/* 35C3B4 E00503E4 46000007 */ neg.s $f0, $f0
/* 35C3B8 E00503E8 44050000 */ mfc1 $a1, $f0
/* 35C3BC E00503EC 0200202D */ daddu $a0, $s0, $zero
/* 35C3C0 E00503F0 0C080104 */ jal shim_guRotateF
/* 35C3C4 E00503F4 E7B40010 */ swc1 $f20, 0x10($sp)
/* 35C3C8 E00503F8 0200202D */ daddu $a0, $s0, $zero
/* 35C3CC E00503FC 27A50018 */ addiu $a1, $sp, 0x18
/* 35C3D0 E0050400 0C080114 */ jal shim_guMtxCatF
/* 35C3D4 E0050404 00A0302D */ daddu $a2, $a1, $zero
/* 35C3D8 E0050408 E7B60010 */ swc1 $f22, 0x10($sp)
/* 35C3DC E005040C 8E650010 */ lw $a1, 0x10($s3)
/* 35C3E0 E0050410 4406A000 */ mfc1 $a2, $f20
/* 35C3E4 E0050414 4407A000 */ mfc1 $a3, $f20
/* 35C3E8 E0050418 0C080104 */ jal shim_guRotateF
/* 35C3EC E005041C 0200202D */ daddu $a0, $s0, $zero
/* 35C3F0 E0050420 0200202D */ daddu $a0, $s0, $zero
/* 35C3F4 E0050424 27A50018 */ addiu $a1, $sp, 0x18
/* 35C3F8 E0050428 0C080114 */ jal shim_guMtxCatF
/* 35C3FC E005042C 00A0302D */ daddu $a2, $a1, $zero
/* 35C400 E0050430 27A40018 */ addiu $a0, $sp, 0x18
/* 35C404 E0050434 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 35C408 E0050438 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 35C40C E005043C 3C11800A */ lui $s1, %hi(gDisplayContext)
/* 35C410 E0050440 2631A674 */ addiu $s1, $s1, %lo(gDisplayContext)
/* 35C414 E0050444 96050000 */ lhu $a1, 0x0($s0)
/* 35C418 E0050448 8E220000 */ lw $v0, 0x0($s1)
/* 35C41C E005044C 00052980 */ sll $a1, $a1, 6
/* 35C420 E0050450 00B22821 */ addu $a1, $a1, $s2
/* 35C424 E0050454 0C080118 */ jal shim_guMtxF2L
/* 35C428 E0050458 00452821 */ addu $a1, $v0, $a1
/* 35C42C E005045C 3C02DA38 */ lui $v0, (0xDA380002 >> 16)
/* 35C430 E0050460 34420002 */ ori $v0, $v0, (0xDA380002 & 0xFFFF)
/* 35C434 E0050464 8E860000 */ lw $a2, 0x0($s4)
/* 35C438 E0050468 96040000 */ lhu $a0, 0x0($s0)
/* 35C43C E005046C 00C0282D */ daddu $a1, $a2, $zero
/* 35C440 E0050470 24C60008 */ addiu $a2, $a2, 0x8
/* 35C444 E0050474 AE860000 */ sw $a2, 0x0($s4)
/* 35C448 E0050478 ACA20000 */ sw $v0, 0x0($a1)
/* 35C44C E005047C 3082FFFF */ andi $v0, $a0, 0xFFFF
/* 35C450 E0050480 00021180 */ sll $v0, $v0, 6
/* 35C454 E0050484 8E230000 */ lw $v1, 0x0($s1)
/* 35C458 E0050488 00521021 */ addu $v0, $v0, $s2
/* 35C45C E005048C 00621821 */ addu $v1, $v1, $v0
/* 35C460 E0050490 ACA30004 */ sw $v1, 0x4($a1)
/* 35C464 E0050494 C6600010 */ lwc1 $f0, 0x10($s3)
/* 35C468 E0050498 24840001 */ addiu $a0, $a0, 0x1
/* 35C46C E005049C 4600A03C */ c.lt.s $f20, $f0
/* 35C470 E00504A0 00000000 */ nop
/* 35C474 E00504A4 4500000D */ bc1f .LE00504DC
/* 35C478 E00504A8 A6040000 */ sh $a0, 0x0($s0)
/* 35C47C E00504AC 3C040900 */ lui $a0, %hi(D_090002C8_415328)
/* 35C480 E00504B0 248402C8 */ addiu $a0, $a0, %lo(D_090002C8_415328)
/* 35C484 E00504B4 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 35C488 E00504B8 ACC20000 */ sw $v0, 0x0($a2)
/* 35C48C E00504BC 8E630000 */ lw $v1, 0x0($s3)
/* 35C490 E00504C0 24C20008 */ addiu $v0, $a2, 0x8
/* 35C494 E00504C4 1460000F */ bnez $v1, .LE0050504
/* 35C498 E00504C8 AE820000 */ sw $v0, 0x0($s4)
/* 35C49C E00504CC 3C040900 */ lui $a0, %hi(D_09000200_415260)
/* 35C4A0 E00504D0 24840200 */ addiu $a0, $a0, %lo(D_09000200_415260)
/* 35C4A4 E00504D4 08014142 */ j .LE0050508
/* 35C4A8 E00504D8 ACC40004 */ sw $a0, 0x4($a2)
.LE00504DC:
/* 35C4AC E00504DC 3C040900 */ lui $a0, %hi(D_09000460_4154C0)
/* 35C4B0 E00504E0 24840460 */ addiu $a0, $a0, %lo(D_09000460_4154C0)
/* 35C4B4 E00504E4 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 35C4B8 E00504E8 ACC20000 */ sw $v0, 0x0($a2)
/* 35C4BC E00504EC 8E630000 */ lw $v1, 0x0($s3)
/* 35C4C0 E00504F0 24C20008 */ addiu $v0, $a2, 0x8
/* 35C4C4 E00504F4 14600003 */ bnez $v1, .LE0050504
/* 35C4C8 E00504F8 AE820000 */ sw $v0, 0x0($s4)
/* 35C4CC E00504FC 3C040900 */ lui $a0, %hi(D_09000390_4153F0)
/* 35C4D0 E0050500 24840390 */ addiu $a0, $a0, %lo(D_09000390_4153F0)
.LE0050504:
/* 35C4D4 E0050504 ACC40004 */ sw $a0, 0x4($a2)
.LE0050508:
/* 35C4D8 E0050508 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* 35C4DC E005050C 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 35C4E0 E0050510 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 35C4E4 E0050514 8C620000 */ lw $v0, 0x0($v1)
/* 35C4E8 E0050518 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* 35C4EC E005051C 0040202D */ daddu $a0, $v0, $zero
/* 35C4F0 E0050520 24420008 */ addiu $v0, $v0, 0x8
/* 35C4F4 E0050524 AC620000 */ sw $v0, 0x0($v1)
/* 35C4F8 E0050528 24020040 */ addiu $v0, $zero, 0x40
/* 35C4FC E005052C AC850000 */ sw $a1, 0x0($a0)
/* 35C500 E0050530 AC820004 */ sw $v0, 0x4($a0)
/* 35C504 E0050534 8FBF00AC */ lw $ra, 0xAC($sp)
/* 35C508 E0050538 8FB400A8 */ lw $s4, 0xA8($sp)
/* 35C50C E005053C 8FB300A4 */ lw $s3, 0xA4($sp)
/* 35C510 E0050540 8FB200A0 */ lw $s2, 0xA0($sp)
/* 35C514 E0050544 8FB1009C */ lw $s1, 0x9C($sp)
/* 35C518 E0050548 8FB00098 */ lw $s0, 0x98($sp)
/* 35C51C E005054C D7B600B8 */ ldc1 $f22, 0xB8($sp)
/* 35C520 E0050550 D7B400B0 */ ldc1 $f20, 0xB0($sp)
/* 35C524 E0050554 03E00008 */ jr $ra
/* 35C528 E0050558 27BD00C0 */ addiu $sp, $sp, 0xC0
/* 35C52C E005055C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void sweat_appendGfx(void* effect) {
SweatFXData* data = ((EffectInstance*)effect)->data.sweat;
Matrix4f sp18;
Matrix4f sp58;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, data->unk_10, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (data->unk_10 > 0.0f) {
gSPDisplayList(gMainGfxPos++, data->unk_00 == 0 ? D_09000200_35C750 : D_090002C8_35C818);
} else {
gSPDisplayList(gMainGfxPos++, data->unk_00 == 0 ? D_09000390_35C8E0 : D_09000460_35C9B0);
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel EnemyTestTarget
/* 1AB898 8027CFB8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 1AB89C 8027CFBC AFB3001C */ sw $s3, 0x1C($sp)
/* 1AB8A0 8027CFC0 0080982D */ daddu $s3, $a0, $zero
/* 1AB8A4 8027CFC4 AFBF0024 */ sw $ra, 0x24($sp)
/* 1AB8A8 8027CFC8 AFB40020 */ sw $s4, 0x20($sp)
/* 1AB8AC 8027CFCC AFB20018 */ sw $s2, 0x18($sp)
/* 1AB8B0 8027CFD0 AFB10014 */ sw $s1, 0x14($sp)
/* 1AB8B4 8027CFD4 AFB00010 */ sw $s0, 0x10($sp)
/* 1AB8B8 8027CFD8 8E70000C */ lw $s0, 0xC($s3)
/* 1AB8BC 8027CFDC 8E050000 */ lw $a1, 0x0($s0)
/* 1AB8C0 8027CFE0 0C0B1EAF */ jal evt_get_variable
/* 1AB8C4 8027CFE4 26100004 */ addiu $s0, $s0, 0x4
/* 1AB8C8 8027CFE8 0040202D */ daddu $a0, $v0, $zero
/* 1AB8CC 8027CFEC 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 1AB8D0 8027CFF0 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 1AB8D4 8027CFF4 2402FF81 */ addiu $v0, $zero, -0x7F
/* 1AB8D8 8027CFF8 14820002 */ bne $a0, $v0, .L8027D004
/* 1AB8DC 8027CFFC 00000000 */ nop
/* 1AB8E0 8027D000 8E640148 */ lw $a0, 0x148($s3)
.L8027D004:
/* 1AB8E4 8027D004 0C09A75B */ jal get_actor
/* 1AB8E8 8027D008 00000000 */ nop
/* 1AB8EC 8027D00C 8E140000 */ lw $s4, 0x0($s0)
/* 1AB8F0 8027D010 26100004 */ addiu $s0, $s0, 0x4
/* 1AB8F4 8027D014 8E030000 */ lw $v1, 0x0($s0)
/* 1AB8F8 8027D018 26100004 */ addiu $s0, $s0, 0x4
/* 1AB8FC 8027D01C 0260202D */ daddu $a0, $s3, $zero
/* 1AB900 8027D020 0040902D */ daddu $s2, $v0, $zero
/* 1AB904 8027D024 AE20018C */ sw $zero, 0x18C($s1)
/* 1AB908 8027D028 AE230188 */ sw $v1, 0x188($s1)
/* 1AB90C 8027D02C 8E030000 */ lw $v1, 0x0($s0)
/* 1AB910 8027D030 26100004 */ addiu $s0, $s0, 0x4
/* 1AB914 8027D034 AE230190 */ sw $v1, 0x190($s1)
/* 1AB918 8027D038 8E050000 */ lw $a1, 0x0($s0)
/* 1AB91C 8027D03C 0C0B1EAF */ jal evt_get_variable
/* 1AB920 8027D040 26100004 */ addiu $s0, $s0, 0x4
/* 1AB924 8027D044 A622017E */ sh $v0, 0x17E($s1)
/* 1AB928 8027D048 8E050000 */ lw $a1, 0x0($s0)
/* 1AB92C 8027D04C 30A20010 */ andi $v0, $a1, 0x10
/* 1AB930 8027D050 10400004 */ beqz $v0, .L8027D064
/* 1AB934 8027D054 2403FFDF */ addiu $v1, $zero, -0x21
/* 1AB938 8027D058 8E220000 */ lw $v0, 0x0($s1)
/* 1AB93C 8027D05C 0809F423 */ j .L8027D08C
/* 1AB940 8027D060 34420010 */ ori $v0, $v0, 0x10
.L8027D064:
/* 1AB944 8027D064 30A20020 */ andi $v0, $a1, 0x20
/* 1AB948 8027D068 10400005 */ beqz $v0, .L8027D080
/* 1AB94C 8027D06C 2403FFEF */ addiu $v1, $zero, -0x11
/* 1AB950 8027D070 8E220000 */ lw $v0, 0x0($s1)
/* 1AB954 8027D074 00431024 */ and $v0, $v0, $v1
/* 1AB958 8027D078 0809F424 */ j .L8027D090
/* 1AB95C 8027D07C 34420020 */ ori $v0, $v0, 0x20
.L8027D080:
/* 1AB960 8027D080 8E220000 */ lw $v0, 0x0($s1)
/* 1AB964 8027D084 00431024 */ and $v0, $v0, $v1
/* 1AB968 8027D088 2403FFDF */ addiu $v1, $zero, -0x21
.L8027D08C:
/* 1AB96C 8027D08C 00431024 */ and $v0, $v0, $v1
.L8027D090:
/* 1AB970 8027D090 AE220000 */ sw $v0, 0x0($s1)
/* 1AB974 8027D094 30A20040 */ andi $v0, $a1, 0x40
/* 1AB978 8027D098 10400007 */ beqz $v0, .L8027D0B8
/* 1AB97C 8027D09C 2404FFBF */ addiu $a0, $zero, -0x41
/* 1AB980 8027D0A0 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1AB984 8027D0A4 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1AB988 8027D0A8 8C620000 */ lw $v0, 0x0($v1)
/* 1AB98C 8027D0AC 34420040 */ ori $v0, $v0, 0x40
/* 1AB990 8027D0B0 0809F433 */ j .L8027D0CC
/* 1AB994 8027D0B4 AC620000 */ sw $v0, 0x0($v1)
.L8027D0B8:
/* 1AB998 8027D0B8 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1AB99C 8027D0BC 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1AB9A0 8027D0C0 8C430000 */ lw $v1, 0x0($v0)
/* 1AB9A4 8027D0C4 00641824 */ and $v1, $v1, $a0
/* 1AB9A8 8027D0C8 AC430000 */ sw $v1, 0x0($v0)
.L8027D0CC:
/* 1AB9AC 8027D0CC 30A20200 */ andi $v0, $a1, 0x200
/* 1AB9B0 8027D0D0 10400007 */ beqz $v0, .L8027D0F0
/* 1AB9B4 8027D0D4 2404FDFF */ addiu $a0, $zero, -0x201
/* 1AB9B8 8027D0D8 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1AB9BC 8027D0DC 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1AB9C0 8027D0E0 8C620000 */ lw $v0, 0x0($v1)
/* 1AB9C4 8027D0E4 34420200 */ ori $v0, $v0, 0x200
/* 1AB9C8 8027D0E8 0809F441 */ j .L8027D104
/* 1AB9CC 8027D0EC AC620000 */ sw $v0, 0x0($v1)
.L8027D0F0:
/* 1AB9D0 8027D0F0 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1AB9D4 8027D0F4 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1AB9D8 8027D0F8 8C430000 */ lw $v1, 0x0($v0)
/* 1AB9DC 8027D0FC 00641824 */ and $v1, $v1, $a0
/* 1AB9E0 8027D100 AC430000 */ sw $v1, 0x0($v0)
.L8027D104:
/* 1AB9E4 8027D104 30A20080 */ andi $v0, $a1, 0x80
/* 1AB9E8 8027D108 10400007 */ beqz $v0, .L8027D128
/* 1AB9EC 8027D10C 2404FF7F */ addiu $a0, $zero, -0x81
/* 1AB9F0 8027D110 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1AB9F4 8027D114 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1AB9F8 8027D118 8C620000 */ lw $v0, 0x0($v1)
/* 1AB9FC 8027D11C 34420080 */ ori $v0, $v0, 0x80
/* 1ABA00 8027D120 0809F44F */ j .L8027D13C
/* 1ABA04 8027D124 AC620000 */ sw $v0, 0x0($v1)
.L8027D128:
/* 1ABA08 8027D128 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1ABA0C 8027D12C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 1ABA10 8027D130 8C430000 */ lw $v1, 0x0($v0)
/* 1ABA14 8027D134 00641824 */ and $v1, $v1, $a0
/* 1ABA18 8027D138 AC430000 */ sw $v1, 0x0($v0)
.L8027D13C:
/* 1ABA1C 8027D13C 96420428 */ lhu $v0, 0x428($s2)
/* 1ABA20 8027D140 92230193 */ lbu $v1, 0x193($s1)
/* 1ABA24 8027D144 A62201A0 */ sh $v0, 0x1A0($s1)
/* 1ABA28 8027D148 92420426 */ lbu $v0, 0x426($s2)
/* 1ABA2C 8027D14C A2230194 */ sb $v1, 0x194($s1)
/* 1ABA30 8027D150 306300FF */ andi $v1, $v1, 0xFF
/* 1ABA34 8027D154 A22201A2 */ sb $v0, 0x1A2($s1)
/* 1ABA38 8027D158 240200FF */ addiu $v0, $zero, 0xFF
/* 1ABA3C 8027D15C 50620001 */ beql $v1, $v0, .L8027D164
/* 1ABA40 8027D160 A2200194 */ sb $zero, 0x194($s1)
.L8027D164:
/* 1ABA44 8027D164 8E220190 */ lw $v0, 0x190($s1)
/* 1ABA48 8027D168 0240202D */ daddu $a0, $s2, $zero
/* 1ABA4C 8027D16C 30420F00 */ andi $v0, $v0, 0xF00
/* 1ABA50 8027D170 00021203 */ sra $v0, $v0, 8
/* 1ABA54 8027D174 0C09DC7E */ jal calc_enemy_test_target
/* 1ABA58 8027D178 A2220195 */ sb $v0, 0x195($s1)
/* 1ABA5C 8027D17C 04400006 */ bltz $v0, .L8027D198
/* 1ABA60 8027D180 0260202D */ daddu $a0, $s3, $zero
/* 1ABA64 8027D184 0280282D */ daddu $a1, $s4, $zero
/* 1ABA68 8027D188 0C0B2026 */ jal evt_set_variable
/* 1ABA6C 8027D18C 0040302D */ daddu $a2, $v0, $zero
/* 1ABA70 8027D190 0809F467 */ j .L8027D19C
/* 1ABA74 8027D194 24020002 */ addiu $v0, $zero, 0x2
.L8027D198:
/* 1ABA78 8027D198 240200FF */ addiu $v0, $zero, 0xFF
.L8027D19C:
/* 1ABA7C 8027D19C 8FBF0024 */ lw $ra, 0x24($sp)
/* 1ABA80 8027D1A0 8FB40020 */ lw $s4, 0x20($sp)
/* 1ABA84 8027D1A4 8FB3001C */ lw $s3, 0x1C($sp)
/* 1ABA88 8027D1A8 8FB20018 */ lw $s2, 0x18($sp)
/* 1ABA8C 8027D1AC 8FB10014 */ lw $s1, 0x14($sp)
/* 1ABA90 8027D1B0 8FB00010 */ lw $s0, 0x10($sp)
/* 1ABA94 8027D1B4 03E00008 */ jr $ra
/* 1ABA98 8027D1B8 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
ApiStatus EnemyTestTarget(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
BattleStatus* battleStatus = &gBattleStatus;
s32 actorID = evt_get_variable(script, *args++);
Actor *actor;
s32 outVar;
s32 hitResult;
u8 attackStatus;
s32 battleStatusFlags1Temp;
s32 battleFlagsModifier;
if (actorID == ACTOR_SELF) {
actorID = script->owner1.enemyID;
}
actor = get_actor(actorID);
outVar = *args++;
battleStatus->currentAttackElement = *args++;
battleStatus->currentAttackEventSuppression = 0;
battleStatus->currentAttackStatus = *args++;
battleStatus->currentAttackDamage = evt_get_variable(script, *args++);
battleFlagsModifier = *args++;
if (battleFlagsModifier & BS_FLAGS1_10) {
gBattleStatus.flags1 |= BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
} else if (battleFlagsModifier & BS_FLAGS1_SP_EVT_ACTIVE) {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
}
if (battleFlagsModifier & BS_FLAGS1_40) {
gBattleStatus.flags1 |= BS_FLAGS1_40;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_40;
}
if (battleFlagsModifier & BS_FLAGS1_200) {
gBattleStatus.flags1 |= BS_FLAGS1_200;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_200;
}
if (battleFlagsModifier & BS_FLAGS1_80) {
gBattleStatus.flags1 |= BS_FLAGS1_80;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_80;
}
attackStatus = battleStatus->currentAttackStatus;
battleStatus->currentTargetID = actor->targetActorID;
battleStatus->currentTargetPart = actor->targetPartIndex;
battleStatus->statusChance = attackStatus;
if ((attackStatus & 0xFF) == 0xFF) {
battleStatus->statusChance = 0;
}
battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8;
hitResult = calc_enemy_test_target(actor);
if (hitResult < 0) {
return ApiStatus_FINISH;
}
evt_set_variable(script, outVar, hitResult);
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel parasol_get_npc
/* E23260 802B6000 27BDFFD0 */ addiu $sp, $sp, -0x30
/* E23264 802B6004 AFB1001C */ sw $s1, 0x1C($sp)
/* E23268 802B6008 AFB00018 */ sw $s0, 0x18($sp)
/* E2326C 802B600C 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* E23270 802B6010 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* E23274 802B6014 AFBF0024 */ sw $ra, 0x24($sp)
.L802B6018:
/* E23278 802B6018 AFB20020 */ sw $s2, 0x20($sp)
/* E2327C 802B601C F7B40028 */ sdc1 $f20, 0x28($sp)
/* E23280 802B6020 8E040004 */ lw $a0, 0x4($s0)
/* E23284 802B6024 3C128011 */ lui $s2, %hi(gPlayerData)
/* E23288 802B6028 2652F290 */ addiu $s2, $s2, %lo(gPlayerData)
/* E2328C 802B602C 30821000 */ andi $v0, $a0, 0x1000
/* E23290 802B6030 10400005 */ beqz $v0, action_hammer_play_hit_fx
/* E23294 802B6034 0000882D */ daddu $s1, $zero, $zero
/* E23298 802B6038 0C0AD879 */ jal func_802B61E4
/* E2329C 802B603C 00000000 */ nop
.L802B6040:
/* E232A0 802B6040 080AD872 */ j .L802B61C8
.L802B6044:
/* E232A4 802B6044 00000000 */ nop
glabel action_hammer_play_hit_fx
/* E232A8 802B6048 96020008 */ lhu $v0, 0x8($s0)
.L802B604C:
/* E232AC 802B604C 8E030000 */ lw $v1, 0x0($s0)
.L802B6050:
/* E232B0 802B6050 24420001 */ addiu $v0, $v0, 0x1
/* E232B4 802B6054 0461001E */ bgez $v1, .L802B60D0
.L802B6058:
/* E232B8 802B6058 A6020008 */ sh $v0, 0x8($s0)
/* E232BC 802B605C 3C027FF7 */ lui $v0, (0x7FF7FFF1 >> 16)
glabel action_update_sliding
/* E232C0 802B6060 3442FFF1 */ ori $v0, $v0, (0x7FF7FFF1 & 0xFFFF)
/* E232C4 802B6064 24110001 */ addiu $s1, $zero, 0x1
.L802B6068:
/* E232C8 802B6068 00621024 */ and $v0, $v1, $v0
/* E232CC 802B606C AE020000 */ sw $v0, 0x0($s0)
/* E232D0 802B6070 30824000 */ andi $v0, $a0, 0x4000
.L802B6074:
/* E232D4 802B6074 A20000B6 */ sb $zero, 0xB6($s0)
/* E232D8 802B6078 A6000008 */ sh $zero, 0x8($s0)
glabel .L802B607C
/* E232DC 802B607C A60000C0 */ sh $zero, 0xC0($s0)
.L802B6080:
/* E232E0 802B6080 A60000C2 */ sh $zero, 0xC2($s0)
/* E232E4 802B6084 AE000054 */ sw $zero, 0x54($s0)
/* E232E8 802B6088 10400004 */ beqz $v0, action_update_state_23
.L802B608C:
/* E232EC 802B608C AE00008C */ sw $zero, 0x8C($s0)
.L802B6090:
/* E232F0 802B6090 3C040009 */ lui $a0, (0x90002 >> 16)
.L802B6094:
/* E232F4 802B6094 080AD832 */ j .L802B60C8
/* E232F8 802B6098 34840002 */ ori $a0, $a0, (0x90002 & 0xFFFF)
glabel action_update_state_23
/* E232FC 802B609C 30820001 */ andi $v0, $a0, 0x1
/* E23300 802B60A0 54400004 */ bnel $v0, $zero, action_update_jump
glabel action_update_use_spinning_flower
/* E23304 802B60A4 3C040006 */ lui $a0, (0x60007 >> 16)
.L802B60A8:
/* E23308 802B60A8 3C040001 */ lui $a0, (0x10007 >> 16)
.L802B60AC:
/* E2330C 802B60AC 080AD832 */ j .L802B60C8
/* E23310 802B60B0 34840002 */ ori $a0, $a0, (0x10002 & 0xFFFF)
glabel action_update_jump
/* E23314 802B60B4 820200B5 */ lb $v0, 0xB5($s0)
/* E23318 802B60B8 14400003 */ bnez $v0, .L802B60C8
/* E2331C 802B60BC 34840007 */ ori $a0, $a0, (0x10007 & 0xFFFF)
/* E23320 802B60C0 3C040006 */ lui $a0, (0x60005 >> 16)
/* E23324 802B60C4 34840005 */ ori $a0, $a0, (0x60005 & 0xFFFF)
.L802B60C8:
/* E23328 802B60C8 0C037FBF */ jal suggest_player_anim_allow_backward
/* E2332C 802B60CC 00000000 */ nop
glabel .L802B60D0
/* E23330 802B60D0 8E020004 */ lw $v0, 0x4($s0)
.L802B60D4:
/* E23334 802B60D4 30420200 */ andi $v0, $v0, 0x200
/* E23338 802B60D8 10400005 */ beqz $v0, .L802B60F0
/* E2333C 802B60DC 27A40010 */ addiu $a0, $sp, 0x10
/* E23340 802B60E0 0C039769 */ jal set_action_state
/* E23344 802B60E4 2404001C */ addiu $a0, $zero, 0x1C
.L802B60E8:
/* E23348 802B60E8 080AD872 */ j .L802B61C8
.L802B60EC:
/* E2334C 802B60EC 00000000 */ nop
.L802B60F0:
/* E23350 802B60F0 0C0388C1 */ jal player_input_to_move_vector
glabel .L802B60F4
/* E23354 802B60F4 27A50014 */ addiu $a1, $sp, 0x14
/* E23358 802B60F8 0C039454 */ jal phys_update_interact_collider
/* E2335C 802B60FC 00000000 */ nop
.L802B6100:
/* E23360 802B6100 0C039858 */ jal check_input_jump
.L802B6104:
/* E23364 802B6104 00000000 */ nop
.L802B6108:
/* E23368 802B6108 10400011 */ beqz $v0, .L802B6150
glabel .L802B610C
/* E2336C 802B610C 00000000 */ nop
.L802B6110:
/* E23370 802B6110 C7A20014 */ lwc1 $f2, 0x14($sp)
/* E23374 802B6114 44800000 */ mtc1 $zero, $f0
.L802B6118:
/* E23378 802B6118 00000000 */ nop
/* E2337C 802B611C 46001032 */ c.eq.s $f2, $f0
glabel action_update_parasol
/* E23380 802B6120 00000000 */ nop
.L802B6124:
/* E23384 802B6124 45000007 */ bc1f .L802B6144
.L802B6128:
/* E23388 802B6128 00000000 */ nop
/* E2338C 802B612C C6020080 */ lwc1 $f2, 0x80($s0)
/* E23390 802B6130 C7A00010 */ lwc1 $f0, 0x10($sp)
glabel .L802B6134
/* E23394 802B6134 46001032 */ c.eq.s $f2, $f0
/* E23398 802B6138 00000000 */ nop
.L802B613C:
/* E2339C 802B613C 45010022 */ bc1t .L802B61C8
.L802B6140:
/* E233A0 802B6140 00000000 */ nop
.L802B6144:
/* E233A4 802B6144 C7A00010 */ lwc1 $f0, 0x10($sp)
/* E233A8 802B6148 080AD872 */ j .L802B61C8
.L802B614C:
/* E233AC 802B614C E6000080 */ swc1 $f0, 0x80($s0)
.L802B6150:
/* E233B0 802B6150 16200005 */ bnez $s1, .L802B6168
.L802B6154:
/* E233B4 802B6154 00000000 */ nop
.L802B6158:
/* E233B8 802B6158 0C039838 */ jal check_input_hammer
.L802B615C:
/* E233BC 802B615C 00000000 */ nop
/* E233C0 802B6160 14400019 */ bnez $v0, .L802B61C8
.L802B6164:
/* E233C4 802B6164 00000000 */ nop
.L802B6168:
/* E233C8 802B6168 C7A00014 */ lwc1 $f0, 0x14($sp)
/* E233CC 802B616C 4480A000 */ mtc1 $zero, $f20
glabel .L802B6170
/* E233D0 802B6170 00000000 */ nop
glabel .L802B6174
/* E233D4 802B6174 46140032 */ c.eq.s $f0, $f20
/* E233D8 802B6178 00000000 */ nop
.L802B617C:
/* E233DC 802B617C 45000005 */ bc1f .L802B6194
.L802B6180:
/* E233E0 802B6180 24040001 */ addiu $a0, $zero, 0x1
glabel .L802B6184
/* E233E4 802B6184 964202B8 */ lhu $v0, 0x2B8($s2)
.L802B6188:
/* E233E8 802B6188 24420001 */ addiu $v0, $v0, 0x1
.L802B618C:
/* E233EC 802B618C 080AD872 */ j .L802B61C8
.L802B6190:
/* E233F0 802B6190 A64202B8 */ sh $v0, 0x2B8($s2)
.L802B6194:
/* E233F4 802B6194 0C039769 */ jal set_action_state
glabel func_802B6198
/* E233F8 802B6198 A6000008 */ sh $zero, 0x8($s0)
/* E233FC 802B619C C7A00014 */ lwc1 $f0, 0x14($sp)
.L802B61A0:
/* E23400 802B61A0 46140032 */ c.eq.s $f0, $f20
.L802B61A4:
/* E23404 802B61A4 00000000 */ nop
.L802B61A8:
/* E23408 802B61A8 45010007 */ bc1t .L802B61C8
.L802B61AC:
/* E2340C 802B61AC 3C037FFF */ lui $v1, (0x7FFFFFFF >> 16)
.L802B61B0:
/* E23410 802B61B0 3463FFFF */ ori $v1, $v1, (0x7FFFFFFF & 0xFFFF)
.L802B61B4:
/* E23414 802B61B4 8E020004 */ lw $v0, 0x4($s0)
/* E23418 802B61B8 C7A00010 */ lwc1 $f0, 0x10($sp)
/* E2341C 802B61BC 00431024 */ and $v0, $v0, $v1
glabel func_802B61C0
/* E23420 802B61C0 E6000080 */ swc1 $f0, 0x80($s0)
/* E23424 802B61C4 AE020004 */ sw $v0, 0x4($s0)
.L802B61C8:
/* E23428 802B61C8 8FBF0024 */ lw $ra, 0x24($sp)
.L802B61CC:
/* E2342C 802B61CC 8FB20020 */ lw $s2, 0x20($sp)
/* E23430 802B61D0 8FB1001C */ lw $s1, 0x1C($sp)
.L802B61D4:
/* E23434 802B61D4 8FB00018 */ lw $s0, 0x18($sp)
.L802B61D8:
/* E23438 802B61D8 D7B40028 */ ldc1 $f20, 0x28($sp)
.L802B61DC:
/* E2343C 802B61DC 03E00008 */ jr $ra
/* E23440 802B61E0 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void action_update_idle(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerData* playerData = &gPlayerData;
s32 wasMoving = FALSE;
f32 angle, magnitude;
AnimID anim;
if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
action_update_idle_peach();
return;
}
playerStatus->currentStateTime++;
if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~(PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_ARMS_RAISED | PS_FLAG_AIRBORNE);
wasMoving = TRUE;
playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT;
playerStatus->currentStateTime = 0;
playerStatus->timeInAir = 0;
playerStatus->peakJumpTime = 0;
playerStatus->currentSpeed = 0.0f;
playerStatus->pitch = 0.0f;
if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) {
anim = ANIM_MarioW3_8bit_Still;
} else if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
anim = ANIM_Mario1_Idle;
} else if (playerStatus->prevActionState == ACTION_STATE_IDLE) {
anim = ANIM_MarioW1_TakeItem;
} else {
anim = ANIM_MarioW1_CarryIdle;
}
suggest_player_anim_allow_backward(anim);
}
if (playerStatus->animFlags & PA_FLAG_RAISED_ARMS) {
set_action_state(ACTION_STATE_RAISE_ARMS);
} else {
player_input_to_move_vector(&angle, &magnitude);
phys_update_interact_collider();
if (check_input_jump()) {
if (magnitude != 0.0f || playerStatus->targetYaw != angle) {
playerStatus->targetYaw = angle;
}
} else if (wasMoving || !check_input_hammer()) {
if (magnitude == 0.0f) {
playerData->idleFrameCounter++;
} else {
playerStatus->currentStateTime = 0;
set_action_state(ACTION_STATE_WALK);
if (magnitude != 0.0f) {
playerStatus->targetYaw = angle;
playerStatus->animFlags &= ~PA_FLAG_80000000;
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_80027774
/* 2B74 80027774 27BDFF90 */ addiu $sp, $sp, -0x70
/* 2B78 80027778 AFB40058 */ sw $s4, 0x58($sp)
/* 2B7C 8002777C 0080A02D */ daddu $s4, $a0, $zero
/* 2B80 80027780 AFB5005C */ sw $s5, 0x5C($sp)
/* 2B84 80027784 00A0A82D */ daddu $s5, $a1, $zero
/* 2B88 80027788 AFB30054 */ sw $s3, 0x54($sp)
/* 2B8C 8002778C 24130001 */ addiu $s3, $zero, 0x1
/* 2B90 80027790 27A80018 */ addiu $t0, $sp, 0x18
/* 2B94 80027794 AFA80040 */ sw $t0, 0x40($sp)
/* 2B98 80027798 24080140 */ addiu $t0, $zero, 0x140
/* 2B9C 8002779C AFBF006C */ sw $ra, 0x6C($sp)
/* 2BA0 800277A0 AFBE0068 */ sw $fp, 0x68($sp)
/* 2BA4 800277A4 AFB70064 */ sw $s7, 0x64($sp)
/* 2BA8 800277A8 AFB60060 */ sw $s6, 0x60($sp)
/* 2BAC 800277AC AFB20050 */ sw $s2, 0x50($sp)
/* 2BB0 800277B0 AFB1004C */ sw $s1, 0x4C($sp)
/* 2BB4 800277B4 AFB00048 */ sw $s0, 0x48($sp)
/* 2BB8 800277B8 AFA60078 */ sw $a2, 0x78($sp)
/* 2BBC 800277BC AFA80044 */ sw $t0, 0x44($sp)
.L800277C0:
/* 2BC0 800277C0 24120001 */ addiu $s2, $zero, 0x1
/* 2BC4 800277C4 267EFFFF */ addiu $fp, $s3, -0x1
/* 2BC8 800277C8 8FA80044 */ lw $t0, 0x44($sp)
/* 2BCC 800277CC 0272B821 */ addu $s7, $s3, $s2
/* 2BD0 800277D0 0112B021 */ addu $s6, $t0, $s2
/* 2BD4 800277D4 00161840 */ sll $v1, $s6, 1
.L800277D8:
/* 2BD8 800277D8 00752021 */ addu $a0, $v1, $s5
/* 2BDC 800277DC 9482FFFE */ lhu $v0, -0x2($a0)
/* 2BE0 800277E0 00021082 */ srl $v0, $v0, 2
/* 2BE4 800277E4 3042000F */ andi $v0, $v0, 0xF
/* 2BE8 800277E8 2C420008 */ sltiu $v0, $v0, 0x8
/* 2BEC 800277EC 5440000D */ bnel $v0, $zero, .L80027824
/* 2BF0 800277F0 0280202D */ daddu $a0, $s4, $zero
/* 2BF4 800277F4 94820000 */ lhu $v0, 0x0($a0)
/* 2BF8 800277F8 00021082 */ srl $v0, $v0, 2
/* 2BFC 800277FC 3042000F */ andi $v0, $v0, 0xF
/* 2C00 80027800 2C420008 */ sltiu $v0, $v0, 0x8
/* 2C04 80027804 54400007 */ bnel $v0, $zero, .L80027824
/* 2C08 80027808 0280202D */ daddu $a0, $s4, $zero
/* 2C0C 8002780C 94820002 */ lhu $v0, 0x2($a0)
/* 2C10 80027810 00021082 */ srl $v0, $v0, 2
/* 2C14 80027814 3042000F */ andi $v0, $v0, 0xF
/* 2C18 80027818 2C420008 */ sltiu $v0, $v0, 0x8
/* 2C1C 8002781C 10400048 */ beqz $v0, .L80027940
/* 2C20 80027820 0280202D */ daddu $a0, $s4, $zero
.L80027824:
/* 2C24 80027824 02A0282D */ daddu $a1, $s5, $zero
/* 2C28 80027828 03C0302D */ daddu $a2, $fp, $zero
/* 2C2C 8002782C 2650FFFF */ addiu $s0, $s2, -0x1
/* 2C30 80027830 8FA80040 */ lw $t0, 0x40($sp)
/* 2C34 80027834 0200382D */ daddu $a3, $s0, $zero
/* 2C38 80027838 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2C3C 8002783C AFA80010 */ sw $t0, 0x10($sp)
/* 2C40 80027840 0280202D */ daddu $a0, $s4, $zero
/* 2C44 80027844 02A0282D */ daddu $a1, $s5, $zero
/* 2C48 80027848 03C0302D */ daddu $a2, $fp, $zero
/* 2C4C 8002784C 0240382D */ daddu $a3, $s2, $zero
/* 2C50 80027850 27A2001C */ addiu $v0, $sp, 0x1C
/* 2C54 80027854 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2C58 80027858 AFA20010 */ sw $v0, 0x10($sp)
/* 2C5C 8002785C 0280202D */ daddu $a0, $s4, $zero
/* 2C60 80027860 02A0282D */ daddu $a1, $s5, $zero
/* 2C64 80027864 03C0302D */ daddu $a2, $fp, $zero
/* 2C68 80027868 26510001 */ addiu $s1, $s2, 0x1
/* 2C6C 8002786C 0220382D */ daddu $a3, $s1, $zero
/* 2C70 80027870 27A20020 */ addiu $v0, $sp, 0x20
/* 2C74 80027874 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2C78 80027878 AFA20010 */ sw $v0, 0x10($sp)
/* 2C7C 8002787C 0280202D */ daddu $a0, $s4, $zero
/* 2C80 80027880 02A0282D */ daddu $a1, $s5, $zero
/* 2C84 80027884 0260302D */ daddu $a2, $s3, $zero
/* 2C88 80027888 0200382D */ daddu $a3, $s0, $zero
/* 2C8C 8002788C 27A20024 */ addiu $v0, $sp, 0x24
/* 2C90 80027890 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2C94 80027894 AFA20010 */ sw $v0, 0x10($sp)
/* 2C98 80027898 0280202D */ daddu $a0, $s4, $zero
/* 2C9C 8002789C 02A0282D */ daddu $a1, $s5, $zero
/* 2CA0 800278A0 0260302D */ daddu $a2, $s3, $zero
/* 2CA4 800278A4 0240382D */ daddu $a3, $s2, $zero
/* 2CA8 800278A8 27A20028 */ addiu $v0, $sp, 0x28
/* 2CAC 800278AC 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2CB0 800278B0 AFA20010 */ sw $v0, 0x10($sp)
/* 2CB4 800278B4 0280202D */ daddu $a0, $s4, $zero
/* 2CB8 800278B8 02A0282D */ daddu $a1, $s5, $zero
/* 2CBC 800278BC 0260302D */ daddu $a2, $s3, $zero
/* 2CC0 800278C0 0220382D */ daddu $a3, $s1, $zero
/* 2CC4 800278C4 27A2002C */ addiu $v0, $sp, 0x2C
/* 2CC8 800278C8 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2CCC 800278CC AFA20010 */ sw $v0, 0x10($sp)
/* 2CD0 800278D0 0280202D */ daddu $a0, $s4, $zero
/* 2CD4 800278D4 02A0282D */ daddu $a1, $s5, $zero
/* 2CD8 800278D8 02E0302D */ daddu $a2, $s7, $zero
/* 2CDC 800278DC 0200382D */ daddu $a3, $s0, $zero
/* 2CE0 800278E0 27A20030 */ addiu $v0, $sp, 0x30
/* 2CE4 800278E4 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2CE8 800278E8 AFA20010 */ sw $v0, 0x10($sp)
/* 2CEC 800278EC 0280202D */ daddu $a0, $s4, $zero
/* 2CF0 800278F0 02A0282D */ daddu $a1, $s5, $zero
/* 2CF4 800278F4 02E0302D */ daddu $a2, $s7, $zero
/* 2CF8 800278F8 0240382D */ daddu $a3, $s2, $zero
/* 2CFC 800278FC 27A20034 */ addiu $v0, $sp, 0x34
/* 2D00 80027900 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2D04 80027904 AFA20010 */ sw $v0, 0x10($sp)
/* 2D08 80027908 0280202D */ daddu $a0, $s4, $zero
/* 2D0C 8002790C 02A0282D */ daddu $a1, $s5, $zero
/* 2D10 80027910 02E0302D */ daddu $a2, $s7, $zero
/* 2D14 80027914 0220382D */ daddu $a3, $s1, $zero
/* 2D18 80027918 27A20038 */ addiu $v0, $sp, 0x38
/* 2D1C 8002791C 0C009C7F */ jal gfx_frame_filter_pass_0
/* 2D20 80027920 AFA20010 */ sw $v0, 0x10($sp)
/* 2D24 80027924 00162840 */ sll $a1, $s6, 1
/* 2D28 80027928 8FA80078 */ lw $t0, 0x78($sp)
/* 2D2C 8002792C 8FA40040 */ lw $a0, 0x40($sp)
/* 2D30 80027930 0C009D80 */ jal func_80027600
/* 2D34 80027934 01052821 */ addu $a1, $t0, $a1
/* 2D38 80027938 08009E57 */ j .L8002795C
/* 2D3C 8002793C 26D60001 */ addiu $s6, $s6, 0x1
.L80027940:
/* 2D40 80027940 00741021 */ addu $v0, $v1, $s4
/* 2D44 80027944 8FA80078 */ lw $t0, 0x78($sp)
/* 2D48 80027948 94420000 */ lhu $v0, 0x0($v0)
/* 2D4C 8002794C 00681821 */ addu $v1, $v1, $t0
/* 2D50 80027950 34420001 */ ori $v0, $v0, 0x1
/* 2D54 80027954 A4620000 */ sh $v0, 0x0($v1)
/* 2D58 80027958 26D60001 */ addiu $s6, $s6, 0x1
.L8002795C:
/* 2D5C 8002795C 26520001 */ addiu $s2, $s2, 0x1
/* 2D60 80027960 2A42013F */ slti $v0, $s2, 0x13F
/* 2D64 80027964 1440FF9C */ bnez $v0, .L800277D8
/* 2D68 80027968 00161840 */ sll $v1, $s6, 1
/* 2D6C 8002796C 26730001 */ addiu $s3, $s3, 0x1
/* 2D70 80027970 8FA80044 */ lw $t0, 0x44($sp)
/* 2D74 80027974 2A6200EF */ slti $v0, $s3, 0xEF
/* 2D78 80027978 25080140 */ addiu $t0, $t0, 0x140
/* 2D7C 8002797C 1440FF90 */ bnez $v0, .L800277C0
/* 2D80 80027980 AFA80044 */ sw $t0, 0x44($sp)
/* 2D84 80027984 8FBF006C */ lw $ra, 0x6C($sp)
/* 2D88 80027988 8FBE0068 */ lw $fp, 0x68($sp)
/* 2D8C 8002798C 8FB70064 */ lw $s7, 0x64($sp)
/* 2D90 80027990 8FB60060 */ lw $s6, 0x60($sp)
/* 2D94 80027994 8FB5005C */ lw $s5, 0x5C($sp)
/* 2D98 80027998 8FB40058 */ lw $s4, 0x58($sp)
/* 2D9C 8002799C 8FB30054 */ lw $s3, 0x54($sp)
/* 2DA0 800279A0 8FB20050 */ lw $s2, 0x50($sp)
/* 2DA4 800279A4 8FB1004C */ lw $s1, 0x4C($sp)
/* 2DA8 800279A8 8FB00048 */ lw $s0, 0x48($sp)
/* 2DAC 800279AC 03E00008 */ jr $ra
/* 2DB0 800279B0 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void func_80027774(u16* frameBuffer0, u16* frameBuffer1, u16* zBuffer) {
Color_RGBA8 filterBuf0[9];
s32 x, y;
for (y = 1; y < SCREEN_HEIGHT - 1; y++) {
for (x = 1; x < SCREEN_WIDTH - 1; x++) {
/*
The application of gfx_frame_filter_pass_0 is done to the following pixels, where x is the current pixel.
...
.x.
...
*/
if (
(((frameBuffer1[(SCREEN_WIDTH * y) + x - 1] >> 2) & 0xF) < 8) ||
(((frameBuffer1[(SCREEN_WIDTH * y) + x + 0] >> 2) & 0xF) < 8) ||
(((frameBuffer1[(SCREEN_WIDTH * y) + x + 1] >> 2) & 0xF) < 8))
{
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y - 1, x - 1, &filterBuf0[0]);
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y - 1, x, &filterBuf0[1]);
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y - 1, x + 1, &filterBuf0[2]);
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y , x - 1, &filterBuf0[3]);
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y , x, &filterBuf0[4]);
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y , x + 1, &filterBuf0[5]);
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y + 1, x - 1, &filterBuf0[6]);
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y + 1, x, &filterBuf0[7]);
gfx_frame_filter_pass_0(frameBuffer0, frameBuffer1, y + 1, x + 1, &filterBuf0[8]);
func_80027600(filterBuf0, &zBuffer[(SCREEN_WIDTH * y) + x]);
} else {
zBuffer[(SCREEN_WIDTH * y) + x] = frameBuffer0[(SCREEN_WIDTH * y) + x] | 1;
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel effect_65_update
/* 3D0748 E00CA248 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 3D074C E00CA24C AFBF0018 */ sw $ra, 0x18($sp)
/* 3D0750 E00CA250 AFB10014 */ sw $s1, 0x14($sp)
/* 3D0754 E00CA254 AFB00010 */ sw $s0, 0x10($sp)
/* 3D0758 E00CA258 F7B40020 */ sdc1 $f20, 0x20($sp)
/* 3D075C E00CA25C 8C830000 */ lw $v1, 0x0($a0)
/* 3D0760 E00CA260 8C90000C */ lw $s0, 0xC($a0)
/* 3D0764 E00CA264 30620010 */ andi $v0, $v1, 0x10
/* 3D0768 E00CA268 8E050000 */ lw $a1, 0x0($s0)
/* 3D076C E00CA26C 10400005 */ beqz $v0, .LE00CA284
/* 3D0770 E00CA270 2402FFEF */ addiu $v0, $zero, -0x11
/* 3D0774 E00CA274 00621024 */ and $v0, $v1, $v0
/* 3D0778 E00CA278 AC820000 */ sw $v0, 0x0($a0)
/* 3D077C E00CA27C 24020010 */ addiu $v0, $zero, 0x10
/* 3D0780 E00CA280 AE020010 */ sw $v0, 0x10($s0)
.LE00CA284:
/* 3D0784 E00CA284 8E030010 */ lw $v1, 0x10($s0)
/* 3D0788 E00CA288 286203E8 */ slti $v0, $v1, 0x3E8
/* 3D078C E00CA28C 10400002 */ beqz $v0, .LE00CA298
/* 3D0790 E00CA290 2462FFFF */ addiu $v0, $v1, -0x1
/* 3D0794 E00CA294 AE020010 */ sw $v0, 0x10($s0)
.LE00CA298:
/* 3D0798 E00CA298 8E020014 */ lw $v0, 0x14($s0)
/* 3D079C E00CA29C 8E030010 */ lw $v1, 0x10($s0)
/* 3D07A0 E00CA2A0 24420001 */ addiu $v0, $v0, 0x1
/* 3D07A4 E00CA2A4 04610005 */ bgez $v1, .LE00CA2BC
/* 3D07A8 E00CA2A8 AE020014 */ sw $v0, 0x14($s0)
/* 3D07AC E00CA2AC 0C080128 */ jal shim_remove_effect
/* 3D07B0 E00CA2B0 00000000 */ nop
/* 3D07B4 E00CA2B4 0803291B */ j .LE00CA46C
/* 3D07B8 E00CA2B8 00000000 */ nop
.LE00CA2BC:
/* 3D07BC E00CA2BC 0040882D */ daddu $s1, $v0, $zero
/* 3D07C0 E00CA2C0 28620010 */ slti $v0, $v1, 0x10
/* 3D07C4 E00CA2C4 10400002 */ beqz $v0, .LE00CA2D0
/* 3D07C8 E00CA2C8 00031100 */ sll $v0, $v1, 4
/* 3D07CC E00CA2CC AE020024 */ sw $v0, 0x24($s0)
.LE00CA2D0:
/* 3D07D0 E00CA2D0 24020003 */ addiu $v0, $zero, 0x3
/* 3D07D4 E00CA2D4 14A20020 */ bne $a1, $v0, .LE00CA358
/* 3D07D8 E00CA2D8 3C028888 */ lui $v0, (0x88888889 >> 16)
/* 3D07DC E00CA2DC 0C080138 */ jal shim_rand_int
/* 3D07E0 E00CA2E0 2404000A */ addiu $a0, $zero, 0xA
/* 3D07E4 E00CA2E4 2442FFFB */ addiu $v0, $v0, -0x5
/* 3D07E8 E00CA2E8 C6000044 */ lwc1 $f0, 0x44($s0)
/* 3D07EC E00CA2EC 44821000 */ mtc1 $v0, $f2
/* 3D07F0 E00CA2F0 00000000 */ nop
/* 3D07F4 E00CA2F4 468010A0 */ cvt.s.w $f2, $f2
/* 3D07F8 E00CA2F8 46020000 */ add.s $f0, $f0, $f2
/* 3D07FC E00CA2FC 2404000A */ addiu $a0, $zero, 0xA
/* 3D0800 E00CA300 0C080138 */ jal shim_rand_int
/* 3D0804 E00CA304 E6000044 */ swc1 $f0, 0x44($s0)
/* 3D0808 E00CA308 2442FFFB */ addiu $v0, $v0, -0x5
/* 3D080C E00CA30C 44820000 */ mtc1 $v0, $f0
/* 3D0810 E00CA310 00000000 */ nop
/* 3D0814 E00CA314 46800020 */ cvt.s.w $f0, $f0
/* 3D0818 E00CA318 C6020048 */ lwc1 $f2, 0x48($s0)
/* 3D081C E00CA31C C6060038 */ lwc1 $f6, 0x38($s0)
/* 3D0820 E00CA320 46001080 */ add.s $f2, $f2, $f0
/* 3D0824 E00CA324 C6000044 */ lwc1 $f0, 0x44($s0)
/* 3D0828 E00CA328 C6040040 */ lwc1 $f4, 0x40($s0)
/* 3D082C E00CA32C 46003180 */ add.s $f6, $f6, $f0
/* 3D0830 E00CA330 C600004C */ lwc1 $f0, 0x4C($s0)
/* 3D0834 E00CA334 46002100 */ add.s $f4, $f4, $f0
/* 3D0838 E00CA338 E6020048 */ swc1 $f2, 0x48($s0)
/* 3D083C E00CA33C C602003C */ lwc1 $f2, 0x3C($s0)
/* 3D0840 E00CA340 C6000048 */ lwc1 $f0, 0x48($s0)
/* 3D0844 E00CA344 46001080 */ add.s $f2, $f2, $f0
/* 3D0848 E00CA348 E6060038 */ swc1 $f6, 0x38($s0)
/* 3D084C E00CA34C E6040040 */ swc1 $f4, 0x40($s0)
/* 3D0850 E00CA350 E602003C */ swc1 $f2, 0x3C($s0)
/* 3D0854 E00CA354 3C028888 */ lui $v0, (0x88888889 >> 16)
.LE00CA358:
/* 3D0858 E00CA358 8E0402A8 */ lw $a0, 0x2A8($s0)
/* 3D085C E00CA35C 34428889 */ ori $v0, $v0, (0x88888889 & 0xFFFF)
/* 3D0860 E00CA360 00820018 */ mult $a0, $v0
/* 3D0864 E00CA364 C6080038 */ lwc1 $f8, 0x38($s0)
/* 3D0868 E00CA368 C606003C */ lwc1 $f6, 0x3C($s0)
/* 3D086C E00CA36C C60A0040 */ lwc1 $f10, 0x40($s0)
/* 3D0870 E00CA370 00041FC3 */ sra $v1, $a0, 31
/* 3D0874 E00CA374 00003010 */ mfhi $a2
/* 3D0878 E00CA378 00C41021 */ addu $v0, $a2, $a0
/* 3D087C E00CA37C 00021103 */ sra $v0, $v0, 4
/* 3D0880 E00CA380 00431823 */ subu $v1, $v0, $v1
/* 3D0884 E00CA384 00031100 */ sll $v0, $v1, 4
/* 3D0888 E00CA388 00431023 */ subu $v0, $v0, $v1
/* 3D088C E00CA38C 00021040 */ sll $v0, $v0, 1
/* 3D0890 E00CA390 00821823 */ subu $v1, $a0, $v0
/* 3D0894 E00CA394 00031080 */ sll $v0, $v1, 2
/* 3D0898 E00CA398 02021021 */ addu $v0, $s0, $v0
/* 3D089C E00CA39C C4420050 */ lwc1 $f2, 0x50($v0)
/* 3D08A0 E00CA3A0 C44000C8 */ lwc1 $f0, 0xC8($v0)
/* 3D08A4 E00CA3A4 C44C0140 */ lwc1 $f12, 0x140($v0)
/* 3D08A8 E00CA3A8 46024032 */ c.eq.s $f8, $f2
/* 3D08AC E00CA3AC 00000000 */ nop
/* 3D08B0 E00CA3B0 45000009 */ bc1f .LE00CA3D8
/* 3D08B4 E00CA3B4 00031880 */ sll $v1, $v1, 2
/* 3D08B8 E00CA3B8 46003032 */ c.eq.s $f6, $f0
/* 3D08BC E00CA3BC 00000000 */ nop
/* 3D08C0 E00CA3C0 45000005 */ bc1f .LE00CA3D8
/* 3D08C4 E00CA3C4 00000000 */ nop
/* 3D08C8 E00CA3C8 460C5032 */ c.eq.s $f10, $f12
/* 3D08CC E00CA3CC 00000000 */ nop
/* 3D08D0 E00CA3D0 45010026 */ bc1t .LE00CA46C
/* 3D08D4 E00CA3D4 00000000 */ nop
.LE00CA3D8:
/* 3D08D8 E00CA3D8 02031821 */ addu $v1, $s0, $v1
/* 3D08DC E00CA3DC 8E0202A8 */ lw $v0, 0x2A8($s0)
/* 3D08E0 E00CA3E0 C47402AC */ lwc1 $f20, 0x2AC($v1)
/* 3D08E4 E00CA3E4 24420001 */ addiu $v0, $v0, 0x1
/* 3D08E8 E00CA3E8 AE0202A8 */ sw $v0, 0x2A8($s0)
/* 3D08EC E00CA3EC 2842001E */ slti $v0, $v0, 0x1E
/* 3D08F0 E00CA3F0 50400001 */ beql $v0, $zero, .LE00CA3F8
/* 3D08F4 E00CA3F4 AE0002A8 */ sw $zero, 0x2A8($s0)
.LE00CA3F8:
/* 3D08F8 E00CA3F8 46024101 */ sub.s $f4, $f8, $f2
/* 3D08FC E00CA3FC 46042102 */ mul.s $f4, $f4, $f4
/* 3D0900 E00CA400 00000000 */ nop
/* 3D0904 E00CA404 46003001 */ sub.s $f0, $f6, $f0
/* 3D0908 E00CA408 46000002 */ mul.s $f0, $f0, $f0
/* 3D090C E00CA40C 00000000 */ nop
/* 3D0910 E00CA410 8E0302A8 */ lw $v1, 0x2A8($s0)
/* 3D0914 E00CA414 460C5081 */ sub.s $f2, $f10, $f12
/* 3D0918 E00CA418 00031080 */ sll $v0, $v1, 2
/* 3D091C E00CA41C 46021082 */ mul.s $f2, $f2, $f2
/* 3D0920 E00CA420 00000000 */ nop
/* 3D0924 E00CA424 02028021 */ addu $s0, $s0, $v0
/* 3D0928 E00CA428 24020001 */ addiu $v0, $zero, 0x1
/* 3D092C E00CA42C AE020230 */ sw $v0, 0x230($s0)
/* 3D0930 E00CA430 E6080050 */ swc1 $f8, 0x50($s0)
/* 3D0934 E00CA434 46002100 */ add.s $f4, $f4, $f0
/* 3D0938 E00CA438 E60600C8 */ swc1 $f6, 0xC8($s0)
/* 3D093C E00CA43C 44800000 */ mtc1 $zero, $f0
/* 3D0940 E00CA440 46022300 */ add.s $f12, $f4, $f2
/* 3D0944 E00CA444 E60A0140 */ swc1 $f10, 0x140($s0)
/* 3D0948 E00CA448 46006032 */ c.eq.s $f12, $f0
/* 3D094C E00CA44C 00000000 */ nop
/* 3D0950 E00CA450 45010004 */ bc1t .LE00CA464
/* 3D0954 E00CA454 AE1101B8 */ sw $s1, 0x1B8($s0)
/* 3D0958 E00CA458 0C080154 */ jal shim_sqrtf
/* 3D095C E00CA45C 00000000 */ nop
/* 3D0960 E00CA460 46000306 */ mov.s $f12, $f0
.LE00CA464:
/* 3D0964 E00CA464 460CA000 */ add.s $f0, $f20, $f12
/* 3D0968 E00CA468 E60002AC */ swc1 $f0, 0x2AC($s0)
.LE00CA46C:
/* 3D096C E00CA46C 8FBF0018 */ lw $ra, 0x18($sp)
/* 3D0970 E00CA470 8FB10014 */ lw $s1, 0x14($sp)
/* 3D0974 E00CA474 8FB00010 */ lw $s0, 0x10($sp)
/* 3D0978 E00CA478 D7B40020 */ ldc1 $f20, 0x20($sp)
/* 3D097C E00CA47C 03E00008 */ jr $ra
/* 3D0980 E00CA480 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void effect_65_update(EffectInstance* effect) {
Effect65FXData* data = effect->data.unk_65;
s32 variation = data->variation;
s32 lifeTime;
f32 pathLength;
f32 posX;
f32 posY;
f32 posZ;
f32 lastPointX;
f32 lastPointY;
f32 lastPointZ;
f32 dist;
s32 idx;
if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
data->timeLeft = 16;
}
if (data->timeLeft < 1000) {
data->timeLeft--;
}
data->lifeTime++;
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
lifeTime = data->lifeTime;
if (data->timeLeft < 16) {
data->alpha = data->timeLeft * 16;
}
if (variation == 3) {
data->pathJitterX += shim_rand_int(10) - 5;
data->pathJitterY += shim_rand_int(10) - 5;
data->pos.x += data->pathJitterX;
data->pos.y += data->pathJitterY;
data->pos.z += data->pathJitterZ;
}
idx = data->lastPointIndex % MAX_POINTS;
posX = data->pos.x;
posY = data->pos.y;
posZ = data->pos.z;
lastPointX = data->pathX[idx];
lastPointY = data->pathY[idx];
lastPointZ = data->pathZ[idx];
if (posX != lastPointX || posY != lastPointY || posZ != lastPointZ) {
// add new point to the trajectory
pathLength = data->pathLength[idx];
data->lastPointIndex++;
if (data->lastPointIndex >= MAX_POINTS) {
data->lastPointIndex = 0;
}
idx = data->lastPointIndex;
data->pathPointEnabled[idx] = TRUE;
data->pathX[idx] = posX;
data->pathY[idx] = posY;
data->pathZ[idx] = posZ;
data->pathTimestamp[idx] = lifeTime;
dist = SQ(posX - lastPointX) + SQ(posY - lastPointY) + SQ(posZ - lastPointZ);
if (dist != 0.0f) {
dist = shim_sqrtf(dist);
}
data->pathLength[idx] = pathLength + dist;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_802C39F8
/* E83A8 802C39F8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* E83AC 802C39FC AFB10014 */ sw $s1, 0x14($sp)
/* E83B0 802C3A00 0080882D */ daddu $s1, $a0, $zero
/* E83B4 802C3A04 AFB20018 */ sw $s2, 0x18($sp)
/* E83B8 802C3A08 00A0902D */ daddu $s2, $a1, $zero
/* E83BC 802C3A0C AFB3001C */ sw $s3, 0x1C($sp)
/* E83C0 802C3A10 00C0982D */ daddu $s3, $a2, $zero
/* E83C4 802C3A14 3C04802E */ lui $a0, %hi(gCurrentScriptListPtr)
/* E83C8 802C3A18 8C84A890 */ lw $a0, %lo(gCurrentScriptListPtr)($a0)
/* E83CC 802C3A1C 0000182D */ daddu $v1, $zero, $zero
/* E83D0 802C3A20 AFBF0024 */ sw $ra, 0x24($sp)
/* E83D4 802C3A24 AFB40020 */ sw $s4, 0x20($sp)
/* E83D8 802C3A28 AFB00010 */ sw $s0, 0x10($sp)
.L802C3A2C:
/* E83DC 802C3A2C 8C820000 */ lw $v0, 0x0($a0)
/* E83E0 802C3A30 10400006 */ beqz $v0, .L802C3A4C
/* E83E4 802C3A34 28620080 */ slti $v0, $v1, 0x80
/* E83E8 802C3A38 24630001 */ addiu $v1, $v1, 0x1
/* E83EC 802C3A3C 28620080 */ slti $v0, $v1, 0x80
/* E83F0 802C3A40 1440FFFA */ bnez $v0, .L802C3A2C
/* E83F4 802C3A44 24840004 */ addiu $a0, $a0, 0x4
/* E83F8 802C3A48 28620080 */ slti $v0, $v1, 0x80
.L802C3A4C:
/* E83FC 802C3A4C 54400003 */ bnel $v0, $zero, .L802C3A5C
/* E8400 802C3A50 24040168 */ addiu $a0, $zero, 0x168
.L802C3A54:
/* E8404 802C3A54 080B0E95 */ j .L802C3A54
/* E8408 802C3A58 00000000 */ nop
.L802C3A5C:
/* E840C 802C3A5C 0C00AB39 */ jal heap_malloc
/* E8410 802C3A60 0060A02D */ daddu $s4, $v1, $zero
/* E8414 802C3A64 00142080 */ sll $a0, $s4, 2
/* E8418 802C3A68 3C03802E */ lui $v1, %hi(gCurrentScriptListPtr)
/* E841C 802C3A6C 8C63A890 */ lw $v1, %lo(gCurrentScriptListPtr)($v1)
/* E8420 802C3A70 3C05802E */ lui $a1, %hi(gNumScripts)
/* E8424 802C3A74 24A5A488 */ addiu $a1, $a1, %lo(gNumScripts)
/* E8428 802C3A78 00832021 */ addu $a0, $a0, $v1
/* E842C 802C3A7C 8CA30000 */ lw $v1, 0x0($a1)
/* E8430 802C3A80 0040802D */ daddu $s0, $v0, $zero
/* E8434 802C3A84 AC900000 */ sw $s0, 0x0($a0)
/* E8438 802C3A88 24630001 */ addiu $v1, $v1, 0x1
/* E843C 802C3A8C 16000003 */ bnez $s0, .L802C3A9C
/* E8440 802C3A90 ACA30000 */ sw $v1, 0x0($a1)
.L802C3A94:
/* E8444 802C3A94 080B0EA5 */ j .L802C3A94
/* E8448 802C3A98 00000000 */ nop
.L802C3A9C:
/* E844C 802C3A9C 36620001 */ ori $v0, $s3, 0x1
/* E8450 802C3AA0 A2020000 */ sb $v0, 0x0($s0)
/* E8454 802C3AA4 AE120008 */ sw $s2, 0x8($s0)
/* E8458 802C3AA8 AE12015C */ sw $s2, 0x15C($s0)
/* E845C 802C3AAC AE120164 */ sw $s2, 0x164($s0)
/* E8460 802C3AB0 A2000002 */ sb $zero, 0x2($s0)
/* E8464 802C3AB4 AE000060 */ sw $zero, 0x60($s0)
/* E8468 802C3AB8 AE000064 */ sw $zero, 0x64($s0)
/* E846C 802C3ABC AE11006C */ sw $s1, 0x6C($s0)
/* E8470 802C3AC0 AE000068 */ sw $zero, 0x68($s0)
/* E8474 802C3AC4 92220003 */ lbu $v0, 0x3($s1)
/* E8478 802C3AC8 3C04802E */ lui $a0, %hi(gStaticScriptCounter)
/* E847C 802C3ACC 24849CA0 */ addiu $a0, $a0, %lo(gStaticScriptCounter)
/* E8480 802C3AD0 A2020003 */ sb $v0, 0x3($s0)
/* E8484 802C3AD4 8C820000 */ lw $v0, 0x0($a0)
/* E8488 802C3AD8 AE020144 */ sw $v0, 0x144($s0)
/* E848C 802C3ADC 8E230148 */ lw $v1, 0x148($s1)
/* E8490 802C3AE0 24420001 */ addiu $v0, $v0, 0x1
/* E8494 802C3AE4 AC820000 */ sw $v0, 0x0($a0)
/* E8498 802C3AE8 AE030148 */ sw $v1, 0x148($s0)
/* E849C 802C3AEC 8E23014C */ lw $v1, 0x14C($s1)
/* E84A0 802C3AF0 2402FFFF */ addiu $v0, $zero, -0x1
/* E84A4 802C3AF4 A2020006 */ sb $v0, 0x6($s0)
/* E84A8 802C3AF8 A2020007 */ sb $v0, 0x7($s0)
/* E84AC 802C3AFC AE03014C */ sw $v1, 0x14C($s0)
/* E84B0 802C3B00 92220004 */ lbu $v0, 0x4($s1)
/* E84B4 802C3B04 0220282D */ daddu $a1, $s1, $zero
/* E84B8 802C3B08 AE000160 */ sw $zero, 0x160($s0)
/* E84BC 802C3B0C A2020004 */ sb $v0, 0x4($s0)
/* E84C0 802C3B10 8E22013C */ lw $v0, 0x13C($s1)
/* E84C4 802C3B14 3C01802E */ lui $at, %hi(gGlobalTimeSpace)
/* E84C8 802C3B18 C4209CA8 */ lwc1 $f0, %lo(gGlobalTimeSpace)($at)
/* E84CC 802C3B1C 0200202D */ daddu $a0, $s0, $zero
/* E84D0 802C3B20 AE02013C */ sw $v0, 0x13C($s0)
/* E84D4 802C3B24 8E220140 */ lw $v0, 0x140($s1)
/* E84D8 802C3B28 0000182D */ daddu $v1, $zero, $zero
/* E84DC 802C3B2C E6000150 */ swc1 $f0, 0x150($s0)
/* E84E0 802C3B30 AE000154 */ sw $zero, 0x154($s0)
/* E84E4 802C3B34 AE000158 */ sw $zero, 0x158($s0)
/* E84E8 802C3B38 AE020140 */ sw $v0, 0x140($s0)
.L802C3B3C:
/* E84EC 802C3B3C 8CA20084 */ lw $v0, 0x84($a1)
/* E84F0 802C3B40 24A50004 */ addiu $a1, $a1, 0x4
/* E84F4 802C3B44 24630001 */ addiu $v1, $v1, 0x1
/* E84F8 802C3B48 AC820084 */ sw $v0, 0x84($a0)
/* E84FC 802C3B4C 28620010 */ slti $v0, $v1, 0x10
/* E8500 802C3B50 1440FFFA */ bnez $v0, .L802C3B3C
/* E8504 802C3B54 24840004 */ addiu $a0, $a0, 0x4
/* E8508 802C3B58 0000182D */ daddu $v1, $zero, $zero
/* E850C 802C3B5C 0220202D */ daddu $a0, $s1, $zero
/* E8510 802C3B60 0200282D */ daddu $a1, $s0, $zero
.L802C3B64:
/* E8514 802C3B64 8C8200C4 */ lw $v0, 0xC4($a0)
/* E8518 802C3B68 24840004 */ addiu $a0, $a0, 0x4
/* E851C 802C3B6C 24630001 */ addiu $v1, $v1, 0x1
/* E8520 802C3B70 ACA200C4 */ sw $v0, 0xC4($a1)
/* E8524 802C3B74 28620003 */ slti $v0, $v1, 0x3
/* E8528 802C3B78 1440FFFA */ bnez $v0, .L802C3B64
/* E852C 802C3B7C 24A50004 */ addiu $a1, $a1, 0x4
/* E8530 802C3B80 0C0B0C52 */ jal find_script_labels
/* E8534 802C3B84 0200202D */ daddu $a0, $s0, $zero
/* E8538 802C3B88 3C02802E */ lui $v0, %hi(gIsUpdatingScripts)
/* E853C 802C3B8C 8C429CA4 */ lw $v0, %lo(gIsUpdatingScripts)($v0)
/* E8540 802C3B90 1040000E */ beqz $v0, .L802C3BCC
/* E8544 802C3B94 00000000 */ nop
/* E8548 802C3B98 3C05802E */ lui $a1, %hi(gScriptListCount)
/* E854C 802C3B9C 24A5AC98 */ addiu $a1, $a1, %lo(gScriptListCount)
/* E8550 802C3BA0 8CA20000 */ lw $v0, 0x0($a1)
/* E8554 802C3BA4 00022080 */ sll $a0, $v0, 2
/* E8558 802C3BA8 3C01802E */ lui $at, %hi(gScriptIndexList)
/* E855C 802C3BAC 00240821 */ addu $at, $at, $a0
/* E8560 802C3BB0 AC34A898 */ sw $s4, %lo(gScriptIndexList)($at)
/* E8564 802C3BB4 8E030144 */ lw $v1, 0x144($s0)
/* E8568 802C3BB8 24420001 */ addiu $v0, $v0, 0x1
/* E856C 802C3BBC ACA20000 */ sw $v0, 0x0($a1)
/* E8570 802C3BC0 3C01802E */ lui $at, %hi(gScriptIdList)
/* E8574 802C3BC4 00240821 */ addu $at, $at, $a0
/* E8578 802C3BC8 AC23AA98 */ sw $v1, %lo(gScriptIdList)($at)
.L802C3BCC:
/* E857C 802C3BCC 3C03802E */ lui $v1, %hi(gStaticScriptCounter)
/* E8580 802C3BD0 24639CA0 */ addiu $v1, $v1, %lo(gStaticScriptCounter)
/* E8584 802C3BD4 8C620000 */ lw $v0, 0x0($v1)
/* E8588 802C3BD8 14400002 */ bnez $v0, .L802C3BE4
/* E858C 802C3BDC 24020001 */ addiu $v0, $zero, 0x1
/* E8590 802C3BE0 AC620000 */ sw $v0, 0x0($v1)
.L802C3BE4:
/* E8594 802C3BE4 0C0B0CE4 */ jal suspend_frozen_scripts
/* E8598 802C3BE8 0200202D */ daddu $a0, $s0, $zero
/* E859C 802C3BEC 0200102D */ daddu $v0, $s0, $zero
/* E85A0 802C3BF0 8FBF0024 */ lw $ra, 0x24($sp)
/* E85A4 802C3BF4 8FB40020 */ lw $s4, 0x20($sp)
/* E85A8 802C3BF8 8FB3001C */ lw $s3, 0x1C($sp)
/* E85AC 802C3BFC 8FB20018 */ lw $s2, 0x18($sp)
/* E85B0 802C3C00 8FB10014 */ lw $s1, 0x14($sp)
/* E85B4 802C3C04 8FB00010 */ lw $s0, 0x10($sp)
/* E85B8 802C3C08 03E00008 */ jr $ra
/* E85BC 802C3C0C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
Evt* func_802C39F8(Evt* parentScript, Bytecode* nextLine, s32 newState) {
Evt* child;
s32 curScriptIndex;
s32 i;
s32 scriptListCount;
for (i = 0; i < MAX_SCRIPTS; i++) {
if ((*gCurrentScriptListPtr)[i] == NULL) {
break;
}
}
ASSERT(i < MAX_SCRIPTS);
curScriptIndex = i;
(*gCurrentScriptListPtr)[curScriptIndex] = child = heap_malloc(sizeof(*child));
gNumScripts++;
ASSERT(child != NULL);
child->stateFlags = newState | EVT_FLAG_ACTIVE;
child->ptrNextLine = nextLine;
child->ptrFirstLine = nextLine;
child->ptrCurrentLine = nextLine;
child->currentOpcode = EVT_OP_INTERNAL_FETCH;
child->userData = NULL;
child->blockingParent = NULL;
child->parentScript = parentScript;
child->childScript = NULL;
child->priority = parentScript->priority;
child->id = gStaticScriptCounter++;
child->owner1.actorID = parentScript->owner1.actorID;
child->owner2.npcID = parentScript->owner2.npcID;
child->loopDepth = -1;
child->switchDepth = -1;
child->groupFlags = parentScript->groupFlags;
child->ptrSavedPos = NULL;
child->array = parentScript->array;
child->flagArray = parentScript->flagArray;
child->timeScale = gGlobalTimeSpace;
child->frameCounter = 0.0f;
child->unk_158 = 0;
scriptListCount = 0;
for (i = 0; i < ARRAY_COUNT(child->varTable); i++) {
child->varTable[i] = parentScript->varTable[i];
}
for (i = 0; i < ARRAY_COUNT(child->varFlags); i++) {
child->varFlags[i] = parentScript->varFlags[i];
}
find_script_labels(child);
if (gIsUpdatingScripts) {
scriptListCount = gScriptListCount++;
gScriptIndexList[scriptListCount] = curScriptIndex;
gScriptIdList[scriptListCount] = child->id;
}
if (gStaticScriptCounter == 0) {
gStaticScriptCounter = 1;
}
suspend_frozen_scripts(child);
return child;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel player_test_lateral_overlap
/* 780B4 800DEC04 27BDFF58 */ addiu $sp, $sp, -0xA8
/* 780B8 800DEC08 AFB40078 */ sw $s4, 0x78($sp)
/* 780BC 800DEC0C 0080A02D */ daddu $s4, $a0, $zero
/* 780C0 800DEC10 AFB20070 */ sw $s2, 0x70($sp)
/* 780C4 800DEC14 00C0902D */ daddu $s2, $a2, $zero
/* 780C8 800DEC18 AFB00068 */ sw $s0, 0x68($sp)
/* 780CC 800DEC1C 00E0802D */ daddu $s0, $a3, $zero
/* 780D0 800DEC20 AFB30074 */ sw $s3, 0x74($sp)
/* 780D4 800DEC24 AFBF007C */ sw $ra, 0x7C($sp)
/* 780D8 800DEC28 AFB1006C */ sw $s1, 0x6C($sp)
/* 780DC 800DEC2C F7BC00A0 */ sdc1 $f28, 0xA0($sp)
/* 780E0 800DEC30 F7BA0098 */ sdc1 $f26, 0x98($sp)
/* 780E4 800DEC34 F7B80090 */ sdc1 $f24, 0x90($sp)
/* 780E8 800DEC38 F7B60088 */ sdc1 $f22, 0x88($sp)
/* 780EC 800DEC3C F7B40080 */ sdc1 $f20, 0x80($sp)
/* 780F0 800DEC40 84A200B2 */ lh $v0, 0xB2($a1)
/* 780F4 800DEC44 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 780F8 800DEC48 44810000 */ mtc1 $at, $f0
/* 780FC 800DEC4C 8FB100B8 */ lw $s1, 0xB8($sp)
/* 78100 800DEC50 C7B400BC */ lwc1 $f20, 0xBC($sp)
/* 78104 800DEC54 44821000 */ mtc1 $v0, $f2
/* 78108 800DEC58 00000000 */ nop
/* 7810C 800DEC5C 468010A0 */ cvt.s.w $f2, $f2
/* 78110 800DEC60 8CA20000 */ lw $v0, 0x0($a1)
/* 78114 800DEC64 46001702 */ mul.s $f28, $f2, $f0
/* 78118 800DEC68 00000000 */ nop
/* 7811C 800DEC6C 30420006 */ andi $v0, $v0, 0x6
/* 78120 800DEC70 1440000B */ bnez $v0, .L800DECA0
/* 78124 800DEC74 2413FFFF */ addiu $s3, $zero, -0x1
/* 78128 800DEC78 84A200B0 */ lh $v0, 0xB0($a1)
/* 7812C 800DEC7C 3C013E92 */ lui $at, (0x3E926E98 >> 16)
/* 78130 800DEC80 34216E98 */ ori $at, $at, (0x3E926E98 & 0xFFFF)
/* 78134 800DEC84 44811000 */ mtc1 $at, $f2
/* 78138 800DEC88 44820000 */ mtc1 $v0, $f0
/* 7813C 800DEC8C 00000000 */ nop
/* 78140 800DEC90 46800020 */ cvt.s.w $f0, $f0
/* 78144 800DEC94 46020582 */ mul.s $f22, $f0, $f2
/* 78148 800DEC98 08037B2A */ j .L800DECA8
/* 7814C 800DEC9C 00000000 */ nop
.L800DECA0:
/* 78150 800DECA0 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 78154 800DECA4 4481B000 */ mtc1 $at, $f22
.L800DECA8:
/* 78158 800DECA8 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* 7815C 800DECAC 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* 78160 800DECB0 44810000 */ mtc1 $at, $f0
/* 78164 800DECB4 C7AC00C0 */ lwc1 $f12, 0xC0($sp)
/* 78168 800DECB8 46006302 */ mul.s $f12, $f12, $f0
/* 7816C 800DECBC 00000000 */ nop
/* 78170 800DECC0 27A50038 */ addiu $a1, $sp, 0x38
/* 78174 800DECC4 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 78178 800DECC8 44810000 */ mtc1 $at, $f0
/* 7817C 800DECCC 27A6003C */ addiu $a2, $sp, 0x3C
/* 78180 800DECD0 0C00A82D */ jal sin_cos_rad
/* 78184 800DECD4 46006303 */ div.s $f12, $f12, $f0
/* 78188 800DECD8 461CA080 */ add.s $f2, $f20, $f28
/* 7818C 800DECDC C7A0003C */ lwc1 $f0, 0x3C($sp)
/* 78190 800DECE0 46000007 */ neg.s $f0, $f0
/* 78194 800DECE4 E7A0003C */ swc1 $f0, 0x3C($sp)
/* 78198 800DECE8 E7A2004C */ swc1 $f2, 0x4C($sp)
/* 7819C 800DECEC C7A20038 */ lwc1 $f2, 0x38($sp)
/* 781A0 800DECF0 C6040000 */ lwc1 $f4, 0x0($s0)
/* 781A4 800DECF4 27A20040 */ addiu $v0, $sp, 0x40
/* 781A8 800DECF8 AFA2001C */ sw $v0, 0x1C($sp)
/* 781AC 800DECFC 27A20044 */ addiu $v0, $sp, 0x44
/* 781B0 800DED00 AFA20020 */ sw $v0, 0x20($sp)
/* 781B4 800DED04 27A20048 */ addiu $v0, $sp, 0x48
/* 781B8 800DED08 AFA20024 */ sw $v0, 0x24($sp)
/* 781BC 800DED0C 27A2004C */ addiu $v0, $sp, 0x4C
/* 781C0 800DED10 AFA20028 */ sw $v0, 0x28($sp)
/* 781C4 800DED14 27A20050 */ addiu $v0, $sp, 0x50
/* 781C8 800DED18 AFA2002C */ sw $v0, 0x2C($sp)
/* 781CC 800DED1C 27A20054 */ addiu $v0, $sp, 0x54
/* 781D0 800DED20 AFA20030 */ sw $v0, 0x30($sp)
/* 781D4 800DED24 27A20058 */ addiu $v0, $sp, 0x58
/* 781D8 800DED28 AFA00014 */ sw $zero, 0x14($sp)
/* 781DC 800DED2C E7A00018 */ swc1 $f0, 0x18($sp)
/* 781E0 800DED30 AFA20034 */ sw $v0, 0x34($sp)
/* 781E4 800DED34 46162100 */ add.s $f4, $f4, $f22
/* 781E8 800DED38 E7A20010 */ swc1 $f2, 0x10($sp)
/* 781EC 800DED3C 8E450000 */ lw $a1, 0x0($s2)
/* 781F0 800DED40 8E270000 */ lw $a3, 0x0($s1)
/* 781F4 800DED44 44062000 */ mfc1 $a2, $f4
/* 781F8 800DED48 0C037B97 */ jal player_raycast_general
/* 781FC 800DED4C 0280202D */ daddu $a0, $s4, $zero
/* 78200 800DED50 0040802D */ daddu $s0, $v0, $zero
/* 78204 800DED54 24020003 */ addiu $v0, $zero, 0x3
/* 78208 800DED58 16820004 */ bne $s4, $v0, .L800DED6C
/* 7820C 800DED5C 00000000 */ nop
/* 78210 800DED60 4480C000 */ mtc1 $zero, $f24
/* 78214 800DED64 08037B61 */ j .L800DED84
/* 78218 800DED68 4600C686 */ mov.s $f26, $f24
.L800DED6C:
/* 7821C 800DED6C C7A00038 */ lwc1 $f0, 0x38($sp)
/* 78220 800DED70 4600A682 */ mul.s $f26, $f20, $f0
/* 78224 800DED74 00000000 */ nop
/* 78228 800DED78 C7A0003C */ lwc1 $f0, 0x3C($sp)
/* 7822C 800DED7C 4600A602 */ mul.s $f24, $f20, $f0
/* 78230 800DED80 00000000 */ nop
.L800DED84:
/* 78234 800DED84 06000021 */ bltz $s0, .L800DEE0C
/* 78238 800DED88 00000000 */ nop
/* 7823C 800DED8C 461CA080 */ add.s $f2, $f20, $f28
/* 78240 800DED90 C7B6004C */ lwc1 $f22, 0x4C($sp)
/* 78244 800DED94 4602B03E */ c.le.s $f22, $f2
/* 78248 800DED98 00000000 */ nop
/* 7824C 800DED9C 4500001B */ bc1f .L800DEE0C
/* 78250 800DEDA0 27A4005C */ addiu $a0, $sp, 0x5C
/* 78254 800DEDA4 4602B581 */ sub.s $f22, $f22, $f2
/* 78258 800DEDA8 4406D000 */ mfc1 $a2, $f26
/* 7825C 800DEDAC C7B40038 */ lwc1 $f20, 0x38($sp)
/* 78260 800DEDB0 4407C000 */ mfc1 $a3, $f24
/* 78264 800DEDB4 C7A2003C */ lwc1 $f2, 0x3C($sp)
/* 78268 800DEDB8 4614B502 */ mul.s $f20, $f22, $f20
/* 7826C 800DEDBC 00000000 */ nop
/* 78270 800DEDC0 C7A00050 */ lwc1 $f0, 0x50($sp)
/* 78274 800DEDC4 27A50060 */ addiu $a1, $sp, 0x60
/* 78278 800DEDC8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 7827C 800DEDCC C7A00058 */ lwc1 $f0, 0x58($sp)
/* 78280 800DEDD0 4602B582 */ mul.s $f22, $f22, $f2
/* 78284 800DEDD4 00000000 */ nop
/* 78288 800DEDD8 0C037CFF */ jal player_get_slip_vector
/* 7828C 800DEDDC E7A00014 */ swc1 $f0, 0x14($sp)
/* 78290 800DEDE0 C7A0005C */ lwc1 $f0, 0x5C($sp)
/* 78294 800DEDE4 4600A500 */ add.s $f20, $f20, $f0
/* 78298 800DEDE8 C6400000 */ lwc1 $f0, 0x0($s2)
/* 7829C 800DEDEC 46140000 */ add.s $f0, $f0, $f20
/* 782A0 800DEDF0 E6400000 */ swc1 $f0, 0x0($s2)
/* 782A4 800DEDF4 C7A00060 */ lwc1 $f0, 0x60($sp)
/* 782A8 800DEDF8 4600B580 */ add.s $f22, $f22, $f0
/* 782AC 800DEDFC C6200000 */ lwc1 $f0, 0x0($s1)
/* 782B0 800DEE00 46160000 */ add.s $f0, $f0, $f22
/* 782B4 800DEE04 0200982D */ daddu $s3, $s0, $zero
/* 782B8 800DEE08 E6200000 */ swc1 $f0, 0x0($s1)
.L800DEE0C:
/* 782BC 800DEE0C C6400000 */ lwc1 $f0, 0x0($s2)
/* 782C0 800DEE10 461A0000 */ add.s $f0, $f0, $f26
/* 782C4 800DEE14 E6400000 */ swc1 $f0, 0x0($s2)
/* 782C8 800DEE18 C6200000 */ lwc1 $f0, 0x0($s1)
/* 782CC 800DEE1C 46180000 */ add.s $f0, $f0, $f24
/* 782D0 800DEE20 0260102D */ daddu $v0, $s3, $zero
/* 782D4 800DEE24 E6200000 */ swc1 $f0, 0x0($s1)
/* 782D8 800DEE28 8FBF007C */ lw $ra, 0x7C($sp)
/* 782DC 800DEE2C 8FB40078 */ lw $s4, 0x78($sp)
/* 782E0 800DEE30 8FB30074 */ lw $s3, 0x74($sp)
/* 782E4 800DEE34 8FB20070 */ lw $s2, 0x70($sp)
/* 782E8 800DEE38 8FB1006C */ lw $s1, 0x6C($sp)
/* 782EC 800DEE3C 8FB00068 */ lw $s0, 0x68($sp)
/* 782F0 800DEE40 D7BC00A0 */ ldc1 $f28, 0xA0($sp)
/* 782F4 800DEE44 D7BA0098 */ ldc1 $f26, 0x98($sp)
/* 782F8 800DEE48 D7B80090 */ ldc1 $f24, 0x90($sp)
/* 782FC 800DEE4C D7B60088 */ ldc1 $f22, 0x88($sp)
/* 78300 800DEE50 D7B40080 */ ldc1 $f20, 0x80($sp)
/* 78304 800DEE54 03E00008 */ jr $ra
/* 78308 800DEE58 27BD00A8 */ addiu $sp, $sp, 0xA8
### DECOMPILED C INSTRUCTIONS:
s32 player_test_lateral_overlap(s32 mode, PlayerStatus* playerStatus, f32* x, f32* y, f32* z, f32 length, f32 yaw) {
f32 sinTheta;
f32 cosTheta;
f32 hitX;
f32 hitY;
f32 hitZ;
f32 hitDepth;
f32 hitNx;
f32 hitNy;
f32 hitNz;
f32 slipDx;
f32 slipDz;
f32 depthDiff;
f32 radius;
f32 originalDepth;
s32 hitID;
f32 height;
f32 targetDx;
f32 targetDz;
f32 dx;
f32 dz;
s32 ret;
radius = playerStatus->colliderDiameter * 0.5f;
ret = NO_COLLIDER;
if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) {
height = playerStatus->colliderHeight * 0.286f;
} else {
height = 1.0f;
}
sin_cos_rad(DEG_TO_RAD(yaw), &sinTheta, &cosTheta);
cosTheta = -cosTheta;
hitDepth = length + radius;
hitID = player_raycast_general(mode, *x, *y + height, *z, sinTheta, 0, cosTheta, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
if (mode == 3) {
targetDx = 0.0f;
targetDz = 0.0f;
} else {
targetDx = length * sinTheta;
targetDz = length * cosTheta;
}
if (hitID >= 0) {
originalDepth = length + radius;
if (hitDepth <= originalDepth) {
depthDiff = hitDepth - originalDepth;
dx = depthDiff * sinTheta;
dz = depthDiff * cosTheta;
player_get_slip_vector(&slipDx, &slipDz, targetDx, targetDz, hitNx, hitNz);
*x += dx + slipDx;
*z += dz + slipDz;
ret = hitID;
}
}
*x += targetDx;
*z += targetDz;
return ret;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel load_obfuscation_shims
/* 8560 8002D160 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 8564 8002D164 AFB60030 */ sw $s6, 0x30($sp)
/* 8568 8002D168 3C16759A */ lui $s6, %hi(D_7599F6D8)
/* 856C 8002D16C 26D6F6D8 */ addiu $s6, $s6, %lo(D_7599F6D8)
/* 8570 8002D170 AFB5002C */ sw $s5, 0x2C($sp)
/* 8574 8002D174 3C15F79E */ lui $s5, %hi(D_F79DDD0F)
/* 8578 8002D178 26B5DD0F */ addiu $s5, $s5, %lo(D_F79DDD0F)
/* 857C 8002D17C AFB30024 */ sw $s3, 0x24($sp)
/* 8580 8002D180 3C130B11 */ lui $s3, (0xB112D28 >> 16)
/* 8584 8002D184 36732D28 */ ori $s3, $s3, (0xB112D28 & 0xFFFF)
/* 8588 8002D188 AFB00018 */ sw $s0, 0x18($sp)
/* 858C 8002D18C 0000802D */ daddu $s0, $zero, $zero
/* 8590 8002D190 3C05B000 */ lui $a1, (0xB0000D10 >> 16)
/* 8594 8002D194 34A50D10 */ ori $a1, $a1, (0xB0000D10 & 0xFFFF)
/* 8598 8002D198 3C04800A */ lui $a0, %hi(nuPiCartHandle)
/* 859C 8002D19C 8C84A638 */ lw $a0, %lo(nuPiCartHandle)($a0)
/* 85A0 8002D1A0 27A60010 */ addiu $a2, $sp, 0x10
/* 85A4 8002D1A4 AFB20020 */ sw $s2, 0x20($sp)
/* 85A8 8002D1A8 0200902D */ daddu $s2, $s0, $zero
/* 85AC 8002D1AC AFB40028 */ sw $s4, 0x28($sp)
/* 85B0 8002D1B0 3C148006 */ lui $s4, %hi(osEPiReadIo)
/* 85B4 8002D1B4 26940DC0 */ addiu $s4, $s4, %lo(osEPiReadIo)
/* 85B8 8002D1B8 AFBF003C */ sw $ra, 0x3C($sp)
/* 85BC 8002D1BC AFBE0038 */ sw $fp, 0x38($sp)
/* 85C0 8002D1C0 AFB70034 */ sw $s7, 0x34($sp)
/* 85C4 8002D1C4 0280F809 */ jalr $s4
/* 85C8 8002D1C8 AFB1001C */ sw $s1, 0x1C($sp)
/* 85CC 8002D1CC 3C110031 */ lui $s1, %hi(D_316D90)
/* 85D0 8002D1D0 26316D90 */ addiu $s1, $s1, %lo(D_316D90)
/* 85D4 8002D1D4 8FA20010 */ lw $v0, 0x10($sp)
/* 85D8 8002D1D8 3C030031 */ lui $v1, %hi(D_316F30)
/* 85DC 8002D1DC 24636F30 */ addiu $v1, $v1, %lo(D_316F30)
/* 85E0 8002D1E0 02629823 */ subu $s3, $s3, $v0
/* 85E4 8002D1E4 0223102B */ sltu $v0, $s1, $v1
/* 85E8 8002D1E8 1040002B */ beqz $v0, .L8002D298
/* 85EC 8002D1EC 241E0003 */ addiu $fp, $zero, 0x3
/* 85F0 8002D1F0 0060B82D */ daddu $s7, $v1, $zero
.L8002D1F4:
/* 85F4 8002D1F4 0220282D */ daddu $a1, $s1, $zero
/* 85F8 8002D1F8 3C04800A */ lui $a0, %hi(nuPiCartHandle)
/* 85FC 8002D1FC 8C84A638 */ lw $a0, %lo(nuPiCartHandle)($a0)
/* 8600 8002D200 0280F809 */ jalr $s4
/* 8604 8002D204 27A60010 */ addiu $a2, $sp, 0x10
/* 8608 8002D208 8FA30010 */ lw $v1, 0x10($sp)
/* 860C 8002D20C 2407000F */ addiu $a3, $zero, 0xF
/* 8610 8002D210 3065FFFF */ andi $a1, $v1, 0xFFFF
/* 8614 8002D214 00032402 */ srl $a0, $v1, 16
/* 8618 8002D218 00A41021 */ addu $v0, $a1, $a0
/* 861C 8002D21C 02028021 */ addu $s0, $s0, $v0
/* 8620 8002D220 00121682 */ srl $v0, $s2, 26
/* 8624 8002D224 14470010 */ bne $v0, $a3, .L8002D268
/* 8628 8002D228 00031682 */ srl $v0, $v1, 26
/* 862C 8002D22C 24070009 */ addiu $a3, $zero, 0x9
/* 8630 8002D230 50470004 */ beql $v0, $a3, .L8002D244
/* 8634 8002D234 00031542 */ srl $v0, $v1, 21
/* 8638 8002D238 24070023 */ addiu $a3, $zero, 0x23
/* 863C 8002D23C 1447000A */ bne $v0, $a3, .L8002D268
/* 8640 8002D240 00031542 */ srl $v0, $v1, 21
.L8002D244:
/* 8644 8002D244 3043001F */ andi $v1, $v0, 0x1F
/* 8648 8002D248 00121402 */ srl $v0, $s2, 16
/* 864C 8002D24C 3042001F */ andi $v0, $v0, 0x1F
/* 8650 8002D250 14620005 */ bne $v1, $v0, .L8002D268
/* 8654 8002D254 3082001F */ andi $v0, $a0, 0x1F
/* 8658 8002D258 14620003 */ bne $v1, $v0, .L8002D268
/* 865C 8002D25C 3242FFFF */ andi $v0, $s2, 0xFFFF
/* 8660 8002D260 02058023 */ subu $s0, $s0, $a1
/* 8664 8002D264 02028023 */ subu $s0, $s0, $v0
.L8002D268:
/* 8668 8002D268 8FA40010 */ lw $a0, 0x10($sp)
/* 866C 8002D26C 00041682 */ srl $v0, $a0, 26
/* 8670 8002D270 145E0006 */ bne $v0, $fp, .L8002D28C
/* 8674 8002D274 26310004 */ addiu $s1, $s1, 0x4
/* 8678 8002D278 3083FFFF */ andi $v1, $a0, 0xFFFF
/* 867C 8002D27C 00041402 */ srl $v0, $a0, 16
/* 8680 8002D280 3042FC00 */ andi $v0, $v0, 0xFC00
/* 8684 8002D284 00621821 */ addu $v1, $v1, $v0
/* 8688 8002D288 02038023 */ subu $s0, $s0, $v1
.L8002D28C:
/* 868C 8002D28C 0237102B */ sltu $v0, $s1, $s7
/* 8690 8002D290 1440FFD8 */ bnez $v0, .L8002D1F4
/* 8694 8002D294 0080902D */ daddu $s2, $a0, $zero
.L8002D298:
/* 8698 8002D298 3C02FFD5 */ lui $v0, (0xFFD5B14A >> 16)
/* 869C 8002D29C 3442B14A */ ori $v0, $v0, (0xFFD5B14A & 0xFFFF)
/* 86A0 8002D2A0 02021021 */ addu $v0, $s0, $v0
/* 86A4 8002D2A4 02621023 */ subu $v0, $s3, $v0
/* 86A8 8002D2A8 02C2B021 */ addu $s6, $s6, $v0
/* 86AC 8002D2AC 3C1318F4 */ lui $s3, (0x18F414AB >> 16)
/* 86B0 8002D2B0 367314AB */ ori $s3, $s3, (0x18F414AB & 0xFFFF)
/* 86B4 8002D2B4 0000802D */ daddu $s0, $zero, $zero
/* 86B8 8002D2B8 3C05B000 */ lui $a1, (0xB0000E38 >> 16)
/* 86BC 8002D2BC 34A50E38 */ ori $a1, $a1, (0xB0000E38 & 0xFFFF)
/* 86C0 8002D2C0 27A60014 */ addiu $a2, $sp, 0x14
/* 86C4 8002D2C4 3C04800A */ lui $a0, %hi(nuPiCartHandle)
/* 86C8 8002D2C8 8C84A638 */ lw $a0, %lo(nuPiCartHandle)($a0)
/* 86CC 8002D2CC 3C148006 */ lui $s4, %hi(osEPiReadIo)
/* 86D0 8002D2D0 26940DC0 */ addiu $s4, $s4, %lo(osEPiReadIo)
/* 86D4 8002D2D4 0280F809 */ jalr $s4
/* 86D8 8002D2D8 0200902D */ daddu $s2, $s0, $zero
/* 86DC 8002D2DC 3C110031 */ lui $s1, %hi(D_316F30)
/* 86E0 8002D2E0 26316F30 */ addiu $s1, $s1, %lo(D_316F30)
/* 86E4 8002D2E4 8FA20014 */ lw $v0, 0x14($sp)
/* 86E8 8002D2E8 3C030031 */ lui $v1, %hi(D_317020)
/* 86EC 8002D2EC 24637020 */ addiu $v1, $v1, %lo(D_317020)
/* 86F0 8002D2F0 02629823 */ subu $s3, $s3, $v0
/* 86F4 8002D2F4 0223102B */ sltu $v0, $s1, $v1
/* 86F8 8002D2F8 1040002B */ beqz $v0, .L8002D3A8
/* 86FC 8002D2FC 241E0003 */ addiu $fp, $zero, 0x3
/* 8700 8002D300 0060B82D */ daddu $s7, $v1, $zero
.L8002D304:
/* 8704 8002D304 0220282D */ daddu $a1, $s1, $zero
/* 8708 8002D308 3C04800A */ lui $a0, %hi(nuPiCartHandle)
/* 870C 8002D30C 8C84A638 */ lw $a0, %lo(nuPiCartHandle)($a0)
/* 8710 8002D310 0280F809 */ jalr $s4
/* 8714 8002D314 27A60014 */ addiu $a2, $sp, 0x14
/* 8718 8002D318 8FA30014 */ lw $v1, 0x14($sp)
/* 871C 8002D31C 2407000F */ addiu $a3, $zero, 0xF
/* 8720 8002D320 3065FFFF */ andi $a1, $v1, 0xFFFF
/* 8724 8002D324 00032402 */ srl $a0, $v1, 16
/* 8728 8002D328 00A41021 */ addu $v0, $a1, $a0
/* 872C 8002D32C 02028021 */ addu $s0, $s0, $v0
/* 8730 8002D330 00121682 */ srl $v0, $s2, 26
/* 8734 8002D334 14470010 */ bne $v0, $a3, .L8002D378
/* 8738 8002D338 00031682 */ srl $v0, $v1, 26
/* 873C 8002D33C 24070009 */ addiu $a3, $zero, 0x9
/* 8740 8002D340 50470004 */ beql $v0, $a3, .L8002D354
/* 8744 8002D344 00031542 */ srl $v0, $v1, 21
/* 8748 8002D348 24070023 */ addiu $a3, $zero, 0x23
/* 874C 8002D34C 1447000A */ bne $v0, $a3, .L8002D378
/* 8750 8002D350 00031542 */ srl $v0, $v1, 21
.L8002D354:
/* 8754 8002D354 3043001F */ andi $v1, $v0, 0x1F
/* 8758 8002D358 00121402 */ srl $v0, $s2, 16
/* 875C 8002D35C 3042001F */ andi $v0, $v0, 0x1F
/* 8760 8002D360 14620005 */ bne $v1, $v0, .L8002D378
/* 8764 8002D364 3082001F */ andi $v0, $a0, 0x1F
/* 8768 8002D368 14620003 */ bne $v1, $v0, .L8002D378
/* 876C 8002D36C 3242FFFF */ andi $v0, $s2, 0xFFFF
/* 8770 8002D370 02058023 */ subu $s0, $s0, $a1
/* 8774 8002D374 02028023 */ subu $s0, $s0, $v0
.L8002D378:
/* 8778 8002D378 8FA40014 */ lw $a0, 0x14($sp)
/* 877C 8002D37C 00041682 */ srl $v0, $a0, 26
/* 8780 8002D380 145E0006 */ bne $v0, $fp, .L8002D39C
/* 8784 8002D384 26310004 */ addiu $s1, $s1, 0x4
/* 8788 8002D388 3083FFFF */ andi $v1, $a0, 0xFFFF
/* 878C 8002D38C 00041402 */ srl $v0, $a0, 16
/* 8790 8002D390 3042FC00 */ andi $v0, $v0, 0xFC00
/* 8794 8002D394 00621821 */ addu $v1, $v1, $v0
/* 8798 8002D398 02038023 */ subu $s0, $s0, $v1
.L8002D39C:
/* 879C 8002D39C 0237102B */ sltu $v0, $s1, $s7
/* 87A0 8002D3A0 1440FFD8 */ bnez $v0, .L8002D304
/* 87A4 8002D3A4 0080902D */ daddu $s2, $a0, $zero
.L8002D3A8:
/* 87A8 8002D3A8 3C04FFF1 */ lui $a0, (0xFFF12BE4 >> 16)
/* 87AC 8002D3AC 34842BE4 */ ori $a0, $a0, (0xFFF12BE4 & 0xFFFF)
/* 87B0 8002D3B0 02042021 */ addu $a0, $s0, $a0
/* 87B4 8002D3B4 02642023 */ subu $a0, $s3, $a0
/* 87B8 8002D3B8 02A42021 */ addu $a0, $s5, $a0
/* 87BC 8002D3BC 3C050031 */ lui $a1, %hi(D_317020)
/* 87C0 8002D3C0 24A57020 */ addiu $a1, $a1, %lo(D_317020)
/* 87C4 8002D3C4 0C00A5CF */ jal dma_copy
/* 87C8 8002D3C8 02C0302D */ daddu $a2, $s6, $zero
/* 87CC 8002D3CC 8FBF003C */ lw $ra, 0x3C($sp)
/* 87D0 8002D3D0 8FBE0038 */ lw $fp, 0x38($sp)
/* 87D4 8002D3D4 8FB70034 */ lw $s7, 0x34($sp)
/* 87D8 8002D3D8 8FB60030 */ lw $s6, 0x30($sp)
/* 87DC 8002D3DC 8FB5002C */ lw $s5, 0x2C($sp)
/* 87E0 8002D3E0 8FB40028 */ lw $s4, 0x28($sp)
/* 87E4 8002D3E4 8FB30024 */ lw $s3, 0x24($sp)
/* 87E8 8002D3E8 8FB20020 */ lw $s2, 0x20($sp)
/* 87EC 8002D3EC 8FB1001C */ lw $s1, 0x1C($sp)
/* 87F0 8002D3F0 8FB00018 */ lw $s0, 0x18($sp)
/* 87F4 8002D3F4 03E00008 */ jr $ra
/* 87F8 8002D3F8 27BD0040 */ addiu $sp, $sp, 0x40
/* 87FC 8002D3FC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void load_obfuscation_shims(void) {
// no-op since in shiftable builds, we bypass the obfuscation
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80252D40
/* 181620 80252D40 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 181624 80252D44 AFB20018 */ sw $s2, 0x18($sp)
/* 181628 80252D48 0080902D */ daddu $s2, $a0, $zero
/* 18162C 80252D4C AFBF0020 */ sw $ra, 0x20($sp)
D_80252D50:
/* 181630 80252D50 AFB3001C */ sw $s3, 0x1C($sp)
/* 181634 80252D54 AFB10014 */ sw $s1, 0x14($sp)
/* 181638 80252D58 AFB00010 */ sw $s0, 0x10($sp)
/* 18163C 80252D5C 8E50000C */ lw $s0, 0xC($s2)
/* 181640 80252D60 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 181644 80252D64 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
dgb_01_D_80252D68_C105E8:
/* 181648 80252D68 8E130000 */ lw $s3, 0x0($s0)
/* 18164C 80252D6C 26100004 */ addiu $s0, $s0, 0x4
/* 181650 80252D70 8E020000 */ lw $v0, 0x0($s0)
/* 181654 80252D74 26100004 */ addiu $s0, $s0, 0x4
/* 181658 80252D78 AE20018C */ sw $zero, 0x18C($s1)
/* 18165C 80252D7C AE220188 */ sw $v0, 0x188($s1)
/* 181660 80252D80 8E020000 */ lw $v0, 0x0($s0)
/* 181664 80252D84 26100004 */ addiu $s0, $s0, 0x4
/* 181668 80252D88 AE220190 */ sw $v0, 0x190($s1)
/* 18166C 80252D8C 8E050000 */ lw $a1, 0x0($s0)
/* 181670 80252D90 0C0B1EAF */ jal evt_get_variable
dgb_01_D_80252D94_C10614:
/* 181674 80252D94 26100004 */ addiu $s0, $s0, 0x4
/* 181678 80252D98 A622017E */ sh $v0, 0x17E($s1)
/* 18167C 80252D9C 8E100000 */ lw $s0, 0x0($s0)
/* 181680 80252DA0 24020030 */ addiu $v0, $zero, 0x30
/* 181684 80252DA4 32030030 */ andi $v1, $s0, 0x30
/* 181688 80252DA8 54620004 */ bnel $v1, $v0, .L80252DBC
/* 18168C 80252DAC 32020010 */ andi $v0, $s0, 0x10
/* 181690 80252DB0 8E220000 */ lw $v0, 0x0($s1)
/* 181694 80252DB4 08094B7F */ j .L80252DFC
/* 181698 80252DB8 34420030 */ ori $v0, $v0, 0x30
.L80252DBC:
/* 18169C 80252DBC 10400004 */ beqz $v0, .L80252DD0
dgb_01_D_80252DC0_C10640:
/* 1816A0 80252DC0 2403FFDF */ addiu $v1, $zero, -0x21
/* 1816A4 80252DC4 8E220000 */ lw $v0, 0x0($s1)
/* 1816A8 80252DC8 08094B7E */ j .L80252DF8
/* 1816AC 80252DCC 34420010 */ ori $v0, $v0, 0x10
.L80252DD0:
/* 1816B0 80252DD0 32020020 */ andi $v0, $s0, 0x20
/* 1816B4 80252DD4 10400005 */ beqz $v0, dgb_01_D_80252DEC_C1066C
/* 1816B8 80252DD8 2403FFEF */ addiu $v1, $zero, -0x11
/* 1816BC 80252DDC 8E220000 */ lw $v0, 0x0($s1)
/* 1816C0 80252DE0 00431024 */ and $v0, $v0, $v1
/* 1816C4 80252DE4 08094B7F */ j .L80252DFC
/* 1816C8 80252DE8 34420020 */ ori $v0, $v0, 0x20
dgb_01_D_80252DEC_C1066C:
/* 1816CC 80252DEC 8E220000 */ lw $v0, 0x0($s1)
/* 1816D0 80252DF0 00431024 */ and $v0, $v0, $v1
/* 1816D4 80252DF4 2403FFDF */ addiu $v1, $zero, -0x21
.L80252DF8:
/* 1816D8 80252DF8 00431024 */ and $v0, $v0, $v1
.L80252DFC:
/* 1816DC 80252DFC AE220000 */ sw $v0, 0x0($s1)
/* 1816E0 80252E00 32020040 */ andi $v0, $s0, 0x40
/* 1816E4 80252E04 10400007 */ beqz $v0, .L80252E24
/* 1816E8 80252E08 2404FFBF */ addiu $a0, $zero, -0x41
/* 1816EC 80252E0C 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1816F0 80252E10 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1816F4 80252E14 8C620000 */ lw $v0, 0x0($v1)
dgb_01_D_80252E18_C10698:
/* 1816F8 80252E18 34420040 */ ori $v0, $v0, 0x40
/* 1816FC 80252E1C 08094B8E */ j .L80252E38
/* 181700 80252E20 AC620000 */ sw $v0, 0x0($v1)
.L80252E24:
/* 181704 80252E24 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181708 80252E28 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 18170C 80252E2C 8C430000 */ lw $v1, 0x0($v0)
/* 181710 80252E30 00641824 */ and $v1, $v1, $a0
/* 181714 80252E34 AC430000 */ sw $v1, 0x0($v0)
.L80252E38:
/* 181718 80252E38 32020200 */ andi $v0, $s0, 0x200
/* 18171C 80252E3C 10400007 */ beqz $v0, .L80252E5C
/* 181720 80252E40 2404FDFF */ addiu $a0, $zero, -0x201
dgb_01_D_80252E44_C106C4:
/* 181724 80252E44 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 181728 80252E48 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 18172C 80252E4C 8C620000 */ lw $v0, 0x0($v1)
/* 181730 80252E50 34420200 */ ori $v0, $v0, 0x200
D_80252E54:
/* 181734 80252E54 08094B9C */ j dgb_01_D_80252E70_C106F0
/* 181738 80252E58 AC620000 */ sw $v0, 0x0($v1)
.L80252E5C:
/* 18173C 80252E5C 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181740 80252E60 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 181744 80252E64 8C430000 */ lw $v1, 0x0($v0)
/* 181748 80252E68 00641824 */ and $v1, $v1, $a0
/* 18174C 80252E6C AC430000 */ sw $v1, 0x0($v0)
dgb_01_D_80252E70_C106F0:
/* 181750 80252E70 32020080 */ andi $v0, $s0, 0x80
/* 181754 80252E74 10400007 */ beqz $v0, .L80252E94
/* 181758 80252E78 2404FF7F */ addiu $a0, $zero, -0x81
/* 18175C 80252E7C 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 181760 80252E80 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 181764 80252E84 8C620000 */ lw $v0, 0x0($v1)
/* 181768 80252E88 34420080 */ ori $v0, $v0, 0x80
D_80252E8C:
/* 18176C 80252E8C 08094BAA */ j .L80252EA8
/* 181770 80252E90 AC620000 */ sw $v0, 0x0($v1)
.L80252E94:
/* 181774 80252E94 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181778 80252E98 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
dgb_01_D_80252E9C_C1071C:
/* 18177C 80252E9C 8C430000 */ lw $v1, 0x0($v0)
/* 181780 80252EA0 00641824 */ and $v1, $v1, $a0
/* 181784 80252EA4 AC430000 */ sw $v1, 0x0($v0)
.L80252EA8:
/* 181788 80252EA8 0C09A75B */ jal get_actor
/* 18178C 80252EAC 8E440148 */ lw $a0, 0x148($s2)
D_80252EB0:
/* 181790 80252EB0 94430428 */ lhu $v1, 0x428($v0)
/* 181794 80252EB4 A62301A0 */ sh $v1, 0x1A0($s1)
/* 181798 80252EB8 92230193 */ lbu $v1, 0x193($s1)
/* 18179C 80252EBC 90420426 */ lbu $v0, 0x426($v0)
/* 1817A0 80252EC0 A2230194 */ sb $v1, 0x194($s1)
/* 1817A4 80252EC4 306300FF */ andi $v1, $v1, 0xFF
dgb_01_D_80252EC8_C10748:
/* 1817A8 80252EC8 A22201A2 */ sb $v0, 0x1A2($s1)
/* 1817AC 80252ECC 240200FF */ addiu $v0, $zero, 0xFF
/* 1817B0 80252ED0 50620001 */ beql $v1, $v0, .L80252ED8
/* 1817B4 80252ED4 A2200194 */ sb $zero, 0x194($s1)
.L80252ED8:
/* 1817B8 80252ED8 8E220190 */ lw $v0, 0x190($s1)
/* 1817BC 80252EDC 30420F00 */ andi $v0, $v0, 0xF00
/* 1817C0 80252EE0 00021203 */ sra $v0, $v0, 8
/* 1817C4 80252EE4 0C094574 */ jal func_802515D0
/* 1817C8 80252EE8 A2220195 */ sb $v0, 0x195($s1)
/* 1817CC 80252EEC 04400006 */ bltz $v0, .L80252F08
/* 1817D0 80252EF0 0240202D */ daddu $a0, $s2, $zero
dgb_01_D_80252EF4_C10774:
/* 1817D4 80252EF4 0260282D */ daddu $a1, $s3, $zero
/* 1817D8 80252EF8 0C0B2026 */ jal evt_set_variable
/* 1817DC 80252EFC 0040302D */ daddu $a2, $v0, $zero
/* 1817E0 80252F00 08094BC3 */ j .L80252F0C
/* 1817E4 80252F04 24020002 */ addiu $v0, $zero, 0x2
.L80252F08:
/* 1817E8 80252F08 240200FF */ addiu $v0, $zero, 0xFF
.L80252F0C:
/* 1817EC 80252F0C 8FBF0020 */ lw $ra, 0x20($sp)
/* 1817F0 80252F10 8FB3001C */ lw $s3, 0x1C($sp)
/* 1817F4 80252F14 8FB20018 */ lw $s2, 0x18($sp)
/* 1817F8 80252F18 8FB10014 */ lw $s1, 0x14($sp)
/* 1817FC 80252F1C 8FB00010 */ lw $s0, 0x10($sp)
dgb_01_D_80252F20_C107A0:
/* 181800 80252F20 03E00008 */ jr $ra
/* 181804 80252F24 27BD0028 */ addiu $sp, $sp, 0x28
/* 181808 80252F28 00000000 */ nop
/* 18180C 80252F2C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
ApiStatus ItemCheckHit(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
Bytecode* args = script->ptrReadPos;
s32 hitResultVarOut = *args++;
s32 flags;
Actor* actor;
HitResult hitResult;
battleStatus->currentAttackElement = *args++;
battleStatus->currentAttackEventSuppression = 0;
battleStatus->currentAttackStatus = *args++;
battleStatus->currentAttackDamage = evt_get_variable(script, *args++);
flags = *args++;
if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) {
gBattleStatus.flags1 |= BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE;
} else if (flags & BS_FLAGS1_10) {
gBattleStatus.flags1 |= BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
} else if (flags & BS_FLAGS1_SP_EVT_ACTIVE) {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
}
if (flags & BS_FLAGS1_40) {
gBattleStatus.flags1 |= BS_FLAGS1_40;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_40;
}
if (flags & BS_FLAGS1_200) {
gBattleStatus.flags1 |= BS_FLAGS1_200;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_200;
}
if (flags & BS_FLAGS1_80) {
gBattleStatus.flags1 |= BS_FLAGS1_80;
} else {
gBattleStatus.flags1 &= ~BS_FLAGS1_80;
}
actor = get_actor(script->owner1.actorID);
battleStatus->currentTargetID = actor->targetActorID;
battleStatus->currentTargetPart = actor->targetPartIndex;
battleStatus->statusChance = battleStatus->currentAttackStatus;
if (battleStatus->statusChance == STATUS_KEY_NEVER) {
battleStatus->statusChance = 0;
}
battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8;
hitResult = calc_item_check_hit();
if (hitResult < 0) {
return ApiStatus_FINISH;
}
evt_set_variable(script, hitResultVarOut, hitResult);
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel set_action_state
/* 7F254 800E5DA4 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 7F258 800E5DA8 AFB00010 */ sw $s0, 0x10($sp)
/* 7F25C 800E5DAC 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* 7F260 800E5DB0 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* 7F264 800E5DB4 AFBF0018 */ sw $ra, 0x18($sp)
/* 7F268 800E5DB8 AFB10014 */ sw $s1, 0x14($sp)
/* 7F26C 800E5DBC 8E030000 */ lw $v1, 0x0($s0)
/* 7F270 800E5DC0 30620200 */ andi $v0, $v1, 0x200
/* 7F274 800E5DC4 10400005 */ beqz $v0, .L800E5DDC
/* 7F278 800E5DC8 0080882D */ daddu $s1, $a0, $zero
/* 7F27C 800E5DCC 2402FDFF */ addiu $v0, $zero, -0x201
/* 7F280 800E5DD0 00621024 */ and $v0, $v1, $v0
/* 7F284 800E5DD4 0C038069 */ jal enable_player_input
/* 7F288 800E5DD8 AE020000 */ sw $v0, 0x0($s0)
.L800E5DDC:
/* 7F28C 800E5DDC 8E040004 */ lw $a0, 0x4($s0)
/* 7F290 800E5DE0 30824000 */ andi $v0, $a0, 0x4000
/* 7F294 800E5DE4 1040000C */ beqz $v0, .L800E5E18
/* 7F298 800E5DE8 2A22000C */ slti $v0, $s1, 0xC
/* 7F29C 800E5DEC 10400059 */ beqz $v0, .L800E5F54
/* 7F2A0 800E5DF0 00000000 */ nop
/* 7F2A4 800E5DF4 06200057 */ bltz $s1, .L800E5F54
/* 7F2A8 800E5DF8 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 7F2AC 800E5DFC 920200B4 */ lbu $v0, 0xB4($s0)
/* 7F2B0 800E5E00 A20200B5 */ sb $v0, 0xB5($s0)
/* 7F2B4 800E5E04 8E020000 */ lw $v0, 0x0($s0)
/* 7F2B8 800E5E08 A21100B4 */ sb $s1, 0xB4($s0)
/* 7F2BC 800E5E0C 00431025 */ or $v0, $v0, $v1
/* 7F2C0 800E5E10 080397D5 */ j .L800E5F54
/* 7F2C4 800E5E14 AE020000 */ sw $v0, 0x0($s0)
.L800E5E18:
/* 7F2C8 800E5E18 24020015 */ addiu $v0, $zero, 0x15
/* 7F2CC 800E5E1C 12220003 */ beq $s1, $v0, .L800E5E2C
/* 7F2D0 800E5E20 24020017 */ addiu $v0, $zero, 0x17
/* 7F2D4 800E5E24 1622001A */ bne $s1, $v0, .L800E5E90
/* 7F2D8 800E5E28 24020011 */ addiu $v0, $zero, 0x11
.L800E5E2C:
/* 7F2DC 800E5E2C 820300BF */ lb $v1, 0xBF($s0)
/* 7F2E0 800E5E30 24020003 */ addiu $v0, $zero, 0x3
/* 7F2E4 800E5E34 50620001 */ beql $v1, $v0, .L800E5E3C
/* 7F2E8 800E5E38 24110015 */ addiu $s1, $zero, 0x15
.L800E5E3C:
/* 7F2EC 800E5E3C 3C028011 */ lui $v0, %hi(gPlayerData)
/* 7F2F0 800E5E40 2442F290 */ addiu $v0, $v0, %lo(gPlayerData)
/* 7F2F4 800E5E44 90430012 */ lbu $v1, 0x12($v0)
/* 7F2F8 800E5E48 2462FFF9 */ addiu $v0, $v1, -0x7
/* 7F2FC 800E5E4C 2C420002 */ sltiu $v0, $v0, 0x2
/* 7F300 800E5E50 14400005 */ bnez $v0, .L800E5E68
/* 7F304 800E5E54 00031600 */ sll $v0, $v1, 24
/* 7F308 800E5E58 00021603 */ sra $v0, $v0, 24
/* 7F30C 800E5E5C 24030004 */ addiu $v1, $zero, 0x4
/* 7F310 800E5E60 1443000B */ bne $v0, $v1, .L800E5E90
/* 7F314 800E5E64 24020011 */ addiu $v0, $zero, 0x11
.L800E5E68:
/* 7F318 800E5E68 3C028011 */ lui $v0, %hi(gPartnerStatus)
/* 7F31C 800E5E6C 8042EBB0 */ lb $v0, %lo(gPartnerStatus)($v0)
/* 7F320 800E5E70 10400006 */ beqz $v0, .L800E5E8C
/* 7F324 800E5E74 34830004 */ ori $v1, $a0, 0x4
/* 7F328 800E5E78 8E020000 */ lw $v0, 0x0($s0)
/* 7F32C 800E5E7C AE030004 */ sw $v1, 0x4($s0)
/* 7F330 800E5E80 34420800 */ ori $v0, $v0, 0x800
/* 7F334 800E5E84 080397D5 */ j .L800E5F54
/* 7F338 800E5E88 AE020000 */ sw $v0, 0x0($s0)
.L800E5E8C:
/* 7F33C 800E5E8C 24020011 */ addiu $v0, $zero, 0x11
.L800E5E90:
/* 7F340 800E5E90 16220007 */ bne $s1, $v0, .L800E5EB0
/* 7F344 800E5E94 2403BFFF */ addiu $v1, $zero, -0x4001
/* 7F348 800E5E98 8E020000 */ lw $v0, 0x0($s0)
/* 7F34C 800E5E9C A6000012 */ sh $zero, 0x12($s0)
/* 7F350 800E5EA0 34420010 */ ori $v0, $v0, 0x10
/* 7F354 800E5EA4 AE020000 */ sw $v0, 0x0($s0)
/* 7F358 800E5EA8 00431024 */ and $v0, $v0, $v1
/* 7F35C 800E5EAC AE020000 */ sw $v0, 0x0($s0)
.L800E5EB0:
/* 7F360 800E5EB0 920200B4 */ lbu $v0, 0xB4($s0)
/* 7F364 800E5EB4 A20200B5 */ sb $v0, 0xB5($s0)
/* 7F368 800E5EB8 2402001F */ addiu $v0, $zero, 0x1F
/* 7F36C 800E5EBC 52220001 */ beql $s1, $v0, .L800E5EC4
/* 7F370 800E5EC0 A20000B5 */ sb $zero, 0xB5($s0)
.L800E5EC4:
/* 7F374 800E5EC4 2402001B */ addiu $v0, $zero, 0x1B
/* 7F378 800E5EC8 16220004 */ bne $s1, $v0, .L800E5EDC
/* 7F37C 800E5ECC 00000000 */ nop
/* 7F380 800E5ED0 8E020004 */ lw $v0, 0x4($s0)
/* 7F384 800E5ED4 34420004 */ ori $v0, $v0, 0x4
/* 7F388 800E5ED8 AE020004 */ sw $v0, 0x4($s0)
.L800E5EDC:
/* 7F38C 800E5EDC 8E030000 */ lw $v1, 0x0($s0)
/* 7F390 800E5EE0 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 7F394 800E5EE4 A21100B4 */ sb $s1, 0xB4($s0)
/* 7F398 800E5EE8 00622825 */ or $a1, $v1, $v0
/* 7F39C 800E5EEC 820300B4 */ lb $v1, 0xB4($s0)
/* 7F3A0 800E5EF0 2402001A */ addiu $v0, $zero, 0x1A
/* 7F3A4 800E5EF4 10620017 */ beq $v1, $v0, .L800E5F54
/* 7F3A8 800E5EF8 AE050000 */ sw $a1, 0x0($s0)
/* 7F3AC 800E5EFC 3C02FFFD */ lui $v0, (0xFFFDFFFF >> 16)
/* 7F3B0 800E5F00 3442FFFF */ ori $v0, $v0, (0xFFFDFFFF & 0xFFFF)
/* 7F3B4 800E5F04 3C04FFFE */ lui $a0, (0xFFFEFFFF >> 16)
/* 7F3B8 800E5F08 3484FFFF */ ori $a0, $a0, (0xFFFEFFFF & 0xFFFF)
/* 7F3BC 800E5F0C 00A21024 */ and $v0, $a1, $v0
/* 7F3C0 800E5F10 3C038011 */ lui $v1, %hi(gPlayerSpinState)
/* 7F3C4 800E5F14 2463F250 */ addiu $v1, $v1, %lo(gPlayerSpinState)
/* 7F3C8 800E5F18 AE020000 */ sw $v0, 0x0($s0)
/* 7F3CC 800E5F1C 8E020004 */ lw $v0, 0x4($s0)
/* 7F3D0 800E5F20 8C630030 */ lw $v1, 0x30($v1)
/* 7F3D4 800E5F24 00441024 */ and $v0, $v0, $a0
/* 7F3D8 800E5F28 10600003 */ beqz $v1, .L800E5F38
/* 7F3DC 800E5F2C AE020004 */ sw $v0, 0x4($s0)
/* 7F3E0 800E5F30 0C05271B */ jal sfx_stop_sound
/* 7F3E4 800E5F34 0060202D */ daddu $a0, $v1, $zero
.L800E5F38:
/* 7F3E8 800E5F38 8E0200D8 */ lw $v0, 0xD8($s0)
/* 7F3EC 800E5F3C 10400005 */ beqz $v0, .L800E5F54
/* 7F3F0 800E5F40 00000000 */ nop
/* 7F3F4 800E5F44 8C43000C */ lw $v1, 0xC($v0)
/* 7F3F8 800E5F48 2402000A */ addiu $v0, $zero, 0xA
/* 7F3FC 800E5F4C AC620024 */ sw $v0, 0x24($v1)
/* 7F400 800E5F50 AE0000D8 */ sw $zero, 0xD8($s0)
.L800E5F54:
/* 7F404 800E5F54 8FBF0018 */ lw $ra, 0x18($sp)
/* 7F408 800E5F58 8FB10014 */ lw $s1, 0x14($sp)
/* 7F40C 800E5F5C 8FB00010 */ lw $s0, 0x10($sp)
/* 7F410 800E5F60 03E00008 */ jr $ra
/* 7F414 800E5F64 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void set_action_state(s32 actionState) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerData* playerData = &gPlayerData;
PlayerSpinState* spinState = &gPlayerSpinState;
if (playerStatus->flags & PS_FLAG_SPECIAL_JUMP) {
playerStatus->flags &= ~PS_FLAG_SPECIAL_JUMP;
enable_player_input();
}
if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) {
// TODO figure this out
#ifdef NON_EQUIVALENT
if (
actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK ||
actionState == ACTION_STATE_RUN || actionState == ACTION_STATE_JUMP ||
actionState == ACTION_STATE_BOUNCE || actionState == ACTION_STATE_HOP ||
actionState == ACTION_STATE_LAUNCH || actionState == ACTION_STATE_LANDING_ON_SWITCH ||
actionState == ACTION_STATE_FALLING || actionState == ACTION_STATE_STEP_DOWN ||
actionState == ACTION_STATE_LAND || actionState == ACTION_STATE_STEP_DOWN_LAND
) {
#else
if (actionState < ACTION_STATE_TALK)
if (actionState >= 0) {
#endif
playerStatus->prevActionState = playerStatus->actionState;
playerStatus->actionState = actionState;
playerStatus->flags |= PS_FLAG_ACTION_STATE_CHANGED;
}
return;
}
if (actionState == ACTION_STATE_HIT_FIRE || actionState == ACTION_STATE_HIT_LAVA) {
s8 partner;
if (playerStatus->hazardType == HAZARD_TYPE_FIRE_BAR) {
actionState = ACTION_STATE_HIT_FIRE;
}
// Whilst Sushie, Lakilester, or Parakarry's ability is active, hazards have no effect.
partner = playerData->currentPartner;
if (partner == PARTNER_SUSHIE || partner == PARTNER_LAKILESTER || partner == PARTNER_PARAKARRY) {
if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE) {
playerStatus->animFlags |= PA_FLAG_INTERRUPT_USE_PARTNER;
playerStatus->flags |= PS_FLAG_HIT_FIRE;
return;
}
}
}
if (actionState == ACTION_STATE_SLIDING) {
playerStatus->flags |= PS_FLAG_SLIDING;
playerStatus->moveFrames = 0;
playerStatus->flags &= ~PS_FLAG_CUTSCENE_MOVEMENT;
}
playerStatus->prevActionState = playerStatus->actionState;
if (actionState == ACTION_STATE_USE_TWEESTER) {
playerStatus->prevActionState = ACTION_STATE_IDLE;
}
if (actionState == ACTION_STATE_ENEMY_FIRST_STRIKE) {
playerStatus->animFlags |= PA_FLAG_INTERRUPT_USE_PARTNER;
}
playerStatus->actionState = actionState;
playerStatus->flags |= PS_FLAG_ACTION_STATE_CHANGED;
if (playerStatus->actionState == ACTION_STATE_SPIN) {
return;
}
playerStatus->flags &= ~PS_FLAG_SPINNING;
playerStatus->animFlags &= ~PA_FLAG_SPINNING;
if (spinState->spinSoundID != 0) {
sfx_stop_sound(spinState->spinSoundID);
}
if (playerStatus->specialDecorationEffect != NULL) {
playerStatus->specialDecorationEffect->data.spin->timeLeft = 10;
playerStatus->specialDecorationEffect = NULL;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel start_script_in_group
/* E7F80 802C35D0 27BDFFD0 */ addiu $sp, $sp, -0x30
/* E7F84 802C35D4 AFB10014 */ sw $s1, 0x14($sp)
/* E7F88 802C35D8 0080882D */ daddu $s1, $a0, $zero
/* E7F8C 802C35DC AFB40020 */ sw $s4, 0x20($sp)
/* E7F90 802C35E0 00A0A02D */ daddu $s4, $a1, $zero
/* E7F94 802C35E4 AFB3001C */ sw $s3, 0x1C($sp)
/* E7F98 802C35E8 00C0982D */ daddu $s3, $a2, $zero
/* E7F9C 802C35EC AFB50024 */ sw $s5, 0x24($sp)
/* E7FA0 802C35F0 00E0A82D */ daddu $s5, $a3, $zero
/* E7FA4 802C35F4 3C03802E */ lui $v1, %hi(gCurrentScriptListPtr)
/* E7FA8 802C35F8 8C63A890 */ lw $v1, %lo(gCurrentScriptListPtr)($v1)
/* E7FAC 802C35FC 0000282D */ daddu $a1, $zero, $zero
/* E7FB0 802C3600 AFBF0028 */ sw $ra, 0x28($sp)
/* E7FB4 802C3604 AFB20018 */ sw $s2, 0x18($sp)
/* E7FB8 802C3608 AFB00010 */ sw $s0, 0x10($sp)
.L802C360C:
/* E7FBC 802C360C 8C620000 */ lw $v0, 0x0($v1)
/* E7FC0 802C3610 10400006 */ beqz $v0, .L802C362C
/* E7FC4 802C3614 28A20080 */ slti $v0, $a1, 0x80
/* E7FC8 802C3618 24A50001 */ addiu $a1, $a1, 0x1
/* E7FCC 802C361C 28A20080 */ slti $v0, $a1, 0x80
/* E7FD0 802C3620 1440FFFA */ bnez $v0, .L802C360C
/* E7FD4 802C3624 24630004 */ addiu $v1, $v1, 0x4
/* E7FD8 802C3628 28A20080 */ slti $v0, $a1, 0x80
.L802C362C:
/* E7FDC 802C362C 14400003 */ bnez $v0, .L802C363C
/* E7FE0 802C3630 24040168 */ addiu $a0, $zero, 0x168
.L802C3634:
/* E7FE4 802C3634 080B0D8D */ j .L802C3634
/* E7FE8 802C3638 00000000 */ nop
.L802C363C:
/* E7FEC 802C363C 0C00AB39 */ jal heap_malloc
/* E7FF0 802C3640 00A0902D */ daddu $s2, $a1, $zero
/* E7FF4 802C3644 00122080 */ sll $a0, $s2, 2
/* E7FF8 802C3648 3C03802E */ lui $v1, %hi(gCurrentScriptListPtr)
/* E7FFC 802C364C 8C63A890 */ lw $v1, %lo(gCurrentScriptListPtr)($v1)
/* E8000 802C3650 3C05802E */ lui $a1, %hi(gNumScripts)
/* E8004 802C3654 24A5A488 */ addiu $a1, $a1, %lo(gNumScripts)
/* E8008 802C3658 00832021 */ addu $a0, $a0, $v1
/* E800C 802C365C 8CA30000 */ lw $v1, 0x0($a1)
/* E8010 802C3660 0040802D */ daddu $s0, $v0, $zero
/* E8014 802C3664 AC900000 */ sw $s0, 0x0($a0)
/* E8018 802C3668 24630001 */ addiu $v1, $v1, 0x1
/* E801C 802C366C 16000003 */ bnez $s0, .L802C367C
/* E8020 802C3670 ACA30000 */ sw $v1, 0x0($a1)
.L802C3674:
/* E8024 802C3674 080B0D9D */ j .L802C3674
/* E8028 802C3678 00000000 */ nop
.L802C367C:
/* E802C 802C367C 36620001 */ ori $v0, $s3, 0x1
/* E8030 802C3680 3C03802E */ lui $v1, %hi(gStaticScriptCounter)
/* E8034 802C3684 24639CA0 */ addiu $v1, $v1, %lo(gStaticScriptCounter)
/* E8038 802C3688 A2020000 */ sb $v0, 0x0($s0)
/* E803C 802C368C A2000002 */ sb $zero, 0x2($s0)
/* E8040 802C3690 A2140003 */ sb $s4, 0x3($s0)
/* E8044 802C3694 8C620000 */ lw $v0, 0x0($v1)
/* E8048 802C3698 2405000F */ addiu $a1, $zero, 0xF
/* E804C 802C369C AE020144 */ sw $v0, 0x144($s0)
/* E8050 802C36A0 24420001 */ addiu $v0, $v0, 0x1
/* E8054 802C36A4 AC620000 */ sw $v0, 0x0($v1)
/* E8058 802C36A8 2402FFFF */ addiu $v0, $zero, -0x1
/* E805C 802C36AC A2020006 */ sb $v0, 0x6($s0)
/* E8060 802C36B0 A2020007 */ sb $v0, 0x7($s0)
/* E8064 802C36B4 A2150004 */ sb $s5, 0x4($s0)
/* E8068 802C36B8 3C01802E */ lui $at, %hi(gGlobalTimeSpace)
/* E806C 802C36BC C4209CA8 */ lwc1 $f0, %lo(gGlobalTimeSpace)($at)
/* E8070 802C36C0 2603003C */ addiu $v1, $s0, 0x3C
/* E8074 802C36C4 AE110008 */ sw $s1, 0x8($s0)
/* E8078 802C36C8 AE11015C */ sw $s1, 0x15C($s0)
/* E807C 802C36CC AE110164 */ sw $s1, 0x164($s0)
/* E8080 802C36D0 AE000060 */ sw $zero, 0x60($s0)
/* E8084 802C36D4 AE000064 */ sw $zero, 0x64($s0)
/* E8088 802C36D8 AE000068 */ sw $zero, 0x68($s0)
/* E808C 802C36DC AE00006C */ sw $zero, 0x6C($s0)
/* E8090 802C36E0 AE020148 */ sw $v0, 0x148($s0)
/* E8094 802C36E4 AE02014C */ sw $v0, 0x14C($s0)
/* E8098 802C36E8 AE000160 */ sw $zero, 0x160($s0)
/* E809C 802C36EC AE000154 */ sw $zero, 0x154($s0)
/* E80A0 802C36F0 AE000158 */ sw $zero, 0x158($s0)
/* E80A4 802C36F4 E6000150 */ swc1 $f0, 0x150($s0)
.L802C36F8:
/* E80A8 802C36F8 AC600084 */ sw $zero, 0x84($v1)
/* E80AC 802C36FC 24A5FFFF */ addiu $a1, $a1, -0x1
/* E80B0 802C3700 04A1FFFD */ bgez $a1, .L802C36F8
/* E80B4 802C3704 2463FFFC */ addiu $v1, $v1, -0x4
/* E80B8 802C3708 24050002 */ addiu $a1, $zero, 0x2
/* E80BC 802C370C 26020008 */ addiu $v0, $s0, 0x8
.L802C3710:
/* E80C0 802C3710 AC4000C4 */ sw $zero, 0xC4($v0)
/* E80C4 802C3714 24A5FFFF */ addiu $a1, $a1, -0x1
/* E80C8 802C3718 04A1FFFD */ bgez $a1, .L802C3710
/* E80CC 802C371C 2442FFFC */ addiu $v0, $v0, -0x4
/* E80D0 802C3720 0C0B0C52 */ jal find_script_labels
/* E80D4 802C3724 0200202D */ daddu $a0, $s0, $zero
/* E80D8 802C3728 3C02802E */ lui $v0, %hi(gIsUpdatingScripts)
/* E80DC 802C372C 8C429CA4 */ lw $v0, %lo(gIsUpdatingScripts)($v0)
/* E80E0 802C3730 10400012 */ beqz $v0, .L802C377C
/* E80E4 802C3734 00000000 */ nop
/* E80E8 802C3738 92020000 */ lbu $v0, 0x0($s0)
/* E80EC 802C373C 30420020 */ andi $v0, $v0, 0x20
/* E80F0 802C3740 1040000E */ beqz $v0, .L802C377C
/* E80F4 802C3744 00000000 */ nop
/* E80F8 802C3748 3C05802E */ lui $a1, %hi(gScriptListCount)
/* E80FC 802C374C 24A5AC98 */ addiu $a1, $a1, %lo(gScriptListCount)
/* E8100 802C3750 8CA20000 */ lw $v0, 0x0($a1)
/* E8104 802C3754 00022080 */ sll $a0, $v0, 2
/* E8108 802C3758 3C01802E */ lui $at, %hi(gScriptIndexList)
/* E810C 802C375C 00240821 */ addu $at, $at, $a0
/* E8110 802C3760 AC32A898 */ sw $s2, %lo(gScriptIndexList)($at)
/* E8114 802C3764 8E030144 */ lw $v1, 0x144($s0)
/* E8118 802C3768 24420001 */ addiu $v0, $v0, 0x1
/* E811C 802C376C ACA20000 */ sw $v0, 0x0($a1)
/* E8120 802C3770 3C01802E */ lui $at, %hi(gScriptIdList)
/* E8124 802C3774 00240821 */ addu $at, $at, $a0
/* E8128 802C3778 AC23AA98 */ sw $v1, %lo(gScriptIdList)($at)
.L802C377C:
/* E812C 802C377C 0C0B0CE4 */ jal suspend_frozen_scripts
/* E8130 802C3780 0200202D */ daddu $a0, $s0, $zero
/* E8134 802C3784 3C03802E */ lui $v1, %hi(gStaticScriptCounter)
/* E8138 802C3788 24639CA0 */ addiu $v1, $v1, %lo(gStaticScriptCounter)
/* E813C 802C378C 8C620000 */ lw $v0, 0x0($v1)
/* E8140 802C3790 14400004 */ bnez $v0, .L802C37A4
/* E8144 802C3794 0200102D */ daddu $v0, $s0, $zero
/* E8148 802C3798 24020001 */ addiu $v0, $zero, 0x1
/* E814C 802C379C AC620000 */ sw $v0, 0x0($v1)
/* E8150 802C37A0 0200102D */ daddu $v0, $s0, $zero
.L802C37A4:
/* E8154 802C37A4 8FBF0028 */ lw $ra, 0x28($sp)
/* E8158 802C37A8 8FB50024 */ lw $s5, 0x24($sp)
/* E815C 802C37AC 8FB40020 */ lw $s4, 0x20($sp)
/* E8160 802C37B0 8FB3001C */ lw $s3, 0x1C($sp)
/* E8164 802C37B4 8FB20018 */ lw $s2, 0x18($sp)
/* E8168 802C37B8 8FB10014 */ lw $s1, 0x14($sp)
/* E816C 802C37BC 8FB00010 */ lw $s0, 0x10($sp)
/* E8170 802C37C0 03E00008 */ jr $ra
/* E8174 802C37C4 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
Evt* start_script_in_group(EvtScript* source, u8 priority, u8 flags, u8 groupFlags) {
Evt* newScript;
s32 scriptListCount;
s32 i;
s32 curScriptIndex;
s32* tempCounter;
s32* numScripts;
for (i = 0; i < MAX_SCRIPTS; i++) {
if ((*gCurrentScriptListPtr)[i] == NULL) {
break;
}
}
ASSERT(i < MAX_SCRIPTS);
curScriptIndex = i;
(*gCurrentScriptListPtr)[curScriptIndex] = newScript = heap_malloc(sizeof(*newScript));
numScripts = &gNumScripts;
(*numScripts)++;
ASSERT(newScript != NULL);
// Some of this function is surely macros. I think we'll learn more as we do others in this file. -Ethan
do {
newScript->stateFlags = flags | EVT_FLAG_ACTIVE;
newScript->currentOpcode = EVT_OP_INTERNAL_FETCH;
newScript->priority = priority;
newScript->id = gStaticScriptCounter++;
newScript->ptrNextLine = (Bytecode*)source;
newScript->ptrFirstLine = (Bytecode*)source;
newScript->ptrCurrentLine = (Bytecode*)source;
newScript->userData = 0;
newScript->blockingParent = 0;
newScript->childScript = 0;
newScript->parentScript = 0;
newScript->owner1.actorID = -1;
newScript->owner2.npcID = -1;
newScript->loopDepth = -1;
newScript->switchDepth = -1;
newScript->groupFlags = groupFlags;
newScript->ptrSavedPos = 0;
newScript->frameCounter = 0.0f;
newScript->unk_158 = 0;
newScript->timeScale = gGlobalTimeSpace;
scriptListCount = 0;
for (i = 0; i < ARRAY_COUNT(newScript->varTable); i++) {
newScript->varTable[i] = 0;
}
for (i = 0; i < ARRAY_COUNT(newScript->varFlags); i++) {
newScript->varFlags[i] = 0;
}
find_script_labels(newScript);
if (gIsUpdatingScripts && (newScript->stateFlags & EVT_FLAG_RUN_IMMEDIATELY)) {
scriptListCount = gScriptListCount++;
gScriptIndexList[scriptListCount] = curScriptIndex;
gScriptIdList[scriptListCount] = newScript->id;
}
} while (0);
suspend_frozen_scripts(newScript);
tempCounter = &gStaticScriptCounter;
if (*tempCounter == 0) {
*tempCounter = 1;
}
return newScript;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel spr_component_update
/* 1007CC 802DD6DC 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 1007D0 802DD6E0 AFB50024 */ sw $s5, 0x24($sp)
/* 1007D4 802DD6E4 8FB50040 */ lw $s5, 0x40($sp)
/* 1007D8 802DD6E8 AFB3001C */ sw $s3, 0x1C($sp)
/* 1007DC 802DD6EC 00A0982D */ daddu $s3, $a1, $zero
/* 1007E0 802DD6F0 AFB10014 */ sw $s1, 0x14($sp)
/* 1007E4 802DD6F4 00C0882D */ daddu $s1, $a2, $zero
/* 1007E8 802DD6F8 AFB40020 */ sw $s4, 0x20($sp)
/* 1007EC 802DD6FC AFB00010 */ sw $s0, 0x10($sp)
/* 1007F0 802DD700 0260802D */ daddu $s0, $s3, $zero
/* 1007F4 802DD704 AFBF0028 */ sw $ra, 0x28($sp)
/* 1007F8 802DD708 AFB20018 */ sw $s2, 0x18($sp)
/* 1007FC 802DD70C 3C01802E */ lui $at, %hi(SpriteUpdateNotifyValue)
/* 100800 802DD710 AC24FEAC */ sw $a0, %lo(SpriteUpdateNotifyValue)($at)
/* 100804 802DD714 8E030000 */ lw $v1, 0x0($s0)
/* 100808 802DD718 2402FFFF */ addiu $v0, $zero, -0x1
/* 10080C 802DD71C 1062000E */ beq $v1, $v0, .L802DD758
/* 100810 802DD720 00E0A02D */ daddu $s4, $a3, $zero
/* 100814 802DD724 0040902D */ daddu $s2, $v0, $zero
.L802DD728:
/* 100818 802DD728 8E040000 */ lw $a0, 0x0($s0)
/* 10081C 802DD72C 8E250000 */ lw $a1, 0x0($s1)
/* 100820 802DD730 0C0B7447 */ jal spr_component_update_commands
/* 100824 802DD734 26100004 */ addiu $s0, $s0, 0x4
/* 100828 802DD738 8E220000 */ lw $v0, 0x0($s1)
/* 10082C 802DD73C 54520001 */ bnel $v0, $s2, .L802DD744
/* 100830 802DD740 26310004 */ addiu $s1, $s1, 0x4
.L802DD744:
/* 100834 802DD744 8E020000 */ lw $v0, 0x0($s0)
/* 100838 802DD748 1452FFF7 */ bne $v0, $s2, .L802DD728
/* 10083C 802DD74C 2402FFFF */ addiu $v0, $zero, -0x1
/* 100840 802DD750 0260802D */ daddu $s0, $s3, $zero
/* 100844 802DD754 8E030000 */ lw $v1, 0x0($s0)
.L802DD758:
/* 100848 802DD758 1062000A */ beq $v1, $v0, .L802DD784
/* 10084C 802DD75C 0040882D */ daddu $s1, $v0, $zero
.L802DD760:
/* 100850 802DD760 8E040000 */ lw $a0, 0x0($s0)
/* 100854 802DD764 26100004 */ addiu $s0, $s0, 0x4
/* 100858 802DD768 0260282D */ daddu $a1, $s3, $zero
/* 10085C 802DD76C 0280302D */ daddu $a2, $s4, $zero
/* 100860 802DD770 0C0B758D */ jal spr_component_update_finish
/* 100864 802DD774 02A0382D */ daddu $a3, $s5, $zero
/* 100868 802DD778 8E020000 */ lw $v0, 0x0($s0)
/* 10086C 802DD77C 1451FFF8 */ bne $v0, $s1, .L802DD760
/* 100870 802DD780 00000000 */ nop
.L802DD784:
/* 100874 802DD784 3C02802E */ lui $v0, %hi(SpriteUpdateNotifyValue)
/* 100878 802DD788 8C42FEAC */ lw $v0, %lo(SpriteUpdateNotifyValue)($v0)
/* 10087C 802DD78C 8FBF0028 */ lw $ra, 0x28($sp)
/* 100880 802DD790 8FB50024 */ lw $s5, 0x24($sp)
/* 100884 802DD794 8FB40020 */ lw $s4, 0x20($sp)
/* 100888 802DD798 8FB3001C */ lw $s3, 0x1C($sp)
/* 10088C 802DD79C 8FB20018 */ lw $s2, 0x18($sp)
/* 100890 802DD7A0 8FB10014 */ lw $s1, 0x14($sp)
/* 100894 802DD7A4 8FB00010 */ lw $s0, 0x10($sp)
/* 100898 802DD7A8 03E00008 */ jr $ra
/* 10089C 802DD7AC 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void spr_component_update_commands(SpriteComponent* comp, SpriteAnimComponent* anim) {
f32 posX, posY, posZ;
f32 rotX, rotY, rotZ;
f32 scaleX, scaleY, scaleZ;
s32 changedFlags;
u16* bufPos;
u16* gotoPos;
s32 cmdValue;
if (comp->initialized) {
scaleZ = 1.0f;
scaleY = 1.0f;
scaleX = 1.0f;
changedFlags = 0;
bufPos = comp->readPos;
gotoPos = (u16*) -1;
comp->waitTime -= spr_animUpdateTimeScale;
while (comp->waitTime <= 0.0f) {
// overflow check
if (bufPos >= &anim->cmdList[anim->cmdListSize / 2]) {
bufPos = anim->cmdList;
break;
}
switch (*bufPos & 0xF000) {
// 0VVV
// Wait
case 0x0000:
comp->waitTime = *bufPos++ & 0xFFF;
if (comp->waitTime == 0.0f) {
comp->waitTime = 4095.0f;
}
comp->posOffset.z = 0.0f;
comp->posOffset.y = 0.0f;
comp->posOffset.x = 0.0f;
comp->rotation.z = 0;
comp->rotation.y = 0;
comp->rotation.x = 0;
comp->scale.z = 1.0f;
comp->scale.y = 1.0f;
comp->scale.x = 1.0f;
break;
// 2VVV
// Goto -- jump to another position in the list
case 0x2000:
bufPos = &anim->cmdList[spr_unpack_signed_12bit(*bufPos)];
if (bufPos == gotoPos) {
bufPos = anim->cmdList;
comp->waitTime = 1.0f;
}
gotoPos = bufPos;
break;
// 1VVV
// SetImage -- FFF is valid value for "no image"
case 0x1000:
cmdValue = *bufPos++ & 0xFFF;
if (cmdValue != 0xFFF) {
comp->currentRaster = cmdValue;
} else {
comp->currentRaster = -1;
}
comp->currentPalette = -1;
break;
// 6VVV
// SetPalette -- FFF to clear
case 0x6000:
cmdValue = *bufPos++ & 0xFFF;
if (cmdValue != 0xFFF) {
comp->currentPalette = cmdValue;
} else {
comp->currentPalette = -1;
}
break;
// 8VUU
// SetProperty
// 81-XX parent to component XX
// 82-YY set notify value to YY
case 0x8000:
cmdValue = *bufPos++;
switch (cmdValue & 0xF00) {
case 0x100: // set parent
comp->properties = (comp->properties & 0xFFFF0000) | cmdValue;
break;
case 0x200: // set notify value
SpriteUpdateNotifyValue = cmdValue & 0xFF;
comp->properties = (comp->properties & 0xFF00FFFF) | (SpriteUpdateNotifyValue << 0x10);
break;
}
break;
// 3VVV XXXX YYYY ZZZZ
// SetPosition -- what does the flag do?
case 0x3000:
switch (*bufPos++ & 0xF) {
case 0:
case 1:
posX = spr_unpack_signed_16bit(*bufPos++);
posY = spr_unpack_signed_16bit(*bufPos++);
posZ = spr_unpack_signed_16bit(*bufPos++);
changedFlags |= 1;
break;
}
break;
// 4XXX YYYY ZZZZ
// SetRotation (euler angles)
case 0x4000:
rotX = spr_unpack_signed_12bit(*bufPos++);
rotY = spr_unpack_signed_16bit(*bufPos++);
rotZ = spr_unpack_signed_16bit(*bufPos++);
changedFlags |= 2;
break;
// 5VVV UUUU
// SetScale (%)
case 0x5000:
switch (*bufPos++ & 0xF) {
case 0:
scaleZ = *bufPos++ / 100.0f;
scaleY = scaleZ;
scaleX = scaleZ;
break;
case 1:
scaleX = *bufPos++ / 100.0f;
break;
case 2:
scaleY = *bufPos++ / 100.0f;
break;
case 3:
scaleZ = *bufPos++ / 100.0f;
break;
}
changedFlags |= 4;
break;
// 7VVV UUUU
// Loop -- VV iterations jumping back to UUUU
case 0x7000:
if (comp->loopCounter != 0) {
comp->loopCounter--;
if (comp->loopCounter == 0) {
bufPos += 2;
break;
}
} else {
comp->loopCounter = bufPos[1];
}
bufPos = &anim->cmdList[spr_unpack_signed_12bit(*bufPos)];
break;
// invalid command
default:
bufPos = anim->cmdList;
comp->waitTime = 1.0f;
break;
}
} // end loop
comp->readPos = bufPos;
if (changedFlags & 1) {
comp->posOffset.x = posX;
comp->posOffset.y = posY;
comp->posOffset.z = posZ;
}
if (changedFlags & 2) {
comp->rotation.x = rotX;
comp->rotation.y = rotY;
comp->rotation.z = rotZ;
}
if (changedFlags & 4) {
comp->scale.x = scaleX;
comp->scale.y = scaleY;
comp->scale.z = scaleZ;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel calc_player_test_enemy
/* 1A0034 80271754 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 1A0038 80271758 AFB20020 */ sw $s2, 0x20($sp)
/* 1A003C 8027175C 3C12800E */ lui $s2, %hi(gBattleStatus)
/* 1A0040 80271760 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus)
/* 1A0044 80271764 AFBF002C */ sw $ra, 0x2C($sp)
/* 1A0048 80271768 AFB40028 */ sw $s4, 0x28($sp)
/* 1A004C 8027176C AFB30024 */ sw $s3, 0x24($sp)
/* 1A0050 80271770 AFB1001C */ sw $s1, 0x1C($sp)
/* 1A0054 80271774 AFB00018 */ sw $s0, 0x18($sp)
/* 1A0058 80271778 964201A0 */ lhu $v0, 0x1A0($s2)
/* 1A005C 8027177C 864401A0 */ lh $a0, 0x1A0($s2)
/* 1A0060 80271780 924301A2 */ lbu $v1, 0x1A2($s2)
/* 1A0064 80271784 8E5400D8 */ lw $s4, 0xD8($s2)
/* 1A0068 80271788 825101A2 */ lb $s1, 0x1A2($s2)
/* 1A006C 8027178C A64201A4 */ sh $v0, 0x1A4($s2)
/* 1A0070 80271790 0C09A75B */ jal get_actor
/* 1A0074 80271794 A24301A6 */ sb $v1, 0x1A6($s2)
/* 1A0078 80271798 0040982D */ daddu $s3, $v0, $zero
/* 1A007C 8027179C 12600060 */ beqz $s3, .L80271920
/* 1A0080 802717A0 2690000C */ addiu $s0, $s4, 0xC
/* 1A0084 802717A4 0260202D */ daddu $a0, $s3, $zero
/* 1A0088 802717A8 0C099117 */ jal get_actor_part
/* 1A008C 802717AC 0220282D */ daddu $a1, $s1, $zero
/* 1A0090 802717B0 0040882D */ daddu $s1, $v0, $zero
/* 1A0094 802717B4 16200003 */ bnez $s1, .L802717C4
/* 1A0098 802717B8 00000000 */ nop
.L802717BC:
/* 1A009C 802717BC 0809C5EF */ j .L802717BC
/* 1A00A0 802717C0 00000000 */ nop
.L802717C4:
/* 1A00A4 802717C4 8E24007C */ lw $a0, 0x7C($s1)
/* 1A00A8 802717C8 30820020 */ andi $v0, $a0, 0x20
/* 1A00AC 802717CC 14400055 */ bnez $v0, .L80271924
/* 1A00B0 802717D0 24020006 */ addiu $v0, $zero, 0x6
/* 1A00B4 802717D4 82630218 */ lb $v1, 0x218($s3)
/* 1A00B8 802717D8 2402000E */ addiu $v0, $zero, 0xE
/* 1A00BC 802717DC 10620007 */ beq $v1, $v0, .L802717FC
/* 1A00C0 802717E0 30820800 */ andi $v0, $a0, 0x800
/* 1A00C4 802717E4 10400007 */ beqz $v0, .L80271804
/* 1A00C8 802717E8 00000000 */ nop
/* 1A00CC 802717EC 8E420188 */ lw $v0, 0x188($s2)
/* 1A00D0 802717F0 30420800 */ andi $v0, $v0, 0x800
/* 1A00D4 802717F4 14400003 */ bnez $v0, .L80271804
/* 1A00D8 802717F8 00000000 */ nop
.L802717FC:
/* 1A00DC 802717FC 0809C649 */ j .L80271924
/* 1A00E0 80271800 24020006 */ addiu $v0, $zero, 0x6
.L80271804:
/* 1A00E4 80271804 82630214 */ lb $v1, 0x214($s3)
/* 1A00E8 80271808 2402000C */ addiu $v0, $zero, 0xC
/* 1A00EC 8027180C 14620009 */ bne $v1, $v0, .L80271834
/* 1A00F0 80271810 2404010C */ addiu $a0, $zero, 0x10C
/* 1A00F4 80271814 C6000014 */ lwc1 $f0, 0x14($s0)
/* 1A00F8 80271818 E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A00FC 8027181C 8E06000C */ lw $a2, 0xC($s0)
/* 1A0100 80271820 8E070010 */ lw $a3, 0x10($s0)
/* 1A0104 80271824 0C052757 */ jal sfx_play_sound_at_position
/* 1A0108 80271828 0000282D */ daddu $a1, $zero, $zero
/* 1A010C 8027182C 0809C649 */ j .L80271924
/* 1A0110 80271830 24020008 */ addiu $v0, $zero, 0x8
.L80271834:
/* 1A0114 80271834 8E420188 */ lw $v0, 0x188($s2)
/* 1A0118 80271838 30420080 */ andi $v0, $v0, 0x80
/* 1A011C 8027183C 10400012 */ beqz $v0, .L80271888
/* 1A0120 80271840 3C031000 */ lui $v1, (0x10000080 >> 16)
/* 1A0124 80271844 8E22007C */ lw $v0, 0x7C($s1)
/* 1A0128 80271848 30420010 */ andi $v0, $v0, 0x10
/* 1A012C 8027184C 1040000E */ beqz $v0, .L80271888
/* 1A0130 80271850 0280202D */ daddu $a0, $s4, $zero
/* 1A0134 80271854 0C099CAB */ jal player_team_is_ability_active
/* 1A0138 80271858 24050002 */ addiu $a1, $zero, 0x2
/* 1A013C 8027185C 1440000A */ bnez $v0, .L80271888
/* 1A0140 80271860 3C031000 */ lui $v1, (0x10000080 >> 16)
/* 1A0144 80271864 C6000014 */ lwc1 $f0, 0x14($s0)
/* 1A0148 80271868 24040108 */ addiu $a0, $zero, 0x108
/* 1A014C 8027186C E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A0150 80271870 8E06000C */ lw $a2, 0xC($s0)
/* 1A0154 80271874 8E070010 */ lw $a3, 0x10($s0)
/* 1A0158 80271878 0C052757 */ jal sfx_play_sound_at_position
/* 1A015C 8027187C 0000282D */ daddu $a1, $zero, $zero
/* 1A0160 80271880 0809C649 */ j .L80271924
/* 1A0164 80271884 24020004 */ addiu $v0, $zero, 0x4
.L80271888:
/* 1A0168 80271888 8E420188 */ lw $v0, 0x188($s2)
/* 1A016C 8027188C 34630080 */ ori $v1, $v1, (0x10000080 & 0xFFFF)
/* 1A0170 80271890 00431024 */ and $v0, $v0, $v1
/* 1A0174 80271894 1440001B */ bnez $v0, .L80271904
/* 1A0178 80271898 3C030001 */ lui $v1, (0x10000 >> 16)
/* 1A017C 8027189C 8E22007C */ lw $v0, 0x7C($s1)
/* 1A0180 802718A0 00431024 */ and $v0, $v0, $v1
/* 1A0184 802718A4 10400017 */ beqz $v0, .L80271904
/* 1A0188 802718A8 00000000 */ nop
/* 1A018C 802718AC 8E42018C */ lw $v0, 0x18C($s2)
/* 1A0190 802718B0 30420004 */ andi $v0, $v0, 0x4
/* 1A0194 802718B4 14400013 */ bnez $v0, .L80271904
/* 1A0198 802718B8 0280202D */ daddu $a0, $s4, $zero
/* 1A019C 802718BC 0C099CAB */ jal player_team_is_ability_active
/* 1A01A0 802718C0 24050002 */ addiu $a1, $zero, 0x2
/* 1A01A4 802718C4 1440000F */ bnez $v0, .L80271904
/* 1A01A8 802718C8 24040108 */ addiu $a0, $zero, 0x108
/* 1A01AC 802718CC C6000014 */ lwc1 $f0, 0x14($s0)
/* 1A01B0 802718D0 E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A01B4 802718D4 8E06000C */ lw $a2, 0xC($s0)
/* 1A01B8 802718D8 8E070010 */ lw $a3, 0x10($s0)
/* 1A01BC 802718DC 0C052757 */ jal sfx_play_sound_at_position
/* 1A01C0 802718E0 0000282D */ daddu $a1, $zero, $zero
/* 1A01C4 802718E4 24040001 */ addiu $a0, $zero, 0x1
/* 1A01C8 802718E8 0C09CCEA */ jal dispatch_damage_event_player_1
/* 1A01CC 802718EC 2405002A */ addiu $a1, $zero, 0x2A
/* 1A01D0 802718F0 0260202D */ daddu $a0, $s3, $zero
/* 1A01D4 802718F4 0C09DC58 */ jal dispatch_event_actor
/* 1A01D8 802718F8 2405001B */ addiu $a1, $zero, 0x1B
/* 1A01DC 802718FC 0809C649 */ j .L80271924
/* 1A01E0 80271900 2402FFFF */ addiu $v0, $zero, -0x1
.L80271904:
/* 1A01E4 80271904 82820212 */ lb $v0, 0x212($s4)
/* 1A01E8 80271908 2404000B */ addiu $a0, $zero, 0xB
/* 1A01EC 8027190C 10440005 */ beq $v0, $a0, .L80271924
/* 1A01F0 80271910 0000102D */ daddu $v0, $zero, $zero
/* 1A01F4 80271914 82630212 */ lb $v1, 0x212($s3)
/* 1A01F8 80271918 10640002 */ beq $v1, $a0, .L80271924
/* 1A01FC 8027191C 24020007 */ addiu $v0, $zero, 0x7
.L80271920:
/* 1A0200 80271920 0000102D */ daddu $v0, $zero, $zero
.L80271924:
/* 1A0204 80271924 8FBF002C */ lw $ra, 0x2C($sp)
/* 1A0208 80271928 8FB40028 */ lw $s4, 0x28($sp)
/* 1A020C 8027192C 8FB30024 */ lw $s3, 0x24($sp)
/* 1A0210 80271930 8FB20020 */ lw $s2, 0x20($sp)
/* 1A0214 80271934 8FB1001C */ lw $s1, 0x1C($sp)
/* 1A0218 80271938 8FB00018 */ lw $s0, 0x18($sp)
/* 1A021C 8027193C 03E00008 */ jr $ra
/* 1A0220 80271940 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
HitResult calc_player_test_enemy(void) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
ActorState* state = &player->state;
s32 targetActorID = battleStatus->currentTargetID;
s32 targetPartIdx = battleStatus->currentTargetPart;
Actor* target;
ActorPart* targetPart;
battleStatus->currentTargetID2 = battleStatus->currentTargetID;
battleStatus->currentTargetPart2 = battleStatus->currentTargetPart;
target = get_actor(targetActorID);
if (target == NULL) {
return HIT_RESULT_HIT;
}
targetPart = get_actor_part(target, targetPartIdx);
ASSERT(targetPart != NULL);
if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY) {
return HIT_RESULT_MISS;
}
if (target->transparentStatus == STATUS_KEY_TRANSPARENT
|| (targetPart->eventFlags & ACTOR_EVENT_FLAG_800)
&& !(battleStatus->currentAttackElement & DAMAGE_TYPE_QUAKE))
{
return HIT_RESULT_MISS;
}
if (target->stoneStatus == STATUS_KEY_STONE) {
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return HIT_RESULT_IMMUNE;
}
if ((battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP)
&& (targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP)
&& !player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD))
{
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
return HIT_RESULT_LANDED_ON_SPIKE;
}
if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP))
&& (targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_FRONT)
&& (!(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SPIKY_FRONT)
&& !player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD)))
{
sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z);
dispatch_damage_event_player_1(1, EVENT_SPIKE_CONTACT);
dispatch_event_actor(target, EVENT_SPIKE_TAUNT);
return HIT_RESULT_BACKFIRE;
}
if (player->staticStatus != STATUS_KEY_STATIC && target->staticStatus == STATUS_KEY_STATIC) {
return HIT_RESULT_HIT_STATIC;
}
return HIT_RESULT_HIT;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel throw_spiny_main
/* 3CF3A0 E00C8000 27BDFF90 */ addiu $sp, $sp, -0x70
/* 3CF3A4 E00C8004 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 3CF3A8 E00C8008 4485A000 */ mtc1 $a1, $f20
/* 3CF3AC E00C800C F7B60048 */ sdc1 $f22, 0x48($sp)
/* 3CF3B0 E00C8010 4486B000 */ mtc1 $a2, $f22
/* 3CF3B4 E00C8014 F7B80050 */ sdc1 $f24, 0x50($sp)
/* 3CF3B8 E00C8018 4487C000 */ mtc1 $a3, $f24
/* 3CF3BC E00C801C F7BA0058 */ sdc1 $f26, 0x58($sp)
/* 3CF3C0 E00C8020 C7BA0080 */ lwc1 $f26, 0x80($sp)
/* 3CF3C4 E00C8024 F7BC0060 */ sdc1 $f28, 0x60($sp)
/* 3CF3C8 E00C8028 C7BC0084 */ lwc1 $f28, 0x84($sp)
/* 3CF3CC E00C802C AFB30034 */ sw $s3, 0x34($sp)
/* 3CF3D0 E00C8030 0080982D */ daddu $s3, $a0, $zero
/* 3CF3D4 E00C8034 F7BE0068 */ sdc1 $f30, 0x68($sp)
/* 3CF3D8 E00C8038 C7BE0088 */ lwc1 $f30, 0x88($sp)
/* 3CF3DC E00C803C 27A40010 */ addiu $a0, $sp, 0x10
/* 3CF3E0 E00C8040 AFB1002C */ sw $s1, 0x2C($sp)
/* 3CF3E4 E00C8044 8FB10090 */ lw $s1, 0x90($sp)
/* 3CF3E8 E00C8048 3C02E00D */ lui $v0, %hi(throw_spiny_init)
/* 3CF3EC E00C804C 24428218 */ addiu $v0, $v0, %lo(throw_spiny_init)
/* 3CF3F0 E00C8050 AFA20018 */ sw $v0, 0x18($sp)
/* 3CF3F4 E00C8054 3C02E00D */ lui $v0, %hi(throw_spiny_update)
/* 3CF3F8 E00C8058 24428220 */ addiu $v0, $v0, %lo(throw_spiny_update)
/* 3CF3FC E00C805C AFA2001C */ sw $v0, 0x1C($sp)
/* 3CF400 E00C8060 3C02E00D */ lui $v0, %hi(throw_spiny_render)
/* 3CF404 E00C8064 24428404 */ addiu $v0, $v0, %lo(throw_spiny_render)
/* 3CF408 E00C8068 AFA20020 */ sw $v0, 0x20($sp)
/* 3CF40C E00C806C 24020064 */ addiu $v0, $zero, 0x64
/* 3CF410 E00C8070 AFBF0038 */ sw $ra, 0x38($sp)
/* 3CF414 E00C8074 AFB20030 */ sw $s2, 0x30($sp)
/* 3CF418 E00C8078 AFB00028 */ sw $s0, 0x28($sp)
/* 3CF41C E00C807C AFA00010 */ sw $zero, 0x10($sp)
/* 3CF420 E00C8080 AFA00024 */ sw $zero, 0x24($sp)
/* 3CF424 E00C8084 0C080124 */ jal shim_create_effect_instance
/* 3CF428 E00C8088 AFA20014 */ sw $v0, 0x14($sp)
/* 3CF42C E00C808C 2404006C */ addiu $a0, $zero, 0x6C
/* 3CF430 E00C8090 24030001 */ addiu $v1, $zero, 0x1
/* 3CF434 E00C8094 0040902D */ daddu $s2, $v0, $zero
/* 3CF438 E00C8098 0C08012C */ jal shim_general_heap_malloc
/* 3CF43C E00C809C AE430008 */ sw $v1, 0x8($s2)
/* 3CF440 E00C80A0 0040802D */ daddu $s0, $v0, $zero
/* 3CF444 E00C80A4 16000003 */ bnez $s0, .LE00C80B4
/* 3CF448 E00C80A8 AE42000C */ sw $v0, 0xC($s2)
.LE00C80AC:
/* 3CF44C E00C80AC 0803202B */ j .LE00C80AC
/* 3CF450 E00C80B0 00000000 */ nop
.LE00C80B4:
/* 3CF454 E00C80B4 AE130000 */ sw $s3, 0x0($s0)
/* 3CF458 E00C80B8 1E200003 */ bgtz $s1, .LE00C80C8
/* 3CF45C E00C80BC AE00002C */ sw $zero, 0x2C($s0)
/* 3CF460 E00C80C0 08032033 */ j .LE00C80CC
/* 3CF464 E00C80C4 240203E8 */ addiu $v0, $zero, 0x3E8
.LE00C80C8:
/* 3CF468 E00C80C8 2622003C */ addiu $v0, $s1, 0x3C
.LE00C80CC:
/* 3CF46C E00C80CC AE020028 */ sw $v0, 0x28($s0)
/* 3CF470 E00C80D0 240200FF */ addiu $v0, $zero, 0xFF
/* 3CF474 E00C80D4 44913000 */ mtc1 $s1, $f6
/* 3CF478 E00C80D8 00000000 */ nop
/* 3CF47C E00C80DC 468031A1 */ cvt.d.w $f6, $f6
/* 3CF480 E00C80E0 4616E201 */ sub.s $f8, $f28, $f22
/* 3CF484 E00C80E4 44912000 */ mtc1 $s1, $f4
/* 3CF488 E00C80E8 00000000 */ nop
/* 3CF48C E00C80EC 46802120 */ cvt.s.w $f4, $f4
/* 3CF490 E00C80F0 3C01E00D */ lui $at, (0xE00D0000 >> 16)
/* 3CF494 E00C80F4 D4208730 */ ldc1 $f0, -0x78D0($at)
/* 3CF498 E00C80F8 4618F081 */ sub.s $f2, $f30, $f24
/* 3CF49C E00C80FC AE110068 */ sw $s1, 0x68($s0)
/* 3CF4A0 E00C8100 AE02003C */ sw $v0, 0x3C($s0)
/* 3CF4A4 E00C8104 46203182 */ mul.d $f6, $f6, $f0
/* 3CF4A8 E00C8108 00000000 */ nop
/* 3CF4AC E00C810C E6140010 */ swc1 $f20, 0x10($s0)
/* 3CF4B0 E00C8110 E6160014 */ swc1 $f22, 0x14($s0)
/* 3CF4B4 E00C8114 E6180018 */ swc1 $f24, 0x18($s0)
/* 3CF4B8 E00C8118 E61A001C */ swc1 $f26, 0x1C($s0)
/* 3CF4BC E00C811C E61C0020 */ swc1 $f28, 0x20($s0)
/* 3CF4C0 E00C8120 E61E0024 */ swc1 $f30, 0x24($s0)
/* 3CF4C4 E00C8124 E6140004 */ swc1 $f20, 0x4($s0)
/* 3CF4C8 E00C8128 4614D001 */ sub.s $f0, $f26, $f20
/* 3CF4CC E00C812C 46041083 */ div.s $f2, $f2, $f4
/* 3CF4D0 E00C8130 E602004C */ swc1 $f2, 0x4C($s0)
/* 3CF4D4 E00C8134 44801000 */ mtc1 $zero, $f2
/* 3CF4D8 E00C8138 46040003 */ div.s $f0, $f0, $f4
/* 3CF4DC E00C813C E6000044 */ swc1 $f0, 0x44($s0)
/* 3CF4E0 E00C8140 46044003 */ div.s $f0, $f8, $f4
/* 3CF4E4 E00C8144 46000021 */ cvt.d.s $f0, $f0
/* 3CF4E8 E00C8148 46260001 */ sub.d $f0, $f0, $f6
/* 3CF4EC E00C814C E6160008 */ swc1 $f22, 0x8($s0)
/* 3CF4F0 E00C8150 E618000C */ swc1 $f24, 0xC($s0)
/* 3CF4F4 E00C8154 4602403C */ c.lt.s $f8, $f2
/* 3CF4F8 E00C8158 46200020 */ cvt.s.d $f0, $f0
/* 3CF4FC E00C815C 45000004 */ bc1f .LE00C8170
/* 3CF500 E00C8160 E6000048 */ swc1 $f0, 0x48($s0)
/* 3CF504 E00C8164 24020001 */ addiu $v0, $zero, 0x1
/* 3CF508 E00C8168 0803205D */ j .LE00C8174
/* 3CF50C E00C816C AE020064 */ sw $v0, 0x64($s0)
.LE00C8170:
/* 3CF510 E00C8170 AE000064 */ sw $zero, 0x64($s0)
.LE00C8174:
/* 3CF514 E00C8174 24040168 */ addiu $a0, $zero, 0x168
/* 3CF518 E00C8178 C7A0008C */ lwc1 $f0, 0x8C($sp)
/* 3CF51C E00C817C 24020046 */ addiu $v0, $zero, 0x46
/* 3CF520 E00C8180 AE020030 */ sw $v0, 0x30($s0)
/* 3CF524 E00C8184 240200B4 */ addiu $v0, $zero, 0xB4
/* 3CF528 E00C8188 AE020034 */ sw $v0, 0x34($s0)
/* 3CF52C E00C818C 24020078 */ addiu $v0, $zero, 0x78
/* 3CF530 E00C8190 AE020038 */ sw $v0, 0x38($s0)
/* 3CF534 E00C8194 0C080138 */ jal shim_rand_int
/* 3CF538 E00C8198 E6000040 */ swc1 $f0, 0x40($s0)
/* 3CF53C E00C819C 2404000A */ addiu $a0, $zero, 0xA
/* 3CF540 E00C81A0 44820000 */ mtc1 $v0, $f0
/* 3CF544 E00C81A4 00000000 */ nop
/* 3CF548 E00C81A8 46800020 */ cvt.s.w $f0, $f0
/* 3CF54C E00C81AC 0C080138 */ jal shim_rand_int
/* 3CF550 E00C81B0 E6000050 */ swc1 $f0, 0x50($s0)
/* 3CF554 E00C81B4 24430005 */ addiu $v1, $v0, 0x5
/* 3CF558 E00C81B8 0240102D */ daddu $v0, $s2, $zero
/* 3CF55C E00C81BC 44830000 */ mtc1 $v1, $f0
/* 3CF560 E00C81C0 00000000 */ nop
/* 3CF564 E00C81C4 46800020 */ cvt.s.w $f0, $f0
/* 3CF568 E00C81C8 E6000054 */ swc1 $f0, 0x54($s0)
/* 3CF56C E00C81CC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3CF570 E00C81D0 44810000 */ mtc1 $at, $f0
/* 3CF574 E00C81D4 2403FFFF */ addiu $v1, $zero, -0x1
/* 3CF578 E00C81D8 AE030060 */ sw $v1, 0x60($s0)
/* 3CF57C E00C81DC E6000058 */ swc1 $f0, 0x58($s0)
/* 3CF580 E00C81E0 E600005C */ swc1 $f0, 0x5C($s0)
/* 3CF584 E00C81E4 8FBF0038 */ lw $ra, 0x38($sp)
/* 3CF588 E00C81E8 8FB30034 */ lw $s3, 0x34($sp)
/* 3CF58C E00C81EC 8FB20030 */ lw $s2, 0x30($sp)
/* 3CF590 E00C81F0 8FB1002C */ lw $s1, 0x2C($sp)
/* 3CF594 E00C81F4 8FB00028 */ lw $s0, 0x28($sp)
/* 3CF598 E00C81F8 D7BE0068 */ ldc1 $f30, 0x68($sp)
/* 3CF59C E00C81FC D7BC0060 */ ldc1 $f28, 0x60($sp)
/* 3CF5A0 E00C8200 D7BA0058 */ ldc1 $f26, 0x58($sp)
/* 3CF5A4 E00C8204 D7B80050 */ ldc1 $f24, 0x50($sp)
/* 3CF5A8 E00C8208 D7B60048 */ ldc1 $f22, 0x48($sp)
/* 3CF5AC E00C820C D7B40040 */ ldc1 $f20, 0x40($sp)
/* 3CF5B0 E00C8210 03E00008 */ jr $ra
/* 3CF5B4 E00C8214 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
EffectInstance* throw_spiny_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, s32 time) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
EffectInstance* effect;
ThrowSpinyFXData* spinyObject;
s32 numParts = 1;
f32 temp_f4, temp_f8, gravity;
bp.init = throw_spiny_init;
bp.update = throw_spiny_update;
bp.renderWorld = throw_spiny_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_THROW_SPINY;
effect = (EffectInstance*)shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
spinyObject = effect->data.throwSpiny = shim_general_heap_malloc(numParts * sizeof(*spinyObject));
ASSERT(effect->data.throwSpiny != NULL);
spinyObject->unk_00 = arg0;
spinyObject->lifeDuration = 0;
if (time <= 0) {
spinyObject->life = 1000;
} else {
spinyObject->life = time + 60;
}
temp_f8 = arg5 - arg2;
temp_f4 = time;
gravity = (temp_f8 / temp_f4) - (time * -0.10000000149011612); //TODO: fix this weird number
spinyObject->timeUntilFall = time;
spinyObject->rgba = 255;
spinyObject->unk_10 = arg1;
spinyObject->unk_14 = arg2;
spinyObject->unk_18 = arg3;
spinyObject->unk_1C = arg4;
spinyObject->unk_20 = arg5;
spinyObject->unk_24 = arg6;
spinyObject->unk_44 = (arg4 - arg1) / temp_f4;
spinyObject->unk_4C = (arg6 - arg3) / temp_f4;
spinyObject->pos.x = arg1;
spinyObject->pos.y = arg2;
spinyObject->pos.z = arg3;
spinyObject->gravity = gravity;
if (temp_f8 < 0.0f) {
spinyObject->unk_64 = 1;
} else {
spinyObject->unk_64 = 0;
}
spinyObject->unk_40 = arg7;
spinyObject->unk_30 = 70;
spinyObject->unk_34 = 180;
spinyObject->unk_38 = 120;
spinyObject->yaw = shim_rand_int(360);
spinyObject->rotationSpeed = shim_rand_int(10) + 5;
spinyObject->state = -1;
spinyObject->xScale = 1.0f;
spinyObject->yScale = 1.0f;
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel parent_collider_to_model
/* 36B80 8005B780 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 36B84 8005B784 00042400 */ sll $a0, $a0, 16
/* 36B88 8005B788 00042403 */ sra $a0, $a0, 16
/* 36B8C 8005B78C 000410C0 */ sll $v0, $a0, 3
/* 36B90 8005B790 00441023 */ subu $v0, $v0, $a0
/* 36B94 8005B794 3C03800B */ lui $v1, %hi(D_800B42E4)
/* 36B98 8005B798 8C6342E4 */ lw $v1, %lo(D_800B42E4)($v1)
/* 36B9C 8005B79C 00021080 */ sll $v0, $v0, 2
/* 36BA0 8005B7A0 AFB30024 */ sw $s3, 0x24($sp)
/* 36BA4 8005B7A4 0000982D */ daddu $s3, $zero, $zero
/* 36BA8 8005B7A8 AFBF0034 */ sw $ra, 0x34($sp)
/* 36BAC 8005B7AC AFB60030 */ sw $s6, 0x30($sp)
/* 36BB0 8005B7B0 AFB5002C */ sw $s5, 0x2C($sp)
/* 36BB4 8005B7B4 AFB40028 */ sw $s4, 0x28($sp)
/* 36BB8 8005B7B8 AFB20020 */ sw $s2, 0x20($sp)
/* 36BBC 8005B7BC AFB1001C */ sw $s1, 0x1C($sp)
/* 36BC0 8005B7C0 AFB00018 */ sw $s0, 0x18($sp)
/* 36BC4 8005B7C4 0062A021 */ addu $s4, $v1, $v0
/* 36BC8 8005B7C8 8682000A */ lh $v0, 0xA($s4)
/* 36BCC 8005B7CC 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 36BD0 8005B7D0 A6850008 */ sh $a1, 0x8($s4)
/* 36BD4 8005B7D4 00022040 */ sll $a0, $v0, 1
/* 36BD8 8005B7D8 00822021 */ addu $a0, $a0, $v0
/* 36BDC 8005B7DC 8E820000 */ lw $v0, 0x0($s4)
/* 36BE0 8005B7E0 00042080 */ sll $a0, $a0, 2
/* 36BE4 8005B7E4 00431025 */ or $v0, $v0, $v1
/* 36BE8 8005B7E8 0C00AB6C */ jal collision_heap_malloc
/* 36BEC 8005B7EC AE820000 */ sw $v0, 0x0($s4)
/* 36BF0 8005B7F0 0040A82D */ daddu $s5, $v0, $zero
/* 36BF4 8005B7F4 8E91000C */ lw $s1, 0xC($s4)
/* 36BF8 8005B7F8 8682000A */ lh $v0, 0xA($s4)
/* 36BFC 8005B7FC 02A0B02D */ daddu $s6, $s5, $zero
/* 36C00 8005B800 18400015 */ blez $v0, .L8005B858
/* 36C04 8005B804 AFA00010 */ sw $zero, 0x10($sp)
/* 36C08 8005B808 27B20010 */ addiu $s2, $sp, 0x10
/* 36C0C 8005B80C 26300008 */ addiu $s0, $s1, 0x8
.L8005B810:
/* 36C10 8005B810 02A0202D */ daddu $a0, $s5, $zero
/* 36C14 8005B814 0240302D */ daddu $a2, $s2, $zero
/* 36C18 8005B818 26730001 */ addiu $s3, $s3, 0x1
/* 36C1C 8005B81C 8E250000 */ lw $a1, 0x0($s1)
/* 36C20 8005B820 0C016E68 */ jal _add_hit_vert_to_buffer
/* 36C24 8005B824 26310040 */ addiu $s1, $s1, 0x40
/* 36C28 8005B828 02A0202D */ daddu $a0, $s5, $zero
/* 36C2C 8005B82C 8E05FFFC */ lw $a1, -0x4($s0)
/* 36C30 8005B830 0C016E68 */ jal _add_hit_vert_to_buffer
/* 36C34 8005B834 0240302D */ daddu $a2, $s2, $zero
/* 36C38 8005B838 02A0202D */ daddu $a0, $s5, $zero
/* 36C3C 8005B83C 8E050000 */ lw $a1, 0x0($s0)
/* 36C40 8005B840 0C016E68 */ jal _add_hit_vert_to_buffer
/* 36C44 8005B844 0240302D */ daddu $a2, $s2, $zero
/* 36C48 8005B848 8682000A */ lh $v0, 0xA($s4)
/* 36C4C 8005B84C 0262102A */ slt $v0, $s3, $v0
/* 36C50 8005B850 1440FFEF */ bnez $v0, .L8005B810
/* 36C54 8005B854 26100040 */ addiu $s0, $s0, 0x40
.L8005B858:
/* 36C58 8005B858 8FA20010 */ lw $v0, 0x10($sp)
/* 36C5C 8005B85C 0000982D */ daddu $s3, $zero, $zero
/* 36C60 8005B860 00022040 */ sll $a0, $v0, 1
/* 36C64 8005B864 00822021 */ addu $a0, $a0, $v0
/* 36C68 8005B868 97A20012 */ lhu $v0, 0x12($sp)
/* 36C6C 8005B86C 000420C0 */ sll $a0, $a0, 3
/* 36C70 8005B870 0C00AB6C */ jal collision_heap_malloc
/* 36C74 8005B874 A6820014 */ sh $v0, 0x14($s4)
/* 36C78 8005B878 8FA30010 */ lw $v1, 0x10($sp)
/* 36C7C 8005B87C 0040902D */ daddu $s2, $v0, $zero
/* 36C80 8005B880 18600013 */ blez $v1, .L8005B8D0
/* 36C84 8005B884 AE920018 */ sw $s2, 0x18($s4)
/* 36C88 8005B888 0060202D */ daddu $a0, $v1, $zero
/* 36C8C 8005B88C 26430008 */ addiu $v1, $s2, 0x8
.L8005B890:
/* 36C90 8005B890 8EC20000 */ lw $v0, 0x0($s6)
/* 36C94 8005B894 26D60004 */ addiu $s6, $s6, 0x4
/* 36C98 8005B898 C4400000 */ lwc1 $f0, 0x0($v0)
/* 36C9C 8005B89C 26730001 */ addiu $s3, $s3, 0x1
/* 36CA0 8005B8A0 E4600004 */ swc1 $f0, 0x4($v1)
/* 36CA4 8005B8A4 E6400000 */ swc1 $f0, 0x0($s2)
/* 36CA8 8005B8A8 C4400004 */ lwc1 $f0, 0x4($v0)
/* 36CAC 8005B8AC 26520018 */ addiu $s2, $s2, 0x18
/* 36CB0 8005B8B0 E4600008 */ swc1 $f0, 0x8($v1)
/* 36CB4 8005B8B4 E460FFFC */ swc1 $f0, -0x4($v1)
/* 36CB8 8005B8B8 C4400008 */ lwc1 $f0, 0x8($v0)
/* 36CBC 8005B8BC 0264102A */ slt $v0, $s3, $a0
/* 36CC0 8005B8C0 E460000C */ swc1 $f0, 0xC($v1)
/* 36CC4 8005B8C4 E4600000 */ swc1 $f0, 0x0($v1)
/* 36CC8 8005B8C8 1440FFF1 */ bnez $v0, .L8005B890
/* 36CCC 8005B8CC 24630018 */ addiu $v1, $v1, 0x18
.L8005B8D0:
/* 36CD0 8005B8D0 8E920018 */ lw $s2, 0x18($s4)
/* 36CD4 8005B8D4 8682000A */ lh $v0, 0xA($s4)
/* 36CD8 8005B8D8 8E91000C */ lw $s1, 0xC($s4)
/* 36CDC 8005B8DC 18400024 */ blez $v0, .L8005B970
/* 36CE0 8005B8E0 0000982D */ daddu $s3, $zero, $zero
/* 36CE4 8005B8E4 27B60010 */ addiu $s6, $sp, 0x10
/* 36CE8 8005B8E8 26300008 */ addiu $s0, $s1, 0x8
.L8005B8EC:
/* 36CEC 8005B8EC 02A0202D */ daddu $a0, $s5, $zero
/* 36CF0 8005B8F0 02C0302D */ daddu $a2, $s6, $zero
/* 36CF4 8005B8F4 8E250000 */ lw $a1, 0x0($s1)
/* 36CF8 8005B8F8 0C016E7D */ jal _get_hit_vert_index_from_buffer
/* 36CFC 8005B8FC 26730001 */ addiu $s3, $s3, 0x1
/* 36D00 8005B900 02A0202D */ daddu $a0, $s5, $zero
/* 36D04 8005B904 02C0302D */ daddu $a2, $s6, $zero
/* 36D08 8005B908 00021840 */ sll $v1, $v0, 1
/* 36D0C 8005B90C 00621821 */ addu $v1, $v1, $v0
/* 36D10 8005B910 000318C0 */ sll $v1, $v1, 3
/* 36D14 8005B914 02431821 */ addu $v1, $s2, $v1
/* 36D18 8005B918 AE230000 */ sw $v1, 0x0($s1)
/* 36D1C 8005B91C 8E05FFFC */ lw $a1, -0x4($s0)
/* 36D20 8005B920 0C016E7D */ jal _get_hit_vert_index_from_buffer
/* 36D24 8005B924 26310040 */ addiu $s1, $s1, 0x40
/* 36D28 8005B928 02A0202D */ daddu $a0, $s5, $zero
/* 36D2C 8005B92C 02C0302D */ daddu $a2, $s6, $zero
/* 36D30 8005B930 00021840 */ sll $v1, $v0, 1
/* 36D34 8005B934 00621821 */ addu $v1, $v1, $v0
/* 36D38 8005B938 000318C0 */ sll $v1, $v1, 3
/* 36D3C 8005B93C 8E050000 */ lw $a1, 0x0($s0)
/* 36D40 8005B940 02431821 */ addu $v1, $s2, $v1
/* 36D44 8005B944 0C016E7D */ jal _get_hit_vert_index_from_buffer
/* 36D48 8005B948 AE03FFFC */ sw $v1, -0x4($s0)
/* 36D4C 8005B94C 00021840 */ sll $v1, $v0, 1
/* 36D50 8005B950 00621821 */ addu $v1, $v1, $v0
/* 36D54 8005B954 000318C0 */ sll $v1, $v1, 3
/* 36D58 8005B958 02431821 */ addu $v1, $s2, $v1
/* 36D5C 8005B95C AE030000 */ sw $v1, 0x0($s0)
/* 36D60 8005B960 8682000A */ lh $v0, 0xA($s4)
/* 36D64 8005B964 0262102A */ slt $v0, $s3, $v0
/* 36D68 8005B968 1440FFE0 */ bnez $v0, .L8005B8EC
/* 36D6C 8005B96C 26100040 */ addiu $s0, $s0, 0x40
.L8005B970:
/* 36D70 8005B970 0C00AB7D */ jal collision_heap_free
/* 36D74 8005B974 02A0202D */ daddu $a0, $s5, $zero
/* 36D78 8005B978 8FBF0034 */ lw $ra, 0x34($sp)
/* 36D7C 8005B97C 8FB60030 */ lw $s6, 0x30($sp)
/* 36D80 8005B980 8FB5002C */ lw $s5, 0x2C($sp)
/* 36D84 8005B984 8FB40028 */ lw $s4, 0x28($sp)
/* 36D88 8005B988 8FB30024 */ lw $s3, 0x24($sp)
/* 36D8C 8005B98C 8FB20020 */ lw $s2, 0x20($sp)
/* 36D90 8005B990 8FB1001C */ lw $s1, 0x1C($sp)
/* 36D94 8005B994 8FB00018 */ lw $s0, 0x18($sp)
/* 36D98 8005B998 03E00008 */ jr $ra
/* 36D9C 8005B99C 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void parent_collider_to_model(s16 colliderID, s16 modelIndex) {
Collider* collider;
ColliderTriangle* triangle;
s32 i;
Vec3f** vertexBuffer;
Vec3f** vertexPtr;
s32 vertexBufferSize;
Vec3f* vertexTable;
Vec3f* vertex;
collider = &gCollisionData.colliderList[colliderID];
collider->parentModelIndex = modelIndex;
collider->flags |= COLLIDER_FLAG_HAS_MODEL_PARENT;
vertexBuffer = collision_heap_malloc(collider->numTriangles * sizeof(Vec3f));
vertexBufferSize = 0;
vertexPtr = vertexBuffer;
for (i = 0, triangle = collider->triangleTable; i < collider->numTriangles; i++, triangle++) {
_add_hit_vert_to_buffer(vertexBuffer, triangle->v1, &vertexBufferSize);
_add_hit_vert_to_buffer(vertexBuffer, triangle->v2, &vertexBufferSize);
_add_hit_vert_to_buffer(vertexBuffer, triangle->v3, &vertexBufferSize);
}
collider->numVertices = vertexBufferSize;
collider->vertexTable = collision_heap_malloc(vertexBufferSize * 2 * sizeof(Vec3f));
for (i = 0, vertexTable = collider->vertexTable; i < vertexBufferSize; vertexPtr++, vertexTable += 2, i++) {
vertex = *vertexPtr;
vertexTable[0].x = vertexTable[1].x = vertex->x;
vertexTable[0].y = vertexTable[1].y = vertex->y;
vertexTable[0].z = vertexTable[1].z = vertex->z;
}
vertexTable = collider->vertexTable;
for (i = 0, triangle = collider->triangleTable; i < collider->numTriangles; triangle++, i++) {
triangle->v1 = &vertexTable[_get_hit_vert_index_from_buffer(vertexBuffer, triangle->v1, &vertexBufferSize) * 2];
triangle->v2 = &vertexTable[_get_hit_vert_index_from_buffer(vertexBuffer, triangle->v2, &vertexBufferSize) * 2];
triangle->v3 = &vertexTable[_get_hit_vert_index_from_buffer(vertexBuffer, triangle->v3, &vertexBufferSize) * 2];
}
collision_heap_free(vertexBuffer);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel ShowEmote
/* FC250 802D78A0 27BDFF90 */ addiu $sp, $sp, -0x70
/* FC254 802D78A4 AFB10034 */ sw $s1, 0x34($sp)
/* FC258 802D78A8 0080882D */ daddu $s1, $a0, $zero
/* FC25C 802D78AC AFBF0048 */ sw $ra, 0x48($sp)
/* FC260 802D78B0 AFB50044 */ sw $s5, 0x44($sp)
/* FC264 802D78B4 AFB40040 */ sw $s4, 0x40($sp)
/* FC268 802D78B8 AFB3003C */ sw $s3, 0x3C($sp)
/* FC26C 802D78BC AFB20038 */ sw $s2, 0x38($sp)
/* FC270 802D78C0 AFB00030 */ sw $s0, 0x30($sp)
/* FC274 802D78C4 F7BA0068 */ sdc1 $f26, 0x68($sp)
/* FC278 802D78C8 F7B80060 */ sdc1 $f24, 0x60($sp)
/* FC27C 802D78CC F7B60058 */ sdc1 $f22, 0x58($sp)
/* FC280 802D78D0 F7B40050 */ sdc1 $f20, 0x50($sp)
/* FC284 802D78D4 8E30000C */ lw $s0, 0xC($s1)
/* FC288 802D78D8 8E050000 */ lw $a1, 0x0($s0)
/* FC28C 802D78DC 0C0B1EAF */ jal evt_get_variable
/* FC290 802D78E0 26100004 */ addiu $s0, $s0, 0x4
/* FC294 802D78E4 8E050000 */ lw $a1, 0x0($s0)
/* FC298 802D78E8 26100004 */ addiu $s0, $s0, 0x4
/* FC29C 802D78EC 0220202D */ daddu $a0, $s1, $zero
/* FC2A0 802D78F0 0C0B1EAF */ jal evt_get_variable
/* FC2A4 802D78F4 0040982D */ daddu $s3, $v0, $zero
/* FC2A8 802D78F8 8E050000 */ lw $a1, 0x0($s0)
/* FC2AC 802D78FC 26100004 */ addiu $s0, $s0, 0x4
/* FC2B0 802D7900 0220202D */ daddu $a0, $s1, $zero
/* FC2B4 802D7904 0C0B210B */ jal evt_get_float_variable
/* FC2B8 802D7908 0040A82D */ daddu $s5, $v0, $zero
/* FC2BC 802D790C 8E050000 */ lw $a1, 0x0($s0)
/* FC2C0 802D7910 26100004 */ addiu $s0, $s0, 0x4
/* FC2C4 802D7914 0220202D */ daddu $a0, $s1, $zero
/* FC2C8 802D7918 0C0B1EAF */ jal evt_get_variable
/* FC2CC 802D791C 46000686 */ mov.s $f26, $f0
/* FC2D0 802D7920 8E050000 */ lw $a1, 0x0($s0)
/* FC2D4 802D7924 26100004 */ addiu $s0, $s0, 0x4
/* FC2D8 802D7928 0220202D */ daddu $a0, $s1, $zero
/* FC2DC 802D792C 0C0B1EAF */ jal evt_get_variable
/* FC2E0 802D7930 0040A02D */ daddu $s4, $v0, $zero
/* FC2E4 802D7934 8E050000 */ lw $a1, 0x0($s0)
/* FC2E8 802D7938 26100004 */ addiu $s0, $s0, 0x4
/* FC2EC 802D793C 0220202D */ daddu $a0, $s1, $zero
/* FC2F0 802D7940 0C0B210B */ jal evt_get_float_variable
/* FC2F4 802D7944 0040902D */ daddu $s2, $v0, $zero
/* FC2F8 802D7948 8E050000 */ lw $a1, 0x0($s0)
/* FC2FC 802D794C 26100004 */ addiu $s0, $s0, 0x4
/* FC300 802D7950 0220202D */ daddu $a0, $s1, $zero
/* FC304 802D7954 0C0B210B */ jal evt_get_float_variable
/* FC308 802D7958 46000606 */ mov.s $f24, $f0
/* FC30C 802D795C 8E050000 */ lw $a1, 0x0($s0)
/* FC310 802D7960 26100004 */ addiu $s0, $s0, 0x4
/* FC314 802D7964 0220202D */ daddu $a0, $s1, $zero
/* FC318 802D7968 0C0B210B */ jal evt_get_float_variable
/* FC31C 802D796C 46000586 */ mov.s $f22, $f0
/* FC320 802D7970 0220202D */ daddu $a0, $s1, $zero
/* FC324 802D7974 8E050000 */ lw $a1, 0x0($s0)
/* FC328 802D7978 0C0B210B */ jal evt_get_float_variable
/* FC32C 802D797C 46000506 */ mov.s $f20, $f0
/* FC330 802D7980 12400006 */ beqz $s2, .L802D799C
/* FC334 802D7984 3C055555 */ lui $a1, (0x55555556 >> 16)
/* FC338 802D7988 24020001 */ addiu $v0, $zero, 0x1
/* FC33C 802D798C 12420018 */ beq $s2, $v0, .L802D79F0
/* FC340 802D7990 4600C086 */ mov.s $f2, $f24
/* FC344 802D7994 080B5E9E */ j .L802D7A78
/* FC348 802D7998 4600B106 */ mov.s $f4, $f22
.L802D799C:
/* FC34C 802D799C 3C028011 */ lui $v0, %hi(gPlayerStatus + 0xB0)
/* FC350 802D79A0 9442F078 */ lhu $v0, %lo(gPlayerStatus + 0xB0)($v0)
/* FC354 802D79A4 34A55556 */ ori $a1, $a1, (0x55555556 & 0xFFFF)
/* FC358 802D79A8 00021400 */ sll $v0, $v0, 16
/* FC35C 802D79AC 00022403 */ sra $a0, $v0, 16
/* FC360 802D79B0 00041840 */ sll $v1, $a0, 1
/* FC364 802D79B4 00650018 */ mult $v1, $a1
/* FC368 802D79B8 44801000 */ mtc1 $zero, $f2
/* FC36C 802D79BC 00003010 */ mfhi $a2
/* FC370 802D79C0 2407FFFF */ addiu $a3, $zero, -0x1
/* FC374 802D79C4 46001186 */ mov.s $f6, $f2
/* FC378 802D79C8 00850018 */ mult $a0, $a1
/* FC37C 802D79CC 00031FC3 */ sra $v1, $v1, 31
/* FC380 802D79D0 000217C3 */ sra $v0, $v0, 31
/* FC384 802D79D4 00C31823 */ subu $v1, $a2, $v1
/* FC388 802D79D8 44832000 */ mtc1 $v1, $f4
/* FC38C 802D79DC 00000000 */ nop
/* FC390 802D79E0 46802120 */ cvt.s.w $f4, $f4
/* FC394 802D79E4 00004810 */ mfhi $t1
/* FC398 802D79E8 080B5E97 */ j .L802D7A5C
/* FC39C 802D79EC 01221023 */ subu $v0, $t1, $v0
.L802D79F0:
/* FC3A0 802D79F0 0220202D */ daddu $a0, $s1, $zero
/* FC3A4 802D79F4 0C0B36B0 */ jal resolve_npc
/* FC3A8 802D79F8 0260282D */ daddu $a1, $s3, $zero
/* FC3AC 802D79FC 0040382D */ daddu $a3, $v0, $zero
/* FC3B0 802D7A00 10E0002A */ beqz $a3, .L802D7AAC
/* FC3B4 802D7A04 3C036666 */ lui $v1, (0x66666667 >> 16)
/* FC3B8 802D7A08 94E200A8 */ lhu $v0, 0xA8($a3)
/* FC3BC 802D7A0C 34636667 */ ori $v1, $v1, (0x66666667 & 0xFFFF)
/* FC3C0 802D7A10 00021400 */ sll $v0, $v0, 16
/* FC3C4 802D7A14 00023403 */ sra $a2, $v0, 16
/* FC3C8 802D7A18 00062080 */ sll $a0, $a2, 2
/* FC3CC 802D7A1C 00830018 */ mult $a0, $v1
/* FC3D0 802D7A20 3C055555 */ lui $a1, (0x55555556 >> 16)
/* FC3D4 802D7A24 34A55556 */ ori $a1, $a1, (0x55555556 & 0xFFFF)
/* FC3D8 802D7A28 44801000 */ mtc1 $zero, $f2
/* FC3DC 802D7A2C 00004010 */ mfhi $t0
/* FC3E0 802D7A30 46001186 */ mov.s $f6, $f2
/* FC3E4 802D7A34 00081843 */ sra $v1, $t0, 1
/* FC3E8 802D7A38 00C50018 */ mult $a2, $a1
/* FC3EC 802D7A3C 000427C3 */ sra $a0, $a0, 31
/* FC3F0 802D7A40 000217C3 */ sra $v0, $v0, 31
/* FC3F4 802D7A44 00641823 */ subu $v1, $v1, $a0
/* FC3F8 802D7A48 44832000 */ mtc1 $v1, $f4
/* FC3FC 802D7A4C 00000000 */ nop
/* FC400 802D7A50 46802120 */ cvt.s.w $f4, $f4
/* FC404 802D7A54 00004010 */ mfhi $t0
/* FC408 802D7A58 01021023 */ subu $v0, $t0, $v0
.L802D7A5C:
/* FC40C 802D7A5C 00021400 */ sll $v0, $v0, 16
/* FC410 802D7A60 00021403 */ sra $v0, $v0, 16
/* FC414 802D7A64 44820000 */ mtc1 $v0, $f0
/* FC418 802D7A68 00000000 */ nop
/* FC41C 802D7A6C 46800020 */ cvt.s.w $f0, $f0
/* FC420 802D7A70 080B5EA1 */ j .L802D7A84
/* FC424 802D7A74 02A0202D */ daddu $a0, $s5, $zero
.L802D7A78:
/* FC428 802D7A78 4600A186 */ mov.s $f6, $f20
/* FC42C 802D7A7C 0000382D */ daddu $a3, $zero, $zero
/* FC430 802D7A80 02A0202D */ daddu $a0, $s5, $zero
.L802D7A84:
/* FC434 802D7A84 00E0282D */ daddu $a1, $a3, $zero
/* FC438 802D7A88 44061000 */ mfc1 $a2, $f2
/* FC43C 802D7A8C 44072000 */ mfc1 $a3, $f4
/* FC440 802D7A90 27A20028 */ addiu $v0, $sp, 0x28
/* FC444 802D7A94 E7A60010 */ swc1 $f6, 0x10($sp)
/* FC448 802D7A98 E7A00014 */ swc1 $f0, 0x14($sp)
/* FC44C 802D7A9C E7BA0018 */ swc1 $f26, 0x18($sp)
/* FC450 802D7AA0 AFB4001C */ sw $s4, 0x1C($sp)
/* FC454 802D7AA4 0C01BFA4 */ jal fx_emote
/* FC458 802D7AA8 AFA20020 */ sw $v0, 0x20($sp)
.L802D7AAC:
/* FC45C 802D7AAC 24020002 */ addiu $v0, $zero, 0x2
/* FC460 802D7AB0 8FBF0048 */ lw $ra, 0x48($sp)
/* FC464 802D7AB4 8FB50044 */ lw $s5, 0x44($sp)
/* FC468 802D7AB8 8FB40040 */ lw $s4, 0x40($sp)
/* FC46C 802D7ABC 8FB3003C */ lw $s3, 0x3C($sp)
/* FC470 802D7AC0 8FB20038 */ lw $s2, 0x38($sp)
/* FC474 802D7AC4 8FB10034 */ lw $s1, 0x34($sp)
/* FC478 802D7AC8 8FB00030 */ lw $s0, 0x30($sp)
/* FC47C 802D7ACC D7BA0068 */ ldc1 $f26, 0x68($sp)
/* FC480 802D7AD0 D7B80060 */ ldc1 $f24, 0x60($sp)
/* FC484 802D7AD4 D7B60058 */ ldc1 $f22, 0x58($sp)
/* FC488 802D7AD8 D7B40050 */ ldc1 $f20, 0x50($sp)
/* FC48C 802D7ADC 03E00008 */ jr $ra
/* FC490 802D7AE0 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
ApiStatus ShowEmote(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 npcID = evt_get_variable(script, *args++);
s32 emoteType = evt_get_variable(script, *args++);
f32 pitch = evt_get_float_variable(script, *args++);
s32 duration = evt_get_variable(script, *args++);
s32 emoterType = evt_get_variable(script, *args++);
f32 dX = evt_get_float_variable(script, *args++);
f32 dY = evt_get_float_variable(script, *args++);
f32 dZ = evt_get_float_variable(script, *args++);
f32 radius = evt_get_float_variable(script, *args++);
Npc* npc;
s32 emoteHandle;
f32 x, y, z, r;
switch (emoterType) {
case EMOTER_PLAYER:
// show emote from player
npc = (Npc*)-1;
x = 0.0f;
y = (gPlayerStatus.colliderHeight * 2) / 3;
z = 0.0f;
r = gPlayerStatus.colliderHeight / 3;
break;
case EMOTER_NPC:
// show emote from NPC
npc = resolve_npc(script, npcID);
if (npc == NULL) {
return ApiStatus_DONE2;
}
x = 0.0f;
y = (npc->collisionHeight * 4) / 5;
z = 0.0f;
r = npc->collisionHeight / 3;
break;
default:
// show emote at arbitrary position
x = dX;
y = dY;
z = dZ;
r = radius;
npc = NULL;
break;
}
fx_emote(emoteType, npc, x, y, z, r, pitch, duration, &emoteHandle);
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel drop_leaves_main
/* 33CDF0 E0028000 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 33CDF4 E0028004 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 33CDF8 E0028008 4485A000 */ mtc1 $a1, $f20
/* 33CDFC E002800C AFB30034 */ sw $s3, 0x34($sp)
/* 33CE00 E0028010 0080982D */ daddu $s3, $a0, $zero
/* 33CE04 E0028014 F7B60048 */ sdc1 $f22, 0x48($sp)
/* 33CE08 E0028018 4486B000 */ mtc1 $a2, $f22
/* 33CE0C E002801C 27A40010 */ addiu $a0, $sp, 0x10
/* 33CE10 E0028020 F7B80050 */ sdc1 $f24, 0x50($sp)
/* 33CE14 E0028024 4487C000 */ mtc1 $a3, $f24
/* 33CE18 E0028028 3C02E003 */ lui $v0, %hi(drop_leaves_init)
/* 33CE1C E002802C 24428240 */ addiu $v0, $v0, %lo(drop_leaves_init)
/* 33CE20 E0028030 AFA20018 */ sw $v0, 0x18($sp)
/* 33CE24 E0028034 3C02E003 */ lui $v0, %hi(drop_leaves_update)
/* 33CE28 E0028038 24428248 */ addiu $v0, $v0, %lo(drop_leaves_update)
/* 33CE2C E002803C AFA2001C */ sw $v0, 0x1C($sp)
/* 33CE30 E0028040 3C02E003 */ lui $v0, %hi(drop_leaves_render)
/* 33CE34 E0028044 244284E8 */ addiu $v0, $v0, %lo(drop_leaves_render)
/* 33CE38 E0028048 AFA20020 */ sw $v0, 0x20($sp)
/* 33CE3C E002804C 24020014 */ addiu $v0, $zero, 0x14
/* 33CE40 E0028050 AFBF0038 */ sw $ra, 0x38($sp)
/* 33CE44 E0028054 AFB20030 */ sw $s2, 0x30($sp)
/* 33CE48 E0028058 AFB1002C */ sw $s1, 0x2C($sp)
/* 33CE4C E002805C AFB00028 */ sw $s0, 0x28($sp)
/* 33CE50 E0028060 AFA00010 */ sw $zero, 0x10($sp)
/* 33CE54 E0028064 AFA00024 */ sw $zero, 0x24($sp)
/* 33CE58 E0028068 0C080124 */ jal shim_create_effect_instance
/* 33CE5C E002806C AFA20014 */ sw $v0, 0x14($sp)
/* 33CE60 E0028070 240400F0 */ addiu $a0, $zero, 0xF0
/* 33CE64 E0028074 24120005 */ addiu $s2, $zero, 0x5
/* 33CE68 E0028078 0040802D */ daddu $s0, $v0, $zero
/* 33CE6C E002807C 0C08012C */ jal shim_general_heap_malloc
/* 33CE70 E0028080 AE120008 */ sw $s2, 0x8($s0)
/* 33CE74 E0028084 0040182D */ daddu $v1, $v0, $zero
/* 33CE78 E0028088 14600003 */ bnez $v1, .LE0028098
/* 33CE7C E002808C AE03000C */ sw $v1, 0xC($s0)
.LE0028090:
/* 33CE80 E0028090 0800A024 */ j .LE0028090
/* 33CE84 E0028094 00000000 */ nop
.LE0028098:
/* 33CE88 E0028098 AC730000 */ sw $s3, 0x0($v1)
/* 33CE8C E002809C E4740004 */ swc1 $f20, 0x4($v1)
/* 33CE90 E00280A0 E4760008 */ swc1 $f22, 0x8($v1)
/* 33CE94 E00280A4 E478000C */ swc1 $f24, 0xC($v1)
/* 33CE98 E00280A8 8FA20068 */ lw $v0, 0x68($sp)
/* 33CE9C E00280AC 24110001 */ addiu $s1, $zero, 0x1
/* 33CEA0 E00280B0 AC60002C */ sw $zero, 0x2C($v1)
/* 33CEA4 E00280B4 AC600024 */ sw $zero, 0x24($v1)
/* 33CEA8 E00280B8 AC620028 */ sw $v0, 0x28($v1)
/* 33CEAC E00280BC 0232102A */ slt $v0, $s1, $s2
/* 33CEB0 E00280C0 10400055 */ beqz $v0, .LE0028218
/* 33CEB4 E00280C4 24630030 */ addiu $v1, $v1, 0x30
/* 33CEB8 E00280C8 3C014120 */ lui $at, (0x41200000 >> 16)
/* 33CEBC E00280CC 4481A000 */ mtc1 $at, $f20
/* 33CEC0 E00280D0 24700014 */ addiu $s0, $v1, 0x14
.LE00280D4:
/* 33CEC4 E00280D4 16600026 */ bnez $s3, .LE0028170
/* 33CEC8 E00280D8 00000000 */ nop
/* 33CECC E00280DC 0C080000 */ jal effect_rand_int
/* 33CED0 E00280E0 24040032 */ addiu $a0, $zero, 0x32
/* 33CED4 E00280E4 24040032 */ addiu $a0, $zero, 0x32
/* 33CED8 E00280E8 2442FFE7 */ addiu $v0, $v0, -0x19
/* 33CEDC E00280EC 44820000 */ mtc1 $v0, $f0
/* 33CEE0 E00280F0 00000000 */ nop
/* 33CEE4 E00280F4 46800020 */ cvt.s.w $f0, $f0
/* 33CEE8 E00280F8 0C080000 */ jal effect_rand_int
/* 33CEEC E00280FC E600FFF0 */ swc1 $f0, -0x10($s0)
/* 33CEF0 E0028100 24040168 */ addiu $a0, $zero, 0x168
/* 33CEF4 E0028104 2442FFE7 */ addiu $v0, $v0, -0x19
/* 33CEF8 E0028108 44820000 */ mtc1 $v0, $f0
/* 33CEFC E002810C 00000000 */ nop
/* 33CF00 E0028110 46800020 */ cvt.s.w $f0, $f0
/* 33CF04 E0028114 E600FFF4 */ swc1 $f0, -0xC($s0)
/* 33CF08 E0028118 0C080000 */ jal effect_rand_int
/* 33CF0C E002811C AE00FFF8 */ sw $zero, -0x8($s0)
/* 33CF10 E0028120 24040168 */ addiu $a0, $zero, 0x168
/* 33CF14 E0028124 44820000 */ mtc1 $v0, $f0
/* 33CF18 E0028128 00000000 */ nop
/* 33CF1C E002812C 46800020 */ cvt.s.w $f0, $f0
/* 33CF20 E0028130 0C080000 */ jal effect_rand_int
/* 33CF24 E0028134 E6000004 */ swc1 $f0, 0x4($s0)
/* 33CF28 E0028138 24040064 */ addiu $a0, $zero, 0x64
/* 33CF2C E002813C 44820000 */ mtc1 $v0, $f0
/* 33CF30 E0028140 00000000 */ nop
/* 33CF34 E0028144 46800020 */ cvt.s.w $f0, $f0
/* 33CF38 E0028148 0C080000 */ jal effect_rand_int
/* 33CF3C E002814C E600000C */ swc1 $f0, 0xC($s0)
/* 33CF40 E0028150 44820000 */ mtc1 $v0, $f0
/* 33CF44 E0028154 00000000 */ nop
/* 33CF48 E0028158 46800020 */ cvt.s.w $f0, $f0
/* 33CF4C E002815C 46140003 */ div.s $f0, $f0, $f20
/* 33CF50 E0028160 E6000008 */ swc1 $f0, 0x8($s0)
/* 33CF54 E0028164 AE00FFFC */ sw $zero, -0x4($s0)
/* 33CF58 E0028168 0800A082 */ j .LE0028208
/* 33CF5C E002816C AE000000 */ sw $zero, 0x0($s0)
.LE0028170:
/* 33CF60 E0028170 0C080000 */ jal effect_rand_int
/* 33CF64 E0028174 2404000A */ addiu $a0, $zero, 0xA
/* 33CF68 E0028178 2404000A */ addiu $a0, $zero, 0xA
/* 33CF6C E002817C 2442FFFB */ addiu $v0, $v0, -0x5
/* 33CF70 E0028180 44820000 */ mtc1 $v0, $f0
/* 33CF74 E0028184 00000000 */ nop
/* 33CF78 E0028188 46800020 */ cvt.s.w $f0, $f0
/* 33CF7C E002818C 0C080000 */ jal effect_rand_int
/* 33CF80 E0028190 E600FFF0 */ swc1 $f0, -0x10($s0)
/* 33CF84 E0028194 24040168 */ addiu $a0, $zero, 0x168
/* 33CF88 E0028198 24420005 */ addiu $v0, $v0, 0x5
/* 33CF8C E002819C 44820000 */ mtc1 $v0, $f0
/* 33CF90 E00281A0 00000000 */ nop
/* 33CF94 E00281A4 46800020 */ cvt.s.w $f0, $f0
/* 33CF98 E00281A8 E600FFF4 */ swc1 $f0, -0xC($s0)
/* 33CF9C E00281AC 0C080000 */ jal effect_rand_int
/* 33CFA0 E00281B0 E614FFF8 */ swc1 $f20, -0x8($s0)
/* 33CFA4 E00281B4 24040168 */ addiu $a0, $zero, 0x168
/* 33CFA8 E00281B8 44820000 */ mtc1 $v0, $f0
/* 33CFAC E00281BC 00000000 */ nop
/* 33CFB0 E00281C0 46800020 */ cvt.s.w $f0, $f0
/* 33CFB4 E00281C4 0C080000 */ jal effect_rand_int
/* 33CFB8 E00281C8 E6000004 */ swc1 $f0, 0x4($s0)
/* 33CFBC E00281CC 24040064 */ addiu $a0, $zero, 0x64
/* 33CFC0 E00281D0 44820000 */ mtc1 $v0, $f0
/* 33CFC4 E00281D4 00000000 */ nop
/* 33CFC8 E00281D8 46800020 */ cvt.s.w $f0, $f0
/* 33CFCC E00281DC 0C080000 */ jal effect_rand_int
/* 33CFD0 E00281E0 E600000C */ swc1 $f0, 0xC($s0)
/* 33CFD4 E00281E4 44820000 */ mtc1 $v0, $f0
/* 33CFD8 E00281E8 00000000 */ nop
/* 33CFDC E00281EC 46800020 */ cvt.s.w $f0, $f0
/* 33CFE0 E00281F0 3C014000 */ lui $at, (0x40000000 >> 16)
/* 33CFE4 E00281F4 44811000 */ mtc1 $at, $f2
/* 33CFE8 E00281F8 46140003 */ div.s $f0, $f0, $f20
/* 33CFEC E00281FC E6000008 */ swc1 $f0, 0x8($s0)
/* 33CFF0 E0028200 AE00FFFC */ sw $zero, -0x4($s0)
/* 33CFF4 E0028204 E6020000 */ swc1 $f2, 0x0($s0)
.LE0028208:
/* 33CFF8 E0028208 26310001 */ addiu $s1, $s1, 0x1
/* 33CFFC E002820C 0232102A */ slt $v0, $s1, $s2
/* 33D000 E0028210 1440FFB0 */ bnez $v0, .LE00280D4
/* 33D004 E0028214 26100030 */ addiu $s0, $s0, 0x30
.LE0028218:
/* 33D008 E0028218 8FBF0038 */ lw $ra, 0x38($sp)
/* 33D00C E002821C 8FB30034 */ lw $s3, 0x34($sp)
/* 33D010 E0028220 8FB20030 */ lw $s2, 0x30($sp)
/* 33D014 E0028224 8FB1002C */ lw $s1, 0x2C($sp)
/* 33D018 E0028228 8FB00028 */ lw $s0, 0x28($sp)
/* 33D01C E002822C D7B80050 */ ldc1 $f24, 0x50($sp)
/* 33D020 E0028230 D7B60048 */ ldc1 $f22, 0x48($sp)
/* 33D024 E0028234 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 33D028 E0028238 03E00008 */ jr $ra
/* 33D02C E002823C 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
void drop_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
EffectBlueprint bp;
EffectInstance* effect;
DropLeavesFXData* part;
s32 numParts = 5;
s32 i;
bp.init = drop_leaves_init;
bp.update = drop_leaves_update;
bp.renderWorld = drop_leaves_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_DROP_LEAVES;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
part = effect->data.dropLeaves = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.dropLeaves != NULL);
part->unk_00 = arg0;
part->unk_04 = arg1;
part->unk_08 = arg2;
part->unk_0C = arg3;
part->unk_28 = arg4;
part->unk_2C = 0;
part->unk_24 = 0;
part++;
for (i = 1; i < numParts; i++, part++) {
if (arg0 == 0) {
part->unk_04 = effect_rand_int(50) - 25;
part->unk_08 = effect_rand_int(50) - 25;
part->unk_0C = 0.0f;
part->unk_18 = effect_rand_int(360);
part->unk_20 = effect_rand_int(360);
part->unk_1C = effect_rand_int(100) / 10.0f;
part->unk_10 = 0;
part->unk_14 = 0;
} else {
part->unk_04 = effect_rand_int(10) - 5;
part->unk_08 = effect_rand_int(10) + 5;
part->unk_0C = 10.0f;
part->unk_18 = effect_rand_int(360);
part->unk_20 = effect_rand_int(360);
part->unk_1C = effect_rand_int(100) / 10.0f;
part->unk_10 = 0;
part->unk_14 = 2.0f;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel npc_get_render_yaw
/* 151A4 80039DA4 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 151A8 80039DA8 AFB10014 */ sw $s1, 0x14($sp)
/* 151AC 80039DAC 0080882D */ daddu $s1, $a0, $zero
/* 151B0 80039DB0 3C03800A */ lui $v1, %hi(gCurrentCamID)
/* 151B4 80039DB4 8463A634 */ lh $v1, %lo(gCurrentCamID)($v1)
/* 151B8 80039DB8 3C04800B */ lui $a0, %hi(gCameras)
/* 151BC 80039DBC 24841D80 */ addiu $a0, $a0, %lo(gCameras)
/* 151C0 80039DC0 AFBF0018 */ sw $ra, 0x18($sp)
/* 151C4 80039DC4 AFB00010 */ sw $s0, 0x10($sp)
/* 151C8 80039DC8 F7B60028 */ sdc1 $f22, 0x28($sp)
/* 151CC 80039DCC F7B40020 */ sdc1 $f20, 0x20($sp)
/* 151D0 80039DD0 00031080 */ sll $v0, $v1, 2
/* 151D4 80039DD4 00431021 */ addu $v0, $v0, $v1
/* 151D8 80039DD8 00021080 */ sll $v0, $v0, 2
/* 151DC 80039DDC 00431023 */ subu $v0, $v0, $v1
/* 151E0 80039DE0 000218C0 */ sll $v1, $v0, 3
/* 151E4 80039DE4 00431021 */ addu $v0, $v0, $v1
/* 151E8 80039DE8 000210C0 */ sll $v0, $v0, 3
/* 151EC 80039DEC 3C03800A */ lui $v1, %hi(gOverrideFlags)
/* 151F0 80039DF0 8C63A650 */ lw $v1, %lo(gOverrideFlags)($v1)
/* 151F4 80039DF4 3063C000 */ andi $v1, $v1, 0xC000
/* 151F8 80039DF8 1460006C */ bnez $v1, .L80039FAC
/* 151FC 80039DFC 00441021 */ addu $v0, $v0, $a0
/* 15200 80039E00 C456006C */ lwc1 $f22, 0x6C($v0)
/* 15204 80039E04 C62E000C */ lwc1 $f14, 0xC($s1)
/* 15208 80039E08 0C00A70A */ jal get_clamped_angle_diff
/* 1520C 80039E0C 4600B306 */ mov.s $f12, $f22
/* 15210 80039E10 3C01C0A0 */ lui $at, (0xC0A00000 >> 16)
/* 15214 80039E14 44811000 */ mtc1 $at, $f2
/* 15218 80039E18 46000306 */ mov.s $f12, $f0
/* 1521C 80039E1C 4602603C */ c.lt.s $f12, $f2
/* 15220 80039E20 00000000 */ nop
/* 15224 80039E24 4500000B */ bc1f .L80039E54
/* 15228 80039E28 00000000 */ nop
/* 1522C 80039E2C 3C01C32F */ lui $at, (0xC32F0000 >> 16)
/* 15230 80039E30 44810000 */ mtc1 $at, $f0
/* 15234 80039E34 00000000 */ nop
/* 15238 80039E38 460C003C */ c.lt.s $f0, $f12
/* 1523C 80039E3C 00000000 */ nop
/* 15240 80039E40 45000004 */ bc1f .L80039E54
/* 15244 80039E44 0000802D */ daddu $s0, $zero, $zero
/* 15248 80039E48 44806000 */ mtc1 $zero, $f12
/* 1524C 80039E4C 0800E7AC */ j .L80039EB0
/* 15250 80039E50 00000000 */ nop
.L80039E54:
/* 15254 80039E54 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 15258 80039E58 44810000 */ mtc1 $at, $f0
/* 1525C 80039E5C 00000000 */ nop
/* 15260 80039E60 460C003C */ c.lt.s $f0, $f12
/* 15264 80039E64 00000000 */ nop
/* 15268 80039E68 4500000C */ bc1f .L80039E9C
/* 1526C 80039E6C 00000000 */ nop
/* 15270 80039E70 3C01432F */ lui $at, (0x432F0000 >> 16)
/* 15274 80039E74 44810000 */ mtc1 $at, $f0
/* 15278 80039E78 00000000 */ nop
/* 1527C 80039E7C 4600603C */ c.lt.s $f12, $f0
/* 15280 80039E80 00000000 */ nop
/* 15284 80039E84 45000005 */ bc1f .L80039E9C
/* 15288 80039E88 24100001 */ addiu $s0, $zero, 0x1
/* 1528C 80039E8C 3C014334 */ lui $at, (0x43340000 >> 16)
/* 15290 80039E90 44816000 */ mtc1 $at, $f12
/* 15294 80039E94 0800E7AC */ j .L80039EB0
/* 15298 80039E98 00000000 */ nop
.L80039E9C:
/* 1529C 80039E9C 8622008A */ lh $v0, 0x8A($s1)
/* 152A0 80039EA0 24100002 */ addiu $s0, $zero, 0x2
/* 152A4 80039EA4 44826000 */ mtc1 $v0, $f12
/* 152A8 80039EA8 00000000 */ nop
/* 152AC 80039EAC 46806320 */ cvt.s.w $f12, $f12
.L80039EB0:
/* 152B0 80039EB0 0C00A6C9 */ jal clamp_angle
/* 152B4 80039EB4 00000000 */ nop
/* 152B8 80039EB8 46000506 */ mov.s $f20, $f0
/* 152BC 80039EBC 4600A10D */ trunc.w.s $f4, $f20
/* 152C0 80039EC0 44022000 */ mfc1 $v0, $f4
/* 152C4 80039EC4 00000000 */ nop
/* 152C8 80039EC8 A622008A */ sh $v0, 0x8A($s1)
/* 152CC 80039ECC 8E220000 */ lw $v0, 0x0($s1)
/* 152D0 80039ED0 3C030004 */ lui $v1, (0x40000 >> 16)
/* 152D4 80039ED4 00431024 */ and $v0, $v0, $v1
/* 152D8 80039ED8 14400034 */ bnez $v0, .L80039FAC
/* 152DC 80039EDC 00000000 */ nop
/* 152E0 80039EE0 86220088 */ lh $v0, 0x88($s1)
/* 152E4 80039EE4 10500016 */ beq $v0, $s0, .L80039F40
/* 152E8 80039EE8 24020002 */ addiu $v0, $zero, 0x2
/* 152EC 80039EEC 12020014 */ beq $s0, $v0, .L80039F40
/* 152F0 80039EF0 00000000 */ nop
/* 152F4 80039EF4 12000003 */ beqz $s0, .L80039F04
/* 152F8 80039EF8 A6300088 */ sh $s0, 0x88($s1)
/* 152FC 80039EFC 0800E7C2 */ j .L80039F08
/* 15300 80039F00 240200B4 */ addiu $v0, $zero, 0xB4
.L80039F04:
/* 15304 80039F04 2402FF4C */ addiu $v0, $zero, -0xB4
.L80039F08:
/* 15308 80039F08 A622008C */ sh $v0, 0x8C($s1)
/* 1530C 80039F0C C62E000C */ lwc1 $f14, 0xC($s1)
/* 15310 80039F10 0C00A70A */ jal get_clamped_angle_diff
/* 15314 80039F14 4600B306 */ mov.s $f12, $f22
/* 15318 80039F18 3C0142B4 */ lui $at, (0x42B40000 >> 16)
/* 1531C 80039F1C 44811000 */ mtc1 $at, $f2
/* 15320 80039F20 46000005 */ abs.s $f0, $f0
/* 15324 80039F24 4600103E */ c.le.s $f2, $f0
/* 15328 80039F28 00000000 */ nop
/* 1532C 80039F2C 45000004 */ bc1f .L80039F40
/* 15330 80039F30 00000000 */ nop
/* 15334 80039F34 9622008C */ lhu $v0, 0x8C($s1)
/* 15338 80039F38 00021023 */ negu $v0, $v0
/* 1533C 80039F3C A622008C */ sh $v0, 0x8C($s1)
.L80039F40:
/* 15340 80039F40 8623008C */ lh $v1, 0x8C($s1)
/* 15344 80039F44 10600009 */ beqz $v1, .L80039F6C
/* 15348 80039F48 9622008C */ lhu $v0, 0x8C($s1)
/* 1534C 80039F4C 04610002 */ bgez $v1, .L80039F58
/* 15350 80039F50 24420014 */ addiu $v0, $v0, 0x14
/* 15354 80039F54 A622008C */ sh $v0, 0x8C($s1)
.L80039F58:
/* 15358 80039F58 8622008C */ lh $v0, 0x8C($s1)
/* 1535C 80039F5C 9623008C */ lhu $v1, 0x8C($s1)
/* 15360 80039F60 18400002 */ blez $v0, .L80039F6C
/* 15364 80039F64 2462FFEC */ addiu $v0, $v1, -0x14
/* 15368 80039F68 A622008C */ sh $v0, 0x8C($s1)
.L80039F6C:
/* 1536C 80039F6C 8E220000 */ lw $v0, 0x0($s1)
/* 15370 80039F70 3C030020 */ lui $v1, (0x200000 >> 16)
/* 15374 80039F74 00431024 */ and $v0, $v0, $v1
/* 15378 80039F78 54400001 */ bnel $v0, $zero, .L80039F80
/* 1537C 80039F7C A620008C */ sh $zero, 0x8C($s1)
.L80039F80:
/* 15380 80039F80 8622008C */ lh $v0, 0x8C($s1)
/* 15384 80039F84 44826000 */ mtc1 $v0, $f12
/* 15388 80039F88 00000000 */ nop
/* 1538C 80039F8C 46806320 */ cvt.s.w $f12, $f12
/* 15390 80039F90 0C00A6C9 */ jal clamp_angle
/* 15394 80039F94 46146300 */ add.s $f12, $f12, $f20
/* 15398 80039F98 0C00A6C9 */ jal clamp_angle
/* 1539C 80039F9C 46160301 */ sub.s $f12, $f0, $f22
/* 153A0 80039FA0 46000506 */ mov.s $f20, $f0
/* 153A4 80039FA4 0800E7EC */ j .L80039FB0
/* 153A8 80039FA8 E6340034 */ swc1 $f20, 0x34($s1)
.L80039FAC:
/* 153AC 80039FAC C6340034 */ lwc1 $f20, 0x34($s1)
.L80039FB0:
/* 153B0 80039FB0 4600A006 */ mov.s $f0, $f20
/* 153B4 80039FB4 8FBF0018 */ lw $ra, 0x18($sp)
/* 153B8 80039FB8 8FB10014 */ lw $s1, 0x14($sp)
/* 153BC 80039FBC 8FB00010 */ lw $s0, 0x10($sp)
/* 153C0 80039FC0 D7B60028 */ ldc1 $f22, 0x28($sp)
/* 153C4 80039FC4 D7B40020 */ ldc1 $f20, 0x20($sp)
/* 153C8 80039FC8 03E00008 */ jr $ra
/* 153CC 80039FCC 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
f32 npc_get_render_yaw(Npc* npc) {
Camera* camera = &gCameras[gCurrentCamID];
f32 cameraYaw;
f32 camRelativeYaw;
f32 yaw;
s32 direction;
if (!(gOverrideFlags & (GLOBAL_OVERRIDES_8000 | GLOBAL_OVERRIDES_4000))) {
cameraYaw = camera->currentYaw;
camRelativeYaw = get_clamped_angle_diff(cameraYaw, npc->yaw);
if (camRelativeYaw < -5.0f && camRelativeYaw > -175.0f) {
direction = 0;
camRelativeYaw = 0.0f;
} else if (camRelativeYaw > 5.0f && camRelativeYaw < 175.0f) {
direction = 1;
camRelativeYaw = 180.0f;
} else {
// direction is close to flipping, use saved value
direction = 2;
camRelativeYaw = npc->yawCamOffset;
}
npc->yawCamOffset = yaw = clamp_angle(camRelativeYaw);
if (!(npc->flags & NPC_FLAG_IGNORE_CAMERA_FOR_YAW)) {
if (npc->isFacingAway != direction && direction != 2) {
npc->isFacingAway = direction;
if (npc->isFacingAway) {
npc->turnAroundYawAdjustment = 180;
} else {
npc->turnAroundYawAdjustment = -180;
}
if (fabsf(get_clamped_angle_diff(cameraYaw, npc->yaw)) >= 90.0f) {
npc->turnAroundYawAdjustment = -npc->turnAroundYawAdjustment;
}
}
if (npc->turnAroundYawAdjustment != 0) {
if (npc->turnAroundYawAdjustment < 0) {
npc->turnAroundYawAdjustment += 20;
}
if (npc->turnAroundYawAdjustment > 0) {
npc->turnAroundYawAdjustment -= 20;
}
}
if (npc->flags & NPC_FLAG_200000) {
npc->turnAroundYawAdjustment = 0;
}
npc->renderYaw = clamp_angle(clamp_angle(npc->turnAroundYawAdjustment + yaw) - cameraYaw);
yaw = npc->renderYaw;
} else {
yaw = npc->renderYaw;
}
} else {
yaw = npc->renderYaw;
}
return yaw;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel recover_update
/* 381490 E00801D0 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 381494 E00801D4 AFB50024 */ sw $s5, 0x24($sp)
/* 381498 E00801D8 0080A82D */ daddu $s5, $a0, $zero
/* 38149C E00801DC AFBF0030 */ sw $ra, 0x30($sp)
/* 3814A0 E00801E0 AFB7002C */ sw $s7, 0x2C($sp)
/* 3814A4 E00801E4 AFB60028 */ sw $s6, 0x28($sp)
/* 3814A8 E00801E8 AFB40020 */ sw $s4, 0x20($sp)
/* 3814AC E00801EC AFB3001C */ sw $s3, 0x1C($sp)
/* 3814B0 E00801F0 AFB20018 */ sw $s2, 0x18($sp)
/* 3814B4 E00801F4 AFB10014 */ sw $s1, 0x14($sp)
/* 3814B8 E00801F8 AFB00010 */ sw $s0, 0x10($sp)
/* 3814BC E00801FC F7B60040 */ sdc1 $f22, 0x40($sp)
/* 3814C0 E0080200 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 3814C4 E0080204 8EA3000C */ lw $v1, 0xC($s5)
/* 3814C8 E0080208 8C62002C */ lw $v0, 0x2C($v1)
/* 3814CC E008020C 2442FFFF */ addiu $v0, $v0, -0x1
/* 3814D0 E0080210 AC62002C */ sw $v0, 0x2C($v1)
/* 3814D4 E0080214 8C620030 */ lw $v0, 0x30($v1)
/* 3814D8 E0080218 8C64002C */ lw $a0, 0x2C($v1)
/* 3814DC E008021C 24420001 */ addiu $v0, $v0, 0x1
/* 3814E0 E0080220 04810005 */ bgez $a0, .LE0080238
/* 3814E4 E0080224 AC620030 */ sw $v0, 0x30($v1)
/* 3814E8 E0080228 0C080128 */ jal shim_remove_effect
/* 3814EC E008022C 02A0202D */ daddu $a0, $s5, $zero
/* 3814F0 E0080230 080200FC */ j .LE00803F0
/* 3814F4 E0080234 00000000 */ nop
.LE0080238:
/* 3814F8 E0080238 24630048 */ addiu $v1, $v1, 0x48
/* 3814FC E008023C 24120001 */ addiu $s2, $zero, 0x1
/* 381500 E0080240 8EA20008 */ lw $v0, 0x8($s5)
/* 381504 E0080244 0242102A */ slt $v0, $s2, $v0
/* 381508 E0080248 10400069 */ beqz $v0, .LE00803F0
/* 38150C E008024C 0080882D */ daddu $s1, $a0, $zero
/* 381510 E0080250 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 381514 E0080254 4481B000 */ mtc1 $at, $f22
/* 381518 E0080258 3C17E008 */ lui $s7, %hi(D_E0080AF0)
/* 38151C E008025C 26F70AF0 */ addiu $s7, $s7, %lo(D_E0080AF0)
/* 381520 E0080260 02511004 */ sllv $v0, $s1, $s2
/* 381524 E0080264 0051A021 */ addu $s4, $v0, $s1
/* 381528 E0080268 001410C0 */ sll $v0, $s4, 3
/* 38152C E008026C 0051B021 */ addu $s6, $v0, $s1
/* 381530 E0080270 2470002C */ addiu $s0, $v1, 0x2C
/* 381534 E0080274 24130026 */ addiu $s3, $zero, 0x26
.LE0080278:
/* 381538 E0080278 8E020008 */ lw $v0, 0x8($s0)
/* 38153C E008027C 8E030000 */ lw $v1, 0x0($s0)
/* 381540 E0080280 18400003 */ blez $v0, .LE0080290
/* 381544 E0080284 2442FFFF */ addiu $v0, $v0, -0x1
/* 381548 E0080288 1C400053 */ bgtz $v0, .LE00803D8
/* 38154C E008028C AE020008 */ sw $v0, 0x8($s0)
.LE0080290:
/* 381550 E0080290 28620007 */ slti $v0, $v1, 0x7
/* 381554 E0080294 14400004 */ bnez $v0, .LE00802A8
/* 381558 E0080298 00031880 */ sll $v1, $v1, 2
/* 38155C E008029C E6160010 */ swc1 $f22, 0x10($s0)
/* 381560 E00802A0 080200B1 */ j .LE00802C4
/* 381564 E00802A4 E616000C */ swc1 $f22, 0xC($s0)
.LE00802A8:
/* 381568 E00802A8 00771021 */ addu $v0, $v1, $s7
/* 38156C E00802AC C4400000 */ lwc1 $f0, 0x0($v0)
/* 381570 E00802B0 E600000C */ swc1 $f0, 0xC($s0)
/* 381574 E00802B4 3C01E008 */ lui $at, (0xE0080B0C >> 16)
/* 381578 E00802B8 00230821 */ addu $at, $at, $v1
/* 38157C E00802BC C4200B0C */ lwc1 $f0, (0xE0080B0C & 0xFFFF)($at)
/* 381580 E00802C0 E6000010 */ swc1 $f0, 0x10($s0)
.LE00802C4:
/* 381584 E00802C4 00141080 */ sll $v0, $s4, 2
/* 381588 E00802C8 02621021 */ addu $v0, $s3, $v0
/* 38158C E00802CC 4482A000 */ mtc1 $v0, $f20
/* 381590 E00802D0 00000000 */ nop
/* 381594 E00802D4 4680A520 */ cvt.s.w $f20, $f20
/* 381598 E00802D8 C606FFD8 */ lwc1 $f6, -0x28($s0)
/* 38159C E00802DC C600FFE4 */ lwc1 $f0, -0x1C($s0)
/* 3815A0 E00802E0 C604FFDC */ lwc1 $f4, -0x24($s0)
/* 3815A4 E00802E4 46003180 */ add.s $f6, $f6, $f0
/* 3815A8 E00802E8 C600FFE8 */ lwc1 $f0, -0x18($s0)
/* 3815AC E00802EC C602FFEC */ lwc1 $f2, -0x14($s0)
/* 3815B0 E00802F0 46002100 */ add.s $f4, $f4, $f0
/* 3815B4 E00802F4 C600FFE0 */ lwc1 $f0, -0x20($s0)
/* 3815B8 E00802F8 4600A306 */ mov.s $f12, $f20
/* 3815BC E00802FC 46020000 */ add.s $f0, $f0, $f2
/* 3815C0 E0080300 E606FFD8 */ swc1 $f6, -0x28($s0)
/* 3815C4 E0080304 E604FFDC */ swc1 $f4, -0x24($s0)
/* 3815C8 E0080308 0C080140 */ jal shim_sin_deg
/* 3815CC E008030C E600FFE0 */ swc1 $f0, -0x20($s0)
/* 3815D0 E0080310 3C01C1F0 */ lui $at, (0xC1F00000 >> 16)
/* 3815D4 E0080314 44811000 */ mtc1 $at, $f2
/* 3815D8 E0080318 00000000 */ nop
/* 3815DC E008031C 46020002 */ mul.s $f0, $f0, $f2
/* 3815E0 E0080320 00000000 */ nop
/* 3815E4 E0080324 4600A306 */ mov.s $f12, $f20
/* 3815E8 E0080328 0C080144 */ jal shim_cos_deg
/* 3815EC E008032C E600FFF0 */ swc1 $f0, -0x10($s0)
/* 3815F0 E0080330 3C014100 */ lui $at, (0x41000000 >> 16)
/* 3815F4 E0080334 44811000 */ mtc1 $at, $f2
/* 3815F8 E0080338 00000000 */ nop
/* 3815FC E008033C 46020082 */ mul.s $f2, $f0, $f2
/* 381600 E0080340 00000000 */ nop
/* 381604 E0080344 2A220014 */ slti $v0, $s1, 0x14
/* 381608 E0080348 10400014 */ beqz $v0, .LE008039C
/* 38160C E008034C E602FFF8 */ swc1 $f2, -0x8($s0)
/* 381610 E0080350 44912000 */ mtc1 $s1, $f4
/* 381614 E0080354 00000000 */ nop
/* 381618 E0080358 46802120 */ cvt.s.w $f4, $f4
/* 38161C E008035C 3C01E008 */ lui $at, (0xE0080B30 >> 16)
/* 381620 E0080360 D4200B30 */ ldc1 $f0, (0xE0080B30 & 0xFFFF)($at)
/* 381624 E0080364 46002121 */ cvt.d.s $f4, $f4
/* 381628 E0080368 46202102 */ mul.d $f4, $f4, $f0
/* 38162C E008036C 00000000 */ nop
/* 381630 E0080370 460010A1 */ cvt.d.s $f2, $f2
/* 381634 E0080374 46241082 */ mul.d $f2, $f2, $f4
/* 381638 E0080378 00000000 */ nop
/* 38163C E008037C C600FFF0 */ lwc1 $f0, -0x10($s0)
/* 381640 E0080380 46000021 */ cvt.d.s $f0, $f0
/* 381644 E0080384 46240002 */ mul.d $f0, $f0, $f4
/* 381648 E0080388 00000000 */ nop
/* 38164C E008038C 462010A0 */ cvt.s.d $f2, $f2
/* 381650 E0080390 46200020 */ cvt.s.d $f0, $f0
/* 381654 E0080394 E602FFF8 */ swc1 $f2, -0x8($s0)
/* 381658 E0080398 E600FFF0 */ swc1 $f0, -0x10($s0)
.LE008039C:
/* 38165C E008039C 2A22000A */ slti $v0, $s1, 0xA
/* 381660 E00803A0 1040000A */ beqz $v0, .LE00803CC
/* 381664 E00803A4 00000000 */ nop
/* 381668 E00803A8 C600FFE8 */ lwc1 $f0, -0x18($s0)
/* 38166C E00803AC 3C01E008 */ lui $at, (0xE0080B38 >> 16)
/* 381670 E00803B0 D4220B38 */ ldc1 $f2, (0xE0080B38 & 0xFFFF)($at)
/* 381674 E00803B4 46000021 */ cvt.d.s $f0, $f0
/* 381678 E00803B8 46220002 */ mul.d $f0, $f0, $f2
/* 38167C E00803BC 00000000 */ nop
/* 381680 E00803C0 AE16FFFC */ sw $s6, -0x4($s0)
/* 381684 E00803C4 46200020 */ cvt.s.d $f0, $f0
/* 381688 E00803C8 E600FFE8 */ swc1 $f0, -0x18($s0)
.LE00803CC:
/* 38168C E00803CC 8E020000 */ lw $v0, 0x0($s0)
/* 381690 E00803D0 24420001 */ addiu $v0, $v0, 0x1
/* 381694 E00803D4 AE020000 */ sw $v0, 0x0($s0)
.LE00803D8:
/* 381698 E00803D8 26730026 */ addiu $s3, $s3, 0x26
/* 38169C E00803DC 26520001 */ addiu $s2, $s2, 0x1
/* 3816A0 E00803E0 8EA20008 */ lw $v0, 0x8($s5)
/* 3816A4 E00803E4 0242102A */ slt $v0, $s2, $v0
/* 3816A8 E00803E8 1440FFA3 */ bnez $v0, .LE0080278
/* 3816AC E00803EC 26100048 */ addiu $s0, $s0, 0x48
.LE00803F0:
/* 3816B0 E00803F0 8FBF0030 */ lw $ra, 0x30($sp)
/* 3816B4 E00803F4 8FB7002C */ lw $s7, 0x2C($sp)
/* 3816B8 E00803F8 8FB60028 */ lw $s6, 0x28($sp)
/* 3816BC E00803FC 8FB50024 */ lw $s5, 0x24($sp)
/* 3816C0 E0080400 8FB40020 */ lw $s4, 0x20($sp)
/* 3816C4 E0080404 8FB3001C */ lw $s3, 0x1C($sp)
/* 3816C8 E0080408 8FB20018 */ lw $s2, 0x18($sp)
/* 3816CC E008040C 8FB10014 */ lw $s1, 0x14($sp)
/* 3816D0 E0080410 8FB00010 */ lw $s0, 0x10($sp)
/* 3816D4 E0080414 D7B60040 */ ldc1 $f22, 0x40($sp)
/* 3816D8 E0080418 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 3816DC E008041C 03E00008 */ jr $ra
/* 3816E0 E0080420 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
void recover_update(EffectInstance* effect) {
RecoverFXData* part = effect->data.recover;
s32 unk_2C;
s32 i;
part->unk_2C--;
part->unk_30++;
if (part->unk_2C < 0) {
shim_remove_effect(effect);
return;
}
unk_2C = part->unk_2C;
part++;
for (i = 1; i < effect->numParts; i++, part++) {
s32 unk_2C_2 = part->unk_2C;
if (part->unk_34 <= 0 || --part->unk_34 <= 0) {
if (unk_2C_2 >= 7) {
part->unk_3C = 1.0f;
part->unk_38 = 1.0f;
} else {
part->unk_38 = D_E0080AF0[unk_2C_2];
part->unk_3C = D_E0080B0C[unk_2C_2];
}
part->unk_04 += part->unk_10;
part->unk_08 += part->unk_14;
part->unk_0C += part->unk_18;
part->unk_1C = shim_sin_deg(i * 38 + unk_2C * 12) * -30.0f;
part->unk_24 = shim_cos_deg(i * 38 + unk_2C * 12) * 8.0f;
if (unk_2C < 20) {
part->unk_24 *= (f32) unk_2C * 0.05;
part->unk_1C *= (f32) unk_2C * 0.05;
}
if (unk_2C < 10) {
part->unk_28 = unk_2C * 25;
part->unk_14 *= 0.9;
}
part->unk_2C++;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel floating_flower_main
/* 32FE30 E001A000 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 32FE34 E001A004 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 32FE38 E001A008 4485A000 */ mtc1 $a1, $f20
/* 32FE3C E001A00C F7B80048 */ sdc1 $f24, 0x48($sp)
/* 32FE40 E001A010 4486C000 */ mtc1 $a2, $f24
/* 32FE44 E001A014 AFB1002C */ sw $s1, 0x2C($sp)
/* 32FE48 E001A018 0080882D */ daddu $s1, $a0, $zero
/* 32FE4C E001A01C F7B60040 */ sdc1 $f22, 0x40($sp)
/* 32FE50 E001A020 4487B000 */ mtc1 $a3, $f22
/* 32FE54 E001A024 27A40010 */ addiu $a0, $sp, 0x10
/* 32FE58 E001A028 AFB20030 */ sw $s2, 0x30($sp)
/* 32FE5C E001A02C 8FB20060 */ lw $s2, 0x60($sp)
/* 32FE60 E001A030 3C02E002 */ lui $v0, %hi(floating_flower_init)
/* 32FE64 E001A034 2442A21C */ addiu $v0, $v0, %lo(floating_flower_init)
/* 32FE68 E001A038 AFA20018 */ sw $v0, 0x18($sp)
/* 32FE6C E001A03C 3C02E002 */ lui $v0, %hi(floating_flower_update)
/* 32FE70 E001A040 2442A224 */ addiu $v0, $v0, %lo(floating_flower_update)
/* 32FE74 E001A044 AFA2001C */ sw $v0, 0x1C($sp)
/* 32FE78 E001A048 3C02E002 */ lui $v0, %hi(floating_flower_render)
/* 32FE7C E001A04C 2442A3FC */ addiu $v0, $v0, %lo(floating_flower_render)
/* 32FE80 E001A050 AFA20020 */ sw $v0, 0x20($sp)
/* 32FE84 E001A054 2402000D */ addiu $v0, $zero, 0xD
/* 32FE88 E001A058 AFBF0034 */ sw $ra, 0x34($sp)
/* 32FE8C E001A05C AFB00028 */ sw $s0, 0x28($sp)
/* 32FE90 E001A060 AFA00010 */ sw $zero, 0x10($sp)
/* 32FE94 E001A064 AFA00024 */ sw $zero, 0x24($sp)
/* 32FE98 E001A068 0C080124 */ jal shim_create_effect_instance
/* 32FE9C E001A06C AFA20014 */ sw $v0, 0x14($sp)
/* 32FEA0 E001A070 24040048 */ addiu $a0, $zero, 0x48
/* 32FEA4 E001A074 24030001 */ addiu $v1, $zero, 0x1
/* 32FEA8 E001A078 0040802D */ daddu $s0, $v0, $zero
/* 32FEAC E001A07C 0C08012C */ jal shim_general_heap_malloc
/* 32FEB0 E001A080 AE030008 */ sw $v1, 0x8($s0)
/* 32FEB4 E001A084 AE02000C */ sw $v0, 0xC($s0)
/* 32FEB8 E001A088 0040802D */ daddu $s0, $v0, $zero
/* 32FEBC E001A08C 56000003 */ bnel $s0, $zero, .LE001A09C
/* 32FEC0 E001A090 AE110000 */ sw $s1, 0x0($s0)
.LE001A094:
/* 32FEC4 E001A094 08006825 */ j .LE001A094
/* 32FEC8 E001A098 00000000 */ nop
.LE001A09C:
/* 32FECC E001A09C 3C014120 */ lui $at, (0x41200000 >> 16)
/* 32FED0 E001A0A0 44813000 */ mtc1 $at, $f6
/* 32FED4 E001A0A4 E6140004 */ swc1 $f20, 0x4($s0)
/* 32FED8 E001A0A8 E616000C */ swc1 $f22, 0xC($s0)
/* 32FEDC E001A0AC AE000010 */ sw $zero, 0x10($s0)
/* 32FEE0 E001A0B0 4606C000 */ add.s $f0, $f24, $f6
/* 32FEE4 E001A0B4 AE000014 */ sw $zero, 0x14($s0)
/* 32FEE8 E001A0B8 AE000018 */ sw $zero, 0x18($s0)
/* 32FEEC E001A0BC 16200018 */ bnez $s1, .LE001A120
/* 32FEF0 E001A0C0 E6000008 */ swc1 $f0, 0x8($s0)
/* 32FEF4 E001A0C4 3C013DF5 */ lui $at, (0x3DF5C28F >> 16)
/* 32FEF8 E001A0C8 3421C28F */ ori $at, $at, (0x3DF5C28F & 0xFFFF)
/* 32FEFC E001A0CC 44810000 */ mtc1 $at, $f0
/* 32FF00 E001A0D0 3C01BC79 */ lui $at, (0xBC79096C >> 16)
/* 32FF04 E001A0D4 3421096C */ ori $at, $at, (0xBC79096C & 0xFFFF)
/* 32FF08 E001A0D8 44811000 */ mtc1 $at, $f2
/* 32FF0C E001A0DC 3C014040 */ lui $at, (0x40400000 >> 16)
/* 32FF10 E001A0E0 44812000 */ mtc1 $at, $f4
/* 32FF14 E001A0E4 3C02E002 */ lui $v0, (0xE0020000 >> 16)
/* 32FF18 E001A0E8 8C42A610 */ lw $v0, -0x59F0($v0)
/* 32FF1C E001A0EC AE000018 */ sw $zero, 0x18($s0)
/* 32FF20 E001A0F0 AE000024 */ sw $zero, 0x24($s0)
/* 32FF24 E001A0F4 AE000028 */ sw $zero, 0x28($s0)
/* 32FF28 E001A0F8 E600001C */ swc1 $f0, 0x1C($s0)
/* 32FF2C E001A0FC E6020020 */ swc1 $f2, 0x20($s0)
/* 32FF30 E001A100 10400004 */ beqz $v0, .LE001A114
/* 32FF34 E001A104 E604002C */ swc1 $f4, 0x2C($s0)
/* 32FF38 E001A108 3C01C120 */ lui $at, (0xC1200000 >> 16)
/* 32FF3C E001A10C 44813000 */ mtc1 $at, $f6
/* 32FF40 E001A110 00000000 */ nop
.LE001A114:
/* 32FF44 E001A114 E6060030 */ swc1 $f6, 0x30($s0)
/* 32FF48 E001A118 08006876 */ j .LE001A1D8
/* 32FF4C E001A11C AE120034 */ sw $s2, 0x34($s0)
.LE001A120:
/* 32FF50 E001A120 3C013DF5 */ lui $at, (0x3DF5C28F >> 16)
/* 32FF54 E001A124 3421C28F */ ori $at, $at, (0x3DF5C28F & 0xFFFF)
/* 32FF58 E001A128 44810000 */ mtc1 $at, $f0
/* 32FF5C E001A12C 3C01BC79 */ lui $at, (0xBC79096C >> 16)
/* 32FF60 E001A130 3421096C */ ori $at, $at, (0xBC79096C & 0xFFFF)
/* 32FF64 E001A134 44811000 */ mtc1 $at, $f2
/* 32FF68 E001A138 24040001 */ addiu $a0, $zero, 0x1
/* 32FF6C E001A13C E600001C */ swc1 $f0, 0x1C($s0)
/* 32FF70 E001A140 0C080138 */ jal shim_rand_int
/* 32FF74 E001A144 E6020020 */ swc1 $f2, 0x20($s0)
/* 32FF78 E001A148 24040168 */ addiu $a0, $zero, 0x168
/* 32FF7C E001A14C 00021900 */ sll $v1, $v0, 4
/* 32FF80 E001A150 00621823 */ subu $v1, $v1, $v0
/* 32FF84 E001A154 00031840 */ sll $v1, $v1, 1
/* 32FF88 E001A158 2463FFF1 */ addiu $v1, $v1, -0xF
/* 32FF8C E001A15C 44830000 */ mtc1 $v1, $f0
/* 32FF90 E001A160 00000000 */ nop
/* 32FF94 E001A164 46800020 */ cvt.s.w $f0, $f0
/* 32FF98 E001A168 0C080138 */ jal shim_rand_int
/* 32FF9C E001A16C E6000024 */ swc1 $f0, 0x24($s0)
/* 32FFA0 E001A170 24040001 */ addiu $a0, $zero, 0x1
/* 32FFA4 E001A174 44820000 */ mtc1 $v0, $f0
/* 32FFA8 E001A178 00000000 */ nop
/* 32FFAC E001A17C 46800020 */ cvt.s.w $f0, $f0
/* 32FFB0 E001A180 E6000028 */ swc1 $f0, 0x28($s0)
/* 32FFB4 E001A184 0C080138 */ jal shim_rand_int
/* 32FFB8 E001A188 AE00002C */ sw $zero, 0x2C($s0)
/* 32FFBC E001A18C 2404000A */ addiu $a0, $zero, 0xA
/* 32FFC0 E001A190 000210C0 */ sll $v0, $v0, 3
/* 32FFC4 E001A194 2442FFFC */ addiu $v0, $v0, -0x4
/* 32FFC8 E001A198 44820000 */ mtc1 $v0, $f0
/* 32FFCC E001A19C 00000000 */ nop
/* 32FFD0 E001A1A0 46800020 */ cvt.s.w $f0, $f0
/* 32FFD4 E001A1A4 E6000030 */ swc1 $f0, 0x30($s0)
/* 32FFD8 E001A1A8 AE120034 */ sw $s2, 0x34($s0)
/* 32FFDC E001A1AC 0C080138 */ jal shim_rand_int
/* 32FFE0 E001A1B0 AE000038 */ sw $zero, 0x38($s0)
/* 32FFE4 E001A1B4 24040014 */ addiu $a0, $zero, 0x14
/* 32FFE8 E001A1B8 0C080138 */ jal shim_rand_int
/* 32FFEC E001A1BC AE020044 */ sw $v0, 0x44($s0)
/* 32FFF0 E001A1C0 24040001 */ addiu $a0, $zero, 0x1
/* 32FFF4 E001A1C4 0C080138 */ jal shim_rand_int
/* 32FFF8 E001A1C8 AE020040 */ sw $v0, 0x40($s0)
/* 32FFFC E001A1CC 00021040 */ sll $v0, $v0, 1
/* 330000 E001A1D0 2442FFFF */ addiu $v0, $v0, -0x1
/* 330004 E001A1D4 AE02003C */ sw $v0, 0x3C($s0)
.LE001A1D8:
/* 330008 E001A1D8 3C03E002 */ lui $v1, %hi(D_E001A610)
/* 33000C E001A1DC 2463A610 */ addiu $v1, $v1, %lo(D_E001A610)
/* 330010 E001A1E0 8C620000 */ lw $v0, 0x0($v1)
/* 330014 E001A1E4 24420001 */ addiu $v0, $v0, 0x1
/* 330018 E001A1E8 AC620000 */ sw $v0, 0x0($v1)
/* 33001C E001A1EC 28420002 */ slti $v0, $v0, 0x2
/* 330020 E001A1F0 50400001 */ beql $v0, $zero, .LE001A1F8
/* 330024 E001A1F4 AC600000 */ sw $zero, 0x0($v1)
.LE001A1F8:
/* 330028 E001A1F8 8FBF0034 */ lw $ra, 0x34($sp)
/* 33002C E001A1FC 8FB20030 */ lw $s2, 0x30($sp)
/* 330030 E001A200 8FB1002C */ lw $s1, 0x2C($sp)
/* 330034 E001A204 8FB00028 */ lw $s0, 0x28($sp)
/* 330038 E001A208 D7B80048 */ ldc1 $f24, 0x48($sp)
/* 33003C E001A20C D7B60040 */ ldc1 $f22, 0x40($sp)
/* 330040 E001A210 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 330044 E001A214 03E00008 */ jr $ra
/* 330048 E001A218 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
void floating_flower_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration) {
EffectBlueprint bp;
EffectInstance* effect;
FloatingFlowerFXData* part;
s32 numParts = 1;
f32 phi_f6;
bp.unk_00 = 0;
bp.init = floating_flower_init;
bp.update = floating_flower_update;
bp.renderWorld = floating_flower_render;
bp.renderUI = NULL;
bp.effectID = EFFECT_FLOATING_FLOWER;
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = effect->data.floatingFlower = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.floatingFlower != NULL);
part->type = type;
part->pos.x = posX;
part->pos.y = posY + 10.0f;
part->pos.z = posZ;
part->vel.x = 0.0f;
part->vel.y = 0.0f;
part->vel.z = 0.0f;
if (type == 0) {
part->vel.z = 0;
part->rot.x = 0.0f;
part->rot.y = 0.0f;
part->accelY = 0.12f;
part->jerkY = -0.0152f;
part->angularVel.x = 3.0f;
if (D_E001A610 != 0) {
phi_f6 = -10.0f;
} else {
phi_f6 = 10.0f;
}
part->angularVel.y = phi_f6;
part->timeLeft = duration;
} else {
part->accelY = 0.12f;
part->jerkY = -0.0152f;
part->rot.x = (shim_rand_int(1) * 30) - 15;
part->rot.y = shim_rand_int(360);
part->angularVel.x = 0;
part->angularVel.y = (shim_rand_int(1) * 8) - 4;
part->timeLeft = duration;
part->lifetime = 0;
part->unk_44 = shim_rand_int(10);
part->unk_40 = shim_rand_int(20);
part->unk_3C = (shim_rand_int(1) * 2) - 1;
}
D_E001A610++;
if (D_E001A610 > 1) {
D_E001A610 = 0;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel title_screen_draw_logo
/* 12D94 80037994 27BDFFF8 */ addiu $sp, $sp, -0x8
/* 12D98 80037998 0000602D */ daddu $t4, $zero, $zero
/* 12D9C 8003799C 3C02800A */ lui $v0, %hi(gMainGfxPos)
/* 12DA0 800379A0 2442A66C */ addiu $v0, $v0, %lo(gMainGfxPos)
/* 12DA4 800379A4 0040402D */ daddu $t0, $v0, $zero
/* 12DA8 800379A8 3C19800A */ lui $t9, %hi(TitleScreen_ImgList_Logo)
/* 12DAC 800379AC 27390978 */ addiu $t9, $t9, %lo(TitleScreen_ImgList_Logo)
/* 12DB0 800379B0 3C0DF518 */ lui $t5, (0xF5186400 >> 16)
/* 12DB4 800379B4 35AD6400 */ ori $t5, $t5, (0xF5186400 & 0xFFFF)
/* 12DB8 800379B8 3C18E441 */ lui $t8, (0xE4410000 >> 16)
/* 12DBC 800379BC 3C0F000F */ lui $t7, (0xF0000 >> 16)
/* 12DC0 800379C0 0180582D */ daddu $t3, $t4, $zero
/* 12DC4 800379C4 0180502D */ daddu $t2, $t4, $zero
/* 12DC8 800379C8 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 12DCC 800379CC AFB00000 */ sw $s0, 0x0($sp)
/* 12DD0 800379D0 8D030000 */ lw $v1, 0x0($t0)
/* 12DD4 800379D4 3C01C2C8 */ lui $at, (0xC2C80000 >> 16)
/* 12DD8 800379D8 44810000 */ mtc1 $at, $f0
/* 12DDC 800379DC 0060202D */ daddu $a0, $v1, $zero
/* 12DE0 800379E0 24630008 */ addiu $v1, $v1, 0x8
/* 12DE4 800379E4 AD030000 */ sw $v1, 0x0($t0)
/* 12DE8 800379E8 AC820000 */ sw $v0, 0x0($a0)
/* 12DEC 800379EC 3C028007 */ lui $v0, %hi(D_80077A50)
/* 12DF0 800379F0 24427A50 */ addiu $v0, $v0, %lo(D_80077A50)
/* 12DF4 800379F4 AC820004 */ sw $v0, 0x4($a0)
/* 12DF8 800379F8 24620008 */ addiu $v0, $v1, 0x8
/* 12DFC 800379FC 46006302 */ mul.s $f12, $f12, $f0
/* 12E00 80037A00 00000000 */ nop
/* 12E04 80037A04 AD020000 */ sw $v0, 0x0($t0)
/* 12E08 80037A08 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 12E0C 80037A0C AC620000 */ sw $v0, 0x0($v1)
/* 12E10 80037A10 AC600004 */ sw $zero, 0x4($v1)
/* 12E14 80037A14 4600608D */ trunc.w.s $f2, $f12
/* 12E18 80037A18 440E1000 */ mfc1 $t6, $f2
/* 12E1C 80037A1C 00000000 */ nop
/* 12E20 80037A20 25C9000F */ addiu $t1, $t6, 0xF
.L80037A24:
/* 12E24 80037A24 3C04FD18 */ lui $a0, (0xFD1800C7 >> 16)
/* 12E28 80037A28 348400C7 */ ori $a0, $a0, (0xFD1800C7 & 0xFFFF)
/* 12E2C 80037A2C 3C050731 */ lui $a1, (0x731C004 >> 16)
/* 12E30 80037A30 34A5C004 */ ori $a1, $a1, (0x731C004 & 0xFFFF)
/* 12E34 80037A34 3C060031 */ lui $a2, (0x31C004 >> 16)
/* 12E38 80037A38 34C6C004 */ ori $a2, $a2, (0x31C004 & 0xFFFF)
/* 12E3C 80037A3C 8D070000 */ lw $a3, 0x0($t0)
/* 12E40 80037A40 8F220000 */ lw $v0, 0x0($t9)
/* 12E44 80037A44 00E0182D */ daddu $v1, $a3, $zero
/* 12E48 80037A48 24E70008 */ addiu $a3, $a3, 0x8
/* 12E4C 80037A4C 004A1021 */ addu $v0, $v0, $t2
/* 12E50 80037A50 AD070000 */ sw $a3, 0x0($t0)
/* 12E54 80037A54 AC620004 */ sw $v0, 0x4($v1)
/* 12E58 80037A58 24E20008 */ addiu $v0, $a3, 0x8
/* 12E5C 80037A5C AC640000 */ sw $a0, 0x0($v1)
/* 12E60 80037A60 AD020000 */ sw $v0, 0x0($t0)
/* 12E64 80037A64 3C020700 */ lui $v0, (0x7000000 >> 16)
/* 12E68 80037A68 ACE20004 */ sw $v0, 0x4($a3)
/* 12E6C 80037A6C 24E20010 */ addiu $v0, $a3, 0x10
/* 12E70 80037A70 ACED0000 */ sw $t5, 0x0($a3)
/* 12E74 80037A74 AD020000 */ sw $v0, 0x0($t0)
/* 12E78 80037A78 3C02E600 */ lui $v0, (0xE6000000 >> 16)
/* 12E7C 80037A7C ACE20008 */ sw $v0, 0x8($a3)
/* 12E80 80037A80 24E20018 */ addiu $v0, $a3, 0x18
/* 12E84 80037A84 ACE0000C */ sw $zero, 0xC($a3)
/* 12E88 80037A88 AD020000 */ sw $v0, 0x0($t0)
/* 12E8C 80037A8C 3C02F400 */ lui $v0, (0xF4000000 >> 16)
/* 12E90 80037A90 ACE20010 */ sw $v0, 0x10($a3)
/* 12E94 80037A94 24E20020 */ addiu $v0, $a3, 0x20
/* 12E98 80037A98 ACE50014 */ sw $a1, 0x14($a3)
/* 12E9C 80037A9C AD020000 */ sw $v0, 0x0($t0)
/* 12EA0 80037AA0 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 12EA4 80037AA4 ACE20018 */ sw $v0, 0x18($a3)
/* 12EA8 80037AA8 24E20028 */ addiu $v0, $a3, 0x28
/* 12EAC 80037AAC 24E30030 */ addiu $v1, $a3, 0x30
/* 12EB0 80037AB0 ACE0001C */ sw $zero, 0x1C($a3)
/* 12EB4 80037AB4 AD020000 */ sw $v0, 0x0($t0)
/* 12EB8 80037AB8 3C02F200 */ lui $v0, (0xF2000000 >> 16)
/* 12EBC 80037ABC ACED0020 */ sw $t5, 0x20($a3)
/* 12EC0 80037AC0 ACE00024 */ sw $zero, 0x24($a3)
/* 12EC4 80037AC4 AD030000 */ sw $v1, 0x0($t0)
/* 12EC8 80037AC8 ACE20028 */ sw $v0, 0x28($a3)
/* 12ECC 80037ACC 24E20038 */ addiu $v0, $a3, 0x38
/* 12ED0 80037AD0 ACE6002C */ sw $a2, 0x2C($a3)
/* 12ED4 80037AD4 AD020000 */ sw $v0, 0x0($t0)
/* 12ED8 80037AD8 25C20011 */ addiu $v0, $t6, 0x11
/* 12EDC 80037ADC 01621021 */ addu $v0, $t3, $v0
/* 12EE0 80037AE0 00021480 */ sll $v0, $v0, 18
/* 12EE4 80037AE4 00021403 */ sra $v0, $v0, 16
/* 12EE8 80037AE8 18400004 */ blez $v0, .L80037AFC
/* 12EEC 80037AEC 30420FFF */ andi $v0, $v0, 0xFFF
/* 12EF0 80037AF0 00581025 */ or $v0, $v0, $t8
/* 12EF4 80037AF4 0800DEC0 */ j .L80037B00
/* 12EF8 80037AF8 ACE20030 */ sw $v0, 0x30($a3)
.L80037AFC:
/* 12EFC 80037AFC ACF80030 */ sw $t8, 0x30($a3)
.L80037B00:
/* 12F00 80037B00 00091480 */ sll $v0, $t1, 18
/* 12F04 80037B04 00021403 */ sra $v0, $v0, 16
/* 12F08 80037B08 18400004 */ blez $v0, .L80037B1C
/* 12F0C 80037B0C 30420FFF */ andi $v0, $v0, 0xFFF
/* 12F10 80037B10 004F1025 */ or $v0, $v0, $t7
/* 12F14 80037B14 0800DEC8 */ j .L80037B20
/* 12F18 80037B18 AC620004 */ sw $v0, 0x4($v1)
.L80037B1C:
/* 12F1C 80037B1C AC6F0004 */ sw $t7, 0x4($v1)
.L80037B20:
/* 12F20 80037B20 8D030000 */ lw $v1, 0x0($t0)
/* 12F24 80037B24 24620008 */ addiu $v0, $v1, 0x8
/* 12F28 80037B28 AD020000 */ sw $v0, 0x0($t0)
/* 12F2C 80037B2C 3C02E100 */ lui $v0, (0xE1000000 >> 16)
/* 12F30 80037B30 AC620000 */ sw $v0, 0x0($v1)
/* 12F34 80037B34 00091080 */ sll $v0, $t1, 2
/* 12F38 80037B38 04430008 */ bgezl $v0, .L80037B5C
/* 12F3C 80037B3C AC600004 */ sw $zero, 0x4($v1)
/* 12F40 80037B40 00091480 */ sll $v0, $t1, 18
/* 12F44 80037B44 00021343 */ sra $v0, $v0, 13
/* 12F48 80037B48 5C400001 */ bgtzl $v0, .L80037B50
/* 12F4C 80037B4C 0000102D */ daddu $v0, $zero, $zero
.L80037B50:
/* 12F50 80037B50 00021023 */ negu $v0, $v0
/* 12F54 80037B54 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 12F58 80037B58 AC620004 */ sw $v0, 0x4($v1)
.L80037B5C:
/* 12F5C 80037B5C 3C040400 */ lui $a0, (0x4000400 >> 16)
/* 12F60 80037B60 34840400 */ ori $a0, $a0, (0x4000400 & 0xFFFF)
/* 12F64 80037B64 25290002 */ addiu $t1, $t1, 0x2
/* 12F68 80037B68 256B0002 */ addiu $t3, $t3, 0x2
/* 12F6C 80037B6C 254A0640 */ addiu $t2, $t2, 0x640
/* 12F70 80037B70 8D020000 */ lw $v0, 0x0($t0)
/* 12F74 80037B74 258C0001 */ addiu $t4, $t4, 0x1
/* 12F78 80037B78 0040182D */ daddu $v1, $v0, $zero
/* 12F7C 80037B7C 24420008 */ addiu $v0, $v0, 0x8
/* 12F80 80037B80 AD020000 */ sw $v0, 0x0($t0)
/* 12F84 80037B84 3C02F100 */ lui $v0, (0xF1000000 >> 16)
/* 12F88 80037B88 AC620000 */ sw $v0, 0x0($v1)
/* 12F8C 80037B8C 29820038 */ slti $v0, $t4, 0x38
/* 12F90 80037B90 1440FFA4 */ bnez $v0, .L80037A24
/* 12F94 80037B94 AC640004 */ sw $a0, 0x4($v1)
/* 12F98 80037B98 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 12F9C 80037B9C 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 12FA0 80037BA0 8C620000 */ lw $v0, 0x0($v1)
/* 12FA4 80037BA4 0040202D */ daddu $a0, $v0, $zero
/* 12FA8 80037BA8 24420008 */ addiu $v0, $v0, 0x8
/* 12FAC 80037BAC AC620000 */ sw $v0, 0x0($v1)
/* 12FB0 80037BB0 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 12FB4 80037BB4 AC820000 */ sw $v0, 0x0($a0)
/* 12FB8 80037BB8 AC800004 */ sw $zero, 0x4($a0)
/* 12FBC 80037BBC 8FB00000 */ lw $s0, 0x0($sp)
/* 12FC0 80037BC0 03E00008 */ jr $ra
/* 12FC4 80037BC4 27BD0008 */ addiu $sp, $sp, 0x8
### DECOMPILED C INSTRUCTIONS:
void title_screen_draw_logo(f32 arg0) {
s32 yOffset;
s32 i;
gSPDisplayList(gMainGfxPos++, D_80077A50);
gDPPipeSync(gMainGfxPos++);
yOffset = -100 * arg0;
for (i = 0; i < TITLE_NUM_TILES; i++) {
// Load a tile from the logo texture
gDPLoadTextureTile(gMainGfxPos++, &TitleScreen_ImgList_Logo[i * TITLE_TILE_PIXELS], G_IM_FMT_RGBA, G_IM_SIZ_32b,
TITLE_WIDTH, TITLE_TILE_HEIGHT, // width, height
0, 0, (TITLE_WIDTH - 1), (TITLE_TILE_HEIGHT - 1), // uls, ult, lrs, lrt
0, // pal
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, // cms, cmt
G_TX_NOMASK, G_TX_NOMASK, // masks, maskt
G_TX_NOLOD, G_TX_NOLOD); // shifts, shiftt
// Draw a scissored texture rectangle with the loaded tile
gSPScisTextureRectangle(gMainGfxPos++,
(TITLE_POS_LEFT) << 2, // ulx
(TITLE_POS_TOP + TITLE_TILE_HEIGHT * i + yOffset) << 2, // uly
(TITLE_POS_LEFT + TITLE_WIDTH) << 2, // lrx
(TITLE_POS_TOP + TITLE_TILE_HEIGHT + TITLE_TILE_HEIGHT * i + yOffset) << 2, // lry
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel footprint_main
/* 32F5F8 E0018078 27BDFF90 */ addiu $sp, $sp, -0x70
/* 32F5FC E001807C F7BC0060 */ sdc1 $f28, 0x60($sp)
/* 32F600 E0018080 4487E000 */ mtc1 $a3, $f28
/* 32F604 E0018084 27A40010 */ addiu $a0, $sp, 0x10
/* 32F608 E0018088 F7BE0068 */ sdc1 $f30, 0x68($sp)
/* 32F60C E001808C C7BE0080 */ lwc1 $f30, 0x80($sp)
/* 32F610 E0018090 3C02E002 */ lui $v0, %hi(footprint_init)
/* 32F614 E0018094 244282AC */ addiu $v0, $v0, %lo(footprint_init)
/* 32F618 E0018098 AFA20018 */ sw $v0, 0x18($sp)
/* 32F61C E001809C 3C02E002 */ lui $v0, %hi(footprint_update)
/* 32F620 E00180A0 244282B4 */ addiu $v0, $v0, %lo(footprint_update)
/* 32F624 E00180A4 AFA2001C */ sw $v0, 0x1C($sp)
/* 32F628 E00180A8 3C02E002 */ lui $v0, %hi(footprint_render)
/* 32F62C E00180AC 24428378 */ addiu $v0, $v0, %lo(footprint_render)
/* 32F630 E00180B0 AFA20020 */ sw $v0, 0x20($sp)
/* 32F634 E00180B4 2402000C */ addiu $v0, $zero, 0xC
/* 32F638 E00180B8 AFBF0038 */ sw $ra, 0x38($sp)
/* 32F63C E00180BC AFB30034 */ sw $s3, 0x34($sp)
/* 32F640 E00180C0 AFB20030 */ sw $s2, 0x30($sp)
/* 32F644 E00180C4 AFB1002C */ sw $s1, 0x2C($sp)
/* 32F648 E00180C8 AFB00028 */ sw $s0, 0x28($sp)
/* 32F64C E00180CC F7BA0058 */ sdc1 $f26, 0x58($sp)
/* 32F650 E00180D0 F7B80050 */ sdc1 $f24, 0x50($sp)
/* 32F654 E00180D4 F7B60048 */ sdc1 $f22, 0x48($sp)
/* 32F658 E00180D8 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 32F65C E00180DC E7AC0070 */ swc1 $f12, 0x70($sp)
/* 32F660 E00180E0 E7AE0074 */ swc1 $f14, 0x74($sp)
/* 32F664 E00180E4 AFA60078 */ sw $a2, 0x78($sp)
/* 32F668 E00180E8 AFA00010 */ sw $zero, 0x10($sp)
/* 32F66C E00180EC AFA00024 */ sw $zero, 0x24($sp)
/* 32F670 E00180F0 0C080124 */ jal shim_create_effect_instance
/* 32F674 E00180F4 AFA20014 */ sw $v0, 0x14($sp)
/* 32F678 E00180F8 24040098 */ addiu $a0, $zero, 0x98
/* 32F67C E00180FC 24130001 */ addiu $s3, $zero, 0x1
/* 32F680 E0018100 0040802D */ daddu $s0, $v0, $zero
/* 32F684 E0018104 0C08012C */ jal shim_general_heap_malloc
/* 32F688 E0018108 AE130008 */ sw $s3, 0x8($s0)
/* 32F68C E001810C 0040882D */ daddu $s1, $v0, $zero
/* 32F690 E0018110 16200003 */ bnez $s1, .LE0018120
/* 32F694 E0018114 AE11000C */ sw $s1, 0xC($s0)
.LE0018118:
/* 32F698 E0018118 08006046 */ j .LE0018118
/* 32F69C E001811C 00000000 */ nop
.LE0018120:
/* 32F6A0 E0018120 0220202D */ daddu $a0, $s1, $zero
/* 32F6A4 E0018124 00132880 */ sll $a1, $s3, 2
/* 32F6A8 E0018128 00B32821 */ addu $a1, $a1, $s3
/* 32F6AC E001812C 00052880 */ sll $a1, $a1, 2
/* 32F6B0 E0018130 00B32823 */ subu $a1, $a1, $s3
/* 32F6B4 E0018134 0C080130 */ jal shim_mem_clear
/* 32F6B8 E0018138 000528C0 */ sll $a1, $a1, 3
/* 32F6BC E001813C 0000902D */ daddu $s2, $zero, $zero
/* 32F6C0 E0018140 0253102A */ slt $v0, $s2, $s3
/* 32F6C4 E0018144 1040004C */ beqz $v0, .LE0018278
/* 32F6C8 E0018148 26300008 */ addiu $s0, $s1, 0x8
/* 32F6CC E001814C 3C0141F0 */ lui $at, (0x41F00000 >> 16)
/* 32F6D0 E0018150 44810000 */ mtc1 $at, $f0
/* 32F6D4 E0018154 00000000 */ nop
/* 32F6D8 E0018158 4600F002 */ mul.s $f0, $f30, $f0
/* 32F6DC E001815C 00000000 */ nop
/* 32F6E0 E0018160 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 32F6E4 E0018164 4481B000 */ mtc1 $at, $f22
/* 32F6E8 E0018168 4600E000 */ add.s $f0, $f28, $f0
/* 32F6EC E001816C 3C014170 */ lui $at, (0x41700000 >> 16)
/* 32F6F0 E0018170 44811000 */ mtc1 $at, $f2
/* 32F6F4 E0018174 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 32F6F8 E0018178 4481C000 */ mtc1 $at, $f24
/* 32F6FC E001817C 46020681 */ sub.s $f26, $f0, $f2
.LE0018180:
/* 32F700 E0018180 24020001 */ addiu $v0, $zero, 0x1
/* 32F704 E0018184 AE220000 */ sw $v0, 0x0($s1)
/* 32F708 E0018188 AE000074 */ sw $zero, 0x74($s0)
/* 32F70C E001818C C7A60070 */ lwc1 $f6, 0x70($sp)
/* 32F710 E0018190 E6060004 */ swc1 $f6, 0x4($s0)
/* 32F714 E0018194 C7A60074 */ lwc1 $f6, 0x74($sp)
/* 32F718 E0018198 4600E306 */ mov.s $f12, $f28
/* 32F71C E001819C E6060008 */ swc1 $f6, 0x8($s0)
/* 32F720 E00181A0 C7A60078 */ lwc1 $f6, 0x78($sp)
/* 32F724 E00181A4 240200FF */ addiu $v0, $zero, 0xFF
/* 32F728 E00181A8 A2020000 */ sb $v0, 0x0($s0)
/* 32F72C E00181AC 24020064 */ addiu $v0, $zero, 0x64
/* 32F730 E00181B0 E6160010 */ swc1 $f22, 0x10($s0)
/* 32F734 E00181B4 E6160014 */ swc1 $f22, 0x14($s0)
/* 32F738 E00181B8 E6160018 */ swc1 $f22, 0x18($s0)
/* 32F73C E00181BC AE000068 */ sw $zero, 0x68($s0)
/* 32F740 E00181C0 AE000078 */ sw $zero, 0x78($s0)
/* 32F744 E00181C4 AE00007C */ sw $zero, 0x7C($s0)
/* 32F748 E00181C8 A602FFFE */ sh $v0, -0x2($s0)
/* 32F74C E00181CC AE00001C */ sw $zero, 0x1C($s0)
/* 32F750 E00181D0 E61A0020 */ swc1 $f26, 0x20($s0)
/* 32F754 E00181D4 AE000024 */ sw $zero, 0x24($s0)
/* 32F758 E00181D8 0C08013C */ jal shim_clamp_angle
/* 32F75C E00181DC E606000C */ swc1 $f6, 0xC($s0)
/* 32F760 E00181E0 46000506 */ mov.s $f20, $f0
/* 32F764 E00181E4 0C080140 */ jal shim_sin_deg
/* 32F768 E00181E8 4600A306 */ mov.s $f12, $f20
/* 32F76C E00181EC 4600A306 */ mov.s $f12, $f20
/* 32F770 E00181F0 0C080144 */ jal shim_cos_deg
/* 32F774 E00181F4 E6000088 */ swc1 $f0, 0x88($s0)
/* 32F778 E00181F8 3C014334 */ lui $at, (0x43340000 >> 16)
/* 32F77C E00181FC 44812000 */ mtc1 $at, $f4
/* 32F780 E0018200 00000000 */ nop
/* 32F784 E0018204 4604F102 */ mul.s $f4, $f30, $f4
/* 32F788 E0018208 00000000 */ nop
/* 32F78C E001820C 3C014234 */ lui $at, (0x42340000 >> 16)
/* 32F790 E0018210 44811000 */ mtc1 $at, $f2
/* 32F794 E0018214 00000000 */ nop
/* 32F798 E0018218 4602A500 */ add.s $f20, $f20, $f2
/* 32F79C E001821C 4604A501 */ sub.s $f20, $f20, $f4
/* 32F7A0 E0018220 E600008C */ swc1 $f0, 0x8C($s0)
/* 32F7A4 E0018224 0C080140 */ jal shim_sin_deg
/* 32F7A8 E0018228 4600A306 */ mov.s $f12, $f20
/* 32F7AC E001822C 46180002 */ mul.s $f0, $f0, $f24
/* 32F7B0 E0018230 00000000 */ nop
/* 32F7B4 E0018234 C6020004 */ lwc1 $f2, 0x4($s0)
/* 32F7B8 E0018238 46001080 */ add.s $f2, $f2, $f0
/* 32F7BC E001823C 4600A306 */ mov.s $f12, $f20
/* 32F7C0 E0018240 0C080144 */ jal shim_cos_deg
/* 32F7C4 E0018244 E6020004 */ swc1 $f2, 0x4($s0)
/* 32F7C8 E0018248 46180002 */ mul.s $f0, $f0, $f24
/* 32F7CC E001824C 00000000 */ nop
/* 32F7D0 E0018250 26520001 */ addiu $s2, $s2, 0x1
/* 32F7D4 E0018254 26310098 */ addiu $s1, $s1, 0x98
/* 32F7D8 E0018258 C602000C */ lwc1 $f2, 0xC($s0)
/* 32F7DC E001825C 240200C8 */ addiu $v0, $zero, 0xC8
/* 32F7E0 E0018260 46001080 */ add.s $f2, $f2, $f0
/* 32F7E4 E0018264 A2020000 */ sb $v0, 0x0($s0)
/* 32F7E8 E0018268 0253102A */ slt $v0, $s2, $s3
/* 32F7EC E001826C E602000C */ swc1 $f2, 0xC($s0)
/* 32F7F0 E0018270 1440FFC3 */ bnez $v0, .LE0018180
/* 32F7F4 E0018274 26100098 */ addiu $s0, $s0, 0x98
.LE0018278:
/* 32F7F8 E0018278 8FBF0038 */ lw $ra, 0x38($sp)
/* 32F7FC E001827C 8FB30034 */ lw $s3, 0x34($sp)
/* 32F800 E0018280 8FB20030 */ lw $s2, 0x30($sp)
/* 32F804 E0018284 8FB1002C */ lw $s1, 0x2C($sp)
/* 32F808 E0018288 8FB00028 */ lw $s0, 0x28($sp)
/* 32F80C E001828C D7BE0068 */ ldc1 $f30, 0x68($sp)
/* 32F810 E0018290 D7BC0060 */ ldc1 $f28, 0x60($sp)
/* 32F814 E0018294 D7BA0058 */ ldc1 $f26, 0x58($sp)
/* 32F818 E0018298 D7B80050 */ ldc1 $f24, 0x50($sp)
/* 32F81C E001829C D7B60048 */ ldc1 $f22, 0x48($sp)
/* 32F820 E00182A0 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 32F824 E00182A4 03E00008 */ jr $ra
/* 32F828 E00182A8 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void footprint_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
EffectBlueprint bp;
EffectInstance* effect;
FootprintFXData* part;
s32 numParts = 1;
s32 i;
f32 temp_f20;
f32 temp_f20_2;
bp.unk_00 = 0;
bp.init = footprint_init;
bp.update = footprint_update;
bp.renderWorld = footprint_render;
bp.renderUI = NULL;
bp.effectID = EFFECT_FOOTPRINT;
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = shim_general_heap_malloc(numParts * sizeof(*part));
effect->data.footprint = part;
ASSERT(effect->data.footprint != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
for (i = 0; i < numParts; i++, part++) {
part->alive = TRUE;
part->unk_7C = 0;
part->unk_0C = arg0;
part->unk_10 = arg1;
part->unk_14 = arg2;
part->alpha = 255;
part->unk_18 = 1.0f;
part->unk_1C = 1.0f;
part->unk_20 = 1.0f;
part->unk_70 = 0;
part->unk_80 = 0;
part->unk_84 = 0;
part->lifetime = 100;
part->unk_24 = 0.0f;
part->unk_28 = (arg3 + (arg4 * 30.0f)) - 15.0f;
part->unk_2C = 0.0f;
temp_f20 = shim_clamp_angle(arg3);
part->unk_90 = shim_sin_deg(temp_f20);
part->unk_94 = shim_cos_deg(temp_f20);
temp_f20_2 = (temp_f20 + 45.0f) - (arg4 * 180.0f);
part->unk_0C += shim_sin_deg(temp_f20_2) * 5.0f;
part->unk_14 += shim_cos_deg(temp_f20_2) * 5.0f;
part->alpha = 200;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel osMotorInit
/* 43344 80067F44 27BDFF88 */ addiu $sp, $sp, -0x78
/* 43348 80067F48 AFB00060 */ sw $s0, 0x60($sp)
/* 4334C 80067F4C 00808021 */ addu $s0, $a0, $zero
/* 43350 80067F50 AFB20068 */ sw $s2, 0x68($sp)
/* 43354 80067F54 00A09021 */ addu $s2, $a1, $zero
/* 43358 80067F58 AFB10064 */ sw $s1, 0x64($sp)
/* 4335C 80067F5C 00C08821 */ addu $s1, $a2, $zero
/* 43360 80067F60 02402021 */ addu $a0, $s2, $zero
/* 43364 80067F64 240500FE */ addiu $a1, $zero, 0xFE
/* 43368 80067F68 240200FF */ addiu $v0, $zero, 0xFF
/* 4336C 80067F6C AFBF0070 */ sw $ra, 0x70($sp)
/* 43370 80067F70 AFB3006C */ sw $s3, 0x6C($sp)
/* 43374 80067F74 AE500004 */ sw $s0, 0x4($s2)
/* 43378 80067F78 AE510008 */ sw $s1, 0x8($s2)
/* 4337C 80067F7C A2420065 */ sb $v0, 0x65($s2)
/* 43380 80067F80 0C01A5B4 */ jal __osPfsSelectBank
/* 43384 80067F84 AE400000 */ sw $zero, 0x0($s2)
/* 43388 80067F88 24130002 */ addiu $s3, $zero, 0x2
/* 4338C 80067F8C 14530003 */ bne $v0, $s3, .L80067F9C
/* 43390 80067F90 02402021 */ addu $a0, $s2, $zero
/* 43394 80067F94 0C01A5B4 */ jal __osPfsSelectBank
/* 43398 80067F98 24050080 */ addiu $a1, $zero, 0x80
.L80067F9C:
/* 4339C 80067F9C 14400074 */ bnez $v0, .L80068170
/* 433A0 80067FA0 02002021 */ addu $a0, $s0, $zero
/* 433A4 80067FA4 02202821 */ addu $a1, $s1, $zero
/* 433A8 80067FA8 24060400 */ addiu $a2, $zero, 0x400
/* 433AC 80067FAC 0C01A874 */ jal __osContRamRead
/* 433B0 80067FB0 27A70010 */ addiu $a3, $sp, 0x10
/* 433B4 80067FB4 50530001 */ beql $v0, $s3, .L80067FBC
/* 433B8 80067FB8 24020004 */ addiu $v0, $zero, 0x4
.L80067FBC:
/* 433BC 80067FBC 1440006C */ bnez $v0, .L80068170
/* 433C0 80067FC0 00000000 */ nop
/* 433C4 80067FC4 93A3002F */ lbu $v1, 0x2F($sp)
/* 433C8 80067FC8 240200FE */ addiu $v0, $zero, 0xFE
/* 433CC 80067FCC 10620013 */ beq $v1, $v0, .L8006801C
/* 433D0 80067FD0 02402021 */ addu $a0, $s2, $zero
/* 433D4 80067FD4 0C01A5B4 */ jal __osPfsSelectBank
/* 433D8 80067FD8 24050080 */ addiu $a1, $zero, 0x80
/* 433DC 80067FDC 50530001 */ beql $v0, $s3, .L80067FE4
/* 433E0 80067FE0 24020004 */ addiu $v0, $zero, 0x4
.L80067FE4:
/* 433E4 80067FE4 14400062 */ bnez $v0, .L80068170
/* 433E8 80067FE8 02002021 */ addu $a0, $s0, $zero
/* 433EC 80067FEC 02202821 */ addu $a1, $s1, $zero
/* 433F0 80067FF0 24060400 */ addiu $a2, $zero, 0x400
/* 433F4 80067FF4 0C01A874 */ jal __osContRamRead
/* 433F8 80067FF8 27A70010 */ addiu $a3, $sp, 0x10
/* 433FC 80067FFC 50530001 */ beql $v0, $s3, .L80068004
/* 43400 80068000 24020004 */ addiu $v0, $zero, 0x4
.L80068004:
/* 43404 80068004 1440005A */ bnez $v0, .L80068170
/* 43408 80068008 00000000 */ nop
/* 4340C 8006800C 93A3002F */ lbu $v1, 0x2F($sp)
/* 43410 80068010 24020080 */ addiu $v0, $zero, 0x80
/* 43414 80068014 10620003 */ beq $v1, $v0, .L80068024
/* 43418 80068018 00000000 */ nop
.L8006801C:
/* 4341C 8006801C 0801A05C */ j .L80068170
/* 43420 80068020 2402000B */ addiu $v0, $zero, 0xB
.L80068024:
/* 43424 80068024 8E420000 */ lw $v0, 0x0($s2)
/* 43428 80068028 30420008 */ andi $v0, $v0, 0x8
/* 4342C 8006802C 1440004E */ bnez $v0, .L80068168
/* 43430 80068030 24020008 */ addiu $v0, $zero, 0x8
/* 43434 80068034 00111980 */ sll $v1, $s1, 6
/* 43438 80068038 3C02800B */ lui $v0, %hi(__MotorDataBuf)
/* 4343C 8006803C 24420B30 */ addiu $v0, $v0, %lo(__MotorDataBuf)
/* 43440 80068040 00628021 */ addu $s0, $v1, $v0
/* 43444 80068044 24040600 */ addiu $a0, $zero, 0x600
/* 43448 80068048 240200FF */ addiu $v0, $zero, 0xFF
/* 4344C 8006804C A3A20030 */ sb $v0, 0x30($sp)
/* 43450 80068050 24020023 */ addiu $v0, $zero, 0x23
/* 43454 80068054 A3A20031 */ sb $v0, 0x31($sp)
/* 43458 80068058 24020001 */ addiu $v0, $zero, 0x1
/* 4345C 8006805C A3A20032 */ sb $v0, 0x32($sp)
/* 43460 80068060 24020003 */ addiu $v0, $zero, 0x3
/* 43464 80068064 A3A20033 */ sb $v0, 0x33($sp)
/* 43468 80068068 240200C0 */ addiu $v0, $zero, 0xC0
/* 4346C 8006806C 0C01B218 */ jal __osContAddressCrc
/* 43470 80068070 A3A20034 */ sb $v0, 0x34($sp)
/* 43474 80068074 12200008 */ beqz $s1, .L80068098
/* 43478 80068078 A3A20035 */ sb $v0, 0x35($sp)
/* 4347C 8006807C 1A200006 */ blez $s1, .L80068098
/* 43480 80068080 00001821 */ addu $v1, $zero, $zero
.L80068084:
/* 43484 80068084 A2000000 */ sb $zero, 0x0($s0)
/* 43488 80068088 24630001 */ addiu $v1, $v1, 0x1
/* 4348C 8006808C 0071102A */ slt $v0, $v1, $s1
/* 43490 80068090 1440FFFC */ bnez $v0, .L80068084
/* 43494 80068094 26100001 */ addiu $s0, $s0, 0x1
.L80068098:
/* 43498 80068098 27A60030 */ addiu $a2, $sp, 0x30
/* 4349C 8006809C 00D01025 */ or $v0, $a2, $s0
/* 434A0 800680A0 30420003 */ andi $v0, $v0, 0x3
/* 434A4 800680A4 10400017 */ beqz $v0, .L80068104
/* 434A8 800680A8 02003821 */ addu $a3, $s0, $zero
/* 434AC 800680AC 27A80050 */ addiu $t0, $sp, 0x50
.L800680B0:
/* 434B0 800680B0 88C20000 */ lwl $v0, 0x0($a2)
/* 434B4 800680B4 98C20003 */ lwr $v0, 0x3($a2)
/* 434B8 800680B8 88C30004 */ lwl $v1, 0x4($a2)
/* 434BC 800680BC 98C30007 */ lwr $v1, 0x7($a2)
/* 434C0 800680C0 88C40008 */ lwl $a0, 0x8($a2)
/* 434C4 800680C4 98C4000B */ lwr $a0, 0xB($a2)
/* 434C8 800680C8 88C5000C */ lwl $a1, 0xC($a2)
/* 434CC 800680CC 98C5000F */ lwr $a1, 0xF($a2)
/* 434D0 800680D0 A8E20000 */ swl $v0, 0x0($a3)
/* 434D4 800680D4 B8E20003 */ swr $v0, 0x3($a3)
/* 434D8 800680D8 A8E30004 */ swl $v1, 0x4($a3)
/* 434DC 800680DC B8E30007 */ swr $v1, 0x7($a3)
/* 434E0 800680E0 A8E40008 */ swl $a0, 0x8($a3)
/* 434E4 800680E4 B8E4000B */ swr $a0, 0xB($a3)
/* 434E8 800680E8 A8E5000C */ swl $a1, 0xC($a3)
/* 434EC 800680EC B8E5000F */ swr $a1, 0xF($a3)
/* 434F0 800680F0 24C60010 */ addiu $a2, $a2, 0x10
/* 434F4 800680F4 14C8FFEE */ bne $a2, $t0, .L800680B0
/* 434F8 800680F8 24E70010 */ addiu $a3, $a3, 0x10
/* 434FC 800680FC 0801A04D */ j .L80068134
/* 43500 80068100 00000000 */ nop
.L80068104:
/* 43504 80068104 27A80050 */ addiu $t0, $sp, 0x50
.L80068108:
/* 43508 80068108 8CC20000 */ lw $v0, 0x0($a2)
/* 4350C 8006810C 8CC30004 */ lw $v1, 0x4($a2)
/* 43510 80068110 8CC40008 */ lw $a0, 0x8($a2)
/* 43514 80068114 8CC5000C */ lw $a1, 0xC($a2)
/* 43518 80068118 ACE20000 */ sw $v0, 0x0($a3)
/* 4351C 8006811C ACE30004 */ sw $v1, 0x4($a3)
/* 43520 80068120 ACE40008 */ sw $a0, 0x8($a3)
/* 43524 80068124 ACE5000C */ sw $a1, 0xC($a3)
/* 43528 80068128 24C60010 */ addiu $a2, $a2, 0x10
/* 4352C 8006812C 14C8FFF6 */ bne $a2, $t0, .L80068108
/* 43530 80068130 24E70010 */ addiu $a3, $a3, 0x10
.L80068134:
/* 43534 80068134 88C20000 */ lwl $v0, 0x0($a2)
/* 43538 80068138 98C20003 */ lwr $v0, 0x3($a2)
/* 4353C 8006813C 80C30004 */ lb $v1, 0x4($a2)
/* 43540 80068140 80C40005 */ lb $a0, 0x5($a2)
/* 43544 80068144 80C50006 */ lb $a1, 0x6($a2)
/* 43548 80068148 A8E20000 */ swl $v0, 0x0($a3)
/* 4354C 8006814C B8E20003 */ swr $v0, 0x3($a3)
/* 43550 80068150 A0E30004 */ sb $v1, 0x4($a3)
/* 43554 80068154 A0E40005 */ sb $a0, 0x5($a3)
/* 43558 80068158 A0E50006 */ sb $a1, 0x6($a3)
/* 4355C 8006815C 240200FE */ addiu $v0, $zero, 0xFE
/* 43560 80068160 A2020027 */ sb $v0, 0x27($s0)
/* 43564 80068164 24020008 */ addiu $v0, $zero, 0x8
.L80068168:
/* 43568 80068168 AE420000 */ sw $v0, 0x0($s2)
/* 4356C 8006816C 00001021 */ addu $v0, $zero, $zero
.L80068170:
/* 43570 80068170 8FBF0070 */ lw $ra, 0x70($sp)
/* 43574 80068174 8FB3006C */ lw $s3, 0x6C($sp)
/* 43578 80068178 8FB20068 */ lw $s2, 0x68($sp)
/* 4357C 8006817C 8FB10064 */ lw $s1, 0x64($sp)
/* 43580 80068180 8FB00060 */ lw $s0, 0x60($sp)
/* 43584 80068184 03E00008 */ jr $ra
/* 43588 80068188 27BD0078 */ addiu $sp, $sp, 0x78
/* 4358C 8006818C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
s32 osMotorInit(OSMesgQueue *mq, OSPfs *pfs, int channel) {
s32 ret;
u8 temp[32];
pfs->queue = mq;
pfs->channel = channel;
pfs->activebank = 0xFF;
pfs->status = 0;
ret = __osPfsSelectBank(pfs, 0xFE);
if (ret == PFS_ERR_NEW_PACK) {
ret = __osPfsSelectBank(pfs, 0x80);
}
if (ret != 0) {
return ret;
}
ret = __osContRamRead(mq, channel, CONT_BLOCK_DETECT, temp);
if (ret == PFS_ERR_NEW_PACK) {
ret = PFS_ERR_CONTRFAIL;
}
if (ret != 0) {
return ret;
}
if (temp[31] == 254) {
return PFS_ERR_DEVICE;
}
ret = __osPfsSelectBank(pfs, 0x80);
if (ret == PFS_ERR_NEW_PACK) {
ret = PFS_ERR_CONTRFAIL;
}
if (ret != 0) {
return ret;
}
ret = __osContRamRead(mq, channel, CONT_BLOCK_DETECT, temp);
if (ret == PFS_ERR_NEW_PACK) {
ret = PFS_ERR_CONTRFAIL;
}
if (ret != 0) {
return ret;
}
if (temp[31] != 0x80) {
return PFS_ERR_DEVICE;
}
if (!(pfs->status & PFS_MOTOR_INITIALIZED)) {
_MakeMotorData(channel, &__MotorDataBuf[channel]);
}
pfs->status = PFS_MOTOR_INITIALIZED;
return 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel clear_player_data
/* 80850 800E73A0 0000182D */ daddu $v1, $zero, $zero
/* 80854 800E73A4 3C048011 */ lui $a0, %hi(gPlayerData)
/* 80858 800E73A8 2484F290 */ addiu $a0, $a0, %lo(gPlayerData)
/* 8085C 800E73AC 0080282D */ daddu $a1, $a0, $zero
/* 80860 800E73B0 2402FFFF */ addiu $v0, $zero, -0x1
/* 80864 800E73B4 3C018011 */ lui $at, %hi(D_8010CD10)
/* 80868 800E73B8 A420CD10 */ sh $zero, %lo(D_8010CD10)($at)
/* 8086C 800E73BC 3C018011 */ lui $at, %hi(D_8010CD12)
/* 80870 800E73C0 A420CD12 */ sh $zero, %lo(D_8010CD12)($at)
/* 80874 800E73C4 A0820001 */ sb $v0, 0x1($a0)
/* 80878 800E73C8 2402000A */ addiu $v0, $zero, 0xA
/* 8087C 800E73CC A0820002 */ sb $v0, 0x2($a0)
/* 80880 800E73D0 A0820003 */ sb $v0, 0x3($a0)
/* 80884 800E73D4 A0820004 */ sb $v0, 0x4($a0)
/* 80888 800E73D8 24020005 */ addiu $v0, $zero, 0x5
/* 8088C 800E73DC A0820005 */ sb $v0, 0x5($a0)
/* 80890 800E73E0 A0820006 */ sb $v0, 0x6($a0)
/* 80894 800E73E4 A0820007 */ sb $v0, 0x7($a0)
/* 80898 800E73E8 24020003 */ addiu $v0, $zero, 0x3
/* 8089C 800E73EC A0820008 */ sb $v0, 0x8($a0)
/* 808A0 800E73F0 24020001 */ addiu $v0, $zero, 0x1
/* 808A4 800E73F4 A0820009 */ sb $v0, 0x9($a0)
/* 808A8 800E73F8 2402FFFF */ addiu $v0, $zero, -0x1
/* 808AC 800E73FC A0800000 */ sb $zero, 0x0($a0)
/* 808B0 800E7400 A080000A */ sb $zero, 0xA($a0)
/* 808B4 800E7404 A480000C */ sh $zero, 0xC($a0)
/* 808B8 800E7408 A080000E */ sb $zero, 0xE($a0)
/* 808BC 800E740C A080000F */ sb $zero, 0xF($a0)
/* 808C0 800E7410 A0800010 */ sb $zero, 0x10($a0)
/* 808C4 800E7414 A0800011 */ sb $zero, 0x11($a0)
/* 808C8 800E7418 A0800288 */ sb $zero, 0x288($a0)
/* 808CC 800E741C A0800289 */ sb $zero, 0x289($a0)
/* 808D0 800E7420 A080028A */ sb $zero, 0x28A($a0)
/* 808D4 800E7424 A482028C */ sh $v0, 0x28C($a0)
/* 808D8 800E7428 A080028E */ sb $zero, 0x28E($a0)
/* 808DC 800E742C A4800290 */ sh $zero, 0x290($a0)
/* 808E0 800E7430 A0800292 */ sb $zero, 0x292($a0)
/* 808E4 800E7434 A0800012 */ sb $zero, 0x12($a0)
.L800E7438:
/* 808E8 800E7438 A0A00014 */ sb $zero, 0x14($a1)
/* 808EC 800E743C A0A00015 */ sb $zero, 0x15($a1)
/* 808F0 800E7440 A4A00016 */ sh $zero, 0x16($a1)
/* 808F4 800E7444 A4A00018 */ sh $zero, 0x18($a1)
/* 808F8 800E7448 A4A0001A */ sh $zero, 0x1A($a1)
/* 808FC 800E744C 24630001 */ addiu $v1, $v1, 0x1
/* 80900 800E7450 2862000C */ slti $v0, $v1, 0xC
/* 80904 800E7454 1440FFF8 */ bnez $v0, .L800E7438
/* 80908 800E7458 24A50008 */ addiu $a1, $a1, 0x8
/* 8090C 800E745C 2403001F */ addiu $v1, $zero, 0x1F
/* 80910 800E7460 2482003E */ addiu $v0, $a0, 0x3E
.L800E7464:
/* 80914 800E7464 A4400074 */ sh $zero, 0x74($v0)
/* 80918 800E7468 2463FFFF */ addiu $v1, $v1, -0x1
/* 8091C 800E746C 0461FFFD */ bgez $v1, .L800E7464
/* 80920 800E7470 2442FFFE */ addiu $v0, $v0, -0x2
/* 80924 800E7474 2403007F */ addiu $v1, $zero, 0x7F
/* 80928 800E7478 248200FE */ addiu $v0, $a0, 0xFE
.L800E747C:
/* 8092C 800E747C A44000B4 */ sh $zero, 0xB4($v0)
/* 80930 800E7480 2463FFFF */ addiu $v1, $v1, -0x1
/* 80934 800E7484 0461FFFD */ bgez $v1, .L800E747C
/* 80938 800E7488 2442FFFE */ addiu $v0, $v0, -0x2
/* 8093C 800E748C 24030009 */ addiu $v1, $zero, 0x9
/* 80940 800E7490 24820012 */ addiu $v0, $a0, 0x12
.L800E7494:
/* 80944 800E7494 A44001B4 */ sh $zero, 0x1B4($v0)
/* 80948 800E7498 2463FFFF */ addiu $v1, $v1, -0x1
/* 8094C 800E749C 0461FFFD */ bgez $v1, .L800E7494
/* 80950 800E74A0 2442FFFE */ addiu $v0, $v0, -0x2
/* 80954 800E74A4 2403003F */ addiu $v1, $zero, 0x3F
/* 80958 800E74A8 2482007E */ addiu $v0, $a0, 0x7E
.L800E74AC:
/* 8095C 800E74AC A4400208 */ sh $zero, 0x208($v0)
/* 80960 800E74B0 2463FFFF */ addiu $v1, $v1, -0x1
/* 80964 800E74B4 0461FFFD */ bgez $v1, .L800E74AC
/* 80968 800E74B8 2442FFFE */ addiu $v0, $v0, -0x2
/* 8096C 800E74BC 2403001F */ addiu $v1, $zero, 0x1F
/* 80970 800E74C0 2482003E */ addiu $v0, $a0, 0x3E
.L800E74C4:
/* 80974 800E74C4 A44001C8 */ sh $zero, 0x1C8($v0)
/* 80978 800E74C8 2463FFFF */ addiu $v1, $v1, -0x1
/* 8097C 800E74CC 0461FFFD */ bgez $v1, .L800E74C4
/* 80980 800E74D0 2442FFFE */ addiu $v0, $v0, -0x2
/* 80984 800E74D4 0000182D */ daddu $v1, $zero, $zero
/* 80988 800E74D8 0080282D */ daddu $a1, $a0, $zero
/* 8098C 800E74DC A4800294 */ sh $zero, 0x294($a0)
/* 80990 800E74E0 A4800296 */ sh $zero, 0x296($a0)
/* 80994 800E74E4 A4800298 */ sh $zero, 0x298($a0)
/* 80998 800E74E8 A480029A */ sh $zero, 0x29A($a0)
/* 8099C 800E74EC A480029C */ sh $zero, 0x29C($a0)
/* 809A0 800E74F0 A480029E */ sh $zero, 0x29E($a0)
/* 809A4 800E74F4 A48002A0 */ sh $zero, 0x2A0($a0)
/* 809A8 800E74F8 A48002A2 */ sh $zero, 0x2A2($a0)
/* 809AC 800E74FC A48002A4 */ sh $zero, 0x2A4($a0)
/* 809B0 800E7500 A48002A6 */ sh $zero, 0x2A6($a0)
/* 809B4 800E7504 A48002A8 */ sh $zero, 0x2A8($a0)
/* 809B8 800E7508 A48002AA */ sh $zero, 0x2AA($a0)
/* 809BC 800E750C AC8002AC */ sw $zero, 0x2AC($a0)
/* 809C0 800E7510 AC8002B0 */ sw $zero, 0x2B0($a0)
/* 809C4 800E7514 A48002B8 */ sh $zero, 0x2B8($a0)
/* 809C8 800E7518 AC8002B4 */ sw $zero, 0x2B4($a0)
/* 809CC 800E751C AC8002BC */ sw $zero, 0x2BC($a0)
/* 809D0 800E7520 A48002C0 */ sh $zero, 0x2C0($a0)
/* 809D4 800E7524 A48002C2 */ sh $zero, 0x2C2($a0)
.L800E7528:
/* 809D8 800E7528 ACA002C4 */ sw $zero, 0x2C4($a1)
/* 809DC 800E752C ACA002F4 */ sw $zero, 0x2F4($a1)
/* 809E0 800E7530 24630001 */ addiu $v1, $v1, 0x1
/* 809E4 800E7534 2862000C */ slti $v0, $v1, 0xC
/* 809E8 800E7538 1440FFFB */ bnez $v0, .L800E7528
/* 809EC 800E753C 24A50004 */ addiu $a1, $a1, 0x4
/* 809F0 800E7540 AC800328 */ sw $zero, 0x328($a0)
/* 809F4 800E7544 A480032C */ sh $zero, 0x32C($a0)
/* 809F8 800E7548 A480032E */ sh $zero, 0x32E($a0)
/* 809FC 800E754C AC800330 */ sw $zero, 0x330($a0)
/* 80A00 800E7550 A4800334 */ sh $zero, 0x334($a0)
/* 80A04 800E7554 A4800336 */ sh $zero, 0x336($a0)
/* 80A08 800E7558 AC800338 */ sw $zero, 0x338($a0)
/* 80A0C 800E755C 03E00008 */ jr $ra
/* 80A10 800E7560 A480033C */ sh $zero, 0x33C($a0)
### DECOMPILED C INSTRUCTIONS:
void clear_player_data(void) {
PlayerData* playerData = &gPlayerData;
s32 i;
D_8010CD10 = 0;
D_8010CD12 = 0;
playerData->hammerLevel = -1;
playerData->curHP = 10;
playerData->curMaxHP = 10;
playerData->hardMaxHP = 10;
playerData->curFP = 5;
playerData->curMaxFP = 5;
playerData->hardMaxFP = 5;
playerData->maxBP = 3;
playerData->level = 1;
playerData->bootsLevel = 0;
playerData->hasActionCommands = FALSE;
playerData->coins = 0;
playerData->fortressKeyCount = 0;
playerData->starPieces = 0;
playerData->starPoints = 0;
playerData->unk_11 = 0;
playerData->unk_288 = 0;
playerData->merleeSpellType = MERLEE_SPELL_0;
playerData->merleeCastsLeft = 0;
playerData->merleeTurnCount = -1;
playerData->maxStarPower = 0;
playerData->specialBarsFilled = 0;
playerData->starBeamLevel = 0;
playerData->currentPartner = 0;
for (i = 0; i < ARRAY_COUNT(playerData->partners); i++) {
playerData->partners[i].enabled = FALSE;
playerData->partners[i].level = 0;
playerData->partners[i].unk_02[0] = 0;
playerData->partners[i].unk_02[1] = 0;
playerData->partners[i].unk_02[2] = 0;
}
for (i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
playerData->keyItems[i] = ITEM_NONE;
}
for (i = 0; i < ARRAY_COUNT(playerData->badges); i++) {
playerData->badges[i] = ITEM_NONE;
}
for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
playerData->invItems[i] = ITEM_NONE;
}
for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
playerData->equippedBadges[i] = ITEM_NONE;
}
for (i = 0; i < ARRAY_COUNT(playerData->storedItems); i++) {
playerData->storedItems[i] = ITEM_NONE;
}
playerData->actionCommandAttempts = 0;
playerData->actionCommandSuccesses = 0;
playerData->hitsTaken = 0;
playerData->hitsBlocked = 0;
playerData->playerFirstStrikes = 0;
playerData->enemyFirstStrikes = 0;
playerData->powerBounces = 0;
playerData->battlesCount = 0;
playerData->battlesWon = 0;
playerData->unk_2A6 = 0;
playerData->battlesFled = 0;
playerData->trainingsDone = 0;
playerData->walkingStepsTaken = 0;
playerData->runningStepsTaken = 0;
playerData->idleFrameCounter = 0;
playerData->totalCoinsEarned = 0;
playerData->frameCounter = 0;
playerData->quizzesAnswered = 0;
playerData->quizzesCorrect = 0;
for (i = 0; i < ARRAY_COUNT(playerData->partnerUnlockedTime); i++) {
playerData->partnerUnlockedTime[i] = 0;
playerData->partnerUsedTime[i] = 0;
}
playerData->droTreeHintTime = 0;
playerData->starPiecesCollected = 0;
playerData->jumpGamePlays = 0;
playerData->jumpGameTotal = 0;
playerData->jumpGameRecord = 0;
playerData->smashGamePlays = 0;
playerData->smashGameTotal = 0;
playerData->smashGameRecord = 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel state_init_intro
/* 11A50 80036650 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 11A54 80036654 AFB10014 */ sw $s1, 0x14($sp)
/* 11A58 80036658 3C118007 */ lui $s1, %hi(gGameStatusPtr)
/* 11A5C 8003665C 2631419C */ addiu $s1, $s1, %lo(gGameStatusPtr)
/* 11A60 80036660 AFBF0018 */ sw $ra, 0x18($sp)
/* 11A64 80036664 AFB00010 */ sw $s0, 0x10($sp)
/* 11A68 80036668 8E220000 */ lw $v0, 0x0($s1)
/* 11A6C 8003666C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 11A70 80036670 44816000 */ mtc1 $at, $f12
/* 11A74 80036674 0C00AFB7 */ jal set_curtain_scale_goal
/* 11A78 80036678 A04000AC */ sb $zero, 0xAC($v0)
/* 11A7C 8003667C 3C013E99 */ lui $at, (0x3E99999A >> 16)
/* 11A80 80036680 3421999A */ ori $at, $at, (0x3E99999A & 0xFFFF)
/* 11A84 80036684 44816000 */ mtc1 $at, $f12
/* 11A88 80036688 0C00AFC5 */ jal set_curtain_fade_goal
/* 11A8C 8003668C 00000000 */ nop
/* 11A90 80036690 8E220000 */ lw $v0, 0x0($s1)
/* 11A94 80036694 805000A8 */ lb $s0, 0xA8($v0)
/* 11A98 80036698 12000005 */ beqz $s0, .L800366B0
/* 11A9C 8003669C 24020001 */ addiu $v0, $zero, 0x1
/* 11AA0 800366A0 12020020 */ beq $s0, $v0, .L80036724
/* 11AA4 800366A4 00000000 */ nop
/* 11AA8 800366A8 0800D9E3 */ j .L8003678C
/* 11AAC 800366AC 00000000 */ nop
.L800366B0:
/* 11AB0 800366B0 0C00CDF4 */ jal intro_logos_set_fade_alpha
/* 11AB4 800366B4 0000202D */ daddu $a0, $zero, $zero
/* 11AB8 800366B8 240200FF */ addiu $v0, $zero, 0xFF
/* 11ABC 800366BC 3C01800A */ lui $at, %hi(D_800A0954)
/* 11AC0 800366C0 A4220954 */ sh $v0, %lo(D_800A0954)($at)
/* 11AC4 800366C4 24020010 */ addiu $v0, $zero, 0x10
/* 11AC8 800366C8 3C01800A */ lui $at, %hi(D_800A0956)
/* 11ACC 800366CC A4220956 */ sh $v0, %lo(D_800A0956)($at)
/* 11AD0 800366D0 24020004 */ addiu $v0, $zero, 0x4
/* 11AD4 800366D4 3C01800A */ lui $at, %hi(D_800A0958)
/* 11AD8 800366D8 A4220958 */ sh $v0, %lo(D_800A0958)($at)
/* 11ADC 800366DC 240200D0 */ addiu $v0, $zero, 0xD0
/* 11AE0 800366E0 3C01800A */ lui $at, %hi(D_800A0960)
/* 11AE4 800366E4 AC200960 */ sw $zero, %lo(D_800A0960)($at)
/* 11AE8 800366E8 3C01800A */ lui $at, %hi(D_800A095A)
/* 11AEC 800366EC A422095A */ sh $v0, %lo(D_800A095A)($at)
/* 11AF0 800366F0 3C01800A */ lui $at, %hi(D_800A095C)
/* 11AF4 800366F4 A422095C */ sh $v0, %lo(D_800A095C)($at)
/* 11AF8 800366F8 3C01800A */ lui $at, %hi(D_800A095E)
/* 11AFC 800366FC A422095E */ sh $v0, %lo(D_800A095E)($at)
/* 11B00 80036700 3C01800A */ lui $at, %hi(D_800A0964)
/* 11B04 80036704 AC200964 */ sw $zero, %lo(D_800A0964)($at)
/* 11B08 80036708 8E230000 */ lw $v1, 0x0($s1)
/* 11B0C 8003670C 24020005 */ addiu $v0, $zero, 0x5
/* 11B10 80036710 A4620086 */ sh $v0, 0x86($v1)
/* 11B14 80036714 A462008C */ sh $v0, 0x8C($v1)
/* 11B18 80036718 24020003 */ addiu $v0, $zero, 0x3
/* 11B1C 8003671C 0800D9FC */ j .L800367F0
/* 11B20 80036720 A462008E */ sh $v0, 0x8E($v1)
.L80036724:
/* 11B24 80036724 0C00CDF4 */ jal intro_logos_set_fade_alpha
/* 11B28 80036728 0000202D */ daddu $a0, $zero, $zero
/* 11B2C 8003672C 2402000C */ addiu $v0, $zero, 0xC
/* 11B30 80036730 24040004 */ addiu $a0, $zero, 0x4
/* 11B34 80036734 3C01800A */ lui $at, %hi(D_800A0954)
/* 11B38 80036738 A4200954 */ sh $zero, %lo(D_800A0954)($at)
/* 11B3C 8003673C 3C01800A */ lui $at, %hi(D_800A0956)
/* 11B40 80036740 A4220956 */ sh $v0, %lo(D_800A0956)($at)
/* 11B44 80036744 3C01800A */ lui $at, %hi(D_800A0958)
/* 11B48 80036748 A4240958 */ sh $a0, %lo(D_800A0958)($at)
/* 11B4C 8003674C 3C01800A */ lui $at, %hi(D_800A0960)
/* 11B50 80036750 AC300960 */ sw $s0, %lo(D_800A0960)($at)
/* 11B54 80036754 3C01800A */ lui $at, %hi(D_800A095A)
/* 11B58 80036758 A420095A */ sh $zero, %lo(D_800A095A)($at)
/* 11B5C 8003675C 3C01800A */ lui $at, %hi(D_800A095C)
/* 11B60 80036760 A420095C */ sh $zero, %lo(D_800A095C)($at)
/* 11B64 80036764 3C01800A */ lui $at, %hi(D_800A095E)
/* 11B68 80036768 A420095E */ sh $zero, %lo(D_800A095E)($at)
/* 11B6C 8003676C 3C01800A */ lui $at, %hi(D_800A0964)
/* 11B70 80036770 AC200964 */ sw $zero, %lo(D_800A0964)($at)
/* 11B74 80036774 8E220000 */ lw $v0, 0x0($s1)
/* 11B78 80036778 24030005 */ addiu $v1, $zero, 0x5
/* 11B7C 8003677C A4430086 */ sh $v1, 0x86($v0)
/* 11B80 80036780 A444008C */ sh $a0, 0x8C($v0)
/* 11B84 80036784 0800D9FC */ j .L800367F0
/* 11B88 80036788 A444008E */ sh $a0, 0x8E($v0)
.L8003678C:
/* 11B8C 8003678C 0C00CDF4 */ jal intro_logos_set_fade_alpha
/* 11B90 80036790 0000202D */ daddu $a0, $zero, $zero
/* 11B94 80036794 0C00CDF8 */ jal intro_logos_set_fade_color
/* 11B98 80036798 240400D0 */ addiu $a0, $zero, 0xD0
/* 11B9C 8003679C 2402FFFF */ addiu $v0, $zero, -0x1
/* 11BA0 800367A0 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 11BA4 800367A4 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* 11BA8 800367A8 3C048007 */ lui $a0, %hi(D_800779B0)
/* 11BAC 800367AC 248479B0 */ addiu $a0, $a0, %lo(D_800779B0)
/* 11BB0 800367B0 A06200A8 */ sb $v0, 0xA8($v1)
/* 11BB4 800367B4 90820000 */ lbu $v0, 0x0($a0)
/* 11BB8 800367B8 24030006 */ addiu $v1, $zero, 0x6
/* 11BBC 800367BC 3C01800A */ lui $at, %hi(D_800A0956)
/* 11BC0 800367C0 A4230956 */ sh $v1, %lo(D_800A0956)($at)
/* 11BC4 800367C4 3C01800A */ lui $at, %hi(D_800A0958)
/* 11BC8 800367C8 A4230958 */ sh $v1, %lo(D_800A0958)($at)
/* 11BCC 800367CC 24420001 */ addiu $v0, $v0, 0x1
/* 11BD0 800367D0 A0820000 */ sb $v0, 0x0($a0)
/* 11BD4 800367D4 304200FF */ andi $v0, $v0, 0xFF
/* 11BD8 800367D8 2C420004 */ sltiu $v0, $v0, 0x4
/* 11BDC 800367DC 50400001 */ beql $v0, $zero, .L800367E4
/* 11BE0 800367E0 A0800000 */ sb $zero, 0x0($a0)
.L800367E4:
/* 11BE4 800367E4 24020003 */ addiu $v0, $zero, 0x3
/* 11BE8 800367E8 3C01800A */ lui $at, %hi(D_800A0964)
/* 11BEC 800367EC AC220964 */ sw $v0, %lo(D_800A0964)($at)
.L800367F0:
/* 11BF0 800367F0 3C02800A */ lui $v0, %hi(D_800A0954)
/* 11BF4 800367F4 84420954 */ lh $v0, %lo(D_800A0954)($v0)
/* 11BF8 800367F8 3C04800A */ lui $a0, %hi(D_800A0963)
/* 11BFC 800367FC 90840963 */ lbu $a0, %lo(D_800A0963)($a0)
/* 11C00 80036800 44820000 */ mtc1 $v0, $f0
/* 11C04 80036804 00000000 */ nop
/* 11C08 80036808 46800020 */ cvt.s.w $f0, $f0
/* 11C0C 8003680C 44050000 */ mfc1 $a1, $f0
/* 11C10 80036810 0C04DF69 */ jal set_screen_overlay_params_back
/* 11C14 80036814 00000000 */ nop
/* 11C18 80036818 3C05800A */ lui $a1, %hi(D_800A095B)
/* 11C1C 8003681C 90A5095B */ lbu $a1, %lo(D_800A095B)($a1)
/* 11C20 80036820 3C06800A */ lui $a2, %hi(D_800A095D)
/* 11C24 80036824 90C6095D */ lbu $a2, %lo(D_800A095D)($a2)
/* 11C28 80036828 3C07800A */ lui $a3, %hi(D_800A095F)
/* 11C2C 8003682C 90E7095F */ lbu $a3, %lo(D_800A095F)($a3)
/* 11C30 80036830 0C04DF84 */ jal set_screen_overlay_color
/* 11C34 80036834 24040001 */ addiu $a0, $zero, 0x1
/* 11C38 80036838 0C00CE1D */ jal intro_logos_update_fade
/* 11C3C 8003683C 00000000 */ nop
/* 11C40 80036840 8FBF0018 */ lw $ra, 0x18($sp)
/* 11C44 80036844 8FB10014 */ lw $s1, 0x14($sp)
/* 11C48 80036848 8FB00010 */ lw $s0, 0x10($sp)
/* 11C4C 8003684C 03E00008 */ jr $ra
/* 11C50 80036850 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void state_init_intro(void) {
s8 unk_A8;
gGameStatusPtr->introState = INTRO_STATE_0;
set_curtain_scale_goal(1.0f);
set_curtain_fade_goal(0.3f);
unk_A8 = gGameStatusPtr->creditsViewportMode;
switch (unk_A8) {
case 0:
intro_logos_set_fade_alpha(0);
D_800A0954 = 0xFF;
D_800A0956 = 0x10;
D_800A0958 = 4;
D_800A0960 = 0;
D_800A095A = 208;
D_800A095C = 208;
D_800A095E = 208;
D_800A0964 = 0;
// hos_05 (Star Sanctuary)
gGameStatusPtr->areaID = AREA_HOS;
gGameStatusPtr->mapID = 5;
gGameStatusPtr->entryID = 3;
break;
case 1:
intro_logos_set_fade_alpha(0);
D_800A0954 = 0;
D_800A0956 = 0xC;
D_800A0958 = 4;
D_800A0960 = unk_A8;
D_800A095A = 0;
D_800A095C = 0;
D_800A095E = 0;
D_800A0964 = 0;
// hos_04 (Outside the Sanctuary)
gGameStatusPtr->areaID = AREA_HOS;
gGameStatusPtr->mapID = 4;
gGameStatusPtr->entryID = 4;
break;
default:
intro_logos_set_fade_alpha(0);
intro_logos_set_fade_color(208);
gGameStatusPtr->creditsViewportMode = -1;
D_800A0956 = 6;
D_800A0958 = 6;
D_800779B0++;
if (D_800779B0 >= 4) {
D_800779B0 = 0;
}
D_800A0964 = 3;
break;
}
set_screen_overlay_params_back(D_800A0963, D_800A0954);
set_screen_overlay_color(SCREEN_LAYER_BACK, D_800A095B, D_800A095D, D_800A095F);
intro_logos_update_fade();
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel shattering_stones_main
/* 33FE80 E002C000 27BDFF98 */ addiu $sp, $sp, -0x68
/* 33FE84 E002C004 F7B40050 */ sdc1 $f20, 0x50($sp)
/* 33FE88 E002C008 4485A000 */ mtc1 $a1, $f20
/* 33FE8C E002C00C F7B60058 */ sdc1 $f22, 0x58($sp)
/* 33FE90 E002C010 4486B000 */ mtc1 $a2, $f22
/* 33FE94 E002C014 27A40010 */ addiu $a0, $sp, 0x10
/* 33FE98 E002C018 F7B80060 */ sdc1 $f24, 0x60($sp)
/* 33FE9C E002C01C 4487C000 */ mtc1 $a3, $f24
/* 33FEA0 E002C020 3C02E003 */ lui $v0, %hi(shattering_stones_init)
/* 33FEA4 E002C024 2442C234 */ addiu $v0, $v0, %lo(shattering_stones_init)
/* 33FEA8 E002C028 AFA20018 */ sw $v0, 0x18($sp)
/* 33FEAC E002C02C 3C02E003 */ lui $v0, %hi(shattering_stones_update)
/* 33FEB0 E002C030 2442C23C */ addiu $v0, $v0, %lo(shattering_stones_update)
/* 33FEB4 E002C034 AFA2001C */ sw $v0, 0x1C($sp)
/* 33FEB8 E002C038 3C02E003 */ lui $v0, %hi(shattering_stones_render)
/* 33FEBC E002C03C 2442C3D0 */ addiu $v0, $v0, %lo(shattering_stones_render)
/* 33FEC0 E002C040 AFA20020 */ sw $v0, 0x20($sp)
/* 33FEC4 E002C044 24020016 */ addiu $v0, $zero, 0x16
/* 33FEC8 E002C048 AFBF0048 */ sw $ra, 0x48($sp)
/* 33FECC E002C04C AFB70044 */ sw $s7, 0x44($sp)
/* 33FED0 E002C050 AFB60040 */ sw $s6, 0x40($sp)
/* 33FED4 E002C054 AFB5003C */ sw $s5, 0x3C($sp)
/* 33FED8 E002C058 AFB40038 */ sw $s4, 0x38($sp)
/* 33FEDC E002C05C AFB30034 */ sw $s3, 0x34($sp)
/* 33FEE0 E002C060 AFB20030 */ sw $s2, 0x30($sp)
/* 33FEE4 E002C064 AFB1002C */ sw $s1, 0x2C($sp)
/* 33FEE8 E002C068 AFB00028 */ sw $s0, 0x28($sp)
/* 33FEEC E002C06C AFA00010 */ sw $zero, 0x10($sp)
/* 33FEF0 E002C070 AFA00024 */ sw $zero, 0x24($sp)
/* 33FEF4 E002C074 0C080124 */ jal shim_create_effect_instance
/* 33FEF8 E002C078 AFA20014 */ sw $v0, 0x14($sp)
/* 33FEFC E002C07C 24040240 */ addiu $a0, $zero, 0x240
/* 33FF00 E002C080 24150009 */ addiu $s5, $zero, 0x9
/* 33FF04 E002C084 0040802D */ daddu $s0, $v0, $zero
/* 33FF08 E002C088 0C08012C */ jal shim_general_heap_malloc
/* 33FF0C E002C08C AE150008 */ sw $s5, 0x8($s0)
/* 33FF10 E002C090 0040882D */ daddu $s1, $v0, $zero
/* 33FF14 E002C094 16200003 */ bnez $s1, .LE002C0A4
/* 33FF18 E002C098 AE11000C */ sw $s1, 0xC($s0)
.LE002C09C:
/* 33FF1C E002C09C 0800B027 */ j .LE002C09C
/* 33FF20 E002C0A0 00000000 */ nop
.LE002C0A4:
/* 33FF24 E002C0A4 3C01C000 */ lui $at, (0xC0000000 >> 16)
/* 33FF28 E002C0A8 44811000 */ mtc1 $at, $f2
/* 33FF2C E002C0AC AE200024 */ sw $zero, 0x24($s1)
/* 33FF30 E002C0B0 E6340000 */ swc1 $f20, 0x0($s1)
/* 33FF34 E002C0B4 E6360004 */ swc1 $f22, 0x4($s1)
/* 33FF38 E002C0B8 C7A00078 */ lwc1 $f0, 0x78($sp)
/* 33FF3C E002C0BC 2404003C */ addiu $a0, $zero, 0x3C
/* 33FF40 E002C0C0 E6380008 */ swc1 $f24, 0x8($s1)
/* 33FF44 E002C0C4 AE20002C */ sw $zero, 0x2C($s1)
/* 33FF48 E002C0C8 AE200030 */ sw $zero, 0x30($s1)
/* 33FF4C E002C0CC E620000C */ swc1 $f0, 0xC($s1)
/* 33FF50 E002C0D0 0C080138 */ jal shim_rand_int
/* 33FF54 E002C0D4 E6220014 */ swc1 $f2, 0x14($s1)
/* 33FF58 E002C0D8 2404003C */ addiu $a0, $zero, 0x3C
/* 33FF5C E002C0DC 2442FFE2 */ addiu $v0, $v0, -0x1E
/* 33FF60 E002C0E0 44820000 */ mtc1 $v0, $f0
/* 33FF64 E002C0E4 00000000 */ nop
/* 33FF68 E002C0E8 46800020 */ cvt.s.w $f0, $f0
/* 33FF6C E002C0EC 240200FF */ addiu $v0, $zero, 0xFF
/* 33FF70 E002C0F0 E6200034 */ swc1 $f0, 0x34($s1)
/* 33FF74 E002C0F4 0C080138 */ jal shim_rand_int
/* 33FF78 E002C0F8 AE220028 */ sw $v0, 0x28($s1)
/* 33FF7C E002C0FC 2442FFE2 */ addiu $v0, $v0, -0x1E
/* 33FF80 E002C100 44822000 */ mtc1 $v0, $f4
/* 33FF84 E002C104 00000000 */ nop
/* 33FF88 E002C108 46802120 */ cvt.s.w $f4, $f4
/* 33FF8C E002C10C 3C013FD0 */ lui $at, (0x3FD00000 >> 16)
/* 33FF90 E002C110 44811800 */ mtc1 $at, $f3
/* 33FF94 E002C114 44801000 */ mtc1 $zero, $f2
/* 33FF98 E002C118 46002021 */ cvt.d.s $f0, $f4
/* 33FF9C E002C11C 46220002 */ mul.d $f0, $f0, $f2
/* 33FFA0 E002C120 00000000 */ nop
/* 33FFA4 E002C124 24120001 */ addiu $s2, $zero, 0x1
/* 33FFA8 E002C128 24020014 */ addiu $v0, $zero, 0x14
/* 33FFAC E002C12C AE220020 */ sw $v0, 0x20($s1)
/* 33FFB0 E002C130 0255102A */ slt $v0, $s2, $s5
/* 33FFB4 E002C134 E6240038 */ swc1 $f4, 0x38($s1)
/* 33FFB8 E002C138 46200020 */ cvt.s.d $f0, $f0
/* 33FFBC E002C13C E620003C */ swc1 $f0, 0x3C($s1)
/* 33FFC0 E002C140 1040002E */ beqz $v0, .LE002C1FC
/* 33FFC4 E002C144 26310040 */ addiu $s1, $s1, 0x40
/* 33FFC8 E002C148 3C17E003 */ lui $s7, %hi(D_E002C984)
/* 33FFCC E002C14C 26F7C984 */ addiu $s7, $s7, %lo(D_E002C984)
/* 33FFD0 E002C150 3C16E003 */ lui $s6, %hi(D_E002C964)
/* 33FFD4 E002C154 26D6C964 */ addiu $s6, $s6, %lo(D_E002C964)
/* 33FFD8 E002C158 26300034 */ addiu $s0, $s1, 0x34
/* 33FFDC E002C15C 0000A02D */ daddu $s4, $zero, $zero
/* 33FFE0 E002C160 0280982D */ daddu $s3, $s4, $zero
/* 33FFE4 E002C164 3C01E003 */ lui $at, (0xE0030000 >> 16)
/* 33FFE8 E002C168 D436C9D0 */ ldc1 $f22, -0x3630($at)
/* 33FFEC E002C16C 3C013FF0 */ lui $at, (0x3FF00000 >> 16)
/* 33FFF0 E002C170 4481A800 */ mtc1 $at, $f21
/* 33FFF4 E002C174 4480A000 */ mtc1 $zero, $f20
.LE002C178:
/* 33FFF8 E002C178 02771021 */ addu $v0, $s3, $s7
/* 33FFFC E002C17C C4400000 */ lwc1 $f0, 0x0($v0)
/* 340000 E002C180 E600FFE4 */ swc1 $f0, -0x1C($s0)
/* 340004 E002C184 C4400004 */ lwc1 $f0, 0x4($v0)
/* 340008 E002C188 02961021 */ addu $v0, $s4, $s6
/* 34000C E002C18C E600FFE8 */ swc1 $f0, -0x18($s0)
/* 340010 E002C190 AE200000 */ sw $zero, 0x0($s1)
/* 340014 E002C194 AE00FFD0 */ sw $zero, -0x30($s0)
/* 340018 E002C198 AE00FFD4 */ sw $zero, -0x2C($s0)
/* 34001C E002C19C C4400000 */ lwc1 $f0, 0x0($v0)
/* 340020 E002C1A0 46000000 */ add.s $f0, $f0, $f0
/* 340024 E002C1A4 2404000A */ addiu $a0, $zero, 0xA
/* 340028 E002C1A8 0C080138 */ jal shim_rand_int
/* 34002C E002C1AC E600FFDC */ swc1 $f0, -0x24($s0)
/* 340030 E002C1B0 44820000 */ mtc1 $v0, $f0
/* 340034 E002C1B4 00000000 */ nop
/* 340038 E002C1B8 46800020 */ cvt.s.w $f0, $f0
/* 34003C E002C1BC 46000021 */ cvt.d.s $f0, $f0
/* 340040 E002C1C0 46360002 */ mul.d $f0, $f0, $f22
/* 340044 E002C1C4 00000000 */ nop
/* 340048 E002C1C8 26940004 */ addiu $s4, $s4, 0x4
/* 34004C E002C1CC 26730008 */ addiu $s3, $s3, 0x8
/* 340050 E002C1D0 26520001 */ addiu $s2, $s2, 0x1
/* 340054 E002C1D4 46200000 */ add.d $f0, $f0, $f0
/* 340058 E002C1D8 26310040 */ addiu $s1, $s1, 0x40
/* 34005C E002C1DC 0255102A */ slt $v0, $s2, $s5
/* 340060 E002C1E0 46340000 */ add.d $f0, $f0, $f20
/* 340064 E002C1E4 AE00FFF8 */ sw $zero, -0x8($s0)
/* 340068 E002C1E8 AE000000 */ sw $zero, 0x0($s0)
/* 34006C E002C1EC 46200020 */ cvt.s.d $f0, $f0
/* 340070 E002C1F0 E600FFE0 */ swc1 $f0, -0x20($s0)
/* 340074 E002C1F4 1440FFE0 */ bnez $v0, .LE002C178
/* 340078 E002C1F8 26100040 */ addiu $s0, $s0, 0x40
.LE002C1FC:
/* 34007C E002C1FC 8FBF0048 */ lw $ra, 0x48($sp)
/* 340080 E002C200 8FB70044 */ lw $s7, 0x44($sp)
/* 340084 E002C204 8FB60040 */ lw $s6, 0x40($sp)
/* 340088 E002C208 8FB5003C */ lw $s5, 0x3C($sp)
/* 34008C E002C20C 8FB40038 */ lw $s4, 0x38($sp)
/* 340090 E002C210 8FB30034 */ lw $s3, 0x34($sp)
/* 340094 E002C214 8FB20030 */ lw $s2, 0x30($sp)
/* 340098 E002C218 8FB1002C */ lw $s1, 0x2C($sp)
/* 34009C E002C21C 8FB00028 */ lw $s0, 0x28($sp)
/* 3400A0 E002C220 D7B80060 */ ldc1 $f24, 0x60($sp)
/* 3400A4 E002C224 D7B60058 */ ldc1 $f22, 0x58($sp)
/* 3400A8 E002C228 D7B40050 */ ldc1 $f20, 0x50($sp)
/* 3400AC E002C22C 03E00008 */ jr $ra
/* 3400B0 E002C230 27BD0068 */ addiu $sp, $sp, 0x68
### DECOMPILED C INSTRUCTIONS:
void shattering_stones_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
EffectBlueprint bp;
EffectInstance* effect;
ShatteringStonesFXData* part;
s32 numParts = 9;
s32 i;
bp.init = shattering_stones_init;
bp.update = shattering_stones_update;
bp.renderWorld = shattering_stones_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_SHATTERING_STONES;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
part = effect->data.shatteringStones = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.shatteringStones != NULL);
part->unk_24 = 0;
part->unk_00 = arg1;
part->unk_04 = arg2;
part->unk_0C = arg4;
part->unk_08 = arg3;
part->unk_2C = 0;
part->unk_30 = 0;
part->unk_14 = -2.0f;
part->unk_34 = shim_rand_int(60) - 30;
part->unk_28 = 255;
part->unk_38 = shim_rand_int(60) - 30;
part->unk_3C = part->unk_38 * 0.25;
part->unk_20 = 20;
part++;
for (i = 1; i < numParts; i++, part++) {
part->unk_18 = D_E002C984[i - 1][0];
part->unk_1C = D_E002C984[i - 1][1];
part->unk_00 = 0;
part->unk_04 = 0;
part->unk_08 = 0;
part->unk_10 = D_E002C964[i - 1] * 2.0f;
part->unk_14 = (f32) shim_rand_int(10) * 0.1 * 2.0 + 1.0;
part->unk_2C = 0;
part->unk_34 = 0;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel parasol_get_npc
/* E24920 802B6000 27BDFFD8 */ addiu $sp, $sp, -0x28
/* E24924 802B6004 AFB1001C */ sw $s1, 0x1C($sp)
/* E24928 802B6008 3C118016 */ lui $s1, %hi(gCollisionStatus)
/* E2492C 802B600C 2631A550 */ addiu $s1, $s1, %lo(gCollisionStatus)
/* E24930 802B6010 AFB00018 */ sw $s0, 0x18($sp)
/* E24934 802B6014 3C108011 */ lui $s0, %hi(gPlayerStatus)
.L802B6018:
/* E24938 802B6018 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* E2493C 802B601C AFBF0024 */ sw $ra, 0x24($sp)
/* E24940 802B6020 AFB20020 */ sw $s2, 0x20($sp)
/* E24944 802B6024 8E050004 */ lw $a1, 0x4($s0)
/* E24948 802B6028 3C12800B */ lui $s2, %hi(gCameras)
/* E2494C 802B602C 26521D80 */ addiu $s2, $s2, %lo(gCameras)
/* E24950 802B6030 30A21000 */ andi $v0, $a1, 0x1000
/* E24954 802B6034 10400005 */ beqz $v0, .L802B604C
/* E24958 802B6038 00000000 */ nop
/* E2495C 802B603C 0C0AD8B3 */ jal action_update_peach_land
.L802B6040:
/* E24960 802B6040 00000000 */ nop
.L802B6044:
/* E24964 802B6044 080AD86A */ j .L802B61A8
glabel action_hammer_play_hit_fx
/* E24968 802B6048 00000000 */ nop
.L802B604C:
/* E2496C 802B604C 8E030000 */ lw $v1, 0x0($s0)
.L802B6050:
/* E24970 802B6050 0461002E */ bgez $v1, .L802B610C
/* E24974 802B6054 3C027F77 */ lui $v0, (0x7F77FFF1 >> 16)
.L802B6058:
/* E24978 802B6058 3442FFF1 */ ori $v0, $v0, (0x7F77FFF1 & 0xFFFF)
/* E2497C 802B605C C6000028 */ lwc1 $f0, 0x28($s0)
glabel action_update_sliding
/* E24980 802B6060 C6020030 */ lwc1 $f2, 0x30($s0)
/* E24984 802B6064 00621024 */ and $v0, $v1, $v0
.L802B6068:
/* E24988 802B6068 AE020000 */ sw $v0, 0x0($s0)
/* E2498C 802B606C 30A24000 */ andi $v0, $a1, 0x4000
/* E24990 802B6070 A20000B6 */ sb $zero, 0xB6($s0)
.L802B6074:
/* E24994 802B6074 A60000C0 */ sh $zero, 0xC0($s0)
/* E24998 802B6078 A60000C2 */ sh $zero, 0xC2($s0)
glabel .L802B607C
/* E2499C 802B607C E6000044 */ swc1 $f0, 0x44($s0)
.L802B6080:
/* E249A0 802B6080 10400004 */ beqz $v0, .L802B6094
/* E249A4 802B6084 E6020048 */ swc1 $f2, 0x48($s0)
/* E249A8 802B6088 3C040009 */ lui $a0, (0x90002 >> 16)
.L802B608C:
/* E249AC 802B608C 080AD82B */ j .L802B60AC
.L802B6090:
/* E249B0 802B6090 34840002 */ ori $a0, $a0, (0x90002 & 0xFFFF)
.L802B6094:
/* E249B4 802B6094 3C040006 */ lui $a0, (0x6000B >> 16)
/* E249B8 802B6098 30A20001 */ andi $v0, $a1, 0x1
glabel action_update_state_23
/* E249BC 802B609C 14400003 */ bnez $v0, .L802B60AC
/* E249C0 802B60A0 3484000B */ ori $a0, $a0, (0x6000B & 0xFFFF)
glabel action_update_use_spinning_flower
/* E249C4 802B60A4 3C040001 */ lui $a0, (0x10009 >> 16)
.L802B60A8:
/* E249C8 802B60A8 34840009 */ ori $a0, $a0, (0x10009 & 0xFFFF)
.L802B60AC:
/* E249CC 802B60AC 0C037FBF */ jal suggest_player_anim_allow_backward
/* E249D0 802B60B0 00000000 */ nop
glabel action_update_jump
/* E249D4 802B60B4 34048161 */ ori $a0, $zero, 0x8161
/* E249D8 802B60B8 0C052736 */ jal sfx_play_sound_at_player
/* E249DC 802B60BC 0000282D */ daddu $a1, $zero, $zero
/* E249E0 802B60C0 24040148 */ addiu $a0, $zero, 0x148
/* E249E4 802B60C4 0C052736 */ jal sfx_play_sound_at_player
.L802B60C8:
/* E249E8 802B60C8 0000282D */ daddu $a1, $zero, $zero
/* E249EC 802B60CC 96220002 */ lhu $v0, 0x2($s1)
glabel .L802B60D0
/* E249F0 802B60D0 30424000 */ andi $v0, $v0, 0x4000
.L802B60D4:
/* E249F4 802B60D4 14400004 */ bnez $v0, .L802B60E8
/* E249F8 802B60D8 3C04FFFB */ lui $a0, (0xFFFBFFFF >> 16)
/* E249FC 802B60DC 0C03954C */ jal phys_adjust_cam_on_landing
/* E24A00 802B60E0 00000000 */ nop
/* E24A04 802B60E4 3C04FFFB */ lui $a0, (0xFFFBFFFF >> 16)
.L802B60E8:
/* E24A08 802B60E8 3484FFFF */ ori $a0, $a0, (0xFFFBFFFF & 0xFFFF)
.L802B60EC:
/* E24A0C 802B60EC 2402FFFF */ addiu $v0, $zero, -0x1
.L802B60F0:
/* E24A10 802B60F0 A6220004 */ sh $v0, 0x4($s1)
glabel .L802B60F4
/* E24A14 802B60F4 8E020004 */ lw $v0, 0x4($s0)
/* E24A18 802B60F8 96430002 */ lhu $v1, 0x2($s2)
/* E24A1C 802B60FC 00441024 */ and $v0, $v0, $a0
.L802B6100:
/* E24A20 802B6100 3063FFFB */ andi $v1, $v1, 0xFFFB
.L802B6104:
/* E24A24 802B6104 AE020004 */ sw $v0, 0x4($s0)
.L802B6108:
/* E24A28 802B6108 A6430002 */ sh $v1, 0x2($s2)
glabel .L802B610C
/* E24A2C 802B610C C6000054 */ lwc1 $f0, 0x54($s0)
.L802B6110:
/* E24A30 802B6110 3C013F19 */ lui $at, (0x3F19999A >> 16)
/* E24A34 802B6114 3421999A */ ori $at, $at, (0x3F19999A & 0xFFFF)
.L802B6118:
/* E24A38 802B6118 44811000 */ mtc1 $at, $f2
/* E24A3C 802B611C 27A40010 */ addiu $a0, $sp, 0x10
glabel action_update_parasol
/* E24A40 802B6120 46020002 */ mul.s $f0, $f0, $f2
.L802B6124:
/* E24A44 802B6124 00000000 */ nop
.L802B6128:
/* E24A48 802B6128 920200B6 */ lbu $v0, 0xB6($s0)
/* E24A4C 802B612C 27A50014 */ addiu $a1, $sp, 0x14
/* E24A50 802B6130 24420001 */ addiu $v0, $v0, 0x1
glabel .L802B6134
/* E24A54 802B6134 A20200B6 */ sb $v0, 0xB6($s0)
/* E24A58 802B6138 0C0388C1 */ jal player_input_to_move_vector
.L802B613C:
/* E24A5C 802B613C E6000054 */ swc1 $f0, 0x54($s0)
.L802B6140:
/* E24A60 802B6140 0C039858 */ jal check_input_jump
.L802B6144:
/* E24A64 802B6144 00000000 */ nop
/* E24A68 802B6148 0040182D */ daddu $v1, $v0, $zero
.L802B614C:
/* E24A6C 802B614C 14600005 */ bnez $v1, .L802B6164
.L802B6150:
/* E24A70 802B6150 00000000 */ nop
.L802B6154:
/* E24A74 802B6154 820200B6 */ lb $v0, 0xB6($s0)
.L802B6158:
/* E24A78 802B6158 0062102A */ slt $v0, $v1, $v0
.L802B615C:
/* E24A7C 802B615C 10400012 */ beqz $v0, .L802B61A8
/* E24A80 802B6160 00000000 */ nop
.L802B6164:
/* E24A84 802B6164 C7A00014 */ lwc1 $f0, 0x14($sp)
.L802B6168:
/* E24A88 802B6168 44801000 */ mtc1 $zero, $f2
/* E24A8C 802B616C 00000000 */ nop
glabel .L802B6170
/* E24A90 802B6170 46020032 */ c.eq.s $f0, $f2
glabel .L802B6174
/* E24A94 802B6174 00000000 */ nop
/* E24A98 802B6178 45000005 */ bc1f .L802B6190
.L802B617C:
/* E24A9C 802B617C 00000000 */ nop
.L802B6180:
/* E24AA0 802B6180 0C039769 */ jal set_action_state
glabel .L802B6184
/* E24AA4 802B6184 0000202D */ daddu $a0, $zero, $zero
.L802B6188:
/* E24AA8 802B6188 080AD86A */ j .L802B61A8
.L802B618C:
/* E24AAC 802B618C 00000000 */ nop
.L802B6190:
/* E24AB0 802B6190 45010003 */ bc1t .L802B61A0
.L802B6194:
/* E24AB4 802B6194 00000000 */ nop
glabel func_802B6198
/* E24AB8 802B6198 C7A00010 */ lwc1 $f0, 0x10($sp)
/* E24ABC 802B619C E6000080 */ swc1 $f0, 0x80($s0)
.L802B61A0:
/* E24AC0 802B61A0 0C0397DA */ jal update_locomotion_state
.L802B61A4:
/* E24AC4 802B61A4 00000000 */ nop
.L802B61A8:
/* E24AC8 802B61A8 8FBF0024 */ lw $ra, 0x24($sp)
.L802B61AC:
/* E24ACC 802B61AC 8FB20020 */ lw $s2, 0x20($sp)
.L802B61B0:
/* E24AD0 802B61B0 8FB1001C */ lw $s1, 0x1C($sp)
.L802B61B4:
/* E24AD4 802B61B4 8FB00018 */ lw $s0, 0x18($sp)
/* E24AD8 802B61B8 03E00008 */ jr $ra
/* E24ADC 802B61BC 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void action_update_land(void) {
CollisionStatus* collisionStatus = &gCollisionStatus;
PlayerStatus* playerStatus = &gPlayerStatus;
Camera* camera = &gCameras[CAM_DEFAULT];
f32 inputMoveMagnitude;
f32 inputMoveAngle;
s32 jumpInputCheck;
AnimID anim;
if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
action_update_peach_land();
return;
}
if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~(
PS_FLAG_ACTION_STATE_CHANGED |
PS_FLAG_SCRIPTED_FALL |
PS_FLAG_ARMS_RAISED |
PS_FLAG_AIRBORNE
);
playerStatus->actionSubstate = SUBSTATE_INIT;
playerStatus->timeInAir = 0;
playerStatus->peakJumpTime = 0;
playerStatus->landPos.x = playerStatus->position.x;
playerStatus->landPos.z = playerStatus->position.z;
if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) {
anim = ANIM_MarioW3_8bit_Still;
} else if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
anim = ANIM_Mario1_Land;
} else {
anim = ANIM_MarioW1_LandWatt;
}
suggest_player_anim_allow_backward(anim);
sfx_play_sound_at_player(SOUND_161 | SOUND_ID_STOP, SOUND_SPACE_MODE_0);
sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0);
if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing();
}
collisionStatus->lastTouchedFloor = -1;
playerStatus->animFlags &= ~PA_FLAG_INTERRUPT_SPIN;
camera->moveFlags &= ~CAMERA_MOVE_FLAG_4;
}
playerStatus->actionSubstate++; // SUBSTATE_DONE
playerStatus->currentSpeed *= 0.6f;
player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude);
jumpInputCheck = check_input_jump();
if (jumpInputCheck != 0 || jumpInputCheck < playerStatus->actionSubstate) {
if (inputMoveMagnitude == 0.0f) {
set_action_state(ACTION_STATE_IDLE);
return;
}
if (inputMoveMagnitude != 0.0f) {
playerStatus->targetYaw = inputMoveAngle;
}
update_locomotion_state();
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel evt_get_float_variable
/* ECDDC 802C842C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* ECDE0 802C8430 3C02EFE8 */ lui $v0, (0xEFE82080 >> 16)
/* ECDE4 802C8434 34422080 */ ori $v0, $v0, (0xEFE82080 & 0xFFFF)
/* ECDE8 802C8438 0045102A */ slt $v0, $v0, $a1
/* ECDEC 802C843C 10400006 */ beqz $v0, .L802C8458
/* ECDF0 802C8440 AFBF0010 */ sw $ra, 0x10($sp)
/* ECDF4 802C8444 3C02F119 */ lui $v0, (0xF1194D80 >> 16)
/* ECDF8 802C8448 34424D80 */ ori $v0, $v0, (0xF1194D80 & 0xFFFF)
/* ECDFC 802C844C 0045102A */ slt $v0, $v0, $a1
/* ECE00 802C8450 14400005 */ bnez $v0, .L802C8468
/* ECE04 802C8454 3C02F2E3 */ lui $v0, (0xF2E31100 >> 16)
.L802C8458:
/* ECE08 802C8458 44850000 */ mtc1 $a1, $f0
/* ECE0C 802C845C 00000000 */ nop
/* ECE10 802C8460 080B218D */ j .L802C8634
/* ECE14 802C8464 46800020 */ cvt.s.w $f0, $f0
.L802C8468:
/* ECE18 802C8468 34421100 */ ori $v0, $v0, (0xF2E31100 & 0xFFFF)
/* ECE1C 802C846C 0045102A */ slt $v0, $v0, $a1
/* ECE20 802C8470 14400003 */ bnez $v0, .L802C8480
/* ECE24 802C8474 3C02F545 */ lui $v0, (0xF5456B00 >> 16)
/* ECE28 802C8478 080B218B */ j .L802C862C
/* ECE2C 802C847C 00A0202D */ daddu $a0, $a1, $zero
.L802C8480:
/* ECE30 802C8480 34426B00 */ ori $v0, $v0, (0xF5456B00 & 0xFFFF)
/* ECE34 802C8484 0045102A */ slt $v0, $v0, $a1
/* ECE38 802C8488 14400009 */ bnez $v0, .L802C84B0
/* ECE3C 802C848C 3C02F676 */ lui $v0, (0xF6769800 >> 16)
/* ECE40 802C8490 3C020B53 */ lui $v0, (0xB532B80 >> 16)
/* ECE44 802C8494 34422B80 */ ori $v0, $v0, (0xB532B80 & 0xFFFF)
/* ECE48 802C8498 00A22821 */ addu $a1, $a1, $v0
/* ECE4C 802C849C 8C83013C */ lw $v1, 0x13C($a0)
/* ECE50 802C84A0 00051080 */ sll $v0, $a1, 2
/* ECE54 802C84A4 00431021 */ addu $v0, $v0, $v1
/* ECE58 802C84A8 080B218B */ j .L802C862C
/* ECE5C 802C84AC 8C440000 */ lw $a0, 0x0($v0)
.L802C84B0:
/* ECE60 802C84B0 34429800 */ ori $v0, $v0, (0xF6769800 & 0xFFFF)
/* ECE64 802C84B4 0045102A */ slt $v0, $v0, $a1
/* ECE68 802C84B8 14400007 */ bnez $v0, .L802C84D8
/* ECE6C 802C84BC 3C02F7A7 */ lui $v0, (0xF7A7C500 >> 16)
/* ECE70 802C84C0 3C040A21 */ lui $a0, (0xA21FE80 >> 16)
/* ECE74 802C84C4 3484FE80 */ ori $a0, $a0, (0xA21FE80 & 0xFFFF)
/* ECE78 802C84C8 0C05154E */ jal get_global_byte
/* ECE7C 802C84CC 00A42021 */ addu $a0, $a1, $a0
/* ECE80 802C84D0 080B218B */ j .L802C862C
/* ECE84 802C84D4 0040202D */ daddu $a0, $v0, $zero
.L802C84D8:
/* ECE88 802C84D8 3442C500 */ ori $v0, $v0, (0xF7A7C500 & 0xFFFF)
/* ECE8C 802C84DC 0045102A */ slt $v0, $v0, $a1
/* ECE90 802C84E0 14400007 */ bnez $v0, .L802C8500
/* ECE94 802C84E4 3C02FB3B */ lui $v0, (0xFB3B4C00 >> 16)
/* ECE98 802C84E8 3C0408F0 */ lui $a0, (0x8F0D180 >> 16)
/* ECE9C 802C84EC 3484D180 */ ori $a0, $a0, (0x8F0D180 & 0xFFFF)
/* ECEA0 802C84F0 0C051594 */ jal get_area_byte
/* ECEA4 802C84F4 00A42021 */ addu $a0, $a1, $a0
/* ECEA8 802C84F8 080B218B */ j .L802C862C
/* ECEAC 802C84FC 0040202D */ daddu $a0, $v0, $zero
.L802C8500:
/* ECEB0 802C8500 34424C00 */ ori $v0, $v0, (0xFB3B4C00 & 0xFFFF)
/* ECEB4 802C8504 0045102A */ slt $v0, $v0, $a1
/* ECEB8 802C8508 14400015 */ bnez $v0, .L802C8560
/* ECEBC 802C850C 3C02FC6C */ lui $v0, (0xFC6C7900 >> 16)
/* ECEC0 802C8510 3C02055D */ lui $v0, (0x55D4A80 >> 16)
/* ECEC4 802C8514 34424A80 */ ori $v0, $v0, (0x55D4A80 & 0xFFFF)
/* ECEC8 802C8518 00A22821 */ addu $a1, $a1, $v0
/* ECECC 802C851C 04A10002 */ bgez $a1, .L802C8528
/* ECED0 802C8520 00A0182D */ daddu $v1, $a1, $zero
/* ECED4 802C8524 24A3001F */ addiu $v1, $a1, 0x1F
.L802C8528:
/* ECED8 802C8528 00033143 */ sra $a2, $v1, 5
/* ECEDC 802C852C 00C0182D */ daddu $v1, $a2, $zero
/* ECEE0 802C8530 00031140 */ sll $v0, $v1, 5
/* ECEE4 802C8534 00A23023 */ subu $a2, $a1, $v0
/* ECEE8 802C8538 00031880 */ sll $v1, $v1, 2
/* ECEEC 802C853C 3C02802E */ lui $v0, %hi(gMapFlags)
/* ECEF0 802C8540 8C42A480 */ lw $v0, %lo(gMapFlags)($v0)
/* ECEF4 802C8544 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* ECEF8 802C8548 44810000 */ mtc1 $at, $f0
/* ECEFC 802C854C 00621821 */ addu $v1, $v1, $v0
/* ECF00 802C8550 24020001 */ addiu $v0, $zero, 0x1
/* ECF04 802C8554 8C630000 */ lw $v1, 0x0($v1)
/* ECF08 802C8558 080B216D */ j .L802C85B4
/* ECF0C 802C855C 00C21004 */ sllv $v0, $v0, $a2
.L802C8560:
/* ECF10 802C8560 34427900 */ ori $v0, $v0, (0xFC6C7900 & 0xFFFF)
/* ECF14 802C8564 0045102A */ slt $v0, $v0, $a1
/* ECF18 802C8568 14400018 */ bnez $v0, .L802C85CC
/* ECF1C 802C856C 3C02FD9D */ lui $v0, (0xFD9DA600 >> 16)
/* ECF20 802C8570 3C02042C */ lui $v0, (0x42C1D80 >> 16)
/* ECF24 802C8574 34421D80 */ ori $v0, $v0, (0x42C1D80 & 0xFFFF)
/* ECF28 802C8578 00A22821 */ addu $a1, $a1, $v0
/* ECF2C 802C857C 04A10002 */ bgez $a1, .L802C8588
/* ECF30 802C8580 00A0182D */ daddu $v1, $a1, $zero
/* ECF34 802C8584 24A3001F */ addiu $v1, $a1, 0x1F
.L802C8588:
/* ECF38 802C8588 00033143 */ sra $a2, $v1, 5
/* ECF3C 802C858C 00C0182D */ daddu $v1, $a2, $zero
/* ECF40 802C8590 00031140 */ sll $v0, $v1, 5
/* ECF44 802C8594 00A23023 */ subu $a2, $a1, $v0
/* ECF48 802C8598 00031880 */ sll $v1, $v1, 2
/* ECF4C 802C859C 00831821 */ addu $v1, $a0, $v1
/* ECF50 802C85A0 24020001 */ addiu $v0, $zero, 0x1
/* ECF54 802C85A4 00C21004 */ sllv $v0, $v0, $a2
/* ECF58 802C85A8 8C6300C4 */ lw $v1, 0xC4($v1)
/* ECF5C 802C85AC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* ECF60 802C85B0 44810000 */ mtc1 $at, $f0
.L802C85B4:
/* ECF64 802C85B4 00622824 */ and $a1, $v1, $v0
/* ECF68 802C85B8 14A0001E */ bnez $a1, .L802C8634
/* ECF6C 802C85BC 00000000 */ nop
/* ECF70 802C85C0 44800000 */ mtc1 $zero, $f0
/* ECF74 802C85C4 080B218D */ j .L802C8634
/* ECF78 802C85C8 00000000 */ nop
.L802C85CC:
/* ECF7C 802C85CC 3442A600 */ ori $v0, $v0, (0xFD9DA600 & 0xFFFF)
/* ECF80 802C85D0 0045102A */ slt $v0, $v0, $a1
/* ECF84 802C85D4 1440000A */ bnez $v0, .L802C8600
/* ECF88 802C85D8 3C02FECE */ lui $v0, (0xFECED300 >> 16)
/* ECF8C 802C85DC 3C0202FA */ lui $v0, (0x2FAF080 >> 16)
/* ECF90 802C85E0 3442F080 */ ori $v0, $v0, (0x2FAF080 & 0xFFFF)
/* ECF94 802C85E4 00A22821 */ addu $a1, $a1, $v0
/* ECF98 802C85E8 3C03802E */ lui $v1, %hi(gMapVars)
/* ECF9C 802C85EC 8C63A484 */ lw $v1, %lo(gMapVars)($v1)
/* ECFA0 802C85F0 00051080 */ sll $v0, $a1, 2
/* ECFA4 802C85F4 00431021 */ addu $v0, $v0, $v1
/* ECFA8 802C85F8 080B218B */ j .L802C862C
/* ECFAC 802C85FC 8C440000 */ lw $a0, 0x0($v0)
.L802C8600:
/* ECFB0 802C8600 3442D300 */ ori $v0, $v0, (0xFECED300 & 0xFFFF)
/* ECFB4 802C8604 0045102A */ slt $v0, $v0, $a1
/* ECFB8 802C8608 10400003 */ beqz $v0, .L802C8618
/* ECFBC 802C860C 3C0201C9 */ lui $v0, (0x1C9C380 >> 16)
/* ECFC0 802C8610 080B218B */ j .L802C862C
/* ECFC4 802C8614 00A0202D */ daddu $a0, $a1, $zero
.L802C8618:
/* ECFC8 802C8618 3442C380 */ ori $v0, $v0, (0x1C9C380 & 0xFFFF)
/* ECFCC 802C861C 00A22821 */ addu $a1, $a1, $v0
/* ECFD0 802C8620 00051080 */ sll $v0, $a1, 2
/* ECFD4 802C8624 00821021 */ addu $v0, $a0, $v0
/* ECFD8 802C8628 8C440084 */ lw $a0, 0x84($v0)
.L802C862C:
/* ECFDC 802C862C 0C0B1248 */ jal evt_fixed_var_to_float
/* ECFE0 802C8630 00000000 */ nop
.L802C8634:
/* ECFE4 802C8634 8FBF0010 */ lw $ra, 0x10($sp)
/* ECFE8 802C8638 03E00008 */ jr $ra
/* ECFEC 802C863C 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
f32 evt_get_float_variable(Evt* script, Bytecode var) {
s32 temp;
if (var <= EVT_LIMIT) {
return var;
} else if (var <= EVT_IGNORE_ARG) {
return var;
} else if (var <= EVT_FIXED_CUTOFF) {
return evt_fixed_var_to_float(var);
} else if (var <= EVT_ARRAY_VAR_CUTOFF) {
var = EVT_INDEX_OF_ARRAY_VAR(var);
return evt_fixed_var_to_float(script->array[var]);
} else if (var <= EVT_GAME_BYTE_CUTOFF) {
var = EVT_INDEX_OF_GAME_BYTE(var);
return evt_fixed_var_to_float(get_global_byte(var));
} else if (var <= EVT_AREA_BYTE_CUTOFF) {
var = EVT_INDEX_OF_AREA_BYTE(var);
return evt_fixed_var_to_float(get_area_byte(var));
} else if (var <= EVT_MAP_FLAG_CUTOFF) {
var = EVT_INDEX_OF_MAP_FLAG(var);
temp = var % 32;
var = gMapFlags[var / 32] & (1 << temp);
if (var) {
return 1.0f;
} else {
return 0.0f;
}
} else if (var <= EVT_LOCAL_FLAG_CUTOFF) {
var = EVT_INDEX_OF_LOCAL_FLAG(var);
temp = var % 32;
var = script->varFlags[var / 32] & (1 << temp);
if (var) {
return 1.0f;
} else {
return 0.0f;
}
} else if (var <= EVT_MAP_VAR_CUTOFF) {
var = EVT_INDEX_OF_MAP_VAR(var);
return evt_fixed_var_to_float(gMapVars[var]);
} else if (var <= EVT_LOCAL_VAR_CUTOFF) {
var = EVT_INDEX_OF_LOCAL_VAR(var);
return evt_fixed_var_to_float(script->varTable[var]);
} else {
return evt_fixed_var_to_float(var);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel sfx_compute_spatialized_sound_params_1
/* E08B4 8014A1B4 27BDFFC0 */ addiu $sp, $sp, -0x40
/* E08B8 8014A1B8 AFB00030 */ sw $s0, 0x30($sp)
/* E08BC 8014A1BC 00E0802D */ daddu $s0, $a3, $zero
/* E08C0 8014A1C0 AFB20038 */ sw $s2, 0x38($sp)
/* E08C4 8014A1C4 8FB20050 */ lw $s2, 0x50($sp)
/* E08C8 8014A1C8 27A20020 */ addiu $v0, $sp, 0x20
/* E08CC 8014A1CC AFA20010 */ sw $v0, 0x10($sp)
/* E08D0 8014A1D0 27A20024 */ addiu $v0, $sp, 0x24
/* E08D4 8014A1D4 AFA20014 */ sw $v0, 0x14($sp)
/* E08D8 8014A1D8 27A20028 */ addiu $v0, $sp, 0x28
/* E08DC 8014A1DC 44860000 */ mtc1 $a2, $f0
/* E08E0 8014A1E0 3C048007 */ lui $a0, %hi(gCurrentCameraID)
/* E08E4 8014A1E4 8C847410 */ lw $a0, %lo(gCurrentCameraID)($a0)
/* E08E8 8014A1E8 44067000 */ mfc1 $a2, $f14
/* E08EC 8014A1EC 3C05800B */ lui $a1, %hi(gCameras)
/* E08F0 8014A1F0 24A51D80 */ addiu $a1, $a1, %lo(gCameras)
/* E08F4 8014A1F4 AFB10034 */ sw $s1, 0x34($sp)
/* E08F8 8014A1F8 AFA20018 */ sw $v0, 0x18($sp)
/* E08FC 8014A1FC 00041080 */ sll $v0, $a0, 2
/* E0900 8014A200 00441021 */ addu $v0, $v0, $a0
/* E0904 8014A204 00021080 */ sll $v0, $v0, 2
/* E0908 8014A208 00441023 */ subu $v0, $v0, $a0
/* E090C 8014A20C 000218C0 */ sll $v1, $v0, 3
/* E0910 8014A210 00431021 */ addu $v0, $v0, $v1
/* E0914 8014A214 000210C0 */ sll $v0, $v0, 3
/* E0918 8014A218 00458821 */ addu $s1, $v0, $a1
/* E091C 8014A21C 44056000 */ mfc1 $a1, $f12
/* E0920 8014A220 44070000 */ mfc1 $a3, $f0
/* E0924 8014A224 AFBF003C */ sw $ra, 0x3C($sp)
/* E0928 8014A228 0C00B94E */ jal get_screen_coords
/* E092C 8014A22C 00000000 */ nop
/* E0930 8014A230 8FA20020 */ lw $v0, 0x20($sp)
/* E0934 8014A234 24420BB8 */ addiu $v0, $v0, 0xBB8
/* E0938 8014A238 2C421771 */ sltiu $v0, $v0, 0x1771
/* E093C 8014A23C 10400008 */ beqz $v0, .L8014A260
/* E0940 8014A240 24020001 */ addiu $v0, $zero, 0x1
/* E0944 8014A244 8FA30024 */ lw $v1, 0x24($sp)
/* E0948 8014A248 28620BB9 */ slti $v0, $v1, 0xBB9
/* E094C 8014A24C 10400003 */ beqz $v0, .L8014A25C
/* E0950 8014A250 2862F448 */ slti $v0, $v1, -0xBB8
/* E0954 8014A254 10400005 */ beqz $v0, .L8014A26C
/* E0958 8014A258 2405007F */ addiu $a1, $zero, 0x7F
.L8014A25C:
/* E095C 8014A25C 24020001 */ addiu $v0, $zero, 0x1
.L8014A260:
/* E0960 8014A260 A6020000 */ sh $v0, 0x0($s0)
/* E0964 8014A264 08052903 */ j .L8014A40C
/* E0968 8014A268 A6400000 */ sh $zero, 0x0($s2)
.L8014A26C:
/* E096C 8014A26C A6050000 */ sh $a1, 0x0($s0)
/* E0970 8014A270 8FA20020 */ lw $v0, 0x20($sp)
/* E0974 8014A274 04410012 */ bgez $v0, .L8014A2C0
/* E0978 8014A278 00000000 */ nop
/* E097C 8014A27C 3C013E99 */ lui $at, (0x3E99999A >> 16)
/* E0980 8014A280 3421999A */ ori $at, $at, (0x3E99999A & 0xFFFF)
/* E0984 8014A284 44811000 */ mtc1 $at, $f2
/* E0988 8014A288 44820000 */ mtc1 $v0, $f0
/* E098C 8014A28C 00000000 */ nop
/* E0990 8014A290 46800020 */ cvt.s.w $f0, $f0
/* E0994 8014A294 46020002 */ mul.s $f0, $f0, $f2
/* E0998 8014A298 00000000 */ nop
/* E099C 8014A29C 3C0142FE */ lui $at, (0x42FE0000 >> 16)
/* E09A0 8014A2A0 44811000 */ mtc1 $at, $f2
/* E09A4 8014A2A4 00000000 */ nop
/* E09A8 8014A2A8 46020000 */ add.s $f0, $f0, $f2
/* E09AC 8014A2AC 4600018D */ trunc.w.s $f6, $f0
/* E09B0 8014A2B0 44023000 */ mfc1 $v0, $f6
/* E09B4 8014A2B4 00000000 */ nop
/* E09B8 8014A2B8 A6020000 */ sh $v0, 0x0($s0)
/* E09BC 8014A2BC AFA00020 */ sw $zero, 0x20($sp)
.L8014A2C0:
/* E09C0 8014A2C0 8624000A */ lh $a0, 0xA($s1)
/* E09C4 8014A2C4 8FA30020 */ lw $v1, 0x20($sp)
/* E09C8 8014A2C8 0083102A */ slt $v0, $a0, $v1
/* E09CC 8014A2CC 10400013 */ beqz $v0, .L8014A31C
/* E09D0 8014A2D0 00641023 */ subu $v0, $v1, $a0
/* E09D4 8014A2D4 3C013E99 */ lui $at, (0x3E99999A >> 16)
/* E09D8 8014A2D8 3421999A */ ori $at, $at, (0x3E99999A & 0xFFFF)
/* E09DC 8014A2DC 44810000 */ mtc1 $at, $f0
/* E09E0 8014A2E0 44821000 */ mtc1 $v0, $f2
/* E09E4 8014A2E4 00000000 */ nop
/* E09E8 8014A2E8 468010A0 */ cvt.s.w $f2, $f2
/* E09EC 8014A2EC 46001082 */ mul.s $f2, $f2, $f0
/* E09F0 8014A2F0 00000000 */ nop
/* E09F4 8014A2F4 3C0142FE */ lui $at, (0x42FE0000 >> 16)
/* E09F8 8014A2F8 44810000 */ mtc1 $at, $f0
/* E09FC 8014A2FC 00000000 */ nop
/* E0A00 8014A300 46020001 */ sub.s $f0, $f0, $f2
/* E0A04 8014A304 4600018D */ trunc.w.s $f6, $f0
/* E0A08 8014A308 44023000 */ mfc1 $v0, $f6
/* E0A0C 8014A30C 00000000 */ nop
/* E0A10 8014A310 A6020000 */ sh $v0, 0x0($s0)
/* E0A14 8014A314 8622000A */ lh $v0, 0xA($s1)
/* E0A18 8014A318 AFA20020 */ sw $v0, 0x20($sp)
.L8014A31C:
/* E0A1C 8014A31C 24031388 */ addiu $v1, $zero, 0x1388
/* E0A20 8014A320 8FA20028 */ lw $v0, 0x28($sp)
/* E0A24 8014A324 3C01447A */ lui $at, (0x447A0000 >> 16)
/* E0A28 8014A328 44811000 */ mtc1 $at, $f2
/* E0A2C 8014A32C 00621823 */ subu $v1, $v1, $v0
/* E0A30 8014A330 44830000 */ mtc1 $v1, $f0
/* E0A34 8014A334 00000000 */ nop
/* E0A38 8014A338 46800020 */ cvt.s.w $f0, $f0
/* E0A3C 8014A33C 46000005 */ abs.s $f0, $f0
/* E0A40 8014A340 4600103C */ c.lt.s $f2, $f0
/* E0A44 8014A344 00000000 */ nop
/* E0A48 8014A348 45030001 */ bc1tl .L8014A350
/* E0A4C 8014A34C 46001006 */ mov.s $f0, $f2
.L8014A350:
/* E0A50 8014A350 3C0144BB */ lui $at, (0x44BB8000 >> 16)
/* E0A54 8014A354 34218000 */ ori $at, $at, (0x44BB8000 & 0xFFFF)
/* E0A58 8014A358 44811000 */ mtc1 $at, $f2
/* E0A5C 8014A35C 86020000 */ lh $v0, 0x0($s0)
/* E0A60 8014A360 46001081 */ sub.s $f2, $f2, $f0
/* E0A64 8014A364 44820000 */ mtc1 $v0, $f0
/* E0A68 8014A368 00000000 */ nop
/* E0A6C 8014A36C 46800020 */ cvt.s.w $f0, $f0
/* E0A70 8014A370 46020002 */ mul.s $f0, $f0, $f2
/* E0A74 8014A374 00000000 */ nop
/* E0A78 8014A378 3C013A83 */ lui $at, (0x3A83126F >> 16)
/* E0A7C 8014A37C 3421126F */ ori $at, $at, (0x3A83126F & 0xFFFF)
/* E0A80 8014A380 44811000 */ mtc1 $at, $f2
/* E0A84 8014A384 00000000 */ nop
/* E0A88 8014A388 46020002 */ mul.s $f0, $f0, $f2
/* E0A8C 8014A38C 00000000 */ nop
/* E0A90 8014A390 4600018D */ trunc.w.s $f6, $f0
/* E0A94 8014A394 44023000 */ mfc1 $v0, $f6
/* E0A98 8014A398 00000000 */ nop
/* E0A9C 8014A39C A6020000 */ sh $v0, 0x0($s0)
/* E0AA0 8014A3A0 00021400 */ sll $v0, $v0, 16
/* E0AA4 8014A3A4 00021403 */ sra $v0, $v0, 16
/* E0AA8 8014A3A8 28420080 */ slti $v0, $v0, 0x80
/* E0AAC 8014A3AC 50400001 */ beql $v0, $zero, .L8014A3B4
/* E0AB0 8014A3B0 A6050000 */ sh $a1, 0x0($s0)
.L8014A3B4:
/* E0AB4 8014A3B4 86020000 */ lh $v0, 0x0($s0)
/* E0AB8 8014A3B8 1C400002 */ bgtz $v0, .L8014A3C4
/* E0ABC 8014A3BC 24020001 */ addiu $v0, $zero, 0x1
/* E0AC0 8014A3C0 A6020000 */ sh $v0, 0x0($s0)
.L8014A3C4:
/* E0AC4 8014A3C4 3C014280 */ lui $at, (0x42800000 >> 16)
/* E0AC8 8014A3C8 44811000 */ mtc1 $at, $f2
/* E0ACC 8014A3CC C7A00020 */ lwc1 $f0, 0x20($sp)
/* E0AD0 8014A3D0 46800020 */ cvt.s.w $f0, $f0
/* E0AD4 8014A3D4 46020002 */ mul.s $f0, $f0, $f2
/* E0AD8 8014A3D8 00000000 */ nop
/* E0ADC 8014A3DC 8622000A */ lh $v0, 0xA($s1)
/* E0AE0 8014A3E0 3C014200 */ lui $at, (0x42000000 >> 16)
/* E0AE4 8014A3E4 44812000 */ mtc1 $at, $f4
/* E0AE8 8014A3E8 44821000 */ mtc1 $v0, $f2
/* E0AEC 8014A3EC 00000000 */ nop
/* E0AF0 8014A3F0 468010A0 */ cvt.s.w $f2, $f2
/* E0AF4 8014A3F4 46020003 */ div.s $f0, $f0, $f2
/* E0AF8 8014A3F8 46040000 */ add.s $f0, $f0, $f4
/* E0AFC 8014A3FC 4600018D */ trunc.w.s $f6, $f0
/* E0B00 8014A400 44023000 */ mfc1 $v0, $f6
/* E0B04 8014A404 00000000 */ nop
/* E0B08 8014A408 A6420000 */ sh $v0, 0x0($s2)
.L8014A40C:
/* E0B0C 8014A40C 8FBF003C */ lw $ra, 0x3C($sp)
/* E0B10 8014A410 8FB20038 */ lw $s2, 0x38($sp)
/* E0B14 8014A414 8FB10034 */ lw $s1, 0x34($sp)
/* E0B18 8014A418 8FB00030 */ lw $s0, 0x30($sp)
/* E0B1C 8014A41C 03E00008 */ jr $ra
/* E0B20 8014A420 27BD0040 */ addiu $sp, $sp, 0x40
/* E0B24 8014A424 00000000 */ nop
/* E0B28 8014A428 00000000 */ nop
/* E0B2C 8014A42C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void sfx_compute_spatialized_sound_params_1(f32 x, f32 y, f32 z, s16* volume, s16* pan) {
Camera* camera = &gCameras[gCurrentCameraID];
s32 screenX, screenY, screenZ;
f32 depth;
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
if (screenX > 3000 || screenX < -3000 || screenY > 3000 || screenY < -3000) {
*volume = 1;
*pan = 0;
return;
}
*volume = 127;
if (screenX < 0) {
*volume = (screenX * 0.3f) + 127.0f;
screenX = 0;
}
if (camera->viewportW < screenX) {
*volume = 127.0f - ((screenX - camera->viewportW) * 0.3f);
screenX = camera->viewportW;
}
depth = fabsf(5000 - screenZ);
if (depth > 1000.0f) {
depth = 1000.0f;
}
*volume = *volume * (1500.0f - depth) * 0.001f;
if (*volume > 127) {
*volume = 127;
}
if (*volume < 1) {
*volume = 1;
}
*pan = ((screenX * 64.0f) / camera->viewportW) + 32.0f;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel explosion_update
/* 343858 E00321D8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 34385C E00321DC AFBF0024 */ sw $ra, 0x24($sp)
/* 343860 E00321E0 AFB20020 */ sw $s2, 0x20($sp)
/* 343864 E00321E4 AFB1001C */ sw $s1, 0x1C($sp)
/* 343868 E00321E8 AFB00018 */ sw $s0, 0x18($sp)
/* 34386C E00321EC 8C90000C */ lw $s0, 0xC($a0)
/* 343870 E00321F0 8E020030 */ lw $v0, 0x30($s0)
/* 343874 E00321F4 2442FFFF */ addiu $v0, $v0, -0x1
/* 343878 E00321F8 04410005 */ bgez $v0, .LE0032210
/* 34387C E00321FC AE020030 */ sw $v0, 0x30($s0)
/* 343880 E0032200 0C080128 */ jal shim_remove_effect
/* 343884 E0032204 00000000 */ nop
/* 343888 E0032208 0800C902 */ j .LE0032408
/* 34388C E003220C 00000000 */ nop
.LE0032210:
/* 343890 E0032210 8E020034 */ lw $v0, 0x34($s0)
/* 343894 E0032214 8E110000 */ lw $s1, 0x0($s0)
/* 343898 E0032218 24420001 */ addiu $v0, $v0, 0x1
/* 34389C E003221C 0040902D */ daddu $s2, $v0, $zero
/* 3438A0 E0032220 AE020034 */ sw $v0, 0x34($s0)
/* 3438A4 E0032224 24020007 */ addiu $v0, $zero, 0x7
/* 3438A8 E0032228 1642000A */ bne $s2, $v0, .LE0032254
/* 3438AC E003222C 24020001 */ addiu $v0, $zero, 0x1
/* 3438B0 E0032230 0C080150 */ jal shim_load_effect
/* 3438B4 E0032234 24040017 */ addiu $a0, $zero, 0x17
/* 3438B8 E0032238 8E050004 */ lw $a1, 0x4($s0)
/* 3438BC E003223C 8E060008 */ lw $a2, 0x8($s0)
/* 3438C0 E0032240 8E07000C */ lw $a3, 0xC($s0)
/* 3438C4 E0032244 0C00B800 */ jal smoke_ring_main
/* 3438C8 E0032248 0220202D */ daddu $a0, $s1, $zero
/* 3438CC E003224C 0800C8A4 */ j .LE0032290
/* 3438D0 E0032250 2610003C */ addiu $s0, $s0, 0x3C
.LE0032254:
/* 3438D4 E0032254 5642000E */ bnel $s2, $v0, .LE0032290
/* 3438D8 E0032258 2610003C */ addiu $s0, $s0, 0x3C
/* 3438DC E003225C 0C080150 */ jal shim_load_effect
/* 3438E0 E0032260 24040044 */ addiu $a0, $zero, 0x44
/* 3438E4 E0032264 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3438E8 E0032268 44810000 */ mtc1 $at, $f0
/* 3438EC E003226C 24020032 */ addiu $v0, $zero, 0x32
/* 3438F0 E0032270 AFA20014 */ sw $v0, 0x14($sp)
/* 3438F4 E0032274 E7A00010 */ swc1 $f0, 0x10($sp)
/* 3438F8 E0032278 8E050004 */ lw $a1, 0x4($s0)
/* 3438FC E003227C 8E060008 */ lw $a2, 0x8($s0)
/* 343900 E0032280 8E07000C */ lw $a3, 0xC($s0)
/* 343904 E0032284 0C02205F */ jal confetti_main
/* 343908 E0032288 26240004 */ addiu $a0, $s1, 0x4
/* 34390C E003228C 2610003C */ addiu $s0, $s0, 0x3C
.LE0032290:
/* 343910 E0032290 C6000020 */ lwc1 $f0, 0x20($s0)
/* 343914 E0032294 C6020024 */ lwc1 $f2, 0x24($s0)
/* 343918 E0032298 46020000 */ add.s $f0, $f0, $f2
/* 34391C E003229C 26030024 */ addiu $v1, $s0, 0x24
/* 343920 E00322A0 2A420008 */ slti $v0, $s2, 0x8
/* 343924 E00322A4 1040001D */ beqz $v0, .LE003231C
/* 343928 E00322A8 E6000020 */ swc1 $f0, 0x20($s0)
/* 34392C E00322AC 46001006 */ mov.s $f0, $f2
/* 343930 E00322B0 460000A1 */ cvt.d.s $f2, $f0
/* 343934 E00322B4 24020002 */ addiu $v0, $zero, 0x2
/* 343938 E00322B8 3C01E003 */ lui $at, (0xE00328C0 >> 16)
/* 34393C E00322BC D42028C0 */ ldc1 $f0, (0xE00328C0 & 0xFFFF)($at)
/* 343940 E00322C0 56220006 */ bnel $s1, $v0, .LE00322DC
/* 343944 E00322C4 46201000 */ add.d $f0, $f2, $f0
/* 343948 E00322C8 3C013FF0 */ lui $at, (0x3FF00000 >> 16)
/* 34394C E00322CC 44810800 */ mtc1 $at, $f1
/* 343950 E00322D0 44800000 */ mtc1 $zero, $f0
/* 343954 E00322D4 00000000 */ nop
/* 343958 E00322D8 46201000 */ add.d $f0, $f2, $f0
.LE00322DC:
/* 34395C E00322DC 46200020 */ cvt.s.d $f0, $f0
/* 343960 E00322E0 240200FF */ addiu $v0, $zero, 0xFF
/* 343964 E00322E4 E4600000 */ swc1 $f0, 0x0($v1)
/* 343968 E00322E8 8E030038 */ lw $v1, 0x38($s0)
/* 34396C E00322EC 3C01E003 */ lui $at, (0xE00328C8 >> 16)
/* 343970 E00322F0 D42228C8 */ ldc1 $f2, (0xE00328C8 & 0xFFFF)($at)
/* 343974 E00322F4 00431023 */ subu $v0, $v0, $v1
/* 343978 E00322F8 44820000 */ mtc1 $v0, $f0
/* 34397C E00322FC 00000000 */ nop
/* 343980 E0032300 46800021 */ cvt.d.w $f0, $f0
/* 343984 E0032304 46220002 */ mul.d $f0, $f0, $f2
/* 343988 E0032308 00000000 */ nop
/* 34398C E003230C 4620018D */ trunc.w.d $f6, $f0
/* 343990 E0032310 E6060038 */ swc1 $f6, 0x38($s0)
/* 343994 E0032314 0800C8D8 */ j .LE0032360
/* 343998 E0032318 2610003C */ addiu $s0, $s0, 0x3C
.LE003231C:
/* 34399C E003231C 3C01E003 */ lui $at, (0xE00328D0 >> 16)
/* 3439A0 E0032320 D42028D0 */ ldc1 $f0, (0xE00328D0 & 0xFFFF)($at)
/* 3439A4 E0032324 C6020038 */ lwc1 $f2, 0x38($s0)
/* 3439A8 E0032328 468010A1 */ cvt.d.w $f2, $f2
/* 3439AC E003232C 46201082 */ mul.d $f2, $f2, $f0
/* 3439B0 E0032330 00000000 */ nop
/* 3439B4 E0032334 C6000024 */ lwc1 $f0, 0x24($s0)
/* 3439B8 E0032338 3C01E003 */ lui $at, (0xE00328D8 >> 16)
/* 3439BC E003233C D42428D8 */ ldc1 $f4, (0xE00328D8 & 0xFFFF)($at)
/* 3439C0 E0032340 46000021 */ cvt.d.s $f0, $f0
/* 3439C4 E0032344 46240002 */ mul.d $f0, $f0, $f4
/* 3439C8 E0032348 00000000 */ nop
/* 3439CC E003234C 4620118D */ trunc.w.d $f6, $f2
/* 3439D0 E0032350 E6060038 */ swc1 $f6, 0x38($s0)
/* 3439D4 E0032354 46200020 */ cvt.s.d $f0, $f0
/* 3439D8 E0032358 E6000024 */ swc1 $f0, 0x24($s0)
/* 3439DC E003235C 2610003C */ addiu $s0, $s0, 0x3C
.LE0032360:
/* 3439E0 E0032360 2A420003 */ slti $v0, $s2, 0x3
/* 3439E4 E0032364 14400024 */ bnez $v0, .LE00323F8
/* 3439E8 E0032368 24020003 */ addiu $v0, $zero, 0x3
/* 3439EC E003236C 16420005 */ bne $s2, $v0, .LE0032384
/* 3439F0 E0032370 00000000 */ nop
/* 3439F4 E0032374 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3439F8 E0032378 44810000 */ mtc1 $at, $f0
/* 3439FC E003237C 00000000 */ nop
/* 343A00 E0032380 E6000020 */ swc1 $f0, 0x20($s0)
.LE0032384:
/* 343A04 E0032384 C6000020 */ lwc1 $f0, 0x20($s0)
/* 343A08 E0032388 C6020024 */ lwc1 $f2, 0x24($s0)
/* 343A0C E003238C 46020000 */ add.s $f0, $f0, $f2
/* 343A10 E0032390 2A420006 */ slti $v0, $s2, 0x6
/* 343A14 E0032394 10400007 */ beqz $v0, .LE00323B4
/* 343A18 E0032398 E6000020 */ swc1 $f0, 0x20($s0)
/* 343A1C E003239C 46001006 */ mov.s $f0, $f2
/* 343A20 E00323A0 3C01E003 */ lui $at, (0xE00328E0 >> 16)
/* 343A24 E00323A4 D42228E0 */ ldc1 $f2, (0xE00328E0 & 0xFFFF)($at)
/* 343A28 E00323A8 46000021 */ cvt.d.s $f0, $f0
/* 343A2C E00323AC 0800C8FC */ j .LE00323F0
/* 343A30 E00323B0 46220000 */ add.d $f0, $f0, $f2
.LE00323B4:
/* 343A34 E00323B4 3C01E003 */ lui $at, (0xE00328E8 >> 16)
/* 343A38 E00323B8 D42028E8 */ ldc1 $f0, (0xE00328E8 & 0xFFFF)($at)
/* 343A3C E00323BC C6020038 */ lwc1 $f2, 0x38($s0)
/* 343A40 E00323C0 468010A1 */ cvt.d.w $f2, $f2
/* 343A44 E00323C4 46201082 */ mul.d $f2, $f2, $f0
/* 343A48 E00323C8 00000000 */ nop
/* 343A4C E00323CC C6000024 */ lwc1 $f0, 0x24($s0)
/* 343A50 E00323D0 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 343A54 E00323D4 44812800 */ mtc1 $at, $f5
/* 343A58 E00323D8 44802000 */ mtc1 $zero, $f4
/* 343A5C E00323DC 46000021 */ cvt.d.s $f0, $f0
/* 343A60 E00323E0 46240002 */ mul.d $f0, $f0, $f4
/* 343A64 E00323E4 00000000 */ nop
/* 343A68 E00323E8 4620118D */ trunc.w.d $f6, $f2
/* 343A6C E00323EC E6060038 */ swc1 $f6, 0x38($s0)
.LE00323F0:
/* 343A70 E00323F0 46200020 */ cvt.s.d $f0, $f0
/* 343A74 E00323F4 E6000024 */ swc1 $f0, 0x24($s0)
.LE00323F8:
/* 343A78 E00323F8 C6000028 */ lwc1 $f0, 0x28($s0)
/* 343A7C E00323FC C602002C */ lwc1 $f2, 0x2C($s0)
/* 343A80 E0032400 46020000 */ add.s $f0, $f0, $f2
/* 343A84 E0032404 E6000028 */ swc1 $f0, 0x28($s0)
.LE0032408:
/* 343A88 E0032408 8FBF0024 */ lw $ra, 0x24($sp)
/* 343A8C E003240C 8FB20020 */ lw $s2, 0x20($sp)
/* 343A90 E0032410 8FB1001C */ lw $s1, 0x1C($sp)
/* 343A94 E0032414 8FB00018 */ lw $s0, 0x18($sp)
/* 343A98 E0032418 03E00008 */ jr $ra
/* 343A9C E003241C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void explosion_update(EffectInstance* effect) {
ExplosionFXData* part = effect->data.explosion;
s32 unk_00;
s32 unk_34;
part->unk_30--;
if (part->unk_30 < 0) {
shim_remove_effect(effect);
return;
}
part->unk_34++;
unk_00 = part->unk_00;
unk_34 = part->unk_34;
if (unk_34 == 7) {
shim_load_effect(EFFECT_SMOKE_RING);
smoke_ring_main(unk_00, part->pos.x, part->pos.y, part->pos.z);
} else if (unk_34 == 1) {
shim_load_effect(EFFECT_CONFETTI);
confetti_main(unk_00 + 4, part->pos.x, part->pos.y, part->pos.z, 1.0f, 50);
}
part++;
part->unk_20 += part->unk_24;
if (unk_34 < 8) {
part->unk_24 += (unk_00 == 2) ? 1.0f : 0.4;
part->unk_38 = (255 - part->unk_38) * 0.6;
} else {
part->unk_24 *= 0.6;
part->unk_38 *= 0.9;
}
part++;
if (unk_34 >= 3) {
if (unk_34 == 3) {
part->unk_20 = 1.0f;
}
part->unk_20 += part->unk_24;
if (unk_34 < 6) {
part->unk_24 += 0.1;
} else {
part->unk_24 *= 0.5;
part->unk_38 *= 0.9;
}
}
part->unk_28 += part->unk_2C;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel _Litob
/* 46D80 8006B980 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 46D84 8006B984 AFB10044 */ sw $s1, 0x44($sp)
/* 46D88 8006B988 00808821 */ addu $s1, $a0, $zero
/* 46D8C 8006B98C AFB60058 */ sw $s6, 0x58($sp)
/* 46D90 8006B990 3C168009 */ lui $s6, %hi(D_80095940)
/* 46D94 8006B994 26D65940 */ addiu $s6, $s6, %lo(D_80095940)
/* 46D98 8006B998 00A02021 */ addu $a0, $a1, $zero
/* 46D9C 8006B99C 00052E00 */ sll $a1, $a1, 24
/* 46DA0 8006B9A0 00052E03 */ sra $a1, $a1, 24
/* 46DA4 8006B9A4 24020058 */ addiu $v0, $zero, 0x58
/* 46DA8 8006B9A8 AFBF005C */ sw $ra, 0x5C($sp)
/* 46DAC 8006B9AC AFB50054 */ sw $s5, 0x54($sp)
/* 46DB0 8006B9B0 AFB40050 */ sw $s4, 0x50($sp)
/* 46DB4 8006B9B4 AFB3004C */ sw $s3, 0x4C($sp)
/* 46DB8 8006B9B8 AFB20048 */ sw $s2, 0x48($sp)
/* 46DBC 8006B9BC 14A20003 */ bne $a1, $v0, .L8006B9CC
/* 46DC0 8006B9C0 AFB00040 */ sw $s0, 0x40($sp)
/* 46DC4 8006B9C4 3C168009 */ lui $s6, %hi(D_80095954)
/* 46DC8 8006B9C8 26D65954 */ addiu $s6, $s6, %lo(D_80095954)
.L8006B9CC:
/* 46DCC 8006B9CC 2402006F */ addiu $v0, $zero, 0x6F
/* 46DD0 8006B9D0 10A20009 */ beq $a1, $v0, .L8006B9F8
/* 46DD4 8006B9D4 38A30078 */ xori $v1, $a1, 0x78
/* 46DD8 8006B9D8 0003182B */ sltu $v1, $zero, $v1
/* 46DDC 8006B9DC 38A20058 */ xori $v0, $a1, 0x58
/* 46DE0 8006B9E0 0002102B */ sltu $v0, $zero, $v0
/* 46DE4 8006B9E4 00621824 */ and $v1, $v1, $v0
/* 46DE8 8006B9E8 10600004 */ beqz $v1, .L8006B9FC
/* 46DEC 8006B9EC 24130010 */ addiu $s3, $zero, 0x10
/* 46DF0 8006B9F0 0801AE7F */ j .L8006B9FC
/* 46DF4 8006B9F4 2413000A */ addiu $s3, $zero, 0xA
.L8006B9F8:
/* 46DF8 8006B9F8 24130008 */ addiu $s3, $zero, 0x8
.L8006B9FC:
/* 46DFC 8006B9FC 8E340000 */ lw $s4, 0x0($s1)
/* 46E00 8006BA00 8E350004 */ lw $s5, 0x4($s1)
/* 46E04 8006BA04 00041600 */ sll $v0, $a0, 24
/* 46E08 8006BA08 00021603 */ sra $v0, $v0, 24
/* 46E0C 8006BA0C 38430064 */ xori $v1, $v0, 0x64
/* 46E10 8006BA10 2C630001 */ sltiu $v1, $v1, 0x1
/* 46E14 8006BA14 38420069 */ xori $v0, $v0, 0x69
/* 46E18 8006BA18 2C420001 */ sltiu $v0, $v0, 0x1
/* 46E1C 8006BA1C 00621825 */ or $v1, $v1, $v0
/* 46E20 8006BA20 10600008 */ beqz $v1, .L8006BA44
/* 46E24 8006BA24 24120018 */ addiu $s2, $zero, 0x18
/* 46E28 8006BA28 8E220000 */ lw $v0, 0x0($s1)
/* 46E2C 8006BA2C 04410005 */ bgez $v0, .L8006BA44
/* 46E30 8006BA30 00000000 */ nop
/* 46E34 8006BA34 0015A823 */ negu $s5, $s5
/* 46E38 8006BA38 0014A023 */ negu $s4, $s4
/* 46E3C 8006BA3C 0015102B */ sltu $v0, $zero, $s5
/* 46E40 8006BA40 0282A023 */ subu $s4, $s4, $v0
.L8006BA44:
/* 46E44 8006BA44 56800007 */ bnel $s4, $zero, .L8006BA64
/* 46E48 8006BA48 2652FFFF */ addiu $s2, $s2, -0x1
/* 46E4C 8006BA4C 56A00005 */ bnel $s5, $zero, .L8006BA64
/* 46E50 8006BA50 2652FFFF */ addiu $s2, $s2, -0x1
/* 46E54 8006BA54 8E220024 */ lw $v0, 0x24($s1)
/* 46E58 8006BA58 1040000D */ beqz $v0, .L8006BA90
/* 46E5C 8006BA5C 02603821 */ addu $a3, $s3, $zero
/* 46E60 8006BA60 2652FFFF */ addiu $s2, $s2, -0x1
.L8006BA64:
/* 46E64 8006BA64 02603821 */ addu $a3, $s3, $zero
/* 46E68 8006BA68 00003021 */ addu $a2, $zero, $zero
/* 46E6C 8006BA6C 02802021 */ addu $a0, $s4, $zero
/* 46E70 8006BA70 02A02821 */ addu $a1, $s5, $zero
/* 46E74 8006BA74 27B00018 */ addiu $s0, $sp, 0x18
/* 46E78 8006BA78 0C01BA1C */ jal __umoddi3
/* 46E7C 8006BA7C 02128021 */ addu $s0, $s0, $s2
/* 46E80 8006BA80 02C31021 */ addu $v0, $s6, $v1
/* 46E84 8006BA84 90420000 */ lbu $v0, 0x0($v0)
/* 46E88 8006BA88 A2020000 */ sb $v0, 0x0($s0)
/* 46E8C 8006BA8C 02603821 */ addu $a3, $s3, $zero
.L8006BA90:
/* 46E90 8006BA90 00003021 */ addu $a2, $zero, $zero
/* 46E94 8006BA94 02802021 */ addu $a0, $s4, $zero
/* 46E98 8006BA98 0C01B8C4 */ jal __udivdi3
/* 46E9C 8006BA9C 02A02821 */ addu $a1, $s5, $zero
/* 46EA0 8006BAA0 AE220000 */ sw $v0, 0x0($s1)
/* 46EA4 8006BAA4 AE230004 */ sw $v1, 0x4($s1)
/* 46EA8 8006BAA8 27A20018 */ addiu $v0, $sp, 0x18
/* 46EAC 8006BAAC 02428021 */ addu $s0, $s2, $v0
.L8006BAB0:
/* 46EB0 8006BAB0 8E220000 */ lw $v0, 0x0($s1)
/* 46EB4 8006BAB4 1C400006 */ bgtz $v0, .L8006BAD0
/* 46EB8 8006BAB8 00001821 */ addu $v1, $zero, $zero
/* 46EBC 8006BABC 14400006 */ bnez $v0, .L8006BAD8
/* 46EC0 8006BAC0 0012102A */ slt $v0, $zero, $s2
/* 46EC4 8006BAC4 8E220004 */ lw $v0, 0x4($s1)
/* 46EC8 8006BAC8 10400003 */ beqz $v0, .L8006BAD8
/* 46ECC 8006BACC 0012102A */ slt $v0, $zero, $s2
.L8006BAD0:
/* 46ED0 8006BAD0 24030001 */ addiu $v1, $zero, 0x1
/* 46ED4 8006BAD4 0012102A */ slt $v0, $zero, $s2
.L8006BAD8:
/* 46ED8 8006BAD8 00621024 */ and $v0, $v1, $v0
/* 46EDC 8006BADC 10400014 */ beqz $v0, .L8006BB30
/* 46EE0 8006BAE0 02601821 */ addu $v1, $s3, $zero
/* 46EE4 8006BAE4 8E260000 */ lw $a2, 0x0($s1)
/* 46EE8 8006BAE8 8E270004 */ lw $a3, 0x4($s1)
/* 46EEC 8006BAEC 001317C3 */ sra $v0, $s3, 31
/* 46EF0 8006BAF0 AFA20010 */ sw $v0, 0x10($sp)
/* 46EF4 8006BAF4 AFA30014 */ sw $v1, 0x14($sp)
/* 46EF8 8006BAF8 0C01B5A9 */ jal lldiv
/* 46EFC 8006BAFC 27A40030 */ addiu $a0, $sp, 0x30
/* 46F00 8006BB00 8FA20030 */ lw $v0, 0x30($sp)
/* 46F04 8006BB04 8FA30034 */ lw $v1, 0x34($sp)
/* 46F08 8006BB08 AE220000 */ sw $v0, 0x0($s1)
/* 46F0C 8006BB0C AE230004 */ sw $v1, 0x4($s1)
/* 46F10 8006BB10 8FA20038 */ lw $v0, 0x38($sp)
/* 46F14 8006BB14 8FA3003C */ lw $v1, 0x3C($sp)
/* 46F18 8006BB18 02C31021 */ addu $v0, $s6, $v1
/* 46F1C 8006BB1C 90420000 */ lbu $v0, 0x0($v0)
/* 46F20 8006BB20 2610FFFF */ addiu $s0, $s0, -0x1
/* 46F24 8006BB24 2652FFFF */ addiu $s2, $s2, -0x1
/* 46F28 8006BB28 0801AEAC */ j .L8006BAB0
/* 46F2C 8006BB2C A2020000 */ sb $v0, 0x0($s0)
.L8006BB30:
/* 46F30 8006BB30 8E240008 */ lw $a0, 0x8($s1)
/* 46F34 8006BB34 27A50018 */ addiu $a1, $sp, 0x18
/* 46F38 8006BB38 00B22821 */ addu $a1, $a1, $s2
/* 46F3C 8006BB3C 24060018 */ addiu $a2, $zero, 0x18
/* 46F40 8006BB40 00D23023 */ subu $a2, $a2, $s2
/* 46F44 8006BB44 0C01929D */ jal memcpy
/* 46F48 8006BB48 AE260014 */ sw $a2, 0x14($s1)
/* 46F4C 8006BB4C 8E240014 */ lw $a0, 0x14($s1)
/* 46F50 8006BB50 8E230024 */ lw $v1, 0x24($s1)
/* 46F54 8006BB54 0083102A */ slt $v0, $a0, $v1
/* 46F58 8006BB58 10400002 */ beqz $v0, .L8006BB64
/* 46F5C 8006BB5C 00641023 */ subu $v0, $v1, $a0
/* 46F60 8006BB60 AE220010 */ sw $v0, 0x10($s1)
.L8006BB64:
/* 46F64 8006BB64 8E220024 */ lw $v0, 0x24($s1)
/* 46F68 8006BB68 0441000F */ bgez $v0, .L8006BBA8
/* 46F6C 8006BB6C 24030010 */ addiu $v1, $zero, 0x10
/* 46F70 8006BB70 8E220030 */ lw $v0, 0x30($s1)
/* 46F74 8006BB74 30420014 */ andi $v0, $v0, 0x14
/* 46F78 8006BB78 1443000B */ bne $v0, $v1, .L8006BBA8
/* 46F7C 8006BB7C 00000000 */ nop
/* 46F80 8006BB80 8E220028 */ lw $v0, 0x28($s1)
/* 46F84 8006BB84 8E23000C */ lw $v1, 0xC($s1)
/* 46F88 8006BB88 8E250010 */ lw $a1, 0x10($s1)
/* 46F8C 8006BB8C 8E240014 */ lw $a0, 0x14($s1)
/* 46F90 8006BB90 00431023 */ subu $v0, $v0, $v1
/* 46F94 8006BB94 00451023 */ subu $v0, $v0, $a1
/* 46F98 8006BB98 00449023 */ subu $s2, $v0, $a0
/* 46F9C 8006BB9C 1A400002 */ blez $s2, .L8006BBA8
/* 46FA0 8006BBA0 00B21021 */ addu $v0, $a1, $s2
/* 46FA4 8006BBA4 AE220010 */ sw $v0, 0x10($s1)
.L8006BBA8:
/* 46FA8 8006BBA8 8FBF005C */ lw $ra, 0x5C($sp)
/* 46FAC 8006BBAC 8FB60058 */ lw $s6, 0x58($sp)
/* 46FB0 8006BBB0 8FB50054 */ lw $s5, 0x54($sp)
/* 46FB4 8006BBB4 8FB40050 */ lw $s4, 0x50($sp)
/* 46FB8 8006BBB8 8FB3004C */ lw $s3, 0x4C($sp)
/* 46FBC 8006BBBC 8FB20048 */ lw $s2, 0x48($sp)
/* 46FC0 8006BBC0 8FB10044 */ lw $s1, 0x44($sp)
/* 46FC4 8006BBC4 8FB00040 */ lw $s0, 0x40($sp)
/* 46FC8 8006BBC8 03E00008 */ jr $ra
/* 46FCC 8006BBCC 27BD0060 */ addiu $sp, $sp, 0x60
### DECOMPILED C INSTRUCTIONS:
void _Litob(_Pft *args, char type) {
char buff[BUFF_LEN];
const char *digs;
s32 base;
s32 i;
unsigned long long ullval;
if (type == 'X') {
digs = udigs;
} else {
digs = ldigs;
}
base = (type == 'o') ? 8 : ((type != 'x' && type != 'X') ? 10 : 16);
i = BUFF_LEN;
ullval = args->v.ll;
if ((type == 'd' || type == 'i') && args->v.ll < 0) {
ullval = -ullval;
}
if (ullval != 0 || args->prec != 0) {
buff[--i] = digs[ullval % base];
}
args->v.ll = ullval / base;
while (args->v.ll > 0 && i > 0) {
lldiv_t qr = lldiv(args->v.ll, base);
args->v.ll = qr.quot;
buff[--i] = digs[qr.rem];
}
args->n1 = BUFF_LEN - i;
memcpy(args->s, buff + i, args->n1);
if (args->n1 < args->prec) {
args->nz0 = args->prec - args->n1;
}
if (args->prec < 0 && (args->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) {
i = args->width - args->n0 - args->nz0 - args->n1;
if (i > 0) {
args->nz0 += i;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_update_clients_2
/* 2E7D0 800533D0 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 2E7D4 800533D4 AFB20018 */ sw $s2, 0x18($sp)
/* 2E7D8 800533D8 3C12800A */ lui $s2, %hi(gSoundGlobals)
/* 2E7DC 800533DC 8E52A5C0 */ lw $s2, %lo(gSoundGlobals)($s2)
/* 2E7E0 800533E0 AFB10014 */ sw $s1, 0x14($sp)
/* 2E7E4 800533E4 3C11800A */ lui $s1, %hi(gSoundManager)
/* 2E7E8 800533E8 8E31A640 */ lw $s1, %lo(gSoundManager)($s1)
/* 2E7EC 800533EC AFB00010 */ sw $s0, 0x10($sp)
/* 2E7F0 800533F0 3C10800A */ lui $s0, %hi(gAuAmbienceManager)
/* 2E7F4 800533F4 8E10A628 */ lw $s0, %lo(gAuAmbienceManager)($s0)
/* 2E7F8 800533F8 AFBF001C */ sw $ra, 0x1C($sp)
/* 2E7FC 800533FC 0C014D95 */ jal au_syn_update
/* 2E800 80053400 0240202D */ daddu $a0, $s2, $zero
/* 2E804 80053404 8E03000C */ lw $v1, 0xC($s0)
/* 2E808 80053408 8E020004 */ lw $v0, 0x4($s0)
/* 2E80C 8005340C 00621823 */ subu $v1, $v1, $v0
/* 2E810 80053410 1C600006 */ bgtz $v1, .L8005342C
/* 2E814 80053414 AE03000C */ sw $v1, 0xC($s0)
/* 2E818 80053418 8E020008 */ lw $v0, 0x8($s0)
/* 2E81C 8005341C 0200202D */ daddu $a0, $s0, $zero
/* 2E820 80053420 00621021 */ addu $v0, $v1, $v0
/* 2E824 80053424 0C01446F */ jal au_amb_manager_update
/* 2E828 80053428 AC82000C */ sw $v0, 0xC($a0)
.L8005342C:
/* 2E82C 8005342C 8622004A */ lh $v0, 0x4A($s1)
/* 2E830 80053430 10400007 */ beqz $v0, .L80053450
/* 2E834 80053434 00000000 */ nop
/* 2E838 80053438 0C014E8A */ jal au_fade_update
/* 2E83C 8005343C 26240040 */ addiu $a0, $s1, 0x40
/* 2E840 80053440 922400BE */ lbu $a0, 0xBE($s1)
/* 2E844 80053444 96250040 */ lhu $a1, 0x40($s1)
/* 2E848 80053448 0C014EA6 */ jal au_fade_set_volume
/* 2E84C 8005344C 8E26005C */ lw $a2, 0x5C($s1)
.L80053450:
/* 2E850 80053450 8E23003C */ lw $v1, 0x3C($s1)
/* 2E854 80053454 8E220034 */ lw $v0, 0x34($s1)
/* 2E858 80053458 00621823 */ subu $v1, $v1, $v0
/* 2E85C 8005345C 1C600007 */ bgtz $v1, .L8005347C
/* 2E860 80053460 AE23003C */ sw $v1, 0x3C($s1)
/* 2E864 80053464 8E220038 */ lw $v0, 0x38($s1)
/* 2E868 80053468 0220202D */ daddu $a0, $s1, $zero
/* 2E86C 8005346C 00621021 */ addu $v0, $v1, $v0
/* 2E870 80053470 0C013111 */ jal au_sfx_manager_update
/* 2E874 80053474 AE22003C */ sw $v0, 0x3C($s1)
/* 2E878 80053478 A62200BA */ sh $v0, 0xBA($s1)
.L8005347C:
/* 2E87C 8005347C 3C118008 */ lui $s1, %hi(PreventBGMPlayerUpdate)
/* 2E880 80053480 26318DB0 */ addiu $s1, $s1, %lo(PreventBGMPlayerUpdate)
/* 2E884 80053484 8E220000 */ lw $v0, 0x0($s1)
/* 2E888 80053488 14400045 */ bnez $v0, .L800535A0
/* 2E88C 8005348C 00000000 */ nop
/* 2E890 80053490 3C10800A */ lui $s0, %hi(gBGMPlayerB)
/* 2E894 80053494 8E10A5FC */ lw $s0, %lo(gBGMPlayerB)($s0)
/* 2E898 80053498 86020036 */ lh $v0, 0x36($s0)
/* 2E89C 8005349C 10400003 */ beqz $v0, .L800534AC
/* 2E8A0 800534A0 00000000 */ nop
/* 2E8A4 800534A4 0C0138E9 */ jal au_bgm_update_fade
/* 2E8A8 800534A8 0200202D */ daddu $a0, $s0, $zero
.L800534AC:
/* 2E8AC 800534AC 8E02001C */ lw $v0, 0x1C($s0)
/* 2E8B0 800534B0 10400004 */ beqz $v0, .L800534C4
/* 2E8B4 800534B4 00000000 */ nop
/* 2E8B8 800534B8 8E020018 */ lw $v0, 0x18($s0)
/* 2E8BC 800534BC 24420001 */ addiu $v0, $v0, 0x1
/* 2E8C0 800534C0 AE020018 */ sw $v0, 0x18($s0)
.L800534C4:
/* 2E8C4 800534C4 8E030010 */ lw $v1, 0x10($s0)
/* 2E8C8 800534C8 8E020008 */ lw $v0, 0x8($s0)
/* 2E8CC 800534CC 00621823 */ subu $v1, $v1, $v0
/* 2E8D0 800534D0 1C600007 */ bgtz $v1, .L800534F0
/* 2E8D4 800534D4 AE030010 */ sw $v1, 0x10($s0)
/* 2E8D8 800534D8 8E02000C */ lw $v0, 0xC($s0)
/* 2E8DC 800534DC 0200202D */ daddu $a0, $s0, $zero
/* 2E8E0 800534E0 00621021 */ addu $v0, $v1, $v0
/* 2E8E4 800534E4 0C01392E */ jal func_8004E4B8
/* 2E8E8 800534E8 AE020010 */ sw $v0, 0x10($s0)
/* 2E8EC 800534EC A602005C */ sh $v0, 0x5C($s0)
.L800534F0:
/* 2E8F0 800534F0 8E220000 */ lw $v0, 0x0($s1)
/* 2E8F4 800534F4 1440002A */ bnez $v0, .L800535A0
/* 2E8F8 800534F8 00000000 */ nop
/* 2E8FC 800534FC 8E420080 */ lw $v0, 0x80($s2)
/* 2E900 80053500 10400003 */ beqz $v0, .L80053510
/* 2E904 80053504 00000000 */ nop
/* 2E908 80053508 0C0137F5 */ jal func_8004DFD4
/* 2E90C 8005350C 0240202D */ daddu $a0, $s2, $zero
.L80053510:
/* 2E910 80053510 3C10800A */ lui $s0, %hi(gBGMPlayerA)
/* 2E914 80053514 8E10A664 */ lw $s0, %lo(gBGMPlayerA)($s0)
/* 2E918 80053518 86020046 */ lh $v0, 0x46($s0)
/* 2E91C 8005351C 1040000A */ beqz $v0, .L80053548
/* 2E920 80053520 00000000 */ nop
/* 2E924 80053524 0C014EEA */ jal func_80053BA8
/* 2E928 80053528 2604002C */ addiu $a0, $s0, 0x2C
/* 2E92C 8005352C 86020036 */ lh $v0, 0x36($s0)
/* 2E930 80053530 14400008 */ bnez $v0, .L80053554
/* 2E934 80053534 00000000 */ nop
/* 2E938 80053538 0C013911 */ jal func_8004E444
/* 2E93C 8005353C 0200202D */ daddu $a0, $s0, $zero
/* 2E940 80053540 08014D57 */ j .L8005355C
/* 2E944 80053544 00000000 */ nop
.L80053548:
/* 2E948 80053548 86020036 */ lh $v0, 0x36($s0)
/* 2E94C 8005354C 10400003 */ beqz $v0, .L8005355C
/* 2E950 80053550 00000000 */ nop
.L80053554:
/* 2E954 80053554 0C0138E9 */ jal au_bgm_update_fade
/* 2E958 80053558 0200202D */ daddu $a0, $s0, $zero
.L8005355C:
/* 2E95C 8005355C 8E02001C */ lw $v0, 0x1C($s0)
/* 2E960 80053560 10400004 */ beqz $v0, .L80053574
/* 2E964 80053564 00000000 */ nop
/* 2E968 80053568 8E020018 */ lw $v0, 0x18($s0)
/* 2E96C 8005356C 24420001 */ addiu $v0, $v0, 0x1
/* 2E970 80053570 AE020018 */ sw $v0, 0x18($s0)
.L80053574:
/* 2E974 80053574 8E030010 */ lw $v1, 0x10($s0)
/* 2E978 80053578 8E020008 */ lw $v0, 0x8($s0)
/* 2E97C 8005357C 00621823 */ subu $v1, $v1, $v0
/* 2E980 80053580 1C600007 */ bgtz $v1, .L800535A0
/* 2E984 80053584 AE030010 */ sw $v1, 0x10($s0)
/* 2E988 80053588 8E02000C */ lw $v0, 0xC($s0)
/* 2E98C 8005358C 0200202D */ daddu $a0, $s0, $zero
/* 2E990 80053590 00621021 */ addu $v0, $v1, $v0
/* 2E994 80053594 0C01392E */ jal func_8004E4B8
/* 2E998 80053598 AE020010 */ sw $v0, 0x10($s0)
/* 2E99C 8005359C A602005C */ sh $v0, 0x5C($s0)
.L800535A0:
/* 2E9A0 800535A0 0C014998 */ jal func_80052660
/* 2E9A4 800535A4 0240202D */ daddu $a0, $s2, $zero
/* 2E9A8 800535A8 8FBF001C */ lw $ra, 0x1C($sp)
/* 2E9AC 800535AC 8FB20018 */ lw $s2, 0x18($sp)
/* 2E9B0 800535B0 8FB10014 */ lw $s1, 0x14($sp)
/* 2E9B4 800535B4 8FB00010 */ lw $s0, 0x10($sp)
/* 2E9B8 800535B8 03E00008 */ jr $ra
/* 2E9BC 800535BC 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void au_update_clients_2(void) {
AuGlobals* globals = gSoundGlobals;
SoundManager* sfxManager = gSoundManager;
AmbienceManager* ambManager = gAuAmbienceManager;
BGMPlayer* bgmPlayer;
au_syn_update(globals);
ambManager->nextUpdateCounter -= ambManager->nextUpdateStep;
if (ambManager->nextUpdateCounter <= 0) {
ambManager->nextUpdateCounter += ambManager->nextUpdateInterval;
au_amb_manager_update(ambManager);
}
if (sfxManager->fadeInfo.fadeTime != 0) {
au_fade_update(&sfxManager->fadeInfo);
au_fade_set_volume(sfxManager->busId, sfxManager->fadeInfo.currentVolume.u16, sfxManager->busVolume);
}
sfxManager->nextUpdateCounter -= sfxManager->nextUpdateStep;
if (sfxManager->nextUpdateCounter <= 0) {
sfxManager->nextUpdateCounter += sfxManager->nextUpdateInterval;
sfxManager->unk_BA = au_sfx_manager_update(sfxManager);
}
// update gBGMPlayerB
if (!PreventBGMPlayerUpdate) {
bgmPlayer = gBGMPlayerB;
if (bgmPlayer->fadeInfo.fadeTime != 0) {
au_bgm_update_fade(bgmPlayer);
}
if (bgmPlayer->songName != 0) {
bgmPlayer->songPlayingCounter++;
}
bgmPlayer->nextUpdateCounter -= bgmPlayer->nextUpdateStep;
if (bgmPlayer->nextUpdateCounter <= 0) {
bgmPlayer->nextUpdateCounter += bgmPlayer->nextUpdateInterval;
bgmPlayer->unk_5C = au_bgm_player_update_main(bgmPlayer);
}
}
if (!PreventBGMPlayerUpdate) {
if (globals->unk_80 != 0) {
func_8004DFD4(globals);
}
bgmPlayer = gBGMPlayerA;
if (bgmPlayer->fadeInfo.volScaleTime != 0) {
func_80053BA8(&bgmPlayer->fadeInfo);
if (bgmPlayer->fadeInfo.fadeTime == 0) {
func_8004E444(bgmPlayer);
} else {
au_bgm_update_fade(bgmPlayer);
}
} else if (bgmPlayer->fadeInfo.fadeTime != 0) {
au_bgm_update_fade(bgmPlayer);
}
if (bgmPlayer->songName != 0) {
bgmPlayer->songPlayingCounter++;
}
bgmPlayer->nextUpdateCounter -= bgmPlayer->nextUpdateStep;
if (bgmPlayer->nextUpdateCounter <= 0) {
bgmPlayer->nextUpdateCounter += bgmPlayer->nextUpdateInterval;
bgmPlayer->unk_5C = au_bgm_player_update_main(bgmPlayer);
}
}
au_update_voices(globals);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel state_step_enter_world
/* 112EC 80035EEC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 112F0 80035EF0 AFB00010 */ sw $s0, 0x10($sp)
/* 112F4 80035EF4 3C10800A */ lui $s0, %hi(gMapTransitionState)
/* 112F8 80035EF8 26100944 */ addiu $s0, $s0, %lo(gMapTransitionState)
/* 112FC 80035EFC AFBF0014 */ sw $ra, 0x14($sp)
/* 11300 80035F00 86030000 */ lh $v1, 0x0($s0)
/* 11304 80035F04 24020001 */ addiu $v0, $zero, 0x1
/* 11308 80035F08 1062003D */ beq $v1, $v0, .L80036000
/* 1130C 80035F0C 28620002 */ slti $v0, $v1, 0x2
/* 11310 80035F10 50400005 */ beql $v0, $zero, .L80035F28
/* 11314 80035F14 24020002 */ addiu $v0, $zero, 0x2
/* 11318 80035F18 10600007 */ beqz $v1, .L80035F38
/* 1131C 80035F1C 00000000 */ nop
/* 11320 80035F20 0800D83B */ j .L800360EC
/* 11324 80035F24 00000000 */ nop
.L80035F28:
/* 11328 80035F28 10620055 */ beq $v1, $v0, .L80036080
/* 1132C 80035F2C 00000000 */ nop
/* 11330 80035F30 0800D83B */ j .L800360EC
/* 11334 80035F34 00000000 */ nop
.L80035F38:
/* 11338 80035F38 3C04800A */ lui $a0, %hi(gMapTransitionStateTime)
/* 1133C 80035F3C 24840946 */ addiu $a0, $a0, %lo(gMapTransitionStateTime)
/* 11340 80035F40 84820000 */ lh $v0, 0x0($a0)
/* 11344 80035F44 94830000 */ lhu $v1, 0x0($a0)
/* 11348 80035F48 1440003B */ bnez $v0, .L80036038
/* 1134C 80035F4C 2462FFFF */ addiu $v0, $v1, -0x1
/* 11350 80035F50 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 11354 80035F54 2463419C */ addiu $v1, $v1, %lo(gGameStatusPtr)
/* 11358 80035F58 8C620000 */ lw $v0, 0x0($v1)
/* 1135C 80035F5C A0400070 */ sb $zero, 0x70($v0)
/* 11360 80035F60 8C620000 */ lw $v0, 0x0($v1)
/* 11364 80035F64 A0400078 */ sb $zero, 0x78($v0)
/* 11368 80035F68 3C02800A */ lui $v0, %hi(D_800A0948)
/* 1136C 80035F6C 84420948 */ lh $v0, %lo(D_800A0948)($v0)
/* 11370 80035F70 14400006 */ bnez $v0, .L80035F8C
/* 11374 80035F74 24060001 */ addiu $a2, $zero, 0x1
/* 11378 80035F78 8C620000 */ lw $v0, 0x0($v1)
/* 1137C 80035F7C 84440086 */ lh $a0, 0x86($v0)
/* 11380 80035F80 8445008C */ lh $a1, 0x8C($v0)
/* 11384 80035F84 0800D7E6 */ j .L80035F98
/* 11388 80035F88 0000302D */ daddu $a2, $zero, $zero
.L80035F8C:
/* 1138C 80035F8C 8C620000 */ lw $v0, 0x0($v1)
/* 11390 80035F90 84440086 */ lh $a0, 0x86($v0)
/* 11394 80035F94 8445008C */ lh $a1, 0x8C($v0)
.L80035F98:
/* 11398 80035F98 0C0169BD */ jal load_map_by_IDs
/* 1139C 80035F9C 00000000 */ nop
/* 113A0 80035FA0 3C108007 */ lui $s0, %hi(gGameStatusPtr)
/* 113A4 80035FA4 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr)
/* 113A8 80035FA8 8E020000 */ lw $v0, 0x0($s0)
/* 113AC 80035FAC 94430086 */ lhu $v1, 0x86($v0)
/* 113B0 80035FB0 0000202D */ daddu $a0, $zero, $zero
/* 113B4 80035FB4 0C009C22 */ jal set_time_freeze_mode
/* 113B8 80035FB8 A4430088 */ sh $v1, 0x88($v0)
/* 113BC 80035FBC 8E020000 */ lw $v0, 0x0($s0)
/* 113C0 80035FC0 80420071 */ lb $v0, 0x71($v0)
/* 113C4 80035FC4 14400003 */ bnez $v0, .L80035FD4
/* 113C8 80035FC8 00000000 */ nop
/* 113CC 80035FCC 0C03805E */ jal disable_player_input
/* 113D0 80035FD0 00000000 */ nop
.L80035FD4:
/* 113D4 80035FD4 0C00B500 */ jal update_cameras
/* 113D8 80035FD8 00000000 */ nop
/* 113DC 80035FDC 3C02800A */ lui $v0, %hi(gMapTransitionState)
/* 113E0 80035FE0 24420944 */ addiu $v0, $v0, %lo(gMapTransitionState)
/* 113E4 80035FE4 94430000 */ lhu $v1, 0x0($v0)
/* 113E8 80035FE8 24040002 */ addiu $a0, $zero, 0x2
/* 113EC 80035FEC 3C01800A */ lui $at, %hi(gMapTransitionStateTime)
/* 113F0 80035FF0 A4240946 */ sh $a0, %lo(gMapTransitionStateTime)($at)
/* 113F4 80035FF4 24630001 */ addiu $v1, $v1, 0x1
/* 113F8 80035FF8 0800D83B */ j .L800360EC
/* 113FC 80035FFC A4430000 */ sh $v1, 0x0($v0)
.L80036000:
/* 11400 80036000 0C00F949 */ jal update_encounters
/* 11404 80036004 00000000 */ nop
/* 11408 80036008 0C00E64C */ jal update_npcs
/* 1140C 8003600C 00000000 */ nop
/* 11410 80036010 0C037DD0 */ jal update_player
/* 11414 80036014 00000000 */ nop
/* 11418 80036018 0C00B500 */ jal update_cameras
/* 1141C 8003601C 00000000 */ nop
/* 11420 80036020 3C04800A */ lui $a0, %hi(gMapTransitionStateTime)
/* 11424 80036024 24840946 */ addiu $a0, $a0, %lo(gMapTransitionStateTime)
/* 11428 80036028 84820000 */ lh $v0, 0x0($a0)
/* 1142C 8003602C 94830000 */ lhu $v1, 0x0($a0)
/* 11430 80036030 10400003 */ beqz $v0, .L80036040
/* 11434 80036034 2462FFFF */ addiu $v0, $v1, -0x1
.L80036038:
/* 11438 80036038 0800D83B */ j .L800360EC
/* 1143C 8003603C A4820000 */ sh $v0, 0x0($a0)
.L80036040:
/* 11440 80036040 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 11444 80036044 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 11448 80036048 0C0B1059 */ jal does_script_exist
/* 1144C 8003604C 8C44006C */ lw $a0, 0x6C($v0)
/* 11450 80036050 14400026 */ bnez $v0, .L800360EC
/* 11454 80036054 00000000 */ nop
/* 11458 80036058 3C05800A */ lui $a1, %hi(gOverrideFlags)
/* 1145C 8003605C 24A5A650 */ addiu $a1, $a1, %lo(gOverrideFlags)
/* 11460 80036060 2404FFF7 */ addiu $a0, $zero, -0x9
/* 11464 80036064 8CA20000 */ lw $v0, 0x0($a1)
/* 11468 80036068 96030000 */ lhu $v1, 0x0($s0)
/* 1146C 8003606C 00441024 */ and $v0, $v0, $a0
/* 11470 80036070 24630001 */ addiu $v1, $v1, 0x1
/* 11474 80036074 ACA20000 */ sw $v0, 0x0($a1)
/* 11478 80036078 0800D83B */ j .L800360EC
/* 1147C 8003607C A6030000 */ sh $v1, 0x0($s0)
.L80036080:
/* 11480 80036080 0C00E64C */ jal update_npcs
/* 11484 80036084 00000000 */ nop
/* 11488 80036088 0C037DD0 */ jal update_player
/* 1148C 8003608C 00000000 */ nop
/* 11490 80036090 0C016754 */ jal update_effects
/* 11494 80036094 00000000 */ nop
/* 11498 80036098 0C00B500 */ jal update_cameras
/* 1149C 8003609C 00000000 */ nop
/* 114A0 800360A0 3C04800A */ lui $a0, %hi(gMapTransitionAlpha)
/* 114A4 800360A4 24840940 */ addiu $a0, $a0, %lo(gMapTransitionAlpha)
/* 114A8 800360A8 0C04E175 */ jal update_enter_map_screen_overlay
/* 114AC 800360AC 00000000 */ nop
/* 114B0 800360B0 00021400 */ sll $v0, $v0, 16
/* 114B4 800360B4 1040000D */ beqz $v0, .L800360EC
/* 114B8 800360B8 00000000 */ nop
/* 114BC 800360BC 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 114C0 800360C0 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 114C4 800360C4 80420071 */ lb $v0, 0x71($v0)
/* 114C8 800360C8 14400003 */ bnez $v0, .L800360D8
/* 114CC 800360CC 00000000 */ nop
/* 114D0 800360D0 0C038069 */ jal enable_player_input
/* 114D4 800360D4 00000000 */ nop
.L800360D8:
/* 114D8 800360D8 3C05BF80 */ lui $a1, (0xBF800000 >> 16)
/* 114DC 800360DC 0C04DF62 */ jal set_screen_overlay_params_front
/* 114E0 800360E0 240400FF */ addiu $a0, $zero, 0xFF
/* 114E4 800360E4 0C00CD3C */ jal set_game_mode
/* 114E8 800360E8 24040004 */ addiu $a0, $zero, 0x4
.L800360EC:
/* 114EC 800360EC 8FBF0014 */ lw $ra, 0x14($sp)
/* 114F0 800360F0 8FB00010 */ lw $s0, 0x10($sp)
/* 114F4 800360F4 03E00008 */ jr $ra
/* 114F8 800360F8 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void state_step_enter_world(void) {
switch (gMapTransitionState) {
case 0:
if (gMapTransitionStateTime == 0) {
gGameStatusPtr->isBattle = FALSE;
gGameStatusPtr->disableScripts = FALSE;
if (D_800A0948 == 0) {
load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_MAP);
} else {
load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_FILE_SELECT);
}
gGameStatusPtr->prevArea = gGameStatusPtr->areaID;
set_time_freeze_mode(TIME_FREEZE_NORMAL);
if (gGameStatusPtr->demoState == DEMO_STATE_NONE) {
disable_player_input();
}
update_cameras();
gMapTransitionStateTime = 2;
gMapTransitionState++;
} else {
gMapTransitionStateTime--;
}
break;
case 1:
update_encounters();
update_npcs();
update_player();
update_cameras();
if (gMapTransitionStateTime != 0) {
gMapTransitionStateTime--;
} else if (!does_script_exist(gGameStatusPtr->mainScriptID)) {
gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
gMapTransitionState++;
}
break;
case 2:
update_npcs();
update_player();
update_effects();
update_cameras();
if (update_enter_map_screen_overlay(&gMapTransitionAlpha) != 0) {
if (gGameStatusPtr->demoState == DEMO_STATE_NONE) {
enable_player_input();
}
set_screen_overlay_params_front(OVERLAY_NONE, -1.0f);
set_game_mode(GAME_MODE_CHANGE_MAP);
}
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel debuff_main
/* 364300 E0062000 27BDFF90 */ addiu $sp, $sp, -0x70
/* 364304 E0062004 F7B40048 */ sdc1 $f20, 0x48($sp)
/* 364308 E0062008 4485A000 */ mtc1 $a1, $f20
/* 36430C E006200C AFB1002C */ sw $s1, 0x2C($sp)
/* 364310 E0062010 0080882D */ daddu $s1, $a0, $zero
/* 364314 E0062014 F7B60050 */ sdc1 $f22, 0x50($sp)
/* 364318 E0062018 4486B000 */ mtc1 $a2, $f22
/* 36431C E006201C 27A40010 */ addiu $a0, $sp, 0x10
/* 364320 E0062020 F7B80058 */ sdc1 $f24, 0x58($sp)
/* 364324 E0062024 4487C000 */ mtc1 $a3, $f24
/* 364328 E0062028 3C02E006 */ lui $v0, %hi(debuff_init)
/* 36432C E006202C 24422218 */ addiu $v0, $v0, %lo(debuff_init)
/* 364330 E0062030 AFA20018 */ sw $v0, 0x18($sp)
/* 364334 E0062034 3C02E006 */ lui $v0, %hi(debuff_update)
/* 364338 E0062038 24422220 */ addiu $v0, $v0, %lo(debuff_update)
/* 36433C E006203C AFA2001C */ sw $v0, 0x1C($sp)
/* 364340 E0062040 3C02E006 */ lui $v0, %hi(debuff_render)
/* 364344 E0062044 244224A8 */ addiu $v0, $v0, %lo(debuff_render)
/* 364348 E0062048 AFA20020 */ sw $v0, 0x20($sp)
/* 36434C E006204C 24020031 */ addiu $v0, $zero, 0x31
/* 364350 E0062050 AFBF0040 */ sw $ra, 0x40($sp)
/* 364354 E0062054 AFB5003C */ sw $s5, 0x3C($sp)
/* 364358 E0062058 AFB40038 */ sw $s4, 0x38($sp)
/* 36435C E006205C AFB30034 */ sw $s3, 0x34($sp)
/* 364360 E0062060 AFB20030 */ sw $s2, 0x30($sp)
/* 364364 E0062064 AFB00028 */ sw $s0, 0x28($sp)
/* 364368 E0062068 F7BC0068 */ sdc1 $f28, 0x68($sp)
/* 36436C E006206C F7BA0060 */ sdc1 $f26, 0x60($sp)
/* 364370 E0062070 AFA00010 */ sw $zero, 0x10($sp)
/* 364374 E0062074 AFA00024 */ sw $zero, 0x24($sp)
/* 364378 E0062078 0C080124 */ jal shim_create_effect_instance
/* 36437C E006207C AFA20014 */ sw $v0, 0x14($sp)
/* 364380 E0062080 24040200 */ addiu $a0, $zero, 0x200
/* 364384 E0062084 24150008 */ addiu $s5, $zero, 0x8
/* 364388 E0062088 0040A02D */ daddu $s4, $v0, $zero
/* 36438C E006208C 0C08012C */ jal shim_general_heap_malloc
/* 364390 E0062090 AE950008 */ sw $s5, 0x8($s4)
/* 364394 E0062094 0040802D */ daddu $s0, $v0, $zero
/* 364398 E0062098 16000003 */ bnez $s0, .LE00620A8
/* 36439C E006209C AE90000C */ sw $s0, 0xC($s4)
.LE00620A0:
/* 3643A0 E00620A0 08018828 */ j .LE00620A0
/* 3643A4 E00620A4 00000000 */ nop
.LE00620A8:
/* 3643A8 E00620A8 0200202D */ daddu $a0, $s0, $zero
/* 3643AC E00620AC 0C080130 */ jal shim_mem_clear
/* 3643B0 E00620B0 00152980 */ sll $a1, $s5, 6
/* 3643B4 E00620B4 2402001E */ addiu $v0, $zero, 0x1E
/* 3643B8 E00620B8 AE020024 */ sw $v0, 0x24($s0)
/* 3643BC E00620BC 240200FF */ addiu $v0, $zero, 0xFF
/* 3643C0 E00620C0 AE000028 */ sw $zero, 0x28($s0)
/* 3643C4 E00620C4 A6110000 */ sh $s1, 0x0($s0)
/* 3643C8 E00620C8 E6140004 */ swc1 $f20, 0x4($s0)
/* 3643CC E00620CC E6160008 */ swc1 $f22, 0x8($s0)
/* 3643D0 E00620D0 E618000C */ swc1 $f24, 0xC($s0)
/* 3643D4 E00620D4 16200009 */ bnez $s1, .LE00620FC
/* 3643D8 E00620D8 AE020034 */ sw $v0, 0x34($s0)
/* 3643DC E00620DC 24020014 */ addiu $v0, $zero, 0x14
/* 3643E0 E00620E0 A202003B */ sb $v0, 0x3B($s0)
/* 3643E4 E00620E4 A2020038 */ sb $v0, 0x38($s0)
/* 3643E8 E00620E8 24020015 */ addiu $v0, $zero, 0x15
/* 3643EC E00620EC A202003C */ sb $v0, 0x3C($s0)
/* 3643F0 E00620F0 A2020039 */ sb $v0, 0x39($s0)
/* 3643F4 E00620F4 08018846 */ j .LE0062118
/* 3643F8 E00620F8 240200F2 */ addiu $v0, $zero, 0xF2
.LE00620FC:
/* 3643FC E00620FC 240200C8 */ addiu $v0, $zero, 0xC8
/* 364400 E0062100 A202003B */ sb $v0, 0x3B($s0)
/* 364404 E0062104 A2020038 */ sb $v0, 0x38($s0)
/* 364408 E0062108 24020015 */ addiu $v0, $zero, 0x15
/* 36440C E006210C A202003C */ sb $v0, 0x3C($s0)
/* 364410 E0062110 A2020039 */ sb $v0, 0x39($s0)
/* 364414 E0062114 240200D4 */ addiu $v0, $zero, 0xD4
.LE0062118:
/* 364418 E0062118 A202003D */ sb $v0, 0x3D($s0)
/* 36441C E006211C A202003A */ sb $v0, 0x3A($s0)
/* 364420 E0062120 24120001 */ addiu $s2, $zero, 0x1
/* 364424 E0062124 0255102A */ slt $v0, $s2, $s5
/* 364428 E0062128 1040002C */ beqz $v0, .LE00621DC
/* 36442C E006212C 26100040 */ addiu $s0, $s0, 0x40
/* 364430 E0062130 26B3FFFF */ addiu $s3, $s5, -0x1
/* 364434 E0062134 2610002C */ addiu $s0, $s0, 0x2C
/* 364438 E0062138 0000882D */ daddu $s1, $zero, $zero
/* 36443C E006213C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 364440 E0062140 4481E000 */ mtc1 $at, $f28
/* 364444 E0062144 3C0142B4 */ lui $at, (0x42B40000 >> 16)
/* 364448 E0062148 4481D000 */ mtc1 $at, $f26
/* 36444C E006214C 3C013DCC */ lui $at, (0x3DCCCCCD >> 16)
/* 364450 E0062150 3421CCCD */ ori $at, $at, (0x3DCCCCCD & 0xFFFF)
/* 364454 E0062154 4481C000 */ mtc1 $at, $f24
.LE0062158:
/* 364458 E0062158 16600002 */ bnez $s3, .LE0062164
/* 36445C E006215C 0233001A */ div $zero, $s1, $s3
/* 364460 E0062160 0007000D */ break 7
.LE0062164:
/* 364464 E0062164 2401FFFF */ addiu $at, $zero, -0x1
/* 364468 E0062168 16610004 */ bne $s3, $at, .LE006217C
/* 36446C E006216C 3C018000 */ lui $at, (0x80000000 >> 16)
/* 364470 E0062170 16210002 */ bne $s1, $at, .LE006217C
/* 364474 E0062174 00000000 */ nop
/* 364478 E0062178 0006000D */ break 6
.LE006217C:
/* 36447C E006217C 00001012 */ mflo $v0
/* 364480 E0062180 4482B000 */ mtc1 $v0, $f22
/* 364484 E0062184 00000000 */ nop
/* 364488 E0062188 4680B5A0 */ cvt.s.w $f22, $f22
/* 36448C E006218C 461AB500 */ add.s $f20, $f22, $f26
/* 364490 E0062190 26310168 */ addiu $s1, $s1, 0x168
/* 364494 E0062194 26520001 */ addiu $s2, $s2, 0x1
/* 364498 E0062198 0C080144 */ jal shim_cos_deg
/* 36449C E006219C 4600A306 */ mov.s $f12, $f20
/* 3644A0 E00621A0 4600A306 */ mov.s $f12, $f20
/* 3644A4 E00621A4 0C080140 */ jal shim_sin_deg
/* 3644A8 E00621A8 E600FFD8 */ swc1 $f0, -0x28($s0)
/* 3644AC E00621AC E600FFDC */ swc1 $f0, -0x24($s0)
/* 3644B0 E00621B0 AE00FFE0 */ sw $zero, -0x20($s0)
/* 3644B4 E00621B4 AE00FFE4 */ sw $zero, -0x1C($s0)
/* 3644B8 E00621B8 AE00FFE8 */ sw $zero, -0x18($s0)
/* 3644BC E00621BC AE00FFEC */ sw $zero, -0x14($s0)
/* 3644C0 E00621C0 E618FFF0 */ swc1 $f24, -0x10($s0)
/* 3644C4 E00621C4 E618FFF4 */ swc1 $f24, -0xC($s0)
/* 3644C8 E00621C8 E61C0004 */ swc1 $f28, 0x4($s0)
/* 3644CC E00621CC E6160000 */ swc1 $f22, 0x0($s0)
/* 3644D0 E00621D0 0255102A */ slt $v0, $s2, $s5
/* 3644D4 E00621D4 1440FFE0 */ bnez $v0, .LE0062158
/* 3644D8 E00621D8 26100040 */ addiu $s0, $s0, 0x40
.LE00621DC:
/* 3644DC E00621DC 0280102D */ daddu $v0, $s4, $zero
/* 3644E0 E00621E0 8FBF0040 */ lw $ra, 0x40($sp)
/* 3644E4 E00621E4 8FB5003C */ lw $s5, 0x3C($sp)
/* 3644E8 E00621E8 8FB40038 */ lw $s4, 0x38($sp)
/* 3644EC E00621EC 8FB30034 */ lw $s3, 0x34($sp)
/* 3644F0 E00621F0 8FB20030 */ lw $s2, 0x30($sp)
/* 3644F4 E00621F4 8FB1002C */ lw $s1, 0x2C($sp)
/* 3644F8 E00621F8 8FB00028 */ lw $s0, 0x28($sp)
/* 3644FC E00621FC D7BC0068 */ ldc1 $f28, 0x68($sp)
/* 364500 E0062200 D7BA0060 */ ldc1 $f26, 0x60($sp)
/* 364504 E0062204 D7B80058 */ ldc1 $f24, 0x58($sp)
/* 364508 E0062208 D7B60050 */ ldc1 $f22, 0x50($sp)
/* 36450C E006220C D7B40048 */ ldc1 $f20, 0x48($sp)
/* 364510 E0062210 03E00008 */ jr $ra
/* 364514 E0062214 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
EffectInstance* debuff_main(s32 type, f32 x, f32 y, f32 z) {
EffectBlueprint bp;
EffectInstance* effect;
DebuffFXData* data;
s32 numParts = 8;
s32 i;
bp.unk_00 = 0;
bp.init = debuff_init;
bp.update = debuff_update;
bp.renderWorld = debuff_render;
bp.renderUI = NULL;
bp.effectID = EFFECT_DEBUFF;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
effect->data.debuff = data = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL);
shim_mem_clear(data, numParts * sizeof(*data));
data->timeLeft = 30;
data->lifetime = 0;
data->type = type;
data->pos.x = x;
data->pos.y = y;
data->pos.z = z;
data->alpha = 255;
if (type == 0) {
data->envCol.r = 20;
data->primCol.r = 20;
data->envCol.g = 21;
data->primCol.g = 21;
data->envCol.b = 242;
data->primCol.b = 242;
} else {
data->envCol.r = 200;
data->primCol.r = 200;
data->envCol.g = 21;
data->primCol.g = 21;
data->envCol.b = 212;
data->primCol.b = 212;
}
data++;
for (i = 1; i < numParts; i++, data++) {
s32 angle = ((i - 1) * 360) / (numParts - 1);
f32 temp2 = 1.0f;
data->pos.x = shim_cos_deg(angle + 90.0f);
data->pos.y = shim_sin_deg(angle + 90.0f);
data->pos.z = 0.0f;
data->unk_10 = 0.0f;
data->unk_14 = 0.0f;
data->unk_18 = 0.0f;
data->scaleY = 0.1f;
data->scaleX = 0.1f;
data->unk_30 = temp2;
data->rotZ = angle;
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel green_impact_update
/* 3650B4 E00641A4 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 3650B8 E00641A8 AFB20018 */ sw $s2, 0x18($sp)
/* 3650BC E00641AC 0080902D */ daddu $s2, $a0, $zero
/* 3650C0 E00641B0 AFBF001C */ sw $ra, 0x1C($sp)
/* 3650C4 E00641B4 AFB10014 */ sw $s1, 0x14($sp)
/* 3650C8 E00641B8 AFB00010 */ sw $s0, 0x10($sp)
/* 3650CC E00641BC F7BC0040 */ sdc1 $f28, 0x40($sp)
/* 3650D0 E00641C0 F7BA0038 */ sdc1 $f26, 0x38($sp)
/* 3650D4 E00641C4 F7B80030 */ sdc1 $f24, 0x30($sp)
/* 3650D8 E00641C8 F7B60028 */ sdc1 $f22, 0x28($sp)
/* 3650DC E00641CC F7B40020 */ sdc1 $f20, 0x20($sp)
/* 3650E0 E00641D0 8E44000C */ lw $a0, 0xC($s2)
/* 3650E4 E00641D4 8C82002C */ lw $v0, 0x2C($a0)
/* 3650E8 E00641D8 8C830028 */ lw $v1, 0x28($a0)
/* 3650EC E00641DC 24420001 */ addiu $v0, $v0, 0x1
/* 3650F0 E00641E0 2463FFFF */ addiu $v1, $v1, -0x1
/* 3650F4 E00641E4 AC82002C */ sw $v0, 0x2C($a0)
/* 3650F8 E00641E8 04610005 */ bgez $v1, .LE0064200
/* 3650FC E00641EC AC830028 */ sw $v1, 0x28($a0)
/* 365100 E00641F0 0C080128 */ jal shim_remove_effect
/* 365104 E00641F4 0240202D */ daddu $a0, $s2, $zero
/* 365108 E00641F8 080190EC */ j .LE00643B0
/* 36510C E00641FC 00000000 */ nop
.LE0064200:
/* 365110 E0064200 8C82002C */ lw $v0, 0x2C($a0)
/* 365114 E0064204 28420008 */ slti $v0, $v0, 0x8
/* 365118 E0064208 14400009 */ bnez $v0, .LE0064230
/* 36511C E006420C 00000000 */ nop
/* 365120 E0064210 3C01E006 */ lui $at, (0xE0064A70 >> 16)
/* 365124 E0064214 D4224A70 */ ldc1 $f2, (0xE0064A70 & 0xFFFF)($at)
/* 365128 E0064218 C4800038 */ lwc1 $f0, 0x38($a0)
/* 36512C E006421C 46800021 */ cvt.d.w $f0, $f0
/* 365130 E0064220 46220002 */ mul.d $f0, $f0, $f2
/* 365134 E0064224 00000000 */ nop
/* 365138 E0064228 4620038D */ trunc.w.d $f14, $f0
/* 36513C E006422C E48E0038 */ swc1 $f14, 0x38($a0)
.LE0064230:
/* 365140 E0064230 8E420008 */ lw $v0, 0x8($s2)
/* 365144 E0064234 24110001 */ addiu $s1, $zero, 0x1
/* 365148 E0064238 0222102A */ slt $v0, $s1, $v0
/* 36514C E006423C 1040005C */ beqz $v0, .LE00643B0
/* 365150 E0064240 24840058 */ addiu $a0, $a0, 0x58
/* 365154 E0064244 2490003C */ addiu $s0, $a0, 0x3C
/* 365158 E0064248 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 36515C E006424C 4481C800 */ mtc1 $at, $f25
/* 365160 E0064250 4480C000 */ mtc1 $zero, $f24
/* 365164 E0064254 3C014200 */ lui $at, (0x42000000 >> 16)
/* 365168 E0064258 4481B000 */ mtc1 $at, $f22
/* 36516C E006425C 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 365170 E0064260 4481E000 */ mtc1 $at, $f28
/* 365174 E0064264 3C01E006 */ lui $at, (0xE0064A78 >> 16)
/* 365178 E0064268 D4344A78 */ ldc1 $f20, (0xE0064A78 & 0xFFFF)($at)
/* 36517C E006426C 3C014300 */ lui $at, (0x43000000 >> 16)
/* 365180 E0064270 4481D000 */ mtc1 $at, $f26
.LE0064274:
/* 365184 E0064274 8E020010 */ lw $v0, 0x10($s0)
/* 365188 E0064278 24420001 */ addiu $v0, $v0, 0x1
/* 36518C E006427C 04400047 */ bltz $v0, .LE006439C
/* 365190 E0064280 AE020010 */ sw $v0, 0x10($s0)
/* 365194 E0064284 1440001D */ bnez $v0, .LE00642FC
/* 365198 E0064288 00000000 */ nop
/* 36519C E006428C C60CFFF8 */ lwc1 $f12, -0x8($s0)
/* 3651A0 E0064290 AE00FFC8 */ sw $zero, -0x38($s0)
/* 3651A4 E0064294 AE00FFCC */ sw $zero, -0x34($s0)
/* 3651A8 E0064298 0C080140 */ jal shim_sin_deg
/* 3651AC E006429C AE00FFD0 */ sw $zero, -0x30($s0)
/* 3651B0 E00642A0 46000007 */ neg.s $f0, $f0
/* 3651B4 E00642A4 46000021 */ cvt.d.s $f0, $f0
/* 3651B8 E00642A8 46380002 */ mul.d $f0, $f0, $f24
/* 3651BC E00642AC 00000000 */ nop
/* 3651C0 E00642B0 C60CFFF8 */ lwc1 $f12, -0x8($s0)
/* 3651C4 E00642B4 46200020 */ cvt.s.d $f0, $f0
/* 3651C8 E00642B8 0C080144 */ jal shim_cos_deg
/* 3651CC E00642BC E600FFD4 */ swc1 $f0, -0x2C($s0)
/* 3651D0 E00642C0 46000021 */ cvt.d.s $f0, $f0
/* 3651D4 E00642C4 3C014120 */ lui $at, (0x41200000 >> 16)
/* 3651D8 E00642C8 44811000 */ mtc1 $at, $f2
/* 3651DC E00642CC 46380002 */ mul.d $f0, $f0, $f24
/* 3651E0 E00642D0 00000000 */ nop
/* 3651E4 E00642D4 AE00FFDC */ sw $zero, -0x24($s0)
/* 3651E8 E00642D8 E6160000 */ swc1 $f22, 0x0($s0)
/* 3651EC E00642DC E6160004 */ swc1 $f22, 0x4($s0)
/* 3651F0 E00642E0 E616000C */ swc1 $f22, 0xC($s0)
/* 3651F4 E00642E4 E61CFFE0 */ swc1 $f28, -0x20($s0)
/* 3651F8 E00642E8 E61CFFE8 */ swc1 $f28, -0x18($s0)
/* 3651FC E00642EC E6160008 */ swc1 $f22, 0x8($s0)
/* 365200 E00642F0 E602FFE4 */ swc1 $f2, -0x1C($s0)
/* 365204 E00642F4 46200020 */ cvt.s.d $f0, $f0
/* 365208 E00642F8 E600FFD8 */ swc1 $f0, -0x28($s0)
.LE00642FC:
/* 36520C E00642FC C6060004 */ lwc1 $f6, 0x4($s0)
/* 365210 E0064300 3C01E006 */ lui $at, (0xE0064A80 >> 16)
/* 365214 E0064304 D4204A80 */ ldc1 $f0, (0xE0064A80 & 0xFFFF)($at)
/* 365218 E0064308 460031A1 */ cvt.d.s $f6, $f6
/* 36521C E006430C 46203182 */ mul.d $f6, $f6, $f0
/* 365220 E0064310 00000000 */ nop
/* 365224 E0064314 C604FFE4 */ lwc1 $f4, -0x1C($s0)
/* 365228 E0064318 3C01E006 */ lui $at, (0xE0064A88 >> 16)
/* 36522C E006431C D42A4A88 */ ldc1 $f10, (0xE0064A88 & 0xFFFF)($at)
/* 365230 E0064320 46002121 */ cvt.d.s $f4, $f4
/* 365234 E0064324 46245281 */ sub.d $f10, $f10, $f4
/* 365238 E0064328 46345282 */ mul.d $f10, $f10, $f20
/* 36523C E006432C 00000000 */ nop
/* 365240 E0064330 C6020004 */ lwc1 $f2, 0x4($s0)
/* 365244 E0064334 C6000000 */ lwc1 $f0, 0x0($s0)
/* 365248 E0064338 46020000 */ add.s $f0, $f0, $f2
/* 36524C E006433C C602FFE0 */ lwc1 $f2, -0x20($s0)
/* 365250 E0064340 C6080008 */ lwc1 $f8, 0x8($s0)
/* 365254 E0064344 460010A1 */ cvt.d.s $f2, $f2
/* 365258 E0064348 46341080 */ add.d $f2, $f2, $f20
/* 36525C E006434C E6000000 */ swc1 $f0, 0x0($s0)
/* 365260 E0064350 C600000C */ lwc1 $f0, 0xC($s0)
/* 365264 E0064354 46004200 */ add.s $f8, $f8, $f0
/* 365268 E0064358 C600FFE8 */ lwc1 $f0, -0x18($s0)
/* 36526C E006435C 462010A0 */ cvt.s.d $f2, $f2
/* 365270 E0064360 46000021 */ cvt.d.s $f0, $f0
/* 365274 E0064364 46340000 */ add.d $f0, $f0, $f20
/* 365278 E0064368 E602FFE0 */ swc1 $f2, -0x20($s0)
/* 36527C E006436C E6080008 */ swc1 $f8, 0x8($s0)
/* 365280 E0064370 46200020 */ cvt.s.d $f0, $f0
/* 365284 E0064374 E600FFE8 */ swc1 $f0, -0x18($s0)
/* 365288 E0064378 C6000000 */ lwc1 $f0, 0x0($s0)
/* 36528C E006437C 462A2100 */ add.d $f4, $f4, $f10
/* 365290 E0064380 462031A0 */ cvt.s.d $f6, $f6
/* 365294 E0064384 E6060004 */ swc1 $f6, 0x4($s0)
/* 365298 E0064388 4600D03C */ c.lt.s $f26, $f0
/* 36529C E006438C 46202120 */ cvt.s.d $f4, $f4
/* 3652A0 E0064390 45000002 */ bc1f .LE006439C
/* 3652A4 E0064394 E604FFE4 */ swc1 $f4, -0x1C($s0)
/* 3652A8 E0064398 E61A0000 */ swc1 $f26, 0x0($s0)
.LE006439C:
/* 3652AC E006439C 26310001 */ addiu $s1, $s1, 0x1
/* 3652B0 E00643A0 8E420008 */ lw $v0, 0x8($s2)
/* 3652B4 E00643A4 0222102A */ slt $v0, $s1, $v0
/* 3652B8 E00643A8 1440FFB2 */ bnez $v0, .LE0064274
/* 3652BC E00643AC 26100058 */ addiu $s0, $s0, 0x58
.LE00643B0:
/* 3652C0 E00643B0 8FBF001C */ lw $ra, 0x1C($sp)
/* 3652C4 E00643B4 8FB20018 */ lw $s2, 0x18($sp)
/* 3652C8 E00643B8 8FB10014 */ lw $s1, 0x14($sp)
/* 3652CC E00643BC 8FB00010 */ lw $s0, 0x10($sp)
/* 3652D0 E00643C0 D7BC0040 */ ldc1 $f28, 0x40($sp)
/* 3652D4 E00643C4 D7BA0038 */ ldc1 $f26, 0x38($sp)
/* 3652D8 E00643C8 D7B80030 */ ldc1 $f24, 0x30($sp)
/* 3652DC E00643CC D7B60028 */ ldc1 $f22, 0x28($sp)
/* 3652E0 E00643D0 D7B40020 */ ldc1 $f20, 0x20($sp)
/* 3652E4 E00643D4 03E00008 */ jr $ra
/* 3652E8 E00643D8 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
void green_impact_update(EffectInstance* effect) {
GreenImpactFXData* part = effect->data.greenImpact;
s32 i;
part->unk_2C++;
part->unk_28--;
if (part->unk_28 < 0) {
shim_remove_effect(effect);
return;
}
if (part->unk_2C >= 8) {
part->unk_38 *= 0.8;
}
part++;
for (i = 1; i < effect->numParts; i++, part++) {
part->unk_4C++;
if (part->unk_4C >= 0) {
if (part->unk_4C == 0) {
part->unk_04 = 0;
part->unk_08 = 0;
part->unk_0C = 0;
part->unk_10 = -shim_sin_deg(part->unk_34) * 0.5;
part->unk_14 = shim_cos_deg(part->unk_34) * 0.5;
part->unk_18 = 0;
part->unk_20 = 10.0f;
part->unk_3C = 32.0f;
part->unk_40 = 32.0f;
part->unk_48 = 32.0f;
part->unk_1C = 0.5f;
part->unk_24 = 0.5f;
part->unk_44 = 32.0f;
}
part->unk_3C += part->unk_40;
part->unk_40 *= 0.9;
part->unk_44 += part->unk_48;
part->unk_1C += 0.2;
part->unk_20 += (0.1 - part->unk_20) * 0.2;
part->unk_24 += 0.2;
if (part->unk_3C > 128.0f) {
part->unk_3C = 128.0f;
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel purple_ring_appendGfx
/* 352A78 E003E638 27BDFF50 */ addiu $sp, $sp, -0xB0
/* 352A7C E003E63C 0080182D */ daddu $v1, $a0, $zero
/* 352A80 E003E640 3C05DB06 */ lui $a1, (0xDB060024 >> 16)
/* 352A84 E003E644 34A50024 */ ori $a1, $a1, (0xDB060024 & 0xFFFF)
/* 352A88 E003E648 27A40010 */ addiu $a0, $sp, 0x10
/* 352A8C E003E64C AFB500A4 */ sw $s5, 0xA4($sp)
/* 352A90 E003E650 3C150001 */ lui $s5, (0x11630 >> 16)
/* 352A94 E003E654 AFB20098 */ sw $s2, 0x98($sp)
/* 352A98 E003E658 3C12800A */ lui $s2, %hi(gMainGfxPos)
/* 352A9C E003E65C 2652A66C */ addiu $s2, $s2, %lo(gMainGfxPos)
/* 352AA0 E003E660 AFB600A8 */ sw $s6, 0xA8($sp)
/* 352AA4 E003E664 3C16E700 */ lui $s6, (0xE7000000 >> 16)
/* 352AA8 E003E668 AFBF00AC */ sw $ra, 0xAC($sp)
/* 352AAC E003E66C AFB400A0 */ sw $s4, 0xA0($sp)
/* 352AB0 E003E670 AFB3009C */ sw $s3, 0x9C($sp)
/* 352AB4 E003E674 AFB10094 */ sw $s1, 0x94($sp)
/* 352AB8 E003E678 AFB00090 */ sw $s0, 0x90($sp)
/* 352ABC E003E67C 8E460000 */ lw $a2, 0x0($s2)
/* 352AC0 E003E680 8C70000C */ lw $s0, 0xC($v1)
/* 352AC4 E003E684 00C0102D */ daddu $v0, $a2, $zero
/* 352AC8 E003E688 24C60008 */ addiu $a2, $a2, 0x8
/* 352ACC E003E68C AE460000 */ sw $a2, 0x0($s2)
/* 352AD0 E003E690 C600005C */ lwc1 $f0, 0x5C($s0)
/* 352AD4 E003E694 3C14DE00 */ lui $s4, (0xDE000000 >> 16)
/* 352AD8 E003E698 AC560000 */ sw $s6, 0x0($v0)
/* 352ADC E003E69C AC400004 */ sw $zero, 0x4($v0)
/* 352AE0 E003E6A0 24C20008 */ addiu $v0, $a2, 0x8
/* 352AE4 E003E6A4 AE420000 */ sw $v0, 0x0($s2)
/* 352AE8 E003E6A8 24C20010 */ addiu $v0, $a2, 0x10
/* 352AEC E003E6AC ACC50000 */ sw $a1, 0x0($a2)
/* 352AF0 E003E6B0 AE420000 */ sw $v0, 0x0($s2)
/* 352AF4 E003E6B4 8C630010 */ lw $v1, 0x10($v1)
/* 352AF8 E003E6B8 24C20018 */ addiu $v0, $a2, 0x18
/* 352AFC E003E6BC AE420000 */ sw $v0, 0x0($s2)
/* 352B00 E003E6C0 8C63001C */ lw $v1, 0x1C($v1)
/* 352B04 E003E6C4 3C020900 */ lui $v0, %hi(D_09000200_415260)
/* 352B08 E003E6C8 24420200 */ addiu $v0, $v0, %lo(D_09000200_415260)
/* 352B0C E003E6CC ACC2000C */ sw $v0, 0xC($a2)
/* 352B10 E003E6D0 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 352B14 E003E6D4 ACC20010 */ sw $v0, 0x10($a2)
/* 352B18 E003E6D8 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 352B1C E003E6DC ACD40008 */ sw $s4, 0x8($a2)
/* 352B20 E003E6E0 00621821 */ addu $v1, $v1, $v0
/* 352B24 E003E6E4 ACC30004 */ sw $v1, 0x4($a2)
/* 352B28 E003E6E8 92020074 */ lbu $v0, 0x74($s0)
/* 352B2C E003E6EC 92030075 */ lbu $v1, 0x75($s0)
/* 352B30 E003E6F0 92050076 */ lbu $a1, 0x76($s0)
/* 352B34 E003E6F4 00021600 */ sll $v0, $v0, 24
/* 352B38 E003E6F8 00031C00 */ sll $v1, $v1, 16
/* 352B3C E003E6FC 00431025 */ or $v0, $v0, $v1
/* 352B40 E003E700 00052A00 */ sll $a1, $a1, 8
/* 352B44 E003E704 9203006B */ lbu $v1, 0x6B($s0)
/* 352B48 E003E708 00451025 */ or $v0, $v0, $a1
/* 352B4C E003E70C 00431025 */ or $v0, $v0, $v1
/* 352B50 E003E710 ACC20014 */ sw $v0, 0x14($a2)
/* 352B54 E003E714 8E050004 */ lw $a1, 0x4($s0)
/* 352B58 E003E718 8E060008 */ lw $a2, 0x8($s0)
/* 352B5C E003E71C 8E07000C */ lw $a3, 0xC($s0)
/* 352B60 E003E720 4600008D */ trunc.w.s $f2, $f0
/* 352B64 E003E724 44111000 */ mfc1 $s1, $f2
/* 352B68 E003E728 0C080108 */ jal shim_guTranslateF
/* 352B6C E003E72C 36B51630 */ ori $s5, $s5, (0x11630 & 0xFFFF)
/* 352B70 E003E730 2604001C */ addiu $a0, $s0, 0x1C
/* 352B74 E003E734 27A50010 */ addiu $a1, $sp, 0x10
/* 352B78 E003E738 0C080114 */ jal shim_guMtxCatF
/* 352B7C E003E73C 00A0302D */ daddu $a2, $a1, $zero
/* 352B80 E003E740 8E050064 */ lw $a1, 0x64($s0)
/* 352B84 E003E744 27B00050 */ addiu $s0, $sp, 0x50
/* 352B88 E003E748 0200202D */ daddu $a0, $s0, $zero
/* 352B8C E003E74C 00A0302D */ daddu $a2, $a1, $zero
/* 352B90 E003E750 0C080110 */ jal shim_guScaleF
/* 352B94 E003E754 00A0382D */ daddu $a3, $a1, $zero
/* 352B98 E003E758 0200202D */ daddu $a0, $s0, $zero
/* 352B9C E003E75C 27A50010 */ addiu $a1, $sp, 0x10
/* 352BA0 E003E760 0C080114 */ jal shim_guMtxCatF
/* 352BA4 E003E764 00A0302D */ daddu $a2, $a1, $zero
/* 352BA8 E003E768 27A40010 */ addiu $a0, $sp, 0x10
/* 352BAC E003E76C 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 352BB0 E003E770 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 352BB4 E003E774 3C13800A */ lui $s3, %hi(gDisplayContext)
/* 352BB8 E003E778 2673A674 */ addiu $s3, $s3, %lo(gDisplayContext)
/* 352BBC E003E77C 96050000 */ lhu $a1, 0x0($s0)
/* 352BC0 E003E780 8E620000 */ lw $v0, 0x0($s3)
/* 352BC4 E003E784 00052980 */ sll $a1, $a1, 6
/* 352BC8 E003E788 00B52821 */ addu $a1, $a1, $s5
/* 352BCC E003E78C 0C080118 */ jal shim_guMtxF2L
/* 352BD0 E003E790 00452821 */ addu $a1, $v0, $a1
/* 352BD4 E003E794 3C06D838 */ lui $a2, (0xD8380002 >> 16)
/* 352BD8 E003E798 8E440000 */ lw $a0, 0x0($s2)
/* 352BDC E003E79C 34C60002 */ ori $a2, $a2, (0xD8380002 & 0xFFFF)
/* 352BE0 E003E7A0 0080282D */ daddu $a1, $a0, $zero
/* 352BE4 E003E7A4 24840008 */ addiu $a0, $a0, 0x8
/* 352BE8 E003E7A8 AE440000 */ sw $a0, 0x0($s2)
/* 352BEC E003E7AC 96020000 */ lhu $v0, 0x0($s0)
/* 352BF0 E003E7B0 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 352BF4 E003E7B4 ACA30000 */ sw $v1, 0x0($a1)
/* 352BF8 E003E7B8 24430001 */ addiu $v1, $v0, 0x1
/* 352BFC E003E7BC 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 352C00 E003E7C0 00021180 */ sll $v0, $v0, 6
/* 352C04 E003E7C4 A6030000 */ sh $v1, 0x0($s0)
/* 352C08 E003E7C8 8E630000 */ lw $v1, 0x0($s3)
/* 352C0C E003E7CC 00551021 */ addu $v0, $v0, $s5
/* 352C10 E003E7D0 00621821 */ addu $v1, $v1, $v0
/* 352C14 E003E7D4 24820008 */ addiu $v0, $a0, 0x8
/* 352C18 E003E7D8 ACA30004 */ sw $v1, 0x4($a1)
/* 352C1C E003E7DC AE420000 */ sw $v0, 0x0($s2)
/* 352C20 E003E7E0 32220FFF */ andi $v0, $s1, 0xFFF
/* 352C24 E003E7E4 3C03F200 */ lui $v1, (0xF2000000 >> 16)
/* 352C28 E003E7E8 00431025 */ or $v0, $v0, $v1
/* 352C2C E003E7EC AC820000 */ sw $v0, 0x0($a0)
/* 352C30 E003E7F0 3C020010 */ lui $v0, (0x100000 >> 16)
/* 352C34 E003E7F4 26310040 */ addiu $s1, $s1, 0x40
/* 352C38 E003E7F8 32310FFF */ andi $s1, $s1, 0xFFF
/* 352C3C E003E7FC 02228825 */ or $s1, $s1, $v0
/* 352C40 E003E800 24820010 */ addiu $v0, $a0, 0x10
/* 352C44 E003E804 AC910004 */ sw $s1, 0x4($a0)
/* 352C48 E003E808 AE420000 */ sw $v0, 0x0($s2)
/* 352C4C E003E80C 3C020900 */ lui $v0, %hi(D_090004E8_415548)
/* 352C50 E003E810 244204E8 */ addiu $v0, $v0, %lo(D_090004E8_415548)
/* 352C54 E003E814 AC82000C */ sw $v0, 0xC($a0)
/* 352C58 E003E818 24820018 */ addiu $v0, $a0, 0x18
/* 352C5C E003E81C AC940008 */ sw $s4, 0x8($a0)
/* 352C60 E003E820 AE420000 */ sw $v0, 0x0($s2)
/* 352C64 E003E824 24020040 */ addiu $v0, $zero, 0x40
/* 352C68 E003E828 AC820014 */ sw $v0, 0x14($a0)
/* 352C6C E003E82C 24820020 */ addiu $v0, $a0, 0x20
/* 352C70 E003E830 AC860010 */ sw $a2, 0x10($a0)
/* 352C74 E003E834 AE420000 */ sw $v0, 0x0($s2)
/* 352C78 E003E838 AC960018 */ sw $s6, 0x18($a0)
/* 352C7C E003E83C AC80001C */ sw $zero, 0x1C($a0)
/* 352C80 E003E840 8FBF00AC */ lw $ra, 0xAC($sp)
/* 352C84 E003E844 8FB600A8 */ lw $s6, 0xA8($sp)
/* 352C88 E003E848 8FB500A4 */ lw $s5, 0xA4($sp)
/* 352C8C E003E84C 8FB400A0 */ lw $s4, 0xA0($sp)
/* 352C90 E003E850 8FB3009C */ lw $s3, 0x9C($sp)
/* 352C94 E003E854 8FB20098 */ lw $s2, 0x98($sp)
/* 352C98 E003E858 8FB10094 */ lw $s1, 0x94($sp)
/* 352C9C E003E85C 8FB00090 */ lw $s0, 0x90($sp)
/* 352CA0 E003E860 03E00008 */ jr $ra
/* 352CA4 E003E864 27BD00B0 */ addiu $sp, $sp, 0xB0
/* 352CA8 E003E868 00000000 */ nop
/* 352CAC E003E86C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void purple_ring_appendGfx(void* effect) {
PurpleRingFXData* data = ((EffectInstance*)effect)->data.purpleRing;
s32 unk_5C = data->unk_5C;
s32 temp = 64;
Matrix4f sp10;
Matrix4f sp50;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09000200_352EE0);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_74, data->unk_75, data->unk_76, data->unk_68);
shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
shim_guMtxCatF(data->unk_1C, sp10, sp10);
shim_guScaleF(sp50, data->unk_64, data->unk_64, data->unk_64);
shim_guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, unk_5C, temp * 4, unk_5C + temp);
gSPDisplayList(gMainGfxPos++, D_090004E8_3531C8);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_bgm_player_init
/* 29558 8004E158 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 2955C 8004E15C AFB20018 */ sw $s2, 0x18($sp)
/* 29560 8004E160 0080902D */ daddu $s2, $a0, $zero
/* 29564 8004E164 AFB00010 */ sw $s0, 0x10($sp)
/* 29568 8004E168 00A0802D */ daddu $s0, $a1, $zero
/* 2956C 8004E16C AFB10014 */ sw $s1, 0x14($sp)
/* 29570 8004E170 00C0882D */ daddu $s1, $a2, $zero
/* 29574 8004E174 3C050002 */ lui $a1, (0x2625A >> 16)
/* 29578 8004E178 34A5625A */ ori $a1, $a1, (0x2625A & 0xFFFF)
/* 2957C 8004E17C 24060030 */ addiu $a2, $zero, 0x30
/* 29580 8004E180 AFBF001C */ sw $ra, 0x1C($sp)
/* 29584 8004E184 0C013A20 */ jal func_8004E880
/* 29588 8004E188 AE470000 */ sw $a3, 0x0($s2)
/* 2958C 8004E18C 0000282D */ daddu $a1, $zero, $zero
/* 29590 8004E190 2404007F */ addiu $a0, $zero, 0x7F
/* 29594 8004E194 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 29598 8004E198 44810000 */ mtc1 $at, $f0
/* 2959C 8004E19C 34028000 */ ori $v0, $zero, 0x8000
/* 295A0 8004E1A0 AE420048 */ sw $v0, 0x48($s2)
/* 295A4 8004E1A4 24023CF0 */ addiu $v0, $zero, 0x3CF0
/* 295A8 8004E1A8 AE4200B0 */ sw $v0, 0xB0($s2)
/* 295AC 8004E1AC 3C027F00 */ lui $v0, (0x7F000000 >> 16)
/* 295B0 8004E1B0 AE4200C0 */ sw $v0, 0xC0($s2)
/* 295B4 8004E1B4 24020001 */ addiu $v0, $zero, 0x1
/* 295B8 8004E1B8 A242022B */ sb $v0, 0x22B($s2)
/* 295BC 8004E1BC 24020002 */ addiu $v0, $zero, 0x2
/* 295C0 8004E1C0 AE400014 */ sw $zero, 0x14($s2)
/* 295C4 8004E1C4 AE400018 */ sw $zero, 0x18($s2)
/* 295C8 8004E1C8 AE40001C */ sw $zero, 0x1C($s2)
/* 295CC 8004E1CC AE400020 */ sw $zero, 0x20($s2)
/* 295D0 8004E1D0 A6400058 */ sh $zero, 0x58($s2)
/* 295D4 8004E1D4 A640005A */ sh $zero, 0x5A($s2)
/* 295D8 8004E1D8 AE400068 */ sw $zero, 0x68($s2)
/* 295DC 8004E1DC AE40006C */ sw $zero, 0x6C($s2)
/* 295E0 8004E1E0 AE400070 */ sw $zero, 0x70($s2)
/* 295E4 8004E1E4 AE4000BC */ sw $zero, 0xBC($s2)
/* 295E8 8004E1E8 AE4000B8 */ sw $zero, 0xB8($s2)
/* 295EC 8004E1EC AE4000B4 */ sw $zero, 0xB4($s2)
/* 295F0 8004E1F0 AE4000CC */ sw $zero, 0xCC($s2)
/* 295F4 8004E1F4 AE4000C8 */ sw $zero, 0xC8($s2)
/* 295F8 8004E1F8 AE4000C4 */ sw $zero, 0xC4($s2)
/* 295FC 8004E1FC A640020C */ sh $zero, 0x20C($s2)
/* 29600 8004E200 A640020E */ sh $zero, 0x20E($s2)
/* 29604 8004E204 A2400220 */ sb $zero, 0x220($s2)
/* 29608 8004E208 AE400204 */ sw $zero, 0x204($s2)
/* 2960C 8004E20C A2400232 */ sb $zero, 0x232($s2)
/* 29610 8004E210 A2400221 */ sb $zero, 0x221($s2)
/* 29614 8004E214 A2500234 */ sb $s0, 0x234($s2)
/* 29618 8004E218 A2510235 */ sb $s1, 0x235($s2)
/* 2961C 8004E21C AE400168 */ sw $zero, 0x168($s2)
/* 29620 8004E220 A2400222 */ sb $zero, 0x222($s2)
/* 29624 8004E224 A2400223 */ sb $zero, 0x223($s2)
/* 29628 8004E228 A240022A */ sb $zero, 0x22A($s2)
/* 2962C 8004E22C A240022C */ sb $zero, 0x22C($s2)
/* 29630 8004E230 E64000D0 */ swc1 $f0, 0xD0($s2)
/* 29634 8004E234 A240022D */ sb $zero, 0x22D($s2)
/* 29638 8004E238 A242022F */ sb $v0, 0x22F($s2)
/* 2963C 8004E23C 24020003 */ addiu $v0, $zero, 0x3
/* 29640 8004E240 A2420230 */ sb $v0, 0x230($s2)
/* 29644 8004E244 24020004 */ addiu $v0, $zero, 0x4
/* 29648 8004E248 A240022E */ sb $zero, 0x22E($s2)
/* 2964C 8004E24C A2420231 */ sb $v0, 0x231($s2)
/* 29650 8004E250 00051400 */ sll $v0, $a1, 16
.L8004E254:
/* 29654 8004E254 00021C03 */ sra $v1, $v0, 16
/* 29658 8004E258 00031040 */ sll $v0, $v1, 1
glabel func_8004E25C
/* 2965C 8004E25C 00431021 */ addu $v0, $v0, $v1
/* 29660 8004E260 00021140 */ sll $v0, $v0, 5
/* 29664 8004E264 2442025C */ addiu $v0, $v0, 0x25C
/* 29668 8004E268 02421021 */ addu $v0, $s2, $v0
/* 2966C 8004E26C AC400018 */ sw $zero, 0x18($v0)
/* 29670 8004E270 AC400028 */ sw $zero, 0x28($v0)
/* 29674 8004E274 A4400046 */ sh $zero, 0x46($v0)
/* 29678 8004E278 A0400048 */ sb $zero, 0x48($v0)
/* 2967C 8004E27C A040004A */ sb $zero, 0x4A($v0)
/* 29680 8004E280 A040004B */ sb $zero, 0x4B($v0)
/* 29684 8004E284 A4400044 */ sh $zero, 0x44($v0)
/* 29688 8004E288 A0400058 */ sb $zero, 0x58($v0)
/* 2968C 8004E28C A0440049 */ sb $a0, 0x49($v0)
/* 29690 8004E290 A040004C */ sb $zero, 0x4C($v0)
/* 29694 8004E294 28620008 */ slti $v0, $v1, 0x8
/* 29698 8004E298 10400005 */ beqz $v0, .L8004E2B0
/* 2969C 8004E29C 24A20001 */ addiu $v0, $a1, 0x1
/* 296A0 8004E2A0 00031080 */ sll $v0, $v1, 2
/* 296A4 8004E2A4 02421021 */ addu $v0, $s2, $v0
/* 296A8 8004E2A8 AC400238 */ sw $zero, 0x238($v0)
/* 296AC 8004E2AC 24A20001 */ addiu $v0, $a1, 0x1
.L8004E2B0:
/* 296B0 8004E2B0 0040282D */ daddu $a1, $v0, $zero
/* 296B4 8004E2B4 00021400 */ sll $v0, $v0, 16
/* 296B8 8004E2B8 00021403 */ sra $v0, $v0, 16
/* 296BC 8004E2BC 28420010 */ slti $v0, $v0, 0x10
/* 296C0 8004E2C0 1440FFE4 */ bnez $v0, .L8004E254
/* 296C4 8004E2C4 00051400 */ sll $v0, $a1, 16
/* 296C8 8004E2C8 0000282D */ daddu $a1, $zero, $zero
.L8004E2CC:
/* 296CC 8004E2CC 00051400 */ sll $v0, $a1, 16
/* 296D0 8004E2D0 24A40001 */ addiu $a0, $a1, 0x1
/* 296D4 8004E2D4 0080282D */ daddu $a1, $a0, $zero
/* 296D8 8004E2D8 00021403 */ sra $v0, $v0, 16
/* 296DC 8004E2DC 00021840 */ sll $v1, $v0, 1
/* 296E0 8004E2E0 00621821 */ addu $v1, $v1, $v0
/* 296E4 8004E2E4 000318C0 */ sll $v1, $v1, 3
/* 296E8 8004E2E8 2463085C */ addiu $v1, $v1, 0x85C
glabel func_8004E2EC
/* 296EC 8004E2EC 02431821 */ addu $v1, $s2, $v1
/* 296F0 8004E2F0 00042400 */ sll $a0, $a0, 16
/* 296F4 8004E2F4 00042403 */ sra $a0, $a0, 16
/* 296F8 8004E2F8 28840018 */ slti $a0, $a0, 0x18
/* 296FC 8004E2FC A4600008 */ sh $zero, 0x8($v1)
/* 29700 8004E300 A460000A */ sh $zero, 0xA($v1)
/* 29704 8004E304 AC60000C */ sw $zero, 0xC($v1)
/* 29708 8004E308 A4600014 */ sh $zero, 0x14($v1)
/* 2970C 8004E30C A0600016 */ sb $zero, 0x16($v1)
/* 29710 8004E310 1480FFEE */ bnez $a0, .L8004E2CC
/* 29714 8004E314 A0600017 */ sb $zero, 0x17($v1)
/* 29718 8004E318 2644002C */ addiu $a0, $s2, 0x2C
/* 2971C 8004E31C 0C014EBB */ jal au_fade_set_vol_scale
/* 29720 8004E320 24057FFF */ addiu $a1, $zero, 0x7FFF
/* 29724 8004E324 0C015444 */ jal func_80055110
/* 29728 8004E328 0240202D */ daddu $a0, $s2, $zero
/* 2972C 8004E32C 8FBF001C */ lw $ra, 0x1C($sp)
/* 29730 8004E330 8FB20018 */ lw $s2, 0x18($sp)
/* 29734 8004E334 8FB10014 */ lw $s1, 0x14($sp)
/* 29738 8004E338 8FB00010 */ lw $s0, 0x10($sp)
/* 2973C 8004E33C 03E00008 */ jr $ra
/* 29740 8004E340 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void au_bgm_player_init(BGMPlayer* player, s32 priority, s32 busId, AuGlobals* globals) {
s16 i;
player->globals = globals;
func_8004E880(player, BGM_SAMPLE_RATE, 48);
player->busVolume = 0x8000;
player->masterTempo = BGM_DEFAULT_TEMPO;
player->masterVolume = 0x7F000000;
player->updateCounter = 0;
player->songPlayingCounter = 0;
player->songName = 0;
player->fadeSongName = 0;
player->unk_58 = 0;
player->unk_5A = 0;
player->segmentReadPos = NULL;
player->segmentStartPos = NULL;
player->subSegmentStartPos = 0;
player->masterTempoTime = 0;
player->masterTempoTarget = 0;
player->masterTempoStep = 0;
player->masterVolumeTime = 0;
player->masterVolumeTarget = 0;
player->masterVolumeStep = 0;
player->masterPitchShift = 0;
player->detune = 0;
player->unk_220 = 0;
player->trackVolsConfig = NULL;
player->bFadeConfigSetsVolume = FALSE;
player->masterState = BGM_PLAY_STATE_IDLE;
player->priority = priority;
player->busId = busId;
*(s32*)player->segLoopCounters = 0;
player->unk_222 = 0;
player->unk_223 = 0;
player->playbackRate = 1.0f;
player->unk_22A[0] = 0;
player->unk_22A[1] = 1;
player->unk_22A[2] = 0;
player->unk_22A[3] = 0;
player->unk_22A[4] = 0;
player->unk_22A[5] = 2;
player->unk_22A[6] = 3;
player->unk_22A[7] = 4;
for (i = 0; i < ARRAY_COUNT(player->tracks); i++) {
BGMPlayerTrack* temp = &player->tracks[i];
temp->subTrackVolume = 0;
temp->delayTime = 0;
temp->subTrackCoarseTune = 0;
temp->subTrackFineTune = 0;
temp->subTrackPan = 0;
temp->subTrackReverb = 0;
temp->patch = 0;
temp->isDrumTrack = FALSE;
temp->segTrackVolume = 0x7F;
temp->unk_4C = 0;
if (i < ARRAY_COUNT(player->unk_238)) {
player->unk_238[i] = 0;
}
}
for (i = 0; i < ARRAY_COUNT(player->notes); i++) {
SeqNote* note = &player->notes[i];
note->volume = 0;
note->adjustedPitch = 0;
note->noteLength = 0;
note->unk_14 = 0;
note->noteVelocity = 0;
note->unk_note_17 = 0;
}
au_fade_set_vol_scale(&player->fadeInfo, 0x7FFF);
func_80055110(player);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel cloud_puff_update
/* 32E6F0 E0014260 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 32E6F4 E0014264 AFB40020 */ sw $s4, 0x20($sp)
/* 32E6F8 E0014268 0080A02D */ daddu $s4, $a0, $zero
/* 32E6FC E001426C AFB3001C */ sw $s3, 0x1C($sp)
/* 32E700 E0014270 0000982D */ daddu $s3, $zero, $zero
/* 32E704 E0014274 AFB20018 */ sw $s2, 0x18($sp)
/* 32E708 E0014278 AFBF0024 */ sw $ra, 0x24($sp)
/* 32E70C E001427C AFB10014 */ sw $s1, 0x14($sp)
/* 32E710 E0014280 AFB00010 */ sw $s0, 0x10($sp)
/* 32E714 E0014284 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 32E718 E0014288 8E820008 */ lw $v0, 0x8($s4)
/* 32E71C E001428C 8E91000C */ lw $s1, 0xC($s4)
/* 32E720 E0014290 18400075 */ blez $v0, .LE0014468
/* 32E724 E0014294 0260902D */ daddu $s2, $s3, $zero
/* 32E728 E0014298 3C01E001 */ lui $at, (0xE0014790 >> 16)
/* 32E72C E001429C D4344790 */ ldc1 $f20, (0xE0014790 & 0xFFFF)($at)
/* 32E730 E00142A0 26300008 */ addiu $s0, $s1, 0x8
.LE00142A4:
/* 32E734 E00142A4 8E220000 */ lw $v0, 0x0($s1)
/* 32E738 E00142A8 5040006A */ beql $v0, $zero, .LE0014454
/* 32E73C E00142AC 26730001 */ addiu $s3, $s3, 0x1
/* 32E740 E00142B0 9602FFFE */ lhu $v0, -0x2($s0)
/* 32E744 E00142B4 2442FFFF */ addiu $v0, $v0, -0x1
/* 32E748 E00142B8 A602FFFE */ sh $v0, -0x2($s0)
/* 32E74C E00142BC 00021400 */ sll $v0, $v0, 16
/* 32E750 E00142C0 1C400003 */ bgtz $v0, .LE00142D0
/* 32E754 E00142C4 00000000 */ nop
/* 32E758 E00142C8 08005114 */ j .LE0014450
/* 32E75C E00142CC AE200000 */ sw $zero, 0x0($s1)
.LE00142D0:
/* 32E760 E00142D0 C6000024 */ lwc1 $f0, 0x24($s0)
/* 32E764 E00142D4 3C014140 */ lui $at, (0x41400000 >> 16)
/* 32E768 E00142D8 44816000 */ mtc1 $at, $f12
/* 32E76C E00142DC 0C08013C */ jal shim_clamp_angle
/* 32E770 E00142E0 460C0300 */ add.s $f12, $f0, $f12
/* 32E774 E00142E4 46000306 */ mov.s $f12, $f0
/* 32E778 E00142E8 0C080140 */ jal shim_sin_deg
/* 32E77C E00142EC E60C0024 */ swc1 $f12, 0x24($s0)
/* 32E780 E00142F0 46000021 */ cvt.d.s $f0, $f0
/* 32E784 E00142F4 46340002 */ mul.d $f0, $f0, $f20
/* 32E788 E00142F8 00000000 */ nop
/* 32E78C E00142FC C602001C */ lwc1 $f2, 0x1C($s0)
/* 32E790 E0014300 460010A1 */ cvt.d.s $f2, $f2
/* 32E794 E0014304 46201080 */ add.d $f2, $f2, $f0
/* 32E798 E0014308 C60C0024 */ lwc1 $f12, 0x24($s0)
/* 32E79C E001430C 462010A0 */ cvt.s.d $f2, $f2
/* 32E7A0 E0014310 0C080144 */ jal shim_cos_deg
/* 32E7A4 E0014314 E6020010 */ swc1 $f2, 0x10($s0)
/* 32E7A8 E0014318 46000021 */ cvt.d.s $f0, $f0
/* 32E7AC E001431C 46340002 */ mul.d $f0, $f0, $f20
/* 32E7B0 E0014320 00000000 */ nop
/* 32E7B4 E0014324 C6040028 */ lwc1 $f4, 0x28($s0)
/* 32E7B8 E0014328 3C01E001 */ lui $at, (0xE0014798 >> 16)
/* 32E7BC E001432C D4224798 */ ldc1 $f2, (0xE0014798 & 0xFFFF)($at)
/* 32E7C0 E0014330 46002121 */ cvt.d.s $f4, $f4
/* 32E7C4 E0014334 46222102 */ mul.d $f4, $f4, $f2
/* 32E7C8 E0014338 00000000 */ nop
/* 32E7CC E001433C C608001C */ lwc1 $f8, 0x1C($s0)
/* 32E7D0 E0014340 3C01401E */ lui $at, (0x401E0000 >> 16)
/* 32E7D4 E0014344 44817800 */ mtc1 $at, $f15
/* 32E7D8 E0014348 44807000 */ mtc1 $zero, $f14
/* 32E7DC E001434C 46004221 */ cvt.d.s $f8, $f8
/* 32E7E0 E0014350 46287381 */ sub.d $f14, $f14, $f8
/* 32E7E4 E0014354 3C01E001 */ lui $at, (0xE00147A0 >> 16)
/* 32E7E8 E0014358 D42247A0 */ ldc1 $f2, (0xE00147A0 & 0xFFFF)($at)
/* 32E7EC E001435C 46227382 */ mul.d $f14, $f14, $f2
/* 32E7F0 E0014360 00000000 */ nop
/* 32E7F4 E0014364 C60C0020 */ lwc1 $f12, 0x20($s0)
/* 32E7F8 E0014368 3C01E001 */ lui $at, (0xE00147A8 >> 16)
/* 32E7FC E001436C D42247A8 */ ldc1 $f2, (0xE00147A8 & 0xFFFF)($at)
/* 32E800 E0014370 46006321 */ cvt.d.s $f12, $f12
/* 32E804 E0014374 46226302 */ mul.d $f12, $f12, $f2
/* 32E808 E0014378 00000000 */ nop
/* 32E80C E001437C C612003C */ lwc1 $f18, 0x3C($s0)
/* 32E810 E0014380 46202120 */ cvt.s.d $f4, $f4
/* 32E814 E0014384 46122482 */ mul.s $f18, $f4, $f18
/* 32E818 E0014388 00000000 */ nop
/* 32E81C E001438C C6020040 */ lwc1 $f2, 0x40($s0)
/* 32E820 E0014390 24120001 */ addiu $s2, $zero, 0x1
/* 32E824 E0014394 E6040028 */ swc1 $f4, 0x28($s0)
/* 32E828 E0014398 46002406 */ mov.s $f16, $f4
/* 32E82C E001439C 46028402 */ mul.s $f16, $f16, $f2
/* 32E830 E00143A0 00000000 */ nop
/* 32E834 E00143A4 C60A0030 */ lwc1 $f10, 0x30($s0)
/* 32E838 E00143A8 C606002C */ lwc1 $f6, 0x2C($s0)
/* 32E83C E00143AC C6020034 */ lwc1 $f2, 0x34($s0)
/* 32E840 E00143B0 8602FFFE */ lh $v0, -0x2($s0)
/* 32E844 E00143B4 46025280 */ add.s $f10, $f10, $f2
/* 32E848 E00143B8 C6020020 */ lwc1 $f2, 0x20($s0)
/* 32E84C E00143BC 2842000A */ slti $v0, $v0, 0xA
/* 32E850 E00143C0 460010A1 */ cvt.d.s $f2, $f2
/* 32E854 E00143C4 46201080 */ add.d $f2, $f2, $f0
/* 32E858 E00143C8 C6040008 */ lwc1 $f4, 0x8($s0)
/* 32E85C E00143CC C600000C */ lwc1 $f0, 0xC($s0)
/* 32E860 E00143D0 462E4200 */ add.d $f8, $f8, $f14
/* 32E864 E00143D4 46206320 */ cvt.s.d $f12, $f12
/* 32E868 E00143D8 E60A0030 */ swc1 $f10, 0x30($s0)
/* 32E86C E00143DC E60C0020 */ swc1 $f12, 0x20($s0)
/* 32E870 E00143E0 460A3180 */ add.s $f6, $f6, $f10
/* 32E874 E00143E4 462010A0 */ cvt.s.d $f2, $f2
/* 32E878 E00143E8 46204220 */ cvt.s.d $f8, $f8
/* 32E87C E00143EC 46100000 */ add.s $f0, $f0, $f16
/* 32E880 E00143F0 E6020014 */ swc1 $f2, 0x14($s0)
/* 32E884 E00143F4 C6020004 */ lwc1 $f2, 0x4($s0)
/* 32E888 E00143F8 46062100 */ add.s $f4, $f4, $f6
/* 32E88C E00143FC E608001C */ swc1 $f8, 0x1C($s0)
/* 32E890 E0014400 E606002C */ swc1 $f6, 0x2C($s0)
/* 32E894 E0014404 46121080 */ add.s $f2, $f2, $f18
/* 32E898 E0014408 E600000C */ swc1 $f0, 0xC($s0)
/* 32E89C E001440C E6040008 */ swc1 $f4, 0x8($s0)
/* 32E8A0 E0014410 10400008 */ beqz $v0, .LE0014434
/* 32E8A4 E0014414 E6020004 */ swc1 $f2, 0x4($s0)
/* 32E8A8 E0014418 3C01E001 */ lui $at, (0xE00147B0 >> 16)
/* 32E8AC E001441C D42247B0 */ ldc1 $f2, (0xE00147B0 & 0xFFFF)($at)
/* 32E8B0 E0014420 46006021 */ cvt.d.s $f0, $f12
/* 32E8B4 E0014424 46220002 */ mul.d $f0, $f0, $f2
/* 32E8B8 E0014428 00000000 */ nop
/* 32E8BC E001442C 46200020 */ cvt.s.d $f0, $f0
/* 32E8C0 E0014430 E6000020 */ swc1 $f0, 0x20($s0)
.LE0014434:
/* 32E8C4 E0014434 8602FFFE */ lh $v0, -0x2($s0)
/* 32E8C8 E0014438 2842000F */ slti $v0, $v0, 0xF
/* 32E8CC E001443C 50400005 */ beql $v0, $zero, .LE0014454
/* 32E8D0 E0014440 26730001 */ addiu $s3, $s3, 0x1
/* 32E8D4 E0014444 92020000 */ lbu $v0, 0x0($s0)
/* 32E8D8 E0014448 2442FFF0 */ addiu $v0, $v0, -0x10
/* 32E8DC E001444C A2020000 */ sb $v0, 0x0($s0)
.LE0014450:
/* 32E8E0 E0014450 26730001 */ addiu $s3, $s3, 0x1
.LE0014454:
/* 32E8E4 E0014454 2610004C */ addiu $s0, $s0, 0x4C
/* 32E8E8 E0014458 8E820008 */ lw $v0, 0x8($s4)
/* 32E8EC E001445C 0262102A */ slt $v0, $s3, $v0
/* 32E8F0 E0014460 1440FF90 */ bnez $v0, .LE00142A4
/* 32E8F4 E0014464 2631004C */ addiu $s1, $s1, 0x4C
.LE0014468:
/* 32E8F8 E0014468 16400003 */ bnez $s2, .LE0014478
/* 32E8FC E001446C 00000000 */ nop
/* 32E900 E0014470 0C080128 */ jal shim_remove_effect
/* 32E904 E0014474 0280202D */ daddu $a0, $s4, $zero
.LE0014478:
/* 32E908 E0014478 8FBF0024 */ lw $ra, 0x24($sp)
/* 32E90C E001447C 8FB40020 */ lw $s4, 0x20($sp)
/* 32E910 E0014480 8FB3001C */ lw $s3, 0x1C($sp)
/* 32E914 E0014484 8FB20018 */ lw $s2, 0x18($sp)
/* 32E918 E0014488 8FB10014 */ lw $s1, 0x14($sp)
/* 32E91C E001448C 8FB00010 */ lw $s0, 0x10($sp)
/* 32E920 E0014490 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 32E924 E0014494 03E00008 */ jr $ra
/* 32E928 E0014498 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void cloud_puff_update(EffectInstance* effect) {
CloudPuffFXData* part = effect->data.cloudPuff;
s32 cond = FALSE;
s32 i;
for (i = 0; i < effect->numParts; i++, part++) {
if (part->alive) {
part->timeLeft--;
if (part->timeLeft <= 0) {
part->alive = FALSE;
} else {
cond = TRUE;
part->unk_2C = shim_clamp_angle(part->unk_2C + 12.0f);
part->unk_18 = part->unk_24 + shim_sin_deg(part->unk_2C) * 0.1;
part->unk_1C = part->unk_28 + shim_cos_deg(part->unk_2C) * 0.1;
part->unk_30 *= 0.83;
part->unk_0C += part->unk_30 * part->unk_44;
part->unk_14 += part->unk_30 * part->unk_48;
part->unk_24 += (7.5 - part->unk_24) * 0.006;
part->unk_38 += part->unk_3C;
part->unk_34 += part->unk_38;
part->unk_10 += part->unk_34;
part->unk_28 *= 0.98;
if (part->timeLeft < 10) {
part->unk_28 *= 0.9;
}
if (part->timeLeft < 15) {
part->alpha -= 16;
}
}
}
}
if (!cond) {
shim_remove_effect(effect);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel get_defense
/* 194B9C 802662BC 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 194BA0 802662C0 AFB10014 */ sw $s1, 0x14($sp)
/* 194BA4 802662C4 00A0882D */ daddu $s1, $a1, $zero
/* 194BA8 802662C8 AFB20018 */ sw $s2, 0x18($sp)
/* 194BAC 802662CC 00C0902D */ daddu $s2, $a2, $zero
/* 194BB0 802662D0 AFB00010 */ sw $s0, 0x10($sp)
/* 194BB4 802662D4 241000FF */ addiu $s0, $zero, 0xFF
/* 194BB8 802662D8 12200065 */ beqz $s1, .L80266470
/* 194BBC 802662DC AFBF001C */ sw $ra, 0x1C($sp)
/* 194BC0 802662E0 32420002 */ andi $v0, $s2, 0x2
/* 194BC4 802662E4 10400007 */ beqz $v0, .L80266304
/* 194BC8 802662E8 0220202D */ daddu $a0, $s1, $zero
/* 194BCC 802662EC 0C099791 */ jal lookup_defense
/* 194BD0 802662F0 24050002 */ addiu $a1, $zero, 0x2
/* 194BD4 802662F4 0040182D */ daddu $v1, $v0, $zero
/* 194BD8 802662F8 0070102A */ slt $v0, $v1, $s0
/* 194BDC 802662FC 54400001 */ bnel $v0, $zero, .L80266304
/* 194BE0 80266300 0060802D */ daddu $s0, $v1, $zero
.L80266304:
/* 194BE4 80266304 32420004 */ andi $v0, $s2, 0x4
/* 194BE8 80266308 10400007 */ beqz $v0, .L80266328
/* 194BEC 8026630C 0220202D */ daddu $a0, $s1, $zero
/* 194BF0 80266310 0C099791 */ jal lookup_defense
/* 194BF4 80266314 24050003 */ addiu $a1, $zero, 0x3
/* 194BF8 80266318 0040182D */ daddu $v1, $v0, $zero
/* 194BFC 8026631C 0070102A */ slt $v0, $v1, $s0
/* 194C00 80266320 54400001 */ bnel $v0, $zero, .L80266328
/* 194C04 80266324 0060802D */ daddu $s0, $v1, $zero
.L80266328:
/* 194C08 80266328 32420008 */ andi $v0, $s2, 0x8
/* 194C0C 8026632C 10400007 */ beqz $v0, .L8026634C
/* 194C10 80266330 0220202D */ daddu $a0, $s1, $zero
/* 194C14 80266334 0C099791 */ jal lookup_defense
/* 194C18 80266338 24050004 */ addiu $a1, $zero, 0x4
/* 194C1C 8026633C 0040182D */ daddu $v1, $v0, $zero
/* 194C20 80266340 0070102A */ slt $v0, $v1, $s0
/* 194C24 80266344 54400001 */ bnel $v0, $zero, .L8026634C
/* 194C28 80266348 0060802D */ daddu $s0, $v1, $zero
.L8026634C:
/* 194C2C 8026634C 32420010 */ andi $v0, $s2, 0x10
/* 194C30 80266350 10400007 */ beqz $v0, .L80266370
/* 194C34 80266354 0220202D */ daddu $a0, $s1, $zero
/* 194C38 80266358 0C099791 */ jal lookup_defense
/* 194C3C 8026635C 24050007 */ addiu $a1, $zero, 0x7
/* 194C40 80266360 0040182D */ daddu $v1, $v0, $zero
/* 194C44 80266364 0070102A */ slt $v0, $v1, $s0
/* 194C48 80266368 54400001 */ bnel $v0, $zero, .L80266370
/* 194C4C 8026636C 0060802D */ daddu $s0, $v1, $zero
.L80266370:
/* 194C50 80266370 32420040 */ andi $v0, $s2, 0x40
/* 194C54 80266374 10400007 */ beqz $v0, .L80266394
/* 194C58 80266378 0220202D */ daddu $a0, $s1, $zero
/* 194C5C 8026637C 0C099791 */ jal lookup_defense
/* 194C60 80266380 24050008 */ addiu $a1, $zero, 0x8
/* 194C64 80266384 0040182D */ daddu $v1, $v0, $zero
/* 194C68 80266388 0070102A */ slt $v0, $v1, $s0
/* 194C6C 8026638C 54400001 */ bnel $v0, $zero, .L80266394
/* 194C70 80266390 0060802D */ daddu $s0, $v1, $zero
.L80266394:
/* 194C74 80266394 32420080 */ andi $v0, $s2, 0x80
/* 194C78 80266398 10400007 */ beqz $v0, .L802663B8
/* 194C7C 8026639C 0220202D */ daddu $a0, $s1, $zero
/* 194C80 802663A0 0C099791 */ jal lookup_defense
/* 194C84 802663A4 24050009 */ addiu $a1, $zero, 0x9
/* 194C88 802663A8 0040182D */ daddu $v1, $v0, $zero
/* 194C8C 802663AC 0070102A */ slt $v0, $v1, $s0
/* 194C90 802663B0 54400001 */ bnel $v0, $zero, .L802663B8
/* 194C94 802663B4 0060802D */ daddu $s0, $v1, $zero
.L802663B8:
/* 194C98 802663B8 32420100 */ andi $v0, $s2, 0x100
/* 194C9C 802663BC 10400007 */ beqz $v0, .L802663DC
/* 194CA0 802663C0 0220202D */ daddu $a0, $s1, $zero
/* 194CA4 802663C4 0C099791 */ jal lookup_defense
/* 194CA8 802663C8 2405000A */ addiu $a1, $zero, 0xA
/* 194CAC 802663CC 0040182D */ daddu $v1, $v0, $zero
/* 194CB0 802663D0 0070102A */ slt $v0, $v1, $s0
/* 194CB4 802663D4 54400001 */ bnel $v0, $zero, .L802663DC
/* 194CB8 802663D8 0060802D */ daddu $s0, $v1, $zero
.L802663DC:
/* 194CBC 802663DC 32420200 */ andi $v0, $s2, 0x200
/* 194CC0 802663E0 10400007 */ beqz $v0, .L80266400
/* 194CC4 802663E4 0220202D */ daddu $a0, $s1, $zero
/* 194CC8 802663E8 0C099791 */ jal lookup_defense
/* 194CCC 802663EC 2405000B */ addiu $a1, $zero, 0xB
/* 194CD0 802663F0 0040182D */ daddu $v1, $v0, $zero
/* 194CD4 802663F4 0070102A */ slt $v0, $v1, $s0
/* 194CD8 802663F8 54400001 */ bnel $v0, $zero, .L80266400
/* 194CDC 802663FC 0060802D */ daddu $s0, $v1, $zero
.L80266400:
/* 194CE0 80266400 32420020 */ andi $v0, $s2, 0x20
/* 194CE4 80266404 10400007 */ beqz $v0, .L80266424
/* 194CE8 80266408 0220202D */ daddu $a0, $s1, $zero
/* 194CEC 8026640C 0C099791 */ jal lookup_defense
/* 194CF0 80266410 2405000C */ addiu $a1, $zero, 0xC
/* 194CF4 80266414 0040182D */ daddu $v1, $v0, $zero
/* 194CF8 80266418 0070102A */ slt $v0, $v1, $s0
/* 194CFC 8026641C 54400001 */ bnel $v0, $zero, .L80266424
/* 194D00 80266420 0060802D */ daddu $s0, $v1, $zero
.L80266424:
/* 194D04 80266424 32420800 */ andi $v0, $s2, 0x800
/* 194D08 80266428 10400007 */ beqz $v0, .L80266448
/* 194D0C 8026642C 0220202D */ daddu $a0, $s1, $zero
/* 194D10 80266430 0C099791 */ jal lookup_defense
/* 194D14 80266434 2405000D */ addiu $a1, $zero, 0xD
/* 194D18 80266438 0040182D */ daddu $v1, $v0, $zero
/* 194D1C 8026643C 0070102A */ slt $v0, $v1, $s0
/* 194D20 80266440 54400001 */ bnel $v0, $zero, .L80266448
/* 194D24 80266444 0060802D */ daddu $s0, $v1, $zero
.L80266448:
/* 194D28 80266448 3C020004 */ lui $v0, (0x40000 >> 16)
/* 194D2C 8026644C 02421024 */ and $v0, $s2, $v0
/* 194D30 80266450 10400007 */ beqz $v0, .L80266470
/* 194D34 80266454 0220202D */ daddu $a0, $s1, $zero
/* 194D38 80266458 0C099791 */ jal lookup_defense
/* 194D3C 8026645C 2405000F */ addiu $a1, $zero, 0xF
/* 194D40 80266460 0040182D */ daddu $v1, $v0, $zero
/* 194D44 80266464 0070102A */ slt $v0, $v1, $s0
/* 194D48 80266468 54400001 */ bnel $v0, $zero, .L80266470
/* 194D4C 8026646C 0060802D */ daddu $s0, $v1, $zero
.L80266470:
/* 194D50 80266470 240200FF */ addiu $v0, $zero, 0xFF
/* 194D54 80266474 16020009 */ bne $s0, $v0, .L8026649C
/* 194D58 80266478 3C020800 */ lui $v0, (0x8000000 >> 16)
/* 194D5C 8026647C 0220202D */ daddu $a0, $s1, $zero
/* 194D60 80266480 0C099791 */ jal lookup_defense
/* 194D64 80266484 24050001 */ addiu $a1, $zero, 0x1
/* 194D68 80266488 0040182D */ daddu $v1, $v0, $zero
/* 194D6C 8026648C 286200FF */ slti $v0, $v1, 0xFF
/* 194D70 80266490 54400001 */ bnel $v0, $zero, .L80266498
/* 194D74 80266494 0060802D */ daddu $s0, $v1, $zero
.L80266498:
/* 194D78 80266498 3C020800 */ lui $v0, (0x8000000 >> 16)
.L8026649C:
/* 194D7C 8026649C 02421024 */ and $v0, $s2, $v0
/* 194D80 802664A0 10400007 */ beqz $v0, .L802664C0
/* 194D84 802664A4 24020063 */ addiu $v0, $zero, 0x63
/* 194D88 802664A8 16020003 */ bne $s0, $v0, .L802664B8
/* 194D8C 802664AC 00000000 */ nop
/* 194D90 802664B0 08099930 */ j .L802664C0
/* 194D94 802664B4 241003E7 */ addiu $s0, $zero, 0x3E7
.L802664B8:
/* 194D98 802664B8 5E000001 */ bgtzl $s0, .L802664C0
/* 194D9C 802664BC 0000802D */ daddu $s0, $zero, $zero
.L802664C0:
/* 194DA0 802664C0 0200102D */ daddu $v0, $s0, $zero
/* 194DA4 802664C4 8FBF001C */ lw $ra, 0x1C($sp)
/* 194DA8 802664C8 8FB20018 */ lw $s2, 0x18($sp)
/* 194DAC 802664CC 8FB10014 */ lw $s1, 0x14($sp)
/* 194DB0 802664D0 8FB00010 */ lw $s0, 0x10($sp)
/* 194DB4 802664D4 03E00008 */ jr $ra
/* 194DB8 802664D8 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
s32 get_defense(Actor* actor, s32* defenseTable, s32 elementFlags) {
s32 defense;
s32 minDefense = 255;
if (defenseTable != NULL) {
#define CHECK_DEFENSE(element) \
if (elementFlags & DAMAGE_TYPE_##element) { \
defense = lookup_defense(defenseTable, ELEMENT_##element); \
if (defense < minDefense) { \
minDefense = defense; \
} \
} \
CHECK_DEFENSE(FIRE);
CHECK_DEFENSE(WATER);
CHECK_DEFENSE(ICE);
CHECK_DEFENSE(MAGIC);
CHECK_DEFENSE(SMASH);
CHECK_DEFENSE(JUMP);
CHECK_DEFENSE(COSMIC);
CHECK_DEFENSE(BLAST);
CHECK_DEFENSE(SHOCK);
CHECK_DEFENSE(QUAKE);
CHECK_DEFENSE(THROW);
#undef CHECK_DEFENSE
}
// If no element flags were set, fall back to normal defense.
if (minDefense == 255) {
defense = lookup_defense(defenseTable, ELEMENT_NORMAL);
if (defense < 255) {
minDefense = defense;
}
}
if (elementFlags & DAMAGE_TYPE_IGNORE_DEFENSE) {
if (minDefense == 99) {
// Immune
minDefense = 999;
} else if (minDefense > 0) {
minDefense = 0;
}
}
return minDefense;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel b_area_tik3_SpawnDrainHealthContinueFX
/* 52B8F0 80218250 27BDFD80 */ addiu $sp, $sp, -0x280
glabel b_area_jan_jungle_fuzzy_SpawnDrainHealthContinueFX
/* 52B8F4 80218254 27A30018 */ addiu $v1, $sp, 0x18
glabel func_80218258
/* 52B8F8 80218258 3C028023 */ lui $v0, %hi(D_8022FC30)
glabel b_area_isk_part_2_chain_chomp_ChompChainUpdate
/* 52B8FC 8021825C 2442FC30 */ addiu $v0, $v0, %lo(D_8022FC30)
.L80218260:
/* 52B900 80218260 24440250 */ addiu $a0, $v0, 0x250
D_80218264:
/* 52B904 80218264 AFBF0278 */ sw $ra, 0x278($sp)
/* 52B908 80218268 AFB10274 */ sw $s1, 0x274($sp)
/* 52B90C 8021826C AFB00270 */ sw $s0, 0x270($sp)
glabel func_80218270
/* 52B910 80218270 8C480000 */ lw $t0, 0x0($v0)
/* 52B914 80218274 8C490004 */ lw $t1, 0x4($v0)
glabel func_80218278
/* 52B918 80218278 8C4A0008 */ lw $t2, 0x8($v0)
/* 52B91C 8021827C 8C4B000C */ lw $t3, 0xC($v0)
glabel func_80218280_6609D0
/* 52B920 80218280 AC680000 */ sw $t0, 0x0($v1)
.L80218284:
/* 52B924 80218284 AC690004 */ sw $t1, 0x4($v1)
/* 52B928 80218288 AC6A0008 */ sw $t2, 0x8($v1)
b_area_trd_part_3_eldstar_DefenseTable_8021828C:
/* 52B92C 8021828C AC6B000C */ sw $t3, 0xC($v1)
.L80218290:
/* 52B930 80218290 24420010 */ addiu $v0, $v0, 0x10
.L80218294:
/* 52B934 80218294 1444FFF6 */ bne $v0, $a0, func_80218270
b_area_trd_part_3_eldstar_StatusTable_80218298:
/* 52B938 80218298 24630010 */ addiu $v1, $v1, 0x10
/* 52B93C 8021829C 8C480000 */ lw $t0, 0x0($v0)
.L802182A0:
/* 52B940 802182A0 8C490004 */ lw $t1, 0x4($v0)
glabel func_802182A4_5CE934
/* 52B944 802182A4 AC680000 */ sw $t0, 0x0($v1)
glabel b_area_kpa4_CosInterpMinMax
/* 52B948 802182A8 AC690004 */ sw $t1, 0x4($v1)
.L802182AC:
/* 52B94C 802182AC 0000882D */ daddu $s1, $zero, $zero
.L802182B0:
/* 52B950 802182B0 27B00018 */ addiu $s0, $sp, 0x18
.L802182B4:
/* 52B954 802182B4 C6000010 */ lwc1 $f0, 0x10($s0)
b_area_iwa_Formation_03:
/* 52B958 802182B8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 52B95C 802182BC 8E020014 */ lw $v0, 0x14($s0)
.L802182C0:
/* 52B960 802182C0 AFA20014 */ sw $v0, 0x14($sp)
/* 52B964 802182C4 8E040000 */ lw $a0, 0x0($s0)
.L802182C8:
/* 52B968 802182C8 8E050004 */ lw $a1, 0x4($s0)
/* 52B96C 802182CC 8E060008 */ lw $a2, 0x8($s0)
.L802182D0:
/* 52B970 802182D0 8E07000C */ lw $a3, 0xC($s0)
glabel b_area_hos_magikoopa_SetAbsoluteStatusOffsets
/* 52B974 802182D4 0C01C994 */ jal fx_ice_shard
glabel func_802182D8
/* 52B978 802182D8 26310001 */ addiu $s1, $s1, 0x1
.L802182DC:
/* 52B97C 802182DC 8C43000C */ lw $v1, 0xC($v0)
glabel func_802182E0
/* 52B980 802182E0 C6000018 */ lwc1 $f0, 0x18($s0)
glabel func_802182E4_660A34
/* 52B984 802182E4 E460004C */ swc1 $f0, 0x4C($v1)
/* 52B988 802182E8 8C43000C */ lw $v1, 0xC($v0)
glabel b_area_tik2_FadeBackgroundToBlack
/* 52B98C 802182EC C600001C */ lwc1 $f0, 0x1C($s0)
b_area_iwa_Formation_04:
/* 52B990 802182F0 E4600050 */ swc1 $f0, 0x50($v1)
.L802182F4:
/* 52B994 802182F4 8C43000C */ lw $v1, 0xC($v0)
/* 52B998 802182F8 C6000020 */ lwc1 $f0, 0x20($s0)
.L802182FC:
/* 52B99C 802182FC E4600054 */ swc1 $f0, 0x54($v1)
glabel b_area_pra_ShrinkActor
/* 52B9A0 80218300 8C42000C */ lw $v0, 0xC($v0)
/* 52B9A4 80218304 C6000024 */ lwc1 $f0, 0x24($s0)
glabel func_80218308
/* 52B9A8 80218308 E4400058 */ swc1 $f0, 0x58($v0)
glabel func_8021830C
/* 52B9AC 8021830C 2A22000F */ slti $v0, $s1, 0xF
glabel dup2_b_area_dig_SetAbsoluteStatusOffsets
/* 52B9B0 80218310 1440FFE8 */ bnez $v0, .L802182B4
glabel b_area_sam2_monstar_Dist3D
/* 52B9B4 80218314 26100028 */ addiu $s0, $s0, 0x28
/* 52B9B8 80218318 8FBF0278 */ lw $ra, 0x278($sp)
.L8021831C:
/* 52B9BC 8021831C 8FB10274 */ lw $s1, 0x274($sp)
.L80218320:
/* 52B9C0 80218320 8FB00270 */ lw $s0, 0x270($sp)
.L80218324:
/* 52B9C4 80218324 24020002 */ addiu $v0, $zero, 0x2
.L80218328:
/* 52B9C8 80218328 03E00008 */ jr $ra
.L8021832C:
/* 52B9CC 8021832C 27BD0280 */ addiu $sp, $sp, 0x280
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(func_80218250_52B8F0) {
s32 i;
IceShardBlueprint bpArray[] = {
{
.unk_00 = 1,
.unk_04 = 117.0f,
.unk_08 = 102.0f,
.unk_0C = 0.0f,
.unk_10 = 0.2f,
.unk_14 = 20,
.unk_18 = 0.3f,
.unk_1C = 0.7f,
.unk_20 = 0.0f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 117.0f,
.unk_08 = 82.0f,
.unk_0C = 11.0f,
.unk_10 = 0.5f,
.unk_14 = 20,
.unk_18 = 0.3f,
.unk_1C = 0.9f,
.unk_20 = 0.1f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 117.0f,
.unk_08 = 92.0f,
.unk_0C = 14.0f,
.unk_10 = 0.4f,
.unk_14 = 20,
.unk_18 = 0.3f,
.unk_1C = 0.8f,
.unk_20 = 0.3f,
.unk_24 = -0.3f,
},
{
.unk_00 = 1,
.unk_04 = 125.0f,
.unk_08 = 82.0f,
.unk_0C = 0.0f,
.unk_10 = 0.2f,
.unk_14 = 20,
.unk_18 = 0.5f,
.unk_1C = 0.9f,
.unk_20 = 0.0f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 108.0f,
.unk_08 = 82.0f,
.unk_0C = 0.0f,
.unk_10 = 0.3f,
.unk_14 = 20,
.unk_18 = -0.2f,
.unk_1C = 0.9f,
.unk_20 = 0.0f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 105.0f,
.unk_08 = 92.0f,
.unk_0C = 0.0f,
.unk_10 = 0.4f,
.unk_14 = 20,
.unk_18 = -0.1f,
.unk_1C = 0.8f,
.unk_20 = 0.0f,
.unk_24 = -0.3f,
},
{
.unk_00 = 1,
.unk_04 = 127.0f,
.unk_08 = 92.0f,
.unk_0C = 0.0f,
.unk_10 = 0.2f,
.unk_14 = 20,
.unk_18 = 0.7f,
.unk_1C = 0.8f,
.unk_20 = 0.0f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 117.0f,
.unk_08 = 97.0f,
.unk_0C = 7.0f,
.unk_10 = 0.1f,
.unk_14 = 20,
.unk_18 = 0.7f,
.unk_1C = 0.8f,
.unk_20 = 0.2f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 117.0f,
.unk_08 = 87.0f,
.unk_0C = 7.0f,
.unk_10 = 0.3f,
.unk_14 = 20,
.unk_18 = 0.7f,
.unk_1C = 0.8f,
.unk_20 = 0.2f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 111.0f,
.unk_08 = 97.0f,
.unk_0C = 3.0f,
.unk_10 = 0.2f,
.unk_14 = 20,
.unk_18 = 0.0f,
.unk_1C = 1.0f,
.unk_20 = 0.1f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 111.0f,
.unk_08 = 92.0f,
.unk_0C = 7.0f,
.unk_10 = 0.1f,
.unk_14 = 20,
.unk_18 = 0.0f,
.unk_1C = 1.0f,
.unk_20 = 0.2f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 111.0f,
.unk_08 = 87.0f,
.unk_0C = 3.0f,
.unk_10 = 0.5f,
.unk_14 = 20,
.unk_18 = 0.0f,
.unk_1C = 1.0f,
.unk_20 = 0.1f,
.unk_24 = -0.3f,
},
{
.unk_00 = 1,
.unk_04 = 123.0f,
.unk_08 = 97.0f,
.unk_0C = 3.0f,
.unk_10 = 0.2f,
.unk_14 = 20,
.unk_18 = 0.1f,
.unk_1C = 1.0f,
.unk_20 = 0.1f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 123.0f,
.unk_08 = 92.0f,
.unk_0C = 7.0f,
.unk_10 = 0.4f,
.unk_14 = 20,
.unk_18 = 0.1f,
.unk_1C = 1.0f,
.unk_20 = 0.2f,
.unk_24 = -0.3f,
},
{
.unk_00 = 0,
.unk_04 = 123.0f,
.unk_08 = 87.0f,
.unk_0C = 3.0f,
.unk_10 = 0.3f,
.unk_14 = 20,
.unk_18 = 0.1f,
.unk_1C = 1.0f,
.unk_20 = 0.1f,
.unk_24 = -0.3f,
},
};
for (i = 0; i < ARRAY_COUNT(bpArray); i++) {
EffectInstance* effect = fx_ice_shard(bpArray[i].unk_00, bpArray[i].unk_04, bpArray[i].unk_08,
bpArray[i].unk_0C, bpArray[i].unk_10, bpArray[i].unk_14);
effect->data.iceShard->vel.x = bpArray[i].unk_18;
effect->data.iceShard->vel.y = bpArray[i].unk_1C;
effect->data.iceShard->vel.z = bpArray[i].unk_20;
effect->data.iceShard->gravAccel = bpArray[i].unk_24;
}
return ApiStatus_DONE2;
}
|