text
stringlengths 6.38k
228k
|
---|
### RAW ASSEMBLY INSTRUCTIONS:
glabel D_8024CB68_C0A3E8
/* 17B448 8024CB68 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 17B44C 8024CB6C AFB00030 */ sw $s0, 0x30($sp)
D_8024CB70:
/* 17B450 8024CB70 3C10800B */ lui $s0, %hi(gCameras + 0x558)
/* 17B454 8024CB74 261022D8 */ addiu $s0, $s0, %lo(gCameras + 0x558)
/* 17B458 8024CB78 3C02802A */ lui $v0, %hi(BattleCam_TargetActor)
/* 17B45C 8024CB7C 9442F27C */ lhu $v0, %lo(BattleCam_TargetActor)($v0)
/* 17B460 8024CB80 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 17B464 8024CB84 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 17B468 8024CB88 AFBF0034 */ sw $ra, 0x34($sp)
/* 17B46C 8024CB8C F7B80048 */ sdc1 $f24, 0x48($sp)
/* 17B470 8024CB90 F7B60040 */ sdc1 $f22, 0x40($sp)
/* 17B474 8024CB94 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 17B478 8024CB98 30430700 */ andi $v1, $v0, 0x700
/* 17B47C 8024CB9C 304600FF */ andi $a2, $v0, 0xFF
/* 17B480 8024CBA0 24020100 */ addiu $v0, $zero, 0x100
/* 17B484 8024CBA4 10620018 */ beq $v1, $v0, .L8024CC08
/* 17B488 8024CBA8 28620101 */ slti $v0, $v1, 0x101
/* 17B48C 8024CBAC 10400019 */ beqz $v0, .L8024CC14
/* 17B490 8024CBB0 00061080 */ sll $v0, $a2, 2
/* 17B494 8024CBB4 14600018 */ bnez $v1, .L8024CC18
/* 17B498 8024CBB8 00821021 */ addu $v0, $a0, $v0
/* 17B49C 8024CBBC 8C8400D8 */ lw $a0, 0xD8($a0)
/* 17B4A0 8024CBC0 108000AF */ beqz $a0, .L8024CE80
/* 17B4A4 8024CBC4 0000102D */ daddu $v0, $zero, $zero
/* 17B4A8 8024CBC8 3C028011 */ lui $v0, %hi(gPlayerStatus)
/* 17B4AC 8024CBCC 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus)
/* 17B4B0 8024CBD0 C4940144 */ lwc1 $f20, 0x144($a0)
/* 17B4B4 8024CBD4 944200B0 */ lhu $v0, 0xB0($v0)
/* 17B4B8 8024CBD8 C498014C */ lwc1 $f24, 0x14C($a0)
/* 17B4BC 8024CBDC C4820148 */ lwc1 $f2, 0x148($a0)
/* 17B4C0 8024CBE0 00021400 */ sll $v0, $v0, 16
/* 17B4C4 8024CBE4 00021C03 */ sra $v1, $v0, 16
/* 17B4C8 8024CBE8 000217C2 */ srl $v0, $v0, 31
/* 17B4CC 8024CBEC 00621821 */ addu $v1, $v1, $v0
/* 17B4D0 8024CBF0 00031843 */ sra $v1, $v1, 1
/* 17B4D4 8024CBF4 44830000 */ mtc1 $v1, $f0
/* 17B4D8 8024CBF8 00000000 */ nop
/* 17B4DC 8024CBFC 46800020 */ cvt.s.w $f0, $f0
/* 17B4E0 8024CC00 0809330C */ j .L8024CC30
/* 17B4E4 8024CC04 46001580 */ add.s $f22, $f2, $f0
.L8024CC08:
/* 17B4E8 8024CC08 8C8200DC */ lw $v0, 0xDC($a0)
/* 17B4EC 8024CC0C 08093307 */ j .L8024CC1C
/* 17B4F0 8024CC10 00000000 */ nop
.L8024CC14:
/* 17B4F4 8024CC14 00821021 */ addu $v0, $a0, $v0
.L8024CC18:
/* 17B4F8 8024CC18 8C4200E0 */ lw $v0, 0xE0($v0)
.L8024CC1C:
/* 17B4FC 8024CC1C 50400098 */ beql $v0, $zero, .L8024CE80
/* 17B500 8024CC20 0000102D */ daddu $v0, $zero, $zero
/* 17B504 8024CC24 C4540144 */ lwc1 $f20, 0x144($v0)
D_8024CC28_C0A4A8:
/* 17B508 8024CC28 C4560148 */ lwc1 $f22, 0x148($v0)
/* 17B50C 8024CC2C C458014C */ lwc1 $f24, 0x14C($v0)
.L8024CC30:
/* 17B510 8024CC30 10A0001D */ beqz $a1, .L8024CCA8
D_8024CC34:
/* 17B514 8024CC34 27A20020 */ addiu $v0, $sp, 0x20
/* 17B518 8024CC38 C6000054 */ lwc1 $f0, 0x54($s0)
/* 17B51C 8024CC3C C6020058 */ lwc1 $f2, 0x58($s0)
/* 17B520 8024CC40 C604005C */ lwc1 $f4, 0x5C($s0)
/* 17B524 8024CC44 8602001E */ lh $v0, 0x1E($s0)
/* 17B528 8024CC48 86030022 */ lh $v1, 0x22($s0)
/* 17B52C 8024CC4C 3C01802A */ lui $at, %hi(BattleCam_PosX)
/* 17B530 8024CC50 E420F270 */ swc1 $f0, %lo(BattleCam_PosX)($at)
/* 17B534 8024CC54 44820000 */ mtc1 $v0, $f0
/* 17B538 8024CC58 00000000 */ nop
/* 17B53C 8024CC5C 46800020 */ cvt.s.w $f0, $f0
D_8024CC60:
/* 17B540 8024CC60 86020024 */ lh $v0, 0x24($s0)
/* 17B544 8024CC64 3C01802A */ lui $at, %hi(BattleCam_PosY)
/* 17B548 8024CC68 E422F274 */ swc1 $f2, %lo(BattleCam_PosY)($at)
/* 17B54C 8024CC6C 3C01802A */ lui $at, %hi(BattleCam_PosZ)
/* 17B550 8024CC70 E424F278 */ swc1 $f4, %lo(BattleCam_PosZ)($at)
/* 17B554 8024CC74 3C01802A */ lui $at, %hi(D_8029F288)
/* 17B558 8024CC78 E420F288 */ swc1 $f0, %lo(D_8029F288)($at)
/* 17B55C 8024CC7C 44820000 */ mtc1 $v0, $f0
/* 17B560 8024CC80 00000000 */ nop
/* 17B564 8024CC84 46800020 */ cvt.s.w $f0, $f0
/* 17B568 8024CC88 3C01802A */ lui $at, %hi(BattleCam_InitialBoomYaw)
/* 17B56C 8024CC8C E420F290 */ swc1 $f0, %lo(BattleCam_InitialBoomYaw)($at)
/* 17B570 8024CC90 44830000 */ mtc1 $v1, $f0
/* 17B574 8024CC94 00000000 */ nop
/* 17B578 8024CC98 46800020 */ cvt.s.w $f0, $f0
/* 17B57C 8024CC9C 3C01802A */ lui $at, %hi(BattleCam_InitialBoomPitch)
D_8024CCA0_C0A520:
/* 17B580 8024CCA0 E420F294 */ swc1 $f0, %lo(BattleCam_InitialBoomPitch)($at)
/* 17B584 8024CCA4 27A20020 */ addiu $v0, $sp, 0x20
.L8024CCA8:
/* 17B588 8024CCA8 AFA20010 */ sw $v0, 0x10($sp)
/* 17B58C 8024CCAC 27A20024 */ addiu $v0, $sp, 0x24
/* 17B590 8024CCB0 AFA20014 */ sw $v0, 0x14($sp)
/* 17B594 8024CCB4 27A20028 */ addiu $v0, $sp, 0x28
/* 17B598 8024CCB8 4405A000 */ mfc1 $a1, $f20
/* 17B59C 8024CCBC 4406B000 */ mfc1 $a2, $f22
/* 17B5A0 8024CCC0 4407C000 */ mfc1 $a3, $f24
D_8024CCC4:
/* 17B5A4 8024CCC4 24040001 */ addiu $a0, $zero, 0x1
/* 17B5A8 8024CCC8 0C00B94E */ jal get_screen_coords
/* 17B5AC 8024CCCC AFA20018 */ sw $v0, 0x18($sp)
/* 17B5B0 8024CCD0 8FA20024 */ lw $v0, 0x24($sp)
/* 17B5B4 8024CCD4 28420064 */ slti $v0, $v0, 0x64
D_8024CCD8:
/* 17B5B8 8024CCD8 10400005 */ beqz $v0, .L8024CCF0
/* 17B5BC 8024CCDC 00000000 */ nop
/* 17B5C0 8024CCE0 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 17B5C4 8024CCE4 44810000 */ mtc1 $at, $f0
/* 17B5C8 8024CCE8 00000000 */ nop
/* 17B5CC 8024CCEC 4600B580 */ add.s $f22, $f22, $f0
.L8024CCF0:
/* 17B5D0 8024CCF0 3C01802A */ lui $at, %hi(BattleCam_PosY)
/* 17B5D4 8024CCF4 C420F274 */ lwc1 $f0, %lo(BattleCam_PosY)($at)
/* 17B5D8 8024CCF8 4600B03C */ c.lt.s $f22, $f0
/* 17B5DC 8024CCFC 00000000 */ nop
/* 17B5E0 8024CD00 45030001 */ bc1tl .L8024CD08
/* 17B5E4 8024CD04 46000586 */ mov.s $f22, $f0
.L8024CD08:
/* 17B5E8 8024CD08 8FA30020 */ lw $v1, 0x20($sp)
/* 17B5EC 8024CD0C 28620064 */ slti $v0, $v1, 0x64
D_8024CD10_C0A590:
/* 17B5F0 8024CD10 10400005 */ beqz $v0, .L8024CD28
/* 17B5F4 8024CD14 00000000 */ nop
/* 17B5F8 8024CD18 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 17B5FC 8024CD1C 44810000 */ mtc1 $at, $f0
/* 17B600 8024CD20 00000000 */ nop
/* 17B604 8024CD24 4600A501 */ sub.s $f20, $f20, $f0
.L8024CD28:
/* 17B608 8024CD28 3C01802A */ lui $at, %hi(BattleCam_PosX)
/* 17B60C 8024CD2C C420F270 */ lwc1 $f0, %lo(BattleCam_PosX)($at)
/* 17B610 8024CD30 4600A03C */ c.lt.s $f20, $f0
/* 17B614 8024CD34 00000000 */ nop
/* 17B618 8024CD38 45030001 */ bc1tl .L8024CD40
/* 17B61C 8024CD3C 46000506 */ mov.s $f20, $f0
.L8024CD40:
/* 17B620 8024CD40 286200DD */ slti $v0, $v1, 0xDD
/* 17B624 8024CD44 14400005 */ bnez $v0, .L8024CD5C
/* 17B628 8024CD48 00000000 */ nop
/* 17B62C 8024CD4C 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 17B630 8024CD50 44810000 */ mtc1 $at, $f0
/* 17B634 8024CD54 00000000 */ nop
/* 17B638 8024CD58 4600A500 */ add.s $f20, $f20, $f0
.L8024CD5C:
/* 17B63C 8024CD5C C6060054 */ lwc1 $f6, 0x54($s0)
/* 17B640 8024CD60 4606A101 */ sub.s $f4, $f20, $f6
/* 17B644 8024CD64 3C01802A */ lui $at, %hi(D_8029CC30)
/* 17B648 8024CD68 D422CC30 */ ldc1 $f2, %lo(D_8029CC30)($at)
/* 17B64C 8024CD6C 46002005 */ abs.s $f0, $f4
/* 17B650 8024CD70 46000021 */ cvt.d.s $f0, $f0
/* 17B654 8024CD74 4622003C */ c.lt.d $f0, $f2
/* 17B658 8024CD78 00000000 */ nop
/* 17B65C 8024CD7C 45000009 */ bc1f .L8024CDA4
/* 17B660 8024CD80 00000000 */ nop
/* 17B664 8024CD84 44800000 */ mtc1 $zero, $f0
/* 17B668 8024CD88 00000000 */ nop
/* 17B66C 8024CD8C 46002032 */ c.eq.s $f4, $f0
.L8024CD90:
/* 17B670 8024CD90 00000000 */ nop
/* 17B674 8024CD94 45020009 */ bc1fl .L8024CDBC
D_8024CD98_C0A618:
/* 17B678 8024CD98 E6140054 */ swc1 $f20, 0x54($s0)
/* 17B67C 8024CD9C 0809336F */ j .L8024CDBC
D_8024CDA0:
/* 17B680 8024CDA0 00000000 */ nop
.L8024CDA4:
/* 17B684 8024CDA4 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 17B688 8024CDA8 44810000 */ mtc1 $at, $f0
D_8024CDAC:
/* 17B68C 8024CDAC 00000000 */ nop
/* 17B690 8024CDB0 46002003 */ div.s $f0, $f4, $f0
/* 17B694 8024CDB4 46003000 */ add.s $f0, $f6, $f0
/* 17B698 8024CDB8 E6000054 */ swc1 $f0, 0x54($s0)
.L8024CDBC:
/* 17B69C 8024CDBC C6060058 */ lwc1 $f6, 0x58($s0)
/* 17B6A0 8024CDC0 4606B101 */ sub.s $f4, $f22, $f6
/* 17B6A4 8024CDC4 3C01802A */ lui $at, %hi(D_8029CC38)
/* 17B6A8 8024CDC8 D422CC38 */ ldc1 $f2, %lo(D_8029CC38)($at)
/* 17B6AC 8024CDCC 46002005 */ abs.s $f0, $f4
/* 17B6B0 8024CDD0 46000021 */ cvt.d.s $f0, $f0
/* 17B6B4 8024CDD4 4622003C */ c.lt.d $f0, $f2
/* 17B6B8 8024CDD8 00000000 */ nop
/* 17B6BC 8024CDDC 45000009 */ bc1f .L8024CE04
/* 17B6C0 8024CDE0 00000000 */ nop
/* 17B6C4 8024CDE4 44800000 */ mtc1 $zero, $f0
/* 17B6C8 8024CDE8 00000000 */ nop
/* 17B6CC 8024CDEC 46002032 */ c.eq.s $f4, $f0
/* 17B6D0 8024CDF0 00000000 */ nop
/* 17B6D4 8024CDF4 45020009 */ bc1fl .L8024CE1C
/* 17B6D8 8024CDF8 E6160058 */ swc1 $f22, 0x58($s0)
.L8024CDFC:
/* 17B6DC 8024CDFC 08093387 */ j .L8024CE1C
/* 17B6E0 8024CE00 00000000 */ nop
.L8024CE04:
/* 17B6E4 8024CE04 3C0140A0 */ lui $at, (0x40A00000 >> 16)
D_8024CE08_C0A688:
/* 17B6E8 8024CE08 44810000 */ mtc1 $at, $f0
/* 17B6EC 8024CE0C 00000000 */ nop
/* 17B6F0 8024CE10 46002003 */ div.s $f0, $f4, $f0
/* 17B6F4 8024CE14 46003000 */ add.s $f0, $f6, $f0
/* 17B6F8 8024CE18 E6000058 */ swc1 $f0, 0x58($s0)
.L8024CE1C:
/* 17B6FC 8024CE1C C606005C */ lwc1 $f6, 0x5C($s0)
/* 17B700 8024CE20 4606C101 */ sub.s $f4, $f24, $f6
/* 17B704 8024CE24 3C01802A */ lui $at, %hi(D_8029CC40)
/* 17B708 8024CE28 D422CC40 */ ldc1 $f2, %lo(D_8029CC40)($at)
/* 17B70C 8024CE2C 46002005 */ abs.s $f0, $f4
/* 17B710 8024CE30 46000021 */ cvt.d.s $f0, $f0
/* 17B714 8024CE34 4622003C */ c.lt.d $f0, $f2
/* 17B718 8024CE38 00000000 */ nop
/* 17B71C 8024CE3C 45000009 */ bc1f .L8024CE64
/* 17B720 8024CE40 00000000 */ nop
/* 17B724 8024CE44 44800000 */ mtc1 $zero, $f0
/* 17B728 8024CE48 00000000 */ nop
/* 17B72C 8024CE4C 46002032 */ c.eq.s $f4, $f0
/* 17B730 8024CE50 00000000 */ nop
/* 17B734 8024CE54 45020009 */ bc1fl .L8024CE7C
/* 17B738 8024CE58 E618005C */ swc1 $f24, 0x5C($s0)
/* 17B73C 8024CE5C 080933A0 */ j .L8024CE80
/* 17B740 8024CE60 0000102D */ daddu $v0, $zero, $zero
.L8024CE64:
/* 17B744 8024CE64 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 17B748 8024CE68 44810000 */ mtc1 $at, $f0
/* 17B74C 8024CE6C 00000000 */ nop
/* 17B750 8024CE70 46002003 */ div.s $f0, $f4, $f0
/* 17B754 8024CE74 46003000 */ add.s $f0, $f6, $f0
/* 17B758 8024CE78 E600005C */ swc1 $f0, 0x5C($s0)
.L8024CE7C:
/* 17B75C 8024CE7C 0000102D */ daddu $v0, $zero, $zero
.L8024CE80:
/* 17B760 8024CE80 8FBF0034 */ lw $ra, 0x34($sp)
/* 17B764 8024CE84 8FB00030 */ lw $s0, 0x30($sp)
/* 17B768 8024CE88 D7B80048 */ ldc1 $f24, 0x48($sp)
/* 17B76C 8024CE8C D7B60040 */ ldc1 $f22, 0x40($sp)
/* 17B770 8024CE90 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 17B774 8024CE94 03E00008 */ jr $ra
/* 17B778 8024CE98 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
ApiStatus CamPresetUpdate_L(Evt* script, s32 isInitialCall) {
Camera* camera = &gCameras[CAM_BATTLE];
BattleStatus* battleStatus = &gBattleStatus;
PlayerStatus* playerStatus = &gPlayerStatus;
s32 actorClass = BattleCam_TargetActor & ACTOR_CLASS_MASK;
s32 actorID = BattleCam_TargetActor & 0xFF;
f32 x, y, z;
s32 screenX, screenY, screenZ;
f32 delta;
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
if (battleStatus->playerActor == NULL) {
return ApiStatus_BLOCK;
}
x = battleStatus->playerActor->currentPos.x;
y = battleStatus->playerActor->currentPos.y + (playerStatus->colliderHeight / 2);
z = battleStatus->playerActor->currentPos.z;
break;
case ACTOR_CLASS_PARTNER:
if (battleStatus->partnerActor == NULL) {
return ApiStatus_BLOCK;
}
x = battleStatus->partnerActor->currentPos.x;
y = battleStatus->partnerActor->currentPos.y;
z = battleStatus->partnerActor->currentPos.z;
break;
case ACTOR_CLASS_ENEMY:
default:
if (battleStatus->enemyActors[actorID] == NULL) {
return ApiStatus_BLOCK;
}
x = battleStatus->enemyActors[actorID]->currentPos.x;
y = battleStatus->enemyActors[actorID]->currentPos.y;
z = battleStatus->enemyActors[actorID]->currentPos.z;
break;
}
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;
}
get_screen_coords(1, x, y, z, &screenX, &screenY, &screenZ);
if (screenY < 100) {
y += 25.0f;
}
if (y < BattleCam_PosY) {
y = BattleCam_PosY;
}
if (screenX < 100) {
x -= 25.0f;
}
if (x < BattleCam_PosX) {
x = BattleCam_PosX;
}
if (screenX > 220) {
x += 25.0f;
}
delta = x - camera->lookAt_obj_target.x;
if (fabsf(delta) < 0.01) {
if (delta != 0.0f) {
camera->lookAt_obj_target.x = x;
}
} else {
camera->lookAt_obj_target.x += delta / 5.0f;
}
delta = y - camera->lookAt_obj_target.y;
if (fabsf(delta) < 0.01) {
if (delta != 0.0f) {
camera->lookAt_obj_target.y = y;
}
} else {
camera->lookAt_obj_target.y += delta / 5.0f;
}
delta = z - camera->lookAt_obj_target.z;
if (fabsf(delta) < 0.01) {
if (delta != 0.0f) {
camera->lookAt_obj_target.z = z;
}
} else {
camera->lookAt_obj_target.z += delta / 5.0f;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel appendGfx_pulse_stone_icon
/* E21A44 802B71D4 3C028011 */ lui $v0, %hi(gPlayerStatus + 0x4)
/* E21A48 802B71D8 8C42EFCC */ lw $v0, %lo(gPlayerStatus + 0x4)($v0)
/* E21A4C 802B71DC 27BDFF38 */ addiu $sp, $sp, -0xC8
/* E21A50 802B71E0 AFBF00C0 */ sw $ra, 0xC0($sp)
/* E21A54 802B71E4 AFB300BC */ sw $s3, 0xBC($sp)
glabel appendGfx_interact_prompt
/* E21A58 802B71E8 AFB200B8 */ sw $s2, 0xB8($sp)
/* E21A5C 802B71EC AFB100B4 */ sw $s1, 0xB4($sp)
/* E21A60 802B71F0 30420040 */ andi $v0, $v0, 0x40
/* E21A64 802B71F4 104000B7 */ beqz $v0, .L802B74D4
/* E21A68 802B71F8 AFB000B0 */ sw $s0, 0xB0($sp)
/* E21A6C 802B71FC 3C13802B */ lui $s3, %hi(PulseStonePtr)
/* E21A70 802B7200 26737D18 */ addiu $s3, $s3, %lo(PulseStonePtr)
/* E21A74 802B7204 8E620000 */ lw $v0, 0x0($s3)
.L802B7208:
/* E21A78 802B7208 27A40018 */ addiu $a0, $sp, 0x18
/* E21A7C 802B720C 8C45000C */ lw $a1, 0xC($v0)
/* E21A80 802B7210 3C120001 */ lui $s2, (0x11630 >> 16)
/* E21A84 802B7214 00A0302D */ daddu $a2, $a1, $zero
/* E21A88 802B7218 0C019DF0 */ jal guScaleF
/* E21A8C 802B721C 00A0382D */ daddu $a3, $a1, $zero
/* E21A90 802B7220 27B00058 */ addiu $s0, $sp, 0x58
/* E21A94 802B7224 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* E21A98 802B7228 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* E21A9C 802B722C 44800000 */ mtc1 $zero, $f0
/* E21AA0 802B7230 00031080 */ sll $v0, $v1, 2
/* E21AA4 802B7234 00431021 */ addu $v0, $v0, $v1
/* E21AA8 802B7238 00021080 */ sll $v0, $v0, 2
/* E21AAC 802B723C 00431023 */ subu $v0, $v0, $v1
/* E21AB0 802B7240 000218C0 */ sll $v1, $v0, 3
/* E21AB4 802B7244 00431021 */ addu $v0, $v0, $v1
/* E21AB8 802B7248 000210C0 */ sll $v0, $v0, 3
/* E21ABC 802B724C 44060000 */ mfc1 $a2, $f0
/* E21AC0 802B7250 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* E21AC4 802B7254 00220821 */ addu $at, $at, $v0
/* E21AC8 802B7258 C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* E21ACC 802B725C 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* E21AD0 802B7260 46000007 */ neg.s $f0, $f0
/* E21AD4 802B7264 44050000 */ mfc1 $a1, $f0
/* E21AD8 802B7268 0200202D */ daddu $a0, $s0, $zero
/* E21ADC 802B726C 0C019EC8 */ jal guRotateF
/* E21AE0 802B7270 AFA60010 */ sw $a2, 0x10($sp)
/* E21AE4 802B7274 27A40018 */ addiu $a0, $sp, 0x18
/* E21AE8 802B7278 0200282D */ daddu $a1, $s0, $zero
/* E21AEC 802B727C 0C019D80 */ jal guMtxCatF
/* E21AF0 802B7280 0080302D */ daddu $a2, $a0, $zero
/* E21AF4 802B7284 8E620000 */ lw $v0, 0x0($s3)
/* E21AF8 802B7288 36521630 */ ori $s2, $s2, (0x11630 & 0xFFFF)
/* E21AFC 802B728C 8C450000 */ lw $a1, 0x0($v0)
/* E21B00 802B7290 8C460004 */ lw $a2, 0x4($v0)
/* E21B04 802B7294 8C470008 */ lw $a3, 0x8($v0)
/* E21B08 802B7298 0C019E40 */ jal guTranslateF
/* E21B0C 802B729C 0200202D */ daddu $a0, $s0, $zero
/* E21B10 802B72A0 27A40018 */ addiu $a0, $sp, 0x18
.L802B72A4:
/* E21B14 802B72A4 0200282D */ daddu $a1, $s0, $zero
/* E21B18 802B72A8 0C019D80 */ jal guMtxCatF
/* E21B1C 802B72AC 0200302D */ daddu $a2, $s0, $zero
/* E21B20 802B72B0 0200202D */ daddu $a0, $s0, $zero
/* E21B24 802B72B4 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* E21B28 802B72B8 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* E21B2C 802B72BC 3C11800A */ lui $s1, %hi(gDisplayContext)
glabel ispy_notification_setup
/* E21B30 802B72C0 2631A674 */ addiu $s1, $s1, %lo(gDisplayContext)
/* E21B34 802B72C4 96050000 */ lhu $a1, 0x0($s0)
/* E21B38 802B72C8 8E220000 */ lw $v0, 0x0($s1)
/* E21B3C 802B72CC 00052980 */ sll $a1, $a1, 6
/* E21B40 802B72D0 00B22821 */ addu $a1, $a1, $s2
/* E21B44 802B72D4 0C019D40 */ jal guMtxF2L
/* E21B48 802B72D8 00452821 */ addu $a1, $v0, $a1
/* E21B4C 802B72DC 3C02DA38 */ lui $v0, (0xDA380002 >> 16)
/* E21B50 802B72E0 34420002 */ ori $v0, $v0, (0xDA380002 & 0xFFFF)
/* E21B54 802B72E4 3C07800A */ lui $a3, %hi(gMainGfxPos)
/* E21B58 802B72E8 24E7A66C */ addiu $a3, $a3, %lo(gMainGfxPos)
/* E21B5C 802B72EC 3C089249 */ lui $t0, (0x92492493 >> 16)
/* E21B60 802B72F0 35082493 */ ori $t0, $t0, (0x92492493 & 0xFFFF)
/* E21B64 802B72F4 8CE50000 */ lw $a1, 0x0($a3)
/* E21B68 802B72F8 96060000 */ lhu $a2, 0x0($s0)
/* E21B6C 802B72FC 00A0202D */ daddu $a0, $a1, $zero
/* E21B70 802B7300 24A50008 */ addiu $a1, $a1, 0x8
/* E21B74 802B7304 AC820000 */ sw $v0, 0x0($a0)
/* E21B78 802B7308 30C2FFFF */ andi $v0, $a2, 0xFFFF
/* E21B7C 802B730C 00021180 */ sll $v0, $v0, 6
/* E21B80 802B7310 8E230000 */ lw $v1, 0x0($s1)
/* E21B84 802B7314 00521021 */ addu $v0, $v0, $s2
/* E21B88 802B7318 00621821 */ addu $v1, $v1, $v0
/* E21B8C 802B731C AC830004 */ sw $v1, 0x4($a0)
/* E21B90 802B7320 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* E21B94 802B7324 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* E21B98 802B7328 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* E21B9C 802B732C ACA20000 */ sw $v0, 0x0($a1)
/* E21BA0 802B7330 3C02802B */ lui $v0, %hi(pulse_stone_icon_gfx)
/* E21BA4 802B7334 24427CA0 */ addiu $v0, $v0, %lo(pulse_stone_icon_gfx)
/* E21BA8 802B7338 ACA20004 */ sw $v0, 0x4($a1)
/* E21BAC 802B733C 9462008C */ lhu $v0, 0x8C($v1)
/* E21BB0 802B7340 24C60001 */ addiu $a2, $a2, 0x1
/* E21BB4 802B7344 ACE50000 */ sw $a1, 0x0($a3)
/* E21BB8 802B7348 00021400 */ sll $v0, $v0, 16
/* E21BBC 802B734C 00022403 */ sra $a0, $v0, 16
/* E21BC0 802B7350 00880018 */ mult $a0, $t0
/* E21BC4 802B7354 24A50008 */ addiu $a1, $a1, 0x8
/* E21BC8 802B7358 A6060000 */ sh $a2, 0x0($s0)
glabel ispy_notification_update
/* E21BCC 802B735C 000217C3 */ sra $v0, $v0, 31
/* E21BD0 802B7360 00004810 */ mfhi $t1
/* E21BD4 802B7364 01241821 */ addu $v1, $t1, $a0
/* E21BD8 802B7368 00031883 */ sra $v1, $v1, 2
/* E21BDC 802B736C 00621823 */ subu $v1, $v1, $v0
/* E21BE0 802B7370 000310C0 */ sll $v0, $v1, 3
/* E21BE4 802B7374 00431023 */ subu $v0, $v0, $v1
/* E21BE8 802B7378 00822023 */ subu $a0, $a0, $v0
/* E21BEC 802B737C 00042400 */ sll $a0, $a0, 16
/* E21BF0 802B7380 00042403 */ sra $a0, $a0, 16
/* E21BF4 802B7384 2484FFFE */ addiu $a0, $a0, -0x2
/* E21BF8 802B7388 04820001 */ bltzl $a0, .L802B7390
/* E21BFC 802B738C 00042023 */ negu $a0, $a0
.L802B7390:
/* E21C00 802B7390 00031C00 */ sll $v1, $v1, 16
/* E21C04 802B7394 00031C03 */ sra $v1, $v1, 16
/* E21C08 802B7398 00832021 */ addu $a0, $a0, $v1
/* E21C0C 802B739C 2C820006 */ sltiu $v0, $a0, 0x6
/* E21C10 802B73A0 10400013 */ beqz $v0, .L802B73F0
/* E21C14 802B73A4 ACE50000 */ sw $a1, 0x0($a3)
/* E21C18 802B73A8 00041080 */ sll $v0, $a0, 2
/* E21C1C 802B73AC 3C01802B */ lui $at, %hi(jtbl_802B7D20)
/* E21C20 802B73B0 00220821 */ addu $at, $at, $v0
/* E21C24 802B73B4 8C227D20 */ lw $v0, %lo(jtbl_802B7D20)($at)
/* E21C28 802B73B8 00400008 */ jr $v0
/* E21C2C 802B73BC 00000000 */ nop
glabel .L802B73C0
/* E21C30 802B73C0 080ADCFF */ j .L802B73FC
/* E21C34 802B73C4 24030004 */ addiu $v1, $zero, 0x4
glabel .L802B73C8
/* E21C38 802B73C8 080ADCFF */ j .L802B73FC
/* E21C3C 802B73CC 24030008 */ addiu $v1, $zero, 0x8
glabel .L802B73D0
/* E21C40 802B73D0 080ADCFF */ j .L802B73FC
/* E21C44 802B73D4 24030010 */ addiu $v1, $zero, 0x10
glabel .L802B73D8
/* E21C48 802B73D8 080ADCFF */ j .L802B73FC
/* E21C4C 802B73DC 24030020 */ addiu $v1, $zero, 0x20
glabel .L802B73E0
/* E21C50 802B73E0 080ADCFF */ j .L802B73FC
/* E21C54 802B73E4 24030040 */ addiu $v1, $zero, 0x40
glabel .L802B73E8
/* E21C58 802B73E8 080ADCFF */ j .L802B73FC
/* E21C5C 802B73EC 24030080 */ addiu $v1, $zero, 0x80
.L802B73F0:
/* E21C60 802B73F0 8E620000 */ lw $v0, 0x0($s3)
/* E21C64 802B73F4 2403FFFF */ addiu $v1, $zero, -0x1
.L802B73F8:
/* E21C68 802B73F8 AC400020 */ sw $zero, 0x20($v0)
.L802B73FC:
/* E21C6C 802B73FC 3C11802B */ lui $s1, %hi(D_802B7C60)
/* E21C70 802B7400 26317C60 */ addiu $s1, $s1, %lo(D_802B7C60)
/* E21C74 802B7404 04600017 */ bltz $v1, .L802B7464
.L802B7408:
/* E21C78 802B7408 AFB1009C */ sw $s1, 0x9C($sp)
/* E21C7C 802B740C 3C10802B */ lui $s0, %hi(PulseStonePtr)
.L802B7410:
/* E21C80 802B7410 26107D18 */ addiu $s0, $s0, %lo(PulseStonePtr)
/* E21C84 802B7414 8E040000 */ lw $a0, 0x0($s0)
/* E21C88 802B7418 8C820020 */ lw $v0, 0x20($a0)
/* E21C8C 802B741C 24630002 */ addiu $v1, $v1, 0x2
/* E21C90 802B7420 24420001 */ addiu $v0, $v0, 0x1
/* E21C94 802B7424 AC820020 */ sw $v0, 0x20($a0)
/* E21C98 802B7428 0043102A */ slt $v0, $v0, $v1
glabel interact_speech_update
/* E21C9C 802B742C 14400005 */ bnez $v0, .L802B7444
/* E21CA0 802B7430 00000000 */ nop
/* E21CA4 802B7434 AC800020 */ sw $zero, 0x20($a0)
.L802B7438:
/* E21CA8 802B7438 2404007D */ addiu $a0, $zero, 0x7D
/* E21CAC 802B743C 0C052736 */ jal sfx_play_sound_at_player
.L802B7440:
/* E21CB0 802B7440 0000282D */ daddu $a1, $zero, $zero
.L802B7444:
/* E21CB4 802B7444 8E020000 */ lw $v0, 0x0($s0)
/* E21CB8 802B7448 8C420020 */ lw $v0, 0x20($v0)
/* E21CBC 802B744C 28420002 */ slti $v0, $v0, 0x2
glabel should_continue_inspect
/* E21CC0 802B7450 50400004 */ beql $v0, $zero, .L802B7464
/* E21CC4 802B7454 AFB1009C */ sw $s1, 0x9C($sp)
/* E21CC8 802B7458 3C02802B */ lui $v0, %hi(D_802B7C80)
/* E21CCC 802B745C 24427C80 */ addiu $v0, $v0, %lo(D_802B7C80)
.L802B7460:
/* E21CD0 802B7460 AFA2009C */ sw $v0, 0x9C($sp)
.L802B7464:
/* E21CD4 802B7464 0000202D */ daddu $a0, $zero, $zero
/* E21CD8 802B7468 27A50098 */ addiu $a1, $sp, 0x98
/* E21CDC 802B746C 0080302D */ daddu $a2, $a0, $zero
/* E21CE0 802B7470 27A70058 */ addiu $a3, $sp, 0x58
/* E21CE4 802B7474 3C02802B */ lui $v0, %hi(D_802B7640)
.L802B7478:
/* E21CE8 802B7478 24427640 */ addiu $v0, $v0, %lo(D_802B7640)
/* E21CEC 802B747C AFA20098 */ sw $v0, 0x98($sp)
/* E21CF0 802B7480 24020038 */ addiu $v0, $zero, 0x38
/* E21CF4 802B7484 A7A200A0 */ sh $v0, 0xA0($sp)
/* E21CF8 802B7488 A7A200A2 */ sh $v0, 0xA2($sp)
/* E21CFC 802B748C 2402FFE4 */ addiu $v0, $zero, -0x1C
/* E21D00 802B7490 A7A200A4 */ sh $v0, 0xA4($sp)
/* E21D04 802B7494 2402002E */ addiu $v0, $zero, 0x2E
.L802B7498:
/* E21D08 802B7498 A7A200A6 */ sh $v0, 0xA6($sp)
/* E21D0C 802B749C 240200FF */ addiu $v0, $zero, 0xFF
/* E21D10 802B74A0 0C04EBDC */ jal imgfx_appendGfx_component
/* E21D14 802B74A4 A3A200A8 */ sb $v0, 0xA8($sp)
.L802B74A8:
/* E21D18 802B74A8 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* E21D1C 802B74AC 3C03800A */ lui $v1, %hi(gMainGfxPos)
.L802B74B0:
/* E21D20 802B74B0 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* E21D24 802B74B4 8C620000 */ lw $v0, 0x0($v1)
/* E21D28 802B74B8 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* E21D2C 802B74BC 0040202D */ daddu $a0, $v0, $zero
/* E21D30 802B74C0 24420008 */ addiu $v0, $v0, 0x8
/* E21D34 802B74C4 AC620000 */ sw $v0, 0x0($v1)
glabel .L802B74C8
/* E21D38 802B74C8 24020040 */ addiu $v0, $zero, 0x40
/* E21D3C 802B74CC AC850000 */ sw $a1, 0x0($a0)
.L802B74D0:
/* E21D40 802B74D0 AC820004 */ sw $v0, 0x4($a0)
.L802B74D4:
/* E21D44 802B74D4 8FBF00C0 */ lw $ra, 0xC0($sp)
/* E21D48 802B74D8 8FB300BC */ lw $s3, 0xBC($sp)
.L802B74DC:
/* E21D4C 802B74DC 8FB200B8 */ lw $s2, 0xB8($sp)
.L802B74E0:
/* E21D50 802B74E0 8FB100B4 */ lw $s1, 0xB4($sp)
/* E21D54 802B74E4 8FB000B0 */ lw $s0, 0xB0($sp)
/* E21D58 802B74E8 03E00008 */ jr $ra
/* E21D5C 802B74EC 27BD00C8 */ addiu $sp, $sp, 0xC8
### DECOMPILED C INSTRUCTIONS:
void appendGfx_pulse_stone_icon(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
Matrix4f sp18, sp58;
ImgFXTexture ifxImg;
s32 pingDelay;
s32 dx, dy;
if (playerStatus->animFlags & PA_FLAG_PULSE_STONE_VISIBLE) {
guScaleF(sp18, PulseStonePtr->scale, PulseStonePtr->scale, PulseStonePtr->scale);
guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp18, sp58, sp18);
guTranslateF(sp58, PulseStonePtr->pos.x, PulseStonePtr->pos.y, PulseStonePtr->pos.z);
guMtxCatF(sp18, sp58, sp58);
guMtxF2L(sp58, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, pulse_stone_icon_gfx);
dx = abs((gGameStatusPtr->mapID % 7) - 2);
dy = gGameStatusPtr->mapID / 7;
switch (dx + dy) {
case 0:
pingDelay = 4;
break;
case 1:
pingDelay = 8;
break;
case 2:
pingDelay = 16;
break;
case 3:
pingDelay = 32;
break;
case 4:
pingDelay = 64;
break;
case 5:
pingDelay = 128;
break;
default:
pingDelay = -1;
PulseStonePtr->pingTime = 0;
break;
}
ifxImg.palette = pulse_stone_icon_1_pal;
if (pingDelay >= 0) {
PulseStonePtr->pingTime++;
if (PulseStonePtr->pingTime >= pingDelay + 2) {
PulseStonePtr->pingTime = 0;
sfx_play_sound_at_player(SOUND_7D, SOUND_SPACE_MODE_0);
}
if (PulseStonePtr->pingTime < 2) {
ifxImg.palette = pulse_stone_icon_2_pal;
} else {
ifxImg.palette = pulse_stone_icon_1_pal;
}
}
ifxImg.raster = pulse_stone_icon_img;
ifxImg.width = pulse_stone_icon_img_width;
ifxImg.height = pulse_stone_icon_img_height;
ifxImg.xOffset = -28;
ifxImg.yOffset = 46;
ifxImg.alpha = 255;
imgfx_appendGfx_component(0, &ifxImg, 0, sp58);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_800F102C
/* 8A4DC 800F102C 27BDFF28 */ addiu $sp, $sp, -0xD8
/* 8A4E0 800F1030 3C090050 */ lui $t1, (0x5003C0 >> 16)
/* 8A4E4 800F1034 352903C0 */ ori $t1, $t1, (0x5003C0 & 0xFFFF)
/* 8A4E8 800F1038 3C0ADC08 */ lui $t2, (0xDC080008 >> 16)
/* 8A4EC 800F103C 354A0008 */ ori $t2, $t2, (0xDC080008 & 0xFFFF)
/* 8A4F0 800F1040 27A40020 */ addiu $a0, $sp, 0x20
/* 8A4F4 800F1044 AFB100A4 */ sw $s1, 0xA4($sp)
/* 8A4F8 800F1048 3C110001 */ lui $s1, (0x11630 >> 16)
/* 8A4FC 800F104C 36311630 */ ori $s1, $s1, (0x11630 & 0xFFFF)
/* 8A500 800F1050 AFB700BC */ sw $s7, 0xBC($sp)
/* 8A504 800F1054 0000B82D */ daddu $s7, $zero, $zero
/* 8A508 800F1058 AFB600B8 */ sw $s6, 0xB8($sp)
/* 8A50C 800F105C 27B60060 */ addiu $s6, $sp, 0x60
/* 8A510 800F1060 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 8A514 800F1064 2442A674 */ addiu $v0, $v0, %lo(gDisplayContext)
/* 8A518 800F1068 AFBE00C0 */ sw $fp, 0xC0($sp)
/* 8A51C 800F106C 0040F02D */ daddu $fp, $v0, $zero
/* 8A520 800F1070 3C028007 */ lui $v0, %hi(gMatrixListPos)
/* 8A524 800F1074 244241F0 */ addiu $v0, $v0, %lo(gMatrixListPos)
/* 8A528 800F1078 AFB300AC */ sw $s3, 0xAC($sp)
/* 8A52C 800F107C 0040982D */ daddu $s3, $v0, $zero
/* 8A530 800F1080 AFB500B4 */ sw $s5, 0xB4($sp)
/* 8A534 800F1084 3C150001 */ lui $s5, (0x11630 >> 16)
/* 8A538 800F1088 36B51630 */ ori $s5, $s5, (0x11630 & 0xFFFF)
/* 8A53C 800F108C AFB400B0 */ sw $s4, 0xB0($sp)
/* 8A540 800F1090 02E0A02D */ daddu $s4, $s7, $zero
/* 8A544 800F1094 AFB000A0 */ sw $s0, 0xA0($sp)
/* 8A548 800F1098 3C10800A */ lui $s0, %hi(gMainGfxPos)
/* 8A54C 800F109C 2610A66C */ addiu $s0, $s0, %lo(gMainGfxPos)
/* 8A550 800F10A0 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 8A554 800F10A4 AFBF00C4 */ sw $ra, 0xC4($sp)
/* 8A558 800F10A8 AFB200A8 */ sw $s2, 0xA8($sp)
/* 8A55C 800F10AC F7B600D0 */ sdc1 $f22, 0xD0($sp)
/* 8A560 800F10B0 F7B400C8 */ sdc1 $f20, 0xC8($sp)
/* 8A564 800F10B4 8E030000 */ lw $v1, 0x0($s0)
/* 8A568 800F10B8 3C0643A0 */ lui $a2, (0x43A00000 >> 16)
/* 8A56C 800F10BC 3C074370 */ lui $a3, (0x43700000 >> 16)
/* 8A570 800F10C0 44800000 */ mtc1 $zero, $f0
/* 8A574 800F10C4 3C0142C8 */ lui $at, (0x42C80000 >> 16)
/* 8A578 800F10C8 44811000 */ mtc1 $at, $f2
/* 8A57C 800F10CC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 8A580 800F10D0 44812000 */ mtc1 $at, $f4
/* 8A584 800F10D4 0060402D */ daddu $t0, $v1, $zero
/* 8A588 800F10D8 44050000 */ mfc1 $a1, $f0
/* 8A58C 800F10DC 3C01C2C8 */ lui $at, (0xC2C80000 >> 16)
/* 8A590 800F10E0 44810000 */ mtc1 $at, $f0
/* 8A594 800F10E4 24630008 */ addiu $v1, $v1, 0x8
/* 8A598 800F10E8 AE030000 */ sw $v1, 0x0($s0)
/* 8A59C 800F10EC AD020000 */ sw $v0, 0x0($t0)
/* 8A5A0 800F10F0 24620008 */ addiu $v0, $v1, 0x8
/* 8A5A4 800F10F4 AD000004 */ sw $zero, 0x4($t0)
/* 8A5A8 800F10F8 AE020000 */ sw $v0, 0x0($s0)
/* 8A5AC 800F10FC 3C02DB06 */ lui $v0, (0xDB060000 >> 16)
/* 8A5B0 800F1100 AC620000 */ sw $v0, 0x0($v1)
/* 8A5B4 800F1104 24620010 */ addiu $v0, $v1, 0x10
/* 8A5B8 800F1108 AC600004 */ sw $zero, 0x4($v1)
/* 8A5BC 800F110C AE020000 */ sw $v0, 0x0($s0)
/* 8A5C0 800F1110 3C02ED00 */ lui $v0, (0xED000000 >> 16)
/* 8A5C4 800F1114 AC620008 */ sw $v0, 0x8($v1)
/* 8A5C8 800F1118 24620018 */ addiu $v0, $v1, 0x18
/* 8A5CC 800F111C AC69000C */ sw $t1, 0xC($v1)
/* 8A5D0 800F1120 AE020000 */ sw $v0, 0x0($s0)
/* 8A5D4 800F1124 4485B000 */ mtc1 $a1, $f22
/* 8A5D8 800F1128 3C028011 */ lui $v0, %hi(D_801096B0)
/* 8A5DC 800F112C 244296B0 */ addiu $v0, $v0, %lo(D_801096B0)
/* 8A5E0 800F1130 AC6A0010 */ sw $t2, 0x10($v1)
/* 8A5E4 800F1134 AC620014 */ sw $v0, 0x14($v1)
/* 8A5E8 800F1138 E7A20018 */ swc1 $f2, 0x18($sp)
/* 8A5EC 800F113C E7A4001C */ swc1 $f4, 0x1C($sp)
/* 8A5F0 800F1140 AFA50010 */ sw $a1, 0x10($sp)
/* 8A5F4 800F1144 0C018E44 */ jal guOrthoF
/* 8A5F8 800F1148 E7A00014 */ swc1 $f0, 0x14($sp)
/* 8A5FC 800F114C 27A40020 */ addiu $a0, $sp, 0x20
/* 8A600 800F1150 96650000 */ lhu $a1, 0x0($s3)
/* 8A604 800F1154 8FC20000 */ lw $v0, 0x0($fp)
/* 8A608 800F1158 00052980 */ sll $a1, $a1, 6
/* 8A60C 800F115C 00B12821 */ addu $a1, $a1, $s1
/* 8A610 800F1160 0C019D40 */ jal guMtxF2L
/* 8A614 800F1164 00452821 */ addu $a1, $v0, $a1
/* 8A618 800F1168 3C03DA38 */ lui $v1, (0xDA380007 >> 16)
/* 8A61C 800F116C 34630007 */ ori $v1, $v1, (0xDA380007 & 0xFFFF)
/* 8A620 800F1170 3C067F7F */ lui $a2, (0x7F7F7F7F >> 16)
/* 8A624 800F1174 34C67F7F */ ori $a2, $a2, (0x7F7F7F7F & 0xFFFF)
/* 8A628 800F1178 8E040000 */ lw $a0, 0x0($s0)
/* 8A62C 800F117C 96620000 */ lhu $v0, 0x0($s3)
/* 8A630 800F1180 0080282D */ daddu $a1, $a0, $zero
/* 8A634 800F1184 24840008 */ addiu $a0, $a0, 0x8
/* 8A638 800F1188 AE040000 */ sw $a0, 0x0($s0)
/* 8A63C 800F118C ACA30000 */ sw $v1, 0x0($a1)
/* 8A640 800F1190 24430001 */ addiu $v1, $v0, 0x1
/* 8A644 800F1194 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 8A648 800F1198 00021180 */ sll $v0, $v0, 6
/* 8A64C 800F119C A6630000 */ sh $v1, 0x0($s3)
/* 8A650 800F11A0 8FC30000 */ lw $v1, 0x0($fp)
/* 8A654 800F11A4 00511021 */ addu $v0, $v0, $s1
/* 8A658 800F11A8 00621821 */ addu $v1, $v1, $v0
/* 8A65C 800F11AC 24820008 */ addiu $v0, $a0, 0x8
/* 8A660 800F11B0 ACA30004 */ sw $v1, 0x4($a1)
/* 8A664 800F11B4 AE020000 */ sw $v0, 0x0($s0)
/* 8A668 800F11B8 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 8A66C 800F11BC AC820000 */ sw $v0, 0x0($a0)
/* 8A670 800F11C0 3C028011 */ lui $v0, %hi(D_80109710)
/* 8A674 800F11C4 24429710 */ addiu $v0, $v0, %lo(D_80109710)
/* 8A678 800F11C8 AC820004 */ sw $v0, 0x4($a0)
/* 8A67C 800F11CC 24820010 */ addiu $v0, $a0, 0x10
/* 8A680 800F11D0 AE020000 */ sw $v0, 0x0($s0)
/* 8A684 800F11D4 3C02FB00 */ lui $v0, (0xFB000000 >> 16)
/* 8A688 800F11D8 AC820008 */ sw $v0, 0x8($a0)
/* 8A68C 800F11DC AC86000C */ sw $a2, 0xC($a0)
.L800F11E0:
/* 8A690 800F11E0 3C0B8011 */ lui $t3, %hi(D_8010D000)
/* 8A694 800F11E4 256BD000 */ addiu $t3, $t3, %lo(D_8010D000)
/* 8A698 800F11E8 028B1821 */ addu $v1, $s4, $t3
/* 8A69C 800F11EC 90620000 */ lbu $v0, 0x0($v1)
/* 8A6A0 800F11F0 5040005C */ beql $v0, $zero, .L800F1364
/* 8A6A4 800F11F4 26F70001 */ addiu $s7, $s7, 0x1
/* 8A6A8 800F11F8 C4740018 */ lwc1 $f20, 0x18($v1)
/* 8A6AC 800F11FC 24120001 */ addiu $s2, $zero, 0x1
/* 8A6B0 800F1200 3C11800A */ lui $s1, %hi(gMainGfxPos)
/* 8A6B4 800F1204 2631A66C */ addiu $s1, $s1, %lo(gMainGfxPos)
/* 8A6B8 800F1208 24700022 */ addiu $s0, $v1, 0x22
.L800F120C:
/* 8A6BC 800F120C 82020001 */ lb $v0, 0x1($s0)
/* 8A6C0 800F1210 0440004F */ bltz $v0, .L800F1350
/* 8A6C4 800F1214 02C0202D */ daddu $a0, $s6, $zero
/* 8A6C8 800F1218 C6000012 */ lwc1 $f0, 0x12($s0)
/* 8A6CC 800F121C 4405B000 */ mfc1 $a1, $f22
/* 8A6D0 800F1220 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 8A6D4 800F1224 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 8A6D8 800F1228 4406B000 */ mfc1 $a2, $f22
/* 8A6DC 800F122C 94430134 */ lhu $v1, 0x134($v0)
/* 8A6E0 800F1230 46140002 */ mul.s $f0, $f0, $f20
/* 8A6E4 800F1234 00000000 */ nop
/* 8A6E8 800F1238 00031080 */ sll $v0, $v1, 2
/* 8A6EC 800F123C 00431021 */ addu $v0, $v0, $v1
/* 8A6F0 800F1240 00021040 */ sll $v0, $v0, 1
/* 8A6F4 800F1244 44823000 */ mtc1 $v0, $f6
/* 8A6F8 800F1248 00000000 */ nop
/* 8A6FC 800F124C 468031A0 */ cvt.s.w $f6, $f6
/* 8A700 800F1250 44073000 */ mfc1 $a3, $f6
/* 8A704 800F1254 E7A00010 */ swc1 $f0, 0x10($sp)
/* 8A708 800F1258 C6000002 */ lwc1 $f0, 0x2($s0)
/* 8A70C 800F125C E7A00014 */ swc1 $f0, 0x14($sp)
/* 8A710 800F1260 C6000006 */ lwc1 $f0, 0x6($s0)
/* 8A714 800F1264 E7B6001C */ swc1 $f22, 0x1C($sp)
/* 8A718 800F1268 0C018FC4 */ jal guPositionF
/* 8A71C 800F126C E7A00018 */ swc1 $f0, 0x18($sp)
/* 8A720 800F1270 02C0202D */ daddu $a0, $s6, $zero
/* 8A724 800F1274 96650000 */ lhu $a1, 0x0($s3)
/* 8A728 800F1278 8FC20000 */ lw $v0, 0x0($fp)
/* 8A72C 800F127C 00052980 */ sll $a1, $a1, 6
/* 8A730 800F1280 00B52821 */ addu $a1, $a1, $s5
/* 8A734 800F1284 0C019D40 */ jal guMtxF2L
/* 8A738 800F1288 00452821 */ addu $a1, $v0, $a1
/* 8A73C 800F128C 3C08D838 */ lui $t0, (0xD8380002 >> 16)
/* 8A740 800F1290 8E240000 */ lw $a0, 0x0($s1)
/* 8A744 800F1294 35080002 */ ori $t0, $t0, (0xD8380002 & 0xFFFF)
/* 8A748 800F1298 0080282D */ daddu $a1, $a0, $zero
/* 8A74C 800F129C 24840008 */ addiu $a0, $a0, 0x8
/* 8A750 800F12A0 AE240000 */ sw $a0, 0x0($s1)
/* 8A754 800F12A4 96620000 */ lhu $v0, 0x0($s3)
/* 8A758 800F12A8 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 8A75C 800F12AC ACA30000 */ sw $v1, 0x0($a1)
/* 8A760 800F12B0 24430001 */ addiu $v1, $v0, 0x1
/* 8A764 800F12B4 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 8A768 800F12B8 00021180 */ sll $v0, $v0, 6
/* 8A76C 800F12BC A6630000 */ sh $v1, 0x0($s3)
/* 8A770 800F12C0 8FC30000 */ lw $v1, 0x0($fp)
/* 8A774 800F12C4 00551021 */ addu $v0, $v0, $s5
/* 8A778 800F12C8 00621821 */ addu $v1, $v1, $v0
/* 8A77C 800F12CC 24820008 */ addiu $v0, $a0, 0x8
/* 8A780 800F12D0 ACA30004 */ sw $v1, 0x4($a1)
/* 8A784 800F12D4 AE220000 */ sw $v0, 0x0($s1)
/* 8A788 800F12D8 82030001 */ lb $v1, 0x1($s0)
/* 8A78C 800F12DC 24020050 */ addiu $v0, $zero, 0x50
/* 8A790 800F12E0 00431023 */ subu $v0, $v0, $v1
/* 8A794 800F12E4 304200FF */ andi $v0, $v0, 0xFF
/* 8A798 800F12E8 3C03FA00 */ lui $v1, (0xFA000000 >> 16)
/* 8A79C 800F12EC 00431025 */ or $v0, $v0, $v1
/* 8A7A0 800F12F0 AC820000 */ sw $v0, 0x0($a0)
/* 8A7A4 800F12F4 9203FFFD */ lbu $v1, -0x3($s0)
/* 8A7A8 800F12F8 9205FFFE */ lbu $a1, -0x2($s0)
/* 8A7AC 800F12FC 9206FFFF */ lbu $a2, -0x1($s0)
/* 8A7B0 800F1300 92070000 */ lbu $a3, 0x0($s0)
/* 8A7B4 800F1304 24820010 */ addiu $v0, $a0, 0x10
/* 8A7B8 800F1308 AE220000 */ sw $v0, 0x0($s1)
/* 8A7BC 800F130C 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 8A7C0 800F1310 AC820008 */ sw $v0, 0x8($a0)
/* 8A7C4 800F1314 3C028011 */ lui $v0, %hi(D_801097D8)
/* 8A7C8 800F1318 244297D8 */ addiu $v0, $v0, %lo(D_801097D8)
/* 8A7CC 800F131C AC82000C */ sw $v0, 0xC($a0)
/* 8A7D0 800F1320 24820018 */ addiu $v0, $a0, 0x18
/* 8A7D4 800F1324 AE220000 */ sw $v0, 0x0($s1)
/* 8A7D8 800F1328 24020040 */ addiu $v0, $zero, 0x40
/* 8A7DC 800F132C AC880010 */ sw $t0, 0x10($a0)
/* 8A7E0 800F1330 AC820014 */ sw $v0, 0x14($a0)
/* 8A7E4 800F1334 00031E00 */ sll $v1, $v1, 24
/* 8A7E8 800F1338 00052C00 */ sll $a1, $a1, 16
/* 8A7EC 800F133C 00651825 */ or $v1, $v1, $a1
/* 8A7F0 800F1340 00063200 */ sll $a2, $a2, 8
/* 8A7F4 800F1344 00661825 */ or $v1, $v1, $a2
/* 8A7F8 800F1348 00671825 */ or $v1, $v1, $a3
/* 8A7FC 800F134C AC830004 */ sw $v1, 0x4($a0)
.L800F1350:
/* 8A800 800F1350 26520001 */ addiu $s2, $s2, 0x1
/* 8A804 800F1354 2A420039 */ slti $v0, $s2, 0x39
/* 8A808 800F1358 1440FFAC */ bnez $v0, .L800F120C
/* 8A80C 800F135C 2610001C */ addiu $s0, $s0, 0x1C
/* 8A810 800F1360 26F70001 */ addiu $s7, $s7, 0x1
.L800F1364:
/* 8A814 800F1364 1AE0FF9E */ blez $s7, .L800F11E0
/* 8A818 800F1368 2694063C */ addiu $s4, $s4, 0x63C
/* 8A81C 800F136C 8FBF00C4 */ lw $ra, 0xC4($sp)
/* 8A820 800F1370 8FBE00C0 */ lw $fp, 0xC0($sp)
/* 8A824 800F1374 8FB700BC */ lw $s7, 0xBC($sp)
/* 8A828 800F1378 8FB600B8 */ lw $s6, 0xB8($sp)
/* 8A82C 800F137C 8FB500B4 */ lw $s5, 0xB4($sp)
/* 8A830 800F1380 8FB400B0 */ lw $s4, 0xB0($sp)
/* 8A834 800F1384 8FB300AC */ lw $s3, 0xAC($sp)
/* 8A838 800F1388 8FB200A8 */ lw $s2, 0xA8($sp)
/* 8A83C 800F138C 8FB100A4 */ lw $s1, 0xA4($sp)
/* 8A840 800F1390 8FB000A0 */ lw $s0, 0xA0($sp)
/* 8A844 800F1394 D7B600D0 */ ldc1 $f22, 0xD0($sp)
/* 8A848 800F1398 D7B400C8 */ ldc1 $f20, 0xC8($sp)
/* 8A84C 800F139C 03E00008 */ jr $ra
/* 8A850 800F13A0 27BD00D8 */ addiu $sp, $sp, 0xD8
/* 8A854 800F13A4 00000000 */ nop
/* 8A858 800F13A8 00000000 */ nop
/* 8A85C 800F13AC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void func_800F102C(void) {
Matrix4f sp20, sp60;
Unk8a160Outer* outer;
s32 i;
s32 j;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x00, 0x00000000);
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
gSPViewport(gMainGfxPos++, &D_801096B0);
guOrthoF(sp20, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 0.0f, -100.0f, 100.0f, 1.0f);
guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
gSPDisplayList(gMainGfxPos++, D_80109710);
gDPSetEnvColor(gMainGfxPos++, 127, 127, 127, 127);
for (i = 0; i < ARRAY_COUNT(D_8010D000); i++, outer++) {
outer = &D_8010D000[i];
if (outer->subs[0].alive) {
Unk8a160* it = &outer->subs[0];
f32 baseScale = it->scale;
it++;
for (j = 1; j < ARRAY_COUNT(outer->subs); j++, it++) {
if (it->lodVal >= 0) {
guPositionF(sp60, 0.0f, 0.0f, gGameStatusPtr->frameCounter * 10, it->scale * baseScale,
it->x, it->y, 0.0f);
guMtxF2L(sp60, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 80 - it->lodVal, it->rgba.r, it->rgba.g, it->rgba.b, it->rgba.a);
gSPDisplayList(gMainGfxPos++, D_801097D8);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel create_entity
/* A7FC4 801118C4 AFA40000 */ sw $a0, 0x0($sp)
/* A7FC8 801118C8 AFA50004 */ sw $a1, 0x4($sp)
/* A7FCC 801118CC AFA60008 */ sw $a2, 0x8($sp)
/* A7FD0 801118D0 AFA7000C */ sw $a3, 0xC($sp)
/* A7FD4 801118D4 27BDFFC0 */ addiu $sp, $sp, -0x40
/* A7FD8 801118D8 AFBF001C */ sw $ra, 0x1C($sp)
/* A7FDC 801118DC AFB20018 */ sw $s2, 0x18($sp)
/* A7FE0 801118E0 AFB10014 */ sw $s1, 0x14($sp)
/* A7FE4 801118E4 AFB00010 */ sw $s0, 0x10($sp)
/* A7FE8 801118E8 F7BA0038 */ sdc1 $f26, 0x38($sp)
/* A7FEC 801118EC F7B80030 */ sdc1 $f24, 0x30($sp)
/* A7FF0 801118F0 F7B60028 */ sdc1 $f22, 0x28($sp)
/* A7FF4 801118F4 F7B40020 */ sdc1 $f20, 0x20($sp)
/* A7FF8 801118F8 0C044305 */ jal load_area_specific_entity_data
/* A7FFC 801118FC AFA40040 */ sw $a0, 0x40($sp)
/* A8000 80111900 27A40054 */ addiu $a0, $sp, 0x54
/* A8004 80111904 3C038016 */ lui $v1, %hi(CreateEntityVarArgBuffer2)
/* A8008 80111908 2463C7D8 */ addiu $v1, $v1, %lo(CreateEntityVarArgBuffer2)
/* A800C 8011190C C7B60044 */ lwc1 $f22, 0x44($sp)
/* A8010 80111910 4680B5A0 */ cvt.s.w $f22, $f22
/* A8014 80111914 C7B80048 */ lwc1 $f24, 0x48($sp)
/* A8018 80111918 4680C620 */ cvt.s.w $f24, $f24
/* A801C 8011191C C7BA004C */ lwc1 $f26, 0x4C($sp)
/* A8020 80111920 4680D6A0 */ cvt.s.w $f26, $f26
/* A8024 80111924 C7B40050 */ lwc1 $f20, 0x50($sp)
/* A8028 80111928 4680A520 */ cvt.s.w $f20, $f20
/* A802C 8011192C AC600000 */ sw $zero, 0x0($v1)
/* A8030 80111930 2463FFFC */ addiu $v1, $v1, -0x4
/* A8034 80111934 AC600000 */ sw $zero, 0x0($v1)
/* A8038 80111938 2463FFFC */ addiu $v1, $v1, -0x4
/* A803C 8011193C 24110003 */ addiu $s1, $zero, 0x3
/* A8040 80111940 3C058000 */ lui $a1, (0x80000000 >> 16)
/* A8044 80111944 AC600000 */ sw $zero, 0x0($v1)
.L80111948:
/* A8048 80111948 24840004 */ addiu $a0, $a0, 0x4
/* A804C 8011194C 8C82FFFC */ lw $v0, -0x4($a0)
/* A8050 80111950 10450004 */ beq $v0, $a1, .L80111964
/* A8054 80111954 2631FFFF */ addiu $s1, $s1, -0x1
/* A8058 80111958 AC620000 */ sw $v0, 0x0($v1)
/* A805C 8011195C 1E20FFFA */ bgtz $s1, .L80111948
/* A8060 80111960 24630004 */ addiu $v1, $v1, 0x4
.L80111964:
/* A8064 80111964 0000882D */ daddu $s1, $zero, $zero
/* A8068 80111968 3C128015 */ lui $s2, %hi(gCurrentEntityListPtr)
/* A806C 8011196C 26521470 */ addiu $s2, $s2, %lo(gCurrentEntityListPtr)
/* A8070 80111970 8E430000 */ lw $v1, 0x0($s2)
.L80111974:
/* A8074 80111974 8C620000 */ lw $v0, 0x0($v1)
/* A8078 80111978 10400006 */ beqz $v0, .L80111994
/* A807C 8011197C 2A22001E */ slti $v0, $s1, 0x1E
/* A8080 80111980 26310001 */ addiu $s1, $s1, 0x1
/* A8084 80111984 2A22001E */ slti $v0, $s1, 0x1E
/* A8088 80111988 1440FFFA */ bnez $v0, .L80111974
/* A808C 8011198C 24630004 */ addiu $v1, $v1, 0x4
/* A8090 80111990 2A22001E */ slti $v0, $s1, 0x1E
.L80111994:
/* A8094 80111994 10400086 */ beqz $v0, .L80111BB0
/* A8098 80111998 2402FFFF */ addiu $v0, $zero, -0x1
/* A809C 8011199C 0C00AB39 */ jal heap_malloc
/* A80A0 801119A0 240400F8 */ addiu $a0, $zero, 0xF8
/* A80A4 801119A4 0040802D */ daddu $s0, $v0, $zero
/* A80A8 801119A8 0200202D */ daddu $a0, $s0, $zero
/* A80AC 801119AC 240500F8 */ addiu $a1, $zero, 0xF8
/* A80B0 801119B0 8E420000 */ lw $v0, 0x0($s2)
/* A80B4 801119B4 00111880 */ sll $v1, $s1, 2
/* A80B8 801119B8 00621821 */ addu $v1, $v1, $v0
/* A80BC 801119BC 0C00A580 */ jal mem_clear
/* A80C0 801119C0 AC700000 */ sw $s0, 0x0($v1)
/* A80C4 801119C4 8FA30040 */ lw $v1, 0x40($sp)
/* A80C8 801119C8 AE000040 */ sw $zero, 0x40($s0)
/* A80CC 801119CC 94620002 */ lhu $v0, 0x2($v1)
/* A80D0 801119D0 10400008 */ beqz $v0, .L801119F4
/* A80D4 801119D4 00000000 */ nop
/* A80D8 801119D8 0C00AB39 */ jal heap_malloc
/* A80DC 801119DC 0040202D */ daddu $a0, $v0, $zero
/* A80E0 801119E0 8FA30040 */ lw $v1, 0x40($sp)
/* A80E4 801119E4 AE020040 */ sw $v0, 0x40($s0)
/* A80E8 801119E8 94650002 */ lhu $a1, 0x2($v1)
/* A80EC 801119EC 0C00A580 */ jal mem_clear
/* A80F0 801119F0 0040202D */ daddu $a0, $v0, $zero
.L801119F4:
/* A80F4 801119F4 8FA20040 */ lw $v0, 0x40($sp)
/* A80F8 801119F8 90420020 */ lbu $v0, 0x20($v0)
/* A80FC 801119FC A2110004 */ sb $s1, 0x4($s0)
/* A8100 80111A00 A202000A */ sb $v0, 0xA($s0)
/* A8104 80111A04 8FA20040 */ lw $v0, 0x40($sp)
/* A8108 80111A08 AE000024 */ sw $zero, 0x24($s0)
/* A810C 80111A0C AE000020 */ sw $zero, 0x20($s0)
/* A8110 80111A10 AE020038 */ sw $v0, 0x38($s0)
/* A8114 80111A14 8C430010 */ lw $v1, 0x10($v0)
/* A8118 80111A18 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* A811C 80111A1C 44810000 */ mtc1 $at, $f0
/* A8120 80111A20 0003102B */ sltu $v0, $zero, $v1
/* A8124 80111A24 A2020009 */ sb $v0, 0x9($s0)
/* A8128 80111A28 8FA40040 */ lw $a0, 0x40($sp)
/* A812C 80111A2C AE030018 */ sw $v1, 0x18($s0)
/* A8130 80111A30 8C820010 */ lw $v0, 0x10($a0)
/* A8134 80111A34 AE00001C */ sw $zero, 0x1C($s0)
/* A8138 80111A38 AE02002C */ sw $v0, 0x2C($s0)
/* A813C 80111A3C 94840000 */ lhu $a0, 0x0($a0)
/* A8140 80111A40 3C028000 */ lui $v0, (0x80000000 >> 16)
/* A8144 80111A44 A2000006 */ sb $zero, 0x6($s0)
/* A8148 80111A48 A2000007 */ sb $zero, 0x7($s0)
/* A814C 80111A4C AE00003C */ sw $zero, 0x3C($s0)
/* A8150 80111A50 E6160048 */ swc1 $f22, 0x48($s0)
/* A8154 80111A54 E618004C */ swc1 $f24, 0x4C($s0)
/* A8158 80111A58 E61A0050 */ swc1 $f26, 0x50($s0)
/* A815C 80111A5C AE000060 */ sw $zero, 0x60($s0)
/* A8160 80111A60 E6140064 */ swc1 $f20, 0x64($s0)
/* A8164 80111A64 AE000068 */ sw $zero, 0x68($s0)
/* A8168 80111A68 E6000054 */ swc1 $f0, 0x54($s0)
/* A816C 80111A6C E6000058 */ swc1 $f0, 0x58($s0)
/* A8170 80111A70 E600005C */ swc1 $f0, 0x5C($s0)
/* A8174 80111A74 8FA30040 */ lw $v1, 0x40($sp)
/* A8178 80111A78 00822025 */ or $a0, $a0, $v0
/* A817C 80111A7C AE040000 */ sw $a0, 0x0($s0)
/* A8180 80111A80 90620021 */ lbu $v0, 0x21($v1)
/* A8184 80111A84 A602000C */ sh $v0, 0xC($s0)
/* A8188 80111A88 90620022 */ lbu $v0, 0x22($v1)
/* A818C 80111A8C A602000E */ sh $v0, 0xE($s0)
/* A8190 80111A90 90630023 */ lbu $v1, 0x23($v1)
/* A8194 80111A94 24020001 */ addiu $v0, $zero, 0x1
/* A8198 80111A98 A2020005 */ sb $v0, 0x5($s0)
/* A819C 80111A9C 240200FF */ addiu $v0, $zero, 0xFF
/* A81A0 80111AA0 A2020008 */ sb $v0, 0x8($s0)
/* A81A4 80111AA4 A202000B */ sb $v0, 0xB($s0)
/* A81A8 80111AA8 8FA50040 */ lw $a1, 0x40($sp)
/* A81AC 80111AAC 2402FFFF */ addiu $v0, $zero, -0x1
/* A81B0 80111AB0 A6020014 */ sh $v0, 0x14($s0)
/* A81B4 80111AB4 A6020016 */ sh $v0, 0x16($s0)
/* A81B8 80111AB8 AE000044 */ sw $zero, 0x44($s0)
/* A81BC 80111ABC A6030010 */ sh $v1, 0x10($s0)
/* A81C0 80111AC0 94A20000 */ lhu $v0, 0x0($a1)
/* A81C4 80111AC4 30420008 */ andi $v0, $v0, 0x8
/* A81C8 80111AC8 14400012 */ bnez $v0, .L80111B14
/* A81CC 80111ACC 0200202D */ daddu $a0, $s0, $zero
/* A81D0 80111AD0 8CA20018 */ lw $v0, 0x18($a1)
/* A81D4 80111AD4 10400003 */ beqz $v0, .L80111AE4
/* A81D8 80111AD8 00000000 */ nop
/* A81DC 80111ADC 0C0444A9 */ jal load_simple_entity_data
/* A81E0 80111AE0 0220302D */ daddu $a2, $s1, $zero
.L80111AE4:
/* A81E4 80111AE4 8FA20040 */ lw $v0, 0x40($sp)
/* A81E8 80111AE8 8C440004 */ lw $a0, 0x4($v0)
/* A81EC 80111AEC 1080000C */ beqz $a0, .L80111B20
/* A81F0 80111AF0 00000000 */ nop
/* A81F4 80111AF4 0C048338 */ jal load_entity_model
/* A81F8 80111AF8 00000000 */ nop
/* A81FC 80111AFC A6020014 */ sh $v0, 0x14($s0)
/* A8200 80111B00 00021400 */ sll $v0, $v0, 16
/* A8204 80111B04 0C0483C1 */ jal exec_entity_model_commandlist
/* A8208 80111B08 00022403 */ sra $a0, $v0, 16
/* A820C 80111B0C 080446C7 */ j .L80111B1C
/* A8210 80111B10 00000000 */ nop
.L80111B14:
/* A8214 80111B14 0C044502 */ jal load_split_entity_data
/* A8218 80111B18 0220302D */ daddu $a2, $s1, $zero
.L80111B1C:
/* A821C 80111B1C 8FA20040 */ lw $v0, 0x40($sp)
.L80111B20:
/* A8220 80111B20 90430020 */ lbu $v1, 0x20($v0)
/* A8224 80111B24 24020001 */ addiu $v0, $zero, 0x1
/* A8228 80111B28 1062000A */ beq $v1, $v0, .L80111B54
/* A822C 80111B2C 00000000 */ nop
/* A8230 80111B30 8E020000 */ lw $v0, 0x0($s0)
/* A8234 80111B34 30420300 */ andi $v0, $v0, 0x300
/* A8238 80111B38 10400006 */ beqz $v0, .L80111B54
/* A823C 80111B3C 00000000 */ nop
/* A8240 80111B40 4405B000 */ mfc1 $a1, $f22
/* A8244 80111B44 4406C000 */ mfc1 $a2, $f24
/* A8248 80111B48 4407D000 */ mfc1 $a3, $f26
/* A824C 80111B4C 0C044873 */ jal create_entity_shadow
/* A8250 80111B50 0200202D */ daddu $a0, $s0, $zero
.L80111B54:
/* A8254 80111B54 8FA20040 */ lw $v0, 0x40($sp)
/* A8258 80111B58 90420020 */ lbu $v0, 0x20($v0)
/* A825C 80111B5C 2443FFF9 */ addiu $v1, $v0, -0x7
/* A8260 80111B60 2C62002B */ sltiu $v0, $v1, 0x2B
/* A8264 80111B64 10400009 */ beqz $v0, .L80111B8C
/* A8268 80111B68 00031080 */ sll $v0, $v1, 2
/* A826C 80111B6C 3C018015 */ lui $at, %hi(jtbl_8014F878)
/* A8270 80111B70 00220821 */ addu $at, $at, $v0
/* A8274 80111B74 8C22F878 */ lw $v0, %lo(jtbl_8014F878)($at)
/* A8278 80111B78 00400008 */ jr $v0
/* A827C 80111B7C 00000000 */ nop
glabel .L80111B80
/* A8280 80111B80 8E020000 */ lw $v0, 0x0($s0)
/* A8284 80111B84 34424000 */ ori $v0, $v0, 0x4000
/* A8288 80111B88 AE020000 */ sw $v0, 0x0($s0)
glabel .L80111B8C
/* A828C 80111B8C 8FA20040 */ lw $v0, 0x40($sp)
/* A8290 80111B90 8C42000C */ lw $v0, 0xC($v0)
/* A8294 80111B94 10400003 */ beqz $v0, .L80111BA4
/* A8298 80111B98 00000000 */ nop
/* A829C 80111B9C 0040F809 */ jalr $v0
/* A82A0 80111BA0 0200202D */ daddu $a0, $s0, $zero
.L80111BA4:
/* A82A4 80111BA4 0C04408B */ jal update_entity_transform_matrix
/* A82A8 80111BA8 0200202D */ daddu $a0, $s0, $zero
/* A82AC 80111BAC 92020004 */ lbu $v0, 0x4($s0)
.L80111BB0:
/* A82B0 80111BB0 8FBF001C */ lw $ra, 0x1C($sp)
/* A82B4 80111BB4 8FB20018 */ lw $s2, 0x18($sp)
/* A82B8 80111BB8 8FB10014 */ lw $s1, 0x14($sp)
/* A82BC 80111BBC 8FB00010 */ lw $s0, 0x10($sp)
/* A82C0 80111BC0 D7BA0038 */ ldc1 $f26, 0x38($sp)
/* A82C4 80111BC4 D7B80030 */ ldc1 $f24, 0x30($sp)
/* A82C8 80111BC8 D7B60028 */ ldc1 $f22, 0x28($sp)
/* A82CC 80111BCC D7B40020 */ ldc1 $f20, 0x20($sp)
/* A82D0 80111BD0 03E00008 */ jr $ra
/* A82D4 80111BD4 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
s32 create_entity(EntityBlueprint* bp, ...) {
va_list ap;
EntityBlueprint** bpPtr;
f32 x, y, z;
f32 rotY;
s32 listIndex;
Entity* entity;
s32* args;
va_start(ap, bp);
// needed to match
bpPtr = &bp;
*bpPtr = bp;
load_area_specific_entity_data();
x = va_arg(ap, s32);
y = va_arg(ap, s32);
z = va_arg(ap, s32);
rotY = va_arg(ap, s32);
args = &CreateEntityVarArgBuffer[2];
*args-- = 0;
*args-- = 0;
*args = 0;
for (listIndex = 3; listIndex > 0; listIndex--) {
s32 arg = va_arg(ap, s32);
if (arg == MAKE_ENTITY_END) {
break;
}
*args++ = arg;
}
va_end(ap);
for (listIndex = 0; listIndex < ARRAY_COUNT(*gCurrentEntityListPtr); listIndex++) {
if ((*gCurrentEntityListPtr)[listIndex] == NULL) {
break;
}
}
if (listIndex >= MAX_ENTITIES) {
return -1;
}
(*gCurrentEntityListPtr)[listIndex] = entity = heap_malloc(sizeof(*entity));
mem_clear(entity, sizeof(*entity));
entity->dataBuf.any = NULL;
if (bp->typeDataSize != 0) {
entity->dataBuf.any = heap_malloc(bp->typeDataSize);
mem_clear(entity->dataBuf.any, bp->typeDataSize);
}
entity->type = bp->entityType;
entity->listIndex = listIndex;
entity->boundScript = NULL;
entity->updateMatrixOverride = NULL;
entity->blueprint = bp;
entity->scriptReadPos = bp->updateEntityScript;
entity->scriptDelay = entity->scriptReadPos != NULL ? 1 : 0;
entity->savedReadPos[0] = bp->updateEntityScript;
entity->updateScriptCallback = NULL;
entity->flags = bp->flags | ENTITY_FLAG_CREATED;
entity->collisionFlags = 0;
entity->collisionTimer = 0;
entity->renderSetupFunc = NULL;
entity->position.x = x;
entity->position.y = y;
entity->position.z = z;
entity->rotation.x = 0.0f;
entity->rotation.y = rotY;
entity->rotation.z = 0.0f;
entity->scale.x = 1.0f;
entity->scale.y = 1.0f;
entity->scale.z = 1.0f;
entity->aabb.x = bp->aabbSize[0];
entity->aabb.y = bp->aabbSize[1];
entity->aabb.z = bp->aabbSize[2];
entity->unk_05 = 1;
entity->unk_08 = -1;
entity->alpha = 255;
entity->virtualModelIndex = -1;
entity->shadowIndex = -1;
entity->gfxBaseAddr = NULL;
if (!(bp->flags & ENTITY_FLAG_HAS_ANIMATED_MODEL)) {
if (bp->dma.start != 0) {
load_simple_entity_data(entity, bp, listIndex);
}
if (bp->renderCommandList != NULL) {
entity->virtualModelIndex = load_entity_model(bp->renderCommandList);
exec_entity_model_commandlist(entity->virtualModelIndex);
}
} else {
load_split_entity_data(entity, bp, listIndex);
}
if (bp->entityType != ENTITY_TYPE_SHADOW && (entity->flags & (ENTITY_FLAG_FIXED_SHADOW_SIZE | ENTITY_FLAG_HAS_SHADOW))) {
create_entity_shadow(entity, x, y, z);
}
switch (bp->entityType) {
case ENTITY_TYPE_BLUE_SWITCH:
case ENTITY_TYPE_RED_SWITCH:
case ENTITY_TYPE_SIMPLE_SPRING:
case ENTITY_TYPE_SCRIPT_SPRING:
case ENTITY_TYPE_STAR_BOX_LAUCHER:
entity->flags |= ENTITY_FLAG_4000;
break;
}
if (bp->fpInit != NULL) {
bp->fpInit(entity);
}
update_entity_transform_matrix(entity);
return entity->listIndex;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel collision_lava_reset_check_additional_overlaps
/* 7E068 800E4BB8 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 7E06C 800E4BBC 3C038011 */ lui $v1, %hi(gPlayerStatus)
/* 7E070 800E4BC0 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus)
/* 7E074 800E4BC4 AFBF0040 */ sw $ra, 0x40($sp)
/* 7E078 800E4BC8 AFB3003C */ sw $s3, 0x3C($sp)
/* 7E07C 800E4BCC AFB20038 */ sw $s2, 0x38($sp)
/* 7E080 800E4BD0 AFB10034 */ sw $s1, 0x34($sp)
/* 7E084 800E4BD4 AFB00030 */ sw $s0, 0x30($sp)
/* 7E088 800E4BD8 F7B60050 */ sdc1 $f22, 0x50($sp)
/* 7E08C 800E4BDC F7B40048 */ sdc1 $f20, 0x48($sp)
/* 7E090 800E4BE0 8C620004 */ lw $v0, 0x4($v1)
/* 7E094 800E4BE4 30421000 */ andi $v0, $v0, 0x1000
/* 7E098 800E4BE8 10400005 */ beqz $v0, .L800E4C00
/* 7E09C 800E4BEC 0060982D */ daddu $s3, $v1, $zero
/* 7E0A0 800E4BF0 0C0393C4 */ jal func_800E4F10
/* 7E0A4 800E4BF4 00000000 */ nop
/* 7E0A8 800E4BF8 080393BB */ j .L800E4EEC
/* 7E0AC 800E4BFC 00000000 */ nop
.L800E4C00:
/* 7E0B0 800E4C00 C66C0080 */ lwc1 $f12, 0x80($s3)
/* 7E0B4 800E4C04 3C01403E */ lui $at, (0x403E0000 >> 16)
/* 7E0B8 800E4C08 4481A800 */ mtc1 $at, $f21
/* 7E0BC 800E4C0C 4480A000 */ mtc1 $zero, $f20
/* 7E0C0 800E4C10 46006321 */ cvt.d.s $f12, $f12
/* 7E0C4 800E4C14 46346301 */ sub.d $f12, $f12, $f20
/* 7E0C8 800E4C18 0C00A6C9 */ jal clamp_angle
/* 7E0CC 800E4C1C 46206320 */ cvt.s.d $f12, $f12
/* 7E0D0 800E4C20 0000202D */ daddu $a0, $zero, $zero
/* 7E0D4 800E4C24 0260282D */ daddu $a1, $s3, $zero
/* 7E0D8 800E4C28 27B20020 */ addiu $s2, $sp, 0x20
/* 7E0DC 800E4C2C 0240302D */ daddu $a2, $s2, $zero
/* 7E0E0 800E4C30 27B10024 */ addiu $s1, $sp, 0x24
/* 7E0E4 800E4C34 0220382D */ daddu $a3, $s1, $zero
/* 7E0E8 800E4C38 866200B0 */ lh $v0, 0xB0($s3)
/* 7E0EC 800E4C3C 3C013F40 */ lui $at, (0x3F400000 >> 16)
/* 7E0F0 800E4C40 4481B000 */ mtc1 $at, $f22
/* 7E0F4 800E4C44 44822000 */ mtc1 $v0, $f4
/* 7E0F8 800E4C48 00000000 */ nop
/* 7E0FC 800E4C4C 46802120 */ cvt.s.w $f4, $f4
/* 7E100 800E4C50 46162102 */ mul.s $f4, $f4, $f22
/* 7E104 800E4C54 00000000 */ nop
/* 7E108 800E4C58 27B00028 */ addiu $s0, $sp, 0x28
/* 7E10C 800E4C5C C662002C */ lwc1 $f2, 0x2C($s3)
/* 7E110 800E4C60 C6660028 */ lwc1 $f6, 0x28($s3)
/* 7E114 800E4C64 C6680030 */ lwc1 $f8, 0x30($s3)
/* 7E118 800E4C68 46041080 */ add.s $f2, $f2, $f4
/* 7E11C 800E4C6C E7A60020 */ swc1 $f6, 0x20($sp)
/* 7E120 800E4C70 E7A80028 */ swc1 $f8, 0x28($sp)
/* 7E124 800E4C74 E7A20024 */ swc1 $f2, 0x24($sp)
/* 7E128 800E4C78 AFB00010 */ sw $s0, 0x10($sp)
/* 7E12C 800E4C7C AFA00014 */ sw $zero, 0x14($sp)
/* 7E130 800E4C80 0C037B01 */ jal player_test_lateral_overlap
/* 7E134 800E4C84 E7A00018 */ swc1 $f0, 0x18($sp)
/* 7E138 800E4C88 C66C0080 */ lwc1 $f12, 0x80($s3)
/* 7E13C 800E4C8C C7A00020 */ lwc1 $f0, 0x20($sp)
/* 7E140 800E4C90 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 7E144 800E4C94 46006321 */ cvt.d.s $f12, $f12
/* 7E148 800E4C98 46346300 */ add.d $f12, $f12, $f20
/* 7E14C 800E4C9C E6600028 */ swc1 $f0, 0x28($s3)
/* 7E150 800E4CA0 E6620030 */ swc1 $f2, 0x30($s3)
/* 7E154 800E4CA4 0C00A6C9 */ jal clamp_angle
/* 7E158 800E4CA8 46206320 */ cvt.s.d $f12, $f12
/* 7E15C 800E4CAC 0000202D */ daddu $a0, $zero, $zero
/* 7E160 800E4CB0 0260282D */ daddu $a1, $s3, $zero
/* 7E164 800E4CB4 866200B0 */ lh $v0, 0xB0($s3)
/* 7E168 800E4CB8 0240302D */ daddu $a2, $s2, $zero
/* 7E16C 800E4CBC 44821000 */ mtc1 $v0, $f2
/* 7E170 800E4CC0 00000000 */ nop
/* 7E174 800E4CC4 468010A0 */ cvt.s.w $f2, $f2
/* 7E178 800E4CC8 46161082 */ mul.s $f2, $f2, $f22
/* 7E17C 800E4CCC 00000000 */ nop
/* 7E180 800E4CD0 0220382D */ daddu $a3, $s1, $zero
/* 7E184 800E4CD4 C664002C */ lwc1 $f4, 0x2C($s3)
/* 7E188 800E4CD8 C6660028 */ lwc1 $f6, 0x28($s3)
/* 7E18C 800E4CDC C6680030 */ lwc1 $f8, 0x30($s3)
/* 7E190 800E4CE0 46022100 */ add.s $f4, $f4, $f2
/* 7E194 800E4CE4 E7A60020 */ swc1 $f6, 0x20($sp)
/* 7E198 800E4CE8 E7A80028 */ swc1 $f8, 0x28($sp)
/* 7E19C 800E4CEC E7A40024 */ swc1 $f4, 0x24($sp)
/* 7E1A0 800E4CF0 AFB00010 */ sw $s0, 0x10($sp)
/* 7E1A4 800E4CF4 AFA00014 */ sw $zero, 0x14($sp)
/* 7E1A8 800E4CF8 0C037B01 */ jal player_test_lateral_overlap
/* 7E1AC 800E4CFC E7A00018 */ swc1 $f0, 0x18($sp)
/* 7E1B0 800E4D00 C66C0080 */ lwc1 $f12, 0x80($s3)
/* 7E1B4 800E4D04 C7A00020 */ lwc1 $f0, 0x20($sp)
/* 7E1B8 800E4D08 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 7E1BC 800E4D0C 46006321 */ cvt.d.s $f12, $f12
/* 7E1C0 800E4D10 46346301 */ sub.d $f12, $f12, $f20
/* 7E1C4 800E4D14 E6600028 */ swc1 $f0, 0x28($s3)
/* 7E1C8 800E4D18 E6620030 */ swc1 $f2, 0x30($s3)
/* 7E1CC 800E4D1C 0C00A6C9 */ jal clamp_angle
/* 7E1D0 800E4D20 46206320 */ cvt.s.d $f12, $f12
/* 7E1D4 800E4D24 0000202D */ daddu $a0, $zero, $zero
/* 7E1D8 800E4D28 0260282D */ daddu $a1, $s3, $zero
/* 7E1DC 800E4D2C 0240302D */ daddu $a2, $s2, $zero
/* 7E1E0 800E4D30 C6620028 */ lwc1 $f2, 0x28($s3)
/* 7E1E4 800E4D34 C664002C */ lwc1 $f4, 0x2C($s3)
/* 7E1E8 800E4D38 C6660030 */ lwc1 $f6, 0x30($s3)
/* 7E1EC 800E4D3C 0220382D */ daddu $a3, $s1, $zero
/* 7E1F0 800E4D40 E7A20020 */ swc1 $f2, 0x20($sp)
/* 7E1F4 800E4D44 E7A40024 */ swc1 $f4, 0x24($sp)
/* 7E1F8 800E4D48 E7A60028 */ swc1 $f6, 0x28($sp)
/* 7E1FC 800E4D4C AFB00010 */ sw $s0, 0x10($sp)
/* 7E200 800E4D50 AFA00014 */ sw $zero, 0x14($sp)
/* 7E204 800E4D54 0C037B01 */ jal player_test_lateral_overlap
/* 7E208 800E4D58 E7A00018 */ swc1 $f0, 0x18($sp)
/* 7E20C 800E4D5C C66C0080 */ lwc1 $f12, 0x80($s3)
/* 7E210 800E4D60 C7A00020 */ lwc1 $f0, 0x20($sp)
/* 7E214 800E4D64 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 7E218 800E4D68 46006321 */ cvt.d.s $f12, $f12
/* 7E21C 800E4D6C 46346300 */ add.d $f12, $f12, $f20
/* 7E220 800E4D70 E6600028 */ swc1 $f0, 0x28($s3)
/* 7E224 800E4D74 E6620030 */ swc1 $f2, 0x30($s3)
/* 7E228 800E4D78 0C00A6C9 */ jal clamp_angle
/* 7E22C 800E4D7C 46206320 */ cvt.s.d $f12, $f12
/* 7E230 800E4D80 0000202D */ daddu $a0, $zero, $zero
/* 7E234 800E4D84 0260282D */ daddu $a1, $s3, $zero
/* 7E238 800E4D88 0240302D */ daddu $a2, $s2, $zero
/* 7E23C 800E4D8C C6620028 */ lwc1 $f2, 0x28($s3)
/* 7E240 800E4D90 C664002C */ lwc1 $f4, 0x2C($s3)
/* 7E244 800E4D94 C6660030 */ lwc1 $f6, 0x30($s3)
/* 7E248 800E4D98 0220382D */ daddu $a3, $s1, $zero
/* 7E24C 800E4D9C E7A20020 */ swc1 $f2, 0x20($sp)
/* 7E250 800E4DA0 E7A40024 */ swc1 $f4, 0x24($sp)
/* 7E254 800E4DA4 E7A60028 */ swc1 $f6, 0x28($sp)
/* 7E258 800E4DA8 AFB00010 */ sw $s0, 0x10($sp)
/* 7E25C 800E4DAC AFA00014 */ sw $zero, 0x14($sp)
/* 7E260 800E4DB0 0C037B01 */ jal player_test_lateral_overlap
/* 7E264 800E4DB4 E7A00018 */ swc1 $f0, 0x18($sp)
/* 7E268 800E4DB8 C66C0080 */ lwc1 $f12, 0x80($s3)
/* 7E26C 800E4DBC C7A20020 */ lwc1 $f2, 0x20($sp)
/* 7E270 800E4DC0 3C018011 */ lui $at, %hi(D_8010BEF0)
/* 7E274 800E4DC4 D434BEF0 */ ldc1 $f20, %lo(D_8010BEF0)($at)
/* 7E278 800E4DC8 C7A00028 */ lwc1 $f0, 0x28($sp)
/* 7E27C 800E4DCC 46006321 */ cvt.d.s $f12, $f12
/* 7E280 800E4DD0 46346300 */ add.d $f12, $f12, $f20
/* 7E284 800E4DD4 E6620028 */ swc1 $f2, 0x28($s3)
/* 7E288 800E4DD8 E6600030 */ swc1 $f0, 0x30($s3)
/* 7E28C 800E4DDC 0C00A6C9 */ jal clamp_angle
/* 7E290 800E4DE0 46206320 */ cvt.s.d $f12, $f12
/* 7E294 800E4DE4 0000202D */ daddu $a0, $zero, $zero
/* 7E298 800E4DE8 0260282D */ daddu $a1, $s3, $zero
/* 7E29C 800E4DEC 0240302D */ daddu $a2, $s2, $zero
/* 7E2A0 800E4DF0 C6620028 */ lwc1 $f2, 0x28($s3)
/* 7E2A4 800E4DF4 C664002C */ lwc1 $f4, 0x2C($s3)
/* 7E2A8 800E4DF8 C6660030 */ lwc1 $f6, 0x30($s3)
/* 7E2AC 800E4DFC 0220382D */ daddu $a3, $s1, $zero
/* 7E2B0 800E4E00 E7A20020 */ swc1 $f2, 0x20($sp)
/* 7E2B4 800E4E04 E7A40024 */ swc1 $f4, 0x24($sp)
/* 7E2B8 800E4E08 E7A60028 */ swc1 $f6, 0x28($sp)
/* 7E2BC 800E4E0C AFB00010 */ sw $s0, 0x10($sp)
/* 7E2C0 800E4E10 AFA00014 */ sw $zero, 0x14($sp)
/* 7E2C4 800E4E14 0C037B01 */ jal player_test_lateral_overlap
/* 7E2C8 800E4E18 E7A00018 */ swc1 $f0, 0x18($sp)
/* 7E2CC 800E4E1C C66C0080 */ lwc1 $f12, 0x80($s3)
/* 7E2D0 800E4E20 C7A00020 */ lwc1 $f0, 0x20($sp)
/* 7E2D4 800E4E24 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 7E2D8 800E4E28 46006321 */ cvt.d.s $f12, $f12
/* 7E2DC 800E4E2C 46346301 */ sub.d $f12, $f12, $f20
/* 7E2E0 800E4E30 E6600028 */ swc1 $f0, 0x28($s3)
/* 7E2E4 800E4E34 E6620030 */ swc1 $f2, 0x30($s3)
/* 7E2E8 800E4E38 0C00A6C9 */ jal clamp_angle
/* 7E2EC 800E4E3C 46206320 */ cvt.s.d $f12, $f12
/* 7E2F0 800E4E40 0000202D */ daddu $a0, $zero, $zero
/* 7E2F4 800E4E44 0260282D */ daddu $a1, $s3, $zero
/* 7E2F8 800E4E48 0240302D */ daddu $a2, $s2, $zero
/* 7E2FC 800E4E4C C6620028 */ lwc1 $f2, 0x28($s3)
/* 7E300 800E4E50 C664002C */ lwc1 $f4, 0x2C($s3)
/* 7E304 800E4E54 C6660030 */ lwc1 $f6, 0x30($s3)
/* 7E308 800E4E58 0220382D */ daddu $a3, $s1, $zero
/* 7E30C 800E4E5C E7A20020 */ swc1 $f2, 0x20($sp)
/* 7E310 800E4E60 E7A40024 */ swc1 $f4, 0x24($sp)
/* 7E314 800E4E64 E7A60028 */ swc1 $f6, 0x28($sp)
/* 7E318 800E4E68 AFB00010 */ sw $s0, 0x10($sp)
/* 7E31C 800E4E6C AFA00014 */ sw $zero, 0x14($sp)
/* 7E320 800E4E70 0C037B01 */ jal player_test_lateral_overlap
/* 7E324 800E4E74 E7A00018 */ swc1 $f0, 0x18($sp)
/* 7E328 800E4E78 C66C0080 */ lwc1 $f12, 0x80($s3)
/* 7E32C 800E4E7C C7A40020 */ lwc1 $f4, 0x20($sp)
/* 7E330 800E4E80 3C018011 */ lui $at, %hi(D_8010BEF8)
/* 7E334 800E4E84 D420BEF8 */ ldc1 $f0, %lo(D_8010BEF8)($at)
/* 7E338 800E4E88 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 7E33C 800E4E8C 46006321 */ cvt.d.s $f12, $f12
/* 7E340 800E4E90 46206300 */ add.d $f12, $f12, $f0
/* 7E344 800E4E94 E6640028 */ swc1 $f4, 0x28($s3)
/* 7E348 800E4E98 E6620030 */ swc1 $f2, 0x30($s3)
/* 7E34C 800E4E9C 0C00A6C9 */ jal clamp_angle
/* 7E350 800E4EA0 46206320 */ cvt.s.d $f12, $f12
/* 7E354 800E4EA4 0000202D */ daddu $a0, $zero, $zero
/* 7E358 800E4EA8 0260282D */ daddu $a1, $s3, $zero
/* 7E35C 800E4EAC 0240302D */ daddu $a2, $s2, $zero
/* 7E360 800E4EB0 C6620028 */ lwc1 $f2, 0x28($s3)
/* 7E364 800E4EB4 C664002C */ lwc1 $f4, 0x2C($s3)
/* 7E368 800E4EB8 C6660030 */ lwc1 $f6, 0x30($s3)
/* 7E36C 800E4EBC 0220382D */ daddu $a3, $s1, $zero
/* 7E370 800E4EC0 E7A20020 */ swc1 $f2, 0x20($sp)
/* 7E374 800E4EC4 E7A40024 */ swc1 $f4, 0x24($sp)
/* 7E378 800E4EC8 E7A60028 */ swc1 $f6, 0x28($sp)
/* 7E37C 800E4ECC AFB00010 */ sw $s0, 0x10($sp)
/* 7E380 800E4ED0 AFA00014 */ sw $zero, 0x14($sp)
/* 7E384 800E4ED4 0C037B01 */ jal player_test_lateral_overlap
/* 7E388 800E4ED8 E7A00018 */ swc1 $f0, 0x18($sp)
/* 7E38C 800E4EDC C7A00020 */ lwc1 $f0, 0x20($sp)
/* 7E390 800E4EE0 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 7E394 800E4EE4 E6600028 */ swc1 $f0, 0x28($s3)
/* 7E398 800E4EE8 E6620030 */ swc1 $f2, 0x30($s3)
.L800E4EEC:
/* 7E39C 800E4EEC 8FBF0040 */ lw $ra, 0x40($sp)
/* 7E3A0 800E4EF0 8FB3003C */ lw $s3, 0x3C($sp)
/* 7E3A4 800E4EF4 8FB20038 */ lw $s2, 0x38($sp)
/* 7E3A8 800E4EF8 8FB10034 */ lw $s1, 0x34($sp)
/* 7E3AC 800E4EFC 8FB00030 */ lw $s0, 0x30($sp)
/* 7E3B0 800E4F00 D7B60050 */ ldc1 $f22, 0x50($sp)
/* 7E3B4 800E4F04 D7B40048 */ ldc1 $f20, 0x48($sp)
/* 7E3B8 800E4F08 03E00008 */ jr $ra
/* 7E3BC 800E4F0C 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
void collision_lava_reset_check_additional_overlaps(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 x, y, z;
f32 temp_f0;
if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
collision_lateral_peach();
return;
}
temp_f0 = clamp_angle(playerStatus->targetYaw - 30.0);
y = playerStatus->position.y + (playerStatus->colliderHeight * 0.75f);
x = playerStatus->position.x;
z = playerStatus->position.z;
player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0);
playerStatus->position.x = x;
playerStatus->position.z = z;
temp_f0 = clamp_angle(playerStatus->targetYaw + 30.0);
y = playerStatus->position.y + (playerStatus->colliderHeight * 0.75f);
x = playerStatus->position.x;
z = playerStatus->position.z;
player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0);
playerStatus->position.x = x;
playerStatus->position.z = z;
temp_f0 = clamp_angle(playerStatus->targetYaw - 30.0);
x = playerStatus->position.x;
y = playerStatus->position.y;
z = playerStatus->position.z;
player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0);
playerStatus->position.x = x;
playerStatus->position.z = z;
temp_f0 = clamp_angle(playerStatus->targetYaw + 30.0);
x = playerStatus->position.x;
y = playerStatus->position.y;
z = playerStatus->position.z;
player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0);
playerStatus->position.x = x;
playerStatus->position.z = z;
temp_f0 = clamp_angle(playerStatus->targetYaw + 90.0);
x = playerStatus->position.x;
y = playerStatus->position.y;
z = playerStatus->position.z;
player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0);
playerStatus->position.x = x;
playerStatus->position.z = z;
temp_f0 = clamp_angle(playerStatus->targetYaw - 90.0);
x = playerStatus->position.x;
y = playerStatus->position.y;
z = playerStatus->position.z;
player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0);
playerStatus->position.x = x;
playerStatus->position.z = z;
temp_f0 = clamp_angle(playerStatus->targetYaw + 180.0);
x = playerStatus->position.x;
y = playerStatus->position.y;
z = playerStatus->position.z;
player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0);
playerStatus->position.x = x;
playerStatus->position.z = z;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8024C338
/* 13F678 8024C338 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 13F67C 8024C33C AFB10014 */ sw $s1, 0x14($sp)
/* 13F680 8024C340 3C118027 */ lui $s1, %hi(gPausePartnersNumPartners)
/* 13F684 8024C344 263106B0 */ addiu $s1, $s1, %lo(gPausePartnersNumPartners)
/* 13F688 8024C348 AFBF0018 */ sw $ra, 0x18($sp)
/* 13F68C 8024C34C AFB00010 */ sw $s0, 0x10($sp)
/* 13F690 8024C350 8E220000 */ lw $v0, 0x0($s1)
/* 13F694 8024C354 28420002 */ slti $v0, $v0, 0x2
/* 13F698 8024C358 14400047 */ bnez $v0, .L8024C478
/* 13F69C 8024C35C 00000000 */ nop
.L8024C360:
/* 13F6A0 8024C360 3C028027 */ lui $v0, %hi(gPausePartnersLevel)
/* 13F6A4 8024C364 8C4206AC */ lw $v0, %lo(gPausePartnersLevel)($v0)
/* 13F6A8 8024C368 10400006 */ beqz $v0, .L8024C384
/* 13F6AC 8024C36C 00000000 */ nop
/* 13F6B0 8024C370 3C028027 */ lui $v0, %hi(gPauseHeldButtons)
/* 13F6B4 8024C374 8C4200C0 */ lw $v0, %lo(gPauseHeldButtons)($v0)
/* 13F6B8 8024C378 30422010 */ andi $v0, $v0, 0x2010
/* 13F6BC 8024C37C 1040003E */ beqz $v0, .L8024C478
/* 13F6C0 8024C380 00000000 */ nop
.L8024C384:
/* 13F6C4 8024C384 3C038027 */ lui $v1, %hi(gPauseHeldButtons)
/* 13F6C8 8024C388 8C6300C0 */ lw $v1, %lo(gPauseHeldButtons)($v1)
.L8024C38C:
/* 13F6CC 8024C38C 3C020004 */ lui $v0, (0x40000 >> 16)
/* 13F6D0 8024C390 00621024 */ and $v0, $v1, $v0
/* 13F6D4 8024C394 10400002 */ beqz $v0, .L8024C3A0
/* 13F6D8 8024C398 0000802D */ daddu $s0, $zero, $zero
/* 13F6DC 8024C39C 2410FFFF */ addiu $s0, $zero, -0x1
.L8024C3A0:
/* 13F6E0 8024C3A0 3C020008 */ lui $v0, (0x80000 >> 16)
/* 13F6E4 8024C3A4 00621024 */ and $v0, $v1, $v0
/* 13F6E8 8024C3A8 54400001 */ bnel $v0, $zero, .L8024C3B0
/* 13F6EC 8024C3AC 26100001 */ addiu $s0, $s0, 0x1
.L8024C3B0:
/* 13F6F0 8024C3B0 30622000 */ andi $v0, $v1, 0x2000
/* 13F6F4 8024C3B4 54400001 */ bnel $v0, $zero, .L8024C3BC
/* 13F6F8 8024C3B8 2610FFFF */ addiu $s0, $s0, -0x1
.L8024C3BC:
/* 13F6FC 8024C3BC 30620010 */ andi $v0, $v1, 0x10
/* 13F700 8024C3C0 54400001 */ bnel $v0, $zero, .L8024C3C8
/* 13F704 8024C3C4 26100001 */ addiu $s0, $s0, 0x1
.L8024C3C8:
/* 13F708 8024C3C8 1200002B */ beqz $s0, .L8024C478
/* 13F70C 8024C3CC 00000000 */ nop
D_8024C3D0_C09C50:
/* 13F710 8024C3D0 0C05272D */ jal sfx_play_sound
/* 13F714 8024C3D4 240400C7 */ addiu $a0, $zero, 0xC7
/* 13F718 8024C3D8 3C048027 */ lui $a0, %hi(gPausePartnersCurrentPartnerIdx)
/* 13F71C 8024C3DC 248406A0 */ addiu $a0, $a0, %lo(gPausePartnersCurrentPartnerIdx)
/* 13F720 8024C3E0 8C820000 */ lw $v0, 0x0($a0)
/* 13F724 8024C3E4 00501821 */ addu $v1, $v0, $s0
/* 13F728 8024C3E8 0461000F */ bgez $v1, .L8024C428
/* 13F72C 8024C3EC AC830000 */ sw $v1, 0x0($a0)
/* 13F730 8024C3F0 3C038027 */ lui $v1, %hi(gPausePartnersRotAngle)
/* 13F734 8024C3F4 246306A8 */ addiu $v1, $v1, %lo(gPausePartnersRotAngle)
/* 13F738 8024C3F8 C4600000 */ lwc1 $f0, 0x0($v1)
/* 13F73C 8024C3FC 8E220000 */ lw $v0, 0x0($s1)
/* 13F740 8024C400 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 13F744 8024C404 44811000 */ mtc1 $at, $f2
/* 13F748 8024C408 2442FFFF */ addiu $v0, $v0, -0x1
/* 13F74C 8024C40C 4602003C */ c.lt.s $f0, $f2
/* 13F750 8024C410 00000000 */ nop
/* 13F754 8024C414 45000016 */ bc1f .L8024C470
/* 13F758 8024C418 AC820000 */ sw $v0, 0x0($a0)
D_8024C41C:
/* 13F75C 8024C41C 46020000 */ add.s $f0, $f0, $f2
D_8024C420_C09CA0:
/* 13F760 8024C420 0809311C */ j .L8024C470
/* 13F764 8024C424 E4600000 */ swc1 $f0, 0x0($v1)
.L8024C428:
/* 13F768 8024C428 8E220000 */ lw $v0, 0x0($s1)
/* 13F76C 8024C42C 0062102A */ slt $v0, $v1, $v0
/* 13F770 8024C430 1440000F */ bnez $v0, .L8024C470
/* 13F774 8024C434 00000000 */ nop
/* 13F778 8024C438 3C028027 */ lui $v0, %hi(gPausePartnersRotAngle)
/* 13F77C 8024C43C 244206A8 */ addiu $v0, $v0, %lo(gPausePartnersRotAngle)
/* 13F780 8024C440 C4420000 */ lwc1 $f2, 0x0($v0)
/* 13F784 8024C444 44800000 */ mtc1 $zero, $f0
/* 13F788 8024C448 00000000 */ nop
/* 13F78C 8024C44C 4602003C */ c.lt.s $f0, $f2
D_8024C450:
/* 13F790 8024C450 00000000 */ nop
/* 13F794 8024C454 45000006 */ bc1f .L8024C470
/* 13F798 8024C458 AC800000 */ sw $zero, 0x0($a0)
/* 13F79C 8024C45C 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 13F7A0 8024C460 44810000 */ mtc1 $at, $f0
/* 13F7A4 8024C464 00000000 */ nop
/* 13F7A8 8024C468 46001001 */ sub.s $f0, $f2, $f0
/* 13F7AC 8024C46C E4400000 */ swc1 $f0, 0x0($v0)
.L8024C470:
/* 13F7B0 8024C470 3C018027 */ lui $at, %hi(gPausePartnersSelectedMove)
/* 13F7B4 8024C474 AC2006A4 */ sw $zero, %lo(gPausePartnersSelectedMove)($at)
.L8024C478:
/* 13F7B8 8024C478 0C039D59 */ jal get_player_data
/* 13F7BC 8024C47C 00000000 */ nop
/* 13F7C0 8024C480 3C038027 */ lui $v1, %hi(gPausePartnersCurrentPartnerIdx)
/* 13F7C4 8024C484 8C6306A0 */ lw $v1, %lo(gPausePartnersCurrentPartnerIdx)($v1)
/* 13F7C8 8024C488 00031880 */ sll $v1, $v1, 2
/* 13F7CC 8024C48C 3C018027 */ lui $at, %hi(gPausePartnersPartnerIdx)
/* 13F7D0 8024C490 00230821 */ addu $at, $at, $v1
/* 13F7D4 8024C494 8C230680 */ lw $v1, %lo(gPausePartnersPartnerIdx)($at)
/* 13F7D8 8024C498 00031880 */ sll $v1, $v1, 2
/* 13F7DC 8024C49C 3C018025 */ lui $at, %hi(D_8024F6B0)
/* 13F7E0 8024C4A0 00230821 */ addu $at, $at, $v1
/* 13F7E4 8024C4A4 8C23F6B0 */ lw $v1, %lo(D_8024F6B0)($at)
/* 13F7E8 8024C4A8 000318C0 */ sll $v1, $v1, 3
/* 13F7EC 8024C4AC 00431021 */ addu $v0, $v0, $v1
/* 13F7F0 8024C4B0 80430015 */ lb $v1, 0x15($v0)
/* 13F7F4 8024C4B4 24020002 */ addiu $v0, $zero, 0x2
/* 13F7F8 8024C4B8 14620003 */ bne $v1, $v0, D_8024C4C8
/* 13F7FC 8024C4BC 24020001 */ addiu $v0, $zero, 0x1
D_8024C4C0_C09D40:
/* 13F800 8024C4C0 08093138 */ j .L8024C4E0
/* 13F804 8024C4C4 24030004 */ addiu $v1, $zero, 0x4
D_8024C4C8:
/* 13F808 8024C4C8 14620003 */ bne $v1, $v0, .L8024C4D8
/* 13F80C 8024C4CC 00000000 */ nop
/* 13F810 8024C4D0 08093138 */ j .L8024C4E0
/* 13F814 8024C4D4 24030003 */ addiu $v1, $zero, 0x3
.L8024C4D8:
/* 13F818 8024C4D8 50600001 */ beql $v1, $zero, .L8024C4E0
/* 13F81C 8024C4DC 24030002 */ addiu $v1, $zero, 0x2
.L8024C4E0:
/* 13F820 8024C4E0 00031040 */ sll $v0, $v1, 1
/* 13F824 8024C4E4 00431021 */ addu $v0, $v0, $v1
/* 13F828 8024C4E8 00021080 */ sll $v0, $v0, 2
D_8024C4EC:
/* 13F82C 8024C4EC 00431021 */ addu $v0, $v0, $v1
/* 13F830 8024C4F0 3C108027 */ lui $s0, %hi(gPausePartnersLevel)
/* 13F834 8024C4F4 8E1006AC */ lw $s0, %lo(gPausePartnersLevel)($s0)
/* 13F838 8024C4F8 2442001E */ addiu $v0, $v0, 0x1E
/* 13F83C 8024C4FC 3C018016 */ lui $at, %hi(D_8015A1E2)
/* 13F840 8024C500 A422A1E2 */ sh $v0, %lo(D_8015A1E2)($at)
/* 13F844 8024C504 24020001 */ addiu $v0, $zero, 0x1
/* 13F848 8024C508 16020043 */ bne $s0, $v0, .L8024C618
/* 13F84C 8024C50C 00000000 */ nop
/* 13F850 8024C510 3C118027 */ lui $s1, %hi(gPausePartnersSelectedMove)
/* 13F854 8024C514 8E3106A4 */ lw $s1, %lo(gPausePartnersSelectedMove)($s1)
/* 13F858 8024C518 0C039D59 */ jal get_player_data
/* 13F85C 8024C51C 00000000 */ nop
/* 13F860 8024C520 3C038027 */ lui $v1, %hi(gPausePartnersCurrentPartnerIdx)
/* 13F864 8024C524 8C6306A0 */ lw $v1, %lo(gPausePartnersCurrentPartnerIdx)($v1)
/* 13F868 8024C528 00031880 */ sll $v1, $v1, 2
/* 13F86C 8024C52C 3C018027 */ lui $at, %hi(gPausePartnersPartnerIdx)
/* 13F870 8024C530 00230821 */ addu $at, $at, $v1
/* 13F874 8024C534 8C230680 */ lw $v1, %lo(gPausePartnersPartnerIdx)($at)
/* 13F878 8024C538 00031880 */ sll $v1, $v1, 2
/* 13F87C 8024C53C 3C018025 */ lui $at, %hi(D_8024F6B0)
.L8024C540:
/* 13F880 8024C540 00230821 */ addu $at, $at, $v1
.L8024C544:
/* 13F884 8024C544 8C23F6B0 */ lw $v1, %lo(D_8024F6B0)($at)
/* 13F888 8024C548 000318C0 */ sll $v1, $v1, 3
/* 13F88C 8024C54C 00431021 */ addu $v0, $v0, $v1
/* 13F890 8024C550 80440015 */ lb $a0, 0x15($v0)
D_8024C554:
/* 13F894 8024C554 24020002 */ addiu $v0, $zero, 0x2
/* 13F898 8024C558 14820003 */ bne $a0, $v0, .L8024C568
/* 13F89C 8024C55C 00000000 */ nop
D_8024C560_C09DE0:
/* 13F8A0 8024C560 08093160 */ j D_8024C580
/* 13F8A4 8024C564 24040004 */ addiu $a0, $zero, 0x4
.L8024C568:
/* 13F8A8 8024C568 14900003 */ bne $a0, $s0, .L8024C578
/* 13F8AC 8024C56C 00000000 */ nop
glabel func_8024C570
/* 13F8B0 8024C570 08093160 */ j D_8024C580
D_8024C574:
/* 13F8B4 8024C574 24040003 */ addiu $a0, $zero, 0x3
.L8024C578:
/* 13F8B8 8024C578 50800001 */ beql $a0, $zero, D_8024C580
/* 13F8BC 8024C57C 24040002 */ addiu $a0, $zero, 0x2
D_8024C580:
/* 13F8C0 8024C580 3C058027 */ lui $a1, %hi(gPauseHeldButtons)
/* 13F8C4 8024C584 24A500C0 */ addiu $a1, $a1, %lo(gPauseHeldButtons)
/* 13F8C8 8024C588 8CA20000 */ lw $v0, 0x0($a1)
/* 13F8CC 8024C58C 3C030001 */ lui $v1, (0x10000 >> 16)
/* 13F8D0 8024C590 00431024 */ and $v0, $v0, $v1
/* 13F8D4 8024C594 10400006 */ beqz $v0, .L8024C5B0
/* 13F8D8 8024C598 00000000 */ nop
/* 13F8DC 8024C59C 3C038027 */ lui $v1, %hi(gPausePartnersSelectedMove)
/* 13F8E0 8024C5A0 246306A4 */ addiu $v1, $v1, %lo(gPausePartnersSelectedMove)
/* 13F8E4 8024C5A4 8C620000 */ lw $v0, 0x0($v1)
/* 13F8E8 8024C5A8 2442FFFF */ addiu $v0, $v0, -0x1
/* 13F8EC 8024C5AC AC620000 */ sw $v0, 0x0($v1)
.L8024C5B0:
/* 13F8F0 8024C5B0 8CA20000 */ lw $v0, 0x0($a1)
/* 13F8F4 8024C5B4 3C030002 */ lui $v1, (0x20000 >> 16)
/* 13F8F8 8024C5B8 00431024 */ and $v0, $v0, $v1
/* 13F8FC 8024C5BC 10400006 */ beqz $v0, .L8024C5D8
/* 13F900 8024C5C0 00000000 */ nop
/* 13F904 8024C5C4 3C038027 */ lui $v1, %hi(gPausePartnersSelectedMove)
/* 13F908 8024C5C8 246306A4 */ addiu $v1, $v1, %lo(gPausePartnersSelectedMove)
/* 13F90C 8024C5CC 8C620000 */ lw $v0, 0x0($v1)
/* 13F910 8024C5D0 24420001 */ addiu $v0, $v0, 0x1
.L8024C5D4:
/* 13F914 8024C5D4 AC620000 */ sw $v0, 0x0($v1)
.L8024C5D8:
/* 13F918 8024C5D8 3C038027 */ lui $v1, %hi(gPausePartnersSelectedMove)
/* 13F91C 8024C5DC 246306A4 */ addiu $v1, $v1, %lo(gPausePartnersSelectedMove)
### DECOMPILED C INSTRUCTIONS:
void pause_partners_handle_input(MenuPanel* panel) {
s32 delta;
s32 level, level2;
s32 partnerID;
s32 oldPos;
if (gPausePartnersNumPartners >= 2 && (gPausePartnersLevel == 0 || (gPauseHeldButtons & (BUTTON_Z | BUTTON_R)))) {
delta = 0;
if (gPauseHeldButtons & BUTTON_STICK_LEFT) {
delta = -1;
}
if (gPauseHeldButtons & BUTTON_STICK_RIGHT) {
delta++;
}
if (gPauseHeldButtons & BUTTON_Z) {
delta--;
}
if (gPauseHeldButtons & BUTTON_R) {
delta++;
}
if (delta) {
sfx_play_sound(SOUND_MENU_CHANGE_SELECTION);
gPausePartnersCurrentPartnerIdx += delta;
if (gPausePartnersCurrentPartnerIdx < 0) {
gPausePartnersCurrentPartnerIdx = gPausePartnersNumPartners - 1;
if (gPausePartnersRotAngle < 360.0f) {
gPausePartnersRotAngle += 360.0f;
}
} else if (gPausePartnersCurrentPartnerIdx >= gPausePartnersNumPartners) {
gPausePartnersCurrentPartnerIdx = 0;
if (gPausePartnersRotAngle > 0.0f) {
gPausePartnersRotAngle -= 360.0f;
}
}
gPausePartnersSelectedMove = 0;
}
}
level = get_player_data()->partners[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].level;
if (level == 2) {
level = 4;
} else if (level == 1) {
level = 3;
} else if (level == 0) {
level = 2;
}
gWindows[WINDOW_ID_PAUSE_PARTNERS_MOVELIST].height = level * 13 + 30;
if (gPausePartnersLevel == 1) {
oldPos = gPausePartnersSelectedMove;
level2 = get_player_data()->partners[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].level;
if (level2 == 2) {
level2 = 4;
} else if (level2 == 1) {
level2 = 3;
} else if (level2 == 0) {
level2 = 2;
}
if (gPauseHeldButtons & BUTTON_STICK_UP) {
gPausePartnersSelectedMove--;
}
if (gPauseHeldButtons & BUTTON_STICK_DOWN) {
gPausePartnersSelectedMove++;
}
if (gPausePartnersSelectedMove < 0) {
gPausePartnersSelectedMove = level2 - 1;
} else if (gPausePartnersSelectedMove >= level2) {
gPausePartnersSelectedMove = 0;
}
if (gPausePartnersSelectedMove != oldPos) {
sfx_play_sound(SOUND_MENU_CHANGE_SELECTION);
}
}
if ((gPausePressedButtons & BUTTON_A) && gPausePartnersLevel == 0) {
gPausePartnersLevel = 1;
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_PAUSE_PARTNERS_MOVELIST, WINDOW_UPDATE_SHOW);
return;
}
if (gPausePressedButtons & BUTTON_B) {
if (gPausePartnersLevel == 0) {
gPauseMenuCurrentTab = 0;
sfx_play_sound(SOUND_MENU_BACK);
return;
} else {
gPausePartnersLevel = 0;
sfx_play_sound(SOUND_MENU_BACK);
set_window_update(WINDOW_ID_PAUSE_PARTNERS_MOVELIST, WINDOW_UPDATE_HIDE);
return;
}
}
gPauseCurrentDescIconScript = 0;
if (gPausePartnersLevel == 0) {
gPauseCurrentDescMsg = gPausePartnersMessages[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]];
} else if (gPausePartnersSelectedMove == 0) {
gPauseCurrentDescMsg = gMoveTable[gPausePartnersMoveBase[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].fullDescMsg;
} else {
gPauseCurrentDescMsg = gMoveTable[gPausePartnersMoveBase[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]] + 2 + gPausePartnersSelectedMove].fullDescMsg;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel star_outline_update
/* 413494 E0126134 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 413498 E0126138 AFBF001C */ sw $ra, 0x1C($sp)
/* 41349C E012613C AFB20018 */ sw $s2, 0x18($sp)
/* 4134A0 E0126140 AFB10014 */ sw $s1, 0x14($sp)
/* 4134A4 E0126144 AFB00010 */ sw $s0, 0x10($sp)
/* 4134A8 E0126148 F7B80030 */ sdc1 $f24, 0x30($sp)
/* 4134AC E012614C F7B60028 */ sdc1 $f22, 0x28($sp)
/* 4134B0 E0126150 F7B40020 */ sdc1 $f20, 0x20($sp)
/* 4134B4 E0126154 8C830000 */ lw $v1, 0x0($a0)
/* 4134B8 E0126158 8C90000C */ lw $s0, 0xC($a0)
/* 4134BC E012615C 30620010 */ andi $v0, $v1, 0x10
/* 4134C0 E0126160 86060002 */ lh $a2, 0x2($s0)
/* 4134C4 E0126164 10400005 */ beqz $v0, .LE012617C
/* 4134C8 E0126168 2402FFEF */ addiu $v0, $zero, -0x11
/* 4134CC E012616C 00621024 */ and $v0, $v1, $v0
/* 4134D0 E0126170 AC820000 */ sw $v0, 0x0($a0)
/* 4134D4 E0126174 24020010 */ addiu $v0, $zero, 0x10
/* 4134D8 E0126178 AE020010 */ sw $v0, 0x10($s0)
.LE012617C:
/* 4134DC E012617C 8E030010 */ lw $v1, 0x10($s0)
/* 4134E0 E0126180 286203E8 */ slti $v0, $v1, 0x3E8
/* 4134E4 E0126184 10400002 */ beqz $v0, .LE0126190
/* 4134E8 E0126188 2462FFFF */ addiu $v0, $v1, -0x1
/* 4134EC E012618C AE020010 */ sw $v0, 0x10($s0)
.LE0126190:
/* 4134F0 E0126190 8E020014 */ lw $v0, 0x14($s0)
/* 4134F4 E0126194 8E050010 */ lw $a1, 0x10($s0)
/* 4134F8 E0126198 24420001 */ addiu $v0, $v0, 0x1
/* 4134FC E012619C 04A10005 */ bgez $a1, .LE01261B4
/* 413500 E01261A0 AE020014 */ sw $v0, 0x14($s0)
/* 413504 E01261A4 0C080128 */ jal shim_remove_effect
/* 413508 E01261A8 00000000 */ nop
/* 41350C E01261AC 08049920 */ j .LE0126480
/* 413510 E01261B0 00000000 */ nop
.LE01261B4:
/* 413514 E01261B4 0040882D */ daddu $s1, $v0, $zero
/* 413518 E01261B8 28A20010 */ slti $v0, $a1, 0x10
/* 41351C E01261BC 1040000B */ beqz $v0, .LE01261EC
/* 413520 E01261C0 2A220010 */ slti $v0, $s1, 0x10
/* 413524 E01261C4 8E020024 */ lw $v0, 0x24($s0)
/* 413528 E01261C8 00051900 */ sll $v1, $a1, 4
/* 41352C E01261CC 0062102A */ slt $v0, $v1, $v0
/* 413530 E01261D0 54400001 */ bnel $v0, $zero, .LE01261D8
/* 413534 E01261D4 AE030024 */ sw $v1, 0x24($s0)
.LE01261D8:
/* 413538 E01261D8 8E020034 */ lw $v0, 0x34($s0)
/* 41353C E01261DC 0062102A */ slt $v0, $v1, $v0
/* 413540 E01261E0 54400001 */ bnel $v0, $zero, .LE01261E8
/* 413544 E01261E4 AE030034 */ sw $v1, 0x34($s0)
.LE01261E8:
/* 413548 E01261E8 2A220010 */ slti $v0, $s1, 0x10
.LE01261EC:
/* 41354C E01261EC 1040000B */ beqz $v0, .LE012621C
/* 413550 E01261F0 00000000 */ nop
/* 413554 E01261F4 00111900 */ sll $v1, $s1, 4
/* 413558 E01261F8 8E020024 */ lw $v0, 0x24($s0)
/* 41355C E01261FC 2463000F */ addiu $v1, $v1, 0xF
/* 413560 E0126200 0043102A */ slt $v0, $v0, $v1
/* 413564 E0126204 54400001 */ bnel $v0, $zero, .LE012620C
/* 413568 E0126208 AE030024 */ sw $v1, 0x24($s0)
.LE012620C:
/* 41356C E012620C 8E020034 */ lw $v0, 0x34($s0)
/* 413570 E0126210 0043102A */ slt $v0, $v0, $v1
/* 413574 E0126214 54400001 */ bnel $v0, $zero, .LE012621C
/* 413578 E0126218 AE030034 */ sw $v1, 0x34($s0)
.LE012621C:
/* 41357C E012621C C600003C */ lwc1 $f0, 0x3C($s0)
/* 413580 E0126220 C6020040 */ lwc1 $f2, 0x40($s0)
/* 413584 E0126224 C6040044 */ lwc1 $f4, 0x44($s0)
/* 413588 E0126228 C6060038 */ lwc1 $f6, 0x38($s0)
/* 41358C E012622C 24120001 */ addiu $s2, $zero, 0x1
/* 413590 E0126230 E6000048 */ swc1 $f0, 0x48($s0)
/* 413594 E0126234 E602004C */ swc1 $f2, 0x4C($s0)
/* 413598 E0126238 E6040050 */ swc1 $f4, 0x50($s0)
/* 41359C E012623C 14D20086 */ bne $a2, $s2, .LE0126458
/* 4135A0 E0126240 E6060054 */ swc1 $f6, 0x54($s0)
/* 4135A4 E0126244 3C014080 */ lui $at, (0x40800000 >> 16)
/* 4135A8 E0126248 44810000 */ mtc1 $at, $f0
/* 4135AC E012624C 4491A000 */ mtc1 $s1, $f20
/* 4135B0 E0126250 00000000 */ nop
/* 4135B4 E0126254 4680A520 */ cvt.s.w $f20, $f20
/* 4135B8 E0126258 4600A002 */ mul.s $f0, $f20, $f0
/* 4135BC E012625C 00000000 */ nop
/* 4135C0 E0126260 3C01E012 */ lui $at, (0xE0126BD0 >> 16)
/* 4135C4 E0126264 D42C6BD0 */ ldc1 $f12, (0xE0126BD0 & 0xFFFF)($at)
/* 4135C8 E0126268 4600A521 */ cvt.d.s $f20, $f20
/* 4135CC E012626C 462CA302 */ mul.d $f12, $f20, $f12
/* 4135D0 E0126270 00000000 */ nop
/* 4135D4 E0126274 3C01E012 */ lui $at, (0xE0126BD8 >> 16)
/* 4135D8 E0126278 D4246BD8 */ ldc1 $f4, (0xE0126BD8 & 0xFFFF)($at)
/* 4135DC E012627C 46000021 */ cvt.d.s $f0, $f0
/* 4135E0 E0126280 46240102 */ mul.d $f4, $f0, $f4
/* 4135E4 E0126284 00000000 */ nop
/* 4135E8 E0126288 3C01E012 */ lui $at, (0xE0126BE0 >> 16)
/* 4135EC E012628C D4226BE0 */ ldc1 $f2, (0xE0126BE0 & 0xFFFF)($at)
/* 4135F0 E0126290 46220002 */ mul.d $f0, $f0, $f2
/* 4135F4 E0126294 00000000 */ nop
/* 4135F8 E0126298 00111080 */ sll $v0, $s1, 2
/* 4135FC E012629C 44821000 */ mtc1 $v0, $f2
/* 413600 E01262A0 00000000 */ nop
/* 413604 E01262A4 468010A0 */ cvt.s.w $f2, $f2
/* 413608 E01262A8 240200FF */ addiu $v0, $zero, 0xFF
/* 41360C E01262AC E602003C */ swc1 $f2, 0x3C($s0)
/* 413610 E01262B0 AE020024 */ sw $v0, 0x24($s0)
/* 413614 E01262B4 46206320 */ cvt.s.d $f12, $f12
/* 413618 E01262B8 46202120 */ cvt.s.d $f4, $f4
/* 41361C E01262BC 46200020 */ cvt.s.d $f0, $f0
/* 413620 E01262C0 E6040040 */ swc1 $f4, 0x40($s0)
/* 413624 E01262C4 0C080140 */ jal shim_sin_deg
/* 413628 E01262C8 E6000044 */ swc1 $f0, 0x44($s0)
/* 41362C E01262CC 3C01E012 */ lui $at, (0xE0126BE8 >> 16)
/* 413630 E01262D0 D42C6BE8 */ ldc1 $f12, (0xE0126BE8 & 0xFFFF)($at)
/* 413634 E01262D4 462CA302 */ mul.d $f12, $f20, $f12
/* 413638 E01262D8 00000000 */ nop
/* 41363C E01262DC 3C0142FE */ lui $at, (0x42FE0000 >> 16)
/* 413640 E01262E0 4481C000 */ mtc1 $at, $f24
/* 413644 E01262E4 00000000 */ nop
/* 413648 E01262E8 46180002 */ mul.s $f0, $f0, $f24
/* 41364C E01262EC 00000000 */ nop
/* 413650 E01262F0 3C014300 */ lui $at, (0x43000000 >> 16)
/* 413654 E01262F4 44811000 */ mtc1 $at, $f2
/* 413658 E01262F8 00000000 */ nop
/* 41365C E01262FC 46020000 */ add.s $f0, $f0, $f2
/* 413660 E0126300 4600020D */ trunc.w.s $f8, $f0
/* 413664 E0126304 E6080034 */ swc1 $f8, 0x34($s0)
/* 413668 E0126308 0C080140 */ jal shim_sin_deg
/* 41366C E012630C 46206320 */ cvt.s.d $f12, $f12
/* 413670 E0126310 3C01E012 */ lui $at, (0xE0126BF0 >> 16)
/* 413674 E0126314 D42C6BF0 */ ldc1 $f12, (0xE0126BF0 & 0xFFFF)($at)
/* 413678 E0126318 462CA302 */ mul.d $f12, $f20, $f12
/* 41367C E012631C 00000000 */ nop
/* 413680 E0126320 46180002 */ mul.s $f0, $f0, $f24
/* 413684 E0126324 00000000 */ nop
/* 413688 E0126328 3C014357 */ lui $at, (0x43570000 >> 16)
/* 41368C E012632C 4481B000 */ mtc1 $at, $f22
/* 413690 E0126330 00000000 */ nop
/* 413694 E0126334 46160000 */ add.s $f0, $f0, $f22
/* 413698 E0126338 4600020D */ trunc.w.s $f8, $f0
/* 41369C E012633C E6080018 */ swc1 $f8, 0x18($s0)
/* 4136A0 E0126340 0C080140 */ jal shim_sin_deg
/* 4136A4 E0126344 46206320 */ cvt.s.d $f12, $f12
/* 4136A8 E0126348 3C01E012 */ lui $at, (0xE0126BF8 >> 16)
/* 4136AC E012634C D42C6BF8 */ ldc1 $f12, (0xE0126BF8 & 0xFFFF)($at)
/* 4136B0 E0126350 462CA302 */ mul.d $f12, $f20, $f12
/* 4136B4 E0126354 00000000 */ nop
/* 4136B8 E0126358 46180002 */ mul.s $f0, $f0, $f24
/* 4136BC E012635C 00000000 */ nop
/* 4136C0 E0126360 46160000 */ add.s $f0, $f0, $f22
/* 4136C4 E0126364 4600020D */ trunc.w.s $f8, $f0
/* 4136C8 E0126368 E608001C */ swc1 $f8, 0x1C($s0)
/* 4136CC E012636C 0C080140 */ jal shim_sin_deg
/* 4136D0 E0126370 46206320 */ cvt.s.d $f12, $f12
/* 4136D4 E0126374 3C01E012 */ lui $at, (0xE0126C00 >> 16)
/* 4136D8 E0126378 D42C6C00 */ ldc1 $f12, (0xE0126C00 & 0xFFFF)($at)
/* 4136DC E012637C 462CA302 */ mul.d $f12, $f20, $f12
/* 4136E0 E0126380 00000000 */ nop
/* 4136E4 E0126384 46180002 */ mul.s $f0, $f0, $f24
/* 4136E8 E0126388 00000000 */ nop
/* 4136EC E012638C 46160000 */ add.s $f0, $f0, $f22
/* 4136F0 E0126390 4600020D */ trunc.w.s $f8, $f0
/* 4136F4 E0126394 E6080020 */ swc1 $f8, 0x20($s0)
/* 4136F8 E0126398 0C080140 */ jal shim_sin_deg
/* 4136FC E012639C 46206320 */ cvt.s.d $f12, $f12
/* 413700 E01263A0 3C01E012 */ lui $at, (0xE0126C08 >> 16)
/* 413704 E01263A4 D42C6C08 */ ldc1 $f12, (0xE0126C08 & 0xFFFF)($at)
/* 413708 E01263A8 462CA302 */ mul.d $f12, $f20, $f12
/* 41370C E01263AC 00000000 */ nop
/* 413710 E01263B0 46180002 */ mul.s $f0, $f0, $f24
/* 413714 E01263B4 00000000 */ nop
/* 413718 E01263B8 3C01433C */ lui $at, (0x433C0000 >> 16)
/* 41371C E01263BC 4481B000 */ mtc1 $at, $f22
/* 413720 E01263C0 00000000 */ nop
/* 413724 E01263C4 46160000 */ add.s $f0, $f0, $f22
/* 413728 E01263C8 4600020D */ trunc.w.s $f8, $f0
/* 41372C E01263CC E6080028 */ swc1 $f8, 0x28($s0)
/* 413730 E01263D0 0C080140 */ jal shim_sin_deg
/* 413734 E01263D4 46206320 */ cvt.s.d $f12, $f12
/* 413738 E01263D8 3C01E012 */ lui $at, (0xE0126C10 >> 16)
/* 41373C E01263DC D42C6C10 */ ldc1 $f12, (0xE0126C10 & 0xFFFF)($at)
/* 413740 E01263E0 462CA302 */ mul.d $f12, $f20, $f12
/* 413744 E01263E4 00000000 */ nop
/* 413748 E01263E8 46180002 */ mul.s $f0, $f0, $f24
/* 41374C E01263EC 00000000 */ nop
/* 413750 E01263F0 46160000 */ add.s $f0, $f0, $f22
/* 413754 E01263F4 4600020D */ trunc.w.s $f8, $f0
/* 413758 E01263F8 E608002C */ swc1 $f8, 0x2C($s0)
/* 41375C E01263FC 0C080140 */ jal shim_sin_deg
/* 413760 E0126400 46206320 */ cvt.s.d $f12, $f12
/* 413764 E0126404 3C01E012 */ lui $at, (0xE0126C18 >> 16)
/* 413768 E0126408 D4226C18 */ ldc1 $f2, (0xE0126C18 & 0xFFFF)($at)
/* 41376C E012640C 4622A502 */ mul.d $f20, $f20, $f2
/* 413770 E0126410 00000000 */ nop
/* 413774 E0126414 46180002 */ mul.s $f0, $f0, $f24
/* 413778 E0126418 00000000 */ nop
/* 41377C E012641C 46160000 */ add.s $f0, $f0, $f22
/* 413780 E0126420 4600020D */ trunc.w.s $f8, $f0
/* 413784 E0126424 E6080030 */ swc1 $f8, 0x30($s0)
/* 413788 E0126428 0C080140 */ jal shim_sin_deg
/* 41378C E012642C 4620A320 */ cvt.s.d $f12, $f20
/* 413790 E0126430 3C01E012 */ lui $at, (0xE0126C20 >> 16)
/* 413794 E0126434 D4226C20 */ ldc1 $f2, (0xE0126C20 & 0xFFFF)($at)
/* 413798 E0126438 46000021 */ cvt.d.s $f0, $f0
/* 41379C E012643C 46220002 */ mul.d $f0, $f0, $f2
/* 4137A0 E0126440 00000000 */ nop
/* 4137A4 E0126444 3C01E012 */ lui $at, (0xE0126C28 >> 16)
/* 4137A8 E0126448 D4226C28 */ ldc1 $f2, (0xE0126C28 & 0xFFFF)($at)
/* 4137AC E012644C 46220000 */ add.d $f0, $f0, $f2
/* 4137B0 E0126450 46200020 */ cvt.s.d $f0, $f0
/* 4137B4 E0126454 E6000038 */ swc1 $f0, 0x38($s0)
.LE0126458:
/* 4137B8 E0126458 16320009 */ bne $s1, $s2, .LE0126480
/* 4137BC E012645C 00000000 */ nop
/* 4137C0 E0126460 C600003C */ lwc1 $f0, 0x3C($s0)
/* 4137C4 E0126464 C6020040 */ lwc1 $f2, 0x40($s0)
/* 4137C8 E0126468 C6040044 */ lwc1 $f4, 0x44($s0)
/* 4137CC E012646C C6060038 */ lwc1 $f6, 0x38($s0)
/* 4137D0 E0126470 E6000048 */ swc1 $f0, 0x48($s0)
/* 4137D4 E0126474 E602004C */ swc1 $f2, 0x4C($s0)
/* 4137D8 E0126478 E6040050 */ swc1 $f4, 0x50($s0)
/* 4137DC E012647C E6060054 */ swc1 $f6, 0x54($s0)
.LE0126480:
/* 4137E0 E0126480 8FBF001C */ lw $ra, 0x1C($sp)
/* 4137E4 E0126484 8FB20018 */ lw $s2, 0x18($sp)
/* 4137E8 E0126488 8FB10014 */ lw $s1, 0x14($sp)
/* 4137EC E012648C 8FB00010 */ lw $s0, 0x10($sp)
/* 4137F0 E0126490 D7B80030 */ ldc1 $f24, 0x30($sp)
/* 4137F4 E0126494 D7B60028 */ ldc1 $f22, 0x28($sp)
/* 4137F8 E0126498 D7B40020 */ ldc1 $f20, 0x20($sp)
/* 4137FC E012649C 03E00008 */ jr $ra
/* 413800 E01264A0 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void star_outline_update(EffectInstance* effect) {
StarOutlineFXData* data = effect->data.starOutline;
s32 temp_a2 = data->unk_02;
s32 lifeTime;
s32 temp;
s32 temp2;
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) {
temp = data->timeLeft * 16;
if (data->unk_24 > temp) {
data->unk_24 = temp;
}
if (data->unk_34 > temp) {
data->unk_34 = temp;
}
}
if (lifeTime < 16) {
temp2 = (lifeTime * 16) + 15;
if (data->unk_24 < temp2) {
data->unk_24 = temp2;
}
if (data->unk_34 < temp2) {
data->unk_34 = temp2;
}
}
data->unk_48 = data->unk_3C.x;
data->unk_4C = data->unk_3C.y;
data->unk_50 = data->unk_3C.z;
data->unk_54 = data->unk_38;
if (temp_a2 == 1) {
f32 lifetimeF = lifeTime;
data->unk_3C.x = lifeTime * 4;
data->unk_24 = 255;
data->unk_3C.y = (lifeTime * 4.0f * 0.4953);
data->unk_3C.z = (lifeTime * 4.0f * 0.2234);
data->unk_34 = ((shim_sin_deg (lifetimeF * 7.12343)) * 127.0f) + 128.0f;
data->unk_18 = ((shim_sin_deg (lifetimeF * 1.231)) * 127.0f) + 215.0f;
data->unk_1C = ((shim_sin_deg (lifetimeF * 0.531)) * 127.0f) + 215.0f;
data->unk_20 = ((shim_sin_deg (lifetimeF * 3.231)) * 127.0f) + 215.0f;
data->unk_28 = ((shim_sin_deg (lifetimeF * 0.298)) * 127.0f) + 188.0f;
data->unk_2C = ((shim_sin_deg (lifetimeF * 0.831)) * 127.0f) + 188.0f;
data->unk_30 = ((shim_sin_deg (lifetimeF * 2.231)) * 127.0f) + 188.0f;
data->unk_38 = ((shim_sin_deg (lifetimeF * 2.044)) * 0.3) + 0.7;
}
if (lifeTime == 1) {
data->unk_48 = data->unk_3C.x;
data->unk_4C = data->unk_3C.y;
data->unk_50 = data->unk_3C.z;
data->unk_54 = data->unk_38;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel imgfx_mesh_make_wavy
/* D5568 8013EE68 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* D556C 8013EE6C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* D5570 8013EE70 27BDFFB8 */ addiu $sp, $sp, -0x48
/* D5574 8013EE74 AFB20018 */ sw $s2, 0x18($sp)
/* D5578 8013EE78 0080902D */ daddu $s2, $a0, $zero
/* D557C 8013EE7C AFBF002C */ sw $ra, 0x2C($sp)
/* D5580 8013EE80 AFB60028 */ sw $s6, 0x28($sp)
/* D5584 8013EE84 AFB50024 */ sw $s5, 0x24($sp)
/* D5588 8013EE88 AFB40020 */ sw $s4, 0x20($sp)
/* D558C 8013EE8C AFB3001C */ sw $s3, 0x1C($sp)
/* D5590 8013EE90 AFB10014 */ sw $s1, 0x14($sp)
/* D5594 8013EE94 AFB00010 */ sw $s0, 0x10($sp)
/* D5598 8013EE98 F7B80040 */ sdc1 $f24, 0x40($sp)
/* D559C 8013EE9C F7B60038 */ sdc1 $f22, 0x38($sp)
/* D55A0 8013EEA0 F7B40030 */ sdc1 $f20, 0x30($sp)
/* D55A4 8013EEA4 94420134 */ lhu $v0, 0x134($v0)
/* D55A8 8013EEA8 3C018015 */ lui $at, %hi(D_80151100)
/* D55AC 8013EEAC D4221100 */ ldc1 $f2, %lo(D_80151100)($at)
/* D55B0 8013EEB0 44820000 */ mtc1 $v0, $f0
/* D55B4 8013EEB4 00000000 */ nop
/* D55B8 8013EEB8 46800020 */ cvt.s.w $f0, $f0
/* D55BC 8013EEBC 46000021 */ cvt.d.s $f0, $f0
/* D55C0 8013EEC0 46220003 */ div.d $f0, $f0, $f2
/* D55C4 8013EEC4 3C018015 */ lui $at, %hi(D_80151108)
/* D55C8 8013EEC8 D4221108 */ ldc1 $f2, %lo(D_80151108)($at)
/* D55CC 8013EECC 0804FBB6 */ j .L8013EED8
/* D55D0 8013EED0 46200220 */ cvt.s.d $f8, $f0
.L8013EED4:
/* D55D4 8013EED4 46200220 */ cvt.s.d $f8, $f0
.L8013EED8:
/* D55D8 8013EED8 46004021 */ cvt.d.s $f0, $f8
/* D55DC 8013EEDC 4620103C */ c.lt.d $f2, $f0
/* D55E0 8013EEE0 00000000 */ nop
/* D55E4 8013EEE4 4503FFFB */ bc1tl .L8013EED4
/* D55E8 8013EEE8 46220001 */ sub.d $f0, $f0, $f2
/* D55EC 8013EEEC 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* D55F0 8013EEF0 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* D55F4 8013EEF4 94420134 */ lhu $v0, 0x134($v0)
/* D55F8 8013EEF8 3C018015 */ lui $at, %hi(D_80151110)
/* D55FC 8013EEFC D4221110 */ ldc1 $f2, %lo(D_80151110)($at)
/* D5600 8013EF00 24420028 */ addiu $v0, $v0, 0x28
/* D5604 8013EF04 44820000 */ mtc1 $v0, $f0
/* D5608 8013EF08 00000000 */ nop
/* D560C 8013EF0C 46800020 */ cvt.s.w $f0, $f0
/* D5610 8013EF10 46000021 */ cvt.d.s $f0, $f0
/* D5614 8013EF14 46220003 */ div.d $f0, $f0, $f2
/* D5618 8013EF18 3C018015 */ lui $at, %hi(D_80151118)
/* D561C 8013EF1C D4221118 */ ldc1 $f2, %lo(D_80151118)($at)
/* D5620 8013EF20 0804FBCB */ j .L8013EF2C
/* D5624 8013EF24 462001A0 */ cvt.s.d $f6, $f0
.L8013EF28:
/* D5628 8013EF28 462001A0 */ cvt.s.d $f6, $f0
.L8013EF2C:
/* D562C 8013EF2C 46003021 */ cvt.d.s $f0, $f6
/* D5630 8013EF30 4620103C */ c.lt.d $f2, $f0
/* D5634 8013EF34 00000000 */ nop
/* D5638 8013EF38 4503FFFB */ bc1tl .L8013EF28
/* D563C 8013EF3C 46220001 */ sub.d $f0, $f0, $f2
/* D5640 8013EF40 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* D5644 8013EF44 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* D5648 8013EF48 94420134 */ lhu $v0, 0x134($v0)
/* D564C 8013EF4C 3C018015 */ lui $at, %hi(D_80151120)
/* D5650 8013EF50 D4221120 */ ldc1 $f2, %lo(D_80151120)($at)
/* D5654 8013EF54 24420019 */ addiu $v0, $v0, 0x19
/* D5658 8013EF58 44820000 */ mtc1 $v0, $f0
/* D565C 8013EF5C 00000000 */ nop
/* D5660 8013EF60 46800020 */ cvt.s.w $f0, $f0
/* D5664 8013EF64 46000021 */ cvt.d.s $f0, $f0
/* D5668 8013EF68 46220003 */ div.d $f0, $f0, $f2
/* D566C 8013EF6C 3C018015 */ lui $at, %hi(D_80151128)
/* D5670 8013EF70 D4221128 */ ldc1 $f2, %lo(D_80151128)($at)
/* D5674 8013EF74 0804FBE0 */ j .L8013EF80
/* D5678 8013EF78 46200120 */ cvt.s.d $f4, $f0
.L8013EF7C:
/* D567C 8013EF7C 46200120 */ cvt.s.d $f4, $f0
.L8013EF80:
/* D5680 8013EF80 46002021 */ cvt.d.s $f0, $f4
/* D5684 8013EF84 4620103C */ c.lt.d $f2, $f0
/* D5688 8013EF88 00000000 */ nop
/* D568C 8013EF8C 4503FFFB */ bc1tl .L8013EF7C
/* D5690 8013EF90 46220001 */ sub.d $f0, $f0, $f2
/* D5694 8013EF94 E648003C */ swc1 $f8, 0x3C($s2)
/* D5698 8013EF98 46004006 */ mov.s $f0, $f8
/* D569C 8013EF9C 3C018015 */ lui $at, %hi(D_80151130)
/* D56A0 8013EFA0 D4221130 */ ldc1 $f2, %lo(D_80151130)($at)
/* D56A4 8013EFA4 46000021 */ cvt.d.s $f0, $f0
/* D56A8 8013EFA8 E6460040 */ swc1 $f6, 0x40($s2)
/* D56AC 8013EFAC 4620103E */ c.le.d $f2, $f0
/* D56B0 8013EFB0 00000000 */ nop
/* D56B4 8013EFB4 45000004 */ bc1f .L8013EFC8
/* D56B8 8013EFB8 E6440044 */ swc1 $f4, 0x44($s2)
/* D56BC 8013EFBC 46220001 */ sub.d $f0, $f0, $f2
/* D56C0 8013EFC0 46200020 */ cvt.s.d $f0, $f0
/* D56C4 8013EFC4 E640003C */ swc1 $f0, 0x3C($s2)
.L8013EFC8:
/* D56C8 8013EFC8 C6400040 */ lwc1 $f0, 0x40($s2)
/* D56CC 8013EFCC 46000021 */ cvt.d.s $f0, $f0
/* D56D0 8013EFD0 4620103E */ c.le.d $f2, $f0
/* D56D4 8013EFD4 00000000 */ nop
/* D56D8 8013EFD8 45000004 */ bc1f .L8013EFEC
/* D56DC 8013EFDC 00000000 */ nop
/* D56E0 8013EFE0 46220001 */ sub.d $f0, $f0, $f2
/* D56E4 8013EFE4 46200020 */ cvt.s.d $f0, $f0
/* D56E8 8013EFE8 E6400040 */ swc1 $f0, 0x40($s2)
.L8013EFEC:
/* D56EC 8013EFEC C6400044 */ lwc1 $f0, 0x44($s2)
/* D56F0 8013EFF0 46000021 */ cvt.d.s $f0, $f0
/* D56F4 8013EFF4 4620103E */ c.le.d $f2, $f0
/* D56F8 8013EFF8 00000000 */ nop
/* D56FC 8013EFFC 45000004 */ bc1f .L8013F010
/* D5700 8013F000 0000A02D */ daddu $s4, $zero, $zero
/* D5704 8013F004 46220001 */ sub.d $f0, $f0, $f2
/* D5708 8013F008 46200020 */ cvt.s.d $f0, $f0
/* D570C 8013F00C E6400044 */ swc1 $f0, 0x44($s2)
.L8013F010:
/* D5710 8013F010 9642000A */ lhu $v0, 0xA($s2)
/* D5714 8013F014 96430008 */ lhu $v1, 0x8($s2)
/* D5718 8013F018 92440003 */ lbu $a0, 0x3($s2)
/* D571C 8013F01C 00431023 */ subu $v0, $v0, $v1
/* D5720 8013F020 0044A823 */ subu $s5, $v0, $a0
/* D5724 8013F024 1AA00067 */ blez $s5, .L8013F1C4
/* D5728 8013F028 0280882D */ daddu $s1, $s4, $zero
/* D572C 8013F02C 3C168015 */ lui $s6, %hi(imgfx_vtxBuf)
/* D5730 8013F030 26D66950 */ addiu $s6, $s6, %lo(imgfx_vtxBuf)
/* D5734 8013F034 0280982D */ daddu $s3, $s4, $zero
.L8013F038:
/* D5738 8013F038 44931000 */ mtc1 $s3, $f2
/* D573C 8013F03C 00000000 */ nop
/* D5740 8013F040 468010A0 */ cvt.s.w $f2, $f2
/* D5744 8013F044 00141040 */ sll $v0, $s4, 1
/* D5748 8013F048 00541021 */ addu $v0, $v0, $s4
/* D574C 8013F04C 00021900 */ sll $v1, $v0, 4
/* D5750 8013F050 00621823 */ subu $v1, $v1, $v0
/* D5754 8013F054 00031880 */ sll $v1, $v1, 2
/* D5758 8013F058 C64C003C */ lwc1 $f12, 0x3C($s2)
/* D575C 8013F05C 44830000 */ mtc1 $v1, $f0
/* D5760 8013F060 00000000 */ nop
/* D5764 8013F064 46800020 */ cvt.s.w $f0, $f0
/* D5768 8013F068 46026300 */ add.s $f12, $f12, $f2
/* D576C 8013F06C C6560040 */ lwc1 $f22, 0x40($s2)
/* D5770 8013F070 96500008 */ lhu $s0, 0x8($s2)
/* D5774 8013F074 4602B580 */ add.s $f22, $f22, $f2
/* D5778 8013F078 C6580044 */ lwc1 $f24, 0x44($s2)
/* D577C 8013F07C 8EC20000 */ lw $v0, 0x0($s6)
/* D5780 8013F080 4602C600 */ add.s $f24, $f24, $f2
/* D5784 8013F084 02118021 */ addu $s0, $s0, $s1
/* D5788 8013F088 00108100 */ sll $s0, $s0, 4
/* D578C 8013F08C 46006300 */ add.s $f12, $f12, $f0
/* D5790 8013F090 02028021 */ addu $s0, $s0, $v0
/* D5794 8013F094 86020000 */ lh $v0, 0x0($s0)
/* D5798 8013F098 4600B580 */ add.s $f22, $f22, $f0
/* D579C 8013F09C 4482A000 */ mtc1 $v0, $f20
/* D57A0 8013F0A0 00000000 */ nop
/* D57A4 8013F0A4 4680A520 */ cvt.s.w $f20, $f20
/* D57A8 8013F0A8 0C00A85B */ jal sin_rad
/* D57AC 8013F0AC 4600C600 */ add.s $f24, $f24, $f0
/* D57B0 8013F0B0 C642001C */ lwc1 $f2, 0x1C($s2)
/* D57B4 8013F0B4 468010A0 */ cvt.s.w $f2, $f2
/* D57B8 8013F0B8 46020002 */ mul.s $f0, $f0, $f2
/* D57BC 8013F0BC 00000000 */ nop
/* D57C0 8013F0C0 4600A500 */ add.s $f20, $f20, $f0
/* D57C4 8013F0C4 4600A28D */ trunc.w.s $f10, $f20
/* D57C8 8013F0C8 44025000 */ mfc1 $v0, $f10
/* D57CC 8013F0CC 00000000 */ nop
/* D57D0 8013F0D0 A6020000 */ sh $v0, 0x0($s0)
/* D57D4 8013F0D4 96500008 */ lhu $s0, 0x8($s2)
/* D57D8 8013F0D8 8EC20000 */ lw $v0, 0x0($s6)
/* D57DC 8013F0DC 02118021 */ addu $s0, $s0, $s1
/* D57E0 8013F0E0 00108100 */ sll $s0, $s0, 4
/* D57E4 8013F0E4 02028021 */ addu $s0, $s0, $v0
/* D57E8 8013F0E8 86020002 */ lh $v0, 0x2($s0)
/* D57EC 8013F0EC 4482A000 */ mtc1 $v0, $f20
/* D57F0 8013F0F0 00000000 */ nop
/* D57F4 8013F0F4 4680A520 */ cvt.s.w $f20, $f20
/* D57F8 8013F0F8 0C00A85B */ jal sin_rad
/* D57FC 8013F0FC 4600B306 */ mov.s $f12, $f22
/* D5800 8013F100 C6420020 */ lwc1 $f2, 0x20($s2)
/* D5804 8013F104 468010A0 */ cvt.s.w $f2, $f2
/* D5808 8013F108 46020002 */ mul.s $f0, $f0, $f2
/* D580C 8013F10C 00000000 */ nop
/* D5810 8013F110 4600A500 */ add.s $f20, $f20, $f0
/* D5814 8013F114 4600A28D */ trunc.w.s $f10, $f20
/* D5818 8013F118 44025000 */ mfc1 $v0, $f10
/* D581C 8013F11C 00000000 */ nop
/* D5820 8013F120 A6020002 */ sh $v0, 0x2($s0)
/* D5824 8013F124 96500008 */ lhu $s0, 0x8($s2)
/* D5828 8013F128 8EC20000 */ lw $v0, 0x0($s6)
/* D582C 8013F12C 02118021 */ addu $s0, $s0, $s1
/* D5830 8013F130 00108100 */ sll $s0, $s0, 4
/* D5834 8013F134 02028021 */ addu $s0, $s0, $v0
/* D5838 8013F138 86020004 */ lh $v0, 0x4($s0)
/* D583C 8013F13C 4482A000 */ mtc1 $v0, $f20
/* D5840 8013F140 00000000 */ nop
/* D5844 8013F144 4680A520 */ cvt.s.w $f20, $f20
/* D5848 8013F148 0C00A85B */ jal sin_rad
/* D584C 8013F14C 4600C306 */ mov.s $f12, $f24
/* D5850 8013F150 C6420024 */ lwc1 $f2, 0x24($s2)
/* D5854 8013F154 468010A0 */ cvt.s.w $f2, $f2
/* D5858 8013F158 46020002 */ mul.s $f0, $f0, $f2
/* D585C 8013F15C 00000000 */ nop
/* D5860 8013F160 4600A500 */ add.s $f20, $f20, $f0
/* D5864 8013F164 4600A28D */ trunc.w.s $f10, $f20
/* D5868 8013F168 44025000 */ mfc1 $v0, $f10
/* D586C 8013F16C 00000000 */ nop
/* D5870 8013F170 A6020004 */ sh $v0, 0x4($s0)
/* D5874 8013F174 92420003 */ lbu $v0, 0x3($s2)
/* D5878 8013F178 24420001 */ addiu $v0, $v0, 0x1
/* D587C 8013F17C 14400002 */ bnez $v0, .L8013F188
/* D5880 8013F180 0222001A */ div $zero, $s1, $v0
/* D5884 8013F184 0007000D */ break 7
.L8013F188:
/* D5888 8013F188 2401FFFF */ addiu $at, $zero, -0x1
/* D588C 8013F18C 14410004 */ bne $v0, $at, .L8013F1A0
/* D5890 8013F190 3C018000 */ lui $at, (0x80000000 >> 16)
/* D5894 8013F194 16210002 */ bne $s1, $at, .L8013F1A0
/* D5898 8013F198 00000000 */ nop
/* D589C 8013F19C 0006000D */ break 6
.L8013F1A0:
/* D58A0 8013F1A0 00001810 */ mfhi $v1
/* D58A4 8013F1A4 14600003 */ bnez $v1, .L8013F1B4
/* D58A8 8013F1A8 2673002D */ addiu $s3, $s3, 0x2D
/* D58AC 8013F1AC 0000982D */ daddu $s3, $zero, $zero
/* D58B0 8013F1B0 3A940001 */ xori $s4, $s4, 0x1
.L8013F1B4:
/* D58B4 8013F1B4 26310001 */ addiu $s1, $s1, 0x1
/* D58B8 8013F1B8 0235102A */ slt $v0, $s1, $s5
/* D58BC 8013F1BC 1440FF9E */ bnez $v0, .L8013F038
/* D58C0 8013F1C0 00000000 */ nop
.L8013F1C4:
/* D58C4 8013F1C4 8FBF002C */ lw $ra, 0x2C($sp)
/* D58C8 8013F1C8 8FB60028 */ lw $s6, 0x28($sp)
/* D58CC 8013F1CC 8FB50024 */ lw $s5, 0x24($sp)
/* D58D0 8013F1D0 8FB40020 */ lw $s4, 0x20($sp)
/* D58D4 8013F1D4 8FB3001C */ lw $s3, 0x1C($sp)
/* D58D8 8013F1D8 8FB20018 */ lw $s2, 0x18($sp)
/* D58DC 8013F1DC 8FB10014 */ lw $s1, 0x14($sp)
/* D58E0 8013F1E0 8FB00010 */ lw $s0, 0x10($sp)
/* D58E4 8013F1E4 D7B80040 */ ldc1 $f24, 0x40($sp)
/* D58E8 8013F1E8 D7B60038 */ ldc1 $f22, 0x38($sp)
/* D58EC 8013F1EC D7B40030 */ ldc1 $f20, 0x30($sp)
/* D58F0 8013F1F0 03E00008 */ jr $ra
/* D58F4 8013F1F4 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
void imgfx_mesh_make_wavy(ImgFXState* state) {
Vtx* v1;
Vtx* v2;
Vtx* v3;
f32 vx;
f32 vy;
f32 vz;
f32 angle1;
f32 angle2;
f32 angle3;
f32 phase1;
f32 phase2;
f32 phase3;
s32 angleInc;
s32 amt;
s32 sign;
s32 i;
phase1 = (f32) gGameStatusPtr->frameCounter / 10.3;
while (phase1 > 360.0) {
phase1 -= 360.0;
}
phase2 = (f32) (gGameStatusPtr->frameCounter + 40) / 11.2;
while (phase2 > 360.0) {
phase2 -= 360.0;
}
phase3 = (f32) (gGameStatusPtr->frameCounter + 25) / 10.8;
while (phase3 > 360.0) {
phase3 -= 360.0;
}
state->floats.wavy.phase1 = phase1;
state->floats.wavy.phase2 = phase2;
state->floats.wavy.phase3 = phase3;
if (state->floats.wavy.phase1 >= 360.0) {
state->floats.wavy.phase1-= 360.0;
}
if (state->floats.wavy.phase2 >= 360.0) {
state->floats.wavy.phase2 -= 360.0;
}
if (state->floats.wavy.phase3 >= 360.0) {
state->floats.wavy.phase3 -= 360.0;
}
sign = 0;
angleInc = 0;
amt = (state->lastVtxIdx - state->firstVtxIdx) - state->subdivX;
for (i = 0; i < amt; i++) {
angle1 = state->floats.wavy.phase1 + (angleInc * 45) + (sign * 180);
angle2 = state->floats.wavy.phase2 + (angleInc * 45) + (sign * 180);
angle3 = state->floats.wavy.phase3 + (angleInc * 45) + (sign * 180);
//TODO find better match
v1 = (Vtx*)((state->firstVtxIdx + i) * sizeof(Vtx) + (s32)imgfx_vtxBuf);
vx = v1->v.ob[0];
v1->v.ob[0] = (vx + (sin_rad(angle1) * state->ints.wavy.mag.x)); // @bug? should be sin_deg?
v2 = (Vtx*)((state->firstVtxIdx + i) * sizeof(Vtx) + (s32)imgfx_vtxBuf);
vy = v2->v.ob[1];
v2->v.ob[1] = (vy + (sin_rad(angle2) * state->ints.wavy.mag.y));
v3 = (Vtx*)((state->firstVtxIdx + i) * sizeof(Vtx) + (s32)imgfx_vtxBuf);
vz = v3->v.ob[2];
v3->v.ob[2] = (vz + (sin_rad(angle3) * state->ints.wavy.mag.z));
angleInc++;
if (i % (state->subdivX + 1) == 0) {
angleInc = 0;
sign = !sign;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel basic_ai_check_player_dist
/* 244B4 800490B4 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 244B8 800490B8 F7B60050 */ sdc1 $f22, 0x50($sp)
/* 244BC 800490BC 4486B000 */ mtc1 $a2, $f22
/* 244C0 800490C0 F7B80058 */ sdc1 $f24, 0x58($sp)
/* 244C4 800490C4 4487C000 */ mtc1 $a3, $f24
/* 244C8 800490C8 AFB10034 */ sw $s1, 0x34($sp)
/* 244CC 800490CC 0080882D */ daddu $s1, $a0, $zero
/* 244D0 800490D0 AFB3003C */ sw $s3, 0x3C($sp)
/* 244D4 800490D4 00A0982D */ daddu $s3, $a1, $zero
/* 244D8 800490D8 AFBF0044 */ sw $ra, 0x44($sp)
/* 244DC 800490DC AFB40040 */ sw $s4, 0x40($sp)
/* 244E0 800490E0 AFB20038 */ sw $s2, 0x38($sp)
/* 244E4 800490E4 AFB00030 */ sw $s0, 0x30($sp)
/* 244E8 800490E8 F7B40048 */ sdc1 $f20, 0x48($sp)
/* 244EC 800490EC 86640008 */ lh $a0, 0x8($s3)
/* 244F0 800490F0 0C00EABB */ jal get_npc_unsafe
/* 244F4 800490F4 93B40073 */ lbu $s4, 0x73($sp)
/* 244F8 800490F8 0040802D */ daddu $s0, $v0, $zero
/* 244FC 800490FC 8E6200B0 */ lw $v0, 0xB0($s3)
/* 24500 80049100 3C128011 */ lui $s2, %hi(gPlayerStatus)
/* 24504 80049104 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus)
/* 24508 80049108 30420002 */ andi $v0, $v0, 0x2
/* 2450C 8004910C 144000AC */ bnez $v0, .L800493C0
/* 24510 80049110 0000102D */ daddu $v0, $zero, $zero
/* 24514 80049114 3C048011 */ lui $a0, %hi(gPartnerStatus)
/* 24518 80049118 2484EBB0 */ addiu $a0, $a0, %lo(gPartnerStatus)
/* 2451C 8004911C 80830003 */ lb $v1, 0x3($a0)
/* 24520 80049120 24020009 */ addiu $v0, $zero, 0x9
/* 24524 80049124 14620008 */ bne $v1, $v0, .L80049148
/* 24528 80049128 24020007 */ addiu $v0, $zero, 0x7
/* 2452C 8004912C 80820000 */ lb $v0, 0x0($a0)
/* 24530 80049130 10400005 */ beqz $v0, .L80049148
/* 24534 80049134 24020007 */ addiu $v0, $zero, 0x7
/* 24538 80049138 9622001C */ lhu $v0, 0x1C($s1)
/* 2453C 8004913C 30420001 */ andi $v0, $v0, 0x1
/* 24540 80049140 1040009E */ beqz $v0, .L800493BC
/* 24544 80049144 24020007 */ addiu $v0, $zero, 0x7
.L80049148:
/* 24548 80049148 14620008 */ bne $v1, $v0, .L8004916C
/* 2454C 8004914C 00000000 */ nop
/* 24550 80049150 80820000 */ lb $v0, 0x0($a0)
/* 24554 80049154 10400005 */ beqz $v0, .L8004916C
/* 24558 80049158 00000000 */ nop
/* 2455C 8004915C 9622001C */ lhu $v0, 0x1C($s1)
/* 24560 80049160 30420001 */ andi $v0, $v0, 0x1
/* 24564 80049164 10400096 */ beqz $v0, .L800493C0
/* 24568 80049168 0000102D */ daddu $v0, $zero, $zero
.L8004916C:
/* 2456C 8004916C 8E220000 */ lw $v0, 0x0($s1)
/* 24570 80049170 04400093 */ bltz $v0, .L800493C0
/* 24574 80049174 0000102D */ daddu $v0, $zero, $zero
/* 24578 80049178 C600003C */ lwc1 $f0, 0x3C($s0)
/* 2457C 8004917C C642002C */ lwc1 $f2, 0x2C($s2)
/* 24580 80049180 46020001 */ sub.s $f0, $f0, $f2
/* 24584 80049184 C6220018 */ lwc1 $f2, 0x18($s1)
/* 24588 80049188 46000005 */ abs.s $f0, $f0
/* 2458C 8004918C 4600103E */ c.le.s $f2, $f0
/* 24590 80049190 00000000 */ nop
/* 24594 80049194 45000005 */ bc1f .L800491AC
/* 24598 80049198 00000000 */ nop
/* 2459C 8004919C 9622001C */ lhu $v0, 0x1C($s1)
/* 245A0 800491A0 30420002 */ andi $v0, $v0, 0x2
/* 245A4 800491A4 10400086 */ beqz $v0, .L800493C0
/* 245A8 800491A8 0000102D */ daddu $v0, $zero, $zero
.L800491AC:
/* 245AC 800491AC 8E220010 */ lw $v0, 0x10($s1)
/* 245B0 800491B0 8E230014 */ lw $v1, 0x14($s1)
/* 245B4 800491B4 00431025 */ or $v0, $v0, $v1
/* 245B8 800491B8 10400014 */ beqz $v0, .L8004920C
/* 245BC 800491BC 00000000 */ nop
/* 245C0 800491C0 C6200008 */ lwc1 $f0, 0x8($s1)
/* 245C4 800491C4 46800020 */ cvt.s.w $f0, $f0
/* 245C8 800491C8 44050000 */ mfc1 $a1, $f0
/* 245CC 800491CC C620000C */ lwc1 $f0, 0xC($s1)
/* 245D0 800491D0 46800020 */ cvt.s.w $f0, $f0
/* 245D4 800491D4 44060000 */ mfc1 $a2, $f0
/* 245D8 800491D8 C6400030 */ lwc1 $f0, 0x30($s2)
/* 245DC 800491DC 8E470028 */ lw $a3, 0x28($s2)
/* 245E0 800491E0 E7A00010 */ swc1 $f0, 0x10($sp)
/* 245E4 800491E4 C6200010 */ lwc1 $f0, 0x10($s1)
/* 245E8 800491E8 46800020 */ cvt.s.w $f0, $f0
/* 245EC 800491EC E7A00014 */ swc1 $f0, 0x14($sp)
/* 245F0 800491F0 C6200014 */ lwc1 $f0, 0x14($s1)
/* 245F4 800491F4 46800020 */ cvt.s.w $f0, $f0
/* 245F8 800491F8 E7A00018 */ swc1 $f0, 0x18($sp)
/* 245FC 800491FC 0C0123F5 */ jal is_point_within_region
/* 24600 80049200 8E240004 */ lw $a0, 0x4($s1)
/* 24604 80049204 1440006E */ bnez $v0, .L800493C0
/* 24608 80049208 0000102D */ daddu $v0, $zero, $zero
.L8004920C:
/* 2460C 8004920C 824300B4 */ lb $v1, 0xB4($s2)
/* 24610 80049210 2402001D */ addiu $v0, $zero, 0x1D
/* 24614 80049214 1062006A */ beq $v1, $v0, .L800493C0
/* 24618 80049218 0000102D */ daddu $v0, $zero, $zero
/* 2461C 8004921C 926200AC */ lbu $v0, 0xAC($s3)
/* 24620 80049220 30420001 */ andi $v0, $v0, 0x1
/* 24624 80049224 1040002C */ beqz $v0, .L800492D8
/* 24628 80049228 00000000 */ nop
/* 2462C 8004922C C60C0038 */ lwc1 $f12, 0x38($s0)
/* 24630 80049230 860200A8 */ lh $v0, 0xA8($s0)
/* 24634 80049234 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 24638 80049238 44810800 */ mtc1 $at, $f1
/* 2463C 8004923C 44800000 */ mtc1 $zero, $f0
/* 24640 80049240 44821000 */ mtc1 $v0, $f2
/* 24644 80049244 00000000 */ nop
/* 24648 80049248 468010A1 */ cvt.d.w $f2, $f2
/* 2464C 8004924C 46201082 */ mul.d $f2, $f2, $f0
/* 24650 80049250 00000000 */ nop
/* 24654 80049254 C60E0040 */ lwc1 $f14, 0x40($s0)
/* 24658 80049258 8E460028 */ lw $a2, 0x28($s2)
/* 2465C 8004925C 8E470030 */ lw $a3, 0x30($s2)
/* 24660 80049260 46006106 */ mov.s $f4, $f12
/* 24664 80049264 C600003C */ lwc1 $f0, 0x3C($s0)
/* 24668 80049268 46007186 */ mov.s $f6, $f14
/* 2466C 8004926C 46000021 */ cvt.d.s $f0, $f0
/* 24670 80049270 46220000 */ add.d $f0, $f0, $f2
/* 24674 80049274 E7A40020 */ swc1 $f4, 0x20($sp)
/* 24678 80049278 E7A60028 */ swc1 $f6, 0x28($sp)
/* 2467C 8004927C 46200020 */ cvt.s.d $f0, $f0
/* 24680 80049280 0C00A7B5 */ jal dist2D
/* 24684 80049284 E7A00024 */ swc1 $f0, 0x24($sp)
/* 24688 80049288 C60C0038 */ lwc1 $f12, 0x38($s0)
/* 2468C 8004928C C60E0040 */ lwc1 $f14, 0x40($s0)
/* 24690 80049290 8E460028 */ lw $a2, 0x28($s2)
/* 24694 80049294 8E470030 */ lw $a3, 0x30($s2)
/* 24698 80049298 0C00A720 */ jal atan2
/* 2469C 8004929C 46000506 */ mov.s $f20, $f0
/* 246A0 800492A0 3C040005 */ lui $a0, (0x50000 >> 16)
/* 246A4 800492A4 27A50020 */ addiu $a1, $sp, 0x20
/* 246A8 800492A8 27A60024 */ addiu $a2, $sp, 0x24
/* 246AC 800492AC 3C013DCC */ lui $at, (0x3DCCCCCD >> 16)
/* 246B0 800492B0 3421CCCD */ ori $at, $at, (0x3DCCCCCD & 0xFFFF)
/* 246B4 800492B4 44811000 */ mtc1 $at, $f2
/* 246B8 800492B8 27A70028 */ addiu $a3, $sp, 0x28
/* 246BC 800492BC E7B40010 */ swc1 $f20, 0x10($sp)
/* 246C0 800492C0 E7A00014 */ swc1 $f0, 0x14($sp)
/* 246C4 800492C4 E7A20018 */ swc1 $f2, 0x18($sp)
/* 246C8 800492C8 0C037711 */ jal npc_test_move_simple_with_slipping
/* 246CC 800492CC E7A2001C */ swc1 $f2, 0x1C($sp)
/* 246D0 800492D0 1440003B */ bnez $v0, .L800493C0
/* 246D4 800492D4 0000102D */ daddu $v0, $zero, $zero
.L800492D8:
/* 246D8 800492D8 8E220000 */ lw $v0, 0x0($s1)
/* 246DC 800492DC 14400003 */ bnez $v0, .L800492EC
/* 246E0 800492E0 00000000 */ nop
/* 246E4 800492E4 080124BD */ j .L800492F4
/* 246E8 800492E8 0000102D */ daddu $v0, $zero, $zero
.L800492EC:
/* 246EC 800492EC 0C00A67F */ jal rand_int
/* 246F0 800492F0 24440001 */ addiu $a0, $v0, 0x1
.L800492F4:
/* 246F4 800492F4 14400032 */ bnez $v0, .L800493C0
/* 246F8 800492F8 0000102D */ daddu $v0, $zero, $zero
/* 246FC 800492FC 926200AC */ lbu $v0, 0xAC($s3)
/* 24700 80049300 30420002 */ andi $v0, $v0, 0x2
/* 24704 80049304 10400010 */ beqz $v0, .L80049348
/* 24708 80049308 24020001 */ addiu $v0, $zero, 0x1
/* 2470C 8004930C 824300B4 */ lb $v1, 0xB4($s2)
/* 24710 80049310 14620005 */ bne $v1, $v0, .L80049328
/* 24714 80049314 24020002 */ addiu $v0, $zero, 0x2
/* 24718 80049318 3C01800A */ lui $at, %hi(D_80098710)
/* 2471C 8004931C D4228710 */ ldc1 $f2, %lo(D_80098710)($at)
/* 24720 80049320 080124CF */ j .L8004933C
/* 24724 80049324 4600B021 */ cvt.d.s $f0, $f22
.L80049328:
/* 24728 80049328 14620007 */ bne $v1, $v0, .L80049348
/* 2472C 8004932C 00000000 */ nop
/* 24730 80049330 3C01800A */ lui $at, %hi(D_80098718)
/* 24734 80049334 D4228718 */ ldc1 $f2, %lo(D_80098718)($at)
/* 24738 80049338 4600B021 */ cvt.d.s $f0, $f22
.L8004933C:
/* 2473C 8004933C 46220002 */ mul.d $f0, $f0, $f2
/* 24740 80049340 00000000 */ nop
/* 24744 80049344 462005A0 */ cvt.s.d $f22, $f0
.L80049348:
/* 24748 80049348 C6000038 */ lwc1 $f0, 0x38($s0)
/* 2474C 8004934C C6020040 */ lwc1 $f2, 0x40($s0)
/* 24750 80049350 328200FF */ andi $v0, $s4, 0xFF
/* 24754 80049354 E7A00020 */ swc1 $f0, 0x20($sp)
/* 24758 80049358 10400005 */ beqz $v0, .L80049370
/* 2475C 8004935C E7A20028 */ swc1 $f2, 0x28($sp)
/* 24760 80049360 4406C000 */ mfc1 $a2, $f24
/* 24764 80049364 8E07000C */ lw $a3, 0xC($s0)
/* 24768 80049368 080124E4 */ j .L80049390
/* 2476C 8004936C 27A40020 */ addiu $a0, $sp, 0x20
.L80049370:
/* 24770 80049370 C6020034 */ lwc1 $f2, 0x34($s0)
/* 24774 80049374 3C014387 */ lui $at, (0x43870000 >> 16)
/* 24778 80049378 44810000 */ mtc1 $at, $f0
/* 2477C 8004937C 00000000 */ nop
/* 24780 80049380 46020001 */ sub.s $f0, $f0, $f2
/* 24784 80049384 27A40020 */ addiu $a0, $sp, 0x20
/* 24788 80049388 4406C000 */ mfc1 $a2, $f24
/* 2478C 8004938C 44070000 */ mfc1 $a3, $f0
.L80049390:
/* 24790 80049390 0C00A7E7 */ jal add_vec2D_polar
/* 24794 80049394 27A50028 */ addiu $a1, $sp, 0x28
/* 24798 80049398 C7AC0020 */ lwc1 $f12, 0x20($sp)
/* 2479C 8004939C C7AE0028 */ lwc1 $f14, 0x28($sp)
/* 247A0 800493A0 8E460028 */ lw $a2, 0x28($s2)
/* 247A4 800493A4 0C00A7B5 */ jal dist2D
/* 247A8 800493A8 8E470030 */ lw $a3, 0x30($s2)
/* 247AC 800493AC 4616003E */ c.le.s $f0, $f22
/* 247B0 800493B0 00000000 */ nop
/* 247B4 800493B4 45010002 */ bc1t .L800493C0
/* 247B8 800493B8 24020001 */ addiu $v0, $zero, 0x1
.L800493BC:
/* 247BC 800493BC 0000102D */ daddu $v0, $zero, $zero
.L800493C0:
/* 247C0 800493C0 8FBF0044 */ lw $ra, 0x44($sp)
/* 247C4 800493C4 8FB40040 */ lw $s4, 0x40($sp)
/* 247C8 800493C8 8FB3003C */ lw $s3, 0x3C($sp)
/* 247CC 800493CC 8FB20038 */ lw $s2, 0x38($sp)
/* 247D0 800493D0 8FB10034 */ lw $s1, 0x34($sp)
/* 247D4 800493D4 8FB00030 */ lw $s0, 0x30($sp)
/* 247D8 800493D8 D7B80058 */ ldc1 $f24, 0x58($sp)
/* 247DC 800493DC D7B60050 */ ldc1 $f22, 0x50($sp)
/* 247E0 800493E0 D7B40048 */ ldc1 $f20, 0x48($sp)
/* 247E4 800493E4 03E00008 */ jr $ra
/* 247E8 800493E8 27BD0060 */ addiu $sp, $sp, 0x60
### DECOMPILED C INSTRUCTIONS:
s32 basic_ai_check_player_dist(EnemyDetectVolume* territory, Enemy* enemy, f32 radius, f32 fwdPosOffset, s8 useWorldYaw) {
Npc* npc = get_npc_unsafe(enemy->npcID);
PlayerStatus* playerStatus = &gPlayerStatus;
PartnerStatus* partnerStatus;
f32 x, y, z;
f32 dist;
s32 skipCheckForPlayer;
if (enemy->aiFlags & ENEMY_AI_FLAG_2) {
return FALSE;
}
partnerStatus = &gPartnerStatus;
if (partnerStatus->actingPartner == PARTNER_BOW && partnerStatus->partnerActionState
&& !(territory->detectFlags & AI_TERRITORY_IGNORE_HIDING)) {
return FALSE;
}
if (partnerStatus->actingPartner == PARTNER_SUSHIE && partnerStatus->partnerActionState
&& !(territory->detectFlags & AI_TERRITORY_IGNORE_HIDING)) {
return FALSE;
}
if (territory->skipPlayerDetectChance < 0) {
return FALSE;
}
if (territory->halfHeight <= fabsf(npc->pos.y - playerStatus->position.y)
&& !(territory->detectFlags & AI_TERRITORY_IGNORE_ELEVATION)) {
return FALSE;
}
if (territory->sizeX | territory->sizeZ && is_point_within_region(territory->shape,
territory->pointX, territory->pointZ,
playerStatus->position.x, playerStatus->position.z,
territory->sizeX, territory->sizeZ)) {
return FALSE;
}
if ((playerStatus->actionState == ACTION_STATE_USE_SPINNING_FLOWER)) {
return FALSE;
}
// check for unbroken line of sight
if (enemy->aiDetectFlags & AI_DETECT_SIGHT) {
x = npc->pos.x;
y = npc->pos.y + npc->collisionHeight * 0.5;
z = npc->pos.z;
dist = dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z);
if (npc_test_move_simple_with_slipping(COLLISION_CHANNEL_10000 | COLLISION_IGNORE_ENTITIES,
&x, &y, &z,
dist, atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z),
0.1f, 0.1f)) {
return FALSE;
}
}
if (territory->skipPlayerDetectChance == 0) {
skipCheckForPlayer = 0;
} else {
skipCheckForPlayer = rand_int(territory->skipPlayerDetectChance + 1);
}
if (skipCheckForPlayer == 0) {
if (enemy->aiDetectFlags & AI_DETECT_SENSITIVE_MOTION) {
if (playerStatus->actionState == ACTION_STATE_WALK) {
radius *= 1.15;
} else if (playerStatus->actionState == ACTION_STATE_RUN) {
radius *= 1.3;
}
}
x = npc->pos.x;
z = npc->pos.z;
if (useWorldYaw & 0xFF) {
add_vec2D_polar(&x, &z, fwdPosOffset, npc->yaw);
} else {
add_vec2D_polar(&x, &z, fwdPosOffset, 270.0f - npc->renderYaw);
}
if (dist2D(x, z, playerStatus->position.x, playerStatus->position.z) <= radius) {
return TRUE;
}
}
return FALSE;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel btl_draw_ui
/* 16D35C 8023EA7C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 16D360 8023EA80 AFB10014 */ sw $s1, 0x14($sp)
/* 16D364 8023EA84 0000882D */ daddu $s1, $zero, $zero
/* 16D368 8023EA88 AFBF0018 */ sw $ra, 0x18($sp)
/* 16D36C 8023EA8C AFB00010 */ sw $s0, 0x10($sp)
/* 16D370 8023EA90 3C10800E */ lui $s0, %hi(gBattleState)
/* 16D374 8023EA94 8E10C068 */ lw $s0, %lo(gBattleState)($s0)
/* 16D378 8023EA98 3C04800E */ lui $a0, %hi(gLastDrawBattleState)
/* 16D37C 8023EA9C 2484C4D0 */ addiu $a0, $a0, %lo(gLastDrawBattleState)
/* 16D380 8023EAA0 8C820000 */ lw $v0, 0x0($a0)
/* 16D384 8023EAA4 12020005 */ beq $s0, $v0, .L8023EABC
/* 16D388 8023EAA8 0200182D */ daddu $v1, $s0, $zero
/* 16D38C 8023EAAC 0040802D */ daddu $s0, $v0, $zero
/* 16D390 8023EAB0 AC830000 */ sw $v1, 0x0($a0)
/* 16D394 8023EAB4 0808FABA */ j .L8023EAE8
/* 16D398 8023EAB8 24110001 */ addiu $s1, $zero, 0x1
.L8023EABC:
/* 16D39C 8023EABC 2402FFFF */ addiu $v0, $zero, -0x1
/* 16D3A0 8023EAC0 16020007 */ bne $s0, $v0, .L8023EAE0
/* 16D3A4 8023EAC4 00000000 */ nop
/* 16D3A8 8023EAC8 0C0900EF */ jal func_802403BC
/* 16D3AC 8023EACC 00000000 */ nop
/* 16D3B0 8023EAD0 0C08FFE8 */ jal btl_draw_enemy_health_bars
/* 16D3B4 8023EAD4 00000000 */ nop
/* 16D3B8 8023EAD8 0808FB50 */ j .L8023ED40
/* 16D3BC 8023EADC 00000000 */ nop
.L8023EAE0:
/* 16D3C0 8023EAE0 12000099 */ beqz $s0, .L8023ED48
/* 16D3C4 8023EAE4 00000000 */ nop
.L8023EAE8:
/* 16D3C8 8023EAE8 0C0900EF */ jal func_802403BC
/* 16D3CC 8023EAEC 00000000 */ nop
/* 16D3D0 8023EAF0 0C08FFE8 */ jal btl_draw_enemy_health_bars
/* 16D3D4 8023EAF4 00000000 */ nop
/* 16D3D8 8023EAF8 1620008F */ bnez $s1, .L8023ED38
/* 16D3DC 8023EAFC 2603FFFF */ addiu $v1, $s0, -0x1
/* 16D3E0 8023EB00 2C620023 */ sltiu $v0, $v1, 0x23
/* 16D3E4 8023EB04 1040008C */ beqz $v0, .L8023ED38
/* 16D3E8 8023EB08 00031080 */ sll $v0, $v1, 2
/* 16D3EC 8023EB0C 3C01802A */ lui $at, %hi(jtbl_8029C9F8)
/* 16D3F0 8023EB10 00220821 */ addu $at, $at, $v0
/* 16D3F4 8023EB14 8C22C9F8 */ lw $v0, %lo(jtbl_8029C9F8)($at)
/* 16D3F8 8023EB18 00400008 */ jr $v0
/* 16D3FC 8023EB1C 00000000 */ nop
glabel .L8023EB20
/* 16D400 8023EB20 0C0906AE */ jal flo_11_pad_1AB8
/* 16D404 8023EB24 00000000 */ nop
/* 16D408 8023EB28 0808FB4E */ j .L8023ED38
/* 16D40C 8023EB2C 00000000 */ nop
glabel .L8023EB30
/* 16D410 8023EB30 0C090AB0 */ jal func_80242AC0
/* 16D414 8023EB34 00000000 */ nop
/* 16D418 8023EB38 0808FB4E */ j .L8023ED38
/* 16D41C 8023EB3C 00000000 */ nop
glabel .L8023EB40
/* 16D420 8023EB40 0C090BBE */ jal func_80242EF8
/* 16D424 8023EB44 00000000 */ nop
/* 16D428 8023EB48 0808FB4E */ j .L8023ED38
/* 16D42C 8023EB4C 00000000 */ nop
glabel .L8023EB50
/* 16D430 8023EB50 0C090E44 */ jal func_80243910
/* 16D434 8023EB54 00000000 */ nop
/* 16D438 8023EB58 0808FB4E */ j .L8023ED38
/* 16D43C 8023EB5C 00000000 */ nop
glabel .L8023EB60
/* 16D440 8023EB60 0C090807 */ jal func_8024201C
/* 16D444 8023EB64 00000000 */ nop
/* 16D448 8023EB68 0808FB4E */ j .L8023ED38
/* 16D44C 8023EB6C 00000000 */ nop
glabel .L8023EB70
/* 16D450 8023EB70 0C090FF5 */ jal func_80243FD4
/* 16D454 8023EB74 00000000 */ nop
/* 16D458 8023EB78 0808FB4E */ j .L8023ED38
/* 16D45C 8023EB7C 00000000 */ nop
glabel .L8023EB80
/* 16D460 8023EB80 0C090AEA */ jal func_80242BA8
/* 16D464 8023EB84 00000000 */ nop
/* 16D468 8023EB88 0808FB4E */ j .L8023ED38
/* 16D46C 8023EB8C 00000000 */ nop
glabel .L8023EB90
/* 16D470 8023EB90 0C090BF6 */ jal func_80242FD8
/* 16D474 8023EB94 00000000 */ nop
/* 16D478 8023EB98 0808FB4E */ j .L8023ED38
/* 16D47C 8023EB9C 00000000 */ nop
glabel .L8023EBA0
/* 16D480 8023EBA0 0C090E74 */ jal func_802439D0
/* 16D484 8023EBA4 00000000 */ nop
/* 16D488 8023EBA8 0808FB4E */ j .L8023ED38
/* 16D48C 8023EBAC 00000000 */ nop
glabel .L8023EBB0
/* 16D490 8023EBB0 0C0AA060 */ jal func_802A8180_7AFB20
/* 16D494 8023EBB4 00000000 */ nop
/* 16D498 8023EBB8 0808FB4E */ j .L8023ED38
/* 16D49C 8023EBBC 00000000 */ nop
glabel .L8023EBC0
/* 16D4A0 8023EBC0 0C0AA6BA */ jal func_802A9AE8_7B1488
/* 16D4A4 8023EBC4 00000000 */ nop
/* 16D4A8 8023EBC8 0808FB4E */ j .L8023ED38
/* 16D4AC 8023EBCC 00000000 */ nop
glabel .L8023EBD0
/* 16D4B0 8023EBD0 0C0AA990 */ jal D_802AA640_7B1FE0
/* 16D4B4 8023EBD4 00000000 */ nop
/* 16D4B8 8023EBD8 0808FB4E */ j .L8023ED38
/* 16D4BC 8023EBDC 00000000 */ nop
glabel .L8023EBE0
/* 16D4C0 8023EBE0 0C0AA817 */ jal func_802AA05C_7B19FC
/* 16D4C4 8023EBE4 00000000 */ nop
/* 16D4C8 8023EBE8 0808FB4E */ j .L8023ED38
/* 16D4CC 8023EBEC 00000000 */ nop
glabel .L8023EBF0
/* 16D4D0 8023EBF0 0C0AAB36 */ jal func_802AACD8_7B2678
/* 16D4D4 8023EBF4 00000000 */ nop
/* 16D4D8 8023EBF8 0808FB4E */ j .L8023ED38
/* 16D4DC 8023EBFC 00000000 */ nop
glabel .L8023EC00
/* 16D4E0 8023EC00 0C091912 */ jal func_80246448
/* 16D4E4 8023EC04 00000000 */ nop
/* 16D4E8 8023EC08 0808FB4E */ j .L8023ED38
/* 16D4EC 8023EC0C 00000000 */ nop
glabel .L8023EC10
/* 16D4F0 8023EC10 0C09203C */ jal func_802480F0
/* 16D4F4 8023EC14 00000000 */ nop
/* 16D4F8 8023EC18 0808FB4E */ j .L8023ED38
/* 16D4FC 8023EC1C 00000000 */ nop
glabel .L8023EC20
/* 16D500 8023EC20 0C091ACB */ jal func_80246B2C
/* 16D504 8023EC24 00000000 */ nop
/* 16D508 8023EC28 0808FB4E */ j .L8023ED38
/* 16D50C 8023EC2C 00000000 */ nop
glabel .L8023EC30
/* 16D510 8023EC30 0C091CA9 */ jal func_802472A4
/* 16D514 8023EC34 00000000 */ nop
/* 16D518 8023EC38 0808FB4E */ j .L8023ED38
/* 16D51C 8023EC3C 00000000 */ nop
glabel .L8023EC40
/* 16D520 8023EC40 0C09217F */ jal func_802485FC
/* 16D524 8023EC44 00000000 */ nop
/* 16D528 8023EC48 0808FB4E */ j .L8023ED38
/* 16D52C 8023EC4C 00000000 */ nop
glabel .L8023EC50
/* 16D530 8023EC50 0C091EBF */ jal func_80247AFC
/* 16D534 8023EC54 00000000 */ nop
/* 16D538 8023EC58 0808FB4E */ j .L8023ED38
/* 16D53C 8023EC5C 00000000 */ nop
glabel .L8023EC60
/* 16D540 8023EC60 0C091D5A */ jal func_80247568
/* 16D544 8023EC64 00000000 */ nop
/* 16D548 8023EC68 0808FB4E */ j .L8023ED38
/* 16D54C 8023EC6C 00000000 */ nop
glabel .L8023EC70
/* 16D550 8023EC70 0C091C85 */ jal func_80247214
/* 16D554 8023EC74 00000000 */ nop
/* 16D558 8023EC78 0808FB4E */ j .L8023ED38
/* 16D55C 8023EC7C 00000000 */ nop
glabel .L8023EC80
/* 16D560 8023EC80 0C0911C2 */ jal func_80244708
/* 16D564 8023EC84 00000000 */ nop
/* 16D568 8023EC88 0808FB4E */ j .L8023ED38
/* 16D56C 8023EC8C 00000000 */ nop
glabel .L8023EC90
/* 16D570 8023EC90 0C091364 */ jal func_80244D90
/* 16D574 8023EC94 00000000 */ nop
/* 16D578 8023EC98 0808FB4E */ j .L8023ED38
/* 16D57C 8023EC9C 00000000 */ nop
glabel .L8023ECA0
/* 16D580 8023ECA0 0C0916B2 */ jal func_80245AC8
/* 16D584 8023ECA4 00000000 */ nop
/* 16D588 8023ECA8 0808FB4E */ j .L8023ED38
/* 16D58C 8023ECAC 00000000 */ nop
glabel .L8023ECB0
/* 16D590 8023ECB0 0C09150E */ jal D_80245438
/* 16D594 8023ECB4 00000000 */ nop
/* 16D598 8023ECB8 0808FB4E */ j .L8023ED38
/* 16D59C 8023ECBC 00000000 */ nop
glabel .L8023ECC0
/* 16D5A0 8023ECC0 0C0913BE */ jal func_80244EF8
/* 16D5A4 8023ECC4 00000000 */ nop
/* 16D5A8 8023ECC8 0808FB4E */ j .L8023ED38
/* 16D5AC 8023ECCC 00000000 */ nop
glabel .L8023ECD0
/* 16D5B0 8023ECD0 0C0915AC */ jal func_802456B0
/* 16D5B4 8023ECD4 00000000 */ nop
/* 16D5B8 8023ECD8 0808FB4E */ j .L8023ED38
/* 16D5BC 8023ECDC 00000000 */ nop
glabel .L8023ECE0
/* 16D5C0 8023ECE0 0C091000 */ jal D_80244000
/* 16D5C4 8023ECE4 00000000 */ nop
/* 16D5C8 8023ECE8 0808FB4E */ j .L8023ED38
/* 16D5CC 8023ECEC 00000000 */ nop
glabel .L8023ECF0
/* 16D5D0 8023ECF0 0C091292 */ jal func_80244A48
/* 16D5D4 8023ECF4 00000000 */ nop
/* 16D5D8 8023ECF8 0808FB4E */ j .L8023ED38
/* 16D5DC 8023ECFC 00000000 */ nop
glabel .L8023ED00
/* 16D5E0 8023ED00 0C0922A9 */ jal func_80248AA4
/* 16D5E4 8023ED04 00000000 */ nop
/* 16D5E8 8023ED08 0808FB4E */ j .L8023ED38
/* 16D5EC 8023ED0C 00000000 */ nop
glabel .L8023ED10
/* 16D5F0 8023ED10 0C0AACCE */ jal func_802AB338_7B2CD8
/* 16D5F4 8023ED14 00000000 */ nop
/* 16D5F8 8023ED18 0808FB4E */ j .L8023ED38
/* 16D5FC 8023ED1C 00000000 */ nop
glabel .L8023ED20
/* 16D600 8023ED20 0C09806F */ jal func_802601BC
/* 16D604 8023ED24 00000000 */ nop
/* 16D608 8023ED28 0808FB4E */ j .L8023ED38
/* 16D60C 8023ED2C 00000000 */ nop
glabel .L8023ED30
/* 16D610 8023ED30 0C09235E */ jal func_80248D78
/* 16D614 8023ED34 00000000 */ nop
glabel .L8023ED38
/* 16D618 8023ED38 0C093BC2 */ jal func_8024EF08
/* 16D61C 8023ED3C 00000000 */ nop
.L8023ED40:
/* 16D620 8023ED40 0C03A5CF */ jal draw_status_ui
/* 16D624 8023ED44 00000000 */ nop
.L8023ED48:
/* 16D628 8023ED48 8FBF0018 */ lw $ra, 0x18($sp)
/* 16D62C 8023ED4C 8FB10014 */ lw $s1, 0x14($sp)
/* 16D630 8023ED50 8FB00010 */ lw $s0, 0x10($sp)
/* 16D634 8023ED54 03E00008 */ jr $ra
/* 16D638 8023ED58 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void btl_draw_ui(void) {
s32 changed = FALSE;
s32 state;
do { } while (0); // TODO required to match (probably can be removed with some sort of control flow inversion)
// do not draw UI during the frame of a state change
state = gBattleState;
if (gBattleState != gLastDrawBattleState) {
state = gLastDrawBattleState;
gLastDrawBattleState = gBattleState;
changed = TRUE;
} else {
switch (state) {
case BATTLE_STATE_NEGATIVE_1:
btl_update_starpoints_display();
btl_draw_enemy_health_bars();
draw_status_ui();
return;
case BATTLE_STATE_0:
return;
}
}
btl_update_starpoints_display();
btl_draw_enemy_health_bars();
if (!changed) {
switch (state) {
case BATTLE_STATE_NORMAL_START:
btl_state_draw_normal_start();
break;
case BATTLE_STATE_BEGIN_PLAYER_TURN:
btl_state_draw_begin_player_turn();
break;
case BATTLE_STATE_BEGIN_PARTNER_TURN:
btl_state_draw_begin_partner_turn();
break;
case BATTLE_STATE_9:
btl_state_draw_9();
break;
case BATTLE_STATE_BEGIN_TURN:
btl_state_draw_begin_turn();
break;
case BATTLE_STATE_END_TURN:
btl_state_draw_end_turn();
break;
case BATTLE_STATE_SWITCH_TO_PLAYER:
btl_state_draw_switch_to_player();
break;
case BATTLE_STATE_SWITCH_TO_PARTNER:
btl_state_draw_switch_to_partner();
break;
case BATTLE_STATE_PREPARE_MENU:
btl_state_draw_prepare_menu();
break;
case BATTLE_STATE_PLAYER_MENU:
btl_state_draw_player_menu();
break;
case BATTLE_STATE_PARTNER_MENU:
btl_state_draw_partner_menu();
break;
case BATTLE_STATE_TWINK_MENU:
btl_state_draw_twink_menu();
break;
case BATTLE_STATE_PEACH_MENU:
btl_state_draw_peach_menu();
break;
case BATTLE_STATE_SELECT_TARGET:
btl_state_draw_select_target();
break;
case BATTLE_STATE_PLAYER_MOVE:
btl_state_draw_player_move();
break;
case BATTLE_STATE_FIRST_STRIKE:
btl_state_draw_first_stike();
break;
case BATTLE_STATE_END_PLAYER_TURN:
btl_state_draw_end_player_turn();
break;
case BATTLE_STATE_END_PARTNER_TURN:
btl_state_draw_end_partner_turn();
break;
case BATTLE_STATE_PARTNER_FIRST_STRIKE:
btl_state_draw_partner_striking_first();
break;
case BATTLE_STATE_ENEMY_MOVE:
btl_state_draw_enemy_move();
break;
case BATTLE_STATE_NEXT_ENEMY:
btl_state_draw_next_enemy();
break;
case BATTLE_STATE_PARTNER_MOVE:
btl_state_draw_partner_move();
break;
case BATTLE_STATE_VICTORY:
btl_state_draw_victory();
break;
case BATTLE_STATE_END_BATTLE:
btl_state_draw_end_battle();
break;
case BATTLE_STATE_CHANGE_PARTNER:
btl_state_draw_change_partner();
break;
case BATTLE_STATE_RUN_AWAY:
btl_state_draw_run_away();
break;
case BATTLE_STATE_DEFEND:
btl_state_draw_defend();
break;
case BATTLE_STATE_DEFEAT:
btl_state_draw_defeat();
break;
case BATTLE_STATE_28:
btl_state_draw_1C();
break;
case BATTLE_STATE_END_TRAINING_BATTLE:
btl_state_draw_end_training_battle();
break;
case BATTLE_STATE_ENEMY_FIRST_STRIKE:
btl_state_draw_enemy_striking_first();
break;
case BATTLE_STATE_34:
btl_state_draw_22();
break;
case BATTLE_STATE_CELEBRATION:
btl_state_draw_celebration();
break;
case BATTLE_STATE_END_DEMO_BATTLE:
btl_state_draw_end_demo_battle();
break;
}
}
btl_popup_messages_draw_ui();
draw_status_ui();
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel dust_appendGfx
/* 33EC84 E002A3C4 27BDFEF8 */ addiu $sp, $sp, -0x108
/* 33EC88 E002A3C8 3C02DB06 */ lui $v0, (0xDB060024 >> 16)
/* 33EC8C E002A3CC 34420024 */ ori $v0, $v0, (0xDB060024 & 0xFFFF)
/* 33EC90 E002A3D0 AFB200E8 */ sw $s2, 0xE8($sp)
/* 33EC94 E002A3D4 3C12800A */ lui $s2, %hi(gMainGfxPos)
/* 33EC98 E002A3D8 2652A66C */ addiu $s2, $s2, %lo(gMainGfxPos)
/* 33EC9C E002A3DC AFBF0104 */ sw $ra, 0x104($sp)
/* 33ECA0 E002A3E0 AFBE0100 */ sw $fp, 0x100($sp)
/* 33ECA4 E002A3E4 AFB700FC */ sw $s7, 0xFC($sp)
/* 33ECA8 E002A3E8 AFB600F8 */ sw $s6, 0xF8($sp)
/* 33ECAC E002A3EC AFB500F4 */ sw $s5, 0xF4($sp)
/* 33ECB0 E002A3F0 AFB400F0 */ sw $s4, 0xF0($sp)
/* 33ECB4 E002A3F4 AFB300EC */ sw $s3, 0xEC($sp)
/* 33ECB8 E002A3F8 AFB100E4 */ sw $s1, 0xE4($sp)
/* 33ECBC E002A3FC AFB000E0 */ sw $s0, 0xE0($sp)
/* 33ECC0 E002A400 AFA40108 */ sw $a0, 0x108($sp)
/* 33ECC4 E002A404 8E490000 */ lw $t1, 0x0($s2)
/* 33ECC8 E002A408 8C90000C */ lw $s0, 0xC($a0)
/* 33ECCC E002A40C 0120202D */ daddu $a0, $t1, $zero
/* 33ECD0 E002A410 AC820000 */ sw $v0, 0x0($a0)
/* 33ECD4 E002A414 8FAB0108 */ lw $t3, 0x108($sp)
/* 33ECD8 E002A418 3C050900 */ lui $a1, %hi(D_09000D68_40DFF8)
/* 33ECDC E002A41C 24A50D68 */ addiu $a1, $a1, %lo(D_09000D68_40DFF8)
/* 33ECE0 E002A420 8D620010 */ lw $v0, 0x10($t3)
/* 33ECE4 E002A424 25290008 */ addiu $t1, $t1, 0x8
/* 33ECE8 E002A428 AE490000 */ sw $t1, 0x0($s2)
/* 33ECEC E002A42C 8C42001C */ lw $v0, 0x1C($v0)
/* 33ECF0 E002A430 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 33ECF4 E002A434 00431021 */ addu $v0, $v0, $v1
/* 33ECF8 E002A438 AC820004 */ sw $v0, 0x4($a0)
/* 33ECFC E002A43C 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 33ED00 E002A440 AD220000 */ sw $v0, 0x0($t1)
/* 33ED04 E002A444 8E020000 */ lw $v0, 0x0($s0)
/* 33ED08 E002A448 252A0008 */ addiu $t2, $t1, 0x8
/* 33ED0C E002A44C 14400003 */ bnez $v0, .LE002A45C
/* 33ED10 E002A450 AE4A0000 */ sw $t2, 0x0($s2)
/* 33ED14 E002A454 3C050900 */ lui $a1, %hi(D_09000CC0_415D20)
/* 33ED18 E002A458 24A50CC0 */ addiu $a1, $a1, %lo(D_09000CC0_415D20)
.LE002A45C:
/* 33ED1C E002A45C 25280010 */ addiu $t0, $t1, 0x10
/* 33ED20 E002A460 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 33ED24 E002A464 AD250004 */ sw $a1, 0x4($t1)
/* 33ED28 E002A468 AE480000 */ sw $t0, 0x0($s2)
/* 33ED2C E002A46C AD220008 */ sw $v0, 0x8($t1)
/* 33ED30 E002A470 92020033 */ lbu $v0, 0x33($s0)
/* 33ED34 E002A474 92050037 */ lbu $a1, 0x37($s0)
/* 33ED38 E002A478 9206003B */ lbu $a2, 0x3B($s0)
/* 33ED3C E002A47C 9207001B */ lbu $a3, 0x1B($s0)
/* 33ED40 E002A480 25230018 */ addiu $v1, $t1, 0x18
/* 33ED44 E002A484 AE430000 */ sw $v1, 0x0($s2)
/* 33ED48 E002A488 00021600 */ sll $v0, $v0, 24
/* 33ED4C E002A48C 00052C00 */ sll $a1, $a1, 16
/* 33ED50 E002A490 00451025 */ or $v0, $v0, $a1
/* 33ED54 E002A494 00063200 */ sll $a2, $a2, 8
/* 33ED58 E002A498 00461025 */ or $v0, $v0, $a2
/* 33ED5C E002A49C 00471025 */ or $v0, $v0, $a3
/* 33ED60 E002A4A0 AD420004 */ sw $v0, 0x4($t2)
/* 33ED64 E002A4A4 3C02FB00 */ lui $v0, (0xFB000000 >> 16)
/* 33ED68 E002A4A8 AD220010 */ sw $v0, 0x10($t1)
/* 33ED6C E002A4AC 9202003F */ lbu $v0, 0x3F($s0)
/* 33ED70 E002A4B0 92050043 */ lbu $a1, 0x43($s0)
/* 33ED74 E002A4B4 92030047 */ lbu $v1, 0x47($s0)
/* 33ED78 E002A4B8 00021600 */ sll $v0, $v0, 24
/* 33ED7C E002A4BC 00052C00 */ sll $a1, $a1, 16
/* 33ED80 E002A4C0 00451025 */ or $v0, $v0, $a1
/* 33ED84 E002A4C4 00031A00 */ sll $v1, $v1, 8
/* 33ED88 E002A4C8 00431025 */ or $v0, $v0, $v1
/* 33ED8C E002A4CC AD020004 */ sw $v0, 0x4($t0)
/* 33ED90 E002A4D0 8E050004 */ lw $a1, 0x4($s0)
/* 33ED94 E002A4D4 8E060008 */ lw $a2, 0x8($s0)
/* 33ED98 E002A4D8 8E07000C */ lw $a3, 0xC($s0)
/* 33ED9C E002A4DC 0C080108 */ jal shim_guTranslateF
/* 33EDA0 E002A4E0 27A40018 */ addiu $a0, $sp, 0x18
/* 33EDA4 E002A4E4 27B10058 */ addiu $s1, $sp, 0x58
/* 33EDA8 E002A4E8 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 33EDAC E002A4EC 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 33EDB0 E002A4F0 44800000 */ mtc1 $zero, $f0
/* 33EDB4 E002A4F4 00031080 */ sll $v0, $v1, 2
/* 33EDB8 E002A4F8 00431021 */ addu $v0, $v0, $v1
/* 33EDBC E002A4FC 00021080 */ sll $v0, $v0, 2
/* 33EDC0 E002A500 00431023 */ subu $v0, $v0, $v1
/* 33EDC4 E002A504 000218C0 */ sll $v1, $v0, 3
/* 33EDC8 E002A508 00431021 */ addu $v0, $v0, $v1
/* 33EDCC E002A50C 000210C0 */ sll $v0, $v0, 3
/* 33EDD0 E002A510 44060000 */ mfc1 $a2, $f0
/* 33EDD4 E002A514 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 33EDD8 E002A518 00220821 */ addu $at, $at, $v0
/* 33EDDC E002A51C C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 33EDE0 E002A520 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 33EDE4 E002A524 46000007 */ neg.s $f0, $f0
/* 33EDE8 E002A528 44050000 */ mfc1 $a1, $f0
/* 33EDEC E002A52C 0220202D */ daddu $a0, $s1, $zero
/* 33EDF0 E002A530 0C080104 */ jal shim_guRotateF
/* 33EDF4 E002A534 AFA60010 */ sw $a2, 0x10($sp)
/* 33EDF8 E002A538 0220202D */ daddu $a0, $s1, $zero
/* 33EDFC E002A53C 27A50018 */ addiu $a1, $sp, 0x18
/* 33EE00 E002A540 0C080114 */ jal shim_guMtxCatF
/* 33EE04 E002A544 27A60098 */ addiu $a2, $sp, 0x98
/* 33EE08 E002A548 8E0B0000 */ lw $t3, 0x0($s0)
/* 33EE0C E002A54C AFAB00D8 */ sw $t3, 0xD8($sp)
/* 33EE10 E002A550 8FAB0108 */ lw $t3, 0x108($sp)
/* 33EE14 E002A554 24130001 */ addiu $s3, $zero, 0x1
/* 33EE18 E002A558 8D620008 */ lw $v0, 0x8($t3)
/* 33EE1C E002A55C 0262102A */ slt $v0, $s3, $v0
/* 33EE20 E002A560 10400061 */ beqz $v0, .LE002A6E8
/* 33EE24 E002A564 26100048 */ addiu $s0, $s0, 0x48
/* 33EE28 E002A568 3C17800A */ lui $s7, %hi(gDisplayContext)
/* 33EE2C E002A56C 26F7A674 */ addiu $s7, $s7, %lo(gDisplayContext)
/* 33EE30 E002A570 3C148007 */ lui $s4, %hi(gMatrixListPos)
/* 33EE34 E002A574 269441F0 */ addiu $s4, $s4, %lo(gMatrixListPos)
/* 33EE38 E002A578 3C150001 */ lui $s5, (0x11630 >> 16)
/* 33EE3C E002A57C 36B51630 */ ori $s5, $s5, (0x11630 & 0xFFFF)
/* 33EE40 E002A580 0220B02D */ daddu $s6, $s1, $zero
/* 33EE44 E002A584 3C1EDE00 */ lui $fp, (0xDE000000 >> 16)
/* 33EE48 E002A588 2611000C */ addiu $s1, $s0, 0xC
.LE002A58C:
/* 33EE4C E002A58C 27A40018 */ addiu $a0, $sp, 0x18
/* 33EE50 E002A590 8E250014 */ lw $a1, 0x14($s1)
/* 33EE54 E002A594 8E260010 */ lw $a2, 0x10($s1)
/* 33EE58 E002A598 96820000 */ lhu $v0, 0x0($s4)
/* 33EE5C E002A59C 00A0382D */ daddu $a3, $a1, $zero
/* 33EE60 E002A5A0 24430001 */ addiu $v1, $v0, 0x1
/* 33EE64 E002A5A4 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 33EE68 E002A5A8 00021180 */ sll $v0, $v0, 6
/* 33EE6C E002A5AC A6830000 */ sh $v1, 0x0($s4)
/* 33EE70 E002A5B0 8EF00000 */ lw $s0, 0x0($s7)
/* 33EE74 E002A5B4 00551021 */ addu $v0, $v0, $s5
/* 33EE78 E002A5B8 0C080110 */ jal shim_guScaleF
/* 33EE7C E002A5BC 02028021 */ addu $s0, $s0, $v0
/* 33EE80 E002A5C0 27A40018 */ addiu $a0, $sp, 0x18
/* 33EE84 E002A5C4 0C080118 */ jal shim_guMtxF2L
/* 33EE88 E002A5C8 0200282D */ daddu $a1, $s0, $zero
/* 33EE8C E002A5CC 8E25FFF8 */ lw $a1, -0x8($s1)
/* 33EE90 E002A5D0 8E26FFFC */ lw $a2, -0x4($s1)
/* 33EE94 E002A5D4 8E270000 */ lw $a3, 0x0($s1)
/* 33EE98 E002A5D8 0C080108 */ jal shim_guTranslateF
/* 33EE9C E002A5DC 02C0202D */ daddu $a0, $s6, $zero
/* 33EEA0 E002A5E0 02C0202D */ daddu $a0, $s6, $zero
/* 33EEA4 E002A5E4 27A50098 */ addiu $a1, $sp, 0x98
/* 33EEA8 E002A5E8 0C080114 */ jal shim_guMtxCatF
/* 33EEAC E002A5EC 27A60018 */ addiu $a2, $sp, 0x18
/* 33EEB0 E002A5F0 27A40018 */ addiu $a0, $sp, 0x18
/* 33EEB4 E002A5F4 96850000 */ lhu $a1, 0x0($s4)
/* 33EEB8 E002A5F8 8EE20000 */ lw $v0, 0x0($s7)
/* 33EEBC E002A5FC 00052980 */ sll $a1, $a1, 6
/* 33EEC0 E002A600 00B52821 */ addu $a1, $a1, $s5
/* 33EEC4 E002A604 0C080118 */ jal shim_guMtxF2L
/* 33EEC8 E002A608 00452821 */ addu $a1, $v0, $a1
/* 33EECC E002A60C 3C05DA38 */ lui $a1, (0xDA380001 >> 16)
/* 33EED0 E002A610 8E460000 */ lw $a2, 0x0($s2)
/* 33EED4 E002A614 34A50001 */ ori $a1, $a1, (0xDA380001 & 0xFFFF)
/* 33EED8 E002A618 00C0202D */ daddu $a0, $a2, $zero
/* 33EEDC E002A61C 24C60008 */ addiu $a2, $a2, 0x8
/* 33EEE0 E002A620 AE460000 */ sw $a2, 0x0($s2)
/* 33EEE4 E002A624 96820000 */ lhu $v0, 0x0($s4)
/* 33EEE8 E002A628 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 33EEEC E002A62C AC830000 */ sw $v1, 0x0($a0)
/* 33EEF0 E002A630 24430001 */ addiu $v1, $v0, 0x1
/* 33EEF4 E002A634 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 33EEF8 E002A638 00021180 */ sll $v0, $v0, 6
/* 33EEFC E002A63C A6830000 */ sh $v1, 0x0($s4)
/* 33EF00 E002A640 8EE30000 */ lw $v1, 0x0($s7)
/* 33EF04 E002A644 00551021 */ addu $v0, $v0, $s5
/* 33EF08 E002A648 00621821 */ addu $v1, $v1, $v0
/* 33EF0C E002A64C 24C20008 */ addiu $v0, $a2, 0x8
/* 33EF10 E002A650 AC830004 */ sw $v1, 0x4($a0)
/* 33EF14 E002A654 AE420000 */ sw $v0, 0x0($s2)
/* 33EF18 E002A658 ACC50000 */ sw $a1, 0x0($a2)
/* 33EF1C E002A65C ACD00004 */ sw $s0, 0x4($a2)
/* 33EF20 E002A660 8FAB00D8 */ lw $t3, 0xD8($sp)
/* 33EF24 E002A664 29620002 */ slti $v0, $t3, 0x2
/* 33EF28 E002A668 1040000B */ beqz $v0, .LE002A698
/* 33EF2C E002A66C 24C20010 */ addiu $v0, $a2, 0x10
/* 33EF30 E002A670 3C030900 */ lui $v1, %hi(D_09000E38_40E0C8)
/* 33EF34 E002A674 24630E38 */ addiu $v1, $v1, %lo(D_09000E38_40E0C8)
/* 33EF38 E002A678 AE420000 */ sw $v0, 0x0($s2)
/* 33EF3C E002A67C 32620001 */ andi $v0, $s3, 0x1
/* 33EF40 E002A680 10400003 */ beqz $v0, .LE002A690
/* 33EF44 E002A684 ACDE0008 */ sw $fp, 0x8($a2)
/* 33EF48 E002A688 3C030900 */ lui $v1, %hi(D_09000E18_40E0A8)
/* 33EF4C E002A68C 24630E18 */ addiu $v1, $v1, %lo(D_09000E18_40E0A8)
.LE002A690:
/* 33EF50 E002A690 0800A9AB */ j .LE002A6AC
/* 33EF54 E002A694 ACC3000C */ sw $v1, 0xC($a2)
.LE002A698:
/* 33EF58 E002A698 AE420000 */ sw $v0, 0x0($s2)
/* 33EF5C E002A69C 3C020900 */ lui $v0, %hi(D_09000E58_40E0E8)
/* 33EF60 E002A6A0 24420E58 */ addiu $v0, $v0, %lo(D_09000E58_40E0E8)
/* 33EF64 E002A6A4 ACDE0008 */ sw $fp, 0x8($a2)
/* 33EF68 E002A6A8 ACC2000C */ sw $v0, 0xC($a2)
.LE002A6AC:
/* 33EF6C E002A6AC 3C02D838 */ lui $v0, (0xD8380002 >> 16)
/* 33EF70 E002A6B0 34420002 */ ori $v0, $v0, (0xD8380002 & 0xFFFF)
/* 33EF74 E002A6B4 8E440000 */ lw $a0, 0x0($s2)
/* 33EF78 E002A6B8 26730001 */ addiu $s3, $s3, 0x1
/* 33EF7C E002A6BC 0080182D */ daddu $v1, $a0, $zero
/* 33EF80 E002A6C0 AC620000 */ sw $v0, 0x0($v1)
/* 33EF84 E002A6C4 24020040 */ addiu $v0, $zero, 0x40
/* 33EF88 E002A6C8 AC620004 */ sw $v0, 0x4($v1)
/* 33EF8C E002A6CC 8FAB0108 */ lw $t3, 0x108($sp)
/* 33EF90 E002A6D0 26310048 */ addiu $s1, $s1, 0x48
/* 33EF94 E002A6D4 8D620008 */ lw $v0, 0x8($t3)
/* 33EF98 E002A6D8 24840008 */ addiu $a0, $a0, 0x8
/* 33EF9C E002A6DC 0262102A */ slt $v0, $s3, $v0
/* 33EFA0 E002A6E0 1440FFAA */ bnez $v0, .LE002A58C
/* 33EFA4 E002A6E4 AE440000 */ sw $a0, 0x0($s2)
.LE002A6E8:
/* 33EFA8 E002A6E8 8FBF0104 */ lw $ra, 0x104($sp)
/* 33EFAC E002A6EC 8FBE0100 */ lw $fp, 0x100($sp)
/* 33EFB0 E002A6F0 8FB700FC */ lw $s7, 0xFC($sp)
/* 33EFB4 E002A6F4 8FB600F8 */ lw $s6, 0xF8($sp)
/* 33EFB8 E002A6F8 8FB500F4 */ lw $s5, 0xF4($sp)
/* 33EFBC E002A6FC 8FB400F0 */ lw $s4, 0xF0($sp)
/* 33EFC0 E002A700 8FB300EC */ lw $s3, 0xEC($sp)
/* 33EFC4 E002A704 8FB200E8 */ lw $s2, 0xE8($sp)
/* 33EFC8 E002A708 8FB100E4 */ lw $s1, 0xE4($sp)
/* 33EFCC E002A70C 8FB000E0 */ lw $s0, 0xE0($sp)
/* 33EFD0 E002A710 03E00008 */ jr $ra
/* 33EFD4 E002A714 27BD0108 */ addiu $sp, $sp, 0x108
/* 33EFD8 E002A718 00000000 */ nop
/* 33EFDC E002A71C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void dust_appendGfx(void* effect) {
DustFXData* part = ((EffectInstance*)effect)->data.dust;
s32 unk_00;
Matrix4f sp18;
Matrix4f sp58;
Matrix4f sp98;
Mtx* matrix;
s32 i;
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, part->unk_00 == 0 ? D_09000CC0_33FCC0 : D_09000D68_33FD68);
gDPSetPrimColor(gMainGfxPos++, 0, 0, part->unk_30, part->unk_34, part->unk_38, part->unk_18);
gDPSetEnvColor(gMainGfxPos++, part->unk_3C, part->unk_40, part->unk_44, 0);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98);
unk_00 = part->unk_00;
part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
matrix = &gDisplayContext->matrixStack[gMatrixListPos++];
shim_guScaleF(sp18, part->unk_20, part->unk_1C, part->unk_20);
shim_guMtxF2L(sp18, matrix);
shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxCatF(sp58, sp98, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, matrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (unk_00 < 2) {
gSPDisplayList(gMainGfxPos++, (i % 2) ? D_09000E18_33FE18 : D_09000E38_33FE38);
} else {
gSPDisplayList(gMainGfxPos++, D_09000E58_33FE58);
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel static_status_update
/* 3E0AB4 E00E6184 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 3E0AB8 E00E6188 AFB20018 */ sw $s2, 0x18($sp)
/* 3E0ABC E00E618C 0080902D */ daddu $s2, $a0, $zero
/* 3E0AC0 E00E6190 AFBF0030 */ sw $ra, 0x30($sp)
/* 3E0AC4 E00E6194 AFB7002C */ sw $s7, 0x2C($sp)
/* 3E0AC8 E00E6198 AFB60028 */ sw $s6, 0x28($sp)
/* 3E0ACC E00E619C AFB50024 */ sw $s5, 0x24($sp)
/* 3E0AD0 E00E61A0 AFB40020 */ sw $s4, 0x20($sp)
/* 3E0AD4 E00E61A4 AFB3001C */ sw $s3, 0x1C($sp)
/* 3E0AD8 E00E61A8 AFB10014 */ sw $s1, 0x14($sp)
/* 3E0ADC E00E61AC AFB00010 */ sw $s0, 0x10($sp)
/* 3E0AE0 E00E61B0 F7BC0058 */ sdc1 $f28, 0x58($sp)
/* 3E0AE4 E00E61B4 F7BA0050 */ sdc1 $f26, 0x50($sp)
/* 3E0AE8 E00E61B8 F7B80048 */ sdc1 $f24, 0x48($sp)
/* 3E0AEC E00E61BC F7B60040 */ sdc1 $f22, 0x40($sp)
/* 3E0AF0 E00E61C0 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 3E0AF4 E00E61C4 8E430000 */ lw $v1, 0x0($s2)
/* 3E0AF8 E00E61C8 8E45000C */ lw $a1, 0xC($s2)
/* 3E0AFC E00E61CC 30620010 */ andi $v0, $v1, 0x10
/* 3E0B00 E00E61D0 8CB30000 */ lw $s3, 0x0($a1)
/* 3E0B04 E00E61D4 10400005 */ beqz $v0, .LE00E61EC
/* 3E0B08 E00E61D8 2402FFEF */ addiu $v0, $zero, -0x11
/* 3E0B0C E00E61DC 00621024 */ and $v0, $v1, $v0
/* 3E0B10 E00E61E0 AE420000 */ sw $v0, 0x0($s2)
/* 3E0B14 E00E61E4 24020010 */ addiu $v0, $zero, 0x10
/* 3E0B18 E00E61E8 ACA20028 */ sw $v0, 0x28($a1)
.LE00E61EC:
/* 3E0B1C E00E61EC 8CA30028 */ lw $v1, 0x28($a1)
/* 3E0B20 E00E61F0 286203E8 */ slti $v0, $v1, 0x3E8
/* 3E0B24 E00E61F4 10400002 */ beqz $v0, .LE00E6200
/* 3E0B28 E00E61F8 2462FFFF */ addiu $v0, $v1, -0x1
/* 3E0B2C E00E61FC ACA20028 */ sw $v0, 0x28($a1)
.LE00E6200:
/* 3E0B30 E00E6200 8CA2002C */ lw $v0, 0x2C($a1)
/* 3E0B34 E00E6204 8CA40028 */ lw $a0, 0x28($a1)
/* 3E0B38 E00E6208 24420001 */ addiu $v0, $v0, 0x1
/* 3E0B3C E00E620C 04810005 */ bgez $a0, .LE00E6224
/* 3E0B40 E00E6210 ACA2002C */ sw $v0, 0x2C($a1)
/* 3E0B44 E00E6214 0C080128 */ jal shim_remove_effect
/* 3E0B48 E00E6218 0240202D */ daddu $a0, $s2, $zero
/* 3E0B4C E00E621C 08039925 */ j .LE00E6494
/* 3E0B50 E00E6220 00000000 */ nop
.LE00E6224:
/* 3E0B54 E00E6224 0040A82D */ daddu $s5, $v0, $zero
/* 3E0B58 E00E6228 28820010 */ slti $v0, $a0, 0x10
/* 3E0B5C E00E622C 10400002 */ beqz $v0, .LE00E6238
/* 3E0B60 E00E6230 00041100 */ sll $v0, $a0, 4
/* 3E0B64 E00E6234 ACA20030 */ sw $v0, 0x30($a1)
.LE00E6238:
/* 3E0B68 E00E6238 16600009 */ bnez $s3, .LE00E6260
/* 3E0B6C E00E623C 24A50038 */ addiu $a1, $a1, 0x38
/* 3E0B70 E00E6240 3C013DCC */ lui $at, (0x3DCCCCCD >> 16)
/* 3E0B74 E00E6244 3421CCCD */ ori $at, $at, (0x3DCCCCCD & 0xFFFF)
/* 3E0B78 E00E6248 4481C000 */ mtc1 $at, $f24
/* 3E0B7C E00E624C 3C013E4C */ lui $at, (0x3E4CCCCD >> 16)
/* 3E0B80 E00E6250 3421CCCD */ ori $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 3E0B84 E00E6254 4481B000 */ mtc1 $at, $f22
/* 3E0B88 E00E6258 0803989D */ j .LE00E6274
/* 3E0B8C E00E625C 00000000 */ nop
.LE00E6260:
/* 3E0B90 E00E6260 3C013E4C */ lui $at, (0x3E4CCCCD >> 16)
/* 3E0B94 E00E6264 3421CCCD */ ori $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 3E0B98 E00E6268 4481B000 */ mtc1 $at, $f22
/* 3E0B9C E00E626C 00000000 */ nop
/* 3E0BA0 E00E6270 4600B606 */ mov.s $f24, $f22
.LE00E6274:
/* 3E0BA4 E00E6274 8E420008 */ lw $v0, 0x8($s2)
/* 3E0BA8 E00E6278 24110001 */ addiu $s1, $zero, 0x1
/* 3E0BAC E00E627C 0222102A */ slt $v0, $s1, $v0
/* 3E0BB0 E00E6280 10400084 */ beqz $v0, .LE00E6494
/* 3E0BB4 E00E6284 00131080 */ sll $v0, $s3, 2
/* 3E0BB8 E00E6288 3C03E00E */ lui $v1, %hi(D_E00E6890)
/* 3E0BBC E00E628C 24636890 */ addiu $v1, $v1, %lo(D_E00E6890)
/* 3E0BC0 E00E6290 0043A021 */ addu $s4, $v0, $v1
/* 3E0BC4 E00E6294 3C17E00E */ lui $s7, %hi(D_E00E6898)
/* 3E0BC8 E00E6298 26F76898 */ addiu $s7, $s7, %lo(D_E00E6898)
/* 3E0BCC E00E629C 3C16E00E */ lui $s6, %hi(D_E00E6910)
/* 3E0BD0 E00E62A0 26D66910 */ addiu $s6, $s6, %lo(D_E00E6910)
/* 3E0BD4 E00E62A4 24B00014 */ addiu $s0, $a1, 0x14
/* 3E0BD8 E00E62A8 3C014180 */ lui $at, (0x41800000 >> 16)
/* 3E0BDC E00E62AC 4481E000 */ mtc1 $at, $f28
/* 3E0BE0 E00E62B0 3C01E00E */ lui $at, (0xE00E6990 >> 16)
/* 3E0BE4 E00E62B4 D43A6990 */ ldc1 $f26, (0xE00E6990 & 0xFFFF)($at)
.LE00E62B8:
/* 3E0BE8 E00E62B8 8E02000C */ lw $v0, 0xC($s0)
/* 3E0BEC E00E62BC 24420001 */ addiu $v0, $v0, 0x1
/* 3E0BF0 E00E62C0 AE02000C */ sw $v0, 0xC($s0)
/* 3E0BF4 E00E62C4 8E830000 */ lw $v1, 0x0($s4)
/* 3E0BF8 E00E62C8 0043102A */ slt $v0, $v0, $v1
/* 3E0BFC E00E62CC 50400001 */ beql $v0, $zero, .LE00E62D4
/* 3E0C00 E00E62D0 AE00000C */ sw $zero, 0xC($s0)
.LE00E62D4:
/* 3E0C04 E00E62D4 8E02000C */ lw $v0, 0xC($s0)
/* 3E0C08 E00E62D8 0442006A */ bltzl $v0, .LE00E6484
/* 3E0C0C E00E62DC 26310001 */ addiu $s1, $s1, 0x1
/* 3E0C10 E00E62E0 1440002A */ bnez $v0, .LE00E638C
/* 3E0C14 E00E62E4 00000000 */ nop
/* 3E0C18 E00E62E8 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 3E0C1C E00E62EC 44810000 */ mtc1 $at, $f0
/* 3E0C20 E00E62F0 4491A000 */ mtc1 $s1, $f20
/* 3E0C24 E00E62F4 00000000 */ nop
/* 3E0C28 E00E62F8 4680A520 */ cvt.s.w $f20, $f20
/* 3E0C2C E00E62FC 4600A502 */ mul.s $f20, $f20, $f0
/* 3E0C30 E00E6300 00000000 */ nop
/* 3E0C34 E00E6304 8E420008 */ lw $v0, 0x8($s2)
/* 3E0C38 E00E6308 2442FFFF */ addiu $v0, $v0, -0x1
/* 3E0C3C E00E630C 44820000 */ mtc1 $v0, $f0
/* 3E0C40 E00E6310 00000000 */ nop
/* 3E0C44 E00E6314 46800020 */ cvt.s.w $f0, $f0
/* 3E0C48 E00E6318 4600A503 */ div.s $f20, $f20, $f0
/* 3E0C4C E00E631C 0C080140 */ jal shim_sin_deg
/* 3E0C50 E00E6320 4600A306 */ mov.s $f12, $f20
/* 3E0C54 E00E6324 461C0002 */ mul.s $f0, $f0, $f28
/* 3E0C58 E00E6328 00000000 */ nop
/* 3E0C5C E00E632C 4600A306 */ mov.s $f12, $f20
/* 3E0C60 E00E6330 0C080144 */ jal shim_cos_deg
/* 3E0C64 E00E6334 E600FFF0 */ swc1 $f0, -0x10($s0)
/* 3E0C68 E00E6338 461C0002 */ mul.s $f0, $f0, $f28
/* 3E0C6C E00E633C 00000000 */ nop
/* 3E0C70 E00E6340 C606FFF0 */ lwc1 $f6, -0x10($s0)
/* 3E0C74 E00E6344 46183182 */ mul.s $f6, $f6, $f24
/* 3E0C78 E00E6348 00000000 */ nop
/* 3E0C7C E00E634C E600FFF4 */ swc1 $f0, -0xC($s0)
/* 3E0C80 E00E6350 46000106 */ mov.s $f4, $f0
/* 3E0C84 E00E6354 46182102 */ mul.s $f4, $f4, $f24
/* 3E0C88 E00E6358 00000000 */ nop
/* 3E0C8C E00E635C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3E0C90 E00E6360 44811000 */ mtc1 $at, $f2
/* 3E0C94 E00E6364 3C014234 */ lui $at, (0x42340000 >> 16)
/* 3E0C98 E00E6368 44810000 */ mtc1 $at, $f0
/* 3E0C9C E00E636C 4600A507 */ neg.s $f20, $f20
/* 3E0CA0 E00E6370 AE000004 */ sw $zero, 0x4($s0)
/* 3E0CA4 E00E6374 AE000008 */ sw $zero, 0x8($s0)
/* 3E0CA8 E00E6378 4600A501 */ sub.s $f20, $f20, $f0
/* 3E0CAC E00E637C E6020020 */ swc1 $f2, 0x20($s0)
/* 3E0CB0 E00E6380 E606FFFC */ swc1 $f6, -0x4($s0)
/* 3E0CB4 E00E6384 E6140010 */ swc1 $f20, 0x10($s0)
/* 3E0CB8 E00E6388 E6040000 */ swc1 $f4, 0x0($s0)
.LE00E638C:
/* 3E0CBC E00E638C 16600008 */ bnez $s3, .LE00E63B0
/* 3E0CC0 E00E6390 00000000 */ nop
/* 3E0CC4 E00E6394 8E02000C */ lw $v0, 0xC($s0)
/* 3E0CC8 E00E6398 3C03E00E */ lui $v1, (0xE00E68F8 >> 16)
/* 3E0CCC E00E639C 00621821 */ addu $v1, $v1, $v0
/* 3E0CD0 E00E63A0 906368F8 */ lbu $v1, (0xE00E68F8 & 0xFFFF)($v1)
/* 3E0CD4 E00E63A4 00021080 */ sll $v0, $v0, 2
/* 3E0CD8 E00E63A8 080398F2 */ j .LE00E63C8
/* 3E0CDC E00E63AC 00571021 */ addu $v0, $v0, $s7
.LE00E63B0:
/* 3E0CE0 E00E63B0 8E02000C */ lw $v0, 0xC($s0)
/* 3E0CE4 E00E63B4 3C03E00E */ lui $v1, (0xE00E6970 >> 16)
/* 3E0CE8 E00E63B8 00621821 */ addu $v1, $v1, $v0
/* 3E0CEC E00E63BC 90636970 */ lbu $v1, (0xE00E6970 & 0xFFFF)($v1)
/* 3E0CF0 E00E63C0 00021080 */ sll $v0, $v0, 2
/* 3E0CF4 E00E63C4 00561021 */ addu $v0, $v0, $s6
.LE00E63C8:
/* 3E0CF8 E00E63C8 AE03001C */ sw $v1, 0x1C($s0)
/* 3E0CFC E00E63CC C4400000 */ lwc1 $f0, 0x0($v0)
/* 3E0D00 E00E63D0 32A30001 */ andi $v1, $s5, 0x1
/* 3E0D04 E00E63D4 32220001 */ andi $v0, $s1, 0x1
/* 3E0D08 E00E63D8 14620009 */ bne $v1, $v0, .LE00E6400
/* 3E0D0C E00E63DC E6000020 */ swc1 $f0, 0x20($s0)
/* 3E0D10 E00E63E0 C604FFF0 */ lwc1 $f4, -0x10($s0)
/* 3E0D14 E00E63E4 C600FFFC */ lwc1 $f0, -0x4($s0)
/* 3E0D18 E00E63E8 C602FFF4 */ lwc1 $f2, -0xC($s0)
/* 3E0D1C E00E63EC 46002100 */ add.s $f4, $f4, $f0
/* 3E0D20 E00E63F0 C6000000 */ lwc1 $f0, 0x0($s0)
/* 3E0D24 E00E63F4 46001080 */ add.s $f2, $f2, $f0
/* 3E0D28 E00E63F8 08039911 */ j .LE00E6444
/* 3E0D2C E00E63FC E604FFF0 */ swc1 $f4, -0x10($s0)
.LE00E6400:
/* 3E0D30 E00E6400 C606FFFC */ lwc1 $f6, -0x4($s0)
/* 3E0D34 E00E6404 460031A1 */ cvt.d.s $f6, $f6
/* 3E0D38 E00E6408 463A3182 */ mul.d $f6, $f6, $f26
/* 3E0D3C E00E640C 00000000 */ nop
/* 3E0D40 E00E6410 C6040000 */ lwc1 $f4, 0x0($s0)
/* 3E0D44 E00E6414 46002121 */ cvt.d.s $f4, $f4
/* 3E0D48 E00E6418 463A2102 */ mul.d $f4, $f4, $f26
/* 3E0D4C E00E641C 00000000 */ nop
/* 3E0D50 E00E6420 C600FFF0 */ lwc1 $f0, -0x10($s0)
/* 3E0D54 E00E6424 C602FFF4 */ lwc1 $f2, -0xC($s0)
/* 3E0D58 E00E6428 46000021 */ cvt.d.s $f0, $f0
/* 3E0D5C E00E642C 46260000 */ add.d $f0, $f0, $f6
/* 3E0D60 E00E6430 460010A1 */ cvt.d.s $f2, $f2
/* 3E0D64 E00E6434 46241080 */ add.d $f2, $f2, $f4
/* 3E0D68 E00E6438 46200020 */ cvt.s.d $f0, $f0
/* 3E0D6C E00E643C 462010A0 */ cvt.s.d $f2, $f2
/* 3E0D70 E00E6440 E600FFF0 */ swc1 $f0, -0x10($s0)
.LE00E6444:
/* 3E0D74 E00E6444 E602FFF4 */ swc1 $f2, -0xC($s0)
/* 3E0D78 E00E6448 C6040004 */ lwc1 $f4, 0x4($s0)
/* 3E0D7C E00E644C C606FFFC */ lwc1 $f6, -0x4($s0)
/* 3E0D80 E00E6450 46062101 */ sub.s $f4, $f4, $f6
/* 3E0D84 E00E6454 46162102 */ mul.s $f4, $f4, $f22
/* 3E0D88 E00E6458 00000000 */ nop
/* 3E0D8C E00E645C C6000008 */ lwc1 $f0, 0x8($s0)
/* 3E0D90 E00E6460 C6020000 */ lwc1 $f2, 0x0($s0)
/* 3E0D94 E00E6464 46020001 */ sub.s $f0, $f0, $f2
/* 3E0D98 E00E6468 46160002 */ mul.s $f0, $f0, $f22
/* 3E0D9C E00E646C 00000000 */ nop
/* 3E0DA0 E00E6470 46043180 */ add.s $f6, $f6, $f4
/* 3E0DA4 E00E6474 46001080 */ add.s $f2, $f2, $f0
/* 3E0DA8 E00E6478 E606FFFC */ swc1 $f6, -0x4($s0)
/* 3E0DAC E00E647C E6020000 */ swc1 $f2, 0x0($s0)
/* 3E0DB0 E00E6480 26310001 */ addiu $s1, $s1, 0x1
.LE00E6484:
/* 3E0DB4 E00E6484 8E420008 */ lw $v0, 0x8($s2)
/* 3E0DB8 E00E6488 0222102A */ slt $v0, $s1, $v0
/* 3E0DBC E00E648C 1440FF8A */ bnez $v0, .LE00E62B8
/* 3E0DC0 E00E6490 26100038 */ addiu $s0, $s0, 0x38
.LE00E6494:
/* 3E0DC4 E00E6494 8FBF0030 */ lw $ra, 0x30($sp)
/* 3E0DC8 E00E6498 8FB7002C */ lw $s7, 0x2C($sp)
/* 3E0DCC E00E649C 8FB60028 */ lw $s6, 0x28($sp)
/* 3E0DD0 E00E64A0 8FB50024 */ lw $s5, 0x24($sp)
/* 3E0DD4 E00E64A4 8FB40020 */ lw $s4, 0x20($sp)
/* 3E0DD8 E00E64A8 8FB3001C */ lw $s3, 0x1C($sp)
/* 3E0DDC E00E64AC 8FB20018 */ lw $s2, 0x18($sp)
/* 3E0DE0 E00E64B0 8FB10014 */ lw $s1, 0x14($sp)
/* 3E0DE4 E00E64B4 8FB00010 */ lw $s0, 0x10($sp)
/* 3E0DE8 E00E64B8 D7BC0058 */ ldc1 $f28, 0x58($sp)
/* 3E0DEC E00E64BC D7BA0050 */ ldc1 $f26, 0x50($sp)
/* 3E0DF0 E00E64C0 D7B80048 */ ldc1 $f24, 0x48($sp)
/* 3E0DF4 E00E64C4 D7B60040 */ ldc1 $f22, 0x40($sp)
/* 3E0DF8 E00E64C8 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 3E0DFC E00E64CC 03E00008 */ jr $ra
/* 3E0E00 E00E64D0 27BD0060 */ addiu $sp, $sp, 0x60
### DECOMPILED C INSTRUCTIONS:
void static_status_update(EffectInstance* effect) {
StaticStatusFXData* part = effect->data.staticStatus;
s32 type = part->type;
s32 unk_28;
s32 time;
f32 interpAmt;
f32 initialAmt;
f32 angle;
s32 i;
if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
part->timeLeft = 16;
}
if (part->timeLeft < 1000) {
part->timeLeft--;
}
part->lifetime++;
if (part->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
time = part->lifetime;
if (part->timeLeft < 16) {
part->alpha = part->timeLeft * 16;
}
if (type == 0) {
initialAmt = 0.1f;
interpAmt = 0.2f;
} else {
initialAmt = 0.2f;
interpAmt = 0.2f;
}
part++;
for (i = 1; i < effect->numParts; i++, part++) {
part->frame++;
if (part->frame >= StaticEffectFrameCount[type]) {
part->frame = 0;
}
if (part->frame >= 0) {
if (part->frame == 0) {
angle = (i * 360.0f) / (effect->numParts - 1);
part->pos.x = shim_sin_deg(angle) * 16.0f;
part->pos.y = shim_cos_deg(angle) * 16.0f;
part->unk_10 = part->pos.x * initialAmt;
part->unk_14 = part->pos.y * initialAmt;
part->unk_18 = 0.0f;
part->unk_1C = 0.0f;
part->scale = 1.0f;
part->rotation = -angle - 45.0f;
}
if (type == 0) {
part->alpha = StaticEffectAlphaVals0[part->frame];
part->scale = StaticEffectScaleVals0[part->frame];
} else {
part->alpha = StaticEffectAlphaVals1[part->frame];
part->scale = StaticEffectScaleVals1[part->frame];
}
if ((time & 1) == (i & 1)) {
part->pos.x += part->unk_10;
part->pos.y += part->unk_14;
} else {
part->pos.x += part->unk_10 * 0.2;
part->pos.y += part->unk_14 * 0.2;
}
part->unk_10 += (part->unk_18 - part->unk_10) * interpAmt;
part->unk_14 += (part->unk_1C - part->unk_14) * interpAmt;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel state_step_language_select
/* 105C8 800351C8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 105CC 800351CC AFB10014 */ sw $s1, 0x14($sp)
/* 105D0 800351D0 3C11800A */ lui $s1, %hi(D_800A0931)
/* 105D4 800351D4 26310931 */ addiu $s1, $s1, %lo(D_800A0931)
/* 105D8 800351D8 AFBF0020 */ sw $ra, 0x20($sp)
/* 105DC 800351DC AFB3001C */ sw $s3, 0x1C($sp)
/* 105E0 800351E0 AFB20018 */ sw $s2, 0x18($sp)
/* 105E4 800351E4 AFB00010 */ sw $s0, 0x10($sp)
/* 105E8 800351E8 82230000 */ lb $v1, 0x0($s1)
/* 105EC 800351EC 24120001 */ addiu $s2, $zero, 0x1
/* 105F0 800351F0 10720030 */ beq $v1, $s2, .L800352B4
/* 105F4 800351F4 28620002 */ slti $v0, $v1, 0x2
/* 105F8 800351F8 10400005 */ beqz $v0, .L80035210
/* 105FC 800351FC 24130002 */ addiu $s3, $zero, 0x2
/* 10600 80035200 10600009 */ beqz $v1, .L80035228
/* 10604 80035204 00000000 */ nop
/* 10608 80035208 0800D534 */ j .L800354D0
/* 1060C 8003520C 00000000 */ nop
.L80035210:
/* 10610 80035210 10730033 */ beq $v1, $s3, .L800352E0
/* 10614 80035214 24020003 */ addiu $v0, $zero, 0x3
/* 10618 80035218 10620055 */ beq $v1, $v0, .L80035370
/* 1061C 8003521C 00000000 */ nop
/* 10620 80035220 0800D534 */ j .L800354D0
/* 10624 80035224 00000000 */ nop
.L80035228:
/* 10628 80035228 0C037DD0 */ jal update_player
/* 1062C 8003522C 00000000 */ nop
/* 10630 80035230 0C00E64C */ jal update_npcs
/* 10634 80035234 00000000 */ nop
/* 10638 80035238 0C00F949 */ jal update_encounters
/* 1063C 8003523C 00000000 */ nop
/* 10640 80035240 0C016754 */ jal update_effects
/* 10644 80035244 00000000 */ nop
/* 10648 80035248 3C10800A */ lui $s0, %hi(D_800A0932)
/* 1064C 8003524C 26100932 */ addiu $s0, $s0, %lo(D_800A0932)
/* 10650 80035250 86020000 */ lh $v0, 0x0($s0)
/* 10654 80035254 96030000 */ lhu $v1, 0x0($s0)
/* 10658 80035258 284200FF */ slti $v0, $v0, 0xFF
/* 1065C 8003525C 10400013 */ beqz $v0, .L800352AC
/* 10660 80035260 24620014 */ addiu $v0, $v1, 0x14
/* 10664 80035264 A6020000 */ sh $v0, 0x0($s0)
/* 10668 80035268 00021400 */ sll $v0, $v0, 16
/* 1066C 8003526C 00021403 */ sra $v0, $v0, 16
/* 10670 80035270 28420100 */ slti $v0, $v0, 0x100
/* 10674 80035274 14400002 */ bnez $v0, .L80035280
/* 10678 80035278 240200FF */ addiu $v0, $zero, 0xFF
/* 1067C 8003527C A6020000 */ sh $v0, 0x0($s0)
.L80035280:
/* 10680 80035280 86020000 */ lh $v0, 0x0($s0)
/* 10684 80035284 44820000 */ mtc1 $v0, $f0
/* 10688 80035288 00000000 */ nop
/* 1068C 8003528C 46800020 */ cvt.s.w $f0, $f0
/* 10690 80035290 44050000 */ mfc1 $a1, $f0
/* 10694 80035294 0C04DF62 */ jal set_screen_overlay_params_front
/* 10698 80035298 0000202D */ daddu $a0, $zero, $zero
/* 1069C 8003529C 86030000 */ lh $v1, 0x0($s0)
/* 106A0 800352A0 240200FF */ addiu $v0, $zero, 0xFF
/* 106A4 800352A4 1462008A */ bne $v1, $v0, .L800354D0
/* 106A8 800352A8 00000000 */ nop
.L800352AC:
/* 106AC 800352AC 0800D534 */ j .L800354D0
/* 106B0 800352B0 A2320000 */ sb $s2, 0x0($s1)
.L800352B4:
/* 106B4 800352B4 24020005 */ addiu $v0, $zero, 0x5
/* 106B8 800352B8 3C04800A */ lui $a0, %hi(gOverrideFlags)
/* 106BC 800352BC 2484A650 */ addiu $a0, $a0, %lo(gOverrideFlags)
/* 106C0 800352C0 3C01800A */ lui $at, %hi(D_800A0930)
/* 106C4 800352C4 A0220930 */ sb $v0, %lo(D_800A0930)($at)
/* 106C8 800352C8 8C820000 */ lw $v0, 0x0($a0)
/* 106CC 800352CC 24030002 */ addiu $v1, $zero, 0x2
/* 106D0 800352D0 A2230000 */ sb $v1, 0x0($s1)
/* 106D4 800352D4 34420008 */ ori $v0, $v0, 0x8
/* 106D8 800352D8 0800D534 */ j .L800354D0
/* 106DC 800352DC AC820000 */ sw $v0, 0x0($a0)
.L800352E0:
/* 106E0 800352E0 3C10800A */ lui $s0, %hi(D_800A0930)
/* 106E4 800352E4 26100930 */ addiu $s0, $s0, %lo(D_800A0930)
/* 106E8 800352E8 92020000 */ lbu $v0, 0x0($s0)
/* 106EC 800352EC 2442FFFF */ addiu $v0, $v0, -0x1
/* 106F0 800352F0 A2020000 */ sb $v0, 0x0($s0)
/* 106F4 800352F4 00021600 */ sll $v0, $v0, 24
/* 106F8 800352F8 14400075 */ bnez $v0, .L800354D0
/* 106FC 800352FC 00000000 */ nop
/* 10700 80035300 3C048007 */ lui $a0, %hi(fsFrameBuffers)
/* 10704 80035304 24847980 */ addiu $a0, $a0, %lo(fsFrameBuffers)
/* 10708 80035308 0C017CBC */ jal nuGfxSetCfb
/* 1070C 8003530C 24050002 */ addiu $a1, $zero, 0x2
/* 10710 80035310 3C02800A */ lui $v0, %hi(nuGfxCfb)
/* 10714 80035314 8C42A658 */ lw $v0, %lo(nuGfxCfb)($v0)
/* 10718 80035318 8C430008 */ lw $v1, 0x8($v0)
/* 1071C 8003531C 3C02800A */ lui $v0, %hi(nuGfxCfb_ptr)
/* 10720 80035320 8C42A64C */ lw $v0, %lo(nuGfxCfb_ptr)($v0)
/* 10724 80035324 14620008 */ bne $v1, $v0, .L80035348
/* 10728 80035328 24040003 */ addiu $a0, $zero, 0x3
/* 1072C 8003532C 3C02800A */ lui $v0, %hi(gOverrideFlags)
/* 10730 80035330 2442A650 */ addiu $v0, $v0, %lo(gOverrideFlags)
/* 10734 80035334 8C430000 */ lw $v1, 0x0($v0)
/* 10738 80035338 2404FFF7 */ addiu $a0, $zero, -0x9
/* 1073C 8003533C 00641824 */ and $v1, $v1, $a0
/* 10740 80035340 0800D534 */ j .L800354D0
/* 10744 80035344 AC430000 */ sw $v1, 0x0($v0)
.L80035348:
/* 10748 80035348 3C02800A */ lui $v0, %hi(gOverrideFlags)
/* 1074C 8003534C 2442A650 */ addiu $v0, $v0, %lo(gOverrideFlags)
/* 10750 80035350 8C430000 */ lw $v1, 0x0($v0)
/* 10754 80035354 34630008 */ ori $v1, $v1, 0x8
/* 10758 80035358 0C051FB1 */ jal set_windows_visible
/* 1075C 8003535C AC430000 */ sw $v1, 0x0($v0)
/* 10760 80035360 24020003 */ addiu $v0, $zero, 0x3
/* 10764 80035364 A2120000 */ sb $s2, 0x0($s0)
/* 10768 80035368 0800D534 */ j .L800354D0
/* 1076C 8003536C A2220000 */ sb $v0, 0x0($s1)
.L80035370:
/* 10770 80035370 3C10800A */ lui $s0, %hi(D_800A0930)
/* 10774 80035374 26100930 */ addiu $s0, $s0, %lo(D_800A0930)
/* 10778 80035378 82020000 */ lb $v0, 0x0($s0)
/* 1077C 8003537C 92030000 */ lbu $v1, 0x0($s0)
/* 10780 80035380 04400042 */ bltz $v0, .L8003548C
/* 10784 80035384 2462FFFF */ addiu $v0, $v1, -0x1
/* 10788 80035388 A2020000 */ sb $v0, 0x0($s0)
/* 1078C 8003538C 00021600 */ sll $v0, $v0, 24
/* 10790 80035390 1440003B */ bnez $v0, .L80035480
/* 10794 80035394 2402FFFF */ addiu $v0, $zero, -0x1
/* 10798 80035398 0C05260E */ jal sfx_stop_env_sounds
/* 1079C 8003539C A2020000 */ sb $v0, 0x0($s0)
/* 107A0 800353A0 0C00EC6A */ jal func_8003B1A8
/* 107A4 800353A4 00000000 */ nop
/* 107A8 800353A8 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 107AC 800353AC 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 107B0 800353B0 0C016BA8 */ jal backup_map_collision_data
/* 107B4 800353B4 A0530070 */ sb $s3, 0x70($v0)
/* 107B8 800353B8 0C00AB28 */ jal battle_heap_create
/* 107BC 800353BC 00000000 */ nop
/* 107C0 800353C0 0C05259C */ jal sfx_clear_env_sounds
/* 107C4 800353C4 0000202D */ daddu $a0, $zero, $zero
/* 107C8 800353C8 0C0B763E */ jal spr_init_sprites
/* 107CC 800353CC 0000202D */ daddu $a0, $zero, $zero
/* 107D0 800353D0 0C045751 */ jal clear_model_data
/* 107D4 800353D4 00000000 */ nop
/* 107D8 800353D8 0C052010 */ jal clear_sprite_shading_data
/* 107DC 800353DC 00000000 */ nop
/* 107E0 800353E0 0C05177E */ jal reset_background_settings
/* 107E4 800353E4 00000000 */ nop
/* 107E8 800353E8 0C0482EC */ jal clear_entity_models
/* 107EC 800353EC 00000000 */ nop
/* 107F0 800353F0 0C047889 */ jal clear_animator_list
/* 107F4 800353F4 00000000 */ nop
/* 107F8 800353F8 0C048C2E */ jal clear_worker_list
/* 107FC 800353FC 00000000 */ nop
/* 10800 80035400 3C048020 */ lui $a0, %hi(vtx_C20F40)
/* 10804 80035404 24840000 */ addiu $a0, $a0, %lo(vtx_C20F40)
/* 10808 80035408 0C0514BA */ jal hud_element_set_aux_cache
/* 1080C 8003540C 3C050002 */ lui $a1, (0x20000 >> 16)
/* 10810 80035410 0C050440 */ jal hud_element_clear_cache
/* 10814 80035414 00000000 */ nop
/* 10818 80035418 0C03A6EC */ jal reset_status_bar
/* 1081C 8003541C 00000000 */ nop
/* 10820 80035420 0C04C3FC */ jal clear_item_entity_data
/* 10824 80035424 00000000 */ nop
/* 10828 80035428 0C0B0C77 */ jal clear_script_list
/* 1082C 8003542C 00000000 */ nop
/* 10830 80035430 0C00E12F */ jal clear_npcs
/* 10834 80035434 00000000 */ nop
/* 10838 80035438 0C04432E */ jal clear_entity_data
/* 1083C 8003543C 0000202D */ daddu $a0, $zero, $zero
/* 10840 80035440 0C0515A0 */ jal clear_trigger_data
/* 10844 80035444 00000000 */ nop
/* 10848 80035448 3C048007 */ lui $a0, %hi(D_8007798C)
/* 1084C 8003544C 0C018038 */ jal nuPiReadRomOverlay
/* 10850 80035450 2484798C */ addiu $a0, $a0, %lo(D_8007798C)
/* 10854 80035454 0C091238 */ jal func_802448E0
/* 10858 80035458 24040001 */ addiu $a0, $zero, 0x1
/* 1085C 8003545C 240400FF */ addiu $a0, $zero, 0xFF
/* 10860 80035460 3C06800A */ lui $a2, %hi(gOverrideFlags)
/* 10864 80035464 24C6A650 */ addiu $a2, $a2, %lo(gOverrideFlags)
/* 10868 80035468 2403FFF7 */ addiu $v1, $zero, -0x9
/* 1086C 8003546C 8CC20000 */ lw $v0, 0x0($a2)
/* 10870 80035470 3C05437F */ lui $a1, (0x437F0000 >> 16)
/* 10874 80035474 00431024 */ and $v0, $v0, $v1
/* 10878 80035478 0C04DF62 */ jal set_screen_overlay_params_front
/* 1087C 8003547C ACC20000 */ sw $v0, 0x0($a2)
.L80035480:
/* 10880 80035480 82020000 */ lb $v0, 0x0($s0)
/* 10884 80035484 04410012 */ bgez $v0, .L800354D0
/* 10888 80035488 00000000 */ nop
.L8003548C:
/* 1088C 8003548C 0C090C68 */ jal func_802431A0
/* 10890 80035490 00000000 */ nop
/* 10894 80035494 3C03800A */ lui $v1, %hi(D_800A0932)
/* 10898 80035498 24630932 */ addiu $v1, $v1, %lo(D_800A0932)
/* 1089C 8003549C 94620000 */ lhu $v0, 0x0($v1)
/* 108A0 800354A0 2442FFEC */ addiu $v0, $v0, -0x14
/* 108A4 800354A4 A4620000 */ sh $v0, 0x0($v1)
/* 108A8 800354A8 00021400 */ sll $v0, $v0, 16
/* 108AC 800354AC 04420001 */ bltzl $v0, .L800354B4
/* 108B0 800354B0 A4600000 */ sh $zero, 0x0($v1)
.L800354B4:
/* 108B4 800354B4 84620000 */ lh $v0, 0x0($v1)
/* 108B8 800354B8 44820000 */ mtc1 $v0, $f0
/* 108BC 800354BC 00000000 */ nop
/* 108C0 800354C0 46800020 */ cvt.s.w $f0, $f0
/* 108C4 800354C4 44050000 */ mfc1 $a1, $f0
/* 108C8 800354C8 0C04DF62 */ jal set_screen_overlay_params_front
/* 108CC 800354CC 0000202D */ daddu $a0, $zero, $zero
.L800354D0:
/* 108D0 800354D0 8FBF0020 */ lw $ra, 0x20($sp)
/* 108D4 800354D4 8FB3001C */ lw $s3, 0x1C($sp)
/* 108D8 800354D8 8FB20018 */ lw $s2, 0x18($sp)
/* 108DC 800354DC 8FB10014 */ lw $s1, 0x14($sp)
/* 108E0 800354E0 8FB00010 */ lw $s0, 0x10($sp)
/* 108E4 800354E4 03E00008 */ jr $ra
/* 108E8 800354E8 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void state_step_language_select(void) {
switch (D_800A0931) {
case 0:
update_player();
update_npcs();
update_encounters();
update_effects();
if (D_800A0932[0] < 255) {
D_800A0932[0] += 20;
if (D_800A0932[0] > 255) {
D_800A0932[0] = 255;
}
set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]);
if (D_800A0932[0] == 255) {
D_800A0931 = 1;
}
} else {
D_800A0931 = 1;
}
break;
case 1:
D_800A0930 = 5;
D_800A0931 = 2;
gOverrideFlags |= GLOBAL_OVERRIDES_8;
break;
case 2:
D_800A0930--;
if (D_800A0930 == 0) {
nuGfxSetCfb(fsFrameBuffers, 2);
if (nuGfxCfb[2] == nuGfxCfb_ptr) {
gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
} else {
gOverrideFlags |= GLOBAL_OVERRIDES_8;
set_windows_visible(WINDOW_GROUP_FILE_MENU);
D_800A0930 = 1;
D_800A0931 = 3;
}
}
break;
case 3:
if (D_800A0930 >= 0) {
D_800A0930--;
if (D_800A0930 == 0) {
D_800A0930 = -1;
sfx_stop_env_sounds();
func_8003B1A8();
gGameStatusPtr->isBattle = 2;
backup_map_collision_data();
battle_heap_create();
sfx_clear_env_sounds(0);
spr_init_sprites(PLAYER_SPRITES_MARIO_WORLD);
clear_model_data();
clear_sprite_shading_data();
reset_background_settings();
clear_entity_models();
clear_animator_list();
clear_worker_list();
hud_element_set_aux_cache(&D_80200000, 0x20000);
hud_element_clear_cache();
reset_status_bar();
clear_item_entity_data();
clear_script_list();
clear_npcs();
clear_entity_data(0);
clear_trigger_data();
nuPiReadRomOverlay(&D_8007798C);
filemenu_init(TRUE);
gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
set_screen_overlay_params_front(OVERLAY_NONE, 255.0f);
}
if (D_800A0930 >= 0) {
break;
}
}
filemenu_update();
D_800A0932[0] -= 20;
if (D_800A0932[0] < 0) {
D_800A0932[0] = 0;
}
set_screen_overlay_params_front(OVERLAY_SCREEN_COLOR, D_800A0932[0]);
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel check_for_interactables
/* 79CC8 800E0818 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 79CCC 800E081C AFB10014 */ sw $s1, 0x14($sp)
/* 79CD0 800E0820 3C118011 */ lui $s1, %hi(gPlayerStatus)
/* 79CD4 800E0824 2631EFC8 */ addiu $s1, $s1, %lo(gPlayerStatus)
/* 79CD8 800E0828 AFBF0020 */ sw $ra, 0x20($sp)
/* 79CDC 800E082C AFB3001C */ sw $s3, 0x1C($sp)
/* 79CE0 800E0830 AFB20018 */ sw $s2, 0x18($sp)
/* 79CE4 800E0834 AFB00010 */ sw $s0, 0x10($sp)
/* 79CE8 800E0838 8E220004 */ lw $v0, 0x4($s1)
/* 79CEC 800E083C 8E2500C8 */ lw $a1, 0xC8($s1)
/* 79CF0 800E0840 30420100 */ andi $v0, $v0, 0x100
/* 79CF4 800E0844 1440009B */ bnez $v0, .L800E0AB4
/* 79CF8 800E0848 00000000 */ nop
/* 79CFC 800E084C 3C028011 */ lui $v0, %hi(TalkNotificationCallback)
/* 79D00 800E0850 8C42C940 */ lw $v0, %lo(TalkNotificationCallback)($v0)
/* 79D04 800E0854 14400097 */ bnez $v0, .L800E0AB4
/* 79D08 800E0858 00000000 */ nop
/* 79D0C 800E085C 3C028011 */ lui $v0, %hi(PulseStoneNotificationCallback)
/* 79D10 800E0860 8C42C920 */ lw $v0, %lo(PulseStoneNotificationCallback)($v0)
/* 79D14 800E0864 14400093 */ bnez $v0, .L800E0AB4
/* 79D18 800E0868 00000000 */ nop
/* 79D1C 800E086C 3C028011 */ lui $v0, %hi(InteractNotificationCallback)
/* 79D20 800E0870 8C42C958 */ lw $v0, %lo(InteractNotificationCallback)($v0)
/* 79D24 800E0874 14400073 */ bnez $v0, .L800E0A44
/* 79D28 800E0878 00000000 */ nop
/* 79D2C 800E087C 3C038016 */ lui $v1, %hi(gCollisionStatus)
/* 79D30 800E0880 2463A550 */ addiu $v1, $v1, %lo(gCollisionStatus)
/* 79D34 800E0884 82220015 */ lb $v0, 0x15($s1)
/* 79D38 800E0888 10400006 */ beqz $v0, .L800E08A4
/* 79D3C 800E088C 84700012 */ lh $s0, 0x12($v1)
/* 79D40 800E0890 862200C6 */ lh $v0, 0xC6($s1)
/* 79D44 800E0894 54500087 */ bnel $v0, $s0, .L800E0AB4
/* 79D48 800E0898 A63000C6 */ sh $s0, 0xC6($s1)
/* 79D4C 800E089C 080382AD */ j .L800E0AB4
/* 79D50 800E08A0 00000000 */ nop
.L800E08A4:
/* 79D54 800E08A4 862200C0 */ lh $v0, 0xC0($s1)
/* 79D58 800E08A8 14400082 */ bnez $v0, .L800E0AB4
/* 79D5C 800E08AC 2413FFFF */ addiu $s3, $zero, -0x1
/* 79D60 800E08B0 1613002E */ bne $s0, $s3, .L800E096C
/* 79D64 800E08B4 32024000 */ andi $v0, $s0, 0x4000
/* 79D68 800E08B8 84640002 */ lh $a0, 0x2($v1)
/* 79D6C 800E08BC 04800010 */ bltz $a0, .L800E0900
/* 79D70 800E08C0 30824000 */ andi $v0, $a0, 0x4000
/* 79D74 800E08C4 1040000E */ beqz $v0, .L800E0900
/* 79D78 800E08C8 24120001 */ addiu $s2, $zero, 0x1
/* 79D7C 800E08CC 0C0441A9 */ jal get_entity_type
/* 79D80 800E08D0 0080802D */ daddu $s0, $a0, $zero
/* 79D84 800E08D4 2443FFFD */ addiu $v1, $v0, -0x3
/* 79D88 800E08D8 2C620031 */ sltiu $v0, $v1, 0x31
/* 79D8C 800E08DC 10400038 */ beqz $v0, .L800E09C0
/* 79D90 800E08E0 00031080 */ sll $v0, $v1, 2
/* 79D94 800E08E4 3C018011 */ lui $at, %hi(jtbl_8010BC60)
/* 79D98 800E08E8 00220821 */ addu $at, $at, $v0
/* 79D9C 800E08EC 8C22BC60 */ lw $v0, %lo(jtbl_8010BC60)($at)
/* 79DA0 800E08F0 00400008 */ jr $v0
/* 79DA4 800E08F4 00000000 */ nop
glabel .L800E08F8
/* 79DA8 800E08F8 08038270 */ j .L800E09C0
/* 79DAC 800E08FC 2410FFFF */ addiu $s0, $zero, -0x1
.L800E0900:
/* 79DB0 800E0900 3C020200 */ lui $v0, (0x2002000 >> 16)
/* 79DB4 800E0904 8E230000 */ lw $v1, 0x0($s1)
/* 79DB8 800E0908 34422000 */ ori $v0, $v0, (0x2002000 & 0xFFFF)
/* 79DBC 800E090C 00621824 */ and $v1, $v1, $v0
/* 79DC0 800E0910 3C020200 */ lui $v0, (0x2000000 >> 16)
/* 79DC4 800E0914 1462000E */ bne $v1, $v0, .L800E0950
/* 79DC8 800E0918 3C02F7FF */ lui $v0, (0xF7FFFFFF >> 16)
/* 79DCC 800E091C 10A0000C */ beqz $a1, .L800E0950
/* 79DD0 800E0920 3C031000 */ lui $v1, (0x10000000 >> 16)
/* 79DD4 800E0924 8CA20000 */ lw $v0, 0x0($a1)
/* 79DD8 800E0928 00431024 */ and $v0, $v0, $v1
/* 79DDC 800E092C 10400008 */ beqz $v0, .L800E0950
/* 79DE0 800E0930 3C02F7FF */ lui $v0, (0xF7FFFFFF >> 16)
/* 79DE4 800E0934 80A200A4 */ lb $v0, 0xA4($a1)
/* 79DE8 800E0938 862300C6 */ lh $v1, 0xC6($s1)
/* 79DEC 800E093C 34502000 */ ori $s0, $v0, 0x2000
/* 79DF0 800E0940 1070005C */ beq $v1, $s0, .L800E0AB4
/* 79DF4 800E0944 0000902D */ daddu $s2, $zero, $zero
/* 79DF8 800E0948 08038270 */ j .L800E09C0
/* 79DFC 800E094C 00000000 */ nop
.L800E0950:
/* 79E00 800E0950 3442FFFF */ ori $v0, $v0, (0xF7FFFFFF & 0xFFFF)
/* 79E04 800E0954 8E230000 */ lw $v1, 0x0($s1)
/* 79E08 800E0958 2404FFFF */ addiu $a0, $zero, -0x1
/* 79E0C 800E095C A62400C6 */ sh $a0, 0xC6($s1)
/* 79E10 800E0960 00621824 */ and $v1, $v1, $v0
/* 79E14 800E0964 080382AD */ j .L800E0AB4
/* 79E18 800E0968 AE230000 */ sw $v1, 0x0($s1)
.L800E096C:
/* 79E1C 800E096C 14400009 */ bnez $v0, .L800E0994
/* 79E20 800E0970 32022000 */ andi $v0, $s0, 0x2000
/* 79E24 800E0974 14400012 */ bnez $v0, .L800E09C0
/* 79E28 800E0978 0000902D */ daddu $s2, $zero, $zero
/* 79E2C 800E097C 0C05173A */ jal should_collider_allow_interact
/* 79E30 800E0980 0200202D */ daddu $a0, $s0, $zero
/* 79E34 800E0984 1440000E */ bnez $v0, .L800E09C0
/* 79E38 800E0988 3C03F7FF */ lui $v1, (0xF7FFFFFF >> 16)
/* 79E3C 800E098C 0803826A */ j .L800E09A8
/* 79E40 800E0990 00000000 */ nop
.L800E0994:
/* 79E44 800E0994 0C0394BE */ jal phys_can_player_interact
/* 79E48 800E0998 00000000 */ nop
/* 79E4C 800E099C 14400008 */ bnez $v0, .L800E09C0
/* 79E50 800E09A0 24120001 */ addiu $s2, $zero, 0x1
/* 79E54 800E09A4 3C03F7FF */ lui $v1, (0xF7FFFFFF >> 16)
.L800E09A8:
/* 79E58 800E09A8 8E220000 */ lw $v0, 0x0($s1)
/* 79E5C 800E09AC 3463FFFF */ ori $v1, $v1, (0xF7FFFFFF & 0xFFFF)
/* 79E60 800E09B0 A63300C6 */ sh $s3, 0xC6($s1)
/* 79E64 800E09B4 00431024 */ and $v0, $v0, $v1
/* 79E68 800E09B8 080382AD */ j .L800E0AB4
/* 79E6C 800E09BC AE220000 */ sw $v0, 0x0($s1)
glabel .L800E09C0
/* 79E70 800E09C0 862200C6 */ lh $v0, 0xC6($s1)
/* 79E74 800E09C4 14500008 */ bne $v0, $s0, .L800E09E8
/* 79E78 800E09C8 3C03F7FF */ lui $v1, (0xF7FFFFFF >> 16)
/* 79E7C 800E09CC 8E220000 */ lw $v0, 0x0($s1)
/* 79E80 800E09D0 3C030800 */ lui $v1, (0x800FFFF >> 16)
/* 79E84 800E09D4 00431024 */ and $v0, $v0, $v1
/* 79E88 800E09D8 14400036 */ bnez $v0, .L800E0AB4
/* 79E8C 800E09DC 00000000 */ nop
/* 79E90 800E09E0 0803827F */ j .L800E09FC
/* 79E94 800E09E4 A63000C6 */ sh $s0, 0xC6($s1)
.L800E09E8:
/* 79E98 800E09E8 8E220000 */ lw $v0, 0x0($s1)
/* 79E9C 800E09EC 3463FFFF */ ori $v1, $v1, (0x800FFFF & 0xFFFF)
/* 79EA0 800E09F0 00431024 */ and $v0, $v0, $v1
/* 79EA4 800E09F4 AE220000 */ sw $v0, 0x0($s1)
/* 79EA8 800E09F8 A63000C6 */ sh $s0, 0xC6($s1)
.L800E09FC:
/* 79EAC 800E09FC 12400009 */ beqz $s2, .L800E0A24
/* 79EB0 800E0A00 00000000 */ nop
/* 79EB4 800E0A04 0600000F */ bltz $s0, .L800E0A44
/* 79EB8 800E0A08 00000000 */ nop
/* 79EBC 800E0A0C 0C04417A */ jal get_entity_by_index
/* 79EC0 800E0A10 0200202D */ daddu $a0, $s0, $zero
/* 79EC4 800E0A14 8C420000 */ lw $v0, 0x0($v0)
/* 79EC8 800E0A18 30421000 */ andi $v0, $v0, 0x1000
/* 79ECC 800E0A1C 10400009 */ beqz $v0, .L800E0A44
/* 79ED0 800E0A20 00000000 */ nop
.L800E0A24:
/* 79ED4 800E0A24 922200B4 */ lbu $v0, 0xB4($s1)
/* 79ED8 800E0A28 2C420003 */ sltiu $v0, $v0, 0x3
/* 79EDC 800E0A2C 10400005 */ beqz $v0, .L800E0A44
/* 79EE0 800E0A30 24040002 */ addiu $a0, $zero, 0x2
/* 79EE4 800E0A34 8E220004 */ lw $v0, 0x4($s1)
/* 79EE8 800E0A38 34420010 */ ori $v0, $v0, 0x10
/* 79EEC 800E0A3C 0C03BCF5 */ jal func_800EF3D4
/* 79EF0 800E0A40 AE220004 */ sw $v0, 0x4($s1)
.L800E0A44:
/* 79EF4 800E0A44 8E220004 */ lw $v0, 0x4($s1)
/* 79EF8 800E0A48 30420010 */ andi $v0, $v0, 0x10
/* 79EFC 800E0A4C 14400007 */ bnez $v0, .L800E0A6C
/* 79F00 800E0A50 00000000 */ nop
/* 79F04 800E0A54 0C03BCF5 */ jal func_800EF3D4
/* 79F08 800E0A58 0000202D */ daddu $a0, $zero, $zero
/* 79F0C 800E0A5C 0C03BCE9 */ jal partner_reset_tether_distance
/* 79F10 800E0A60 00000000 */ nop
/* 79F14 800E0A64 080382AD */ j .L800E0AB4
/* 79F18 800E0A68 00000000 */ nop
.L800E0A6C:
/* 79F1C 800E0A6C 3C108011 */ lui $s0, %hi(InteractNotificationCallback)
/* 79F20 800E0A70 2610C958 */ addiu $s0, $s0, %lo(InteractNotificationCallback)
/* 79F24 800E0A74 8E020000 */ lw $v0, 0x0($s0)
/* 79F28 800E0A78 1440000C */ bnez $v0, .L800E0AAC
/* 79F2C 800E0A7C 3C06802B */ lui $a2, (0x802B7000 >> 16)
/* 79F30 800E0A80 3C0400E2 */ lui $a0, %hi(D_E20110)
/* 79F34 800E0A84 24840110 */ addiu $a0, $a0, %lo(D_E20110)
/* 79F38 800E0A88 3C0500E2 */ lui $a1, %hi(D_E20EB0)
/* 79F3C 800E0A8C 24A50EB0 */ addiu $a1, $a1, %lo(D_E20EB0)
/* 79F40 800E0A90 0C00A5CF */ jal dma_copy
/* 79F44 800E0A94 34C67000 */ ori $a2, $a2, (0x802B7000 & 0xFFFF)
/* 79F48 800E0A98 3C02802B */ lui $v0, %hi(interact_speech_setup)
/* 79F4C 800E0A9C 244270B4 */ addiu $v0, $v0, %lo(interact_speech_setup)
/* 79F50 800E0AA0 10400004 */ beqz $v0, .L800E0AB4
/* 79F54 800E0AA4 AE020000 */ sw $v0, 0x0($s0)
/* 79F58 800E0AA8 8E020000 */ lw $v0, 0x0($s0)
.L800E0AAC:
/* 79F5C 800E0AAC 0040F809 */ jalr $v0
/* 79F60 800E0AB0 00000000 */ nop
.L800E0AB4:
/* 79F64 800E0AB4 8FBF0020 */ lw $ra, 0x20($sp)
/* 79F68 800E0AB8 8FB3001C */ lw $s3, 0x1C($sp)
/* 79F6C 800E0ABC 8FB20018 */ lw $s2, 0x18($sp)
/* 79F70 800E0AC0 8FB10014 */ lw $s1, 0x14($sp)
/* 79F74 800E0AC4 8FB00010 */ lw $s0, 0x10($sp)
/* 79F78 800E0AC8 03E00008 */ jr $ra
/* 79F7C 800E0ACC 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void check_for_interactables(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
Npc* npc = gPlayerStatus.encounteredNPC;
s32 phi_s2;
if ((playerStatus->animFlags & PA_FLAG_ISPY_VISIBLE) || TalkNotificationCallback || PulseStoneNotificationCallback != NULL) {
return;
}
if (InteractNotificationCallback == NULL) {
s32 curInteraction = gCollisionStatus.currentWall;
if (playerStatus->inputDisabledCount != 0) {
if (gPlayerStatus.interactingWithID != curInteraction) {
gPlayerStatus.interactingWithID = curInteraction;
}
return;
}
if (playerStatus->timeInAir != 0) {
return;
}
if (curInteraction == NO_COLLIDER) {
s32 floor = gCollisionStatus.currentFloor;
if ((floor >= 0) && (floor & COLLISION_WITH_ENTITY_BIT)) {
phi_s2 = 1;
curInteraction = floor;
switch (get_entity_type(floor)) {
case ENTITY_TYPE_PADLOCK:
case ENTITY_TYPE_PADLOCK_RED_FRAME:
case ENTITY_TYPE_PADLOCK_RED_FACE:
case ENTITY_TYPE_PADLOCK_BLUE_FACE:
case ENTITY_TYPE_PUSH_BLOCK:
case ENTITY_TYPE_CHEST:
case ENTITY_TYPE_SIGNPOST:
curInteraction = NO_COLLIDER;
break;
}
} else if (
((playerStatus->flags & (PS_FLAG_HAS_CONVERSATION_NPC | PS_FLAG_INPUT_DISABLED)) == PS_FLAG_HAS_CONVERSATION_NPC)
&& (npc != NULL)
&& (npc->flags & NPC_FLAG_10000000)
) {
curInteraction = npc->npcID | COLLISION_WITH_NPC_BIT;
if (playerStatus->interactingWithID == curInteraction) {
return;
}
phi_s2 = 0;
} else {
playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED;
return;
}
} else {
if (!(curInteraction & COLLISION_WITH_ENTITY_BIT)) {
phi_s2 = 0;
if (!(curInteraction & COLLISION_WITH_NPC_BIT)) {
if (!should_collider_allow_interact(curInteraction)) {
playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED;
return;
}
}
} else {
if (!phys_can_player_interact()) {
phi_s2 = 1;
playerStatus->interactingWithID = NO_COLLIDER;
playerStatus->flags &= ~PS_FLAG_INTERACTED;
return;
}
phi_s2 = 1;
}
}
if (playerStatus->interactingWithID == curInteraction) {
if ((playerStatus->flags & PS_FLAG_INTERACTED)) {
return;
}
} else {
playerStatus->flags &= ~PS_FLAG_INTERACTED;
}
playerStatus->interactingWithID = curInteraction;
if ((phi_s2 == 0) || curInteraction >= 0 && get_entity_by_index(curInteraction)->flags & ENTITY_FLAG_SHOWS_INSPECT_PROMPT) {
if (playerStatus->actionState == ACTION_STATE_IDLE || playerStatus->actionState == ACTION_STATE_WALK || playerStatus->actionState == ACTION_STATE_RUN) {
playerStatus->animFlags |= PA_FLAG_INTERACT_PROMPT_AVAILABLE;
func_800EF3D4(2);
}
}
}
if (!(playerStatus->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE)) {
func_800EF3D4(0);
partner_reset_tether_distance();
return;
}
if (InteractNotificationCallback == NULL) {
dma_copy(inspect_icon_ROM_START, inspect_icon_ROM_END, inspect_icon_VRAM_DEF);
InteractNotificationCallback = interact_inspect_setup;
}
if (InteractNotificationCallback != NULL) {
InteractNotificationCallback();
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel SetSpriteShading
/* FE0B0 802D9700 27BDFF98 */ addiu $sp, $sp, -0x68
/* FE0B4 802D9704 AFBF0064 */ sw $ra, 0x64($sp)
/* FE0B8 802D9708 AFBE0060 */ sw $fp, 0x60($sp)
/* FE0BC 802D970C AFB7005C */ sw $s7, 0x5C($sp)
/* FE0C0 802D9710 AFB60058 */ sw $s6, 0x58($sp)
/* FE0C4 802D9714 AFB50054 */ sw $s5, 0x54($sp)
/* FE0C8 802D9718 AFB40050 */ sw $s4, 0x50($sp)
/* FE0CC 802D971C AFB3004C */ sw $s3, 0x4C($sp)
/* FE0D0 802D9720 AFB20048 */ sw $s2, 0x48($sp)
/* FE0D4 802D9724 AFB10044 */ sw $s1, 0x44($sp)
/* FE0D8 802D9728 AFB00040 */ sw $s0, 0x40($sp)
/* FE0DC 802D972C 8C82000C */ lw $v0, 0xC($a0)
/* FE0E0 802D9730 0C0B1EAF */ jal evt_get_variable
/* FE0E4 802D9734 8C450000 */ lw $a1, 0x0($v0)
/* FE0E8 802D9738 00021C03 */ sra $v1, $v0, 16
/* FE0EC 802D973C 000330C0 */ sll $a2, $v1, 3
/* FE0F0 802D9740 3043FFFF */ andi $v1, $v0, 0xFFFF
/* FE0F4 802D9744 00039080 */ sll $s2, $v1, 2
/* FE0F8 802D9748 2403FFFF */ addiu $v1, $zero, -0x1
/* FE0FC 802D974C 104300AF */ beq $v0, $v1, .L802D9A0C
/* FE100 802D9750 24020002 */ addiu $v0, $zero, 0x2
/* FE104 802D9754 3C100031 */ lui $s0, %hi(D_315B80)
/* FE108 802D9758 26105B80 */ addiu $s0, $s0, %lo(D_315B80)
/* FE10C 802D975C 00D02021 */ addu $a0, $a2, $s0
/* FE110 802D9760 26050008 */ addiu $a1, $s0, 0x8
/* FE114 802D9764 00C52821 */ addu $a1, $a2, $a1
/* FE118 802D9768 3C11802E */ lui $s1, %hi(gSpriteShadingHeader)
/* FE11C 802D976C 2631BB60 */ addiu $s1, $s1, %lo(gSpriteShadingHeader)
/* FE120 802D9770 0C00A5CF */ jal dma_copy
/* FE124 802D9774 0220302D */ daddu $a2, $s1, $zero
/* FE128 802D9778 0220302D */ daddu $a2, $s1, $zero
/* FE12C 802D977C 8E240004 */ lw $a0, 0x4($s1)
/* FE130 802D9780 02508021 */ addu $s0, $s2, $s0
/* FE134 802D9784 00902021 */ addu $a0, $a0, $s0
/* FE138 802D9788 8E300000 */ lw $s0, 0x0($s1)
/* FE13C 802D978C 0C00A5CF */ jal dma_copy
/* FE140 802D9790 24850004 */ addiu $a1, $a0, 0x4
/* FE144 802D9794 3C12802E */ lui $s2, %hi(gSpriteShadingData)
/* FE148 802D9798 2652BB68 */ addiu $s2, $s2, %lo(gSpriteShadingData)
/* FE14C 802D979C 0240302D */ daddu $a2, $s2, $zero
/* FE150 802D97A0 8E220000 */ lw $v0, 0x0($s1)
/* FE154 802D97A4 3C030031 */ lui $v1, %hi(D_315D50)
/* FE158 802D97A8 24635D50 */ addiu $v1, $v1, %lo(D_315D50)
/* FE15C 802D97AC 00431021 */ addu $v0, $v0, $v1
/* FE160 802D97B0 02028021 */ addu $s0, $s0, $v0
/* FE164 802D97B4 0200202D */ daddu $a0, $s0, $zero
/* FE168 802D97B8 0C00A5CF */ jal dma_copy
/* FE16C 802D97BC 24850100 */ addiu $a1, $a0, 0x100
/* FE170 802D97C0 3C058015 */ lui $a1, %hi(gSpriteShadingProfile)
/* FE174 802D97C4 24A51328 */ addiu $a1, $a1, %lo(gSpriteShadingProfile)
/* FE178 802D97C8 92470000 */ lbu $a3, 0x0($s2)
/* FE17C 802D97CC 8CA30000 */ lw $v1, 0x0($a1)
/* FE180 802D97D0 92420002 */ lbu $v0, 0x2($s2)
/* FE184 802D97D4 AFA70014 */ sw $a3, 0x14($sp)
/* FE188 802D97D8 A06200AC */ sb $v0, 0xAC($v1)
/* FE18C 802D97DC 92420003 */ lbu $v0, 0x3($s2)
/* FE190 802D97E0 A06200AD */ sb $v0, 0xAD($v1)
/* FE194 802D97E4 92420004 */ lbu $v0, 0x4($s2)
/* FE198 802D97E8 A06200AE */ sb $v0, 0xAE($v1)
/* FE19C 802D97EC 92420005 */ lbu $v0, 0x5($s2)
/* FE1A0 802D97F0 0000882D */ daddu $s1, $zero, $zero
/* FE1A4 802D97F4 10E0007F */ beqz $a3, .L802D99F4
/* FE1A8 802D97F8 A06200AF */ sb $v0, 0xAF($v1)
/* FE1AC 802D97FC 0240802D */ daddu $s0, $s2, $zero
/* FE1B0 802D9800 24070014 */ addiu $a3, $zero, 0x14
/* FE1B4 802D9804 AFA7002C */ sw $a3, 0x2C($sp)
/* FE1B8 802D9808 24070010 */ addiu $a3, $zero, 0x10
/* FE1BC 802D980C 240B0011 */ addiu $t3, $zero, 0x11
/* FE1C0 802D9810 240C0012 */ addiu $t4, $zero, 0x12
/* FE1C4 802D9814 240D0013 */ addiu $t5, $zero, 0x13
/* FE1C8 802D9818 240E000F */ addiu $t6, $zero, 0xF
/* FE1CC 802D981C 240F000E */ addiu $t7, $zero, 0xE
/* FE1D0 802D9820 241E000D */ addiu $fp, $zero, 0xD
/* FE1D4 802D9824 2417000C */ addiu $s7, $zero, 0xC
/* FE1D8 802D9828 2416000B */ addiu $s6, $zero, 0xB
/* FE1DC 802D982C 2415000A */ addiu $s5, $zero, 0xA
/* FE1E0 802D9830 24140009 */ addiu $s4, $zero, 0x9
/* FE1E4 802D9834 24130008 */ addiu $s3, $zero, 0x8
/* FE1E8 802D9838 24190007 */ addiu $t9, $zero, 0x7
/* FE1EC 802D983C 24180006 */ addiu $t8, $zero, 0x6
/* FE1F0 802D9840 24120004 */ addiu $s2, $zero, 0x4
/* FE1F4 802D9844 AFA70030 */ sw $a3, 0x30($sp)
.L802D9848:
/* FE1F8 802D9848 01D05021 */ addu $t2, $t6, $s0
/* FE1FC 802D984C 25CE0010 */ addiu $t6, $t6, 0x10
/* FE200 802D9850 01F04821 */ addu $t1, $t7, $s0
/* FE204 802D9854 25EF0010 */ addiu $t7, $t7, 0x10
/* FE208 802D9858 03D04021 */ addu $t0, $fp, $s0
/* FE20C 802D985C 27DE0010 */ addiu $fp, $fp, 0x10
/* FE210 802D9860 02D03021 */ addu $a2, $s6, $s0
/* FE214 802D9864 26D60010 */ addiu $s6, $s6, 0x10
/* FE218 802D9868 02B02021 */ addu $a0, $s5, $s0
/* FE21C 802D986C 26B50010 */ addiu $s5, $s5, 0x10
/* FE220 802D9870 03101021 */ addu $v0, $t8, $s0
/* FE224 802D9874 02901821 */ addu $v1, $s4, $s0
/* FE228 802D9878 8FA7002C */ lw $a3, 0x2C($sp)
/* FE22C 802D987C 26940010 */ addiu $s4, $s4, 0x10
/* FE230 802D9880 00F03821 */ addu $a3, $a3, $s0
/* FE234 802D9884 AFA70028 */ sw $a3, 0x28($sp)
/* FE238 802D9888 8FA7002C */ lw $a3, 0x2C($sp)
/* FE23C 802D988C 27180010 */ addiu $t8, $t8, 0x10
/* FE240 802D9890 24E70010 */ addiu $a3, $a3, 0x10
/* FE244 802D9894 AFA7002C */ sw $a3, 0x2C($sp)
/* FE248 802D9898 8FA70030 */ lw $a3, 0x30($sp)
/* FE24C 802D989C 26310001 */ addiu $s1, $s1, 0x1
/* FE250 802D98A0 00F03821 */ addu $a3, $a3, $s0
/* FE254 802D98A4 AFA70024 */ sw $a3, 0x24($sp)
/* FE258 802D98A8 8FA70030 */ lw $a3, 0x30($sp)
/* FE25C 802D98AC 3C058015 */ lui $a1, %hi(gSpriteShadingProfile)
/* FE260 802D98B0 8CA51328 */ lw $a1, %lo(gSpriteShadingProfile)($a1)
/* FE264 802D98B4 24E70010 */ addiu $a3, $a3, 0x10
/* FE268 802D98B8 AFA70030 */ sw $a3, 0x30($sp)
/* FE26C 802D98BC 01703821 */ addu $a3, $t3, $s0
/* FE270 802D98C0 AFA70020 */ sw $a3, 0x20($sp)
/* FE274 802D98C4 01903821 */ addu $a3, $t4, $s0
/* FE278 802D98C8 AFA7001C */ sw $a3, 0x1C($sp)
/* FE27C 802D98CC 01B03821 */ addu $a3, $t5, $s0
/* FE280 802D98D0 AFA70018 */ sw $a3, 0x18($sp)
/* FE284 802D98D4 90420000 */ lbu $v0, 0x0($v0)
/* FE288 802D98D8 00B22821 */ addu $a1, $a1, $s2
/* FE28C 802D98DC A0A20000 */ sb $v0, 0x0($a1)
/* FE290 802D98E0 03301021 */ addu $v0, $t9, $s0
/* FE294 802D98E4 90420000 */ lbu $v0, 0x0($v0)
/* FE298 802D98E8 26520018 */ addiu $s2, $s2, 0x18
/* FE29C 802D98EC A0A20001 */ sb $v0, 0x1($a1)
/* FE2A0 802D98F0 02701021 */ addu $v0, $s3, $s0
/* FE2A4 802D98F4 90420000 */ lbu $v0, 0x0($v0)
/* FE2A8 802D98F8 256B0010 */ addiu $t3, $t3, 0x10
/* FE2AC 802D98FC A0A20002 */ sb $v0, 0x2($a1)
/* FE2B0 802D9900 90620000 */ lbu $v0, 0x0($v1)
/* FE2B4 802D9904 02F03821 */ addu $a3, $s7, $s0
/* FE2B8 802D9908 A0A20003 */ sb $v0, 0x3($a1)
/* FE2BC 802D990C 90830000 */ lbu $v1, 0x0($a0)
/* FE2C0 802D9910 90C20000 */ lbu $v0, 0x0($a2)
/* FE2C4 802D9914 00031A00 */ sll $v1, $v1, 8
/* FE2C8 802D9918 00431021 */ addu $v0, $v0, $v1
/* FE2CC 802D991C 00021400 */ sll $v0, $v0, 16
/* FE2D0 802D9920 00021403 */ sra $v0, $v0, 16
/* FE2D4 802D9924 44820000 */ mtc1 $v0, $f0
/* FE2D8 802D9928 00000000 */ nop
/* FE2DC 802D992C 46800020 */ cvt.s.w $f0, $f0
/* FE2E0 802D9930 E4A00004 */ swc1 $f0, 0x4($a1)
/* FE2E4 802D9934 90E30000 */ lbu $v1, 0x0($a3)
/* FE2E8 802D9938 91020000 */ lbu $v0, 0x0($t0)
/* FE2EC 802D993C 00031A00 */ sll $v1, $v1, 8
/* FE2F0 802D9940 00431021 */ addu $v0, $v0, $v1
/* FE2F4 802D9944 00021400 */ sll $v0, $v0, 16
/* FE2F8 802D9948 00021403 */ sra $v0, $v0, 16
/* FE2FC 802D994C 44820000 */ mtc1 $v0, $f0
/* FE300 802D9950 00000000 */ nop
/* FE304 802D9954 46800020 */ cvt.s.w $f0, $f0
/* FE308 802D9958 E4A00008 */ swc1 $f0, 0x8($a1)
/* FE30C 802D995C 91230000 */ lbu $v1, 0x0($t1)
/* FE310 802D9960 91420000 */ lbu $v0, 0x0($t2)
/* FE314 802D9964 00031A00 */ sll $v1, $v1, 8
/* FE318 802D9968 00431021 */ addu $v0, $v0, $v1
/* FE31C 802D996C 00021400 */ sll $v0, $v0, 16
/* FE320 802D9970 00021403 */ sra $v0, $v0, 16
/* FE324 802D9974 44820000 */ mtc1 $v0, $f0
/* FE328 802D9978 00000000 */ nop
/* FE32C 802D997C 46800020 */ cvt.s.w $f0, $f0
/* FE330 802D9980 E4A0000C */ swc1 $f0, 0xC($a1)
/* FE334 802D9984 8FA7001C */ lw $a3, 0x1C($sp)
/* FE338 802D9988 258C0010 */ addiu $t4, $t4, 0x10
/* FE33C 802D998C 90E30000 */ lbu $v1, 0x0($a3)
/* FE340 802D9990 8FA70018 */ lw $a3, 0x18($sp)
/* FE344 802D9994 00031A00 */ sll $v1, $v1, 8
/* FE348 802D9998 90E20000 */ lbu $v0, 0x0($a3)
/* FE34C 802D999C 8FA70020 */ lw $a3, 0x20($sp)
/* FE350 802D99A0 00431021 */ addu $v0, $v0, $v1
/* FE354 802D99A4 90E40000 */ lbu $a0, 0x0($a3)
/* FE358 802D99A8 8FA70024 */ lw $a3, 0x24($sp)
/* FE35C 802D99AC 00042400 */ sll $a0, $a0, 16
/* FE360 802D99B0 90E30000 */ lbu $v1, 0x0($a3)
/* FE364 802D99B4 00441021 */ addu $v0, $v0, $a0
/* FE368 802D99B8 00031E00 */ sll $v1, $v1, 24
/* FE36C 802D99BC 00431021 */ addu $v0, $v0, $v1
/* FE370 802D99C0 AFA20010 */ sw $v0, 0x10($sp)
/* FE374 802D99C4 C7A00010 */ lwc1 $f0, 0x10($sp)
/* FE378 802D99C8 25AD0010 */ addiu $t5, $t5, 0x10
/* FE37C 802D99CC E4A00010 */ swc1 $f0, 0x10($a1)
/* FE380 802D99D0 8FA70028 */ lw $a3, 0x28($sp)
/* FE384 802D99D4 26F70010 */ addiu $s7, $s7, 0x10
/* FE388 802D99D8 90E20000 */ lbu $v0, 0x0($a3)
/* FE38C 802D99DC 27390010 */ addiu $t9, $t9, 0x10
/* FE390 802D99E0 A0A20014 */ sb $v0, 0x14($a1)
/* FE394 802D99E4 8FA70014 */ lw $a3, 0x14($sp)
/* FE398 802D99E8 0227102A */ slt $v0, $s1, $a3
/* FE39C 802D99EC 1440FF96 */ bnez $v0, .L802D9848
/* FE3A0 802D99F0 26730010 */ addiu $s3, $s3, 0x10
.L802D99F4:
/* FE3A4 802D99F4 3C048015 */ lui $a0, %hi(gSpriteShadingProfile)
/* FE3A8 802D99F8 8C841328 */ lw $a0, %lo(gSpriteShadingProfile)($a0)
/* FE3AC 802D99FC 94830000 */ lhu $v1, 0x0($a0)
/* FE3B0 802D9A00 24020002 */ addiu $v0, $zero, 0x2
/* FE3B4 802D9A04 34630001 */ ori $v1, $v1, 0x1
/* FE3B8 802D9A08 A4830000 */ sh $v1, 0x0($a0)
.L802D9A0C:
/* FE3BC 802D9A0C 8FBF0064 */ lw $ra, 0x64($sp)
/* FE3C0 802D9A10 8FBE0060 */ lw $fp, 0x60($sp)
/* FE3C4 802D9A14 8FB7005C */ lw $s7, 0x5C($sp)
/* FE3C8 802D9A18 8FB60058 */ lw $s6, 0x58($sp)
/* FE3CC 802D9A1C 8FB50054 */ lw $s5, 0x54($sp)
/* FE3D0 802D9A20 8FB40050 */ lw $s4, 0x50($sp)
/* FE3D4 802D9A24 8FB3004C */ lw $s3, 0x4C($sp)
/* FE3D8 802D9A28 8FB20048 */ lw $s2, 0x48($sp)
/* FE3DC 802D9A2C 8FB10044 */ lw $s1, 0x44($sp)
/* FE3E0 802D9A30 8FB00040 */ lw $s0, 0x40($sp)
/* FE3E4 802D9A34 03E00008 */ jr $ra
/* FE3E8 802D9A38 27BD0068 */ addiu $sp, $sp, 0x68
### DECOMPILED C INSTRUCTIONS:
s32 SetSpriteShading(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 profileID = evt_get_variable(script, *args++);
s32 shadingGroupOffset = (profileID >> 0x10) * 8;
s32 shadingProfileOffset = (profileID & 0xFFFF) * 4;
s32 dataOffset;
s32 i;
s32 romStart;
s32 romEnd;
s32 count;
s32 falloff;
s32 data;
SpriteShadingProfile* profile;
if (profileID == SHADING_NONE) {
return ApiStatus_DONE2;
}
// load shading group data
romStart = (s32)sprite_shading_profiles_ROM_START;
romEnd = romStart + 8;
dma_copy((u8*) shadingGroupOffset + romStart, (u8*) shadingGroupOffset + romEnd, gSpriteShadingHeader);
// load offset to shading data
romStart = shadingProfileOffset + (s32)sprite_shading_profiles_ROM_START;
data = gSpriteShadingHeader[0];
dma_copy((u8*)gSpriteShadingHeader[1] + romStart, (u8*)gSpriteShadingHeader[1] + romStart + 4, gSpriteShadingHeader);
// load shading data
dataOffset = (s32)sprite_shading_profiles_data_ROM_START + data + gSpriteShadingHeader[0];
dma_copy((u8*) dataOffset, (u8*) dataOffset + sizeof(gSpriteShadingData), &gSpriteShadingData);
profile = gSpriteShadingProfile;
count = gSpriteShadingData[0];
profile->ambientColor.r = gSpriteShadingData[2];
profile->ambientColor.g = gSpriteShadingData[3];
profile->ambientColor.b = gSpriteShadingData[4];
profile->ambientPower = gSpriteShadingData[5];
for (i = 0; i < count; i++) {
SpriteShadingLightSource* source = &gSpriteShadingProfile->sources[i];
source->flags = gSpriteShadingData[6 + 16 * i + 0];
source->rgb.r = gSpriteShadingData[6 + 16 * i + 1];
source->rgb.g = gSpriteShadingData[6 + 16 * i + 2];
source->rgb.b = gSpriteShadingData[6 + 16 * i + 3];
source->pos.x = (s16) ((gSpriteShadingData[6 + 16 * i + 4] << 8) + gSpriteShadingData[6 + 16 * i + 5]);
source->pos.y = (s16) ((gSpriteShadingData[6 + 16 * i + 6] << 8) + gSpriteShadingData[6 + 16 * i + 7]);
source->pos.z = (s16) ((gSpriteShadingData[6 + 16 * i + 8] << 8) + gSpriteShadingData[6 + 16 * i + 9]);
falloff = gSpriteShadingData[6 + 16 * i + 13]
+ (gSpriteShadingData[6 + 16 * i + 12] << 8)
+ (gSpriteShadingData[6 + 16 * i + 11] << 16)
+ (gSpriteShadingData[6 + 16 * i + 10] << 24);
source->falloff = *(f32*)&falloff;
source->unk_14 = gSpriteShadingData[6 + 16 * i + 14];
}
gSpriteShadingProfile->flags |= 1;
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel static_status_appendGfx
/* 3E0E54 E00E6524 27BDFF28 */ addiu $sp, $sp, -0xD8
/* 3E0E58 E00E6528 AFBE00C8 */ sw $fp, 0xC8($sp)
/* 3E0E5C E00E652C 0080F02D */ daddu $fp, $a0, $zero
/* 3E0E60 E00E6530 3C06DB06 */ lui $a2, (0xDB060024 >> 16)
/* 3E0E64 E00E6534 34C60024 */ ori $a2, $a2, (0xDB060024 & 0xFFFF)
/* 3E0E68 E00E6538 27A40020 */ addiu $a0, $sp, 0x20
/* 3E0E6C E00E653C AFB200B0 */ sw $s2, 0xB0($sp)
/* 3E0E70 E00E6540 3C120001 */ lui $s2, (0x11630 >> 16)
/* 3E0E74 E00E6544 36521630 */ ori $s2, $s2, (0x11630 & 0xFFFF)
/* 3E0E78 E00E6548 AFB600C0 */ sw $s6, 0xC0($sp)
/* 3E0E7C E00E654C 3C16800A */ lui $s6, %hi(gMainGfxPos)
/* 3E0E80 E00E6550 26D6A66C */ addiu $s6, $s6, %lo(gMainGfxPos)
/* 3E0E84 E00E6554 AFBF00CC */ sw $ra, 0xCC($sp)
/* 3E0E88 E00E6558 AFB700C4 */ sw $s7, 0xC4($sp)
/* 3E0E8C E00E655C AFB500BC */ sw $s5, 0xBC($sp)
/* 3E0E90 E00E6560 AFB400B8 */ sw $s4, 0xB8($sp)
/* 3E0E94 E00E6564 AFB300B4 */ sw $s3, 0xB4($sp)
/* 3E0E98 E00E6568 AFB100AC */ sw $s1, 0xAC($sp)
/* 3E0E9C E00E656C AFB000A8 */ sw $s0, 0xA8($sp)
/* 3E0EA0 E00E6570 F7B400D0 */ sdc1 $f20, 0xD0($sp)
/* 3E0EA4 E00E6574 8EC50000 */ lw $a1, 0x0($s6)
/* 3E0EA8 E00E6578 8FD4000C */ lw $s4, 0xC($fp)
/* 3E0EAC E00E657C 00A0182D */ daddu $v1, $a1, $zero
/* 3E0EB0 E00E6580 24A50008 */ addiu $a1, $a1, 0x8
/* 3E0EB4 E00E6584 AEC50000 */ sw $a1, 0x0($s6)
/* 3E0EB8 E00E6588 8E880030 */ lw $t0, 0x30($s4)
/* 3E0EBC E00E658C 24150001 */ addiu $s5, $zero, 0x1
/* 3E0EC0 E00E6590 AFA800A0 */ sw $t0, 0xA0($sp)
/* 3E0EC4 E00E6594 8E930000 */ lw $s3, 0x0($s4)
/* 3E0EC8 E00E6598 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3E0ECC E00E659C AC620000 */ sw $v0, 0x0($v1)
/* 3E0ED0 E00E65A0 AC600004 */ sw $zero, 0x4($v1)
/* 3E0ED4 E00E65A4 ACA60000 */ sw $a2, 0x0($a1)
/* 3E0ED8 E00E65A8 8FC30010 */ lw $v1, 0x10($fp)
/* 3E0EDC E00E65AC 24A20008 */ addiu $v0, $a1, 0x8
/* 3E0EE0 E00E65B0 AEC20000 */ sw $v0, 0x0($s6)
/* 3E0EE4 E00E65B4 8C62001C */ lw $v0, 0x1C($v1)
/* 3E0EE8 E00E65B8 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 3E0EEC E00E65BC 00431021 */ addu $v0, $v0, $v1
/* 3E0EF0 E00E65C0 3C03800B */ lui $v1, %hi(gCameras)
/* 3E0EF4 E00E65C4 24631D80 */ addiu $v1, $v1, %lo(gCameras)
/* 3E0EF8 E00E65C8 ACA20004 */ sw $v0, 0x4($a1)
/* 3E0EFC E00E65CC 8E850004 */ lw $a1, 0x4($s4)
/* 3E0F00 E00E65D0 8E860008 */ lw $a2, 0x8($s4)
/* 3E0F04 E00E65D4 3C028007 */ lui $v0, %hi(gCurrentCameraID)
/* 3E0F08 E00E65D8 8C427410 */ lw $v0, %lo(gCurrentCameraID)($v0)
/* 3E0F0C E00E65DC 8E87000C */ lw $a3, 0xC($s4)
/* 3E0F10 E00E65E0 00028080 */ sll $s0, $v0, 2
/* 3E0F14 E00E65E4 02028021 */ addu $s0, $s0, $v0
/* 3E0F18 E00E65E8 00108080 */ sll $s0, $s0, 2
/* 3E0F1C E00E65EC 02028023 */ subu $s0, $s0, $v0
/* 3E0F20 E00E65F0 001010C0 */ sll $v0, $s0, 3
/* 3E0F24 E00E65F4 02028021 */ addu $s0, $s0, $v0
/* 3E0F28 E00E65F8 001080C0 */ sll $s0, $s0, 3
/* 3E0F2C E00E65FC 0C080108 */ jal shim_guTranslateF
/* 3E0F30 E00E6600 02038021 */ addu $s0, $s0, $v1
/* 3E0F34 E00E6604 27B10060 */ addiu $s1, $sp, 0x60
/* 3E0F38 E00E6608 0220202D */ daddu $a0, $s1, $zero
/* 3E0F3C E00E660C 8E850034 */ lw $a1, 0x34($s4)
/* 3E0F40 E00E6610 26940038 */ addiu $s4, $s4, 0x38
/* 3E0F44 E00E6614 00A0302D */ daddu $a2, $a1, $zero
/* 3E0F48 E00E6618 0C080110 */ jal shim_guScaleF
/* 3E0F4C E00E661C 00A0382D */ daddu $a3, $a1, $zero
/* 3E0F50 E00E6620 0220202D */ daddu $a0, $s1, $zero
/* 3E0F54 E00E6624 27A50020 */ addiu $a1, $sp, 0x20
/* 3E0F58 E00E6628 0C080114 */ jal shim_guMtxCatF
/* 3E0F5C E00E662C 00A0302D */ daddu $a2, $a1, $zero
/* 3E0F60 E00E6630 27A40020 */ addiu $a0, $sp, 0x20
/* 3E0F64 E00E6634 3C118007 */ lui $s1, %hi(gMatrixListPos)
/* 3E0F68 E00E6638 263141F0 */ addiu $s1, $s1, %lo(gMatrixListPos)
/* 3E0F6C E00E663C 3C17800A */ lui $s7, %hi(gDisplayContext)
/* 3E0F70 E00E6640 26F7A674 */ addiu $s7, $s7, %lo(gDisplayContext)
/* 3E0F74 E00E6644 96250000 */ lhu $a1, 0x0($s1)
/* 3E0F78 E00E6648 8EE20000 */ lw $v0, 0x0($s7)
/* 3E0F7C E00E664C 00052980 */ sll $a1, $a1, 6
/* 3E0F80 E00E6650 00B22821 */ addu $a1, $a1, $s2
/* 3E0F84 E00E6654 0C080118 */ jal shim_guMtxF2L
/* 3E0F88 E00E6658 00452821 */ addu $a1, $v0, $a1
/* 3E0F8C E00E665C 3C03DA38 */ lui $v1, (0xDA380002 >> 16)
/* 3E0F90 E00E6660 34630002 */ ori $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3E0F94 E00E6664 3C06DA38 */ lui $a2, (0xDA380000 >> 16)
/* 3E0F98 E00E6668 00D53025 */ or $a2, $a2, $s5
/* 3E0F9C E00E666C 00139880 */ sll $s3, $s3, 2
/* 3E0FA0 E00E6670 8EC40000 */ lw $a0, 0x0($s6)
/* 3E0FA4 E00E6674 96220000 */ lhu $v0, 0x0($s1)
/* 3E0FA8 E00E6678 0080282D */ daddu $a1, $a0, $zero
/* 3E0FAC E00E667C 24840008 */ addiu $a0, $a0, 0x8
/* 3E0FB0 E00E6680 AEC40000 */ sw $a0, 0x0($s6)
/* 3E0FB4 E00E6684 ACA30000 */ sw $v1, 0x0($a1)
/* 3E0FB8 E00E6688 00551821 */ addu $v1, $v0, $s5
/* 3E0FBC E00E668C 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 3E0FC0 E00E6690 00021180 */ sll $v0, $v0, 6
/* 3E0FC4 E00E6694 A6230000 */ sh $v1, 0x0($s1)
/* 3E0FC8 E00E6698 8EE30000 */ lw $v1, 0x0($s7)
/* 3E0FCC E00E669C 00521021 */ addu $v0, $v0, $s2
/* 3E0FD0 E00E66A0 00621821 */ addu $v1, $v1, $v0
/* 3E0FD4 E00E66A4 ACA30004 */ sw $v1, 0x4($a1)
/* 3E0FD8 E00E66A8 AC860000 */ sw $a2, 0x0($a0)
/* 3E0FDC E00E66AC 8E030204 */ lw $v1, 0x204($s0)
/* 3E0FE0 E00E66B0 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3E0FE4 E00E66B4 AC820008 */ sw $v0, 0x8($a0)
/* 3E0FE8 E00E66B8 AC830004 */ sw $v1, 0x4($a0)
/* 3E0FEC E00E66BC 3C03E00E */ lui $v1, (0xE00E6888 >> 16)
/* 3E0FF0 E00E66C0 00731821 */ addu $v1, $v1, $s3
/* 3E0FF4 E00E66C4 8C636888 */ lw $v1, (0xE00E6888 & 0xFFFF)($v1)
/* 3E0FF8 E00E66C8 24820008 */ addiu $v0, $a0, 0x8
/* 3E0FFC E00E66CC AEC20000 */ sw $v0, 0x0($s6)
/* 3E1000 E00E66D0 AC83000C */ sw $v1, 0xC($a0)
/* 3E1004 E00E66D4 8FC20008 */ lw $v0, 0x8($fp)
/* 3E1008 E00E66D8 24840010 */ addiu $a0, $a0, 0x10
/* 3E100C E00E66DC 02A2102A */ slt $v0, $s5, $v0
/* 3E1010 E00E66E0 1040004C */ beqz $v0, .LE00E6814
/* 3E1014 E00E66E4 AEC40000 */ sw $a0, 0x0($s6)
/* 3E1018 E00E66E8 4480A000 */ mtc1 $zero, $f20
/* 3E101C E00E66EC 0220902D */ daddu $s2, $s1, $zero
/* 3E1020 E00E66F0 3C110001 */ lui $s1, (0x11630 >> 16)
/* 3E1024 E00E66F4 36311630 */ ori $s1, $s1, (0x11630 & 0xFFFF)
/* 3E1028 E00E66F8 02C0802D */ daddu $s0, $s6, $zero
/* 3E102C E00E66FC 3C02E00E */ lui $v0, %hi(D_E00E6880)
/* 3E1030 E00E6700 24426880 */ addiu $v0, $v0, %lo(D_E00E6880)
/* 3E1034 E00E6704 0262B021 */ addu $s6, $s3, $v0
/* 3E1038 E00E6708 26930030 */ addiu $s3, $s4, 0x30
.LE00E670C:
/* 3E103C E00E670C 8E62FFF0 */ lw $v0, -0x10($s3)
/* 3E1040 E00E6710 0442003C */ bltzl $v0, .LE00E6804
/* 3E1044 E00E6714 26B50001 */ addiu $s5, $s5, 0x1
/* 3E1048 E00E6718 C6600004 */ lwc1 $f0, 0x4($s3)
/* 3E104C E00E671C 4405A000 */ mfc1 $a1, $f20
/* 3E1050 E00E6720 4406A000 */ mfc1 $a2, $f20
/* 3E1054 E00E6724 E7A00010 */ swc1 $f0, 0x10($sp)
/* 3E1058 E00E6728 C660FFD4 */ lwc1 $f0, -0x2C($s3)
/* 3E105C E00E672C E7A00014 */ swc1 $f0, 0x14($sp)
/* 3E1060 E00E6730 C660FFD8 */ lwc1 $f0, -0x28($s3)
/* 3E1064 E00E6734 E7B4001C */ swc1 $f20, 0x1C($sp)
/* 3E1068 E00E6738 E7A00018 */ swc1 $f0, 0x18($sp)
/* 3E106C E00E673C 8E67FFF4 */ lw $a3, -0xC($s3)
/* 3E1070 E00E6740 0C080180 */ jal shim_guPositionF
/* 3E1074 E00E6744 27A40020 */ addiu $a0, $sp, 0x20
/* 3E1078 E00E6748 27A40020 */ addiu $a0, $sp, 0x20
/* 3E107C E00E674C 96450000 */ lhu $a1, 0x0($s2)
/* 3E1080 E00E6750 8EE20000 */ lw $v0, 0x0($s7)
/* 3E1084 E00E6754 00052980 */ sll $a1, $a1, 6
/* 3E1088 E00E6758 00B12821 */ addu $a1, $a1, $s1
/* 3E108C E00E675C 0C080118 */ jal shim_guMtxF2L
/* 3E1090 E00E6760 00452821 */ addu $a1, $v0, $a1
/* 3E1094 E00E6764 8E040000 */ lw $a0, 0x0($s0)
/* 3E1098 E00E6768 3C06D838 */ lui $a2, (0xD8380002 >> 16)
/* 3E109C E00E676C 0080282D */ daddu $a1, $a0, $zero
/* 3E10A0 E00E6770 24840008 */ addiu $a0, $a0, 0x8
/* 3E10A4 E00E6774 AE040000 */ sw $a0, 0x0($s0)
/* 3E10A8 E00E6778 96420000 */ lhu $v0, 0x0($s2)
/* 3E10AC E00E677C 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 3E10B0 E00E6780 ACA30000 */ sw $v1, 0x0($a1)
/* 3E10B4 E00E6784 24430001 */ addiu $v1, $v0, 0x1
/* 3E10B8 E00E6788 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 3E10BC E00E678C 00021180 */ sll $v0, $v0, 6
/* 3E10C0 E00E6790 A6430000 */ sh $v1, 0x0($s2)
/* 3E10C4 E00E6794 8EE30000 */ lw $v1, 0x0($s7)
/* 3E10C8 E00E6798 00511021 */ addu $v0, $v0, $s1
/* 3E10CC E00E679C 00621821 */ addu $v1, $v1, $v0
/* 3E10D0 E00E67A0 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 3E10D4 E00E67A4 ACA30004 */ sw $v1, 0x4($a1)
/* 3E10D8 E00E67A8 AC820000 */ sw $v0, 0x0($a0)
/* 3E10DC E00E67AC 8E630000 */ lw $v1, 0x0($s3)
/* 3E10E0 E00E67B0 24820008 */ addiu $v0, $a0, 0x8
/* 3E10E4 E00E67B4 AE020000 */ sw $v0, 0x0($s0)
/* 3E10E8 E00E67B8 8FA800A0 */ lw $t0, 0xA0($sp)
/* 3E10EC E00E67BC 34C60002 */ ori $a2, $a2, (0xD8380002 & 0xFFFF)
/* 3E10F0 E00E67C0 01030018 */ mult $t0, $v1
/* 3E10F4 E00E67C4 24820010 */ addiu $v0, $a0, 0x10
/* 3E10F8 E00E67C8 AE020000 */ sw $v0, 0x0($s0)
/* 3E10FC E00E67CC 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3E1100 E00E67D0 AC820008 */ sw $v0, 0x8($a0)
/* 3E1104 E00E67D4 00004012 */ mflo $t0
/* 3E1108 E00E67D8 00081203 */ sra $v0, $t0, 8
/* 3E110C E00E67DC 304200FF */ andi $v0, $v0, 0xFF
/* 3E1110 E00E67E0 AC820004 */ sw $v0, 0x4($a0)
/* 3E1114 E00E67E4 8EC30000 */ lw $v1, 0x0($s6)
/* 3E1118 E00E67E8 24820018 */ addiu $v0, $a0, 0x18
/* 3E111C E00E67EC AE020000 */ sw $v0, 0x0($s0)
/* 3E1120 E00E67F0 24020040 */ addiu $v0, $zero, 0x40
/* 3E1124 E00E67F4 AC860010 */ sw $a2, 0x10($a0)
/* 3E1128 E00E67F8 AC820014 */ sw $v0, 0x14($a0)
/* 3E112C E00E67FC AC83000C */ sw $v1, 0xC($a0)
/* 3E1130 E00E6800 26B50001 */ addiu $s5, $s5, 0x1
.LE00E6804:
/* 3E1134 E00E6804 8FC20008 */ lw $v0, 0x8($fp)
/* 3E1138 E00E6808 02A2102A */ slt $v0, $s5, $v0
/* 3E113C E00E680C 1440FFBF */ bnez $v0, .LE00E670C
/* 3E1140 E00E6810 26730038 */ addiu $s3, $s3, 0x38
.LE00E6814:
/* 3E1144 E00E6814 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* 3E1148 E00E6818 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 3E114C E00E681C 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 3E1150 E00E6820 8C620000 */ lw $v0, 0x0($v1)
/* 3E1154 E00E6824 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* 3E1158 E00E6828 0040202D */ daddu $a0, $v0, $zero
/* 3E115C E00E682C 24420008 */ addiu $v0, $v0, 0x8
/* 3E1160 E00E6830 AC620000 */ sw $v0, 0x0($v1)
/* 3E1164 E00E6834 24020040 */ addiu $v0, $zero, 0x40
/* 3E1168 E00E6838 AC850000 */ sw $a1, 0x0($a0)
/* 3E116C E00E683C AC820004 */ sw $v0, 0x4($a0)
/* 3E1170 E00E6840 8FBF00CC */ lw $ra, 0xCC($sp)
/* 3E1174 E00E6844 8FBE00C8 */ lw $fp, 0xC8($sp)
/* 3E1178 E00E6848 8FB700C4 */ lw $s7, 0xC4($sp)
/* 3E117C E00E684C 8FB600C0 */ lw $s6, 0xC0($sp)
/* 3E1180 E00E6850 8FB500BC */ lw $s5, 0xBC($sp)
/* 3E1184 E00E6854 8FB400B8 */ lw $s4, 0xB8($sp)
/* 3E1188 E00E6858 8FB300B4 */ lw $s3, 0xB4($sp)
/* 3E118C E00E685C 8FB200B0 */ lw $s2, 0xB0($sp)
/* 3E1190 E00E6860 8FB100AC */ lw $s1, 0xAC($sp)
/* 3E1194 E00E6864 8FB000A8 */ lw $s0, 0xA8($sp)
/* 3E1198 E00E6868 D7B400D0 */ ldc1 $f20, 0xD0($sp)
/* 3E119C E00E686C 03E00008 */ jr $ra
/* 3E11A0 E00E6870 27BD00D8 */ addiu $sp, $sp, 0xD8
/* 3E11A4 E00E6874 00000000 */ nop
/* 3E11A8 E00E6878 00000000 */ nop
/* 3E11AC E00E687C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void static_status_appendGfx(void* effect) {
StaticStatusFXData* part = ((EffectInstance*)effect)->data.staticStatus;
Camera* camera = &gCameras[gCurrentCameraID];
s32 unk_30 = part->alpha;
s32 unk_00 = part->type;
Matrix4f mtxTransform;
Matrix4f mtxTemp;
s32 i;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(mtxTransform, part->pos.x, part->pos.y, part->pos.z);
shim_guScaleF(mtxTemp, part->scale, part->scale, part->scale);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guMtxF2L(mtxTransform, &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);
gSPDisplayList(gMainGfxPos++, D_E00E6888[unk_00]);
part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
if (part->frame >= 0) {
shim_guPositionF(mtxTransform, 0.0f, 0.0f, part->rotation, part->scale, part->pos.x, part->pos.y, 0.0f);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, (unk_30 * part->alpha) >> 8);
gSPDisplayList(gMainGfxPos++, D_E00E6880[unk_00]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel btl_draw_enemy_health_bars
/* 16E880 8023FFA0 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 16E884 8023FFA4 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 16E888 8023FFA8 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 16E88C 8023FFAC AFBF0054 */ sw $ra, 0x54($sp)
/* 16E890 8023FFB0 AFBE0050 */ sw $fp, 0x50($sp)
/* 16E894 8023FFB4 AFB7004C */ sw $s7, 0x4C($sp)
/* 16E898 8023FFB8 AFB60048 */ sw $s6, 0x48($sp)
/* 16E89C 8023FFBC AFB50044 */ sw $s5, 0x44($sp)
/* 16E8A0 8023FFC0 AFB40040 */ sw $s4, 0x40($sp)
/* 16E8A4 8023FFC4 AFB3003C */ sw $s3, 0x3C($sp)
/* 16E8A8 8023FFC8 AFB20038 */ sw $s2, 0x38($sp)
/* 16E8AC 8023FFCC AFB10034 */ sw $s1, 0x34($sp)
/* 16E8B0 8023FFD0 AFB00030 */ sw $s0, 0x30($sp)
/* 16E8B4 8023FFD4 8042007C */ lb $v0, 0x7C($v0)
/* 16E8B8 8023FFD8 104000EC */ beqz $v0, func_8024038C
/* 16E8BC 8023FFDC 00000000 */ nop
/* 16E8C0 8023FFE0 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 16E8C4 8023FFE4 8C42C070 */ lw $v0, %lo(gBattleStatus)($v0)
/* 16E8C8 8023FFE8 30420001 */ andi $v0, $v0, 0x1
/* 16E8CC 8023FFEC 104000E7 */ beqz $v0, func_8024038C
/* 16E8D0 8023FFF0 0000B82D */ daddu $s7, $zero, $zero
/* 16E8D4 8023FFF4 27B60020 */ addiu $s6, $sp, 0x20
/* 16E8D8 8023FFF8 27B50024 */ addiu $s5, $sp, 0x24
/* 16E8DC 8023FFFC 241E0008 */ addiu $fp, $zero, 0x8
EFEB00_UpdateTexturePanSmooth:
/* 16E8E0 80240000 00171080 */ sll $v0, $s7, 2
.L80240004:
/* 16E8E4 80240004 3C08800E */ lui $t0, %hi(gBattleStatus)
glabel func_80240008
/* 16E8E8 80240008 2508C070 */ addiu $t0, $t0, %lo(gBattleStatus)
glabel obk_02_UpdateTrafficBooMotion
/* 16E8EC 8024000C 01021021 */ addu $v0, $t0, $v0
glabel end_01_WidenCameraFOV
/* 16E8F0 80240010 8C5300E0 */ lw $s3, 0xE0($v0)
glabel func_80240014
/* 16E8F4 80240014 526000DA */ beql $s3, $zero, D_80240380
glabel func_80240018
/* 16E8F8 80240018 26F70001 */ addiu $s7, $s7, 0x1
glabel dead_flo_08_SuperBlock_ClearOverride40
/* 16E8FC 8024001C 827401B8 */ lb $s4, 0x1B8($s3)
glabel dead_flo_11_Pipe_GetCurrentFloor
/* 16E900 80240020 826301B9 */ lb $v1, 0x1B9($s3)
/* 16E904 80240024 00141040 */ sll $v0, $s4, 1
glabel func_80240028
/* 16E908 80240028 00541021 */ addu $v0, $v0, $s4
glabel func_8024002C
/* 16E90C 8024002C 000210C0 */ sll $v0, $v0, 3
glabel func_80240030
/* 16E910 80240030 00541021 */ addu $v0, $v0, $s4
glabel func_80240034
/* 16E914 80240034 14600002 */ bnez $v1, func_80240040
glabel func_80240038
/* 16E918 80240038 0043001A */ div $zero, $v0, $v1
glabel func_8024003C
/* 16E91C 8024003C 0007000D */ break 7
glabel func_80240040
/* 16E920 80240040 2401FFFF */ addiu $at, $zero, -0x1
glabel func_80240044
/* 16E924 80240044 14610004 */ bne $v1, $at, func_80240058
glabel func_80240048
/* 16E928 80240048 3C018000 */ lui $at, (0x80000000 >> 16)
glabel omo_15_StarSpiritEffectFunc2
/* 16E92C 8024004C 14410002 */ bne $v0, $at, func_80240058
glabel func_80240050
/* 16E930 80240050 00000000 */ nop
glabel omo_09_WaitWhileConveyorPaused
/* 16E934 80240054 0006000D */ break 6
glabel func_80240058
/* 16E938 80240058 00008812 */ mflo $s1
glabel func_8024005C
/* 16E93C 8024005C 826201BC */ lb $v0, 0x1BC($s3)
D_80240060:
/* 16E940 80240060 926301BC */ lbu $v1, 0x1BC($s3)
glabel func_80240064
/* 16E944 80240064 0222102A */ slt $v0, $s1, $v0
glabel dead_flo_08_SuperBlock_GetPartnerRank
/* 16E948 80240068 10400008 */ beqz $v0, arn_08_func_8024008C_BF482C
glabel func_8024006C
/* 16E94C 8024006C 2462FFFE */ addiu $v0, $v1, -0x2
glabel dead_11_FlyingAI_WanderInit
/* 16E950 80240070 A26201BC */ sb $v0, 0x1BC($s3)
glabel func_80240074
/* 16E954 80240074 00021600 */ sll $v0, $v0, 24
glabel func_80240078
/* 16E958 80240078 00021603 */ sra $v0, $v0, 24
glabel func_8024007C
/* 16E95C 8024007C 0051102A */ slt $v0, $v0, $s1
glabel dead_flo_10_StashVars
/* 16E960 80240080 1040000E */ beqz $v0, func_802400BC
glabel func_80240084
/* 16E964 80240084 3C020004 */ lui $v0, (0x44000 >> 16)
glabel func_80240088
/* 16E968 80240088 A27101BC */ sb $s1, 0x1BC($s3)
glabel arn_08_func_8024008C_BF482C
/* 16E96C 8024008C 826201BC */ lb $v0, 0x1BC($s3)
glabel func_80240090
/* 16E970 80240090 926301BC */ lbu $v1, 0x1BC($s3)
.L80240094:
/* 16E974 80240094 0051102A */ slt $v0, $v0, $s1
glabel func_80240098
/* 16E978 80240098 10400007 */ beqz $v0, func_802400B8
glabel func_8024009C
/* 16E97C 8024009C 24620002 */ addiu $v0, $v1, 0x2
glabel func_802400A0
/* 16E980 802400A0 A26201BC */ sb $v0, 0x1BC($s3)
glabel func_802400A4
/* 16E984 802400A4 00021600 */ sll $v0, $v0, 24
glabel func_802400A8
/* 16E988 802400A8 00021603 */ sra $v0, $v0, 24
glabel func_802400AC
/* 16E98C 802400AC 0222102A */ slt $v0, $s1, $v0
glabel dead_flo_12_TransformFoliage
/* 16E990 802400B0 54400001 */ bnel $v0, $zero, func_802400B8
glabel func_802400B4
/* 16E994 802400B4 A27101BC */ sb $s1, 0x1BC($s3)
glabel func_802400B8
/* 16E998 802400B8 3C020004 */ lui $v0, (0x44000 >> 16)
glabel func_802400BC
/* 16E99C 802400BC 8E630000 */ lw $v1, 0x0($s3)
glabel func_802400C0
/* 16E9A0 802400C0 34424000 */ ori $v0, $v0, (0x44000 & 0xFFFF)
glabel obk_03_GetEntityPosition
/* 16E9A4 802400C4 00621024 */ and $v0, $v1, $v0
glabel func_802400C8
/* 16E9A8 802400C8 544000AD */ bnel $v0, $zero, D_80240380
glabel func_802400CC
/* 16E9AC 802400CC 26F70001 */ addiu $s7, $s7, 0x1
D_802400D0:
/* 16E9B0 802400D0 3C02800E */ lui $v0, %hi(gBattleStatus)
glabel func_802400D4
/* 16E9B4 802400D4 8C42C070 */ lw $v0, %lo(gBattleStatus)($v0)
glabel func_802400D8
/* 16E9B8 802400D8 30420002 */ andi $v0, $v0, 0x2
glabel func_802400DC
/* 16E9BC 802400DC 14400004 */ bnez $v0, dead_flo_11_Pipe_GetEntryPos
glabel func_802400E0
/* 16E9C0 802400E0 3C020008 */ lui $v0, (0x80000 >> 16)
glabel omo_17_CompareFloats
/* 16E9C4 802400E4 00621024 */ and $v0, $v1, $v0
glabel dgb_13_pad_E8
/* 16E9C8 802400E8 504000A5 */ beql $v0, $zero, D_80240380
glabel func_802400EC
/* 16E9CC 802400EC 26F70001 */ addiu $s7, $s7, 0x1
glabel dead_flo_11_Pipe_GetEntryPos
/* 16E9D0 802400F0 0C094F08 */ jal func_80253C20
glabel func_802400F4
/* 16E9D4 802400F4 0260202D */ daddu $a0, $s3, $zero
dgb_14_pad_F8:
/* 16E9D8 802400F8 504000A1 */ beql $v0, $zero, D_80240380
glabel dead_flo_16_SuperBlock_ClearOverride40
/* 16E9DC 802400FC 26F70001 */ addiu $s7, $s7, 0x1
D_80240100:
/* 16E9E0 80240100 86620156 */ lh $v0, 0x156($s3)
glabel omo_03_CompareFloats
/* 16E9E4 80240104 8663015A */ lh $v1, 0x15A($s3)
glabel .L80240108
/* 16E9E8 80240108 44822000 */ mtc1 $v0, $f4
glabel func_8024010C
/* 16E9EC 8024010C 00000000 */ nop
D_80240110:
/* 16E9F0 80240110 46802120 */ cvt.s.w $f4, $f4
glabel func_80240114
/* 16E9F4 80240114 86620158 */ lh $v0, 0x158($s3)
glabel func_80240118
/* 16E9F8 80240118 44831000 */ mtc1 $v1, $f2
dead_flo_16_SuperBlock_HideBlockContent:
/* 16E9FC 8024011C 00000000 */ nop
glabel dead_flo_08_SuperBlock_CountEligiblePartners
/* 16EA00 80240120 468010A0 */ cvt.s.w $f2, $f2
glabel EFEB00_UpdateTexturePanStepped
/* 16EA04 80240124 44820000 */ mtc1 $v0, $f0
glabel func_80240128
/* 16EA08 80240128 00000000 */ nop
glabel func_8024012C
/* 16EA0C 8024012C 46800020 */ cvt.s.w $f0, $f0
glabel func_80240130
/* 16EA10 80240130 2842FE0C */ slti $v0, $v0, -0x1F4
glabel dead_flo_10_GetItemName
/* 16EA14 80240134 54400092 */ bnel $v0, $zero, D_80240380
glabel func_80240138_D547C8
/* 16EA18 80240138 26F70001 */ addiu $s7, $s7, 0x1
glabel func_8024013C
/* 16EA1C 8024013C 24040001 */ addiu $a0, $zero, 0x1
glabel omo_07_ShyGuyWanderAI_16
/* 16EA20 80240140 44052000 */ mfc1 $a1, $f4
glabel func_80240144
/* 16EA24 80240144 44060000 */ mfc1 $a2, $f0
glabel func_80240148
/* 16EA28 80240148 44071000 */ mfc1 $a3, $f2
D_8024014C:
/* 16EA2C 8024014C 27A20028 */ addiu $v0, $sp, 0x28
glabel dead_flo_09_TransformFoliage
/* 16EA30 80240150 AFB60010 */ sw $s6, 0x10($sp)
glabel func_80240154
/* 16EA34 80240154 AFB50014 */ sw $s5, 0x14($sp)
glabel func_80240158_EC2358
/* 16EA38 80240158 0C00B94E */ jal get_screen_coords
glabel func_8024015C
/* 16EA3C 8024015C AFA20018 */ sw $v0, 0x18($sp)
glabel func_80240160
/* 16EA40 80240160 2405000A */ addiu $a1, $zero, 0xA
glabel dead_kzn_18_UpdateTexturePanStepped
/* 16EA44 80240164 3C10802A */ lui $s0, %hi(D_8029EFBC)
omo_17_AdvanceBuffer:
/* 16EA48 80240168 8E10EFBC */ lw $s0, %lo(D_8029EFBC)($s0)
glabel func_8024016C
/* 16EA4C 8024016C 8FA20024 */ lw $v0, 0x24($sp)
D_80240170:
/* 16EA50 80240170 0200202D */ daddu $a0, $s0, $zero
glabel func_80240174
/* 16EA54 80240174 24420010 */ addiu $v0, $v0, 0x10
D_80240178:
/* 16EA58 80240178 0C051277 */ jal hud_element_set_render_depth
D_8024017C:
/* 16EA5C 8024017C AFA20024 */ sw $v0, 0x24($sp)
glabel nok_14_SetCamera0Flag1000
/* 16EA60 80240180 3C058029 */ lui $a1, %hi(HES_HPBar)
glabel func_80240184
/* 16EA64 80240184 24A51F80 */ addiu $a1, $a1, %lo(HES_HPBar)
glabel func_80240188
/* 16EA68 80240188 0C0511FF */ jal hud_element_set_script
glabel func_8024018C
/* 16EA6C 8024018C 0200202D */ daddu $a0, $s0, $zero
glabel func_80240190
/* 16EA70 80240190 8FA50020 */ lw $a1, 0x20($sp)
glabel sam_12_PlayRisingBubble
/* 16EA74 80240194 8FA60024 */ lw $a2, 0x24($sp)
glabel dead_flo_10_UpdateTexturePanSmooth
/* 16EA78 80240198 0C051261 */ jal hud_element_set_render_pos
glabel func_8024019C
/* 16EA7C 8024019C 0200202D */ daddu $a0, $s0, $zero
glabel func_802401A0
/* 16EA80 802401A0 0C0511EA */ jal hud_element_draw_clipped
glabel func_802401A4
/* 16EA84 802401A4 0200202D */ daddu $a0, $s0, $zero
D_802401A8:
/* 16EA88 802401A8 3C026666 */ lui $v0, (0x66666667 >> 16)
glabel omo_15_StarSpiritEffectFunc3
/* 16EA8C 802401AC 34426667 */ ori $v0, $v0, (0x66666667 & 0xFFFF)
glabel func_802401B0
/* 16EA90 802401B0 02820018 */ mult $s4, $v0
glabel func_802401B4
/* 16EA94 802401B4 001417C3 */ sra $v0, $s4, 31
### DECOMPILED C INSTRUCTIONS:
void btl_draw_enemy_health_bars(void) {
BattleStatus* battleStatus = &gBattleStatus;
if (gGameStatusPtr->unk_7C != 0) {
if (gBattleStatus.flags1 & BS_FLAGS1_ACTORS_VISIBLE) {
s32 i;
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
Actor* enemy = battleStatus->enemyActors[i];
if (enemy != NULL) {
s32 currentHP;
s32 temp;
s32 ones;
currentHP = enemy->currentHP;
temp = (currentHP * 25) / enemy->maxHP;
if (temp < enemy->healthFraction) {
enemy->healthFraction -= 2;
if (enemy->healthFraction < temp) {
enemy->healthFraction = temp;
}
}
if (enemy->healthFraction < temp) {
enemy->healthFraction += 2;
if (enemy->healthFraction > temp) {
enemy->healthFraction = temp;
}
}
if (!(enemy->flags & (ACTOR_FLAG_NO_HEALTH_BAR | ACTOR_FLAG_TARGET_ONLY))
&& ((gBattleStatus.flags1 & BS_FLAGS1_MENU_OPEN) || (enemy->flags & ACTOR_FLAG_HEALTH_BAR_HIDDEN))
&& is_actor_health_bar_visible(enemy)
) {
f32 x = enemy->healthBarPos.x;
f32 y = enemy->healthBarPos.y;
f32 z = enemy->healthBarPos.z;
if (enemy->healthBarPos.y >= -500) {
s32 screenX, screenY, screenZ;
s32 id;
get_screen_coords(1, x, y, z, &screenX, &screenY, &screenZ);
screenY += 16;
id = D_8029EFBC;
hud_element_set_render_depth(id, 10);
hud_element_set_script(id, &HES_HPBar);
hud_element_set_render_pos(id, screenX, screenY);
hud_element_draw_clipped(id);
temp = currentHP / 10;
ones = currentHP % 10;
// tens digit
if (temp > 0) {
id = D_8029EFBC;
hud_element_set_render_depth(id, 10);
hud_element_set_script(id, bHPDigitHudScripts[temp]);
btl_draw_prim_quad(0, 0, 0, 0, screenX, screenY + 2, 8, 8);
hud_element_set_render_pos(id, screenX + 4, screenY + 6);
hud_element_draw_next(id);
}
// ones digit
id = D_8029EFBC;
hud_element_set_render_depth(id, 10);
hud_element_set_script(id, bHPDigitHudScripts[ones]);
btl_draw_prim_quad(0, 0, 0, 0, screenX + 6, screenY + 2, 8, 8);
hud_element_set_render_pos(id, screenX + 10, screenY + 6);
hud_element_draw_next(id);
temp = enemy->healthFraction;
temp = 25 - temp;
btl_draw_prim_quad(168, 0, 0, 255, screenX + 11 - temp, screenY - 7, temp, 1);
btl_draw_prim_quad(255, 0, 0, 255, screenX + 11 - temp, screenY - 6, temp, 4);
}
}
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_camera_mode_6
/* AD90 8002F990 27BDFFB8 */ addiu $sp, $sp, -0x48
/* AD94 8002F994 AFB00010 */ sw $s0, 0x10($sp)
/* AD98 8002F998 0080802D */ daddu $s0, $a0, $zero
/* AD9C 8002F99C AFBF0014 */ sw $ra, 0x14($sp)
/* ADA0 8002F9A0 F7BE0040 */ sdc1 $f30, 0x40($sp)
/* ADA4 8002F9A4 F7BC0038 */ sdc1 $f28, 0x38($sp)
/* ADA8 8002F9A8 F7BA0030 */ sdc1 $f26, 0x30($sp)
/* ADAC 8002F9AC F7B80028 */ sdc1 $f24, 0x28($sp)
/* ADB0 8002F9B0 F7B60020 */ sdc1 $f22, 0x20($sp)
/* ADB4 8002F9B4 F7B40018 */ sdc1 $f20, 0x18($sp)
/* ADB8 8002F9B8 86020006 */ lh $v0, 0x6($s0)
/* ADBC 8002F9BC 14400004 */ bnez $v0, .L8002F9D0
/* ADC0 8002F9C0 00000000 */ nop
/* ADC4 8002F9C4 86020008 */ lh $v0, 0x8($s0)
/* ADC8 8002F9C8 10400013 */ beqz $v0, .L8002FA18
/* ADCC 8002F9CC 00000000 */ nop
.L8002F9D0:
/* ADD0 8002F9D0 C6000054 */ lwc1 $f0, 0x54($s0)
/* ADD4 8002F9D4 C6020058 */ lwc1 $f2, 0x58($s0)
/* ADD8 8002F9D8 C604005C */ lwc1 $f4, 0x5C($s0)
/* ADDC 8002F9DC 24020064 */ addiu $v0, $zero, 0x64
/* ADE0 8002F9E0 A6000006 */ sh $zero, 0x6($s0)
/* ADE4 8002F9E4 A6000008 */ sh $zero, 0x8($s0)
/* ADE8 8002F9E8 A600001C */ sh $zero, 0x1C($s0)
/* ADEC 8002F9EC A602001E */ sh $v0, 0x1E($s0)
/* ADF0 8002F9F0 A6020020 */ sh $v0, 0x20($s0)
/* ADF4 8002F9F4 A6000022 */ sh $zero, 0x22($s0)
/* ADF8 8002F9F8 A6000024 */ sh $zero, 0x24($s0)
/* ADFC 8002F9FC A6000026 */ sh $zero, 0x26($s0)
/* AE00 8002FA00 AE000060 */ sw $zero, 0x60($s0)
/* AE04 8002FA04 AE000064 */ sw $zero, 0x64($s0)
/* AE08 8002FA08 AE000068 */ sw $zero, 0x68($s0)
/* AE0C 8002FA0C E6000048 */ swc1 $f0, 0x48($s0)
/* AE10 8002FA10 E602004C */ swc1 $f2, 0x4C($s0)
/* AE14 8002FA14 E6040050 */ swc1 $f4, 0x50($s0)
.L8002FA18:
/* AE18 8002FA18 8602001C */ lh $v0, 0x1C($s0)
/* AE1C 8002FA1C 14400073 */ bnez $v0, .L8002FBEC
/* AE20 8002FA20 24022710 */ addiu $v0, $zero, 0x2710
/* AE24 8002FA24 86030020 */ lh $v1, 0x20($s0)
/* AE28 8002FA28 14600002 */ bnez $v1, .L8002FA34
/* AE2C 8002FA2C 0043001A */ div $zero, $v0, $v1
/* AE30 8002FA30 0007000D */ break 7
.L8002FA34:
/* AE34 8002FA34 2401FFFF */ addiu $at, $zero, -0x1
/* AE38 8002FA38 14610004 */ bne $v1, $at, .L8002FA4C
/* AE3C 8002FA3C 3C018000 */ lui $at, (0x80000000 >> 16)
/* AE40 8002FA40 14410002 */ bne $v0, $at, .L8002FA4C
/* AE44 8002FA44 00000000 */ nop
/* AE48 8002FA48 0006000D */ break 6
.L8002FA4C:
/* AE4C 8002FA4C 00001812 */ mflo $v1
/* AE50 8002FA50 3C013F70 */ lui $at, (0x3F700000 >> 16)
/* AE54 8002FA54 44810800 */ mtc1 $at, $f1
/* AE58 8002FA58 44800000 */ mtc1 $zero, $f0
/* AE5C 8002FA5C C60A0054 */ lwc1 $f10, 0x54($s0)
/* AE60 8002FA60 C6020060 */ lwc1 $f2, 0x60($s0)
/* AE64 8002FA64 C6040064 */ lwc1 $f4, 0x64($s0)
/* AE68 8002FA68 C606005C */ lwc1 $f6, 0x5C($s0)
/* AE6C 8002FA6C 86020026 */ lh $v0, 0x26($s0)
/* AE70 8002FA70 46025280 */ add.s $f10, $f10, $f2
/* AE74 8002FA74 44824000 */ mtc1 $v0, $f8
/* AE78 8002FA78 00000000 */ nop
/* AE7C 8002FA7C 46804221 */ cvt.d.w $f8, $f8
/* AE80 8002FA80 86020024 */ lh $v0, 0x24($s0)
/* AE84 8002FA84 46204202 */ mul.d $f8, $f8, $f0
/* AE88 8002FA88 00000000 */ nop
/* AE8C 8002FA8C 44820000 */ mtc1 $v0, $f0
/* AE90 8002FA90 00000000 */ nop
/* AE94 8002FA94 46800020 */ cvt.s.w $f0, $f0
/* AE98 8002FA98 E6000084 */ swc1 $f0, 0x84($s0)
/* AE9C 8002FA9C C6000058 */ lwc1 $f0, 0x58($s0)
/* AEA0 8002FAA0 86020022 */ lh $v0, 0x22($s0)
/* AEA4 8002FAA4 E60A0048 */ swc1 $f10, 0x48($s0)
/* AEA8 8002FAA8 44821000 */ mtc1 $v0, $f2
/* AEAC 8002FAAC 00000000 */ nop
/* AEB0 8002FAB0 468010A0 */ cvt.s.w $f2, $f2
/* AEB4 8002FAB4 46040000 */ add.s $f0, $f0, $f4
/* AEB8 8002FAB8 E6020074 */ swc1 $f2, 0x74($s0)
/* AEBC 8002FABC C6020068 */ lwc1 $f2, 0x68($s0)
/* AEC0 8002FAC0 8602001E */ lh $v0, 0x1E($s0)
/* AEC4 8002FAC4 46023180 */ add.s $f6, $f6, $f2
/* AEC8 8002FAC8 44822000 */ mtc1 $v0, $f4
/* AECC 8002FACC 00000000 */ nop
/* AED0 8002FAD0 46802120 */ cvt.s.w $f4, $f4
/* AED4 8002FAD4 46000021 */ cvt.d.s $f0, $f0
/* AED8 8002FAD8 46280000 */ add.d $f0, $f0, $f8
/* AEDC 8002FADC E6040078 */ swc1 $f4, 0x78($s0)
/* AEE0 8002FAE0 E6060050 */ swc1 $f6, 0x50($s0)
/* AEE4 8002FAE4 46200020 */ cvt.s.d $f0, $f0
/* AEE8 8002FAE8 04610002 */ bgez $v1, .L8002FAF4
/* AEEC 8002FAEC E600004C */ swc1 $f0, 0x4C($s0)
/* AEF0 8002FAF0 24630003 */ addiu $v1, $v1, 0x3
.L8002FAF4:
/* AEF4 8002FAF4 C6020074 */ lwc1 $f2, 0x74($s0)
/* AEF8 8002FAF8 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* AEFC 8002FAFC 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* AF00 8002FB00 4481A000 */ mtc1 $at, $f20
/* AF04 8002FB04 00031083 */ sra $v0, $v1, 2
/* AF08 8002FB08 46141082 */ mul.s $f2, $f2, $f20
/* AF0C 8002FB0C 00000000 */ nop
/* AF10 8002FB10 4480F000 */ mtc1 $zero, $f30
/* AF14 8002FB14 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* AF18 8002FB18 4481B000 */ mtc1 $at, $f22
/* AF1C 8002FB1C 44820000 */ mtc1 $v0, $f0
/* AF20 8002FB20 00000000 */ nop
/* AF24 8002FB24 46800020 */ cvt.s.w $f0, $f0
/* AF28 8002FB28 E6000018 */ swc1 $f0, 0x18($s0)
/* AF2C 8002FB2C 46161683 */ div.s $f26, $f2, $f22
/* AF30 8002FB30 0C00A85B */ jal sin_rad
/* AF34 8002FB34 4600D306 */ mov.s $f12, $f26
/* AF38 8002FB38 46000706 */ mov.s $f28, $f0
/* AF3C 8002FB3C 0C00A874 */ jal cos_rad
/* AF40 8002FB40 4600D306 */ mov.s $f12, $f26
/* AF44 8002FB44 461E0202 */ mul.s $f8, $f0, $f30
/* AF48 8002FB48 00000000 */ nop
/* AF4C 8002FB4C 4600F087 */ neg.s $f2, $f30
/* AF50 8002FB50 4602E082 */ mul.s $f2, $f28, $f2
/* AF54 8002FB54 00000000 */ nop
/* AF58 8002FB58 C6180078 */ lwc1 $f24, 0x78($s0)
/* AF5C 8002FB5C 461CC102 */ mul.s $f4, $f24, $f28
/* AF60 8002FB60 00000000 */ nop
/* AF64 8002FB64 4600C182 */ mul.s $f6, $f24, $f0
/* AF68 8002FB68 00000000 */ nop
/* AF6C 8002FB6C C6000084 */ lwc1 $f0, 0x84($s0)
/* AF70 8002FB70 46140002 */ mul.s $f0, $f0, $f20
/* AF74 8002FB74 00000000 */ nop
/* AF78 8002FB78 4600F286 */ mov.s $f10, $f30
/* AF7C 8002FB7C 46005506 */ mov.s $f20, $f10
/* AF80 8002FB80 46044780 */ add.s $f30, $f8, $f4
/* AF84 8002FB84 46061600 */ add.s $f24, $f2, $f6
/* AF88 8002FB88 46160683 */ div.s $f26, $f0, $f22
/* AF8C 8002FB8C 0C00A85B */ jal sin_rad
/* AF90 8002FB90 4600D306 */ mov.s $f12, $f26
/* AF94 8002FB94 46000706 */ mov.s $f28, $f0
/* AF98 8002FB98 0C00A874 */ jal cos_rad
/* AF9C 8002FB9C 4600D306 */ mov.s $f12, $f26
/* AFA0 8002FBA0 46140182 */ mul.s $f6, $f0, $f20
/* AFA4 8002FBA4 00000000 */ nop
/* AFA8 8002FBA8 4614E102 */ mul.s $f4, $f28, $f20
/* AFAC 8002FBAC 00000000 */ nop
/* AFB0 8002FBB0 461CC082 */ mul.s $f2, $f24, $f28
/* AFB4 8002FBB4 00000000 */ nop
/* AFB8 8002FBB8 4600C002 */ mul.s $f0, $f24, $f0
/* AFBC 8002FBBC 00000000 */ nop
/* AFC0 8002FBC0 46023281 */ sub.s $f10, $f6, $f2
/* AFC4 8002FBC4 46002100 */ add.s $f4, $f4, $f0
/* AFC8 8002FBC8 C600004C */ lwc1 $f0, 0x4C($s0)
/* AFCC 8002FBCC 461E0000 */ add.s $f0, $f0, $f30
/* AFD0 8002FBD0 C6060048 */ lwc1 $f6, 0x48($s0)
/* AFD4 8002FBD4 460A3180 */ add.s $f6, $f6, $f10
/* AFD8 8002FBD8 C6020050 */ lwc1 $f2, 0x50($s0)
/* AFDC 8002FBDC 46041080 */ add.s $f2, $f2, $f4
/* AFE0 8002FBE0 E6000040 */ swc1 $f0, 0x40($s0)
/* AFE4 8002FBE4 E606003C */ swc1 $f6, 0x3C($s0)
/* AFE8 8002FBE8 E6020044 */ swc1 $f2, 0x44($s0)
.L8002FBEC:
/* AFEC 8002FBEC C60C003C */ lwc1 $f12, 0x3C($s0)
/* AFF0 8002FBF0 C60E0044 */ lwc1 $f14, 0x44($s0)
/* AFF4 8002FBF4 8E060048 */ lw $a2, 0x48($s0)
/* AFF8 8002FBF8 0C00A720 */ jal atan2
/* AFFC 8002FBFC 8E070050 */ lw $a3, 0x50($s0)
/* B000 8002FC00 C6040048 */ lwc1 $f4, 0x48($s0)
/* B004 8002FC04 4480B000 */ mtc1 $zero, $f22
/* B008 8002FC08 C602003C */ lwc1 $f2, 0x3C($s0)
/* B00C 8002FC0C E600006C */ swc1 $f0, 0x6C($s0)
/* B010 8002FC10 46022501 */ sub.s $f20, $f4, $f2
/* B014 8002FC14 C6040050 */ lwc1 $f4, 0x50($s0)
/* B018 8002FC18 C6020044 */ lwc1 $f2, 0x44($s0)
/* B01C 8002FC1C 4600B306 */ mov.s $f12, $f22
/* B020 8002FC20 46022601 */ sub.s $f24, $f4, $f2
/* B024 8002FC24 C604004C */ lwc1 $f4, 0x4C($s0)
/* B028 8002FC28 C6020040 */ lwc1 $f2, 0x40($s0)
/* B02C 8002FC2C 4406A000 */ mfc1 $a2, $f20
/* B030 8002FC30 46022781 */ sub.s $f30, $f4, $f2
/* B034 8002FC34 4407C000 */ mfc1 $a3, $f24
/* B038 8002FC38 0C00A720 */ jal atan2
/* B03C 8002FC3C 4600B386 */ mov.s $f14, $f22
/* B040 8002FC40 4614A102 */ mul.s $f4, $f20, $f20
/* B044 8002FC44 00000000 */ nop
/* B048 8002FC48 4618C082 */ mul.s $f2, $f24, $f24
/* B04C 8002FC4C 00000000 */ nop
/* B050 8002FC50 46022300 */ add.s $f12, $f4, $f2
/* B054 8002FC54 46000007 */ neg.s $f0, $f0
/* B058 8002FC58 E6000090 */ swc1 $f0, 0x90($s0)
/* B05C 8002FC5C 46006004 */ sqrt.s $f0, $f12
/* B060 8002FC60 46000032 */ c.eq.s $f0, $f0
/* B064 8002FC64 00000000 */ nop
/* B068 8002FC68 45030004 */ bc1tl .L8002FC7C
/* B06C 8002FC6C 4600B306 */ mov.s $f12, $f22
/* B070 8002FC70 0C0187BC */ jal sqrtf
/* B074 8002FC74 00000000 */ nop
/* B078 8002FC78 4600B306 */ mov.s $f12, $f22
.L8002FC7C:
/* B07C 8002FC7C 46000007 */ neg.s $f0, $f0
/* B080 8002FC80 4406F000 */ mfc1 $a2, $f30
/* B084 8002FC84 44070000 */ mfc1 $a3, $f0
/* B088 8002FC88 0C00A720 */ jal atan2
/* B08C 8002FC8C 46006386 */ mov.s $f14, $f12
/* B090 8002FC90 E6000094 */ swc1 $f0, 0x94($s0)
/* B094 8002FC94 C6000048 */ lwc1 $f0, 0x48($s0)
/* B098 8002FC98 3C02800E */ lui $v0, %hi(gBattleStatus)
/* B09C 8002FC9C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* B0A0 8002FCA0 E44000CC */ swc1 $f0, 0xCC($v0)
/* B0A4 8002FCA4 C600004C */ lwc1 $f0, 0x4C($s0)
/* B0A8 8002FCA8 E44000D0 */ swc1 $f0, 0xD0($v0)
/* B0AC 8002FCAC C6000050 */ lwc1 $f0, 0x50($s0)
/* B0B0 8002FCB0 E44000D4 */ swc1 $f0, 0xD4($v0)
/* B0B4 8002FCB4 8FBF0014 */ lw $ra, 0x14($sp)
/* B0B8 8002FCB8 8FB00010 */ lw $s0, 0x10($sp)
glabel func_8002FCBC
/* B0BC 8002FCBC D7BE0040 */ ldc1 $f30, 0x40($sp)
/* B0C0 8002FCC0 D7BC0038 */ ldc1 $f28, 0x38($sp)
/* B0C4 8002FCC4 D7BA0030 */ ldc1 $f26, 0x30($sp)
/* B0C8 8002FCC8 D7B80028 */ ldc1 $f24, 0x28($sp)
/* B0CC 8002FCCC D7B60020 */ ldc1 $f22, 0x20($sp)
/* B0D0 8002FCD0 D7B40018 */ ldc1 $f20, 0x18($sp)
/* B0D4 8002FCD4 03E00008 */ jr $ra
/* B0D8 8002FCD8 27BD0048 */ addiu $sp, $sp, 0x48
/* B0DC 8002FCDC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void update_camera_mode_6(Camera* camera) {
f32 sinBoom;
f32 cosBoom;
f32 deltaX;
f32 deltaY;
f32 deltaZ;
f32 deltaX2;
f32 deltaY2;
f32 deltaZ2;
f32 boomYaw;
f32 new_var;
f32 planarDist;
if (camera->needsInit || camera->isChangingMap) {
camera->needsInit = FALSE;
camera->isChangingMap = FALSE;
camera->auxPitch = 0;
camera->auxBoomLength = 100;
camera->lookAt_dist = 100;
camera->auxBoomPitch = 0;
camera->auxBoomYaw = 0;
camera->auxBoomZOffset = 0;
camera->targetPos.x = 0.0f;
camera->targetPos.y = 0.0f;
camera->targetPos.z = 0.0f;
camera->lookAt_obj.x = camera->lookAt_obj_target.x;
camera->lookAt_obj.y = camera->lookAt_obj_target.y;
camera->lookAt_obj.z = camera->lookAt_obj_target.z;
}
if (camera->auxPitch == 0) {
camera->lookAt_obj.x = camera->lookAt_obj_target.x + camera->targetPos.x;
camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->targetPos.y + camera->auxBoomZOffset / 256.0;
camera->lookAt_obj.z = camera->lookAt_obj_target.z + camera->targetPos.z;
camera->trueRotation.x = camera->auxBoomYaw;
camera->currentBoomYaw = camera->auxBoomPitch;
camera->currentBoomLength = camera->auxBoomLength;
camera->vfov = (10000 / camera->lookAt_dist) / 4;
boomYaw = DEG_TO_RAD(camera->currentBoomYaw);
sinBoom = sin_rad(boomYaw);
cosBoom = cos_rad(boomYaw);
deltaX = 0.0f;
deltaY = 0.0f;
deltaZ = camera->currentBoomLength;
deltaX2 = 0.0f;
deltaY2 = 0.0f;
boomYaw = deltaX = -deltaY2;
deltaZ2 = camera->currentBoomLength;
new_var = boomYaw;
deltaX = deltaX2;
deltaY = cosBoom * deltaY2 + deltaZ2 * sinBoom;
deltaZ = sinBoom * new_var + deltaZ2 * cosBoom;
boomYaw = DEG_TO_RAD(camera->trueRotation.x);
sinBoom = sin_rad(boomYaw);
cosBoom = cos_rad(boomYaw);
deltaZ2 = cosBoom * deltaX - deltaZ * sinBoom;
deltaX2 = cosBoom * deltaX - deltaZ * sinBoom;
deltaY2 = deltaY;
deltaZ2 = sinBoom * deltaX + deltaZ * cosBoom;
camera->lookAt_eye.x = camera->lookAt_obj.x + deltaX2;
camera->lookAt_eye.y = camera->lookAt_obj.y + deltaY2;
camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ2;
}
camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z);
deltaX = camera->lookAt_obj.x - camera->lookAt_eye.x;
deltaY = camera->lookAt_obj.y - camera->lookAt_eye.y;
deltaZ = camera->lookAt_obj.z - camera->lookAt_eye.z;
camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ);
planarDist = sqrtf(SQ(deltaX) + SQ(deltaZ));
camera->currentPitch = atan2(0.0f, 0.0f, deltaY, -planarDist);
gBattleStatus.camLookatObjPos.x = camera->lookAt_obj.x;
gBattleStatus.camLookatObjPos.y = camera->lookAt_obj.y;
gBattleStatus.camLookatObjPos.z = camera->lookAt_obj.z;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_802A1518_7A8EB8
/* 78BB18 802A1518 27BDFFD8 */ addiu $sp, $sp, -0x28
.L802A151C_7A8EBC:
/* 78BB1C 802A151C AFB1001C */ sw $s1, 0x1C($sp)
D_802A1520_7A8EC0:
/* 78BB20 802A1520 0080882D */ daddu $s1, $a0, $zero
.L802A1524_7A8EC4:
/* 78BB24 802A1524 AFBF0024 */ sw $ra, 0x24($sp)
glabel func_802A1528_7A8EC8
/* 78BB28 802A1528 AFB20020 */ sw $s2, 0x20($sp)
.L802A152C_7A8ECC:
/* 78BB2C 802A152C AFB00018 */ sw $s0, 0x18($sp)
D_802A1530_7A8ED0:
/* 78BB30 802A1530 8E24000C */ lw $a0, 0xC($s1)
.L802A1534_7A8ED4:
/* 78BB34 802A1534 54A00001 */ bnel $a1, $zero, func_802A153C_7A8EDC
/* 78BB38 802A1538 AE200070 */ sw $zero, 0x70($s1)
glabel func_802A153C_7A8EDC
/* 78BB3C 802A153C 24120001 */ addiu $s2, $zero, 0x1
D_802A1540_7A8EE0:
/* 78BB40 802A1540 8E230070 */ lw $v1, 0x70($s1)
D_802A1544_7A8EE4:
/* 78BB44 802A1544 8E300074 */ lw $s0, 0x74($s1)
D_802A1548_7A8EE8:
/* 78BB48 802A1548 10720027 */ beq $v1, $s2, .L802A15E8_7A8F88
glabel func_802A154C_7A8EEC
/* 78BB4C 802A154C 28620002 */ slti $v0, $v1, 0x2
D_802A1550_7A8EF0:
/* 78BB50 802A1550 10400005 */ beqz $v0, .L802A1568_7A8F08
.L802A1554_7A8EF4:
/* 78BB54 802A1554 24020002 */ addiu $v0, $zero, 0x2
/* 78BB58 802A1558 10600007 */ beqz $v1, .L802A1578_7A8F18
/* 78BB5C 802A155C 0000102D */ daddu $v0, $zero, $zero
.L802A1560_7A8F00:
/* 78BB60 802A1560 080A85EF */ j .L802A17BC_7A915C
.L802A1564_7A8F04:
/* 78BB64 802A1564 00000000 */ nop
.L802A1568_7A8F08:
/* 78BB68 802A1568 10620091 */ beq $v1, $v0, .L802A17B0_7A9150
glabel func_802A156C_7A8F0C
/* 78BB6C 802A156C 0000102D */ daddu $v0, $zero, $zero
/* 78BB70 802A1570 080A85EF */ j .L802A17BC_7A915C
/* 78BB74 802A1574 00000000 */ nop
.L802A1578_7A8F18:
/* 78BB78 802A1578 8C850000 */ lw $a1, 0x0($a0)
/* 78BB7C 802A157C 0C0B1EAF */ jal evt_get_variable
/* 78BB80 802A1580 0220202D */ daddu $a0, $s1, $zero
D_802A1584_7A8F24:
/* 78BB84 802A1584 0C00EABB */ jal get_npc_unsafe
.L802A1588_7A8F28:
/* 78BB88 802A1588 0040202D */ daddu $a0, $v0, $zero
.L802A158C_7A8F2C:
/* 78BB8C 802A158C 3C01BFC0 */ lui $at, (0xBFC00000 >> 16)
.L802A1590_7A8F30:
/* 78BB90 802A1590 44810000 */ mtc1 $at, $f0
.L802A1594_7A8F34:
/* 78BB94 802A1594 3C013CA3 */ lui $at, (0x3CA3D70A >> 16)
.L802A1598_7A8F38:
/* 78BB98 802A1598 3421D70A */ ori $at, $at, (0x3CA3D70A & 0xFFFF)
/* 78BB9C 802A159C 44811000 */ mtc1 $at, $f2
glabel func_802A15A0_7A8F40
/* 78BBA0 802A15A0 3C013F80 */ lui $at, (0x3F800000 >> 16)
D_802A15A4_7A8F44:
/* 78BBA4 802A15A4 44812000 */ mtc1 $at, $f4
/* 78BBA8 802A15A8 0040802D */ daddu $s0, $v0, $zero
glabel func_802A15AC_7A8F4C
/* 78BBAC 802A15AC AE300074 */ sw $s0, 0x74($s1)
D_802A15B0_7A8F50:
/* 78BBB0 802A15B0 C6060038 */ lwc1 $f6, 0x38($s0)
glabel func_802A15B4_7A8F54
/* 78BBB4 802A15B4 C608003C */ lwc1 $f8, 0x3C($s0)
.L802A15B8_7A8F58:
/* 78BBB8 802A15B8 C60A0040 */ lwc1 $f10, 0x40($s0)
/* 78BBBC 802A15BC AE000010 */ sw $zero, 0x10($s0)
.L802A15C0_7A8F60:
/* 78BBC0 802A15C0 AE00000C */ sw $zero, 0xC($s0)
/* 78BBC4 802A15C4 A600008E */ sh $zero, 0x8E($s0)
/* 78BBC8 802A15C8 E600001C */ swc1 $f0, 0x1C($s0)
/* 78BBCC 802A15CC E6020014 */ swc1 $f2, 0x14($s0)
.L802A15D0_7A8F70:
/* 78BBD0 802A15D0 E6040018 */ swc1 $f4, 0x18($s0)
/* 78BBD4 802A15D4 E6060060 */ swc1 $f6, 0x60($s0)
D_802A15D8_7A8F78:
/* 78BBD8 802A15D8 E6080064 */ swc1 $f8, 0x64($s0)
.L802A15DC_7A8F7C:
/* 78BBDC 802A15DC E60A0068 */ swc1 $f10, 0x68($s0)
/* 78BBE0 802A15E0 080A85EE */ j .L802A17B8_7A9158
D_802A15E4_7A8F84:
/* 78BBE4 802A15E4 AE320070 */ sw $s2, 0x70($s1)
.L802A15E8_7A8F88:
/* 78BBE8 802A15E8 C602001C */ lwc1 $f2, 0x1C($s0)
/* 78BBEC 802A15EC 44800000 */ mtc1 $zero, $f0
.L802A15F0_7A8F90:
/* 78BBF0 802A15F0 00000000 */ nop
.L802A15F4_7A8F94:
/* 78BBF4 802A15F4 4600103C */ c.lt.s $f2, $f0
/* 78BBF8 802A15F8 00000000 */ nop
/* 78BBFC 802A15FC 4500000D */ bc1f .L802A1634_7A8FD4
D_802A1600_7A8FA0:
/* 78BC00 802A1600 00000000 */ nop
.L802A1604_7A8FA4:
/* 78BC04 802A1604 C6000010 */ lwc1 $f0, 0x10($s0)
.L802A1608_7A8FA8:
/* 78BC08 802A1608 3C014008 */ lui $at, (0x40080000 >> 16)
/* 78BC0C 802A160C 44811800 */ mtc1 $at, $f3
.L802A1610_7A8FB0:
/* 78BC10 802A1610 44801000 */ mtc1 $zero, $f2
D_802A1614_7A8FB4:
/* 78BC14 802A1614 46000021 */ cvt.d.s $f0, $f0
.L802A1618_7A8FB8:
/* 78BC18 802A1618 46220000 */ add.d $f0, $f0, $f2
D_802A161C_7A8FBC:
/* 78BC1C 802A161C 3C014220 */ lui $at, (0x42200000 >> 16)
D_802A1620_7A8FC0:
/* 78BC20 802A1620 44811000 */ mtc1 $at, $f2
/* 78BC24 802A1624 46200020 */ cvt.s.d $f0, $f0
glabel func_802A1628_7A8FC8
/* 78BC28 802A1628 4600103C */ c.lt.s $f2, $f0
/* 78BC2C 802A162C 080A8598 */ j .L802A1660_7A9000
D_802A1630_7A8FD0:
/* 78BC30 802A1630 E6000010 */ swc1 $f0, 0x10($s0)
.L802A1634_7A8FD4:
/* 78BC34 802A1634 C6000010 */ lwc1 $f0, 0x10($s0)
/* 78BC38 802A1638 3C014000 */ lui $at, (0x40000000 >> 16)
glabel func_802A163C_7A8FDC
/* 78BC3C 802A163C 44811800 */ mtc1 $at, $f3
/* 78BC40 802A1640 44801000 */ mtc1 $zero, $f2
D_802A1644_7A8FE4:
/* 78BC44 802A1644 46000021 */ cvt.d.s $f0, $f0
/* 78BC48 802A1648 46220001 */ sub.d $f0, $f0, $f2
.L802A164C_7A8FEC:
/* 78BC4C 802A164C 3C0141A0 */ lui $at, (0x41A00000 >> 16)
/* 78BC50 802A1650 44811000 */ mtc1 $at, $f2
.L802A1654_7A8FF4:
/* 78BC54 802A1654 46200020 */ cvt.s.d $f0, $f0
/* 78BC58 802A1658 4602003C */ c.lt.s $f0, $f2
/* 78BC5C 802A165C E6000010 */ swc1 $f0, 0x10($s0)
.L802A1660_7A9000:
/* 78BC60 802A1660 45030001 */ bc1tl .L802A1668_7A9008
D_802A1664_7A9004:
/* 78BC64 802A1664 E6020010 */ swc1 $f2, 0x10($s0)
.L802A1668_7A9008:
/* 78BC68 802A1668 C6000018 */ lwc1 $f0, 0x18($s0)
/* 78BC6C 802A166C 3C013FE8 */ lui $at, (0x3FE80000 >> 16)
D_802A1670_7A9010:
/* 78BC70 802A1670 44811800 */ mtc1 $at, $f3
/* 78BC74 802A1674 44801000 */ mtc1 $zero, $f2
.L802A1678_7A9018:
/* 78BC78 802A1678 C604001C */ lwc1 $f4, 0x1C($s0)
.L802A167C_7A901C:
/* 78BC7C 802A167C 46000021 */ cvt.d.s $f0, $f0
/* 78BC80 802A1680 46220000 */ add.d $f0, $f0, $f2
/* 78BC84 802A1684 C6020014 */ lwc1 $f2, 0x14($s0)
/* 78BC88 802A1688 3C014204 */ lui $at, (0x42040000 >> 16)
D_802A168C_7A902C:
/* 78BC8C 802A168C 44813000 */ mtc1 $at, $f6
D_802A1690_7A9030:
/* 78BC90 802A1690 46022100 */ add.s $f4, $f4, $f2
/* 78BC94 802A1694 C602003C */ lwc1 $f2, 0x3C($s0)
glabel .L802A1698_7A9038
/* 78BC98 802A1698 46200020 */ cvt.s.d $f0, $f0
/* 78BC9C 802A169C 4600303C */ c.lt.s $f6, $f0
.L802A16A0_7A9040:
/* 78BCA0 802A16A0 46041080 */ add.s $f2, $f2, $f4
D_802A16A4_7A9044:
/* 78BCA4 802A16A4 E6000018 */ swc1 $f0, 0x18($s0)
/* 78BCA8 802A16A8 E604001C */ swc1 $f4, 0x1C($s0)
.L802A16AC_7A904C:
/* 78BCAC 802A16AC 45000002 */ bc1f .L802A16B8_7A9058
D_802A16B0_7A9050:
/* 78BCB0 802A16B0 E602003C */ swc1 $f2, 0x3C($s0)
/* 78BCB4 802A16B4 E6060018 */ swc1 $f6, 0x18($s0)
.L802A16B8_7A9058:
/* 78BCB8 802A16B8 C602000C */ lwc1 $f2, 0xC($s0)
/* 78BCBC 802A16BC C6000018 */ lwc1 $f0, 0x18($s0)
/* 78BCC0 802A16C0 8E060010 */ lw $a2, 0x10($s0)
/* 78BCC4 802A16C4 46001080 */ add.s $f2, $f2, $f0
/* 78BCC8 802A16C8 C6000060 */ lwc1 $f0, 0x60($s0)
glabel func_802A16CC_7A906C
/* 78BCCC 802A16CC 26040038 */ addiu $a0, $s0, 0x38
D_802A16D0_7A9070:
/* 78BCD0 802A16D0 E602000C */ swc1 $f2, 0xC($s0)
D_802A16D4_7A9074:
/* 78BCD4 802A16D4 44071000 */ mfc1 $a3, $f2
.L802A16D8_7A9078:
/* 78BCD8 802A16D8 C6020068 */ lwc1 $f2, 0x68($s0)
.L802A16DC_7A907C:
/* 78BCDC 802A16DC 26050040 */ addiu $a1, $s0, 0x40
/* 78BCE0 802A16E0 E6000038 */ swc1 $f0, 0x38($s0)
glabel func_802A16E4_7A9084
/* 78BCE4 802A16E4 0C00A7E7 */ jal add_vec2D_polar
/* 78BCE8 802A16E8 E6020040 */ swc1 $f2, 0x40($s0)
/* 78BCEC 802A16EC 3C039249 */ lui $v1, (0x92492493 >> 16)
D_802A16F0_7A9090:
/* 78BCF0 802A16F0 9602008E */ lhu $v0, 0x8E($s0)
glabel func_802A16F4_7A9094
/* 78BCF4 802A16F4 34632493 */ ori $v1, $v1, (0x92492493 & 0xFFFF)
/* 78BCF8 802A16F8 00021400 */ sll $v0, $v0, 16
.L802A16FC_7A909C:
/* 78BCFC 802A16FC 00022403 */ sra $a0, $v0, 16
.L802A1700_7A90A0:
/* 78BD00 802A1700 00830018 */ mult $a0, $v1
D_802A1704_7A90A4:
/* 78BD04 802A1704 000217C3 */ sra $v0, $v0, 31
.L802A1708_7A90A8:
/* 78BD08 802A1708 00004010 */ mfhi $t0
D_802A170C_7A90AC:
/* 78BD0C 802A170C 01041821 */ addu $v1, $t0, $a0
D_802A1710_7A90B0:
/* 78BD10 802A1710 000318C3 */ sra $v1, $v1, 3
/* 78BD14 802A1714 00621823 */ subu $v1, $v1, $v0
/* 78BD18 802A1718 000310C0 */ sll $v0, $v1, 3
.L802A171C_7A90BC:
/* 78BD1C 802A171C 00431023 */ subu $v0, $v0, $v1
/* 78BD20 802A1720 00021040 */ sll $v0, $v0, 1
D_802A1724_7A90C4:
/* 78BD24 802A1724 00822023 */ subu $a0, $a0, $v0
/* 78BD28 802A1728 00042400 */ sll $a0, $a0, 16
/* 78BD2C 802A172C 1480000A */ bnez $a0, .L802A1758_7A90F8
/* 78BD30 802A1730 00000000 */ nop
glabel .L802A1734_7A90D4
/* 78BD34 802A1734 3C0141F0 */ lui $at, (0x41F00000 >> 16)
.L802A1738_7A90D8:
/* 78BD38 802A1738 44810000 */ mtc1 $at, $f0
/* 78BD3C 802A173C 00000000 */ nop
D_802A1740_7A90E0:
/* 78BD40 802A1740 E7A00010 */ swc1 $f0, 0x10($sp)
D_802A1744_7A90E4:
/* 78BD44 802A1744 8E050038 */ lw $a1, 0x38($s0)
/* 78BD48 802A1748 8E06003C */ lw $a2, 0x3C($s0)
D_802A174C_7A90EC:
/* 78BD4C 802A174C 8E070040 */ lw $a3, 0x40($s0)
.L802A1750_7A90F0:
/* 78BD50 802A1750 0C01BFBC */ jal fx_sparkles
glabel .L802A1754_7A90F4
/* 78BD54 802A1754 0000202D */ daddu $a0, $zero, $zero
.L802A1758_7A90F8:
/* 78BD58 802A1758 9602008E */ lhu $v0, 0x8E($s0)
.L802A175C_7A90FC:
/* 78BD5C 802A175C 24420001 */ addiu $v0, $v0, 0x1
/* 78BD60 802A1760 A602008E */ sh $v0, 0x8E($s0)
/* 78BD64 802A1764 00021400 */ sll $v0, $v0, 16
/* 78BD68 802A1768 00021403 */ sra $v0, $v0, 16
D_802A176C_7A910C:
/* 78BD6C 802A176C 28420029 */ slti $v0, $v0, 0x29
D_802A1770_7A9110:
/* 78BD70 802A1770 14400005 */ bnez $v0, .L802A1788_7A9128
.L802A1774_7A9114:
/* 78BD74 802A1774 00000000 */ nop
/* 78BD78 802A1778 3C013F00 */ lui $at, (0x3F000000 >> 16)
.L802A177C_7A911C:
/* 78BD7C 802A177C 44810000 */ mtc1 $at, $f0
/* 78BD80 802A1780 00000000 */ nop
D_802A1784_7A9124:
/* 78BD84 802A1784 E6000014 */ swc1 $f0, 0x14($s0)
.L802A1788_7A9128:
/* 78BD88 802A1788 C602003C */ lwc1 $f2, 0x3C($s0)
/* 78BD8C 802A178C 3C014348 */ lui $at, (0x43480000 >> 16)
D_802A1790_7A9130:
/* 78BD90 802A1790 44810000 */ mtc1 $at, $f0
.L802A1794_7A9134:
/* 78BD94 802A1794 00000000 */ nop
.L802A1798_7A9138:
/* 78BD98 802A1798 4602003C */ c.lt.s $f0, $f2
.L802A179C_7A913C:
/* 78BD9C 802A179C 00000000 */ nop
D_802A17A0_7A9140:
/* 78BDA0 802A17A0 45000005 */ bc1f .L802A17B8_7A9158
D_802A17A4_7A9144:
/* 78BDA4 802A17A4 24020002 */ addiu $v0, $zero, 0x2
/* 78BDA8 802A17A8 080A85EE */ j .L802A17B8_7A9158
D_802A17AC_7A914C:
/* 78BDAC 802A17AC AE220070 */ sw $v0, 0x70($s1)
.L802A17B0_7A9150:
/* 78BDB0 802A17B0 080A85EF */ j .L802A17BC_7A915C
.L802A17B4_7A9154:
/* 78BDB4 802A17B4 24020002 */ addiu $v0, $zero, 0x2
.L802A17B8_7A9158:
/* 78BDB8 802A17B8 0000102D */ daddu $v0, $zero, $zero
.L802A17BC_7A915C:
/* 78BDBC 802A17BC 8FBF0024 */ lw $ra, 0x24($sp)
/* 78BDC0 802A17C0 8FB20020 */ lw $s2, 0x20($sp)
D_802A17C4_7A9164:
/* 78BDC4 802A17C4 8FB1001C */ lw $s1, 0x1C($sp)
/* 78BDC8 802A17C8 8FB00018 */ lw $s0, 0x18($sp)
D_802A17CC_7A916C:
/* 78BDCC 802A17CC 03E00008 */ jr $ra
D_802A17D0_7A9170:
/* 78BDD0 802A17D0 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(func_802A1518_78BB18) {
Bytecode* args = script->ptrReadPos;
Npc* npc;
if (isInitialCall) {
script->functionTemp[0] = 0;
}
npc = script->functionTempPtr[1];
switch (script->functionTemp[0]) {
case 0:
script->functionTempPtr[1] = npc = get_npc_unsafe(evt_get_variable(script, *args++));
npc->planarFlyDist = 0;
npc->yaw = 0;
npc->duration = 0;
npc->jumpVelocity = -1.5f;
npc->jumpScale = 0.02f;
npc->moveSpeed = 1.0f;
npc->moveToPos.x = npc->pos.x;
npc->moveToPos.y = npc->pos.y;
npc->moveToPos.z = npc->pos.z;
script->functionTemp[0] = 1;
break;
case 1:
if (npc->jumpVelocity < 0.0f) {
npc->planarFlyDist += 3.0;
if (npc->planarFlyDist > 40.0f) {
npc->planarFlyDist = 40.0f;
}
} else {
npc->planarFlyDist -= 2.0;
if (npc->planarFlyDist < 20.0f) {
npc->planarFlyDist = 20.0f;
}
}
npc->moveSpeed += 0.75;
npc->jumpVelocity += npc->jumpScale;
npc->pos.y += npc->jumpVelocity;
if (npc->moveSpeed > 33.0f) {
npc->moveSpeed = 33.0f;
}
npc->yaw += npc->moveSpeed;
npc->pos.x = npc->moveToPos.x;
npc->pos.z = npc->moveToPos.z;
add_vec2D_polar(&npc->pos.x, &npc->pos.z, npc->planarFlyDist, npc->yaw);
if ((npc->duration % 14) == 0) {
fx_sparkles(0, npc->pos.x, npc->pos.y, npc->pos.z, 30.0f);
}
npc->duration++;
if (npc->duration > 40) {
npc->jumpScale = 0.5f;
}
if (npc->pos.y > 200.0f) {
script->functionTemp[0] = 2;
}
break;
case 2:
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel item_entity_load
/* C7828 80131128 27BDFFC8 */ addiu $sp, $sp, -0x38
/* C782C 8013112C AFBE0030 */ sw $fp, 0x30($sp)
/* C7830 80131130 0080F02D */ daddu $fp, $a0, $zero
/* C7834 80131134 AFB7002C */ sw $s7, 0x2C($sp)
/* C7838 80131138 2417FFFF */ addiu $s7, $zero, -0x1
/* C783C 8013113C AFB50024 */ sw $s5, 0x24($sp)
/* C7840 80131140 3C150001 */ lui $s5, (0x10FFF >> 16)
/* C7844 80131144 AFBF0034 */ sw $ra, 0x34($sp)
/* C7848 80131148 AFB60028 */ sw $s6, 0x28($sp)
/* C784C 8013114C AFB40020 */ sw $s4, 0x20($sp)
/* C7850 80131150 AFB3001C */ sw $s3, 0x1C($sp)
/* C7854 80131154 AFB20018 */ sw $s2, 0x18($sp)
/* C7858 80131158 AFB10014 */ sw $s1, 0x14($sp)
/* C785C 8013115C AFB00010 */ sw $s0, 0x10($sp)
/* C7860 80131160 87C20018 */ lh $v0, 0x18($fp)
/* C7864 80131164 36B50FFF */ ori $s5, $s5, (0x10FFF & 0xFFFF)
/* C7868 80131168 00021080 */ sll $v0, $v0, 2
/* C786C 8013116C 3C108009 */ lui $s0, %hi(gItemEntityScripts)
/* C7870 80131170 02028021 */ addu $s0, $s0, $v0
/* C7874 80131174 8E10DDD4 */ lw $s0, %lo(gItemEntityScripts)($s0)
/* C7878 80131178 3C16001D */ lui $s6, %hi(D_1CC310)
/* C787C 8013117C 26D6C310 */ addiu $s6, $s6, %lo(D_1CC310)
/* C7880 80131180 AFD00024 */ sw $s0, 0x24($fp)
/* C7884 80131184 AFD00028 */ sw $s0, 0x28($fp)
glabel .L80131188
/* C7888 80131188 8E030000 */ lw $v1, 0x0($s0)
/* C788C 8013118C 2C620005 */ sltiu $v0, $v1, 0x5
/* C7890 80131190 1040FFFD */ beqz $v0, .L80131188
/* C7894 80131194 26100004 */ addiu $s0, $s0, 0x4
/* C7898 80131198 00031080 */ sll $v0, $v1, 2
/* C789C 8013119C 3C018015 */ lui $at, %hi(jtbl_80150A80)
/* C78A0 801311A0 00220821 */ addu $at, $at, $v0
/* C78A4 801311A4 8C220A80 */ lw $v0, %lo(jtbl_80150A80)($at)
/* C78A8 801311A8 00400008 */ jr $v0
/* C78AC 801311AC 00000000 */ nop
glabel .L801311B0
/* C78B0 801311B0 0804C462 */ j .L80131188
/* C78B4 801311B4 26100008 */ addiu $s0, $s0, 0x8
glabel .L801311B8
/* C78B8 801311B8 26100004 */ addiu $s0, $s0, 0x4
/* C78BC 801311BC 8E060000 */ lw $a2, 0x0($s0)
/* C78C0 801311C0 26100004 */ addiu $s0, $s0, 0x4
/* C78C4 801311C4 8E140000 */ lw $s4, 0x0($s0)
/* C78C8 801311C8 26100004 */ addiu $s0, $s0, 0x4
/* C78CC 801311CC 8FC20000 */ lw $v0, 0x0($fp)
/* C78D0 801311D0 3C030004 */ lui $v1, (0x40000 >> 16)
/* C78D4 801311D4 00431024 */ and $v0, $v0, $v1
/* C78D8 801311D8 10400002 */ beqz $v0, .L801311E4
/* C78DC 801311DC 24120120 */ addiu $s2, $zero, 0x120
/* C78E0 801311E0 24120200 */ addiu $s2, $zero, 0x200
.L801311E4:
/* C78E4 801311E4 3C038015 */ lui $v1, %hi(gHudElementCacheTableRaster)
/* C78E8 801311E8 8C6312C8 */ lw $v1, %lo(gHudElementCacheTableRaster)($v1)
/* C78EC 801311EC 0000882D */ daddu $s1, $zero, $zero
/* C78F0 801311F0 0220982D */ daddu $s3, $s1, $zero
/* C78F4 801311F4 24650004 */ addiu $a1, $v1, 0x4
.L801311F8:
/* C78F8 801311F8 8C620000 */ lw $v0, 0x0($v1)
/* C78FC 801311FC 1457001F */ bne $v0, $s7, .L8013127C
/* C7900 80131200 00000000 */ nop
/* C7904 80131204 3C048015 */ lui $a0, %hi(gHudElementCacheSize)
/* C7908 80131208 8C84133C */ lw $a0, %lo(gHudElementCacheSize)($a0)
/* C790C 8013120C 3C028015 */ lui $v0, %hi(gHudElementCacheBuffer)
/* C7910 80131210 8C421314 */ lw $v0, %lo(gHudElementCacheBuffer)($v0)
/* C7914 80131214 AC660000 */ sw $a2, 0x0($v1)
/* C7918 80131218 8C830000 */ lw $v1, 0x0($a0)
/* C791C 8013121C 00431021 */ addu $v0, $v0, $v1
/* C7920 80131220 ACA20000 */ sw $v0, 0x0($a1)
/* C7924 80131224 8C820000 */ lw $v0, 0x0($a0)
/* C7928 80131228 00521021 */ addu $v0, $v0, $s2
/* C792C 8013122C 02A2102A */ slt $v0, $s5, $v0
/* C7930 80131230 10400003 */ beqz $v0, .L80131240
/* C7934 80131234 00D62021 */ addu $a0, $a2, $s6
.L80131238:
/* C7938 80131238 0804C48E */ j .L80131238
/* C793C 8013123C 00000000 */ nop
.L80131240:
/* C7940 80131240 8CA50000 */ lw $a1, 0x0($a1)
/* C7944 80131244 0C017D24 */ jal nuPiReadRom
/* C7948 80131248 0240302D */ daddu $a2, $s2, $zero
/* C794C 8013124C 3C038015 */ lui $v1, %hi(gHudElementCacheSize)
/* C7950 80131250 8C63133C */ lw $v1, %lo(gHudElementCacheSize)($v1)
/* C7954 80131254 8C620000 */ lw $v0, 0x0($v1)
/* C7958 80131258 00521021 */ addu $v0, $v0, $s2
/* C795C 8013125C AC620000 */ sw $v0, 0x0($v1)
/* C7960 80131260 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7964 80131264 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C7968 80131268 80420070 */ lb $v0, 0x70($v0)
/* C796C 8013126C 5040000F */ beql $v0, $zero, .L801312AC
/* C7970 80131270 AE110000 */ sw $s1, 0x0($s0)
/* C7974 80131274 0804C4A8 */ j .L801312A0
/* C7978 80131278 00000000 */ nop
.L8013127C:
/* C797C 8013127C 5446000D */ bnel $v0, $a2, .L801312B4
/* C7980 80131280 24A50008 */ addiu $a1, $a1, 0x8
/* C7984 80131284 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7988 80131288 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C798C 8013128C 80420070 */ lb $v0, 0x70($v0)
/* C7990 80131290 14400003 */ bnez $v0, .L801312A0
/* C7994 80131294 00000000 */ nop
/* C7998 80131298 0804C4AB */ j .L801312AC
/* C799C 8013129C AE110000 */ sw $s1, 0x0($s0)
.L801312A0:
/* C79A0 801312A0 96020002 */ lhu $v0, 0x2($s0)
/* C79A4 801312A4 00531025 */ or $v0, $v0, $s3
/* C79A8 801312A8 AE020000 */ sw $v0, 0x0($s0)
.L801312AC:
/* C79AC 801312AC 0804C4B2 */ j .L801312C8
/* C79B0 801312B0 26100004 */ addiu $s0, $s0, 0x4
.L801312B4:
/* C79B4 801312B4 24630008 */ addiu $v1, $v1, 0x8
/* C79B8 801312B8 3C020001 */ lui $v0, (0x10000 >> 16)
/* C79BC 801312BC 02629821 */ addu $s3, $s3, $v0
/* C79C0 801312C0 0804C47E */ j .L801311F8
/* C79C4 801312C4 26310001 */ addiu $s1, $s1, 0x1
.L801312C8:
/* C79C8 801312C8 2A220100 */ slti $v0, $s1, 0x100
/* C79CC 801312CC 14400003 */ bnez $v0, .L801312DC
/* C79D0 801312D0 0000882D */ daddu $s1, $zero, $zero
.L801312D4:
/* C79D4 801312D4 0804C4B5 */ j .L801312D4
/* C79D8 801312D8 00000000 */ nop
.L801312DC:
/* C79DC 801312DC 3C038015 */ lui $v1, %hi(gHudElementCacheTablePalette)
/* C79E0 801312E0 8C6312D0 */ lw $v1, %lo(gHudElementCacheTablePalette)($v1)
/* C79E4 801312E4 0220902D */ daddu $s2, $s1, $zero
/* C79E8 801312E8 24650004 */ addiu $a1, $v1, 0x4
.L801312EC:
/* C79EC 801312EC 8C620000 */ lw $v0, 0x0($v1)
/* C79F0 801312F0 1457001F */ bne $v0, $s7, .L80131370
/* C79F4 801312F4 00000000 */ nop
/* C79F8 801312F8 3C048015 */ lui $a0, %hi(gHudElementCacheSize)
/* C79FC 801312FC 8C84133C */ lw $a0, %lo(gHudElementCacheSize)($a0)
/* C7A00 80131300 3C028015 */ lui $v0, %hi(gHudElementCacheBuffer)
/* C7A04 80131304 8C421314 */ lw $v0, %lo(gHudElementCacheBuffer)($v0)
/* C7A08 80131308 AC740000 */ sw $s4, 0x0($v1)
/* C7A0C 8013130C 8C830000 */ lw $v1, 0x0($a0)
/* C7A10 80131310 00431021 */ addu $v0, $v0, $v1
/* C7A14 80131314 ACA20000 */ sw $v0, 0x0($a1)
/* C7A18 80131318 8C820000 */ lw $v0, 0x0($a0)
/* C7A1C 8013131C 24420020 */ addiu $v0, $v0, 0x20
/* C7A20 80131320 02A2102A */ slt $v0, $s5, $v0
/* C7A24 80131324 10400003 */ beqz $v0, .L80131334
/* C7A28 80131328 02962021 */ addu $a0, $s4, $s6
.L8013132C:
/* C7A2C 8013132C 0804C4CB */ j .L8013132C
/* C7A30 80131330 00000000 */ nop
.L80131334:
/* C7A34 80131334 8CA50000 */ lw $a1, 0x0($a1)
/* C7A38 80131338 0C017D24 */ jal nuPiReadRom
/* C7A3C 8013133C 24060020 */ addiu $a2, $zero, 0x20
/* C7A40 80131340 3C038015 */ lui $v1, %hi(gHudElementCacheSize)
/* C7A44 80131344 8C63133C */ lw $v1, %lo(gHudElementCacheSize)($v1)
/* C7A48 80131348 8C620000 */ lw $v0, 0x0($v1)
/* C7A4C 8013134C 24420020 */ addiu $v0, $v0, 0x20
/* C7A50 80131350 AC620000 */ sw $v0, 0x0($v1)
/* C7A54 80131354 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7A58 80131358 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C7A5C 8013135C 80420070 */ lb $v0, 0x70($v0)
/* C7A60 80131360 5040000F */ beql $v0, $zero, .L801313A0
/* C7A64 80131364 AE110000 */ sw $s1, 0x0($s0)
/* C7A68 80131368 0804C4E5 */ j .L80131394
/* C7A6C 8013136C 00000000 */ nop
.L80131370:
/* C7A70 80131370 5454000D */ bnel $v0, $s4, .L801313A8
/* C7A74 80131374 24A50008 */ addiu $a1, $a1, 0x8
/* C7A78 80131378 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7A7C 8013137C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C7A80 80131380 80420070 */ lb $v0, 0x70($v0)
/* C7A84 80131384 14400003 */ bnez $v0, .L80131394
/* C7A88 80131388 00000000 */ nop
/* C7A8C 8013138C 0804C4E8 */ j .L801313A0
/* C7A90 80131390 AE110000 */ sw $s1, 0x0($s0)
.L80131394:
/* C7A94 80131394 96020002 */ lhu $v0, 0x2($s0)
/* C7A98 80131398 00521025 */ or $v0, $v0, $s2
/* C7A9C 8013139C AE020000 */ sw $v0, 0x0($s0)
.L801313A0:
/* C7AA0 801313A0 0804C462 */ j .L80131188
/* C7AA4 801313A4 26100004 */ addiu $s0, $s0, 0x4
.L801313A8:
/* C7AA8 801313A8 24630008 */ addiu $v1, $v1, 0x8
/* C7AAC 801313AC 3C020001 */ lui $v0, (0x10000 >> 16)
/* C7AB0 801313B0 02429021 */ addu $s2, $s2, $v0
/* C7AB4 801313B4 0804C4BB */ j .L801312EC
/* C7AB8 801313B8 26310001 */ addiu $s1, $s1, 0x1
glabel .L801313BC
/* C7ABC 801313BC 0C04C775 */ jal item_entity_update
/* C7AC0 801313C0 03C0202D */ daddu $a0, $fp, $zero
/* C7AC4 801313C4 8FBF0034 */ lw $ra, 0x34($sp)
/* C7AC8 801313C8 8FBE0030 */ lw $fp, 0x30($sp)
/* C7ACC 801313CC 8FB7002C */ lw $s7, 0x2C($sp)
/* C7AD0 801313D0 8FB60028 */ lw $s6, 0x28($sp)
/* C7AD4 801313D4 8FB50024 */ lw $s5, 0x24($sp)
/* C7AD8 801313D8 8FB40020 */ lw $s4, 0x20($sp)
/* C7ADC 801313DC 8FB3001C */ lw $s3, 0x1C($sp)
/* C7AE0 801313E0 8FB20018 */ lw $s2, 0x18($sp)
/* C7AE4 801313E4 8FB10014 */ lw $s1, 0x14($sp)
/* C7AE8 801313E8 8FB00010 */ lw $s0, 0x10($sp)
/* C7AEC 801313EC 03E00008 */ jr $ra
/* C7AF0 801313F0 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void item_entity_load(ItemEntity* item) {
s32* pos;
HudCacheEntry* entry;
s32 cond;
s32 raster;
s32 palette;
s32 size;
s32 i;
item->savedReadPos = item->readPos = pos = gItemEntityScripts[item->itemID];
while (TRUE) {
switch (*pos++) {
case ITEM_SCRIPT_OP_End:
break;
case ITEM_SCRIPT_OP_Restart:
case ITEM_SCRIPT_OP_Loop:
default:
continue;
case ITEM_SCRIPT_OP_RandomRestart:
pos += 2;
continue;
case ITEM_SCRIPT_OP_SetImage:
pos++;
raster = *pos++;
palette = *pos++;
// 32x32 or 24x24 (divided by 2 because these are ci4 iamges)
size = (item->flags & ITEM_ENTITY_FLAG_40000) ? (32 * 32 / 2) : (24 * 24 / 2);
entry = gHudElementCacheTableRaster;
i = 0;
while (TRUE) {
if (entry->id == -1) {
entry->id = raster;
entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize];
ASSERT(*gHudElementCacheSize + size < 0x11000);
nuPiReadRom((s32)icon_present_ROM_START + raster, entry->data, size);
*gHudElementCacheSize += size;
if (!gGameStatusPtr->isBattle) {
*pos = i;
} else {
*pos = (u16)(*pos) | (i << 16);
}
pos++;
break;
} else {
cond = entry->id == raster; // TODO required to match
if (cond) {
if (!gGameStatusPtr->isBattle) {
*pos = i;
} else {
*pos = (u16)(*pos) | (i << 16);
}
pos++;
break;
}
}
entry++;
i++;
}
ASSERT(i < MAX_ITEM_ENTITIES);
entry = gHudElementCacheTablePalette;
i = 0;
while (TRUE) {
if (entry->id == -1) {
entry->id = palette;
entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize];
ASSERT(*gHudElementCacheSize + 0x20 < 0x11000);
nuPiReadRom((s32)icon_present_ROM_START + palette, entry->data, 0x20);
*gHudElementCacheSize += 0x20;
if (!gGameStatusPtr->isBattle) {
*pos = i;
} else {
*pos = (u16)(*pos) | (i << 16);
}
pos++;
break;
} else if (entry->id == palette) {
if (!gGameStatusPtr->isBattle) {
*pos = i;
} else {
*pos = (u16)(*pos) | (i << 16);
}
pos++;
break;
}
entry++;
i++;
}
continue;
}
break;
}
item_entity_update(item);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel FallPartTo
/* 1A9134 8027A854 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 1A9138 8027A858 AFB30024 */ sw $s3, 0x24($sp)
/* 1A913C 8027A85C 0080982D */ daddu $s3, $a0, $zero
/* 1A9140 8027A860 AFBF0028 */ sw $ra, 0x28($sp)
/* 1A9144 8027A864 AFB20020 */ sw $s2, 0x20($sp)
/* 1A9148 8027A868 AFB1001C */ sw $s1, 0x1C($sp)
/* 1A914C 8027A86C AFB00018 */ sw $s0, 0x18($sp)
/* 1A9150 8027A870 F7BE0058 */ sdc1 $f30, 0x58($sp)
/* 1A9154 8027A874 F7BC0050 */ sdc1 $f28, 0x50($sp)
/* 1A9158 8027A878 F7BA0048 */ sdc1 $f26, 0x48($sp)
/* 1A915C 8027A87C F7B80040 */ sdc1 $f24, 0x40($sp)
/* 1A9160 8027A880 F7B60038 */ sdc1 $f22, 0x38($sp)
/* 1A9164 8027A884 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 1A9168 8027A888 8E72000C */ lw $s2, 0xC($s3)
/* 1A916C 8027A88C 54A00001 */ bnel $a1, $zero, .L8027A894
/* 1A9170 8027A890 AE600070 */ sw $zero, 0x70($s3)
.L8027A894:
/* 1A9174 8027A894 8E620070 */ lw $v0, 0x70($s3)
/* 1A9178 8027A898 1440007C */ bnez $v0, .L8027AA8C
/* 1A917C 8027A89C 00000000 */ nop
/* 1A9180 8027A8A0 8E450000 */ lw $a1, 0x0($s2)
/* 1A9184 8027A8A4 26520004 */ addiu $s2, $s2, 0x4
/* 1A9188 8027A8A8 0C0B1EAF */ jal evt_get_variable
/* 1A918C 8027A8AC 0260202D */ daddu $a0, $s3, $zero
/* 1A9190 8027A8B0 0040802D */ daddu $s0, $v0, $zero
/* 1A9194 8027A8B4 2402FF81 */ addiu $v0, $zero, -0x7F
/* 1A9198 8027A8B8 16020002 */ bne $s0, $v0, .L8027A8C4
/* 1A919C 8027A8BC 00000000 */ nop
/* 1A91A0 8027A8C0 8E700148 */ lw $s0, 0x148($s3)
.L8027A8C4:
/* 1A91A4 8027A8C4 8E450000 */ lw $a1, 0x0($s2)
/* 1A91A8 8027A8C8 26520004 */ addiu $s2, $s2, 0x4
/* 1A91AC 8027A8CC 0C0B1EAF */ jal evt_get_variable
/* 1A91B0 8027A8D0 0260202D */ daddu $a0, $s3, $zero
/* 1A91B4 8027A8D4 0200202D */ daddu $a0, $s0, $zero
/* 1A91B8 8027A8D8 0C09A75B */ jal get_actor
/* 1A91BC 8027A8DC 0040882D */ daddu $s1, $v0, $zero
/* 1A91C0 8027A8E0 0040802D */ daddu $s0, $v0, $zero
/* 1A91C4 8027A8E4 0200202D */ daddu $a0, $s0, $zero
/* 1A91C8 8027A8E8 0C099117 */ jal get_actor_part
/* 1A91CC 8027A8EC 0220282D */ daddu $a1, $s1, $zero
/* 1A91D0 8027A8F0 0040882D */ daddu $s1, $v0, $zero
/* 1A91D4 8027A8F4 AE700074 */ sw $s0, 0x74($s3)
/* 1A91D8 8027A8F8 AE710078 */ sw $s1, 0x78($s3)
/* 1A91DC 8027A8FC 8E450000 */ lw $a1, 0x0($s2)
/* 1A91E0 8027A900 26520004 */ addiu $s2, $s2, 0x4
/* 1A91E4 8027A904 8E300010 */ lw $s0, 0x10($s1)
/* 1A91E8 8027A908 0C0B1EAF */ jal evt_get_variable
/* 1A91EC 8027A90C 0260202D */ daddu $a0, $s3, $zero
/* 1A91F0 8027A910 4482E000 */ mtc1 $v0, $f28
/* 1A91F4 8027A914 00000000 */ nop
/* 1A91F8 8027A918 4680E720 */ cvt.s.w $f28, $f28
/* 1A91FC 8027A91C 8E450000 */ lw $a1, 0x0($s2)
/* 1A9200 8027A920 26520004 */ addiu $s2, $s2, 0x4
/* 1A9204 8027A924 0C0B1EAF */ jal evt_get_variable
/* 1A9208 8027A928 0260202D */ daddu $a0, $s3, $zero
/* 1A920C 8027A92C 4482F000 */ mtc1 $v0, $f30
/* 1A9210 8027A930 00000000 */ nop
/* 1A9214 8027A934 4680F7A0 */ cvt.s.w $f30, $f30
/* 1A9218 8027A938 8E450000 */ lw $a1, 0x0($s2)
/* 1A921C 8027A93C 26520004 */ addiu $s2, $s2, 0x4
/* 1A9220 8027A940 0C0B1EAF */ jal evt_get_variable
/* 1A9224 8027A944 0260202D */ daddu $a0, $s3, $zero
/* 1A9228 8027A948 44820000 */ mtc1 $v0, $f0
/* 1A922C 8027A94C 00000000 */ nop
/* 1A9230 8027A950 46800020 */ cvt.s.w $f0, $f0
/* 1A9234 8027A954 E61C000C */ swc1 $f28, 0xC($s0)
/* 1A9238 8027A958 E61E0010 */ swc1 $f30, 0x10($s0)
/* 1A923C 8027A95C E6000014 */ swc1 $f0, 0x14($s0)
/* 1A9240 8027A960 8E450000 */ lw $a1, 0x0($s2)
/* 1A9244 8027A964 0C0B1EAF */ jal evt_get_variable
/* 1A9248 8027A968 0260202D */ daddu $a0, $s3, $zero
/* 1A924C 8027A96C A6020038 */ sh $v0, 0x38($s0)
/* 1A9250 8027A970 C620002C */ lwc1 $f0, 0x2C($s1)
/* 1A9254 8027A974 C618000C */ lwc1 $f24, 0xC($s0)
/* 1A9258 8027A978 C61A0014 */ lwc1 $f26, 0x14($s0)
/* 1A925C 8027A97C C6160010 */ lwc1 $f22, 0x10($s0)
/* 1A9260 8027A980 E6000000 */ swc1 $f0, 0x0($s0)
/* 1A9264 8027A984 46000706 */ mov.s $f28, $f0
/* 1A9268 8027A988 4406C000 */ mfc1 $a2, $f24
/* 1A926C 8027A98C 4407D000 */ mfc1 $a3, $f26
/* 1A9270 8027A990 C6200030 */ lwc1 $f0, 0x30($s1)
/* 1A9274 8027A994 4600E306 */ mov.s $f12, $f28
/* 1A9278 8027A998 E6000004 */ swc1 $f0, 0x4($s0)
/* 1A927C 8027A99C C6340034 */ lwc1 $f20, 0x34($s1)
/* 1A9280 8027A9A0 46000786 */ mov.s $f30, $f0
/* 1A9284 8027A9A4 4600A386 */ mov.s $f14, $f20
/* 1A9288 8027A9A8 0C00A720 */ jal atan2
/* 1A928C 8027A9AC E6140008 */ swc1 $f20, 0x8($s0)
/* 1A9290 8027A9B0 4600E306 */ mov.s $f12, $f28
/* 1A9294 8027A9B4 4600A386 */ mov.s $f14, $f20
/* 1A9298 8027A9B8 4406C000 */ mfc1 $a2, $f24
/* 1A929C 8027A9BC 4407D000 */ mfc1 $a3, $f26
/* 1A92A0 8027A9C0 461EB781 */ sub.s $f30, $f22, $f30
/* 1A92A4 8027A9C4 0C00A7B5 */ jal dist2D
/* 1A92A8 8027A9C8 E6000030 */ swc1 $f0, 0x30($s0)
/* 1A92AC 8027A9CC 86020038 */ lh $v0, 0x38($s0)
/* 1A92B0 8027A9D0 46000086 */ mov.s $f2, $f0
/* 1A92B4 8027A9D4 14400007 */ bnez $v0, .L8027A9F4
/* 1A92B8 8027A9D8 E6020034 */ swc1 $f2, 0x34($s0)
/* 1A92BC 8027A9DC C6000028 */ lwc1 $f0, 0x28($s0)
/* 1A92C0 8027A9E0 46001003 */ div.s $f0, $f2, $f0
/* 1A92C4 8027A9E4 4600018D */ trunc.w.s $f6, $f0
/* 1A92C8 8027A9E8 44023000 */ mfc1 $v0, $f6
/* 1A92CC 8027A9EC 0809EA82 */ j .L8027AA08
/* 1A92D0 8027A9F0 A6020038 */ sh $v0, 0x38($s0)
.L8027A9F4:
/* 1A92D4 8027A9F4 44820000 */ mtc1 $v0, $f0
/* 1A92D8 8027A9F8 00000000 */ nop
/* 1A92DC 8027A9FC 46800020 */ cvt.s.w $f0, $f0
/* 1A92E0 8027AA00 46001003 */ div.s $f0, $f2, $f0
/* 1A92E4 8027AA04 E6000028 */ swc1 $f0, 0x28($s0)
.L8027AA08:
/* 1A92E8 8027AA08 86030038 */ lh $v1, 0x38($s0)
/* 1A92EC 8027AA0C 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 1A92F0 8027AA10 44810800 */ mtc1 $at, $f1
/* 1A92F4 8027AA14 44800000 */ mtc1 $zero, $f0
/* 1A92F8 8027AA18 00031023 */ negu $v0, $v1
/* 1A92FC 8027AA1C 44821000 */ mtc1 $v0, $f2
/* 1A9300 8027AA20 00000000 */ nop
/* 1A9304 8027AA24 468010A1 */ cvt.d.w $f2, $f2
/* 1A9308 8027AA28 46201082 */ mul.d $f2, $f2, $f0
/* 1A930C 8027AA2C 00000000 */ nop
/* 1A9310 8027AA30 AE00002C */ sw $zero, 0x2C($s0)
/* 1A9314 8027AA34 C604002C */ lwc1 $f4, 0x2C($s0)
/* 1A9318 8027AA38 44830000 */ mtc1 $v1, $f0
/* 1A931C 8027AA3C 00000000 */ nop
/* 1A9320 8027AA40 46800020 */ cvt.s.w $f0, $f0
/* 1A9324 8027AA44 4600F003 */ div.s $f0, $f30, $f0
/* 1A9328 8027AA48 46040001 */ sub.s $f0, $f0, $f4
/* 1A932C 8027AA4C 46000021 */ cvt.d.s $f0, $f0
/* 1A9330 8027AA50 46220003 */ div.d $f0, $f0, $f2
/* 1A9334 8027AA54 46200020 */ cvt.s.d $f0, $f0
/* 1A9338 8027AA58 E6000024 */ swc1 $f0, 0x24($s0)
/* 1A933C 8027AA5C 8E2200B4 */ lw $v0, 0xB4($s1)
/* 1A9340 8027AA60 10400009 */ beqz $v0, .L8027AA88
/* 1A9344 8027AA64 24020001 */ addiu $v0, $zero, 0x1
/* 1A9348 8027AA68 C6200034 */ lwc1 $f0, 0x34($s1)
/* 1A934C 8027AA6C E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A9350 8027AA70 8E2400B4 */ lw $a0, 0xB4($s1)
/* 1A9354 8027AA74 8E26002C */ lw $a2, 0x2C($s1)
/* 1A9358 8027AA78 8E270030 */ lw $a3, 0x30($s1)
/* 1A935C 8027AA7C 0C052757 */ jal sfx_play_sound_at_position
/* 1A9360 8027AA80 0000282D */ daddu $a1, $zero, $zero
/* 1A9364 8027AA84 24020001 */ addiu $v0, $zero, 0x1
.L8027AA88:
/* 1A9368 8027AA88 AE620070 */ sw $v0, 0x70($s3)
.L8027AA8C:
/* 1A936C 8027AA8C 8E710078 */ lw $s1, 0x78($s3)
/* 1A9370 8027AA90 8E300010 */ lw $s0, 0x10($s1)
/* 1A9374 8027AA94 C6040004 */ lwc1 $f4, 0x4($s0)
/* 1A9378 8027AA98 C600002C */ lwc1 $f0, 0x2C($s0)
/* 1A937C 8027AA9C 8E050028 */ lw $a1, 0x28($s0)
/* 1A9380 8027AAA0 46002100 */ add.s $f4, $f4, $f0
/* 1A9384 8027AAA4 C6020024 */ lwc1 $f2, 0x24($s0)
/* 1A9388 8027AAA8 8E060030 */ lw $a2, 0x30($s0)
/* 1A938C 8027AAAC 46020001 */ sub.s $f0, $f0, $f2
/* 1A9390 8027AAB0 0200202D */ daddu $a0, $s0, $zero
/* 1A9394 8027AAB4 E6040004 */ swc1 $f4, 0x4($s0)
/* 1A9398 8027AAB8 0C099070 */ jal add_xz_vec3f_copy1
/* 1A939C 8027AABC E600002C */ swc1 $f0, 0x2C($s0)
/* 1A93A0 8027AAC0 C6000000 */ lwc1 $f0, 0x0($s0)
/* 1A93A4 8027AAC4 E620002C */ swc1 $f0, 0x2C($s1)
/* 1A93A8 8027AAC8 C6000004 */ lwc1 $f0, 0x4($s0)
/* 1A93AC 8027AACC E6200030 */ swc1 $f0, 0x30($s1)
/* 1A93B0 8027AAD0 C6000008 */ lwc1 $f0, 0x8($s0)
/* 1A93B4 8027AAD4 E6200034 */ swc1 $f0, 0x34($s1)
/* 1A93B8 8027AAD8 96020038 */ lhu $v0, 0x38($s0)
/* 1A93BC 8027AADC 2442FFFF */ addiu $v0, $v0, -0x1
/* 1A93C0 8027AAE0 A6020038 */ sh $v0, 0x38($s0)
/* 1A93C4 8027AAE4 00021400 */ sll $v0, $v0, 16
/* 1A93C8 8027AAE8 1C40000F */ bgtz $v0, .L8027AB28
/* 1A93CC 8027AAEC 0000102D */ daddu $v0, $zero, $zero
/* 1A93D0 8027AAF0 C6000030 */ lwc1 $f0, 0x30($s0)
/* 1A93D4 8027AAF4 E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A93D8 8027AAF8 8E05000C */ lw $a1, 0xC($s0)
/* 1A93DC 8027AAFC 8E060010 */ lw $a2, 0x10($s0)
/* 1A93E0 8027AB00 8E070014 */ lw $a3, 0x14($s0)
/* 1A93E4 8027AB04 0C0990BC */ jal play_movement_dust_effects
/* 1A93E8 8027AB08 24040002 */ addiu $a0, $zero, 0x2
/* 1A93EC 8027AB0C C600000C */ lwc1 $f0, 0xC($s0)
/* 1A93F0 8027AB10 E620002C */ swc1 $f0, 0x2C($s1)
/* 1A93F4 8027AB14 C6000010 */ lwc1 $f0, 0x10($s0)
/* 1A93F8 8027AB18 E6200030 */ swc1 $f0, 0x30($s1)
/* 1A93FC 8027AB1C C6000014 */ lwc1 $f0, 0x14($s0)
/* 1A9400 8027AB20 24020001 */ addiu $v0, $zero, 0x1
/* 1A9404 8027AB24 E6200034 */ swc1 $f0, 0x34($s1)
.L8027AB28:
/* 1A9408 8027AB28 8FBF0028 */ lw $ra, 0x28($sp)
/* 1A940C 8027AB2C 8FB30024 */ lw $s3, 0x24($sp)
/* 1A9410 8027AB30 8FB20020 */ lw $s2, 0x20($sp)
/* 1A9414 8027AB34 8FB1001C */ lw $s1, 0x1C($sp)
/* 1A9418 8027AB38 8FB00018 */ lw $s0, 0x18($sp)
/* 1A941C 8027AB3C D7BE0058 */ ldc1 $f30, 0x58($sp)
/* 1A9420 8027AB40 D7BC0050 */ ldc1 $f28, 0x50($sp)
/* 1A9424 8027AB44 D7BA0048 */ ldc1 $f26, 0x48($sp)
/* 1A9428 8027AB48 D7B80040 */ ldc1 $f24, 0x40($sp)
/* 1A942C 8027AB4C D7B60038 */ ldc1 $f22, 0x38($sp)
/* 1A9430 8027AB50 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 1A9434 8027AB54 03E00008 */ jr $ra
/* 1A9438 8027AB58 27BD0060 */ addiu $sp, $sp, 0x60
### DECOMPILED C INSTRUCTIONS:
ApiStatus FallPartTo(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Actor* actor;
ActorPart* part;
ActorPartMovement* movement;
s32 actorID, partID;
f32 posX, posY, posZ;
f32 goalX, goalY, goalZ;
if (isInitialCall) {
script->functionTemp[0] = 0;
}
if (script->functionTemp[0] == 0) {
actorID = evt_get_variable(script, *args++);
if (actorID == ACTOR_SELF) {
actorID = script->owner1.actorID;
}
partID = evt_get_variable(script, *args++);
actor = get_actor(actorID);
part = get_actor_part(actor, partID);
script->functionTempPtr[1] = actor;
script->functionTempPtr[2] = part;
movement = part->movement;
posX = evt_get_variable(script, *args++);
posY = evt_get_variable(script, *args++);
posZ = evt_get_variable(script, *args++);
movement->goalPos.x = posX;
movement->goalPos.y = posY;
movement->goalPos.z = posZ;
movement->moveTime = evt_get_variable(script, *args++);
goalX = movement->goalPos.x;
goalY = movement->goalPos.y;
goalZ = movement->goalPos.z;
movement->absolutePosition.x = part->absolutePosition.x;
movement->absolutePosition.y = part->absolutePosition.y;
movement->absolutePosition.z = part->absolutePosition.z;
posX = movement->absolutePosition.x;
posY = movement->absolutePosition.y;
posZ = movement->absolutePosition.z;
movement->angle = atan2(posX, posZ, goalX, goalZ);
movement->distance = dist2D(posX, posZ, goalX, goalZ);
// make relative
posX = (goalX - posX);
posY = (goalY - posY);
posZ = (goalZ - posZ);
if (movement->moveTime == 0) {
movement->moveTime = movement->distance / movement->moveSpeed;
} else {
movement->moveSpeed = movement->distance / movement->moveTime;
}
movement->unk_2C = 0.0f;
movement->jumpScale = (posY / movement->moveTime - movement->unk_2C) / (-movement->moveTime * 0.5);
if (part->partTypeData[4] != 0) {
sfx_play_sound_at_position(part->partTypeData[4], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z);
}
script->functionTemp[0] = 1;
}
part = script->functionTempPtr[2];
movement = part->movement;
movement->absolutePosition.y += movement->unk_2C;
movement->unk_2C -= movement->jumpScale;
add_xz_vec3f_copy1(&movement->absolutePosition, movement->moveSpeed, movement->angle);
part->absolutePosition.x = movement->absolutePosition.x;
part->absolutePosition.y = movement->absolutePosition.y;
part->absolutePosition.z = movement->absolutePosition.z;
movement->moveTime--;
if (movement->moveTime <= 0) {
play_movement_dust_effects(2, movement->goalPos.x, movement->goalPos.y, movement->goalPos.z, movement->angle);
part->absolutePosition.x = movement->goalPos.x;
part->absolutePosition.y = movement->goalPos.y;
part->absolutePosition.z = movement->goalPos.z;
return ApiStatus_DONE1;
} else {
return ApiStatus_BLOCK;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel __osPfsRWInode
/* 4528C 80069E8C 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 45290 80069E90 AFB20030 */ sw $s2, 0x30($sp)
/* 45294 80069E94 00809021 */ addu $s2, $a0, $zero
/* 45298 80069E98 AFB40038 */ sw $s4, 0x38($sp)
/* 4529C 80069E9C 00A0A021 */ addu $s4, $a1, $zero
/* 452A0 80069EA0 AFB60040 */ sw $s6, 0x40($sp)
/* 452A4 80069EA4 00C0B021 */ addu $s6, $a2, $zero
/* 452A8 80069EA8 AFB70044 */ sw $s7, 0x44($sp)
/* 452AC 80069EAC 00E0B821 */ addu $s7, $a3, $zero
/* 452B0 80069EB0 32C200FF */ andi $v0, $s6, 0xFF
/* 452B4 80069EB4 AFBF004C */ sw $ra, 0x4C($sp)
/* 452B8 80069EB8 AFBE0048 */ sw $fp, 0x48($sp)
/* 452BC 80069EBC AFB5003C */ sw $s5, 0x3C($sp)
/* 452C0 80069EC0 AFB30034 */ sw $s3, 0x34($sp)
/* 452C4 80069EC4 AFB1002C */ sw $s1, 0x2C($sp)
/* 452C8 80069EC8 14400011 */ bnez $v0, .L80069F10
/* 452CC 80069ECC AFB00028 */ sw $s0, 0x28($sp)
/* 452D0 80069ED0 3C038009 */ lui $v1, %hi(D_800958D4)
/* 452D4 80069ED4 906358D4 */ lbu $v1, %lo(D_800958D4)($v1)
/* 452D8 80069ED8 32E200FF */ andi $v0, $s7, 0xFF
/* 452DC 80069EDC 1443000C */ bne $v0, $v1, .L80069F10
/* 452E0 80069EE0 00000000 */ nop
/* 452E4 80069EE4 8E430008 */ lw $v1, 0x8($s2)
/* 452E8 80069EE8 3C028009 */ lui $v0, %hi(D_800958D0)
/* 452EC 80069EEC 8C4258D0 */ lw $v0, %lo(D_800958D0)($v0)
/* 452F0 80069EF0 14620007 */ bne $v1, $v0, .L80069F10
/* 452F4 80069EF4 00000000 */ nop
/* 452F8 80069EF8 3C04800E */ lui $a0, %hi(__osPfsInodeCache)
/* 452FC 80069EFC 24849680 */ addiu $a0, $a0, %lo(__osPfsInodeCache)
/* 45300 80069F00 0C019194 */ jal bcopy
/* 45304 80069F04 24060100 */ addiu $a2, $zero, 0x100
/* 45308 80069F08 0801A865 */ j .L8006A194
/* 4530C 80069F0C 00001021 */ addu $v0, $zero, $zero
.L80069F10:
/* 45310 80069F10 92420065 */ lbu $v0, 0x65($s2)
/* 45314 80069F14 10400006 */ beqz $v0, .L80069F30
/* 45318 80069F18 02402021 */ addu $a0, $s2, $zero
/* 4531C 80069F1C 0C01A5B4 */ jal __osPfsSelectBank
/* 45320 80069F20 00002821 */ addu $a1, $zero, $zero
/* 45324 80069F24 00401821 */ addu $v1, $v0, $zero
/* 45328 80069F28 1460009A */ bnez $v1, .L8006A194
/* 4532C 80069F2C 00000000 */ nop
.L80069F30:
/* 45330 80069F30 32E200FF */ andi $v0, $s7, 0xFF
/* 45334 80069F34 14400002 */ bnez $v0, .L80069F40
/* 45338 80069F38 24150001 */ addiu $s5, $zero, 0x1
/* 4533C 80069F3C 8E550060 */ lw $s5, 0x60($s2)
.L80069F40:
/* 45340 80069F40 32C300FF */ andi $v1, $s6, 0xFF
/* 45344 80069F44 24020001 */ addiu $v0, $zero, 0x1
/* 45348 80069F48 14620011 */ bne $v1, $v0, .L80069F90
/* 4534C 80069F4C 00008021 */ addu $s0, $zero, $zero
/* 45350 80069F50 00151040 */ sll $v0, $s5, 1
/* 45354 80069F54 00542821 */ addu $a1, $v0, $s4
/* 45358 80069F58 00002021 */ addu $a0, $zero, $zero
/* 4535C 80069F5C 24020080 */ addiu $v0, $zero, 0x80
/* 45360 80069F60 00551023 */ subu $v0, $v0, $s5
/* 45364 80069F64 00023040 */ sll $a2, $v0, 1
/* 45368 80069F68 18C00007 */ blez $a2, .L80069F88
/* 4536C 80069F6C 00001821 */ addu $v1, $zero, $zero
.L80069F70:
/* 45370 80069F70 90A20000 */ lbu $v0, 0x0($a1)
/* 45374 80069F74 24840001 */ addiu $a0, $a0, 0x1
/* 45378 80069F78 00621821 */ addu $v1, $v1, $v0
/* 4537C 80069F7C 0086102A */ slt $v0, $a0, $a2
/* 45380 80069F80 1440FFFB */ bnez $v0, .L80069F70
/* 45384 80069F84 24A50001 */ addiu $a1, $a1, 0x1
.L80069F88:
/* 45388 80069F88 A2830001 */ sb $v1, 0x1($s4)
/* 4538C 80069F8C 00008021 */ addu $s0, $zero, $zero
.L80069F90:
/* 45390 80069F90 32DE00FF */ andi $fp, $s6, 0xFF
/* 45394 80069F94 32E200FF */ andi $v0, $s7, 0xFF
/* 45398 80069F98 000298C0 */ sll $s3, $v0, 3
/* 4539C 80069F9C 00101140 */ sll $v0, $s0, 5
.L80069FA0:
/* 453A0 80069FA0 24080001 */ addiu $t0, $zero, 0x1
/* 453A4 80069FA4 17C80015 */ bne $fp, $t0, .L80069FFC
/* 453A8 80069FA8 02828821 */ addu $s1, $s4, $v0
/* 453AC 80069FAC 8E460054 */ lw $a2, 0x54($s2)
/* 453B0 80069FB0 AFA00010 */ sw $zero, 0x10($sp)
/* 453B4 80069FB4 8E440004 */ lw $a0, 0x4($s2)
/* 453B8 80069FB8 8E450008 */ lw $a1, 0x8($s2)
/* 453BC 80069FBC 02203821 */ addu $a3, $s1, $zero
/* 453C0 80069FC0 00D33021 */ addu $a2, $a2, $s3
/* 453C4 80069FC4 00D03021 */ addu $a2, $a2, $s0
/* 453C8 80069FC8 0C01A8F0 */ jal osContRamWrite
/* 453CC 80069FCC 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 453D0 80069FD0 8E460058 */ lw $a2, 0x58($s2)
/* 453D4 80069FD4 AFA00010 */ sw $zero, 0x10($sp)
/* 453D8 80069FD8 8E440004 */ lw $a0, 0x4($s2)
/* 453DC 80069FDC 8E450008 */ lw $a1, 0x8($s2)
/* 453E0 80069FE0 02203821 */ addu $a3, $s1, $zero
/* 453E4 80069FE4 00D33021 */ addu $a2, $a2, $s3
/* 453E8 80069FE8 00D03021 */ addu $a2, $a2, $s0
/* 453EC 80069FEC 0C01A8F0 */ jal osContRamWrite
/* 453F0 80069FF0 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 453F4 80069FF4 0801A808 */ j .L8006A020
/* 453F8 80069FF8 00401821 */ addu $v1, $v0, $zero
.L80069FFC:
/* 453FC 80069FFC 8E440004 */ lw $a0, 0x4($s2)
/* 45400 8006A000 8E460054 */ lw $a2, 0x54($s2)
/* 45404 8006A004 8E450008 */ lw $a1, 0x8($s2)
/* 45408 8006A008 02203821 */ addu $a3, $s1, $zero
/* 4540C 8006A00C 00D33021 */ addu $a2, $a2, $s3
/* 45410 8006A010 00D03021 */ addu $a2, $a2, $s0
/* 45414 8006A014 0C01A874 */ jal __osContRamRead
/* 45418 8006A018 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 4541C 8006A01C 00401821 */ addu $v1, $v0, $zero
.L8006A020:
/* 45420 8006A020 1460003D */ bnez $v1, .L8006A118
/* 45424 8006A024 26100001 */ addiu $s0, $s0, 0x1
/* 45428 8006A028 2A020008 */ slti $v0, $s0, 0x8
/* 4542C 8006A02C 1440FFDC */ bnez $v0, .L80069FA0
/* 45430 8006A030 00101140 */ sll $v0, $s0, 5
/* 45434 8006A034 32C200FF */ andi $v0, $s6, 0xFF
/* 45438 8006A038 5440004C */ bnel $v0, $zero, .L8006A16C
/* 4543C 8006A03C 02802021 */ addu $a0, $s4, $zero
/* 45440 8006A040 00003821 */ addu $a3, $zero, $zero
/* 45444 8006A044 00151040 */ sll $v0, $s5, 1
/* 45448 8006A048 00542821 */ addu $a1, $v0, $s4
/* 4544C 8006A04C 24020080 */ addiu $v0, $zero, 0x80
/* 45450 8006A050 00551023 */ subu $v0, $v0, $s5
/* 45454 8006A054 00023040 */ sll $a2, $v0, 1
/* 45458 8006A058 0066102A */ slt $v0, $v1, $a2
/* 4545C 8006A05C 10400007 */ beqz $v0, .L8006A07C
/* 45460 8006A060 00002021 */ addu $a0, $zero, $zero
.L8006A064:
/* 45464 8006A064 90A20000 */ lbu $v0, 0x0($a1)
/* 45468 8006A068 24840001 */ addiu $a0, $a0, 0x1
/* 4546C 8006A06C 00E23821 */ addu $a3, $a3, $v0
/* 45470 8006A070 0086102A */ slt $v0, $a0, $a2
/* 45474 8006A074 1440FFFB */ bnez $v0, .L8006A064
/* 45478 8006A078 24A50001 */ addiu $a1, $a1, 0x1
.L8006A07C:
/* 4547C 8006A07C 92830001 */ lbu $v1, 0x1($s4)
/* 45480 8006A080 30E200FF */ andi $v0, $a3, 0xFF
/* 45484 8006A084 10430038 */ beq $v0, $v1, .L8006A168
/* 45488 8006A088 32E200FF */ andi $v0, $s7, 0xFF
/* 4548C 8006A08C 00008021 */ addu $s0, $zero, $zero
/* 45490 8006A090 000298C0 */ sll $s3, $v0, 3
/* 45494 8006A094 02808821 */ addu $s1, $s4, $zero
.L8006A098:
/* 45498 8006A098 8E440004 */ lw $a0, 0x4($s2)
/* 4549C 8006A09C 8E450008 */ lw $a1, 0x8($s2)
/* 454A0 8006A0A0 8E460058 */ lw $a2, 0x58($s2)
/* 454A4 8006A0A4 02203821 */ addu $a3, $s1, $zero
/* 454A8 8006A0A8 26310020 */ addiu $s1, $s1, 0x20
/* 454AC 8006A0AC 00D33021 */ addu $a2, $a2, $s3
/* 454B0 8006A0B0 00D03021 */ addu $a2, $a2, $s0
/* 454B4 8006A0B4 0C01A874 */ jal __osContRamRead
/* 454B8 8006A0B8 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 454BC 8006A0BC 26100001 */ addiu $s0, $s0, 0x1
/* 454C0 8006A0C0 2A020008 */ slti $v0, $s0, 0x8
/* 454C4 8006A0C4 1440FFF4 */ bnez $v0, .L8006A098
/* 454C8 8006A0C8 24030080 */ addiu $v1, $zero, 0x80
/* 454CC 8006A0CC 00151040 */ sll $v0, $s5, 1
/* 454D0 8006A0D0 00543021 */ addu $a2, $v0, $s4
/* 454D4 8006A0D4 00002021 */ addu $a0, $zero, $zero
/* 454D8 8006A0D8 00751823 */ subu $v1, $v1, $s5
/* 454DC 8006A0DC 00031840 */ sll $v1, $v1, 1
/* 454E0 8006A0E0 18600007 */ blez $v1, .L8006A100
/* 454E4 8006A0E4 00002821 */ addu $a1, $zero, $zero
.L8006A0E8:
/* 454E8 8006A0E8 90C20000 */ lbu $v0, 0x0($a2)
/* 454EC 8006A0EC 24840001 */ addiu $a0, $a0, 0x1
/* 454F0 8006A0F0 00A22821 */ addu $a1, $a1, $v0
/* 454F4 8006A0F4 0083102A */ slt $v0, $a0, $v1
/* 454F8 8006A0F8 1440FFFB */ bnez $v0, .L8006A0E8
/* 454FC 8006A0FC 24C60001 */ addiu $a2, $a2, 0x1
.L8006A100:
/* 45500 8006A100 92830001 */ lbu $v1, 0x1($s4)
/* 45504 8006A104 30A200FF */ andi $v0, $a1, 0xFF
/* 45508 8006A108 10430005 */ beq $v0, $v1, .L8006A120
/* 4550C 8006A10C 24020003 */ addiu $v0, $zero, 0x3
/* 45510 8006A110 0801A865 */ j .L8006A194
/* 45514 8006A114 00000000 */ nop
.L8006A118:
/* 45518 8006A118 0801A865 */ j .L8006A194
/* 4551C 8006A11C 00601021 */ addu $v0, $v1, $zero
.L8006A120:
/* 45520 8006A120 00008021 */ addu $s0, $zero, $zero
/* 45524 8006A124 32E200FF */ andi $v0, $s7, 0xFF
/* 45528 8006A128 000298C0 */ sll $s3, $v0, 3
/* 4552C 8006A12C 02808821 */ addu $s1, $s4, $zero
.L8006A130:
/* 45530 8006A130 8E460054 */ lw $a2, 0x54($s2)
/* 45534 8006A134 AFA00010 */ sw $zero, 0x10($sp)
/* 45538 8006A138 8E440004 */ lw $a0, 0x4($s2)
/* 4553C 8006A13C 8E450008 */ lw $a1, 0x8($s2)
/* 45540 8006A140 02203821 */ addu $a3, $s1, $zero
/* 45544 8006A144 26310020 */ addiu $s1, $s1, 0x20
/* 45548 8006A148 00D33021 */ addu $a2, $a2, $s3
/* 4554C 8006A14C 00D03021 */ addu $a2, $a2, $s0
/* 45550 8006A150 0C01A8F0 */ jal osContRamWrite
/* 45554 8006A154 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 45558 8006A158 26100001 */ addiu $s0, $s0, 0x1
/* 4555C 8006A15C 2A020008 */ slti $v0, $s0, 0x8
/* 45560 8006A160 1440FFF3 */ bnez $v0, .L8006A130
/* 45564 8006A164 00000000 */ nop
.L8006A168:
/* 45568 8006A168 02802021 */ addu $a0, $s4, $zero
.L8006A16C:
/* 4556C 8006A16C 3C05800E */ lui $a1, %hi(__osPfsInodeCache)
/* 45570 8006A170 24A59680 */ addiu $a1, $a1, %lo(__osPfsInodeCache)
/* 45574 8006A174 3C018009 */ lui $at, %hi(D_800958D4)
/* 45578 8006A178 A03758D4 */ sb $s7, %lo(D_800958D4)($at)
/* 4557C 8006A17C 0C019194 */ jal bcopy
/* 45580 8006A180 24060100 */ addiu $a2, $zero, 0x100
/* 45584 8006A184 8E430008 */ lw $v1, 0x8($s2)
/* 45588 8006A188 00001021 */ addu $v0, $zero, $zero
/* 4558C 8006A18C 3C018009 */ lui $at, %hi(D_800958D0)
/* 45590 8006A190 AC2358D0 */ sw $v1, %lo(D_800958D0)($at)
.L8006A194:
/* 45594 8006A194 8FBF004C */ lw $ra, 0x4C($sp)
/* 45598 8006A198 8FBE0048 */ lw $fp, 0x48($sp)
/* 4559C 8006A19C 8FB70044 */ lw $s7, 0x44($sp)
/* 455A0 8006A1A0 8FB60040 */ lw $s6, 0x40($sp)
/* 455A4 8006A1A4 8FB5003C */ lw $s5, 0x3C($sp)
/* 455A8 8006A1A8 8FB40038 */ lw $s4, 0x38($sp)
/* 455AC 8006A1AC 8FB30034 */ lw $s3, 0x34($sp)
/* 455B0 8006A1B0 8FB20030 */ lw $s2, 0x30($sp)
/* 455B4 8006A1B4 8FB1002C */ lw $s1, 0x2C($sp)
/* 455B8 8006A1B8 8FB00028 */ lw $s0, 0x28($sp)
/* 455BC 8006A1BC 03E00008 */ jr $ra
/* 455C0 8006A1C0 27BD0050 */ addiu $sp, $sp, 0x50
/* 455C4 8006A1C4 00000000 */ nop
/* 455C8 8006A1C8 00000000 */ nop
/* 455CC 8006A1CC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
s32 __osPfsRWInode(OSPfs *pfs, __OSInode *inode, u8 flag, u8 bank) {
u8 sum;
int j;
s32 ret;
int offset;
u8 *addr;
if (flag == PFS_READ && bank == __osPfsInodeCacheBank && pfs->channel == __osPfsInodeCacheChannel) {
bcopy(&__osPfsInodeCache, inode, sizeof(__OSInode));
return 0;
}
SET_ACTIVEBANK_TO_ZERO;
if (bank > 0) {
offset = 1;
} else {
offset = pfs->inode_start_page;
}
if (flag == PFS_WRITE) {
inode->inode_page[0].inode_t.page = __osSumcalc((u8*)&inode->inode_page[offset], (128 - offset) * 2);
}
for (j = 0; j < PFS_ONE_PAGE; j++) {
addr = ((u8 *)inode->inode_page + j * 32);
if (flag == PFS_WRITE) {
ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->inode_table + bank * PFS_ONE_PAGE + j, addr, FALSE);
ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->minode_table + bank * PFS_ONE_PAGE + j, addr, FALSE);
} else {
ret = __osContRamRead(pfs->queue, pfs->channel, pfs->inode_table + bank * 8 + j, addr);
}
if (ret != 0) {
return ret;
}
}
if (flag == PFS_READ) {
sum = __osSumcalc((u8*)&inode->inode_page[offset], (128 - offset) * 2);
if (sum != inode->inode_page[0].inode_t.page) {
for (j = 0; j < PFS_ONE_PAGE; j++) {
addr = ((u8 *)inode->inode_page + j * 32);
ret = __osContRamRead(pfs->queue, pfs->channel, pfs->minode_table + bank * PFS_ONE_PAGE + j, addr);
}
sum = __osSumcalc((u8*)&inode->inode_page[offset], (128 - offset) * 2);
if (sum != inode->inode_page[0].inode_t.page) {
return PFS_ERR_INCONSISTENT;
}
for (j = 0; j < PFS_ONE_PAGE; j++) {
addr = ((u8 *)inode->inode_page + j * 32);
ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->inode_table + bank * PFS_ONE_PAGE + j, addr, FALSE);
}
}
}
__osPfsInodeCacheBank = bank;
bcopy(inode, &__osPfsInodeCache, sizeof(__OSInode));
__osPfsInodeCacheChannel = pfs->channel;
return 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel stars_spread_appendGfx
/* 3606B4 E005A3F4 27BDFF28 */ addiu $sp, $sp, -0xD8
/* 3606B8 E005A3F8 AFBE00B8 */ sw $fp, 0xB8($sp)
/* 3606BC E005A3FC 0080F02D */ daddu $fp, $a0, $zero
/* 3606C0 E005A400 3C06DB06 */ lui $a2, (0xDB060024 >> 16)
/* 3606C4 E005A404 34C60024 */ ori $a2, $a2, (0xDB060024 & 0xFFFF)
/* 3606C8 E005A408 27A40018 */ addiu $a0, $sp, 0x18
/* 3606CC E005A40C AFB00098 */ sw $s0, 0x98($sp)
/* 3606D0 E005A410 3C100001 */ lui $s0, (0x11630 >> 16)
/* 3606D4 E005A414 36101630 */ ori $s0, $s0, (0x11630 & 0xFFFF)
/* 3606D8 E005A418 AFB200A0 */ sw $s2, 0xA0($sp)
/* 3606DC E005A41C 3C12800A */ lui $s2, %hi(gMainGfxPos)
/* 3606E0 E005A420 2652A66C */ addiu $s2, $s2, %lo(gMainGfxPos)
/* 3606E4 E005A424 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3606E8 E005A428 AFBF00BC */ sw $ra, 0xBC($sp)
/* 3606EC E005A42C AFB700B4 */ sw $s7, 0xB4($sp)
/* 3606F0 E005A430 AFB600B0 */ sw $s6, 0xB0($sp)
/* 3606F4 E005A434 AFB500AC */ sw $s5, 0xAC($sp)
/* 3606F8 E005A438 AFB400A8 */ sw $s4, 0xA8($sp)
/* 3606FC E005A43C AFB300A4 */ sw $s3, 0xA4($sp)
/* 360700 E005A440 AFB1009C */ sw $s1, 0x9C($sp)
/* 360704 E005A444 F7B800D0 */ sdc1 $f24, 0xD0($sp)
/* 360708 E005A448 F7B600C8 */ sdc1 $f22, 0xC8($sp)
/* 36070C E005A44C F7B400C0 */ sdc1 $f20, 0xC0($sp)
/* 360710 E005A450 8E430000 */ lw $v1, 0x0($s2)
/* 360714 E005A454 8FD3000C */ lw $s3, 0xC($fp)
/* 360718 E005A458 0060282D */ daddu $a1, $v1, $zero
/* 36071C E005A45C 24630008 */ addiu $v1, $v1, 0x8
/* 360720 E005A460 AE430000 */ sw $v1, 0x0($s2)
/* 360724 E005A464 ACA20000 */ sw $v0, 0x0($a1)
/* 360728 E005A468 24620008 */ addiu $v0, $v1, 0x8
/* 36072C E005A46C ACA00004 */ sw $zero, 0x4($a1)
/* 360730 E005A470 AE420000 */ sw $v0, 0x0($s2)
/* 360734 E005A474 AC660000 */ sw $a2, 0x0($v1)
/* 360738 E005A478 8FC50010 */ lw $a1, 0x10($fp)
/* 36073C E005A47C 24620010 */ addiu $v0, $v1, 0x10
/* 360740 E005A480 AE420000 */ sw $v0, 0x0($s2)
/* 360744 E005A484 8CA5001C */ lw $a1, 0x1C($a1)
/* 360748 E005A488 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 36074C E005A48C AC620008 */ sw $v0, 0x8($v1)
/* 360750 E005A490 3C020900 */ lui $v0, %hi(D_09000440_4154A0)
/* 360754 E005A494 24420440 */ addiu $v0, $v0, %lo(D_09000440_4154A0)
/* 360758 E005A498 AC62000C */ sw $v0, 0xC($v1)
/* 36075C E005A49C 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 360760 E005A4A0 00A22821 */ addu $a1, $a1, $v0
/* 360764 E005A4A4 AC650004 */ sw $a1, 0x4($v1)
/* 360768 E005A4A8 8E650004 */ lw $a1, 0x4($s3)
/* 36076C E005A4AC 8E660008 */ lw $a2, 0x8($s3)
/* 360770 E005A4B0 8E67000C */ lw $a3, 0xC($s3)
/* 360774 E005A4B4 0C080108 */ jal shim_guTranslateF
/* 360778 E005A4B8 24140001 */ addiu $s4, $zero, 0x1
/* 36077C E005A4BC 27B10058 */ addiu $s1, $sp, 0x58
/* 360780 E005A4C0 4480A000 */ mtc1 $zero, $f20
/* 360784 E005A4C4 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 360788 E005A4C8 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 36078C E005A4CC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 360790 E005A4D0 4481C000 */ mtc1 $at, $f24
/* 360794 E005A4D4 00031080 */ sll $v0, $v1, 2
/* 360798 E005A4D8 00431021 */ addu $v0, $v0, $v1
/* 36079C E005A4DC 00021080 */ sll $v0, $v0, 2
/* 3607A0 E005A4E0 00431023 */ subu $v0, $v0, $v1
/* 3607A4 E005A4E4 000218C0 */ sll $v1, $v0, 3
/* 3607A8 E005A4E8 00431021 */ addu $v0, $v0, $v1
/* 3607AC E005A4EC 000210C0 */ sll $v0, $v0, 3
/* 3607B0 E005A4F0 4406A000 */ mfc1 $a2, $f20
/* 3607B4 E005A4F4 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 3607B8 E005A4F8 00220821 */ addu $at, $at, $v0
/* 3607BC E005A4FC C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 3607C0 E005A500 4407C000 */ mfc1 $a3, $f24
/* 3607C4 E005A504 46000007 */ neg.s $f0, $f0
/* 3607C8 E005A508 44050000 */ mfc1 $a1, $f0
/* 3607CC E005A50C 0220202D */ daddu $a0, $s1, $zero
/* 3607D0 E005A510 0C080104 */ jal shim_guRotateF
/* 3607D4 E005A514 E7B40010 */ swc1 $f20, 0x10($sp)
/* 3607D8 E005A518 0220202D */ daddu $a0, $s1, $zero
/* 3607DC E005A51C 27A50018 */ addiu $a1, $sp, 0x18
/* 3607E0 E005A520 0C080114 */ jal shim_guMtxCatF
/* 3607E4 E005A524 00A0302D */ daddu $a2, $a1, $zero
/* 3607E8 E005A528 27A40018 */ addiu $a0, $sp, 0x18
/* 3607EC E005A52C 3C158007 */ lui $s5, %hi(gMatrixListPos)
/* 3607F0 E005A530 26B541F0 */ addiu $s5, $s5, %lo(gMatrixListPos)
/* 3607F4 E005A534 3C16800A */ lui $s6, %hi(gDisplayContext)
/* 3607F8 E005A538 26D6A674 */ addiu $s6, $s6, %lo(gDisplayContext)
/* 3607FC E005A53C 96A50000 */ lhu $a1, 0x0($s5)
/* 360800 E005A540 8EC20000 */ lw $v0, 0x0($s6)
/* 360804 E005A544 00052980 */ sll $a1, $a1, 6
/* 360808 E005A548 00B02821 */ addu $a1, $a1, $s0
/* 36080C E005A54C 0C080118 */ jal shim_guMtxF2L
/* 360810 E005A550 00452821 */ addu $a1, $v0, $a1
/* 360814 E005A554 3C06DCDC */ lui $a2, (0xDCDC28E6 >> 16)
/* 360818 E005A558 8E440000 */ lw $a0, 0x0($s2)
/* 36081C E005A55C 34C628E6 */ ori $a2, $a2, (0xDCDC28E6 & 0xFFFF)
/* 360820 E005A560 0080282D */ daddu $a1, $a0, $zero
/* 360824 E005A564 24840008 */ addiu $a0, $a0, 0x8
/* 360828 E005A568 AE440000 */ sw $a0, 0x0($s2)
/* 36082C E005A56C 96A20000 */ lhu $v0, 0x0($s5)
/* 360830 E005A570 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 360834 E005A574 ACA30000 */ sw $v1, 0x0($a1)
/* 360838 E005A578 00541821 */ addu $v1, $v0, $s4
/* 36083C E005A57C 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 360840 E005A580 00021180 */ sll $v0, $v0, 6
/* 360844 E005A584 A6A30000 */ sh $v1, 0x0($s5)
/* 360848 E005A588 8EC30000 */ lw $v1, 0x0($s6)
/* 36084C E005A58C 00501021 */ addu $v0, $v0, $s0
/* 360850 E005A590 00621821 */ addu $v1, $v1, $v0
/* 360854 E005A594 24820008 */ addiu $v0, $a0, 0x8
/* 360858 E005A598 ACA30004 */ sw $v1, 0x4($a1)
/* 36085C E005A59C AE420000 */ sw $v0, 0x0($s2)
/* 360860 E005A5A0 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 360864 E005A5A4 AC820000 */ sw $v0, 0x0($a0)
/* 360868 E005A5A8 AC860004 */ sw $a2, 0x4($a0)
/* 36086C E005A5AC 8FC20008 */ lw $v0, 0x8($fp)
/* 360870 E005A5B0 0282102A */ slt $v0, $s4, $v0
/* 360874 E005A5B4 10400049 */ beqz $v0, .LE005A6DC
/* 360878 E005A5B8 26730034 */ addiu $s3, $s3, 0x34
/* 36087C E005A5BC 4600A586 */ mov.s $f22, $f20
/* 360880 E005A5C0 4600C506 */ mov.s $f20, $f24
/* 360884 E005A5C4 02C0B82D */ daddu $s7, $s6, $zero
/* 360888 E005A5C8 02A0B02D */ daddu $s6, $s5, $zero
/* 36088C E005A5CC 3C150001 */ lui $s5, (0x11630 >> 16)
/* 360890 E005A5D0 36B51630 */ ori $s5, $s5, (0x11630 & 0xFFFF)
/* 360894 E005A5D4 26700030 */ addiu $s0, $s3, 0x30
.LE005A5D8:
/* 360898 E005A5D8 27A40018 */ addiu $a0, $sp, 0x18
/* 36089C E005A5DC 8E05FFD4 */ lw $a1, -0x2C($s0)
/* 3608A0 E005A5E0 8E06FFD8 */ lw $a2, -0x28($s0)
/* 3608A4 E005A5E4 8E07FFDC */ lw $a3, -0x24($s0)
/* 3608A8 E005A5E8 0C080108 */ jal shim_guTranslateF
/* 3608AC E005A5EC 26940001 */ addiu $s4, $s4, 0x1
/* 3608B0 E005A5F0 E7B40010 */ swc1 $f20, 0x10($sp)
/* 3608B4 E005A5F4 8E05FFEC */ lw $a1, -0x14($s0)
/* 3608B8 E005A5F8 4406B000 */ mfc1 $a2, $f22
/* 3608BC E005A5FC 4407B000 */ mfc1 $a3, $f22
/* 3608C0 E005A600 0C080104 */ jal shim_guRotateF
/* 3608C4 E005A604 0220202D */ daddu $a0, $s1, $zero
/* 3608C8 E005A608 0220202D */ daddu $a0, $s1, $zero
/* 3608CC E005A60C 27A50018 */ addiu $a1, $sp, 0x18
/* 3608D0 E005A610 0C080114 */ jal shim_guMtxCatF
/* 3608D4 E005A614 00A0302D */ daddu $a2, $a1, $zero
/* 3608D8 E005A618 0220202D */ daddu $a0, $s1, $zero
/* 3608DC E005A61C 8E050000 */ lw $a1, 0x0($s0)
/* 3608E0 E005A620 26100034 */ addiu $s0, $s0, 0x34
/* 3608E4 E005A624 4407A000 */ mfc1 $a3, $f20
/* 3608E8 E005A628 0C080110 */ jal shim_guScaleF
/* 3608EC E005A62C 00A0302D */ daddu $a2, $a1, $zero
/* 3608F0 E005A630 0220202D */ daddu $a0, $s1, $zero
/* 3608F4 E005A634 27A50018 */ addiu $a1, $sp, 0x18
/* 3608F8 E005A638 0C080114 */ jal shim_guMtxCatF
/* 3608FC E005A63C 00A0302D */ daddu $a2, $a1, $zero
/* 360900 E005A640 27A40018 */ addiu $a0, $sp, 0x18
/* 360904 E005A644 96C50000 */ lhu $a1, 0x0($s6)
/* 360908 E005A648 8EE20000 */ lw $v0, 0x0($s7)
/* 36090C E005A64C 00052980 */ sll $a1, $a1, 6
/* 360910 E005A650 00B52821 */ addu $a1, $a1, $s5
/* 360914 E005A654 0C080118 */ jal shim_guMtxF2L
/* 360918 E005A658 00452821 */ addu $a1, $v0, $a1
/* 36091C E005A65C 3C06D838 */ lui $a2, (0xD8380002 >> 16)
/* 360920 E005A660 8E440000 */ lw $a0, 0x0($s2)
/* 360924 E005A664 34C60002 */ ori $a2, $a2, (0xD8380002 & 0xFFFF)
/* 360928 E005A668 0080282D */ daddu $a1, $a0, $zero
/* 36092C E005A66C 24840008 */ addiu $a0, $a0, 0x8
/* 360930 E005A670 AE440000 */ sw $a0, 0x0($s2)
/* 360934 E005A674 96C20000 */ lhu $v0, 0x0($s6)
/* 360938 E005A678 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 36093C E005A67C ACA30000 */ sw $v1, 0x0($a1)
/* 360940 E005A680 24430001 */ addiu $v1, $v0, 0x1
/* 360944 E005A684 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 360948 E005A688 00021180 */ sll $v0, $v0, 6
/* 36094C E005A68C A6C30000 */ sh $v1, 0x0($s6)
/* 360950 E005A690 8EE30000 */ lw $v1, 0x0($s7)
/* 360954 E005A694 00551021 */ addu $v0, $v0, $s5
/* 360958 E005A698 00621821 */ addu $v1, $v1, $v0
/* 36095C E005A69C 24820008 */ addiu $v0, $a0, 0x8
/* 360960 E005A6A0 ACA30004 */ sw $v1, 0x4($a1)
/* 360964 E005A6A4 AE420000 */ sw $v0, 0x0($s2)
/* 360968 E005A6A8 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 36096C E005A6AC 3C080900 */ lui $t0, %hi(D_090004F0_415550)
/* 360970 E005A6B0 250804F0 */ addiu $t0, $t0, %lo(D_090004F0_415550)
/* 360974 E005A6B4 AC820000 */ sw $v0, 0x0($a0)
/* 360978 E005A6B8 24020040 */ addiu $v0, $zero, 0x40
/* 36097C E005A6BC AC880004 */ sw $t0, 0x4($a0)
/* 360980 E005A6C0 AC860008 */ sw $a2, 0x8($a0)
/* 360984 E005A6C4 AC82000C */ sw $v0, 0xC($a0)
/* 360988 E005A6C8 8FC20008 */ lw $v0, 0x8($fp)
/* 36098C E005A6CC 24840010 */ addiu $a0, $a0, 0x10
/* 360990 E005A6D0 0282102A */ slt $v0, $s4, $v0
/* 360994 E005A6D4 1440FFC0 */ bnez $v0, .LE005A5D8
/* 360998 E005A6D8 AE440000 */ sw $a0, 0x0($s2)
.LE005A6DC:
/* 36099C E005A6DC 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* 3609A0 E005A6E0 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 3609A4 E005A6E4 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 3609A8 E005A6E8 8C620000 */ lw $v0, 0x0($v1)
/* 3609AC E005A6EC 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* 3609B0 E005A6F0 0040202D */ daddu $a0, $v0, $zero
/* 3609B4 E005A6F4 24420008 */ addiu $v0, $v0, 0x8
/* 3609B8 E005A6F8 AC620000 */ sw $v0, 0x0($v1)
/* 3609BC E005A6FC 24020040 */ addiu $v0, $zero, 0x40
/* 3609C0 E005A700 AC850000 */ sw $a1, 0x0($a0)
/* 3609C4 E005A704 AC820004 */ sw $v0, 0x4($a0)
/* 3609C8 E005A708 8FBF00BC */ lw $ra, 0xBC($sp)
/* 3609CC E005A70C 8FBE00B8 */ lw $fp, 0xB8($sp)
/* 3609D0 E005A710 8FB700B4 */ lw $s7, 0xB4($sp)
/* 3609D4 E005A714 8FB600B0 */ lw $s6, 0xB0($sp)
/* 3609D8 E005A718 8FB500AC */ lw $s5, 0xAC($sp)
/* 3609DC E005A71C 8FB400A8 */ lw $s4, 0xA8($sp)
/* 3609E0 E005A720 8FB300A4 */ lw $s3, 0xA4($sp)
/* 3609E4 E005A724 8FB200A0 */ lw $s2, 0xA0($sp)
/* 3609E8 E005A728 8FB1009C */ lw $s1, 0x9C($sp)
/* 3609EC E005A72C 8FB00098 */ lw $s0, 0x98($sp)
/* 3609F0 E005A730 D7B800D0 */ ldc1 $f24, 0xD0($sp)
/* 3609F4 E005A734 D7B600C8 */ ldc1 $f22, 0xC8($sp)
/* 3609F8 E005A738 D7B400C0 */ ldc1 $f20, 0xC0($sp)
/* 3609FC E005A73C 03E00008 */ jr $ra
/* 360A00 E005A740 27BD00D8 */ addiu $sp, $sp, 0xD8
/* 360A04 E005A744 00000000 */ nop
/* 360A08 E005A748 00000000 */ nop
/* 360A0C E005A74C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void stars_spread_appendGfx(void* effect) {
StarsSpreadFXData* part = ((EffectInstance*)effect)->data.starsSpread;
Gfx* dlist = D_090004F0_360F20;
Matrix4f sp18;
Matrix4f sp58;
s32 i;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09000440_360E70);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 220, 220, 40, 230);
part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, part->unk_1C, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, part->unk_30, part->unk_30, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, dlist);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel spr_load_npc_extra_anims
/* 1020FC 802DF00C 27BDFE30 */ addiu $sp, $sp, -0x1D0
/* 102100 802DF010 AFB601C0 */ sw $s6, 0x1C0($sp)
/* 102104 802DF014 0080B02D */ daddu $s6, $a0, $zero
/* 102108 802DF018 AFB101AC */ sw $s1, 0x1AC($sp)
/* 10210C 802DF01C 24110063 */ addiu $s1, $zero, 0x63
/* 102110 802DF020 27A2019C */ addiu $v0, $sp, 0x19C
/* 102114 802DF024 AFBF01C8 */ sw $ra, 0x1C8($sp)
/* 102118 802DF028 AFB701C4 */ sw $s7, 0x1C4($sp)
/* 10211C 802DF02C AFB501BC */ sw $s5, 0x1BC($sp)
/* 102120 802DF030 AFB401B8 */ sw $s4, 0x1B8($sp)
/* 102124 802DF034 AFB301B4 */ sw $s3, 0x1B4($sp)
/* 102128 802DF038 AFB201B0 */ sw $s2, 0x1B0($sp)
/* 10212C 802DF03C AFB001A8 */ sw $s0, 0x1A8($sp)
.L802DF040:
/* 102130 802DF040 AC400000 */ sw $zero, 0x0($v0)
/* 102134 802DF044 2631FFFF */ addiu $s1, $s1, -0x1
/* 102138 802DF048 0621FFFD */ bgez $s1, .L802DF040
/* 10213C 802DF04C 2442FFFC */ addiu $v0, $v0, -0x4
/* 102140 802DF050 8CA30000 */ lw $v1, 0x0($a1)
/* 102144 802DF054 2402FFFF */ addiu $v0, $zero, -0x1
/* 102148 802DF058 1062004B */ beq $v1, $v0, .L802DF188
/* 10214C 802DF05C 24A50004 */ addiu $a1, $a1, 0x4
/* 102150 802DF060 0040602D */ daddu $t4, $v0, $zero
/* 102154 802DF064 24124000 */ addiu $s2, $zero, 0x4000
/* 102158 802DF068 24111000 */ addiu $s1, $zero, 0x1000
/* 10215C 802DF06C 24102000 */ addiu $s0, $zero, 0x2000
/* 102160 802DF070 240F3000 */ addiu $t7, $zero, 0x3000
/* 102164 802DF074 240E6000 */ addiu $t6, $zero, 0x6000
/* 102168 802DF078 240D5000 */ addiu $t5, $zero, 0x5000
.L802DF07C:
/* 10216C 802DF07C 306200FF */ andi $v0, $v1, 0xFF
/* 102170 802DF080 00021080 */ sll $v0, $v0, 2
/* 102174 802DF084 02C21021 */ addu $v0, $s6, $v0
/* 102178 802DF088 080B7C5C */ j .L802DF170
/* 10217C 802DF08C 8C480010 */ lw $t0, 0x10($v0)
.L802DF090:
/* 102180 802DF090 94620004 */ lhu $v0, 0x4($v1)
/* 102184 802DF094 8C660000 */ lw $a2, 0x0($v1)
/* 102188 802DF098 00021400 */ sll $v0, $v0, 16
/* 10218C 802DF09C 00021C03 */ sra $v1, $v0, 16
/* 102190 802DF0A0 000217C2 */ srl $v0, $v0, 31
/* 102194 802DF0A4 00621821 */ addu $v1, $v1, $v0
/* 102198 802DF0A8 00031843 */ sra $v1, $v1, 1
/* 10219C 802DF0AC 18600030 */ blez $v1, .L802DF170
/* 1021A0 802DF0B0 00000000 */ nop
/* 1021A4 802DF0B4 240B7000 */ addiu $t3, $zero, 0x7000
/* 1021A8 802DF0B8 27A90010 */ addiu $t1, $sp, 0x10
/* 1021AC 802DF0BC 240A0001 */ addiu $t2, $zero, 0x1
.L802DF0C0:
/* 1021B0 802DF0C0 94C70000 */ lhu $a3, 0x0($a2)
/* 1021B4 802DF0C4 24C60002 */ addiu $a2, $a2, 0x2
/* 1021B8 802DF0C8 30E4F000 */ andi $a0, $a3, 0xF000
/* 1021BC 802DF0CC 10920022 */ beq $a0, $s2, .L802DF158
/* 1021C0 802DF0D0 2463FFFF */ addiu $v1, $v1, -0x1
/* 1021C4 802DF0D4 28824001 */ slti $v0, $a0, 0x4001
/* 1021C8 802DF0D8 1040000B */ beqz $v0, .L802DF108
/* 1021CC 802DF0DC 00000000 */ nop
/* 1021D0 802DF0E0 10910015 */ beq $a0, $s1, .L802DF138
/* 1021D4 802DF0E4 28821001 */ slti $v0, $a0, 0x1001
/* 1021D8 802DF0E8 1440001F */ bnez $v0, .L802DF168
/* 1021DC 802DF0EC 00000000 */ nop
/* 1021E0 802DF0F0 1090001D */ beq $a0, $s0, .L802DF168
/* 1021E4 802DF0F4 00000000 */ nop
/* 1021E8 802DF0F8 508F0016 */ beql $a0, $t7, .L802DF154
/* 1021EC 802DF0FC 24C60002 */ addiu $a2, $a2, 0x2
/* 1021F0 802DF100 080B7C5A */ j .L802DF168
/* 1021F4 802DF104 00000000 */ nop
.L802DF108:
/* 1021F8 802DF108 108E0017 */ beq $a0, $t6, .L802DF168
/* 1021FC 802DF10C 28826001 */ slti $v0, $a0, 0x6001
/* 102200 802DF110 10400005 */ beqz $v0, .L802DF128
/* 102204 802DF114 00000000 */ nop
/* 102208 802DF118 508D0012 */ beql $a0, $t5, .L802DF164
/* 10220C 802DF11C 24C60002 */ addiu $a2, $a2, 0x2
/* 102210 802DF120 080B7C5A */ j .L802DF168
/* 102214 802DF124 00000000 */ nop
.L802DF128:
/* 102218 802DF128 508B000E */ beql $a0, $t3, .L802DF164
/* 10221C 802DF12C 24C60002 */ addiu $a2, $a2, 0x2
/* 102220 802DF130 080B7C5A */ j .L802DF168
/* 102224 802DF134 00000000 */ nop
.L802DF138:
/* 102228 802DF138 30E400FF */ andi $a0, $a3, 0xFF
/* 10222C 802DF13C 28820064 */ slti $v0, $a0, 0x64
/* 102230 802DF140 10400009 */ beqz $v0, .L802DF168
/* 102234 802DF144 00041080 */ sll $v0, $a0, 2
/* 102238 802DF148 01221021 */ addu $v0, $t1, $v0
/* 10223C 802DF14C 080B7C5A */ j .L802DF168
/* 102240 802DF150 AC4A0000 */ sw $t2, 0x0($v0)
.L802DF154:
/* 102244 802DF154 2463FFFF */ addiu $v1, $v1, -0x1
.L802DF158:
/* 102248 802DF158 24C60002 */ addiu $a2, $a2, 0x2
/* 10224C 802DF15C 2463FFFF */ addiu $v1, $v1, -0x1
/* 102250 802DF160 24C60002 */ addiu $a2, $a2, 0x2
.L802DF164:
/* 102254 802DF164 2463FFFF */ addiu $v1, $v1, -0x1
.L802DF168:
/* 102258 802DF168 1C60FFD5 */ bgtz $v1, .L802DF0C0
/* 10225C 802DF16C 00000000 */ nop
.L802DF170:
/* 102260 802DF170 8D030000 */ lw $v1, 0x0($t0)
/* 102264 802DF174 146CFFC6 */ bne $v1, $t4, .L802DF090
/* 102268 802DF178 25080004 */ addiu $t0, $t0, 0x4
/* 10226C 802DF17C 8CA30000 */ lw $v1, 0x0($a1)
/* 102270 802DF180 146CFFBE */ bne $v1, $t4, .L802DF07C
/* 102274 802DF184 24A50004 */ addiu $a1, $a1, 0x4
.L802DF188:
/* 102278 802DF188 0000882D */ daddu $s1, $zero, $zero
/* 10227C 802DF18C 8ED30000 */ lw $s3, 0x0($s6)
/* 102280 802DF190 2417FFFF */ addiu $s7, $zero, -0x1
/* 102284 802DF194 8E650000 */ lw $a1, 0x0($s3)
/* 102288 802DF198 27B40010 */ addiu $s4, $sp, 0x10
/* 10228C 802DF19C 8CB20000 */ lw $s2, 0x0($a1)
.L802DF1A0:
/* 102290 802DF1A0 8E650000 */ lw $a1, 0x0($s3)
/* 102294 802DF1A4 50B70019 */ beql $a1, $s7, .L802DF20C
/* 102298 802DF1A8 0240302D */ daddu $a2, $s2, $zero
/* 10229C 802DF1AC 8E820000 */ lw $v0, 0x0($s4)
/* 1022A0 802DF1B0 50400011 */ beql $v0, $zero, .L802DF1F8
/* 1022A4 802DF1B4 26730004 */ addiu $s3, $s3, 0x4
/* 1022A8 802DF1B8 90A30004 */ lbu $v1, 0x4($a1)
/* 1022AC 802DF1BC 90A20005 */ lbu $v0, 0x5($a1)
/* 1022B0 802DF1C0 00620018 */ mult $v1, $v0
/* 1022B4 802DF1C4 8CA40000 */ lw $a0, 0x0($a1)
/* 1022B8 802DF1C8 0000C012 */ mflo $t8
/* 1022BC 802DF1CC 00188043 */ sra $s0, $t8, 1
/* 1022C0 802DF1D0 0250A821 */ addu $s5, $s2, $s0
/* 1022C4 802DF1D4 12440005 */ beq $s2, $a0, .L802DF1EC
/* 1022C8 802DF1D8 26100008 */ addiu $s0, $s0, 0x8
/* 1022CC 802DF1DC ACB20000 */ sw $s2, 0x0($a1)
/* 1022D0 802DF1E0 0240282D */ daddu $a1, $s2, $zero
/* 1022D4 802DF1E4 0C019194 */ jal bcopy
/* 1022D8 802DF1E8 0200302D */ daddu $a2, $s0, $zero
.L802DF1EC:
/* 1022DC 802DF1EC AE750000 */ sw $s5, 0x0($s3)
/* 1022E0 802DF1F0 02509021 */ addu $s2, $s2, $s0
/* 1022E4 802DF1F4 26730004 */ addiu $s3, $s3, 0x4
.L802DF1F8:
/* 1022E8 802DF1F8 26310001 */ addiu $s1, $s1, 0x1
/* 1022EC 802DF1FC 2A220064 */ slti $v0, $s1, 0x64
/* 1022F0 802DF200 1440FFE7 */ bnez $v0, .L802DF1A0
/* 1022F4 802DF204 26940004 */ addiu $s4, $s4, 0x4
/* 1022F8 802DF208 0240302D */ daddu $a2, $s2, $zero
.L802DF20C:
/* 1022FC 802DF20C 00111080 */ sll $v0, $s1, 2
/* 102300 802DF210 0000882D */ daddu $s1, $zero, $zero
/* 102304 802DF214 27A40010 */ addiu $a0, $sp, 0x10
/* 102308 802DF218 00821021 */ addu $v0, $a0, $v0
/* 10230C 802DF21C 24030001 */ addiu $v1, $zero, 0x1
/* 102310 802DF220 AC430000 */ sw $v1, 0x0($v0)
/* 102314 802DF224 8ED30000 */ lw $s3, 0x0($s6)
/* 102318 802DF228 2407FFFF */ addiu $a3, $zero, -0x1
/* 10231C 802DF22C AEC60000 */ sw $a2, 0x0($s6)
.L802DF230:
/* 102320 802DF230 8E650000 */ lw $a1, 0x0($s3)
/* 102324 802DF234 8C820000 */ lw $v0, 0x0($a0)
/* 102328 802DF238 10400003 */ beqz $v0, .L802DF248
/* 10232C 802DF23C 26730004 */ addiu $s3, $s3, 0x4
/* 102330 802DF240 080B7C93 */ j .L802DF24C
/* 102334 802DF244 ACC50000 */ sw $a1, 0x0($a2)
.L802DF248:
/* 102338 802DF248 ACD50000 */ sw $s5, 0x0($a2)
.L802DF24C:
/* 10233C 802DF24C 10A70005 */ beq $a1, $a3, .L802DF264
/* 102340 802DF250 24C60004 */ addiu $a2, $a2, 0x4
/* 102344 802DF254 26310001 */ addiu $s1, $s1, 0x1
/* 102348 802DF258 2A220064 */ slti $v0, $s1, 0x64
/* 10234C 802DF25C 1440FFF4 */ bnez $v0, .L802DF230
/* 102350 802DF260 24840004 */ addiu $a0, $a0, 0x4
.L802DF264:
/* 102354 802DF264 0000882D */ daddu $s1, $zero, $zero
/* 102358 802DF268 8EC30004 */ lw $v1, 0x4($s6)
/* 10235C 802DF26C 2404FFFF */ addiu $a0, $zero, -0x1
/* 102360 802DF270 AEC60004 */ sw $a2, 0x4($s6)
.L802DF274:
/* 102364 802DF274 8C650000 */ lw $a1, 0x0($v1)
/* 102368 802DF278 24630004 */ addiu $v1, $v1, 0x4
/* 10236C 802DF27C ACC50000 */ sw $a1, 0x0($a2)
/* 102370 802DF280 10A40005 */ beq $a1, $a0, .L802DF298
/* 102374 802DF284 24C60004 */ addiu $a2, $a2, 0x4
/* 102378 802DF288 26310001 */ addiu $s1, $s1, 0x1
/* 10237C 802DF28C 2A220064 */ slti $v0, $s1, 0x64
/* 102380 802DF290 1440FFF8 */ bnez $v0, .L802DF274
/* 102384 802DF294 00000000 */ nop
.L802DF298:
/* 102388 802DF298 3C048035 */ lui $a0, %hi(heap_spriteHead)
/* 10238C 802DF29C 2484F800 */ addiu $a0, $a0, %lo(heap_spriteHead)
/* 102390 802DF2A0 02C0282D */ daddu $a1, $s6, $zero
/* 102394 802DF2A4 0C00A4B1 */ jal _heap_realloc
/* 102398 802DF2A8 00C53023 */ subu $a2, $a2, $a1
/* 10239C 802DF2AC 8FBF01C8 */ lw $ra, 0x1C8($sp)
/* 1023A0 802DF2B0 8FB701C4 */ lw $s7, 0x1C4($sp)
/* 1023A4 802DF2B4 8FB601C0 */ lw $s6, 0x1C0($sp)
/* 1023A8 802DF2B8 8FB501BC */ lw $s5, 0x1BC($sp)
/* 1023AC 802DF2BC 8FB401B8 */ lw $s4, 0x1B8($sp)
/* 1023B0 802DF2C0 8FB301B4 */ lw $s3, 0x1B4($sp)
/* 1023B4 802DF2C4 8FB201B0 */ lw $s2, 0x1B0($sp)
/* 1023B8 802DF2C8 8FB101AC */ lw $s1, 0x1AC($sp)
/* 1023BC 802DF2CC 8FB001A8 */ lw $s0, 0x1A8($sp)
/* 1023C0 802DF2D0 03E00008 */ jr $ra
/* 1023C4 802DF2D4 27BD01D0 */ addiu $sp, $sp, 0x1D0
### DECOMPILED C INSTRUCTIONS:
void spr_load_npc_extra_anims(SpriteAnimData* header, u32* extraAnimList) {
u8* src;
s32 imgID;
s32 rasterSize;
s32 remaining;
u16 animCmd;
u16* cmdList;
u32 extraAnimID;
u8* dataPos;
void* copyEnd;
SpriteAnimComponent* comp;
SpriteAnimComponent** compList;
void* writePos;
SpriteRasterCacheEntry** rasterList;
SpriteRasterCacheEntry* raster;
u16** oldPalList;
u16* palette;
// one extra required for 'done' sentinel
s32 sawRaster[100 + 1];
s32 i;
for (i = 0; i < ARRAY_COUNT(sawRaster) - 1; i++) {
sawRaster[i] = FALSE;
}
while ((extraAnimID = *extraAnimList++) != -1) {
compList = header->animListStart[extraAnimID & 0xFF];
while ((comp = *compList++) != PTR_LIST_END) {
cmdList = comp->cmdList;
remaining = (s16) comp->cmdListSize / 2;
while (remaining > 0) {
animCmd = *cmdList++;
remaining--;
switch (animCmd & 0xF000) {
case 0x1000:
i = animCmd; // required to match
imgID = i & 0xFF;
if (imgID < ARRAY_COUNT(sawRaster) - 1) {
sawRaster[imgID] = TRUE;
}
break;
case 0x3000:
cmdList++;
remaining--;
// fallthrough
case 0x4000:
cmdList++;
remaining--;
// fallthrough
case 0x7000:
case 0x5000:
cmdList++;
remaining--;
// fallthrough
case 0x0000:
case 0x2000:
case 0x6000:
case 0x8000:
break;
}
}
}
}
rasterList = header->rastersOffset;
raster = *rasterList;
dataPos = raster->image;
for (i = 0; i < ARRAY_COUNT(sawRaster) - 1; i++) {
if ((raster = *rasterList) == PTR_LIST_END) {
break;
}
if (sawRaster[i]) {
src = raster->image;
rasterSize = (raster->width * raster->height) / 2;
copyEnd = &dataPos[rasterSize];
rasterSize += 8;
if (dataPos != src) {
raster->image = dataPos;
bcopy(src, dataPos, rasterSize);
}
*rasterList = copyEnd;
dataPos += rasterSize;
}
rasterList++;
}
// sentinel value to mark end of valid data
sawRaster[i] = TRUE;
writePos = dataPos;
// copy raster list
rasterList = header->rastersOffset;
header->rastersOffset = writePos;
for (i = 0; i < ARRAY_COUNT(sawRaster) - 1; i++) {
raster = *rasterList++;
if (sawRaster[i]) {
*(SpriteRasterCacheEntry**) writePos = raster;
} else {
*(SpriteRasterCacheEntry**) writePos = (SpriteRasterCacheEntry*) copyEnd;
}
writePos += 4;
if (raster == PTR_LIST_END) {
break;
}
}
// copy palette list
oldPalList = header->palettesOffset;
header->palettesOffset = writePos;
for (i = 0; i < ARRAY_COUNT(sawRaster) - 1; i++) {
raster = (SpriteRasterCacheEntry*)*oldPalList++; // required to match
*(u16**)writePos = (u16*)raster;
writePos += 4;
if (raster == PTR_LIST_END) {
break;
}
}
_heap_realloc(&heap_spriteHead, header, (s32)writePos - (s32)header);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel osPfsAllocateFile
/* 43590 80068190 27BDFD68 */ addiu $sp, $sp, -0x298
/* 43594 80068194 AFB00270 */ sw $s0, 0x270($sp)
/* 43598 80068198 8FB002AC */ lw $s0, 0x2AC($sp)
/* 4359C 8006819C A7A50256 */ sh $a1, 0x256($sp)
/* 435A0 800681A0 97A50256 */ lhu $a1, 0x256($sp)
/* 435A4 800681A4 AFB20278 */ sw $s2, 0x278($sp)
/* 435A8 800681A8 00809021 */ addu $s2, $a0, $zero
/* 435AC 800681AC AFB60288 */ sw $s6, 0x288($sp)
/* 435B0 800681B0 0000B021 */ addu $s6, $zero, $zero
/* 435B4 800681B4 AFB7028C */ sw $s7, 0x28C($sp)
/* 435B8 800681B8 0000B821 */ addu $s7, $zero, $zero
/* 435BC 800681BC AFB50284 */ sw $s5, 0x284($sp)
/* 435C0 800681C0 0000A821 */ addu $s5, $zero, $zero
/* 435C4 800681C4 AFA6025C */ sw $a2, 0x25C($sp)
/* 435C8 800681C8 2CC30001 */ sltiu $v1, $a2, 0x1
/* 435CC 800681CC AFBF0294 */ sw $ra, 0x294($sp)
/* 435D0 800681D0 AFBE0290 */ sw $fp, 0x290($sp)
/* 435D4 800681D4 AFB40280 */ sw $s4, 0x280($sp)
/* 435D8 800681D8 AFB3027C */ sw $s3, 0x27C($sp)
/* 435DC 800681DC AFB10274 */ sw $s1, 0x274($sp)
/* 435E0 800681E0 2CA20001 */ sltiu $v0, $a1, 0x1
/* 435E4 800681E4 00431025 */ or $v0, $v0, $v1
/* 435E8 800681E8 14400020 */ bnez $v0, .L8006826C
/* 435EC 800681EC AFA70264 */ sw $a3, 0x264($sp)
/* 435F0 800681F0 260600FF */ addiu $a2, $s0, 0xFF
/* 435F4 800681F4 04C20001 */ bltzl $a2, .L800681FC
/* 435F8 800681F8 260601FE */ addiu $a2, $s0, 0x1FE
.L800681FC:
/* 435FC 800681FC 00069A03 */ sra $s3, $a2, 8
/* 43600 80068200 8FA802A8 */ lw $t0, 0x2A8($sp)
/* 43604 80068204 8FA6025C */ lw $a2, 0x25C($sp)
/* 43608 80068208 8FA70264 */ lw $a3, 0x264($sp)
/* 4360C 8006820C AFA80010 */ sw $t0, 0x10($sp)
/* 43610 80068210 8FA802B0 */ lw $t0, 0x2B0($sp)
/* 43614 80068214 02402021 */ addu $a0, $s2, $zero
/* 43618 80068218 0C01A370 */ jal osPfsFindFile
/* 4361C 8006821C AFA80014 */ sw $t0, 0x14($sp)
/* 43620 80068220 00401821 */ addu $v1, $v0, $zero
/* 43624 80068224 10600003 */ beqz $v1, .L80068234
/* 43628 80068228 24020005 */ addiu $v0, $zero, 0x5
/* 4362C 8006822C 1462008F */ bne $v1, $v0, .L8006846C
/* 43630 80068230 00601021 */ addu $v0, $v1, $zero
.L80068234:
/* 43634 80068234 8FA802B0 */ lw $t0, 0x2B0($sp)
/* 43638 80068238 8D030000 */ lw $v1, 0x0($t0)
/* 4363C 8006823C 2402FFFF */ addiu $v0, $zero, -0x1
/* 43640 80068240 1462008A */ bne $v1, $v0, .L8006846C
/* 43644 80068244 24020009 */ addiu $v0, $zero, 0x9
/* 43648 80068248 02402021 */ addu $a0, $s2, $zero
/* 4364C 8006824C 0C01A3E0 */ jal osPfsFreeBlocks
/* 43650 80068250 27A50240 */ addiu $a1, $sp, 0x240
/* 43654 80068254 8FA20240 */ lw $v0, 0x240($sp)
/* 43658 80068258 0050102A */ slt $v0, $v0, $s0
/* 4365C 8006825C 14400083 */ bnez $v0, .L8006846C
/* 43660 80068260 24020007 */ addiu $v0, $zero, 0x7
/* 43664 80068264 16600003 */ bnez $s3, .L80068274
/* 43668 80068268 02402021 */ addu $a0, $s2, $zero
.L8006826C:
/* 4366C 8006826C 0801A11B */ j .L8006846C
/* 43670 80068270 24020005 */ addiu $v0, $zero, 0x5
.L80068274:
/* 43674 80068274 00002821 */ addu $a1, $zero, $zero
/* 43678 80068278 8FA802B0 */ lw $t0, 0x2B0($sp)
/* 4367C 8006827C 00003021 */ addu $a2, $zero, $zero
/* 43680 80068280 00003821 */ addu $a3, $zero, $zero
/* 43684 80068284 AFA00010 */ sw $zero, 0x10($sp)
/* 43688 80068288 0C01A370 */ jal osPfsFindFile
/* 4368C 8006828C AFA80014 */ sw $t0, 0x14($sp)
/* 43690 80068290 00401821 */ addu $v1, $v0, $zero
/* 43694 80068294 10600003 */ beqz $v1, .L800682A4
/* 43698 80068298 24020005 */ addiu $v0, $zero, 0x5
/* 4369C 8006829C 14620073 */ bne $v1, $v0, .L8006846C
/* 436A0 800682A0 00601021 */ addu $v0, $v1, $zero
.L800682A4:
/* 436A4 800682A4 8FA802B0 */ lw $t0, 0x2B0($sp)
/* 436A8 800682A8 8D030000 */ lw $v1, 0x0($t0)
/* 436AC 800682AC 2402FFFF */ addiu $v0, $zero, -0x1
/* 436B0 800682B0 1062006E */ beq $v1, $v0, .L8006846C
/* 436B4 800682B4 24020008 */ addiu $v0, $zero, 0x8
/* 436B8 800682B8 92420064 */ lbu $v0, 0x64($s2)
/* 436BC 800682BC 1040004A */ beqz $v0, .L800683E8
/* 436C0 800682C0 00008821 */ addu $s1, $zero, $zero
/* 436C4 800682C4 27B40120 */ addiu $s4, $sp, 0x120
/* 436C8 800682C8 02402021 */ addu $a0, $s2, $zero
.L800682CC:
/* 436CC 800682CC 27A50020 */ addiu $a1, $sp, 0x20
/* 436D0 800682D0 00003021 */ addu $a2, $zero, $zero
/* 436D4 800682D4 323000FF */ andi $s0, $s1, 0xFF
/* 436D8 800682D8 0C01A7A3 */ jal __osPfsRWInode
/* 436DC 800682DC 02003821 */ addu $a3, $s0, $zero
/* 436E0 800682E0 00401821 */ addu $v1, $v0, $zero
/* 436E4 800682E4 14600048 */ bnez $v1, .L80068408
/* 436E8 800682E8 02402021 */ addu $a0, $s2, $zero
/* 436EC 800682EC 27A50020 */ addiu $a1, $sp, 0x20
/* 436F0 800682F0 02603021 */ addu $a2, $s3, $zero
/* 436F4 800682F4 27A70244 */ addiu $a3, $sp, 0x244
/* 436F8 800682F8 27A20248 */ addiu $v0, $sp, 0x248
/* 436FC 800682FC AFA20014 */ sw $v0, 0x14($sp)
/* 43700 80068300 27A2024C */ addiu $v0, $sp, 0x24C
/* 43704 80068304 AFB00010 */ sw $s0, 0x10($sp)
/* 43708 80068308 0C01A127 */ jal osPfsDeclearPage
/* 4370C 8006830C AFA20018 */ sw $v0, 0x18($sp)
/* 43710 80068310 00401821 */ addu $v1, $v0, $zero
/* 43714 80068314 1460003C */ bnez $v1, .L80068408
/* 43718 80068318 2402FFFF */ addiu $v0, $zero, -0x1
/* 4371C 8006831C 8FA30244 */ lw $v1, 0x244($sp)
/* 43720 80068320 1062002B */ beq $v1, $v0, .L800683D0
/* 43724 80068324 00000000 */ nop
/* 43728 80068328 12A0000F */ beqz $s5, .L80068368
/* 4372C 8006832C 02402021 */ addu $a0, $s2, $zero
/* 43730 80068330 02802821 */ addu $a1, $s4, $zero
/* 43734 80068334 00161040 */ sll $v0, $s6, 1
/* 43738 80068338 02821021 */ addu $v0, $s4, $v0
/* 4373C 8006833C A0510000 */ sb $s1, 0x0($v0)
/* 43740 80068340 8FA30244 */ lw $v1, 0x244($sp)
/* 43744 80068344 24060001 */ addiu $a2, $zero, 0x1
/* 43748 80068348 32E700FF */ andi $a3, $s7, 0xFF
/* 4374C 8006834C 0C01A7A3 */ jal __osPfsRWInode
/* 43750 80068350 A0430001 */ sb $v1, 0x1($v0)
/* 43754 80068354 00401821 */ addu $v1, $v0, $zero
/* 43758 80068358 10600006 */ beqz $v1, .L80068374
/* 4375C 8006835C 00000000 */ nop
/* 43760 80068360 0801A11B */ j .L8006846C
/* 43764 80068364 00000000 */ nop
.L80068368:
/* 43768 80068368 306300FF */ andi $v1, $v1, 0xFF
/* 4376C 8006836C 00111200 */ sll $v0, $s1, 8
/* 43770 80068370 0043F025 */ or $fp, $v0, $v1
.L80068374:
/* 43774 80068374 8FA20248 */ lw $v0, 0x248($sp)
/* 43778 80068378 0053102A */ slt $v0, $v0, $s3
/* 4377C 8006837C 1440000C */ bnez $v0, .L800683B0
/* 43780 80068380 27A40020 */ addiu $a0, $sp, 0x20
/* 43784 80068384 00009821 */ addu $s3, $zero, $zero
/* 43788 80068388 02402021 */ addu $a0, $s2, $zero
/* 4378C 8006838C 27A50020 */ addiu $a1, $sp, 0x20
/* 43790 80068390 24060001 */ addiu $a2, $zero, 0x1
/* 43794 80068394 0C01A7A3 */ jal __osPfsRWInode
/* 43798 80068398 322700FF */ andi $a3, $s1, 0xFF
/* 4379C 8006839C 00401821 */ addu $v1, $v0, $zero
/* 437A0 800683A0 10600011 */ beqz $v1, .L800683E8
/* 437A4 800683A4 00000000 */ nop
/* 437A8 800683A8 0801A11B */ j .L8006846C
/* 437AC 800683AC 00000000 */ nop
.L800683B0:
/* 437B0 800683B0 27A50120 */ addiu $a1, $sp, 0x120
/* 437B4 800683B4 0C019194 */ jal bcopy
/* 437B8 800683B8 24060100 */ addiu $a2, $zero, 0x100
/* 437BC 800683BC 8FB6024C */ lw $s6, 0x24C($sp)
/* 437C0 800683C0 8FA20248 */ lw $v0, 0x248($sp)
/* 437C4 800683C4 0220B821 */ addu $s7, $s1, $zero
/* 437C8 800683C8 26B50001 */ addiu $s5, $s5, 0x1
/* 437CC 800683CC 02629823 */ subu $s3, $s3, $v0
.L800683D0:
/* 437D0 800683D0 92430064 */ lbu $v1, 0x64($s2)
/* 437D4 800683D4 26310001 */ addiu $s1, $s1, 0x1
/* 437D8 800683D8 322200FF */ andi $v0, $s1, 0xFF
/* 437DC 800683DC 0043102B */ sltu $v0, $v0, $v1
/* 437E0 800683E0 1440FFBA */ bnez $v0, .L800682CC
/* 437E4 800683E4 02402021 */ addu $a0, $s2, $zero
.L800683E8:
/* 437E8 800683E8 1E600020 */ bgtz $s3, .L8006846C
/* 437EC 800683EC 24020003 */ addiu $v0, $zero, 0x3
/* 437F0 800683F0 8FA30244 */ lw $v1, 0x244($sp)
/* 437F4 800683F4 2402FFFF */ addiu $v0, $zero, -0x1
/* 437F8 800683F8 14620005 */ bne $v1, $v0, .L80068410
/* 437FC 800683FC 27A50230 */ addiu $a1, $sp, 0x230
/* 43800 80068400 0801A11B */ j .L8006846C
/* 43804 80068404 24020003 */ addiu $v0, $zero, 0x3
.L80068408:
/* 43808 80068408 0801A11B */ j .L8006846C
/* 4380C 8006840C 00601021 */ addu $v0, $v1, $zero
.L80068410:
/* 43810 80068410 97A80256 */ lhu $t0, 0x256($sp)
/* 43814 80068414 8FA40264 */ lw $a0, 0x264($sp)
/* 43818 80068418 A7A80224 */ sh $t0, 0x224($sp)
/* 4381C 8006841C 8FA8025C */ lw $t0, 0x25C($sp)
/* 43820 80068420 24060010 */ addiu $a2, $zero, 0x10
/* 43824 80068424 A7BE0226 */ sh $fp, 0x226($sp)
/* 43828 80068428 A7A0022A */ sh $zero, 0x22A($sp)
/* 4382C 8006842C 0C019194 */ jal bcopy
/* 43830 80068430 AFA80220 */ sw $t0, 0x220($sp)
/* 43834 80068434 8FA402A8 */ lw $a0, 0x2A8($sp)
/* 43838 80068438 27A5022C */ addiu $a1, $sp, 0x22C
/* 4383C 8006843C 0C019194 */ jal bcopy
/* 43840 80068440 24060004 */ addiu $a2, $zero, 0x4
/* 43844 80068444 8FA802B0 */ lw $t0, 0x2B0($sp)
/* 43848 80068448 8E46005C */ lw $a2, 0x5C($s2)
/* 4384C 8006844C 8D020000 */ lw $v0, 0x0($t0)
/* 43850 80068450 27A70220 */ addiu $a3, $sp, 0x220
/* 43854 80068454 AFA00010 */ sw $zero, 0x10($sp)
/* 43858 80068458 8E440004 */ lw $a0, 0x4($s2)
/* 4385C 8006845C 8E450008 */ lw $a1, 0x8($s2)
/* 43860 80068460 00C23021 */ addu $a2, $a2, $v0
/* 43864 80068464 0C01A8F0 */ jal osContRamWrite
/* 43868 80068468 30C6FFFF */ andi $a2, $a2, 0xFFFF
.L8006846C:
/* 4386C 8006846C 8FBF0294 */ lw $ra, 0x294($sp)
/* 43870 80068470 8FBE0290 */ lw $fp, 0x290($sp)
/* 43874 80068474 8FB7028C */ lw $s7, 0x28C($sp)
/* 43878 80068478 8FB60288 */ lw $s6, 0x288($sp)
/* 4387C 8006847C 8FB50284 */ lw $s5, 0x284($sp)
/* 43880 80068480 8FB40280 */ lw $s4, 0x280($sp)
/* 43884 80068484 8FB3027C */ lw $s3, 0x27C($sp)
/* 43888 80068488 8FB20278 */ lw $s2, 0x278($sp)
/* 4388C 8006848C 8FB10274 */ lw $s1, 0x274($sp)
/* 43890 80068490 8FB00270 */ lw $s0, 0x270($sp)
/* 43894 80068494 03E00008 */ jr $ra
/* 43898 80068498 27BD0298 */ addiu $sp, $sp, 0x298
### DECOMPILED C INSTRUCTIONS:
s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, int fileSize, s32* fileNo) {
s32 startPage;
s32 decleared;
s32 prevPage;
s32 oldPrevPage = 0;
s32 ret = 0;
s32 fileSizeInPages;
__OSInode inode;
__OSInode backupInode;
__OSDir dir;
u8 bank;
u8 prevBank = 0;
s32 firsttime = 0;
s32 bytes;
__OSInodeUnit fpage;
if ((companyCode == 0) || (gameCode == 0)) {
return PFS_ERR_INVALID;
}
fileSizeInPages = (fileSize + PFS_PAGE_SIZE - 1) / PFS_PAGE_SIZE;
if (((ret = osPfsFindFile(pfs, companyCode, gameCode, gameName, extName, fileNo)) != 0) &&
(ret != PFS_ERR_INVALID)) {
return ret;
}
if (*fileNo != -1) {
return PFS_ERR_EXIST;
}
ret = osPfsFreeBlocks(pfs, &bytes);
if (fileSize > bytes) {
return PFS_DATA_FULL;
}
if (fileSizeInPages == 0) {
return (PFS_ERR_INVALID);
}
if (((ret = osPfsFindFile(pfs, 0, 0, 0, 0, fileNo)) != 0) && (ret != PFS_ERR_INVALID)) {
return ret;
}
if (*fileNo == -1) {
return PFS_DIR_FULL;
}
for (bank = PFS_ID_BANK_256K; bank < pfs->banks; bank++) {
if ((ret = __osPfsRWInode(pfs, &inode, PFS_READ, bank)) != 0) {
return ret;
}
ret = __osPfsDeclearPage(pfs, &inode, fileSizeInPages, &startPage, bank, &decleared, &prevPage);
if (ret) {
return ret;
}
if (startPage != -1) { /* There is free space */
if (firsttime == 0) {
fpage.inode_t.page = (u8)startPage;
fpage.inode_t.bank = bank;
} else { /* Writing previous bank inode */
backupInode.inode_page[oldPrevPage].inode_t.bank = bank;
backupInode.inode_page[oldPrevPage].inode_t.page = (u8)startPage;
if ((ret = __osPfsRWInode(pfs, &backupInode, PFS_WRITE, prevBank)) != 0) {
return ret;
}
}
if (fileSizeInPages > decleared) {
bcopy(&inode, &backupInode, sizeof(__OSInode));
oldPrevPage = prevPage;
prevBank = bank;
fileSizeInPages -= decleared;
firsttime++;
} else {
fileSizeInPages = 0;
if ((ret = __osPfsRWInode(pfs, &inode, PFS_WRITE, bank)) != 0) {
return ret;
}
break;
}
}
}
if ((fileSizeInPages > 0) || (startPage == -1)) {
return PFS_ERR_INCONSISTENT;
}
dir.start_page = fpage;
dir.company_code = companyCode;
dir.game_code = gameCode;
dir.data_sum = 0;
bcopy(gameName, dir.game_name, PFS_FILE_NAME_LEN);
bcopy(extName, dir.ext_name, PFS_FILE_EXT_LEN);
return __osContRamWrite(pfs->queue, pfs->channel, pfs->dir_table + *fileNo, (u8*)&dir, 0);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel draw_shop_items
/* 7E23A4 80281524 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 7E23A8 80281528 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 7E23AC 8028152C 27BDFF90 */ addiu $sp, $sp, -0x70
/* 7E23B0 80281530 AFBF005C */ sw $ra, 0x5C($sp)
/* 7E23B4 80281534 AFBE0058 */ sw $fp, 0x58($sp)
/* 7E23B8 80281538 AFB70054 */ sw $s7, 0x54($sp)
/* 7E23BC 8028153C AFB60050 */ sw $s6, 0x50($sp)
/* 7E23C0 80281540 AFB5004C */ sw $s5, 0x4C($sp)
/* 7E23C4 80281544 AFB40048 */ sw $s4, 0x48($sp)
/* 7E23C8 80281548 AFB30044 */ sw $s3, 0x44($sp)
/* 7E23CC 8028154C AFB20040 */ sw $s2, 0x40($sp)
/* 7E23D0 80281550 AFB1003C */ sw $s1, 0x3C($sp)
/* 7E23D4 80281554 AFB00038 */ sw $s0, 0x38($sp)
/* 7E23D8 80281558 F7B60068 */ sdc1 $f22, 0x68($sp)
/* 7E23DC 8028155C F7B40060 */ sdc1 $f20, 0x60($sp)
/* 7E23E0 80281560 8C520144 */ lw $s2, 0x144($v0)
/* 7E23E4 80281564 96420000 */ lhu $v0, 0x0($s2)
/* 7E23E8 80281568 30420001 */ andi $v0, $v0, 0x1
/* 7E23EC 8028156C 10400005 */ beqz $v0, .L80281584
/* 7E23F0 80281570 2404000A */ addiu $a0, $zero, 0xA
/* 7E23F4 80281574 3C108014 */ lui $s0, %hi(basic_window_update)
/* 7E23F8 80281578 26107474 */ addiu $s0, $s0, %lo(basic_window_update)
/* 7E23FC 8028157C 080A0563 */ j .L8028158C
/* 7E2400 80281580 00000000 */ nop
.L80281584:
/* 7E2404 80281584 3C108014 */ lui $s0, %hi(basic_hidden_window_update)
/* 7E2408 80281588 26107574 */ addiu $s0, $s0, %lo(basic_hidden_window_update)
.L8028158C:
/* 7E240C 8028158C 0C051F9F */ jal set_window_update
/* 7E2410 80281590 0200282D */ daddu $a1, $s0, $zero
/* 7E2414 80281594 2404000B */ addiu $a0, $zero, 0xB
/* 7E2418 80281598 0C051F9F */ jal set_window_update
/* 7E241C 8028159C 0200282D */ daddu $a1, $s0, $zero
/* 7E2420 802815A0 96420000 */ lhu $v0, 0x0($s2)
/* 7E2424 802815A4 30420001 */ andi $v0, $v0, 0x1
/* 7E2428 802815A8 10400096 */ beqz $v0, .L80281804
/* 7E242C 802815AC 00000000 */ nop
/* 7E2430 802815B0 3C04800B */ lui $a0, %hi(gCameras)
/* 7E2434 802815B4 24841D80 */ addiu $a0, $a0, %lo(gCameras)
/* 7E2438 802815B8 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 7E243C 802815BC 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 7E2440 802815C0 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 7E2444 802815C4 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 7E2448 802815C8 8C5E0140 */ lw $fp, 0x140($v0)
/* 7E244C 802815CC 00031080 */ sll $v0, $v1, 2
/* 7E2450 802815D0 00431021 */ addu $v0, $v0, $v1
/* 7E2454 802815D4 00021080 */ sll $v0, $v0, 2
/* 7E2458 802815D8 00431023 */ subu $v0, $v0, $v1
/* 7E245C 802815DC 000218C0 */ sll $v1, $v0, 3
/* 7E2460 802815E0 00431021 */ addu $v0, $v0, $v1
/* 7E2464 802815E4 000210C0 */ sll $v0, $v0, 3
/* 7E2468 802815E8 0044A821 */ addu $s5, $v0, $a0
/* 7E246C 802815EC 86420002 */ lh $v0, 0x2($s2)
/* 7E2470 802815F0 8E440018 */ lw $a0, 0x18($s2)
/* 7E2474 802815F4 18400083 */ blez $v0, .L80281804
/* 7E2478 802815F8 0000B82D */ daddu $s7, $zero, $zero
/* 7E247C 802815FC 27D4000C */ addiu $s4, $fp, 0xC
/* 7E2480 80281600 24960004 */ addiu $s6, $a0, 0x4
/* 7E2484 80281604 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 7E2488 80281608 4481B000 */ mtc1 $at, $f22
/* 7E248C 8028160C 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 7E2490 80281610 4481A800 */ mtc1 $at, $f21
/* 7E2494 80281614 4480A000 */ mtc1 $zero, $f20
.L80281618:
/* 7E2498 80281618 26A400D4 */ addiu $a0, $s5, 0xD4
/* 7E249C 8028161C C686FFF8 */ lwc1 $f6, -0x8($s4)
/* 7E24A0 80281620 C682FFFC */ lwc1 $f2, -0x4($s4)
/* 7E24A4 80281624 C6840000 */ lwc1 $f4, 0x0($s4)
/* 7E24A8 80281628 3C0141F0 */ lui $at, (0x41F00000 >> 16)
/* 7E24AC 8028162C 44810000 */ mtc1 $at, $f0
/* 7E24B0 80281630 27A20028 */ addiu $v0, $sp, 0x28
/* 7E24B4 80281634 AFA20014 */ sw $v0, 0x14($sp)
/* 7E24B8 80281638 27A2002C */ addiu $v0, $sp, 0x2C
/* 7E24BC 8028163C AFA20018 */ sw $v0, 0x18($sp)
/* 7E24C0 80281640 27A20030 */ addiu $v0, $sp, 0x30
/* 7E24C4 80281644 AFA2001C */ sw $v0, 0x1C($sp)
/* 7E24C8 80281648 46001080 */ add.s $f2, $f2, $f0
/* 7E24CC 8028164C 44053000 */ mfc1 $a1, $f6
/* 7E24D0 80281650 44072000 */ mfc1 $a3, $f4
/* 7E24D4 80281654 44061000 */ mfc1 $a2, $f2
/* 7E24D8 80281658 27A20034 */ addiu $v0, $sp, 0x34
/* 7E24DC 8028165C E7B60010 */ swc1 $f22, 0x10($sp)
/* 7E24E0 80281660 0C00A588 */ jal transform_point
/* 7E24E4 80281664 AFA20020 */ sw $v0, 0x20($sp)
/* 7E24E8 80281668 C7A60034 */ lwc1 $f6, 0x34($sp)
/* 7E24EC 8028166C C7A00030 */ lwc1 $f0, 0x30($sp)
/* 7E24F0 80281670 4606B183 */ div.s $f6, $f22, $f6
/* 7E24F4 80281674 46060002 */ mul.s $f0, $f0, $f6
/* 7E24F8 80281678 00000000 */ nop
/* 7E24FC 8028167C 46160000 */ add.s $f0, $f0, $f22
/* 7E2500 80281680 46000021 */ cvt.d.s $f0, $f0
/* 7E2504 80281684 46340002 */ mul.d $f0, $f0, $f20
/* 7E2508 80281688 00000000 */ nop
/* 7E250C 8028168C C7A20028 */ lwc1 $f2, 0x28($sp)
/* 7E2510 80281690 46061202 */ mul.s $f8, $f2, $f6
/* 7E2514 80281694 00000000 */ nop
/* 7E2518 80281698 C7A4002C */ lwc1 $f4, 0x2C($sp)
/* 7E251C 8028169C 46003087 */ neg.s $f2, $f6
/* 7E2520 802816A0 46022282 */ mul.s $f10, $f4, $f2
/* 7E2524 802816A4 00000000 */ nop
/* 7E2528 802816A8 44801000 */ mtc1 $zero, $f2
/* 7E252C 802816AC E7A60034 */ swc1 $f6, 0x34($sp)
/* 7E2530 802816B0 E7A80028 */ swc1 $f8, 0x28($sp)
/* 7E2534 802816B4 E7AA002C */ swc1 $f10, 0x2C($sp)
/* 7E2538 802816B8 46200020 */ cvt.s.d $f0, $f0
/* 7E253C 802816BC 4600103C */ c.lt.s $f2, $f0
/* 7E2540 802816C0 00000000 */ nop
/* 7E2544 802816C4 45000048 */ bc1f .L802817E8
/* 7E2548 802816C8 E7A00030 */ swc1 $f0, 0x30($sp)
/* 7E254C 802816CC 4616003C */ c.lt.s $f0, $f22
/* 7E2550 802816D0 00000000 */ nop
/* 7E2554 802816D4 45020045 */ bc1fl .L802817EC
/* 7E2558 802816D8 26F70001 */ addiu $s7, $s7, 0x1
/* 7E255C 802816DC 86A2000A */ lh $v0, 0xA($s5)
/* 7E2560 802816E0 44820000 */ mtc1 $v0, $f0
/* 7E2564 802816E4 00000000 */ nop
/* 7E2568 802816E8 46800020 */ cvt.s.w $f0, $f0
/* 7E256C 802816EC 46004102 */ mul.s $f4, $f8, $f0
/* 7E2570 802816F0 00000000 */ nop
/* 7E2574 802816F4 46002100 */ add.s $f4, $f4, $f0
/* 7E2578 802816F8 46002121 */ cvt.d.s $f4, $f4
/* 7E257C 802816FC 46342102 */ mul.d $f4, $f4, $f20
/* 7E2580 80281700 00000000 */ nop
/* 7E2584 80281704 86A2000C */ lh $v0, 0xC($s5)
/* 7E2588 80281708 44820000 */ mtc1 $v0, $f0
/* 7E258C 8028170C 00000000 */ nop
/* 7E2590 80281710 46800020 */ cvt.s.w $f0, $f0
/* 7E2594 80281714 46005082 */ mul.s $f2, $f10, $f0
/* 7E2598 80281718 00000000 */ nop
/* 7E259C 8028171C 46001080 */ add.s $f2, $f2, $f0
/* 7E25A0 80281720 460010A1 */ cvt.d.s $f2, $f2
/* 7E25A4 80281724 46341082 */ mul.d $f2, $f2, $f20
/* 7E25A8 80281728 00000000 */ nop
/* 7E25AC 8028172C 86A2000E */ lh $v0, 0xE($s5)
/* 7E25B0 80281730 44820000 */ mtc1 $v0, $f0
/* 7E25B4 80281734 00000000 */ nop
/* 7E25B8 80281738 46800021 */ cvt.d.w $f0, $f0
/* 7E25BC 8028173C 86A20010 */ lh $v0, 0x10($s5)
/* 7E25C0 80281740 46202100 */ add.d $f4, $f4, $f0
/* 7E25C4 80281744 44820000 */ mtc1 $v0, $f0
/* 7E25C8 80281748 00000000 */ nop
/* 7E25CC 8028174C 46800021 */ cvt.d.w $f0, $f0
/* 7E25D0 80281750 8EC20000 */ lw $v0, 0x0($s6)
/* 7E25D4 80281754 46201080 */ add.d $f2, $f2, $f0
/* 7E25D8 80281758 28420064 */ slti $v0, $v0, 0x64
/* 7E25DC 8028175C 4620230D */ trunc.w.d $f12, $f4
/* 7E25E0 80281760 44116000 */ mfc1 $s1, $f12
/* 7E25E4 80281764 4620130D */ trunc.w.d $f12, $f2
/* 7E25E8 80281768 44136000 */ mfc1 $s3, $f12
/* 7E25EC 8028176C 10400002 */ beqz $v0, .L80281778
/* 7E25F0 80281770 0000802D */ daddu $s0, $zero, $zero
/* 7E25F4 80281774 2410FFFC */ addiu $s0, $zero, -0x4
.L80281778:
/* 7E25F8 80281778 0C04C3D6 */ jal get_item_entity
/* 7E25FC 8028177C 8FC40000 */ lw $a0, 0x0($fp)
/* 7E2600 80281780 8C420000 */ lw $v0, 0x0($v0)
/* 7E2604 80281784 30420040 */ andi $v0, $v0, 0x40
/* 7E2608 80281788 14400009 */ bnez $v0, .L802817B0
/* 7E260C 8028178C 02302821 */ addu $a1, $s1, $s0
/* 7E2610 80281790 0260302D */ daddu $a2, $s3, $zero
/* 7E2614 80281794 240200FF */ addiu $v0, $zero, 0xFF
/* 7E2618 80281798 AFA00010 */ sw $zero, 0x10($sp)
/* 7E261C 8028179C AFA20014 */ sw $v0, 0x14($sp)
/* 7E2620 802817A0 AFA00018 */ sw $zero, 0x18($sp)
/* 7E2624 802817A4 8EC40000 */ lw $a0, 0x0($s6)
/* 7E2628 802817A8 0C049DA7 */ jal draw_number
/* 7E262C 802817AC 24070001 */ addiu $a3, $zero, 0x1
.L802817B0:
/* 7E2630 802817B0 8E420008 */ lw $v0, 0x8($s2)
/* 7E2634 802817B4 56E2000D */ bnel $s7, $v0, .L802817EC
/* 7E2638 802817B8 26F70001 */ addiu $s7, $s7, 0x1
/* 7E263C 802817BC 02302821 */ addu $a1, $s1, $s0
/* 7E2640 802817C0 24A5FFFA */ addiu $a1, $a1, -0x6
/* 7E2644 802817C4 8E440020 */ lw $a0, 0x20($s2)
/* 7E2648 802817C8 0C051261 */ jal hud_element_set_render_pos
/* 7E264C 802817CC 26660005 */ addiu $a2, $s3, 0x5
/* 7E2650 802817D0 8E440020 */ lw $a0, 0x20($s2)
/* 7E2654 802817D4 3C053F33 */ lui $a1, (0x3F333333 >> 16)
/* 7E2658 802817D8 0C051308 */ jal hud_element_set_scale
/* 7E265C 802817DC 34A53333 */ ori $a1, $a1, (0x3F333333 & 0xFFFF)
/* 7E2660 802817E0 0C0511EA */ jal hud_element_draw_clipped
/* 7E2664 802817E4 8E440020 */ lw $a0, 0x20($s2)
.L802817E8:
/* 7E2668 802817E8 26F70001 */ addiu $s7, $s7, 0x1
.L802817EC:
/* 7E266C 802817EC 26D6000C */ addiu $s6, $s6, 0xC
/* 7E2670 802817F0 26940010 */ addiu $s4, $s4, 0x10
/* 7E2674 802817F4 86420002 */ lh $v0, 0x2($s2)
/* 7E2678 802817F8 02E2102A */ slt $v0, $s7, $v0
/* 7E267C 802817FC 1440FF86 */ bnez $v0, .L80281618
/* 7E2680 80281800 27DE0010 */ addiu $fp, $fp, 0x10
.L80281804:
/* 7E2684 80281804 8E420358 */ lw $v0, 0x358($s2)
/* 7E2688 80281808 18400003 */ blez $v0, .L80281818
/* 7E268C 8028180C 2442FFFF */ addiu $v0, $v0, -0x1
/* 7E2690 80281810 080A060A */ j .L80281828
/* 7E2694 80281814 AE420358 */ sw $v0, 0x358($s2)
.L80281818:
/* 7E2698 80281818 96420000 */ lhu $v0, 0x0($s2)
/* 7E269C 8028181C 3042FFFE */ andi $v0, $v0, 0xFFFE
/* 7E26A0 80281820 0C03A640 */ jal func_800E9900
/* 7E26A4 80281824 A6420000 */ sh $v0, 0x0($s2)
.L80281828:
/* 7E26A8 80281828 8FBF005C */ lw $ra, 0x5C($sp)
/* 7E26AC 8028182C 8FBE0058 */ lw $fp, 0x58($sp)
/* 7E26B0 80281830 8FB70054 */ lw $s7, 0x54($sp)
/* 7E26B4 80281834 8FB60050 */ lw $s6, 0x50($sp)
/* 7E26B8 80281838 8FB5004C */ lw $s5, 0x4C($sp)
/* 7E26BC 8028183C 8FB40048 */ lw $s4, 0x48($sp)
/* 7E26C0 80281840 8FB30044 */ lw $s3, 0x44($sp)
/* 7E26C4 80281844 8FB20040 */ lw $s2, 0x40($sp)
/* 7E26C8 80281848 8FB1003C */ lw $s1, 0x3C($sp)
/* 7E26CC 8028184C 8FB00038 */ lw $s0, 0x38($sp)
/* 7E26D0 80281850 D7B60068 */ ldc1 $f22, 0x68($sp)
/* 7E26D4 80281854 D7B40060 */ ldc1 $f20, 0x60($sp)
/* 7E26D8 80281858 03E00008 */ jr $ra
/* 7E26DC 8028185C 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void draw_shop_items(void) {
Shop* shop = gGameStatusPtr->mapShop;
ShopItemData* itemData;
Camera* camera;
s32 i;
s32 xTemp;
s32 yTemp;
s32 xOffset;
f32 x, y, z, s;
f32 inX, inY, inZ;
ShopItemEntity* shopItemEntities;
if (shop->flags & SHOP_FLAG_1) {
set_window_update(WINDOW_ID_ITEM_INFO_NAME, (s32) basic_window_update);
set_window_update(WINDOW_ID_ITEM_INFO_DESC, (s32) basic_window_update);
} else {
set_window_update(WINDOW_ID_ITEM_INFO_NAME, (s32) basic_hidden_window_update);
set_window_update(WINDOW_ID_ITEM_INFO_DESC, (s32) basic_hidden_window_update);
}
if (shop->flags & SHOP_FLAG_1) {
camera = &gCameras[gCurrentCameraID];
itemData = shop->staticInventory;
shopItemEntities = gGameStatusPtr->shopItemEntities;
for (i = 0; i < shop->numItems; i++, itemData++, shopItemEntities++) {
inX = shopItemEntities->pos.x;
inY = shopItemEntities->pos.y + 30.0f;
inZ = shopItemEntities->pos.z;
transform_point(camera->perspectiveMatrix, inX, inY, inZ, 1.0f, &x, &y, &z, &s);
s = 1.0f / s;
x *= s;
y *= -s;
z = (z * s + 1.0f) * 0.5;
if (z > 0.0f && z < 1.0f) {
xTemp = (((x * camera->viewportW) + camera->viewportW) * 0.5) + camera->viewportStartX;
yTemp = (((y * camera->viewportH) + camera->viewportH) * 0.5) + camera->viewportStartY;
if (itemData->price < 100) {
xOffset = -4;
} else {
xOffset = 0;
}
if (!(get_item_entity(shopItemEntities->index)->flags & ITEM_ENTITY_FLAG_HIDDEN)) {
draw_number(itemData->price, xTemp + xOffset, yTemp, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_WHITE, 255, 0);
}
if (i == shop->currentItemSlot) {
hud_element_set_render_pos(shop->costIconID, (xTemp + xOffset) - 6, yTemp + 5);
hud_element_set_scale(shop->costIconID, 0.7f);
hud_element_draw_clipped(shop->costIconID);
}
}
}
}
if (shop->unk_358 > 0) {
shop->unk_358--;
} else {
shop->flags &= ~SHOP_FLAG_1;
func_800E9900();
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel ai_check_fwd_collisions
/* 25B84 8004A784 27BDFF68 */ addiu $sp, $sp, -0x98
/* 25B88 8004A788 F7BC0088 */ sdc1 $f28, 0x88($sp)
/* 25B8C 8004A78C 4485E000 */ mtc1 $a1, $f28
/* 25B90 8004A790 AFB40058 */ sw $s4, 0x58($sp)
/* 25B94 8004A794 8FB400A8 */ lw $s4, 0xA8($sp)
/* 25B98 8004A798 AFB00048 */ sw $s0, 0x48($sp)
/* 25B9C 8004A79C 0080802D */ daddu $s0, $a0, $zero
/* 25BA0 8004A7A0 AFB1004C */ sw $s1, 0x4C($sp)
/* 25BA4 8004A7A4 00C0882D */ daddu $s1, $a2, $zero
/* 25BA8 8004A7A8 AFB30054 */ sw $s3, 0x54($sp)
/* 25BAC 8004A7AC 00E0982D */ daddu $s3, $a3, $zero
/* 25BB0 8004A7B0 AFB5005C */ sw $s5, 0x5C($sp)
/* 25BB4 8004A7B4 8FB500AC */ lw $s5, 0xAC($sp)
/* 25BB8 8004A7B8 27A50020 */ addiu $a1, $sp, 0x20
/* 25BBC 8004A7BC AFBF0060 */ sw $ra, 0x60($sp)
/* 25BC0 8004A7C0 AFB20050 */ sw $s2, 0x50($sp)
/* 25BC4 8004A7C4 F7BE0090 */ sdc1 $f30, 0x90($sp)
/* 25BC8 8004A7C8 F7BA0080 */ sdc1 $f26, 0x80($sp)
/* 25BCC 8004A7CC F7B80078 */ sdc1 $f24, 0x78($sp)
/* 25BD0 8004A7D0 F7B60070 */ sdc1 $f22, 0x70($sp)
/* 25BD4 8004A7D4 F7B40068 */ sdc1 $f20, 0x68($sp)
/* 25BD8 8004A7D8 C6000038 */ lwc1 $f0, 0x38($s0)
/* 25BDC 8004A7DC C602003C */ lwc1 $f2, 0x3C($s0)
/* 25BE0 8004A7E0 27A60024 */ addiu $a2, $sp, 0x24
/* 25BE4 8004A7E4 E7A00020 */ swc1 $f0, 0x20($sp)
/* 25BE8 8004A7E8 E7A20024 */ swc1 $f2, 0x24($sp)
/* 25BEC 8004A7EC C6000018 */ lwc1 $f0, 0x18($s0)
/* 25BF0 8004A7F0 C6020040 */ lwc1 $f2, 0x40($s0)
/* 25BF4 8004A7F4 461C0002 */ mul.s $f0, $f0, $f28
/* 25BF8 8004A7F8 00000000 */ nop
/* 25BFC 8004A7FC E7A20028 */ swc1 $f2, 0x28($sp)
/* 25C00 8004A800 C63A0000 */ lwc1 $f26, 0x0($s1)
/* 25C04 8004A804 27A70028 */ addiu $a3, $sp, 0x28
/* 25C08 8004A808 E7BA0014 */ swc1 $f26, 0x14($sp)
/* 25C0C 8004A80C E7A00010 */ swc1 $f0, 0x10($sp)
/* 25C10 8004A810 860200A8 */ lh $v0, 0xA8($s0)
/* 25C14 8004A814 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* 25C18 8004A818 4481A000 */ mtc1 $at, $f20
/* 25C1C 8004A81C 44820000 */ mtc1 $v0, $f0
/* 25C20 8004A820 00000000 */ nop
/* 25C24 8004A824 46800020 */ cvt.s.w $f0, $f0
/* 25C28 8004A828 E7A00018 */ swc1 $f0, 0x18($sp)
/* 25C2C 8004A82C 860200A6 */ lh $v0, 0xA6($s0)
/* 25C30 8004A830 4600A586 */ mov.s $f22, $f20
/* 25C34 8004A834 44820000 */ mtc1 $v0, $f0
/* 25C38 8004A838 00000000 */ nop
/* 25C3C 8004A83C 46800020 */ cvt.s.w $f0, $f0
/* 25C40 8004A840 E7A0001C */ swc1 $f0, 0x1C($sp)
/* 25C44 8004A844 8E040080 */ lw $a0, 0x80($s0)
/* 25C48 8004A848 0C037711 */ jal npc_test_move_simple_with_slipping
/* 25C4C 8004A84C 4600A606 */ mov.s $f24, $f20
/* 25C50 8004A850 0040902D */ daddu $s2, $v0, $zero
/* 25C54 8004A854 1240008D */ beqz $s2, .L8004AA8C
/* 25C58 8004A858 00000000 */ nop
/* 25C5C 8004A85C C60C0038 */ lwc1 $f12, 0x38($s0)
/* 25C60 8004A860 C60E0040 */ lwc1 $f14, 0x40($s0)
/* 25C64 8004A864 8FA60020 */ lw $a2, 0x20($sp)
/* 25C68 8004A868 0C00A7B5 */ jal dist2D
/* 25C6C 8004A86C 8FA70028 */ lw $a3, 0x28($sp)
/* 25C70 8004A870 46000586 */ mov.s $f22, $f0
/* 25C74 8004A874 C6020038 */ lwc1 $f2, 0x38($s0)
/* 25C78 8004A878 C604003C */ lwc1 $f4, 0x3C($s0)
/* 25C7C 8004A87C 3C01420C */ lui $at, (0x420C0000 >> 16)
/* 25C80 8004A880 4481F000 */ mtc1 $at, $f30
/* 25C84 8004A884 C6000040 */ lwc1 $f0, 0x40($s0)
/* 25C88 8004A888 461ED300 */ add.s $f12, $f26, $f30
/* 25C8C 8004A88C E7A2002C */ swc1 $f2, 0x2C($sp)
/* 25C90 8004A890 E7A40030 */ swc1 $f4, 0x30($sp)
/* 25C94 8004A894 0C00A6C9 */ jal clamp_angle
/* 25C98 8004A898 E7A00034 */ swc1 $f0, 0x34($sp)
/* 25C9C 8004A89C C6020018 */ lwc1 $f2, 0x18($s0)
/* 25CA0 8004A8A0 461C1082 */ mul.s $f2, $f2, $f28
/* 25CA4 8004A8A4 00000000 */ nop
/* 25CA8 8004A8A8 E7A00014 */ swc1 $f0, 0x14($sp)
/* 25CAC 8004A8AC E7A20010 */ swc1 $f2, 0x10($sp)
/* 25CB0 8004A8B0 860200A8 */ lh $v0, 0xA8($s0)
/* 25CB4 8004A8B4 27A5002C */ addiu $a1, $sp, 0x2C
/* 25CB8 8004A8B8 44820000 */ mtc1 $v0, $f0
/* 25CBC 8004A8BC 00000000 */ nop
/* 25CC0 8004A8C0 46800020 */ cvt.s.w $f0, $f0
/* 25CC4 8004A8C4 E7A00018 */ swc1 $f0, 0x18($sp)
/* 25CC8 8004A8C8 860200A6 */ lh $v0, 0xA6($s0)
/* 25CCC 8004A8CC 27A60030 */ addiu $a2, $sp, 0x30
/* 25CD0 8004A8D0 44820000 */ mtc1 $v0, $f0
/* 25CD4 8004A8D4 00000000 */ nop
/* 25CD8 8004A8D8 46800020 */ cvt.s.w $f0, $f0
/* 25CDC 8004A8DC E7A0001C */ swc1 $f0, 0x1C($sp)
/* 25CE0 8004A8E0 8E040080 */ lw $a0, 0x80($s0)
/* 25CE4 8004A8E4 0C037711 */ jal npc_test_move_simple_with_slipping
/* 25CE8 8004A8E8 27A70034 */ addiu $a3, $sp, 0x34
/* 25CEC 8004A8EC 10400007 */ beqz $v0, .L8004A90C
/* 25CF0 8004A8F0 00000000 */ nop
/* 25CF4 8004A8F4 C60C0038 */ lwc1 $f12, 0x38($s0)
/* 25CF8 8004A8F8 C60E0040 */ lwc1 $f14, 0x40($s0)
/* 25CFC 8004A8FC 8FA6002C */ lw $a2, 0x2C($sp)
/* 25D00 8004A900 0C00A7B5 */ jal dist2D
/* 25D04 8004A904 8FA70034 */ lw $a3, 0x34($sp)
/* 25D08 8004A908 46000506 */ mov.s $f20, $f0
.L8004A90C:
/* 25D0C 8004A90C C6000038 */ lwc1 $f0, 0x38($s0)
/* 25D10 8004A910 C602003C */ lwc1 $f2, 0x3C($s0)
/* 25D14 8004A914 C6040040 */ lwc1 $f4, 0x40($s0)
/* 25D18 8004A918 461ED301 */ sub.s $f12, $f26, $f30
/* 25D1C 8004A91C E7A00038 */ swc1 $f0, 0x38($sp)
/* 25D20 8004A920 E7A2003C */ swc1 $f2, 0x3C($sp)
/* 25D24 8004A924 0C00A6C9 */ jal clamp_angle
/* 25D28 8004A928 E7A40040 */ swc1 $f4, 0x40($sp)
/* 25D2C 8004A92C C6020018 */ lwc1 $f2, 0x18($s0)
/* 25D30 8004A930 461C1082 */ mul.s $f2, $f2, $f28
/* 25D34 8004A934 00000000 */ nop
/* 25D38 8004A938 E7A00014 */ swc1 $f0, 0x14($sp)
/* 25D3C 8004A93C E7A20010 */ swc1 $f2, 0x10($sp)
/* 25D40 8004A940 860200A8 */ lh $v0, 0xA8($s0)
/* 25D44 8004A944 27A50038 */ addiu $a1, $sp, 0x38
/* 25D48 8004A948 44820000 */ mtc1 $v0, $f0
/* 25D4C 8004A94C 00000000 */ nop
/* 25D50 8004A950 46800020 */ cvt.s.w $f0, $f0
/* 25D54 8004A954 E7A00018 */ swc1 $f0, 0x18($sp)
/* 25D58 8004A958 860200A6 */ lh $v0, 0xA6($s0)
/* 25D5C 8004A95C 27A6003C */ addiu $a2, $sp, 0x3C
/* 25D60 8004A960 44820000 */ mtc1 $v0, $f0
/* 25D64 8004A964 00000000 */ nop
/* 25D68 8004A968 46800020 */ cvt.s.w $f0, $f0
/* 25D6C 8004A96C E7A0001C */ swc1 $f0, 0x1C($sp)
/* 25D70 8004A970 8E040080 */ lw $a0, 0x80($s0)
/* 25D74 8004A974 0C037711 */ jal npc_test_move_simple_with_slipping
/* 25D78 8004A978 27A70040 */ addiu $a3, $sp, 0x40
/* 25D7C 8004A97C 10400007 */ beqz $v0, .L8004A99C
/* 25D80 8004A980 00000000 */ nop
/* 25D84 8004A984 C60C0038 */ lwc1 $f12, 0x38($s0)
/* 25D88 8004A988 C60E0040 */ lwc1 $f14, 0x40($s0)
/* 25D8C 8004A98C 8FA60038 */ lw $a2, 0x38($sp)
/* 25D90 8004A990 0C00A7B5 */ jal dist2D
/* 25D94 8004A994 8FA70040 */ lw $a3, 0x40($sp)
/* 25D98 8004A998 46000606 */ mov.s $f24, $f0
.L8004A99C:
/* 25D9C 8004A99C 4616A03C */ c.lt.s $f20, $f22
/* 25DA0 8004A9A0 00000000 */ nop
/* 25DA4 8004A9A4 45000005 */ bc1f .L8004A9BC
/* 25DA8 8004A9A8 00000000 */ nop
/* 25DAC 8004A9AC 4614C03C */ c.lt.s $f24, $f20
/* 25DB0 8004A9B0 00000000 */ nop
/* 25DB4 8004A9B4 45010009 */ bc1t .L8004A9DC
/* 25DB8 8004A9B8 00000000 */ nop
.L8004A9BC:
/* 25DBC 8004A9BC 4616C03C */ c.lt.s $f24, $f22
/* 25DC0 8004A9C0 00000000 */ nop
/* 25DC4 8004A9C4 45000007 */ bc1f .L8004A9E4
/* 25DC8 8004A9C8 00000000 */ nop
/* 25DCC 8004A9CC 4618A03C */ c.lt.s $f20, $f24
/* 25DD0 8004A9D0 00000000 */ nop
/* 25DD4 8004A9D4 45000003 */ bc1f .L8004A9E4
/* 25DD8 8004A9D8 00000000 */ nop
.L8004A9DC:
/* 25DDC 8004A9DC 08012AA3 */ j .L8004AA8C
/* 25DE0 8004A9E0 C61A000C */ lwc1 $f26, 0xC($s0)
.L8004A9E4:
/* 25DE4 8004A9E4 4614B03C */ c.lt.s $f22, $f20
/* 25DE8 8004A9E8 00000000 */ nop
/* 25DEC 8004A9EC 45000005 */ bc1f .L8004AA04
/* 25DF0 8004A9F0 00000000 */ nop
/* 25DF4 8004A9F4 4616C03C */ c.lt.s $f24, $f22
/* 25DF8 8004A9F8 00000000 */ nop
/* 25DFC 8004A9FC 45010009 */ bc1t .L8004AA24
/* 25E00 8004AA00 00000000 */ nop
.L8004AA04:
/* 25E04 8004AA04 4614C03C */ c.lt.s $f24, $f20
/* 25E08 8004AA08 00000000 */ nop
/* 25E0C 8004AA0C 4500000A */ bc1f .L8004AA38
/* 25E10 8004AA10 00000000 */ nop
/* 25E14 8004AA14 4618B03C */ c.lt.s $f22, $f24
/* 25E18 8004AA18 00000000 */ nop
/* 25E1C 8004AA1C 45000008 */ bc1f .L8004AA40
/* 25E20 8004AA20 00000000 */ nop
.L8004AA24:
/* 25E24 8004AA24 C602000C */ lwc1 $f2, 0xC($s0)
/* 25E28 8004AA28 3C01420C */ lui $at, (0x420C0000 >> 16)
/* 25E2C 8004AA2C 44810000 */ mtc1 $at, $f0
/* 25E30 8004AA30 08012AA3 */ j .L8004AA8C
/* 25E34 8004AA34 46001680 */ add.s $f26, $f2, $f0
.L8004AA38:
/* 25E38 8004AA38 4618B03C */ c.lt.s $f22, $f24
/* 25E3C 8004AA3C 00000000 */ nop
.L8004AA40:
/* 25E40 8004AA40 45000005 */ bc1f .L8004AA58
/* 25E44 8004AA44 00000000 */ nop
/* 25E48 8004AA48 4616A03C */ c.lt.s $f20, $f22
/* 25E4C 8004AA4C 00000000 */ nop
/* 25E50 8004AA50 45010009 */ bc1t .L8004AA78
/* 25E54 8004AA54 00000000 */ nop
.L8004AA58:
/* 25E58 8004AA58 4618A03C */ c.lt.s $f20, $f24
/* 25E5C 8004AA5C 00000000 */ nop
/* 25E60 8004AA60 4500000A */ bc1f .L8004AA8C
/* 25E64 8004AA64 00000000 */ nop
/* 25E68 8004AA68 4614B03C */ c.lt.s $f22, $f20
/* 25E6C 8004AA6C 00000000 */ nop
/* 25E70 8004AA70 45000006 */ bc1f .L8004AA8C
/* 25E74 8004AA74 00000000 */ nop
.L8004AA78:
/* 25E78 8004AA78 C602000C */ lwc1 $f2, 0xC($s0)
/* 25E7C 8004AA7C 3C01420C */ lui $at, (0x420C0000 >> 16)
/* 25E80 8004AA80 44810000 */ mtc1 $at, $f0
/* 25E84 8004AA84 00000000 */ nop
/* 25E88 8004AA88 46001681 */ sub.s $f26, $f2, $f0
.L8004AA8C:
/* 25E8C 8004AA8C 12200004 */ beqz $s1, .L8004AAA0
/* 25E90 8004AA90 00000000 */ nop
/* 25E94 8004AA94 0C00A6C9 */ jal clamp_angle
/* 25E98 8004AA98 4600D306 */ mov.s $f12, $f26
/* 25E9C 8004AA9C E6200000 */ swc1 $f0, 0x0($s1)
.L8004AAA0:
/* 25EA0 8004AAA0 56600001 */ bnel $s3, $zero, .L8004AAA8
/* 25EA4 8004AAA4 E6760000 */ swc1 $f22, 0x0($s3)
.L8004AAA8:
/* 25EA8 8004AAA8 56800001 */ bnel $s4, $zero, .L8004AAB0
/* 25EAC 8004AAAC E6940000 */ swc1 $f20, 0x0($s4)
.L8004AAB0:
/* 25EB0 8004AAB0 56A00001 */ bnel $s5, $zero, .L8004AAB8
/* 25EB4 8004AAB4 E6B80000 */ swc1 $f24, 0x0($s5)
.L8004AAB8:
/* 25EB8 8004AAB8 0240102D */ daddu $v0, $s2, $zero
/* 25EBC 8004AABC 8FBF0060 */ lw $ra, 0x60($sp)
/* 25EC0 8004AAC0 8FB5005C */ lw $s5, 0x5C($sp)
/* 25EC4 8004AAC4 8FB40058 */ lw $s4, 0x58($sp)
/* 25EC8 8004AAC8 8FB30054 */ lw $s3, 0x54($sp)
/* 25ECC 8004AACC 8FB20050 */ lw $s2, 0x50($sp)
/* 25ED0 8004AAD0 8FB1004C */ lw $s1, 0x4C($sp)
/* 25ED4 8004AAD4 8FB00048 */ lw $s0, 0x48($sp)
/* 25ED8 8004AAD8 D7BE0090 */ ldc1 $f30, 0x90($sp)
/* 25EDC 8004AADC D7BC0088 */ ldc1 $f28, 0x88($sp)
/* 25EE0 8004AAE0 D7BA0080 */ ldc1 $f26, 0x80($sp)
/* 25EE4 8004AAE4 D7B80078 */ ldc1 $f24, 0x78($sp)
/* 25EE8 8004AAE8 D7B60070 */ ldc1 $f22, 0x70($sp)
/* 25EEC 8004AAEC D7B40068 */ ldc1 $f20, 0x68($sp)
/* 25EF0 8004AAF0 03E00008 */ jr $ra
/* 25EF4 8004AAF4 27BD0098 */ addiu $sp, $sp, 0x98
/* 25EF8 8004AAF8 00000000 */ nop
/* 25EFC 8004AAFC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
s32 ai_check_fwd_collisions(Npc* npc, f32 time, f32* outYaw, f32* outDistFwd, f32* outDistCW, f32* outDistCCW) {
f32 x1, y1, z1;
f32 x2, y2, z2;
f32 x3, y3, z3;
f32 fwdHitDist = -1.0f;
f32 cwHitDist = -1.0f;
f32 ccwHitDist = -1.0f;
f32 yaw;
s32 fwdHit;
x1 = npc->pos.x;
y1 = npc->pos.y;
z1 = npc->pos.z;
yaw = *outYaw;
fwdHit = npc_test_move_simple_with_slipping(npc->collisionChannel,
&x1, &y1, &z1,
npc->moveSpeed * time,
yaw,
npc->collisionHeight,
npc->collisionDiameter);
if (fwdHit != 0) {
fwdHitDist = dist2D(npc->pos.x, npc->pos.z, x1, z1);
x2 = npc->pos.x;
y2 = npc->pos.y;
z2 = npc->pos.z;
if (npc_test_move_simple_with_slipping(npc->collisionChannel,
&x2, &y2, &z2, npc->moveSpeed * time,
clamp_angle(yaw + 35.0f),
npc->collisionHeight,
npc->collisionDiameter) != 0) {
cwHitDist = dist2D(npc->pos.x, npc->pos.z, x2, z2);
}
x3 = npc->pos.x;
y3 = npc->pos.y;
z3 = npc->pos.z;
if (npc_test_move_simple_with_slipping(npc->collisionChannel,
&x3, &y3, &z3,
npc->moveSpeed * time,
clamp_angle(yaw - 35.0f),
npc->collisionHeight,
npc->collisionDiameter) != 0) {
ccwHitDist = dist2D(npc->pos.x, npc->pos.z, x3, z3);
}
if ((cwHitDist < fwdHitDist && ccwHitDist < cwHitDist) || (ccwHitDist < fwdHitDist && cwHitDist < ccwHitDist)) {
yaw = npc->yaw;
} else if ((fwdHitDist < cwHitDist && ccwHitDist < fwdHitDist) || (ccwHitDist < cwHitDist && fwdHitDist < ccwHitDist)) {
yaw = npc->yaw + 35.0f;
} else if ((fwdHitDist < ccwHitDist && cwHitDist < fwdHitDist) || (cwHitDist < ccwHitDist && fwdHitDist < cwHitDist)) {
yaw = npc->yaw - 35.0f;
}
}
if (outYaw != NULL) {
*outYaw = clamp_angle(yaw);
}
if (outDistFwd != NULL) {
*outDistFwd = fwdHitDist;
}
if (outDistCW != NULL) {
*outDistCW = cwHitDist;
}
if (outDistCCW != NULL) {
*outDistCCW = ccwHitDist;
}
return fwdHit;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel action_update_state_23
/* E28ACC 802B609C 27BDFF90 */ addiu $sp, $sp, -0x70
/* E28AD0 802B60A0 AFB20058 */ sw $s2, 0x58($sp)
glabel action_update_use_spinning_flower
/* E28AD4 802B60A4 3C128011 */ lui $s2, %hi(gPlayerStatus)
.L802B60A8:
/* E28AD8 802B60A8 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus)
.L802B60AC:
/* E28ADC 802B60AC AFBF005C */ sw $ra, 0x5C($sp)
/* E28AE0 802B60B0 AFB10054 */ sw $s1, 0x54($sp)
glabel action_update_jump
/* E28AE4 802B60B4 AFB00050 */ sw $s0, 0x50($sp)
/* E28AE8 802B60B8 F7B60068 */ sdc1 $f22, 0x68($sp)
/* E28AEC 802B60BC F7B40060 */ sdc1 $f20, 0x60($sp)
/* E28AF0 802B60C0 8E430000 */ lw $v1, 0x0($s2)
/* E28AF4 802B60C4 0461000E */ bgez $v1, .L802B6100
.L802B60C8:
/* E28AF8 802B60C8 3C027FF7 */ lui $v0, (0x7FF7FFF1 >> 16)
/* E28AFC 802B60CC 3442FFF1 */ ori $v0, $v0, (0x7FF7FFF1 & 0xFFFF)
glabel .L802B60D0
/* E28B00 802B60D0 3C018011 */ lui $at, %hi(D_8010C938)
.L802B60D4:
/* E28B04 802B60D4 C420C938 */ lwc1 $f0, %lo(D_8010C938)($at)
/* E28B08 802B60D8 00621024 */ and $v0, $v1, $v0
/* E28B0C 802B60DC AE420000 */ sw $v0, 0x0($s2)
/* E28B10 802B60E0 A24000B6 */ sb $zero, 0xB6($s2)
/* E28B14 802B60E4 A6400008 */ sh $zero, 0x8($s2)
.L802B60E8:
/* E28B18 802B60E8 A64000C0 */ sh $zero, 0xC0($s2)
.L802B60EC:
/* E28B1C 802B60EC A64000C2 */ sh $zero, 0xC2($s2)
.L802B60F0:
/* E28B20 802B60F0 AE400054 */ sw $zero, 0x54($s2)
glabel .L802B60F4
/* E28B24 802B60F4 AE40008C */ sw $zero, 0x8C($s2)
/* E28B28 802B60F8 3C01802B */ lui $at, %hi(D_802B6770_E27C80)
/* E28B2C 802B60FC E4206770 */ swc1 $f0, %lo(D_802B6770_E27C80)($at)
.L802B6100:
/* E28B30 802B6100 824300B6 */ lb $v1, 0xB6($s2)
.L802B6104:
/* E28B34 802B6104 924200B6 */ lbu $v0, 0xB6($s2)
.L802B6108:
/* E28B38 802B6108 10600006 */ beqz $v1, .L802B6124
glabel .L802B610C
/* E28B3C 802B610C 24420001 */ addiu $v0, $v0, 0x1
.L802B6110:
/* E28B40 802B6110 24020001 */ addiu $v0, $zero, 0x1
/* E28B44 802B6114 10620004 */ beq $v1, $v0, .L802B6128
.L802B6118:
/* E28B48 802B6118 00000000 */ nop
/* E28B4C 802B611C 080AD8CC */ j .L802B6330
glabel action_update_parasol
/* E28B50 802B6120 00000000 */ nop
.L802B6124:
/* E28B54 802B6124 A24200B6 */ sb $v0, 0xB6($s2)
.L802B6128:
/* E28B58 802B6128 3C018011 */ lui $at, %hi(D_8010C990)
/* E28B5C 802B612C C42CC990 */ lwc1 $f12, %lo(D_8010C990)($at)
/* E28B60 802B6130 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
glabel .L802B6134
/* E28B64 802B6134 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* E28B68 802B6138 4481A000 */ mtc1 $at, $f20
.L802B613C:
/* E28B6C 802B613C 27B10028 */ addiu $s1, $sp, 0x28
.L802B6140:
/* E28B70 802B6140 46146302 */ mul.s $f12, $f12, $f20
.L802B6144:
/* E28B74 802B6144 00000000 */ nop
/* E28B78 802B6148 0220282D */ daddu $a1, $s1, $zero
.L802B614C:
/* E28B7C 802B614C 27B0002C */ addiu $s0, $sp, 0x2C
.L802B6150:
/* E28B80 802B6150 3C0143B4 */ lui $at, (0x43B40000 >> 16)
.L802B6154:
/* E28B84 802B6154 4481B000 */ mtc1 $at, $f22
.L802B6158:
/* E28B88 802B6158 0200302D */ daddu $a2, $s0, $zero
.L802B615C:
/* E28B8C 802B615C 0C00A82D */ jal sin_cos_rad
/* E28B90 802B6160 46166303 */ div.s $f12, $f12, $f22
.L802B6164:
/* E28B94 802B6164 3C01802B */ lui $at, %hi(D_802B6770_E27C80)
.L802B6168:
/* E28B98 802B6168 C42C6770 */ lwc1 $f12, %lo(D_802B6770_E27C80)($at)
/* E28B9C 802B616C 46146302 */ mul.s $f12, $f12, $f20
glabel .L802B6170
/* E28BA0 802B6170 00000000 */ nop
glabel .L802B6174
/* E28BA4 802B6174 0220282D */ daddu $a1, $s1, $zero
/* E28BA8 802B6178 C7A00028 */ lwc1 $f0, 0x28($sp)
.L802B617C:
/* E28BAC 802B617C 3C014040 */ lui $at, (0x40400000 >> 16)
.L802B6180:
/* E28BB0 802B6180 4481A000 */ mtc1 $at, $f20
glabel .L802B6184
/* E28BB4 802B6184 0200302D */ daddu $a2, $s0, $zero
.L802B6188:
/* E28BB8 802B6188 46140502 */ mul.s $f20, $f0, $f20
.L802B618C:
/* E28BBC 802B618C 00000000 */ nop
.L802B6190:
/* E28BC0 802B6190 0C00A82D */ jal sin_cos_rad
.L802B6194:
/* E28BC4 802B6194 46166303 */ div.s $f12, $f12, $f22
glabel func_802B6198
/* E28BC8 802B6198 C7A00028 */ lwc1 $f0, 0x28($sp)
/* E28BCC 802B619C 46140102 */ mul.s $f4, $f0, $f20
.L802B61A0:
/* E28BD0 802B61A0 00000000 */ nop
.L802B61A4:
/* E28BD4 802B61A4 C7A0002C */ lwc1 $f0, 0x2C($sp)
.L802B61A8:
/* E28BD8 802B61A8 46140182 */ mul.s $f6, $f0, $f20
.L802B61AC:
/* E28BDC 802B61AC 00000000 */ nop
.L802B61B0:
/* E28BE0 802B61B0 3C01802B */ lui $at, %hi(D_802B6760_E29190)
.L802B61B4:
/* E28BE4 802B61B4 D4226760 */ ldc1 $f2, %lo(D_802B6760_E29190)($at)
/* E28BE8 802B61B8 46002021 */ cvt.d.s $f0, $f4
/* E28BEC 802B61BC 46200005 */ abs.d $f0, $f0
glabel func_802B61C0
/* E28BF0 802B61C0 4622003C */ c.lt.d $f0, $f2
/* E28BF4 802B61C4 00000000 */ nop
.L802B61C8:
/* E28BF8 802B61C8 45020011 */ bc1fl .L802B6210
.L802B61CC:
/* E28BFC 802B61CC 46003021 */ cvt.d.s $f0, $f6
/* E28C00 802B61D0 44800000 */ mtc1 $zero, $f0
.L802B61D4:
/* E28C04 802B61D4 3C013DCC */ lui $at, (0x3DCCCCCD >> 16)
.L802B61D8:
/* E28C08 802B61D8 3421CCCD */ ori $at, $at, (0x3DCCCCCD & 0xFFFF)
.L802B61DC:
/* E28C0C 802B61DC 44811000 */ mtc1 $at, $f2
/* E28C10 802B61E0 4600203C */ c.lt.s $f4, $f0
glabel func_802B61E4
/* E28C14 802B61E4 00000000 */ nop
.L802B61E8:
/* E28C18 802B61E8 45000006 */ bc1f .L802B6204
.L802B61EC:
/* E28C1C 802B61EC 46001106 */ mov.s $f4, $f2
.L802B61F0:
/* E28C20 802B61F0 3C01BDCC */ lui $at, (0xBDCCCCCD >> 16)
.L802B61F4:
/* E28C24 802B61F4 3421CCCD */ ori $at, $at, (0xBDCCCCCD & 0xFFFF)
.L802B61F8:
/* E28C28 802B61F8 44811000 */ mtc1 $at, $f2
.L802B61FC:
/* E28C2C 802B61FC 00000000 */ nop
.L802B6200:
/* E28C30 802B6200 46001106 */ mov.s $f4, $f2
.L802B6204:
/* E28C34 802B6204 46003021 */ cvt.d.s $f0, $f6
glabel .L802B6208
/* E28C38 802B6208 3C01802B */ lui $at, %hi(D_802B6768_E29198)
/* E28C3C 802B620C D4226768 */ ldc1 $f2, %lo(D_802B6768_E29198)($at)
.L802B6210:
/* E28C40 802B6210 46200005 */ abs.d $f0, $f0
.L802B6214:
/* E28C44 802B6214 4622003C */ c.lt.d $f0, $f2
glabel .L802B6218
/* E28C48 802B6218 00000000 */ nop
/* E28C4C 802B621C 4500000F */ bc1f .L802B625C
.L802B6220:
/* E28C50 802B6220 0240202D */ daddu $a0, $s2, $zero
.L802B6224:
/* E28C54 802B6224 44800000 */ mtc1 $zero, $f0
glabel .L802B6228
/* E28C58 802B6228 3C013DCC */ lui $at, (0x3DCCCCCD >> 16)
.L802B622C:
/* E28C5C 802B622C 3421CCCD */ ori $at, $at, (0x3DCCCCCD & 0xFFFF)
glabel action_update_step_up_peach
/* E28C60 802B6230 44811000 */ mtc1 $at, $f2
/* E28C64 802B6234 4600303C */ c.lt.s $f6, $f0
glabel .L802B6238
/* E28C68 802B6238 00000000 */ nop
glabel .L802B623C
/* E28C6C 802B623C 45000007 */ bc1f .L802B625C
glabel .L802B6240
/* E28C70 802B6240 46001186 */ mov.s $f6, $f2
glabel .L802B6244
/* E28C74 802B6244 3C01BDCC */ lui $at, (0xBDCCCCCD >> 16)
glabel .L802B6248
/* E28C78 802B6248 3421CCCD */ ori $at, $at, (0xBDCCCCCD & 0xFFFF)
/* E28C7C 802B624C 44811000 */ mtc1 $at, $f2
glabel .L802B6250
/* E28C80 802B6250 00000000 */ nop
.L802B6254:
/* E28C84 802B6254 46001186 */ mov.s $f6, $f2
glabel .L802B6258
/* E28C88 802B6258 0240202D */ daddu $a0, $s2, $zero
.L802B625C:
/* E28C8C 802B625C 27A50030 */ addiu $a1, $sp, 0x30
/* E28C90 802B6260 C6420028 */ lwc1 $f2, 0x28($s2)
/* E28C94 802B6264 27A60034 */ addiu $a2, $sp, 0x34
.L802B6268:
/* E28C98 802B6268 46041080 */ add.s $f2, $f2, $f4
.L802B626C:
/* E28C9C 802B626C C6400030 */ lwc1 $f0, 0x30($s2)
/* E28CA0 802B6270 27A2003C */ addiu $v0, $sp, 0x3C
.L802B6274:
/* E28CA4 802B6274 46060001 */ sub.s $f0, $f0, $f6
glabel .L802B6278
/* E28CA8 802B6278 E6420028 */ swc1 $f2, 0x28($s2)
/* E28CAC 802B627C 46001186 */ mov.s $f6, $f2
.L802B6280:
/* E28CB0 802B6280 E6400030 */ swc1 $f0, 0x30($s2)
.L802B6284:
/* E28CB4 802B6284 46000106 */ mov.s $f4, $f0
glabel action_update_run
/* E28CB8 802B6288 C642002C */ lwc1 $f2, 0x2C($s2)
/* E28CBC 802B628C 3C0140A0 */ lui $at, (0x40A00000 >> 16)
.L802B6290:
/* E28CC0 802B6290 44810000 */ mtc1 $at, $f0
glabel func_802B6294
/* E28CC4 802B6294 27A70038 */ addiu $a3, $sp, 0x38
glabel .L802B6298
/* E28CC8 802B6298 E7A60030 */ swc1 $f6, 0x30($sp)
/* E28CCC 802B629C E7A40038 */ swc1 $f4, 0x38($sp)
/* E28CD0 802B62A0 E7A20034 */ swc1 $f2, 0x34($sp)
glabel func_802B62A4
/* E28CD4 802B62A4 E7A0003C */ swc1 $f0, 0x3C($sp)
.L802B62A8:
/* E28CD8 802B62A8 AFA20010 */ sw $v0, 0x10($sp)
/* E28CDC 802B62AC 27A20040 */ addiu $v0, $sp, 0x40
jtbl_802B62B0:
/* E28CE0 802B62B0 AFA20014 */ sw $v0, 0x14($sp)
.L802B62B4:
/* E28CE4 802B62B4 27A20044 */ addiu $v0, $sp, 0x44
glabel .L802B62B8
/* E28CE8 802B62B8 AFA20018 */ sw $v0, 0x18($sp)
/* E28CEC 802B62BC 27A20048 */ addiu $v0, $sp, 0x48
/* E28CF0 802B62C0 AFA2001C */ sw $v0, 0x1C($sp)
/* E28CF4 802B62C4 27A2004C */ addiu $v0, $sp, 0x4C
.L802B62C8:
/* E28CF8 802B62C8 0C03791B */ jal player_raycast_below_cam_relative
glabel action_update_peach_land
/* E28CFC 802B62CC AFA20020 */ sw $v0, 0x20($sp)
Munchlesia_LaunchVelocity:
/* E28D00 802B62D0 04400003 */ bltz $v0, D_802B62E0
Munchlesia_LateralVelocity:
/* E28D04 802B62D4 00000000 */ nop
Munchlesia_LaunchAccel:
/* E28D08 802B62D8 C7A00034 */ lwc1 $f0, 0x34($sp)
Munchlesia_LaunchYaw:
/* E28D0C 802B62DC E640002C */ swc1 $f0, 0x2C($s2)
D_802B62E0:
/* E28D10 802B62E0 3C028007 */ lui $v0, %hi(gGameStatusPtr)
.L802B62E4:
/* E28D14 802B62E4 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* E28D18 802B62E8 3C014270 */ lui $at, (0x42700000 >> 16)
/* E28D1C 802B62EC 4481A000 */ mtc1 $at, $f20
/* E28D20 802B62F0 84430086 */ lh $v1, 0x86($v0)
/* E28D24 802B62F4 2402000A */ addiu $v0, $zero, 0xA
glabel func_802B62F8
/* E28D28 802B62F8 14620003 */ bne $v1, $v0, .L802B6308
.L802B62FC:
/* E28D2C 802B62FC 00000000 */ nop
D_802B6300:
/* E28D30 802B6300 3C0141F0 */ lui $at, (0x41F00000 >> 16)
/* E28D34 802B6304 4481A000 */ mtc1 $at, $f20
.L802B6308:
/* E28D38 802B6308 3C018011 */ lui $at, %hi(D_8010C990)
.L802B630C:
/* E28D3C 802B630C C420C990 */ lwc1 $f0, %lo(D_8010C990)($at)
.L802B6310:
/* E28D40 802B6310 4614003C */ c.lt.s $f0, $f20
/* E28D44 802B6314 00000000 */ nop
/* E28D48 802B6318 45000005 */ bc1f .L802B6330
glabel .L802B631C
/* E28D4C 802B631C 00000000 */ nop
.L802B6320:
/* E28D50 802B6320 0C039769 */ jal set_action_state
glabel .L802B6324
/* E28D54 802B6324 24040008 */ addiu $a0, $zero, 0x8
.L802B6328:
/* E28D58 802B6328 0C038C1B */ jal gravity_use_fall_parms
glabel .L802B632C
/* E28D5C 802B632C 00000000 */ nop
.L802B6330:
/* E28D60 802B6330 8FBF005C */ lw $ra, 0x5C($sp)
/* E28D64 802B6334 8FB20058 */ lw $s2, 0x58($sp)
.L802B6338:
/* E28D68 802B6338 8FB10054 */ lw $s1, 0x54($sp)
/* E28D6C 802B633C 8FB00050 */ lw $s0, 0x50($sp)
.L802B6340:
/* E28D70 802B6340 D7B60068 */ ldc1 $f22, 0x68($sp)
/* E28D74 802B6344 D7B40060 */ ldc1 $f20, 0x60($sp)
glabel func_802B6348
/* E28D78 802B6348 03E00008 */ jr $ra
/* E28D7C 802B634C 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void action_update_state_23(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 hitDirZ;
f32 hitDirX;
f32 hitRz;
f32 hitRx;
f32 outLength;
f32 outZ;
f32 outY;
f32 outX;
f32 cosTheta;
f32 sinTheta;
f32 miscTempVariable;
f32 playerXOffset;
f32 playerZOffset;
f32 zDelta;
f32 playerOffsetTempVar;
if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~(PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_ARMS_RAISED | PS_FLAG_AIRBORNE);
playerStatus->actionSubstate = 0;
playerStatus->currentStateTime = 0;
playerStatus->timeInAir = 0;
playerStatus->peakJumpTime = 0;
playerStatus->currentSpeed = 0.0f;
playerStatus->pitch = 0.0f;
D_802B6770_E27C80 = D_8010C938;
}
switch (playerStatus->actionSubstate) {
case 0:
playerStatus->actionSubstate++;
case 1:
break;
default:
return;
}
sin_cos_rad(DEG_TO_RAD(D_8010C990), &sinTheta, &cosTheta);
miscTempVariable = 3.0f;
miscTempVariable = sinTheta * miscTempVariable;
sin_cos_rad(DEG_TO_RAD(D_802B6770_E27C80), &sinTheta, &cosTheta);
playerXOffset = sinTheta * miscTempVariable;
playerZOffset = cosTheta * miscTempVariable;
if (fabs(playerXOffset) < 0.1) {
playerOffsetTempVar = 0.1f;
if (playerXOffset < 0.0f) {
playerOffsetTempVar = -0.1f;
}
playerXOffset = playerOffsetTempVar;
}
if (fabs(playerZOffset) < 0.1) {
playerOffsetTempVar = 0.1f;
if (playerZOffset < 0.0f) {
playerOffsetTempVar = -0.1f;
}
playerZOffset = playerOffsetTempVar;
}
playerStatus->position.x += playerXOffset;
playerStatus->position.z -= playerZOffset;
outX = playerStatus->position.x;
outY = playerStatus->position.y;
outZ = playerStatus->position.z;
outLength = 5.0f;
if (player_raycast_below_cam_relative(playerStatus, &outX, &outY, &outZ, &outLength, &hitRx, &hitRz, &hitDirX, &hitDirZ) >= 0) {
playerStatus->position.y = outY;
}
if (gGameStatusPtr->areaID == AREA_SBK) {
miscTempVariable = 30.0f;
} else {
miscTempVariable = 60.0f;
}
if (D_8010C990 < miscTempVariable) {
set_action_state(ACTION_STATE_FALLING);
gravity_use_fall_parms();
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel render_effects_UI
/* 35394 80059F94 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 35398 80059F98 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 3539C 80059F9C 3C014080 */ lui $at, (0x40800000 >> 16)
/* 353A0 80059FA0 4481A000 */ mtc1 $at, $f20
/* 353A4 80059FA4 AFB10014 */ sw $s1, 0x14($sp)
/* 353A8 80059FA8 24110001 */ addiu $s1, $zero, 0x1
/* 353AC 80059FAC AFB20018 */ sw $s2, 0x18($sp)
/* 353B0 80059FB0 0000902D */ daddu $s2, $zero, $zero
/* 353B4 80059FB4 AFB50024 */ sw $s5, 0x24($sp)
/* 353B8 80059FB8 3C15800B */ lui $s5, %hi(gCameras)
/* 353BC 80059FBC 26B51D80 */ addiu $s5, $s5, %lo(gCameras)
/* 353C0 80059FC0 AFB00010 */ sw $s0, 0x10($sp)
/* 353C4 80059FC4 3C10800A */ lui $s0, %hi(gMainGfxPos)
/* 353C8 80059FC8 2610A66C */ addiu $s0, $s0, %lo(gMainGfxPos)
/* 353CC 80059FCC AFB40020 */ sw $s4, 0x20($sp)
/* 353D0 80059FD0 24140002 */ addiu $s4, $zero, 0x2
/* 353D4 80059FD4 AFB3001C */ sw $s3, 0x1C($sp)
/* 353D8 80059FD8 3413FFFE */ ori $s3, $zero, 0xFFFE
/* 353DC 80059FDC AFBF0028 */ sw $ra, 0x28($sp)
/* 353E0 80059FE0 00121080 */ sll $v0, $s2, 2
.L80059FE4:
/* 353E4 80059FE4 3C0E800B */ lui $t6, %hi(gEffectInstances)
/* 353E8 80059FE8 01C27021 */ addu $t6, $t6, $v0
/* 353EC 80059FEC 8DCE4398 */ lw $t6, %lo(gEffectInstances)($t6)
/* 353F0 80059FF0 51C000A5 */ beql $t6, $zero, .L8005A288
/* 353F4 80059FF4 26520001 */ addiu $s2, $s2, 0x1
/* 353F8 80059FF8 8DC30000 */ lw $v1, 0x0($t6)
/* 353FC 80059FFC 30620001 */ andi $v0, $v1, 0x1
/* 35400 8005A000 504000A1 */ beql $v0, $zero, .L8005A288
/* 35404 8005A004 26520001 */ addiu $s2, $s2, 0x1
/* 35408 8005A008 30620008 */ andi $v0, $v1, 0x8
/* 3540C 8005A00C 5040009E */ beql $v0, $zero, .L8005A288
/* 35410 8005A010 26520001 */ addiu $s2, $s2, 0x1
/* 35414 8005A014 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 35418 8005A018 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 3541C 8005A01C 80420070 */ lb $v0, 0x70($v0)
/* 35420 8005A020 10400005 */ beqz $v0, .L8005A038
/* 35424 8005A024 30620004 */ andi $v0, $v1, 0x4
/* 35428 8005A028 50400097 */ beql $v0, $zero, .L8005A288
/* 3542C 8005A02C 26520001 */ addiu $s2, $s2, 0x1
/* 35430 8005A030 08016810 */ j .L8005A040
/* 35434 8005A034 00000000 */ nop
.L8005A038:
/* 35438 8005A038 54400093 */ bnel $v0, $zero, .L8005A288
/* 3543C 8005A03C 26520001 */ addiu $s2, $s2, 0x1
.L8005A040:
/* 35440 8005A040 8DC20010 */ lw $v0, 0x10($t6)
/* 35444 8005A044 8C4F0018 */ lw $t7, 0x18($v0)
/* 35448 8005A048 3C028006 */ lui $v0, %hi(stub_effect_delegate)
/* 3544C 8005A04C 24429C80 */ addiu $v0, $v0, %lo(stub_effect_delegate)
/* 35450 8005A050 51E2008D */ beql $t7, $v0, .L8005A288
/* 35454 8005A054 26520001 */ addiu $s2, $s2, 0x1
/* 35458 8005A058 12200088 */ beqz $s1, .L8005A27C
/* 3545C 8005A05C 3C04DC08 */ lui $a0, (0xDC080008 >> 16)
/* 35460 8005A060 34840008 */ ori $a0, $a0, (0xDC080008 & 0xFFFF)
/* 35464 8005A064 3C06D9FF */ lui $a2, (0xD9FFFFFF >> 16)
/* 35468 8005A068 34C6FFFF */ ori $a2, $a2, (0xD9FFFFFF & 0xFFFF)
/* 3546C 8005A06C 3C050020 */ lui $a1, (0x200405 >> 16)
/* 35470 8005A070 34A50405 */ ori $a1, $a1, (0x200405 & 0xFFFF)
/* 35474 8005A074 3C07DB04 */ lui $a3, (0xDB040004 >> 16)
/* 35478 8005A078 34E70004 */ ori $a3, $a3, (0xDB040004 & 0xFFFF)
/* 3547C 8005A07C 3C08DB04 */ lui $t0, (0xDB04000C >> 16)
/* 35480 8005A080 3508000C */ ori $t0, $t0, (0xDB04000C & 0xFFFF)
/* 35484 8005A084 3C09DB04 */ lui $t1, (0xDB040014 >> 16)
/* 35488 8005A088 35290014 */ ori $t1, $t1, (0xDB040014 & 0xFFFF)
/* 3548C 8005A08C 3C0ADB04 */ lui $t2, (0xDB04001C >> 16)
/* 35490 8005A090 8E0B0000 */ lw $t3, 0x0($s0)
/* 35494 8005A094 354A001C */ ori $t2, $t2, (0xDB04001C & 0xFFFF)
/* 35498 8005A098 0160182D */ daddu $v1, $t3, $zero
/* 3549C 8005A09C 256B0008 */ addiu $t3, $t3, 0x8
/* 354A0 8005A0A0 AE0B0000 */ sw $t3, 0x0($s0)
/* 354A4 8005A0A4 3C0D8007 */ lui $t5, %hi(gCurrentCameraID)
/* 354A8 8005A0A8 8DAD7410 */ lw $t5, %lo(gCurrentCameraID)($t5)
/* 354AC 8005A0AC 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 354B0 8005A0B0 AC620000 */ sw $v0, 0x0($v1)
/* 354B4 8005A0B4 25620008 */ addiu $v0, $t3, 0x8
/* 354B8 8005A0B8 AC600004 */ sw $zero, 0x4($v1)
/* 354BC 8005A0BC AE020000 */ sw $v0, 0x0($s0)
/* 354C0 8005A0C0 AD640000 */ sw $a0, 0x0($t3)
/* 354C4 8005A0C4 3C04ED00 */ lui $a0, (0xED000000 >> 16)
/* 354C8 8005A0C8 000D1080 */ sll $v0, $t5, 2
/* 354CC 8005A0CC 004D1021 */ addu $v0, $v0, $t5
/* 354D0 8005A0D0 00021080 */ sll $v0, $v0, 2
/* 354D4 8005A0D4 004D1023 */ subu $v0, $v0, $t5
/* 354D8 8005A0D8 000218C0 */ sll $v1, $v0, 3
/* 354DC 8005A0DC 00431021 */ addu $v0, $v0, $v1
/* 354E0 8005A0E0 000210C0 */ sll $v0, $v0, 3
/* 354E4 8005A0E4 00556021 */ addu $t4, $v0, $s5
/* 354E8 8005A0E8 258200A0 */ addiu $v0, $t4, 0xA0
/* 354EC 8005A0EC AD620004 */ sw $v0, 0x4($t3)
/* 354F0 8005A0F0 25620010 */ addiu $v0, $t3, 0x10
/* 354F4 8005A0F4 AE020000 */ sw $v0, 0x0($s0)
/* 354F8 8005A0F8 3C02D900 */ lui $v0, (0xD9000000 >> 16)
/* 354FC 8005A0FC AD620008 */ sw $v0, 0x8($t3)
/* 35500 8005A100 25620018 */ addiu $v0, $t3, 0x18
/* 35504 8005A104 AD60000C */ sw $zero, 0xC($t3)
/* 35508 8005A108 AE020000 */ sw $v0, 0x0($s0)
/* 3550C 8005A10C 25620020 */ addiu $v0, $t3, 0x20
/* 35510 8005A110 AD660010 */ sw $a2, 0x10($t3)
/* 35514 8005A114 AD650014 */ sw $a1, 0x14($t3)
/* 35518 8005A118 AE020000 */ sw $v0, 0x0($s0)
/* 3551C 8005A11C 8583000E */ lh $v1, 0xE($t4)
/* 35520 8005A120 25620028 */ addiu $v0, $t3, 0x28
/* 35524 8005A124 AE020000 */ sw $v0, 0x0($s0)
/* 35528 8005A128 44831000 */ mtc1 $v1, $f2
/* 3552C 8005A12C 00000000 */ nop
/* 35530 8005A130 468010A0 */ cvt.s.w $f2, $f2
/* 35534 8005A134 46141082 */ mul.s $f2, $f2, $f20
/* 35538 8005A138 00000000 */ nop
/* 3553C 8005A13C 85830010 */ lh $v1, 0x10($t4)
/* 35540 8005A140 25620030 */ addiu $v0, $t3, 0x30
/* 35544 8005A144 AE020000 */ sw $v0, 0x0($s0)
/* 35548 8005A148 25620038 */ addiu $v0, $t3, 0x38
/* 3554C 8005A14C 44830000 */ mtc1 $v1, $f0
/* 35550 8005A150 00000000 */ nop
/* 35554 8005A154 46800020 */ cvt.s.w $f0, $f0
/* 35558 8005A158 46140002 */ mul.s $f0, $f0, $f20
/* 3555C 8005A15C 00000000 */ nop
/* 35560 8005A160 AE020000 */ sw $v0, 0x0($s0)
/* 35564 8005A164 4600110D */ trunc.w.s $f4, $f2
/* 35568 8005A168 44032000 */ mfc1 $v1, $f4
/* 3556C 8005A16C 00000000 */ nop
/* 35570 8005A170 30630FFF */ andi $v1, $v1, 0xFFF
/* 35574 8005A174 00031B00 */ sll $v1, $v1, 12
/* 35578 8005A178 4600010D */ trunc.w.s $f4, $f0
/* 3557C 8005A17C 44022000 */ mfc1 $v0, $f4
/* 35580 8005A180 00000000 */ nop
/* 35584 8005A184 30420FFF */ andi $v0, $v0, 0xFFF
/* 35588 8005A188 00441025 */ or $v0, $v0, $a0
/* 3558C 8005A18C 00621825 */ or $v1, $v1, $v0
/* 35590 8005A190 AD630018 */ sw $v1, 0x18($t3)
/* 35594 8005A194 8583000E */ lh $v1, 0xE($t4)
/* 35598 8005A198 8585000A */ lh $a1, 0xA($t4)
/* 3559C 8005A19C 85840010 */ lh $a0, 0x10($t4)
/* 355A0 8005A1A0 8586000C */ lh $a2, 0xC($t4)
/* 355A4 8005A1A4 25620040 */ addiu $v0, $t3, 0x40
/* 355A8 8005A1A8 AE020000 */ sw $v0, 0x0($s0)
/* 355AC 8005A1AC AD670020 */ sw $a3, 0x20($t3)
/* 355B0 8005A1B0 AD740024 */ sw $s4, 0x24($t3)
/* 355B4 8005A1B4 AD680028 */ sw $t0, 0x28($t3)
/* 355B8 8005A1B8 00651821 */ addu $v1, $v1, $a1
/* 355BC 8005A1BC 44831000 */ mtc1 $v1, $f2
/* 355C0 8005A1C0 00000000 */ nop
/* 355C4 8005A1C4 468010A0 */ cvt.s.w $f2, $f2
/* 355C8 8005A1C8 46141082 */ mul.s $f2, $f2, $f20
/* 355CC 8005A1CC 00000000 */ nop
/* 355D0 8005A1D0 AD74002C */ sw $s4, 0x2C($t3)
/* 355D4 8005A1D4 AD690030 */ sw $t1, 0x30($t3)
/* 355D8 8005A1D8 00862021 */ addu $a0, $a0, $a2
/* 355DC 8005A1DC 44840000 */ mtc1 $a0, $f0
/* 355E0 8005A1E0 00000000 */ nop
/* 355E4 8005A1E4 46800020 */ cvt.s.w $f0, $f0
/* 355E8 8005A1E8 46140002 */ mul.s $f0, $f0, $f20
/* 355EC 8005A1EC 00000000 */ nop
/* 355F0 8005A1F0 AD730034 */ sw $s3, 0x34($t3)
/* 355F4 8005A1F4 4600110D */ trunc.w.s $f4, $f2
/* 355F8 8005A1F8 44032000 */ mfc1 $v1, $f4
/* 355FC 8005A1FC 00000000 */ nop
/* 35600 8005A200 30630FFF */ andi $v1, $v1, 0xFFF
/* 35604 8005A204 00031B00 */ sll $v1, $v1, 12
/* 35608 8005A208 4600010D */ trunc.w.s $f4, $f0
/* 3560C 8005A20C 44022000 */ mfc1 $v0, $f4
/* 35610 8005A210 00000000 */ nop
/* 35614 8005A214 30420FFF */ andi $v0, $v0, 0xFFF
/* 35618 8005A218 00621825 */ or $v1, $v1, $v0
/* 3561C 8005A21C AD63001C */ sw $v1, 0x1C($t3)
/* 35620 8005A220 AD6A0038 */ sw $t2, 0x38($t3)
/* 35624 8005A224 AD73003C */ sw $s3, 0x3C($t3)
/* 35628 8005A228 95820000 */ lhu $v0, 0x0($t4)
/* 3562C 8005A22C 30420010 */ andi $v0, $v0, 0x10
/* 35630 8005A230 14400012 */ bnez $v0, .L8005A27C
/* 35634 8005A234 0000882D */ daddu $s1, $zero, $zero
/* 35638 8005A238 3C04DA38 */ lui $a0, (0xDA380007 >> 16)
/* 3563C 8005A23C 34840007 */ ori $a0, $a0, (0xDA380007 & 0xFFFF)
/* 35640 8005A240 25620048 */ addiu $v0, $t3, 0x48
/* 35644 8005A244 AE020000 */ sw $v0, 0x0($s0)
/* 35648 8005A248 3C02DB0E */ lui $v0, (0xDB0E0000 >> 16)
/* 3564C 8005A24C AD620040 */ sw $v0, 0x40($t3)
/* 35650 8005A250 95830038 */ lhu $v1, 0x38($t4)
/* 35654 8005A254 25620050 */ addiu $v0, $t3, 0x50
/* 35658 8005A258 AE020000 */ sw $v0, 0x0($s0)
/* 3565C 8005A25C 000D1180 */ sll $v0, $t5, 6
/* 35660 8005A260 AD630044 */ sw $v1, 0x44($t3)
/* 35664 8005A264 3C03800A */ lui $v1, %hi(gDisplayContext)
/* 35668 8005A268 8C63A674 */ lw $v1, %lo(gDisplayContext)($v1)
/* 3566C 8005A26C 24420030 */ addiu $v0, $v0, 0x30
/* 35670 8005A270 AD640048 */ sw $a0, 0x48($t3)
/* 35674 8005A274 00621821 */ addu $v1, $v1, $v0
/* 35678 8005A278 AD63004C */ sw $v1, 0x4C($t3)
.L8005A27C:
/* 3567C 8005A27C 01E0F809 */ jalr $t7
/* 35680 8005A280 01C0202D */ daddu $a0, $t6, $zero
/* 35684 8005A284 26520001 */ addiu $s2, $s2, 0x1
.L8005A288:
/* 35688 8005A288 2A420060 */ slti $v0, $s2, 0x60
/* 3568C 8005A28C 5440FF55 */ bnel $v0, $zero, .L80059FE4
/* 35690 8005A290 00121080 */ sll $v0, $s2, 2
/* 35694 8005A294 8FBF0028 */ lw $ra, 0x28($sp)
/* 35698 8005A298 8FB50024 */ lw $s5, 0x24($sp)
/* 3569C 8005A29C 8FB40020 */ lw $s4, 0x20($sp)
/* 356A0 8005A2A0 8FB3001C */ lw $s3, 0x1C($sp)
/* 356A4 8005A2A4 8FB20018 */ lw $s2, 0x18($sp)
/* 356A8 8005A2A8 8FB10014 */ lw $s1, 0x14($sp)
/* 356AC 8005A2AC 8FB00010 */ lw $s0, 0x10($sp)
/* 356B0 8005A2B0 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 356B4 8005A2B4 03E00008 */ jr $ra
/* 356B8 8005A2B8 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void render_effects_UI(void) {
s32 cond = TRUE;
s32 i;
for (i = 0; i < ARRAY_COUNT(gEffectInstances); i++) {
EffectInstance* effectInstance = gEffectInstances[i];
if (effectInstance != NULL) {
if (effectInstance->flags & FX_INSTANCE_FLAG_ENABLED) {
if (effectInstance->flags & FX_INSTANCE_FLAG_HAS_UPDATED) {
void (*renderUI)(EffectInstance* effect);
if (gGameStatusPtr->isBattle && !(effectInstance->flags & FX_INSTANCE_FLAG_BATTLE)) {
continue;
}
if (!gGameStatusPtr->isBattle && effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) {
continue;
}
renderUI = effectInstance->graphics->renderUI;
if (renderUI != stub_effect_delegate) {
if (cond) {
Camera* camera = &gCameras[gCurrentCameraID];
gDPPipeSync(gMainGfxPos++);
gSPViewport(gMainGfxPos++, &camera->vp);
gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG |
G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD |
G_SHADING_SMOOTH | G_CLIPPING | 0x40F9FA);
gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH);
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE,
camera->viewportStartX,
camera->viewportStartY,
camera->viewportStartX + camera->viewportW,
camera->viewportStartY + camera->viewportH);
gSPClipRatio(gMainGfxPos++, FRUSTRATIO_2);
cond = FALSE;
if (!(camera->flags & CAMERA_FLAG_ORTHO)) {
gSPPerspNormalize(gMainGfxPos++, camera->perspNorm);
gSPMatrix(gMainGfxPos++, &gDisplayContext->camPerspMatrix[gCurrentCameraID],
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
}
}
renderUI(effectInstance);
}
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel rising_bubble_appendGfx
/* 3561A0 E00462C0 27BDFF48 */ addiu $sp, $sp, -0xB8
/* 3561A4 E00462C4 3C05DB06 */ lui $a1, (0xDB060024 >> 16)
/* 3561A8 E00462C8 3C09800A */ lui $t1, %hi(gMainGfxPos)
/* 3561AC E00462CC 2529A66C */ addiu $t1, $t1, %lo(gMainGfxPos)
/* 3561B0 E00462D0 34A50024 */ ori $a1, $a1, (0xDB060024 & 0xFFFF)
/* 3561B4 E00462D4 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3561B8 E00462D8 AFBF00B4 */ sw $ra, 0xB4($sp)
/* 3561BC E00462DC AFB400B0 */ sw $s4, 0xB0($sp)
/* 3561C0 E00462E0 AFB300AC */ sw $s3, 0xAC($sp)
/* 3561C4 E00462E4 AFB200A8 */ sw $s2, 0xA8($sp)
/* 3561C8 E00462E8 AFB100A4 */ sw $s1, 0xA4($sp)
/* 3561CC E00462EC AFB000A0 */ sw $s0, 0xA0($sp)
/* 3561D0 E00462F0 8D280000 */ lw $t0, 0x0($t1)
/* 3561D4 E00462F4 8C93000C */ lw $s3, 0xC($a0)
/* 3561D8 E00462F8 0100182D */ daddu $v1, $t0, $zero
/* 3561DC E00462FC 8E74001C */ lw $s4, 0x1C($s3)
/* 3561E0 E0046300 25080008 */ addiu $t0, $t0, 0x8
/* 3561E4 E0046304 AC620000 */ sw $v0, 0x0($v1)
/* 3561E8 E0046308 AC600004 */ sw $zero, 0x4($v1)
/* 3561EC E004630C AD050000 */ sw $a1, 0x0($t0)
/* 3561F0 E0046310 8C820010 */ lw $v0, 0x10($a0)
/* 3561F4 E0046314 AD280000 */ sw $t0, 0x0($t1)
/* 3561F8 E0046318 8C42001C */ lw $v0, 0x1C($v0)
/* 3561FC E004631C 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 356200 E0046320 00431021 */ addu $v0, $v0, $v1
/* 356204 E0046324 AD020004 */ sw $v0, 0x4($t0)
/* 356208 E0046328 C6620008 */ lwc1 $f2, 0x8($s3)
/* 35620C E004632C C6600024 */ lwc1 $f0, 0x24($s3)
/* 356210 E0046330 25020008 */ addiu $v0, $t0, 0x8
/* 356214 E0046334 4602003E */ c.le.s $f0, $f2
/* 356218 E0046338 00000000 */ nop
/* 35621C E004633C 45000032 */ bc1f .LE0046408
/* 356220 E0046340 AD220000 */ sw $v0, 0x0($t1)
/* 356224 E0046344 3C047F7F */ lui $a0, (0x7F7F7F00 >> 16)
/* 356228 E0046348 25020010 */ addiu $v0, $t0, 0x10
/* 35622C E004634C AD220000 */ sw $v0, 0x0($t1)
/* 356230 E0046350 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 356234 E0046354 AD020008 */ sw $v0, 0x8($t0)
/* 356238 E0046358 25020018 */ addiu $v0, $t0, 0x18
/* 35623C E004635C AD220000 */ sw $v0, 0x0($t1)
/* 356240 E0046360 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 356244 E0046364 3C03E004 */ lui $v1, (0xE0046614 >> 16)
/* 356248 E0046368 8C636614 */ lw $v1, (0xE0046614 & 0xFFFF)($v1)
/* 35624C E004636C 34847F00 */ ori $a0, $a0, (0x7F7F7F00 & 0xFFFF)
/* 356250 E0046370 AD020010 */ sw $v0, 0x10($t0)
/* 356254 E0046374 AD03000C */ sw $v1, 0xC($t0)
/* 356258 E0046378 92620017 */ lbu $v0, 0x17($s3)
/* 35625C E004637C 3C05F200 */ lui $a1, (0xF2000000 >> 16)
/* 356260 E0046380 00441025 */ or $v0, $v0, $a0
/* 356264 E0046384 AD020014 */ sw $v0, 0x14($t0)
/* 356268 E0046388 8E630020 */ lw $v1, 0x20($s3)
/* 35626C E004638C 27A40020 */ addiu $a0, $sp, 0x20
/* 356270 E0046390 00031080 */ sll $v0, $v1, 2
/* 356274 E0046394 30420FFF */ andi $v0, $v0, 0xFFF
/* 356278 E0046398 00451025 */ or $v0, $v0, $a1
/* 35627C E004639C 3C050008 */ lui $a1, (0x80000 >> 16)
/* 356280 E00463A0 24630020 */ addiu $v1, $v1, 0x20
/* 356284 E00463A4 00031880 */ sll $v1, $v1, 2
/* 356288 E00463A8 30630FFF */ andi $v1, $v1, 0xFFF
/* 35628C E00463AC AD020018 */ sw $v0, 0x18($t0)
/* 356290 E00463B0 3C020100 */ lui $v0, (0x1000000 >> 16)
/* 356294 E00463B4 00621825 */ or $v1, $v1, $v0
/* 356298 E00463B8 00651825 */ or $v1, $v1, $a1
/* 35629C E00463BC AD03001C */ sw $v1, 0x1C($t0)
/* 3562A0 E00463C0 8E650004 */ lw $a1, 0x4($s3)
/* 3562A4 E00463C4 8E660008 */ lw $a2, 0x8($s3)
/* 3562A8 E00463C8 8E67000C */ lw $a3, 0xC($s3)
/* 3562AC E00463CC 25020020 */ addiu $v0, $t0, 0x20
/* 3562B0 E00463D0 0C080108 */ jal shim_guTranslateF
/* 3562B4 E00463D4 AD220000 */ sw $v0, 0x0($t1)
/* 3562B8 E00463D8 27B00060 */ addiu $s0, $sp, 0x60
/* 3562BC E00463DC 0200202D */ daddu $a0, $s0, $zero
/* 3562C0 E00463E0 8E650010 */ lw $a1, 0x10($s3)
/* 3562C4 E00463E4 3C063F80 */ lui $a2, (0x3F800000 >> 16)
/* 3562C8 E00463E8 0C080110 */ jal shim_guScaleF
/* 3562CC E00463EC 00A0382D */ daddu $a3, $a1, $zero
/* 3562D0 E00463F0 0200202D */ daddu $a0, $s0, $zero
/* 3562D4 E00463F4 27A50020 */ addiu $a1, $sp, 0x20
/* 3562D8 E00463F8 0C080114 */ jal shim_guMtxCatF
/* 3562DC E00463FC 00A0302D */ daddu $a2, $a1, $zero
/* 3562E0 E0046400 08011936 */ j .LE00464D8
/* 3562E4 E0046404 3C120001 */ lui $s2, (0x11630 >> 16)
.LE0046408:
/* 3562E8 E0046408 3C048080 */ lui $a0, (0x8080FF00 >> 16)
/* 3562EC E004640C 3484FF00 */ ori $a0, $a0, (0x8080FF00 & 0xFFFF)
/* 3562F0 E0046410 44800000 */ mtc1 $zero, $f0
/* 3562F4 E0046414 25020010 */ addiu $v0, $t0, 0x10
/* 3562F8 E0046418 AD220000 */ sw $v0, 0x0($t1)
/* 3562FC E004641C 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 356300 E0046420 AD020008 */ sw $v0, 0x8($t0)
/* 356304 E0046424 25020018 */ addiu $v0, $t0, 0x18
/* 356308 E0046428 AD220000 */ sw $v0, 0x0($t1)
/* 35630C E004642C 3C03E004 */ lui $v1, (0xE0046618 >> 16)
/* 356310 E0046430 8C636618 */ lw $v1, (0xE0046618 & 0xFFFF)($v1)
/* 356314 E0046434 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 356318 E0046438 AD020010 */ sw $v0, 0x10($t0)
/* 35631C E004643C AD03000C */ sw $v1, 0xC($t0)
/* 356320 E0046440 92630017 */ lbu $v1, 0x17($s3)
/* 356324 E0046444 25020020 */ addiu $v0, $t0, 0x20
/* 356328 E0046448 AD220000 */ sw $v0, 0x0($t1)
/* 35632C E004644C 3C02FB00 */ lui $v0, (0xFB000000 >> 16)
/* 356330 E0046450 AD020018 */ sw $v0, 0x18($t0)
/* 356334 E0046454 2402FF00 */ addiu $v0, $zero, -0x100
/* 356338 E0046458 44050000 */ mfc1 $a1, $f0
/* 35633C E004645C 00621825 */ or $v1, $v1, $v0
/* 356340 E0046460 AD030014 */ sw $v1, 0x14($t0)
/* 356344 E0046464 92620017 */ lbu $v0, 0x17($s3)
/* 356348 E0046468 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 35634C E004646C 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 356350 E0046470 00441025 */ or $v0, $v0, $a0
/* 356354 E0046474 AD02001C */ sw $v0, 0x1C($t0)
/* 356358 E0046478 00031080 */ sll $v0, $v1, 2
/* 35635C E004647C 00431021 */ addu $v0, $v0, $v1
/* 356360 E0046480 00021080 */ sll $v0, $v0, 2
/* 356364 E0046484 00431023 */ subu $v0, $v0, $v1
/* 356368 E0046488 000218C0 */ sll $v1, $v0, 3
/* 35636C E004648C 00431021 */ addu $v0, $v0, $v1
/* 356370 E0046490 000210C0 */ sll $v0, $v0, 3
/* 356374 E0046494 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 356378 E0046498 00220821 */ addu $at, $at, $v0
/* 35637C E004649C C4221DEC */ lwc1 $f2, %lo(gCameras + 0x6C)($at)
/* 356380 E00464A0 C6600010 */ lwc1 $f0, 0x10($s3)
/* 356384 E00464A4 46001087 */ neg.s $f2, $f2
/* 356388 E00464A8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 35638C E00464AC C6600004 */ lwc1 $f0, 0x4($s3)
/* 356390 E00464B0 44061000 */ mfc1 $a2, $f2
/* 356394 E00464B4 E7A00014 */ swc1 $f0, 0x14($sp)
/* 356398 E00464B8 C6600008 */ lwc1 $f0, 0x8($s3)
/* 35639C E00464BC 00A0382D */ daddu $a3, $a1, $zero
/* 3563A0 E00464C0 E7A00018 */ swc1 $f0, 0x18($sp)
/* 3563A4 E00464C4 C660000C */ lwc1 $f0, 0xC($s3)
/* 3563A8 E00464C8 27A40020 */ addiu $a0, $sp, 0x20
/* 3563AC E00464CC 0C080180 */ jal shim_guPositionF
/* 3563B0 E00464D0 E7A0001C */ swc1 $f0, 0x1C($sp)
/* 3563B4 E00464D4 3C120001 */ lui $s2, (0x11630 >> 16)
.LE00464D8:
/* 3563B8 E00464D8 36521630 */ ori $s2, $s2, (0x11630 & 0xFFFF)
/* 3563BC E00464DC 27A40020 */ addiu $a0, $sp, 0x20
/* 3563C0 E00464E0 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 3563C4 E00464E4 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 3563C8 E00464E8 3C11800A */ lui $s1, %hi(gDisplayContext)
/* 3563CC E00464EC 2631A674 */ addiu $s1, $s1, %lo(gDisplayContext)
/* 3563D0 E00464F0 96050000 */ lhu $a1, 0x0($s0)
/* 3563D4 E00464F4 8E220000 */ lw $v0, 0x0($s1)
/* 3563D8 E00464F8 00052980 */ sll $a1, $a1, 6
/* 3563DC E00464FC 00B22821 */ addu $a1, $a1, $s2
/* 3563E0 E0046500 0C080118 */ jal shim_guMtxF2L
/* 3563E4 E0046504 00452821 */ addu $a1, $v0, $a1
/* 3563E8 E0046508 3C07800A */ lui $a3, %hi(gMainGfxPos)
/* 3563EC E004650C 24E7A66C */ addiu $a3, $a3, %lo(gMainGfxPos)
/* 3563F0 E0046510 8CE60000 */ lw $a2, 0x0($a3)
/* 3563F4 E0046514 00C0282D */ daddu $a1, $a2, $zero
/* 3563F8 E0046518 24C60008 */ addiu $a2, $a2, 0x8
/* 3563FC E004651C ACE60000 */ sw $a2, 0x0($a3)
/* 356400 E0046520 96040000 */ lhu $a0, 0x0($s0)
/* 356404 E0046524 3C02DA38 */ lui $v0, (0xDA380000 >> 16)
/* 356408 E0046528 ACA20000 */ sw $v0, 0x0($a1)
/* 35640C E004652C 8E230000 */ lw $v1, 0x0($s1)
/* 356410 E0046530 3082FFFF */ andi $v0, $a0, 0xFFFF
/* 356414 E0046534 00021180 */ sll $v0, $v0, 6
/* 356418 E0046538 00521021 */ addu $v0, $v0, $s2
/* 35641C E004653C 00621821 */ addu $v1, $v1, $v0
/* 356420 E0046540 ACA30004 */ sw $v1, 0x4($a1)
/* 356424 E0046544 C6620008 */ lwc1 $f2, 0x8($s3)
/* 356428 E0046548 C6600024 */ lwc1 $f0, 0x24($s3)
/* 35642C E004654C 24840001 */ addiu $a0, $a0, 0x1
/* 356430 E0046550 4602003E */ c.le.s $f0, $f2
/* 356434 E0046554 00000000 */ nop
/* 356438 E0046558 45000007 */ bc1f .LE0046578
/* 35643C E004655C A6040000 */ sh $a0, 0x0($s0)
/* 356440 E0046560 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 356444 E0046564 ACC20000 */ sw $v0, 0x0($a2)
/* 356448 E0046568 3C03E004 */ lui $v1, (0xE0046600 >> 16)
/* 35644C E004656C 8C636600 */ lw $v1, (0xE0046600 & 0xFFFF)($v1)
/* 356450 E0046570 08011966 */ j .LE0046598
/* 356454 E0046574 24C20008 */ addiu $v0, $a2, 0x8
.LE0046578:
/* 356458 E0046578 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 35645C E004657C ACC20000 */ sw $v0, 0x0($a2)
/* 356460 E0046580 00141040 */ sll $v0, $s4, 1
/* 356464 E0046584 3042000C */ andi $v0, $v0, 0xC
/* 356468 E0046588 3C03E004 */ lui $v1, (0xE0046604 >> 16)
/* 35646C E004658C 00621821 */ addu $v1, $v1, $v0
/* 356470 E0046590 8C636604 */ lw $v1, (0xE0046604 & 0xFFFF)($v1)
/* 356474 E0046594 24C20008 */ addiu $v0, $a2, 0x8
.LE0046598:
/* 356478 E0046598 ACE20000 */ sw $v0, 0x0($a3)
/* 35647C E004659C ACC30004 */ sw $v1, 0x4($a2)
/* 356480 E00465A0 3C03D838 */ lui $v1, (0xD8380002 >> 16)
/* 356484 E00465A4 3C04800A */ lui $a0, %hi(gMainGfxPos)
/* 356488 E00465A8 2484A66C */ addiu $a0, $a0, %lo(gMainGfxPos)
/* 35648C E00465AC 8C820000 */ lw $v0, 0x0($a0)
/* 356490 E00465B0 34630002 */ ori $v1, $v1, (0xD8380002 & 0xFFFF)
/* 356494 E00465B4 0040282D */ daddu $a1, $v0, $zero
/* 356498 E00465B8 24420008 */ addiu $v0, $v0, 0x8
/* 35649C E00465BC AC820000 */ sw $v0, 0x0($a0)
/* 3564A0 E00465C0 ACA30000 */ sw $v1, 0x0($a1)
/* 3564A4 E00465C4 24030040 */ addiu $v1, $zero, 0x40
/* 3564A8 E00465C8 ACA30004 */ sw $v1, 0x4($a1)
/* 3564AC E00465CC 24430008 */ addiu $v1, $v0, 0x8
/* 3564B0 E00465D0 AC830000 */ sw $v1, 0x0($a0)
/* 3564B4 E00465D4 3C03E700 */ lui $v1, (0xE7000000 >> 16)
/* 3564B8 E00465D8 AC430000 */ sw $v1, 0x0($v0)
/* 3564BC E00465DC AC400004 */ sw $zero, 0x4($v0)
/* 3564C0 E00465E0 8FBF00B4 */ lw $ra, 0xB4($sp)
/* 3564C4 E00465E4 8FB400B0 */ lw $s4, 0xB0($sp)
/* 3564C8 E00465E8 8FB300AC */ lw $s3, 0xAC($sp)
/* 3564CC E00465EC 8FB200A8 */ lw $s2, 0xA8($sp)
/* 3564D0 E00465F0 8FB100A4 */ lw $s1, 0xA4($sp)
/* 3564D4 E00465F4 8FB000A0 */ lw $s0, 0xA0($sp)
/* 3564D8 E00465F8 03E00008 */ jr $ra
/* 3564DC E00465FC 27BD00B8 */ addiu $sp, $sp, 0xB8
### DECOMPILED C INSTRUCTIONS:
void rising_bubble_appendGfx(void* effect) {
RisingBubbleFXData* data = ((EffectInstance*)effect)->data.risingBubble;
s32 lifeTime = data->lifeTime;
Matrix4f sp20;
Matrix4f sp60;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
if (data->pos.y >= data->unk_24) {
s32 uls;
s32 ult;
gSPDisplayList(gMainGfxPos++, D_E0046614[0]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 127, 127, 127, data->unk_14);
uls = 0;
ult = data->unk_20;
gDPSetTileSize(gMainGfxPos++, 1,
(uls ) * 4, (ult ) * 4,
(uls + 32) * 4, (ult + 32) * 4);
shim_guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp60, data->unk_10, 1.0f, data->unk_10);
shim_guMtxCatF(sp60, sp20, sp20);
} else {
gSPDisplayList(gMainGfxPos++, D_E0046618[0]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->unk_14);
gDPSetEnvColor(gMainGfxPos++, 128, 128, 255, data->unk_14);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z);
}
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (data->pos.y >= data->unk_24) {
gSPDisplayList(gMainGfxPos++, D_E0046600[0]);
} else {
gSPDisplayList(gMainGfxPos++, D_E0046604[(lifeTime >> 1) & 3]);
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel UpdatePushBlockMotion
/* 7E375C 802828DC 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 7E3760 802828E0 AFB20018 */ sw $s2, 0x18($sp)
/* 7E3764 802828E4 0080902D */ daddu $s2, $a0, $zero
/* 7E3768 802828E8 AFBF0020 */ sw $ra, 0x20($sp)
/* 7E376C 802828EC AFB3001C */ sw $s3, 0x1C($sp)
/* 7E3770 802828F0 AFB10014 */ sw $s1, 0x14($sp)
/* 7E3774 802828F4 AFB00010 */ sw $s0, 0x10($sp)
/* 7E3778 802828F8 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 7E377C 802828FC F7B60030 */ sdc1 $f22, 0x30($sp)
/* 7E3780 80282900 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 7E3784 80282904 8E4400B0 */ lw $a0, 0xB0($s2)
/* 7E3788 80282908 0C04417A */ jal get_entity_by_index
/* 7E378C 8028290C 00A0802D */ daddu $s0, $a1, $zero
/* 7E3790 80282910 3C138011 */ lui $s3, %hi(gPlayerStatus)
/* 7E3794 80282914 2673EFC8 */ addiu $s3, $s3, %lo(gPlayerStatus)
/* 7E3798 80282918 1200001A */ beqz $s0, .L80282984
/* 7E379C 8028291C 0040882D */ daddu $s1, $v0, $zero
/* 7E37A0 80282920 AE400070 */ sw $zero, 0x70($s2)
/* 7E37A4 80282924 C6600028 */ lwc1 $f0, 0x28($s3)
/* 7E37A8 80282928 4600018D */ trunc.w.s $f6, $f0
/* 7E37AC 8028292C E6460084 */ swc1 $f6, 0x84($s2)
/* 7E37B0 80282930 C660002C */ lwc1 $f0, 0x2C($s3)
/* 7E37B4 80282934 4600018D */ trunc.w.s $f6, $f0
/* 7E37B8 80282938 E6460088 */ swc1 $f6, 0x88($s2)
/* 7E37BC 8028293C C6600030 */ lwc1 $f0, 0x30($s3)
/* 7E37C0 80282940 4600018D */ trunc.w.s $f6, $f0
/* 7E37C4 80282944 E646008C */ swc1 $f6, 0x8C($s2)
/* 7E37C8 80282948 C6200048 */ lwc1 $f0, 0x48($s1)
/* 7E37CC 8028294C 4600018D */ trunc.w.s $f6, $f0
/* 7E37D0 80282950 E6460090 */ swc1 $f6, 0x90($s2)
/* 7E37D4 80282954 C620004C */ lwc1 $f0, 0x4C($s1)
/* 7E37D8 80282958 4600018D */ trunc.w.s $f6, $f0
/* 7E37DC 8028295C E6460094 */ swc1 $f6, 0x94($s2)
/* 7E37E0 80282960 C6200050 */ lwc1 $f0, 0x50($s1)
/* 7E37E4 80282964 4600018D */ trunc.w.s $f6, $f0
/* 7E37E8 80282968 E6460098 */ swc1 $f6, 0x98($s2)
/* 7E37EC 8028296C C6200060 */ lwc1 $f0, 0x60($s1)
/* 7E37F0 80282970 4600018D */ trunc.w.s $f6, $f0
/* 7E37F4 80282974 E64600A8 */ swc1 $f6, 0xA8($s2)
/* 7E37F8 80282978 C6200068 */ lwc1 $f0, 0x68($s1)
/* 7E37FC 8028297C 4600018D */ trunc.w.s $f6, $f0
/* 7E3800 80282980 E64600B4 */ swc1 $f6, 0xB4($s2)
.L80282984:
/* 7E3804 80282984 8E420070 */ lw $v0, 0x70($s2)
/* 7E3808 80282988 00021080 */ sll $v0, $v0, 2
/* 7E380C 8028298C 3C018028 */ lui $at, %hi(D_80285640)
/* 7E3810 80282990 00220821 */ addu $at, $at, $v0
/* 7E3814 80282994 C4245640 */ lwc1 $f4, %lo(D_80285640)($at)
/* 7E3818 80282998 C642009C */ lwc1 $f2, 0x9C($s2)
/* 7E381C 8028299C 468010A0 */ cvt.s.w $f2, $f2
/* 7E3820 802829A0 46041082 */ mul.s $f2, $f2, $f4
/* 7E3824 802829A4 00000000 */ nop
/* 7E3828 802829A8 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 7E382C 802829AC 4481C000 */ mtc1 $at, $f24
/* 7E3830 802829B0 00000000 */ nop
/* 7E3834 802829B4 46181082 */ mul.s $f2, $f2, $f24
/* 7E3838 802829B8 00000000 */ nop
/* 7E383C 802829BC C6400084 */ lwc1 $f0, 0x84($s2)
/* 7E3840 802829C0 46800020 */ cvt.s.w $f0, $f0
/* 7E3844 802829C4 46020000 */ add.s $f0, $f0, $f2
/* 7E3848 802829C8 E6600028 */ swc1 $f0, 0x28($s3)
/* 7E384C 802829CC C64200A0 */ lwc1 $f2, 0xA0($s2)
/* 7E3850 802829D0 468010A0 */ cvt.s.w $f2, $f2
/* 7E3854 802829D4 46041082 */ mul.s $f2, $f2, $f4
/* 7E3858 802829D8 00000000 */ nop
/* 7E385C 802829DC 46181082 */ mul.s $f2, $f2, $f24
/* 7E3860 802829E0 00000000 */ nop
/* 7E3864 802829E4 C6400088 */ lwc1 $f0, 0x88($s2)
/* 7E3868 802829E8 46800020 */ cvt.s.w $f0, $f0
/* 7E386C 802829EC 46020000 */ add.s $f0, $f0, $f2
/* 7E3870 802829F0 E660002C */ swc1 $f0, 0x2C($s3)
/* 7E3874 802829F4 C64200A4 */ lwc1 $f2, 0xA4($s2)
/* 7E3878 802829F8 468010A0 */ cvt.s.w $f2, $f2
/* 7E387C 802829FC 46041082 */ mul.s $f2, $f2, $f4
/* 7E3880 80282A00 00000000 */ nop
/* 7E3884 80282A04 46181082 */ mul.s $f2, $f2, $f24
/* 7E3888 80282A08 00000000 */ nop
/* 7E388C 80282A0C C640008C */ lwc1 $f0, 0x8C($s2)
/* 7E3890 80282A10 46800020 */ cvt.s.w $f0, $f0
/* 7E3894 80282A14 46020000 */ add.s $f0, $f0, $f2
/* 7E3898 80282A18 E6600030 */ swc1 $f0, 0x30($s3)
/* 7E389C 80282A1C C642009C */ lwc1 $f2, 0x9C($s2)
/* 7E38A0 80282A20 468010A0 */ cvt.s.w $f2, $f2
/* 7E38A4 80282A24 46041082 */ mul.s $f2, $f2, $f4
/* 7E38A8 80282A28 00000000 */ nop
/* 7E38AC 80282A2C 46181082 */ mul.s $f2, $f2, $f24
/* 7E38B0 80282A30 00000000 */ nop
/* 7E38B4 80282A34 C6400090 */ lwc1 $f0, 0x90($s2)
/* 7E38B8 80282A38 46800020 */ cvt.s.w $f0, $f0
/* 7E38BC 80282A3C 46020000 */ add.s $f0, $f0, $f2
/* 7E38C0 80282A40 E6200048 */ swc1 $f0, 0x48($s1)
/* 7E38C4 80282A44 C64200A0 */ lwc1 $f2, 0xA0($s2)
/* 7E38C8 80282A48 468010A0 */ cvt.s.w $f2, $f2
/* 7E38CC 80282A4C 46041082 */ mul.s $f2, $f2, $f4
/* 7E38D0 80282A50 00000000 */ nop
/* 7E38D4 80282A54 46181082 */ mul.s $f2, $f2, $f24
/* 7E38D8 80282A58 00000000 */ nop
/* 7E38DC 80282A5C C6400094 */ lwc1 $f0, 0x94($s2)
/* 7E38E0 80282A60 46800020 */ cvt.s.w $f0, $f0
/* 7E38E4 80282A64 46020000 */ add.s $f0, $f0, $f2
/* 7E38E8 80282A68 E620004C */ swc1 $f0, 0x4C($s1)
/* 7E38EC 80282A6C C64200A4 */ lwc1 $f2, 0xA4($s2)
/* 7E38F0 80282A70 468010A0 */ cvt.s.w $f2, $f2
/* 7E38F4 80282A74 46041082 */ mul.s $f2, $f2, $f4
/* 7E38F8 80282A78 00000000 */ nop
/* 7E38FC 80282A7C 46181082 */ mul.s $f2, $f2, $f24
/* 7E3900 80282A80 00000000 */ nop
/* 7E3904 80282A84 C6400098 */ lwc1 $f0, 0x98($s2)
/* 7E3908 80282A88 46800020 */ cvt.s.w $f0, $f0
/* 7E390C 80282A8C 46020000 */ add.s $f0, $f0, $f2
/* 7E3910 80282A90 E6200050 */ swc1 $f0, 0x50($s1)
/* 7E3914 80282A94 8E420070 */ lw $v0, 0x70($s2)
/* 7E3918 80282A98 2842000C */ slti $v0, $v0, 0xC
/* 7E391C 80282A9C 1040004D */ beqz $v0, .L80282BD4
/* 7E3920 80282AA0 00000000 */ nop
/* 7E3924 80282AA4 C642009C */ lwc1 $f2, 0x9C($s2)
/* 7E3928 80282AA8 468010A0 */ cvt.s.w $f2, $f2
/* 7E392C 80282AAC 46041082 */ mul.s $f2, $f2, $f4
/* 7E3930 80282AB0 00000000 */ nop
/* 7E3934 80282AB4 3C01C2B4 */ lui $at, (0xC2B40000 >> 16)
/* 7E3938 80282AB8 44810000 */ mtc1 $at, $f0
/* 7E393C 80282ABC 00000000 */ nop
/* 7E3940 80282AC0 46001082 */ mul.s $f2, $f2, $f0
/* 7E3944 80282AC4 00000000 */ nop
/* 7E3948 80282AC8 C64000B4 */ lwc1 $f0, 0xB4($s2)
/* 7E394C 80282ACC 46800020 */ cvt.s.w $f0, $f0
/* 7E3950 80282AD0 46020000 */ add.s $f0, $f0, $f2
/* 7E3954 80282AD4 E6200068 */ swc1 $f0, 0x68($s1)
/* 7E3958 80282AD8 C64200A4 */ lwc1 $f2, 0xA4($s2)
/* 7E395C 80282ADC 468010A0 */ cvt.s.w $f2, $f2
/* 7E3960 80282AE0 46041082 */ mul.s $f2, $f2, $f4
/* 7E3964 80282AE4 00000000 */ nop
/* 7E3968 80282AE8 3C0142B4 */ lui $at, (0x42B40000 >> 16)
/* 7E396C 80282AEC 4481B000 */ mtc1 $at, $f22
/* 7E3970 80282AF0 00000000 */ nop
/* 7E3974 80282AF4 46161082 */ mul.s $f2, $f2, $f22
/* 7E3978 80282AF8 00000000 */ nop
/* 7E397C 80282AFC 46162582 */ mul.s $f22, $f4, $f22
/* 7E3980 80282B00 00000000 */ nop
/* 7E3984 80282B04 C64000A8 */ lwc1 $f0, 0xA8($s2)
/* 7E3988 80282B08 46800020 */ cvt.s.w $f0, $f0
/* 7E398C 80282B0C 46020000 */ add.s $f0, $f0, $f2
/* 7E3990 80282B10 4600B306 */ mov.s $f12, $f22
/* 7E3994 80282B14 0C00A8BB */ jal sin_deg
/* 7E3998 80282B18 E6200060 */ swc1 $f0, 0x60($s1)
/* 7E399C 80282B1C 46180002 */ mul.s $f0, $f0, $f24
/* 7E39A0 80282B20 00000000 */ nop
/* 7E39A4 80282B24 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 7E39A8 80282B28 4481A800 */ mtc1 $at, $f21
/* 7E39AC 80282B2C 4480A000 */ mtc1 $zero, $f20
/* 7E39B0 80282B30 46000021 */ cvt.d.s $f0, $f0
/* 7E39B4 80282B34 46340002 */ mul.d $f0, $f0, $f20
/* 7E39B8 80282B38 00000000 */ nop
/* 7E39BC 80282B3C C622004C */ lwc1 $f2, 0x4C($s1)
/* 7E39C0 80282B40 460010A1 */ cvt.d.s $f2, $f2
/* 7E39C4 80282B44 46201080 */ add.d $f2, $f2, $f0
/* 7E39C8 80282B48 4600B306 */ mov.s $f12, $f22
/* 7E39CC 80282B4C 462010A0 */ cvt.s.d $f2, $f2
/* 7E39D0 80282B50 0C00A8BB */ jal sin_deg
/* 7E39D4 80282B54 E622004C */ swc1 $f2, 0x4C($s1)
/* 7E39D8 80282B58 C642009C */ lwc1 $f2, 0x9C($s2)
/* 7E39DC 80282B5C 468010A0 */ cvt.s.w $f2, $f2
/* 7E39E0 80282B60 46001082 */ mul.s $f2, $f2, $f0
/* 7E39E4 80282B64 00000000 */ nop
/* 7E39E8 80282B68 46181082 */ mul.s $f2, $f2, $f24
/* 7E39EC 80282B6C 00000000 */ nop
/* 7E39F0 80282B70 460010A1 */ cvt.d.s $f2, $f2
/* 7E39F4 80282B74 46341082 */ mul.d $f2, $f2, $f20
/* 7E39F8 80282B78 00000000 */ nop
/* 7E39FC 80282B7C C6200048 */ lwc1 $f0, 0x48($s1)
/* 7E3A00 80282B80 46000021 */ cvt.d.s $f0, $f0
/* 7E3A04 80282B84 46220001 */ sub.d $f0, $f0, $f2
/* 7E3A08 80282B88 4600B306 */ mov.s $f12, $f22
/* 7E3A0C 80282B8C 46200020 */ cvt.s.d $f0, $f0
/* 7E3A10 80282B90 0C00A8BB */ jal sin_deg
/* 7E3A14 80282B94 E6200048 */ swc1 $f0, 0x48($s1)
bActorTattles:
/* 7E3A18 80282B98 C64200A4 */ lwc1 $f2, 0xA4($s2)
/* 7E3A1C 80282B9C 468010A0 */ cvt.s.w $f2, $f2
/* 7E3A20 80282BA0 46001082 */ mul.s $f2, $f2, $f0
/* 7E3A24 80282BA4 00000000 */ nop
/* 7E3A28 80282BA8 46181082 */ mul.s $f2, $f2, $f24
/* 7E3A2C 80282BAC 00000000 */ nop
/* 7E3A30 80282BB0 460010A1 */ cvt.d.s $f2, $f2
/* 7E3A34 80282BB4 46341082 */ mul.d $f2, $f2, $f20
/* 7E3A38 80282BB8 00000000 */ nop
/* 7E3A3C 80282BBC C6200050 */ lwc1 $f0, 0x50($s1)
/* 7E3A40 80282BC0 46000021 */ cvt.d.s $f0, $f0
/* 7E3A44 80282BC4 46220001 */ sub.d $f0, $f0, $f2
/* 7E3A48 80282BC8 46200020 */ cvt.s.d $f0, $f0
/* 7E3A4C 80282BCC 080A0AF9 */ j .L80282BE4
/* 7E3A50 80282BD0 E6200050 */ swc1 $f0, 0x50($s1)
.L80282BD4:
/* 7E3A54 80282BD4 44800000 */ mtc1 $zero, $f0
/* 7E3A58 80282BD8 00000000 */ nop
/* 7E3A5C 80282BDC E6200060 */ swc1 $f0, 0x60($s1)
/* 7E3A60 80282BE0 E6200068 */ swc1 $f0, 0x68($s1)
.L80282BE4:
/* 7E3A64 80282BE4 C6600028 */ lwc1 $f0, 0x28($s3)
/* 7E3A68 80282BE8 C662002C */ lwc1 $f2, 0x2C($s3)
/* 7E3A6C 80282BEC C6640030 */ lwc1 $f4, 0x30($s3)
/* 7E3A70 80282BF0 3C02800B */ lui $v0, %hi(gCameras)
/* 7E3A74 80282BF4 24421D80 */ addiu $v0, $v0, %lo(gCameras)
/* 7E3A78 80282BF8 E4400060 */ swc1 $f0, 0x60($v0)
/* 7E3A7C 80282BFC E4420064 */ swc1 $f2, 0x64($v0)
/* 7E3A80 80282C00 E4440068 */ swc1 $f4, 0x68($v0)
/* 7E3A84 80282C04 8E430070 */ lw $v1, 0x70($s2)
/* 7E3A88 80282C08 24630001 */ addiu $v1, $v1, 0x1
/* 7E3A8C 80282C0C 3862000D */ xori $v0, $v1, 0xD
/* 7E3A90 80282C10 AE430070 */ sw $v1, 0x70($s2)
/* 7E3A94 80282C14 8FBF0020 */ lw $ra, 0x20($sp)
/* 7E3A98 80282C18 8FB3001C */ lw $s3, 0x1C($sp)
/* 7E3A9C 80282C1C 8FB20018 */ lw $s2, 0x18($sp)
/* 7E3AA0 80282C20 8FB10014 */ lw $s1, 0x14($sp)
/* 7E3AA4 80282C24 8FB00010 */ lw $s0, 0x10($sp)
/* 7E3AA8 80282C28 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 7E3AAC 80282C2C D7B60030 */ ldc1 $f22, 0x30($sp)
/* 7E3AB0 80282C30 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 7E3AB4 80282C34 2C420001 */ sltiu $v0, $v0, 0x1
/* 7E3AB8 80282C38 03E00008 */ jr $ra
/* 7E3ABC 80282C3C 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(UpdatePushBlockMotion) {
PlayerStatus* playerStatus = &gPlayerStatus;
Entity* entity = get_entity_by_index(script->varTable[11]);
f32 moveRatio;
if (isInitialCall) {
script->functionTemp[0] = 0;
script->varTable[0] = playerStatus->position.x;
script->varTable[1] = playerStatus->position.y;
script->varTable[2] = playerStatus->position.z;
script->varTable[3] = entity->position.x;
script->varTable[4] = entity->position.y;
script->varTable[5] = entity->position.z;
script->varTable[9] = entity->rotation.x;
script->varTable[12] = entity->rotation.z;
}
moveRatio = PushBlockMovePositions[script->functionTemp[0]];
playerStatus->position.x = script->varTable[0] + (script->varTable[6] * moveRatio * BLOCK_GRID_SIZE);
playerStatus->position.y = script->varTable[1] + (script->varTable[7] * moveRatio * BLOCK_GRID_SIZE);
playerStatus->position.z = script->varTable[2] + (script->varTable[8] * moveRatio * BLOCK_GRID_SIZE);
entity->position.x = script->varTable[3] + (script->varTable[6] * moveRatio * BLOCK_GRID_SIZE);
entity->position.y = script->varTable[4] + (script->varTable[7] * moveRatio * BLOCK_GRID_SIZE);
entity->position.z = script->varTable[5] + (script->varTable[8] * moveRatio * BLOCK_GRID_SIZE);
if (script->functionTemp[0] < 12) {
entity->rotation.z = script->varTable[12] + (script->varTable[6] * moveRatio * -90.0f);
entity->rotation.x = script->varTable[9] + (script->varTable[8] * moveRatio * 90.0f);
entity->position.y = entity->position.y + (sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5);
entity->position.x = entity->position.x - (script->varTable[6] * sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5);
entity->position.z = entity->position.z - (script->varTable[8] * sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5);
} else {
entity->rotation.z = entity->rotation.x = 0.0f;
}
gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
script->functionTemp[0]++;
if (script->functionTemp[0] == ARRAY_COUNT(PushBlockMovePositions)) {
return ApiStatus_DONE1;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel star_update
/* 331CB8 E001E378 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 331CBC E001E37C AFB1002C */ sw $s1, 0x2C($sp)
/* 331CC0 E001E380 0080882D */ daddu $s1, $a0, $zero
/* 331CC4 E001E384 AFBF0030 */ sw $ra, 0x30($sp)
/* 331CC8 E001E388 AFB00028 */ sw $s0, 0x28($sp)
/* 331CCC E001E38C F7B40038 */ sdc1 $f20, 0x38($sp)
/* 331CD0 E001E390 8E30000C */ lw $s0, 0xC($s1)
/* 331CD4 E001E394 8E020038 */ lw $v0, 0x38($s0)
/* 331CD8 E001E398 28420002 */ slti $v0, $v0, 0x2
/* 331CDC E001E39C 144000AF */ bnez $v0, .LE001E65C
/* 331CE0 E001E3A0 00000000 */ nop
/* 331CE4 E001E3A4 C6040010 */ lwc1 $f4, 0x10($s0)
/* 331CE8 E001E3A8 46042102 */ mul.s $f4, $f4, $f4
/* 331CEC E001E3AC 00000000 */ nop
/* 331CF0 E001E3B0 C6020014 */ lwc1 $f2, 0x14($s0)
/* 331CF4 E001E3B4 46021082 */ mul.s $f2, $f2, $f2
/* 331CF8 E001E3B8 00000000 */ nop
/* 331CFC E001E3BC C6000018 */ lwc1 $f0, 0x18($s0)
/* 331D00 E001E3C0 46000002 */ mul.s $f0, $f0, $f0
/* 331D04 E001E3C4 00000000 */ nop
/* 331D08 E001E3C8 46022100 */ add.s $f4, $f4, $f2
/* 331D0C E001E3CC 46002300 */ add.s $f12, $f4, $f0
/* 331D10 E001E3D0 3C013C23 */ lui $at, (0x3C23D70A >> 16)
/* 331D14 E001E3D4 3421D70A */ ori $at, $at, (0x3C23D70A & 0xFFFF)
/* 331D18 E001E3D8 44810000 */ mtc1 $at, $f0
/* 331D1C E001E3DC 00000000 */ nop
/* 331D20 E001E3E0 460C003C */ c.lt.s $f0, $f12
/* 331D24 E001E3E4 00000000 */ nop
/* 331D28 E001E3E8 45000008 */ bc1f .LE001E40C
/* 331D2C E001E3EC E7AC0024 */ swc1 $f12, 0x24($sp)
/* 331D30 E001E3F0 0C080154 */ jal shim_sqrtf
/* 331D34 E001E3F4 00000000 */ nop
/* 331D38 E001E3F8 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 331D3C E001E3FC 44811000 */ mtc1 $at, $f2
/* 331D40 E001E400 00000000 */ nop
/* 331D44 E001E404 46001083 */ div.s $f2, $f2, $f0
/* 331D48 E001E408 E7A20024 */ swc1 $f2, 0x24($sp)
.LE001E40C:
/* 331D4C E001E40C C60A0010 */ lwc1 $f10, 0x10($s0)
/* 331D50 E001E410 C7A00024 */ lwc1 $f0, 0x24($sp)
/* 331D54 E001E414 46005282 */ mul.s $f10, $f10, $f0
/* 331D58 E001E418 00000000 */ nop
/* 331D5C E001E41C C6040014 */ lwc1 $f4, 0x14($s0)
/* 331D60 E001E420 46002102 */ mul.s $f4, $f4, $f0
/* 331D64 E001E424 00000000 */ nop
/* 331D68 E001E428 C6060018 */ lwc1 $f6, 0x18($s0)
/* 331D6C E001E42C 46003182 */ mul.s $f6, $f6, $f0
/* 331D70 E001E430 00000000 */ nop
/* 331D74 E001E434 3C014200 */ lui $at, (0x42000000 >> 16)
/* 331D78 E001E438 44811000 */ mtc1 $at, $f2
/* 331D7C E001E43C 00000000 */ nop
/* 331D80 E001E440 46025282 */ mul.s $f10, $f10, $f2
/* 331D84 E001E444 00000000 */ nop
/* 331D88 E001E448 46022102 */ mul.s $f4, $f4, $f2
/* 331D8C E001E44C 00000000 */ nop
/* 331D90 E001E450 46023182 */ mul.s $f6, $f6, $f2
/* 331D94 E001E454 00000000 */ nop
/* 331D98 E001E458 C6080004 */ lwc1 $f8, 0x4($s0)
/* 331D9C E001E45C 3C014280 */ lui $at, (0x42800000 >> 16)
/* 331DA0 E001E460 44810000 */ mtc1 $at, $f0
/* 331DA4 E001E464 C6020008 */ lwc1 $f2, 0x8($s0)
/* 331DA8 E001E468 460A4201 */ sub.s $f8, $f8, $f10
/* 331DAC E001E46C E7A00024 */ swc1 $f0, 0x24($sp)
/* 331DB0 E001E470 46041081 */ sub.s $f2, $f2, $f4
/* 331DB4 E001E474 C600000C */ lwc1 $f0, 0xC($s0)
/* 331DB8 E001E478 8E020000 */ lw $v0, 0x0($s0)
/* 331DBC E001E47C 46060001 */ sub.s $f0, $f0, $f6
/* 331DC0 E001E480 E7A80018 */ swc1 $f8, 0x18($sp)
/* 331DC4 E001E484 E7A2001C */ swc1 $f2, 0x1C($sp)
/* 331DC8 E001E488 1040005C */ beqz $v0, .LE001E5FC
/* 331DCC E001E48C E7A00020 */ swc1 $f0, 0x20($sp)
/* 331DD0 E001E490 C6000014 */ lwc1 $f0, 0x14($s0)
/* 331DD4 E001E494 4480A000 */ mtc1 $zero, $f20
/* 331DD8 E001E498 00000000 */ nop
/* 331DDC E001E49C 4614003C */ c.lt.s $f0, $f20
/* 331DE0 E001E4A0 00000000 */ nop
/* 331DE4 E001E4A4 45000055 */ bc1f .LE001E5FC
/* 331DE8 E001E4A8 27A20024 */ addiu $v0, $sp, 0x24
/* 331DEC E001E4AC AFA20010 */ sw $v0, 0x10($sp)
/* 331DF0 E001E4B0 0000202D */ daddu $a0, $zero, $zero
/* 331DF4 E001E4B4 27A50018 */ addiu $a1, $sp, 0x18
/* 331DF8 E001E4B8 27A6001C */ addiu $a2, $sp, 0x1C
/* 331DFC E001E4BC 0C08014C */ jal shim_npc_raycast_down_sides
/* 331E00 E001E4C0 27A70020 */ addiu $a3, $sp, 0x20
/* 331E04 E001E4C4 1040004D */ beqz $v0, .LE001E5FC
/* 331E08 E001E4C8 00000000 */ nop
/* 331E0C E001E4CC C7A20024 */ lwc1 $f2, 0x24($sp)
/* 331E10 E001E4D0 3C014228 */ lui $at, (0x42280000 >> 16)
/* 331E14 E001E4D4 44810000 */ mtc1 $at, $f0
/* 331E18 E001E4D8 00000000 */ nop
/* 331E1C E001E4DC 4600103C */ c.lt.s $f2, $f0
/* 331E20 E001E4E0 00000000 */ nop
/* 331E24 E001E4E4 45000045 */ bc1f .LE001E5FC
/* 331E28 E001E4E8 24040006 */ addiu $a0, $zero, 0x6
/* 331E2C E001E4EC C6040014 */ lwc1 $f4, 0x14($s0)
/* 331E30 E001E4F0 3C01E002 */ lui $at, (0xE0020000 >> 16)
/* 331E34 E001E4F4 D420ED50 */ ldc1 $f0, -0x12B0($at)
/* 331E38 E001E4F8 46002107 */ neg.s $f4, $f4
/* 331E3C E001E4FC 46002121 */ cvt.d.s $f4, $f4
/* 331E40 E001E500 46202102 */ mul.d $f4, $f4, $f0
/* 331E44 E001E504 00000000 */ nop
/* 331E48 E001E508 C6060010 */ lwc1 $f6, 0x10($s0)
/* 331E4C E001E50C 3C01E002 */ lui $at, (0xE0020000 >> 16)
/* 331E50 E001E510 D428ED58 */ ldc1 $f8, -0x12A8($at)
/* 331E54 E001E514 460031A1 */ cvt.d.s $f6, $f6
/* 331E58 E001E518 46283182 */ mul.d $f6, $f6, $f8
/* 331E5C E001E51C 00000000 */ nop
/* 331E60 E001E520 C6020034 */ lwc1 $f2, 0x34($s0)
/* 331E64 E001E524 460010A1 */ cvt.d.s $f2, $f2
/* 331E68 E001E528 46281082 */ mul.d $f2, $f2, $f8
/* 331E6C E001E52C 00000000 */ nop
/* 331E70 E001E530 C60A001C */ lwc1 $f10, 0x1C($s0)
/* 331E74 E001E534 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 331E78 E001E538 44810000 */ mtc1 $at, $f0
/* 331E7C E001E53C 00000000 */ nop
/* 331E80 E001E540 46005280 */ add.s $f10, $f10, $f0
/* 331E84 E001E544 C600002C */ lwc1 $f0, 0x2C($s0)
/* 331E88 E001E548 46000021 */ cvt.d.s $f0, $f0
/* 331E8C E001E54C 46280002 */ mul.d $f0, $f0, $f8
/* 331E90 E001E550 00000000 */ nop
/* 331E94 E001E554 E60A001C */ swc1 $f10, 0x1C($s0)
/* 331E98 E001E558 46202120 */ cvt.s.d $f4, $f4
/* 331E9C E001E55C 462031A0 */ cvt.s.d $f6, $f6
/* 331EA0 E001E560 462010A0 */ cvt.s.d $f2, $f2
/* 331EA4 E001E564 E6040014 */ swc1 $f4, 0x14($s0)
/* 331EA8 E001E568 E6060010 */ swc1 $f6, 0x10($s0)
/* 331EAC E001E56C E6020034 */ swc1 $f2, 0x34($s0)
/* 331EB0 E001E570 46200020 */ cvt.s.d $f0, $f0
/* 331EB4 E001E574 0C080150 */ jal shim_load_effect
/* 331EB8 E001E578 E600002C */ swc1 $f0, 0x2C($s0)
/* 331EBC E001E57C C6020008 */ lwc1 $f2, 0x8($s0)
/* 331EC0 E001E580 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 331EC4 E001E584 44810000 */ mtc1 $at, $f0
/* 331EC8 E001E588 E7B40010 */ swc1 $f20, 0x10($sp)
/* 331ECC E001E58C 46001081 */ sub.s $f2, $f2, $f0
/* 331ED0 E001E590 8E050004 */ lw $a1, 0x4($s0)
/* 331ED4 E001E594 8E07000C */ lw $a3, 0xC($s0)
/* 331ED8 E001E598 44061000 */ mfc1 $a2, $f2
/* 331EDC E001E59C 0C003058 */ jal landing_dust_main
/* 331EE0 E001E5A0 0000202D */ daddu $a0, $zero, $zero
/* 331EE4 E001E5A4 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 331EE8 E001E5A8 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 331EEC E001E5AC 80420070 */ lb $v0, 0x70($v0)
/* 331EF0 E001E5B0 14400008 */ bnez $v0, .LE001E5D4
/* 331EF4 E001E5B4 3C04B000 */ lui $a0, (0xB0000016 >> 16)
/* 331EF8 E001E5B8 C600000C */ lwc1 $f0, 0xC($s0)
/* 331EFC E001E5BC 34840016 */ ori $a0, $a0, (0xB0000016 & 0xFFFF)
/* 331F00 E001E5C0 E7A00010 */ swc1 $f0, 0x10($sp)
/* 331F04 E001E5C4 8E060004 */ lw $a2, 0x4($s0)
/* 331F08 E001E5C8 8E070008 */ lw $a3, 0x8($s0)
/* 331F0C E001E5CC 0C0801A0 */ jal shim_sfx_play_sound_at_position
/* 331F10 E001E5D0 0000282D */ daddu $a1, $zero, $zero
.LE001E5D4:
/* 331F14 E001E5D4 C602001C */ lwc1 $f2, 0x1C($s0)
/* 331F18 E001E5D8 3C014120 */ lui $at, (0x41200000 >> 16)
/* 331F1C E001E5DC 44810000 */ mtc1 $at, $f0
/* 331F20 E001E5E0 00000000 */ nop
/* 331F24 E001E5E4 4602003E */ c.le.s $f0, $f2
/* 331F28 E001E5E8 00000000 */ nop
/* 331F2C E001E5EC 45000003 */ bc1f .LE001E5FC
/* 331F30 E001E5F0 AE000000 */ sw $zero, 0x0($s0)
/* 331F34 E001E5F4 2402FFFF */ addiu $v0, $zero, -0x1
/* 331F38 E001E5F8 AE020030 */ sw $v0, 0x30($s0)
.LE001E5FC:
/* 331F3C E001E5FC C600001C */ lwc1 $f0, 0x1C($s0)
/* 331F40 E001E600 44806000 */ mtc1 $zero, $f12
/* 331F44 E001E604 00000000 */ nop
/* 331F48 E001E608 460C0032 */ c.eq.s $f0, $f12
/* 331F4C E001E60C 00000000 */ nop
/* 331F50 E001E610 45010012 */ bc1t .LE001E65C
/* 331F54 E001E614 46006386 */ mov.s $f14, $f12
/* 331F58 E001E618 C6000014 */ lwc1 $f0, 0x14($s0)
/* 331F5C E001E61C 3C01BFE0 */ lui $at, (0xBFE00000 >> 16)
/* 331F60 E001E620 44811800 */ mtc1 $at, $f3
/* 331F64 E001E624 44801000 */ mtc1 $zero, $f2
/* 331F68 E001E628 C604002C */ lwc1 $f4, 0x2C($s0)
/* 331F6C E001E62C 46000021 */ cvt.d.s $f0, $f0
/* 331F70 E001E630 46220000 */ add.d $f0, $f0, $f2
/* 331F74 E001E634 C6020024 */ lwc1 $f2, 0x24($s0)
/* 331F78 E001E638 8E070034 */ lw $a3, 0x34($s0)
/* 331F7C E001E63C 46041080 */ add.s $f2, $f2, $f4
/* 331F80 E001E640 46200020 */ cvt.s.d $f0, $f0
/* 331F84 E001E644 E6000014 */ swc1 $f0, 0x14($s0)
/* 331F88 E001E648 46000007 */ neg.s $f0, $f0
/* 331F8C E001E64C 44060000 */ mfc1 $a2, $f0
/* 331F90 E001E650 0C080148 */ jal shim_atan2
/* 331F94 E001E654 E6020024 */ swc1 $f2, 0x24($s0)
/* 331F98 E001E658 E6000020 */ swc1 $f0, 0x20($s0)
.LE001E65C:
/* 331F9C E001E65C 3C028011 */ lui $v0, %hi(gPlayerStatus)
/* 331FA0 E001E660 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus)
/* 331FA4 E001E664 C440002C */ lwc1 $f0, 0x2C($v0)
/* 331FA8 E001E668 C6020008 */ lwc1 $f2, 0x8($s0)
/* 331FAC E001E66C 46020001 */ sub.s $f0, $f0, $f2
/* 331FB0 E001E670 3C014396 */ lui $at, (0x43960000 >> 16)
/* 331FB4 E001E674 44811000 */ mtc1 $at, $f2
/* 331FB8 E001E678 00000000 */ nop
/* 331FBC E001E67C 4600103C */ c.lt.s $f2, $f0
/* 331FC0 E001E680 00000000 */ nop
/* 331FC4 E001E684 45000002 */ bc1f .LE001E690
/* 331FC8 E001E688 2402FFFF */ addiu $v0, $zero, -0x1
/* 331FCC E001E68C AE020030 */ sw $v0, 0x30($s0)
.LE001E690:
/* 331FD0 E001E690 C6060004 */ lwc1 $f6, 0x4($s0)
/* 331FD4 E001E694 C6000010 */ lwc1 $f0, 0x10($s0)
/* 331FD8 E001E698 C6020008 */ lwc1 $f2, 0x8($s0)
/* 331FDC E001E69C 46003180 */ add.s $f6, $f6, $f0
/* 331FE0 E001E6A0 C6000014 */ lwc1 $f0, 0x14($s0)
/* 331FE4 E001E6A4 C6040018 */ lwc1 $f4, 0x18($s0)
/* 331FE8 E001E6A8 46001080 */ add.s $f2, $f2, $f0
/* 331FEC E001E6AC C600000C */ lwc1 $f0, 0xC($s0)
/* 331FF0 E001E6B0 8E020030 */ lw $v0, 0x30($s0)
/* 331FF4 E001E6B4 46040000 */ add.s $f0, $f0, $f4
/* 331FF8 E001E6B8 E6060004 */ swc1 $f6, 0x4($s0)
/* 331FFC E001E6BC E6020008 */ swc1 $f2, 0x8($s0)
/* 332000 E001E6C0 04410003 */ bgez $v0, .LE001E6D0
/* 332004 E001E6C4 E600000C */ swc1 $f0, 0xC($s0)
/* 332008 E001E6C8 0C080128 */ jal shim_remove_effect
/* 33200C E001E6CC 0220202D */ daddu $a0, $s1, $zero
.LE001E6D0:
/* 332010 E001E6D0 8FBF0030 */ lw $ra, 0x30($sp)
/* 332014 E001E6D4 8FB1002C */ lw $s1, 0x2C($sp)
/* 332018 E001E6D8 8FB00028 */ lw $s0, 0x28($sp)
/* 33201C E001E6DC D7B40038 */ ldc1 $f20, 0x38($sp)
/* 332020 E001E6E0 03E00008 */ jr $ra
/* 332024 E001E6E4 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
void star_update(EffectInstance* effect) {
PlayerStatus* playerStatus = &gPlayerStatus;
StarFXData* data = effect->data.star;
f32 x, y, z, length;
f32 xTemp, yTemp, zTemp;
if (data->unk_38 >= 2) {
length = SQ(data->unk_10) + SQ(data->unk_14) + SQ(data->unk_18);
if (length > 0.01f) {
length = 1.0f / shim_sqrtf(length);
}
xTemp = data->unk_10 * length * 32.0f;
yTemp = data->unk_14 * length * 32.0f;
zTemp = data->unk_18 * length * 32.0f;
x = data->unk_04 - xTemp;
y = data->unk_08 - yTemp;
z = data->unk_0C - zTemp;
length = 64.0f;
if (data->unk_00 != 0 &&
data->unk_14 < 0.0f &&
shim_npc_raycast_down_sides(0, &x, &y, &z, &length) != 0 &&
length < 42.0f)
{
data->unk_1C = data->unk_1C + 1.0f;
data->unk_14 = -data->unk_14 * 0.6;
data->unk_10 = data->unk_10 * 0.7;
data->unk_34 = data->unk_34 * 0.7;
data->unk_2C = data->unk_2C * 0.7;
shim_load_effect(EFFECT_LANDING_DUST);
landing_dust_main(0, data->unk_04, data->unk_08 - 5.0f, data->unk_0C, 0.0f);
if (!gGameStatusPtr->isBattle) {
shim_sfx_play_sound_at_position(SOUND_B0000016, SOUND_SPACE_MODE_0, data->unk_04, data->unk_08, data->unk_0C);
}
data->unk_00 = 0;
if (data->unk_1C >= 10.0f) {
data->unk_30 = -1;
}
}
if (data->unk_1C != 0.0f) {
data->unk_14 += -0.5;
data->unk_24 += data->unk_2C;
data->unk_20 = shim_atan2(0.0f, 0.0f, -data->unk_14, data->unk_34);
}
}
if (playerStatus->position.y - data->unk_08 > 300.0f) {
data->unk_30 = -1;
}
data->unk_04 += data->unk_10;
data->unk_08 += data->unk_14;
data->unk_0C += data->unk_18;
if (data->unk_30 < 0) {
shim_remove_effect(effect);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel IdleJumpToGoal
/* 1A79EC 8027910C 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 1A79F0 80279110 AFB20020 */ sw $s2, 0x20($sp)
/* 1A79F4 80279114 0080902D */ daddu $s2, $a0, $zero
/* 1A79F8 80279118 AFBF0024 */ sw $ra, 0x24($sp)
/* 1A79FC 8027911C AFB1001C */ sw $s1, 0x1C($sp)
/* 1A7A00 80279120 AFB00018 */ sw $s0, 0x18($sp)
/* 1A7A04 80279124 F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 1A7A08 80279128 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 1A7A0C 8027912C F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 1A7A10 80279130 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 1A7A14 80279134 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 1A7A18 80279138 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 1A7A1C 8027913C 8E51000C */ lw $s1, 0xC($s2)
/* 1A7A20 80279140 54A00001 */ bnel $a1, $zero, .L80279148
/* 1A7A24 80279144 AE400070 */ sw $zero, 0x70($s2)
.L80279148:
/* 1A7A28 80279148 8E420070 */ lw $v0, 0x70($s2)
/* 1A7A2C 8027914C 14400073 */ bnez $v0, .L8027931C
/* 1A7A30 80279150 00000000 */ nop
/* 1A7A34 80279154 8E250000 */ lw $a1, 0x0($s1)
/* 1A7A38 80279158 26310004 */ addiu $s1, $s1, 0x4
/* 1A7A3C 8027915C 0C0B1EAF */ jal evt_get_variable
/* 1A7A40 80279160 0240202D */ daddu $a0, $s2, $zero
/* 1A7A44 80279164 0040202D */ daddu $a0, $v0, $zero
/* 1A7A48 80279168 2402FF81 */ addiu $v0, $zero, -0x7F
/* 1A7A4C 8027916C 14820002 */ bne $a0, $v0, .L80279178
/* 1A7A50 80279170 00000000 */ nop
/* 1A7A54 80279174 8E440148 */ lw $a0, 0x148($s2)
.L80279178:
/* 1A7A58 80279178 0C09A75B */ jal get_actor
/* 1A7A5C 8027917C 00000000 */ nop
/* 1A7A60 80279180 0040802D */ daddu $s0, $v0, $zero
/* 1A7A64 80279184 AE500074 */ sw $s0, 0x74($s2)
/* 1A7A68 80279188 8E250000 */ lw $a1, 0x0($s1)
/* 1A7A6C 8027918C 26310004 */ addiu $s1, $s1, 0x4
/* 1A7A70 80279190 0C0B1EAF */ jal evt_get_variable
/* 1A7A74 80279194 0240202D */ daddu $a0, $s2, $zero
/* 1A7A78 80279198 A6020120 */ sh $v0, 0x120($s0)
/* 1A7A7C 8027919C 8E250000 */ lw $a1, 0x0($s1)
/* 1A7A80 802791A0 26310004 */ addiu $s1, $s1, 0x4
/* 1A7A84 802791A4 0C0B1EAF */ jal evt_get_variable
/* 1A7A88 802791A8 0240202D */ daddu $a0, $s2, $zero
/* 1A7A8C 802791AC AE420078 */ sw $v0, 0x78($s2)
/* 1A7A90 802791B0 8E250000 */ lw $a1, 0x0($s1)
/* 1A7A94 802791B4 0C0B1EAF */ jal evt_get_variable
/* 1A7A98 802791B8 0240202D */ daddu $a0, $s2, $zero
/* 1A7A9C 802791BC AE42007C */ sw $v0, 0x7C($s2)
/* 1A7AA0 802791C0 C6000148 */ lwc1 $f0, 0x148($s0)
/* 1A7AA4 802791C4 C61A00D4 */ lwc1 $f26, 0xD4($s0)
/* 1A7AA8 802791C8 C61C00DC */ lwc1 $f28, 0xDC($s0)
/* 1A7AAC 802791CC C614014C */ lwc1 $f20, 0x14C($s0)
/* 1A7AB0 802791D0 C61800D8 */ lwc1 $f24, 0xD8($s0)
/* 1A7AB4 802791D4 261100C8 */ addiu $s1, $s0, 0xC8
/* 1A7AB8 802791D8 E60000CC */ swc1 $f0, 0xCC($s0)
/* 1A7ABC 802791DC 46000786 */ mov.s $f30, $f0
/* 1A7AC0 802791E0 4406D000 */ mfc1 $a2, $f26
/* 1A7AC4 802791E4 4407E000 */ mfc1 $a3, $f28
/* 1A7AC8 802791E8 C6000144 */ lwc1 $f0, 0x144($s0)
/* 1A7ACC 802791EC 4600A386 */ mov.s $f14, $f20
/* 1A7AD0 802791F0 E61400D0 */ swc1 $f20, 0xD0($s0)
/* 1A7AD4 802791F4 E60000C8 */ swc1 $f0, 0xC8($s0)
/* 1A7AD8 802791F8 46000586 */ mov.s $f22, $f0
/* 1A7ADC 802791FC 0C00A720 */ jal atan2
/* 1A7AE0 80279200 4600B306 */ mov.s $f12, $f22
/* 1A7AE4 80279204 4600B306 */ mov.s $f12, $f22
/* 1A7AE8 80279208 4600A386 */ mov.s $f14, $f20
/* 1A7AEC 8027920C 4406D000 */ mfc1 $a2, $f26
/* 1A7AF0 80279210 4407E000 */ mfc1 $a3, $f28
/* 1A7AF4 80279214 461EC781 */ sub.s $f30, $f24, $f30
/* 1A7AF8 80279218 0C00A7B5 */ jal dist2D
/* 1A7AFC 8027921C E6000110 */ swc1 $f0, 0x110($s0)
/* 1A7B00 80279220 86020120 */ lh $v0, 0x120($s0)
/* 1A7B04 80279224 46000106 */ mov.s $f4, $f0
/* 1A7B08 80279228 14400012 */ bnez $v0, .L80279274
/* 1A7B0C 8027922C E6040114 */ swc1 $f4, 0x114($s0)
/* 1A7B10 80279230 C6000108 */ lwc1 $f0, 0x108($s0)
/* 1A7B14 80279234 C6020108 */ lwc1 $f2, 0x108($s0)
/* 1A7B18 80279238 46002003 */ div.s $f0, $f4, $f0
/* 1A7B1C 8027923C 4600028D */ trunc.w.s $f10, $f0
/* 1A7B20 80279240 44035000 */ mfc1 $v1, $f10
/* 1A7B24 80279244 00000000 */ nop
/* 1A7B28 80279248 00031400 */ sll $v0, $v1, 16
/* 1A7B2C 8027924C 00021403 */ sra $v0, $v0, 16
/* 1A7B30 80279250 44820000 */ mtc1 $v0, $f0
/* 1A7B34 80279254 00000000 */ nop
/* 1A7B38 80279258 46800020 */ cvt.s.w $f0, $f0
/* 1A7B3C 8027925C 46020002 */ mul.s $f0, $f0, $f2
/* 1A7B40 80279260 00000000 */ nop
/* 1A7B44 80279264 46002086 */ mov.s $f2, $f4
/* 1A7B48 80279268 A6030120 */ sh $v1, 0x120($s0)
/* 1A7B4C 8027926C 0809E4AA */ j .L802792A8
/* 1A7B50 80279270 46001201 */ sub.s $f8, $f2, $f0
.L80279274:
/* 1A7B54 80279274 44821000 */ mtc1 $v0, $f2
/* 1A7B58 80279278 00000000 */ nop
/* 1A7B5C 8027927C 468010A0 */ cvt.s.w $f2, $f2
/* 1A7B60 80279280 86020120 */ lh $v0, 0x120($s0)
/* 1A7B64 80279284 46022083 */ div.s $f2, $f4, $f2
/* 1A7B68 80279288 44820000 */ mtc1 $v0, $f0
/* 1A7B6C 8027928C 00000000 */ nop
/* 1A7B70 80279290 46800020 */ cvt.s.w $f0, $f0
/* 1A7B74 80279294 46020002 */ mul.s $f0, $f0, $f2
/* 1A7B78 80279298 00000000 */ nop
/* 1A7B7C 8027929C C6040114 */ lwc1 $f4, 0x114($s0)
/* 1A7B80 802792A0 E6020108 */ swc1 $f2, 0x108($s0)
/* 1A7B84 802792A4 46002201 */ sub.s $f8, $f4, $f0
.L802792A8:
/* 1A7B88 802792A8 86220058 */ lh $v0, 0x58($s1)
/* 1A7B8C 802792AC 14400003 */ bnez $v0, .L802792BC
/* 1A7B90 802792B0 00000000 */ nop
/* 1A7B94 802792B4 0809E4FC */ j .L802793F0
/* 1A7B98 802792B8 24020002 */ addiu $v0, $zero, 0x2
.L802792BC:
/* 1A7B9C 802792BC C622003C */ lwc1 $f2, 0x3C($s1)
/* 1A7BA0 802792C0 44823000 */ mtc1 $v0, $f6
/* 1A7BA4 802792C4 00000000 */ nop
/* 1A7BA8 802792C8 468031A0 */ cvt.s.w $f6, $f6
/* 1A7BAC 802792CC 46061082 */ mul.s $f2, $f2, $f6
/* 1A7BB0 802792D0 00000000 */ nop
/* 1A7BB4 802792D4 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 1A7BB8 802792D8 44810000 */ mtc1 $at, $f0
/* 1A7BBC 802792DC 00000000 */ nop
/* 1A7BC0 802792E0 46001082 */ mul.s $f2, $f2, $f0
/* 1A7BC4 802792E4 00000000 */ nop
/* 1A7BC8 802792E8 86220058 */ lh $v0, 0x58($s1)
/* 1A7BCC 802792EC C6240040 */ lwc1 $f4, 0x40($s1)
/* 1A7BD0 802792F0 44820000 */ mtc1 $v0, $f0
/* 1A7BD4 802792F4 00000000 */ nop
/* 1A7BD8 802792F8 46800020 */ cvt.s.w $f0, $f0
/* 1A7BDC 802792FC 46004003 */ div.s $f0, $f8, $f0
/* 1A7BE0 80279300 46002100 */ add.s $f4, $f4, $f0
/* 1A7BE4 80279304 4606F183 */ div.s $f6, $f30, $f6
/* 1A7BE8 80279308 46061080 */ add.s $f2, $f2, $f6
/* 1A7BEC 8027930C 24020001 */ addiu $v0, $zero, 0x1
/* 1A7BF0 80279310 E6240040 */ swc1 $f4, 0x40($s1)
/* 1A7BF4 80279314 E6220044 */ swc1 $f2, 0x44($s1)
/* 1A7BF8 80279318 AE420070 */ sw $v0, 0x70($s2)
.L8027931C:
/* 1A7BFC 8027931C 8E500074 */ lw $s0, 0x74($s2)
/* 1A7C00 80279320 C600010C */ lwc1 $f0, 0x10C($s0)
/* 1A7C04 80279324 C60400CC */ lwc1 $f4, 0xCC($s0)
/* 1A7C08 80279328 46000086 */ mov.s $f2, $f0
/* 1A7C0C 8027932C 46002100 */ add.s $f4, $f4, $f0
/* 1A7C10 80279330 C6000104 */ lwc1 $f0, 0x104($s0)
/* 1A7C14 80279334 46001081 */ sub.s $f2, $f2, $f0
/* 1A7C18 80279338 44800000 */ mtc1 $zero, $f0
/* 1A7C1C 8027933C 261100C8 */ addiu $s1, $s0, 0xC8
/* 1A7C20 80279340 E60400CC */ swc1 $f4, 0xCC($s0)
/* 1A7C24 80279344 4600103C */ c.lt.s $f2, $f0
/* 1A7C28 80279348 00000000 */ nop
/* 1A7C2C 8027934C 45000007 */ bc1f .L8027936C
/* 1A7C30 80279350 E602010C */ swc1 $f2, 0x10C($s0)
/* 1A7C34 80279354 C60200D8 */ lwc1 $f2, 0xD8($s0)
/* 1A7C38 80279358 46002006 */ mov.s $f0, $f4
/* 1A7C3C 8027935C 4602003C */ c.lt.s $f0, $f2
/* 1A7C40 80279360 00000000 */ nop
/* 1A7C44 80279364 45030001 */ bc1tl .L8027936C
/* 1A7C48 80279368 E60200CC */ swc1 $f2, 0xCC($s0)
.L8027936C:
/* 1A7C4C 8027936C 8E250040 */ lw $a1, 0x40($s1)
/* 1A7C50 80279370 8E260048 */ lw $a2, 0x48($s1)
/* 1A7C54 80279374 0C099096 */ jal add_xz_vec3f_copy2
/* 1A7C58 80279378 0220202D */ daddu $a0, $s1, $zero
/* 1A7C5C 8027937C C6200000 */ lwc1 $f0, 0x0($s1)
/* 1A7C60 80279380 E6000144 */ swc1 $f0, 0x144($s0)
/* 1A7C64 80279384 C6200004 */ lwc1 $f0, 0x4($s1)
/* 1A7C68 80279388 E6000148 */ swc1 $f0, 0x148($s0)
/* 1A7C6C 8027938C C6200008 */ lwc1 $f0, 0x8($s1)
/* 1A7C70 80279390 E600014C */ swc1 $f0, 0x14C($s0)
/* 1A7C74 80279394 96220058 */ lhu $v0, 0x58($s1)
/* 1A7C78 80279398 2442FFFF */ addiu $v0, $v0, -0x1
/* 1A7C7C 8027939C A6220058 */ sh $v0, 0x58($s1)
/* 1A7C80 802793A0 00021400 */ sll $v0, $v0, 16
/* 1A7C84 802793A4 1C400012 */ bgtz $v0, .L802793F0
/* 1A7C88 802793A8 0000102D */ daddu $v0, $zero, $zero
/* 1A7C8C 802793AC 8E42007C */ lw $v0, 0x7C($s2)
/* 1A7C90 802793B0 10400008 */ beqz $v0, .L802793D4
/* 1A7C94 802793B4 00000000 */ nop
/* 1A7C98 802793B8 C6200048 */ lwc1 $f0, 0x48($s1)
/* 1A7C9C 802793BC E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A7CA0 802793C0 8E25000C */ lw $a1, 0xC($s1)
/* 1A7CA4 802793C4 8E260010 */ lw $a2, 0x10($s1)
/* 1A7CA8 802793C8 8E270014 */ lw $a3, 0x14($s1)
/* 1A7CAC 802793CC 0C0990BC */ jal play_movement_dust_effects
/* 1A7CB0 802793D0 24040002 */ addiu $a0, $zero, 0x2
.L802793D4:
/* 1A7CB4 802793D4 C620000C */ lwc1 $f0, 0xC($s1)
/* 1A7CB8 802793D8 E6000144 */ swc1 $f0, 0x144($s0)
/* 1A7CBC 802793DC C6200010 */ lwc1 $f0, 0x10($s1)
/* 1A7CC0 802793E0 E6000148 */ swc1 $f0, 0x148($s0)
/* 1A7CC4 802793E4 C6200014 */ lwc1 $f0, 0x14($s1)
/* 1A7CC8 802793E8 24020001 */ addiu $v0, $zero, 0x1
/* 1A7CCC 802793EC E600014C */ swc1 $f0, 0x14C($s0)
.L802793F0:
/* 1A7CD0 802793F0 8FBF0024 */ lw $ra, 0x24($sp)
/* 1A7CD4 802793F4 8FB20020 */ lw $s2, 0x20($sp)
/* 1A7CD8 802793F8 8FB1001C */ lw $s1, 0x1C($sp)
/* 1A7CDC 802793FC 8FB00018 */ lw $s0, 0x18($sp)
/* 1A7CE0 80279400 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 1A7CE4 80279404 D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 1A7CE8 80279408 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 1A7CEC 8027940C D7B80038 */ ldc1 $f24, 0x38($sp)
/* 1A7CF0 80279410 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 1A7CF4 80279414 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 1A7CF8 80279418 03E00008 */ jr $ra
/* 1A7CFC 8027941C 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
ApiStatus IdleJumpToGoal(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Actor* actor;
ActorMovement* movement;
f32 posX, posY, posZ;
f32 goalX, goalY, goalZ;
f32 moveDist;
if (isInitialCall) {
script->functionTemp[0] = FALSE;
}
if (!script->functionTemp[0]) {
s32 actorID = evt_get_variable(script, *args++);
if (actorID == ACTOR_SELF) {
actorID = script->owner1.actorID;
}
script->functionTempPtr[1] = actor = get_actor(actorID);
movement = &actor->fly;
actor->fly.flyTime = evt_get_variable(script, *args++);
script->functionTemp[2] = evt_get_variable(script, *args++);
script->functionTemp[3] = evt_get_variable(script, *args++);
movement->currentPos.x = actor->currentPos.x;
movement->currentPos.y = actor->currentPos.y;
movement->currentPos.z = actor->currentPos.z;
posX = movement->currentPos.x;
posY = movement->currentPos.y;
posZ = movement->currentPos.z;
goalX = movement->goalPos.x;
goalY = movement->goalPos.y;
goalZ = movement->goalPos.z;
movement->angle = atan2(posX, posZ, goalX, goalZ);
movement->distance = dist2D(posX, posZ, goalX, goalZ);
// make relative
posX = (goalX - posX);
posY = (goalY - posY);
posZ = (goalZ - posZ);
if (movement->flyTime == 0) {
movement->flyTime = movement->distance / movement->speed;
moveDist = movement->distance - (movement->flyTime * movement->speed);
} else {
movement->speed = movement->distance / movement->flyTime;
moveDist = movement->distance - (movement->flyTime * movement->speed);
}
if (movement->flyTime == 0) {
return ApiStatus_DONE2;
}
movement->velocity = (movement->acceleration * movement->flyTime * 0.5f) + (posY / movement->flyTime);
movement->speed += moveDist / movement->flyTime;
script->functionTemp[0] = TRUE;
}
actor = script->functionTempPtr[1];
movement = &actor->fly;
movement->currentPos.y += movement->velocity;
movement->velocity -= movement->acceleration;
if (movement->velocity < 0.0f && movement->goalPos.y > movement->currentPos.y) {
movement->currentPos.y = movement->goalPos.y;
}
add_xz_vec3f_copy2(&movement->currentPos, movement->speed, movement->angle);
actor->currentPos.x = movement->currentPos.x;
actor->currentPos.y = movement->currentPos.y;
actor->currentPos.z = movement->currentPos.z;
movement->flyTime--;
if (movement->flyTime <= 0) {
if (script->functionTemp[3] != 0) {
play_movement_dust_effects(2, movement->goalPos.x, movement->goalPos.y, movement->goalPos.z, movement->angle);
}
actor->currentPos.x = movement->goalPos.x;
actor->currentPos.y = movement->goalPos.y;
actor->currentPos.z = movement->goalPos.z;
return ApiStatus_DONE1;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel partner_put_away
/* 87E68 800EE9B8 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 87E6C 800EE9BC AFB00010 */ sw $s0, 0x10($sp)
/* 87E70 800EE9C0 0080802D */ daddu $s0, $a0, $zero
/* 87E74 800EE9C4 3C048011 */ lui $a0, %hi(gPlayerStatus)
/* 87E78 800EE9C8 2484EFC8 */ addiu $a0, $a0, %lo(gPlayerStatus)
/* 87E7C 800EE9CC AFB10014 */ sw $s1, 0x14($sp)
/* 87E80 800EE9D0 3C118011 */ lui $s1, %hi(wPartnerFollowState)
/* 87E84 800EE9D4 2631CFC8 */ addiu $s1, $s1, %lo(wPartnerFollowState)
/* 87E88 800EE9D8 AFBF001C */ sw $ra, 0x1C($sp)
/* 87E8C 800EE9DC AFB20018 */ sw $s2, 0x18($sp)
/* 87E90 800EE9E0 F7BE0048 */ sdc1 $f30, 0x48($sp)
/* 87E94 800EE9E4 F7BC0040 */ sdc1 $f28, 0x40($sp)
/* 87E98 800EE9E8 F7BA0038 */ sdc1 $f26, 0x38($sp)
/* 87E9C 800EE9EC F7B80030 */ sdc1 $f24, 0x30($sp)
/* 87EA0 800EE9F0 F7B60028 */ sdc1 $f22, 0x28($sp)
/* 87EA4 800EE9F4 F7B40020 */ sdc1 $f20, 0x20($sp)
/* 87EA8 800EE9F8 86230000 */ lh $v1, 0x0($s1)
/* 87EAC 800EE9FC 24120001 */ addiu $s2, $zero, 0x1
/* 87EB0 800EEA00 10720062 */ beq $v1, $s2, .L800EEB8C
/* 87EB4 800EEA04 28620002 */ slti $v0, $v1, 0x2
/* 87EB8 800EEA08 10400005 */ beqz $v0, .L800EEA20
/* 87EBC 800EEA0C 24020002 */ addiu $v0, $zero, 0x2
/* 87EC0 800EEA10 10600007 */ beqz $v1, .L800EEA30
/* 87EC4 800EEA14 0000102D */ daddu $v0, $zero, $zero
/* 87EC8 800EEA18 0803BB25 */ j .L800EEC94
/* 87ECC 800EEA1C 00000000 */ nop
.L800EEA20:
/* 87ED0 800EEA20 1062008C */ beq $v1, $v0, .L800EEC54
/* 87ED4 800EEA24 0200202D */ daddu $a0, $s0, $zero
/* 87ED8 800EEA28 0803BB25 */ j .L800EEC94
/* 87EDC 800EEA2C 0000102D */ daddu $v0, $zero, $zero
.L800EEA30:
/* 87EE0 800EEA30 2403FDFF */ addiu $v1, $zero, -0x201
/* 87EE4 800EEA34 8E020000 */ lw $v0, 0x0($s0)
/* 87EE8 800EEA38 C61A0038 */ lwc1 $f26, 0x38($s0)
/* 87EEC 800EEA3C C614003C */ lwc1 $f20, 0x3C($s0)
/* 87EF0 800EEA40 C6160040 */ lwc1 $f22, 0x40($s0)
/* 87EF4 800EEA44 3C013FCC */ lui $at, (0x3FCCCCCD >> 16)
/* 87EF8 800EEA48 3421CCCD */ ori $at, $at, (0x3FCCCCCD & 0xFFFF)
/* 87EFC 800EEA4C 44811000 */ mtc1 $at, $f2
/* 87F00 800EEA50 00431024 */ and $v0, $v0, $v1
/* 87F04 800EEA54 2403FFF7 */ addiu $v1, $zero, -0x9
/* 87F08 800EEA58 00431024 */ and $v0, $v0, $v1
/* 87F0C 800EEA5C AE020000 */ sw $v0, 0x0($s0)
/* 87F10 800EEA60 C49C0028 */ lwc1 $f28, 0x28($a0)
/* 87F14 800EEA64 E61C0060 */ swc1 $f28, 0x60($s0)
/* 87F18 800EEA68 948200B0 */ lhu $v0, 0xB0($a0)
/* 87F1C 800EEA6C C49E002C */ lwc1 $f30, 0x2C($a0)
/* 87F20 800EEA70 00021400 */ sll $v0, $v0, 16
/* 87F24 800EEA74 00021C03 */ sra $v1, $v0, 16
/* 87F28 800EEA78 000217C2 */ srl $v0, $v0, 31
/* 87F2C 800EEA7C 00621821 */ addu $v1, $v1, $v0
/* 87F30 800EEA80 00031843 */ sra $v1, $v1, 1
/* 87F34 800EEA84 44830000 */ mtc1 $v1, $f0
/* 87F38 800EEA88 00000000 */ nop
/* 87F3C 800EEA8C 46800020 */ cvt.s.w $f0, $f0
/* 87F40 800EEA90 4600F780 */ add.s $f30, $f30, $f0
/* 87F44 800EEA94 4406E000 */ mfc1 $a2, $f28
/* 87F48 800EEA98 4600D306 */ mov.s $f12, $f26
/* 87F4C 800EEA9C E61E0064 */ swc1 $f30, 0x64($s0)
/* 87F50 800EEAA0 C4980030 */ lwc1 $f24, 0x30($a0)
/* 87F54 800EEAA4 3C014080 */ lui $at, (0x40800000 >> 16)
/* 87F58 800EEAA8 44810000 */ mtc1 $at, $f0
/* 87F5C 800EEAAC 4407C000 */ mfc1 $a3, $f24
/* 87F60 800EEAB0 4600B386 */ mov.s $f14, $f22
/* 87F64 800EEAB4 3C018010 */ lui $at, %hi(wSavedPartnerPosX)
/* 87F68 800EEAB8 E43A833C */ swc1 $f26, %lo(wSavedPartnerPosX)($at)
/* 87F6C 800EEABC 3C018010 */ lui $at, %hi(wSavedPartnerPosY)
/* 87F70 800EEAC0 E4348340 */ swc1 $f20, %lo(wSavedPartnerPosY)($at)
/* 87F74 800EEAC4 3C018010 */ lui $at, %hi(wSavedPartnerPosZ)
/* 87F78 800EEAC8 E4368344 */ swc1 $f22, %lo(wSavedPartnerPosZ)($at)
/* 87F7C 800EEACC E6000018 */ swc1 $f0, 0x18($s0)
/* 87F80 800EEAD0 E6020014 */ swc1 $f2, 0x14($s0)
/* 87F84 800EEAD4 0C00A7B5 */ jal dist2D
/* 87F88 800EEAD8 E6180068 */ swc1 $f24, 0x68($s0)
/* 87F8C 800EEADC 4600D306 */ mov.s $f12, $f26
/* 87F90 800EEAE0 4406E000 */ mfc1 $a2, $f28
/* 87F94 800EEAE4 4407C000 */ mfc1 $a3, $f24
/* 87F98 800EEAE8 4600B386 */ mov.s $f14, $f22
/* 87F9C 800EEAEC 0C00A720 */ jal atan2
/* 87FA0 800EEAF0 E6000010 */ swc1 $f0, 0x10($s0)
/* 87FA4 800EEAF4 2402000F */ addiu $v0, $zero, 0xF
/* 87FA8 800EEAF8 A602008E */ sh $v0, 0x8E($s0)
/* 87FAC 800EEAFC 8602008E */ lh $v0, 0x8E($s0)
/* 87FB0 800EEB00 C6020014 */ lwc1 $f2, 0x14($s0)
/* 87FB4 800EEB04 44823000 */ mtc1 $v0, $f6
/* 87FB8 800EEB08 00000000 */ nop
/* 87FBC 800EEB0C 468031A0 */ cvt.s.w $f6, $f6
/* 87FC0 800EEB10 46061082 */ mul.s $f2, $f2, $f6
/* 87FC4 800EEB14 00000000 */ nop
/* 87FC8 800EEB18 4614F501 */ sub.s $f20, $f30, $f20
/* 87FCC 800EEB1C 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 87FD0 800EEB20 44812000 */ mtc1 $at, $f4
/* 87FD4 800EEB24 46061082 */ mul.s $f2, $f2, $f6
/* 87FD8 800EEB28 00000000 */ nop
/* 87FDC 800EEB2C 3C014170 */ lui $at, (0x41700000 >> 16)
/* 87FE0 800EEB30 44814000 */ mtc1 $at, $f8
/* 87FE4 800EEB34 3C038011 */ lui $v1, %hi(wCurrentPartnerId)
/* 87FE8 800EEB38 8C63CFD8 */ lw $v1, %lo(wCurrentPartnerId)($v1)
/* 87FEC 800EEB3C E600000C */ swc1 $f0, 0xC($s0)
/* 87FF0 800EEB40 46041082 */ mul.s $f2, $f2, $f4
/* 87FF4 800EEB44 00000000 */ nop
/* 87FF8 800EEB48 000310C0 */ sll $v0, $v1, 3
/* 87FFC 800EEB4C 00431021 */ addu $v0, $v0, $v1
/* 88000 800EEB50 00021080 */ sll $v0, $v0, 2
/* 88004 800EEB54 C6040010 */ lwc1 $f4, 0x10($s0)
/* 88008 800EEB58 4602A500 */ add.s $f20, $f20, $f2
/* 8800C 800EEB5C 46082103 */ div.s $f4, $f4, $f8
/* 88010 800EEB60 E6040018 */ swc1 $f4, 0x18($s0)
/* 88014 800EEB64 4606A503 */ div.s $f20, $f20, $f6
/* 88018 800EEB68 E614001C */ swc1 $f20, 0x1C($s0)
/* 8801C 800EEB6C 3C018010 */ lui $at, %hi(gPartnerAnimations + 0x8)
/* 88020 800EEB70 00220821 */ addu $at, $at, $v0
/* 88024 800EEB74 8C228350 */ lw $v0, %lo(gPartnerAnimations + 0x8)($at)
/* 88028 800EEB78 0200202D */ daddu $a0, $s0, $zero
/* 8802C 800EEB7C 0C00EB49 */ jal enable_npc_blur
/* 88030 800EEB80 AC820028 */ sw $v0, 0x28($a0)
/* 88034 800EEB84 0803BB24 */ j .L800EEC90
/* 88038 800EEB88 A6320000 */ sh $s2, 0x0($s1)
.L800EEB8C:
/* 8803C 800EEB8C C600001C */ lwc1 $f0, 0x1C($s0)
/* 88040 800EEB90 C6020014 */ lwc1 $f2, 0x14($s0)
/* 88044 800EEB94 46020001 */ sub.s $f0, $f0, $f2
/* 88048 800EEB98 C602003C */ lwc1 $f2, 0x3C($s0)
/* 8804C 800EEB9C E600001C */ swc1 $f0, 0x1C($s0)
/* 88050 800EEBA0 46000106 */ mov.s $f4, $f0
/* 88054 800EEBA4 46001080 */ add.s $f2, $f2, $f0
/* 88058 800EEBA8 44800000 */ mtc1 $zero, $f0
/* 8805C 800EEBAC 00000000 */ nop
/* 88060 800EEBB0 4600203E */ c.le.s $f4, $f0
/* 88064 800EEBB4 00000000 */ nop
/* 88068 800EEBB8 4500000A */ bc1f .L800EEBE4
/* 8806C 800EEBBC E602003C */ swc1 $f2, 0x3C($s0)
/* 88070 800EEBC0 3C028011 */ lui $v0, %hi(wCurrentPartnerId)
/* 88074 800EEBC4 8C42CFD8 */ lw $v0, %lo(wCurrentPartnerId)($v0)
/* 88078 800EEBC8 000218C0 */ sll $v1, $v0, 3
/* 8807C 800EEBCC 00621821 */ addu $v1, $v1, $v0
/* 88080 800EEBD0 00031880 */ sll $v1, $v1, 2
/* 88084 800EEBD4 3C028010 */ lui $v0, %hi(gPartnerAnimations + 0xC)
/* 88088 800EEBD8 00431021 */ addu $v0, $v0, $v1
/* 8808C 800EEBDC 8C428354 */ lw $v0, %lo(gPartnerAnimations + 0xC)($v0)
/* 88090 800EEBE0 AE020028 */ sw $v0, 0x28($s0)
.L800EEBE4:
/* 88094 800EEBE4 8E06000C */ lw $a2, 0xC($s0)
/* 88098 800EEBE8 8E050018 */ lw $a1, 0x18($s0)
/* 8809C 800EEBEC 0C00EA95 */ jal npc_move_heading
/* 880A0 800EEBF0 0200202D */ daddu $a0, $s0, $zero
/* 880A4 800EEBF4 8602008E */ lh $v0, 0x8E($s0)
/* 880A8 800EEBF8 3C014120 */ lui $at, (0x41200000 >> 16)
/* 880AC 800EEBFC 44811000 */ mtc1 $at, $f2
/* 880B0 800EEC00 44820000 */ mtc1 $v0, $f0
/* 880B4 800EEC04 00000000 */ nop
/* 880B8 800EEC08 46800020 */ cvt.s.w $f0, $f0
/* 880BC 800EEC0C 4600103C */ c.lt.s $f2, $f0
/* 880C0 800EEC10 00000000 */ nop
/* 880C4 800EEC14 45030001 */ bc1tl .L800EEC1C
/* 880C8 800EEC18 46001006 */ mov.s $f0, $f2
.L800EEC1C:
/* 880CC 800EEC1C 9602008E */ lhu $v0, 0x8E($s0)
/* 880D0 800EEC20 46020003 */ div.s $f0, $f0, $f2
/* 880D4 800EEC24 E6000054 */ swc1 $f0, 0x54($s0)
/* 880D8 800EEC28 46000086 */ mov.s $f2, $f0
/* 880DC 800EEC2C E6000058 */ swc1 $f0, 0x58($s0)
/* 880E0 800EEC30 E602005C */ swc1 $f2, 0x5C($s0)
/* 880E4 800EEC34 2442FFFF */ addiu $v0, $v0, -0x1
/* 880E8 800EEC38 A602008E */ sh $v0, 0x8E($s0)
/* 880EC 800EEC3C 00021400 */ sll $v0, $v0, 16
/* 880F0 800EEC40 04410014 */ bgez $v0, .L800EEC94
/* 880F4 800EEC44 0000102D */ daddu $v0, $zero, $zero
/* 880F8 800EEC48 24020002 */ addiu $v0, $zero, 0x2
/* 880FC 800EEC4C 0803BB24 */ j .L800EEC90
/* 88100 800EEC50 A6220000 */ sh $v0, 0x0($s1)
.L800EEC54:
/* 88104 800EEC54 3C038011 */ lui $v1, %hi(wCurrentPartnerId)
/* 88108 800EEC58 8C63CFD8 */ lw $v1, %lo(wCurrentPartnerId)($v1)
/* 8810C 800EEC5C C6000064 */ lwc1 $f0, 0x64($s0)
/* 88110 800EEC60 000310C0 */ sll $v0, $v1, 3
/* 88114 800EEC64 00431021 */ addu $v0, $v0, $v1
/* 88118 800EEC68 00021080 */ sll $v0, $v0, 2
/* 8811C 800EEC6C 3C018010 */ lui $at, %hi(gPartnerAnimations + 0x10)
/* 88120 800EEC70 00220821 */ addu $at, $at, $v0
/* 88124 800EEC74 8C228358 */ lw $v0, %lo(gPartnerAnimations + 0x10)($at)
/* 88128 800EEC78 AC80001C */ sw $zero, 0x1C($a0)
/* 8812C 800EEC7C E480003C */ swc1 $f0, 0x3C($a0)
/* 88130 800EEC80 0C00EB6B */ jal disable_npc_blur
/* 88134 800EEC84 AC820028 */ sw $v0, 0x28($a0)
/* 88138 800EEC88 0803BB25 */ j .L800EEC94
/* 8813C 800EEC8C 24020001 */ addiu $v0, $zero, 0x1
.L800EEC90:
/* 88140 800EEC90 0000102D */ daddu $v0, $zero, $zero
.L800EEC94:
/* 88144 800EEC94 8FBF001C */ lw $ra, 0x1C($sp)
/* 88148 800EEC98 8FB20018 */ lw $s2, 0x18($sp)
/* 8814C 800EEC9C 8FB10014 */ lw $s1, 0x14($sp)
/* 88150 800EECA0 8FB00010 */ lw $s0, 0x10($sp)
/* 88154 800EECA4 D7BE0048 */ ldc1 $f30, 0x48($sp)
/* 88158 800EECA8 D7BC0040 */ ldc1 $f28, 0x40($sp)
/* 8815C 800EECAC D7BA0038 */ ldc1 $f26, 0x38($sp)
/* 88160 800EECB0 D7B80030 */ ldc1 $f24, 0x30($sp)
/* 88164 800EECB4 D7B60028 */ ldc1 $f22, 0x28($sp)
/* 88168 800EECB8 D7B40020 */ ldc1 $f20, 0x20($sp)
/* 8816C 800EECBC 03E00008 */ jr $ra
/* 88170 800EECC0 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
s32 partner_put_away(Npc* partner) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 tempMoveToY;
f32 tempMoveToZ;
f32 tempPosZ;
f32 tempMoveToX;
f32 tempPosX;
f32 tempPosY;
f32 tempDuration;
f32 divisor;
switch (wPartnerFollowState){
case 0:
tempMoveToX = partner->pos.x;
tempMoveToY = partner->pos.y;
tempMoveToZ = partner->pos.z;
partner->flags &= ~NPC_FLAG_GRAVITY;
partner->flags &= ~NPC_FLAG_8;
tempPosX = playerStatus->position.x;
partner->moveToPos.x = tempPosX;
tempPosY = playerStatus->position.y + (playerStatus->colliderHeight / 2);
partner->moveToPos.y = playerStatus->position.y + (playerStatus->colliderHeight / 2);
tempPosZ = playerStatus->position.z;
wSavedPartnerPosX = tempMoveToX;
wSavedPartnerPosY = tempMoveToY;
wSavedPartnerPosZ = tempMoveToZ;
partner->moveSpeed = 4.0f;
partner->jumpScale = 1.6f;
partner->moveToPos.z = tempPosZ;
partner->planarFlyDist = dist2D(tempMoveToX, tempMoveToZ, tempPosX, tempPosZ);
partner->yaw = atan2(tempMoveToX, tempMoveToZ, tempPosX, tempPosZ);
partner->duration = 0xF;
divisor = 15.0f;
partner->moveSpeed = partner->planarFlyDist / divisor;
tempMoveToY = tempPosY - tempMoveToY;
partner->jumpVelocity = (tempMoveToY + partner->jumpScale * partner->duration * partner->duration * 0.5f) / partner->duration;
partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].jump;
enable_npc_blur(partner);
wPartnerFollowState = 1;
break;
case 1:
partner->jumpVelocity -= partner->jumpScale;
partner->pos.y += partner->jumpVelocity;
if (partner->jumpVelocity <= 0.0f) {
partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall;
}
npc_move_heading(partner, partner->moveSpeed, partner->yaw);
tempDuration = partner->duration;
if (partner->duration > 10.0f) {
tempDuration = 10.0f;
}
partner->scale.x = tempDuration / 10.0f;
partner->scale.y = partner->scale.x;
partner->scale.z = partner->scale.x;
partner->duration--;
if (partner->duration >> 0x10 != 0) {
wPartnerFollowState = 2;
}
break;
case 2:
partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fly;
partner->jumpVelocity = 0.0f;
partner->pos.y = partner->moveToPos.y;
disable_npc_blur(partner);
return TRUE;
}
return FALSE;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel initialize_battle
/* 16CA10 8023E130 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 16CA14 8023E134 AFB3001C */ sw $s3, 0x1C($sp)
/* 16CA18 8023E138 3C138011 */ lui $s3, %hi(gPlayerData)
/* 16CA1C 8023E13C 2673F290 */ addiu $s3, $s3, %lo(gPlayerData)
/* 16CA20 8023E140 AFB40020 */ sw $s4, 0x20($sp)
/* 16CA24 8023E144 3C14800B */ lui $s4, %hi(gCameras + 0xAB0)
/* 16CA28 8023E148 26942830 */ addiu $s4, $s4, %lo(gCameras + 0xAB0)
/* 16CA2C 8023E14C AFB10014 */ sw $s1, 0x14($sp)
/* 16CA30 8023E150 2411000F */ addiu $s1, $zero, 0xF
/* 16CA34 8023E154 3C06800E */ lui $a2, %hi(gBattleStatus)
/* 16CA38 8023E158 24C6C070 */ addiu $a2, $a2, %lo(gBattleStatus)
/* 16CA3C 8023E15C 24C5003C */ addiu $a1, $a2, 0x3C
/* 16CA40 8023E160 3C04800A */ lui $a0, %hi(gOverrideFlags)
/* 16CA44 8023E164 2484A650 */ addiu $a0, $a0, %lo(gOverrideFlags)
/* 16CA48 8023E168 AFBF0024 */ sw $ra, 0x24($sp)
/* 16CA4C 8023E16C AFB20018 */ sw $s2, 0x18($sp)
/* 16CA50 8023E170 AFB00010 */ sw $s0, 0x10($sp)
/* 16CA54 8023E174 ACC00000 */ sw $zero, 0x0($a2)
/* 16CA58 8023E178 ACC00004 */ sw $zero, 0x4($a2)
/* 16CA5C 8023E17C ACC00000 */ sw $zero, 0x0($a2)
/* 16CA60 8023E180 8C820000 */ lw $v0, 0x0($a0)
/* 16CA64 8023E184 2403FFFF */ addiu $v1, $zero, -0x1
/* 16CA68 8023E188 ACC30224 */ sw $v1, 0x224($a2)
/* 16CA6C 8023E18C 2403FF7F */ addiu $v1, $zero, -0x81
/* 16CA70 8023E190 3C01802A */ lui $at, %hi(bSavedOverrideFlags)
/* 16CA74 8023E194 AC22DA34 */ sw $v0, %lo(bSavedOverrideFlags)($at)
/* 16CA78 8023E198 00431024 */ and $v0, $v0, $v1
/* 16CA7C 8023E19C AC820000 */ sw $v0, 0x0($a0)
/* 16CA80 8023E1A0 00431024 */ and $v0, $v0, $v1
/* 16CA84 8023E1A4 AC820000 */ sw $v0, 0x0($a0)
.L8023E1A8:
/* 16CA88 8023E1A8 ACA00330 */ sw $zero, 0x330($a1)
/* 16CA8C 8023E1AC 2631FFFF */ addiu $s1, $s1, -0x1
/* 16CA90 8023E1B0 0621FFFD */ bgez $s1, .L8023E1A8
/* 16CA94 8023E1B4 24A5FFFC */ addiu $a1, $a1, -0x4
/* 16CA98 8023E1B8 24110017 */ addiu $s1, $zero, 0x17
/* 16CA9C 8023E1BC 24C2005C */ addiu $v0, $a2, 0x5C
/* 16CAA0 8023E1C0 A0C00431 */ sb $zero, 0x431($a2)
/* 16CAA4 8023E1C4 A0C00430 */ sb $zero, 0x430($a2)
/* 16CAA8 8023E1C8 A0C00095 */ sb $zero, 0x95($a2)
.L8023E1CC:
/* 16CAAC 8023E1CC AC4000E0 */ sw $zero, 0xE0($v0)
/* 16CAB0 8023E1D0 2631FFFF */ addiu $s1, $s1, -0x1
/* 16CAB4 8023E1D4 0621FFFD */ bgez $s1, .L8023E1CC
/* 16CAB8 8023E1D8 2442FFFC */ addiu $v0, $v0, -0x4
/* 16CABC 8023E1DC 0000882D */ daddu $s1, $zero, $zero
/* 16CAC0 8023E1E0 2403FFFF */ addiu $v1, $zero, -0x1
/* 16CAC4 8023E1E4 ACC000D8 */ sw $zero, 0xD8($a2)
/* 16CAC8 8023E1E8 ACC000DC */ sw $zero, 0xDC($a2)
/* 16CACC 8023E1EC 00D11021 */ addu $v0, $a2, $s1
.L8023E1F0:
/* 16CAD0 8023E1F0 26310001 */ addiu $s1, $s1, 0x1
/* 16CAD4 8023E1F4 A043004C */ sb $v1, 0x4C($v0)
/* 16CAD8 8023E1F8 A043005C */ sb $v1, 0x5C($v0)
/* 16CADC 8023E1FC 2A220010 */ slti $v0, $s1, 0x10
/* 16CAE0 8023E200 5440FFFB */ bnel $v0, $zero, .L8023E1F0
/* 16CAE4 8023E204 00D11021 */ addu $v0, $a2, $s1
/* 16CAE8 8023E208 2411001B */ addiu $s1, $zero, 0x1B
/* 16CAEC 8023E20C 00D11021 */ addu $v0, $a2, $s1
.L8023E210:
/* 16CAF0 8023E210 A0400440 */ sb $zero, 0x440($v0)
/* 16CAF4 8023E214 2631FFFF */ addiu $s1, $s1, -0x1
/* 16CAF8 8023E218 0621FFFD */ bgez $s1, .L8023E210
/* 16CAFC 8023E21C 2442FFFF */ addiu $v0, $v0, -0x1
/* 16CB00 8023E220 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 16CB04 8023E224 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 16CB08 8023E228 9042007E */ lbu $v0, 0x7E($v0)
/* 16CB0C 8023E22C 30420001 */ andi $v0, $v0, 0x1
/* 16CB10 8023E230 10400009 */ beqz $v0, .L8023E258
/* 16CB14 8023E234 2404FFBF */ addiu $a0, $zero, -0x41
/* 16CB18 8023E238 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 16CB1C 8023E23C 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 16CB20 8023E240 8C620004 */ lw $v0, 0x4($v1)
/* 16CB24 8023E244 34420040 */ ori $v0, $v0, 0x40
/* 16CB28 8023E248 0C03A6D5 */ jal increment_status_bar_disabled
/* 16CB2C 8023E24C AC620004 */ sw $v0, 0x4($v1)
/* 16CB30 8023E250 0808F89B */ j .L8023E26C
/* 16CB34 8023E254 00000000 */ nop
.L8023E258:
/* 16CB38 8023E258 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 16CB3C 8023E25C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 16CB40 8023E260 8C430004 */ lw $v1, 0x4($v0)
/* 16CB44 8023E264 00641824 */ and $v1, $v1, $a0
/* 16CB48 8023E268 AC430004 */ sw $v1, 0x4($v0)
.L8023E26C:
/* 16CB4C 8023E26C 3C058024 */ lui $a1, %hi(btl_render_actors)
/* 16CB50 8023E270 24A5ED5C */ addiu $a1, $a1, %lo(btl_render_actors)
/* 16CB54 8023E274 0C048C56 */ jal create_worker_world
/* 16CB58 8023E278 0000202D */ daddu $a0, $zero, $zero
/* 16CB5C 8023E27C 0C093B70 */ jal func_8024EDC0
/* 16CB60 8023E280 0000882D */ daddu $s1, $zero, $zero
/* 16CB64 8023E284 0C09A3A2 */ jal func_80268E88
/* 16CB68 8023E288 00000000 */ nop
/* 16CB6C 8023E28C 0C051FB1 */ jal set_windows_visible
/* 16CB70 8023E290 24040001 */ addiu $a0, $zero, 0x1
/* 16CB74 8023E294 3C048029 */ lui $a0, %hi(HES_HPBar)
/* 16CB78 8023E298 24841F80 */ addiu $a0, $a0, %lo(HES_HPBar)
/* 16CB7C 8023E29C 0C050529 */ jal hud_element_create
/* 16CB80 8023E2A0 00000000 */ nop
/* 16CB84 8023E2A4 3C01802A */ lui $at, %hi(D_8029EFBC)
/* 16CB88 8023E2A8 AC22EFBC */ sw $v0, %lo(D_8029EFBC)($at)
/* 16CB8C 8023E2AC 0040202D */ daddu $a0, $v0, $zero
/* 16CB90 8023E2B0 0C051280 */ jal hud_element_set_flags
/* 16CB94 8023E2B4 24050080 */ addiu $a1, $zero, 0x80
/* 16CB98 8023E2B8 3C12802A */ lui $s2, %hi(D_8029EFC0)
/* 16CB9C 8023E2BC 2652EFC0 */ addiu $s2, $s2, %lo(D_8029EFC0)
.L8023E2C0:
/* 16CBA0 8023E2C0 3C048008 */ lui $a0, %hi(HES_Item_StarPoint)
/* 16CBA4 8023E2C4 24840FF0 */ addiu $a0, $a0, %lo(HES_Item_StarPoint)
/* 16CBA8 8023E2C8 0C050529 */ jal hud_element_create
/* 16CBAC 8023E2CC 26310001 */ addiu $s1, $s1, 0x1
/* 16CBB0 8023E2D0 AE420000 */ sw $v0, 0x0($s2)
/* 16CBB4 8023E2D4 0040802D */ daddu $s0, $v0, $zero
/* 16CBB8 8023E2D8 0200202D */ daddu $a0, $s0, $zero
/* 16CBBC 8023E2DC 0C051280 */ jal hud_element_set_flags
/* 16CBC0 8023E2E0 24050082 */ addiu $a1, $zero, 0x82
/* 16CBC4 8023E2E4 0200202D */ daddu $a0, $s0, $zero
/* 16CBC8 8023E2E8 0C051277 */ jal hud_element_set_render_depth
/* 16CBCC 8023E2EC 24050014 */ addiu $a1, $zero, 0x14
/* 16CBD0 8023E2F0 2A22000A */ slti $v0, $s1, 0xA
/* 16CBD4 8023E2F4 1440FFF2 */ bnez $v0, .L8023E2C0
/* 16CBD8 8023E2F8 26520004 */ addiu $s2, $s2, 0x4
/* 16CBDC 8023E2FC 0000882D */ daddu $s1, $zero, $zero
/* 16CBE0 8023E300 3C12802A */ lui $s2, %hi(D_8029EFE8)
/* 16CBE4 8023E304 2652EFE8 */ addiu $s2, $s2, %lo(D_8029EFE8)
.L8023E308:
/* 16CBE8 8023E308 3C048010 */ lui $a0, %hi(HES_StatusSPShine)
/* 16CBEC 8023E30C 24844BEC */ addiu $a0, $a0, %lo(HES_StatusSPShine)
/* 16CBF0 8023E310 0C050529 */ jal hud_element_create
/* 16CBF4 8023E314 26310001 */ addiu $s1, $s1, 0x1
/* 16CBF8 8023E318 AE420000 */ sw $v0, 0x0($s2)
/* 16CBFC 8023E31C 0040802D */ daddu $s0, $v0, $zero
/* 16CC00 8023E320 0200202D */ daddu $a0, $s0, $zero
/* 16CC04 8023E324 0C051280 */ jal hud_element_set_flags
/* 16CC08 8023E328 24050082 */ addiu $a1, $zero, 0x82
/* 16CC0C 8023E32C 0200202D */ daddu $a0, $s0, $zero
/* 16CC10 8023E330 0C051277 */ jal hud_element_set_render_depth
/* 16CC14 8023E334 24050014 */ addiu $a1, $zero, 0x14
/* 16CC18 8023E338 2A22000A */ slti $v0, $s1, 0xA
/* 16CC1C 8023E33C 1440FFF2 */ bnez $v0, .L8023E308
/* 16CC20 8023E340 26520004 */ addiu $s2, $s2, 0x4
/* 16CC24 8023E344 0000882D */ daddu $s1, $zero, $zero
/* 16CC28 8023E348 3C12802A */ lui $s2, %hi(D_8029F010)
/* 16CC2C 8023E34C 2652F010 */ addiu $s2, $s2, %lo(D_8029F010)
.L8023E350:
/* 16CC30 8023E350 3C048008 */ lui $a0, %hi(HES_Item_SmallStarPoint)
/* 16CC34 8023E354 248410C8 */ addiu $a0, $a0, %lo(HES_Item_SmallStarPoint)
/* 16CC38 8023E358 0C050529 */ jal hud_element_create
/* 16CC3C 8023E35C 26310001 */ addiu $s1, $s1, 0x1
/* 16CC40 8023E360 AE420000 */ sw $v0, 0x0($s2)
/* 16CC44 8023E364 0040802D */ daddu $s0, $v0, $zero
/* 16CC48 8023E368 0200202D */ daddu $a0, $s0, $zero
/* 16CC4C 8023E36C 0C051280 */ jal hud_element_set_flags
/* 16CC50 8023E370 24050082 */ addiu $a1, $zero, 0x82
/* 16CC54 8023E374 0200202D */ daddu $a0, $s0, $zero
/* 16CC58 8023E378 0C051277 */ jal hud_element_set_render_depth
/* 16CC5C 8023E37C 24050014 */ addiu $a1, $zero, 0x14
/* 16CC60 8023E380 2A22000A */ slti $v0, $s1, 0xA
/* 16CC64 8023E384 1440FFF2 */ bnez $v0, .L8023E350
/* 16CC68 8023E388 26520004 */ addiu $s2, $s2, 0x4
/* 16CC6C 8023E38C 3C028024 */ lui $v0, %hi(tattle_cam_pre_render)
/* 16CC70 8023E390 2442F088 */ addiu $v0, $v0, %lo(tattle_cam_pre_render)
/* 16CC74 8023E394 AE8201FC */ sw $v0, 0x1FC($s4)
/* 16CC78 8023E398 966302A2 */ lhu $v1, 0x2A2($s3)
/* 16CC7C 8023E39C 3C028024 */ lui $v0, %hi(func_8023FF84)
/* 16CC80 8023E3A0 2442FF84 */ addiu $v0, $v0, %lo(func_8023FF84)
/* 16CC84 8023E3A4 AE820200 */ sw $v0, 0x200($s4)
/* 16CC88 8023E3A8 2C62270F */ sltiu $v0, $v1, 0x270F
/* 16CC8C 8023E3AC 10400002 */ beqz $v0, .L8023E3B8
/* 16CC90 8023E3B0 24620001 */ addiu $v0, $v1, 0x1
/* 16CC94 8023E3B4 A66202A2 */ sh $v0, 0x2A2($s3)
.L8023E3B8:
/* 16CC98 8023E3B8 3C02800E */ lui $v0, %hi(gBattleStatus + 0x4)
/* 16CC9C 8023E3BC 8C42C074 */ lw $v0, %lo(gBattleStatus + 0x4)($v0)
/* 16CCA0 8023E3C0 82630012 */ lb $v1, 0x12($s3)
/* 16CCA4 8023E3C4 30420040 */ andi $v0, $v0, 0x40
/* 16CCA8 8023E3C8 3C01802A */ lui $at, %hi(bSavedPartner)
/* 16CCAC 8023E3CC AC23DA30 */ sw $v1, %lo(bSavedPartner)($at)
/* 16CCB0 8023E3D0 10400002 */ beqz $v0, .L8023E3DC
/* 16CCB4 8023E3D4 2402000B */ addiu $v0, $zero, 0xB
/* 16CCB8 8023E3D8 A2620012 */ sb $v0, 0x12($s3)
.L8023E3DC:
/* 16CCBC 8023E3DC 8FBF0024 */ lw $ra, 0x24($sp)
/* 16CCC0 8023E3E0 8FB40020 */ lw $s4, 0x20($sp)
/* 16CCC4 8023E3E4 8FB3001C */ lw $s3, 0x1C($sp)
/* 16CCC8 8023E3E8 8FB20018 */ lw $s2, 0x18($sp)
/* 16CCCC 8023E3EC 8FB10014 */ lw $s1, 0x14($sp)
/* 16CCD0 8023E3F0 8FB00010 */ lw $s0, 0x10($sp)
/* 16CCD4 8023E3F4 03E00008 */ jr $ra
/* 16CCD8 8023E3F8 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void initialize_battle(void) {
PlayerData* playerData = &gPlayerData;
BattleStatus* battleStatus = &gBattleStatus;
Camera* tattleCam = &gCameras[CAM_TATTLE];
s32 hudElemID;
s32 i;
gBattleStatus.flags1 = 0;
gBattleStatus.flags2 = 0;
gBattleStatus.flags1 = 0;
bSavedOverrideFlags = gOverrideFlags;
gOverrideFlags &= ~GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION;
gBattleStatus.inputBitmask = -1;
gOverrideFlags &= ~GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION;
for (i = 0; i < 16; i++) {
battleStatus->pushInputBuffer[i] = 0; // @bug? why just 16
}
battleStatus->inputBufferPos = 0;
battleStatus->holdInputBufferPos = 0;
battleStatus->unk_95 = 0;
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
battleStatus->enemyActors[i] = NULL;
}
battleStatus->playerActor = NULL;
battleStatus->partnerActor = NULL;
for (i = 0; i < ARRAY_COUNT(battleStatus->lastPlayerMenuSelection); i++) {
battleStatus->lastPlayerMenuSelection[i] = -1;
battleStatus->lastPartnerMenuSelection[i] = -1;
}
for (i = 0; i < ARRAY_COUNT(battleStatus->tattleFlags); i++) {
battleStatus->tattleFlags[i] = 0;
}
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) {
gBattleStatus.flags2 |= BS_FLAGS2_PEACH_BATTLE;
increment_status_bar_disabled();
} else {
gBattleStatus.flags2 &= ~BS_FLAGS2_PEACH_BATTLE;
}
create_worker_world(NULL, btl_render_actors);
btl_popup_messages_init();
func_80268E88();
set_windows_visible(WINDOW_GROUP_1);
D_8029EFBC = hud_element_create(&HES_HPBar);
hud_element_set_flags(D_8029EFBC, HUD_ELEMENT_FLAG_80);
for (i = 0; i < ARRAY_COUNT(D_8029EFC0); i++) {
hudElemID = D_8029EFC0[i] = hud_element_create(&HES_Item_StarPoint);
hud_element_set_flags(hudElemID, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED);
hud_element_set_render_depth(hudElemID, 20);
}
for (i = 0; i < ARRAY_COUNT(D_8029EFE8); i++) {
hudElemID = D_8029EFE8[i] = hud_element_create(&HES_StatusSPShine);
hud_element_set_flags(hudElemID, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED);
hud_element_set_render_depth(hudElemID, 20);
}
for (i = 0; i < ARRAY_COUNT(D_8029F010); i++) {
hudElemID = D_8029F010[i] = hud_element_create(&HES_Item_SmallStarPoint);
hud_element_set_flags(hudElemID, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED);
hud_element_set_render_depth(hudElemID, 20);
}
tattleCam->fpDoPreRender = tattle_cam_pre_render;
tattleCam->fpDoPostRender = func_8023FF84;
if (playerData->battlesCount < 9999) {
playerData->battlesCount++;
}
bSavedPartner = playerData->currentPartner;
if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
playerData->currentPartner = PARTNER_TWINK;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel snowfall_appendGfx
/* 38CD18 E008A728 27BDFF70 */ addiu $sp, $sp, -0x90
/* 38CD1C E008A72C AFB1006C */ sw $s1, 0x6C($sp)
/* 38CD20 E008A730 0080882D */ daddu $s1, $a0, $zero
/* 38CD24 E008A734 AFBF008C */ sw $ra, 0x8C($sp)
/* 38CD28 E008A738 AFBE0088 */ sw $fp, 0x88($sp)
/* 38CD2C E008A73C AFB70084 */ sw $s7, 0x84($sp)
/* 38CD30 E008A740 AFB60080 */ sw $s6, 0x80($sp)
/* 38CD34 E008A744 AFB5007C */ sw $s5, 0x7C($sp)
/* 38CD38 E008A748 AFB40078 */ sw $s4, 0x78($sp)
/* 38CD3C E008A74C AFB30074 */ sw $s3, 0x74($sp)
/* 38CD40 E008A750 AFB20070 */ sw $s2, 0x70($sp)
/* 38CD44 E008A754 AFB00068 */ sw $s0, 0x68($sp)
/* 38CD48 E008A758 8E33000C */ lw $s3, 0xC($s1)
/* 38CD4C E008A75C 8E620000 */ lw $v0, 0x0($s3)
/* 38CD50 E008A760 104000AF */ beqz $v0, .LE008AA20
/* 38CD54 E008A764 240200FF */ addiu $v0, $zero, 0xFF
/* 38CD58 E008A768 8E690028 */ lw $t1, 0x28($s3)
/* 38CD5C E008A76C 8E630004 */ lw $v1, 0x4($s3)
/* 38CD60 E008A770 A3A20059 */ sb $v0, 0x59($sp)
/* 38CD64 E008A774 3C028015 */ lui $v0, %hi(gBackgroundFogModePtr)
/* 38CD68 E008A778 8C4212F0 */ lw $v0, %lo(gBackgroundFogModePtr)($v0)
/* 38CD6C E008A77C 8E7E002C */ lw $fp, 0x2C($s3)
/* 38CD70 E008A780 00031880 */ sll $v1, $v1, 2
/* 38CD74 E008A784 90420000 */ lbu $v0, 0x0($v0)
/* 38CD78 E008A788 3C01E009 */ lui $at, (0xE0090000 >> 16)
/* 38CD7C E008A78C 00230821 */ addu $at, $at, $v1
/* 38CD80 E008A790 8C23AA50 */ lw $v1, -0x55B0($at)
/* 38CD84 E008A794 24040001 */ addiu $a0, $zero, 0x1
/* 38CD88 E008A798 14440009 */ bne $v0, $a0, .LE008A7C0
/* 38CD8C E008A79C AFA3005C */ sw $v1, 0x5C($sp)
/* 38CD90 E008A7A0 27A40058 */ addiu $a0, $sp, 0x58
/* 38CD94 E008A7A4 0080282D */ daddu $a1, $a0, $zero
/* 38CD98 E008A7A8 0080302D */ daddu $a2, $a0, $zero
/* 38CD9C E008A7AC 0C08019C */ jal shim_get_background_color_blend
/* 38CDA0 E008A7B0 27A70059 */ addiu $a3, $sp, 0x59
/* 38CDA4 E008A7B4 93A30059 */ lbu $v1, 0x59($sp)
/* 38CDA8 E008A7B8 240200FF */ addiu $v0, $zero, 0xFF
/* 38CDAC E008A7BC 00434823 */ subu $t1, $v0, $v1
.LE008A7C0:
/* 38CDB0 E008A7C0 11200097 */ beqz $t1, .LE008AA20
/* 38CDB4 E008A7C4 3C08DB06 */ lui $t0, (0xDB060024 >> 16)
/* 38CDB8 E008A7C8 35080024 */ ori $t0, $t0, (0xDB060024 & 0xFFFF)
/* 38CDBC E008A7CC 27A40018 */ addiu $a0, $sp, 0x18
/* 38CDC0 E008A7D0 3C100001 */ lui $s0, (0x11630 >> 16)
/* 38CDC4 E008A7D4 36101630 */ ori $s0, $s0, (0x11630 & 0xFFFF)
/* 38CDC8 E008A7D8 3C16800A */ lui $s6, %hi(gMainGfxPos)
/* 38CDCC E008A7DC 26D6A66C */ addiu $s6, $s6, %lo(gMainGfxPos)
/* 38CDD0 E008A7E0 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 38CDD4 E008A7E4 8EC50000 */ lw $a1, 0x0($s6)
/* 38CDD8 E008A7E8 44800000 */ mtc1 $zero, $f0
/* 38CDDC E008A7EC 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 38CDE0 E008A7F0 00A0182D */ daddu $v1, $a1, $zero
/* 38CDE4 E008A7F4 44060000 */ mfc1 $a2, $f0
/* 38CDE8 E008A7F8 24A50008 */ addiu $a1, $a1, 0x8
/* 38CDEC E008A7FC AEC50000 */ sw $a1, 0x0($s6)
/* 38CDF0 E008A800 AC620000 */ sw $v0, 0x0($v1)
/* 38CDF4 E008A804 24A20008 */ addiu $v0, $a1, 0x8
/* 38CDF8 E008A808 AC600004 */ sw $zero, 0x4($v1)
/* 38CDFC E008A80C AEC20000 */ sw $v0, 0x0($s6)
/* 38CE00 E008A810 ACA80000 */ sw $t0, 0x0($a1)
/* 38CE04 E008A814 8E230010 */ lw $v1, 0x10($s1)
/* 38CE08 E008A818 24A20010 */ addiu $v0, $a1, 0x10
/* 38CE0C E008A81C AEC20000 */ sw $v0, 0x0($s6)
/* 38CE10 E008A820 8C68001C */ lw $t0, 0x1C($v1)
/* 38CE14 E008A824 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 38CE18 E008A828 ACA20008 */ sw $v0, 0x8($a1)
/* 38CE1C E008A82C 3C020900 */ lui $v0, %hi(D_09000C00_415C60)
/* 38CE20 E008A830 24420C00 */ addiu $v0, $v0, %lo(D_09000C00_415C60)
/* 38CE24 E008A834 ACA2000C */ sw $v0, 0xC($a1)
/* 38CE28 E008A838 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 38CE2C E008A83C ACA20010 */ sw $v0, 0x10($a1)
/* 38CE30 E008A840 2402FF00 */ addiu $v0, $zero, -0x100
/* 38CE34 E008A844 01221025 */ or $v0, $t1, $v0
/* 38CE38 E008A848 ACA20014 */ sw $v0, 0x14($a1)
/* 38CE3C E008A84C 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 38CE40 E008A850 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 38CE44 E008A854 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 38CE48 E008A858 01024021 */ addu $t0, $t0, $v0
/* 38CE4C E008A85C 00031080 */ sll $v0, $v1, 2
/* 38CE50 E008A860 00431021 */ addu $v0, $v0, $v1
/* 38CE54 E008A864 00021080 */ sll $v0, $v0, 2
/* 38CE58 E008A868 00431023 */ subu $v0, $v0, $v1
/* 38CE5C E008A86C 000218C0 */ sll $v1, $v0, 3
/* 38CE60 E008A870 00431021 */ addu $v0, $v0, $v1
/* 38CE64 E008A874 000210C0 */ sll $v0, $v0, 3
/* 38CE68 E008A878 ACA80004 */ sw $t0, 0x4($a1)
/* 38CE6C E008A87C 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 38CE70 E008A880 00220821 */ addu $at, $at, $v0
/* 38CE74 E008A884 C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 38CE78 E008A888 24A50018 */ addiu $a1, $a1, 0x18
/* 38CE7C E008A88C AEC50000 */ sw $a1, 0x0($s6)
/* 38CE80 E008A890 46000007 */ neg.s $f0, $f0
/* 38CE84 E008A894 44050000 */ mfc1 $a1, $f0
/* 38CE88 E008A898 26730034 */ addiu $s3, $s3, 0x34
/* 38CE8C E008A89C 0C080104 */ jal shim_guRotateF
/* 38CE90 E008A8A0 AFA60010 */ sw $a2, 0x10($sp)
/* 38CE94 E008A8A4 27A40018 */ addiu $a0, $sp, 0x18
/* 38CE98 E008A8A8 3C128007 */ lui $s2, %hi(gMatrixListPos)
/* 38CE9C E008A8AC 265241F0 */ addiu $s2, $s2, %lo(gMatrixListPos)
/* 38CEA0 E008A8B0 3C14800A */ lui $s4, %hi(gDisplayContext)
/* 38CEA4 E008A8B4 2694A674 */ addiu $s4, $s4, %lo(gDisplayContext)
/* 38CEA8 E008A8B8 96450000 */ lhu $a1, 0x0($s2)
/* 38CEAC E008A8BC 8E820000 */ lw $v0, 0x0($s4)
/* 38CEB0 E008A8C0 00052980 */ sll $a1, $a1, 6
/* 38CEB4 E008A8C4 00B02821 */ addu $a1, $a1, $s0
/* 38CEB8 E008A8C8 0C080118 */ jal shim_guMtxF2L
/* 38CEBC E008A8CC 00452821 */ addu $a1, $v0, $a1
/* 38CEC0 E008A8D0 96420000 */ lhu $v0, 0x0($s2)
/* 38CEC4 E008A8D4 0000882D */ daddu $s1, $zero, $zero
/* 38CEC8 E008A8D8 24430001 */ addiu $v1, $v0, 0x1
/* 38CECC E008A8DC 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 38CED0 E008A8E0 00021180 */ sll $v0, $v0, 6
/* 38CED4 E008A8E4 A6430000 */ sh $v1, 0x0($s2)
/* 38CED8 E008A8E8 8E830000 */ lw $v1, 0x0($s4)
/* 38CEDC E008A8EC 00501021 */ addu $v0, $v0, $s0
/* 38CEE0 E008A8F0 00621821 */ addu $v1, $v1, $v0
/* 38CEE4 E008A8F4 1BC00041 */ blez $fp, .LE008A9FC
/* 38CEE8 E008A8F8 AFA30060 */ sw $v1, 0x60($sp)
/* 38CEEC E008A8FC 0280B82D */ daddu $s7, $s4, $zero
/* 38CEF0 E008A900 0240A82D */ daddu $s5, $s2, $zero
/* 38CEF4 E008A904 3C140001 */ lui $s4, (0x11630 >> 16)
/* 38CEF8 E008A908 36941630 */ ori $s4, $s4, (0x11630 & 0xFFFF)
/* 38CEFC E008A90C 02C0902D */ daddu $s2, $s6, $zero
/* 38CF00 E008A910 26700010 */ addiu $s0, $s3, 0x10
.LE008A914:
/* 38CF04 E008A914 8E020020 */ lw $v0, 0x20($s0)
/* 38CF08 E008A918 5C400035 */ bgtzl $v0, .LE008A9F0
/* 38CF0C E008A91C 26310001 */ addiu $s1, $s1, 0x1
/* 38CF10 E008A920 8E020018 */ lw $v0, 0x18($s0)
/* 38CF14 E008A924 50400032 */ beql $v0, $zero, .LE008A9F0
/* 38CF18 E008A928 26310001 */ addiu $s1, $s1, 0x1
/* 38CF1C E008A92C 8E05FFF8 */ lw $a1, -0x8($s0)
/* 38CF20 E008A930 8E06FFFC */ lw $a2, -0x4($s0)
/* 38CF24 E008A934 8E070000 */ lw $a3, 0x0($s0)
/* 38CF28 E008A938 0C080108 */ jal shim_guTranslateF
/* 38CF2C E008A93C 27A40018 */ addiu $a0, $sp, 0x18
/* 38CF30 E008A940 27A40018 */ addiu $a0, $sp, 0x18
/* 38CF34 E008A944 96A50000 */ lhu $a1, 0x0($s5)
/* 38CF38 E008A948 8EE20000 */ lw $v0, 0x0($s7)
/* 38CF3C E008A94C 00052980 */ sll $a1, $a1, 6
/* 38CF40 E008A950 00B42821 */ addu $a1, $a1, $s4
/* 38CF44 E008A954 0C080118 */ jal shim_guMtxF2L
/* 38CF48 E008A958 00452821 */ addu $a1, $v0, $a1
/* 38CF4C E008A95C 3C02DA38 */ lui $v0, (0xDA380002 >> 16)
/* 38CF50 E008A960 34420002 */ ori $v0, $v0, (0xDA380002 & 0xFFFF)
/* 38CF54 E008A964 3C06DA38 */ lui $a2, (0xDA380001 >> 16)
/* 38CF58 E008A968 34C60001 */ ori $a2, $a2, (0xDA380001 & 0xFFFF)
/* 38CF5C E008A96C 3C07D838 */ lui $a3, (0xD8380002 >> 16)
/* 38CF60 E008A970 34E70002 */ ori $a3, $a3, (0xD8380002 & 0xFFFF)
/* 38CF64 E008A974 8E440000 */ lw $a0, 0x0($s2)
/* 38CF68 E008A978 96A30000 */ lhu $v1, 0x0($s5)
/* 38CF6C E008A97C 0080282D */ daddu $a1, $a0, $zero
/* 38CF70 E008A980 24840008 */ addiu $a0, $a0, 0x8
/* 38CF74 E008A984 AE440000 */ sw $a0, 0x0($s2)
/* 38CF78 E008A988 ACA20000 */ sw $v0, 0x0($a1)
/* 38CF7C E008A98C 24620001 */ addiu $v0, $v1, 0x1
/* 38CF80 E008A990 3063FFFF */ andi $v1, $v1, 0xFFFF
/* 38CF84 E008A994 00031980 */ sll $v1, $v1, 6
/* 38CF88 E008A998 A6A20000 */ sh $v0, 0x0($s5)
/* 38CF8C E008A99C 8EE20000 */ lw $v0, 0x0($s7)
/* 38CF90 E008A9A0 00741821 */ addu $v1, $v1, $s4
/* 38CF94 E008A9A4 00431021 */ addu $v0, $v0, $v1
/* 38CF98 E008A9A8 ACA20004 */ sw $v0, 0x4($a1)
/* 38CF9C E008A9AC 24820008 */ addiu $v0, $a0, 0x8
/* 38CFA0 E008A9B0 AE420000 */ sw $v0, 0x0($s2)
/* 38CFA4 E008A9B4 AC860000 */ sw $a2, 0x0($a0)
/* 38CFA8 E008A9B8 8FAA0060 */ lw $t2, 0x60($sp)
/* 38CFAC E008A9BC 24820010 */ addiu $v0, $a0, 0x10
/* 38CFB0 E008A9C0 AC8A0004 */ sw $t2, 0x4($a0)
/* 38CFB4 E008A9C4 AE420000 */ sw $v0, 0x0($s2)
/* 38CFB8 E008A9C8 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 38CFBC E008A9CC AC820008 */ sw $v0, 0x8($a0)
/* 38CFC0 E008A9D0 8FAA005C */ lw $t2, 0x5C($sp)
/* 38CFC4 E008A9D4 24820018 */ addiu $v0, $a0, 0x18
/* 38CFC8 E008A9D8 AC8A000C */ sw $t2, 0xC($a0)
/* 38CFCC E008A9DC AE420000 */ sw $v0, 0x0($s2)
/* 38CFD0 E008A9E0 24020040 */ addiu $v0, $zero, 0x40
/* 38CFD4 E008A9E4 AC870010 */ sw $a3, 0x10($a0)
/* 38CFD8 E008A9E8 AC820014 */ sw $v0, 0x14($a0)
/* 38CFDC E008A9EC 26310001 */ addiu $s1, $s1, 0x1
.LE008A9F0:
/* 38CFE0 E008A9F0 023E102A */ slt $v0, $s1, $fp
/* 38CFE4 E008A9F4 1440FFC7 */ bnez $v0, .LE008A914
/* 38CFE8 E008A9F8 26100034 */ addiu $s0, $s0, 0x34
.LE008A9FC:
/* 38CFEC E008A9FC 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 38CFF0 E008AA00 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 38CFF4 E008AA04 8C620000 */ lw $v0, 0x0($v1)
/* 38CFF8 E008AA08 0040202D */ daddu $a0, $v0, $zero
/* 38CFFC E008AA0C 24420008 */ addiu $v0, $v0, 0x8
/* 38D000 E008AA10 AC620000 */ sw $v0, 0x0($v1)
/* 38D004 E008AA14 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 38D008 E008AA18 AC820000 */ sw $v0, 0x0($a0)
/* 38D00C E008AA1C AC800004 */ sw $zero, 0x4($a0)
.LE008AA20:
/* 38D010 E008AA20 8FBF008C */ lw $ra, 0x8C($sp)
/* 38D014 E008AA24 8FBE0088 */ lw $fp, 0x88($sp)
/* 38D018 E008AA28 8FB70084 */ lw $s7, 0x84($sp)
/* 38D01C E008AA2C 8FB60080 */ lw $s6, 0x80($sp)
/* 38D020 E008AA30 8FB5007C */ lw $s5, 0x7C($sp)
/* 38D024 E008AA34 8FB40078 */ lw $s4, 0x78($sp)
/* 38D028 E008AA38 8FB30074 */ lw $s3, 0x74($sp)
/* 38D02C E008AA3C 8FB20070 */ lw $s2, 0x70($sp)
/* 38D030 E008AA40 8FB1006C */ lw $s1, 0x6C($sp)
/* 38D034 E008AA44 8FB00068 */ lw $s0, 0x68($sp)
/* 38D038 E008AA48 03E00008 */ jr $ra
/* 38D03C E008AA4C 27BD0090 */ addiu $sp, $sp, 0x90
### DECOMPILED C INSTRUCTIONS:
void snowfall_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
SnowfallFXData* data = effectTemp->data.snowfall;
Matrix4f sp18;
Gfx* dlist;
Mtx* mtx;
u8 bgRGB;
u8 bgAlpha;
s32 unk_28;
s32 unk_2C;
s32 i;
if (data->unk_00 != 0) {
unk_28 = data->unk_28;
bgAlpha = 255;
unk_2C = data->unk_2C;
dlist = D_E008AA50[data->unk_04];
if (*gBackgroundFogModePtr == 1) {
shim_get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha);
unk_28 = 255 - bgAlpha;
}
if (unk_28 != 0) {
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09000C00_38DC70);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, unk_28);
shim_guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
mtx = &gDisplayContext->matrixStack[gMatrixListPos++];
data++;
for (i = 0; i < unk_2C; i++, data++) {
if (data->unk_30 <= 0 && data->unk_28 != 0) {
shim_guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, mtx,
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, dlist);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
gDPPipeSync(gMainGfxPos++);
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel snaking_static_update
/* 3B2504 E00AE1B4 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 3B2508 E00AE1B8 AFB3001C */ sw $s3, 0x1C($sp)
/* 3B250C E00AE1BC 0080982D */ daddu $s3, $a0, $zero
/* 3B2510 E00AE1C0 AFBF0020 */ sw $ra, 0x20($sp)
/* 3B2514 E00AE1C4 AFB20018 */ sw $s2, 0x18($sp)
/* 3B2518 E00AE1C8 AFB10014 */ sw $s1, 0x14($sp)
/* 3B251C E00AE1CC AFB00010 */ sw $s0, 0x10($sp)
/* 3B2520 E00AE1D0 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 3B2524 E00AE1D4 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 3B2528 E00AE1D8 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 3B252C E00AE1DC F7B60030 */ sdc1 $f22, 0x30($sp)
/* 3B2530 E00AE1E0 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 3B2534 E00AE1E4 8E630000 */ lw $v1, 0x0($s3)
/* 3B2538 E00AE1E8 8E71000C */ lw $s1, 0xC($s3)
/* 3B253C E00AE1EC 30620010 */ andi $v0, $v1, 0x10
/* 3B2540 E00AE1F0 10400005 */ beqz $v0, .LE00AE208
/* 3B2544 E00AE1F4 2402FFEF */ addiu $v0, $zero, -0x11
/* 3B2548 E00AE1F8 00621024 */ and $v0, $v1, $v0
/* 3B254C E00AE1FC AE620000 */ sw $v0, 0x0($s3)
/* 3B2550 E00AE200 24020010 */ addiu $v0, $zero, 0x10
/* 3B2554 E00AE204 AE220010 */ sw $v0, 0x10($s1)
.LE00AE208:
/* 3B2558 E00AE208 8E230010 */ lw $v1, 0x10($s1)
/* 3B255C E00AE20C 286203E8 */ slti $v0, $v1, 0x3E8
/* 3B2560 E00AE210 10400002 */ beqz $v0, .LE00AE21C
/* 3B2564 E00AE214 2462FFFF */ addiu $v0, $v1, -0x1
/* 3B2568 E00AE218 AE220010 */ sw $v0, 0x10($s1)
.LE00AE21C:
/* 3B256C E00AE21C 8E220014 */ lw $v0, 0x14($s1)
/* 3B2570 E00AE220 8E230010 */ lw $v1, 0x10($s1)
/* 3B2574 E00AE224 24440001 */ addiu $a0, $v0, 0x1
/* 3B2578 E00AE228 04610005 */ bgez $v1, .LE00AE240
/* 3B257C E00AE22C AE240014 */ sw $a0, 0x14($s1)
/* 3B2580 E00AE230 0C080128 */ jal shim_remove_effect
/* 3B2584 E00AE234 0260202D */ daddu $a0, $s3, $zero
/* 3B2588 E00AE238 0802B933 */ j .LE00AE4CC
/* 3B258C E00AE23C 00000000 */ nop
.LE00AE240:
/* 3B2590 E00AE240 28620010 */ slti $v0, $v1, 0x10
/* 3B2594 E00AE244 10400002 */ beqz $v0, .LE00AE250
/* 3B2598 E00AE248 00031100 */ sll $v0, $v1, 4
/* 3B259C E00AE24C AE220024 */ sw $v0, 0x24($s1)
.LE00AE250:
/* 3B25A0 E00AE250 28820010 */ slti $v0, $a0, 0x10
/* 3B25A4 E00AE254 10400003 */ beqz $v0, .LE00AE264
/* 3B25A8 E00AE258 00041100 */ sll $v0, $a0, 4
/* 3B25AC E00AE25C 2442000F */ addiu $v0, $v0, 0xF
/* 3B25B0 E00AE260 AE220024 */ sw $v0, 0x24($s1)
.LE00AE264:
/* 3B25B4 E00AE264 8E620008 */ lw $v0, 0x8($s3)
/* 3B25B8 E00AE268 24120001 */ addiu $s2, $zero, 0x1
/* 3B25BC E00AE26C 0242102A */ slt $v0, $s2, $v0
/* 3B25C0 E00AE270 1040008B */ beqz $v0, .LE00AE4A0
/* 3B25C4 E00AE274 26310044 */ addiu $s1, $s1, 0x44
/* 3B25C8 E00AE278 4480E000 */ mtc1 $zero, $f28
/* 3B25CC E00AE27C 26300014 */ addiu $s0, $s1, 0x14
.LE00AE280:
/* 3B25D0 E00AE280 8E020000 */ lw $v0, 0x0($s0)
/* 3B25D4 E00AE284 8E03FFFC */ lw $v1, -0x4($s0)
/* 3B25D8 E00AE288 0043102A */ slt $v0, $v0, $v1
/* 3B25DC E00AE28C 1440000E */ bnez $v0, .LE00AE2C8
/* 3B25E0 E00AE290 00000000 */ nop
/* 3B25E4 E00AE294 0C080138 */ jal shim_rand_int
/* 3B25E8 E00AE298 24040032 */ addiu $a0, $zero, 0x32
/* 3B25EC E00AE29C 24040168 */ addiu $a0, $zero, 0x168
/* 3B25F0 E00AE2A0 24420014 */ addiu $v0, $v0, 0x14
/* 3B25F4 E00AE2A4 AE02FFFC */ sw $v0, -0x4($s0)
/* 3B25F8 E00AE2A8 0C080138 */ jal shim_rand_int
/* 3B25FC E00AE2AC AE000000 */ sw $zero, 0x0($s0)
/* 3B2600 E00AE2B0 44820000 */ mtc1 $v0, $f0
/* 3B2604 E00AE2B4 00000000 */ nop
/* 3B2608 E00AE2B8 46800020 */ cvt.s.w $f0, $f0
/* 3B260C E00AE2BC E6000028 */ swc1 $f0, 0x28($s0)
/* 3B2610 E00AE2C0 AE00FFF0 */ sw $zero, -0x10($s0)
/* 3B2614 E00AE2C4 AE00FFF4 */ sw $zero, -0xC($s0)
.LE00AE2C8:
/* 3B2618 E00AE2C8 0C080138 */ jal shim_rand_int
/* 3B261C E00AE2CC 24040064 */ addiu $a0, $zero, 0x64
/* 3B2620 E00AE2D0 28420033 */ slti $v0, $v0, 0x33
/* 3B2624 E00AE2D4 10400047 */ beqz $v0, .LE00AE3F4
/* 3B2628 E00AE2D8 00000000 */ nop
/* 3B262C E00AE2DC C618FFF0 */ lwc1 $f24, -0x10($s0)
/* 3B2630 E00AE2E0 C61AFFF4 */ lwc1 $f26, -0xC($s0)
/* 3B2634 E00AE2E4 0C080138 */ jal shim_rand_int
/* 3B2638 E00AE2E8 24040010 */ addiu $a0, $zero, 0x10
/* 3B263C E00AE2EC 2442FFF8 */ addiu $v0, $v0, -0x8
/* 3B2640 E00AE2F0 4482B000 */ mtc1 $v0, $f22
/* 3B2644 E00AE2F4 00000000 */ nop
/* 3B2648 E00AE2F8 4680B5A0 */ cvt.s.w $f22, $f22
/* 3B264C E00AE2FC 0C080138 */ jal shim_rand_int
/* 3B2650 E00AE300 24040010 */ addiu $a0, $zero, 0x10
/* 3B2654 E00AE304 2442FFF8 */ addiu $v0, $v0, -0x8
/* 3B2658 E00AE308 4482A000 */ mtc1 $v0, $f20
/* 3B265C E00AE30C 00000000 */ nop
/* 3B2660 E00AE310 4680A520 */ cvt.s.w $f20, $f20
/* 3B2664 E00AE314 26230088 */ addiu $v1, $s1, 0x88
/* 3B2668 E00AE318 26220044 */ addiu $v0, $s1, 0x44
/* 3B266C E00AE31C 26240084 */ addiu $a0, $s1, 0x84
.LE00AE320:
/* 3B2670 E00AE320 8C450000 */ lw $a1, 0x0($v0)
/* 3B2674 E00AE324 8C480004 */ lw $t0, 0x4($v0)
/* 3B2678 E00AE328 8C490008 */ lw $t1, 0x8($v0)
/* 3B267C E00AE32C 8C4A000C */ lw $t2, 0xC($v0)
/* 3B2680 E00AE330 AC650000 */ sw $a1, 0x0($v1)
/* 3B2684 E00AE334 AC680004 */ sw $t0, 0x4($v1)
/* 3B2688 E00AE338 AC690008 */ sw $t1, 0x8($v1)
/* 3B268C E00AE33C AC6A000C */ sw $t2, 0xC($v1)
/* 3B2690 E00AE340 24420010 */ addiu $v0, $v0, 0x10
/* 3B2694 E00AE344 1444FFF6 */ bne $v0, $a0, .LE00AE320
/* 3B2698 E00AE348 24630010 */ addiu $v1, $v1, 0x10
/* 3B269C E00AE34C 8C450000 */ lw $a1, 0x0($v0)
/* 3B26A0 E00AE350 AC650000 */ sw $a1, 0x0($v1)
/* 3B26A4 E00AE354 26230044 */ addiu $v1, $s1, 0x44
/* 3B26A8 E00AE358 0220102D */ daddu $v0, $s1, $zero
/* 3B26AC E00AE35C 26240040 */ addiu $a0, $s1, 0x40
.LE00AE360:
/* 3B26B0 E00AE360 8C450000 */ lw $a1, 0x0($v0)
/* 3B26B4 E00AE364 8C480004 */ lw $t0, 0x4($v0)
/* 3B26B8 E00AE368 8C490008 */ lw $t1, 0x8($v0)
/* 3B26BC E00AE36C 8C4A000C */ lw $t2, 0xC($v0)
/* 3B26C0 E00AE370 AC650000 */ sw $a1, 0x0($v1)
/* 3B26C4 E00AE374 AC680004 */ sw $t0, 0x4($v1)
/* 3B26C8 E00AE378 AC690008 */ sw $t1, 0x8($v1)
/* 3B26CC E00AE37C AC6A000C */ sw $t2, 0xC($v1)
/* 3B26D0 E00AE380 24420010 */ addiu $v0, $v0, 0x10
/* 3B26D4 E00AE384 1444FFF6 */ bne $v0, $a0, .LE00AE360
/* 3B26D8 E00AE388 24630010 */ addiu $v1, $v1, 0x10
/* 3B26DC E00AE38C 4600E306 */ mov.s $f12, $f28
/* 3B26E0 E00AE390 4600E386 */ mov.s $f14, $f28
/* 3B26E4 E00AE394 4616C080 */ add.s $f2, $f24, $f22
/* 3B26E8 E00AE398 4406B000 */ mfc1 $a2, $f22
/* 3B26EC E00AE39C 4407A000 */ mfc1 $a3, $f20
/* 3B26F0 E00AE3A0 4614D000 */ add.s $f0, $f26, $f20
/* 3B26F4 E00AE3A4 8C450000 */ lw $a1, 0x0($v0)
/* 3B26F8 E00AE3A8 AC650000 */ sw $a1, 0x0($v1)
/* 3B26FC E00AE3AC E602FFF0 */ swc1 $f2, -0x10($s0)
/* 3B2700 E00AE3B0 0C080148 */ jal shim_atan2
/* 3B2704 E00AE3B4 E600FFF4 */ swc1 $f0, -0xC($s0)
/* 3B2708 E00AE3B8 461CB032 */ c.eq.s $f22, $f28
/* 3B270C E00AE3BC 00000000 */ nop
/* 3B2710 E00AE3C0 45000005 */ bc1f .LE00AE3D8
/* 3B2714 E00AE3C4 E6000028 */ swc1 $f0, 0x28($s0)
/* 3B2718 E00AE3C8 461CA032 */ c.eq.s $f20, $f28
/* 3B271C E00AE3CC 00000000 */ nop
/* 3B2720 E00AE3D0 45030008 */ bc1tl .LE00AE3F4
/* 3B2724 E00AE3D4 E61C0020 */ swc1 $f28, 0x20($s0)
.LE00AE3D8:
/* 3B2728 E00AE3D8 4616B002 */ mul.s $f0, $f22, $f22
/* 3B272C E00AE3DC 00000000 */ nop
/* 3B2730 E00AE3E0 4614A302 */ mul.s $f12, $f20, $f20
/* 3B2734 E00AE3E4 00000000 */ nop
/* 3B2738 E00AE3E8 0C080154 */ jal shim_sqrtf
/* 3B273C E00AE3EC 460C0300 */ add.s $f12, $f0, $f12
/* 3B2740 E00AE3F0 E6000020 */ swc1 $f0, 0x20($s0)
.LE00AE3F4:
/* 3B2744 E00AE3F4 8E020000 */ lw $v0, 0x0($s0)
/* 3B2748 E00AE3F8 00021840 */ sll $v1, $v0, 1
/* 3B274C E00AE3FC 00621821 */ addu $v1, $v1, $v0
/* 3B2750 E00AE400 00031100 */ sll $v0, $v1, 4
/* 3B2754 E00AE404 00431023 */ subu $v0, $v0, $v1
/* 3B2758 E00AE408 8E03FFFC */ lw $v1, -0x4($s0)
/* 3B275C E00AE40C 00021080 */ sll $v0, $v0, 2
/* 3B2760 E00AE410 14600002 */ bnez $v1, .LE00AE41C
/* 3B2764 E00AE414 0043001A */ div $zero, $v0, $v1
/* 3B2768 E00AE418 0007000D */ break 7
.LE00AE41C:
/* 3B276C E00AE41C 2401FFFF */ addiu $at, $zero, -0x1
/* 3B2770 E00AE420 14610004 */ bne $v1, $at, .LE00AE434
/* 3B2774 E00AE424 3C018000 */ lui $at, (0x80000000 >> 16)
/* 3B2778 E00AE428 14410002 */ bne $v0, $at, .LE00AE434
/* 3B277C E00AE42C 00000000 */ nop
/* 3B2780 E00AE430 0006000D */ break 6
.LE00AE434:
/* 3B2784 E00AE434 00001012 */ mflo $v0
/* 3B2788 E00AE438 44826000 */ mtc1 $v0, $f12
/* 3B278C E00AE43C 00000000 */ nop
/* 3B2790 E00AE440 0C080140 */ jal shim_sin_deg
/* 3B2794 E00AE444 46806320 */ cvt.s.w $f12, $f12
/* 3B2798 E00AE448 3C014480 */ lui $at, (0x44800000 >> 16)
/* 3B279C E00AE44C 44811000 */ mtc1 $at, $f2
/* 3B27A0 E00AE450 00000000 */ nop
/* 3B27A4 E00AE454 46020002 */ mul.s $f0, $f0, $f2
/* 3B27A8 E00AE458 00000000 */ nop
/* 3B27AC E00AE45C 4600010D */ trunc.w.s $f4, $f0
/* 3B27B0 E00AE460 44022000 */ mfc1 $v0, $f4
/* 3B27B4 E00AE464 00000000 */ nop
/* 3B27B8 E00AE468 AE020010 */ sw $v0, 0x10($s0)
/* 3B27BC E00AE46C 28420100 */ slti $v0, $v0, 0x100
/* 3B27C0 E00AE470 14400003 */ bnez $v0, .LE00AE480
/* 3B27C4 E00AE474 26520003 */ addiu $s2, $s2, 0x3
/* 3B27C8 E00AE478 240200FF */ addiu $v0, $zero, 0xFF
/* 3B27CC E00AE47C AE020010 */ sw $v0, 0x10($s0)
.LE00AE480:
/* 3B27D0 E00AE480 8E020000 */ lw $v0, 0x0($s0)
/* 3B27D4 E00AE484 263100CC */ addiu $s1, $s1, 0xCC
/* 3B27D8 E00AE488 24420001 */ addiu $v0, $v0, 0x1
/* 3B27DC E00AE48C AE020000 */ sw $v0, 0x0($s0)
/* 3B27E0 E00AE490 8E620008 */ lw $v0, 0x8($s3)
/* 3B27E4 E00AE494 0242102A */ slt $v0, $s2, $v0
/* 3B27E8 E00AE498 1440FF79 */ bnez $v0, .LE00AE280
/* 3B27EC E00AE49C 261000CC */ addiu $s0, $s0, 0xCC
.LE00AE4A0:
/* 3B27F0 E00AE4A0 8E71000C */ lw $s1, 0xC($s3)
/* 3B27F4 E00AE4A4 0802B92F */ j .LE00AE4BC
/* 3B27F8 E00AE4A8 24120001 */ addiu $s2, $zero, 0x1
.LE00AE4AC:
/* 3B27FC E00AE4AC 0C080138 */ jal shim_rand_int
/* 3B2800 E00AE4B0 2404000F */ addiu $a0, $zero, 0xF
/* 3B2804 E00AE4B4 26520001 */ addiu $s2, $s2, 0x1
/* 3B2808 E00AE4B8 AE220040 */ sw $v0, 0x40($s1)
.LE00AE4BC:
/* 3B280C E00AE4BC 8E620008 */ lw $v0, 0x8($s3)
/* 3B2810 E00AE4C0 0242102A */ slt $v0, $s2, $v0
/* 3B2814 E00AE4C4 1440FFF9 */ bnez $v0, .LE00AE4AC
/* 3B2818 E00AE4C8 26310044 */ addiu $s1, $s1, 0x44
.LE00AE4CC:
/* 3B281C E00AE4CC 8FBF0020 */ lw $ra, 0x20($sp)
/* 3B2820 E00AE4D0 8FB3001C */ lw $s3, 0x1C($sp)
/* 3B2824 E00AE4D4 8FB20018 */ lw $s2, 0x18($sp)
/* 3B2828 E00AE4D8 8FB10014 */ lw $s1, 0x14($sp)
/* 3B282C E00AE4DC 8FB00010 */ lw $s0, 0x10($sp)
/* 3B2830 E00AE4E0 D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 3B2834 E00AE4E4 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 3B2838 E00AE4E8 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 3B283C E00AE4EC D7B60030 */ ldc1 $f22, 0x30($sp)
/* 3B2840 E00AE4F0 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 3B2844 E00AE4F4 03E00008 */ jr $ra
/* 3B2848 E00AE4F8 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
void snaking_static_update(EffectInstance* effect) {
SnakingStaticFXData* data = effect->data.snakingStatic;
f32 tempOffsetY;
f32 tempOffsetX;
f32 tempPosX;
f32 tempPosY;
s32 lifeTime;
s32 timeLeft;
s32 i;
if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
data->timeLeft = 16;
}
if (data->timeLeft < 1000) {
data->timeLeft--;
}
timeLeft = data->timeLeft;
data->lifeTime++;
lifeTime = data->lifeTime;
if (timeLeft < 0) {
shim_remove_effect(effect);
return;
}
if (timeLeft < 16) {
data->unk_24 = timeLeft * 16;
}
if (lifeTime < 16) {
data->unk_24 = (lifeTime * 16) + 15;
}
data++;
for (i = 1; i < effect->numParts; i += 3, data += 3) {
if (data->lifeTime >= data->timeLeft) {
data->timeLeft = shim_rand_int(50) + 20;
data->lifeTime = 0;
data->unk_3C = shim_rand_int(360);
data->pos.x = 0.0f;
data->pos.y = 0.0f;
}
if (shim_rand_int(100) < 51) {
tempPosX = data->pos.x;
tempPosY = data->pos.y;
tempOffsetX = shim_rand_int(16) - 8;
tempOffsetY = shim_rand_int(16) - 8;
data[2] = data[1];
data[1] = data[0];
data->pos.x = tempPosX + tempOffsetX;
data->pos.y = tempPosY + tempOffsetY;
data->unk_3C = shim_atan2(0.0f, 0.0f, tempOffsetX, tempOffsetY);
if (tempOffsetX != 0.0f || tempOffsetY != 0.0f) {
data->unk_34 = shim_sqrtf((tempOffsetX * tempOffsetX) + (tempOffsetY * tempOffsetY));
} else {
data->unk_34 = 0.0f;
}
}
data->unk_24 = (shim_sin_deg(((data->lifeTime * 180) / data->timeLeft)) * 1024.0f);
if (data->unk_24 >= 256) {
data->unk_24 = 255;
}
data->lifeTime++;
}
data = effect->data.snakingStatic;
data++;
for (i = 1; i < effect->numParts; i++, data++) {
data->unk_40 = shim_rand_int(15);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel appendGfx_title_screen
/* 12A38 80037638 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 12A3C 8003763C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 12A40 80037640 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 12A44 80037644 AFBF0030 */ sw $ra, 0x30($sp)
/* 12A48 80037648 AFB7002C */ sw $s7, 0x2C($sp)
/* 12A4C 8003764C AFB60028 */ sw $s6, 0x28($sp)
/* 12A50 80037650 AFB50024 */ sw $s5, 0x24($sp)
/* 12A54 80037654 AFB40020 */ sw $s4, 0x20($sp)
/* 12A58 80037658 AFB3001C */ sw $s3, 0x1C($sp)
/* 12A5C 8003765C AFB20018 */ sw $s2, 0x18($sp)
/* 12A60 80037660 AFB10014 */ sw $s1, 0x14($sp)
/* 12A64 80037664 AFB00010 */ sw $s0, 0x10($sp)
/* 12A68 80037668 804300AC */ lb $v1, 0xAC($v0)
/* 12A6C 8003766C 2C620006 */ sltiu $v0, $v1, 0x6
/* 12A70 80037670 10400029 */ beqz $v0, .L80037718
/* 12A74 80037674 00031080 */ sll $v0, $v1, 2
/* 12A78 80037678 3C01800A */ lui $at, %hi(jtbl_800983E0)
/* 12A7C 8003767C 00220821 */ addu $at, $at, $v0
/* 12A80 80037680 8C2283E0 */ lw $v0, %lo(jtbl_800983E0)($at)
/* 12A84 80037684 00400008 */ jr $v0
/* 12A88 80037688 00000000 */ nop
glabel .L8003768C
/* 12A8C 8003768C 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 12A90 80037690 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 12A94 80037694 804300AF */ lb $v1, 0xAF($v0)
/* 12A98 80037698 804200B0 */ lb $v0, 0xB0($v0)
/* 12A9C 8003769C 44836000 */ mtc1 $v1, $f12
/* 12AA0 800376A0 00000000 */ nop
/* 12AA4 800376A4 46806320 */ cvt.s.w $f12, $f12
/* 12AA8 800376A8 44820000 */ mtc1 $v0, $f0
/* 12AAC 800376AC 00000000 */ nop
/* 12AB0 800376B0 46800020 */ cvt.s.w $f0, $f0
/* 12AB4 800376B4 0800DDC2 */ j .L80037708
/* 12AB8 800376B8 46006303 */ div.s $f12, $f12, $f0
glabel .L800376BC
/* 12ABC 800376BC 44806000 */ mtc1 $zero, $f12
/* 12AC0 800376C0 0800DDC4 */ j .L80037710
/* 12AC4 800376C4 00000000 */ nop
glabel .L800376C8
/* 12AC8 800376C8 44806000 */ mtc1 $zero, $f12
/* 12ACC 800376CC 0800DDC4 */ j .L80037710
/* 12AD0 800376D0 00000000 */ nop
glabel .L800376D4
/* 12AD4 800376D4 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 12AD8 800376D8 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* 12ADC 800376DC 806200AF */ lb $v0, 0xAF($v1)
/* 12AE0 800376E0 806300B0 */ lb $v1, 0xB0($v1)
/* 12AE4 800376E4 2442FFFF */ addiu $v0, $v0, -0x1
/* 12AE8 800376E8 00621023 */ subu $v0, $v1, $v0
/* 12AEC 800376EC 44826000 */ mtc1 $v0, $f12
/* 12AF0 800376F0 00000000 */ nop
/* 12AF4 800376F4 46806320 */ cvt.s.w $f12, $f12
/* 12AF8 800376F8 44830000 */ mtc1 $v1, $f0
/* 12AFC 800376FC 00000000 */ nop
/* 12B00 80037700 46800020 */ cvt.s.w $f0, $f0
/* 12B04 80037704 46006303 */ div.s $f12, $f12, $f0
.L80037708:
/* 12B08 80037708 460C6302 */ mul.s $f12, $f12, $f12
/* 12B0C 8003770C 00000000 */ nop
.L80037710:
/* 12B10 80037710 0C00DE5A */ jal title_screen_draw_images
/* 12B14 80037714 46006386 */ mov.s $f14, $f12
glabel .L80037718
/* 12B18 80037718 3C03FF10 */ lui $v1, (0xFF10013F >> 16)
/* 12B1C 8003771C 3463013F */ ori $v1, $v1, (0xFF10013F & 0xFFFF)
/* 12B20 80037720 3C10800A */ lui $s0, %hi(gMainGfxPos)
/* 12B24 80037724 2610A66C */ addiu $s0, $s0, %lo(gMainGfxPos)
/* 12B28 80037728 3C12E700 */ lui $s2, (0xE7000000 >> 16)
/* 12B2C 8003772C 8E110000 */ lw $s1, 0x0($s0)
/* 12B30 80037730 3C04800A */ lui $a0, %hi(nuGfxCfb_ptr)
/* 12B34 80037734 8C84A64C */ lw $a0, %lo(nuGfxCfb_ptr)($a0)
/* 12B38 80037738 0220102D */ daddu $v0, $s1, $zero
/* 12B3C 8003773C 26310008 */ addiu $s1, $s1, 0x8
/* 12B40 80037740 AE110000 */ sw $s1, 0x0($s0)
/* 12B44 80037744 AC520000 */ sw $s2, 0x0($v0)
/* 12B48 80037748 AC400004 */ sw $zero, 0x4($v0)
/* 12B4C 8003774C 26220008 */ addiu $v0, $s1, 0x8
/* 12B50 80037750 AE020000 */ sw $v0, 0x0($s0)
/* 12B54 80037754 0C0187A4 */ jal osVirtualToPhysical
/* 12B58 80037758 AE230000 */ sw $v1, 0x0($s1)
/* 12B5C 8003775C 3C060050 */ lui $a2, (0x5003C0 >> 16)
/* 12B60 80037760 34C603C0 */ ori $a2, $a2, (0x5003C0 & 0xFFFF)
/* 12B64 80037764 3C07E300 */ lui $a3, (0xE3000A01 >> 16)
/* 12B68 80037768 34E70A01 */ ori $a3, $a3, (0xE3000A01 & 0xFFFF)
/* 12B6C 8003776C 3C08D9C0 */ lui $t0, (0xD9C0F9FA >> 16)
/* 12B70 80037770 3508F9FA */ ori $t0, $t0, (0xD9C0F9FA & 0xFFFF)
/* 12B74 80037774 3C0AD9FF */ lui $t2, (0xD9FFFFFF >> 16)
/* 12B78 80037778 354AFFFF */ ori $t2, $t2, (0xD9FFFFFF & 0xFFFF)
/* 12B7C 8003777C 3C090022 */ lui $t1, (0x220005 >> 16)
/* 12B80 80037780 35290005 */ ori $t1, $t1, (0x220005 & 0xFFFF)
/* 12B84 80037784 3C0BDC08 */ lui $t3, (0xDC08060A >> 16)
/* 12B88 80037788 356B060A */ ori $t3, $t3, (0xDC08060A & 0xFFFF)
/* 12B8C 8003778C 3C0CDC08 */ lui $t4, (0xDC08090A >> 16)
/* 12B90 80037790 358C090A */ ori $t4, $t4, (0xDC08090A & 0xFFFF)
/* 12B94 80037794 3C0DD700 */ lui $t5, (0xD7000002 >> 16)
/* 12B98 80037798 35AD0002 */ ori $t5, $t5, (0xD7000002 & 0xFFFF)
/* 12B9C 8003779C 3C0EE300 */ lui $t6, (0xE3000F00 >> 16)
/* 12BA0 800377A0 35CE0F00 */ ori $t6, $t6, (0xE3000F00 & 0xFFFF)
/* 12BA4 800377A4 3C0FE300 */ lui $t7, (0xE3000C00 >> 16)
/* 12BA8 800377A8 35EF0C00 */ ori $t7, $t7, (0xE3000C00 & 0xFFFF)
/* 12BAC 800377AC 3C13E300 */ lui $s3, (0xE3001201 >> 16)
/* 12BB0 800377B0 36731201 */ ori $s3, $s3, (0xE3001201 & 0xFFFF)
/* 12BB4 800377B4 3C14E300 */ lui $s4, (0xE3001801 >> 16)
/* 12BB8 800377B8 36941801 */ ori $s4, $s4, (0xE3001801 & 0xFFFF)
/* 12BBC 800377BC 3C15E300 */ lui $s5, (0xE3000D01 >> 16)
/* 12BC0 800377C0 36B50D01 */ ori $s5, $s5, (0xE3000D01 & 0xFFFF)
/* 12BC4 800377C4 3C16E300 */ lui $s6, (0xE3001402 >> 16)
/* 12BC8 800377C8 36D61402 */ ori $s6, $s6, (0xE3001402 & 0xFFFF)
/* 12BCC 800377CC 3C17E300 */ lui $s7, (0xE3001700 >> 16)
/* 12BD0 800377D0 36F71700 */ ori $s7, $s7, (0xE3001700 & 0xFFFF)
/* 12BD4 800377D4 3C18E200 */ lui $t8, (0xE2001E01 >> 16)
/* 12BD8 800377D8 37181E01 */ ori $t8, $t8, (0xE2001E01 & 0xFFFF)
/* 12BDC 800377DC 8E030000 */ lw $v1, 0x0($s0)
/* 12BE0 800377E0 0000202D */ daddu $a0, $zero, $zero
/* 12BE4 800377E4 AE220004 */ sw $v0, 0x4($s1)
/* 12BE8 800377E8 3C02ED00 */ lui $v0, (0xED000000 >> 16)
/* 12BEC 800377EC 0060282D */ daddu $a1, $v1, $zero
/* 12BF0 800377F0 24630008 */ addiu $v1, $v1, 0x8
/* 12BF4 800377F4 AE030000 */ sw $v1, 0x0($s0)
/* 12BF8 800377F8 ACA20000 */ sw $v0, 0x0($a1)
/* 12BFC 800377FC 24620008 */ addiu $v0, $v1, 0x8
/* 12C00 80037800 ACA60004 */ sw $a2, 0x4($a1)
/* 12C04 80037804 AE020000 */ sw $v0, 0x0($s0)
/* 12C08 80037808 24620010 */ addiu $v0, $v1, 0x10
/* 12C0C 8003780C AC670000 */ sw $a3, 0x0($v1)
/* 12C10 80037810 AC600004 */ sw $zero, 0x4($v1)
/* 12C14 80037814 AE020000 */ sw $v0, 0x0($s0)
/* 12C18 80037818 24620018 */ addiu $v0, $v1, 0x18
/* 12C1C 8003781C AC720008 */ sw $s2, 0x8($v1)
/* 12C20 80037820 AC60000C */ sw $zero, 0xC($v1)
/* 12C24 80037824 AE020000 */ sw $v0, 0x0($s0)
/* 12C28 80037828 24620020 */ addiu $v0, $v1, 0x20
/* 12C2C 8003782C AC680010 */ sw $t0, 0x10($v1)
/* 12C30 80037830 AC600014 */ sw $zero, 0x14($v1)
/* 12C34 80037834 AE020000 */ sw $v0, 0x0($s0)
/* 12C38 80037838 24620028 */ addiu $v0, $v1, 0x28
/* 12C3C 8003783C AC6A0018 */ sw $t2, 0x18($v1)
/* 12C40 80037840 AC69001C */ sw $t1, 0x1C($v1)
/* 12C44 80037844 AE020000 */ sw $v0, 0x0($s0)
/* 12C48 80037848 3C02DB02 */ lui $v0, (0xDB020000 >> 16)
/* 12C4C 8003784C AC620020 */ sw $v0, 0x20($v1)
/* 12C50 80037850 24020018 */ addiu $v0, $zero, 0x18
/* 12C54 80037854 AC620024 */ sw $v0, 0x24($v1)
/* 12C58 80037858 24620030 */ addiu $v0, $v1, 0x30
/* 12C5C 8003785C 3C058007 */ lui $a1, %hi(D_80077A40)
/* 12C60 80037860 24A57A40 */ addiu $a1, $a1, %lo(D_80077A40)
/* 12C64 80037864 AE020000 */ sw $v0, 0x0($s0)
/* 12C68 80037868 24620038 */ addiu $v0, $v1, 0x38
/* 12C6C 8003786C AC65002C */ sw $a1, 0x2C($v1)
/* 12C70 80037870 24A5FFF8 */ addiu $a1, $a1, -0x8
/* 12C74 80037874 AC6B0028 */ sw $t3, 0x28($v1)
/* 12C78 80037878 AE020000 */ sw $v0, 0x0($s0)
/* 12C7C 8003787C 24620040 */ addiu $v0, $v1, 0x40
/* 12C80 80037880 AC6C0030 */ sw $t4, 0x30($v1)
/* 12C84 80037884 AC650034 */ sw $a1, 0x34($v1)
/* 12C88 80037888 AE020000 */ sw $v0, 0x0($s0)
/* 12C8C 8003788C 2402FFFF */ addiu $v0, $zero, -0x1
/* 12C90 80037890 AC62003C */ sw $v0, 0x3C($v1)
/* 12C94 80037894 24620048 */ addiu $v0, $v1, 0x48
/* 12C98 80037898 AC6D0038 */ sw $t5, 0x38($v1)
/* 12C9C 8003789C AE020000 */ sw $v0, 0x0($s0)
/* 12CA0 800378A0 24620050 */ addiu $v0, $v1, 0x50
/* 12CA4 800378A4 AC6E0040 */ sw $t6, 0x40($v1)
/* 12CA8 800378A8 AC600044 */ sw $zero, 0x44($v1)
/* 12CAC 800378AC AE020000 */ sw $v0, 0x0($s0)
/* 12CB0 800378B0 3C020008 */ lui $v0, (0x80000 >> 16)
/* 12CB4 800378B4 AC6F0048 */ sw $t7, 0x48($v1)
/* 12CB8 800378B8 AC62004C */ sw $v0, 0x4C($v1)
/* 12CBC 800378BC 24620058 */ addiu $v0, $v1, 0x58
/* 12CC0 800378C0 AE020000 */ sw $v0, 0x0($s0)
/* 12CC4 800378C4 24022000 */ addiu $v0, $zero, 0x2000
/* 12CC8 800378C8 AC620054 */ sw $v0, 0x54($v1)
/* 12CCC 800378CC 24620060 */ addiu $v0, $v1, 0x60
/* 12CD0 800378D0 AC730050 */ sw $s3, 0x50($v1)
/* 12CD4 800378D4 AE020000 */ sw $v0, 0x0($s0)
/* 12CD8 800378D8 240200C0 */ addiu $v0, $zero, 0xC0
/* 12CDC 800378DC AC62005C */ sw $v0, 0x5C($v1)
/* 12CE0 800378E0 24620068 */ addiu $v0, $v1, 0x68
/* 12CE4 800378E4 AC740058 */ sw $s4, 0x58($v1)
/* 12CE8 800378E8 AE020000 */ sw $v0, 0x0($s0)
/* 12CEC 800378EC 24620070 */ addiu $v0, $v1, 0x70
/* 12CF0 800378F0 AC750060 */ sw $s5, 0x60($v1)
/* 12CF4 800378F4 AC600064 */ sw $zero, 0x64($v1)
/* 12CF8 800378F8 AE020000 */ sw $v0, 0x0($s0)
/* 12CFC 800378FC 24020C00 */ addiu $v0, $zero, 0xC00
/* 12D00 80037900 AC62006C */ sw $v0, 0x6C($v1)
/* 12D04 80037904 24620078 */ addiu $v0, $v1, 0x78
/* 12D08 80037908 AC760068 */ sw $s6, 0x68($v1)
/* 12D0C 8003790C AE020000 */ sw $v0, 0x0($s0)
/* 12D10 80037910 24620080 */ addiu $v0, $v1, 0x80
/* 12D14 80037914 AC770070 */ sw $s7, 0x70($v1)
/* 12D18 80037918 AC600074 */ sw $zero, 0x74($v1)
/* 12D1C 8003791C AE020000 */ sw $v0, 0x0($s0)
/* 12D20 80037920 AC780078 */ sw $t8, 0x78($v1)
/* 12D24 80037924 0C00B5CF */ jal render_frame
/* 12D28 80037928 AC60007C */ sw $zero, 0x7C($v1)
/* 12D2C 8003792C 0C00B5CF */ jal render_frame
/* 12D30 80037930 24040001 */ addiu $a0, $zero, 0x1
/* 12D34 80037934 8FBF0030 */ lw $ra, 0x30($sp)
/* 12D38 80037938 8FB7002C */ lw $s7, 0x2C($sp)
/* 12D3C 8003793C 8FB60028 */ lw $s6, 0x28($sp)
/* 12D40 80037940 8FB50024 */ lw $s5, 0x24($sp)
/* 12D44 80037944 8FB40020 */ lw $s4, 0x20($sp)
/* 12D48 80037948 8FB3001C */ lw $s3, 0x1C($sp)
/* 12D4C 8003794C 8FB20018 */ lw $s2, 0x18($sp)
/* 12D50 80037950 8FB10014 */ lw $s1, 0x14($sp)
/* 12D54 80037954 8FB00010 */ lw $s0, 0x10($sp)
/* 12D58 80037958 03E00008 */ jr $ra
/* 12D5C 8003795C 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void appendGfx_title_screen(void) {
f32 phi_f12;
s32 temp;
switch (gGameStatusPtr->introState) {
case INTRO_STATE_0:
case INTRO_STATE_3:
break;
case INTRO_STATE_1:
phi_f12 = gGameStatusPtr->unk_AF;
phi_f12 /= gGameStatusPtr->unk_B0;
phi_f12 = SQ(phi_f12);
title_screen_draw_images(phi_f12, phi_f12);
break;
case INTRO_STATE_2:
title_screen_draw_images(0.0f, 0.0f);
break;
case INTRO_STATE_4:
title_screen_draw_images(0.0f, 0.0f);
break;
case INTRO_STATE_5:
temp = gGameStatusPtr->unk_AF - 1;
phi_f12 = gGameStatusPtr->unk_B0 - temp;
phi_f12 /= gGameStatusPtr->unk_B0;
phi_f12 = SQ(phi_f12);
title_screen_draw_images(phi_f12, phi_f12);
break;
}
gDPPipeSync(gMainGfxPos++);
gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr));
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
gDPPipeSync(gMainGfxPos++);
gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING |
G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
gSPSetLights1(gMainGfxPos++, D_80077A38);
gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
gDPSetColorDither(gMainGfxPos++, G_CD_DISABLE);
gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
gDPSetTextureConvert(gMainGfxPos++, G_TC_FILT);
gDPSetCombineKey(gMainGfxPos++, G_CK_NONE);
gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
render_frame(FALSE);
render_frame(TRUE);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel fire_flower_update
/* 37F924 E007E204 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 37F928 E007E208 AFB1001C */ sw $s1, 0x1C($sp)
/* 37F92C E007E20C 0080882D */ daddu $s1, $a0, $zero
/* 37F930 E007E210 AFBF0020 */ sw $ra, 0x20($sp)
/* 37F934 E007E214 AFB00018 */ sw $s0, 0x18($sp)
/* 37F938 E007E218 8E30000C */ lw $s0, 0xC($s1)
/* 37F93C E007E21C 8E050004 */ lw $a1, 0x4($s0)
/* 37F940 E007E220 8E020044 */ lw $v0, 0x44($s0)
/* 37F944 E007E224 8E030040 */ lw $v1, 0x40($s0)
/* 37F948 E007E228 24420001 */ addiu $v0, $v0, 0x1
/* 37F94C E007E22C 24630001 */ addiu $v1, $v1, 0x1
/* 37F950 E007E230 AE020044 */ sw $v0, 0x44($s0)
/* 37F954 E007E234 24020007 */ addiu $v0, $zero, 0x7
/* 37F958 E007E238 14A20005 */ bne $a1, $v0, .LE007E250
/* 37F95C E007E23C AE030040 */ sw $v1, 0x40($s0)
/* 37F960 E007E240 0C080128 */ jal shim_remove_effect
/* 37F964 E007E244 00000000 */ nop
/* 37F968 E007E248 0801F93D */ j .LE007E4F4
/* 37F96C E007E24C 00000000 */ nop
.LE007E250:
/* 37F970 E007E250 2CA20007 */ sltiu $v0, $a1, 0x7
/* 37F974 E007E254 10400075 */ beqz $v0, .LE007E42C
/* 37F978 E007E258 00051080 */ sll $v0, $a1, 2
/* 37F97C E007E25C 3C01E008 */ lui $at, (0xE0080000 >> 16)
/* 37F980 E007E260 00220821 */ addu $at, $at, $v0
/* 37F984 E007E264 8C22EC48 */ lw $v0, -0x13B8($at)
/* 37F988 E007E268 00400008 */ jr $v0
/* 37F98C E007E26C 00000000 */ nop
/* 37F990 E007E270 0C080150 */ jal shim_load_effect
/* 37F994 E007E274 2404002D */ addiu $a0, $zero, 0x2D
/* 37F998 E007E278 C6020008 */ lwc1 $f2, 0x8($s0)
/* 37F99C E007E27C 3C014120 */ lui $at, (0x41200000 >> 16)
/* 37F9A0 E007E280 44810000 */ mtc1 $at, $f0
/* 37F9A4 E007E284 24020007 */ addiu $v0, $zero, 0x7
/* 37F9A8 E007E288 AFA20010 */ sw $v0, 0x10($sp)
/* 37F9AC E007E28C 24020014 */ addiu $v0, $zero, 0x14
/* 37F9B0 E007E290 AFA20014 */ sw $v0, 0x14($sp)
/* 37F9B4 E007E294 46001081 */ sub.s $f2, $f2, $f0
/* 37F9B8 E007E298 8E06000C */ lw $a2, 0xC($s0)
/* 37F9BC E007E29C 8E070010 */ lw $a3, 0x10($s0)
/* 37F9C0 E007E2A0 44051000 */ mfc1 $a1, $f2
/* 37F9C4 E007E2A4 0C016800 */ jal stars_spread_main
/* 37F9C8 E007E2A8 0000202D */ daddu $a0, $zero, $zero
/* 37F9CC E007E2AC 8E020004 */ lw $v0, 0x4($s0)
/* 37F9D0 E007E2B0 AE000034 */ sw $zero, 0x34($s0)
/* 37F9D4 E007E2B4 AE000038 */ sw $zero, 0x38($s0)
/* 37F9D8 E007E2B8 0801F909 */ j .LE007E424
/* 37F9DC E007E2BC AE000040 */ sw $zero, 0x40($s0)
/* 37F9E0 E007E2C0 28620008 */ slti $v0, $v1, 0x8
/* 37F9E4 E007E2C4 14400004 */ bnez $v0, .LE007E2D8
/* 37F9E8 E007E2C8 00000000 */ nop
/* 37F9EC E007E2CC 8E020004 */ lw $v0, 0x4($s0)
/* 37F9F0 E007E2D0 0801F909 */ j .LE007E424
/* 37F9F4 E007E2D4 AE000040 */ sw $zero, 0x40($s0)
.LE007E2D8:
/* 37F9F8 E007E2D8 3C02E008 */ lui $v0, (0xE0080000 >> 16)
/* 37F9FC E007E2DC 00431021 */ addu $v0, $v0, $v1
/* 37FA00 E007E2E0 8042EC2F */ lb $v0, -0x13D1($v0)
/* 37FA04 E007E2E4 3C01E008 */ lui $at, (0xE0080000 >> 16)
/* 37FA08 E007E2E8 D422EC68 */ ldc1 $f2, -0x1398($at)
/* 37FA0C E007E2EC 44820000 */ mtc1 $v0, $f0
/* 37FA10 E007E2F0 00000000 */ nop
/* 37FA14 E007E2F4 46800021 */ cvt.d.w $f0, $f0
/* 37FA18 E007E2F8 46220002 */ mul.d $f0, $f0, $f2
/* 37FA1C E007E2FC 00000000 */ nop
/* 37FA20 E007E300 AE000034 */ sw $zero, 0x34($s0)
/* 37FA24 E007E304 AE000038 */ sw $zero, 0x38($s0)
/* 37FA28 E007E308 46200020 */ cvt.s.d $f0, $f0
/* 37FA2C E007E30C 0801F90B */ j .LE007E42C
/* 37FA30 E007E310 E6000030 */ swc1 $f0, 0x30($s0)
/* 37FA34 E007E314 28620002 */ slti $v0, $v1, 0x2
/* 37FA38 E007E318 14400004 */ bnez $v0, .LE007E32C
/* 37FA3C E007E31C 24020001 */ addiu $v0, $zero, 0x1
/* 37FA40 E007E320 8E020004 */ lw $v0, 0x4($s0)
/* 37FA44 E007E324 0801F909 */ j .LE007E424
/* 37FA48 E007E328 AE000040 */ sw $zero, 0x40($s0)
.LE007E32C:
/* 37FA4C E007E32C 0801F90B */ j .LE007E42C
/* 37FA50 E007E330 AE020034 */ sw $v0, 0x34($s0)
/* 37FA54 E007E334 2862000F */ slti $v0, $v1, 0xF
/* 37FA58 E007E338 14400004 */ bnez $v0, .LE007E34C
/* 37FA5C E007E33C 24020002 */ addiu $v0, $zero, 0x2
/* 37FA60 E007E340 8E020004 */ lw $v0, 0x4($s0)
/* 37FA64 E007E344 0801F909 */ j .LE007E424
/* 37FA68 E007E348 AE000040 */ sw $zero, 0x40($s0)
.LE007E34C:
/* 37FA6C E007E34C 0801F90B */ j .LE007E42C
/* 37FA70 E007E350 AE020034 */ sw $v0, 0x34($s0)
/* 37FA74 E007E354 2862002D */ slti $v0, $v1, 0x2D
/* 37FA78 E007E358 14400004 */ bnez $v0, .LE007E36C
/* 37FA7C E007E35C 24020003 */ addiu $v0, $zero, 0x3
/* 37FA80 E007E360 8E020004 */ lw $v0, 0x4($s0)
/* 37FA84 E007E364 0801F909 */ j .LE007E424
/* 37FA88 E007E368 AE000040 */ sw $zero, 0x40($s0)
.LE007E36C:
/* 37FA8C E007E36C AE020034 */ sw $v0, 0x34($s0)
/* 37FA90 E007E370 30620001 */ andi $v0, $v1, 0x1
/* 37FA94 E007E374 10400005 */ beqz $v0, .LE007E38C
/* 37FA98 E007E378 AE00002C */ sw $zero, 0x2C($s0)
/* 37FA9C E007E37C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 37FAA0 E007E380 44810000 */ mtc1 $at, $f0
/* 37FAA4 E007E384 0801F90B */ j .LE007E42C
/* 37FAA8 E007E388 E6000030 */ swc1 $f0, 0x30($s0)
.LE007E38C:
/* 37FAAC E007E38C 3C013F86 */ lui $at, (0x3F866666 >> 16)
/* 37FAB0 E007E390 34216666 */ ori $at, $at, (0x3F866666 & 0xFFFF)
/* 37FAB4 E007E394 44810000 */ mtc1 $at, $f0
/* 37FAB8 E007E398 0801F90B */ j .LE007E42C
/* 37FABC E007E39C E6000030 */ swc1 $f0, 0x30($s0)
/* 37FAC0 E007E3A0 2862000A */ slti $v0, $v1, 0xA
/* 37FAC4 E007E3A4 54400004 */ bnel $v0, $zero, .LE007E3B8
/* 37FAC8 E007E3A8 AE000034 */ sw $zero, 0x34($s0)
/* 37FACC E007E3AC 8E020004 */ lw $v0, 0x4($s0)
/* 37FAD0 E007E3B0 0801F909 */ j .LE007E424
/* 37FAD4 E007E3B4 AE000040 */ sw $zero, 0x40($s0)
.LE007E3B8:
/* 37FAD8 E007E3B8 3C01C120 */ lui $at, (0xC1200000 >> 16)
/* 37FADC E007E3BC 44810000 */ mtc1 $at, $f0
/* 37FAE0 E007E3C0 0801F90B */ j .LE007E42C
/* 37FAE4 E007E3C4 E600002C */ swc1 $f0, 0x2C($s0)
/* 37FAE8 E007E3C8 C6040028 */ lwc1 $f4, 0x28($s0)
/* 37FAEC E007E3CC 3C014210 */ lui $at, (0x42100000 >> 16)
/* 37FAF0 E007E3D0 44810000 */ mtc1 $at, $f0
/* 37FAF4 E007E3D4 00000000 */ nop
/* 37FAF8 E007E3D8 46002100 */ add.s $f4, $f4, $f0
/* 37FAFC E007E3DC 3C01E008 */ lui $at, (0xE0080000 >> 16)
/* 37FB00 E007E3E0 D422EC70 */ ldc1 $f2, -0x1390($at)
/* 37FB04 E007E3E4 C600003C */ lwc1 $f0, 0x3C($s0)
/* 37FB08 E007E3E8 46800021 */ cvt.d.w $f0, $f0
/* 37FB0C E007E3EC 46220002 */ mul.d $f0, $f0, $f2
/* 37FB10 E007E3F0 00000000 */ nop
/* 37FB14 E007E3F4 E6040028 */ swc1 $f4, 0x28($s0)
/* 37FB18 E007E3F8 46002086 */ mov.s $f2, $f4
/* 37FB1C E007E3FC 3C014434 */ lui $at, (0x44340000 >> 16)
/* 37FB20 E007E400 44812000 */ mtc1 $at, $f4
/* 37FB24 E007E404 AE000034 */ sw $zero, 0x34($s0)
/* 37FB28 E007E408 4602203E */ c.le.s $f4, $f2
/* 37FB2C E007E40C 4620028D */ trunc.w.d $f10, $f0
/* 37FB30 E007E410 E60A003C */ swc1 $f10, 0x3C($s0)
/* 37FB34 E007E414 45000005 */ bc1f .LE007E42C
/* 37FB38 E007E418 00000000 */ nop
/* 37FB3C E007E41C 8E020004 */ lw $v0, 0x4($s0)
/* 37FB40 E007E420 E6040028 */ swc1 $f4, 0x28($s0)
.LE007E424:
/* 37FB44 E007E424 24420001 */ addiu $v0, $v0, 0x1
/* 37FB48 E007E428 AE020004 */ sw $v0, 0x4($s0)
.LE007E42C:
/* 37FB4C E007E42C 8E050004 */ lw $a1, 0x4($s0)
/* 37FB50 E007E430 24A2FFFC */ addiu $v0, $a1, -0x4
/* 37FB54 E007E434 2C420003 */ sltiu $v0, $v0, 0x3
/* 37FB58 E007E438 1040002E */ beqz $v0, .LE007E4F4
/* 37FB5C E007E43C 2610004C */ addiu $s0, $s0, 0x4C
/* 37FB60 E007E440 8E220008 */ lw $v0, 0x8($s1)
/* 37FB64 E007E444 24040001 */ addiu $a0, $zero, 0x1
/* 37FB68 E007E448 0082102A */ slt $v0, $a0, $v0
/* 37FB6C E007E44C 10400029 */ beqz $v0, .LE007E4F4
/* 37FB70 E007E450 00000000 */ nop
/* 37FB74 E007E454 24060004 */ addiu $a2, $zero, 0x4
/* 37FB78 E007E458 3C014348 */ lui $at, (0x43480000 >> 16)
/* 37FB7C E007E45C 44814000 */ mtc1 $at, $f8
/* 37FB80 E007E460 26030010 */ addiu $v1, $s0, 0x10
.LE007E464:
/* 37FB84 E007E464 8C620038 */ lw $v0, 0x38($v1)
/* 37FB88 E007E468 18400003 */ blez $v0, .LE007E478
/* 37FB8C E007E46C 2442FFFF */ addiu $v0, $v0, -0x1
/* 37FB90 E007E470 1C40001B */ bgtz $v0, .LE007E4E0
/* 37FB94 E007E474 AC620038 */ sw $v0, 0x38($v1)
.LE007E478:
/* 37FB98 E007E478 C4620008 */ lwc1 $f2, 0x8($v1)
/* 37FB9C E007E47C C4600010 */ lwc1 $f0, 0x10($v1)
/* 37FBA0 E007E480 C466FFF8 */ lwc1 $f6, -0x8($v1)
/* 37FBA4 E007E484 46001080 */ add.s $f2, $f2, $f0
/* 37FBA8 E007E488 C4600004 */ lwc1 $f0, 0x4($v1)
/* 37FBAC E007E48C C4640000 */ lwc1 $f4, 0x0($v1)
/* 37FBB0 E007E490 46003180 */ add.s $f6, $f6, $f0
/* 37FBB4 E007E494 C460000C */ lwc1 $f0, 0xC($v1)
/* 37FBB8 E007E498 46002100 */ add.s $f4, $f4, $f0
/* 37FBBC E007E49C E4620008 */ swc1 $f2, 0x8($v1)
/* 37FBC0 E007E4A0 C462FFFC */ lwc1 $f2, -0x4($v1)
/* 37FBC4 E007E4A4 C4600008 */ lwc1 $f0, 0x8($v1)
/* 37FBC8 E007E4A8 46001080 */ add.s $f2, $f2, $f0
/* 37FBCC E007E4AC E466FFF8 */ swc1 $f6, -0x8($v1)
/* 37FBD0 E007E4B0 E4640000 */ swc1 $f4, 0x0($v1)
/* 37FBD4 E007E4B4 14A6000A */ bne $a1, $a2, .LE007E4E0
/* 37FBD8 E007E4B8 E462FFFC */ swc1 $f2, -0x4($v1)
/* 37FBDC E007E4BC 46003006 */ mov.s $f0, $f6
/* 37FBE0 E007E4C0 4600403C */ c.lt.s $f8, $f0
/* 37FBE4 E007E4C4 00000000 */ nop
/* 37FBE8 E007E4C8 45020006 */ bc1fl .LE007E4E4
/* 37FBEC E007E4CC 24840001 */ addiu $a0, $a0, 0x1
/* 37FBF0 E007E4D0 AC60FFF8 */ sw $zero, -0x8($v1)
/* 37FBF4 E007E4D4 AC60FFFC */ sw $zero, -0x4($v1)
/* 37FBF8 E007E4D8 AC600008 */ sw $zero, 0x8($v1)
/* 37FBFC E007E4DC AC600000 */ sw $zero, 0x0($v1)
.LE007E4E0:
/* 37FC00 E007E4E0 24840001 */ addiu $a0, $a0, 0x1
.LE007E4E4:
/* 37FC04 E007E4E4 8E220008 */ lw $v0, 0x8($s1)
/* 37FC08 E007E4E8 0082102A */ slt $v0, $a0, $v0
/* 37FC0C E007E4EC 1440FFDD */ bnez $v0, .LE007E464
/* 37FC10 E007E4F0 2463004C */ addiu $v1, $v1, 0x4C
.LE007E4F4:
/* 37FC14 E007E4F4 8FBF0020 */ lw $ra, 0x20($sp)
/* 37FC18 E007E4F8 8FB1001C */ lw $s1, 0x1C($sp)
/* 37FC1C E007E4FC 8FB00018 */ lw $s0, 0x18($sp)
/* 37FC20 E007E500 03E00008 */ jr $ra
/* 37FC24 E007E504 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void fire_flower_update(EffectInstance* effect) {
FireFlowerFXData* part = effect->data.fireFlower;
s32 unk_04;
s32 unk_40X;
s32 i;
part->unk_40.y++;
part->unk_40.x++;
unk_04 = part->unk_04;
unk_40X = part->unk_40.x;
if (unk_04 == 7) {
shim_remove_effect(effect);
return;
}
switch (unk_04) {
case 0:
shim_load_effect(EFFECT_STARS_SPREAD);
stars_spread_main(0, part->pos.x - 10.0f, part->pos.y, part->pos.z, 7, 20);
part->unk_34 = 0;
part->unk_38 = 0;
part->unk_40.x = 0;
part->unk_04++;
break;
case 1:
if (unk_40X >= ARRAY_COUNT(D_E007EC30)) {
part->unk_40.x = 0;
part->unk_04++;
} else {
part->unk_30 = D_E007EC30[unk_40X - 1] * 0.01;
part->unk_34 = 0;
part->unk_38 = 0;
}
break;
case 2:
if (unk_40X >= 2) {
part->unk_40.x = 0;
part->unk_04++;
} else {
part->unk_34 = 1;
}
break;
case 3:
if (unk_40X >= 15) {
part->unk_40.x = 0;
part->unk_04++;
} else {
part->unk_34 = 2;
}
break;
case 4:
if (unk_40X >= 45) {
part->unk_40.x = 0;
part->unk_04++;
} else {
part->unk_34 = 3;
part->unk_2C = 0;
if (unk_40X % 2) {
part->unk_30 = 1.0f;
} else {
part->unk_30 = 1.05f;
}
}
break;
case 5:
if (unk_40X >= 10) {
part->unk_40.x = 0;
part->unk_04++;
} else {
part->unk_34 = 0;
part->unk_2C = -10.0f;
}
break;
case 6:
part->unk_28 += 36.0f;
part->unk_34 = 0;
part->unk_3C *= 0.9;
if (part->unk_28 >= 720.0f) {
part->unk_28 = 720.0f;
part->unk_04++;
}
break;
}
unk_04 = part->unk_04;
part++;
if (unk_04 == 4 || unk_04 == 5 || unk_04 == 6) {
for (i = 1; i < effect->numParts; i++, part++) {
if (part->unk_40.z <= 0 || --part->unk_40.z <= 0) {
part->unk_18 += part->unk_20;
part->pos.x += part->unk_14;
part->pos.y += part->unk_18;
part->pos.z += part->unk_1C;
if (unk_04 == 4 && part->pos.x > 200.0f) {
part->pos.x = 0;
part->pos.y = 0;
part->unk_18 = 0;
part->pos.z = 0;
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel appendGfx_npc_blur
/* 16238 8003AE38 27BDFF08 */ addiu $sp, $sp, -0xF8
/* 1623C 8003AE3C F7BC00E8 */ sdc1 $f28, 0xE8($sp)
/* 16240 8003AE40 4480E000 */ mtc1 $zero, $f28
/* 16244 8003AE44 F7BA00E0 */ sdc1 $f26, 0xE0($sp)
/* 16248 8003AE48 3C01800A */ lui $at, %hi(D_800984C0)
/* 1624C 8003AE4C D43A84C0 */ ldc1 $f26, %lo(D_800984C0)($at)
/* 16250 8003AE50 AFB000A0 */ sw $s0, 0xA0($sp)
/* 16254 8003AE54 0080802D */ daddu $s0, $a0, $zero
/* 16258 8003AE58 AFB300AC */ sw $s3, 0xAC($sp)
/* 1625C 8003AE5C 0000982D */ daddu $s3, $zero, $zero
/* 16260 8003AE60 AFB500B4 */ sw $s5, 0xB4($sp)
/* 16264 8003AE64 0260A82D */ daddu $s5, $s3, $zero
/* 16268 8003AE68 AFB100A4 */ sw $s1, 0xA4($sp)
/* 1626C 8003AE6C 27B10060 */ addiu $s1, $sp, 0x60
/* 16270 8003AE70 AFB700BC */ sw $s7, 0xBC($sp)
/* 16274 8003AE74 27B70020 */ addiu $s7, $sp, 0x20
/* 16278 8003AE78 AFB400B0 */ sw $s4, 0xB0($sp)
/* 1627C 8003AE7C 0260A02D */ daddu $s4, $s3, $zero
/* 16280 8003AE80 AFBF00C0 */ sw $ra, 0xC0($sp)
/* 16284 8003AE84 AFB600B8 */ sw $s6, 0xB8($sp)
/* 16288 8003AE88 AFB200A8 */ sw $s2, 0xA8($sp)
/* 1628C 8003AE8C F7BE00F0 */ sdc1 $f30, 0xF0($sp)
/* 16290 8003AE90 F7B800D8 */ sdc1 $f24, 0xD8($sp)
/* 16294 8003AE94 F7B600D0 */ sdc1 $f22, 0xD0($sp)
/* 16298 8003AE98 F7B400C8 */ sdc1 $f20, 0xC8($sp)
/* 1629C 8003AE9C 8E160020 */ lw $s6, 0x20($s0)
/* 162A0 8003AEA0 3C013FF0 */ lui $at, (0x3FF00000 >> 16)
/* 162A4 8003AEA4 4481F800 */ mtc1 $at, $f31
/* 162A8 8003AEA8 4480F000 */ mtc1 $zero, $f30
/* 162AC 8003AEAC 82D20001 */ lb $s2, 0x1($s6)
/* 162B0 8003AEB0 2652FFFF */ addiu $s2, $s2, -0x1
.L8003AEB4:
/* 162B4 8003AEB4 06410002 */ bgez $s2, .L8003AEC0
/* 162B8 8003AEB8 26730001 */ addiu $s3, $s3, 0x1
/* 162BC 8003AEBC 24120013 */ addiu $s2, $zero, 0x13
.L8003AEC0:
/* 162C0 8003AEC0 82C20001 */ lb $v0, 0x1($s6)
/* 162C4 8003AEC4 1242009C */ beq $s2, $v0, .L8003B138
/* 162C8 8003AEC8 2A620003 */ slti $v0, $s3, 0x3
/* 162CC 8003AECC 5440FFF9 */ bnel $v0, $zero, .L8003AEB4
/* 162D0 8003AED0 2652FFFF */ addiu $s2, $s2, -0x1
/* 162D4 8003AED4 0000982D */ daddu $s3, $zero, $zero
/* 162D8 8003AED8 26B50001 */ addiu $s5, $s5, 0x1
/* 162DC 8003AEDC 2AA20004 */ slti $v0, $s5, 0x4
/* 162E0 8003AEE0 10400095 */ beqz $v0, .L8003B138
/* 162E4 8003AEE4 26940014 */ addiu $s4, $s4, 0x14
/* 162E8 8003AEE8 24050007 */ addiu $a1, $zero, 0x7
/* 162EC 8003AEEC 240600FF */ addiu $a2, $zero, 0xFF
/* 162F0 8003AEF0 00121080 */ sll $v0, $s2, 2
/* 162F4 8003AEF4 02C21021 */ addu $v0, $s6, $v0
/* 162F8 8003AEF8 C4540004 */ lwc1 $f20, 0x4($v0)
/* 162FC 8003AEFC C4560054 */ lwc1 $f22, 0x54($v0)
/* 16300 8003AF00 C45800A4 */ lwc1 $f24, 0xA4($v0)
/* 16304 8003AF04 00C0102D */ daddu $v0, $a2, $zero
/* 16308 8003AF08 AFA20010 */ sw $v0, 0x10($sp)
/* 1630C 8003AF0C 24020078 */ addiu $v0, $zero, 0x78
/* 16310 8003AF10 00541023 */ subu $v0, $v0, $s4
/* 16314 8003AF14 AFA20014 */ sw $v0, 0x14($sp)
/* 16318 8003AF18 AFA00018 */ sw $zero, 0x18($sp)
/* 1631C 8003AF1C 8E040024 */ lw $a0, 0x24($s0)
/* 16320 8003AF20 0C0B7A25 */ jal set_npc_imgfx_all
/* 16324 8003AF24 00C0382D */ daddu $a3, $a2, $zero
/* 16328 8003AF28 4405A000 */ mfc1 $a1, $f20
/* 1632C 8003AF2C 4406B000 */ mfc1 $a2, $f22
/* 16330 8003AF30 4407C000 */ mfc1 $a3, $f24
/* 16334 8003AF34 C6140034 */ lwc1 $f20, 0x34($s0)
/* 16338 8003AF38 0C019E40 */ jal guTranslateF
/* 1633C 8003AF3C 27A40020 */ addiu $a0, $sp, 0x20
/* 16340 8003AF40 C6000048 */ lwc1 $f0, 0x48($s0)
/* 16344 8003AF44 461C0032 */ c.eq.s $f0, $f28
/* 16348 8003AF48 00000000 */ nop
/* 1634C 8003AF4C 4501000B */ bc1t .L8003AF7C
/* 16350 8003AF50 00000000 */ nop
/* 16354 8003AF54 E7BC0010 */ swc1 $f28, 0x10($sp)
/* 16358 8003AF58 8E050048 */ lw $a1, 0x48($s0)
/* 1635C 8003AF5C 4406E000 */ mfc1 $a2, $f28
/* 16360 8003AF60 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 16364 8003AF64 0C019EC8 */ jal guRotateF
/* 16368 8003AF68 0220202D */ daddu $a0, $s1, $zero
/* 1636C 8003AF6C 0220202D */ daddu $a0, $s1, $zero
/* 16370 8003AF70 27A50020 */ addiu $a1, $sp, 0x20
/* 16374 8003AF74 0C019D80 */ jal guMtxCatF
/* 16378 8003AF78 00A0302D */ daddu $a2, $a1, $zero
.L8003AF7C:
/* 1637C 8003AF7C C6000044 */ lwc1 $f0, 0x44($s0)
/* 16380 8003AF80 461C0032 */ c.eq.s $f0, $f28
/* 16384 8003AF84 00000000 */ nop
/* 16388 8003AF88 4501000B */ bc1t .L8003AFB8
/* 1638C 8003AF8C 00000000 */ nop
/* 16390 8003AF90 E7BC0010 */ swc1 $f28, 0x10($sp)
/* 16394 8003AF94 8E050048 */ lw $a1, 0x48($s0)
/* 16398 8003AF98 4406E000 */ mfc1 $a2, $f28
/* 1639C 8003AF9C 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 163A0 8003AFA0 0C019EC8 */ jal guRotateF
/* 163A4 8003AFA4 0220202D */ daddu $a0, $s1, $zero
/* 163A8 8003AFA8 0220202D */ daddu $a0, $s1, $zero
/* 163AC 8003AFAC 27A50020 */ addiu $a1, $sp, 0x20
/* 163B0 8003AFB0 0C019D80 */ jal guMtxCatF
/* 163B4 8003AFB4 00A0302D */ daddu $a2, $a1, $zero
.L8003AFB8:
/* 163B8 8003AFB8 C600004C */ lwc1 $f0, 0x4C($s0)
/* 163BC 8003AFBC 461C0032 */ c.eq.s $f0, $f28
/* 163C0 8003AFC0 00000000 */ nop
/* 163C4 8003AFC4 4501000B */ bc1t .L8003AFF4
/* 163C8 8003AFC8 00000000 */ nop
/* 163CC 8003AFCC E7BC0010 */ swc1 $f28, 0x10($sp)
/* 163D0 8003AFD0 8E050048 */ lw $a1, 0x48($s0)
/* 163D4 8003AFD4 4406E000 */ mfc1 $a2, $f28
/* 163D8 8003AFD8 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 163DC 8003AFDC 0C019EC8 */ jal guRotateF
/* 163E0 8003AFE0 0220202D */ daddu $a0, $s1, $zero
/* 163E4 8003AFE4 0220202D */ daddu $a0, $s1, $zero
/* 163E8 8003AFE8 27A50020 */ addiu $a1, $sp, 0x20
/* 163EC 8003AFEC 0C019D80 */ jal guMtxCatF
/* 163F0 8003AFF0 00A0302D */ daddu $a2, $a1, $zero
.L8003AFF4:
/* 163F4 8003AFF4 C6000054 */ lwc1 $f0, 0x54($s0)
/* 163F8 8003AFF8 46000021 */ cvt.d.s $f0, $f0
/* 163FC 8003AFFC 463A0002 */ mul.d $f0, $f0, $f26
/* 16400 8003B000 00000000 */ nop
/* 16404 8003B004 463E0032 */ c.eq.d $f0, $f30
/* 16408 8003B008 00000000 */ nop
/* 1640C 8003B00C 45000014 */ bc1f .L8003B060
/* 16410 8003B010 00000000 */ nop
/* 16414 8003B014 C6000058 */ lwc1 $f0, 0x58($s0)
/* 16418 8003B018 C6020320 */ lwc1 $f2, 0x320($s0)
/* 1641C 8003B01C 46020002 */ mul.s $f0, $f0, $f2
/* 16420 8003B020 00000000 */ nop
/* 16424 8003B024 46000021 */ cvt.d.s $f0, $f0
/* 16428 8003B028 463A0002 */ mul.d $f0, $f0, $f26
/* 1642C 8003B02C 00000000 */ nop
/* 16430 8003B030 463E0032 */ c.eq.d $f0, $f30
/* 16434 8003B034 00000000 */ nop
/* 16438 8003B038 45000009 */ bc1f .L8003B060
/* 1643C 8003B03C 00000000 */ nop
/* 16440 8003B040 C600005C */ lwc1 $f0, 0x5C($s0)
/* 16444 8003B044 46000021 */ cvt.d.s $f0, $f0
/* 16448 8003B048 463A0002 */ mul.d $f0, $f0, $f26
/* 1644C 8003B04C 00000000 */ nop
/* 16450 8003B050 463E0032 */ c.eq.d $f0, $f30
/* 16454 8003B054 00000000 */ nop
/* 16458 8003B058 4501001C */ bc1t .L8003B0CC
/* 1645C 8003B05C 00000000 */ nop
.L8003B060:
/* 16460 8003B060 C6060054 */ lwc1 $f6, 0x54($s0)
/* 16464 8003B064 460031A1 */ cvt.d.s $f6, $f6
/* 16468 8003B068 463A3182 */ mul.d $f6, $f6, $f26
/* 1646C 8003B06C 00000000 */ nop
/* 16470 8003B070 C604005C */ lwc1 $f4, 0x5C($s0)
/* 16474 8003B074 46002121 */ cvt.d.s $f4, $f4
/* 16478 8003B078 463A2102 */ mul.d $f4, $f4, $f26
/* 1647C 8003B07C 00000000 */ nop
/* 16480 8003B080 C6000058 */ lwc1 $f0, 0x58($s0)
/* 16484 8003B084 C6020320 */ lwc1 $f2, 0x320($s0)
/* 16488 8003B088 46020002 */ mul.s $f0, $f0, $f2
/* 1648C 8003B08C 00000000 */ nop
/* 16490 8003B090 46000021 */ cvt.d.s $f0, $f0
/* 16494 8003B094 463A0002 */ mul.d $f0, $f0, $f26
/* 16498 8003B098 00000000 */ nop
/* 1649C 8003B09C 462031A0 */ cvt.s.d $f6, $f6
/* 164A0 8003B0A0 46202120 */ cvt.s.d $f4, $f4
/* 164A4 8003B0A4 44053000 */ mfc1 $a1, $f6
/* 164A8 8003B0A8 44072000 */ mfc1 $a3, $f4
/* 164AC 8003B0AC 46200020 */ cvt.s.d $f0, $f0
/* 164B0 8003B0B0 44060000 */ mfc1 $a2, $f0
/* 164B4 8003B0B4 0C019DF0 */ jal guScaleF
/* 164B8 8003B0B8 0220202D */ daddu $a0, $s1, $zero
/* 164BC 8003B0BC 0220202D */ daddu $a0, $s1, $zero
/* 164C0 8003B0C0 27A50020 */ addiu $a1, $sp, 0x20
/* 164C4 8003B0C4 0C019D80 */ jal guMtxCatF
/* 164C8 8003B0C8 00A0302D */ daddu $a2, $a1, $zero
.L8003B0CC:
/* 164CC 8003B0CC 8E030000 */ lw $v1, 0x0($s0)
/* 164D0 8003B0D0 3C024000 */ lui $v0, (0x40000000 >> 16)
/* 164D4 8003B0D4 00621024 */ and $v0, $v1, $v0
/* 164D8 8003B0D8 5440000E */ bnel $v0, $zero, .L8003B114
/* 164DC 8003B0DC AFB70010 */ sw $s7, 0x10($sp)
/* 164E0 8003B0E0 3C020100 */ lui $v0, (0x1000000 >> 16)
/* 164E4 8003B0E4 00621024 */ and $v0, $v1, $v0
/* 164E8 8003B0E8 5440FF72 */ bnel $v0, $zero, .L8003AEB4
/* 164EC 8003B0EC 2652FFFF */ addiu $s2, $s2, -0x1
/* 164F0 8003B0F0 4600A20D */ trunc.w.s $f8, $f20
/* 164F4 8003B0F4 44054000 */ mfc1 $a1, $f8
/* 164F8 8003B0F8 0000302D */ daddu $a2, $zero, $zero
/* 164FC 8003B0FC AFB70010 */ sw $s7, 0x10($sp)
/* 16500 8003B100 8E040024 */ lw $a0, 0x24($s0)
/* 16504 8003B104 0C0B78F6 */ jal spr_draw_npc_sprite
/* 16508 8003B108 00C0382D */ daddu $a3, $a2, $zero
/* 1650C 8003B10C 0800EBAD */ j .L8003AEB4
/* 16510 8003B110 2652FFFF */ addiu $s2, $s2, -0x1
.L8003B114:
/* 16514 8003B114 3C044000 */ lui $a0, (0x40000001 >> 16)
/* 16518 8003B118 34840001 */ ori $a0, $a0, (0x40000001 & 0xFFFF)
/* 1651C 8003B11C 4600A20D */ trunc.w.s $f8, $f20
/* 16520 8003B120 44054000 */ mfc1 $a1, $f8
/* 16524 8003B124 0000302D */ daddu $a2, $zero, $zero
/* 16528 8003B128 0C0B7710 */ jal spr_draw_player_sprite
/* 1652C 8003B12C 00C0382D */ daddu $a3, $a2, $zero
/* 16530 8003B130 0800EBAD */ j .L8003AEB4
/* 16534 8003B134 2652FFFF */ addiu $s2, $s2, -0x1
.L8003B138:
/* 16538 8003B138 0C00F4EF */ jal npc_imgfx_update
/* 1653C 8003B13C 0200202D */ daddu $a0, $s0, $zero
/* 16540 8003B140 8FBF00C0 */ lw $ra, 0xC0($sp)
/* 16544 8003B144 8FB700BC */ lw $s7, 0xBC($sp)
/* 16548 8003B148 8FB600B8 */ lw $s6, 0xB8($sp)
/* 1654C 8003B14C 8FB500B4 */ lw $s5, 0xB4($sp)
/* 16550 8003B150 8FB400B0 */ lw $s4, 0xB0($sp)
/* 16554 8003B154 8FB300AC */ lw $s3, 0xAC($sp)
/* 16558 8003B158 8FB200A8 */ lw $s2, 0xA8($sp)
/* 1655C 8003B15C 8FB100A4 */ lw $s1, 0xA4($sp)
/* 16560 8003B160 8FB000A0 */ lw $s0, 0xA0($sp)
/* 16564 8003B164 D7BE00F0 */ ldc1 $f30, 0xF0($sp)
/* 16568 8003B168 D7BC00E8 */ ldc1 $f28, 0xE8($sp)
/* 1656C 8003B16C D7BA00E0 */ ldc1 $f26, 0xE0($sp)
/* 16570 8003B170 D7B800D8 */ ldc1 $f24, 0xD8($sp)
/* 16574 8003B174 D7B600D0 */ ldc1 $f22, 0xD0($sp)
/* 16578 8003B178 D7B400C8 */ ldc1 $f20, 0xC8($sp)
/* 1657C 8003B17C 03E00008 */ jr $ra
/* 16580 8003B180 27BD00F8 */ addiu $sp, $sp, 0xF8
### DECOMPILED C INSTRUCTIONS:
void appendGfx_npc_blur(void* data) {
Npc* npc = (Npc*) data;
Matrix4f sp20, sp60;
f32 x, y, z;
f32 yaw;
s32 var_s3;
s32 var_s5;
s32 index;
NpcMotionBlur* blur;
var_s3 = 0;
var_s5 = 0;
blur = npc->blur.motion;
index = blur->index;
while (TRUE) {
index--;
var_s3++;
if (index < 0) {
index = ARRAY_COUNT(blur->x) - 1;
}
if (index == blur->index) {
break;
}
if (var_s3 >= 3) {
var_s3 = 0;
var_s5++;
if (var_s5 >= 4) {
break;
}
x = blur->x[index];
y = blur->y[index];
z = blur->z[index];
set_npc_imgfx_all(npc->spriteInstanceID, IMGFX_SET_ALPHA, 255, 255, 255, 120 - (var_s5 * 20), 0);
yaw = npc->renderYaw;
guTranslateF(sp20, x, y, z);
if (npc->rotation.y != 0.0f) {
guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp60, sp20, sp20);
}
if (npc->rotation.x != 0.0f) {
guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp60, sp20, sp20);
}
if (npc->rotation.z != 0.0f) {
guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp60, sp20, sp20);
}
if (
(npc->scale.x * SPRITE_WORLD_SCALE_D) != 1.0 ||
((npc->scale.y * npc->verticalStretch) * SPRITE_WORLD_SCALE_D) != 1.0 ||
(npc->scale.z * SPRITE_WORLD_SCALE_D) != 1.0)
{
guScaleF(
sp60,
npc->scale.x * SPRITE_WORLD_SCALE_D,
(npc->scale.y * npc->verticalStretch) * SPRITE_WORLD_SCALE_D,
npc->scale.z * SPRITE_WORLD_SCALE_D
);
guMtxCatF(sp60, sp20, sp20);
}
if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
spr_draw_npc_sprite(npc->spriteInstanceID, (s32) yaw, 0, 0, sp20);
}
} else {
spr_draw_player_sprite(PLAYER_SPRITE_AUX1 | DRAW_SPRITE_OVERRIDE_YAW, (s32) yaw, 0, 0, sp20);
}
}
}
npc_imgfx_update(npc);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_cameras
/* 8800 8002D400 27BDFF90 */ addiu $sp, $sp, -0x70
/* 8804 8002D404 F7B60068 */ sdc1 $f22, 0x68($sp)
/* 8808 8002D408 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 880C 8002D40C 4481B000 */ mtc1 $at, $f22
/* 8810 8002D410 F7B40060 */ sdc1 $f20, 0x60($sp)
/* 8814 8002D414 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 8818 8002D418 4481A800 */ mtc1 $at, $f21
/* 881C 8002D41C 4480A000 */ mtc1 $zero, $f20
/* 8820 8002D420 AFB3004C */ sw $s3, 0x4C($sp)
/* 8824 8002D424 0000982D */ daddu $s3, $zero, $zero
/* 8828 8002D428 AFB60058 */ sw $s6, 0x58($sp)
/* 882C 8002D42C 27B60030 */ addiu $s6, $sp, 0x30
/* 8830 8002D430 AFB50054 */ sw $s5, 0x54($sp)
/* 8834 8002D434 27B50034 */ addiu $s5, $sp, 0x34
/* 8838 8002D438 AFB40050 */ sw $s4, 0x50($sp)
/* 883C 8002D43C 27B40038 */ addiu $s4, $sp, 0x38
/* 8840 8002D440 AFB00040 */ sw $s0, 0x40($sp)
/* 8844 8002D444 3C10800B */ lui $s0, %hi(gCameras)
/* 8848 8002D448 26101D80 */ addiu $s0, $s0, %lo(gCameras)
/* 884C 8002D44C AFBF005C */ sw $ra, 0x5C($sp)
/* 8850 8002D450 AFB20048 */ sw $s2, 0x48($sp)
/* 8854 8002D454 AFB10044 */ sw $s1, 0x44($sp)
.L8002D458:
/* 8858 8002D458 96020000 */ lhu $v0, 0x0($s0)
/* 885C 8002D45C 104000A5 */ beqz $v0, .L8002D6F4
/* 8860 8002D460 30420002 */ andi $v0, $v0, 0x2
/* 8864 8002D464 544000A4 */ bnel $v0, $zero, .L8002D6F8
/* 8868 8002D468 26730001 */ addiu $s3, $s3, 0x1
/* 886C 8002D46C 86030004 */ lh $v1, 0x4($s0)
/* 8870 8002D470 3C01800A */ lui $at, %hi(gCurrentCamID)
/* 8874 8002D474 A433A634 */ sh $s3, %lo(gCurrentCamID)($at)
/* 8878 8002D478 2C620007 */ sltiu $v0, $v1, 0x7
/* 887C 8002D47C 1040001E */ beqz $v0, .L8002D4F8
/* 8880 8002D480 00031080 */ sll $v0, $v1, 2
/* 8884 8002D484 3C01800A */ lui $at, %hi(jtbl_800981E0)
/* 8888 8002D488 00220821 */ addu $at, $at, $v0
/* 888C 8002D48C 8C2281E0 */ lw $v0, %lo(jtbl_800981E0)($at)
/* 8890 8002D490 00400008 */ jr $v0
/* 8894 8002D494 00000000 */ nop
glabel .L8002D498
/* 8898 8002D498 0C00C525 */ jal update_camera_zone_interp
/* 889C 8002D49C 0200202D */ daddu $a0, $s0, $zero
/* 88A0 8002D4A0 0800B540 */ j .L8002D500
/* 88A4 8002D4A4 00000000 */ nop
glabel .L8002D4A8
/* 88A8 8002D4A8 0C00BE14 */ jal update_camera_mode_0
/* 88AC 8002D4AC 0200202D */ daddu $a0, $s0, $zero
/* 88B0 8002D4B0 0800B540 */ j .L8002D500
/* 88B4 8002D4B4 00000000 */ nop
glabel .L8002D4B8
/* 88B8 8002D4B8 0C00BCA4 */ jal update_camera_mode_1
/* 88BC 8002D4BC 0200202D */ daddu $a0, $s0, $zero
/* 88C0 8002D4C0 0800B540 */ j .L8002D500
/* 88C4 8002D4C4 00000000 */ nop
glabel .L8002D4C8
/* 88C8 8002D4C8 0C00BB3E */ jal update_camera_mode_2
/* 88CC 8002D4CC 0200202D */ daddu $a0, $s0, $zero
/* 88D0 8002D4D0 0800B540 */ j .L8002D500
/* 88D4 8002D4D4 00000000 */ nop
glabel .L8002D4D8
/* 88D8 8002D4D8 0C00BA44 */ jal update_camera_mode_4
/* 88DC 8002D4DC 0200202D */ daddu $a0, $s0, $zero
/* 88E0 8002D4E0 0800B540 */ j .L8002D500
/* 88E4 8002D4E4 00000000 */ nop
glabel .L8002D4E8
/* 88E8 8002D4E8 0C00C000 */ jal update_camera_mode_5
/* 88EC 8002D4EC 0200202D */ daddu $a0, $s0, $zero
/* 88F0 8002D4F0 0800B540 */ j .L8002D500
/* 88F4 8002D4F4 00000000 */ nop
glabel .L8002D4F8
/* 88F8 8002D4F8 0C00BE64 */ jal update_camera_mode_6
/* 88FC 8002D4FC 0200202D */ daddu $a0, $s0, $zero
.L8002D500:
/* 8900 8002D500 C6000044 */ lwc1 $f0, 0x44($s0)
/* 8904 8002D504 3C05800A */ lui $a1, %hi(gDisplayContext)
/* 8908 8002D508 8CA5A674 */ lw $a1, %lo(gDisplayContext)($a1)
/* 890C 8002D50C E7A00010 */ swc1 $f0, 0x10($sp)
/* 8910 8002D510 C6000048 */ lwc1 $f0, 0x48($s0)
/* 8914 8002D514 E7A00014 */ swc1 $f0, 0x14($sp)
/* 8918 8002D518 C600004C */ lwc1 $f0, 0x4C($s0)
/* 891C 8002D51C E7A00018 */ swc1 $f0, 0x18($sp)
/* 8920 8002D520 C6000050 */ lwc1 $f0, 0x50($s0)
/* 8924 8002D524 26120114 */ addiu $s2, $s0, 0x114
/* 8928 8002D528 AFA00020 */ sw $zero, 0x20($sp)
/* 892C 8002D52C E7B60024 */ swc1 $f22, 0x24($sp)
/* 8930 8002D530 AFA00028 */ sw $zero, 0x28($sp)
/* 8934 8002D534 E7A0001C */ swc1 $f0, 0x1C($sp)
/* 8938 8002D538 8E06003C */ lw $a2, 0x3C($s0)
/* 893C 8002D53C 8E070040 */ lw $a3, 0x40($s0)
/* 8940 8002D540 0C018CC8 */ jal guLookAtReflectF
/* 8944 8002D544 0240202D */ daddu $a0, $s2, $zero
/* 8948 8002D548 96030000 */ lhu $v1, 0x0($s0)
/* 894C 8002D54C 30620010 */ andi $v0, $v1, 0x10
/* 8950 8002D550 14400034 */ bnez $v0, .L8002D624
/* 8954 8002D554 260400D4 */ addiu $a0, $s0, 0xD4
/* 8958 8002D558 30620004 */ andi $v0, $v1, 0x4
/* 895C 8002D55C 10400004 */ beqz $v0, .L8002D570
/* 8960 8002D560 261100D4 */ addiu $s1, $s0, 0xD4
/* 8964 8002D564 0C00CCE5 */ jal create_camera_leadplayer_matrix
/* 8968 8002D568 0200202D */ daddu $a0, $s0, $zero
/* 896C 8002D56C 261100D4 */ addiu $s1, $s0, 0xD4
.L8002D570:
/* 8970 8002D570 0220202D */ daddu $a0, $s1, $zero
/* 8974 8002D574 8607000A */ lh $a3, 0xA($s0)
/* 8978 8002D578 86020012 */ lh $v0, 0x12($s0)
/* 897C 8002D57C 8603000C */ lh $v1, 0xC($s0)
/* 8980 8002D580 44820000 */ mtc1 $v0, $f0
/* 8984 8002D584 00000000 */ nop
/* 8988 8002D588 46800020 */ cvt.s.w $f0, $f0
/* 898C 8002D58C E7A00010 */ swc1 $f0, 0x10($sp)
/* 8990 8002D590 86020014 */ lh $v0, 0x14($s0)
/* 8994 8002D594 44871000 */ mtc1 $a3, $f2
/* 8998 8002D598 00000000 */ nop
/* 899C 8002D59C 468010A0 */ cvt.s.w $f2, $f2
/* 89A0 8002D5A0 E7B60018 */ swc1 $f22, 0x18($sp)
/* 89A4 8002D5A4 44820000 */ mtc1 $v0, $f0
/* 89A8 8002D5A8 00000000 */ nop
/* 89AC 8002D5AC 46800020 */ cvt.s.w $f0, $f0
/* 89B0 8002D5B0 E7A00014 */ swc1 $f0, 0x14($sp)
/* 89B4 8002D5B4 44830000 */ mtc1 $v1, $f0
/* 89B8 8002D5B8 00000000 */ nop
/* 89BC 8002D5BC 46800020 */ cvt.s.w $f0, $f0
/* 89C0 8002D5C0 46001083 */ div.s $f2, $f2, $f0
/* 89C4 8002D5C4 8E060018 */ lw $a2, 0x18($s0)
/* 89C8 8002D5C8 44071000 */ mfc1 $a3, $f2
/* 89CC 8002D5CC 0C018EE4 */ jal guPerspectiveF
/* 89D0 8002D5D0 26050038 */ addiu $a1, $s0, 0x38
/* 89D4 8002D5D4 96020000 */ lhu $v0, 0x0($s0)
/* 89D8 8002D5D8 30420008 */ andi $v0, $v0, 0x8
/* 89DC 8002D5DC 10400004 */ beqz $v0, .L8002D5F0
/* 89E0 8002D5E0 26040194 */ addiu $a0, $s0, 0x194
/* 89E4 8002D5E4 0220282D */ daddu $a1, $s1, $zero
/* 89E8 8002D5E8 0C019D80 */ jal guMtxCatF
/* 89EC 8002D5EC 0220302D */ daddu $a2, $s1, $zero
.L8002D5F0:
/* 89F0 8002D5F0 96020000 */ lhu $v0, 0x0($s0)
/* 89F4 8002D5F4 30420004 */ andi $v0, $v0, 0x4
/* 89F8 8002D5F8 10400004 */ beqz $v0, .L8002D60C
/* 89FC 8002D5FC 26040154 */ addiu $a0, $s0, 0x154
/* 8A00 8002D600 0220282D */ daddu $a1, $s1, $zero
/* 8A04 8002D604 0C019D80 */ jal guMtxCatF
/* 8A08 8002D608 0220302D */ daddu $a2, $s1, $zero
.L8002D60C:
/* 8A0C 8002D60C 0240202D */ daddu $a0, $s2, $zero
/* 8A10 8002D610 0220282D */ daddu $a1, $s1, $zero
/* 8A14 8002D614 0C019D80 */ jal guMtxCatF
/* 8A18 8002D618 00A0302D */ daddu $a2, $a1, $zero
/* 8A1C 8002D61C 0800B5B0 */ j .L8002D6C0
/* 8A20 8002D620 AFB60010 */ sw $s6, 0x10($sp)
.L8002D624:
/* 8A24 8002D624 8602000A */ lh $v0, 0xA($s0)
/* 8A28 8002D628 44822000 */ mtc1 $v0, $f4
/* 8A2C 8002D62C 00000000 */ nop
/* 8A30 8002D630 46802120 */ cvt.s.w $f4, $f4
/* 8A34 8002D634 46002187 */ neg.s $f6, $f4
/* 8A38 8002D638 460031A1 */ cvt.d.s $f6, $f6
/* 8A3C 8002D63C 46343182 */ mul.d $f6, $f6, $f20
/* 8A40 8002D640 00000000 */ nop
/* 8A44 8002D644 46002121 */ cvt.d.s $f4, $f4
/* 8A48 8002D648 46342102 */ mul.d $f4, $f4, $f20
/* 8A4C 8002D64C 00000000 */ nop
/* 8A50 8002D650 8602000C */ lh $v0, 0xC($s0)
/* 8A54 8002D654 44820000 */ mtc1 $v0, $f0
/* 8A58 8002D658 00000000 */ nop
/* 8A5C 8002D65C 46800020 */ cvt.s.w $f0, $f0
/* 8A60 8002D660 46000087 */ neg.s $f2, $f0
/* 8A64 8002D664 460010A1 */ cvt.d.s $f2, $f2
/* 8A68 8002D668 46341082 */ mul.d $f2, $f2, $f20
/* 8A6C 8002D66C 00000000 */ nop
/* 8A70 8002D670 3C01C47A */ lui $at, (0xC47A0000 >> 16)
/* 8A74 8002D674 44814000 */ mtc1 $at, $f8
/* 8A78 8002D678 3C01447A */ lui $at, (0x447A0000 >> 16)
/* 8A7C 8002D67C 44815000 */ mtc1 $at, $f10
/* 8A80 8002D680 E7B6001C */ swc1 $f22, 0x1C($sp)
/* 8A84 8002D684 E7A80014 */ swc1 $f8, 0x14($sp)
/* 8A88 8002D688 46000021 */ cvt.d.s $f0, $f0
/* 8A8C 8002D68C 46340002 */ mul.d $f0, $f0, $f20
/* 8A90 8002D690 00000000 */ nop
/* 8A94 8002D694 E7AA0018 */ swc1 $f10, 0x18($sp)
/* 8A98 8002D698 462031A0 */ cvt.s.d $f6, $f6
/* 8A9C 8002D69C 46202120 */ cvt.s.d $f4, $f4
/* 8AA0 8002D6A0 44053000 */ mfc1 $a1, $f6
/* 8AA4 8002D6A4 44062000 */ mfc1 $a2, $f4
/* 8AA8 8002D6A8 462010A0 */ cvt.s.d $f2, $f2
/* 8AAC 8002D6AC 44071000 */ mfc1 $a3, $f2
/* 8AB0 8002D6B0 46200020 */ cvt.s.d $f0, $f0
/* 8AB4 8002D6B4 0C018E44 */ jal guOrthoF
/* 8AB8 8002D6B8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 8ABC 8002D6BC AFB60010 */ sw $s6, 0x10($sp)
.L8002D6C0:
/* 8AC0 8002D6C0 AFB50014 */ sw $s5, 0x14($sp)
/* 8AC4 8002D6C4 AFB40018 */ sw $s4, 0x18($sp)
/* 8AC8 8002D6C8 8E050060 */ lw $a1, 0x60($s0)
/* 8ACC 8002D6CC 8E060064 */ lw $a2, 0x64($s0)
/* 8AD0 8002D6D0 8E070068 */ lw $a3, 0x68($s0)
/* 8AD4 8002D6D4 0C00B94E */ jal get_screen_coords
/* 8AD8 8002D6D8 0000202D */ daddu $a0, $zero, $zero
/* 8ADC 8002D6DC 96C20002 */ lhu $v0, 0x2($s6)
/* 8AE0 8002D6E0 A6020032 */ sh $v0, 0x32($s0)
/* 8AE4 8002D6E4 96A20002 */ lhu $v0, 0x2($s5)
/* 8AE8 8002D6E8 A6020034 */ sh $v0, 0x34($s0)
/* 8AEC 8002D6EC 96820002 */ lhu $v0, 0x2($s4)
/* 8AF0 8002D6F0 A6020036 */ sh $v0, 0x36($s0)
.L8002D6F4:
/* 8AF4 8002D6F4 26730001 */ addiu $s3, $s3, 0x1
.L8002D6F8:
/* 8AF8 8002D6F8 2A620004 */ slti $v0, $s3, 0x4
/* 8AFC 8002D6FC 1440FF56 */ bnez $v0, .L8002D458
/* 8B00 8002D700 26100558 */ addiu $s0, $s0, 0x558
/* 8B04 8002D704 8FBF005C */ lw $ra, 0x5C($sp)
/* 8B08 8002D708 8FB60058 */ lw $s6, 0x58($sp)
/* 8B0C 8002D70C 8FB50054 */ lw $s5, 0x54($sp)
/* 8B10 8002D710 8FB40050 */ lw $s4, 0x50($sp)
/* 8B14 8002D714 8FB3004C */ lw $s3, 0x4C($sp)
/* 8B18 8002D718 8FB20048 */ lw $s2, 0x48($sp)
/* 8B1C 8002D71C 8FB10044 */ lw $s1, 0x44($sp)
/* 8B20 8002D720 8FB00040 */ lw $s0, 0x40($sp)
/* 8B24 8002D724 D7B60068 */ ldc1 $f22, 0x68($sp)
/* 8B28 8002D728 D7B40060 */ ldc1 $f20, 0x60($sp)
/* 8B2C 8002D72C 3C01800A */ lui $at, %hi(gCurrentCamID)
/* 8B30 8002D730 A420A634 */ sh $zero, %lo(gCurrentCamID)($at)
/* 8B34 8002D734 03E00008 */ jr $ra
/* 8B38 8002D738 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void update_cameras(void) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gCameras); i++) {
Camera* cam = &gCameras[i];
s32 sx;
s32 sy;
s32 sz;
if (cam->flags == 0 || cam->flags & CAMERA_FLAG_DISABLED) {
continue;
}
gCurrentCamID = i;
switch (cam->updateMode) {
case CAM_UPDATE_FROM_ZONE:
update_camera_zone_interp(cam);
break;
case CAM_UPDATE_MODE_INIT:
update_camera_mode_0(cam);
break;
case CAM_UPDATE_UNUSED_1:
update_camera_mode_1(cam);
break;
case CAM_UPDATE_MODE_2:
update_camera_mode_2(cam);
break;
case CAM_UPDATE_UNUSED_4:
update_camera_mode_4(cam);
break;
case CAM_UPDATE_UNUSED_5:
update_camera_mode_5(cam);
break;
case CAM_UPDATE_MODE_6:
default:
update_camera_mode_6(cam);
break;
}
guLookAtReflectF(cam->viewMtxPlayer, &gDisplayContext->lookAt, cam->lookAt_eye.x, cam->lookAt_eye.y, cam->lookAt_eye.z, cam->lookAt_obj.x, cam->lookAt_obj.y, cam->lookAt_obj.z, 0, 1.0f, 0);
if (!(cam->flags & CAMERA_FLAG_ORTHO)) {
if (cam->flags & CAMERA_FLAG_LEAD_PLAYER) {
create_camera_leadplayer_matrix(cam);
}
guPerspectiveF(cam->perspectiveMatrix, &cam->perspNorm, cam->vfov, (f32) cam->viewportW / (f32) cam->viewportH, (f32) cam->nearClip, (f32) cam->farClip, 1.0f);
if (cam->flags & CAMERA_FLAG_SHAKING) {
guMtxCatF(cam->viewMtxShaking, cam->perspectiveMatrix, cam->perspectiveMatrix);
}
if (cam->flags & CAMERA_FLAG_LEAD_PLAYER) {
guMtxCatF(cam->viewMtxLeading, cam->perspectiveMatrix, cam->perspectiveMatrix);
}
guMtxCatF(cam->viewMtxPlayer, cam->perspectiveMatrix, cam->perspectiveMatrix);
} else {
f32 w = cam->viewportW;
f32 h = cam->viewportH;
guOrthoF(cam->perspectiveMatrix, -w * 0.5, w * 0.5, -h * 0.5, h * 0.5, -1000.0f, 1000.0f, 1.0f);
}
get_screen_coords(0, cam->targetPos.x, cam->targetPos.y, cam->targetPos.z, &sx, &sy, &sz);
cam->targetScreenCoords.x = sx;
cam->targetScreenCoords.y = sy;
cam->targetScreenCoords.z = sz;
}
gCurrentCamID = CAM_DEFAULT;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_80245440
/* 173D20 80245440 27BDFFD0 */ addiu $sp, $sp, -0x30
D_80245444:
/* 173D24 80245444 AFB1001C */ sw $s1, 0x1C($sp)
D_80245448:
/* 173D28 80245448 3C11800E */ lui $s1, %hi(gBattleStatus)
glabel func_8024544C
/* 173D2C 8024544C 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
D_80245450_EF2550:
/* 173D30 80245450 AFB30024 */ sw $s3, 0x24($sp)
/* 173D34 80245454 3C13800E */ lui $s3, %hi(gBattleSubState)
D_80245458_EF2558:
/* 173D38 80245458 2673C4DC */ addiu $s3, $s3, %lo(gBattleSubState)
/* 173D3C 8024545C 24020001 */ addiu $v0, $zero, 0x1
D_80245460_EF2560:
/* 173D40 80245460 AFBF0028 */ sw $ra, 0x28($sp)
/* 173D44 80245464 AFB20020 */ sw $s2, 0x20($sp)
D_80245468_EF7A78:
/* 173D48 80245468 AFB00018 */ sw $s0, 0x18($sp)
D_8024546C:
/* 173D4C 8024546C 8E3000D8 */ lw $s0, 0xD8($s1)
/* 173D50 80245470 8E630000 */ lw $v1, 0x0($s3)
.L80245474:
/* 173D54 80245474 8E3200DC */ lw $s2, 0xDC($s1)
.L80245478:
/* 173D58 80245478 1062004D */ beq $v1, $v0, .L802455B0
.L8024547C:
/* 173D5C 8024547C 28620002 */ slti $v0, $v1, 0x2
/* 173D60 80245480 10400005 */ beqz $v0, D_80245498
/* 173D64 80245484 24020002 */ addiu $v0, $zero, 0x2
glabel func_80245488
/* 173D68 80245488 10600007 */ beqz $v1, D_802454A8_EF25A8
/* 173D6C 8024548C 2404FFF7 */ addiu $a0, $zero, -0x9
D_80245490:
/* 173D70 80245490 0809158F */ j .L8024563C
/* 173D74 80245494 00000000 */ nop
D_80245498:
/* 173D78 80245498 1062005E */ beq $v1, $v0, D_80245614
/* 173D7C 8024549C 00000000 */ nop
D_802454A0:
/* 173D80 802454A0 0809158F */ j .L8024563C
/* 173D84 802454A4 00000000 */ nop
D_802454A8_EF25A8:
/* 173D88 802454A8 8E220000 */ lw $v0, 0x0($s1)
/* 173D8C 802454AC 00441024 */ and $v0, $v0, $a0
D_802454B0:
/* 173D90 802454B0 AE220000 */ sw $v0, 0x0($s1)
glabel func_802454B4
/* 173D94 802454B4 8E220004 */ lw $v0, 0x4($s1)
D_802454B8:
/* 173D98 802454B8 2403FFFD */ addiu $v1, $zero, -0x3
/* 173D9C 802454BC A220008C */ sb $zero, 0x8C($s1)
.L802454C0:
/* 173DA0 802454C0 00431024 */ and $v0, $v0, $v1
/* 173DA4 802454C4 2403FFFB */ addiu $v1, $zero, -0x5
/* 173DA8 802454C8 00431024 */ and $v0, $v0, $v1
/* 173DAC 802454CC 00441024 */ and $v0, $v0, $a0
/* 173DB0 802454D0 2403FFEF */ addiu $v1, $zero, -0x11
D_802454D4:
/* 173DB4 802454D4 00431024 */ and $v0, $v0, $v1
/* 173DB8 802454D8 AE220004 */ sw $v0, 0x4($s1)
/* 173DBC 802454DC 82030210 */ lb $v1, 0x210($s0)
D_802454E0:
/* 173DC0 802454E0 10600013 */ beqz $v1, jtbl_80245530
/* 173DC4 802454E4 24020007 */ addiu $v0, $zero, 0x7
/* 173DC8 802454E8 14620008 */ bne $v1, $v0, .L8024550C
/* 173DCC 802454EC 00000000 */ nop
.L802454F0:
/* 173DD0 802454F0 0C05272D */ jal sfx_play_sound
/* 173DD4 802454F4 240400E7 */ addiu $a0, $zero, 0xE7
D_802454F8:
/* 173DD8 802454F8 8E030228 */ lw $v1, 0x228($s0)
/* 173DDC 802454FC 8C620000 */ lw $v0, 0x0($v1)
/* 173DE0 80245500 34420010 */ ori $v0, $v0, 0x10
glabel func_80245504
/* 173DE4 80245504 AC620000 */ sw $v0, 0x0($v1)
.L80245508:
/* 173DE8 80245508 AE000228 */ sw $zero, 0x228($s0)
.L8024550C:
/* 173DEC 8024550C 86040436 */ lh $a0, 0x436($s0)
/* 173DF0 80245510 A2000210 */ sb $zero, 0x210($s0)
/* 173DF4 80245514 0C011E26 */ jal remove_status_debuff
D_80245518:
/* 173DF8 80245518 A2000211 */ sb $zero, 0x211($s0)
/* 173DFC 8024551C 8E020440 */ lw $v0, 0x440($s0)
/* 173E00 80245520 A2000216 */ sb $zero, 0x216($s0)
/* 173E04 80245524 A2000217 */ sb $zero, 0x217($s0)
D_80245528:
/* 173E08 80245528 8C42000C */ lw $v0, 0xC($v0)
glabel func_8024552C
/* 173E0C 8024552C AC40003C */ sw $zero, 0x3C($v0)
jtbl_80245530:
/* 173E10 80245530 0C093903 */ jal func_8024E40C
/* 173E14 80245534 24040019 */ addiu $a0, $zero, 0x19
.L80245538:
/* 173E18 80245538 0C09390F */ jal func_8024E43C
/* 173E1C 8024553C 0000202D */ daddu $a0, $zero, $zero
D_80245540:
/* 173E20 80245540 3C048028 */ lui $a0, %hi(EVS_Mario_HandlePhase)
D_80245544:
/* 173E24 80245544 24844EBC */ addiu $a0, $a0, %lo(EVS_Mario_HandlePhase)
D_80245548:
/* 173E28 80245548 2405000A */ addiu $a1, $zero, 0xA
/* 173E2C 8024554C 0000302D */ daddu $a2, $zero, $zero
D_80245550:
/* 173E30 80245550 24020004 */ addiu $v0, $zero, 0x4
/* 173E34 80245554 0C0B0CF8 */ jal start_script
/* 173E38 80245558 A22201A7 */ sb $v0, 0x1A7($s1)
/* 173E3C 8024555C 0040202D */ daddu $a0, $v0, $zero
/* 173E40 80245560 AE0401D4 */ sw $a0, 0x1D4($s0)
/* 173E44 80245564 8C820144 */ lw $v0, 0x144($a0)
.L80245568:
/* 173E48 80245568 AE0201E4 */ sw $v0, 0x1E4($s0)
/* 173E4C 8024556C 1240000B */ beqz $s2, .L8024559C
/* 173E50 80245570 AC800148 */ sw $zero, 0x148($a0)
/* 173E54 80245574 2405000A */ addiu $a1, $zero, 0xA
/* 173E58 80245578 8E4401C4 */ lw $a0, 0x1C4($s2)
/* 173E5C 8024557C 0C0B0CF8 */ jal start_script
.L80245580:
/* 173E60 80245580 0000302D */ daddu $a2, $zero, $zero
/* 173E64 80245584 0040202D */ daddu $a0, $v0, $zero
glabel func_80245588
/* 173E68 80245588 AE4401D4 */ sw $a0, 0x1D4($s2)
/* 173E6C 8024558C 8C820144 */ lw $v0, 0x144($a0)
/* 173E70 80245590 AE4201E4 */ sw $v0, 0x1E4($s2)
/* 173E74 80245594 24020100 */ addiu $v0, $zero, 0x100
.L80245598:
/* 173E78 80245598 AC820148 */ sw $v0, 0x148($a0)
.L8024559C:
/* 173E7C 8024559C 24020001 */ addiu $v0, $zero, 0x1
/* 173E80 802455A0 3C01800E */ lui $at, %hi(gBattleSubState)
/* 173E84 802455A4 AC22C4DC */ sw $v0, %lo(gBattleSubState)($at)
/* 173E88 802455A8 0809158F */ j .L8024563C
/* 173E8C 802455AC 00000000 */ nop
.L802455B0:
/* 173E90 802455B0 0C0B1059 */ jal does_script_exist
D_802455B4:
/* 173E94 802455B4 8E0401E4 */ lw $a0, 0x1E4($s0)
/* 173E98 802455B8 14400020 */ bnez $v0, .L8024563C
glabel func_802455BC
/* 173E9C 802455BC 00000000 */ nop
/* 173EA0 802455C0 8222008C */ lb $v0, 0x8C($s1)
/* 173EA4 802455C4 1440001D */ bnez $v0, .L8024563C
D_802455C8:
/* 173EA8 802455C8 00000000 */ nop
.L802455CC:
/* 173EAC 802455CC 0C039D91 */ jal find_item
D_802455D0:
/* 173EB0 802455D0 24040095 */ addiu $a0, $zero, 0x95
D_802455D4:
/* 173EB4 802455D4 04400017 */ bltz $v0, D_80245634
glabel func_802455D8
/* 173EB8 802455D8 2405000A */ addiu $a1, $zero, 0xA
/* 173EBC 802455DC 3C048028 */ lui $a0, %hi(EVS_Mario_HandlePhase)
D_802455E0:
/* 173EC0 802455E0 24844EBC */ addiu $a0, $a0, %lo(EVS_Mario_HandlePhase)
/* 173EC4 802455E4 0000302D */ daddu $a2, $zero, $zero
D_802455E8:
/* 173EC8 802455E8 24020008 */ addiu $v0, $zero, 0x8
/* 173ECC 802455EC 0C0B0CF8 */ jal start_script
D_802455F0:
/* 173ED0 802455F0 A22201A7 */ sb $v0, 0x1A7($s1)
D_802455F4:
/* 173ED4 802455F4 0040202D */ daddu $a0, $v0, $zero
D_802455F8:
/* 173ED8 802455F8 AE0401D4 */ sw $a0, 0x1D4($s0)
/* 173EDC 802455FC 8C830144 */ lw $v1, 0x144($a0)
D_80245600:
/* 173EE0 80245600 24020002 */ addiu $v0, $zero, 0x2
D_80245604:
/* 173EE4 80245604 AE620000 */ sw $v0, 0x0($s3)
D_80245608:
/* 173EE8 80245608 AE0301E4 */ sw $v1, 0x1E4($s0)
D_8024560C:
/* 173EEC 8024560C 0809158F */ j .L8024563C
D_80245610:
/* 173EF0 80245610 AC800148 */ sw $zero, 0x148($a0)
D_80245614:
/* 173EF4 80245614 8E0401E4 */ lw $a0, 0x1E4($s0)
D_80245618:
/* 173EF8 80245618 0C0B1059 */ jal does_script_exist
D_8024561C:
/* 173EFC 8024561C 00000000 */ nop
D_80245620:
/* 173F00 80245620 14400006 */ bnez $v0, .L8024563C
D_80245624:
/* 173F04 80245624 00000000 */ nop
glabel func_80245628
/* 173F08 80245628 8222008C */ lb $v0, 0x8C($s1)
/* 173F0C 8024562C 14400003 */ bnez $v0, .L8024563C
sbk_02_D_80245630:
/* 173F10 80245630 00000000 */ nop
D_80245634:
/* 173F14 80245634 2402000A */ addiu $v0, $zero, 0xA
D_80245638:
/* 173F18 80245638 AE620000 */ sw $v0, 0x0($s3)
.L8024563C:
/* 173F1C 8024563C 3C03800E */ lui $v1, %hi(gBattleSubState)
jtbl_80245640:
/* 173F20 80245640 8C63C4DC */ lw $v1, %lo(gBattleSubState)($v1)
/* 173F24 80245644 2402000A */ addiu $v0, $zero, 0xA
D_80245648:
/* 173F28 80245648 14620012 */ bne $v1, $v0, D_80245694
glabel func_8024564C
/* 173F2C 8024564C 24030001 */ addiu $v1, $zero, 0x1
D_80245650:
/* 173F30 80245650 3C02800B */ lui $v0, %hi(gCurrentEncounter)
/* 173F34 80245654 24420F10 */ addiu $v0, $v0, %lo(gCurrentEncounter)
/* 173F38 80245658 A0430009 */ sb $v1, 0x9($v0)
/* 173F3C 8024565C 3C02800E */ lui $v0, %hi(gBattleStatus + 0x4)
/* 173F40 80245660 8C42C074 */ lw $v0, %lo(gBattleStatus + 0x4)($v0)
/* 173F44 80245664 3C030200 */ lui $v1, (0x2000000 >> 16)
D_80245668:
/* 173F48 80245668 00431024 */ and $v0, $v0, $v1
.L8024566C:
/* 173F4C 8024566C 14400007 */ bnez $v0, .L8024568C
D_80245670:
/* 173F50 80245670 24020008 */ addiu $v0, $zero, 0x8
D_80245674:
/* 173F54 80245674 AFA20010 */ sw $v0, 0x10($sp)
glabel func_80245678
/* 173F58 80245678 0000202D */ daddu $a0, $zero, $zero
/* 173F5C 8024567C 2405FFFF */ addiu $a1, $zero, -0x1
/* 173F60 80245680 0080302D */ daddu $a2, $a0, $zero
/* 173F64 80245684 0C052A46 */ jal bgm_set_song
/* 173F68 80245688 240705DC */ addiu $a3, $zero, 0x5DC
.L8024568C:
/* 173F6C 8024568C 0C090464 */ jal func_80241190
.L80245690:
/* 173F70 80245690 24040020 */ addiu $a0, $zero, 0x20
D_80245694:
/* 173F74 80245694 8FBF0028 */ lw $ra, 0x28($sp)
D_80245698:
/* 173F78 80245698 8FB30024 */ lw $s3, 0x24($sp)
glabel func_8024569C
/* 173F7C 8024569C 8FB20020 */ lw $s2, 0x20($sp)
D_802456A0:
/* 173F80 802456A0 8FB1001C */ lw $s1, 0x1C($sp)
D_802456A4:
/* 173F84 802456A4 8FB00018 */ lw $s0, 0x18($sp)
glabel func_802456A8
/* 173F88 802456A8 03E00008 */ jr $ra
D_802456AC:
/* 173F8C 802456AC 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void btl_state_update_defeat(void) {
BattleStatus* battleStatus = &gBattleStatus;
EncounterStatus* currentEncounter = &gCurrentEncounter;
Actor* player = battleStatus->playerActor;
Actor* partner = battleStatus->partnerActor;
Evt* script;
switch (gBattleSubState) {
case BTL_SUBSTATE_DEFEAT_INIT:
battleStatus->flags1 &= ~BS_FLAGS1_SHOW_PLAYER_DECORATIONS;
gBattleStatus.flags2 &= ~BS_FLAGS2_2;
gBattleStatus.flags2 &= ~BS_FLAGS2_4;
gBattleStatus.flags2 &= ~BS_FLAGS2_8;
gBattleStatus.flags2 &= ~BS_FLAGS2_10;
battleStatus->stateFreezeCount = 0;
if (player->debuff != 0) {
if (player->debuff == STATUS_KEY_FROZEN) {
sfx_play_sound(SOUND_FROZEN_SHATTER);
player->icePillarEffect->flags |= FX_INSTANCE_FLAG_DISMISS;
player->icePillarEffect = NULL;
}
player->debuff = 0;
player->debuffDuration = 0;
remove_status_debuff(player->hudElementDataIndex);
player->koStatus = 0;
player->koDuration = 0;
player->disableEffect->data.disableX->koDuration = 0;
}
btl_cam_use_preset(BTL_CAM_PRESET_25);
btl_cam_target_actor(ACTOR_PLAYER);
battleStatus->battlePhase = PHASE_DEATH;
script = start_script(&EVS_Mario_HandlePhase, EVT_PRIORITY_A, 0);
player->takeTurnScript = script;
player->takeTurnScriptID = script->id;
script->owner1.actorID = ACTOR_PLAYER;
if (partner != NULL) {
script = start_script(partner->takeTurnSource, EVT_PRIORITY_A, 0);
partner->takeTurnScript = script;
partner->takeTurnScriptID = script->id;
script->owner1.actorID = ACTOR_PARTNER;
}
gBattleSubState = BTL_SUBSTATE_DEFEAT_CHECK_LIFE_SHROOM;
break;
case BTL_SUBSTATE_DEFEAT_CHECK_LIFE_SHROOM:
if (does_script_exist(player->takeTurnScriptID) || battleStatus->stateFreezeCount != 0) {
break;
}
if (find_item(ITEM_LIFE_SHROOM) >= 0) {
battleStatus->battlePhase = PHASE_USE_LIFE_SHROOM;
script = start_script(&EVS_Mario_HandlePhase, EVT_PRIORITY_A, 0);
player->takeTurnScript = script;
player->takeTurnScriptID = script->id;
script->owner1.actorID = ACTOR_PLAYER;
gBattleSubState = BTL_SUBSTATE_DEFEAT_AWAIT_LIFE_SHROOM;
} else {
gBattleSubState = BTL_SUBSTATE_DEFEAT_DONE;
}
break;
case BTL_SUBSTATE_DEFEAT_AWAIT_LIFE_SHROOM:
if (does_script_exist(player->takeTurnScriptID) || battleStatus->stateFreezeCount != 0) {
break;
}
// never reached if life shroom is successful. its item script calls RestorePreDefeatState,
// resetting the state to BATTLE_STATE_ENEMY_MOVE (based on the value of gDefeatedBattleState)
gBattleSubState = BTL_SUBSTATE_DEFEAT_DONE;
break;
}
if (gBattleSubState == BTL_SUBSTATE_DEFEAT_DONE) {
currentEncounter->battleOutcome = OUTCOME_PLAYER_LOST;
if (!(gBattleStatus.flags2 & BS_FLAGS2_DONT_STOP_MUSIC)) {
bgm_set_song(0, -1, 0, 1500, 8);
}
btl_set_state(BATTLE_STATE_END_BATTLE);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel clear_model_data
/* AC444 80115D44 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* AC448 80115D48 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* AC44C 80115D4C 80420070 */ lb $v0, 0x70($v0)
/* AC450 80115D50 1440002C */ bnez $v0, .L80115E04
/* AC454 80115D54 00000000 */ nop
/* AC458 80115D58 3C028015 */ lui $v0, %hi(wModelList)
/* AC45C 80115D5C 24421770 */ addiu $v0, $v0, %lo(wModelList)
/* AC460 80115D60 3C018015 */ lui $at, %hi(gCurrentModels)
/* AC464 80115D64 AC2212CC */ sw $v0, %lo(gCurrentModels)($at)
/* AC468 80115D68 3C028015 */ lui $v0, %hi(wTransformGroups)
/* AC46C 80115D6C 24421F70 */ addiu $v0, $v0, %lo(wTransformGroups)
/* AC470 80115D70 3C018015 */ lui $at, %hi(gCurrentTransformGroups)
/* AC474 80115D74 AC2212E0 */ sw $v0, %lo(gCurrentTransformGroups)($at)
/* AC478 80115D78 3C028015 */ lui $v0, %hi(wModelSpecialDls)
/* AC47C 80115D7C 24421F90 */ addiu $v0, $v0, %lo(wModelSpecialDls)
/* AC480 80115D80 3C018015 */ lui $at, %hi(gCurrentCustomModelGfxPtr)
/* AC484 80115D84 AC2212E8 */ sw $v0, %lo(gCurrentCustomModelGfxPtr)($at)
/* AC488 80115D88 3C028015 */ lui $v0, %hi(wCustomModelGfxBuilders)
/* AC48C 80115D8C 24422090 */ addiu $v0, $v0, %lo(wCustomModelGfxBuilders)
/* AC490 80115D90 3C018015 */ lui $at, %hi(gCurrentCustomModelGfxBuildersPtr)
/* AC494 80115D94 AC2212B8 */ sw $v0, %lo(gCurrentCustomModelGfxBuildersPtr)($at)
/* AC498 80115D98 3C028015 */ lui $v0, %hi(D_80152214)
/* AC49C 80115D9C 24422214 */ addiu $v0, $v0, %lo(D_80152214)
/* AC4A0 80115DA0 3C018015 */ lui $at, %hi(gCurrentModelTreeRoot)
/* AC4A4 80115DA4 AC2212FC */ sw $v0, %lo(gCurrentModelTreeRoot)($at)
/* AC4A8 80115DA8 3C028015 */ lui $v0, %hi(wModelLocalVtxBuffers)
/* AC4AC 80115DAC 24422190 */ addiu $v0, $v0, %lo(wModelLocalVtxBuffers)
/* AC4B0 80115DB0 3C018015 */ lui $at, %hi(gCurrentModelLocalVtxBuffers)
/* AC4B4 80115DB4 AC222210 */ sw $v0, %lo(gCurrentModelLocalVtxBuffers)($at)
/* AC4B8 80115DB8 3C028015 */ lui $v0, %hi(D_80152220)
/* AC4BC 80115DBC 24422220 */ addiu $v0, $v0, %lo(D_80152220)
/* AC4C0 80115DC0 3C01800A */ lui $at, %hi(mdl_currentModelTreeNodeInfo)
/* AC4C4 80115DC4 AC22A5F4 */ sw $v0, %lo(mdl_currentModelTreeNodeInfo)($at)
/* AC4C8 80115DC8 3C028015 */ lui $v0, %hi(wBackgroundFogMode)
/* AC4CC 80115DCC 24423220 */ addiu $v0, $v0, %lo(wBackgroundFogMode)
/* AC4D0 80115DD0 3C018015 */ lui $at, %hi(gBackgroundFogModePtr)
/* AC4D4 80115DD4 AC2212F0 */ sw $v0, %lo(gBackgroundFogModePtr)($at)
/* AC4D8 80115DD8 3C028015 */ lui $v0, %hi(wFogSettings)
/* AC4DC 80115DDC 24423228 */ addiu $v0, $v0, %lo(wFogSettings)
/* AC4E0 80115DE0 3C018015 */ lui $at, %hi(mdl_bgMultiplyColorA)
/* AC4E4 80115DE4 A020B74C */ sb $zero, %lo(mdl_bgMultiplyColorA)($at)
/* AC4E8 80115DE8 3C018015 */ lui $at, %hi(mdl_bgMultiplyColorR)
/* AC4EC 80115DEC A020B74D */ sb $zero, %lo(mdl_bgMultiplyColorR)($at)
/* AC4F0 80115DF0 3C018015 */ lui $at, %hi(mdl_bgMultiplyColorG)
/* AC4F4 80115DF4 A020B74E */ sb $zero, %lo(mdl_bgMultiplyColorG)($at)
/* AC4F8 80115DF8 3C018015 */ lui $at, %hi(mdl_bgMultiplyColorB)
/* AC4FC 80115DFC 080457A3 */ j .L80115E8C
/* AC500 80115E00 A020B74F */ sb $zero, %lo(mdl_bgMultiplyColorB)($at)
.L80115E04:
/* AC504 80115E04 3C028015 */ lui $v0, %hi(bModelList)
/* AC508 80115E08 24421B70 */ addiu $v0, $v0, %lo(bModelList)
/* AC50C 80115E0C 3C018015 */ lui $at, %hi(gCurrentModels)
/* AC510 80115E10 AC2212CC */ sw $v0, %lo(gCurrentModels)($at)
/* AC514 80115E14 3C028015 */ lui $v0, %hi(bTransformGroups)
/* AC518 80115E18 24421F80 */ addiu $v0, $v0, %lo(bTransformGroups)
/* AC51C 80115E1C 3C018015 */ lui $at, %hi(gCurrentTransformGroups)
/* AC520 80115E20 AC2212E0 */ sw $v0, %lo(gCurrentTransformGroups)($at)
/* AC524 80115E24 3C028015 */ lui $v0, %hi(bModelSpecialDls)
/* AC528 80115E28 24422010 */ addiu $v0, $v0, %lo(bModelSpecialDls)
/* AC52C 80115E2C 3C018015 */ lui $at, %hi(gCurrentCustomModelGfxPtr)
/* AC530 80115E30 AC2212E8 */ sw $v0, %lo(gCurrentCustomModelGfxPtr)($at)
/* AC534 80115E34 3C028015 */ lui $v0, %hi(bCustomModelGfxBuilders)
/* AC538 80115E38 24422110 */ addiu $v0, $v0, %lo(bCustomModelGfxBuilders)
/* AC53C 80115E3C 3C018015 */ lui $at, %hi(gCurrentCustomModelGfxBuildersPtr)
/* AC540 80115E40 AC2212B8 */ sw $v0, %lo(gCurrentCustomModelGfxBuildersPtr)($at)
/* AC544 80115E44 3C028015 */ lui $v0, %hi(D_80152218)
/* AC548 80115E48 24422218 */ addiu $v0, $v0, %lo(D_80152218)
/* AC54C 80115E4C 3C018015 */ lui $at, %hi(gCurrentModelTreeRoot)
/* AC550 80115E50 AC2212FC */ sw $v0, %lo(gCurrentModelTreeRoot)($at)
/* AC554 80115E54 3C028015 */ lui $v0, %hi(bModelLocalVtxBuffers)
/* AC558 80115E58 244221D0 */ addiu $v0, $v0, %lo(bModelLocalVtxBuffers)
/* AC55C 80115E5C 3C018015 */ lui $at, %hi(gCurrentModelLocalVtxBuffers)
/* AC560 80115E60 AC222210 */ sw $v0, %lo(gCurrentModelLocalVtxBuffers)($at)
/* AC564 80115E64 3C028015 */ lui $v0, %hi(D_80152A20)
/* AC568 80115E68 24422A20 */ addiu $v0, $v0, %lo(D_80152A20)
/* AC56C 80115E6C 3C01800A */ lui $at, %hi(mdl_currentModelTreeNodeInfo)
/* AC570 80115E70 AC22A5F4 */ sw $v0, %lo(mdl_currentModelTreeNodeInfo)($at)
/* AC574 80115E74 3C028015 */ lui $v0, %hi(bBackgroundFogMode)
/* AC578 80115E78 24423221 */ addiu $v0, $v0, %lo(bBackgroundFogMode)
/* AC57C 80115E7C 3C018015 */ lui $at, %hi(gBackgroundFogModePtr)
/* AC580 80115E80 AC2212F0 */ sw $v0, %lo(gBackgroundFogModePtr)($at)
/* AC584 80115E84 3C028015 */ lui $v0, %hi(bFogSettings)
/* AC588 80115E88 24423248 */ addiu $v0, $v0, %lo(bFogSettings)
.L80115E8C:
/* AC58C 80115E8C 3C018015 */ lui $at, %hi(gCurrentFogSettings)
/* AC590 80115E90 AC223264 */ sw $v0, %lo(gCurrentFogSettings)($at)
/* AC594 80115E94 3C028015 */ lui $v0, %hi(gCurrentModels)
/* AC598 80115E98 8C4212CC */ lw $v0, %lo(gCurrentModels)($v0)
/* AC59C 80115E9C 240400FF */ addiu $a0, $zero, 0xFF
/* AC5A0 80115EA0 244203FC */ addiu $v0, $v0, 0x3FC
.L80115EA4:
/* AC5A4 80115EA4 AC400000 */ sw $zero, 0x0($v0)
/* AC5A8 80115EA8 2484FFFF */ addiu $a0, $a0, -0x1
/* AC5AC 80115EAC 0481FFFD */ bgez $a0, .L80115EA4
/* AC5B0 80115EB0 2442FFFC */ addiu $v0, $v0, -0x4
/* AC5B4 80115EB4 3C028015 */ lui $v0, %hi(gCurrentTransformGroups)
/* AC5B8 80115EB8 8C4212E0 */ lw $v0, %lo(gCurrentTransformGroups)($v0)
/* AC5BC 80115EBC 24040003 */ addiu $a0, $zero, 0x3
/* AC5C0 80115EC0 2442000C */ addiu $v0, $v0, 0xC
.L80115EC4:
/* AC5C4 80115EC4 AC400000 */ sw $zero, 0x0($v0)
/* AC5C8 80115EC8 2484FFFF */ addiu $a0, $a0, -0x1
/* AC5CC 80115ECC 0481FFFD */ bgez $a0, .L80115EC4
/* AC5D0 80115ED0 2442FFFC */ addiu $v0, $v0, -0x4
/* AC5D4 80115ED4 0000202D */ daddu $a0, $zero, $zero
/* AC5D8 80115ED8 3C058015 */ lui $a1, %hi(gCurrentCustomModelGfxBuildersPtr)
/* AC5DC 80115EDC 8CA512B8 */ lw $a1, %lo(gCurrentCustomModelGfxBuildersPtr)($a1)
/* AC5E0 80115EE0 3C038015 */ lui $v1, %hi(gCurrentCustomModelGfxPtr)
/* AC5E4 80115EE4 8C6312E8 */ lw $v1, %lo(gCurrentCustomModelGfxPtr)($v1)
.L80115EE8:
/* AC5E8 80115EE8 AC600000 */ sw $zero, 0x0($v1)
/* AC5EC 80115EEC ACA00000 */ sw $zero, 0x0($a1)
/* AC5F0 80115EF0 24A50004 */ addiu $a1, $a1, 0x4
/* AC5F4 80115EF4 24840001 */ addiu $a0, $a0, 0x1
/* AC5F8 80115EF8 28820020 */ slti $v0, $a0, 0x20
/* AC5FC 80115EFC 1440FFFA */ bnez $v0, .L80115EE8
/* AC600 80115F00 24630004 */ addiu $v1, $v1, 0x4
/* AC604 80115F04 0000202D */ daddu $a0, $zero, $zero
/* AC608 80115F08 3C05800A */ lui $a1, %hi(mdl_currentModelTreeNodeInfo)
/* AC60C 80115F0C 24A5A5F4 */ addiu $a1, $a1, %lo(mdl_currentModelTreeNodeInfo)
/* AC610 80115F10 3C028015 */ lui $v0, %hi(gCurrentModelTreeRoot)
/* AC614 80115F14 8C4212FC */ lw $v0, %lo(gCurrentModelTreeRoot)($v0)
/* AC618 80115F18 240600FF */ addiu $a2, $zero, 0xFF
/* AC61C 80115F1C AC400000 */ sw $zero, 0x0($v0)
.L80115F20:
/* AC620 80115F20 8CA20000 */ lw $v0, 0x0($a1)
/* AC624 80115F24 00041880 */ sll $v1, $a0, 2
/* AC628 80115F28 00621021 */ addu $v0, $v1, $v0
/* AC62C 80115F2C A0460000 */ sb $a2, 0x0($v0)
/* AC630 80115F30 8CA20000 */ lw $v0, 0x0($a1)
/* AC634 80115F34 00621021 */ addu $v0, $v1, $v0
/* AC638 80115F38 A0400001 */ sb $zero, 0x1($v0)
/* AC63C 80115F3C 8CA20000 */ lw $v0, 0x0($a1)
/* AC640 80115F40 24840001 */ addiu $a0, $a0, 0x1
/* AC644 80115F44 00621821 */ addu $v1, $v1, $v0
/* AC648 80115F48 28820200 */ slti $v0, $a0, 0x200
/* AC64C 80115F4C 1440FFF4 */ bnez $v0, .L80115F20
/* AC650 80115F50 A0600002 */ sb $zero, 0x2($v1)
/* AC654 80115F54 0000202D */ daddu $a0, $zero, $zero
/* AC658 80115F58 3C088015 */ lui $t0, %hi(texPannerMainU)
/* AC65C 80115F5C 25083268 */ addiu $t0, $t0, %lo(texPannerMainU)
/* AC660 80115F60 3C078015 */ lui $a3, %hi(texPannerMainV)
/* AC664 80115F64 24E732A8 */ addiu $a3, $a3, %lo(texPannerMainV)
/* AC668 80115F68 3C068015 */ lui $a2, %hi(texPannerAuxU)
/* AC66C 80115F6C 24C632E8 */ addiu $a2, $a2, %lo(texPannerAuxU)
/* AC670 80115F70 3C028015 */ lui $v0, %hi(gBackgroundFogModePtr)
/* AC674 80115F74 8C4212F0 */ lw $v0, %lo(gBackgroundFogModePtr)($v0)
/* AC678 80115F78 3C058015 */ lui $a1, %hi(texPannerAuxV)
/* AC67C 80115F7C 24A53328 */ addiu $a1, $a1, %lo(texPannerAuxV)
/* AC680 80115F80 A0400000 */ sb $zero, 0x0($v0)
/* AC684 80115F84 3C038015 */ lui $v1, %hi(gCurrentFogSettings)
/* AC688 80115F88 8C633264 */ lw $v1, %lo(gCurrentFogSettings)($v1)
/* AC68C 80115F8C 2402000A */ addiu $v0, $zero, 0xA
/* AC690 80115F90 AC620004 */ sw $v0, 0x4($v1)
/* AC694 80115F94 AC620008 */ sw $v0, 0x8($v1)
/* AC698 80115F98 AC62000C */ sw $v0, 0xC($v1)
/* AC69C 80115F9C 240203B6 */ addiu $v0, $zero, 0x3B6
/* AC6A0 80115FA0 AC620014 */ sw $v0, 0x14($v1)
/* AC6A4 80115FA4 240203E8 */ addiu $v0, $zero, 0x3E8
/* AC6A8 80115FA8 AC600000 */ sw $zero, 0x0($v1)
/* AC6AC 80115FAC AC600010 */ sw $zero, 0x10($v1)
/* AC6B0 80115FB0 AC620018 */ sw $v0, 0x18($v1)
.L80115FB4:
/* AC6B4 80115FB4 ACA00000 */ sw $zero, 0x0($a1)
/* AC6B8 80115FB8 ACC00000 */ sw $zero, 0x0($a2)
/* AC6BC 80115FBC ACE00000 */ sw $zero, 0x0($a3)
/* AC6C0 80115FC0 AD000000 */ sw $zero, 0x0($t0)
/* AC6C4 80115FC4 25080004 */ addiu $t0, $t0, 0x4
/* AC6C8 80115FC8 24E70004 */ addiu $a3, $a3, 0x4
/* AC6CC 80115FCC 24C60004 */ addiu $a2, $a2, 0x4
/* AC6D0 80115FD0 24840001 */ addiu $a0, $a0, 0x1
/* AC6D4 80115FD4 28820010 */ slti $v0, $a0, 0x10
/* AC6D8 80115FD8 1440FFF6 */ bnez $v0, .L80115FB4
/* AC6DC 80115FDC 24A50004 */ addiu $a1, $a1, 0x4
/* AC6E0 80115FE0 03E00008 */ jr $ra
/* AC6E4 80115FE4 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void clear_model_data(void) {
s32 i;
if (!gGameStatusPtr->isBattle) {
gCurrentModels = &wModelList;
gCurrentTransformGroups = &wTransformGroups;
gCurrentCustomModelGfxPtr = &wModelSpecialDls;
gCurrentCustomModelGfxBuildersPtr = &wCustomModelGfxBuilders;
gCurrentModelTreeRoot = &D_80152214;
gCurrentModelLocalVtxBuffers = &wModelLocalVtxBuffers;
mdl_currentModelTreeNodeInfo = &D_80152220;
gBackgroundFogModePtr = &wBackgroundFogMode;
mdl_bgMultiplyColorA = 0;
mdl_bgMultiplyColorR = 0;
mdl_bgMultiplyColorG = 0;
mdl_bgMultiplyColorB = 0;
gCurrentFogSettings = &wFogSettings;
} else {
gCurrentModels = &bModelList;
gCurrentTransformGroups = &bTransformGroups;
gCurrentCustomModelGfxPtr = &bModelSpecialDls;
gCurrentCustomModelGfxBuildersPtr = &bCustomModelGfxBuilders;
gCurrentModelTreeRoot = &D_80152218;
gCurrentModelLocalVtxBuffers = &bModelLocalVtxBuffers;
mdl_currentModelTreeNodeInfo = &D_80152A20;
gBackgroundFogModePtr = &bBackgroundFogMode;
gCurrentFogSettings = &bFogSettings;
}
for (i = 0; i < ARRAY_COUNT(*gCurrentModels); i++) {
(*gCurrentModels)[i] = 0;
}
for (i = 0; i < ARRAY_COUNT(*gCurrentTransformGroups); i++) {
(*gCurrentTransformGroups)[i] = 0;
}
for (i = 0; i < ARRAY_COUNT(*gCurrentCustomModelGfxPtr); i++) {
(*gCurrentCustomModelGfxPtr)[i] = 0;
(*gCurrentCustomModelGfxBuildersPtr)[i] = 0;
}
*gCurrentModelTreeRoot = NULL;
for (i = 0; i < ARRAY_COUNT(*mdl_currentModelTreeNodeInfo); i++) {
(*mdl_currentModelTreeNodeInfo)[i].modelIndex = -1;
(*mdl_currentModelTreeNodeInfo)[i].treeDepth = 0;
(*mdl_currentModelTreeNodeInfo)[i].textureID = 0;
}
*gBackgroundFogModePtr = FOG_MODE_0;
gCurrentFogSettings->color.r = 10;
gCurrentFogSettings->color.g = 10;
gCurrentFogSettings->color.b = 10;
gCurrentFogSettings->startDistance = 950;
gCurrentFogSettings->enabled = FALSE;
gCurrentFogSettings->color.a = 0;
gCurrentFogSettings->endDistance = 1000;
for (i = 0; i < ARRAY_COUNT(texPannerAuxV); i++) {
texPannerAuxV[i] = 0;
texPannerAuxU[i] = 0;
texPannerMainV[i] = 0;
texPannerMainU[i] = 0;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_E005E334
/* 3628F4 E005E334 27BDFEF0 */ addiu $sp, $sp, -0x110
/* 3628F8 E005E338 AFBF0104 */ sw $ra, 0x104($sp)
/* 3628FC E005E33C AFBE0100 */ sw $fp, 0x100($sp)
/* 362900 E005E340 AFB700FC */ sw $s7, 0xFC($sp)
/* 362904 E005E344 AFB600F8 */ sw $s6, 0xF8($sp)
/* 362908 E005E348 AFB500F4 */ sw $s5, 0xF4($sp)
/* 36290C E005E34C AFB400F0 */ sw $s4, 0xF0($sp)
/* 362910 E005E350 AFB300EC */ sw $s3, 0xEC($sp)
/* 362914 E005E354 AFB200E8 */ sw $s2, 0xE8($sp)
/* 362918 E005E358 AFB100E4 */ sw $s1, 0xE4($sp)
/* 36291C E005E35C AFB000E0 */ sw $s0, 0xE0($sp)
/* 362920 E005E360 F7B40108 */ sdc1 $f20, 0x108($sp)
/* 362924 E005E364 AFA40110 */ sw $a0, 0x110($sp)
/* 362928 E005E368 8C92000C */ lw $s2, 0xC($a0)
/* 36292C E005E36C 8E420028 */ lw $v0, 0x28($s2)
/* 362930 E005E370 104000B2 */ beqz $v0, .LE005E63C
/* 362934 E005E374 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 362938 E005E378 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 36293C E005E37C 27A40018 */ addiu $a0, $sp, 0x18
/* 362940 E005E380 3C110001 */ lui $s1, (0x11630 >> 16)
/* 362944 E005E384 3C16800A */ lui $s6, %hi(gMainGfxPos)
/* 362948 E005E388 26D6A66C */ addiu $s6, $s6, %lo(gMainGfxPos)
/* 36294C E005E38C 8EC30000 */ lw $v1, 0x0($s6)
/* 362950 E005E390 36311630 */ ori $s1, $s1, (0x11630 & 0xFFFF)
/* 362954 E005E394 0060282D */ daddu $a1, $v1, $zero
/* 362958 E005E398 24630008 */ addiu $v1, $v1, 0x8
/* 36295C E005E39C AEC30000 */ sw $v1, 0x0($s6)
/* 362960 E005E3A0 3C08E006 */ lui $t0, (0xE0060000 >> 16)
/* 362964 E005E3A4 8D08E670 */ lw $t0, -0x1990($t0)
/* 362968 E005E3A8 3C06E006 */ lui $a2, (0xE0060000 >> 16)
/* 36296C E005E3AC 8CC6E674 */ lw $a2, -0x198C($a2)
/* 362970 E005E3B0 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 362974 E005E3B4 AFA800D8 */ sw $t0, 0xD8($sp)
/* 362978 E005E3B8 ACA20000 */ sw $v0, 0x0($a1)
/* 36297C E005E3BC 24620008 */ addiu $v0, $v1, 0x8
/* 362980 E005E3C0 ACA00004 */ sw $zero, 0x4($a1)
/* 362984 E005E3C4 AEC20000 */ sw $v0, 0x0($s6)
/* 362988 E005E3C8 AC670000 */ sw $a3, 0x0($v1)
/* 36298C E005E3CC 8FA80110 */ lw $t0, 0x110($sp)
/* 362990 E005E3D0 8D050010 */ lw $a1, 0x10($t0)
/* 362994 E005E3D4 24620010 */ addiu $v0, $v1, 0x10
/* 362998 E005E3D8 AEC20000 */ sw $v0, 0x0($s6)
/* 36299C E005E3DC 8CA5001C */ lw $a1, 0x1C($a1)
/* 3629A0 E005E3E0 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3629A4 E005E3E4 AC620008 */ sw $v0, 0x8($v1)
/* 3629A8 E005E3E8 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 3629AC E005E3EC AC66000C */ sw $a2, 0xC($v1)
/* 3629B0 E005E3F0 00A22821 */ addu $a1, $a1, $v0
/* 3629B4 E005E3F4 AC650004 */ sw $a1, 0x4($v1)
/* 3629B8 E005E3F8 8E450004 */ lw $a1, 0x4($s2)
/* 3629BC E005E3FC 8E460008 */ lw $a2, 0x8($s2)
/* 3629C0 E005E400 8E47000C */ lw $a3, 0xC($s2)
/* 3629C4 E005E404 4480A000 */ mtc1 $zero, $f20
/* 3629C8 E005E408 0C080108 */ jal shim_guTranslateF
/* 3629CC E005E40C 24140001 */ addiu $s4, $zero, 0x1
/* 3629D0 E005E410 27B30058 */ addiu $s3, $sp, 0x58
/* 3629D4 E005E414 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 3629D8 E005E418 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 3629DC E005E41C 4406A000 */ mfc1 $a2, $f20
/* 3629E0 E005E420 00031080 */ sll $v0, $v1, 2
/* 3629E4 E005E424 00431021 */ addu $v0, $v0, $v1
/* 3629E8 E005E428 00021080 */ sll $v0, $v0, 2
/* 3629EC E005E42C 00431023 */ subu $v0, $v0, $v1
/* 3629F0 E005E430 000218C0 */ sll $v1, $v0, 3
/* 3629F4 E005E434 00431021 */ addu $v0, $v0, $v1
/* 3629F8 E005E438 000210C0 */ sll $v0, $v0, 3
/* 3629FC E005E43C 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 362A00 E005E440 00220821 */ addu $at, $at, $v0
/* 362A04 E005E444 C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 362A08 E005E448 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 362A0C E005E44C 46000007 */ neg.s $f0, $f0
/* 362A10 E005E450 44050000 */ mfc1 $a1, $f0
/* 362A14 E005E454 0260202D */ daddu $a0, $s3, $zero
/* 362A18 E005E458 0C080104 */ jal shim_guRotateF
/* 362A1C E005E45C E7B40010 */ swc1 $f20, 0x10($sp)
/* 362A20 E005E460 0260202D */ daddu $a0, $s3, $zero
/* 362A24 E005E464 27A50018 */ addiu $a1, $sp, 0x18
/* 362A28 E005E468 27B00098 */ addiu $s0, $sp, 0x98
/* 362A2C E005E46C 0C080114 */ jal shim_guMtxCatF
/* 362A30 E005E470 0200302D */ daddu $a2, $s0, $zero
/* 362A34 E005E474 0200202D */ daddu $a0, $s0, $zero
/* 362A38 E005E478 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 362A3C E005E47C 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 362A40 E005E480 3C17800A */ lui $s7, %hi(gDisplayContext)
/* 362A44 E005E484 26F7A674 */ addiu $s7, $s7, %lo(gDisplayContext)
/* 362A48 E005E488 96050000 */ lhu $a1, 0x0($s0)
/* 362A4C E005E48C 8EE20000 */ lw $v0, 0x0($s7)
/* 362A50 E005E490 00052980 */ sll $a1, $a1, 6
/* 362A54 E005E494 00B12821 */ addu $a1, $a1, $s1
/* 362A58 E005E498 0C080118 */ jal shim_guMtxF2L
/* 362A5C E005E49C 00452821 */ addu $a1, $v0, $a1
/* 362A60 E005E4A0 3C06DCDC */ lui $a2, (0xDCDC28FF >> 16)
/* 362A64 E005E4A4 8EC40000 */ lw $a0, 0x0($s6)
/* 362A68 E005E4A8 34C628FF */ ori $a2, $a2, (0xDCDC28FF & 0xFFFF)
/* 362A6C E005E4AC 0080282D */ daddu $a1, $a0, $zero
/* 362A70 E005E4B0 24840008 */ addiu $a0, $a0, 0x8
/* 362A74 E005E4B4 AEC40000 */ sw $a0, 0x0($s6)
/* 362A78 E005E4B8 96020000 */ lhu $v0, 0x0($s0)
/* 362A7C E005E4BC 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 362A80 E005E4C0 ACA30000 */ sw $v1, 0x0($a1)
/* 362A84 E005E4C4 00541821 */ addu $v1, $v0, $s4
/* 362A88 E005E4C8 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 362A8C E005E4CC 00021180 */ sll $v0, $v0, 6
/* 362A90 E005E4D0 A6030000 */ sh $v1, 0x0($s0)
/* 362A94 E005E4D4 8EE30000 */ lw $v1, 0x0($s7)
/* 362A98 E005E4D8 00511021 */ addu $v0, $v0, $s1
/* 362A9C E005E4DC 00621821 */ addu $v1, $v1, $v0
/* 362AA0 E005E4E0 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 362AA4 E005E4E4 ACA30004 */ sw $v1, 0x4($a1)
/* 362AA8 E005E4E8 AC820000 */ sw $v0, 0x0($a0)
/* 362AAC E005E4EC AC860004 */ sw $a2, 0x4($a0)
/* 362AB0 E005E4F0 8FA80110 */ lw $t0, 0x110($sp)
/* 362AB4 E005E4F4 2652002C */ addiu $s2, $s2, 0x2C
/* 362AB8 E005E4F8 8D020008 */ lw $v0, 0x8($t0)
/* 362ABC E005E4FC 24840008 */ addiu $a0, $a0, 0x8
/* 362AC0 E005E500 0282102A */ slt $v0, $s4, $v0
/* 362AC4 E005E504 10400042 */ beqz $v0, .LE005E610
/* 362AC8 E005E508 AEC40000 */ sw $a0, 0x0($s6)
/* 362ACC E005E50C 0260A82D */ daddu $s5, $s3, $zero
/* 362AD0 E005E510 02E0F02D */ daddu $fp, $s7, $zero
/* 362AD4 E005E514 0200B82D */ daddu $s7, $s0, $zero
/* 362AD8 E005E518 3C130001 */ lui $s3, (0x11630 >> 16)
/* 362ADC E005E51C 36731630 */ ori $s3, $s3, (0x11630 & 0xFFFF)
/* 362AE0 E005E520 02C0882D */ daddu $s1, $s6, $zero
/* 362AE4 E005E524 26500018 */ addiu $s0, $s2, 0x18
.LE005E528:
/* 362AE8 E005E528 8E05FFEC */ lw $a1, -0x14($s0)
/* 362AEC E005E52C 8E06FFF0 */ lw $a2, -0x10($s0)
/* 362AF0 E005E530 8E07FFF4 */ lw $a3, -0xC($s0)
/* 362AF4 E005E534 0C080108 */ jal shim_guTranslateF
/* 362AF8 E005E538 27A40018 */ addiu $a0, $sp, 0x18
/* 362AFC E005E53C 4406A000 */ mfc1 $a2, $f20
/* 362B00 E005E540 4407A000 */ mfc1 $a3, $f20
/* 362B04 E005E544 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 362B08 E005E548 44810000 */ mtc1 $at, $f0
/* 362B0C E005E54C 26940001 */ addiu $s4, $s4, 0x1
/* 362B10 E005E550 E7A00010 */ swc1 $f0, 0x10($sp)
/* 362B14 E005E554 8E050000 */ lw $a1, 0x0($s0)
/* 362B18 E005E558 0C080104 */ jal shim_guRotateF
/* 362B1C E005E55C 02A0202D */ daddu $a0, $s5, $zero
/* 362B20 E005E560 02A0202D */ daddu $a0, $s5, $zero
/* 362B24 E005E564 27A50018 */ addiu $a1, $sp, 0x18
/* 362B28 E005E568 0C080114 */ jal shim_guMtxCatF
/* 362B2C E005E56C 00A0302D */ daddu $a2, $a1, $zero
/* 362B30 E005E570 27A40018 */ addiu $a0, $sp, 0x18
/* 362B34 E005E574 96E50000 */ lhu $a1, 0x0($s7)
/* 362B38 E005E578 8FC20000 */ lw $v0, 0x0($fp)
/* 362B3C E005E57C 00052980 */ sll $a1, $a1, 6
/* 362B40 E005E580 00B32821 */ addu $a1, $a1, $s3
/* 362B44 E005E584 0C080118 */ jal shim_guMtxF2L
/* 362B48 E005E588 00452821 */ addu $a1, $v0, $a1
/* 362B4C E005E58C 3C06D838 */ lui $a2, (0xD8380002 >> 16)
/* 362B50 E005E590 8E240000 */ lw $a0, 0x0($s1)
/* 362B54 E005E594 34C60002 */ ori $a2, $a2, (0xD8380002 & 0xFFFF)
/* 362B58 E005E598 0080282D */ daddu $a1, $a0, $zero
/* 362B5C E005E59C 24840008 */ addiu $a0, $a0, 0x8
/* 362B60 E005E5A0 AE240000 */ sw $a0, 0x0($s1)
/* 362B64 E005E5A4 96E20000 */ lhu $v0, 0x0($s7)
/* 362B68 E005E5A8 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 362B6C E005E5AC ACA30000 */ sw $v1, 0x0($a1)
/* 362B70 E005E5B0 24430001 */ addiu $v1, $v0, 0x1
/* 362B74 E005E5B4 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 362B78 E005E5B8 00021180 */ sll $v0, $v0, 6
/* 362B7C E005E5BC A6E30000 */ sh $v1, 0x0($s7)
/* 362B80 E005E5C0 8FC30000 */ lw $v1, 0x0($fp)
/* 362B84 E005E5C4 00531021 */ addu $v0, $v0, $s3
/* 362B88 E005E5C8 00621821 */ addu $v1, $v1, $v0
/* 362B8C E005E5CC 24820008 */ addiu $v0, $a0, 0x8
/* 362B90 E005E5D0 ACA30004 */ sw $v1, 0x4($a1)
/* 362B94 E005E5D4 AE220000 */ sw $v0, 0x0($s1)
/* 362B98 E005E5D8 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 362B9C E005E5DC AC820000 */ sw $v0, 0x0($a0)
/* 362BA0 E005E5E0 8FA800D8 */ lw $t0, 0xD8($sp)
/* 362BA4 E005E5E4 24020040 */ addiu $v0, $zero, 0x40
/* 362BA8 E005E5E8 AC860008 */ sw $a2, 0x8($a0)
/* 362BAC E005E5EC AC82000C */ sw $v0, 0xC($a0)
/* 362BB0 E005E5F0 AC880004 */ sw $t0, 0x4($a0)
/* 362BB4 E005E5F4 8FA80110 */ lw $t0, 0x110($sp)
/* 362BB8 E005E5F8 2610002C */ addiu $s0, $s0, 0x2C
/* 362BBC E005E5FC 8D020008 */ lw $v0, 0x8($t0)
/* 362BC0 E005E600 24840010 */ addiu $a0, $a0, 0x10
/* 362BC4 E005E604 0282102A */ slt $v0, $s4, $v0
/* 362BC8 E005E608 1440FFC7 */ bnez $v0, .LE005E528
/* 362BCC E005E60C AE240000 */ sw $a0, 0x0($s1)
.LE005E610:
/* 362BD0 E005E610 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* 362BD4 E005E614 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 362BD8 E005E618 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 362BDC E005E61C 8C620000 */ lw $v0, 0x0($v1)
/* 362BE0 E005E620 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* 362BE4 E005E624 0040202D */ daddu $a0, $v0, $zero
/* 362BE8 E005E628 24420008 */ addiu $v0, $v0, 0x8
/* 362BEC E005E62C AC620000 */ sw $v0, 0x0($v1)
/* 362BF0 E005E630 24020040 */ addiu $v0, $zero, 0x40
/* 362BF4 E005E634 AC850000 */ sw $a1, 0x0($a0)
/* 362BF8 E005E638 AC820004 */ sw $v0, 0x4($a0)
.LE005E63C:
/* 362BFC E005E63C 8FBF0104 */ lw $ra, 0x104($sp)
/* 362C00 E005E640 8FBE0100 */ lw $fp, 0x100($sp)
/* 362C04 E005E644 8FB700FC */ lw $s7, 0xFC($sp)
/* 362C08 E005E648 8FB600F8 */ lw $s6, 0xF8($sp)
/* 362C0C E005E64C 8FB500F4 */ lw $s5, 0xF4($sp)
/* 362C10 E005E650 8FB400F0 */ lw $s4, 0xF0($sp)
/* 362C14 E005E654 8FB300EC */ lw $s3, 0xEC($sp)
/* 362C18 E005E658 8FB200E8 */ lw $s2, 0xE8($sp)
/* 362C1C E005E65C 8FB100E4 */ lw $s1, 0xE4($sp)
/* 362C20 E005E660 8FB000E0 */ lw $s0, 0xE0($sp)
/* 362C24 E005E664 D7B40108 */ ldc1 $f20, 0x108($sp)
/* 362C28 E005E668 03E00008 */ jr $ra
/* 362C2C E005E66C 27BD0110 */ addiu $sp, $sp, 0x110
### DECOMPILED C INSTRUCTIONS:
void func_E005E334(EffectInstance* effect) {
StarsOrbitingFXData* part = effect->data.starsOrbiting;
Matrix4f sp18;
Matrix4f sp58;
Matrix4f sp98;
s32 i;
if (part->enabled) {
Gfx* dlist = D_E005E670[0];
Gfx* dlist2 = D_E005E674[0];
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist2);
shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98);
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 220, 220, 40, 255);
part++;
for (i = 1; i < effect->numParts; i++, part++) {
shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z);
shim_guRotateF(sp58, part->roll, 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_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, dlist);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_item_entities
/* C85EC 80131EEC 3C02800A */ lui $v0, %hi(gOverrideFlags)
/* C85F0 80131EF0 8C42A650 */ lw $v0, %lo(gOverrideFlags)($v0)
/* C85F4 80131EF4 27BDFFC0 */ addiu $sp, $sp, -0x40
/* C85F8 80131EF8 AFBF0038 */ sw $ra, 0x38($sp)
/* C85FC 80131EFC AFB30034 */ sw $s3, 0x34($sp)
/* C8600 80131F00 AFB20030 */ sw $s2, 0x30($sp)
/* C8604 80131F04 AFB1002C */ sw $s1, 0x2C($sp)
/* C8608 80131F08 30420C00 */ andi $v0, $v0, 0xC00
/* C860C 80131F0C 1440009E */ bnez $v0, .L80132188
/* C8610 80131F10 AFB00028 */ sw $s0, 0x28($sp)
/* C8614 80131F14 0000982D */ daddu $s3, $zero, $zero
/* C8618 80131F18 0260902D */ daddu $s2, $s3, $zero
.L80131F1C:
/* C861C 80131F1C 3C028015 */ lui $v0, %hi(gCurrentItemEntities)
/* C8620 80131F20 8C4265A0 */ lw $v0, %lo(gCurrentItemEntities)($v0)
/* C8624 80131F24 02421021 */ addu $v0, $s2, $v0
/* C8628 80131F28 8C510000 */ lw $s1, 0x0($v0)
/* C862C 80131F2C 52200093 */ beql $s1, $zero, .L8013217C
/* C8630 80131F30 26730001 */ addiu $s3, $s3, 0x1
/* C8634 80131F34 8E220000 */ lw $v0, 0x0($s1)
/* C8638 80131F38 1040008F */ beqz $v0, .L80132178
/* C863C 80131F3C 24020157 */ addiu $v0, $zero, 0x157
/* C8640 80131F40 86230018 */ lh $v1, 0x18($s1)
/* C8644 80131F44 14620019 */ bne $v1, $v0, .L80131FAC
/* C8648 80131F48 00000000 */ nop
/* C864C 80131F4C 0C00A67F */ jal rand_int
/* C8650 80131F50 24040064 */ addiu $a0, $zero, 0x64
/* C8654 80131F54 2842005B */ slti $v0, $v0, 0x5B
/* C8658 80131F58 14400012 */ bnez $v0, .L80131FA4
/* C865C 80131F5C 00000000 */ nop
/* C8660 80131F60 3C058010 */ lui $a1, %hi(SparkleScript_Coin)
/* C8664 80131F64 24A54AC0 */ addiu $a1, $a1, %lo(SparkleScript_Coin)
/* C8668 80131F68 0C04C27C */ jal sparkle_script_init
/* C866C 80131F6C 0220202D */ daddu $a0, $s1, $zero
/* C8670 80131F70 0C00A67F */ jal rand_int
/* C8674 80131F74 24040010 */ addiu $a0, $zero, 0x10
/* C8678 80131F78 2442FFF8 */ addiu $v0, $v0, -0x8
/* C867C 80131F7C 3C018015 */ lui $at, %hi(D_80155D8C)
/* C8680 80131F80 A4225D8C */ sh $v0, %lo(D_80155D8C)($at)
/* C8684 80131F84 0C00A67F */ jal rand_int
/* C8688 80131F88 24040010 */ addiu $a0, $zero, 0x10
/* C868C 80131F8C 2442FFF8 */ addiu $v0, $v0, -0x8
/* C8690 80131F90 3C018015 */ lui $at, %hi(D_80155D8E)
/* C8694 80131F94 A4225D8E */ sh $v0, %lo(D_80155D8E)($at)
/* C8698 80131F98 24020005 */ addiu $v0, $zero, 0x5
/* C869C 80131F9C 3C018015 */ lui $at, %hi(D_80155D90)
/* C86A0 80131FA0 A4225D90 */ sh $v0, %lo(D_80155D90)($at)
.L80131FA4:
/* C86A4 80131FA4 0C04C2B3 */ jal sparkle_script_update
/* C86A8 80131FA8 0220202D */ daddu $a0, $s1, $zero
.L80131FAC:
/* C86AC 80131FAC 0C04C775 */ jal item_entity_update
/* C86B0 80131FB0 0220202D */ daddu $a0, $s1, $zero
/* C86B4 80131FB4 8223001B */ lb $v1, 0x1B($s1)
/* C86B8 80131FB8 2C62001D */ sltiu $v0, $v1, 0x1D
/* C86BC 80131FBC 10400014 */ beqz $v0, .L80132010
/* C86C0 80131FC0 00031080 */ sll $v0, $v1, 2
/* C86C4 80131FC4 3C018015 */ lui $at, %hi(jtbl_80150BD8)
/* C86C8 80131FC8 00220821 */ addu $at, $at, $v0
/* C86CC 80131FCC 8C220BD8 */ lw $v0, %lo(jtbl_80150BD8)($at)
/* C86D0 80131FD0 00400008 */ jr $v0
/* C86D4 80131FD4 00000000 */ nop
glabel .L80131FD8
/* C86D8 80131FD8 0C04D596 */ jal update_item_entity_stationary
/* C86DC 80131FDC 0220202D */ daddu $a0, $s1, $zero
/* C86E0 80131FE0 0804C804 */ j .L80132010
/* C86E4 80131FE4 00000000 */ nop
glabel .L80131FE8
/* C86E8 80131FE8 0C04D5B3 */ jal update_item_entity_no_pickup
/* C86EC 80131FEC 0220202D */ daddu $a0, $s1, $zero
/* C86F0 80131FF0 0804C804 */ j .L80132010
/* C86F4 80131FF4 00000000 */ nop
glabel .L80131FF8
/* C86F8 80131FF8 0C04D094 */ jal update_item_entity_collectable
/* C86FC 80131FFC 0220202D */ daddu $a0, $s1, $zero
/* C8700 80132000 0804C804 */ j .L80132010
/* C8704 80132004 00000000 */ nop
glabel .L80132008
/* C8708 80132008 0C04D5B7 */ jal update_item_entity_pickup
/* C870C 8013200C 0220202D */ daddu $a0, $s1, $zero
glabel .L80132010
/* C8710 80132010 3C028015 */ lui $v0, %hi(gCurrentItemEntities)
/* C8714 80132014 8C4265A0 */ lw $v0, %lo(gCurrentItemEntities)($v0)
/* C8718 80132018 02421021 */ addu $v0, $s2, $v0
/* C871C 8013201C 8C510000 */ lw $s1, 0x0($v0)
/* C8720 80132020 52200056 */ beql $s1, $zero, .L8013217C
/* C8724 80132024 26730001 */ addiu $s3, $s3, 0x1
/* C8728 80132028 8223001B */ lb $v1, 0x1B($s1)
/* C872C 8013202C 2C62001D */ sltiu $v0, $v1, 0x1D
/* C8730 80132030 10400043 */ beqz $v0, .L80132140
/* C8734 80132034 00031080 */ sll $v0, $v1, 2
/* C8738 80132038 3C018015 */ lui $at, %hi(jtbl_80150C50)
/* C873C 8013203C 00220821 */ addu $at, $at, $v0
/* C8740 80132040 8C220C50 */ lw $v0, %lo(jtbl_80150C50)($at)
/* C8744 80132044 00400008 */ jr $v0
/* C8748 80132048 00000000 */ nop
glabel .L8013204C
/* C874C 8013204C C6200008 */ lwc1 $f0, 0x8($s1)
/* C8750 80132050 C622000C */ lwc1 $f2, 0xC($s1)
/* C8754 80132054 86220034 */ lh $v0, 0x34($s1)
/* C8758 80132058 4600020D */ trunc.w.s $f8, $f0
/* C875C 8013205C 44034000 */ mfc1 $v1, $f8
/* C8760 80132060 C6200010 */ lwc1 $f0, 0x10($s1)
/* C8764 80132064 4600120D */ trunc.w.s $f8, $f2
/* C8768 80132068 44054000 */ mfc1 $a1, $f8
/* C876C 8013206C 4600020D */ trunc.w.s $f8, $f0
/* C8770 80132070 44044000 */ mfc1 $a0, $f8
/* C8774 80132074 14620007 */ bne $v1, $v0, .L80132094
/* C8778 80132078 00000000 */ nop
/* C877C 8013207C 86220036 */ lh $v0, 0x36($s1)
/* C8780 80132080 14A20004 */ bne $a1, $v0, .L80132094
/* C8784 80132084 00000000 */ nop
/* C8788 80132088 86220038 */ lh $v0, 0x38($s1)
/* C878C 8013208C 1082002C */ beq $a0, $v0, .L80132140
/* C8790 80132090 00000000 */ nop
.L80132094:
/* C8794 80132094 0C044181 */ jal get_shadow_by_index
/* C8798 80132098 86240020 */ lh $a0, 0x20($s1)
/* C879C 8013209C 3C040002 */ lui $a0, (0x20000 >> 16)
/* C87A0 801320A0 27A50018 */ addiu $a1, $sp, 0x18
/* C87A4 801320A4 27A30024 */ addiu $v1, $sp, 0x24
/* C87A8 801320A8 0040802D */ daddu $s0, $v0, $zero
/* C87AC 801320AC 27A6001C */ addiu $a2, $sp, 0x1C
/* C87B0 801320B0 C6200008 */ lwc1 $f0, 0x8($s1)
/* C87B4 801320B4 3C014140 */ lui $at, (0x41400000 >> 16)
/* C87B8 801320B8 44811000 */ mtc1 $at, $f2
/* C87BC 801320BC 3C01447A */ lui $at, (0x447A0000 >> 16)
/* C87C0 801320C0 44813000 */ mtc1 $at, $f6
/* C87C4 801320C4 27A70020 */ addiu $a3, $sp, 0x20
/* C87C8 801320C8 E7A00018 */ swc1 $f0, 0x18($sp)
/* C87CC 801320CC C620000C */ lwc1 $f0, 0xC($s1)
/* C87D0 801320D0 C6240010 */ lwc1 $f4, 0x10($s1)
/* C87D4 801320D4 46020000 */ add.s $f0, $f0, $f2
/* C87D8 801320D8 E7A60024 */ swc1 $f6, 0x24($sp)
/* C87DC 801320DC E7A40020 */ swc1 $f4, 0x20($sp)
/* C87E0 801320E0 E7A0001C */ swc1 $f0, 0x1C($sp)
/* C87E4 801320E4 0C0372DF */ jal npc_raycast_down_sides
/* C87E8 801320E8 AFA30010 */ sw $v1, 0x10($sp)
/* C87EC 801320EC C7A00018 */ lwc1 $f0, 0x18($sp)
/* C87F0 801320F0 C7A2001C */ lwc1 $f2, 0x1C($sp)
/* C87F4 801320F4 C7A40020 */ lwc1 $f4, 0x20($sp)
/* C87F8 801320F8 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C87FC 801320FC 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C8800 80132100 E6000010 */ swc1 $f0, 0x10($s0)
/* C8804 80132104 E6020014 */ swc1 $f2, 0x14($s0)
/* C8808 80132108 E6040018 */ swc1 $f4, 0x18($s0)
/* C880C 8013210C C7A20024 */ lwc1 $f2, 0x24($sp)
/* C8810 80132110 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* C8814 80132114 44810000 */ mtc1 $at, $f0
/* C8818 80132118 C444011C */ lwc1 $f4, 0x11C($v0)
/* C881C 8013211C 46001082 */ mul.s $f2, $f2, $f0
/* C8820 80132120 00000000 */ nop
/* C8824 80132124 AE00002C */ sw $zero, 0x2C($s0)
/* C8828 80132128 E6040028 */ swc1 $f4, 0x28($s0)
/* C882C 8013212C C4400124 */ lwc1 $f0, 0x124($v0)
/* C8830 80132130 44051000 */ mfc1 $a1, $f2
/* C8834 80132134 0200202D */ daddu $a0, $s0, $zero
/* C8838 80132138 0C044A17 */ jal set_standard_shadow_scale
/* C883C 8013213C E4800030 */ swc1 $f0, 0x30($a0)
glabel .L80132140
/* C8840 80132140 C6200008 */ lwc1 $f0, 0x8($s1)
/* C8844 80132144 C6220010 */ lwc1 $f2, 0x10($s1)
/* C8848 80132148 4600020D */ trunc.w.s $f8, $f0
/* C884C 8013214C 44024000 */ mfc1 $v0, $f8
/* C8850 80132150 C620000C */ lwc1 $f0, 0xC($s1)
/* C8854 80132154 A6220034 */ sh $v0, 0x34($s1)
/* C8858 80132158 4600020D */ trunc.w.s $f8, $f0
/* C885C 8013215C 44024000 */ mfc1 $v0, $f8
/* C8860 80132160 00000000 */ nop
/* C8864 80132164 A6220036 */ sh $v0, 0x36($s1)
/* C8868 80132168 4600120D */ trunc.w.s $f8, $f2
/* C886C 8013216C 44024000 */ mfc1 $v0, $f8
/* C8870 80132170 00000000 */ nop
/* C8874 80132174 A6220038 */ sh $v0, 0x38($s1)
.L80132178:
/* C8878 80132178 26730001 */ addiu $s3, $s3, 0x1
.L8013217C:
/* C887C 8013217C 2A620100 */ slti $v0, $s3, 0x100
/* C8880 80132180 1440FF66 */ bnez $v0, .L80131F1C
/* C8884 80132184 26520004 */ addiu $s2, $s2, 0x4
.L80132188:
/* C8888 80132188 8FBF0038 */ lw $ra, 0x38($sp)
/* C888C 8013218C 8FB30034 */ lw $s3, 0x34($sp)
/* C8890 80132190 8FB20030 */ lw $s2, 0x30($sp)
/* C8894 80132194 8FB1002C */ lw $s1, 0x2C($sp)
/* C8898 80132198 8FB00028 */ lw $s0, 0x28($sp)
/* C889C 8013219C 03E00008 */ jr $ra
/* C88A0 801321A0 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
void update_item_entities(void) {
ItemEntity* item;
f32 x, y, z, hitDepth;
s32 i;
if (!(gOverrideFlags & (GLOBAL_OVERRIDES_400 | GLOBAL_OVERRIDES_800))) {
for (i = 0; i < MAX_ITEM_ENTITIES; i++) {
item = gCurrentItemEntities[i];
if (item != NULL && item->flags != 0) {
if (item->itemID == ITEM_COIN) {
if (rand_int(100) > 90) {
sparkle_script_init(item, &SparkleScript_Coin);
D_80155D8C = rand_int(16) - 8;
D_80155D8E = rand_int(16) - 8;
D_80155D90 = 5;
}
sparkle_script_update(item);
}
item_entity_update(item);
switch (item->spawnType) {
case ITEM_SPAWN_MODE_KEY:
update_item_entity_stationary(item);
break;
case ITEM_SPAWN_MODE_DECORATION:
case ITEM_SPAWN_MODE_INVISIBLE:
update_item_entity_no_pickup(item);
break;
case ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS:
case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS:
case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS:
case ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS:
case ITEM_SPAWN_MODE_TOSS_FADE1:
update_item_entity_collectable(item);
break;
case ITEM_SPAWN_AT_PLAYER:
update_item_entity_pickup(item);
break;
}
item = gCurrentItemEntities[i];
if (item != NULL) {
s32 xs, ys, zs;
switch (item->spawnType) {
case ITEM_SPAWN_MODE_KEY:
case ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS:
case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS:
case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS:
case ITEM_SPAWN_AT_PLAYER:
xs = item->position.x;
ys = item->position.y;
zs = item->position.z;
if (xs != item->lastPos.x || ys != item->lastPos.y || zs != item->lastPos.z) {
Shadow* shadow = get_shadow_by_index(item->shadowIndex);
x = item->position.x;
y = item->position.y + 12.0f;
z = item->position.z;
hitDepth = 1000.0f;
npc_raycast_down_sides(COLLISION_CHANNEL_20000, &x, &y, &z, &hitDepth);
shadow->position.x = x;
shadow->position.y = y;
shadow->position.z = z;
shadow->rotation.x = gGameStatusPtr->playerGroundTraceAngles.x;
shadow->rotation.y = 0.0f;
shadow->rotation.z = gGameStatusPtr->playerGroundTraceAngles.z;
set_standard_shadow_scale(shadow, hitDepth * 0.5f);
}
break;
}
item->lastPos.x = item->position.x;
item->lastPos.y = item->position.y;
item->lastPos.z = item->position.z;
}
}
do {} while (0); // required to match
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel sparkles_appendGfx
/* 337BD8 E0022998 27BDFF00 */ addiu $sp, $sp, -0x100
/* 337BDC E002299C 3C06DB06 */ lui $a2, (0xDB060024 >> 16)
/* 337BE0 E00229A0 34C60024 */ ori $a2, $a2, (0xDB060024 & 0xFFFF)
/* 337BE4 E00229A4 AFA40100 */ sw $a0, 0x100($sp)
/* 337BE8 E00229A8 27A40018 */ addiu $a0, $sp, 0x18
/* 337BEC E00229AC AFB300E4 */ sw $s3, 0xE4($sp)
/* 337BF0 E00229B0 3C13800A */ lui $s3, %hi(gMainGfxPos)
/* 337BF4 E00229B4 2673A66C */ addiu $s3, $s3, %lo(gMainGfxPos)
/* 337BF8 E00229B8 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 337BFC E00229BC AFBF00FC */ sw $ra, 0xFC($sp)
/* 337C00 E00229C0 AFBE00F8 */ sw $fp, 0xF8($sp)
/* 337C04 E00229C4 AFB700F4 */ sw $s7, 0xF4($sp)
/* 337C08 E00229C8 AFB600F0 */ sw $s6, 0xF0($sp)
/* 337C0C E00229CC AFB500EC */ sw $s5, 0xEC($sp)
/* 337C10 E00229D0 AFB400E8 */ sw $s4, 0xE8($sp)
/* 337C14 E00229D4 AFB200E0 */ sw $s2, 0xE0($sp)
/* 337C18 E00229D8 AFB100DC */ sw $s1, 0xDC($sp)
/* 337C1C E00229DC AFB000D8 */ sw $s0, 0xD8($sp)
/* 337C20 E00229E0 8E630000 */ lw $v1, 0x0($s3)
/* 337C24 E00229E4 8FAA0100 */ lw $t2, 0x100($sp)
/* 337C28 E00229E8 0060282D */ daddu $a1, $v1, $zero
/* 337C2C E00229EC 8D50000C */ lw $s0, 0xC($t2)
/* 337C30 E00229F0 24630008 */ addiu $v1, $v1, 0x8
/* 337C34 E00229F4 AE630000 */ sw $v1, 0x0($s3)
/* 337C38 E00229F8 ACA20000 */ sw $v0, 0x0($a1)
/* 337C3C E00229FC 24620008 */ addiu $v0, $v1, 0x8
/* 337C40 E0022A00 ACA00004 */ sw $zero, 0x4($a1)
/* 337C44 E0022A04 AE620000 */ sw $v0, 0x0($s3)
/* 337C48 E0022A08 AC660000 */ sw $a2, 0x0($v1)
/* 337C4C E0022A0C 8D450010 */ lw $a1, 0x10($t2)
/* 337C50 E0022A10 24620010 */ addiu $v0, $v1, 0x10
/* 337C54 E0022A14 AE620000 */ sw $v0, 0x0($s3)
/* 337C58 E0022A18 8CA5001C */ lw $a1, 0x1C($a1)
/* 337C5C E0022A1C 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 337C60 E0022A20 AC620008 */ sw $v0, 0x8($v1)
/* 337C64 E0022A24 3C020900 */ lui $v0, %hi(D_09000F20_327330)
/* 337C68 E0022A28 24420F20 */ addiu $v0, $v0, %lo(D_09000F20_327330)
/* 337C6C E0022A2C AC62000C */ sw $v0, 0xC($v1)
/* 337C70 E0022A30 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 337C74 E0022A34 00A22821 */ addu $a1, $a1, $v0
/* 337C78 E0022A38 AC650004 */ sw $a1, 0x4($v1)
/* 337C7C E0022A3C 8E050004 */ lw $a1, 0x4($s0)
/* 337C80 E0022A40 8E060008 */ lw $a2, 0x8($s0)
/* 337C84 E0022A44 8E020020 */ lw $v0, 0x20($s0)
/* 337C88 E0022A48 8E07000C */ lw $a3, 0xC($s0)
/* 337C8C E0022A4C 2442FFFF */ addiu $v0, $v0, -0x1
/* 337C90 E0022A50 00021840 */ sll $v1, $v0, 1
/* 337C94 E0022A54 0C080108 */ jal shim_guTranslateF
/* 337C98 E0022A58 00628821 */ addu $s1, $v1, $v0
/* 337C9C E0022A5C 27B20058 */ addiu $s2, $sp, 0x58
/* 337CA0 E0022A60 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 337CA4 E0022A64 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 337CA8 E0022A68 44800000 */ mtc1 $zero, $f0
/* 337CAC E0022A6C 00031080 */ sll $v0, $v1, 2
/* 337CB0 E0022A70 00431021 */ addu $v0, $v0, $v1
/* 337CB4 E0022A74 00021080 */ sll $v0, $v0, 2
/* 337CB8 E0022A78 00431023 */ subu $v0, $v0, $v1
/* 337CBC E0022A7C 000218C0 */ sll $v1, $v0, 3
/* 337CC0 E0022A80 00431021 */ addu $v0, $v0, $v1
/* 337CC4 E0022A84 000210C0 */ sll $v0, $v0, 3
/* 337CC8 E0022A88 44060000 */ mfc1 $a2, $f0
/* 337CCC E0022A8C 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 337CD0 E0022A90 00220821 */ addu $at, $at, $v0
/* 337CD4 E0022A94 C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 337CD8 E0022A98 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 337CDC E0022A9C 46000007 */ neg.s $f0, $f0
/* 337CE0 E0022AA0 44050000 */ mfc1 $a1, $f0
/* 337CE4 E0022AA4 0240202D */ daddu $a0, $s2, $zero
/* 337CE8 E0022AA8 0C080104 */ jal shim_guRotateF
/* 337CEC E0022AAC AFA60010 */ sw $a2, 0x10($sp)
/* 337CF0 E0022AB0 0240202D */ daddu $a0, $s2, $zero
/* 337CF4 E0022AB4 27A50018 */ addiu $a1, $sp, 0x18
/* 337CF8 E0022AB8 0C080114 */ jal shim_guMtxCatF
/* 337CFC E0022ABC 27A60098 */ addiu $a2, $sp, 0x98
/* 337D00 E0022AC0 8FAA0100 */ lw $t2, 0x100($sp)
/* 337D04 E0022AC4 0000A02D */ daddu $s4, $zero, $zero
/* 337D08 E0022AC8 8D420008 */ lw $v0, 0x8($t2)
/* 337D0C E0022ACC 2442FFFF */ addiu $v0, $v0, -0x1
/* 337D10 E0022AD0 18400069 */ blez $v0, .LE0022C78
/* 337D14 E0022AD4 26100030 */ addiu $s0, $s0, 0x30
/* 337D18 E0022AD8 0240B02D */ daddu $s6, $s2, $zero
/* 337D1C E0022ADC 3C1E8007 */ lui $fp, %hi(gMatrixListPos)
/* 337D20 E0022AE0 27DE41F0 */ addiu $fp, $fp, %lo(gMatrixListPos)
/* 337D24 E0022AE4 3C150001 */ lui $s5, (0x11630 >> 16)
/* 337D28 E0022AE8 36B51630 */ ori $s5, $s5, (0x11630 & 0xFFFF)
/* 337D2C E0022AEC 0260902D */ daddu $s2, $s3, $zero
/* 337D30 E0022AF0 3C17E002 */ lui $s7, %hi(D_E0022CF0)
/* 337D34 E0022AF4 26F72CF0 */ addiu $s7, $s7, %lo(D_E0022CF0)
/* 337D38 E0022AF8 2610001C */ addiu $s0, $s0, 0x1C
.LE0022AFC:
/* 337D3C E0022AFC 8E130010 */ lw $s3, 0x10($s0)
/* 337D40 E0022B00 06600056 */ bltz $s3, .LE0022C5C
/* 337D44 E0022B04 02C0202D */ daddu $a0, $s6, $zero
/* 337D48 E0022B08 8E05FFE8 */ lw $a1, -0x18($s0)
/* 337D4C E0022B0C 8E06FFEC */ lw $a2, -0x14($s0)
/* 337D50 E0022B10 8E07FFF0 */ lw $a3, -0x10($s0)
/* 337D54 E0022B14 0C080108 */ jal shim_guTranslateF
/* 337D58 E0022B18 26310003 */ addiu $s1, $s1, 0x3
/* 337D5C E0022B1C C6000000 */ lwc1 $f0, 0x0($s0)
/* 337D60 E0022B20 02C0202D */ daddu $a0, $s6, $zero
/* 337D64 E0022B24 E7A00058 */ swc1 $f0, 0x58($sp)
/* 337D68 E0022B28 C6000000 */ lwc1 $f0, 0x0($s0)
/* 337D6C E0022B2C 27A50098 */ addiu $a1, $sp, 0x98
/* 337D70 E0022B30 E7A0006C */ swc1 $f0, 0x6C($sp)
/* 337D74 E0022B34 C6000000 */ lwc1 $f0, 0x0($s0)
/* 337D78 E0022B38 27A60018 */ addiu $a2, $sp, 0x18
/* 337D7C E0022B3C 0C080114 */ jal shim_guMtxCatF
/* 337D80 E0022B40 E7A00080 */ swc1 $f0, 0x80($sp)
/* 337D84 E0022B44 27A40018 */ addiu $a0, $sp, 0x18
/* 337D88 E0022B48 97C50000 */ lhu $a1, 0x0($fp)
/* 337D8C E0022B4C 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 337D90 E0022B50 8C42A674 */ lw $v0, %lo(gDisplayContext)($v0)
/* 337D94 E0022B54 00052980 */ sll $a1, $a1, 6
/* 337D98 E0022B58 00B52821 */ addu $a1, $a1, $s5
/* 337D9C E0022B5C 0C080118 */ jal shim_guMtxF2L
/* 337DA0 E0022B60 00452821 */ addu $a1, $v0, $a1
/* 337DA4 E0022B64 3C0238E3 */ lui $v0, (0x38E38E39 >> 16)
/* 337DA8 E0022B68 34428E39 */ ori $v0, $v0, (0x38E38E39 & 0xFFFF)
/* 337DAC E0022B6C 3C09D838 */ lui $t1, (0xD8380002 >> 16)
/* 337DB0 E0022B70 35290002 */ ori $t1, $t1, (0xD8380002 & 0xFFFF)
/* 337DB4 E0022B74 02220018 */ mult $s1, $v0
/* 337DB8 E0022B78 8E470000 */ lw $a3, 0x0($s2)
/* 337DBC E0022B7C 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 337DC0 E0022B80 00E0402D */ daddu $t0, $a3, $zero
/* 337DC4 E0022B84 24E70008 */ addiu $a3, $a3, 0x8
/* 337DC8 E0022B88 AE470000 */ sw $a3, 0x0($s2)
/* 337DCC E0022B8C AD020000 */ sw $v0, 0x0($t0)
/* 337DD0 E0022B90 001117C3 */ sra $v0, $s1, 31
/* 337DD4 E0022B94 00005010 */ mfhi $t2
/* 337DD8 E0022B98 000A18C3 */ sra $v1, $t2, 3
/* 337DDC E0022B9C 00621823 */ subu $v1, $v1, $v0
/* 337DE0 E0022BA0 000310C0 */ sll $v0, $v1, 3
/* 337DE4 E0022BA4 00431021 */ addu $v0, $v0, $v1
/* 337DE8 E0022BA8 00021080 */ sll $v0, $v0, 2
/* 337DEC E0022BAC 02228823 */ subu $s1, $s1, $v0
/* 337DF0 E0022BB0 02371021 */ addu $v0, $s1, $s7
/* 337DF4 E0022BB4 0040202D */ daddu $a0, $v0, $zero
/* 337DF8 E0022BB8 0040282D */ daddu $a1, $v0, $zero
/* 337DFC E0022BBC 90430000 */ lbu $v1, 0x0($v0)
/* 337E00 E0022BC0 24E20008 */ addiu $v0, $a3, 0x8
/* 337E04 E0022BC4 90860001 */ lbu $a2, 0x1($a0)
/* 337E08 E0022BC8 90A50002 */ lbu $a1, 0x2($a1)
/* 337E0C E0022BCC 97C40000 */ lhu $a0, 0x0($fp)
/* 337E10 E0022BD0 3C0AE002 */ lui $t2, %hi(D_E0022CD0)
/* 337E14 E0022BD4 254A2CD0 */ addiu $t2, $t2, %lo(D_E0022CD0)
/* 337E18 E0022BD8 AE420000 */ sw $v0, 0x0($s2)
/* 337E1C E0022BDC 24820001 */ addiu $v0, $a0, 0x1
/* 337E20 E0022BE0 A7C20000 */ sh $v0, 0x0($fp)
/* 337E24 E0022BE4 24E20010 */ addiu $v0, $a3, 0x10
/* 337E28 E0022BE8 00031E00 */ sll $v1, $v1, 24
/* 337E2C E0022BEC 00063400 */ sll $a2, $a2, 16
/* 337E30 E0022BF0 00661825 */ or $v1, $v1, $a2
/* 337E34 E0022BF4 00052A00 */ sll $a1, $a1, 8
/* 337E38 E0022BF8 00651825 */ or $v1, $v1, $a1
/* 337E3C E0022BFC 346300FF */ ori $v1, $v1, 0xFF
/* 337E40 E0022C00 AE420000 */ sw $v0, 0x0($s2)
/* 337E44 E0022C04 3C02DA38 */ lui $v0, (0xDA380000 >> 16)
/* 337E48 E0022C08 3084FFFF */ andi $a0, $a0, 0xFFFF
/* 337E4C E0022C0C 00042180 */ sll $a0, $a0, 6
/* 337E50 E0022C10 AD030004 */ sw $v1, 0x4($t0)
/* 337E54 E0022C14 ACE20000 */ sw $v0, 0x0($a3)
/* 337E58 E0022C18 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 337E5C E0022C1C 8C42A674 */ lw $v0, %lo(gDisplayContext)($v0)
/* 337E60 E0022C20 00952021 */ addu $a0, $a0, $s5
/* 337E64 E0022C24 00441021 */ addu $v0, $v0, $a0
/* 337E68 E0022C28 ACE20004 */ sw $v0, 0x4($a3)
/* 337E6C E0022C2C 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 337E70 E0022C30 ACE20008 */ sw $v0, 0x8($a3)
/* 337E74 E0022C34 32620007 */ andi $v0, $s3, 0x7
/* 337E78 E0022C38 00021080 */ sll $v0, $v0, 2
/* 337E7C E0022C3C 004A1021 */ addu $v0, $v0, $t2
/* 337E80 E0022C40 8C430000 */ lw $v1, 0x0($v0)
/* 337E84 E0022C44 24E20018 */ addiu $v0, $a3, 0x18
/* 337E88 E0022C48 AE420000 */ sw $v0, 0x0($s2)
/* 337E8C E0022C4C 24020040 */ addiu $v0, $zero, 0x40
/* 337E90 E0022C50 ACE90010 */ sw $t1, 0x10($a3)
/* 337E94 E0022C54 ACE20014 */ sw $v0, 0x14($a3)
/* 337E98 E0022C58 ACE3000C */ sw $v1, 0xC($a3)
.LE0022C5C:
/* 337E9C E0022C5C 8FAA0100 */ lw $t2, 0x100($sp)
/* 337EA0 E0022C60 26940001 */ addiu $s4, $s4, 0x1
/* 337EA4 E0022C64 8D420008 */ lw $v0, 0x8($t2)
/* 337EA8 E0022C68 2442FFFF */ addiu $v0, $v0, -0x1
/* 337EAC E0022C6C 0282102A */ slt $v0, $s4, $v0
/* 337EB0 E0022C70 1440FFA2 */ bnez $v0, .LE0022AFC
/* 337EB4 E0022C74 26100030 */ addiu $s0, $s0, 0x30
.LE0022C78:
/* 337EB8 E0022C78 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 337EBC E0022C7C 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 337EC0 E0022C80 8C620000 */ lw $v0, 0x0($v1)
/* 337EC4 E0022C84 0040202D */ daddu $a0, $v0, $zero
/* 337EC8 E0022C88 24420008 */ addiu $v0, $v0, 0x8
/* 337ECC E0022C8C AC620000 */ sw $v0, 0x0($v1)
/* 337ED0 E0022C90 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 337ED4 E0022C94 AC820000 */ sw $v0, 0x0($a0)
/* 337ED8 E0022C98 AC800004 */ sw $zero, 0x4($a0)
/* 337EDC E0022C9C 8FBF00FC */ lw $ra, 0xFC($sp)
/* 337EE0 E0022CA0 8FBE00F8 */ lw $fp, 0xF8($sp)
/* 337EE4 E0022CA4 8FB700F4 */ lw $s7, 0xF4($sp)
/* 337EE8 E0022CA8 8FB600F0 */ lw $s6, 0xF0($sp)
/* 337EEC E0022CAC 8FB500EC */ lw $s5, 0xEC($sp)
/* 337EF0 E0022CB0 8FB400E8 */ lw $s4, 0xE8($sp)
/* 337EF4 E0022CB4 8FB300E4 */ lw $s3, 0xE4($sp)
/* 337EF8 E0022CB8 8FB200E0 */ lw $s2, 0xE0($sp)
/* 337EFC E0022CBC 8FB100DC */ lw $s1, 0xDC($sp)
/* 337F00 E0022CC0 8FB000D8 */ lw $s0, 0xD8($sp)
/* 337F04 E0022CC4 03E00008 */ jr $ra
/* 337F08 E0022CC8 27BD0100 */ addiu $sp, $sp, 0x100
/* 337F0C E0022CCC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void sparkles_appendGfx(void* effect) {
SparklesFXData* part = ((EffectInstance*)effect)->data.sparkles;
Matrix4f sp18;
Matrix4f sp58;
Matrix4f sp98;
s32 colorIdx;
s32 i;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09000F20_338EE0);
colorIdx = (part->unk_20 - 1) * 3;
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98);
part++;
for (i = 0; i < ((EffectInstance*)effect)->numParts - 1; i++, part++) {
s32 unk_2C = part->unk_2C;
if (unk_2C >= 0) {
shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C);
sp58[0][0] = part->unk_1C;
sp58[1][1] = part->unk_1C;
sp58[2][2] = part->unk_1C;
colorIdx += 3;
shim_guMtxCatF(sp58, sp98, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
colorIdx %= ARRAY_COUNT(D_E0022CF0);
gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0022CF0[colorIdx], D_E0022CF0[colorIdx + 1], D_E0022CF0[colorIdx + 2], 255);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E0022CD0[unk_2C & 7]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel quizmo_assistant_appendGfx
/* 406D04 E011C1C4 27BDFF40 */ addiu $sp, $sp, -0xC0
/* 406D08 E011C1C8 0080302D */ daddu $a2, $a0, $zero
/* 406D0C E011C1CC 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 406D10 E011C1D0 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 406D14 E011C1D4 27A40018 */ addiu $a0, $sp, 0x18
/* 406D18 E011C1D8 AFB200A0 */ sw $s2, 0xA0($sp)
/* 406D1C E011C1DC 3C12800A */ lui $s2, %hi(gMainGfxPos)
/* 406D20 E011C1E0 2652A66C */ addiu $s2, $s2, %lo(gMainGfxPos)
/* 406D24 E011C1E4 AFB500AC */ sw $s5, 0xAC($sp)
/* 406D28 E011C1E8 AFBF00B4 */ sw $ra, 0xB4($sp)
/* 406D2C E011C1EC AFB600B0 */ sw $s6, 0xB0($sp)
/* 406D30 E011C1F0 AFB400A8 */ sw $s4, 0xA8($sp)
/* 406D34 E011C1F4 AFB300A4 */ sw $s3, 0xA4($sp)
/* 406D38 E011C1F8 AFB1009C */ sw $s1, 0x9C($sp)
/* 406D3C E011C1FC AFB00098 */ sw $s0, 0x98($sp)
/* 406D40 E011C200 F7B400B8 */ sdc1 $f20, 0xB8($sp)
/* 406D44 E011C204 8E450000 */ lw $a1, 0x0($s2)
/* 406D48 E011C208 8CD4000C */ lw $s4, 0xC($a2)
/* 406D4C E011C20C 00A0182D */ daddu $v1, $a1, $zero
/* 406D50 E011C210 24A50008 */ addiu $a1, $a1, 0x8
/* 406D54 E011C214 AE450000 */ sw $a1, 0x0($s2)
/* 406D58 E011C218 8E960014 */ lw $s6, 0x14($s4)
/* 406D5C E011C21C 8E910018 */ lw $s1, 0x18($s4)
/* 406D60 E011C220 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 406D64 E011C224 AC620000 */ sw $v0, 0x0($v1)
/* 406D68 E011C228 AC600004 */ sw $zero, 0x4($v1)
/* 406D6C E011C22C ACA70000 */ sw $a3, 0x0($a1)
/* 406D70 E011C230 8CC30010 */ lw $v1, 0x10($a2)
/* 406D74 E011C234 24A20008 */ addiu $v0, $a1, 0x8
/* 406D78 E011C238 AE420000 */ sw $v0, 0x0($s2)
/* 406D7C E011C23C 8C62001C */ lw $v0, 0x1C($v1)
/* 406D80 E011C240 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 406D84 E011C244 00431021 */ addu $v0, $v0, $v1
/* 406D88 E011C248 ACA20004 */ sw $v0, 0x4($a1)
/* 406D8C E011C24C 8E850004 */ lw $a1, 0x4($s4)
/* 406D90 E011C250 8E860008 */ lw $a2, 0x8($s4)
/* 406D94 E011C254 8E87000C */ lw $a3, 0xC($s4)
/* 406D98 E011C258 4480A000 */ mtc1 $zero, $f20
/* 406D9C E011C25C 0C080108 */ jal shim_guTranslateF
/* 406DA0 E011C260 3C150001 */ lui $s5, (0x11630 >> 16)
/* 406DA4 E011C264 27B00058 */ addiu $s0, $sp, 0x58
/* 406DA8 E011C268 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 406DAC E011C26C 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 406DB0 E011C270 4406A000 */ mfc1 $a2, $f20
/* 406DB4 E011C274 00031080 */ sll $v0, $v1, 2
/* 406DB8 E011C278 00431021 */ addu $v0, $v0, $v1
/* 406DBC E011C27C 00021080 */ sll $v0, $v0, 2
/* 406DC0 E011C280 00431023 */ subu $v0, $v0, $v1
/* 406DC4 E011C284 000218C0 */ sll $v1, $v0, 3
/* 406DC8 E011C288 00431021 */ addu $v0, $v0, $v1
/* 406DCC E011C28C 000210C0 */ sll $v0, $v0, 3
/* 406DD0 E011C290 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 406DD4 E011C294 00220821 */ addu $at, $at, $v0
/* 406DD8 E011C298 C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 406DDC E011C29C 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 406DE0 E011C2A0 46000007 */ neg.s $f0, $f0
/* 406DE4 E011C2A4 44050000 */ mfc1 $a1, $f0
/* 406DE8 E011C2A8 0200202D */ daddu $a0, $s0, $zero
/* 406DEC E011C2AC 0C080104 */ jal shim_guRotateF
/* 406DF0 E011C2B0 E7B40010 */ swc1 $f20, 0x10($sp)
/* 406DF4 E011C2B4 0200202D */ daddu $a0, $s0, $zero
/* 406DF8 E011C2B8 27A50018 */ addiu $a1, $sp, 0x18
/* 406DFC E011C2BC 0C080114 */ jal shim_guMtxCatF
/* 406E00 E011C2C0 00A0302D */ daddu $a2, $a1, $zero
/* 406E04 E011C2C4 3C0542B3 */ lui $a1, (0x42B30000 >> 16)
/* 406E08 E011C2C8 4406A000 */ mfc1 $a2, $f20
/* 406E0C E011C2CC 3C074000 */ lui $a3, (0x40000000 >> 16)
/* 406E10 E011C2D0 0C080108 */ jal shim_guTranslateF
/* 406E14 E011C2D4 0200202D */ daddu $a0, $s0, $zero
/* 406E18 E011C2D8 0200202D */ daddu $a0, $s0, $zero
/* 406E1C E011C2DC 27A50018 */ addiu $a1, $sp, 0x18
/* 406E20 E011C2E0 0C080114 */ jal shim_guMtxCatF
/* 406E24 E011C2E4 00A0302D */ daddu $a2, $a1, $zero
/* 406E28 E011C2E8 3C013F36 */ lui $at, (0x3F36DB6E >> 16)
/* 406E2C E011C2EC 3421DB6E */ ori $at, $at, (0x3F36DB6E & 0xFFFF)
/* 406E30 E011C2F0 44810000 */ mtc1 $at, $f0
/* 406E34 E011C2F4 36B51630 */ ori $s5, $s5, (0x11630 & 0xFFFF)
/* 406E38 E011C2F8 44050000 */ mfc1 $a1, $f0
/* 406E3C E011C2FC 0200202D */ daddu $a0, $s0, $zero
/* 406E40 E011C300 00A0302D */ daddu $a2, $a1, $zero
/* 406E44 E011C304 0C080110 */ jal shim_guScaleF
/* 406E48 E011C308 00A0382D */ daddu $a3, $a1, $zero
/* 406E4C E011C30C 0200202D */ daddu $a0, $s0, $zero
/* 406E50 E011C310 27A50018 */ addiu $a1, $sp, 0x18
/* 406E54 E011C314 0C080114 */ jal shim_guMtxCatF
/* 406E58 E011C318 00A0302D */ daddu $a2, $a1, $zero
/* 406E5C E011C31C 27A40018 */ addiu $a0, $sp, 0x18
/* 406E60 E011C320 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 406E64 E011C324 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 406E68 E011C328 3C13800A */ lui $s3, %hi(gDisplayContext)
/* 406E6C E011C32C 2673A674 */ addiu $s3, $s3, %lo(gDisplayContext)
/* 406E70 E011C330 96050000 */ lhu $a1, 0x0($s0)
/* 406E74 E011C334 8E620000 */ lw $v0, 0x0($s3)
/* 406E78 E011C338 00052980 */ sll $a1, $a1, 6
/* 406E7C E011C33C 00B52821 */ addu $a1, $a1, $s5
/* 406E80 E011C340 0C080118 */ jal shim_guMtxF2L
/* 406E84 E011C344 00452821 */ addu $a1, $v0, $a1
/* 406E88 E011C348 3C03DA38 */ lui $v1, (0xDA380002 >> 16)
/* 406E8C E011C34C 34630002 */ ori $v1, $v1, (0xDA380002 & 0xFFFF)
/* 406E90 E011C350 323100FF */ andi $s1, $s1, 0xFF
/* 406E94 E011C354 8E440000 */ lw $a0, 0x0($s2)
/* 406E98 E011C358 96020000 */ lhu $v0, 0x0($s0)
/* 406E9C E011C35C 0080282D */ daddu $a1, $a0, $zero
/* 406EA0 E011C360 24840008 */ addiu $a0, $a0, 0x8
/* 406EA4 E011C364 AE440000 */ sw $a0, 0x0($s2)
/* 406EA8 E011C368 ACA30000 */ sw $v1, 0x0($a1)
/* 406EAC E011C36C 24430001 */ addiu $v1, $v0, 0x1
/* 406EB0 E011C370 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 406EB4 E011C374 00021180 */ sll $v0, $v0, 6
/* 406EB8 E011C378 A6030000 */ sh $v1, 0x0($s0)
/* 406EBC E011C37C 8E630000 */ lw $v1, 0x0($s3)
/* 406EC0 E011C380 00551021 */ addu $v0, $v0, $s5
/* 406EC4 E011C384 00621821 */ addu $v1, $v1, $v0
/* 406EC8 E011C388 24820008 */ addiu $v0, $a0, 0x8
/* 406ECC E011C38C ACA30004 */ sw $v1, 0x4($a1)
/* 406ED0 E011C390 AE420000 */ sw $v0, 0x0($s2)
/* 406ED4 E011C394 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 406ED8 E011C398 AC820000 */ sw $v0, 0x0($a0)
/* 406EDC E011C39C 00111600 */ sll $v0, $s1, 24
/* 406EE0 E011C3A0 00111C00 */ sll $v1, $s1, 16
/* 406EE4 E011C3A4 00431025 */ or $v0, $v0, $v1
/* 406EE8 E011C3A8 00118A00 */ sll $s1, $s1, 8
/* 406EEC E011C3AC 00511025 */ or $v0, $v0, $s1
/* 406EF0 E011C3B0 344200FF */ ori $v0, $v0, 0xFF
/* 406EF4 E011C3B4 AC820004 */ sw $v0, 0x4($a0)
/* 406EF8 E011C3B8 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 406EFC E011C3BC AC820008 */ sw $v0, 0x8($a0)
/* 406F00 E011C3C0 3C03E012 */ lui $v1, (0xE0120000 >> 16)
/* 406F04 E011C3C4 8C63C514 */ lw $v1, -0x3AEC($v1)
/* 406F08 E011C3C8 24820010 */ addiu $v0, $a0, 0x10
/* 406F0C E011C3CC AE420000 */ sw $v0, 0x0($s2)
/* 406F10 E011C3D0 AC83000C */ sw $v1, 0xC($a0)
/* 406F14 E011C3D4 8E83001C */ lw $v1, 0x1C($s4)
/* 406F18 E011C3D8 24020001 */ addiu $v0, $zero, 0x1
/* 406F1C E011C3DC 10620007 */ beq $v1, $v0, .LE011C3FC
/* 406F20 E011C3E0 28620002 */ slti $v0, $v1, 0x2
/* 406F24 E011C3E4 10400015 */ beqz $v0, .LE011C43C
/* 406F28 E011C3E8 00000000 */ nop
/* 406F2C E011C3EC 14600013 */ bnez $v1, .LE011C43C
/* 406F30 E011C3F0 0000282D */ daddu $a1, $zero, $zero
/* 406F34 E011C3F4 0804711B */ j .LE011C46C
/* 406F38 E011C3F8 3C07D838 */ lui $a3, (0xD8380002 >> 16)
.LE011C3FC:
/* 406F3C E011C3FC 3C026666 */ lui $v0, (0x66666667 >> 16)
/* 406F40 E011C400 34426667 */ ori $v0, $v0, (0x66666667 & 0xFFFF)
/* 406F44 E011C404 02C20018 */ mult $s6, $v0
/* 406F48 E011C408 001617C3 */ sra $v0, $s6, 31
/* 406F4C E011C40C 00004010 */ mfhi $t0
/* 406F50 E011C410 00081843 */ sra $v1, $t0, 1
/* 406F54 E011C414 00621823 */ subu $v1, $v1, $v0
/* 406F58 E011C418 00031080 */ sll $v0, $v1, 2
/* 406F5C E011C41C 00431021 */ addu $v0, $v0, $v1
/* 406F60 E011C420 02C21023 */ subu $v0, $s6, $v0
/* 406F64 E011C424 00021080 */ sll $v0, $v0, 2
/* 406F68 E011C428 3C05E012 */ lui $a1, (0xE0120000 >> 16)
/* 406F6C E011C42C 00A22821 */ addu $a1, $a1, $v0
/* 406F70 E011C430 8CA5C518 */ lw $a1, -0x3AE8($a1)
/* 406F74 E011C434 0804711B */ j .LE011C46C
/* 406F78 E011C438 3C07D838 */ lui $a3, (0xD8380002 >> 16)
.LE011C43C:
/* 406F7C E011C43C 06C10002 */ bgez $s6, .LE011C448
/* 406F80 E011C440 02C0102D */ daddu $v0, $s6, $zero
/* 406F84 E011C444 26C20003 */ addiu $v0, $s6, 0x3
.LE011C448:
/* 406F88 E011C448 00021083 */ sra $v0, $v0, 2
/* 406F8C E011C44C 00021080 */ sll $v0, $v0, 2
/* 406F90 E011C450 02C21023 */ subu $v0, $s6, $v0
/* 406F94 E011C454 00021080 */ sll $v0, $v0, 2
/* 406F98 E011C458 3C03E012 */ lui $v1, %hi(D_E011C52C)
/* 406F9C E011C45C 2463C52C */ addiu $v1, $v1, %lo(D_E011C52C)
/* 406FA0 E011C460 00431021 */ addu $v0, $v0, $v1
/* 406FA4 E011C464 8C450000 */ lw $a1, 0x0($v0)
/* 406FA8 E011C468 3C07D838 */ lui $a3, (0xD8380002 >> 16)
.LE011C46C:
/* 406FAC E011C46C 3C04800A */ lui $a0, %hi(gMainGfxPos)
/* 406FB0 E011C470 2484A66C */ addiu $a0, $a0, %lo(gMainGfxPos)
/* 406FB4 E011C474 34E70002 */ ori $a3, $a3, (0xD8380002 & 0xFFFF)
/* 406FB8 E011C478 8C830000 */ lw $v1, 0x0($a0)
/* 406FBC E011C47C 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 406FC0 E011C480 0060302D */ daddu $a2, $v1, $zero
/* 406FC4 E011C484 24630008 */ addiu $v1, $v1, 0x8
/* 406FC8 E011C488 AC830000 */ sw $v1, 0x0($a0)
/* 406FCC E011C48C ACC20000 */ sw $v0, 0x0($a2)
/* 406FD0 E011C490 24620008 */ addiu $v0, $v1, 0x8
/* 406FD4 E011C494 AC820000 */ sw $v0, 0x0($a0)
/* 406FD8 E011C498 00051080 */ sll $v0, $a1, 2
/* 406FDC E011C49C 3C05E012 */ lui $a1, (0xE0120000 >> 16)
/* 406FE0 E011C4A0 00A22821 */ addu $a1, $a1, $v0
/* 406FE4 E011C4A4 8CA5C500 */ lw $a1, -0x3B00($a1)
/* 406FE8 E011C4A8 24620010 */ addiu $v0, $v1, 0x10
/* 406FEC E011C4AC AC820000 */ sw $v0, 0x0($a0)
/* 406FF0 E011C4B0 24020040 */ addiu $v0, $zero, 0x40
/* 406FF4 E011C4B4 ACC50004 */ sw $a1, 0x4($a2)
/* 406FF8 E011C4B8 AC620004 */ sw $v0, 0x4($v1)
/* 406FFC E011C4BC 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 407000 E011C4C0 AC670000 */ sw $a3, 0x0($v1)
/* 407004 E011C4C4 AC620008 */ sw $v0, 0x8($v1)
/* 407008 E011C4C8 AC60000C */ sw $zero, 0xC($v1)
/* 40700C E011C4CC 8FBF00B4 */ lw $ra, 0xB4($sp)
/* 407010 E011C4D0 8FB600B0 */ lw $s6, 0xB0($sp)
/* 407014 E011C4D4 8FB500AC */ lw $s5, 0xAC($sp)
/* 407018 E011C4D8 8FB400A8 */ lw $s4, 0xA8($sp)
/* 40701C E011C4DC 8FB300A4 */ lw $s3, 0xA4($sp)
/* 407020 E011C4E0 8FB200A0 */ lw $s2, 0xA0($sp)
/* 407024 E011C4E4 8FB1009C */ lw $s1, 0x9C($sp)
/* 407028 E011C4E8 8FB00098 */ lw $s0, 0x98($sp)
/* 40702C E011C4EC D7B400B8 */ ldc1 $f20, 0xB8($sp)
/* 407030 E011C4F0 03E00008 */ jr $ra
/* 407034 E011C4F4 27BD00C0 */ addiu $sp, $sp, 0xC0
/* 407038 E011C4F8 00000000 */ nop
/* 40703C E011C4FC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void quizmo_assistant_appendGfx(void* effect) {
QuizmoAssistantFXData* data = ((EffectInstance*)effect)->data.quizmoAssistant;
s32 lifetime = data->lifetime;
s32 fadeInAmt = data->fadeInAmt;
s32 idx;
Matrix4f sp18;
Matrix4f sp58;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->position.x, data->position.y, data->position.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guTranslateF(sp58, 89.5f, 0.0f, 2.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, 5.0f / 7, 5.0f / 7, 5.0f / 7);
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);
gDPSetPrimColor(gMainGfxPos++, 0, 0, fadeInAmt, fadeInAmt, fadeInAmt, 255);
gSPDisplayList(gMainGfxPos++, D_E011C514[0]);
switch (data->anim) {
case 0:
idx = 0;
break;
case 1:
idx = D_E011C518[lifetime % ARRAY_COUNT(D_E011C518)];
break;
case 2:
default:
idx = D_E011C52C[lifetime % ARRAY_COUNT(D_E011C52C)];
break;
}
gSPDisplayList(gMainGfxPos++, D_E011C500[idx]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel JumpToGoalSimple2
/* 1A7D00 80279420 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 1A7D04 80279424 AFB20020 */ sw $s2, 0x20($sp)
/* 1A7D08 80279428 0080902D */ daddu $s2, $a0, $zero
/* 1A7D0C 8027942C AFBF0024 */ sw $ra, 0x24($sp)
/* 1A7D10 80279430 AFB1001C */ sw $s1, 0x1C($sp)
/* 1A7D14 80279434 AFB00018 */ sw $s0, 0x18($sp)
/* 1A7D18 80279438 F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 1A7D1C 8027943C F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 1A7D20 80279440 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 1A7D24 80279444 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 1A7D28 80279448 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 1A7D2C 8027944C F7B40028 */ sdc1 $f20, 0x28($sp)
/* 1A7D30 80279450 8E51000C */ lw $s1, 0xC($s2)
/* 1A7D34 80279454 54A00001 */ bnel $a1, $zero, .L8027945C
/* 1A7D38 80279458 AE400070 */ sw $zero, 0x70($s2)
.L8027945C:
/* 1A7D3C 8027945C 8E420070 */ lw $v0, 0x70($s2)
/* 1A7D40 80279460 14400073 */ bnez $v0, .L80279630
/* 1A7D44 80279464 00000000 */ nop
/* 1A7D48 80279468 8E250000 */ lw $a1, 0x0($s1)
/* 1A7D4C 8027946C 26310004 */ addiu $s1, $s1, 0x4
/* 1A7D50 80279470 0C0B1EAF */ jal evt_get_variable
/* 1A7D54 80279474 0240202D */ daddu $a0, $s2, $zero
/* 1A7D58 80279478 0040202D */ daddu $a0, $v0, $zero
/* 1A7D5C 8027947C 2402FF81 */ addiu $v0, $zero, -0x7F
/* 1A7D60 80279480 14820002 */ bne $a0, $v0, .L8027948C
/* 1A7D64 80279484 00000000 */ nop
/* 1A7D68 80279488 8E440148 */ lw $a0, 0x148($s2)
.L8027948C:
/* 1A7D6C 8027948C 0C09A75B */ jal get_actor
/* 1A7D70 80279490 00000000 */ nop
/* 1A7D74 80279494 0040802D */ daddu $s0, $v0, $zero
/* 1A7D78 80279498 AE500074 */ sw $s0, 0x74($s2)
/* 1A7D7C 8027949C 8E250000 */ lw $a1, 0x0($s1)
/* 1A7D80 802794A0 0C0B1EAF */ jal evt_get_variable
/* 1A7D84 802794A4 0240202D */ daddu $a0, $s2, $zero
/* 1A7D88 802794A8 C6000148 */ lwc1 $f0, 0x148($s0)
/* 1A7D8C 802794AC C61A0018 */ lwc1 $f26, 0x18($s0)
/* 1A7D90 802794B0 C61C0020 */ lwc1 $f28, 0x20($s0)
/* 1A7D94 802794B4 C614014C */ lwc1 $f20, 0x14C($s0)
/* 1A7D98 802794B8 C618001C */ lwc1 $f24, 0x1C($s0)
/* 1A7D9C 802794BC 2611000C */ addiu $s1, $s0, 0xC
/* 1A7DA0 802794C0 A6020070 */ sh $v0, 0x70($s0)
/* 1A7DA4 802794C4 E6000010 */ swc1 $f0, 0x10($s0)
/* 1A7DA8 802794C8 46000786 */ mov.s $f30, $f0
/* 1A7DAC 802794CC 4406D000 */ mfc1 $a2, $f26
/* 1A7DB0 802794D0 4407E000 */ mfc1 $a3, $f28
/* 1A7DB4 802794D4 C6000144 */ lwc1 $f0, 0x144($s0)
/* 1A7DB8 802794D8 4600A386 */ mov.s $f14, $f20
/* 1A7DBC 802794DC E6140014 */ swc1 $f20, 0x14($s0)
/* 1A7DC0 802794E0 E600000C */ swc1 $f0, 0xC($s0)
/* 1A7DC4 802794E4 46000586 */ mov.s $f22, $f0
/* 1A7DC8 802794E8 0C00A720 */ jal atan2
/* 1A7DCC 802794EC 4600B306 */ mov.s $f12, $f22
/* 1A7DD0 802794F0 4600B306 */ mov.s $f12, $f22
/* 1A7DD4 802794F4 4600A386 */ mov.s $f14, $f20
/* 1A7DD8 802794F8 4406D000 */ mfc1 $a2, $f26
/* 1A7DDC 802794FC 4407E000 */ mfc1 $a3, $f28
/* 1A7DE0 80279500 4618F781 */ sub.s $f30, $f30, $f24
/* 1A7DE4 80279504 0C00A7B5 */ jal dist2D
/* 1A7DE8 80279508 E6000054 */ swc1 $f0, 0x54($s0)
/* 1A7DEC 8027950C 86020070 */ lh $v0, 0x70($s0)
/* 1A7DF0 80279510 46000106 */ mov.s $f4, $f0
/* 1A7DF4 80279514 14400012 */ bnez $v0, .L80279560
/* 1A7DF8 80279518 E6040058 */ swc1 $f4, 0x58($s0)
/* 1A7DFC 8027951C C600004C */ lwc1 $f0, 0x4C($s0)
/* 1A7E00 80279520 C602004C */ lwc1 $f2, 0x4C($s0)
/* 1A7E04 80279524 46002003 */ div.s $f0, $f4, $f0
/* 1A7E08 80279528 4600028D */ trunc.w.s $f10, $f0
/* 1A7E0C 8027952C 44035000 */ mfc1 $v1, $f10
/* 1A7E10 80279530 00000000 */ nop
/* 1A7E14 80279534 00031400 */ sll $v0, $v1, 16
/* 1A7E18 80279538 00021403 */ sra $v0, $v0, 16
/* 1A7E1C 8027953C 44820000 */ mtc1 $v0, $f0
/* 1A7E20 80279540 00000000 */ nop
/* 1A7E24 80279544 46800020 */ cvt.s.w $f0, $f0
/* 1A7E28 80279548 46020002 */ mul.s $f0, $f0, $f2
/* 1A7E2C 8027954C 00000000 */ nop
/* 1A7E30 80279550 46002086 */ mov.s $f2, $f4
/* 1A7E34 80279554 A6030070 */ sh $v1, 0x70($s0)
/* 1A7E38 80279558 0809E565 */ j .L80279594
/* 1A7E3C 8027955C 46001201 */ sub.s $f8, $f2, $f0
.L80279560:
/* 1A7E40 80279560 44821000 */ mtc1 $v0, $f2
/* 1A7E44 80279564 00000000 */ nop
/* 1A7E48 80279568 468010A0 */ cvt.s.w $f2, $f2
/* 1A7E4C 8027956C 86020070 */ lh $v0, 0x70($s0)
/* 1A7E50 80279570 46022083 */ div.s $f2, $f4, $f2
/* 1A7E54 80279574 44820000 */ mtc1 $v0, $f0
/* 1A7E58 80279578 00000000 */ nop
/* 1A7E5C 8027957C 46800020 */ cvt.s.w $f0, $f0
/* 1A7E60 80279580 46020002 */ mul.s $f0, $f0, $f2
/* 1A7E64 80279584 00000000 */ nop
/* 1A7E68 80279588 C6040058 */ lwc1 $f4, 0x58($s0)
/* 1A7E6C 8027958C E602004C */ swc1 $f2, 0x4C($s0)
/* 1A7E70 80279590 46002201 */ sub.s $f8, $f4, $f0
.L80279594:
/* 1A7E74 80279594 86220064 */ lh $v0, 0x64($s1)
/* 1A7E78 80279598 14400003 */ bnez $v0, .L802795A8
/* 1A7E7C 8027959C 00000000 */ nop
/* 1A7E80 802795A0 0809E5BE */ j .L802796F8
/* 1A7E84 802795A4 24020002 */ addiu $v0, $zero, 0x2
.L802795A8:
/* 1A7E88 802795A8 C622003C */ lwc1 $f2, 0x3C($s1)
/* 1A7E8C 802795AC 44823000 */ mtc1 $v0, $f6
/* 1A7E90 802795B0 00000000 */ nop
/* 1A7E94 802795B4 468031A0 */ cvt.s.w $f6, $f6
/* 1A7E98 802795B8 46061082 */ mul.s $f2, $f2, $f6
/* 1A7E9C 802795BC 00000000 */ nop
/* 1A7EA0 802795C0 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 1A7EA4 802795C4 44810000 */ mtc1 $at, $f0
/* 1A7EA8 802795C8 00000000 */ nop
/* 1A7EAC 802795CC 46001082 */ mul.s $f2, $f2, $f0
/* 1A7EB0 802795D0 00000000 */ nop
/* 1A7EB4 802795D4 86220064 */ lh $v0, 0x64($s1)
/* 1A7EB8 802795D8 C6240040 */ lwc1 $f4, 0x40($s1)
/* 1A7EBC 802795DC 44820000 */ mtc1 $v0, $f0
/* 1A7EC0 802795E0 00000000 */ nop
/* 1A7EC4 802795E4 46800020 */ cvt.s.w $f0, $f0
/* 1A7EC8 802795E8 46004003 */ div.s $f0, $f8, $f0
/* 1A7ECC 802795EC 46002100 */ add.s $f4, $f4, $f0
/* 1A7ED0 802795F0 4606F183 */ div.s $f6, $f30, $f6
/* 1A7ED4 802795F4 46061080 */ add.s $f2, $f2, $f6
/* 1A7ED8 802795F8 E6240040 */ swc1 $f4, 0x40($s1)
/* 1A7EDC 802795FC E6220044 */ swc1 $f2, 0x44($s1)
/* 1A7EE0 80279600 8E0201AC */ lw $v0, 0x1AC($s0)
/* 1A7EE4 80279604 10400009 */ beqz $v0, .L8027962C
/* 1A7EE8 80279608 24020001 */ addiu $v0, $zero, 0x1
/* 1A7EEC 8027960C C600014C */ lwc1 $f0, 0x14C($s0)
/* 1A7EF0 80279610 E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A7EF4 80279614 8E0401AC */ lw $a0, 0x1AC($s0)
/* 1A7EF8 80279618 8E060144 */ lw $a2, 0x144($s0)
/* 1A7EFC 8027961C 8E070148 */ lw $a3, 0x148($s0)
/* 1A7F00 80279620 0C052757 */ jal sfx_play_sound_at_position
/* 1A7F04 80279624 0000282D */ daddu $a1, $zero, $zero
/* 1A7F08 80279628 24020001 */ addiu $v0, $zero, 0x1
.L8027962C:
/* 1A7F0C 8027962C AE420070 */ sw $v0, 0x70($s2)
.L80279630:
/* 1A7F10 80279630 8E500074 */ lw $s0, 0x74($s2)
/* 1A7F14 80279634 C6000050 */ lwc1 $f0, 0x50($s0)
/* 1A7F18 80279638 C6040010 */ lwc1 $f4, 0x10($s0)
/* 1A7F1C 8027963C 46000086 */ mov.s $f2, $f0
/* 1A7F20 80279640 46002101 */ sub.s $f4, $f4, $f0
/* 1A7F24 80279644 C6000048 */ lwc1 $f0, 0x48($s0)
/* 1A7F28 80279648 46001081 */ sub.s $f2, $f2, $f0
/* 1A7F2C 8027964C 44800000 */ mtc1 $zero, $f0
/* 1A7F30 80279650 2611000C */ addiu $s1, $s0, 0xC
/* 1A7F34 80279654 E6040010 */ swc1 $f4, 0x10($s0)
/* 1A7F38 80279658 4602003C */ c.lt.s $f0, $f2
/* 1A7F3C 8027965C 00000000 */ nop
/* 1A7F40 80279660 45000007 */ bc1f .L80279680
/* 1A7F44 80279664 E6020050 */ swc1 $f2, 0x50($s0)
/* 1A7F48 80279668 C602001C */ lwc1 $f2, 0x1C($s0)
/* 1A7F4C 8027966C 46002006 */ mov.s $f0, $f4
/* 1A7F50 80279670 4600103C */ c.lt.s $f2, $f0
/* 1A7F54 80279674 00000000 */ nop
/* 1A7F58 80279678 45030001 */ bc1tl .L80279680
/* 1A7F5C 8027967C E6020010 */ swc1 $f2, 0x10($s0)
.L80279680:
/* 1A7F60 80279680 8E250040 */ lw $a1, 0x40($s1)
/* 1A7F64 80279684 8E260048 */ lw $a2, 0x48($s1)
/* 1A7F68 80279688 0C09904A */ jal add_xz_vec3f
/* 1A7F6C 8027968C 0220202D */ daddu $a0, $s1, $zero
/* 1A7F70 80279690 C6200000 */ lwc1 $f0, 0x0($s1)
/* 1A7F74 80279694 E6000144 */ swc1 $f0, 0x144($s0)
/* 1A7F78 80279698 C6200004 */ lwc1 $f0, 0x4($s1)
/* 1A7F7C 8027969C E6000148 */ swc1 $f0, 0x148($s0)
/* 1A7F80 802796A0 C6200008 */ lwc1 $f0, 0x8($s1)
/* 1A7F84 802796A4 E600014C */ swc1 $f0, 0x14C($s0)
/* 1A7F88 802796A8 96220064 */ lhu $v0, 0x64($s1)
/* 1A7F8C 802796AC 2442FFFF */ addiu $v0, $v0, -0x1
/* 1A7F90 802796B0 A6220064 */ sh $v0, 0x64($s1)
/* 1A7F94 802796B4 00021400 */ sll $v0, $v0, 16
/* 1A7F98 802796B8 1C40000F */ bgtz $v0, .L802796F8
/* 1A7F9C 802796BC 0000102D */ daddu $v0, $zero, $zero
/* 1A7FA0 802796C0 C6200048 */ lwc1 $f0, 0x48($s1)
/* 1A7FA4 802796C4 E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A7FA8 802796C8 8E25000C */ lw $a1, 0xC($s1)
/* 1A7FAC 802796CC 8E260010 */ lw $a2, 0x10($s1)
/* 1A7FB0 802796D0 8E270014 */ lw $a3, 0x14($s1)
/* 1A7FB4 802796D4 0C0990BC */ jal play_movement_dust_effects
/* 1A7FB8 802796D8 24040002 */ addiu $a0, $zero, 0x2
/* 1A7FBC 802796DC C620000C */ lwc1 $f0, 0xC($s1)
/* 1A7FC0 802796E0 E6000144 */ swc1 $f0, 0x144($s0)
/* 1A7FC4 802796E4 C6200010 */ lwc1 $f0, 0x10($s1)
/* 1A7FC8 802796E8 E6000148 */ swc1 $f0, 0x148($s0)
/* 1A7FCC 802796EC C6200014 */ lwc1 $f0, 0x14($s1)
/* 1A7FD0 802796F0 24020001 */ addiu $v0, $zero, 0x1
/* 1A7FD4 802796F4 E600014C */ swc1 $f0, 0x14C($s0)
.L802796F8:
/* 1A7FD8 802796F8 8FBF0024 */ lw $ra, 0x24($sp)
/* 1A7FDC 802796FC 8FB20020 */ lw $s2, 0x20($sp)
/* 1A7FE0 80279700 8FB1001C */ lw $s1, 0x1C($sp)
/* 1A7FE4 80279704 8FB00018 */ lw $s0, 0x18($sp)
/* 1A7FE8 80279708 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 1A7FEC 8027970C D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 1A7FF0 80279710 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 1A7FF4 80279714 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 1A7FF8 80279718 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 1A7FFC 8027971C D7B40028 */ ldc1 $f20, 0x28($sp)
/* 1A8000 80279720 03E00008 */ jr $ra
/* 1A8004 80279724 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
ApiStatus JumpToGoalSimple2(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
ActorState* state;
f32 posX, posY, posZ;
f32 goalX, goalY, goalZ;
f32 moveDist;
Actor* actor;
if (isInitialCall) {
script->functionTemp[0] = FALSE;
}
if (!script->functionTemp[0]) {
s32 actorID = evt_get_variable(script, *args++);
if (actorID == ACTOR_SELF) {
actorID = script->owner1.actorID;
}
script->functionTempPtr[1] = actor = get_actor(actorID);
state = &actor->state;
state->moveTime = evt_get_variable(script, *args++);
state->currentPos.x = actor->currentPos.x;
state->currentPos.y = actor->currentPos.y;
state->currentPos.z = actor->currentPos.z;
posX = state->currentPos.x;
posY = state->currentPos.y;
posZ = state->currentPos.z;
goalX = state->goalPos.x;
goalY = state->goalPos.y;
goalZ = state->goalPos.z;
state->angle = atan2(posX, posZ, goalX, goalZ);
state->distance = dist2D(posX, posZ, goalX, goalZ);
// make relative (note: negated)
posX = (posX - goalX);
posY = (posY - goalY);
posZ = (posZ - goalZ);
if (state->moveTime == 0) {
state->moveTime = state->distance / state->speed;
moveDist = state->distance - (state->moveTime * state->speed);
} else {
state->speed = state->distance / state->moveTime;
moveDist = state->distance - (state->moveTime * state->speed);
}
if (state->moveTime == 0) {
return ApiStatus_DONE2;
}
state->velocity = ((state->acceleration * state->moveTime) * 0.5f) + (posY / state->moveTime);
state->speed += moveDist / state->moveTime;
if (actor->actorTypeData1[4] != 0) {
sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z);
}
script->functionTemp[0] = TRUE;
}
actor = script->functionTempPtr[1];
state = &actor->state;
state->currentPos.y -= state->velocity;
state->velocity -= state->acceleration;
if (state->velocity > 0.0f && state->goalPos.y < state->currentPos.y) {
state->currentPos.y = state->goalPos.y;
}
add_xz_vec3f(&state->currentPos, state->speed, state->angle);
actor->currentPos.x = state->currentPos.x;
actor->currentPos.y = state->currentPos.y;
actor->currentPos.z = state->currentPos.z;
state->moveTime--;
if (state->moveTime <= 0) {
play_movement_dust_effects(2, state->goalPos.x, state->goalPos.y, state->goalPos.z, state->angle);
actor->currentPos.x = state->goalPos.x;
actor->currentPos.y = state->goalPos.y;
actor->currentPos.z = state->goalPos.z;
return ApiStatus_DONE1;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel draw_encounters_pre_battle
/* 1CD64 80041964 27BDFF88 */ addiu $sp, $sp, -0x78
/* 1CD68 80041968 AFB00038 */ sw $s0, 0x38($sp)
/* 1CD6C 8004196C 3C10800B */ lui $s0, %hi(gCurrentEncounter)
/* 1CD70 80041970 26100F10 */ addiu $s0, $s0, %lo(gCurrentEncounter)
/* 1CD74 80041974 AFBF0040 */ sw $ra, 0x40($sp)
/* 1CD78 80041978 AFB1003C */ sw $s1, 0x3C($sp)
/* 1CD7C 8004197C F7BE0070 */ sdc1 $f30, 0x70($sp)
/* 1CD80 80041980 F7BC0068 */ sdc1 $f28, 0x68($sp)
/* 1CD84 80041984 F7BA0060 */ sdc1 $f26, 0x60($sp)
/* 1CD88 80041988 F7B80058 */ sdc1 $f24, 0x58($sp)
/* 1CD8C 8004198C F7B60050 */ sdc1 $f22, 0x50($sp)
/* 1CD90 80041990 F7B40048 */ sdc1 $f20, 0x48($sp)
/* 1CD94 80041994 8E02008C */ lw $v0, 0x8C($s0)
/* 1CD98 80041998 84440008 */ lh $a0, 0x8($v0)
/* 1CD9C 8004199C 0C00EABB */ jal get_npc_unsafe
/* 1CDA0 800419A0 0200882D */ daddu $s1, $s0, $zero
/* 1CDA4 800419A4 0040382D */ daddu $a3, $v0, $zero
/* 1CDA8 800419A8 8E020094 */ lw $v0, 0x94($s0)
/* 1CDAC 800419AC 3C048011 */ lui $a0, %hi(gPlayerStatus)
/* 1CDB0 800419B0 2484EFC8 */ addiu $a0, $a0, %lo(gPlayerStatus)
/* 1CDB4 800419B4 1040009E */ beqz $v0, .L80041C30
/* 1CDB8 800419B8 240500FF */ addiu $a1, $zero, 0xFF
/* 1CDBC 800419BC 8E030090 */ lw $v1, 0x90($s0)
/* 1CDC0 800419C0 1065009B */ beq $v1, $a1, .L80041C30
/* 1CDC4 800419C4 00000000 */ nop
/* 1CDC8 800419C8 8E020098 */ lw $v0, 0x98($s0)
/* 1CDCC 800419CC 24420001 */ addiu $v0, $v0, 0x1
/* 1CDD0 800419D0 AE020098 */ sw $v0, 0x98($s0)
/* 1CDD4 800419D4 2842000B */ slti $v0, $v0, 0xB
/* 1CDD8 800419D8 14400002 */ bnez $v0, .L800419E4
/* 1CDDC 800419DC 2402000A */ addiu $v0, $zero, 0xA
/* 1CDE0 800419E0 AE020098 */ sw $v0, 0x98($s0)
.L800419E4:
/* 1CDE4 800419E4 8E020098 */ lw $v0, 0x98($s0)
/* 1CDE8 800419E8 00621021 */ addu $v0, $v1, $v0
/* 1CDEC 800419EC AE020090 */ sw $v0, 0x90($s0)
/* 1CDF0 800419F0 28420100 */ slti $v0, $v0, 0x100
/* 1CDF4 800419F4 50400001 */ beql $v0, $zero, .L800419FC
/* 1CDF8 800419F8 AE050090 */ sw $a1, 0x90($s0)
.L800419FC:
/* 1CDFC 800419FC C4FE0038 */ lwc1 $f30, 0x38($a3)
/* 1CE00 80041A00 C4FA003C */ lwc1 $f26, 0x3C($a3)
/* 1CE04 80041A04 3C01C477 */ lui $at, (0xC4778000 >> 16)
/* 1CE08 80041A08 34218000 */ ori $at, $at, (0xC4778000 & 0xFFFF)
/* 1CE0C 80041A0C 44810000 */ mtc1 $at, $f0
/* 1CE10 80041A10 C4FC0040 */ lwc1 $f28, 0x40($a3)
/* 1CE14 80041A14 C4940028 */ lwc1 $f20, 0x28($a0)
/* 1CE18 80041A18 C498002C */ lwc1 $f24, 0x2C($a0)
/* 1CE1C 80041A1C C4960030 */ lwc1 $f22, 0x30($a0)
/* 1CE20 80041A20 4600D03C */ c.lt.s $f26, $f0
/* 1CE24 80041A24 00000000 */ nop
/* 1CE28 80041A28 45000004 */ bc1f .L80041A3C
/* 1CE2C 80041A2C 00000000 */ nop
/* 1CE30 80041A30 4600A786 */ mov.s $f30, $f20
/* 1CE34 80041A34 4600C686 */ mov.s $f26, $f24
/* 1CE38 80041A38 4600B706 */ mov.s $f28, $f22
.L80041A3C:
/* 1CE3C 80041A3C 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 1CE40 80041A40 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 1CE44 80041A44 80430071 */ lb $v1, 0x71($v0)
/* 1CE48 80041A48 24020002 */ addiu $v0, $zero, 0x2
/* 1CE4C 80041A4C 1462003C */ bne $v1, $v0, .L80041B40
/* 1CE50 80041A50 00000000 */ nop
/* 1CE54 80041A54 C6020090 */ lwc1 $f2, 0x90($s0)
/* 1CE58 80041A58 468010A0 */ cvt.s.w $f2, $f2
/* 1CE5C 80041A5C 44051000 */ mfc1 $a1, $f2
/* 1CE60 80041A60 0C04DF69 */ jal set_screen_overlay_params_back
/* 1CE64 80041A64 2404000A */ addiu $a0, $zero, 0xA
/* 1CE68 80041A68 3C05437F */ lui $a1, (0x437F0000 >> 16)
/* 1CE6C 80041A6C 0C04E035 */ jal set_screen_overlay_alpha
/* 1CE70 80041A70 24040001 */ addiu $a0, $zero, 0x1
/* 1CE74 80041A74 24040001 */ addiu $a0, $zero, 0x1
/* 1CE78 80041A78 0000282D */ daddu $a1, $zero, $zero
/* 1CE7C 80041A7C 00A0302D */ daddu $a2, $a1, $zero
/* 1CE80 80041A80 0C04DF84 */ jal set_screen_overlay_color
/* 1CE84 80041A84 00A0382D */ daddu $a3, $a1, $zero
/* 1CE88 80041A88 3C108007 */ lui $s0, %hi(gCurrentCameraID)
/* 1CE8C 80041A8C 26107410 */ addiu $s0, $s0, %lo(gCurrentCameraID)
/* 1CE90 80041A90 8E040000 */ lw $a0, 0x0($s0)
/* 1CE94 80041A94 4405A000 */ mfc1 $a1, $f20
/* 1CE98 80041A98 4407B000 */ mfc1 $a3, $f22
/* 1CE9C 80041A9C 3C0141A0 */ lui $at, (0x41A00000 >> 16)
/* 1CEA0 80041AA0 44810000 */ mtc1 $at, $f0
/* 1CEA4 80041AA4 27A20020 */ addiu $v0, $sp, 0x20
/* 1CEA8 80041AA8 AFA20010 */ sw $v0, 0x10($sp)
/* 1CEAC 80041AAC 4600C600 */ add.s $f24, $f24, $f0
/* 1CEB0 80041AB0 27A20024 */ addiu $v0, $sp, 0x24
/* 1CEB4 80041AB4 AFA20014 */ sw $v0, 0x14($sp)
/* 1CEB8 80041AB8 4406C000 */ mfc1 $a2, $f24
/* 1CEBC 80041ABC 27A20028 */ addiu $v0, $sp, 0x28
/* 1CEC0 80041AC0 0C00B94E */ jal get_screen_coords
/* 1CEC4 80041AC4 AFA20018 */ sw $v0, 0x18($sp)
/* 1CEC8 80041AC8 8E040000 */ lw $a0, 0x0($s0)
/* 1CECC 80041ACC 4405F000 */ mfc1 $a1, $f30
/* 1CED0 80041AD0 4407E000 */ mfc1 $a3, $f28
/* 1CED4 80041AD4 3C014170 */ lui $at, (0x41700000 >> 16)
/* 1CED8 80041AD8 44810000 */ mtc1 $at, $f0
/* 1CEDC 80041ADC 27A2002C */ addiu $v0, $sp, 0x2C
/* 1CEE0 80041AE0 AFA20010 */ sw $v0, 0x10($sp)
/* 1CEE4 80041AE4 4600D680 */ add.s $f26, $f26, $f0
/* 1CEE8 80041AE8 27A20030 */ addiu $v0, $sp, 0x30
/* 1CEEC 80041AEC AFA20014 */ sw $v0, 0x14($sp)
/* 1CEF0 80041AF0 4406D000 */ mfc1 $a2, $f26
/* 1CEF4 80041AF4 27A20034 */ addiu $v0, $sp, 0x34
/* 1CEF8 80041AF8 0C00B94E */ jal get_screen_coords
/* 1CEFC 80041AFC AFA20018 */ sw $v0, 0x18($sp)
/* 1CF00 80041B00 24040001 */ addiu $a0, $zero, 0x1
/* 1CF04 80041B04 0000282D */ daddu $a1, $zero, $zero
/* 1CF08 80041B08 8FA60020 */ lw $a2, 0x20($sp)
/* 1CF0C 80041B0C 8FA8002C */ lw $t0, 0x2C($sp)
/* 1CF10 80041B10 8FA70024 */ lw $a3, 0x24($sp)
/* 1CF14 80041B14 8FA30030 */ lw $v1, 0x30($sp)
/* 1CF18 80041B18 00C83023 */ subu $a2, $a2, $t0
/* 1CF1C 80041B1C 000617C2 */ srl $v0, $a2, 31
/* 1CF20 80041B20 00C23021 */ addu $a2, $a2, $v0
/* 1CF24 80041B24 00863007 */ srav $a2, $a2, $a0
/* 1CF28 80041B28 00C83021 */ addu $a2, $a2, $t0
/* 1CF2C 80041B2C 00E33823 */ subu $a3, $a3, $v1
/* 1CF30 80041B30 000717C2 */ srl $v0, $a3, 31
/* 1CF34 80041B34 00E23821 */ addu $a3, $a3, $v0
/* 1CF38 80041B38 0801070A */ j .L80041C28
/* 1CF3C 80041B3C 00873807 */ srav $a3, $a3, $a0
.L80041B40:
/* 1CF40 80041B40 C6220090 */ lwc1 $f2, 0x90($s1)
/* 1CF44 80041B44 468010A0 */ cvt.s.w $f2, $f2
/* 1CF48 80041B48 44051000 */ mfc1 $a1, $f2
/* 1CF4C 80041B4C 0C04DF62 */ jal set_screen_overlay_params_front
/* 1CF50 80041B50 2404000A */ addiu $a0, $zero, 0xA
/* 1CF54 80041B54 3C05437F */ lui $a1, (0x437F0000 >> 16)
/* 1CF58 80041B58 0C04E035 */ jal set_screen_overlay_alpha
/* 1CF5C 80041B5C 0000202D */ daddu $a0, $zero, $zero
/* 1CF60 80041B60 0000202D */ daddu $a0, $zero, $zero
/* 1CF64 80041B64 0080282D */ daddu $a1, $a0, $zero
/* 1CF68 80041B68 0080302D */ daddu $a2, $a0, $zero
/* 1CF6C 80041B6C 0C04DF84 */ jal set_screen_overlay_color
/* 1CF70 80041B70 0080382D */ daddu $a3, $a0, $zero
/* 1CF74 80041B74 3C108007 */ lui $s0, %hi(gCurrentCameraID)
/* 1CF78 80041B78 26107410 */ addiu $s0, $s0, %lo(gCurrentCameraID)
/* 1CF7C 80041B7C 8E040000 */ lw $a0, 0x0($s0)
/* 1CF80 80041B80 4405A000 */ mfc1 $a1, $f20
/* 1CF84 80041B84 4407B000 */ mfc1 $a3, $f22
/* 1CF88 80041B88 3C0141A0 */ lui $at, (0x41A00000 >> 16)
/* 1CF8C 80041B8C 44810000 */ mtc1 $at, $f0
/* 1CF90 80041B90 27A20020 */ addiu $v0, $sp, 0x20
/* 1CF94 80041B94 AFA20010 */ sw $v0, 0x10($sp)
/* 1CF98 80041B98 4600C600 */ add.s $f24, $f24, $f0
/* 1CF9C 80041B9C 27A20024 */ addiu $v0, $sp, 0x24
/* 1CFA0 80041BA0 AFA20014 */ sw $v0, 0x14($sp)
/* 1CFA4 80041BA4 4406C000 */ mfc1 $a2, $f24
/* 1CFA8 80041BA8 27A20028 */ addiu $v0, $sp, 0x28
/* 1CFAC 80041BAC 0C00B94E */ jal get_screen_coords
/* 1CFB0 80041BB0 AFA20018 */ sw $v0, 0x18($sp)
/* 1CFB4 80041BB4 8E040000 */ lw $a0, 0x0($s0)
/* 1CFB8 80041BB8 4405F000 */ mfc1 $a1, $f30
/* 1CFBC 80041BBC 4407E000 */ mfc1 $a3, $f28
/* 1CFC0 80041BC0 3C014170 */ lui $at, (0x41700000 >> 16)
/* 1CFC4 80041BC4 44810000 */ mtc1 $at, $f0
/* 1CFC8 80041BC8 27A2002C */ addiu $v0, $sp, 0x2C
/* 1CFCC 80041BCC AFA20010 */ sw $v0, 0x10($sp)
/* 1CFD0 80041BD0 4600D680 */ add.s $f26, $f26, $f0
/* 1CFD4 80041BD4 27A20030 */ addiu $v0, $sp, 0x30
/* 1CFD8 80041BD8 AFA20014 */ sw $v0, 0x14($sp)
/* 1CFDC 80041BDC 4406D000 */ mfc1 $a2, $f26
/* 1CFE0 80041BE0 27A20034 */ addiu $v0, $sp, 0x34
/* 1CFE4 80041BE4 0C00B94E */ jal get_screen_coords
/* 1CFE8 80041BE8 AFA20018 */ sw $v0, 0x18($sp)
/* 1CFEC 80041BEC 0000202D */ daddu $a0, $zero, $zero
/* 1CFF0 80041BF0 0080282D */ daddu $a1, $a0, $zero
/* 1CFF4 80041BF4 8FA60020 */ lw $a2, 0x20($sp)
/* 1CFF8 80041BF8 8FA8002C */ lw $t0, 0x2C($sp)
/* 1CFFC 80041BFC 8FA70024 */ lw $a3, 0x24($sp)
/* 1D000 80041C00 8FA30030 */ lw $v1, 0x30($sp)
/* 1D004 80041C04 00C83023 */ subu $a2, $a2, $t0
/* 1D008 80041C08 000617C2 */ srl $v0, $a2, 31
/* 1D00C 80041C0C 00C23021 */ addu $a2, $a2, $v0
/* 1D010 80041C10 00063043 */ sra $a2, $a2, 1
/* 1D014 80041C14 00C83021 */ addu $a2, $a2, $t0
/* 1D018 80041C18 00E33823 */ subu $a3, $a3, $v1
/* 1D01C 80041C1C 000717C2 */ srl $v0, $a3, 31
/* 1D020 80041C20 00E23821 */ addu $a3, $a3, $v0
/* 1D024 80041C24 00073843 */ sra $a3, $a3, 1
.L80041C28:
/* 1D028 80041C28 0C04DF93 */ jal set_screen_overlay_center
/* 1D02C 80041C2C 00E33821 */ addu $a3, $a3, $v1
.L80041C30:
/* 1D030 80041C30 8FBF0040 */ lw $ra, 0x40($sp)
/* 1D034 80041C34 8FB1003C */ lw $s1, 0x3C($sp)
/* 1D038 80041C38 8FB00038 */ lw $s0, 0x38($sp)
/* 1D03C 80041C3C D7BE0070 */ ldc1 $f30, 0x70($sp)
/* 1D040 80041C40 D7BC0068 */ ldc1 $f28, 0x68($sp)
/* 1D044 80041C44 D7BA0060 */ ldc1 $f26, 0x60($sp)
/* 1D048 80041C48 D7B80058 */ ldc1 $f24, 0x58($sp)
/* 1D04C 80041C4C D7B60050 */ ldc1 $f22, 0x50($sp)
/* 1D050 80041C50 D7B40048 */ ldc1 $f20, 0x48($sp)
/* 1D054 80041C54 03E00008 */ jr $ra
/* 1D058 80041C58 27BD0078 */ addiu $sp, $sp, 0x78
### DECOMPILED C INSTRUCTIONS:
void draw_encounters_pre_battle(void) {
EncounterStatus* encounter = &gCurrentEncounter;
Npc* npc = get_npc_unsafe(encounter->currentEnemy->npcID);
PlayerStatus* playerStatus = &gPlayerStatus;
if (encounter->unk_94 != 0) {
f32 playerX, playerY, playerZ;
f32 otherX, otherY, otherZ;
s32 pScreenX, pScreenY, pScreenZ;
s32 oScreenX, oScreenY, oScreenZ;
if (encounter->fadeOutAmount != 255) {
encounter->fadeOutAccel++;
if (encounter->fadeOutAccel > 10) {
encounter->fadeOutAccel = 10;
}
encounter->fadeOutAmount += encounter->fadeOutAccel;
if (encounter->fadeOutAmount > 255) {
encounter->fadeOutAmount = 255;
}
playerX = playerStatus->position.x;
playerY = playerStatus->position.y;
playerZ = playerStatus->position.z;
otherX = npc->pos.x;
otherY = npc->pos.y;
otherZ = npc->pos.z;
if (otherY < -990.0f) {
otherX = playerX;
otherY = playerY;
otherZ = playerZ;
}
if (gGameStatusPtr->demoState == DEMO_STATE_CHANGE_MAP) {
set_screen_overlay_params_back(OVERLAY_START_BATTLE, encounter->fadeOutAmount);
set_screen_overlay_alpha(SCREEN_LAYER_BACK, 255.0f);
set_screen_overlay_color(SCREEN_LAYER_BACK, 0, 0, 0);
get_screen_coords(gCurrentCameraID, playerX, playerY + 20.0f, playerZ, &pScreenX, &pScreenY, &pScreenZ);
get_screen_coords(gCurrentCameraID, otherX, otherY + 15.0f, otherZ, &oScreenX, &oScreenY, &oScreenZ);
set_screen_overlay_center(SCREEN_LAYER_BACK, 0, (pScreenX - oScreenX) / 2 + oScreenX,
(pScreenY - oScreenY) / 2 + oScreenY);
} else {
set_screen_overlay_params_front(OVERLAY_START_BATTLE, encounter->fadeOutAmount);
set_screen_overlay_alpha(SCREEN_LAYER_FRONT, 255.0f);
set_screen_overlay_color(SCREEN_LAYER_FRONT, 0, 0, 0);
get_screen_coords(gCurrentCameraID, playerX, playerY + 20.0f, playerZ, &pScreenX, &pScreenY, &pScreenZ);
get_screen_coords(gCurrentCameraID, otherX, otherY + 15.0f, otherZ, &oScreenX, &oScreenY, &oScreenZ);
set_screen_overlay_center(SCREEN_LAYER_FRONT, 0, (pScreenX - oScreenX) / 2 + oScreenX,
(pScreenY - oScreenY) / 2 + oScreenY);
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel parasol_get_npc
/* E27C90 802B6000 27BDFFD0 */ addiu $sp, $sp, -0x30
/* E27C94 802B6004 AFB00020 */ sw $s0, 0x20($sp)
/* E27C98 802B6008 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* E27C9C 802B600C 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* E27CA0 802B6010 AFBF0028 */ sw $ra, 0x28($sp)
/* E27CA4 802B6014 AFB10024 */ sw $s1, 0x24($sp)
.L802B6018:
/* E27CA8 802B6018 8E020000 */ lw $v0, 0x0($s0)
/* E27CAC 802B601C 04410048 */ bgez $v0, .L802B6140
/* E27CB0 802B6020 0200882D */ daddu $s1, $s0, $zero
/* E27CB4 802B6024 3C037FFF */ lui $v1, (0x7FFFFFFF >> 16)
/* E27CB8 802B6028 3463FFFF */ ori $v1, $v1, (0x7FFFFFFF & 0xFFFF)
/* E27CBC 802B602C 3C040001 */ lui $a0, (0x10019 >> 16)
/* E27CC0 802B6030 00431824 */ and $v1, $v0, $v1
/* E27CC4 802B6034 8E020004 */ lw $v0, 0x4($s0)
/* E27CC8 802B6038 34840019 */ ori $a0, $a0, (0x10019 & 0xFFFF)
/* E27CCC 802B603C AE030000 */ sw $v1, 0x0($s0)
.L802B6040:
/* E27CD0 802B6040 34630808 */ ori $v1, $v1, 0x808
.L802B6044:
/* E27CD4 802B6044 AE030000 */ sw $v1, 0x0($s0)
glabel action_hammer_play_hit_fx
/* E27CD8 802B6048 34420004 */ ori $v0, $v0, 0x4
.L802B604C:
/* E27CDC 802B604C 0C037FDE */ jal suggest_player_anim_always_forward
.L802B6050:
/* E27CE0 802B6050 AE020004 */ sw $v0, 0x4($s0)
/* E27CE4 802B6054 C60C0028 */ lwc1 $f12, 0x28($s0)
.L802B6058:
/* E27CE8 802B6058 C60E0030 */ lwc1 $f14, 0x30($s0)
/* E27CEC 802B605C 3C014192 */ lui $at, (0x4192C745 >> 16)
glabel action_update_sliding
/* E27CF0 802B6060 3421C745 */ ori $at, $at, (0x4192C745 & 0xFFFF)
/* E27CF4 802B6064 44811000 */ mtc1 $at, $f2
.L802B6068:
/* E27CF8 802B6068 3C01C06F */ lui $at, (0xC06F3B64 >> 16)
/* E27CFC 802B606C 34213B64 */ ori $at, $at, (0xC06F3B64 & 0xFFFF)
/* E27D00 802B6070 44812000 */ mtc1 $at, $f4
.L802B6074:
/* E27D04 802B6074 3C013F4E */ lui $at, (0x3F4E4F76 >> 16)
/* E27D08 802B6078 34214F76 */ ori $at, $at, (0x3F4E4F76 & 0xFFFF)
glabel .L802B607C
/* E27D0C 802B607C 44813000 */ mtc1 $at, $f6
.L802B6080:
/* E27D10 802B6080 86020016 */ lh $v0, 0x16($s0)
/* E27D14 802B6084 3C01BDCA */ lui $at, (0xBDCA233A >> 16)
/* E27D18 802B6088 3421233A */ ori $at, $at, (0xBDCA233A & 0xFFFF)
.L802B608C:
/* E27D1C 802B608C 44810000 */ mtc1 $at, $f0
.L802B6090:
/* E27D20 802B6090 8604001A */ lh $a0, 0x1A($s0)
.L802B6094:
/* E27D24 802B6094 3C03800B */ lui $v1, %hi(gCameras)
/* E27D28 802B6098 24631D80 */ addiu $v1, $v1, %lo(gCameras)
glabel action_update_state_23
/* E27D2C 802B609C A20000B6 */ sb $zero, 0xB6($s0)
/* E27D30 802B60A0 44824000 */ mtc1 $v0, $f8
glabel action_update_use_spinning_flower
/* E27D34 802B60A4 00000000 */ nop
.L802B60A8:
/* E27D38 802B60A8 46804220 */ cvt.s.w $f8, $f8
.L802B60AC:
/* E27D3C 802B60AC 44064000 */ mfc1 $a2, $f8
/* E27D40 802B60B0 44844000 */ mtc1 $a0, $f8
glabel action_update_jump
/* E27D44 802B60B4 00000000 */ nop
/* E27D48 802B60B8 46804220 */ cvt.s.w $f8, $f8
/* E27D4C 802B60BC E6020070 */ swc1 $f2, 0x70($s0)
/* E27D50 802B60C0 E6040074 */ swc1 $f4, 0x74($s0)
/* E27D54 802B60C4 E6060078 */ swc1 $f6, 0x78($s0)
.L802B60C8:
/* E27D58 802B60C8 E600007C */ swc1 $f0, 0x7C($s0)
/* E27D5C 802B60CC 94620002 */ lhu $v0, 0x2($v1)
glabel .L802B60D0
/* E27D60 802B60D0 44074000 */ mfc1 $a3, $f8
.L802B60D4:
/* E27D64 802B60D4 34420001 */ ori $v0, $v0, 0x1
/* E27D68 802B60D8 0C00A720 */ jal atan2
/* E27D6C 802B60DC A4620002 */ sh $v0, 0x2($v1)
/* E27D70 802B60E0 86020016 */ lh $v0, 0x16($s0)
/* E27D74 802B60E4 8603001A */ lh $v1, 0x1A($s0)
.L802B60E8:
/* E27D78 802B60E8 3C01802B */ lui $at, %hi(jtbl_802B62B0)
.L802B60EC:
/* E27D7C 802B60EC E42062B0 */ swc1 $f0, %lo(jtbl_802B62B0)($at)
.L802B60F0:
/* E27D80 802B60F0 44826000 */ mtc1 $v0, $f12
glabel .L802B60F4
/* E27D84 802B60F4 00000000 */ nop
/* E27D88 802B60F8 46806320 */ cvt.s.w $f12, $f12
/* E27D8C 802B60FC 44837000 */ mtc1 $v1, $f14
.L802B6100:
/* E27D90 802B6100 00000000 */ nop
.L802B6104:
/* E27D94 802B6104 0C038022 */ jal get_xz_dist_to_player
.L802B6108:
/* E27D98 802B6108 468073A0 */ cvt.s.w $f14, $f14
glabel .L802B610C
/* E27D9C 802B610C 3C014190 */ lui $at, (0x41900000 >> 16)
.L802B6110:
/* E27DA0 802B6110 44811000 */ mtc1 $at, $f2
/* E27DA4 802B6114 24040001 */ addiu $a0, $zero, 0x1
.L802B6118:
/* E27DA8 802B6118 46020003 */ div.s $f0, $f0, $f2
/* E27DAC 802B611C 0C03A8CD */ jal subtract_hp
glabel action_update_parasol
/* E27DB0 802B6120 E6000054 */ swc1 $f0, 0x54($s0)
.L802B6124:
/* E27DB4 802B6124 0C03A5D8 */ jal open_status_bar_long
.L802B6128:
/* E27DB8 802B6128 00000000 */ nop
/* E27DBC 802B612C 3C03800A */ lui $v1, %hi(gOverrideFlags)
/* E27DC0 802B6130 2463A650 */ addiu $v1, $v1, %lo(gOverrideFlags)
glabel .L802B6134
/* E27DC4 802B6134 8C620000 */ lw $v0, 0x0($v1)
/* E27DC8 802B6138 34420040 */ ori $v0, $v0, 0x40
.L802B613C:
/* E27DCC 802B613C AC620000 */ sw $v0, 0x0($v1)
.L802B6140:
/* E27DD0 802B6140 3C01802B */ lui $at, %hi(jtbl_802B62B0)
.L802B6144:
/* E27DD4 802B6144 C42C62B0 */ lwc1 $f12, %lo(jtbl_802B62B0)($at)
/* E27DD8 802B6148 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
.L802B614C:
/* E27DDC 802B614C 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
.L802B6150:
/* E27DE0 802B6150 44810000 */ mtc1 $at, $f0
.L802B6154:
/* E27DE4 802B6154 00000000 */ nop
.L802B6158:
/* E27DE8 802B6158 46006302 */ mul.s $f12, $f12, $f0
.L802B615C:
/* E27DEC 802B615C 00000000 */ nop
/* E27DF0 802B6160 27A50010 */ addiu $a1, $sp, 0x10
.L802B6164:
/* E27DF4 802B6164 3C0143B4 */ lui $at, (0x43B40000 >> 16)
.L802B6168:
/* E27DF8 802B6168 44810000 */ mtc1 $at, $f0
/* E27DFC 802B616C 27A60014 */ addiu $a2, $sp, 0x14
glabel .L802B6170
/* E27E00 802B6170 0C00A82D */ jal sin_cos_rad
glabel .L802B6174
/* E27E04 802B6174 46006303 */ div.s $f12, $f12, $f0
/* E27E08 802B6178 3C030004 */ lui $v1, (0x40000 >> 16)
.L802B617C:
/* E27E0C 802B617C 8E020000 */ lw $v0, 0x0($s0)
.L802B6180:
/* E27E10 802B6180 C6060054 */ lwc1 $f6, 0x54($s0)
glabel .L802B6184
/* E27E14 802B6184 00431024 */ and $v0, $v0, $v1
.L802B6188:
/* E27E18 802B6188 10400008 */ beqz $v0, .L802B61AC
.L802B618C:
/* E27E1C 802B618C 00000000 */ nop
.L802B6190:
/* E27E20 802B6190 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
.L802B6194:
/* E27E24 802B6194 44811800 */ mtc1 $at, $f3
glabel func_802B6198
/* E27E28 802B6198 44801000 */ mtc1 $zero, $f2
/* E27E2C 802B619C 46003021 */ cvt.d.s $f0, $f6
.L802B61A0:
/* E27E30 802B61A0 46220002 */ mul.d $f0, $f0, $f2
.L802B61A4:
/* E27E34 802B61A4 00000000 */ nop
.L802B61A8:
/* E27E38 802B61A8 462001A0 */ cvt.s.d $f6, $f0
.L802B61AC:
/* E27E3C 802B61AC C7A00010 */ lwc1 $f0, 0x10($sp)
.L802B61B0:
/* E27E40 802B61B0 46003002 */ mul.s $f0, $f6, $f0
.L802B61B4:
/* E27E44 802B61B4 00000000 */ nop
/* E27E48 802B61B8 C7A40014 */ lwc1 $f4, 0x14($sp)
/* E27E4C 802B61BC 46043102 */ mul.s $f4, $f6, $f4
glabel func_802B61C0
/* E27E50 802B61C0 00000000 */ nop
/* E27E54 802B61C4 C6020028 */ lwc1 $f2, 0x28($s0)
.L802B61C8:
/* E27E58 802B61C8 46001080 */ add.s $f2, $f2, $f0
.L802B61CC:
/* E27E5C 802B61CC C6000030 */ lwc1 $f0, 0x30($s0)
/* E27E60 802B61D0 820200B6 */ lb $v0, 0xB6($s0)
.L802B61D4:
/* E27E64 802B61D4 46040001 */ sub.s $f0, $f0, $f4
.L802B61D8:
/* E27E68 802B61D8 E6020028 */ swc1 $f2, 0x28($s0)
.L802B61DC:
/* E27E6C 802B61DC 14400012 */ bnez $v0, .L802B6228
/* E27E70 802B61E0 E6000030 */ swc1 $f0, 0x30($s0)
glabel func_802B61E4
/* E27E74 802B61E4 0C038D12 */ jal integrate_gravity
.L802B61E8:
/* E27E78 802B61E8 00000000 */ nop
.L802B61EC:
/* E27E7C 802B61EC C600002C */ lwc1 $f0, 0x2C($s0)
.L802B61F0:
/* E27E80 802B61F0 C6040070 */ lwc1 $f4, 0x70($s0)
.L802B61F4:
/* E27E84 802B61F4 46040000 */ add.s $f0, $f0, $f4
.L802B61F8:
/* E27E88 802B61F8 44801000 */ mtc1 $zero, $f2
.L802B61FC:
/* E27E8C 802B61FC 00000000 */ nop
.L802B6200:
/* E27E90 802B6200 4602203C */ c.lt.s $f4, $f2
.L802B6204:
/* E27E94 802B6204 00000000 */ nop
glabel .L802B6208
/* E27E98 802B6208 45000021 */ bc1f .L802B6290
/* E27E9C 802B620C E600002C */ swc1 $f0, 0x2C($s0)
.L802B6210:
/* E27EA0 802B6210 8E020000 */ lw $v0, 0x0($s0)
.L802B6214:
/* E27EA4 802B6214 24030001 */ addiu $v1, $zero, 0x1
glabel .L802B6218
/* E27EA8 802B6218 A20300B6 */ sb $v1, 0xB6($s0)
/* E27EAC 802B621C 34420004 */ ori $v0, $v0, 0x4
.L802B6220:
/* E27EB0 802B6220 080AD8A4 */ j .L802B6290
.L802B6224:
/* E27EB4 802B6224 AE020000 */ sw $v0, 0x0($s0)
glabel .L802B6228
/* E27EB8 802B6228 0C038D36 */ jal func_800E34D8
.L802B622C:
/* E27EBC 802B622C 00000000 */ nop
glabel action_update_step_up_peach
/* E27EC0 802B6230 46000306 */ mov.s $f12, $f0
/* E27EC4 802B6234 0C038D45 */ jal player_check_collision_below
glabel .L802B6238
/* E27EC8 802B6238 27A50018 */ addiu $a1, $sp, 0x18
glabel .L802B623C
/* E27ECC 802B623C 8FA40018 */ lw $a0, 0x18($sp)
glabel .L802B6240
/* E27ED0 802B6240 04800013 */ bltz $a0, .L802B6290
glabel .L802B6244
/* E27ED4 802B6244 E620002C */ swc1 $f0, 0x2C($s1)
glabel .L802B6248
/* E27ED8 802B6248 0C016F6A */ jal get_collider_flags
/* E27EDC 802B624C 00000000 */ nop
glabel .L802B6250
/* E27EE0 802B6250 2404000A */ addiu $a0, $zero, 0xA
.L802B6254:
/* E27EE4 802B6254 0C039769 */ jal set_action_state
glabel .L802B6258
/* E27EE8 802B6258 AFA20018 */ sw $v0, 0x18($sp)
.L802B625C:
/* E27EEC 802B625C 2402003C */ addiu $v0, $zero, 0x3C
/* E27EF0 802B6260 2403F7FF */ addiu $v1, $zero, -0x801
/* E27EF4 802B6264 A6220010 */ sh $v0, 0x10($s1)
.L802B6268:
/* E27EF8 802B6268 8E220000 */ lw $v0, 0x0($s1)
.L802B626C:
/* E27EFC 802B626C 3C04800A */ lui $a0, %hi(gOverrideFlags)
/* E27F00 802B6270 2484A650 */ addiu $a0, $a0, %lo(gOverrideFlags)
.L802B6274:
/* E27F04 802B6274 A22000BF */ sb $zero, 0xBF($s1)
glabel .L802B6278
/* E27F08 802B6278 00431024 */ and $v0, $v0, $v1
/* E27F0C 802B627C AE220000 */ sw $v0, 0x0($s1)
.L802B6280:
/* E27F10 802B6280 8C820000 */ lw $v0, 0x0($a0)
.L802B6284:
/* E27F14 802B6284 2403FFBF */ addiu $v1, $zero, -0x41
glabel action_update_run
/* E27F18 802B6288 00431024 */ and $v0, $v0, $v1
/* E27F1C 802B628C AC820000 */ sw $v0, 0x0($a0)
.L802B6290:
/* E27F20 802B6290 8FBF0028 */ lw $ra, 0x28($sp)
glabel func_802B6294
/* E27F24 802B6294 8FB10024 */ lw $s1, 0x24($sp)
glabel .L802B6298
/* E27F28 802B6298 8FB00020 */ lw $s0, 0x20($sp)
/* E27F2C 802B629C 03E00008 */ jr $ra
/* E27F30 802B62A0 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void action_update_hit_fire(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 dx, dy;
f32 speed;
static f32 ReturnAngle;
if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
playerStatus->animFlags |= PA_FLAG_INTERRUPT_USE_PARTNER;
playerStatus->flags |= (PS_FLAG_HIT_FIRE | PS_FLAG_FLYING);
suggest_player_anim_always_forward(ANIM_Mario1_TouchedFire);
playerStatus->actionSubstate = SUBSTATE_FLYING;
playerStatus->gravityIntegrator[0] = 18.3473f;
playerStatus->gravityIntegrator[1] = -3.738f;
playerStatus->gravityIntegrator[2] = 0.8059f;
playerStatus->gravityIntegrator[3] = -0.0987f;
gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y;
ReturnAngle = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z);
playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f;
subtract_hp(1);
open_status_bar_long();
gOverrideFlags |= GLOBAL_OVERRIDES_40;
}
sin_cos_rad(DEG_TO_RAD(ReturnAngle), &dx, &dy);
speed = playerStatus->currentSpeed;
if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
speed *= 0.5;
}
playerStatus->position.x += speed * dx;
playerStatus->position.z -= speed * dy;
if (playerStatus->actionSubstate == SUBSTATE_FLYING) {
integrate_gravity();
playerStatus->position.y += playerStatus->gravityIntegrator[0];
if (playerStatus->gravityIntegrator[0] < 0.0f) {
playerStatus->actionSubstate = SUBSTATE_FALLING;
playerStatus->flags |= PS_FLAG_FALLING;
}
} else {
s32 colliderID;
playerStatus->position.y = player_check_collision_below(player_fall_distance(), &colliderID);
if (colliderID >= 0) {
colliderID = get_collider_flags(colliderID); //TODO surfaceType
set_action_state(ACTION_STATE_LAND);
playerStatus->blinkTimer = 60;
playerStatus->hazardType = HAZARD_TYPE_NONE;
playerStatus->flags &= ~PS_FLAG_HIT_FIRE;
gOverrideFlags &= ~GLOBAL_OVERRIDES_40;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel interact_speech_update
/* E212DC 802B742C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* E212E0 802B7430 3C020204 */ lui $v0, (0x2040020 >> 16)
/* E212E4 802B7434 AFB00010 */ sw $s0, 0x10($sp)
.L802B7438:
/* E212E8 802B7438 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* E212EC 802B743C 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
.L802B7440:
/* E212F0 802B7440 AFBF0014 */ sw $ra, 0x14($sp)
.L802B7444:
/* E212F4 802B7444 8E030000 */ lw $v1, 0x0($s0)
/* E212F8 802B7448 34420020 */ ori $v0, $v0, (0x2040020 & 0xFFFF)
/* E212FC 802B744C 00621824 */ and $v1, $v1, $v0
glabel should_continue_inspect
/* E21300 802B7450 3C020200 */ lui $v0, (0x2000000 >> 16)
/* E21304 802B7454 14620010 */ bne $v1, $v0, .L802B7498
/* E21308 802B7458 240600FF */ addiu $a2, $zero, 0xFF
/* E2130C 802B745C 3C03800A */ lui $v1, %hi(gEncounterState)
.L802B7460:
/* E21310 802B7460 8C63A600 */ lw $v1, %lo(gEncounterState)($v1)
.L802B7464:
/* E21314 802B7464 24020004 */ addiu $v0, $zero, 0x4
/* E21318 802B7468 1062000B */ beq $v1, $v0, .L802B7498
/* E2131C 802B746C 00000000 */ nop
/* E21320 802B7470 8E030004 */ lw $v1, 0x4($s0)
/* E21324 802B7474 30620001 */ andi $v0, $v1, 0x1
.L802B7478:
/* E21328 802B7478 14400007 */ bnez $v0, .L802B7498
/* E2132C 802B747C 00000000 */ nop
/* E21330 802B7480 82020015 */ lb $v0, 0x15($s0)
/* E21334 802B7484 14400004 */ bnez $v0, .L802B7498
/* E21338 802B7488 3C020001 */ lui $v0, (0x10000 >> 16)
/* E2133C 802B748C 00621024 */ and $v0, $v1, $v0
/* E21340 802B7490 10400005 */ beqz $v0, .L802B74A8
/* E21344 802B7494 00000000 */ nop
.L802B7498:
/* E21348 802B7498 3C03802B */ lui $v1, %hi(D_802B79A8)
/* E2134C 802B749C 8C6379A8 */ lw $v1, %lo(D_802B79A8)($v1)
/* E21350 802B74A0 24020003 */ addiu $v0, $zero, 0x3
/* E21354 802B74A4 A062002A */ sb $v0, 0x2A($v1)
.L802B74A8:
/* E21358 802B74A8 3C03802B */ lui $v1, %hi(D_802B79A8)
/* E2135C 802B74AC 246379A8 */ addiu $v1, $v1, %lo(D_802B79A8)
.L802B74B0:
/* E21360 802B74B0 8C640000 */ lw $a0, 0x0($v1)
/* E21364 802B74B4 9085002A */ lbu $a1, 0x2A($a0)
/* E21368 802B74B8 24020001 */ addiu $v0, $zero, 0x1
/* E2136C 802B74BC 10A20026 */ beq $a1, $v0, .L802B7558
/* E21370 802B74C0 28A20002 */ slti $v0, $a1, 0x2
/* E21374 802B74C4 10400005 */ beqz $v0, .L802B74DC
glabel .L802B74C8
/* E21378 802B74C8 24020002 */ addiu $v0, $zero, 0x2
/* E2137C 802B74CC 10A00009 */ beqz $a1, .L802B74F4
.L802B74D0:
/* E21380 802B74D0 00000000 */ nop
.L802B74D4:
/* E21384 802B74D4 080ADDA0 */ j .L802B7680
/* E21388 802B74D8 00000000 */ nop
.L802B74DC:
/* E2138C 802B74DC 10A20027 */ beq $a1, $v0, func_802B757C
.L802B74E0:
/* E21390 802B74E0 24020003 */ addiu $v0, $zero, 0x3
/* E21394 802B74E4 10A20033 */ beq $a1, $v0, .L802B75B4
/* E21398 802B74E8 00000000 */ nop
/* E2139C 802B74EC 080ADDA0 */ j .L802B7680
glabel pulse_stone_notification_update
/* E213A0 802B74F0 00000000 */ nop
.L802B74F4:
/* E213A4 802B74F4 C4800014 */ lwc1 $f0, 0x14($a0)
/* E213A8 802B74F8 3C01802B */ lui $at, %hi(D_802B79B0)
/* E213AC 802B74FC D42279B0 */ ldc1 $f2, %lo(D_802B79B0)($at)
/* E213B0 802B7500 3C01802B */ lui $at, %hi(D_802B79B8)
/* E213B4 802B7504 D42479B8 */ ldc1 $f4, %lo(D_802B79B8)($at)
/* E213B8 802B7508 46000021 */ cvt.d.s $f0, $f0
.L802B750C:
/* E213BC 802B750C 46220000 */ add.d $f0, $f0, $f2
/* E213C0 802B7510 AC800010 */ sw $zero, 0x10($a0)
/* E213C4 802B7514 46200020 */ cvt.s.d $f0, $f0
/* E213C8 802B7518 460000A1 */ cvt.d.s $f2, $f0
/* E213CC 802B751C 4622203E */ c.le.d $f4, $f2
.L802B7520:
/* E213D0 802B7520 00000000 */ nop
.L802B7524:
/* E213D4 802B7524 45000056 */ bc1f .L802B7680
.L802B7528:
/* E213D8 802B7528 E4800014 */ swc1 $f0, 0x14($a0)
/* E213DC 802B752C 9082002A */ lbu $v0, 0x2A($a0)
/* E213E0 802B7530 3C013F0C */ lui $at, (0x3F0CCCCD >> 16)
/* E213E4 802B7534 3421CCCD */ ori $at, $at, (0x3F0CCCCD & 0xFFFF)
/* E213E8 802B7538 44810000 */ mtc1 $at, $f0
/* E213EC 802B753C 24420001 */ addiu $v0, $v0, 0x1
/* E213F0 802B7540 E4800014 */ swc1 $f0, 0x14($a0)
.L802B7544:
/* E213F4 802B7544 A082002A */ sb $v0, 0x2A($a0)
/* E213F8 802B7548 8C630000 */ lw $v1, 0x0($v1)
/* E213FC 802B754C 2402000C */ addiu $v0, $zero, 0xC
/* E21400 802B7550 080ADDA0 */ j .L802B7680
/* E21404 802B7554 AC620020 */ sw $v0, 0x20($v1)
.L802B7558:
/* E21408 802B7558 8C820020 */ lw $v0, 0x20($a0)
/* E2140C 802B755C AC800010 */ sw $zero, 0x10($a0)
/* E21410 802B7560 2442FFFF */ addiu $v0, $v0, -0x1
.L802B7564:
/* E21414 802B7564 1C400046 */ bgtz $v0, .L802B7680
.L802B7568:
/* E21418 802B7568 AC820020 */ sw $v0, 0x20($a0)
.L802B756C:
/* E2141C 802B756C 9082002A */ lbu $v0, 0x2A($a0)
/* E21420 802B7570 24420001 */ addiu $v0, $v0, 0x1
/* E21424 802B7574 080ADDA0 */ j .L802B7680
/* E21428 802B7578 A082002A */ sb $v0, 0x2A($a0)
glabel func_802B757C
/* E2142C 802B757C C48C0010 */ lwc1 $f12, 0x10($a0)
ispy_icon_img:
/* E21430 802B7580 3C014120 */ lui $at, (0x41200000 >> 16)
/* E21434 802B7584 44810000 */ mtc1 $at, $f0
/* E21438 802B7588 00000000 */ nop
/* E2143C 802B758C 46006300 */ add.s $f12, $f12, $f0
glabel .L802B7590
/* E21440 802B7590 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* E21444 802B7594 44810000 */ mtc1 $at, $f0
/* E21448 802B7598 00000000 */ nop
/* E2144C 802B759C 460C003E */ c.le.s $f0, $f12
/* E21450 802B75A0 00000000 */ nop
/* E21454 802B75A4 45030001 */ bc1tl .L802B75AC
/* E21458 802B75A8 46006301 */ sub.s $f12, $f12, $f0
.L802B75AC:
/* E2145C 802B75AC 080ADD9D */ j .L802B7674
/* E21460 802B75B0 E48C0010 */ swc1 $f12, 0x10($a0)
.L802B75B4:
/* E21464 802B75B4 C48C0010 */ lwc1 $f12, 0x10($a0)
.L802B75B8:
/* E21468 802B75B8 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* E2146C 802B75BC 44810000 */ mtc1 $at, $f0
/* E21470 802B75C0 00000000 */ nop
/* E21474 802B75C4 46006300 */ add.s $f12, $f12, $f0
.L802B75C8:
/* E21478 802B75C8 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* E2147C 802B75CC 44810000 */ mtc1 $at, $f0
.L802B75D0:
/* E21480 802B75D0 00000000 */ nop
/* E21484 802B75D4 460C003E */ c.le.s $f0, $f12
/* E21488 802B75D8 00000000 */ nop
/* E2148C 802B75DC 45030001 */ bc1tl .L802B75E4
/* E21490 802B75E0 46006301 */ sub.s $f12, $f12, $f0
.L802B75E4:
/* E21494 802B75E4 3C01428C */ lui $at, (0x428C0000 >> 16)
glabel func_802B75E8
/* E21498 802B75E8 44810000 */ mtc1 $at, $f0
/* E2149C 802B75EC 00000000 */ nop
/* E214A0 802B75F0 460C003E */ c.le.s $f0, $f12
/* E214A4 802B75F4 00000000 */ nop
.L802B75F8:
/* E214A8 802B75F8 45000008 */ bc1f .L802B761C
/* E214AC 802B75FC E48C0010 */ swc1 $f12, 0x10($a0)
/* E214B0 802B7600 3C0142DC */ lui $at, (0x42DC0000 >> 16)
/* E214B4 802B7604 44810000 */ mtc1 $at, $f0
/* E214B8 802B7608 00000000 */ nop
/* E214BC 802B760C 4600603E */ c.le.s $f12, $f0
.L802B7610:
/* E214C0 802B7610 00000000 */ nop
/* E214C4 802B7614 4501000F */ bc1t .L802B7654
/* E214C8 802B7618 00000000 */ nop
.L802B761C:
/* E214CC 802B761C 3C01437A */ lui $at, (0x437A0000 >> 16)
/* E214D0 802B7620 44810000 */ mtc1 $at, $f0
.L802B7624:
/* E214D4 802B7624 00000000 */ nop
/* E214D8 802B7628 460C003E */ c.le.s $f0, $f12
.L802B762C:
/* E214DC 802B762C 00000000 */ nop
/* E214E0 802B7630 45000010 */ bc1f .L802B7674
.L802B7634:
/* E214E4 802B7634 00000000 */ nop
/* E214E8 802B7638 3C014391 */ lui $at, (0x43910000 >> 16)
/* E214EC 802B763C 44810000 */ mtc1 $at, $f0
D_802B7640:
/* E214F0 802B7640 00000000 */ nop
/* E214F4 802B7644 4600603E */ c.le.s $f12, $f0
/* E214F8 802B7648 00000000 */ nop
/* E214FC 802B764C 45000009 */ bc1f .L802B7674
/* E21500 802B7650 00000000 */ nop
.L802B7654:
/* E21504 802B7654 8E020004 */ lw $v0, 0x4($s0)
/* E21508 802B7658 2403FFDF */ addiu $v1, $zero, -0x21
/* E2150C 802B765C 3C018011 */ lui $at, %hi(TalkNotificationCallback)
/* E21510 802B7660 AC20C940 */ sw $zero, %lo(TalkNotificationCallback)($at)
/* E21514 802B7664 AE0000C8 */ sw $zero, 0xC8($s0)
/* E21518 802B7668 00431024 */ and $v0, $v0, $v1
/* E2151C 802B766C 080ADDBE */ j .L802B76F8
/* E21520 802B7670 AE020004 */ sw $v0, 0x4($s0)
.L802B7674:
/* E21524 802B7674 0C0ADC00 */ jal appendGfx_ispy_icon
/* E21528 802B7678 00000000 */ nop
/* E2152C 802B767C 0040302D */ daddu $a2, $v0, $zero
.L802B7680:
/* E21530 802B7680 3C04802B */ lui $a0, %hi(D_802B79A8)
/* E21534 802B7684 248479A8 */ addiu $a0, $a0, %lo(D_802B79A8)
/* E21538 802B7688 8C820000 */ lw $v0, 0x0($a0)
/* E2153C 802B768C A046002B */ sb $a2, 0x2B($v0)
/* E21540 802B7690 8E0300C8 */ lw $v1, 0xC8($s0)
/* E21544 802B7694 10600005 */ beqz $v1, .L802B76AC
/* E21548 802B7698 00000000 */ nop
/* E2154C 802B769C 8C840000 */ lw $a0, 0x0($a0)
/* E21550 802B76A0 8C820000 */ lw $v0, 0x0($a0)
/* E21554 802B76A4 54620001 */ bnel $v1, $v0, .L802B76AC
/* E21558 802B76A8 AC830000 */ sw $v1, 0x0($a0)
.L802B76AC:
/* E2155C 802B76AC 3C03802B */ lui $v1, %hi(D_802B79A8)
/* E21560 802B76B0 8C6379A8 */ lw $v1, %lo(D_802B79A8)($v1)
/* E21564 802B76B4 8C640000 */ lw $a0, 0x0($v1)
/* E21568 802B76B8 848200A8 */ lh $v0, 0xA8($a0)
/* E2156C 802B76BC C480003C */ lwc1 $f0, 0x3C($a0)
/* E21570 802B76C0 44821000 */ mtc1 $v0, $f2
/* E21574 802B76C4 00000000 */ nop
/* E21578 802B76C8 468010A0 */ cvt.s.w $f2, $f2
/* E2157C 802B76CC 46020000 */ add.s $f0, $f0, $f2
/* E21580 802B76D0 3C014100 */ lui $at, (0x41000000 >> 16)
/* E21584 802B76D4 44811000 */ mtc1 $at, $f2
/* E21588 802B76D8 00000000 */ nop
/* E2158C 802B76DC 46020000 */ add.s $f0, $f0, $f2
/* E21590 802B76E0 E460001C */ swc1 $f0, 0x1C($v1)
/* E21594 802B76E4 E4600008 */ swc1 $f0, 0x8($v1)
/* E21598 802B76E8 C4800038 */ lwc1 $f0, 0x38($a0)
/* E2159C 802B76EC E4600004 */ swc1 $f0, 0x4($v1)
/* E215A0 802B76F0 C4800040 */ lwc1 $f0, 0x40($a0)
.L802B76F4:
/* E215A4 802B76F4 E460000C */ swc1 $f0, 0xC($v1)
.L802B76F8:
/* E215A8 802B76F8 8FBF0014 */ lw $ra, 0x14($sp)
/* E215AC 802B76FC 8FB00010 */ lw $s0, 0x10($sp)
/* E215B0 802B7700 03E00008 */ jr $ra
/* E215B4 802B7704 27BD0018 */ addiu $sp, $sp, 0x18
/* E215B8 802B7708 00000000 */ nop
/* E215BC 802B770C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void interact_speech_update(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
s32 brightness = 255;
f32 yaw;
Npc* npc;
if (((playerStatus->flags & (PS_FLAG_HAS_CONVERSATION_NPC | PS_FLAG_ENTERING_BATTLE | PS_FLAG_PAUSED))
!= PS_FLAG_HAS_CONVERSATION_NPC)
|| gEncounterState == ENCOUNTER_STATE_CONVERSATION
|| playerStatus->animFlags & PA_FLAG_USING_WATT
|| playerStatus->inputDisabledCount != 0
|| playerStatus->animFlags & PA_FLAG_SPINNING
) {
SpeechBubblePtr->state = 3;
}
switch (SpeechBubblePtr->state) {
case SPEECH_BUBBLE_APPEAR:
SpeechBubblePtr->yaw = 0.0f;
SpeechBubblePtr->scale += 0.05;
if (SpeechBubblePtr->scale >= 0.55) {
SpeechBubblePtr->scale = 0.55f;
SpeechBubblePtr->state++;
SpeechBubblePtr->holdTime = 12;
}
break;
case SPEECH_BUBBLE_HOLD:
SpeechBubblePtr->yaw = 0.0f;
SpeechBubblePtr->holdTime--;
if (SpeechBubblePtr->holdTime <= 0) {
SpeechBubblePtr->state++;
}
break;
case SPEECH_BUBBLE_IDLE:
yaw = SpeechBubblePtr->yaw;
yaw += 10.0f;
if (yaw >= 360.0f) {
yaw -= 360.0f;
}
SpeechBubblePtr->yaw = yaw;
brightness = N(GetIconBrightnessForAngle)(yaw);
break;
case SPEECH_BUBBLE_VANISH:
yaw = SpeechBubblePtr->yaw;
yaw += 25.0f;
if (yaw >= 360.0f) {
yaw -= 360.0f;
}
SpeechBubblePtr->yaw = yaw;
if ((yaw >= 70.0f && yaw <= 110.0f) || (yaw >= 250.0f && yaw <= 290.0f)) {
// only dimiss when the icon is rotated away from view
TalkNotificationCallback = NULL;
playerStatus->encounteredNPC = NULL;
playerStatus->animFlags &= ~PA_FLAG_SPEECH_PROMPT_AVAILABLE;
return;
}
brightness = N(GetIconBrightnessForAngle)(yaw);
break;
}
SpeechBubblePtr->brightness = brightness;
if (playerStatus->encounteredNPC != NULL) {
if (playerStatus->encounteredNPC != SpeechBubblePtr->encounteredNPC) {
SpeechBubblePtr->encounteredNPC = playerStatus->encounteredNPC;
}
}
npc = SpeechBubblePtr->encounteredNPC;
SpeechBubblePtr->pos.y = SpeechBubblePtr->unk_1C = npc->pos.y + npc->collisionHeight + 8.0f;
SpeechBubblePtr->pos.x = npc->pos.x;
SpeechBubblePtr->pos.z = npc->pos.z;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_8026E558
/* 19CE38 8026E558 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 19CE3C 8026E55C AFB3001C */ sw $s3, 0x1C($sp)
/* 19CE40 8026E560 0080982D */ daddu $s3, $a0, $zero
/* 19CE44 8026E564 AFBF0020 */ sw $ra, 0x20($sp)
/* 19CE48 8026E568 AFB20018 */ sw $s2, 0x18($sp)
/* 19CE4C 8026E56C AFB10014 */ sw $s1, 0x14($sp)
/* 19CE50 8026E570 AFB00010 */ sw $s0, 0x10($sp)
/* 19CE54 8026E574 8E70000C */ lw $s0, 0xC($s3)
/* 19CE58 8026E578 8E050000 */ lw $a1, 0x0($s0)
/* 19CE5C 8026E57C 0C0B1EAF */ jal evt_get_variable
/* 19CE60 8026E580 26100004 */ addiu $s0, $s0, 0x4
/* 19CE64 8026E584 0040882D */ daddu $s1, $v0, $zero
/* 19CE68 8026E588 8E050000 */ lw $a1, 0x0($s0)
/* 19CE6C 8026E58C 26100004 */ addiu $s0, $s0, 0x4
/* 19CE70 8026E590 0C0B1EAF */ jal evt_get_variable
/* 19CE74 8026E594 0260202D */ daddu $a0, $s3, $zero
/* 19CE78 8026E598 0040902D */ daddu $s2, $v0, $zero
/* 19CE7C 8026E59C 2402FF81 */ addiu $v0, $zero, -0x7F
/* 19CE80 8026E5A0 16220002 */ bne $s1, $v0, .L8026E5AC
/* 19CE84 8026E5A4 8E100000 */ lw $s0, 0x0($s0)
/* 19CE88 8026E5A8 8E710148 */ lw $s1, 0x148($s3)
.L8026E5AC:
/* 19CE8C 8026E5AC 0C09A75B */ jal get_actor
/* 19CE90 8026E5B0 0220202D */ daddu $a0, $s1, $zero
/* 19CE94 8026E5B4 0040202D */ daddu $a0, $v0, $zero
/* 19CE98 8026E5B8 C4820148 */ lwc1 $f2, 0x148($a0)
/* 19CE9C 8026E5BC 3C014220 */ lui $at, (0x42200000 >> 16)
/* 19CEA0 8026E5C0 44810000 */ mtc1 $at, $f0
/* 19CEA4 8026E5C4 C4840144 */ lwc1 $f4, 0x144($a0)
/* 19CEA8 8026E5C8 C486014C */ lwc1 $f6, 0x14C($a0)
/* 19CEAC 8026E5CC 4600103C */ c.lt.s $f2, $f0
/* 19CEB0 8026E5D0 00000000 */ nop
/* 19CEB4 8026E5D4 45000003 */ bc1f .L8026E5E4
/* 19CEB8 8026E5D8 2406FFFF */ addiu $a2, $zero, -0x1
/* 19CEBC 8026E5DC 0809B988 */ j .L8026E620
/* 19CEC0 8026E5E0 0000402D */ daddu $t0, $zero, $zero
.L8026E5E4:
/* 19CEC4 8026E5E4 3C0142AA */ lui $at, (0x42AA0000 >> 16)
/* 19CEC8 8026E5E8 44810000 */ mtc1 $at, $f0
/* 19CECC 8026E5EC 00000000 */ nop
/* 19CED0 8026E5F0 4600103C */ c.lt.s $f2, $f0
/* 19CED4 8026E5F4 00000000 */ nop
/* 19CED8 8026E5F8 45010009 */ bc1t .L8026E620
/* 19CEDC 8026E5FC 24080001 */ addiu $t0, $zero, 0x1
/* 19CEE0 8026E600 3C0142C8 */ lui $at, (0x42C80000 >> 16)
/* 19CEE4 8026E604 44810000 */ mtc1 $at, $f0
/* 19CEE8 8026E608 00000000 */ nop
/* 19CEEC 8026E60C 4600103C */ c.lt.s $f2, $f0
/* 19CEF0 8026E610 00000000 */ nop
/* 19CEF4 8026E614 45000002 */ bc1f .L8026E620
/* 19CEF8 8026E618 24080003 */ addiu $t0, $zero, 0x3
/* 19CEFC 8026E61C 24080002 */ addiu $t0, $zero, 0x2
.L8026E620:
/* 19CF00 8026E620 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 19CF04 8026E624 44810000 */ mtc1 $at, $f0
/* 19CF08 8026E628 00000000 */ nop
/* 19CF0C 8026E62C 4600203C */ c.lt.s $f4, $f0
/* 19CF10 8026E630 00000000 */ nop
/* 19CF14 8026E634 45010010 */ bc1t .L8026E678
/* 19CF18 8026E638 0000282D */ daddu $a1, $zero, $zero
/* 19CF1C 8026E63C 3C014282 */ lui $at, (0x42820000 >> 16)
/* 19CF20 8026E640 44810000 */ mtc1 $at, $f0
/* 19CF24 8026E644 00000000 */ nop
/* 19CF28 8026E648 4600203C */ c.lt.s $f4, $f0
/* 19CF2C 8026E64C 00000000 */ nop
/* 19CF30 8026E650 45010009 */ bc1t .L8026E678
/* 19CF34 8026E654 24050001 */ addiu $a1, $zero, 0x1
/* 19CF38 8026E658 3C0142D2 */ lui $at, (0x42D20000 >> 16)
/* 19CF3C 8026E65C 44810000 */ mtc1 $at, $f0
/* 19CF40 8026E660 00000000 */ nop
/* 19CF44 8026E664 4600203C */ c.lt.s $f4, $f0
/* 19CF48 8026E668 00000000 */ nop
/* 19CF4C 8026E66C 45000002 */ bc1f .L8026E678
/* 19CF50 8026E670 24050003 */ addiu $a1, $zero, 0x3
/* 19CF54 8026E674 24050002 */ addiu $a1, $zero, 0x2
.L8026E678:
/* 19CF58 8026E678 3C01C1F0 */ lui $at, (0xC1F00000 >> 16)
/* 19CF5C 8026E67C 44810000 */ mtc1 $at, $f0
/* 19CF60 8026E680 00000000 */ nop
/* 19CF64 8026E684 4600303C */ c.lt.s $f6, $f0
/* 19CF68 8026E688 00000000 */ nop
/* 19CF6C 8026E68C 45000002 */ bc1f .L8026E698
/* 19CF70 8026E690 24070001 */ addiu $a3, $zero, 0x1
/* 19CF74 8026E694 0000382D */ daddu $a3, $zero, $zero
.L8026E698:
/* 19CF78 8026E698 1240000C */ beqz $s2, .L8026E6CC
/* 19CF7C 8026E69C 00000000 */ nop
/* 19CF80 8026E6A0 1E400006 */ bgtz $s2, .L8026E6BC
/* 19CF84 8026E6A4 24020001 */ addiu $v0, $zero, 0x1
/* 19CF88 8026E6A8 2402FFFF */ addiu $v0, $zero, -0x1
/* 19CF8C 8026E6AC 12420045 */ beq $s2, $v0, .L8026E7C4
pause_stats_bar_png:
/* 19CF90 8026E6B0 00000000 */ nop
/* 19CF94 8026E6B4 0809BA0F */ j .L8026E83C
/* 19CF98 8026E6B8 0260202D */ daddu $a0, $s3, $zero
.L8026E6BC:
/* 19CF9C 8026E6BC 12420022 */ beq $s2, $v0, .L8026E748
/* 19CFA0 8026E6C0 00000000 */ nop
/* 19CFA4 8026E6C4 0809BA0F */ j .L8026E83C
/* 19CFA8 8026E6C8 0260202D */ daddu $a0, $s3, $zero
.L8026E6CC:
/* 19CFAC 8026E6CC 8082040C */ lb $v0, 0x40C($a0)
/* 19CFB0 8026E6D0 18400059 */ blez $v0, .L8026E838
/* 19CFB4 8026E6D4 0000882D */ daddu $s1, $zero, $zero
/* 19CFB8 8026E6D8 0040482D */ daddu $t1, $v0, $zero
/* 19CFBC 8026E6DC 00911021 */ addu $v0, $a0, $s1
.L8026E6E0:
/* 19CFC0 8026E6E0 8043040D */ lb $v1, 0x40D($v0)
/* 19CFC4 8026E6E4 00031080 */ sll $v0, $v1, 2
/* 19CFC8 8026E6E8 00431021 */ addu $v0, $v0, $v1
/* 19CFCC 8026E6EC 00021080 */ sll $v0, $v0, 2
/* 19CFD0 8026E6F0 2442022C */ addiu $v0, $v0, 0x22C
/* 19CFD4 8026E6F4 00821821 */ addu $v1, $a0, $v0
/* 19CFD8 8026E6F8 80620011 */ lb $v0, 0x11($v1)
/* 19CFDC 8026E6FC 5445000D */ bnel $v0, $a1, .L8026E734
/* 19CFE0 8026E700 26310001 */ addiu $s1, $s1, 0x1
/* 19CFE4 8026E704 80620013 */ lb $v0, 0x13($v1)
/* 19CFE8 8026E708 1447000A */ bne $v0, $a3, .L8026E734
/* 19CFEC 8026E70C 26310001 */ addiu $s1, $s1, 0x1
/* 19CFF0 8026E710 80620012 */ lb $v0, 0x12($v1)
/* 19CFF4 8026E714 0048102A */ slt $v0, $v0, $t0
/* 19CFF8 8026E718 10400006 */ beqz $v0, .L8026E734
/* 19CFFC 8026E71C 00000000 */ nop
/* 19D000 8026E720 94620000 */ lhu $v0, 0x0($v1)
/* 19D004 8026E724 A4820428 */ sh $v0, 0x428($a0)
/* 19D008 8026E728 90620003 */ lbu $v0, 0x3($v1)
/* 19D00C 8026E72C 0000302D */ daddu $a2, $zero, $zero
/* 19D010 8026E730 A0820426 */ sb $v0, 0x426($a0)
.L8026E734:
/* 19D014 8026E734 0229102A */ slt $v0, $s1, $t1
/* 19D018 8026E738 1440FFE9 */ bnez $v0, .L8026E6E0
/* 19D01C 8026E73C 00911021 */ addu $v0, $a0, $s1
/* 19D020 8026E740 0809BA0F */ j .L8026E83C
/* 19D024 8026E744 0260202D */ daddu $a0, $s3, $zero
.L8026E748:
/* 19D028 8026E748 8082040C */ lb $v0, 0x40C($a0)
/* 19D02C 8026E74C 1840003A */ blez $v0, .L8026E838
/* 19D030 8026E750 0000882D */ daddu $s1, $zero, $zero
/* 19D034 8026E754 0040482D */ daddu $t1, $v0, $zero
/* 19D038 8026E758 00911021 */ addu $v0, $a0, $s1
.L8026E75C:
/* 19D03C 8026E75C 8043040D */ lb $v1, 0x40D($v0)
/* 19D040 8026E760 00031080 */ sll $v0, $v1, 2
/* 19D044 8026E764 00431021 */ addu $v0, $v0, $v1
/* 19D048 8026E768 00021080 */ sll $v0, $v0, 2
/* 19D04C 8026E76C 2442022C */ addiu $v0, $v0, 0x22C
/* 19D050 8026E770 00821821 */ addu $v1, $a0, $v0
/* 19D054 8026E774 80620011 */ lb $v0, 0x11($v1)
/* 19D058 8026E778 5445000D */ bnel $v0, $a1, .L8026E7B0
/* 19D05C 8026E77C 26310001 */ addiu $s1, $s1, 0x1
/* 19D060 8026E780 80620013 */ lb $v0, 0x13($v1)
/* 19D064 8026E784 1447000A */ bne $v0, $a3, .L8026E7B0
/* 19D068 8026E788 26310001 */ addiu $s1, $s1, 0x1
/* 19D06C 8026E78C 80620012 */ lb $v0, 0x12($v1)
/* 19D070 8026E790 0048102A */ slt $v0, $v0, $t0
/* 19D074 8026E794 10400006 */ beqz $v0, .L8026E7B0
/* 19D078 8026E798 00000000 */ nop
/* 19D07C 8026E79C 94620000 */ lhu $v0, 0x0($v1)
/* 19D080 8026E7A0 A4820428 */ sh $v0, 0x428($a0)
/* 19D084 8026E7A4 90620003 */ lbu $v0, 0x3($v1)
/* 19D088 8026E7A8 0000302D */ daddu $a2, $zero, $zero
/* 19D08C 8026E7AC A0820426 */ sb $v0, 0x426($a0)
.L8026E7B0:
/* 19D090 8026E7B0 0229102A */ slt $v0, $s1, $t1
/* 19D094 8026E7B4 1440FFE9 */ bnez $v0, .L8026E75C
/* 19D098 8026E7B8 00911021 */ addu $v0, $a0, $s1
/* 19D09C 8026E7BC 0809BA0F */ j .L8026E83C
/* 19D0A0 8026E7C0 0260202D */ daddu $a0, $s3, $zero
.L8026E7C4:
/* 19D0A4 8026E7C4 8082040C */ lb $v0, 0x40C($a0)
/* 19D0A8 8026E7C8 1840001B */ blez $v0, .L8026E838
/* 19D0AC 8026E7CC 0000882D */ daddu $s1, $zero, $zero
/* 19D0B0 8026E7D0 0040482D */ daddu $t1, $v0, $zero
/* 19D0B4 8026E7D4 00911021 */ addu $v0, $a0, $s1
.L8026E7D8:
/* 19D0B8 8026E7D8 8043040D */ lb $v1, 0x40D($v0)
/* 19D0BC 8026E7DC 00031080 */ sll $v0, $v1, 2
/* 19D0C0 8026E7E0 00431021 */ addu $v0, $v0, $v1
/* 19D0C4 8026E7E4 00021080 */ sll $v0, $v0, 2
/* 19D0C8 8026E7E8 2442022C */ addiu $v0, $v0, 0x22C
/* 19D0CC 8026E7EC 00821821 */ addu $v1, $a0, $v0
/* 19D0D0 8026E7F0 80620011 */ lb $v0, 0x11($v1)
/* 19D0D4 8026E7F4 5445000D */ bnel $v0, $a1, .L8026E82C
/* 19D0D8 8026E7F8 26310001 */ addiu $s1, $s1, 0x1
/* 19D0DC 8026E7FC 80620013 */ lb $v0, 0x13($v1)
/* 19D0E0 8026E800 1447000A */ bne $v0, $a3, .L8026E82C
/* 19D0E4 8026E804 26310001 */ addiu $s1, $s1, 0x1
/* 19D0E8 8026E808 80620012 */ lb $v0, 0x12($v1)
/* 19D0EC 8026E80C 0048102A */ slt $v0, $v0, $t0
/* 19D0F0 8026E810 10400006 */ beqz $v0, .L8026E82C
/* 19D0F4 8026E814 00000000 */ nop
/* 19D0F8 8026E818 94620000 */ lhu $v0, 0x0($v1)
/* 19D0FC 8026E81C A4820428 */ sh $v0, 0x428($a0)
/* 19D100 8026E820 90620003 */ lbu $v0, 0x3($v1)
/* 19D104 8026E824 0000302D */ daddu $a2, $zero, $zero
/* 19D108 8026E828 A0820426 */ sb $v0, 0x426($a0)
.L8026E82C:
/* 19D10C 8026E82C 0229102A */ slt $v0, $s1, $t1
/* 19D110 8026E830 1440FFE9 */ bnez $v0, .L8026E7D8
/* 19D114 8026E834 00911021 */ addu $v0, $a0, $s1
.L8026E838:
/* 19D118 8026E838 0260202D */ daddu $a0, $s3, $zero
.L8026E83C:
/* 19D11C 8026E83C 0C0B2026 */ jal evt_set_variable
/* 19D120 8026E840 0200282D */ daddu $a1, $s0, $zero
/* 19D124 8026E844 8FBF0020 */ lw $ra, 0x20($sp)
/* 19D128 8026E848 8FB3001C */ lw $s3, 0x1C($sp)
/* 19D12C 8026E84C 8FB20018 */ lw $s2, 0x18($sp)
/* 19D130 8026E850 8FB10014 */ lw $s1, 0x14($sp)
/* 19D134 8026E854 8FB00010 */ lw $s0, 0x10($sp)
/* 19D138 8026E858 24020002 */ addiu $v0, $zero, 0x2
/* 19D13C 8026E85C 03E00008 */ jr $ra
/* 19D140 8026E860 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
s32 func_8026E558(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
SelectableTarget* target;
s32 mode;
s32 outVar;
Actor* actor;
f32 x, y, z;
s32 outVal;
s32 row;
s32 column;
s32 layer;
s32 i;
i = evt_get_variable(script, *args++);
mode = evt_get_variable(script, *args++);
outVar = *args++;
if (i == ACTOR_SELF) {
i = script->owner1.actorID;
}
actor = get_actor(i);
x = actor->currentPos.x;
y = actor->currentPos.y;
z = actor->currentPos.z;
outVal = -1;
if (y < 40.0f) {
row = 0;
} else if (y < 85.0f) {
row = 1;
} else if (y < 100.0f) {
row = 2;
} else {
row = 3;
}
if (x < 25.0f) {
column = 0;
} else if (x < 65.0f) {
column = 1;
} else if (x < 105.0f) {
column = 2;
} else {
column = 3;
}
if (z < -30.0f) {
layer = 0;
} else {
layer = 1;
}
switch (mode) {
case 0:
for (i = 0; i < actor->targetListLength; i++) {
target = &actor->targetData[actor->targetIndexList[i]];
if (target->homeCol == column && target->layer == layer && target->homeRow < row) {
actor->targetActorID = target->actorID;
actor->targetPartIndex = target->partID;
outVal = 0;
}
}
break;
case 1:
for (i = 0; i < actor->targetListLength; i++) {
target = &actor->targetData[actor->targetIndexList[i]];
if (target->homeCol == column && target->layer == layer && target->homeRow < row) {
actor->targetActorID = target->actorID;
actor->targetPartIndex = target->partID;
outVal = 0;
}
}
break;
case -1:
for (i = 0; i < actor->targetListLength; i++) {
target = &actor->targetData[actor->targetIndexList[i]];
if (target->homeCol == column && target->layer == layer && target->homeRow < row) {
actor->targetActorID = target->actorID;
actor->targetPartIndex = target->partID;
outVal = 0;
}
}
break;
}
evt_set_variable(script, outVar, outVal);
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel parasol_get_npc
/* E236E0 802B6000 27BDFFD0 */ addiu $sp, $sp, -0x30
/* E236E4 802B6004 AFB30024 */ sw $s3, 0x24($sp)
/* E236E8 802B6008 AFB00018 */ sw $s0, 0x18($sp)
/* E236EC 802B600C 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* E236F0 802B6010 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* E236F4 802B6014 AFBF002C */ sw $ra, 0x2C($sp)
.L802B6018:
/* E236F8 802B6018 AFB40028 */ sw $s4, 0x28($sp)
/* E236FC 802B601C AFB20020 */ sw $s2, 0x20($sp)
/* E23700 802B6020 AFB1001C */ sw $s1, 0x1C($sp)
/* E23704 802B6024 8E050004 */ lw $a1, 0x4($s0)
/* E23708 802B6028 3C148011 */ lui $s4, %hi(gPlayerData)
/* E2370C 802B602C 2694F290 */ addiu $s4, $s4, %lo(gPlayerData)
/* E23710 802B6030 30A21000 */ andi $v0, $a1, 0x1000
/* E23714 802B6034 10400005 */ beqz $v0, .L802B604C
/* E23718 802B6038 0000982D */ daddu $s3, $zero, $zero
/* E2371C 802B603C 0C0AD97A */ jal action_update_walk_peach
.L802B6040:
/* E23720 802B6040 00000000 */ nop
.L802B6044:
/* E23724 802B6044 080AD89A */ j .L802B6268
glabel action_hammer_play_hit_fx
/* E23728 802B6048 00000000 */ nop
.L802B604C:
/* E2372C 802B604C 8E030000 */ lw $v1, 0x0($s0)
.L802B6050:
/* E23730 802B6050 04610016 */ bgez $v1, .L802B60AC
/* E23734 802B6054 3C027F77 */ lui $v0, (0x7F77FFFF >> 16)
.L802B6058:
/* E23738 802B6058 3442FFFF */ ori $v0, $v0, (0x7F77FFFF & 0xFFFF)
/* E2373C 802B605C 24130001 */ addiu $s3, $zero, 0x1
glabel action_update_sliding
/* E23740 802B6060 00621024 */ and $v0, $v1, $v0
/* E23744 802B6064 AE020000 */ sw $v0, 0x0($s0)
.L802B6068:
/* E23748 802B6068 30624000 */ andi $v0, $v1, 0x4000
/* E2374C 802B606C 14400003 */ bnez $v0, .L802B607C
/* E23750 802B6070 AE000060 */ sw $zero, 0x60($s0)
.L802B6074:
/* E23754 802B6074 C6000058 */ lwc1 $f0, 0x58($s0)
/* E23758 802B6078 E6000054 */ swc1 $f0, 0x54($s0)
glabel .L802B607C
/* E2375C 802B607C 30A24000 */ andi $v0, $a1, 0x4000
.L802B6080:
/* E23760 802B6080 10400003 */ beqz $v0, .L802B6090
/* E23764 802B6084 3C040009 */ lui $a0, (0x90003 >> 16)
/* E23768 802B6088 080AD829 */ j action_update_use_spinning_flower
.L802B608C:
/* E2376C 802B608C 34840003 */ ori $a0, $a0, (0x90003 & 0xFFFF)
.L802B6090:
/* E23770 802B6090 30A20001 */ andi $v0, $a1, 0x1
.L802B6094:
/* E23774 802B6094 14400003 */ bnez $v0, action_update_use_spinning_flower
/* E23778 802B6098 3C040006 */ lui $a0, (0x60000 >> 16)
glabel action_update_state_23
/* E2377C 802B609C 3C040001 */ lui $a0, (0x10004 >> 16)
/* E23780 802B60A0 34840004 */ ori $a0, $a0, (0x10004 & 0xFFFF)
glabel action_update_use_spinning_flower
/* E23784 802B60A4 0C037FBF */ jal suggest_player_anim_allow_backward
.L802B60A8:
/* E23788 802B60A8 00000000 */ nop
.L802B60AC:
/* E2378C 802B60AC 8E020000 */ lw $v0, 0x0($s0)
/* E23790 802B60B0 30424000 */ andi $v0, $v0, 0x4000
glabel action_update_jump
/* E23794 802B60B4 10400006 */ beqz $v0, .L802B60D0
/* E23798 802B60B8 24040008 */ addiu $a0, $zero, 0x8
/* E2379C 802B60BC C60000A0 */ lwc1 $f0, 0xA0($s0)
/* E237A0 802B60C0 0C039426 */ jal try_player_footstep_sounds
/* E237A4 802B60C4 E6000080 */ swc1 $f0, 0x80($s0)
.L802B60C8:
/* E237A8 802B60C8 080AD89A */ j .L802B6268
/* E237AC 802B60CC 00000000 */ nop
glabel .L802B60D0
/* E237B0 802B60D0 27B20010 */ addiu $s2, $sp, 0x10
.L802B60D4:
/* E237B4 802B60D4 0240202D */ daddu $a0, $s2, $zero
/* E237B8 802B60D8 27B10014 */ addiu $s1, $sp, 0x14
/* E237BC 802B60DC 0C0388C1 */ jal player_input_to_move_vector
/* E237C0 802B60E0 0220282D */ daddu $a1, $s1, $zero
/* E237C4 802B60E4 0C039454 */ jal phys_update_interact_collider
.L802B60E8:
/* E237C8 802B60E8 00000000 */ nop
.L802B60EC:
/* E237CC 802B60EC 0C039858 */ jal check_input_jump
.L802B60F0:
/* E237D0 802B60F0 00000000 */ nop
glabel .L802B60F4
/* E237D4 802B60F4 1440005C */ bnez $v0, .L802B6268
/* E237D8 802B60F8 00000000 */ nop
/* E237DC 802B60FC 16600006 */ bnez $s3, .L802B6118
.L802B6100:
/* E237E0 802B6100 0240202D */ daddu $a0, $s2, $zero
.L802B6104:
/* E237E4 802B6104 0C039838 */ jal check_input_hammer
.L802B6108:
/* E237E8 802B6108 00000000 */ nop
glabel .L802B610C
/* E237EC 802B610C 14400056 */ bnez $v0, .L802B6268
.L802B6110:
/* E237F0 802B6110 00000000 */ nop
/* E237F4 802B6114 0240202D */ daddu $a0, $s2, $zero
.L802B6118:
/* E237F8 802B6118 0C0388C1 */ jal player_input_to_move_vector
/* E237FC 802B611C 0220282D */ daddu $a1, $s1, $zero
glabel action_update_parasol
/* E23800 802B6120 C7A40014 */ lwc1 $f4, 0x14($sp)
.L802B6124:
/* E23804 802B6124 44800000 */ mtc1 $zero, $f0
.L802B6128:
/* E23808 802B6128 00000000 */ nop
/* E2380C 802B612C 46002032 */ c.eq.s $f4, $f0
/* E23810 802B6130 00000000 */ nop
glabel .L802B6134
/* E23814 802B6134 45000005 */ bc1f .L802B614C
/* E23818 802B6138 00000000 */ nop
.L802B613C:
/* E2381C 802B613C 0C039769 */ jal set_action_state
.L802B6140:
/* E23820 802B6140 0000202D */ daddu $a0, $zero, $zero
.L802B6144:
/* E23824 802B6144 080AD89A */ j .L802B6268
/* E23828 802B6148 00000000 */ nop
.L802B614C:
/* E2382C 802B614C C7A60010 */ lwc1 $f6, 0x10($sp)
.L802B6150:
/* E23830 802B6150 3C01800F */ lui $at, %hi(PrevPlayerCamRelativeYaw)
.L802B6154:
/* E23834 802B6154 C4207B40 */ lwc1 $f0, %lo(PrevPlayerCamRelativeYaw)($at)
.L802B6158:
/* E23838 802B6158 46800020 */ cvt.s.w $f0, $f0
.L802B615C:
/* E2383C 802B615C 46060001 */ sub.s $f0, $f0, $f6
/* E23840 802B6160 3C0142B4 */ lui $at, (0x42B40000 >> 16)
.L802B6164:
/* E23844 802B6164 44811000 */ mtc1 $at, $f2
.L802B6168:
/* E23848 802B6168 46000005 */ abs.s $f0, $f0
/* E2384C 802B616C 4602003E */ c.le.s $f0, $f2
glabel .L802B6170
/* E23850 802B6170 00000000 */ nop
glabel .L802B6174
/* E23854 802B6174 4500001C */ bc1f .L802B61E8
/* E23858 802B6178 00000000 */ nop
.L802B617C:
/* E2385C 802B617C 3C01800F */ lui $at, %hi(D_800F7B44)
.L802B6180:
/* E23860 802B6180 C4207B44 */ lwc1 $f0, %lo(D_800F7B44)($at)
glabel .L802B6184
/* E23864 802B6184 46800020 */ cvt.s.w $f0, $f0
.L802B6188:
/* E23868 802B6188 46002001 */ sub.s $f0, $f4, $f0
.L802B618C:
/* E2386C 802B618C 4600020D */ trunc.w.s $f8, $f0
.L802B6190:
/* E23870 802B6190 44024000 */ mfc1 $v0, $f8
.L802B6194:
/* E23874 802B6194 00000000 */ nop
glabel func_802B6198
/* E23878 802B6198 04420001 */ bltzl $v0, .L802B61A0
/* E2387C 802B619C 00021023 */ negu $v0, $v0
.L802B61A0:
/* E23880 802B61A0 28420014 */ slti $v0, $v0, 0x14
.L802B61A4:
/* E23884 802B61A4 10400010 */ beqz $v0, .L802B61E8
.L802B61A8:
/* E23888 802B61A8 00000000 */ nop
.L802B61AC:
/* E2388C 802B61AC 8E020004 */ lw $v0, 0x4($s0)
.L802B61B0:
/* E23890 802B61B0 0440000A */ bltz $v0, .L802B61DC
.L802B61B4:
/* E23894 802B61B4 3C037FFF */ lui $v1, (0x7FFFFFFF >> 16)
/* E23898 802B61B8 3C0141A0 */ lui $at, (0x41A00000 >> 16)
/* E2389C 802B61BC 44810000 */ mtc1 $at, $f0
glabel func_802B61C0
/* E238A0 802B61C0 00000000 */ nop
/* E238A4 802B61C4 4604003E */ c.le.s $f0, $f4
.L802B61C8:
/* E238A8 802B61C8 00000000 */ nop
.L802B61CC:
/* E238AC 802B61CC 45030002 */ bc1tl .L802B61D8
/* E238B0 802B61D0 E6060080 */ swc1 $f6, 0x80($s0)
.L802B61D4:
/* E238B4 802B61D4 3C037FFF */ lui $v1, (0x7FFFFFFF >> 16)
.L802B61D8:
/* E238B8 802B61D8 8E020004 */ lw $v0, 0x4($s0)
.L802B61DC:
/* E238BC 802B61DC 3463FFFF */ ori $v1, $v1, (0x7FFFFFFF & 0xFFFF)
/* E238C0 802B61E0 080AD881 */ j .L802B6204
glabel func_802B61E4
/* E238C4 802B61E4 00431024 */ and $v0, $v0, $v1
.L802B61E8:
/* E238C8 802B61E8 8E020004 */ lw $v0, 0x4($s0)
.L802B61EC:
/* E238CC 802B61EC 04410004 */ bgez $v0, .L802B6200
.L802B61F0:
/* E238D0 802B61F0 3C038000 */ lui $v1, (0x80000000 >> 16)
.L802B61F4:
/* E238D4 802B61F4 C7A00010 */ lwc1 $f0, 0x10($sp)
.L802B61F8:
/* E238D8 802B61F8 080AD882 */ j .L802B6208
.L802B61FC:
/* E238DC 802B61FC E6000080 */ swc1 $f0, 0x80($s0)
.L802B6200:
/* E238E0 802B6200 00431025 */ or $v0, $v0, $v1
.L802B6204:
/* E238E4 802B6204 AE020004 */ sw $v0, 0x4($s0)
glabel .L802B6208
/* E238E8 802B6208 0C03A752 */ jal is_ability_active
/* E238EC 802B620C 2404000B */ addiu $a0, $zero, 0xB
.L802B6210:
/* E238F0 802B6210 14400010 */ bnez $v0, .L802B6254
.L802B6214:
/* E238F4 802B6214 00000000 */ nop
glabel .L802B6218
/* E238F8 802B6218 8E0200E8 */ lw $v0, 0xE8($s0)
/* E238FC 802B621C 00420018 */ mult $v0, $v0
.L802B6220:
/* E23900 802B6220 00001812 */ mflo $v1
.L802B6224:
/* E23904 802B6224 8E0200EC */ lw $v0, 0xEC($s0)
glabel .L802B6228
/* E23908 802B6228 00000000 */ nop
.L802B622C:
/* E2390C 802B622C 00420018 */ mult $v0, $v0
glabel action_update_step_up_peach
/* E23910 802B6230 00003812 */ mflo $a3
/* E23914 802B6234 00671021 */ addu $v0, $v1, $a3
glabel .L802B6238
/* E23918 802B6238 28420BD2 */ slti $v0, $v0, 0xBD2
glabel .L802B623C
/* E2391C 802B623C 14400005 */ bnez $v0, .L802B6254
glabel .L802B6240
/* E23920 802B6240 00000000 */ nop
glabel .L802B6244
/* E23924 802B6244 0C039769 */ jal set_action_state
glabel .L802B6248
/* E23928 802B6248 24040002 */ addiu $a0, $zero, 0x2
/* E2392C 802B624C 080AD89A */ j .L802B6268
glabel .L802B6250
/* E23930 802B6250 00000000 */ nop
.L802B6254:
/* E23934 802B6254 0C039426 */ jal try_player_footstep_sounds
glabel .L802B6258
/* E23938 802B6258 24040008 */ addiu $a0, $zero, 0x8
.L802B625C:
/* E2393C 802B625C 8E8202AC */ lw $v0, 0x2AC($s4)
/* E23940 802B6260 24420001 */ addiu $v0, $v0, 0x1
/* E23944 802B6264 AE8202AC */ sw $v0, 0x2AC($s4)
.L802B6268:
/* E23948 802B6268 8FBF002C */ lw $ra, 0x2C($sp)
.L802B626C:
/* E2394C 802B626C 8FB40028 */ lw $s4, 0x28($sp)
/* E23950 802B6270 8FB30024 */ lw $s3, 0x24($sp)
.L802B6274:
/* E23954 802B6274 8FB20020 */ lw $s2, 0x20($sp)
glabel .L802B6278
/* E23958 802B6278 8FB1001C */ lw $s1, 0x1C($sp)
/* E2395C 802B627C 8FB00018 */ lw $s0, 0x18($sp)
.L802B6280:
/* E23960 802B6280 03E00008 */ jr $ra
.L802B6284:
/* E23964 802B6284 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void action_update_walk(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerData* playerData = &gPlayerData;
f32 moveVectorMagnitude;
f32 moveVectorAngle;
s32 stickAxisX;
s32 stickAxisY;
AnimID anim;
s32 changedAnim = FALSE;
if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
action_update_walk_peach();
return;
}
if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~(
PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_SCRIPTED_FALL | PS_FLAG_ARMS_RAISED);
playerStatus->unk_60 = 0;
changedAnim = TRUE;
if (!(playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT)) {
playerStatus->currentSpeed = playerStatus->walkSpeed;
}
if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) {
anim = ANIM_MarioW3_8bit_Run;
}
else if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
anim = ANIM_Mario1_Walk;
}
else {
anim = ANIM_MarioW1_CarryWalk;
}
suggest_player_anim_allow_backward(anim);
}
if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) {
playerStatus->targetYaw = playerStatus->heading;
try_player_footstep_sounds(8);
return;
}
player_input_to_move_vector(&moveVectorAngle, &moveVectorMagnitude);
phys_update_interact_collider();
if (!check_input_jump()) {
if (changedAnim != 0 || !check_input_hammer()) {
player_input_to_move_vector(&moveVectorAngle, &moveVectorMagnitude);
if (moveVectorMagnitude == 0.0f) {
set_action_state(ACTION_STATE_IDLE);
return;
}
if (fabsf(PrevPlayerCamRelativeYaw - moveVectorAngle) <= 90.0f && abs(moveVectorMagnitude - D_800F7B44) < 20) {
if (!(playerStatus->animFlags & PA_FLAG_80000000)) {
if (moveVectorMagnitude >= 20.0f) {
playerStatus->targetYaw = moveVectorAngle;
}
}
playerStatus->animFlags &= ~PA_FLAG_80000000;
} else {
if (playerStatus->animFlags & PA_FLAG_80000000) {
playerStatus->targetYaw = moveVectorAngle;
} else {
playerStatus->animFlags |= PA_FLAG_80000000;
}
}
if (!is_ability_active(ABILITY_SLOW_GO)) {
stickAxisX = playerStatus->stickAxis[0];
stickAxisY = playerStatus->stickAxis[1];
if (SQ(stickAxisX) + SQ(stickAxisY) > SQ(55)) {
set_action_state(ACTION_STATE_RUN);
return;
}
}
try_player_footstep_sounds(8);
playerData->walkingStepsTaken++;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_80248B08
/* 1773E8 80248B08 3C03800E */ lui $v1, %hi(gBattleSubState)
/* 1773EC 80248B0C 8C63C4DC */ lw $v1, %lo(gBattleSubState)($v1)
D_80248B10:
/* 1773F0 80248B10 3C06800E */ lui $a2, %hi(gCurrentBattlePtr)
/* 1773F4 80248B14 8CC6C4FC */ lw $a2, %lo(gCurrentBattlePtr)($a2)
D_80248B18:
/* 1773F8 80248B18 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1773FC 80248B1C AFB20018 */ sw $s2, 0x18($sp)
/* 177400 80248B20 3C12800E */ lui $s2, %hi(gBattleStatus)
D_80248B24:
/* 177404 80248B24 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus)
/* 177408 80248B28 AFBF001C */ sw $ra, 0x1C($sp)
/* 17740C 80248B2C AFB10014 */ sw $s1, 0x14($sp)
/* 177410 80248B30 2C620005 */ sltiu $v0, $v1, 0x5
/* 177414 80248B34 1040008A */ beqz $v0, D_80248D60
/* 177418 80248B38 AFB00010 */ sw $s0, 0x10($sp)
/* 17741C 80248B3C 00031080 */ sll $v0, $v1, 2
/* 177420 80248B40 3C01802A */ lui $at, %hi(jtbl_8029CBE0)
D_80248B44:
/* 177424 80248B44 00220821 */ addu $at, $at, $v0
/* 177428 80248B48 8C22CBE0 */ lw $v0, %lo(jtbl_8029CBE0)($at)
/* 17742C 80248B4C 00400008 */ jr $v0
D_80248B50:
/* 177430 80248B50 00000000 */ nop
glabel .L80248B54
/* 177434 80248B54 3C038028 */ lui $v1, %hi(D_802809F6)
/* 177438 80248B58 846309F6 */ lh $v1, %lo(D_802809F6)($v1)
/* 17743C 80248B5C 2402FFFF */ addiu $v0, $zero, -0x1
.L80248B60:
/* 177440 80248B60 3C018028 */ lui $at, %hi(BattleScreenFadeAmt)
/* 177444 80248B64 AC200A30 */ sw $zero, %lo(BattleScreenFadeAmt)($at)
/* 177448 80248B68 1462000A */ bne $v1, $v0, .L80248B94
/* 17744C 80248B6C 24020001 */ addiu $v0, $zero, 0x1
.L80248B70:
/* 177450 80248B70 3C048028 */ lui $a0, %hi(DemoBattleBeginDelay)
/* 177454 80248B74 248409F8 */ addiu $a0, $a0, %lo(DemoBattleBeginDelay)
/* 177458 80248B78 84820000 */ lh $v0, 0x0($a0)
D_80248B7C:
/* 17745C 80248B7C 94830000 */ lhu $v1, 0x0($a0)
/* 177460 80248B80 10400003 */ beqz $v0, .L80248B90
/* 177464 80248B84 2462FFFF */ addiu $v0, $v1, -0x1
/* 177468 80248B88 08092358 */ j D_80248D60
/* 17746C 80248B8C A4820000 */ sh $v0, 0x0($a0)
.L80248B90:
/* 177470 80248B90 24020001 */ addiu $v0, $zero, 0x1
.L80248B94:
/* 177474 80248B94 3C01800E */ lui $at, %hi(gBattleSubState)
.L80248B98:
/* 177478 80248B98 AC22C4DC */ sw $v0, %lo(gBattleSubState)($at)
D_80248B9C:
/* 17747C 80248B9C 08092358 */ j D_80248D60
D_80248BA0:
/* 177480 80248BA0 00000000 */ nop
glabel .L80248BA4
/* 177484 80248BA4 3C038028 */ lui $v1, %hi(D_802809F6)
D_80248BA8:
/* 177488 80248BA8 846309F6 */ lh $v1, %lo(D_802809F6)($v1)
/* 17748C 80248BAC 2402FFFF */ addiu $v0, $zero, -0x1
/* 177490 80248BB0 10620005 */ beq $v1, $v0, .L80248BC8
/* 177494 80248BB4 240200FF */ addiu $v0, $zero, 0xFF
/* 177498 80248BB8 14620069 */ bne $v1, $v0, D_80248D60
/* 17749C 80248BBC 24020002 */ addiu $v0, $zero, 0x2
/* 1774A0 80248BC0 080922F9 */ j .L80248BE4
.L80248BC4:
/* 1774A4 80248BC4 00000000 */ nop
.L80248BC8:
/* 1774A8 80248BC8 3C038028 */ lui $v1, %hi(BattleScreenFadeAmt)
.L80248BCC:
/* 1774AC 80248BCC 24630A30 */ addiu $v1, $v1, %lo(BattleScreenFadeAmt)
/* 1774B0 80248BD0 8C620000 */ lw $v0, 0x0($v1)
D_80248BD4:
/* 1774B4 80248BD4 240400FF */ addiu $a0, $zero, 0xFF
D_80248BD8:
/* 1774B8 80248BD8 14440006 */ bne $v0, $a0, func_80248BF4
.L80248BDC:
/* 1774BC 80248BDC 24420032 */ addiu $v0, $v0, 0x32
/* 1774C0 80248BE0 24020002 */ addiu $v0, $zero, 0x2
.L80248BE4:
/* 1774C4 80248BE4 3C01800E */ lui $at, %hi(gBattleSubState)
/* 1774C8 80248BE8 AC22C4DC */ sw $v0, %lo(gBattleSubState)($at)
/* 1774CC 80248BEC 08092358 */ j D_80248D60
/* 1774D0 80248BF0 00000000 */ nop
glabel func_80248BF4
/* 1774D4 80248BF4 AC620000 */ sw $v0, 0x0($v1)
/* 1774D8 80248BF8 28420100 */ slti $v0, $v0, 0x100
.L80248BFC:
/* 1774DC 80248BFC 50400058 */ beql $v0, $zero, D_80248D60
D_80248C00:
/* 1774E0 80248C00 AC640000 */ sw $a0, 0x0($v1)
D_80248C04:
/* 1774E4 80248C04 08092358 */ j D_80248D60
/* 1774E8 80248C08 00000000 */ nop
glabel .L80248C0C
/* 1774EC 80248C0C 240200FF */ addiu $v0, $zero, 0xFF
/* 1774F0 80248C10 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 1774F4 80248C14 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 1774F8 80248C18 2403FFFE */ addiu $v1, $zero, -0x2
/* 1774FC 80248C1C 3C018028 */ lui $at, %hi(BattleScreenFadeAmt)
/* 177500 80248C20 AC220A30 */ sw $v0, %lo(BattleScreenFadeAmt)($at)
/* 177504 80248C24 8C820000 */ lw $v0, 0x0($a0)
D_80248C28:
/* 177508 80248C28 3C05800E */ lui $a1, %hi(gCurrentStagePtr)
D_80248C2C:
/* 17750C 80248C2C 8CA5C064 */ lw $a1, %lo(gCurrentStagePtr)($a1)
D_80248C30:
/* 177510 80248C30 00431024 */ and $v0, $v0, $v1
D_80248C34:
/* 177514 80248C34 14A00004 */ bnez $a1, .L80248C48
/* 177518 80248C38 AC820000 */ sw $v0, 0x0($a0)
/* 17751C 80248C3C 8CC4000C */ lw $a0, 0xC($a2)
/* 177520 80248C40 08092313 */ j .L80248C4C
/* 177524 80248C44 00000000 */ nop
.L80248C48:
/* 177528 80248C48 8CA40004 */ lw $a0, 0x4($a1)
.L80248C4C:
/* 17752C 80248C4C 8C840010 */ lw $a0, 0x10($a0)
/* 177530 80248C50 14800006 */ bnez $a0, D_80248C6C
/* 177534 80248C54 2405000A */ addiu $a1, $zero, 0xA
D_80248C58:
/* 177538 80248C58 24020004 */ addiu $v0, $zero, 0x4
/* 17753C 80248C5C 3C01800E */ lui $at, %hi(gBattleSubState)
/* 177540 80248C60 AC22C4DC */ sw $v0, %lo(gBattleSubState)($at)
/* 177544 80248C64 08092358 */ j D_80248D60
/* 177548 80248C68 00000000 */ nop
D_80248C6C:
/* 17754C 80248C6C 0C0B0CF8 */ jal start_script
D_80248C70:
/* 177550 80248C70 0000302D */ daddu $a2, $zero, $zero
/* 177554 80248C74 AE4200BC */ sw $v0, 0xBC($s2)
.L80248C78:
/* 177558 80248C78 8C430144 */ lw $v1, 0x144($v0)
/* 17755C 80248C7C 24020003 */ addiu $v0, $zero, 0x3
/* 177560 80248C80 3C01800E */ lui $at, %hi(gBattleSubState)
D_80248C84:
/* 177564 80248C84 AC22C4DC */ sw $v0, %lo(gBattleSubState)($at)
/* 177568 80248C88 08092358 */ j D_80248D60
/* 17756C 80248C8C AE4300C0 */ sw $v1, 0xC0($s2)
glabel .L80248C90
/* 177570 80248C90 8E4400C0 */ lw $a0, 0xC0($s2)
D_80248C94:
/* 177574 80248C94 0C0B1059 */ jal does_script_exist
/* 177578 80248C98 00000000 */ nop
/* 17757C 80248C9C 14400030 */ bnez $v0, D_80248D60
/* 177580 80248CA0 24020004 */ addiu $v0, $zero, 0x4
/* 177584 80248CA4 3C01800E */ lui $at, %hi(gBattleSubState)
.L80248CA8:
/* 177588 80248CA8 AC22C4DC */ sw $v0, %lo(gBattleSubState)($at)
glabel .L80248CAC
/* 17758C 80248CAC 0C0B1045 */ jal kill_all_scripts
D_80248CB0:
/* 177590 80248CB0 0000882D */ daddu $s1, $zero, $zero
/* 177594 80248CB4 0240802D */ daddu $s0, $s2, $zero
.L80248CB8:
/* 177598 80248CB8 8E0400E0 */ lw $a0, 0xE0($s0)
/* 17759C 80248CBC 10800003 */ beqz $a0, .L80248CCC
.L80248CC0:
/* 1775A0 80248CC0 26310001 */ addiu $s1, $s1, 0x1
/* 1775A4 80248CC4 0C0902EF */ jal func_80240BBC
D_80248CC8:
/* 1775A8 80248CC8 00000000 */ nop
.L80248CCC:
/* 1775AC 80248CCC 2A220018 */ slti $v0, $s1, 0x18
D_80248CD0:
/* 1775B0 80248CD0 1440FFF9 */ bnez $v0, .L80248CB8
D_80248CD4:
/* 1775B4 80248CD4 26100004 */ addiu $s0, $s0, 0x4
/* 1775B8 80248CD8 8E4400DC */ lw $a0, 0xDC($s2)
D_80248CDC:
/* 1775BC 80248CDC 10800003 */ beqz $a0, .L80248CEC
/* 1775C0 80248CE0 00000000 */ nop
/* 1775C4 80248CE4 0C0902EF */ jal func_80240BBC
/* 1775C8 80248CE8 00000000 */ nop
.L80248CEC:
/* 1775CC 80248CEC 0C09035A */ jal func_80240D68
D_80248CF0:
/* 1775D0 80248CF0 8E4400D8 */ lw $a0, 0xD8($s2)
/* 1775D4 80248CF4 0C016938 */ jal remove_all_effects
/* 1775D8 80248CF8 00000000 */ nop
/* 1775DC 80248CFC 0C051FB1 */ jal set_windows_visible
/* 1775E0 80248D00 0000202D */ daddu $a0, $zero, $zero
/* 1775E4 80248D04 3C02800E */ lui $v0, %hi(gBattleStatus + 0x4)
D_80248D08:
/* 1775E8 80248D08 8C42C074 */ lw $v0, %lo(gBattleStatus + 0x4)($v0)
/* 1775EC 80248D0C 30420040 */ andi $v0, $v0, 0x40
.L80248D10:
/* 1775F0 80248D10 10400003 */ beqz $v0, .L80248D20
/* 1775F4 80248D14 00000000 */ nop
D_80248D18:
/* 1775F8 80248D18 0C03A6CC */ jal decrement_status_bar_disabled
/* 1775FC 80248D1C 00000000 */ nop
.L80248D20:
/* 177600 80248D20 3C038028 */ lui $v1, %hi(D_802809F6)
D_80248D24:
/* 177604 80248D24 846309F6 */ lh $v1, %lo(D_802809F6)($v1)
D_80248D28:
/* 177608 80248D28 2402FFFF */ addiu $v0, $zero, -0x1
/* 17760C 80248D2C 10620004 */ beq $v1, $v0, .L80248D40
/* 177610 80248D30 24020012 */ addiu $v0, $zero, 0x12
D_80248D34:
/* 177614 80248D34 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 177618 80248D38 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
D_80248D3C:
/* 17761C 80248D3C A0620072 */ sb $v0, 0x72($v1)
.L80248D40:
/* 177620 80248D40 0C090464 */ jal func_80241190
/* 177624 80248D44 0000202D */ daddu $a0, $zero, $zero
/* 177628 80248D48 3C02800E */ lui $v0, %hi(gBattleState)
D_80248D4C:
/* 17762C 80248D4C 8C42C068 */ lw $v0, %lo(gBattleState)($v0)
/* 177630 80248D50 3C01800E */ lui $at, %hi(gLastDrawBattleState)
D_80248D54:
/* 177634 80248D54 AC22C4D0 */ sw $v0, %lo(gLastDrawBattleState)($at)
/* 177638 80248D58 0C00CD3C */ jal set_game_mode
.L80248D5C:
/* 17763C 80248D5C 24040009 */ addiu $a0, $zero, 0x9
D_80248D60:
/* 177640 80248D60 8FBF001C */ lw $ra, 0x1C($sp)
/* 177644 80248D64 8FB20018 */ lw $s2, 0x18($sp)
/* 177648 80248D68 8FB10014 */ lw $s1, 0x14($sp)
/* 17764C 80248D6C 8FB00010 */ lw $s0, 0x10($sp)
.L80248D70:
/* 177650 80248D70 03E00008 */ jr $ra
/* 177654 80248D74 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void btl_state_update_end_demo_battle(void) {
BattleStatus* battleStatus = &gBattleStatus;
Battle* battle = gCurrentBattlePtr;
Stage* stage;
s32 i;
switch (gBattleSubState) {
case BTL_SUBSTATE_END_DEMO_BATTLE_INIT:
BattleScreenFadeAmt = 0;
if (D_802809F6 == -1) {
if (DemoBattleBeginDelay != 0) {
DemoBattleBeginDelay--;
break;
}
}
gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_FADE_OUT;
break;
case BTL_SUBSTATE_END_DEMO_BATTLE_FADE_OUT:
switch (D_802809F6) {
case 255:
gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT;
return;
case -1:
if (BattleScreenFadeAmt == 255) {
gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT;
return;
}
BattleScreenFadeAmt += 50;
if (BattleScreenFadeAmt > 255) {
BattleScreenFadeAmt = 255;
}
return;
}
break;
case BTL_SUBSTATE_END_DEMO_BATTLE_EXEC_STAGE_SCRIPT:
BattleScreenFadeAmt = 255;
gBattleStatus.flags1 &= ~BS_FLAGS1_ACTORS_VISIBLE;
if (gCurrentStagePtr == NULL) {
stage = battle->stage;
} else {
stage = gCurrentStagePtr->stage;
}
if (stage->postBattle == NULL) {
gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP;
} else {
battleStatus->controlScript = start_script(stage->postBattle, EVT_PRIORITY_A, 0);
battleStatus->controlScriptID = battleStatus->controlScript->id;
gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_AWAIT_STAGE_SCRIPT;
}
break;
case BTL_SUBSTATE_END_DEMO_BATTLE_AWAIT_STAGE_SCRIPT:
if (does_script_exist(battleStatus->controlScriptID)) {
break;
}
gBattleSubState = BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP;
//fallthrough
case BTL_SUBSTATE_END_DEMO_BATTLE_CLEANUP:
kill_all_scripts();
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
Actor* enemy = battleStatus->enemyActors[i];
if (enemy != NULL) {
btl_delete_actor(enemy);
}
}
if (battleStatus->partnerActor != NULL) {
btl_delete_actor(battleStatus->partnerActor);
}
btl_delete_player_actor(battleStatus->playerActor);
remove_all_effects();
set_windows_visible(WINDOW_GROUP_ALL);
if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) {
decrement_status_bar_disabled();
}
if (D_802809F6 != -1) {
gGameStatusPtr->nextDemoScene = LAST_DEMO_SCENE_IDX;
}
btl_set_state(BATTLE_STATE_0);
gLastDrawBattleState = gBattleState;
set_game_mode(GAME_MODE_END_BATTLE);
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel huff_puff_breath_appendGfx
/* 3D7D74 E00DC304 27BDFF38 */ addiu $sp, $sp, -0xC8
/* 3D7D78 E00DC308 0080302D */ daddu $a2, $a0, $zero
/* 3D7D7C E00DC30C 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 3D7D80 E00DC310 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3D7D84 E00DC314 27A40018 */ addiu $a0, $sp, 0x18
/* 3D7D88 E00DC318 AFB400B0 */ sw $s4, 0xB0($sp)
/* 3D7D8C E00DC31C 3C14800A */ lui $s4, %hi(gMainGfxPos)
/* 3D7D90 E00DC320 2694A66C */ addiu $s4, $s4, %lo(gMainGfxPos)
/* 3D7D94 E00DC324 AFBF00C4 */ sw $ra, 0xC4($sp)
/* 3D7D98 E00DC328 AFBE00C0 */ sw $fp, 0xC0($sp)
/* 3D7D9C E00DC32C AFB700BC */ sw $s7, 0xBC($sp)
/* 3D7DA0 E00DC330 AFB600B8 */ sw $s6, 0xB8($sp)
/* 3D7DA4 E00DC334 AFB500B4 */ sw $s5, 0xB4($sp)
/* 3D7DA8 E00DC338 AFB300AC */ sw $s3, 0xAC($sp)
/* 3D7DAC E00DC33C AFB200A8 */ sw $s2, 0xA8($sp)
/* 3D7DB0 E00DC340 AFB100A4 */ sw $s1, 0xA4($sp)
/* 3D7DB4 E00DC344 AFB000A0 */ sw $s0, 0xA0($sp)
/* 3D7DB8 E00DC348 8E850000 */ lw $a1, 0x0($s4)
/* 3D7DBC E00DC34C 8CD2000C */ lw $s2, 0xC($a2)
/* 3D7DC0 E00DC350 3C014080 */ lui $at, (0x40800000 >> 16)
/* 3D7DC4 E00DC354 44810000 */ mtc1 $at, $f0
/* 3D7DC8 E00DC358 00A0182D */ daddu $v1, $a1, $zero
/* 3D7DCC E00DC35C 24A50008 */ addiu $a1, $a1, 0x8
/* 3D7DD0 E00DC360 AE850000 */ sw $a1, 0x0($s4)
/* 3D7DD4 E00DC364 8E570024 */ lw $s7, 0x24($s2)
/* 3D7DD8 E00DC368 8E4A0000 */ lw $t2, 0x0($s2)
/* 3D7DDC E00DC36C 3C1E0001 */ lui $fp, (0x11630 >> 16)
/* 3D7DE0 E00DC370 AFAA0098 */ sw $t2, 0x98($sp)
/* 3D7DE4 E00DC374 C6420038 */ lwc1 $f2, 0x38($s2)
/* 3D7DE8 E00DC378 C6440040 */ lwc1 $f4, 0x40($s2)
/* 3D7DEC E00DC37C 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3D7DF0 E00DC380 AC620000 */ sw $v0, 0x0($v1)
/* 3D7DF4 E00DC384 AC600004 */ sw $zero, 0x4($v1)
/* 3D7DF8 E00DC388 ACA70000 */ sw $a3, 0x0($a1)
/* 3D7DFC E00DC38C 8CC30010 */ lw $v1, 0x10($a2)
/* 3D7E00 E00DC390 46001082 */ mul.s $f2, $f2, $f0
/* 3D7E04 E00DC394 00000000 */ nop
/* 3D7E08 E00DC398 24A20008 */ addiu $v0, $a1, 0x8
/* 3D7E0C E00DC39C AE820000 */ sw $v0, 0x0($s4)
/* 3D7E10 E00DC3A0 8C62001C */ lw $v0, 0x1C($v1)
/* 3D7E14 E00DC3A4 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 3D7E18 E00DC3A8 46002102 */ mul.s $f4, $f4, $f0
/* 3D7E1C E00DC3AC 00000000 */ nop
/* 3D7E20 E00DC3B0 00431021 */ addu $v0, $v0, $v1
/* 3D7E24 E00DC3B4 3C03800B */ lui $v1, %hi(gCameras)
/* 3D7E28 E00DC3B8 24631D80 */ addiu $v1, $v1, %lo(gCameras)
/* 3D7E2C E00DC3BC ACA20004 */ sw $v0, 0x4($a1)
/* 3D7E30 E00DC3C0 8E450004 */ lw $a1, 0x4($s2)
/* 3D7E34 E00DC3C4 8E460008 */ lw $a2, 0x8($s2)
/* 3D7E38 E00DC3C8 3C028007 */ lui $v0, %hi(gCurrentCameraID)
/* 3D7E3C E00DC3CC 8C427410 */ lw $v0, %lo(gCurrentCameraID)($v0)
/* 3D7E40 E00DC3D0 8E47000C */ lw $a3, 0xC($s2)
/* 3D7E44 E00DC3D4 00028880 */ sll $s1, $v0, 2
/* 3D7E48 E00DC3D8 02228821 */ addu $s1, $s1, $v0
/* 3D7E4C E00DC3DC 00118880 */ sll $s1, $s1, 2
/* 3D7E50 E00DC3E0 02228823 */ subu $s1, $s1, $v0
/* 3D7E54 E00DC3E4 001110C0 */ sll $v0, $s1, 3
/* 3D7E58 E00DC3E8 02228821 */ addu $s1, $s1, $v0
/* 3D7E5C E00DC3EC 001188C0 */ sll $s1, $s1, 3
/* 3D7E60 E00DC3F0 4600118D */ trunc.w.s $f6, $f2
/* 3D7E64 E00DC3F4 44133000 */ mfc1 $s3, $f6
/* 3D7E68 E00DC3F8 4600218D */ trunc.w.s $f6, $f4
/* 3D7E6C E00DC3FC 44163000 */ mfc1 $s6, $f6
/* 3D7E70 E00DC400 0C080108 */ jal shim_guTranslateF
/* 3D7E74 E00DC404 02238821 */ addu $s1, $s1, $v1
/* 3D7E78 E00DC408 37DE1630 */ ori $fp, $fp, (0x11630 & 0xFFFF)
/* 3D7E7C E00DC40C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3D7E80 E00DC410 44810000 */ mtc1 $at, $f0
/* 3D7E84 E00DC414 27B00058 */ addiu $s0, $sp, 0x58
/* 3D7E88 E00DC418 E7A00010 */ swc1 $f0, 0x10($sp)
/* 3D7E8C E00DC41C 44800000 */ mtc1 $zero, $f0
/* 3D7E90 E00DC420 0200202D */ daddu $a0, $s0, $zero
/* 3D7E94 E00DC424 44060000 */ mfc1 $a2, $f0
/* 3D7E98 E00DC428 8E450048 */ lw $a1, 0x48($s2)
/* 3D7E9C E00DC42C 0C080104 */ jal shim_guRotateF
/* 3D7EA0 E00DC430 00C0382D */ daddu $a3, $a2, $zero
/* 3D7EA4 E00DC434 0200202D */ daddu $a0, $s0, $zero
/* 3D7EA8 E00DC438 27A50018 */ addiu $a1, $sp, 0x18
/* 3D7EAC E00DC43C 0C080114 */ jal shim_guMtxCatF
/* 3D7EB0 E00DC440 00A0302D */ daddu $a2, $a1, $zero
/* 3D7EB4 E00DC444 8E45004C */ lw $a1, 0x4C($s2)
/* 3D7EB8 E00DC448 0200202D */ daddu $a0, $s0, $zero
/* 3D7EBC E00DC44C 00A0302D */ daddu $a2, $a1, $zero
/* 3D7EC0 E00DC450 0C080110 */ jal shim_guScaleF
/* 3D7EC4 E00DC454 00A0382D */ daddu $a3, $a1, $zero
/* 3D7EC8 E00DC458 0200202D */ daddu $a0, $s0, $zero
/* 3D7ECC E00DC45C 27A50018 */ addiu $a1, $sp, 0x18
/* 3D7ED0 E00DC460 0C080114 */ jal shim_guMtxCatF
/* 3D7ED4 E00DC464 00A0302D */ daddu $a2, $a1, $zero
/* 3D7ED8 E00DC468 27A40018 */ addiu $a0, $sp, 0x18
/* 3D7EDC E00DC46C 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 3D7EE0 E00DC470 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 3D7EE4 E00DC474 3C15800A */ lui $s5, %hi(gDisplayContext)
/* 3D7EE8 E00DC478 26B5A674 */ addiu $s5, $s5, %lo(gDisplayContext)
/* 3D7EEC E00DC47C 96050000 */ lhu $a1, 0x0($s0)
/* 3D7EF0 E00DC480 8EA20000 */ lw $v0, 0x0($s5)
/* 3D7EF4 E00DC484 00052980 */ sll $a1, $a1, 6
/* 3D7EF8 E00DC488 00BE2821 */ addu $a1, $a1, $fp
/* 3D7EFC E00DC48C 0C080118 */ jal shim_guMtxF2L
/* 3D7F00 E00DC490 00452821 */ addu $a1, $v0, $a1
/* 3D7F04 E00DC494 3C03DA38 */ lui $v1, (0xDA380002 >> 16)
/* 3D7F08 E00DC498 34630002 */ ori $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3D7F0C E00DC49C 3C06DA38 */ lui $a2, (0xDA380001 >> 16)
/* 3D7F10 E00DC4A0 34C60001 */ ori $a2, $a2, (0xDA380001 & 0xFFFF)
/* 3D7F14 E00DC4A4 3C09D838 */ lui $t1, (0xD8380002 >> 16)
/* 3D7F18 E00DC4A8 35290002 */ ori $t1, $t1, (0xD8380002 & 0xFFFF)
/* 3D7F1C E00DC4AC 32F700FF */ andi $s7, $s7, 0xFF
/* 3D7F20 E00DC4B0 3C08DE00 */ lui $t0, (0xDE000000 >> 16)
/* 3D7F24 E00DC4B4 8E850000 */ lw $a1, 0x0($s4)
/* 3D7F28 E00DC4B8 96020000 */ lhu $v0, 0x0($s0)
/* 3D7F2C E00DC4BC 00A0202D */ daddu $a0, $a1, $zero
/* 3D7F30 E00DC4C0 24A50008 */ addiu $a1, $a1, 0x8
/* 3D7F34 E00DC4C4 AE850000 */ sw $a1, 0x0($s4)
/* 3D7F38 E00DC4C8 AC830000 */ sw $v1, 0x0($a0)
/* 3D7F3C E00DC4CC 24430001 */ addiu $v1, $v0, 0x1
/* 3D7F40 E00DC4D0 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 3D7F44 E00DC4D4 00021180 */ sll $v0, $v0, 6
/* 3D7F48 E00DC4D8 A6030000 */ sh $v1, 0x0($s0)
/* 3D7F4C E00DC4DC 8EA30000 */ lw $v1, 0x0($s5)
/* 3D7F50 E00DC4E0 005E1021 */ addu $v0, $v0, $fp
/* 3D7F54 E00DC4E4 00621821 */ addu $v1, $v1, $v0
/* 3D7F58 E00DC4E8 24A20008 */ addiu $v0, $a1, 0x8
/* 3D7F5C E00DC4EC AC830004 */ sw $v1, 0x4($a0)
/* 3D7F60 E00DC4F0 AE820000 */ sw $v0, 0x0($s4)
/* 3D7F64 E00DC4F4 24A20010 */ addiu $v0, $a1, 0x10
/* 3D7F68 E00DC4F8 ACA60000 */ sw $a2, 0x0($a1)
/* 3D7F6C E00DC4FC AE820000 */ sw $v0, 0x0($s4)
/* 3D7F70 E00DC500 8E230204 */ lw $v1, 0x204($s1)
/* 3D7F74 E00DC504 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 3D7F78 E00DC508 ACA20008 */ sw $v0, 0x8($a1)
/* 3D7F7C E00DC50C ACA30004 */ sw $v1, 0x4($a1)
/* 3D7F80 E00DC510 9242001B */ lbu $v0, 0x1B($s2)
/* 3D7F84 E00DC514 9244001F */ lbu $a0, 0x1F($s2)
/* 3D7F88 E00DC518 92460023 */ lbu $a2, 0x23($s2)
/* 3D7F8C E00DC51C 24A30018 */ addiu $v1, $a1, 0x18
/* 3D7F90 E00DC520 AE830000 */ sw $v1, 0x0($s4)
/* 3D7F94 E00DC524 3C03FB00 */ lui $v1, (0xFB000000 >> 16)
/* 3D7F98 E00DC528 ACA30010 */ sw $v1, 0x10($a1)
/* 3D7F9C E00DC52C 00021600 */ sll $v0, $v0, 24
/* 3D7FA0 E00DC530 00042400 */ sll $a0, $a0, 16
/* 3D7FA4 E00DC534 00441025 */ or $v0, $v0, $a0
/* 3D7FA8 E00DC538 00063200 */ sll $a2, $a2, 8
/* 3D7FAC E00DC53C 00461025 */ or $v0, $v0, $a2
/* 3D7FB0 E00DC540 00571025 */ or $v0, $v0, $s7
/* 3D7FB4 E00DC544 ACA2000C */ sw $v0, 0xC($a1)
/* 3D7FB8 E00DC548 9243002B */ lbu $v1, 0x2B($s2)
/* 3D7FBC E00DC54C 9244002F */ lbu $a0, 0x2F($s2)
/* 3D7FC0 E00DC550 92460033 */ lbu $a2, 0x33($s2)
/* 3D7FC4 E00DC554 92470037 */ lbu $a3, 0x37($s2)
/* 3D7FC8 E00DC558 24A20020 */ addiu $v0, $a1, 0x20
/* 3D7FCC E00DC55C AE820000 */ sw $v0, 0x0($s4)
/* 3D7FD0 E00DC560 24A20028 */ addiu $v0, $a1, 0x28
/* 3D7FD4 E00DC564 ACA80018 */ sw $t0, 0x18($a1)
/* 3D7FD8 E00DC568 AE820000 */ sw $v0, 0x0($s4)
/* 3D7FDC E00DC56C 32C20FFF */ andi $v0, $s6, 0xFFF
/* 3D7FE0 E00DC570 26D6003C */ addiu $s6, $s6, 0x3C
/* 3D7FE4 E00DC574 32D60FFF */ andi $s6, $s6, 0xFFF
/* 3D7FE8 E00DC578 00031E00 */ sll $v1, $v1, 24
/* 3D7FEC E00DC57C 00042400 */ sll $a0, $a0, 16
/* 3D7FF0 E00DC580 00641825 */ or $v1, $v1, $a0
/* 3D7FF4 E00DC584 00063200 */ sll $a2, $a2, 8
/* 3D7FF8 E00DC588 00661825 */ or $v1, $v1, $a2
/* 3D7FFC E00DC58C 00671825 */ or $v1, $v1, $a3
/* 3D8000 E00DC590 32640FFF */ andi $a0, $s3, 0xFFF
/* 3D8004 E00DC594 00042300 */ sll $a0, $a0, 12
/* 3D8008 E00DC598 ACA30014 */ sw $v1, 0x14($a1)
/* 3D800C E00DC59C 3C03F200 */ lui $v1, (0xF2000000 >> 16)
/* 3D8010 E00DC5A0 00431025 */ or $v0, $v0, $v1
/* 3D8014 E00DC5A4 00822025 */ or $a0, $a0, $v0
/* 3D8018 E00DC5A8 2673007C */ addiu $s3, $s3, 0x7C
/* 3D801C E00DC5AC 32730FFF */ andi $s3, $s3, 0xFFF
/* 3D8020 E00DC5B0 8FAA0098 */ lw $t2, 0x98($sp)
/* 3D8024 E00DC5B4 00139B00 */ sll $s3, $s3, 12
/* 3D8028 E00DC5B8 000A9080 */ sll $s2, $t2, 2
/* 3D802C E00DC5BC 3C03E00E */ lui $v1, (0xE00E0000 >> 16)
/* 3D8030 E00DC5C0 00721821 */ addu $v1, $v1, $s2
/* 3D8034 E00DC5C4 8C63C648 */ lw $v1, -0x39B8($v1)
/* 3D8038 E00DC5C8 02769825 */ or $s3, $s3, $s6
/* 3D803C E00DC5CC ACA40020 */ sw $a0, 0x20($a1)
/* 3D8040 E00DC5D0 ACB30024 */ sw $s3, 0x24($a1)
/* 3D8044 E00DC5D4 ACA80028 */ sw $t0, 0x28($a1)
/* 3D8048 E00DC5D8 ACA3001C */ sw $v1, 0x1C($a1)
/* 3D804C E00DC5DC 3C03E00E */ lui $v1, (0xE00E0000 >> 16)
/* 3D8050 E00DC5E0 00721821 */ addu $v1, $v1, $s2
/* 3D8054 E00DC5E4 8C63C640 */ lw $v1, -0x39C0($v1)
/* 3D8058 E00DC5E8 24A20030 */ addiu $v0, $a1, 0x30
/* 3D805C E00DC5EC AE820000 */ sw $v0, 0x0($s4)
/* 3D8060 E00DC5F0 24A20038 */ addiu $v0, $a1, 0x38
/* 3D8064 E00DC5F4 ACA3002C */ sw $v1, 0x2C($a1)
/* 3D8068 E00DC5F8 AE820000 */ sw $v0, 0x0($s4)
/* 3D806C E00DC5FC 24020040 */ addiu $v0, $zero, 0x40
/* 3D8070 E00DC600 ACA90030 */ sw $t1, 0x30($a1)
/* 3D8074 E00DC604 ACA20034 */ sw $v0, 0x34($a1)
/* 3D8078 E00DC608 8FBF00C4 */ lw $ra, 0xC4($sp)
/* 3D807C E00DC60C 8FBE00C0 */ lw $fp, 0xC0($sp)
/* 3D8080 E00DC610 8FB700BC */ lw $s7, 0xBC($sp)
/* 3D8084 E00DC614 8FB600B8 */ lw $s6, 0xB8($sp)
/* 3D8088 E00DC618 8FB500B4 */ lw $s5, 0xB4($sp)
/* 3D808C E00DC61C 8FB400B0 */ lw $s4, 0xB0($sp)
/* 3D8090 E00DC620 8FB300AC */ lw $s3, 0xAC($sp)
/* 3D8094 E00DC624 8FB200A8 */ lw $s2, 0xA8($sp)
/* 3D8098 E00DC628 8FB100A4 */ lw $s1, 0xA4($sp)
/* 3D809C E00DC62C 8FB000A0 */ lw $s0, 0xA0($sp)
/* 3D80A0 E00DC630 03E00008 */ jr $ra
/* 3D80A4 E00DC634 27BD00C8 */ addiu $sp, $sp, 0xC8
/* 3D80A8 E00DC638 00000000 */ nop
/* 3D80AC E00DC63C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void huff_puff_breath_appendGfx(void* effect) {
HuffPuffBreathFXData* data = ((EffectInstance*)effect)->data.huffPuffBreath;
Camera* camera = &gCameras[gCurrentCameraID];
s32 primA = data->primA;
s32 unk_00 = data->type;
s32 uls = data->texOffsetX * 4.0f;
s32 ult = data->texOffsetY * 4.0f;
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, data->angle, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, data->scale, data->scale, data->scale);
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);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primR, data->primG, data->primB, primA);
gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, data->envA);
gSPDisplayList(gMainGfxPos++, D_E00DC648[unk_00]);
gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, uls, ult, uls + 31 * 4, ult + 15 * 4);
gSPDisplayList(gMainGfxPos++, D_E00DC640[unk_00]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_802591EC
/* 187ACC 802591EC 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 187AD0 802591F0 00A0482D */ daddu $t1, $a1, $zero
/* 187AD4 802591F4 00C0502D */ daddu $t2, $a2, $zero
/* 187AD8 802591F8 AFBF0018 */ sw $ra, 0x18($sp)
/* 187ADC 802591FC 8D250000 */ lw $a1, 0x0($t1)
/* 187AE0 80259200 8FA80030 */ lw $t0, 0x30($sp)
/* 187AE4 80259204 30A20002 */ andi $v0, $a1, 0x2
/* 187AE8 80259208 10400033 */ beqz $v0, .L802592D8
/* 187AEC 8025920C 00E0582D */ daddu $t3, $a3, $zero
/* 187AF0 80259210 240600FF */ addiu $a2, $zero, 0xFF
/* 187AF4 80259214 85230098 */ lh $v1, 0x98($t1)
/* 187AF8 80259218 0066102A */ slt $v0, $v1, $a2
/* 187AFC 8025921C 10400003 */ beqz $v0, .L8025922C
/* 187B00 80259220 0000402D */ daddu $t0, $zero, $zero
/* 187B04 80259224 3C088000 */ lui $t0, (0x80000000 >> 16)
/* 187B08 80259228 0060302D */ daddu $a2, $v1, $zero
.L8025922C:
/* 187B0C 8025922C 30A20100 */ andi $v0, $a1, 0x100
/* 187B10 80259230 1040000C */ beqz $v0, .L80259264
/* 187B14 80259234 3C038080 */ lui $v1, (0x80808081 >> 16)
/* 187B18 80259238 34638081 */ ori $v1, $v1, (0x80808081 & 0xFFFF)
/* 187B1C 8025923C 00061100 */ sll $v0, $a2, 4
/* 187B20 80259240 00461023 */ subu $v0, $v0, $a2
/* 187B24 80259244 000210C0 */ sll $v0, $v0, 3
/* 187B28 80259248 00430018 */ mult $v0, $v1
/* 187B2C 8025924C 3C088000 */ lui $t0, (0x80000000 >> 16)
/* 187B30 80259250 00006010 */ mfhi $t4
/* 187B34 80259254 01821821 */ addu $v1, $t4, $v0
/* 187B38 80259258 000319C3 */ sra $v1, $v1, 7
/* 187B3C 8025925C 000217C3 */ sra $v0, $v0, 31
/* 187B40 80259260 00623023 */ subu $a2, $v1, $v0
.L80259264:
/* 187B44 80259264 1480000D */ bnez $a0, .L8025929C
/* 187B48 80259268 240200FF */ addiu $v0, $zero, 0xFF
/* 187B4C 8025926C 14C20005 */ bne $a2, $v0, .L80259284
/* 187B50 80259270 AFAB0010 */ sw $t3, 0x10($sp)
/* 187B54 80259274 0000202D */ daddu $a0, $zero, $zero
/* 187B58 80259278 0140282D */ daddu $a1, $t2, $zero
/* 187B5C 8025927C 080964A3 */ j .L8025928C
/* 187B60 80259280 0080302D */ daddu $a2, $a0, $zero
.L80259284:
/* 187B64 80259284 0100202D */ daddu $a0, $t0, $zero
/* 187B68 80259288 0140282D */ daddu $a1, $t2, $zero
.L8025928C:
/* 187B6C 8025928C 0C0B7710 */ jal spr_draw_player_sprite
/* 187B70 80259290 0000382D */ daddu $a3, $zero, $zero
/* 187B74 80259294 08096522 */ j .L80259488
/* 187B78 80259298 0000102D */ daddu $v0, $zero, $zero
.L8025929C:
/* 187B7C 8025929C 14C20006 */ bne $a2, $v0, .L802592B8
/* 187B80 802592A0 0140282D */ daddu $a1, $t2, $zero
/* 187B84 802592A4 0000302D */ daddu $a2, $zero, $zero
/* 187B88 802592A8 AFAB0010 */ sw $t3, 0x10($sp)
/* 187B8C 802592AC 8D240084 */ lw $a0, 0x84($t1)
/* 187B90 802592B0 080964B2 */ j .L802592C8
/* 187B94 802592B4 00C0382D */ daddu $a3, $a2, $zero
.L802592B8:
/* 187B98 802592B8 8D240084 */ lw $a0, 0x84($t1)
/* 187B9C 802592BC 0000382D */ daddu $a3, $zero, $zero
/* 187BA0 802592C0 AFAB0010 */ sw $t3, 0x10($sp)
/* 187BA4 802592C4 00882025 */ or $a0, $a0, $t0
.L802592C8:
/* 187BA8 802592C8 0C0B78F6 */ jal spr_draw_npc_sprite
/* 187BAC 802592CC 00000000 */ nop
/* 187BB0 802592D0 08096522 */ j .L80259488
/* 187BB4 802592D4 0000102D */ daddu $v0, $zero, $zero
.L802592D8:
/* 187BB8 802592D8 8D2200C0 */ lw $v0, 0xC0($t1)
/* 187BBC 802592DC 804306C0 */ lb $v1, 0x6C0($v0)
/* 187BC0 802592E0 2C620011 */ sltiu $v0, $v1, 0x11
/* 187BC4 802592E4 10400067 */ beqz $v0, .L80259484
/* 187BC8 802592E8 00031080 */ sll $v0, $v1, 2
/* 187BCC 802592EC 3C01802A */ lui $at, %hi(jtbl_8029D3A0)
/* 187BD0 802592F0 00220821 */ addu $at, $at, $v0
/* 187BD4 802592F4 8C22D3A0 */ lw $v0, %lo(jtbl_8029D3A0)($at)
/* 187BD8 802592F8 00400008 */ jr $v0
/* 187BDC 802592FC 00000000 */ nop
glabel .L80259300
/* 187BE0 80259300 AFA80010 */ sw $t0, 0x10($sp)
/* 187BE4 80259304 0120282D */ daddu $a1, $t1, $zero
/* 187BE8 80259308 0140302D */ daddu $a2, $t2, $zero
/* 187BEC 8025930C 0C096692 */ jal func_80259A48
/* 187BF0 80259310 0160382D */ daddu $a3, $t3, $zero
/* 187BF4 80259314 08096522 */ j .L80259488
/* 187BF8 80259318 0000102D */ daddu $v0, $zero, $zero
glabel .L8025931C
/* 187BFC 8025931C AFA80010 */ sw $t0, 0x10($sp)
/* 187C00 80259320 0120282D */ daddu $a1, $t1, $zero
/* 187C04 80259324 0140302D */ daddu $a2, $t2, $zero
/* 187C08 80259328 0C0966AB */ jal func_80259AAC
/* 187C0C 8025932C 0160382D */ daddu $a3, $t3, $zero
/* 187C10 80259330 08096522 */ j .L80259488
/* 187C14 80259334 0000102D */ daddu $v0, $zero, $zero
glabel .L80259338
/* 187C18 80259338 AFA80010 */ sw $t0, 0x10($sp)
/* 187C1C 8025933C 0120282D */ daddu $a1, $t1, $zero
/* 187C20 80259340 0140302D */ daddu $a2, $t2, $zero
/* 187C24 80259344 0C096767 */ jal func_80259D9C
/* 187C28 80259348 0160382D */ daddu $a3, $t3, $zero
/* 187C2C 8025934C 08096522 */ j .L80259488
/* 187C30 80259350 0000102D */ daddu $v0, $zero, $zero
glabel .L80259354
/* 187C34 80259354 AFA80010 */ sw $t0, 0x10($sp)
/* 187C38 80259358 0120282D */ daddu $a1, $t1, $zero
/* 187C3C 8025935C 0140302D */ daddu $a2, $t2, $zero
/* 187C40 80259360 0C0968B1 */ jal func_8025A2C4
/* 187C44 80259364 0160382D */ daddu $a3, $t3, $zero
/* 187C48 80259368 08096522 */ j .L80259488
/* 187C4C 8025936C 0000102D */ daddu $v0, $zero, $zero
glabel .L80259370
/* 187C50 80259370 AFA80010 */ sw $t0, 0x10($sp)
/* 187C54 80259374 0120282D */ daddu $a1, $t1, $zero
/* 187C58 80259378 0140302D */ daddu $a2, $t2, $zero
/* 187C5C 8025937C 0C096943 */ jal func_8025A50C
/* 187C60 80259380 0160382D */ daddu $a3, $t3, $zero
/* 187C64 80259384 08096522 */ j .L80259488
/* 187C68 80259388 0000102D */ daddu $v0, $zero, $zero
glabel .L8025938C
/* 187C6C 8025938C AFA80010 */ sw $t0, 0x10($sp)
/* 187C70 80259390 0120282D */ daddu $a1, $t1, $zero
/* 187C74 80259394 0140302D */ daddu $a2, $t2, $zero
/* 187C78 80259398 0C0969D3 */ jal func_8025A74C
/* 187C7C 8025939C 0160382D */ daddu $a3, $t3, $zero
/* 187C80 802593A0 08096522 */ j .L80259488
/* 187C84 802593A4 0000102D */ daddu $v0, $zero, $zero
glabel .L802593A8
/* 187C88 802593A8 AFA80010 */ sw $t0, 0x10($sp)
/* 187C8C 802593AC 0120282D */ daddu $a1, $t1, $zero
/* 187C90 802593B0 0140302D */ daddu $a2, $t2, $zero
/* 187C94 802593B4 0C096AA0 */ jal func_8025AA80
/* 187C98 802593B8 0160382D */ daddu $a3, $t3, $zero
/* 187C9C 802593BC 08096522 */ j .L80259488
/* 187CA0 802593C0 0000102D */ daddu $v0, $zero, $zero
glabel .L802593C4
/* 187CA4 802593C4 AFA80010 */ sw $t0, 0x10($sp)
/* 187CA8 802593C8 0120282D */ daddu $a1, $t1, $zero
/* 187CAC 802593CC 0140302D */ daddu $a2, $t2, $zero
/* 187CB0 802593D0 0C096B64 */ jal func_8025AD90
/* 187CB4 802593D4 0160382D */ daddu $a3, $t3, $zero
/* 187CB8 802593D8 08096522 */ j .L80259488
/* 187CBC 802593DC 0000102D */ daddu $v0, $zero, $zero
glabel .L802593E0
/* 187CC0 802593E0 AFA80010 */ sw $t0, 0x10($sp)
/* 187CC4 802593E4 0120282D */ daddu $a1, $t1, $zero
/* 187CC8 802593E8 0140302D */ daddu $a2, $t2, $zero
/* 187CCC 802593EC 0C096C6A */ jal func_8025B1A8
/* 187CD0 802593F0 0160382D */ daddu $a3, $t3, $zero
/* 187CD4 802593F4 08096522 */ j .L80259488
/* 187CD8 802593F8 0000102D */ daddu $v0, $zero, $zero
glabel .L802593FC
/* 187CDC 802593FC 0120282D */ daddu $a1, $t1, $zero
/* 187CE0 80259400 0140302D */ daddu $a2, $t2, $zero
/* 187CE4 80259404 0160382D */ daddu $a3, $t3, $zero
/* 187CE8 80259408 AFA80010 */ sw $t0, 0x10($sp)
/* 187CEC 8025940C 0C096D70 */ jal func_8025B5C0
/* 187CF0 80259410 AFA00014 */ sw $zero, 0x14($sp)
/* 187CF4 80259414 08096522 */ j .L80259488
/* 187CF8 80259418 0000102D */ daddu $v0, $zero, $zero
glabel .L8025941C
/* 187CFC 8025941C 0120282D */ daddu $a1, $t1, $zero
/* 187D00 80259420 0140302D */ daddu $a2, $t2, $zero
/* 187D04 80259424 0160382D */ daddu $a3, $t3, $zero
/* 187D08 80259428 24020001 */ addiu $v0, $zero, 0x1
/* 187D0C 8025942C AFA80010 */ sw $t0, 0x10($sp)
/* 187D10 80259430 0C096D70 */ jal func_8025B5C0
/* 187D14 80259434 AFA20014 */ sw $v0, 0x14($sp)
/* 187D18 80259438 08096522 */ j .L80259488
/* 187D1C 8025943C 0000102D */ daddu $v0, $zero, $zero
glabel .L80259440
/* 187D20 80259440 0120282D */ daddu $a1, $t1, $zero
/* 187D24 80259444 0140302D */ daddu $a2, $t2, $zero
/* 187D28 80259448 08096517 */ j .L8025945C
/* 187D2C 8025944C 0000382D */ daddu $a3, $zero, $zero
glabel .L80259450
/* 187D30 80259450 0120282D */ daddu $a1, $t1, $zero
/* 187D34 80259454 0140302D */ daddu $a2, $t2, $zero
/* 187D38 80259458 24070001 */ addiu $a3, $zero, 0x1
.L8025945C:
/* 187D3C 8025945C AFAB0010 */ sw $t3, 0x10($sp)
/* 187D40 80259460 0C096EA8 */ jal func_8025BAA0
/* 187D44 80259464 AFA80014 */ sw $t0, 0x14($sp)
/* 187D48 80259468 08096522 */ j .L80259488
/* 187D4C 8025946C 0000102D */ daddu $v0, $zero, $zero
glabel .L80259470
/* 187D50 80259470 AFA80010 */ sw $t0, 0x10($sp)
/* 187D54 80259474 0120282D */ daddu $a1, $t1, $zero
/* 187D58 80259478 0140302D */ daddu $a2, $t2, $zero
/* 187D5C 8025947C 0C097048 */ jal func_8025C120
/* 187D60 80259480 0160382D */ daddu $a3, $t3, $zero
glabel .L80259484
/* 187D64 80259484 0000102D */ daddu $v0, $zero, $zero
.L80259488:
/* 187D68 80259488 8FBF0018 */ lw $ra, 0x18($sp)
/* 187D6C 8025948C 03E00008 */ jr $ra
/* 187D70 80259490 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
s32 render_with_adjusted_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, b32 skipAnimation) {
s32 opacity;
s32 sprDrawOpts;
if (part->flags & ACTOR_PART_FLAG_2) {
opacity = 255;
sprDrawOpts = 0;
if (part->opacity < 255) {
sprDrawOpts = DRAW_SPRITE_OVERRIDE_ALPHA;
opacity = part->opacity;
}
if (part->flags & ACTOR_PART_FLAG_100) {
sprDrawOpts = DRAW_SPRITE_OVERRIDE_ALPHA;
opacity = opacity * 120 / 255;
}
if (isNpcSprite == SPRITE_MODE_PLAYER) {
if (opacity == 255) {
spr_draw_player_sprite(PLAYER_SPRITE_MAIN, yaw, 0, NULL, mtx);
} else {
spr_draw_player_sprite(PLAYER_SPRITE_MAIN | sprDrawOpts, yaw, opacity, NULL, mtx);
}
} else {
if (opacity == 255) {
spr_draw_npc_sprite(part->spriteInstanceID, yaw, 0, NULL, mtx);
} else {
spr_draw_npc_sprite(part->spriteInstanceID | sprDrawOpts, yaw, opacity, NULL, mtx);
}
}
return 0;
}
switch (part->decorationTable->paletteAdjustment) {
case PAL_ADJUST_NONE:
render_without_adjusted_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_SLEEP:
render_with_sleep_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_STATIC:
render_with_static_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_FEAR:
render_with_fear_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_POISON:
render_with_poison_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_PARALYZE:
render_with_paralyze_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_BERSERK:
render_with_berserk_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_WATT_IDLE:
render_with_watt_idle_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_WATT_ATTACK:
render_with_watt_attack_palettes(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
case PAL_ADJUST_PLAYER_DEBUFF:
render_with_player_debuff_palettes(isNpcSprite, part, yaw, mtx, skipAnimation, FALSE);
break;
case PAL_ADJUST_PLAYER_POISON:
render_with_player_debuff_palettes(isNpcSprite, part, yaw, mtx, skipAnimation, TRUE);
break;
case PAL_ADJUST_BLEND_PALETTES_UNIFORM_INTERVALS:
render_with_pal_blending(isNpcSprite, part, yaw, FALSE, mtx, skipAnimation);
break;
case PAL_ADJUST_BLEND_PALETTES_VARYING_INTERVALS:
render_with_pal_blending(isNpcSprite, part, yaw, TRUE, mtx, skipAnimation);
break;
case PAL_ADJUST_BLEND_PALSETS:
render_with_palset_blending(isNpcSprite, part, yaw, mtx, skipAnimation);
break;
default:
break;
}
return 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel entity_block_handle_collision
/* 105424 802E3BA4 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 105428 802E3BA8 AFB1001C */ sw $s1, 0x1C($sp)
/* 10542C 802E3BAC 0080882D */ daddu $s1, $a0, $zero
/* 105430 802E3BB0 AFBF0024 */ sw $ra, 0x24($sp)
/* 105434 802E3BB4 AFB20020 */ sw $s2, 0x20($sp)
/* 105438 802E3BB8 AFB00018 */ sw $s0, 0x18($sp)
/* 10543C 802E3BBC 9222000B */ lbu $v0, 0xB($s1)
/* 105440 802E3BC0 3C128011 */ lui $s2, %hi(gPlayerStatus)
/* 105444 802E3BC4 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus)
/* 105448 802E3BC8 14400005 */ bnez $v0, .L802E3BE0
/* 10544C 802E3BCC 00000000 */ nop
/* 105450 802E3BD0 92220006 */ lbu $v0, 0x6($s1)
/* 105454 802E3BD4 30420001 */ andi $v0, $v0, 0x1
/* 105458 802E3BD8 14400083 */ bnez $v0, .L802E3DE8
/* 10545C 802E3BDC 0000102D */ daddu $v0, $zero, $zero
.L802E3BE0:
/* 105460 802E3BE0 92230006 */ lbu $v1, 0x6($s1)
/* 105464 802E3BE4 30620004 */ andi $v0, $v1, 0x4
/* 105468 802E3BE8 10400016 */ beqz $v0, .L802E3C44
/* 10546C 802E3BEC 30620080 */ andi $v0, $v1, 0x80
/* 105470 802E3BF0 92240004 */ lbu $a0, 0x4($s1)
/* 105474 802E3BF4 0C0441A9 */ jal get_entity_type
/* 105478 802E3BF8 00000000 */ nop
/* 10547C 802E3BFC 0040182D */ daddu $v1, $v0, $zero
/* 105480 802E3C00 2402000C */ addiu $v0, $zero, 0xC
/* 105484 802E3C04 10620019 */ beq $v1, $v0, .L802E3C6C
/* 105488 802E3C08 0062102A */ slt $v0, $v1, $v0
/* 10548C 802E3C0C 14400005 */ bnez $v0, .L802E3C24
/* 105490 802E3C10 2862001B */ slti $v0, $v1, 0x1B
/* 105494 802E3C14 10400003 */ beqz $v0, .L802E3C24
/* 105498 802E3C18 28620015 */ slti $v0, $v1, 0x15
/* 10549C 802E3C1C 10400072 */ beqz $v0, .L802E3DE8
/* 1054A0 802E3C20 0000102D */ daddu $v0, $zero, $zero
.L802E3C24:
/* 1054A4 802E3C24 8E420000 */ lw $v0, 0x0($s2)
/* 1054A8 802E3C28 30420002 */ andi $v0, $v0, 0x2
/* 1054AC 802E3C2C 1040006E */ beqz $v0, .L802E3DE8
/* 1054B0 802E3C30 24020001 */ addiu $v0, $zero, 0x1
glabel .L802E3C34
/* 1054B4 802E3C34 0C043F5A */ jal exec_entity_commandlist
/* 1054B8 802E3C38 0220202D */ daddu $a0, $s1, $zero
/* 1054BC 802E3C3C 080B8F7A */ j .L802E3DE8
/* 1054C0 802E3C40 24020001 */ addiu $v0, $zero, 0x1
.L802E3C44:
/* 1054C4 802E3C44 1440FFFB */ bnez $v0, .L802E3C34
/* 1054C8 802E3C48 30620001 */ andi $v0, $v1, 0x1
/* 1054CC 802E3C4C 1040000F */ beqz $v0, .L802E3C8C
/* 1054D0 802E3C50 0000802D */ daddu $s0, $zero, $zero
/* 1054D4 802E3C54 824300B4 */ lb $v1, 0xB4($s2)
/* 1054D8 802E3C58 2402000D */ addiu $v0, $zero, 0xD
/* 1054DC 802E3C5C 10620003 */ beq $v1, $v0, .L802E3C6C
/* 1054E0 802E3C60 2402000F */ addiu $v0, $zero, 0xF
/* 1054E4 802E3C64 14620003 */ bne $v1, $v0, .L802E3C74
/* 1054E8 802E3C68 2402000E */ addiu $v0, $zero, 0xE
.L802E3C6C:
/* 1054EC 802E3C6C 080B8F7A */ j .L802E3DE8
/* 1054F0 802E3C70 0000102D */ daddu $v0, $zero, $zero
.L802E3C74:
/* 1054F4 802E3C74 10620003 */ beq $v1, $v0, .L802E3C84
/* 1054F8 802E3C78 24020010 */ addiu $v0, $zero, 0x10
/* 1054FC 802E3C7C 1462005A */ bne $v1, $v0, .L802E3DE8
/* 105500 802E3C80 24020001 */ addiu $v0, $zero, 0x1
.L802E3C84:
/* 105504 802E3C84 080B8F2A */ j .L802E3CA8
/* 105508 802E3C88 24100001 */ addiu $s0, $zero, 0x1
.L802E3C8C:
/* 10550C 802E3C8C 30620040 */ andi $v0, $v1, 0x40
/* 105510 802E3C90 10400054 */ beqz $v0, .L802E3DE4
/* 105514 802E3C94 3C030100 */ lui $v1, (0x1000000 >> 16)
/* 105518 802E3C98 8E420000 */ lw $v0, 0x0($s2)
/* 10551C 802E3C9C 00431024 */ and $v0, $v0, $v1
/* 105520 802E3CA0 10400051 */ beqz $v0, .L802E3DE8
/* 105524 802E3CA4 24020001 */ addiu $v0, $zero, 0x1
.L802E3CA8:
/* 105528 802E3CA8 92240004 */ lbu $a0, 0x4($s1)
/* 10552C 802E3CAC 0C0441A9 */ jal get_entity_type
/* 105530 802E3CB0 00000000 */ nop
/* 105534 802E3CB4 2443FFF5 */ addiu $v1, $v0, -0xB
/* 105538 802E3CB8 2C620015 */ sltiu $v0, $v1, 0x15
/* 10553C 802E3CBC 10400049 */ beqz $v0, .L802E3DE4
/* 105540 802E3CC0 00031080 */ sll $v0, $v1, 2
/* 105544 802E3CC4 3C01802F */ lui $at, %hi(jtbl_802EB210)
/* 105548 802E3CC8 00220821 */ addu $at, $at, $v0
/* 10554C 802E3CCC 8C22B210 */ lw $v0, %lo(jtbl_802EB210)($at)
/* 105550 802E3CD0 00400008 */ jr $v0
/* 105554 802E3CD4 00000000 */ nop
glabel .L802E3CD8
/* 105558 802E3CD8 12000007 */ beqz $s0, .L802E3CF8
/* 10555C 802E3CDC 00000000 */ nop
/* 105560 802E3CE0 3C028011 */ lui $v0, %hi(gPlayerData)
/* 105564 802E3CE4 8042F290 */ lb $v0, %lo(gPlayerData)($v0)
/* 105568 802E3CE8 58400007 */ blezl $v0, .L802E3D08
/* 10556C 802E3CEC 0000802D */ daddu $s0, $zero, $zero
/* 105570 802E3CF0 080B8F42 */ j .L802E3D08
/* 105574 802E3CF4 00000000 */ nop
.L802E3CF8:
/* 105578 802E3CF8 3C028011 */ lui $v0, %hi(gPlayerData + 0x1)
/* 10557C 802E3CFC 8042F291 */ lb $v0, %lo(gPlayerData + 0x1)($v0)
/* 105580 802E3D00 04430001 */ bgezl $v0, .L802E3D08
/* 105584 802E3D04 24100001 */ addiu $s0, $zero, 0x1
.L802E3D08:
/* 105588 802E3D08 12000037 */ beqz $s0, .L802E3DE8
/* 10558C 802E3D0C 24020001 */ addiu $v0, $zero, 0x1
/* 105590 802E3D10 3C05802F */ lui $a1, %hi(D_802E9E80)
/* 105594 802E3D14 24A59E80 */ addiu $a1, $a1, %lo(D_802E9E80)
/* 105598 802E3D18 0C043EF0 */ jal set_entity_commandlist
/* 10559C 802E3D1C 0220202D */ daddu $a0, $s1, $zero
/* 1055A0 802E3D20 C6200050 */ lwc1 $f0, 0x50($s1)
/* 1055A4 802E3D24 080B8F6C */ j .L802E3DB0
/* 1055A8 802E3D28 2404014F */ addiu $a0, $zero, 0x14F
glabel .L802E3D2C
/* 1055AC 802E3D2C 12000008 */ beqz $s0, .L802E3D50
/* 1055B0 802E3D30 00000000 */ nop
/* 1055B4 802E3D34 3C028011 */ lui $v0, %hi(gPlayerData)
/* 1055B8 802E3D38 8042F290 */ lb $v0, %lo(gPlayerData)($v0)
/* 1055BC 802E3D3C 28420002 */ slti $v0, $v0, 0x2
/* 1055C0 802E3D40 54400007 */ bnel $v0, $zero, .L802E3D60
/* 1055C4 802E3D44 0000802D */ daddu $s0, $zero, $zero
/* 1055C8 802E3D48 080B8F58 */ j .L802E3D60
/* 1055CC 802E3D4C 00000000 */ nop
.L802E3D50:
/* 1055D0 802E3D50 3C028011 */ lui $v0, %hi(gPlayerData + 0x1)
/* 1055D4 802E3D54 8042F291 */ lb $v0, %lo(gPlayerData + 0x1)($v0)
/* 1055D8 802E3D58 5C400001 */ bgtzl $v0, .L802E3D60
/* 1055DC 802E3D5C 24100001 */ addiu $s0, $zero, 0x1
.L802E3D60:
/* 1055E0 802E3D60 12000021 */ beqz $s0, .L802E3DE8
/* 1055E4 802E3D64 24020001 */ addiu $v0, $zero, 0x1
/* 1055E8 802E3D68 3C05802F */ lui $a1, %hi(D_802E9E80)
/* 1055EC 802E3D6C 24A59E80 */ addiu $a1, $a1, %lo(D_802E9E80)
/* 1055F0 802E3D70 0C043EF0 */ jal set_entity_commandlist
/* 1055F4 802E3D74 0220202D */ daddu $a0, $s1, $zero
/* 1055F8 802E3D78 C6200050 */ lwc1 $f0, 0x50($s1)
/* 1055FC 802E3D7C 080B8F6C */ j .L802E3DB0
/* 105600 802E3D80 24040150 */ addiu $a0, $zero, 0x150
glabel .L802E3D84
/* 105604 802E3D84 3C028011 */ lui $v0, %hi(gPlayerData + 0x1)
/* 105608 802E3D88 8042F291 */ lb $v0, %lo(gPlayerData + 0x1)($v0)
/* 10560C 802E3D8C 28420002 */ slti $v0, $v0, 0x2
/* 105610 802E3D90 14400015 */ bnez $v0, .L802E3DE8
/* 105614 802E3D94 24020001 */ addiu $v0, $zero, 0x1
/* 105618 802E3D98 3C05802F */ lui $a1, %hi(D_802E9E80)
/* 10561C 802E3D9C 24A59E80 */ addiu $a1, $a1, %lo(D_802E9E80)
/* 105620 802E3DA0 0C043EF0 */ jal set_entity_commandlist
/* 105624 802E3DA4 0220202D */ daddu $a0, $s1, $zero
/* 105628 802E3DA8 C6200050 */ lwc1 $f0, 0x50($s1)
/* 10562C 802E3DAC 24040151 */ addiu $a0, $zero, 0x151
.L802E3DB0:
/* 105630 802E3DB0 E7A00010 */ swc1 $f0, 0x10($sp)
/* 105634 802E3DB4 8E260048 */ lw $a2, 0x48($s1)
/* 105638 802E3DB8 8E27004C */ lw $a3, 0x4C($s1)
/* 10563C 802E3DBC 0C052757 */ jal sfx_play_sound_at_position
/* 105640 802E3DC0 0000282D */ daddu $a1, $zero, $zero
/* 105644 802E3DC4 080B8F7A */ j .L802E3DE8
/* 105648 802E3DC8 24020001 */ addiu $v0, $zero, 0x1
glabel .L802E3DCC
/* 10564C 802E3DCC 0C04419E */ jal entity_start_script
/* 105650 802E3DD0 0220202D */ daddu $a0, $s1, $zero
/* 105654 802E3DD4 080B8F0D */ j .L802E3C34
/* 105658 802E3DD8 00000000 */ nop
glabel .L802E3DDC
/* 10565C 802E3DDC 0C04419E */ jal entity_start_script
/* 105660 802E3DE0 0220202D */ daddu $a0, $s1, $zero
glabel .L802E3DE4
/* 105664 802E3DE4 24020001 */ addiu $v0, $zero, 0x1
.L802E3DE8:
/* 105668 802E3DE8 8FBF0024 */ lw $ra, 0x24($sp)
/* 10566C 802E3DEC 8FB20020 */ lw $s2, 0x20($sp)
/* 105670 802E3DF0 8FB1001C */ lw $s1, 0x1C($sp)
/* 105674 802E3DF4 8FB00018 */ lw $s0, 0x18($sp)
/* 105678 802E3DF8 03E00008 */ jr $ra
/* 10567C 802E3DFC 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
s32 entity_block_handle_collision(Entity* entity) {
s32 breakBlock;
PlayerStatus* playerStatus = &gPlayerStatus;
if (entity->alpha == 0 && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR)) {
return FALSE;
}
if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_CEILING) {
s32 type = get_entity_type(entity->listIndex);
switch (type) {
case ENTITY_TYPE_PUSH_BLOCK:
case ENTITY_TYPE_HAMMER1_BLOCK:
case ENTITY_TYPE_HAMMER2_BLOCK:
case ENTITY_TYPE_HAMMER3_BLOCK:
case ENTITY_TYPE_HAMMER1_BLOCK_TINY:
case ENTITY_TYPE_HAMMER2_BLOCK_TINY:
case ENTITY_TYPE_HAMMER3_BLOCK_TINY:
return FALSE;
}
if (playerStatus->flags & PS_FLAG_JUMPING) {
exec_entity_commandlist(entity);
}
return TRUE;
}
if (entity->collisionFlags & ENTITY_COLLISION_PARTNER) {
exec_entity_commandlist(entity);
return TRUE;
}
breakBlock = FALSE;
if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) {
if (playerStatus->actionState == ACTION_STATE_SPIN_JUMP || playerStatus->actionState == ACTION_STATE_TORNADO_JUMP) {
return FALSE;
}
if (playerStatus->actionState == ACTION_STATE_SPIN_POUND || playerStatus->actionState == ACTION_STATE_TORNADO_POUND) {
breakBlock = TRUE;
} else {
return TRUE;
}
} else {
if (!(entity->collisionFlags & ENTITY_COLLISION_PLAYER_HAMMER)) {
return TRUE;
}
if (!(playerStatus->flags & PS_FLAG_HAMMER_CHECK)) {
return TRUE;
}
}
switch (get_entity_type(entity->listIndex)) {
case ENTITY_TYPE_BRICK_BLOCK:
case ENTITY_TYPE_MULTI_COIN_BRICK:
case ENTITY_TYPE_YELLOW_BLOCK:
case ENTITY_TYPE_SINGLE_TRIGGER_BLOCK:
case ENTITY_TYPE_HIDDEN_YELLOW_BLOCK:
case ENTITY_TYPE_HIDDEN_RED_BLOCK:
case ENTITY_TYPE_RED_BLOCK:
exec_entity_commandlist(entity);
break;
case ENTITY_TYPE_HAMMER1_BLOCK:
case ENTITY_TYPE_HAMMER1_BLOCK_TINY:
if (breakBlock) {
if (gPlayerData.bootsLevel < 1) {
breakBlock = FALSE;
}
} else {
if (gPlayerData.hammerLevel > -1) {
breakBlock = TRUE;
}
}
if (!breakBlock) {
return TRUE;
}
set_entity_commandlist(entity, Entity_BreakingBlock_Script);
sfx_play_sound_at_position(SOUND_14F, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
break;
case ENTITY_TYPE_HAMMER2_BLOCK:
case ENTITY_TYPE_HAMMER2_BLOCK_TINY:
if (breakBlock) {
if (gPlayerData.bootsLevel < 2) {
breakBlock = FALSE;
}
} else if (gPlayerData.hammerLevel > 0) {
breakBlock = TRUE;
}
if (!breakBlock) {
return TRUE;
}
set_entity_commandlist(entity, Entity_BreakingBlock_Script);
sfx_play_sound_at_position(SOUND_150, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
break;
case ENTITY_TYPE_HAMMER3_BLOCK:
case ENTITY_TYPE_HAMMER3_BLOCK_TINY:
if (gPlayerData.hammerLevel < 2) {
return TRUE;
}
set_entity_commandlist(entity, Entity_BreakingBlock_Script);
sfx_play_sound_at_position(SOUND_151, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z);
break;
case ENTITY_TYPE_MULTI_TRIGGER_BLOCK:
case ENTITY_TYPE_HEALING_BLOCK:
case ENTITY_TYPE_1C:
case ENTITY_TYPE_1D:
case ENTITY_TYPE_1E:
case ENTITY_TYPE_HEALING_BLOCK_FRAME:
entity_start_script(entity);
exec_entity_commandlist(entity);
break;
case ENTITY_TYPE_PUSH_BLOCK:
entity_start_script(entity);
break;
case ENTITY_TYPE_INACTIVE_BLOCK:
break;
}
return TRUE;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel SummonEnemy
/* 19C444 8026DB64 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 19C448 8026DB68 AFB20018 */ sw $s2, 0x18($sp)
/* 19C44C 8026DB6C 0080902D */ daddu $s2, $a0, $zero
/* 19C450 8026DB70 AFB10014 */ sw $s1, 0x14($sp)
/* 19C454 8026DB74 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 19C458 8026DB78 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 19C45C 8026DB7C AFBF001C */ sw $ra, 0x1C($sp)
/* 19C460 8026DB80 AFB00010 */ sw $s0, 0x10($sp)
/* 19C464 8026DB84 8E50000C */ lw $s0, 0xC($s2)
/* 19C468 8026DB88 54A00001 */ bnel $a1, $zero, .L8026DB90
/* 19C46C 8026DB8C AE400070 */ sw $zero, 0x70($s2)
.L8026DB90:
/* 19C470 8026DB90 8E430070 */ lw $v1, 0x70($s2)
/* 19C474 8026DB94 10600005 */ beqz $v1, .L8026DBAC
/* 19C478 8026DB98 24020001 */ addiu $v0, $zero, 0x1
/* 19C47C 8026DB9C 10620011 */ beq $v1, $v0, .L8026DBE4
/* 19C480 8026DBA0 0000102D */ daddu $v0, $zero, $zero
/* 19C484 8026DBA4 0809B77A */ j .L8026DDE8
/* 19C488 8026DBA8 00000000 */ nop
.L8026DBAC:
/* 19C48C 8026DBAC 8E050000 */ lw $a1, 0x0($s0)
/* 19C490 8026DBB0 26100004 */ addiu $s0, $s0, 0x4
/* 19C494 8026DBB4 0C0B1EAF */ jal evt_get_variable
/* 19C498 8026DBB8 0240202D */ daddu $a0, $s2, $zero
/* 19C49C 8026DBBC 0C0994E9 */ jal create_actor
/* 19C4A0 8026DBC0 0040202D */ daddu $a0, $v0, $zero
/* 19C4A4 8026DBC4 AE420074 */ sw $v0, 0x74($s2)
/* 19C4A8 8026DBC8 8E050000 */ lw $a1, 0x0($s0)
/* 19C4AC 8026DBCC 0C0B1EAF */ jal evt_get_variable
/* 19C4B0 8026DBD0 0240202D */ daddu $a0, $s2, $zero
/* 19C4B4 8026DBD4 AE420078 */ sw $v0, 0x78($s2)
/* 19C4B8 8026DBD8 24020001 */ addiu $v0, $zero, 0x1
/* 19C4BC 8026DBDC 0809B779 */ j .L8026DDE4
/* 19C4C0 8026DBE0 AE420070 */ sw $v0, 0x70($s2)
.L8026DBE4:
/* 19C4C4 8026DBE4 8E500074 */ lw $s0, 0x74($s2)
/* 19C4C8 8026DBE8 0C0B1059 */ jal does_script_exist
/* 19C4CC 8026DBEC 8E0401E4 */ lw $a0, 0x1E4($s0)
/* 19C4D0 8026DBF0 1440007D */ bnez $v0, .L8026DDE8
/* 19C4D4 8026DBF4 0000102D */ daddu $v0, $zero, $zero
/* 19C4D8 8026DBF8 82220170 */ lb $v0, 0x170($s1)
/* 19C4DC 8026DBFC 14400040 */ bnez $v0, .L8026DD00
/* 19C4E0 8026DC00 262E0140 */ addiu $t6, $s1, 0x140
/* 19C4E4 8026DC04 0000582D */ daddu $t3, $zero, $zero
/* 19C4E8 8026DC08 0160202D */ daddu $a0, $t3, $zero
/* 19C4EC 8026DC0C 0220282D */ daddu $a1, $s1, $zero
/* 19C4F0 8026DC10 0220182D */ daddu $v1, $s1, $zero
.L8026DC14:
/* 19C4F4 8026DC14 8CA200E0 */ lw $v0, 0xE0($a1)
/* 19C4F8 8026DC18 50400006 */ beql $v0, $zero, .L8026DC34
/* 19C4FC 8026DC1C 24840001 */ addiu $a0, $a0, 0x1
/* 19C500 8026DC20 34820200 */ ori $v0, $a0, 0x200
/* 19C504 8026DC24 A4620140 */ sh $v0, 0x140($v1)
/* 19C508 8026DC28 24630002 */ addiu $v1, $v1, 0x2
/* 19C50C 8026DC2C 256B0001 */ addiu $t3, $t3, 0x1
/* 19C510 8026DC30 24840001 */ addiu $a0, $a0, 0x1
.L8026DC34:
/* 19C514 8026DC34 28820018 */ slti $v0, $a0, 0x18
/* 19C518 8026DC38 1440FFF6 */ bnez $v0, .L8026DC14
/* 19C51C 8026DC3C 24A50004 */ addiu $a1, $a1, 0x4
/* 19C520 8026DC40 A22B0171 */ sb $t3, 0x171($s1)
/* 19C524 8026DC44 8E420078 */ lw $v0, 0x78($s2)
/* 19C528 8026DC48 10400002 */ beqz $v0, .L8026DC54
/* 19C52C 8026DC4C 240C03E8 */ addiu $t4, $zero, 0x3E8
/* 19C530 8026DC50 240CFC18 */ addiu $t4, $zero, -0x3E8
.L8026DC54:
/* 19C534 8026DC54 262E0140 */ addiu $t6, $s1, 0x140
/* 19C538 8026DC58 2562FFFF */ addiu $v0, $t3, -0x1
/* 19C53C 8026DC5C 1840005D */ blez $v0, .L8026DDD4
/* 19C540 8026DC60 0000202D */ daddu $a0, $zero, $zero
/* 19C544 8026DC64 0040782D */ daddu $t7, $v0, $zero
/* 19C548 8026DC68 01C0682D */ daddu $t5, $t6, $zero
.L8026DC6C:
/* 19C54C 8026DC6C 24880001 */ addiu $t0, $a0, 0x1
/* 19C550 8026DC70 010B102A */ slt $v0, $t0, $t3
/* 19C554 8026DC74 5040001D */ beql $v0, $zero, .L8026DCEC
/* 19C558 8026DC78 24840001 */ addiu $a0, $a0, 0x1
/* 19C55C 8026DC7C 01A0502D */ daddu $t2, $t5, $zero
/* 19C560 8026DC80 00081040 */ sll $v0, $t0, 1
/* 19C564 8026DC84 004E3821 */ addu $a3, $v0, $t6
.L8026DC88:
/* 19C568 8026DC88 95490000 */ lhu $t1, 0x0($t2)
/* 19C56C 8026DC8C 312200FF */ andi $v0, $t1, 0xFF
/* 19C570 8026DC90 00021080 */ sll $v0, $v0, 2
/* 19C574 8026DC94 02221021 */ addu $v0, $s1, $v0
/* 19C578 8026DC98 8C4200E0 */ lw $v0, 0xE0($v0)
/* 19C57C 8026DC9C 804501F1 */ lb $a1, 0x1F1($v0)
/* 19C580 8026DCA0 50500001 */ beql $v0, $s0, .L8026DCA8
/* 19C584 8026DCA4 00AC2821 */ addu $a1, $a1, $t4
.L8026DCA8:
/* 19C588 8026DCA8 94E60000 */ lhu $a2, 0x0($a3)
/* 19C58C 8026DCAC 30C200FF */ andi $v0, $a2, 0xFF
pause_available_png:
/* 19C590 8026DCB0 00021080 */ sll $v0, $v0, 2
/* 19C594 8026DCB4 02221021 */ addu $v0, $s1, $v0
/* 19C598 8026DCB8 8C4200E0 */ lw $v0, 0xE0($v0)
/* 19C59C 8026DCBC 804301F1 */ lb $v1, 0x1F1($v0)
/* 19C5A0 8026DCC0 50500001 */ beql $v0, $s0, .L8026DCC8
/* 19C5A4 8026DCC4 006C1821 */ addu $v1, $v1, $t4
.L8026DCC8:
/* 19C5A8 8026DCC8 00A3102A */ slt $v0, $a1, $v1
/* 19C5AC 8026DCCC 10400003 */ beqz $v0, .L8026DCDC
/* 19C5B0 8026DCD0 25080001 */ addiu $t0, $t0, 0x1
/* 19C5B4 8026DCD4 A5460000 */ sh $a2, 0x0($t2)
/* 19C5B8 8026DCD8 A4E90000 */ sh $t1, 0x0($a3)
.L8026DCDC:
/* 19C5BC 8026DCDC 010B102A */ slt $v0, $t0, $t3
/* 19C5C0 8026DCE0 1440FFE9 */ bnez $v0, .L8026DC88
/* 19C5C4 8026DCE4 24E70002 */ addiu $a3, $a3, 0x2
/* 19C5C8 8026DCE8 24840001 */ addiu $a0, $a0, 0x1
.L8026DCEC:
/* 19C5CC 8026DCEC 008F102A */ slt $v0, $a0, $t7
/* 19C5D0 8026DCF0 1440FFDE */ bnez $v0, .L8026DC6C
/* 19C5D4 8026DCF4 25AD0002 */ addiu $t5, $t5, 0x2
/* 19C5D8 8026DCF8 0809B775 */ j .L8026DDD4
/* 19C5DC 8026DCFC 00000000 */ nop
.L8026DD00:
/* 19C5E0 8026DD00 822B0171 */ lb $t3, 0x171($s1)
/* 19C5E4 8026DD04 1960000D */ blez $t3, .L8026DD3C
/* 19C5E8 8026DD08 0000202D */ daddu $a0, $zero, $zero
/* 19C5EC 8026DD0C 2405FFFF */ addiu $a1, $zero, -0x1
/* 19C5F0 8026DD10 01C0182D */ daddu $v1, $t6, $zero
.L8026DD14:
/* 19C5F4 8026DD14 90620001 */ lbu $v0, 0x1($v1)
/* 19C5F8 8026DD18 00021080 */ sll $v0, $v0, 2
/* 19C5FC 8026DD1C 02221021 */ addu $v0, $s1, $v0
/* 19C600 8026DD20 8C4200E0 */ lw $v0, 0xE0($v0)
/* 19C604 8026DD24 50500001 */ beql $v0, $s0, .L8026DD2C
/* 19C608 8026DD28 A4650000 */ sh $a1, 0x0($v1)
.L8026DD2C:
/* 19C60C 8026DD2C 24840001 */ addiu $a0, $a0, 0x1
/* 19C610 8026DD30 008B102A */ slt $v0, $a0, $t3
/* 19C614 8026DD34 1440FFF7 */ bnez $v0, .L8026DD14
/* 19C618 8026DD38 24630002 */ addiu $v1, $v1, 0x2
.L8026DD3C:
/* 19C61C 8026DD3C 8E420078 */ lw $v0, 0x78($s2)
/* 19C620 8026DD40 1440001C */ bnez $v0, .L8026DDB4
/* 19C624 8026DD44 0160202D */ daddu $a0, $t3, $zero
/* 19C628 8026DD48 82220170 */ lb $v0, 0x170($s1)
/* 19C62C 8026DD4C 0082102A */ slt $v0, $a0, $v0
/* 19C630 8026DD50 1440000B */ bnez $v0, .L8026DD80
/* 19C634 8026DD54 00041840 */ sll $v1, $a0, 1
.L8026DD58:
/* 19C638 8026DD58 2484FFFF */ addiu $a0, $a0, -0x1
/* 19C63C 8026DD5C 00041040 */ sll $v0, $a0, 1
/* 19C640 8026DD60 02221021 */ addu $v0, $s1, $v0
/* 19C644 8026DD64 94420140 */ lhu $v0, 0x140($v0)
/* 19C648 8026DD68 02231821 */ addu $v1, $s1, $v1
/* 19C64C 8026DD6C A4620140 */ sh $v0, 0x140($v1)
/* 19C650 8026DD70 82220170 */ lb $v0, 0x170($s1)
/* 19C654 8026DD74 0082102A */ slt $v0, $a0, $v0
/* 19C658 8026DD78 1040FFF7 */ beqz $v0, .L8026DD58
/* 19C65C 8026DD7C 00041840 */ sll $v1, $a0, 1
.L8026DD80:
/* 19C660 8026DD80 82220170 */ lb $v0, 0x170($s1)
/* 19C664 8026DD84 96030192 */ lhu $v1, 0x192($s0)
/* 19C668 8026DD88 2442FFFF */ addiu $v0, $v0, -0x1
/* 19C66C 8026DD8C 00021040 */ sll $v0, $v0, 1
/* 19C670 8026DD90 02221021 */ addu $v0, $s1, $v0
/* 19C674 8026DD94 A4430140 */ sh $v1, 0x140($v0)
/* 19C678 8026DD98 92220171 */ lbu $v0, 0x171($s1)
/* 19C67C 8026DD9C 92230170 */ lbu $v1, 0x170($s1)
/* 19C680 8026DDA0 24420001 */ addiu $v0, $v0, 0x1
/* 19C684 8026DDA4 24630001 */ addiu $v1, $v1, 0x1
/* 19C688 8026DDA8 A2220171 */ sb $v0, 0x171($s1)
/* 19C68C 8026DDAC 0809B775 */ j .L8026DDD4
/* 19C690 8026DDB0 A2230170 */ sb $v1, 0x170($s1)
.L8026DDB4:
/* 19C694 8026DDB4 82220171 */ lb $v0, 0x171($s1)
/* 19C698 8026DDB8 96030192 */ lhu $v1, 0x192($s0)
/* 19C69C 8026DDBC 00021040 */ sll $v0, $v0, 1
/* 19C6A0 8026DDC0 02221021 */ addu $v0, $s1, $v0
/* 19C6A4 8026DDC4 A4430140 */ sh $v1, 0x140($v0)
/* 19C6A8 8026DDC8 92220171 */ lbu $v0, 0x171($s1)
/* 19C6AC 8026DDCC 24420001 */ addiu $v0, $v0, 0x1
/* 19C6B0 8026DDD0 A2220171 */ sb $v0, 0x171($s1)
.L8026DDD4:
/* 19C6B4 8026DDD4 86030192 */ lh $v1, 0x192($s0)
/* 19C6B8 8026DDD8 24020002 */ addiu $v0, $zero, 0x2
/* 19C6BC 8026DDDC 0809B77A */ j .L8026DDE8
/* 19C6C0 8026DDE0 AE430084 */ sw $v1, 0x84($s2)
.L8026DDE4:
/* 19C6C4 8026DDE4 0000102D */ daddu $v0, $zero, $zero
.L8026DDE8:
/* 19C6C8 8026DDE8 8FBF001C */ lw $ra, 0x1C($sp)
/* 19C6CC 8026DDEC 8FB20018 */ lw $s2, 0x18($sp)
/* 19C6D0 8026DDF0 8FB10014 */ lw $s1, 0x14($sp)
/* 19C6D4 8026DDF4 8FB00010 */ lw $s0, 0x10($sp)
/* 19C6D8 8026DDF8 03E00008 */ jr $ra
/* 19C6DC 8026DDFC 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
ApiStatus SummonEnemy(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
s32* args = script->ptrReadPos;
Actor* actor1;
Actor* actor2;
s16* enemyIDs;
s32 numEnemies;
s32 i, j;
u16 enemyID1, enemyID2;
s32 priority1, priority2;
s32 tempPriority;
if (isInitialCall) {
script->functionTemp[0] = 0;
}
switch (script->functionTemp[0]) {
case 0:
script->functionTempPtr[1] = create_actor((FormationRow*)evt_get_variable(script, *args++));
script->functionTemp[2] = evt_get_variable(script, *args++);
script->functionTemp[0] = 1;
break;
case 1:
actor2 = script->functionTempPtr[1];
if (does_script_exist(actor2->takeTurnScriptID)) {
break;
}
enemyIDs = battleStatus->enemyIDs;
if (battleStatus->nextEnemyIndex == 0) {
numEnemies = 0;
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
if (battleStatus->enemyActors[i]) {
battleStatus->enemyIDs[numEnemies++] = i | ACTOR_CLASS_ENEMY;
}
}
battleStatus->numEnemyActors = numEnemies;
if (script->functionTemp[2] != 0) {
tempPriority = -1000;
} else {
tempPriority = 1000;
}
enemyIDs = battleStatus->enemyIDs;
for (i = 0; i < numEnemies - 1; i++) {
for (j = i + 1; j < numEnemies; j++) {
enemyID1 = enemyIDs[i];
actor1 = battleStatus->enemyActors[(u8) enemyID1];
priority1 = actor1->turnPriority;
if (actor1 == actor2) {
priority1 += tempPriority;
}
enemyID2 = enemyIDs[j];
actor1 = battleStatus->enemyActors[(u8) enemyID2];
priority2 = actor1->turnPriority;
if (actor1 == actor2) {
priority2 += tempPriority;
}
if (priority1 < priority2) {
enemyIDs[i] = enemyID2;
enemyIDs[j] = enemyID1;
}
}
}
} else {
numEnemies = battleStatus->numEnemyActors;
for (i = 0; i < numEnemies; i++){
if (battleStatus->enemyActors[(u8) enemyIDs[i]] == actor2) {
enemyIDs[i] = -1;
}
}
if (script->functionTemp[2] == 0) {
for (i = numEnemies; i >= battleStatus->nextEnemyIndex; i--) {
battleStatus->enemyIDs[i] = battleStatus->enemyIDs[i - 1];
}
battleStatus->enemyIDs[battleStatus->nextEnemyIndex - 1] = actor2->actorID;
battleStatus->numEnemyActors++;
battleStatus->nextEnemyIndex++;
} else {
battleStatus->enemyIDs[battleStatus->numEnemyActors] = actor2->actorID;
battleStatus->numEnemyActors++;
}
}
script->varTable[0] = actor2->actorID;
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel NpcFlyTo
/* F30AC 802CE6FC 27BDFFC0 */ addiu $sp, $sp, -0x40
/* F30B0 802CE700 AFB20020 */ sw $s2, 0x20($sp)
/* F30B4 802CE704 0080902D */ daddu $s2, $a0, $zero
/* F30B8 802CE708 AFB30024 */ sw $s3, 0x24($sp)
/* F30BC 802CE70C 26530090 */ addiu $s3, $s2, 0x90
/* F30C0 802CE710 AFB40028 */ sw $s4, 0x28($sp)
/* F30C4 802CE714 26540094 */ addiu $s4, $s2, 0x94
/* F30C8 802CE718 AFB5002C */ sw $s5, 0x2C($sp)
/* F30CC 802CE71C AFBF0030 */ sw $ra, 0x30($sp)
/* F30D0 802CE720 AFB1001C */ sw $s1, 0x1C($sp)
/* F30D4 802CE724 AFB00018 */ sw $s0, 0x18($sp)
/* F30D8 802CE728 F7B40038 */ sdc1 $f20, 0x38($sp)
/* F30DC 802CE72C 8E50000C */ lw $s0, 0xC($s2)
/* F30E0 802CE730 10A0004A */ beqz $a1, .L802CE85C
/* F30E4 802CE734 26550098 */ addiu $s5, $s2, 0x98
/* F30E8 802CE738 8E050000 */ lw $a1, 0x0($s0)
/* F30EC 802CE73C 0C0B1EAF */ jal evt_get_variable
/* F30F0 802CE740 26100004 */ addiu $s0, $s0, 0x4
/* F30F4 802CE744 0240202D */ daddu $a0, $s2, $zero
/* F30F8 802CE748 0C0B36B0 */ jal resolve_npc
/* F30FC 802CE74C 0040282D */ daddu $a1, $v0, $zero
/* F3100 802CE750 0040882D */ daddu $s1, $v0, $zero
/* F3104 802CE754 56200003 */ bnel $s1, $zero, .L802CE764
/* F3108 802CE758 AE510074 */ sw $s1, 0x74($s2)
/* F310C 802CE75C 080B3A7A */ j .L802CE9E8
/* F3110 802CE760 24020002 */ addiu $v0, $zero, 0x2
.L802CE764:
/* F3114 802CE764 8E050000 */ lw $a1, 0x0($s0)
/* F3118 802CE768 26100004 */ addiu $s0, $s0, 0x4
/* F311C 802CE76C 0C0B210B */ jal evt_get_float_variable
/* F3120 802CE770 0240202D */ daddu $a0, $s2, $zero
/* F3124 802CE774 E6200060 */ swc1 $f0, 0x60($s1)
/* F3128 802CE778 8E050000 */ lw $a1, 0x0($s0)
/* F312C 802CE77C 26100004 */ addiu $s0, $s0, 0x4
/* F3130 802CE780 0C0B210B */ jal evt_get_float_variable
/* F3134 802CE784 0240202D */ daddu $a0, $s2, $zero
/* F3138 802CE788 E6200064 */ swc1 $f0, 0x64($s1)
/* F313C 802CE78C 8E050000 */ lw $a1, 0x0($s0)
/* F3140 802CE790 26100004 */ addiu $s0, $s0, 0x4
/* F3144 802CE794 0C0B210B */ jal evt_get_float_variable
/* F3148 802CE798 0240202D */ daddu $a0, $s2, $zero
/* F314C 802CE79C E6200068 */ swc1 $f0, 0x68($s1)
/* F3150 802CE7A0 8E050000 */ lw $a1, 0x0($s0)
/* F3154 802CE7A4 26100004 */ addiu $s0, $s0, 0x4
/* F3158 802CE7A8 0C0B1EAF */ jal evt_get_variable
/* F315C 802CE7AC 0240202D */ daddu $a0, $s2, $zero
/* F3160 802CE7B0 AE42009C */ sw $v0, 0x9C($s2)
/* F3164 802CE7B4 8E050000 */ lw $a1, 0x0($s0)
/* F3168 802CE7B8 26100004 */ addiu $s0, $s0, 0x4
/* F316C 802CE7BC 0C0B1EAF */ jal evt_get_variable
/* F3170 802CE7C0 0240202D */ daddu $a0, $s2, $zero
/* F3174 802CE7C4 AE420078 */ sw $v0, 0x78($s2)
/* F3178 802CE7C8 8E050000 */ lw $a1, 0x0($s0)
/* F317C 802CE7CC 0C0B1EAF */ jal evt_get_variable
/* F3180 802CE7D0 0240202D */ daddu $a0, $s2, $zero
/* F3184 802CE7D4 AE42007C */ sw $v0, 0x7C($s2)
/* F3188 802CE7D8 C6200038 */ lwc1 $f0, 0x38($s1)
/* F318C 802CE7DC A620008E */ sh $zero, 0x8E($s1)
/* F3190 802CE7E0 E6400090 */ swc1 $f0, 0x90($s2)
/* F3194 802CE7E4 C620003C */ lwc1 $f0, 0x3C($s1)
/* F3198 802CE7E8 E6400094 */ swc1 $f0, 0x94($s2)
/* F319C 802CE7EC C6200040 */ lwc1 $f0, 0x40($s1)
/* F31A0 802CE7F0 E6400098 */ swc1 $f0, 0x98($s2)
/* F31A4 802CE7F4 C62C0038 */ lwc1 $f12, 0x38($s1)
/* F31A8 802CE7F8 C62E0040 */ lwc1 $f14, 0x40($s1)
/* F31AC 802CE7FC 8E260060 */ lw $a2, 0x60($s1)
/* F31B0 802CE800 0C00A720 */ jal atan2
/* F31B4 802CE804 8E270068 */ lw $a3, 0x68($s1)
/* F31B8 802CE808 C62C0038 */ lwc1 $f12, 0x38($s1)
/* F31BC 802CE80C C62E0040 */ lwc1 $f14, 0x40($s1)
/* F31C0 802CE810 8E260060 */ lw $a2, 0x60($s1)
/* F31C4 802CE814 8E270068 */ lw $a3, 0x68($s1)
/* F31C8 802CE818 0C00A7B5 */ jal dist2D
/* F31CC 802CE81C E620000C */ swc1 $f0, 0xC($s1)
/* F31D0 802CE820 46000086 */ mov.s $f2, $f0
/* F31D4 802CE824 E6220010 */ swc1 $f2, 0x10($s1)
/* F31D8 802CE828 8E42009C */ lw $v0, 0x9C($s2)
/* F31DC 802CE82C 14400006 */ bnez $v0, .L802CE848
/* F31E0 802CE830 00000000 */ nop
/* F31E4 802CE834 C6200018 */ lwc1 $f0, 0x18($s1)
/* F31E8 802CE838 46001003 */ div.s $f0, $f2, $f0
/* F31EC 802CE83C 4600018D */ trunc.w.s $f6, $f0
/* F31F0 802CE840 080B3A17 */ j .L802CE85C
/* F31F4 802CE844 E646009C */ swc1 $f6, 0x9C($s2)
.L802CE848:
/* F31F8 802CE848 44820000 */ mtc1 $v0, $f0
/* F31FC 802CE84C 00000000 */ nop
/* F3200 802CE850 46800020 */ cvt.s.w $f0, $f0
/* F3204 802CE854 46001003 */ div.s $f0, $f2, $f0
/* F3208 802CE858 E6200018 */ swc1 $f0, 0x18($s1)
.L802CE85C:
/* F320C 802CE85C 8E510074 */ lw $s1, 0x74($s2)
/* F3210 802CE860 8E42009C */ lw $v0, 0x9C($s2)
/* F3214 802CE864 8627008E */ lh $a3, 0x8E($s1)
/* F3218 802CE868 AFA20010 */ sw $v0, 0x10($sp)
/* F321C 802CE86C 8E44007C */ lw $a0, 0x7C($s2)
/* F3220 802CE870 8E650000 */ lw $a1, 0x0($s3)
/* F3224 802CE874 0C00A8ED */ jal update_lerp
/* F3228 802CE878 8E260060 */ lw $a2, 0x60($s1)
/* F322C 802CE87C E6200038 */ swc1 $f0, 0x38($s1)
/* F3230 802CE880 8E42009C */ lw $v0, 0x9C($s2)
/* F3234 802CE884 8627008E */ lh $a3, 0x8E($s1)
/* F3238 802CE888 AFA20010 */ sw $v0, 0x10($sp)
/* F323C 802CE88C 8E44007C */ lw $a0, 0x7C($s2)
/* F3240 802CE890 8E850000 */ lw $a1, 0x0($s4)
/* F3244 802CE894 0C00A8ED */ jal update_lerp
/* F3248 802CE898 8E260064 */ lw $a2, 0x64($s1)
/* F324C 802CE89C E620003C */ swc1 $f0, 0x3C($s1)
/* F3250 802CE8A0 8E42009C */ lw $v0, 0x9C($s2)
/* F3254 802CE8A4 8627008E */ lh $a3, 0x8E($s1)
/* F3258 802CE8A8 AFA20010 */ sw $v0, 0x10($sp)
/* F325C 802CE8AC 8E44007C */ lw $a0, 0x7C($s2)
/* F3260 802CE8B0 8EA50000 */ lw $a1, 0x0($s5)
/* F3264 802CE8B4 0C00A8ED */ jal update_lerp
/* F3268 802CE8B8 8E260068 */ lw $a2, 0x68($s1)
/* F326C 802CE8BC 9622008E */ lhu $v0, 0x8E($s1)
/* F3270 802CE8C0 E6200040 */ swc1 $f0, 0x40($s1)
/* F3274 802CE8C4 24420001 */ addiu $v0, $v0, 0x1
/* F3278 802CE8C8 A622008E */ sh $v0, 0x8E($s1)
/* F327C 802CE8CC 00021400 */ sll $v0, $v0, 16
/* F3280 802CE8D0 8E43009C */ lw $v1, 0x9C($s2)
/* F3284 802CE8D4 00021403 */ sra $v0, $v0, 16
/* F3288 802CE8D8 0043102A */ slt $v0, $v0, $v1
/* F328C 802CE8DC 14400008 */ bnez $v0, .L802CE900
/* F3290 802CE8E0 24020002 */ addiu $v0, $zero, 0x2
/* F3294 802CE8E4 C6200060 */ lwc1 $f0, 0x60($s1)
/* F3298 802CE8E8 C6220064 */ lwc1 $f2, 0x64($s1)
/* F329C 802CE8EC C6240068 */ lwc1 $f4, 0x68($s1)
/* F32A0 802CE8F0 E6200038 */ swc1 $f0, 0x38($s1)
/* F32A4 802CE8F4 E622003C */ swc1 $f2, 0x3C($s1)
/* F32A8 802CE8F8 080B3A7A */ j .L802CE9E8
/* F32AC 802CE8FC E6240040 */ swc1 $f4, 0x40($s1)
.L802CE900:
/* F32B0 802CE900 C62C0038 */ lwc1 $f12, 0x38($s1)
/* F32B4 802CE904 C62E0040 */ lwc1 $f14, 0x40($s1)
/* F32B8 802CE908 8E260060 */ lw $a2, 0x60($s1)
/* F32BC 802CE90C 0C00A7B5 */ jal dist2D
/* F32C0 802CE910 8E270068 */ lw $a3, 0x68($s1)
/* F32C4 802CE914 4480A000 */ mtc1 $zero, $f20
/* F32C8 802CE918 00000000 */ nop
/* F32CC 802CE91C 46140032 */ c.eq.s $f0, $f20
/* F32D0 802CE920 00000000 */ nop
/* F32D4 802CE924 45000003 */ bc1f .L802CE934
/* F32D8 802CE928 46000086 */ mov.s $f2, $f0
/* F32DC 802CE92C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* F32E0 802CE930 44811000 */ mtc1 $at, $f2
.L802CE934:
/* F32E4 802CE934 C6200010 */ lwc1 $f0, 0x10($s1)
/* F32E8 802CE938 46140032 */ c.eq.s $f0, $f20
/* F32EC 802CE93C 00000000 */ nop
/* F32F0 802CE940 45000006 */ bc1f .L802CE95C
/* F32F4 802CE944 00000000 */ nop
/* F32F8 802CE948 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* F32FC 802CE94C 44810000 */ mtc1 $at, $f0
/* F3300 802CE950 00000000 */ nop
/* F3304 802CE954 E6200010 */ swc1 $f0, 0x10($s1)
/* F3308 802CE958 C6200010 */ lwc1 $f0, 0x10($s1)
.L802CE95C:
/* F330C 802CE95C 3C013FF0 */ lui $at, (0x3FF00000 >> 16)
/* F3310 802CE960 44816800 */ mtc1 $at, $f13
/* F3314 802CE964 44806000 */ mtc1 $zero, $f12
/* F3318 802CE968 46001003 */ div.s $f0, $f2, $f0
/* F331C 802CE96C 46000021 */ cvt.d.s $f0, $f0
/* F3320 802CE970 46206301 */ sub.d $f12, $f12, $f0
/* F3324 802CE974 3C01802E */ lui $at, %hi(D_802DA1E0)
/* F3328 802CE978 D420A1E0 */ ldc1 $f0, %lo(D_802DA1E0)($at)
/* F332C 802CE97C 46206302 */ mul.d $f12, $f12, $f0
/* F3330 802CE980 00000000 */ nop
/* F3334 802CE984 0C00A8BB */ jal sin_deg
/* F3338 802CE988 46206320 */ cvt.s.d $f12, $f12
/* F333C 802CE98C 8E440078 */ lw $a0, 0x78($s2)
/* F3340 802CE990 14800002 */ bnez $a0, .L802CE99C
/* F3344 802CE994 46000106 */ mov.s $f4, $f0
/* F3348 802CE998 4600A106 */ mov.s $f4, $f20
.L802CE99C:
/* F334C 802CE99C 04810007 */ bgez $a0, .L802CE9BC
/* F3350 802CE9A0 00041023 */ negu $v0, $a0
/* F3354 802CE9A4 44821000 */ mtc1 $v0, $f2
/* F3358 802CE9A8 00000000 */ nop
/* F335C 802CE9AC 468010A0 */ cvt.s.w $f2, $f2
/* F3360 802CE9B0 46002007 */ neg.s $f0, $f4
/* F3364 802CE9B4 46020102 */ mul.s $f4, $f0, $f2
/* F3368 802CE9B8 00000000 */ nop
.L802CE9BC:
/* F336C 802CE9BC 18800006 */ blez $a0, .L802CE9D8
/* F3370 802CE9C0 00000000 */ nop
/* F3374 802CE9C4 44840000 */ mtc1 $a0, $f0
/* F3378 802CE9C8 00000000 */ nop
/* F337C 802CE9CC 46800020 */ cvt.s.w $f0, $f0
/* F3380 802CE9D0 46002102 */ mul.s $f4, $f4, $f0
/* F3384 802CE9D4 00000000 */ nop
.L802CE9D8:
/* F3388 802CE9D8 C620003C */ lwc1 $f0, 0x3C($s1)
/* F338C 802CE9DC 46040000 */ add.s $f0, $f0, $f4
/* F3390 802CE9E0 0000102D */ daddu $v0, $zero, $zero
/* F3394 802CE9E4 E620003C */ swc1 $f0, 0x3C($s1)
.L802CE9E8:
/* F3398 802CE9E8 8FBF0030 */ lw $ra, 0x30($sp)
/* F339C 802CE9EC 8FB5002C */ lw $s5, 0x2C($sp)
/* F33A0 802CE9F0 8FB40028 */ lw $s4, 0x28($sp)
/* F33A4 802CE9F4 8FB30024 */ lw $s3, 0x24($sp)
/* F33A8 802CE9F8 8FB20020 */ lw $s2, 0x20($sp)
/* F33AC 802CE9FC 8FB1001C */ lw $s1, 0x1C($sp)
/* F33B0 802CEA00 8FB00018 */ lw $s0, 0x18($sp)
/* F33B4 802CEA04 D7B40038 */ ldc1 $f20, 0x38($sp)
/* F33B8 802CEA08 03E00008 */ jr $ra
/* F33BC 802CEA0C 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
ApiStatus NpcFlyTo(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
f32* outX = (f32*)&script->varTable[3];
f32* outY = (f32*)&script->varTable[4];
f32* outZ = (f32*)&script->varTable[5];
Npc* npc;
f32 dist;
f32 yDelta;
if (isInitialCall) {
npc = resolve_npc(script, evt_get_variable(script, *args++));
if (npc == NULL) {
return ApiStatus_DONE2;
}
script->functionTempPtr[1] = npc;
npc->moveToPos.x = evt_get_float_variable(script, *args++);
npc->moveToPos.y = evt_get_float_variable(script, *args++);
npc->moveToPos.z = evt_get_float_variable(script, *args++);
script->varTable[6] = evt_get_variable(script, *args++);
script->functionTemp[2] = evt_get_variable(script, *args++);
script->functionTemp[3] = evt_get_variable(script, *args++);
npc->duration = 0;
*outX = npc->pos.x;
*outY = npc->pos.y;
*outZ = npc->pos.z;
npc->yaw = atan2(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
dist = dist2D(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
npc->planarFlyDist = dist;
if (script->varTable[6] == 0) {
script->varTable[6] = (dist / npc->moveSpeed);
} else {
npc->moveSpeed = dist / script->varTable[6];
}
}
npc = script->functionTempPtr[1];
npc->pos.x = update_lerp(script->functionTemp[3], *outX, npc->moveToPos.x, npc->duration, script->varTable[6]);
npc->pos.y = update_lerp(script->functionTemp[3], *outY, npc->moveToPos.y, npc->duration, script->varTable[6]);
npc->pos.z = update_lerp(script->functionTemp[3], *outZ, npc->moveToPos.z, npc->duration, script->varTable[6]);
npc->duration++;
if (npc->duration >= script->varTable[6]) {
npc->pos.x = npc->moveToPos.x;
npc->pos.y = npc->moveToPos.y;
npc->pos.z = npc->moveToPos.z;
return ApiStatus_DONE2;
}
dist = dist2D(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
if (dist == 0.0f) {
dist = 1.0f;
}
if (npc->planarFlyDist == 0.0f) {
npc->planarFlyDist = 1.0f;
}
yDelta = sin_deg((1.0 - (dist / npc->planarFlyDist)) * 180.0);
if (script->functionTemp[2] == 0) {
yDelta = 0.0f;
}
if (script->functionTemp[2] < 0) {
yDelta = -yDelta * -script->functionTemp[2];
}
if (script->functionTemp[2] > 0) {
yDelta *= script->functionTemp[2];
}
npc->pos.y += yDelta;
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_camera_mode_unused
/* B0E0 8002FCE0 27BDFFB8 */ addiu $sp, $sp, -0x48
/* B0E4 8002FCE4 AFB00010 */ sw $s0, 0x10($sp)
/* B0E8 8002FCE8 0080802D */ daddu $s0, $a0, $zero
/* B0EC 8002FCEC AFBF0014 */ sw $ra, 0x14($sp)
/* B0F0 8002FCF0 F7BE0040 */ sdc1 $f30, 0x40($sp)
/* B0F4 8002FCF4 F7BC0038 */ sdc1 $f28, 0x38($sp)
/* B0F8 8002FCF8 F7BA0030 */ sdc1 $f26, 0x30($sp)
/* B0FC 8002FCFC F7B80028 */ sdc1 $f24, 0x28($sp)
/* B100 8002FD00 F7B60020 */ sdc1 $f22, 0x20($sp)
/* B104 8002FD04 F7B40018 */ sdc1 $f20, 0x18($sp)
/* B108 8002FD08 86020006 */ lh $v0, 0x6($s0)
/* B10C 8002FD0C 3C038011 */ lui $v1, %hi(gPlayerStatus)
/* B110 8002FD10 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus)
/* B114 8002FD14 14400004 */ bnez $v0, .L8002FD28
/* B118 8002FD18 00000000 */ nop
/* B11C 8002FD1C 86020008 */ lh $v0, 0x8($s0)
/* B120 8002FD20 1040000F */ beqz $v0, .L8002FD60
/* B124 8002FD24 00000000 */ nop
.L8002FD28:
/* B128 8002FD28 C6000054 */ lwc1 $f0, 0x54($s0)
/* B12C 8002FD2C C6020058 */ lwc1 $f2, 0x58($s0)
/* B130 8002FD30 C604005C */ lwc1 $f4, 0x5C($s0)
/* B134 8002FD34 24020064 */ addiu $v0, $zero, 0x64
/* B138 8002FD38 A6000006 */ sh $zero, 0x6($s0)
/* B13C 8002FD3C A6000008 */ sh $zero, 0x8($s0)
/* B140 8002FD40 A600001C */ sh $zero, 0x1C($s0)
/* B144 8002FD44 A602001E */ sh $v0, 0x1E($s0)
/* B148 8002FD48 A6020020 */ sh $v0, 0x20($s0)
/* B14C 8002FD4C A6000022 */ sh $zero, 0x22($s0)
/* B150 8002FD50 A6000024 */ sh $zero, 0x24($s0)
/* B154 8002FD54 E6000048 */ swc1 $f0, 0x48($s0)
/* B158 8002FD58 E602004C */ swc1 $f2, 0x4C($s0)
/* B15C 8002FD5C E6040050 */ swc1 $f4, 0x50($s0)
.L8002FD60:
/* B160 8002FD60 8C620000 */ lw $v0, 0x0($v1)
/* B164 8002FD64 30420006 */ andi $v0, $v0, 0x6
/* B168 8002FD68 14400007 */ bnez $v0, .L8002FD88
/* B16C 8002FD6C 00000000 */ nop
/* B170 8002FD70 C460002C */ lwc1 $f0, 0x2C($v1)
/* B174 8002FD74 3C014270 */ lui $at, (0x42700000 >> 16)
/* B178 8002FD78 44811000 */ mtc1 $at, $f2
/* B17C 8002FD7C 00000000 */ nop
/* B180 8002FD80 46020000 */ add.s $f0, $f0, $f2
/* B184 8002FD84 E6000058 */ swc1 $f0, 0x58($s0)
.L8002FD88:
/* B188 8002FD88 C4600028 */ lwc1 $f0, 0x28($v1)
/* B18C 8002FD8C 3C0143C8 */ lui $at, (0x43C80000 >> 16)
/* B190 8002FD90 44811000 */ mtc1 $at, $f2
/* B194 8002FD94 E6000054 */ swc1 $f0, 0x54($s0)
/* B198 8002FD98 C4600030 */ lwc1 $f0, 0x30($v1)
/* B19C 8002FD9C 46020000 */ add.s $f0, $f0, $f2
/* B1A0 8002FDA0 8602001C */ lh $v0, 0x1C($s0)
/* B1A4 8002FDA4 14400062 */ bnez $v0, .L8002FF30
/* B1A8 8002FDA8 E600005C */ swc1 $f0, 0x5C($s0)
/* B1AC 8002FDAC 86030020 */ lh $v1, 0x20($s0)
/* B1B0 8002FDB0 24022710 */ addiu $v0, $zero, 0x2710
/* B1B4 8002FDB4 14600002 */ bnez $v1, .L8002FDC0
/* B1B8 8002FDB8 0043001A */ div $zero, $v0, $v1
/* B1BC 8002FDBC 0007000D */ break 7
.L8002FDC0:
/* B1C0 8002FDC0 2401FFFF */ addiu $at, $zero, -0x1
/* B1C4 8002FDC4 14610004 */ bne $v1, $at, .L8002FDD8
/* B1C8 8002FDC8 3C018000 */ lui $at, (0x80000000 >> 16)
/* B1CC 8002FDCC 14410002 */ bne $v0, $at, .L8002FDD8
/* B1D0 8002FDD0 00000000 */ nop
/* B1D4 8002FDD4 0006000D */ break 6
.L8002FDD8:
/* B1D8 8002FDD8 00002012 */ mflo $a0
/* B1DC 8002FDDC C6000054 */ lwc1 $f0, 0x54($s0)
/* B1E0 8002FDE0 C6020058 */ lwc1 $f2, 0x58($s0)
/* B1E4 8002FDE4 C604005C */ lwc1 $f4, 0x5C($s0)
/* B1E8 8002FDE8 86020024 */ lh $v0, 0x24($s0)
/* B1EC 8002FDEC 8603001E */ lh $v1, 0x1E($s0)
/* B1F0 8002FDF0 E6000048 */ swc1 $f0, 0x48($s0)
/* B1F4 8002FDF4 44820000 */ mtc1 $v0, $f0
/* B1F8 8002FDF8 00000000 */ nop
/* B1FC 8002FDFC 46800020 */ cvt.s.w $f0, $f0
/* B200 8002FE00 86020022 */ lh $v0, 0x22($s0)
/* B204 8002FE04 E602004C */ swc1 $f2, 0x4C($s0)
/* B208 8002FE08 E6040050 */ swc1 $f4, 0x50($s0)
/* B20C 8002FE0C E6000084 */ swc1 $f0, 0x84($s0)
/* B210 8002FE10 44820000 */ mtc1 $v0, $f0
/* B214 8002FE14 00000000 */ nop
/* B218 8002FE18 46800020 */ cvt.s.w $f0, $f0
/* B21C 8002FE1C E6000074 */ swc1 $f0, 0x74($s0)
/* B220 8002FE20 44830000 */ mtc1 $v1, $f0
/* B224 8002FE24 00000000 */ nop
/* B228 8002FE28 46800020 */ cvt.s.w $f0, $f0
/* B22C 8002FE2C 04810002 */ bgez $a0, .L8002FE38
/* B230 8002FE30 E6000078 */ swc1 $f0, 0x78($s0)
/* B234 8002FE34 24840003 */ addiu $a0, $a0, 0x3
.L8002FE38:
/* B238 8002FE38 C6020074 */ lwc1 $f2, 0x74($s0)
/* B23C 8002FE3C 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* B240 8002FE40 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* B244 8002FE44 4481A000 */ mtc1 $at, $f20
/* B248 8002FE48 00041083 */ sra $v0, $a0, 2
/* B24C 8002FE4C 46141082 */ mul.s $f2, $f2, $f20
/* B250 8002FE50 00000000 */ nop
/* B254 8002FE54 4480F000 */ mtc1 $zero, $f30
/* B258 8002FE58 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* B25C 8002FE5C 4481B000 */ mtc1 $at, $f22
/* B260 8002FE60 44820000 */ mtc1 $v0, $f0
/* B264 8002FE64 00000000 */ nop
/* B268 8002FE68 46800020 */ cvt.s.w $f0, $f0
/* B26C 8002FE6C E6000018 */ swc1 $f0, 0x18($s0)
/* B270 8002FE70 46161683 */ div.s $f26, $f2, $f22
/* B274 8002FE74 0C00A85B */ jal sin_rad
/* B278 8002FE78 4600D306 */ mov.s $f12, $f26
/* B27C 8002FE7C 46000706 */ mov.s $f28, $f0
/* B280 8002FE80 0C00A874 */ jal cos_rad
/* B284 8002FE84 4600D306 */ mov.s $f12, $f26
/* B288 8002FE88 461E0202 */ mul.s $f8, $f0, $f30
/* B28C 8002FE8C 00000000 */ nop
/* B290 8002FE90 4600F087 */ neg.s $f2, $f30
/* B294 8002FE94 4602E082 */ mul.s $f2, $f28, $f2
/* B298 8002FE98 00000000 */ nop
/* B29C 8002FE9C C6180078 */ lwc1 $f24, 0x78($s0)
/* B2A0 8002FEA0 461CC102 */ mul.s $f4, $f24, $f28
/* B2A4 8002FEA4 00000000 */ nop
/* B2A8 8002FEA8 4600C182 */ mul.s $f6, $f24, $f0
/* B2AC 8002FEAC 00000000 */ nop
/* B2B0 8002FEB0 C6000084 */ lwc1 $f0, 0x84($s0)
/* B2B4 8002FEB4 46140002 */ mul.s $f0, $f0, $f20
/* B2B8 8002FEB8 00000000 */ nop
/* B2BC 8002FEBC 4600F286 */ mov.s $f10, $f30
/* B2C0 8002FEC0 46005506 */ mov.s $f20, $f10
/* B2C4 8002FEC4 46044780 */ add.s $f30, $f8, $f4
/* B2C8 8002FEC8 46061600 */ add.s $f24, $f2, $f6
/* B2CC 8002FECC 46160683 */ div.s $f26, $f0, $f22
/* B2D0 8002FED0 0C00A85B */ jal sin_rad
/* B2D4 8002FED4 4600D306 */ mov.s $f12, $f26
/* B2D8 8002FED8 46000706 */ mov.s $f28, $f0
/* B2DC 8002FEDC 0C00A874 */ jal cos_rad
/* B2E0 8002FEE0 4600D306 */ mov.s $f12, $f26
/* B2E4 8002FEE4 46140182 */ mul.s $f6, $f0, $f20
/* B2E8 8002FEE8 00000000 */ nop
/* B2EC 8002FEEC 4614E102 */ mul.s $f4, $f28, $f20
/* B2F0 8002FEF0 00000000 */ nop
/* B2F4 8002FEF4 461CC082 */ mul.s $f2, $f24, $f28
/* B2F8 8002FEF8 00000000 */ nop
/* B2FC 8002FEFC 4600C002 */ mul.s $f0, $f24, $f0
/* B300 8002FF00 00000000 */ nop
/* B304 8002FF04 46023281 */ sub.s $f10, $f6, $f2
/* B308 8002FF08 46002100 */ add.s $f4, $f4, $f0
/* B30C 8002FF0C C600004C */ lwc1 $f0, 0x4C($s0)
/* B310 8002FF10 461E0000 */ add.s $f0, $f0, $f30
/* B314 8002FF14 C6060048 */ lwc1 $f6, 0x48($s0)
/* B318 8002FF18 460A3180 */ add.s $f6, $f6, $f10
/* B31C 8002FF1C C6020050 */ lwc1 $f2, 0x50($s0)
/* B320 8002FF20 46041080 */ add.s $f2, $f2, $f4
/* B324 8002FF24 E6000040 */ swc1 $f0, 0x40($s0)
/* B328 8002FF28 E606003C */ swc1 $f6, 0x3C($s0)
/* B32C 8002FF2C E6020044 */ swc1 $f2, 0x44($s0)
.L8002FF30:
/* B330 8002FF30 C60C003C */ lwc1 $f12, 0x3C($s0)
/* B334 8002FF34 C60E0044 */ lwc1 $f14, 0x44($s0)
/* B338 8002FF38 8E060048 */ lw $a2, 0x48($s0)
/* B33C 8002FF3C 0C00A720 */ jal atan2
/* B340 8002FF40 8E070050 */ lw $a3, 0x50($s0)
/* B344 8002FF44 C6040048 */ lwc1 $f4, 0x48($s0)
/* B348 8002FF48 4480B000 */ mtc1 $zero, $f22
/* B34C 8002FF4C C602003C */ lwc1 $f2, 0x3C($s0)
/* B350 8002FF50 E600006C */ swc1 $f0, 0x6C($s0)
/* B354 8002FF54 46022501 */ sub.s $f20, $f4, $f2
/* B358 8002FF58 C6040050 */ lwc1 $f4, 0x50($s0)
/* B35C 8002FF5C C6020044 */ lwc1 $f2, 0x44($s0)
/* B360 8002FF60 4600B306 */ mov.s $f12, $f22
/* B364 8002FF64 46022601 */ sub.s $f24, $f4, $f2
/* B368 8002FF68 C604004C */ lwc1 $f4, 0x4C($s0)
/* B36C 8002FF6C C6020040 */ lwc1 $f2, 0x40($s0)
/* B370 8002FF70 4406A000 */ mfc1 $a2, $f20
/* B374 8002FF74 46022781 */ sub.s $f30, $f4, $f2
/* B378 8002FF78 4407C000 */ mfc1 $a3, $f24
/* B37C 8002FF7C 0C00A720 */ jal atan2
/* B380 8002FF80 4600B386 */ mov.s $f14, $f22
/* B384 8002FF84 4614A102 */ mul.s $f4, $f20, $f20
/* B388 8002FF88 00000000 */ nop
/* B38C 8002FF8C 4618C082 */ mul.s $f2, $f24, $f24
/* B390 8002FF90 00000000 */ nop
/* B394 8002FF94 46022300 */ add.s $f12, $f4, $f2
/* B398 8002FF98 46000007 */ neg.s $f0, $f0
/* B39C 8002FF9C E6000090 */ swc1 $f0, 0x90($s0)
/* B3A0 8002FFA0 46006004 */ sqrt.s $f0, $f12
/* B3A4 8002FFA4 46000032 */ c.eq.s $f0, $f0
/* B3A8 8002FFA8 00000000 */ nop
/* B3AC 8002FFAC 45030004 */ bc1tl .L8002FFC0
/* B3B0 8002FFB0 4600B306 */ mov.s $f12, $f22
/* B3B4 8002FFB4 0C0187BC */ jal sqrtf
/* B3B8 8002FFB8 00000000 */ nop
/* B3BC 8002FFBC 4600B306 */ mov.s $f12, $f22
.L8002FFC0:
/* B3C0 8002FFC0 46000007 */ neg.s $f0, $f0
/* B3C4 8002FFC4 4406F000 */ mfc1 $a2, $f30
/* B3C8 8002FFC8 44070000 */ mfc1 $a3, $f0
/* B3CC 8002FFCC 0C00A720 */ jal atan2
/* B3D0 8002FFD0 46006386 */ mov.s $f14, $f12
/* B3D4 8002FFD4 E6000094 */ swc1 $f0, 0x94($s0)
/* B3D8 8002FFD8 8FBF0014 */ lw $ra, 0x14($sp)
/* B3DC 8002FFDC 8FB00010 */ lw $s0, 0x10($sp)
/* B3E0 8002FFE0 D7BE0040 */ ldc1 $f30, 0x40($sp)
/* B3E4 8002FFE4 D7BC0038 */ ldc1 $f28, 0x38($sp)
/* B3E8 8002FFE8 D7BA0030 */ ldc1 $f26, 0x30($sp)
/* B3EC 8002FFEC D7B80028 */ ldc1 $f24, 0x28($sp)
/* B3F0 8002FFF0 D7B60020 */ ldc1 $f22, 0x20($sp)
/* B3F4 8002FFF4 D7B40018 */ ldc1 $f20, 0x18($sp)
/* B3F8 8002FFF8 03E00008 */ jr $ra
/* B3FC 8002FFFC 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
void update_camera_mode_unused(Camera* camera) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 sinBoom;
f32 cosBoom;
f32 deltaX;
f32 deltaY;
f32 deltaZ;
f32 deltaX2;
f32 deltaY2;
f32 deltaZ2;
f32 boomYaw;
if (camera->needsInit || camera->isChangingMap) {
camera->needsInit = FALSE;
camera->isChangingMap = FALSE;
camera->auxPitch = 0;
camera->auxBoomLength = 100;
camera->lookAt_dist = 100;
camera->auxBoomPitch = 0;
camera->auxBoomYaw = 0;
camera->lookAt_obj.x = camera->lookAt_obj_target.x;
camera->lookAt_obj.y = camera->lookAt_obj_target.y;
camera->lookAt_obj.z = camera->lookAt_obj_target.z;
}
if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) {
camera->lookAt_obj_target.y = playerStatus->position.y + 60.0f;
}
camera->lookAt_obj_target.x = playerStatus->position.x;
camera->lookAt_obj_target.z = playerStatus->position.z + 400.0f;
if (camera->auxPitch == 0) {
camera->lookAt_obj.x = camera->lookAt_obj_target.x;
camera->lookAt_obj.y = camera->lookAt_obj_target.y;
camera->lookAt_obj.z = camera->lookAt_obj_target.z;
camera->trueRotation.x = camera->auxBoomYaw;
camera->currentBoomYaw = camera->auxBoomPitch;
camera->currentBoomLength = camera->auxBoomLength;
camera->vfov = (10000 / camera->lookAt_dist) / 4;
boomYaw = DEG_TO_RAD(camera->currentBoomYaw);
sinBoom = sin_rad(boomYaw);
cosBoom = cos_rad(boomYaw);
deltaX = 0.0f;
deltaY = 0.0f;
deltaZ = camera->currentBoomLength;
deltaX2 = deltaX;
deltaY2 = deltaY;
boomYaw = deltaX = -deltaY2;
deltaZ2 = deltaZ;
deltaX = deltaX2;
deltaY = cosBoom * deltaY2 + deltaZ2 * sinBoom;
deltaZ = sinBoom * boomYaw + deltaZ2 * cosBoom;
boomYaw = DEG_TO_RAD(camera->trueRotation.x);
sinBoom = sin_rad(boomYaw);
cosBoom = cos_rad(boomYaw);
deltaZ2 = cosBoom * deltaX - deltaZ * sinBoom;
deltaX2 = cosBoom * deltaX - deltaZ * sinBoom;
deltaY2 = deltaY;
deltaZ2 = sinBoom * deltaX + deltaZ * cosBoom;
camera->lookAt_eye.x = camera->lookAt_obj.x + deltaX2;
camera->lookAt_eye.y = camera->lookAt_obj.y + deltaY2;
camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ2;
}
camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z);
deltaX = camera->lookAt_obj.x - camera->lookAt_eye.x;
deltaY = camera->lookAt_obj.y - camera->lookAt_eye.y;
deltaZ = camera->lookAt_obj.z - camera->lookAt_eye.z;
camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ);
camera->currentPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf(SQ(deltaX) + SQ(deltaZ)));
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel __osViSwapContext
/* 42470 80067070 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 42474 80067074 AFB00010 */ sw $s0, 0x10($sp)
/* 42478 80067078 3C108009 */ lui $s0, %hi(D_800959D4)
/* 4247C 8006707C 8E1059D4 */ lw $s0, %lo(D_800959D4)($s0)
/* 42480 80067080 3C02A440 */ lui $v0, (0xA4400010 >> 16)
/* 42484 80067084 34420010 */ ori $v0, $v0, (0xA4400010 & 0xFFFF)
/* 42488 80067088 AFBF0024 */ sw $ra, 0x24($sp)
/* 4248C 8006708C AFB40020 */ sw $s4, 0x20($sp)
/* 42490 80067090 AFB3001C */ sw $s3, 0x1C($sp)
/* 42494 80067094 AFB20018 */ sw $s2, 0x18($sp)
/* 42498 80067098 AFB10014 */ sw $s1, 0x14($sp)
/* 4249C 8006709C 8C420000 */ lw $v0, 0x0($v0)
/* 424A0 800670A0 8E040004 */ lw $a0, 0x4($s0)
/* 424A4 800670A4 8E120008 */ lw $s2, 0x8($s0)
/* 424A8 800670A8 0C0187A4 */ jal osVirtualToPhysical
/* 424AC 800670AC 30510001 */ andi $s1, $v0, 0x1
/* 424B0 800670B0 00111880 */ sll $v1, $s1, 2
/* 424B4 800670B4 00711821 */ addu $v1, $v1, $s1
/* 424B8 800670B8 00031880 */ sll $v1, $v1, 2
/* 424BC 800670BC 02431821 */ addu $v1, $s2, $v1
/* 424C0 800670C0 8C640028 */ lw $a0, 0x28($v1)
/* 424C4 800670C4 96030000 */ lhu $v1, 0x0($s0)
/* 424C8 800670C8 30630002 */ andi $v1, $v1, 0x2
/* 424CC 800670CC 10600008 */ beqz $v1, .L800670F0
/* 424D0 800670D0 00443021 */ addu $a2, $v0, $a0
/* 424D4 800670D4 8E420020 */ lw $v0, 0x20($s2)
/* 424D8 800670D8 8E030020 */ lw $v1, 0x20($s0)
/* 424DC 800670DC 2404F000 */ addiu $a0, $zero, -0x1000
/* 424E0 800670E0 00441024 */ and $v0, $v0, $a0
/* 424E4 800670E4 00621825 */ or $v1, $v1, $v0
/* 424E8 800670E8 08019C3E */ j .L800670F8
/* 424EC 800670EC AE030020 */ sw $v1, 0x20($s0)
.L800670F0:
/* 424F0 800670F0 8E420020 */ lw $v0, 0x20($s2)
/* 424F4 800670F4 AE020020 */ sw $v0, 0x20($s0)
.L800670F8:
/* 424F8 800670F8 96020000 */ lhu $v0, 0x0($s0)
/* 424FC 800670FC 30420004 */ andi $v0, $v0, 0x4
/* 42500 80067100 1040002B */ beqz $v0, .L800671B0
/* 42504 80067104 00111080 */ sll $v0, $s1, 2
/* 42508 80067108 00511021 */ addu $v0, $v0, $s1
/* 4250C 8006710C 00021080 */ sll $v0, $v0, 2
/* 42510 80067110 02421021 */ addu $v0, $s2, $v0
/* 42514 80067114 8C42002C */ lw $v0, 0x2C($v0)
/* 42518 80067118 30420FFF */ andi $v0, $v0, 0xFFF
/* 4251C 8006711C 44822000 */ mtc1 $v0, $f4
/* 42520 80067120 00000000 */ nop
/* 42524 80067124 04410004 */ bgez $v0, .L80067138
/* 42528 80067128 46802121 */ cvt.d.w $f4, $f4
/* 4252C 8006712C 3C01800A */ lui $at, %hi(D_80099D70)
/* 42530 80067130 D4209D70 */ ldc1 $f0, %lo(D_80099D70)($at)
/* 42534 80067134 46202100 */ add.d $f4, $f4, $f0
.L80067138:
/* 42538 80067138 C6020024 */ lwc1 $f2, 0x24($s0)
/* 4253C 8006713C 46202020 */ cvt.s.d $f0, $f4
/* 42540 80067140 46001082 */ mul.s $f2, $f2, $f0
/* 42544 80067144 3C014F00 */ lui $at, (0x4F000000 >> 16)
/* 42548 80067148 44810000 */ mtc1 $at, $f0
/* 4254C 8006714C 00000000 */ nop
/* 42550 80067150 4602003E */ c.le.s $f0, $f2
/* 42554 80067154 00000000 */ nop
/* 42558 80067158 00000000 */ nop
/* 4255C 8006715C 45030006 */ bc1tl .L80067178
/* 42560 80067160 46001001 */ sub.s $f0, $f2, $f0
/* 42564 80067164 4600100D */ trunc.w.s $f0, $f2
/* 42568 80067168 44040000 */ mfc1 $a0, $f0
/* 4256C 8006716C 00000000 */ nop
/* 42570 80067170 08019C63 */ j .L8006718C
/* 42574 80067174 00111080 */ sll $v0, $s1, 2
.L80067178:
/* 42578 80067178 4600008D */ trunc.w.s $f2, $f0
/* 4257C 8006717C 44041000 */ mfc1 $a0, $f2
/* 42580 80067180 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 42584 80067184 00822025 */ or $a0, $a0, $v0
/* 42588 80067188 00111080 */ sll $v0, $s1, 2
.L8006718C:
/* 4258C 8006718C 00511021 */ addu $v0, $v0, $s1
/* 42590 80067190 00021080 */ sll $v0, $v0, 2
/* 42594 80067194 02421021 */ addu $v0, $s2, $v0
/* 42598 80067198 AE04002C */ sw $a0, 0x2C($s0)
/* 4259C 8006719C 8C42002C */ lw $v0, 0x2C($v0)
/* 425A0 800671A0 2403F000 */ addiu $v1, $zero, -0x1000
/* 425A4 800671A4 00431024 */ and $v0, $v0, $v1
/* 425A8 800671A8 08019C70 */ j .L800671C0
/* 425AC 800671AC 00821025 */ or $v0, $a0, $v0
.L800671B0:
/* 425B0 800671B0 00511021 */ addu $v0, $v0, $s1
/* 425B4 800671B4 00021080 */ sll $v0, $v0, 2
/* 425B8 800671B8 02421021 */ addu $v0, $s2, $v0
/* 425BC 800671BC 8C42002C */ lw $v0, 0x2C($v0)
.L800671C0:
/* 425C0 800671C0 AE02002C */ sw $v0, 0x2C($s0)
/* 425C4 800671C4 8E53001C */ lw $s3, 0x1C($s2)
/* 425C8 800671C8 00111080 */ sll $v0, $s1, 2
/* 425CC 800671CC 00511021 */ addu $v0, $v0, $s1
/* 425D0 800671D0 00021080 */ sll $v0, $v0, 2
/* 425D4 800671D4 02428821 */ addu $s1, $s2, $v0
/* 425D8 800671D8 96040000 */ lhu $a0, 0x0($s0)
/* 425DC 800671DC 3C058009 */ lui $a1, %hi(D_8009469C)
/* 425E0 800671E0 8CA5469C */ lw $a1, %lo(D_8009469C)($a1)
/* 425E4 800671E4 8E230030 */ lw $v1, 0x30($s1)
/* 425E8 800671E8 30820020 */ andi $v0, $a0, 0x20
/* 425EC 800671EC 2C420001 */ sltiu $v0, $v0, 0x1
/* 425F0 800671F0 00021023 */ negu $v0, $v0
/* 425F4 800671F4 02629824 */ and $s3, $s3, $v0
/* 425F8 800671F8 00051400 */ sll $v0, $a1, 16
/* 425FC 800671FC 00621823 */ subu $v1, $v1, $v0
/* 42600 80067200 30840040 */ andi $a0, $a0, 0x40
/* 42604 80067204 10800005 */ beqz $a0, .L8006721C
/* 42608 80067208 0065A021 */ addu $s4, $v1, $a1
/* 4260C 8006720C 8E040004 */ lw $a0, 0x4($s0)
/* 42610 80067210 0C0187A4 */ jal osVirtualToPhysical
/* 42614 80067214 AE00002C */ sw $zero, 0x2C($s0)
/* 42618 80067218 00403021 */ addu $a2, $v0, $zero
.L8006721C:
/* 4261C 8006721C 96020000 */ lhu $v0, 0x0($s0)
/* 42620 80067220 30420080 */ andi $v0, $v0, 0x80
/* 42624 80067224 10400008 */ beqz $v0, .L80067248
/* 42628 80067228 3C0303FF */ lui $v1, (0x3FF0000 >> 16)
/* 4262C 8006722C 96020028 */ lhu $v0, 0x28($s0)
/* 42630 80067230 8E040004 */ lw $a0, 0x4($s0)
/* 42634 80067234 00021400 */ sll $v0, $v0, 16
/* 42638 80067238 00431024 */ and $v0, $v0, $v1
/* 4263C 8006723C 0C0187A4 */ jal osVirtualToPhysical
/* 42640 80067240 AE02002C */ sw $v0, 0x2C($s0)
/* 42644 80067244 00403021 */ addu $a2, $v0, $zero
.L80067248:
/* 42648 80067248 3C02A440 */ lui $v0, (0xA4400004 >> 16)
/* 4264C 8006724C 34420004 */ ori $v0, $v0, (0xA4400004 & 0xFFFF)
/* 42650 80067250 3C03A440 */ lui $v1, (0xA4400008 >> 16)
/* 42654 80067254 34630008 */ ori $v1, $v1, (0xA4400008 & 0xFFFF)
/* 42658 80067258 3C04A440 */ lui $a0, (0xA4400014 >> 16)
/* 4265C 8006725C 34840014 */ ori $a0, $a0, (0xA4400014 & 0xFFFF)
/* 42660 80067260 AC460000 */ sw $a2, 0x0($v0)
/* 42664 80067264 8E420008 */ lw $v0, 0x8($s2)
/* 42668 80067268 3C05A440 */ lui $a1, (0xA4400018 >> 16)
/* 4266C 8006726C 34A50018 */ ori $a1, $a1, (0xA4400018 & 0xFFFF)
/* 42670 80067270 AC620000 */ sw $v0, 0x0($v1)
/* 42674 80067274 8E42000C */ lw $v0, 0xC($s2)
/* 42678 80067278 3C06A440 */ lui $a2, (0xA4400020 >> 16)
/* 4267C 8006727C 34C60020 */ ori $a2, $a2, (0xA4400020 & 0xFFFF)
/* 42680 80067280 AC820000 */ sw $v0, 0x0($a0)
/* 42684 80067284 8E420010 */ lw $v0, 0x10($s2)
/* 42688 80067288 3C03A440 */ lui $v1, (0xA440001C >> 16)
/* 4268C 8006728C 3463001C */ ori $v1, $v1, (0xA440001C & 0xFFFF)
/* 42690 80067290 ACA20000 */ sw $v0, 0x0($a1)
/* 42694 80067294 8E420014 */ lw $v0, 0x14($s2)
/* 42698 80067298 3C04A440 */ lui $a0, (0xA4400024 >> 16)
/* 4269C 8006729C 34840024 */ ori $a0, $a0, (0xA4400024 & 0xFFFF)
/* 426A0 800672A0 AC620000 */ sw $v0, 0x0($v1)
/* 426A4 800672A4 8E420018 */ lw $v0, 0x18($s2)
/* 426A8 800672A8 3C03A440 */ lui $v1, (0xA4400028 >> 16)
/* 426AC 800672AC 34630028 */ ori $v1, $v1, (0xA4400028 & 0xFFFF)
/* 426B0 800672B0 ACC20000 */ sw $v0, 0x0($a2)
/* 426B4 800672B4 AC930000 */ sw $s3, 0x0($a0)
/* 426B8 800672B8 AC740000 */ sw $s4, 0x0($v1)
/* 426BC 800672BC 8E230034 */ lw $v1, 0x34($s1)
/* 426C0 800672C0 3C02A440 */ lui $v0, (0xA440002C >> 16)
/* 426C4 800672C4 3442002C */ ori $v0, $v0, (0xA440002C & 0xFFFF)
/* 426C8 800672C8 AC430000 */ sw $v1, 0x0($v0)
/* 426CC 800672CC 8E230038 */ lw $v1, 0x38($s1)
/* 426D0 800672D0 3C02A440 */ lui $v0, (0xA440000C >> 16)
/* 426D4 800672D4 3442000C */ ori $v0, $v0, (0xA440000C & 0xFFFF)
/* 426D8 800672D8 AC430000 */ sw $v1, 0x0($v0)
/* 426DC 800672DC 8E030020 */ lw $v1, 0x20($s0)
/* 426E0 800672E0 3C02A440 */ lui $v0, (0xA4400030 >> 16)
/* 426E4 800672E4 34420030 */ ori $v0, $v0, (0xA4400030 & 0xFFFF)
/* 426E8 800672E8 AC430000 */ sw $v1, 0x0($v0)
/* 426EC 800672EC 8E03002C */ lw $v1, 0x2C($s0)
/* 426F0 800672F0 3C02A440 */ lui $v0, (0xA4400034 >> 16)
/* 426F4 800672F4 34420034 */ ori $v0, $v0, (0xA4400034 & 0xFFFF)
/* 426F8 800672F8 AC430000 */ sw $v1, 0x0($v0)
/* 426FC 800672FC 8E03000C */ lw $v1, 0xC($s0)
/* 42700 80067300 3C028009 */ lui $v0, %hi(D_800959D0)
/* 42704 80067304 8C4259D0 */ lw $v0, %lo(D_800959D0)($v0)
/* 42708 80067308 02003021 */ addu $a2, $s0, $zero
/* 4270C 8006730C 24C80030 */ addiu $t0, $a2, 0x30
/* 42710 80067310 3C018009 */ lui $at, %hi(D_800959D0)
/* 42714 80067314 AC2659D0 */ sw $a2, %lo(D_800959D0)($at)
/* 42718 80067318 00403821 */ addu $a3, $v0, $zero
/* 4271C 8006731C 3C02A440 */ lui $v0, %hi(D_A4400000)
/* 42720 80067320 3C018009 */ lui $at, %hi(D_800959D4)
/* 42724 80067324 AC2759D4 */ sw $a3, %lo(D_800959D4)($at)
/* 42728 80067328 AC430000 */ sw $v1, %lo(D_A4400000)($v0)
.L8006732C:
/* 4272C 8006732C 8CC20000 */ lw $v0, 0x0($a2)
/* 42730 80067330 8CC30004 */ lw $v1, 0x4($a2)
/* 42734 80067334 8CC40008 */ lw $a0, 0x8($a2)
/* 42738 80067338 8CC5000C */ lw $a1, 0xC($a2)
/* 4273C 8006733C ACE20000 */ sw $v0, 0x0($a3)
/* 42740 80067340 ACE30004 */ sw $v1, 0x4($a3)
/* 42744 80067344 ACE40008 */ sw $a0, 0x8($a3)
/* 42748 80067348 ACE5000C */ sw $a1, 0xC($a3)
/* 4274C 8006734C 24C60010 */ addiu $a2, $a2, 0x10
/* 42750 80067350 14C8FFF6 */ bne $a2, $t0, .L8006732C
/* 42754 80067354 24E70010 */ addiu $a3, $a3, 0x10
/* 42758 80067358 8FBF0024 */ lw $ra, 0x24($sp)
/* 4275C 8006735C 8FB40020 */ lw $s4, 0x20($sp)
/* 42760 80067360 8FB3001C */ lw $s3, 0x1C($sp)
/* 42764 80067364 8FB20018 */ lw $s2, 0x18($sp)
/* 42768 80067368 8FB10014 */ lw $s1, 0x14($sp)
/* 4276C 8006736C 8FB00010 */ lw $s0, 0x10($sp)
/* 42770 80067370 03E00008 */ jr $ra
/* 42774 80067374 27BD0028 */ addiu $sp, $sp, 0x28
/* 42778 80067378 00000000 */ nop
/* 4277C 8006737C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void __osViSwapContext() {
register OSViMode *vm;
register __OSViContext *vc;
u32 origin;
u32 vStart;
u32 hStart;
u32 nomValue;
u32 field;
field = 0;
vc = __osViNext;
vm = vc->modep;
field = IO_READ(VI_CURRENT_REG) & 1; //field num
origin = osVirtualToPhysical(vc->framep) + (vm->fldRegs[field].origin);
if (vc->state & VI_STATE_XSCALE_UPDATED) {
vc->x.scale |= (vm->comRegs.xScale & ~VI_SCALE_MASK);
} else {
vc->x.scale = vm->comRegs.xScale;
}
if (vc->state & VI_STATE_YSCALE_UPDATED) {
nomValue = vm->fldRegs[field].yScale & VI_SCALE_MASK;
vc->y.scale = vc->y.factor * nomValue;
vc->y.scale |= vm->fldRegs[field].yScale & ~VI_SCALE_MASK;
} else {
vc->y.scale = vm->fldRegs[field].yScale;
}
vStart = (vm->fldRegs[field].vStart - (__additional_scanline << 0x10)) + __additional_scanline;
hStart = vm->comRegs.hStart;
if (vc->state & VI_STATE_BLACK) {
hStart = 0;
}
if (vc->state & VI_STATE_REPEATLINE) {
vc->y.scale = 0;
origin = osVirtualToPhysical(vc->framep);
}
if (vc->state & VI_STATE_FADE) {
vc->y.scale = (vc->y.offset << VI_SUBPIXEL_SH) & (VI_2_10_FPART_MASK << VI_SUBPIXEL_SH);
origin = osVirtualToPhysical(vc->framep);
}
IO_WRITE(VI_ORIGIN_REG, origin);
IO_WRITE(VI_WIDTH_REG, vm->comRegs.width);
IO_WRITE(VI_BURST_REG, vm->comRegs.burst);
IO_WRITE(VI_V_SYNC_REG, vm->comRegs.vSync);
IO_WRITE(VI_H_SYNC_REG, vm->comRegs.hSync);
IO_WRITE(VI_LEAP_REG, vm->comRegs.leap);
IO_WRITE(VI_H_START_REG, hStart);
IO_WRITE(VI_V_START_REG, vStart);
IO_WRITE(VI_V_BURST_REG, vm->fldRegs[field].vBurst);
IO_WRITE(VI_INTR_REG, vm->fldRegs[field].vIntr);
IO_WRITE(VI_X_SCALE_REG, vc->x.scale);
IO_WRITE(VI_Y_SCALE_REG, vc->y.scale);
IO_WRITE(VI_CONTROL_REG, vc->control);
__osViNext = __osViCurr;
__osViCurr = vc;
*__osViNext = *__osViCurr;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel spawn_cloud_surface_effects
/* 19038 8003DC38 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 1903C 8003DC3C 3C028007 */ lui $v0, %hi(D_80077C2C)
/* 19040 8003DC40 24427C2C */ addiu $v0, $v0, %lo(D_80077C2C)
/* 19044 8003DC44 AFBF0020 */ sw $ra, 0x20($sp)
/* 19048 8003DC48 AFB3001C */ sw $s3, 0x1C($sp)
/* 1904C 8003DC4C AFB20018 */ sw $s2, 0x18($sp)
/* 19050 8003DC50 AFB10014 */ sw $s1, 0x14($sp)
/* 19054 8003DC54 AFB00010 */ sw $s0, 0x10($sp)
/* 19058 8003DC58 F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 1905C 8003DC5C F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 19060 8003DC60 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 19064 8003DC64 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 19068 8003DC68 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 1906C 8003DC6C F7B40028 */ sdc1 $f20, 0x28($sp)
/* 19070 8003DC70 C4400000 */ lwc1 $f0, 0x0($v0)
/* 19074 8003DC74 3C013DCC */ lui $at, (0x3DCCCCCD >> 16)
/* 19078 8003DC78 3421CCCD */ ori $at, $at, (0x3DCCCCCD & 0xFFFF)
/* 1907C 8003DC7C 44811000 */ mtc1 $at, $f2
/* 19080 8003DC80 00000000 */ nop
/* 19084 8003DC84 46020000 */ add.s $f0, $f0, $f2
/* 19088 8003DC88 E4400000 */ swc1 $f0, 0x0($v0)
/* 1908C 8003DC8C 24020002 */ addiu $v0, $zero, 0x2
/* 19090 8003DC90 14A2006B */ bne $a1, $v0, .L8003DE40
/* 19094 8003DC94 0080882D */ daddu $s1, $a0, $zero
/* 19098 8003DC98 3C108007 */ lui $s0, %hi(D_80077C24)
/* 1909C 8003DC9C 26107C24 */ addiu $s0, $s0, %lo(D_80077C24)
/* 190A0 8003DCA0 C62E003C */ lwc1 $f14, 0x3C($s1)
/* 190A4 8003DCA4 3C014160 */ lui $at, (0x41600000 >> 16)
/* 190A8 8003DCA8 44810000 */ mtc1 $at, $f0
/* 190AC 8003DCAC C62C0038 */ lwc1 $f12, 0x38($s1)
/* 190B0 8003DCB0 46007380 */ add.s $f14, $f14, $f0
/* 190B4 8003DCB4 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 190B8 8003DCB8 44810000 */ mtc1 $at, $f0
/* 190BC 8003DCBC 8E260040 */ lw $a2, 0x40($s1)
/* 190C0 8003DCC0 8E070000 */ lw $a3, 0x0($s0)
/* 190C4 8003DCC4 0C01BF14 */ jal fx_cloud_puff
/* 190C8 8003DCC8 46007381 */ sub.s $f14, $f14, $f0
/* 190CC 8003DCCC C6000000 */ lwc1 $f0, 0x0($s0)
/* 190D0 8003DCD0 3C01420C */ lui $at, (0x420C0000 >> 16)
/* 190D4 8003DCD4 44816000 */ mtc1 $at, $f12
/* 190D8 8003DCD8 0000982D */ daddu $s3, $zero, $zero
/* 190DC 8003DCDC 460C0300 */ add.s $f12, $f0, $f12
/* 190E0 8003DCE0 3C01BE99 */ lui $at, (0xBE99999A >> 16)
/* 190E4 8003DCE4 3421999A */ ori $at, $at, (0xBE99999A & 0xFFFF)
/* 190E8 8003DCE8 4481F000 */ mtc1 $at, $f30
/* 190EC 8003DCEC 0C00A6C9 */ jal clamp_angle
/* 190F0 8003DCF0 0260902D */ daddu $s2, $s3, $zero
/* 190F4 8003DCF4 E6000000 */ swc1 $f0, 0x0($s0)
.L8003DCF8:
/* 190F8 8003DCF8 0C00A67F */ jal rand_int
/* 190FC 8003DCFC 2404000A */ addiu $a0, $zero, 0xA
/* 19100 8003DD00 2442FFFB */ addiu $v0, $v0, -0x5
/* 19104 8003DD04 4482B000 */ mtc1 $v0, $f22
/* 19108 8003DD08 00000000 */ nop
/* 1910C 8003DD0C 4680B5A0 */ cvt.s.w $f22, $f22
/* 19110 8003DD10 0C00A67F */ jal rand_int
/* 19114 8003DD14 2404000A */ addiu $a0, $zero, 0xA
/* 19118 8003DD18 4616B082 */ mul.s $f2, $f22, $f22
/* 1911C 8003DD1C 00000000 */ nop
/* 19120 8003DD20 2442FFFB */ addiu $v0, $v0, -0x5
/* 19124 8003DD24 4482C000 */ mtc1 $v0, $f24
/* 19128 8003DD28 00000000 */ nop
/* 1912C 8003DD2C 4680C620 */ cvt.s.w $f24, $f24
/* 19130 8003DD30 4618C102 */ mul.s $f4, $f24, $f24
/* 19134 8003DD34 00000000 */ nop
/* 19138 8003DD38 C62C000C */ lwc1 $f12, 0xC($s1)
/* 1913C 8003DD3C 44920000 */ mtc1 $s2, $f0
/* 19140 8003DD40 00000000 */ nop
/* 19144 8003DD44 46800020 */ cvt.s.w $f0, $f0
/* 19148 8003DD48 46006307 */ neg.s $f12, $f12
/* 1914C 8003DD4C 46006300 */ add.s $f12, $f12, $f0
/* 19150 8003DD50 3C01C000 */ lui $at, (0xC0000000 >> 16)
/* 19154 8003DD54 4481A000 */ mtc1 $at, $f20
/* 19158 8003DD58 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 1915C 8003DD5C 44810000 */ mtc1 $at, $f0
/* 19160 8003DD60 46041080 */ add.s $f2, $f2, $f4
/* 19164 8003DD64 3C018007 */ lui $at, %hi(D_80077C28)
/* 19168 8003DD68 A4207C28 */ sh $zero, %lo(D_80077C28)($at)
/* 1916C 8003DD6C 46001083 */ div.s $f2, $f2, $f0
/* 19170 8003DD70 0C00A6C9 */ jal clamp_angle
/* 19174 8003DD74 4602A501 */ sub.s $f20, $f20, $f2
/* 19178 8003DD78 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* 1917C 8003DD7C 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* 19180 8003DD80 44811000 */ mtc1 $at, $f2
/* 19184 8003DD84 00000000 */ nop
/* 19188 8003DD88 46020002 */ mul.s $f0, $f0, $f2
/* 1918C 8003DD8C 00000000 */ nop
/* 19190 8003DD90 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 19194 8003DD94 44811000 */ mtc1 $at, $f2
/* 19198 8003DD98 00000000 */ nop
/* 1919C 8003DD9C 46020683 */ div.s $f26, $f0, $f2
/* 191A0 8003DDA0 0C00A85B */ jal sin_rad
/* 191A4 8003DDA4 4600D306 */ mov.s $f12, $f26
/* 191A8 8003DDA8 46000706 */ mov.s $f28, $f0
/* 191AC 8003DDAC 0C00A874 */ jal cos_rad
/* 191B0 8003DDB0 4600D306 */ mov.s $f12, $f26
/* 191B4 8003DDB4 862200A6 */ lh $v0, 0xA6($s1)
/* 191B8 8003DDB8 44822000 */ mtc1 $v0, $f4
/* 191BC 8003DDBC 00000000 */ nop
/* 191C0 8003DDC0 46802120 */ cvt.s.w $f4, $f4
/* 191C4 8003DDC4 461C2182 */ mul.s $f6, $f4, $f28
/* 191C8 8003DDC8 00000000 */ nop
/* 191CC 8003DDCC 46002102 */ mul.s $f4, $f4, $f0
/* 191D0 8003DDD0 00000000 */ nop
/* 191D4 8003DDD4 3C014178 */ lui $at, (0x41780000 >> 16)
/* 191D8 8003DDD8 44811000 */ mtc1 $at, $f2
/* 191DC 8003DDDC C620003C */ lwc1 $f0, 0x3C($s1)
/* 191E0 8003DDE0 46020000 */ add.s $f0, $f0, $f2
/* 191E4 8003DDE4 46140000 */ add.s $f0, $f0, $f20
/* 191E8 8003DDE8 461E3182 */ mul.s $f6, $f6, $f30
/* 191EC 8003DDEC 00000000 */ nop
/* 191F0 8003DDF0 44060000 */ mfc1 $a2, $f0
/* 191F4 8003DDF4 C6200038 */ lwc1 $f0, 0x38($s1)
/* 191F8 8003DDF8 46060000 */ add.s $f0, $f0, $f6
/* 191FC 8003DDFC 46160000 */ add.s $f0, $f0, $f22
/* 19200 8003DE00 461E2102 */ mul.s $f4, $f4, $f30
/* 19204 8003DE04 00000000 */ nop
/* 19208 8003DE08 44050000 */ mfc1 $a1, $f0
/* 1920C 8003DE0C C6200040 */ lwc1 $f0, 0x40($s1)
/* 19210 8003DE10 46040000 */ add.s $f0, $f0, $f4
/* 19214 8003DE14 46180000 */ add.s $f0, $f0, $f24
/* 19218 8003DE18 2652005A */ addiu $s2, $s2, 0x5A
/* 1921C 8003DE1C 26730001 */ addiu $s3, $s3, 0x1
/* 19220 8003DE20 44070000 */ mfc1 $a3, $f0
/* 19224 8003DE24 0C01BF2C */ jal fx_cloud_trail
/* 19228 8003DE28 24040001 */ addiu $a0, $zero, 0x1
/* 1922C 8003DE2C 2A620004 */ slti $v0, $s3, 0x4
/* 19230 8003DE30 1040004E */ beqz $v0, .L8003DF6C
/* 19234 8003DE34 00000000 */ nop
/* 19238 8003DE38 0800F73E */ j .L8003DCF8
/* 1923C 8003DE3C 00000000 */ nop
.L8003DE40:
/* 19240 8003DE40 0C00A67F */ jal rand_int
/* 19244 8003DE44 2404000A */ addiu $a0, $zero, 0xA
/* 19248 8003DE48 2442FFFB */ addiu $v0, $v0, -0x5
/* 1924C 8003DE4C 4482C000 */ mtc1 $v0, $f24
/* 19250 8003DE50 00000000 */ nop
/* 19254 8003DE54 4680C620 */ cvt.s.w $f24, $f24
/* 19258 8003DE58 0C00A67F */ jal rand_int
/* 1925C 8003DE5C 2404000A */ addiu $a0, $zero, 0xA
/* 19260 8003DE60 4618C002 */ mul.s $f0, $f24, $f24
/* 19264 8003DE64 00000000 */ nop
/* 19268 8003DE68 2442FFFB */ addiu $v0, $v0, -0x5
/* 1926C 8003DE6C 4482B000 */ mtc1 $v0, $f22
/* 19270 8003DE70 00000000 */ nop
/* 19274 8003DE74 4680B5A0 */ cvt.s.w $f22, $f22
/* 19278 8003DE78 4616B082 */ mul.s $f2, $f22, $f22
/* 1927C 8003DE7C 00000000 */ nop
/* 19280 8003DE80 C62C000C */ lwc1 $f12, 0xC($s1)
/* 19284 8003DE84 3C01C000 */ lui $at, (0xC0000000 >> 16)
/* 19288 8003DE88 4481A000 */ mtc1 $at, $f20
/* 1928C 8003DE8C 46020000 */ add.s $f0, $f0, $f2
/* 19290 8003DE90 3C018007 */ lui $at, %hi(D_80077C28)
/* 19294 8003DE94 A4207C28 */ sh $zero, %lo(D_80077C28)($at)
/* 19298 8003DE98 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 1929C 8003DE9C 44811000 */ mtc1 $at, $f2
/* 192A0 8003DEA0 46006307 */ neg.s $f12, $f12
/* 192A4 8003DEA4 46020003 */ div.s $f0, $f0, $f2
/* 192A8 8003DEA8 0C00A6C9 */ jal clamp_angle
/* 192AC 8003DEAC 4600A501 */ sub.s $f20, $f20, $f0
/* 192B0 8003DEB0 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* 192B4 8003DEB4 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* 192B8 8003DEB8 44811000 */ mtc1 $at, $f2
/* 192BC 8003DEBC 00000000 */ nop
/* 192C0 8003DEC0 46020002 */ mul.s $f0, $f0, $f2
/* 192C4 8003DEC4 00000000 */ nop
/* 192C8 8003DEC8 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 192CC 8003DECC 44811000 */ mtc1 $at, $f2
/* 192D0 8003DED0 00000000 */ nop
/* 192D4 8003DED4 46020683 */ div.s $f26, $f0, $f2
/* 192D8 8003DED8 0C00A85B */ jal sin_rad
/* 192DC 8003DEDC 4600D306 */ mov.s $f12, $f26
/* 192E0 8003DEE0 46000706 */ mov.s $f28, $f0
/* 192E4 8003DEE4 0C00A874 */ jal cos_rad
/* 192E8 8003DEE8 4600D306 */ mov.s $f12, $f26
/* 192EC 8003DEEC 862200A6 */ lh $v0, 0xA6($s1)
/* 192F0 8003DEF0 44822000 */ mtc1 $v0, $f4
/* 192F4 8003DEF4 00000000 */ nop
/* 192F8 8003DEF8 46802120 */ cvt.s.w $f4, $f4
/* 192FC 8003DEFC 461C2182 */ mul.s $f6, $f4, $f28
/* 19300 8003DF00 00000000 */ nop
/* 19304 8003DF04 46002102 */ mul.s $f4, $f4, $f0
/* 19308 8003DF08 00000000 */ nop
/* 1930C 8003DF0C 3C01BE99 */ lui $at, (0xBE99999A >> 16)
/* 19310 8003DF10 3421999A */ ori $at, $at, (0xBE99999A & 0xFFFF)
/* 19314 8003DF14 44810000 */ mtc1 $at, $f0
/* 19318 8003DF18 00000000 */ nop
/* 1931C 8003DF1C 46003182 */ mul.s $f6, $f6, $f0
/* 19320 8003DF20 00000000 */ nop
/* 19324 8003DF24 46002102 */ mul.s $f4, $f4, $f0
/* 19328 8003DF28 00000000 */ nop
/* 1932C 8003DF2C 3C014178 */ lui $at, (0x41780000 >> 16)
/* 19330 8003DF30 44811000 */ mtc1 $at, $f2
/* 19334 8003DF34 C620003C */ lwc1 $f0, 0x3C($s1)
/* 19338 8003DF38 46020000 */ add.s $f0, $f0, $f2
/* 1933C 8003DF3C 46140000 */ add.s $f0, $f0, $f20
/* 19340 8003DF40 44060000 */ mfc1 $a2, $f0
/* 19344 8003DF44 C6200038 */ lwc1 $f0, 0x38($s1)
/* 19348 8003DF48 46060000 */ add.s $f0, $f0, $f6
/* 1934C 8003DF4C 46180000 */ add.s $f0, $f0, $f24
/* 19350 8003DF50 44050000 */ mfc1 $a1, $f0
/* 19354 8003DF54 C6200040 */ lwc1 $f0, 0x40($s1)
/* 19358 8003DF58 46040000 */ add.s $f0, $f0, $f4
/* 1935C 8003DF5C 46160000 */ add.s $f0, $f0, $f22
/* 19360 8003DF60 44070000 */ mfc1 $a3, $f0
/* 19364 8003DF64 0C01BF2C */ jal fx_cloud_trail
/* 19368 8003DF68 24040001 */ addiu $a0, $zero, 0x1
.L8003DF6C:
/* 1936C 8003DF6C 8FBF0020 */ lw $ra, 0x20($sp)
/* 19370 8003DF70 8FB3001C */ lw $s3, 0x1C($sp)
/* 19374 8003DF74 8FB20018 */ lw $s2, 0x18($sp)
/* 19378 8003DF78 8FB10014 */ lw $s1, 0x14($sp)
/* 1937C 8003DF7C 8FB00010 */ lw $s0, 0x10($sp)
/* 19380 8003DF80 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 19384 8003DF84 D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 19388 8003DF88 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 1938C 8003DF8C D7B80038 */ ldc1 $f24, 0x38($sp)
/* 19390 8003DF90 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 19394 8003DF94 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 19398 8003DF98 03E00008 */ jr $ra
/* 1939C 8003DF9C 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
void spawn_cloud_surface_effects(Npc* npc, SurfaceInteractMode mode) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 xTemp, yTemp, zTemp;
f32 xTemp2, yTemp2, zTemp2;
f32 theta;
f32 sinTheta;
f32 cosTheta;
f32 angle;
s32 i;
D_80077C2C += 0.1f;
if (mode == SURFACE_INTERACT_LAND) {
fx_cloud_puff(npc->pos.x, (npc->pos.y + 14.0f) - 5.0f, npc->pos.z, D_80077C24);
D_80077C24 = clamp_angle(D_80077C24 + 35.0f);
for (i = 0; i < 4; i++) {
xTemp = rand_int(10) - 5;
zTemp = rand_int(10) - 5;
yTemp = -2.0f - ((SQ(xTemp) + SQ(zTemp)) / 5.0f);
D_80077C28 = 0;
theta = DEG_TO_RAD(clamp_angle(-npc->yaw + (i * 90)));
sinTheta = sin_rad(theta);
cosTheta = cos_rad(theta);
fx_cloud_trail(
1,
npc->pos.x + (npc->collisionDiameter * sinTheta * -0.3f) + xTemp,
npc->pos.y + 15.5f + yTemp,
npc->pos.z + (npc->collisionDiameter * cosTheta * -0.3f) + zTemp
);
}
} else {
xTemp2 = rand_int(10) - 5;
zTemp2 = rand_int(10) - 5;
yTemp2 = -2.0f - ((SQ(xTemp2) + SQ(zTemp2)) / 5.0f);
D_80077C28 = 0;
theta = DEG_TO_RAD(clamp_angle(-npc->yaw));
sinTheta = sin_rad(theta);
cosTheta = cos_rad(theta);
fx_cloud_trail(
1,
npc->pos.x + (npc->collisionDiameter * sinTheta * -0.3f) + xTemp2,
npc->pos.y + 15.5f + yTemp2,
npc->pos.z + (npc->collisionDiameter * cosTheta * -0.3f) + zTemp2
);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel make_item_entity_at_player
/* C8200 80131B00 27BDFFB8 */ addiu $sp, $sp, -0x48
/* C8204 80131B04 AFB00028 */ sw $s0, 0x28($sp)
/* C8208 80131B08 0080802D */ daddu $s0, $a0, $zero
/* C820C 80131B0C AFB30034 */ sw $s3, 0x34($sp)
/* C8210 80131B10 00A0982D */ daddu $s3, $a1, $zero
/* C8214 80131B14 AFB40038 */ sw $s4, 0x38($sp)
/* C8218 80131B18 00C0A02D */ daddu $s4, $a2, $zero
/* C821C 80131B1C AFB20030 */ sw $s2, 0x30($sp)
/* C8220 80131B20 3C128011 */ lui $s2, %hi(gPlayerStatus)
/* C8224 80131B24 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus)
/* C8228 80131B28 3C048015 */ lui $a0, %hi(gCurrentItemEntities)
/* C822C 80131B2C 8C8465A0 */ lw $a0, %lo(gCurrentItemEntities)($a0)
/* C8230 80131B30 0000182D */ daddu $v1, $zero, $zero
/* C8234 80131B34 AFBF0040 */ sw $ra, 0x40($sp)
/* C8238 80131B38 AFB5003C */ sw $s5, 0x3C($sp)
/* C823C 80131B3C AFB1002C */ sw $s1, 0x2C($sp)
.L80131B40:
/* C8240 80131B40 8C820000 */ lw $v0, 0x0($a0)
/* C8244 80131B44 10400006 */ beqz $v0, .L80131B60
/* C8248 80131B48 28620100 */ slti $v0, $v1, 0x100
/* C824C 80131B4C 24630001 */ addiu $v1, $v1, 0x1
/* C8250 80131B50 28620100 */ slti $v0, $v1, 0x100
/* C8254 80131B54 1440FFFA */ bnez $v0, .L80131B40
/* C8258 80131B58 24840004 */ addiu $a0, $a0, 0x4
/* C825C 80131B5C 28620100 */ slti $v0, $v1, 0x100
.L80131B60:
/* C8260 80131B60 54400003 */ bnel $v0, $zero, .L80131B70
/* C8264 80131B64 2404005C */ addiu $a0, $zero, 0x5C
.L80131B68:
/* C8268 80131B68 0804C6DA */ j .L80131B68
/* C826C 80131B6C 00000000 */ nop
.L80131B70:
/* C8270 80131B70 0C00AB39 */ jal heap_malloc
/* C8274 80131B74 0060A82D */ daddu $s5, $v1, $zero
/* C8278 80131B78 00152080 */ sll $a0, $s5, 2
/* C827C 80131B7C 3C038015 */ lui $v1, %hi(gCurrentItemEntities)
/* C8280 80131B80 8C6365A0 */ lw $v1, %lo(gCurrentItemEntities)($v1)
/* C8284 80131B84 3C058015 */ lui $a1, %hi(ItemEntitiesCreated)
/* C8288 80131B88 24A512F8 */ addiu $a1, $a1, %lo(ItemEntitiesCreated)
/* C828C 80131B8C 00832021 */ addu $a0, $a0, $v1
/* C8290 80131B90 8CA30000 */ lw $v1, 0x0($a1)
/* C8294 80131B94 0040882D */ daddu $s1, $v0, $zero
/* C8298 80131B98 AC910000 */ sw $s1, 0x0($a0)
/* C829C 80131B9C 24630001 */ addiu $v1, $v1, 0x1
/* C82A0 80131BA0 16200003 */ bnez $s1, .L80131BB0
/* C82A4 80131BA4 ACA30000 */ sw $v1, 0x0($a1)
.L80131BA8:
/* C82A8 80131BA8 0804C6EA */ j .L80131BA8
/* C82AC 80131BAC 00000000 */ nop
.L80131BB0:
/* C82B0 80131BB0 3210FFFF */ andi $s0, $s0, 0xFFFF
/* C82B4 80131BB4 3C030200 */ lui $v1, (0x2000017 >> 16)
/* C82B8 80131BB8 34630017 */ ori $v1, $v1, (0x2000017 & 0xFFFF)
/* C82BC 80131BBC 2402FFFF */ addiu $v0, $zero, -0x1
/* C82C0 80131BC0 A222001D */ sb $v0, 0x1D($s1)
/* C82C4 80131BC4 12600004 */ beqz $s3, .L80131BD8
/* C82C8 80131BC8 AE230000 */ sw $v1, 0x0($s1)
/* C82CC 80131BCC 3C020600 */ lui $v0, (0x6000017 >> 16)
/* C82D0 80131BD0 34420017 */ ori $v0, $v0, (0x6000017 & 0xFFFF)
/* C82D4 80131BD4 AE220000 */ sw $v0, 0x0($s1)
.L80131BD8:
/* C82D8 80131BD8 2402001C */ addiu $v0, $zero, 0x1C
/* C82DC 80131BDC A6340006 */ sh $s4, 0x6($s1)
/* C82E0 80131BE0 A222001B */ sb $v0, 0x1B($s1)
/* C82E4 80131BE4 A220001A */ sb $zero, 0x1A($s1)
/* C82E8 80131BE8 A6200004 */ sh $zero, 0x4($s1)
/* C82EC 80131BEC C6400028 */ lwc1 $f0, 0x28($s2)
/* C82F0 80131BF0 8E230000 */ lw $v1, 0x0($s1)
/* C82F4 80131BF4 E6200008 */ swc1 $f0, 0x8($s1)
/* C82F8 80131BF8 C640002C */ lwc1 $f0, 0x2C($s2)
/* C82FC 80131BFC 2402FFFF */ addiu $v0, $zero, -0x1
/* C8300 80131C00 E620000C */ swc1 $f0, 0xC($s1)
/* C8304 80131C04 C6420030 */ lwc1 $f2, 0x30($s2)
/* C8308 80131C08 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* C830C 80131C0C 44810000 */ mtc1 $at, $f0
/* C8310 80131C10 34634000 */ ori $v1, $v1, 0x4000
/* C8314 80131C14 A6220020 */ sh $v0, 0x20($s1)
/* C8318 80131C18 24020001 */ addiu $v0, $zero, 0x1
/* C831C 80131C1C A222002E */ sb $v0, 0x2E($s1)
/* C8320 80131C20 2402D8F1 */ addiu $v0, $zero, -0x270F
/* C8324 80131C24 A6220034 */ sh $v0, 0x34($s1)
/* C8328 80131C28 A6220036 */ sh $v0, 0x36($s1)
/* C832C 80131C2C A6220038 */ sh $v0, 0x38($s1)
/* C8330 80131C30 00101140 */ sll $v0, $s0, 5
/* C8334 80131C34 A6300018 */ sh $s0, 0x18($s1)
/* C8338 80131C38 AE200014 */ sw $zero, 0x14($s1)
/* C833C 80131C3C A220001C */ sb $zero, 0x1C($s1)
/* C8340 80131C40 A620001E */ sh $zero, 0x1E($s1)
/* C8344 80131C44 AE230000 */ sw $v1, 0x0($s1)
/* C8348 80131C48 E6200030 */ swc1 $f0, 0x30($s1)
/* C834C 80131C4C E6220010 */ swc1 $f2, 0x10($s1)
/* C8350 80131C50 3C018008 */ lui $at, %hi(gItemTable + 0x18)
/* C8354 80131C54 00220821 */ addu $at, $at, $v0
/* C8358 80131C58 942278F8 */ lhu $v0, %lo(gItemTable + 0x18)($at)
/* C835C 80131C5C 30421000 */ andi $v0, $v0, 0x1000
/* C8360 80131C60 10400005 */ beqz $v0, .L80131C78
/* C8364 80131C64 3C020004 */ lui $v0, (0x40000 >> 16)
/* C8368 80131C68 00621025 */ or $v0, $v1, $v0
/* C836C 80131C6C 2403BFFF */ addiu $v1, $zero, -0x4001
/* C8370 80131C70 00431024 */ and $v0, $v0, $v1
/* C8374 80131C74 AE220000 */ sw $v0, 0x0($s1)
.L80131C78:
/* C8378 80131C78 3C088015 */ lui $t0, %hi(ItemEntityAlternatingSpawn)
/* C837C 80131C7C 25085D84 */ addiu $t0, $t0, %lo(ItemEntityAlternatingSpawn)
/* C8380 80131C80 8D020000 */ lw $v0, 0x0($t0)
/* C8384 80131C84 10400004 */ beqz $v0, .L80131C98
/* C8388 80131C88 3C030002 */ lui $v1, (0x20000 >> 16)
/* C838C 80131C8C 8E220000 */ lw $v0, 0x0($s1)
/* C8390 80131C90 00431025 */ or $v0, $v0, $v1
/* C8394 80131C94 AE220000 */ sw $v0, 0x0($s1)
.L80131C98:
/* C8398 80131C98 0000202D */ daddu $a0, $zero, $zero
/* C839C 80131C9C 24020001 */ addiu $v0, $zero, 0x1
/* C83A0 80131CA0 8E250008 */ lw $a1, 0x8($s1)
/* C83A4 80131CA4 8E26000C */ lw $a2, 0xC($s1)
/* C83A8 80131CA8 8D030000 */ lw $v1, 0x0($t0)
/* C83AC 80131CAC 8E270010 */ lw $a3, 0x10($s1)
/* C83B0 80131CB0 00431023 */ subu $v0, $v0, $v1
/* C83B4 80131CB4 0C044898 */ jal create_shadow_type
/* C83B8 80131CB8 AD020000 */ sw $v0, 0x0($t0)
/* C83BC 80131CBC 00022400 */ sll $a0, $v0, 16
/* C83C0 80131CC0 00042403 */ sra $a0, $a0, 16
/* C83C4 80131CC4 0C044181 */ jal get_shadow_by_index
/* C83C8 80131CC8 A6220020 */ sh $v0, 0x20($s1)
/* C83CC 80131CCC 3C040002 */ lui $a0, (0x20000 >> 16)
/* C83D0 80131CD0 27A50018 */ addiu $a1, $sp, 0x18
/* C83D4 80131CD4 27A6001C */ addiu $a2, $sp, 0x1C
/* C83D8 80131CD8 27A70020 */ addiu $a3, $sp, 0x20
/* C83DC 80131CDC 0040802D */ daddu $s0, $v0, $zero
/* C83E0 80131CE0 8E020000 */ lw $v0, 0x0($s0)
/* C83E4 80131CE4 3C01447A */ lui $at, (0x447A0000 >> 16)
/* C83E8 80131CE8 44810000 */ mtc1 $at, $f0
/* C83EC 80131CEC 3C014140 */ lui $at, (0x41400000 >> 16)
/* C83F0 80131CF0 44811000 */ mtc1 $at, $f2
/* C83F4 80131CF4 34420001 */ ori $v0, $v0, 0x1
/* C83F8 80131CF8 AE020000 */ sw $v0, 0x0($s0)
/* C83FC 80131CFC 27A20024 */ addiu $v0, $sp, 0x24
/* C8400 80131D00 E7A00024 */ swc1 $f0, 0x24($sp)
/* C8404 80131D04 C6260008 */ lwc1 $f6, 0x8($s1)
/* C8408 80131D08 C620000C */ lwc1 $f0, 0xC($s1)
/* C840C 80131D0C C6240010 */ lwc1 $f4, 0x10($s1)
/* C8410 80131D10 46020000 */ add.s $f0, $f0, $f2
/* C8414 80131D14 E7A60018 */ swc1 $f6, 0x18($sp)
/* C8418 80131D18 E7A40020 */ swc1 $f4, 0x20($sp)
/* C841C 80131D1C E7A0001C */ swc1 $f0, 0x1C($sp)
/* C8420 80131D20 0C0372DF */ jal npc_raycast_down_sides
/* C8424 80131D24 AFA20010 */ sw $v0, 0x10($sp)
/* C8428 80131D28 C7A00018 */ lwc1 $f0, 0x18($sp)
/* C842C 80131D2C C7A2001C */ lwc1 $f2, 0x1C($sp)
/* C8430 80131D30 C7A40020 */ lwc1 $f4, 0x20($sp)
/* C8434 80131D34 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C8438 80131D38 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C843C 80131D3C E6000010 */ swc1 $f0, 0x10($s0)
/* C8440 80131D40 E6020014 */ swc1 $f2, 0x14($s0)
/* C8444 80131D44 E6040018 */ swc1 $f4, 0x18($s0)
/* C8448 80131D48 C7A20024 */ lwc1 $f2, 0x24($sp)
/* C844C 80131D4C 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* C8450 80131D50 44810000 */ mtc1 $at, $f0
/* C8454 80131D54 C444011C */ lwc1 $f4, 0x11C($v0)
/* C8458 80131D58 46001082 */ mul.s $f2, $f2, $f0
/* C845C 80131D5C 00000000 */ nop
/* C8460 80131D60 AE00002C */ sw $zero, 0x2C($s0)
/* C8464 80131D64 E6040028 */ swc1 $f4, 0x28($s0)
/* C8468 80131D68 C4400124 */ lwc1 $f0, 0x124($v0)
/* C846C 80131D6C 44051000 */ mfc1 $a1, $f2
/* C8470 80131D70 0200202D */ daddu $a0, $s0, $zero
/* C8474 80131D74 0C044A17 */ jal set_standard_shadow_scale
/* C8478 80131D78 E4800030 */ swc1 $f0, 0x30($a0)
/* C847C 80131D7C 0C04C44A */ jal item_entity_load
/* C8480 80131D80 0220202D */ daddu $a0, $s1, $zero
/* C8484 80131D84 86230018 */ lh $v1, 0x18($s1)
/* C8488 80131D88 24020157 */ addiu $v0, $zero, 0x157
/* C848C 80131D8C 14620008 */ bne $v1, $v0, .L80131DB0
/* C8490 80131D90 02A0102D */ daddu $v0, $s5, $zero
/* C8494 80131D94 3C058010 */ lui $a1, %hi(SparkleScript_Coin)
/* C8498 80131D98 24A54AC0 */ addiu $a1, $a1, %lo(SparkleScript_Coin)
/* C849C 80131D9C 0C04C27C */ jal sparkle_script_init
/* C84A0 80131DA0 0220202D */ daddu $a0, $s1, $zero
/* C84A4 80131DA4 0C04C2B3 */ jal sparkle_script_update
/* C84A8 80131DA8 0220202D */ daddu $a0, $s1, $zero
/* C84AC 80131DAC 02A0102D */ daddu $v0, $s5, $zero
.L80131DB0:
/* C84B0 80131DB0 8FBF0040 */ lw $ra, 0x40($sp)
/* C84B4 80131DB4 8FB5003C */ lw $s5, 0x3C($sp)
/* C84B8 80131DB8 8FB40038 */ lw $s4, 0x38($sp)
/* C84BC 80131DBC 8FB30034 */ lw $s3, 0x34($sp)
/* C84C0 80131DC0 8FB20030 */ lw $s2, 0x30($sp)
/* C84C4 80131DC4 8FB1002C */ lw $s1, 0x2C($sp)
/* C84C8 80131DC8 8FB00028 */ lw $s0, 0x28($sp)
/* C84CC 80131DCC 03E00008 */ jr $ra
/* C84D0 80131DD0 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
s32 make_item_entity_at_player(s32 itemID, s32 category, s32 pickupMsgFlags) {
PlayerStatus* playerStatus = &gPlayerStatus;
ItemEntity* item;
Shadow* shadow;
s32 i;
f32 posX;
f32 posY;
f32 posZ;
f32 depth;
s32 id;
for (i = 0; i < MAX_ITEM_ENTITIES; i++) {
if (gCurrentItemEntities[i] == NULL) {
break;
}
}
ASSERT(i < MAX_ITEM_ENTITIES);
id = i;
gCurrentItemEntities[id] = item = heap_malloc(sizeof(*item));
ItemEntitiesCreated++;
ASSERT(item != NULL);
itemID &= 0xFFFF;
item->renderGroup = -1;
item->flags = (ITEM_ENTITY_FLAG_CAM0 | ITEM_ENTITY_FLAG_CAM1 | ITEM_ENTITY_FLAG_CAM2 | ITEM_ENTITY_FLAG_10 | ITEM_ENTITY_FLAG_2000000);
if (category != ITEM_TYPE_CONSUMABLE) {
item->flags |= ITEM_ENTITY_FLAG_4000000;
}
item->pickupMsgFlags = pickupMsgFlags;
item->spawnType = ITEM_SPAWN_AT_PLAYER;
item->state = ITEM_PICKUP_STATE_INIT;
item->boundVar = 0;
item->position.x = playerStatus->position.x;
item->position.y = playerStatus->position.y;
item->position.z = playerStatus->position.z;
item->shadowIndex = -1;
item->nextUpdate = 1;
item->lastPos.x = -9999;
item->lastPos.y = -9999;
item->lastPos.z = -9999;
item->scale = 1.0f;
item->itemID = itemID;
item->physicsData = NULL;
item->pickupDelay = 0;
item->spawnAngle = 0;
item->flags |= ITEM_ENTITY_RESIZABLE;
if (gItemTable[itemID].typeFlags & ITEM_TYPE_FLAG_ENTITY_FULLSIZE) {
item->flags = (item->flags | ITEM_ENTITY_FLAG_40000) & ~ITEM_ENTITY_RESIZABLE;
}
if (ItemEntityAlternatingSpawn != 0) {
item->flags |= ITEM_ENTITY_FLAG_20000;
}
ItemEntityAlternatingSpawn = 1 - ItemEntityAlternatingSpawn;
item->shadowIndex = create_shadow_type(0, item->position.x, item->position.y, item->position.z);
shadow = get_shadow_by_index(item->shadowIndex);
shadow->flags |= ENTITY_FLAG_HIDDEN;
posX = item->position.x;
posY = item->position.y + 12.0f;
posZ = item->position.z;
depth = 1000.0f;
npc_raycast_down_sides(COLLISION_CHANNEL_20000, &posX, &posY, &posZ, &depth);
shadow->position.x = posX;
shadow->position.y = posY;
shadow->position.z = posZ;
shadow->rotation.x = gGameStatusPtr->playerGroundTraceAngles.x;
shadow->rotation.y = 0.0f;
shadow->rotation.z = gGameStatusPtr->playerGroundTraceAngles.z;
set_standard_shadow_scale(shadow, depth * 0.5f);
item_entity_load(item);
if (item->itemID == ITEM_COIN) {
sparkle_script_init(item, &SparkleScript_Coin);
sparkle_script_update(item);
}
return id;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8025AA80
/* 189360 8025AA80 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 189364 8025AA84 AFB20018 */ sw $s2, 0x18($sp)
/* 189368 8025AA88 0080902D */ daddu $s2, $a0, $zero
/* 18936C 8025AA8C AFB10014 */ sw $s1, 0x14($sp)
/* 189370 8025AA90 00A0882D */ daddu $s1, $a1, $zero
/* 189374 8025AA94 AFBF0024 */ sw $ra, 0x24($sp)
/* 189378 8025AA98 AFB40020 */ sw $s4, 0x20($sp)
/* 18937C 8025AA9C AFB3001C */ sw $s3, 0x1C($sp)
/* 189380 8025AAA0 AFB00010 */ sw $s0, 0x10($sp)
/* 189384 8025AAA4 8E3000C0 */ lw $s0, 0xC0($s1)
/* 189388 8025AAA8 00C0982D */ daddu $s3, $a2, $zero
/* 18938C 8025AAAC 820206C1 */ lb $v0, 0x6C1($s0)
/* 189390 8025AAB0 10400032 */ beqz $v0, .L8025AB7C
/* 189394 8025AAB4 00E0A02D */ daddu $s4, $a3, $zero
/* 189398 8025AAB8 16400017 */ bnez $s2, .L8025AB18
/* 18939C 8025AABC 00000000 */ nop
/* 1893A0 8025AAC0 0C0B7830 */ jal spr_get_player_palettes
/* 1893A4 8025AAC4 96240088 */ lhu $a0, 0x88($s1)
/* 1893A8 8025AAC8 AE0206D0 */ sw $v0, 0x6D0($s0)
/* 1893AC 8025AACC 0040202D */ daddu $a0, $v0, $zero
/* 1893B0 8025AAD0 A20006CD */ sb $zero, 0x6CD($s0)
/* 1893B4 8025AAD4 8C830000 */ lw $v1, 0x0($a0)
/* 1893B8 8025AAD8 2402FFFF */ addiu $v0, $zero, -0x1
/* 1893BC 8025AADC 50620024 */ beql $v1, $v0, .L8025AB70
/* 1893C0 8025AAE0 A20006C2 */ sb $zero, 0x6C2($s0)
/* 1893C4 8025AAE4 0080182D */ daddu $v1, $a0, $zero
/* 1893C8 8025AAE8 0040202D */ daddu $a0, $v0, $zero
.L8025AAEC:
/* 1893CC 8025AAEC 920206CD */ lbu $v0, 0x6CD($s0)
/* 1893D0 8025AAF0 24420001 */ addiu $v0, $v0, 0x1
/* 1893D4 8025AAF4 A20206CD */ sb $v0, 0x6CD($s0)
/* 1893D8 8025AAF8 00021600 */ sll $v0, $v0, 24
/* 1893DC 8025AAFC 00021583 */ sra $v0, $v0, 22
/* 1893E0 8025AB00 00431021 */ addu $v0, $v0, $v1
/* 1893E4 8025AB04 8C420000 */ lw $v0, 0x0($v0)
/* 1893E8 8025AB08 1444FFF8 */ bne $v0, $a0, .L8025AAEC
/* 1893EC 8025AB0C 00000000 */ nop
/* 1893F0 8025AB10 08096ADC */ j .L8025AB70
/* 1893F4 8025AB14 A20006C2 */ sb $zero, 0x6C2($s0)
.L8025AB18:
/* 1893F8 8025AB18 96240088 */ lhu $a0, 0x88($s1)
D_8025AB1C:
/* 1893FC 8025AB1C 0C0B7A90 */ jal spr_get_npc_palettes
/* 189400 8025AB20 00000000 */ nop
/* 189404 8025AB24 AE0206D0 */ sw $v0, 0x6D0($s0)
/* 189408 8025AB28 0040202D */ daddu $a0, $v0, $zero
/* 18940C 8025AB2C A20006CD */ sb $zero, 0x6CD($s0)
/* 189410 8025AB30 8C830000 */ lw $v1, 0x0($a0)
/* 189414 8025AB34 2402FFFF */ addiu $v0, $zero, -0x1
/* 189418 8025AB38 5062000D */ beql $v1, $v0, .L8025AB70
/* 18941C 8025AB3C A20006C2 */ sb $zero, 0x6C2($s0)
/* 189420 8025AB40 0080182D */ daddu $v1, $a0, $zero
/* 189424 8025AB44 0040202D */ daddu $a0, $v0, $zero
.L8025AB48:
/* 189428 8025AB48 920206CD */ lbu $v0, 0x6CD($s0)
/* 18942C 8025AB4C 24420001 */ addiu $v0, $v0, 0x1
/* 189430 8025AB50 A20206CD */ sb $v0, 0x6CD($s0)
/* 189434 8025AB54 00021600 */ sll $v0, $v0, 24
/* 189438 8025AB58 00021583 */ sra $v0, $v0, 22
/* 18943C 8025AB5C 00431021 */ addu $v0, $v0, $v1
/* 189440 8025AB60 8C420000 */ lw $v0, 0x0($v0)
/* 189444 8025AB64 1444FFF8 */ bne $v0, $a0, .L8025AB48
/* 189448 8025AB68 00000000 */ nop
/* 18944C 8025AB6C A20006C2 */ sb $zero, 0x6C2($s0)
.L8025AB70:
/* 189450 8025AB70 A60006CA */ sh $zero, 0x6CA($s0)
/* 189454 8025AB74 A20006C2 */ sb $zero, 0x6C2($s0)
/* 189458 8025AB78 A20006C1 */ sb $zero, 0x6C1($s0)
.L8025AB7C:
/* 18945C 8025AB7C 820206CD */ lb $v0, 0x6CD($s0)
/* 189460 8025AB80 18400066 */ blez $v0, .L8025AD1C
/* 189464 8025AB84 0000402D */ daddu $t0, $zero, $zero
/* 189468 8025AB88 3C0B8000 */ lui $t3, (0x80000000 >> 16)
/* 18946C 8025AB8C 3C01802A */ lui $at, %hi(D_8029D408)
/* 189470 8025AB90 D428D408 */ ldc1 $f8, %lo(D_8029D408)($at)
/* 189474 8025AB94 3C0141E0 */ lui $at, (0x41E00000 >> 16)
/* 189478 8025AB98 44811800 */ mtc1 $at, $f3
/* 18947C 8025AB9C 44801000 */ mtc1 $zero, $f2
/* 189480 8025ABA0 3C01802A */ lui $at, %hi(D_8029D410)
/* 189484 8025ABA4 D426D410 */ ldc1 $f6, %lo(D_8029D410)($at)
/* 189488 8025ABA8 3C01802A */ lui $at, %hi(D_8029D418)
/* 18948C 8025ABAC D424D418 */ ldc1 $f4, %lo(D_8029D418)($at)
.L8025ABB0:
/* 189490 8025ABB0 8E0206D0 */ lw $v0, 0x6D0($s0)
/* 189494 8025ABB4 00081880 */ sll $v1, $t0, 2
D_8025ABB8:
/* 189498 8025ABB8 00621821 */ addu $v1, $v1, $v0
/* 18949C 8025ABBC 00081140 */ sll $v0, $t0, 5
/* 1894A0 8025ABC0 8C670000 */ lw $a3, 0x0($v1)
/* 1894A4 8025ABC4 10E0004F */ beqz $a3, .L8025AD04
/* 1894A8 8025ABC8 02025021 */ addu $t2, $s0, $v0
/* 1894AC 8025ABCC 0000482D */ daddu $t1, $zero, $zero
.L8025ABD0:
/* 1894B0 8025ABD0 94E30000 */ lhu $v1, 0x0($a3)
/* 1894B4 8025ABD4 000312C2 */ srl $v0, $v1, 11
/* 1894B8 8025ABD8 44820000 */ mtc1 $v0, $f0
/* 1894BC 8025ABDC 00000000 */ nop
/* 1894C0 8025ABE0 46800021 */ cvt.d.w $f0, $f0
/* 1894C4 8025ABE4 46280002 */ mul.d $f0, $f0, $f8
/* 1894C8 8025ABE8 00000000 */ nop
/* 1894CC 8025ABEC 90E40001 */ lbu $a0, 0x1($a3)
/* 1894D0 8025ABF0 24E70002 */ addiu $a3, $a3, 0x2
/* 1894D4 8025ABF4 00031182 */ srl $v0, $v1, 6
/* 1894D8 8025ABF8 3042001F */ andi $v0, $v0, 0x1F
/* 1894DC 8025ABFC 00031842 */ srl $v1, $v1, 1
/* 1894E0 8025AC00 3066001F */ andi $a2, $v1, 0x1F
/* 1894E4 8025AC04 4620103E */ c.le.d $f2, $f0
/* 1894E8 8025AC08 00000000 */ nop
/* 1894EC 8025AC0C 45010005 */ bc1t .L8025AC24
/* 1894F0 8025AC10 30840001 */ andi $a0, $a0, 0x1
/* 1894F4 8025AC14 4620028D */ trunc.w.d $f10, $f0
/* 1894F8 8025AC18 44035000 */ mfc1 $v1, $f10
/* 1894FC 8025AC1C 08096B0F */ j .L8025AC3C
/* 189500 8025AC20 304200FF */ andi $v0, $v0, 0xFF
.L8025AC24:
/* 189504 8025AC24 46220001 */ sub.d $f0, $f0, $f2
/* 189508 8025AC28 4620028D */ trunc.w.d $f10, $f0
/* 18950C 8025AC2C 44035000 */ mfc1 $v1, $f10
/* 189510 8025AC30 00000000 */ nop
/* 189514 8025AC34 006B1825 */ or $v1, $v1, $t3
/* 189518 8025AC38 304200FF */ andi $v0, $v0, 0xFF
.L8025AC3C:
/* 18951C 8025AC3C 44820000 */ mtc1 $v0, $f0
/* 189520 8025AC40 00000000 */ nop
/* 189524 8025AC44 46800021 */ cvt.d.w $f0, $f0
/* 189528 8025AC48 46260002 */ mul.d $f0, $f0, $f6
/* 18952C 8025AC4C 00000000 */ nop
/* 189530 8025AC50 4620103E */ c.le.d $f2, $f0
/* 189534 8025AC54 00000000 */ nop
/* 189538 8025AC58 45030005 */ bc1tl .L8025AC70
/* 18953C 8025AC5C 46220001 */ sub.d $f0, $f0, $f2
/* 189540 8025AC60 4620028D */ trunc.w.d $f10, $f0
/* 189544 8025AC64 44055000 */ mfc1 $a1, $f10
/* 189548 8025AC68 08096B21 */ j .L8025AC84
/* 18954C 8025AC6C 30C200FF */ andi $v0, $a2, 0xFF
.L8025AC70:
/* 189550 8025AC70 4620028D */ trunc.w.d $f10, $f0
/* 189554 8025AC74 44055000 */ mfc1 $a1, $f10
/* 189558 8025AC78 00000000 */ nop
/* 18955C 8025AC7C 00AB2825 */ or $a1, $a1, $t3
/* 189560 8025AC80 30C200FF */ andi $v0, $a2, 0xFF
.L8025AC84:
/* 189564 8025AC84 44820000 */ mtc1 $v0, $f0
/* 189568 8025AC88 00000000 */ nop
/* 18956C 8025AC8C 46800021 */ cvt.d.w $f0, $f0
/* 189570 8025AC90 46240002 */ mul.d $f0, $f0, $f4
/* 189574 8025AC94 00000000 */ nop
/* 189578 8025AC98 4620103E */ c.le.d $f2, $f0
/* 18957C 8025AC9C 00000000 */ nop
/* 189580 8025ACA0 45010005 */ bc1t .L8025ACB8
/* 189584 8025ACA4 00A0102D */ daddu $v0, $a1, $zero
/* 189588 8025ACA8 4620028D */ trunc.w.d $f10, $f0
/* 18958C 8025ACAC 44055000 */ mfc1 $a1, $f10
/* 189590 8025ACB0 08096B34 */ j .L8025ACD0
/* 189594 8025ACB4 306300FF */ andi $v1, $v1, 0xFF
.L8025ACB8:
/* 189598 8025ACB8 46220001 */ sub.d $f0, $f0, $f2
/* 18959C 8025ACBC 4620028D */ trunc.w.d $f10, $f0
/* 1895A0 8025ACC0 44055000 */ mfc1 $a1, $f10
/* 1895A4 8025ACC4 00000000 */ nop
/* 1895A8 8025ACC8 00AB2825 */ or $a1, $a1, $t3
/* 1895AC 8025ACCC 306300FF */ andi $v1, $v1, 0xFF
.L8025ACD0:
/* 1895B0 8025ACD0 00031AC0 */ sll $v1, $v1, 11
/* 1895B4 8025ACD4 304200FF */ andi $v0, $v0, 0xFF
/* 1895B8 8025ACD8 00021180 */ sll $v0, $v0, 6
/* 1895BC 8025ACDC 00621825 */ or $v1, $v1, $v0
/* 1895C0 8025ACE0 30A200FF */ andi $v0, $a1, 0xFF
/* 1895C4 8025ACE4 00021040 */ sll $v0, $v0, 1
/* 1895C8 8025ACE8 00621825 */ or $v1, $v1, $v0
/* 1895CC 8025ACEC 00831825 */ or $v1, $a0, $v1
/* 1895D0 8025ACF0 A5430000 */ sh $v1, 0x0($t2)
/* 1895D4 8025ACF4 25290001 */ addiu $t1, $t1, 0x1
/* 1895D8 8025ACF8 29220010 */ slti $v0, $t1, 0x10
/* 1895DC 8025ACFC 1440FFB4 */ bnez $v0, .L8025ABD0
/* 1895E0 8025AD00 254A0002 */ addiu $t2, $t2, 0x2
.L8025AD04:
/* 1895E4 8025AD04 820206CD */ lb $v0, 0x6CD($s0)
/* 1895E8 8025AD08 25080001 */ addiu $t0, $t0, 0x1
/* 1895EC 8025AD0C 0102102A */ slt $v0, $t0, $v0
/* 1895F0 8025AD10 1440FFA7 */ bnez $v0, .L8025ABB0
/* 1895F4 8025AD14 00000000 */ nop
/* 1895F8 8025AD18 820206CD */ lb $v0, 0x6CD($s0)
.L8025AD1C:
/* 1895FC 8025AD1C 1840000A */ blez $v0, .L8025AD48
/* 189600 8025AD20 0000402D */ daddu $t0, $zero, $zero
/* 189604 8025AD24 0200202D */ daddu $a0, $s0, $zero
/* 189608 8025AD28 0200182D */ daddu $v1, $s0, $zero
.L8025AD2C:
/* 18960C 8025AD2C AC6406D4 */ sw $a0, 0x6D4($v1)
/* 189610 8025AD30 24840020 */ addiu $a0, $a0, 0x20
/* 189614 8025AD34 820206CD */ lb $v0, 0x6CD($s0)
/* 189618 8025AD38 25080001 */ addiu $t0, $t0, 0x1
/* 18961C 8025AD3C 0102102A */ slt $v0, $t0, $v0
/* 189620 8025AD40 1440FFFA */ bnez $v0, .L8025AD2C
/* 189624 8025AD44 24630004 */ addiu $v1, $v1, 0x4
.L8025AD48:
/* 189628 8025AD48 16400006 */ bnez $s2, .L8025AD64
/* 18962C 8025AD4C 0220202D */ daddu $a0, $s1, $zero
/* 189630 8025AD50 0260282D */ daddu $a1, $s3, $zero
/* 189634 8025AD54 0C096657 */ jal func_8025995C
/* 189638 8025AD58 0280302D */ daddu $a2, $s4, $zero
/* 18963C 8025AD5C 08096B5C */ j .L8025AD70
/* 189640 8025AD60 00000000 */ nop
.L8025AD64:
/* 189644 8025AD64 0260282D */ daddu $a1, $s3, $zero
/* 189648 8025AD68 0C0965B0 */ jal func_802596C0
/* 18964C 8025AD6C 0280302D */ daddu $a2, $s4, $zero
.L8025AD70:
/* 189650 8025AD70 8FBF0024 */ lw $ra, 0x24($sp)
/* 189654 8025AD74 8FB40020 */ lw $s4, 0x20($sp)
/* 189658 8025AD78 8FB3001C */ lw $s3, 0x1C($sp)
/* 18965C 8025AD7C 8FB20018 */ lw $s2, 0x18($sp)
/* 189660 8025AD80 8FB10014 */ lw $s1, 0x14($sp)
/* 189664 8025AD84 8FB00010 */ lw $s0, 0x10($sp)
/* 189668 8025AD88 03E00008 */ jr $ra
/* 18966C 8025AD8C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void render_with_berserk_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, b32 skipAnimation) {
DecorationTable* decorationTable = part->decorationTable;
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->palAnimState = 0;
} else {
decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16);
decorationTable->originalPalettesCount = 0;
while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) {
decorationTable->originalPalettesCount++;
}
decorationTable->palAnimState = 0;
}
decorationTable->palBlendAlpha = 0;
decorationTable->palAnimState = 0;
decorationTable->resetPalAdjust = FALSE;
}
// adjust each palette
for (i = 0; i < decorationTable->originalPalettesCount; i++) {
PAL_PTR palIn = decorationTable->originalPalettesList[i];
PAL_PTR palOut = decorationTable->copiedPalettes[0][i];
if (palIn != NULL) {
for (j = 0; j < SPR_PAL_SIZE; j++) {
u8 r = UNPACK_PAL_R(*palIn);
u8 g = UNPACK_PAL_G(*palIn);
u8 b = UNPACK_PAL_B(*palIn);
u8 a = UNPACK_PAL_A(*palIn);
palIn++;
// make each color darker and redder
r *= 0.8;
g *= 0.6;
b *= 0.1;
*palOut++ = PACK_PAL_RGBA(r, g, b, a);
}
}
}
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 state_init_title_screen
/* 121F0 80036DF0 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 121F4 80036DF4 AFB20028 */ sw $s2, 0x28($sp)
/* 121F8 80036DF8 3C12800A */ lui $s2, %hi(gOverrideFlags)
/* 121FC 80036DFC 2652A650 */ addiu $s2, $s2, %lo(gOverrideFlags)
/* 12200 80036E00 24020001 */ addiu $v0, $zero, 0x1
/* 12204 80036E04 AFBF002C */ sw $ra, 0x2C($sp)
/* 12208 80036E08 AFB10024 */ sw $s1, 0x24($sp)
/* 1220C 80036E0C AFB00020 */ sw $s0, 0x20($sp)
/* 12210 80036E10 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 12214 80036E14 AE400000 */ sw $zero, 0x0($s2)
/* 12218 80036E18 3C01800A */ lui $at, %hi(timeFreezeMode)
/* 1221C 80036E1C AC20A5D8 */ sw $zero, %lo(timeFreezeMode)($at)
/* 12220 80036E20 3C018015 */ lui $at, %hi(D_8014C248)
/* 12224 80036E24 A022C248 */ sb $v0, %lo(D_8014C248)($at)
/* 12228 80036E28 0C00AB00 */ jal general_heap_create
/* 1222C 80036E2C 00000000 */ nop
/* 12230 80036E30 0C048D9D */ jal clear_printers
/* 12234 80036E34 00000000 */ nop
/* 12238 80036E38 0C0525FF */ jal sfx_set_reverb_mode
/* 1223C 80036E3C 0000202D */ daddu $a0, $zero, $zero
/* 12240 80036E40 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 12244 80036E44 2463419C */ addiu $v1, $v1, %lo(gGameStatusPtr)
/* 12248 80036E48 8C620000 */ lw $v0, 0x0($v1)
/* 1224C 80036E4C A04000AC */ sb $zero, 0xAC($v0)
/* 12250 80036E50 8C620000 */ lw $v0, 0x0($v1)
/* 12254 80036E54 A04000AD */ sb $zero, 0xAD($v0)
/* 12258 80036E58 8C620000 */ lw $v0, 0x0($v1)
/* 1225C 80036E5C A0400070 */ sb $zero, 0x70($v0)
/* 12260 80036E60 8C630000 */ lw $v1, 0x0($v1)
/* 12264 80036E64 2402FFFF */ addiu $v0, $zero, -0x1
/* 12268 80036E68 0C00CE1D */ jal intro_logos_update_fade
/* 1226C 80036E6C A06200A8 */ sb $v0, 0xA8($v1)
/* 12270 80036E70 3C04800A */ lui $a0, %hi(D_80098390)
/* 12274 80036E74 24848390 */ addiu $a0, $a0, %lo(D_80098390)
/* 12278 80036E78 0C016B3A */ jal load_asset_by_name
/* 1227C 80036E7C 27A50018 */ addiu $a1, $sp, 0x18
/* 12280 80036E80 8FA40018 */ lw $a0, 0x18($sp)
/* 12284 80036E84 0C00AB39 */ jal heap_malloc
/* 12288 80036E88 0040882D */ daddu $s1, $v0, $zero
/* 1228C 80036E8C 0220202D */ daddu $a0, $s1, $zero
/* 12290 80036E90 0040282D */ daddu $a1, $v0, $zero
/* 12294 80036E94 3C10800A */ lui $s0, %hi(TitleScreen_ImgList)
/* 12298 80036E98 26100974 */ addiu $s0, $s0, %lo(TitleScreen_ImgList)
/* 1229C 80036E9C 0C01BB7C */ jal decode_yay0
/* 122A0 80036EA0 AE050000 */ sw $a1, 0x0($s0)
/* 122A4 80036EA4 0C00AB1E */ jal general_heap_free
/* 122A8 80036EA8 0220202D */ daddu $a0, $s1, $zero
/* 122AC 80036EAC 8E040000 */ lw $a0, 0x0($s0)
/* 122B0 80036EB0 8C820000 */ lw $v0, 0x0($a0)
/* 122B4 80036EB4 8C830008 */ lw $v1, 0x8($a0)
/* 122B8 80036EB8 00441021 */ addu $v0, $v0, $a0
/* 122BC 80036EBC 3C01800A */ lui $at, %hi(TitleScreen_ImgList_Logo)
/* 122C0 80036EC0 AC220978 */ sw $v0, %lo(TitleScreen_ImgList_Logo)($at)
/* 122C4 80036EC4 8C820004 */ lw $v0, 0x4($a0)
/* 122C8 80036EC8 00641821 */ addu $v1, $v1, $a0
/* 122CC 80036ECC 3C01800A */ lui $at, %hi(TitleScreen_ImgList_PressStart)
/* 122D0 80036ED0 AC230980 */ sw $v1, %lo(TitleScreen_ImgList_PressStart)($at)
/* 122D4 80036ED4 00441021 */ addu $v0, $v0, $a0
/* 122D8 80036ED8 3C01800A */ lui $at, %hi(TitleScreen_ImgList_Copyright)
/* 122DC 80036EDC AC22097C */ sw $v0, %lo(TitleScreen_ImgList_Copyright)($at)
/* 122E0 80036EE0 0C00B7BD */ jal create_cameras_a
/* 122E4 80036EE4 00000000 */ nop
/* 122E8 80036EE8 0000202D */ daddu $a0, $zero, $zero
/* 122EC 80036EEC 2405000C */ addiu $a1, $zero, 0xC
/* 122F0 80036EF0 2406001C */ addiu $a2, $zero, 0x1C
/* 122F4 80036EF4 24070128 */ addiu $a3, $zero, 0x128
/* 122F8 80036EF8 3C10800B */ lui $s0, %hi(gCameras)
/* 122FC 80036EFC 26101D80 */ addiu $s0, $s0, %lo(gCameras)
/* 12300 80036F00 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 12304 80036F04 4481A000 */ mtc1 $at, $f20
/* 12308 80036F08 24020006 */ addiu $v0, $zero, 0x6
/* 1230C 80036F0C A6020004 */ sh $v0, 0x4($s0)
/* 12310 80036F10 24020001 */ addiu $v0, $zero, 0x1
/* 12314 80036F14 A6020006 */ sh $v0, 0x6($s0)
/* 12318 80036F18 24020010 */ addiu $v0, $zero, 0x10
/* 1231C 80036F1C A6020012 */ sh $v0, 0x12($s0)
/* 12320 80036F20 24021000 */ addiu $v0, $zero, 0x1000
/* 12324 80036F24 A6020014 */ sh $v0, 0x14($s0)
/* 12328 80036F28 240200B8 */ addiu $v0, $zero, 0xB8
/* 1232C 80036F2C 3C018007 */ lui $at, %hi(gCurrentCameraID)
/* 12330 80036F30 AC207410 */ sw $zero, %lo(gCurrentCameraID)($at)
/* 12334 80036F34 E6140018 */ swc1 $f20, 0x18($s0)
/* 12338 80036F38 AFA20010 */ sw $v0, 0x10($sp)
/* 1233C 80036F3C 96020000 */ lhu $v0, 0x0($s0)
/* 12340 80036F40 96030558 */ lhu $v1, 0x558($s0)
/* 12344 80036F44 34420002 */ ori $v0, $v0, 0x2
/* 12348 80036F48 A6020000 */ sh $v0, 0x0($s0)
/* 1234C 80036F4C 96020AB0 */ lhu $v0, 0xAB0($s0)
/* 12350 80036F50 34630002 */ ori $v1, $v1, 0x2
/* 12354 80036F54 A6030558 */ sh $v1, 0x558($s0)
/* 12358 80036F58 96031008 */ lhu $v1, 0x1008($s0)
/* 1235C 80036F5C 34420002 */ ori $v0, $v0, 0x2
/* 12360 80036F60 34630002 */ ori $v1, $v1, 0x2
/* 12364 80036F64 A6020AB0 */ sh $v0, 0xAB0($s0)
/* 12368 80036F68 0C00B8C5 */ jal set_cam_viewport
/* 1236C 80036F6C A6031008 */ sh $v1, 0x1008($s0)
/* 12370 80036F70 3C0143FA */ lui $at, (0x43FA0000 >> 16)
/* 12374 80036F74 44810000 */ mtc1 $at, $f0
/* 12378 80036F78 3C01447A */ lui $at, (0x447A0000 >> 16)
/* 1237C 80036F7C 44811000 */ mtc1 $at, $f2
/* 12380 80036F80 3C0144BB */ lui $at, (0x44BB8000 >> 16)
/* 12384 80036F84 34218000 */ ori $at, $at, (0x44BB8000 & 0xFFFF)
/* 12388 80036F88 44812000 */ mtc1 $at, $f4
/* 1238C 80036F8C 3C014316 */ lui $at, (0x43160000 >> 16)
/* 12390 80036F90 44813000 */ mtc1 $at, $f6
/* 12394 80036F94 24020028 */ addiu $v0, $zero, 0x28
/* 12398 80036F98 A602001E */ sh $v0, 0x1E($s0)
/* 1239C 80036F9C 24020064 */ addiu $v0, $zero, 0x64
/* 123A0 80036FA0 A600002C */ sh $zero, 0x2C($s0)
/* 123A4 80036FA4 A600002E */ sh $zero, 0x2E($s0)
/* 123A8 80036FA8 A6000030 */ sh $zero, 0x30($s0)
/* 123AC 80036FAC E6140054 */ swc1 $f20, 0x54($s0)
/* 123B0 80036FB0 E6140058 */ swc1 $f20, 0x58($s0)
/* 123B4 80036FB4 A600001C */ sh $zero, 0x1C($s0)
/* 123B8 80036FB8 A6020020 */ sh $v0, 0x20($s0)
/* 123BC 80036FBC A6000022 */ sh $zero, 0x22($s0)
/* 123C0 80036FC0 E600003C */ swc1 $f0, 0x3C($s0)
/* 123C4 80036FC4 E6020040 */ swc1 $f2, 0x40($s0)
/* 123C8 80036FC8 E6040044 */ swc1 $f4, 0x44($s0)
/* 123CC 80036FCC 0C0B0C77 */ jal clear_script_list
/* 123D0 80036FD0 E606005C */ swc1 $f6, 0x5C($s0)
/* 123D4 80036FD4 0C048C2E */ jal clear_worker_list
/* 123D8 80036FD8 00000000 */ nop
/* 123DC 80036FDC 0C047624 */ jal clear_render_tasks
/* 123E0 80036FE0 00000000 */ nop
/* 123E4 80036FE4 0C0B763E */ jal spr_init_sprites
/* 123E8 80036FE8 0000202D */ daddu $a0, $zero, $zero
/* 123EC 80036FEC 0C047889 */ jal clear_animator_list
/* 123F0 80036FF0 00000000 */ nop
/* 123F4 80036FF4 0C0482EC */ jal clear_entity_models
/* 123F8 80036FF8 00000000 */ nop
/* 123FC 80036FFC 0C00E12F */ jal clear_npcs
/* 12400 80037000 00000000 */ nop
/* 12404 80037004 0C050440 */ jal hud_element_clear_cache
/* 12408 80037008 00000000 */ nop
/* 1240C 8003700C 0C05177E */ jal reset_background_settings
/* 12410 80037010 00000000 */ nop
/* 12414 80037014 0C04432E */ jal clear_entity_data
/* 12418 80037018 24040001 */ addiu $a0, $zero, 0x1
/* 1241C 8003701C 0C016727 */ jal clear_effect_data
/* 12420 80037020 00000000 */ nop
/* 12424 80037024 8E420000 */ lw $v0, 0x0($s2)
/* 12428 80037028 34420002 */ ori $v0, $v0, 0x2
/* 1242C 8003702C 0C039CE8 */ jal clear_player_data
/* 12430 80037030 AE420000 */ sw $v0, 0x0($s2)
/* 12434 80037034 0000202D */ daddu $a0, $zero, $zero
/* 12438 80037038 3C058003 */ lui $a1, %hi(appendGfx_title_screen)
/* 1243C 8003703C 24A57638 */ addiu $a1, $a1, %lo(appendGfx_title_screen)
/* 12440 80037040 8E420000 */ lw $v0, 0x0($s2)
/* 12444 80037044 2403FFF7 */ addiu $v1, $zero, -0x9
/* 12448 80037048 00431024 */ and $v0, $v0, $v1
/* 1244C 8003704C 0C044B61 */ jal game_mode_set_fpDrawAuxUI
/* 12450 80037050 AE420000 */ sw $v0, 0x0($s2)
/* 12454 80037054 3C04800A */ lui $a0, %hi(D_8009839C)
/* 12458 80037058 0C05175C */ jal load_map_bg
/* 1245C 8003705C 2484839C */ addiu $a0, $a0, %lo(D_8009839C)
/* 12460 80037060 3C048020 */ lui $a0, %hi(vtx_C20F40)
/* 12464 80037064 24840000 */ addiu $a0, $a0, %lo(vtx_C20F40)
/* 12468 80037068 0C05178A */ jal read_background_size
/* 1246C 8003706C 00000000 */ nop
/* 12470 80037070 0000202D */ daddu $a0, $zero, $zero
/* 12474 80037074 2405006A */ addiu $a1, $zero, 0x6A
/* 12478 80037078 0080302D */ daddu $a2, $a0, $zero
/* 1247C 8003707C 240701F4 */ addiu $a3, $zero, 0x1F4
/* 12480 80037080 24020008 */ addiu $v0, $zero, 0x8
/* 12484 80037084 0C052A46 */ jal bgm_set_song
/* 12488 80037088 AFA20010 */ sw $v0, 0x10($sp)
/* 1248C 8003708C 8FBF002C */ lw $ra, 0x2C($sp)
/* 12490 80037090 8FB20028 */ lw $s2, 0x28($sp)
/* 12494 80037094 8FB10024 */ lw $s1, 0x24($sp)
/* 12498 80037098 8FB00020 */ lw $s0, 0x20($sp)
/* 1249C 8003709C D7B40030 */ ldc1 $f20, 0x30($sp)
/* 124A0 800370A0 240201E0 */ addiu $v0, $zero, 0x1E0
/* 124A4 800370A4 3C01800A */ lui $at, %hi(D_800A0988)
/* 124A8 800370A8 A4220988 */ sh $v0, %lo(D_800A0988)($at)
/* 124AC 800370AC 03E00008 */ jr $ra
/* 124B0 800370B0 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void state_init_title_screen(void) {
s32 titleDataSize;
void* titleDataDst;
void* titleData;
gOverrideFlags = 0;
timeFreezeMode = 0;
D_8014C248[0] = 1;
general_heap_create();
clear_printers();
sfx_set_reverb_mode(0);
gGameStatusPtr->introState = INTRO_STATE_0;
gGameStatusPtr->introCounter = 0;
gGameStatusPtr->isBattle = FALSE;
gGameStatusPtr->creditsViewportMode = -1;
intro_logos_update_fade();
titleData = load_asset_by_name("title_data", &titleDataSize);
titleDataDst = TitleScreen_ImgList = heap_malloc(titleDataSize);
decode_yay0(titleData, titleDataDst);
general_heap_free(titleData);
TitleScreen_ImgList_Logo = (s32*)(TitleScreen_ImgList->logo + (s32) TitleScreen_ImgList);
TitleScreen_ImgList_Copyright = (u8 (*)[COPYRIGHT_WIDTH]) ((s32*)(TitleScreen_ImgList->copyright + (s32) TitleScreen_ImgList));
TitleScreen_ImgList_PressStart = (s32*)(TitleScreen_ImgList->pressStart + (s32) TitleScreen_ImgList);
#if VERSION_JP
TitleScreen_ImgList_CopyrightPalette = (s32*)(TitleScreen_ImgList->copyrightPalette + (s32) TitleScreen_ImgList);
#endif
create_cameras_a();
gCameras[CAM_DEFAULT].updateMode = CAM_UPDATE_MODE_6;
gCameras[CAM_DEFAULT].needsInit = TRUE;
gCameras[CAM_DEFAULT].nearClip = CAM_NEAR_CLIP;
gCameras[CAM_DEFAULT].farClip = CAM_FAR_CLIP;
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;
clear_player_data();
gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
game_mode_set_fpDrawAuxUI(0, appendGfx_title_screen);
load_map_bg("title_bg");
read_background_size(&gBackgroundImage);
bgm_set_song(0, SONG_MAIN_THEME, 0, 500, 8);
D_800A0988 = 480;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel BoostAttack
/* 19E5B4 8026FCD4 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 19E5B8 8026FCD8 AFB20020 */ sw $s2, 0x20($sp)
/* 19E5BC 8026FCDC 0080902D */ daddu $s2, $a0, $zero
/* 19E5C0 8026FCE0 AFBF0024 */ sw $ra, 0x24($sp)
/* 19E5C4 8026FCE4 AFB1001C */ sw $s1, 0x1C($sp)
/* 19E5C8 8026FCE8 AFB00018 */ sw $s0, 0x18($sp)
/* 19E5CC 8026FCEC F7B80038 */ sdc1 $f24, 0x38($sp)
gPauseWS_18:
/* 19E5D0 8026FCF0 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 19E5D4 8026FCF4 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 19E5D8 8026FCF8 8E51000C */ lw $s1, 0xC($s2)
/* 19E5DC 8026FCFC 54A00001 */ bnel $a1, $zero, .L8026FD04
/* 19E5E0 8026FD00 AE400070 */ sw $zero, 0x70($s2)
.L8026FD04:
/* 19E5E4 8026FD04 8E420070 */ lw $v0, 0x70($s2)
/* 19E5E8 8026FD08 1440002D */ bnez $v0, .L8026FDC0
/* 19E5EC 8026FD0C 00000000 */ nop
/* 19E5F0 8026FD10 8E250000 */ lw $a1, 0x0($s1)
/* 19E5F4 8026FD14 26310004 */ addiu $s1, $s1, 0x4
/* 19E5F8 8026FD18 0C0B1EAF */ jal evt_get_variable
/* 19E5FC 8026FD1C 0240202D */ daddu $a0, $s2, $zero
/* 19E600 8026FD20 0040802D */ daddu $s0, $v0, $zero
/* 19E604 8026FD24 2402FF81 */ addiu $v0, $zero, -0x7F
gPauseWS_19:
/* 19E608 8026FD28 16020002 */ bne $s0, $v0, .L8026FD34
/* 19E60C 8026FD2C 00000000 */ nop
/* 19E610 8026FD30 8E500148 */ lw $s0, 0x148($s2)
.L8026FD34:
/* 19E614 8026FD34 8E250000 */ lw $a1, 0x0($s1)
/* 19E618 8026FD38 0C0B1EAF */ jal evt_get_variable
/* 19E61C 8026FD3C 0240202D */ daddu $a0, $s2, $zero
/* 19E620 8026FD40 0040882D */ daddu $s1, $v0, $zero
/* 19E624 8026FD44 0C09A75B */ jal get_actor
/* 19E628 8026FD48 0200202D */ daddu $a0, $s0, $zero
/* 19E62C 8026FD4C 0040802D */ daddu $s0, $v0, $zero
/* 19E630 8026FD50 24040008 */ addiu $a0, $zero, 0x8
/* 19E634 8026FD54 AE500074 */ sw $s0, 0x74($s2)
/* 19E638 8026FD58 0C093903 */ jal func_8024E40C
/* 19E63C 8026FD5C AE510078 */ sw $s1, 0x78($s2)
gPauseWS_20:
/* 19E640 8026FD60 0C093978 */ jal func_8024E5E0
/* 19E644 8026FD64 2404000C */ addiu $a0, $zero, 0xC
/* 19E648 8026FD68 86040192 */ lh $a0, 0x192($s0)
/* 19E64C 8026FD6C 0C09390F */ jal func_8024E43C
/* 19E650 8026FD70 00000000 */ nop
/* 19E654 8026FD74 0C093965 */ jal func_8024E594
/* 19E658 8026FD78 240400FA */ addiu $a0, $zero, 0xFA
/* 19E65C 8026FD7C 0C093936 */ jal D_8024E4D8_C0BD58
/* 19E660 8026FD80 2404000A */ addiu $a0, $zero, 0xA
/* 19E664 8026FD84 0C093983 */ jal func_8024E60C
/* 19E668 8026FD88 00000000 */ nop
/* 19E66C 8026FD8C 8E020000 */ lw $v0, 0x0($s0)
/* 19E670 8026FD90 30420800 */ andi $v0, $v0, 0x800
/* 19E674 8026FD94 10400004 */ beqz $v0, .L8026FDA8
gPauseWS_21:
/* 19E678 8026FD98 24020001 */ addiu $v0, $zero, 0x1
/* 19E67C 8026FD9C 0C093978 */ jal func_8024E5E0
/* 19E680 8026FDA0 0000202D */ daddu $a0, $zero, $zero
/* 19E684 8026FDA4 24020001 */ addiu $v0, $zero, 0x1
.L8026FDA8:
/* 19E688 8026FDA8 3C01802A */ lui $at, %hi(D_8029FBD4)
/* 19E68C 8026FDAC A022FBD4 */ sb $v0, %lo(D_8029FBD4)($at)
/* 19E690 8026FDB0 24020005 */ addiu $v0, $zero, 0x5
/* 19E694 8026FDB4 AE42007C */ sw $v0, 0x7C($s2)
/* 19E698 8026FDB8 24020001 */ addiu $v0, $zero, 0x1
/* 19E69C 8026FDBC AE420070 */ sw $v0, 0x70($s2)
.L8026FDC0:
/* 19E6A0 8026FDC0 0C09A75B */ jal get_actor
/* 19E6A4 8026FDC4 8E440148 */ lw $a0, 0x148($s2)
/* 19E6A8 8026FDC8 8E500074 */ lw $s0, 0x74($s2)
/* 19E6AC 8026FDCC 8E510078 */ lw $s1, 0x78($s2)
gPauseWS_22:
/* 19E6B0 8026FDD0 86020150 */ lh $v0, 0x150($s0)
/* 19E6B4 8026FDD4 8E030000 */ lw $v1, 0x0($s0)
/* 19E6B8 8026FDD8 C6000144 */ lwc1 $f0, 0x144($s0)
/* 19E6BC 8026FDDC 44821000 */ mtc1 $v0, $f2
/* 19E6C0 8026FDE0 00000000 */ nop
/* 19E6C4 8026FDE4 468010A0 */ cvt.s.w $f2, $f2
/* 19E6C8 8026FDE8 30620800 */ andi $v0, $v1, 0x800
/* 19E6CC 8026FDEC 1040000E */ beqz $v0, .L8026FE28
/* 19E6D0 8026FDF0 46020280 */ add.s $f10, $f0, $f2
/* 19E6D4 8026FDF4 86020152 */ lh $v0, 0x152($s0)
/* 19E6D8 8026FDF8 C6020148 */ lwc1 $f2, 0x148($s0)
/* 19E6DC 8026FDFC 44820000 */ mtc1 $v0, $f0
/* 19E6E0 8026FE00 00000000 */ nop
/* 19E6E4 8026FE04 46800020 */ cvt.s.w $f0, $f0
gPauseWS_23:
/* 19E6E8 8026FE08 92020191 */ lbu $v0, 0x191($s0)
/* 19E6EC 8026FE0C 46001080 */ add.s $f2, $f2, $f0
/* 19E6F0 8026FE10 00021042 */ srl $v0, $v0, 1
/* 19E6F4 8026FE14 44820000 */ mtc1 $v0, $f0
/* 19E6F8 8026FE18 00000000 */ nop
/* 19E6FC 8026FE1C 46800020 */ cvt.s.w $f0, $f0
/* 19E700 8026FE20 0809BFA5 */ j .L8026FE94
/* 19E704 8026FE24 46001181 */ sub.s $f6, $f2, $f0
.L8026FE28:
/* 19E708 8026FE28 30628000 */ andi $v0, $v1, 0x8000
/* 19E70C 8026FE2C 1440000E */ bnez $v0, .L8026FE68
/* 19E710 8026FE30 00000000 */ nop
/* 19E714 8026FE34 86020152 */ lh $v0, 0x152($s0)
/* 19E718 8026FE38 C6020148 */ lwc1 $f2, 0x148($s0)
/* 19E71C 8026FE3C 44820000 */ mtc1 $v0, $f0
gPauseWS_24:
/* 19E720 8026FE40 00000000 */ nop
/* 19E724 8026FE44 46800020 */ cvt.s.w $f0, $f0
/* 19E728 8026FE48 92020191 */ lbu $v0, 0x191($s0)
/* 19E72C 8026FE4C 46001080 */ add.s $f2, $f2, $f0
/* 19E730 8026FE50 00021042 */ srl $v0, $v0, 1
/* 19E734 8026FE54 44820000 */ mtc1 $v0, $f0
/* 19E738 8026FE58 00000000 */ nop
/* 19E73C 8026FE5C 46800020 */ cvt.s.w $f0, $f0
/* 19E740 8026FE60 0809BFA5 */ j .L8026FE94
/* 19E744 8026FE64 46020180 */ add.s $f6, $f0, $f2
.L8026FE68:
/* 19E748 8026FE68 86020152 */ lh $v0, 0x152($s0)
/* 19E74C 8026FE6C C6000148 */ lwc1 $f0, 0x148($s0)
/* 19E750 8026FE70 44821000 */ mtc1 $v0, $f2
/* 19E754 8026FE74 00000000 */ nop
gPauseWS_25:
/* 19E758 8026FE78 468010A0 */ cvt.s.w $f2, $f2
/* 19E75C 8026FE7C 92020191 */ lbu $v0, 0x191($s0)
/* 19E760 8026FE80 46020000 */ add.s $f0, $f0, $f2
/* 19E764 8026FE84 44821000 */ mtc1 $v0, $f2
/* 19E768 8026FE88 00000000 */ nop
/* 19E76C 8026FE8C 468010A0 */ cvt.s.w $f2, $f2
/* 19E770 8026FE90 46020180 */ add.s $f6, $f0, $f2
.L8026FE94:
/* 19E774 8026FE94 86020154 */ lh $v0, 0x154($s0)
/* 19E778 8026FE98 86030150 */ lh $v1, 0x150($s0)
/* 19E77C 8026FE9C C600014C */ lwc1 $f0, 0x14C($s0)
/* 19E780 8026FEA0 44821000 */ mtc1 $v0, $f2
/* 19E784 8026FEA4 00000000 */ nop
/* 19E788 8026FEA8 468010A0 */ cvt.s.w $f2, $f2
/* 19E78C 8026FEAC 44832000 */ mtc1 $v1, $f4
gPauseWS_26:
/* 19E790 8026FEB0 00000000 */ nop
/* 19E794 8026FEB4 46802120 */ cvt.s.w $f4, $f4
/* 19E798 8026FEB8 92020190 */ lbu $v0, 0x190($s0)
/* 19E79C 8026FEBC 46020000 */ add.s $f0, $f0, $f2
/* 19E7A0 8026FEC0 3C014120 */ lui $at, (0x41200000 >> 16)
/* 19E7A4 8026FEC4 44811000 */ mtc1 $at, $f2
/* 19E7A8 8026FEC8 8E030000 */ lw $v1, 0x0($s0)
/* 19E7AC 8026FECC 46020200 */ add.s $f8, $f0, $f2
/* 19E7B0 8026FED0 C6000144 */ lwc1 $f0, 0x144($s0)
/* 19E7B4 8026FED4 00021042 */ srl $v0, $v0, 1
/* 19E7B8 8026FED8 46040000 */ add.s $f0, $f0, $f4
/* 19E7BC 8026FEDC 44821000 */ mtc1 $v0, $f2
/* 19E7C0 8026FEE0 00000000 */ nop
/* 19E7C4 8026FEE4 468010A0 */ cvt.s.w $f2, $f2
gPauseWS_27:
/* 19E7C8 8026FEE8 30620800 */ andi $v0, $v1, 0x800
/* 19E7CC 8026FEEC 1040000D */ beqz $v0, .L8026FF24
/* 19E7D0 8026FEF0 46020600 */ add.s $f24, $f0, $f2
/* 19E7D4 8026FEF4 86020152 */ lh $v0, 0x152($s0)
/* 19E7D8 8026FEF8 C6000148 */ lwc1 $f0, 0x148($s0)
/* 19E7DC 8026FEFC 44821000 */ mtc1 $v0, $f2
/* 19E7E0 8026FF00 00000000 */ nop
/* 19E7E4 8026FF04 468010A0 */ cvt.s.w $f2, $f2
/* 19E7E8 8026FF08 92020191 */ lbu $v0, 0x191($s0)
/* 19E7EC 8026FF0C 46020000 */ add.s $f0, $f0, $f2
/* 19E7F0 8026FF10 44821000 */ mtc1 $v0, $f2
/* 19E7F4 8026FF14 00000000 */ nop
/* 19E7F8 8026FF18 468010A0 */ cvt.s.w $f2, $f2
/* 19E7FC 8026FF1C 0809BFE4 */ j D_8026FF90
gPauseWS_28:
/* 19E800 8026FF20 46020501 */ sub.s $f20, $f0, $f2
.L8026FF24:
/* 19E804 8026FF24 30628000 */ andi $v0, $v1, 0x8000
/* 19E808 8026FF28 1440000D */ bnez $v0, D_8026FF60
/* 19E80C 8026FF2C 00000000 */ nop
/* 19E810 8026FF30 86020152 */ lh $v0, 0x152($s0)
/* 19E814 8026FF34 C6000148 */ lwc1 $f0, 0x148($s0)
/* 19E818 8026FF38 44821000 */ mtc1 $v0, $f2
/* 19E81C 8026FF3C 00000000 */ nop
/* 19E820 8026FF40 468010A0 */ cvt.s.w $f2, $f2
/* 19E824 8026FF44 92020191 */ lbu $v0, 0x191($s0)
/* 19E828 8026FF48 46020000 */ add.s $f0, $f0, $f2
/* 19E82C 8026FF4C 44821000 */ mtc1 $v0, $f2
/* 19E830 8026FF50 00000000 */ nop
/* 19E834 8026FF54 468010A0 */ cvt.s.w $f2, $f2
/* 19E838 8026FF58 0809BFE4 */ j D_8026FF90
/* 19E83C 8026FF5C 46001500 */ add.s $f20, $f2, $f0
### DECOMPILED C INSTRUCTIONS:
ApiStatus BoostAttack(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 actorID;
Actor* actor;
s32 flags;
s32 flags2;
f32 x1, y1, z1;
f32 x2, y2, z2;
s32 attackBoost;
if (isInitialCall) {
script->functionTemp[0] = 0;
}
if (script->functionTemp[0] == 0) {
actorID = evt_get_variable(script, *args++);
if (actorID == ACTOR_SELF) {
actorID = script->owner1.actorID;
}
attackBoost = evt_get_variable(script, *args++);
actor = get_actor(actorID);
script->functionTempPtr[1] = actor;
script->functionTemp[2] = attackBoost;
btl_cam_use_preset(BTL_CAM_PRESET_08);
btl_cam_set_zoffset(12);
btl_cam_target_actor(actor->actorID);
btl_cam_set_zoom(250);
btl_cam_move(10);
func_8024E60C();
if (actor->flags & ACTOR_FLAG_UPSIDE_DOWN) {
btl_cam_set_zoffset(0);
}
D_8029FBD4 = 1;
script->functionTemp[3] = 5;
script->functionTemp[0] = 1;
}
get_actor(script->owner1.actorID);
actor = script->functionTempPtr[1];
attackBoost = script->functionTemp[2];
flags = actor->flags;
x1 = actor->currentPos.x + actor->headOffset.x;
if (flags & ACTOR_FLAG_UPSIDE_DOWN) {
y1 = actor->currentPos.y + actor->headOffset.y - actor->size.y / 2;
} else if (!(flags & ACTOR_FLAG_8000)) {
y1 = actor->currentPos.y + actor->headOffset.y + actor->size.y / 2;
} else {
y1 = actor->currentPos.y + actor->headOffset.y + actor->size.y;
}
z1 = actor->currentPos.z + actor->headOffset.z + 10.0f;
flags2 = actor->flags;
x2 = actor->currentPos.x + actor->headOffset.x + actor->size.x / 2;
if (flags2 & ACTOR_FLAG_UPSIDE_DOWN) {
y2 = actor->currentPos.y + actor->headOffset.y - actor->size.y;
} else if (!(flags2 & ACTOR_FLAG_8000)) {
y2 = actor->currentPos.y + actor->headOffset.y + actor->size.y;
} else {
y2 = actor->currentPos.y + actor->headOffset.y + actor->size.y * 2;
}
z2 = actor->currentPos.z + actor->headOffset.z + 10.0f;
switch (script->functionTemp[0]) {
case 1:
if (script->functionTemp[3] == 0) {
fx_radial_shimmer(2, x1, y1, z1, 1.0f, 30);
btl_cam_use_preset_immediately(BTL_CAM_PRESET_19);
script->functionTemp[3] = 30;
script->functionTemp[0] = 2;
} else {
script->functionTemp[3]--;
break;
}
break;
case 2:
if (script->functionTemp[3] == 0) {
dispatch_event_actor(actor, EVENT_SWAP_PARTNER);
btl_cam_use_preset(BTL_CAM_DEFAULT);
btl_cam_move(15);
actor->isGlowing = 1;
actor->attackBoost += attackBoost;
if (actor->attackBoost > 20) {
actor->attackBoost = 20;
}
fx_stat_change(attackBoost - 1, x2, y2, z2, 1.0f, 60);
script->functionTemp[3] = 15;
script->functionTemp[0] = 3;
} else {
script->functionTemp[3]--;
break;
}
break;
case 3:
if (script->functionTemp[3] == 0) {
btl_show_variable_battle_message(BTL_MSG_ATTACK_UP, 60, attackBoost);
script->functionTemp[0] = 4;
} else {
script->functionTemp[3]--;
break;
}
break;
case 4:
if (btl_is_popup_displayed() == 0) {
btl_cam_use_preset(BTL_CAM_DEFAULT);
script->functionTemp[3] = 10;
script->functionTemp[0] = 5;
}
break;
case 5:
if (script->functionTemp[3] != 0) {
script->functionTemp[3]--;
break;
}
if ((actor->handleEventScript == NULL) || !does_script_exist(actor->handleEventScriptID)) {
D_8029FBD4 = 0;
return ApiStatus_DONE2;
}
break;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel bgm_update_music_settings
/* E0C48 8014A548 27BDFFC8 */ addiu $sp, $sp, -0x38
/* E0C4C 8014A54C AFB1001C */ sw $s1, 0x1C($sp)
/* E0C50 8014A550 3C118016 */ lui $s1, %hi(gMusicSettings)
/* E0C54 8014A554 26319AF0 */ addiu $s1, $s1, %lo(gMusicSettings)
/* E0C58 8014A558 AFB20020 */ sw $s2, 0x20($sp)
/* E0C5C 8014A55C 0000902D */ daddu $s2, $zero, $zero
/* E0C60 8014A560 AFB30024 */ sw $s3, 0x24($sp)
/* E0C64 8014A564 24130002 */ addiu $s3, $zero, 0x2
/* E0C68 8014A568 AFB5002C */ sw $s5, 0x2C($sp)
/* E0C6C 8014A56C 2415FFFB */ addiu $s5, $zero, -0x5
/* E0C70 8014A570 AFB40028 */ sw $s4, 0x28($sp)
/* E0C74 8014A574 24140005 */ addiu $s4, $zero, 0x5
/* E0C78 8014A578 AFB00018 */ sw $s0, 0x18($sp)
/* E0C7C 8014A57C 26300002 */ addiu $s0, $s1, 0x2
/* E0C80 8014A580 AFBF0030 */ sw $ra, 0x30($sp)
.L8014A584:
/* E0C84 8014A584 86030000 */ lh $v1, 0x0($s0)
/* E0C88 8014A588 2C620006 */ sltiu $v0, $v1, 0x6
/* E0C8C 8014A58C 50400085 */ beql $v0, $zero, .L8014A7A4
/* E0C90 8014A590 26520001 */ addiu $s2, $s2, 0x1
/* E0C94 8014A594 00031080 */ sll $v0, $v1, 2
/* E0C98 8014A598 3C018015 */ lui $at, %hi(jtbl_80151290)
/* E0C9C 8014A59C 00220821 */ addu $at, $at, $v0
/* E0CA0 8014A5A0 8C221290 */ lw $v0, %lo(jtbl_80151290)($at)
/* E0CA4 8014A5A4 00400008 */ jr $v0
/* E0CA8 8014A5A8 00000000 */ nop
glabel .L8014A5AC
/* E0CAC 8014A5AC 96230000 */ lhu $v1, 0x0($s1)
/* E0CB0 8014A5B0 30620001 */ andi $v0, $v1, 0x1
/* E0CB4 8014A5B4 1040001D */ beqz $v0, .L8014A62C
/* E0CB8 8014A5B8 30620004 */ andi $v0, $v1, 0x4
/* E0CBC 8014A5BC 8E050002 */ lw $a1, 0x2($s0)
/* E0CC0 8014A5C0 28A200FA */ slti $v0, $a1, 0xFA
/* E0CC4 8014A5C4 1040000B */ beqz $v0, .L8014A5F4
/* E0CC8 8014A5C8 30620004 */ andi $v0, $v1, 0x4
/* E0CCC 8014A5CC 14400005 */ bnez $v0, .L8014A5E4
/* E0CD0 8014A5D0 00000000 */ nop
/* E0CD4 8014A5D4 0C015671 */ jal au_song_stop
/* E0CD8 8014A5D8 8E040016 */ lw $a0, 0x16($s0)
/* E0CDC 8014A5DC 08052987 */ j .L8014A61C
/* E0CE0 8014A5E0 00000000 */ nop
.L8014A5E4:
/* E0CE4 8014A5E4 0C0156BC */ jal func_80055AF0
/* E0CE8 8014A5E8 8E040016 */ lw $a0, 0x16($s0)
/* E0CEC 8014A5EC 08052987 */ j .L8014A61C
/* E0CF0 8014A5F0 00000000 */ nop
.L8014A5F4:
/* E0CF4 8014A5F4 14400006 */ bnez $v0, .L8014A610
/* E0CF8 8014A5F8 00000000 */ nop
/* E0CFC 8014A5FC 8E040016 */ lw $a0, 0x16($s0)
/* E0D00 8014A600 0C0156AF */ jal snd_set_song_variation_fade_time
/* E0D04 8014A604 0000302D */ daddu $a2, $zero, $zero
/* E0D08 8014A608 08052987 */ j .L8014A61C
/* E0D0C 8014A60C 00000000 */ nop
.L8014A610:
/* E0D10 8014A610 8E040016 */ lw $a0, 0x16($s0)
/* E0D14 8014A614 0C0156EE */ jal func_80055BB8
/* E0D18 8014A618 240500FA */ addiu $a1, $zero, 0xFA
.L8014A61C:
/* E0D1C 8014A61C 50400060 */ beql $v0, $zero, .L8014A7A0
/* E0D20 8014A620 A6130000 */ sh $s3, 0x0($s0)
/* E0D24 8014A624 080529E9 */ j .L8014A7A4
/* E0D28 8014A628 26520001 */ addiu $s2, $s2, 0x1
.L8014A62C:
/* E0D2C 8014A62C 10400002 */ beqz $v0, .L8014A638
/* E0D30 8014A630 34620010 */ ori $v0, $v1, 0x10
/* E0D34 8014A634 A6220000 */ sh $v0, 0x0($s1)
.L8014A638:
/* E0D38 8014A638 96220000 */ lhu $v0, 0x0($s1)
/* E0D3C 8014A63C 00551024 */ and $v0, $v0, $s5
/* E0D40 8014A640 A6220000 */ sh $v0, 0x0($s1)
glabel .L8014A644
/* E0D44 8014A644 080529E8 */ j .L8014A7A0
/* E0D48 8014A648 A6140000 */ sh $s4, 0x0($s0)
glabel .L8014A64C
/* E0D4C 8014A64C 96230000 */ lhu $v1, 0x0($s1)
/* E0D50 8014A650 00751024 */ and $v0, $v1, $s5
/* E0D54 8014A654 30630001 */ andi $v1, $v1, 0x1
/* E0D58 8014A658 1060FFFA */ beqz $v1, .L8014A644
/* E0D5C 8014A65C A6220000 */ sh $v0, 0x0($s1)
/* E0D60 8014A660 8E040016 */ lw $a0, 0x16($s0)
/* E0D64 8014A664 0C01567F */ jal au_song_is_playing
/* E0D68 8014A668 00000000 */ nop
/* E0D6C 8014A66C 5440004D */ bnel $v0, $zero, .L8014A7A4
/* E0D70 8014A670 26520001 */ addiu $s2, $s2, 0x1
/* E0D74 8014A674 96220000 */ lhu $v0, 0x0($s1)
/* E0D78 8014A678 3042FFFE */ andi $v0, $v0, 0xFFFE
/* E0D7C 8014A67C A6220000 */ sh $v0, 0x0($s1)
/* E0D80 8014A680 24020003 */ addiu $v0, $zero, 0x3
/* E0D84 8014A684 080529E8 */ j .L8014A7A0
/* E0D88 8014A688 A6020000 */ sh $v0, 0x0($s0)
glabel .L8014A68C
/* E0D8C 8014A68C 24020004 */ addiu $v0, $zero, 0x4
/* E0D90 8014A690 080529E8 */ j .L8014A7A0
/* E0D94 8014A694 A6020000 */ sh $v0, 0x0($s0)
glabel .L8014A698
/* E0D98 8014A698 96230000 */ lhu $v1, 0x0($s1)
/* E0D9C 8014A69C 30620008 */ andi $v0, $v1, 0x8
/* E0DA0 8014A6A0 14400029 */ bnez $v0, .L8014A748
/* E0DA4 8014A6A4 30620010 */ andi $v0, $v1, 0x10
/* E0DA8 8014A6A8 8E04000E */ lw $a0, 0xE($s0)
/* E0DAC 8014A6AC 04810003 */ bgez $a0, .L8014A6BC
/* E0DB0 8014A6B0 00000000 */ nop
/* E0DB4 8014A6B4 080529E8 */ j .L8014A7A0
/* E0DB8 8014A6B8 A6000000 */ sh $zero, 0x0($s0)
.L8014A6BC:
/* E0DBC 8014A6BC 0C015635 */ jal au_song_load
/* E0DC0 8014A6C0 0240282D */ daddu $a1, $s2, $zero
/* E0DC4 8014A6C4 3403FFFF */ ori $v1, $zero, 0xFFFF
/* E0DC8 8014A6C8 0062182B */ sltu $v1, $v1, $v0
/* E0DCC 8014A6CC 10600034 */ beqz $v1, .L8014A7A0
/* E0DD0 8014A6D0 AE020016 */ sw $v0, 0x16($s0)
/* E0DD4 8014A6D4 96220000 */ lhu $v0, 0x0($s1)
/* E0DD8 8014A6D8 30420020 */ andi $v0, $v0, 0x20
/* E0DDC 8014A6DC 1040000C */ beqz $v0, .L8014A710
/* E0DE0 8014A6E0 00000000 */ nop
/* E0DE4 8014A6E4 8602000C */ lh $v0, 0xC($s0)
/* E0DE8 8014A6E8 8607000A */ lh $a3, 0xA($s0)
/* E0DEC 8014A6EC AFA20010 */ sw $v0, 0x10($sp)
/* E0DF0 8014A6F0 8E040016 */ lw $a0, 0x16($s0)
/* E0DF4 8014A6F4 8E050012 */ lw $a1, 0x12($s0)
/* E0DF8 8014A6F8 0C015686 */ jal snd_set_song_variation_fade
/* E0DFC 8014A6FC 8E060006 */ lw $a2, 0x6($s0)
/* E0E00 8014A700 96220000 */ lhu $v0, 0x0($s1)
/* E0E04 8014A704 3042FFDF */ andi $v0, $v0, 0xFFDF
/* E0E08 8014A708 080529C8 */ j .L8014A720
/* E0E0C 8014A70C A6220000 */ sh $v0, 0x0($s1)
.L8014A710:
/* E0E10 8014A710 3C048016 */ lui $a0, %hi(MusicDefaultVolume)
/* E0E14 8014A714 84849AE0 */ lh $a0, %lo(MusicDefaultVolume)($a0)
/* E0E18 8014A718 0C052B21 */ jal bgm_set_target_volume
/* E0E1C 8014A71C 00000000 */ nop
.L8014A720:
/* E0E20 8014A720 8E040016 */ lw $a0, 0x16($s0)
/* E0E24 8014A724 0C01565C */ jal au_song_start_variation
/* E0E28 8014A728 8E050012 */ lw $a1, 0x12($s0)
/* E0E2C 8014A72C 5440001D */ bnel $v0, $zero, .L8014A7A4
/* E0E30 8014A730 26520001 */ addiu $s2, $s2, 0x1
/* E0E34 8014A734 96220000 */ lhu $v0, 0x0($s1)
/* E0E38 8014A738 34420001 */ ori $v0, $v0, 0x1
/* E0E3C 8014A73C A6220000 */ sh $v0, 0x0($s1)
/* E0E40 8014A740 080529E8 */ j .L8014A7A0
/* E0E44 8014A744 A6000000 */ sh $zero, 0x0($s0)
.L8014A748:
/* E0E48 8014A748 10400005 */ beqz $v0, .L8014A760
/* E0E4C 8014A74C 00000000 */ nop
/* E0E50 8014A750 A6000000 */ sh $zero, 0x0($s0)
/* E0E54 8014A754 96220000 */ lhu $v0, 0x0($s1)
/* E0E58 8014A758 080529E7 */ j .L8014A79C
/* E0E5C 8014A75C 3042FFE7 */ andi $v0, $v0, 0xFFE7
.L8014A760:
/* E0E60 8014A760 8E04002A */ lw $a0, 0x2A($s0)
/* E0E64 8014A764 0C0156CA */ jal func_80055B28
/* E0E68 8014A768 00000000 */ nop
/* E0E6C 8014A76C 5440000D */ bnel $v0, $zero, .L8014A7A4
/* E0E70 8014A770 26520001 */ addiu $s2, $s2, 0x1
/* E0E74 8014A774 8E020022 */ lw $v0, 0x22($s0)
/* E0E78 8014A778 8E030026 */ lw $v1, 0x26($s0)
/* E0E7C 8014A77C 8E04002A */ lw $a0, 0x2A($s0)
/* E0E80 8014A780 A6000000 */ sh $zero, 0x0($s0)
/* E0E84 8014A784 AE02000E */ sw $v0, 0xE($s0)
/* E0E88 8014A788 AE030012 */ sw $v1, 0x12($s0)
/* E0E8C 8014A78C AE040016 */ sw $a0, 0x16($s0)
/* E0E90 8014A790 96220000 */ lhu $v0, 0x0($s1)
/* E0E94 8014A794 34420001 */ ori $v0, $v0, 0x1
/* E0E98 8014A798 3042FFF7 */ andi $v0, $v0, 0xFFF7
.L8014A79C:
/* E0E9C 8014A79C A6220000 */ sh $v0, 0x0($s1)
glabel .L8014A7A0
/* E0EA0 8014A7A0 26520001 */ addiu $s2, $s2, 0x1
.L8014A7A4:
/* E0EA4 8014A7A4 26100030 */ addiu $s0, $s0, 0x30
/* E0EA8 8014A7A8 2A420002 */ slti $v0, $s2, 0x2
/* E0EAC 8014A7AC 1440FF75 */ bnez $v0, .L8014A584
/* E0EB0 8014A7B0 26310030 */ addiu $s1, $s1, 0x30
/* E0EB4 8014A7B4 0C052B25 */ jal bgm_update_volume
/* E0EB8 8014A7B8 00000000 */ nop
/* E0EBC 8014A7BC 8FBF0030 */ lw $ra, 0x30($sp)
/* E0EC0 8014A7C0 8FB5002C */ lw $s5, 0x2C($sp)
/* E0EC4 8014A7C4 8FB40028 */ lw $s4, 0x28($sp)
/* E0EC8 8014A7C8 8FB30024 */ lw $s3, 0x24($sp)
/* E0ECC 8014A7CC 8FB20020 */ lw $s2, 0x20($sp)
/* E0ED0 8014A7D0 8FB1001C */ lw $s1, 0x1C($sp)
/* E0ED4 8014A7D4 8FB00018 */ lw $s0, 0x18($sp)
/* E0ED8 8014A7D8 03E00008 */ jr $ra
/* E0EDC 8014A7DC 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void bgm_update_music_settings(void) {
MusicSettings* music = gMusicSettings;
s32 i = 0;
s16 state2 = 2;
s16 flag4 = MUSIC_SETTINGS_FLAG_4;
s32 flags;
for (i; i < 2; i++, music++) {
switch (music->state) {
case 0:
break;
case 1:
if (music->flags & MUSIC_SETTINGS_FLAG_1) {
if (music->fadeOutTime < 250) {
if (!(music->flags & MUSIC_SETTINGS_FLAG_4)) {
if (au_song_stop(music->songName) == AU_RESULT_OK) {
music->state = state2;
}
} else {
if (func_80055AF0(music->songName) == AU_RESULT_OK) {
music->state = state2;
}
}
} else if (!(music->flags & MUSIC_SETTINGS_FLAG_4)) {
if (snd_set_song_variation_fade_time(music->songName, music->fadeOutTime, 0) == 0) {
music->state = state2;
}
} else {
if (func_80055BB8(music->songName, 250) == AU_RESULT_OK) {
music->state = state2;
}
}
} else {
if (music->flags & MUSIC_SETTINGS_FLAG_4) {
music->flags |= MUSIC_SETTINGS_FLAG_10;
}
music->flags &= ~flag4;
music->state = 5;
}
break;
case 2:
flags = music->flags;
music->flags &= ~flag4;
if (flags & 1) {
if (au_song_is_playing(music->songName) == AU_RESULT_OK) {
music->flags &= ~MUSIC_SETTINGS_FLAG_1;
music->state = 3;
}
} else {
music->state = 5;
}
break;
case 3:
music->state = 4;
break;
case 4:
music->state = 5;
break;
case 5:
if (!(music->flags & MUSIC_SETTINGS_FLAG_8)) {
if (music->songID < 0) {
music->state = 0;
} else {
music->songName = au_song_load(music->songID, i);
if (music->songName > 0xFFFFU) {
if ((music->flags & MUSIC_SETTINGS_FLAG_20)) {
snd_set_song_variation_fade(music->songName, music->variation,
music->fadeInTime, music->fadeStartVolume, music->fadeEndVolume);
music->flags &= ~MUSIC_SETTINGS_FLAG_20;
} else {
bgm_set_target_volume(MusicDefaultVolume);
}
if (au_song_start_variation(music->songName, music->variation) == 0) {
music->flags |= MUSIC_SETTINGS_FLAG_1;
music->state = 0;
}
}
}
} else {
if (music->flags & MUSIC_SETTINGS_FLAG_10) {
music->state = 0;
music->flags &= ~(MUSIC_SETTINGS_FLAG_10 | MUSIC_SETTINGS_FLAG_8);
} else if (func_80055B28(music->savedSongName) == 0) {
music->songID = music->savedSongID;
music->variation = music->savedVariation;
music->songName = music->savedSongName;
music->state = 0;
music->flags |= MUSIC_SETTINGS_FLAG_1;
music->flags &= ~MUSIC_SETTINGS_FLAG_8;
}
}
break;
}
}
bgm_update_volume();
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel calculate_segment_intersection
/* D6DC 800322DC 27BDFFC0 */ addiu $sp, $sp, -0x40
/* D6E0 800322E0 F7BC0030 */ sdc1 $f28, 0x30($sp)
/* D6E4 800322E4 AFA60048 */ sw $a2, 0x48($sp)
/* D6E8 800322E8 C7BC0048 */ lwc1 $f28, 0x48($sp)
/* D6EC 800322EC F7B80020 */ sdc1 $f24, 0x20($sp)
/* D6F0 800322F0 C7B80050 */ lwc1 $f24, 0x50($sp)
/* D6F4 800322F4 F7B40010 */ sdc1 $f20, 0x10($sp)
/* D6F8 800322F8 46006506 */ mov.s $f20, $f12
/* D6FC 800322FC F7B60018 */ sdc1 $f22, 0x18($sp)
/* D700 80032300 46007586 */ mov.s $f22, $f14
/* D704 80032304 F7BA0028 */ sdc1 $f26, 0x28($sp)
/* D708 80032308 C7BA0054 */ lwc1 $f26, 0x54($sp)
/* D70C 8003230C 4614E481 */ sub.s $f18, $f28, $f20
/* D710 80032310 C7A20058 */ lwc1 $f2, 0x58($sp)
/* D714 80032314 C7A0005C */ lwc1 $f0, 0x5C($sp)
/* D718 80032318 4616D181 */ sub.s $f6, $f26, $f22
/* D71C 8003231C F7BE0038 */ sdc1 $f30, 0x38($sp)
/* D720 80032320 46160781 */ sub.s $f30, $f0, $f22
/* D724 80032324 AFA7004C */ sw $a3, 0x4C($sp)
/* D728 80032328 46181401 */ sub.s $f16, $f2, $f24
/* D72C 8003232C C7BC004C */ lwc1 $f28, 0x4C($sp)
/* D730 80032330 4616E301 */ sub.s $f12, $f28, $f22
/* D734 80032334 4614C701 */ sub.s $f28, $f24, $f20
/* D738 80032338 461A0381 */ sub.s $f14, $f0, $f26
/* D73C 8003233C E7BC0008 */ swc1 $f28, 0x8($sp)
/* D740 80032340 46141701 */ sub.s $f28, $f2, $f20
/* D744 80032344 44802000 */ mtc1 $zero, $f4
/* D748 80032348 46009286 */ mov.s $f10, $f18
/* D74C 8003234C 46049032 */ c.eq.s $f18, $f4
/* D750 80032350 46006207 */ neg.s $f8, $f12
/* D754 80032354 45000005 */ bc1f .L8003236C
/* D758 80032358 E7BC0000 */ swc1 $f28, 0x0($sp)
/* D75C 8003235C 46046032 */ c.eq.s $f12, $f4
/* D760 80032360 00000000 */ nop
/* D764 80032364 45010097 */ bc1t .L800325C4
/* D768 80032368 0000102D */ daddu $v0, $zero, $zero
.L8003236C:
/* D76C 8003236C 44800000 */ mtc1 $zero, $f0
/* D770 80032370 00000000 */ nop
/* D774 80032374 46008032 */ c.eq.s $f16, $f0
/* D778 80032378 00000000 */ nop
/* D77C 8003237C 45000005 */ bc1f .L80032394
/* D780 80032380 00000000 */ nop
/* D784 80032384 46007032 */ c.eq.s $f14, $f0
/* D788 80032388 00000000 */ nop
/* D78C 8003238C 4501008D */ bc1t .L800325C4
/* D790 80032390 0000102D */ daddu $v0, $zero, $zero
.L80032394:
/* D794 80032394 46065002 */ mul.s $f0, $f10, $f6
/* D798 80032398 00000000 */ nop
/* D79C 8003239C C7BC0008 */ lwc1 $f28, 0x8($sp)
/* D7A0 800323A0 461C4082 */ mul.s $f2, $f8, $f28
/* D7A4 800323A4 00000000 */ nop
/* D7A8 800323A8 46001180 */ add.s $f6, $f2, $f0
/* D7AC 800323AC 44800000 */ mtc1 $zero, $f0
/* D7B0 800323B0 00000000 */ nop
/* D7B4 800323B4 4600303C */ c.lt.s $f6, $f0
/* D7B8 800323B8 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* D7BC 800323BC 44812000 */ mtc1 $at, $f4
/* D7C0 800323C0 45010007 */ bc1t .L800323E0
/* D7C4 800323C4 00000000 */ nop
/* D7C8 800323C8 4606003C */ c.lt.s $f0, $f6
/* D7CC 800323CC 00000000 */ nop
/* D7D0 800323D0 45000003 */ bc1f .L800323E0
/* D7D4 800323D4 46000106 */ mov.s $f4, $f0
/* D7D8 800323D8 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* D7DC 800323DC 44812000 */ mtc1 $at, $f4
.L800323E0:
/* D7E0 800323E0 461E5002 */ mul.s $f0, $f10, $f30
/* D7E4 800323E4 00000000 */ nop
/* D7E8 800323E8 C7BC0000 */ lwc1 $f28, 0x0($sp)
/* D7EC 800323EC 461C4082 */ mul.s $f2, $f8, $f28
/* D7F0 800323F0 00000000 */ nop
/* D7F4 800323F4 46001080 */ add.s $f2, $f2, $f0
/* D7F8 800323F8 44800000 */ mtc1 $zero, $f0
/* D7FC 800323FC 00000000 */ nop
/* D800 80032400 4600103C */ c.lt.s $f2, $f0
/* D804 80032404 00000000 */ nop
/* D808 80032408 45000005 */ bc1f .L80032420
/* D80C 8003240C 46002186 */ mov.s $f6, $f4
/* D810 80032410 3C01BF80 */ lui $at, (0xBF800000 >> 16)
/* D814 80032414 44810000 */ mtc1 $at, $f0
/* D818 80032418 0800C90F */ j .L8003243C
/* D81C 8003241C 00000000 */ nop
.L80032420:
/* D820 80032420 4602003C */ c.lt.s $f0, $f2
/* D824 80032424 00000000 */ nop
/* D828 80032428 45000004 */ bc1f .L8003243C
/* D82C 8003242C 00000000 */ nop
/* D830 80032430 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* D834 80032434 44810000 */ mtc1 $at, $f0
/* D838 80032438 00000000 */ nop
.L8003243C:
/* D83C 8003243C 46003032 */ c.eq.s $f6, $f0
/* D840 80032440 00000000 */ nop
/* D844 80032444 4501005F */ bc1t .L800325C4
/* D848 80032448 0000102D */ daddu $v0, $zero, $zero
/* D84C 8003244C 46009085 */ abs.s $f2, $f18
/* D850 80032450 46008005 */ abs.s $f0, $f16
/* D854 80032454 4602003C */ c.lt.s $f0, $f2
/* D858 80032458 00000000 */ nop
/* D85C 8003245C 4500001E */ bc1f .L800324D8
/* D860 80032460 00000000 */ nop
/* D864 80032464 460CA002 */ mul.s $f0, $f20, $f12
/* D868 80032468 00000000 */ nop
/* D86C 8003246C 4612B182 */ mul.s $f6, $f22, $f18
/* D870 80032470 00000000 */ nop
/* D874 80032474 461A9202 */ mul.s $f8, $f18, $f26
/* D878 80032478 00000000 */ nop
/* D87C 8003247C 46186282 */ mul.s $f10, $f12, $f24
/* D880 80032480 00000000 */ nop
/* D884 80032484 46106082 */ mul.s $f2, $f12, $f16
/* D888 80032488 00000000 */ nop
/* D88C 8003248C 460E9102 */ mul.s $f4, $f18, $f14
/* D890 80032490 00000000 */ nop
/* D894 80032494 46060001 */ sub.s $f0, $f0, $f6
/* D898 80032498 46041081 */ sub.s $f2, $f2, $f4
/* D89C 8003249C 46080000 */ add.s $f0, $f0, $f8
/* D8A0 800324A0 460A0181 */ sub.s $f6, $f0, $f10
/* D8A4 800324A4 46023183 */ div.s $f6, $f6, $f2
/* D8A8 800324A8 46068002 */ mul.s $f0, $f16, $f6
/* D8AC 800324AC 00000000 */ nop
/* D8B0 800324B0 4600C000 */ add.s $f0, $f24, $f0
/* D8B4 800324B4 46140001 */ sub.s $f0, $f0, $f20
/* D8B8 800324B8 46120183 */ div.s $f6, $f0, $f18
/* D8BC 800324BC 46069002 */ mul.s $f0, $f18, $f6
/* D8C0 800324C0 00000000 */ nop
/* D8C4 800324C4 46066082 */ mul.s $f2, $f12, $f6
/* D8C8 800324C8 00000000 */ nop
/* D8CC 800324CC 4600A200 */ add.s $f8, $f20, $f0
/* D8D0 800324D0 0800C952 */ j .L80032548
/* D8D4 800324D4 4602B180 */ add.s $f6, $f22, $f2
.L800324D8:
/* D8D8 800324D8 4610D002 */ mul.s $f0, $f26, $f16
/* D8DC 800324DC 00000000 */ nop
/* D8E0 800324E0 460EA182 */ mul.s $f6, $f20, $f14
/* D8E4 800324E4 00000000 */ nop
/* D8E8 800324E8 460ED202 */ mul.s $f8, $f26, $f14
/* D8EC 800324EC 00000000 */ nop
/* D8F0 800324F0 4610B282 */ mul.s $f10, $f22, $f16
/* D8F4 800324F4 00000000 */ nop
/* D8F8 800324F8 46106082 */ mul.s $f2, $f12, $f16
/* D8FC 800324FC 00000000 */ nop
/* D900 80032500 460E9102 */ mul.s $f4, $f18, $f14
/* D904 80032504 00000000 */ nop
/* D908 80032508 46060000 */ add.s $f0, $f0, $f6
/* D90C 8003250C 46041081 */ sub.s $f2, $f2, $f4
/* D910 80032510 46080001 */ sub.s $f0, $f0, $f8
/* D914 80032514 460A0181 */ sub.s $f6, $f0, $f10
/* D918 80032518 46023183 */ div.s $f6, $f6, $f2
/* D91C 8003251C 46069002 */ mul.s $f0, $f18, $f6
/* D920 80032520 00000000 */ nop
/* D924 80032524 4600A000 */ add.s $f0, $f20, $f0
/* D928 80032528 46180001 */ sub.s $f0, $f0, $f24
/* D92C 8003252C 46100183 */ div.s $f6, $f0, $f16
/* D930 80032530 46068002 */ mul.s $f0, $f16, $f6
/* D934 80032534 00000000 */ nop
/* D938 80032538 46067082 */ mul.s $f2, $f14, $f6
/* D93C 8003253C 00000000 */ nop
/* D940 80032540 4600C200 */ add.s $f8, $f24, $f0
/* D944 80032544 4602D180 */ add.s $f6, $f26, $f2
.L80032548:
/* D948 80032548 46144101 */ sub.s $f4, $f8, $f20
/* D94C 8003254C C7BC0048 */ lwc1 $f28, 0x48($sp)
/* D950 80032550 461C4001 */ sub.s $f0, $f8, $f28
/* D954 80032554 46002102 */ mul.s $f4, $f4, $f0
/* D958 80032558 00000000 */ nop
/* D95C 8003255C C7BC004C */ lwc1 $f28, 0x4C($sp)
/* D960 80032560 461C3081 */ sub.s $f2, $f6, $f28
/* D964 80032564 46163001 */ sub.s $f0, $f6, $f22
/* D968 80032568 46020002 */ mul.s $f0, $f0, $f2
/* D96C 8003256C 00000000 */ nop
/* D970 80032570 46002100 */ add.s $f4, $f4, $f0
/* D974 80032574 44800000 */ mtc1 $zero, $f0
/* D978 80032578 00000000 */ nop
/* D97C 8003257C 4604003C */ c.lt.s $f0, $f4
/* D980 80032580 00000000 */ nop
/* D984 80032584 4501000F */ bc1t .L800325C4
/* D988 80032588 0000102D */ daddu $v0, $zero, $zero
/* D98C 8003258C 46184081 */ sub.s $f2, $f8, $f24
/* D990 80032590 46021082 */ mul.s $f2, $f2, $f2
/* D994 80032594 00000000 */ nop
/* D998 80032598 461A3001 */ sub.s $f0, $f6, $f26
/* D99C 8003259C 8FA30060 */ lw $v1, 0x60($sp)
/* D9A0 800325A0 46000002 */ mul.s $f0, $f0, $f0
/* D9A4 800325A4 00000000 */ nop
/* D9A8 800325A8 E4680000 */ swc1 $f8, 0x0($v1)
/* D9AC 800325AC 8FA30064 */ lw $v1, 0x64($sp)
/* D9B0 800325B0 E4660000 */ swc1 $f6, 0x0($v1)
/* D9B4 800325B4 46001080 */ add.s $f2, $f2, $f0
/* D9B8 800325B8 8FA30068 */ lw $v1, 0x68($sp)
/* D9BC 800325BC 24020001 */ addiu $v0, $zero, 0x1
/* D9C0 800325C0 E4620000 */ swc1 $f2, 0x0($v1)
.L800325C4:
/* D9C4 800325C4 D7BE0038 */ ldc1 $f30, 0x38($sp)
/* D9C8 800325C8 D7BC0030 */ ldc1 $f28, 0x30($sp)
/* D9CC 800325CC D7BA0028 */ ldc1 $f26, 0x28($sp)
/* D9D0 800325D0 D7B80020 */ ldc1 $f24, 0x20($sp)
/* D9D4 800325D4 D7B60018 */ ldc1 $f22, 0x18($sp)
/* D9D8 800325D8 D7B40010 */ ldc1 $f20, 0x10($sp)
/* D9DC 800325DC 03E00008 */ jr $ra
/* D9E0 800325E0 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
s32 calculate_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 distance between points on the line is 0
if (dx12_copy == 0.0f && dz12 == 0.0f) {
return FALSE;
}
// if length of second segment is 0
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;
}
// B1 and B2 are on the same side relative to the line: no intersection
if (B1_side_ == B2_side) {
return FALSE;
}
if (fabsf(dx12) > fabsf(dx34)) {
/*
We represent intersection point P as P = B1 + alpha * (B2 - B1)
and solve the equation (P - A1) x (A2 - A1) = 0, where 'x' is cross product, A1 and A2 are points on the line
and B1 and B2 are the ends of the segment.
So, (B1 - A1 + alpha * (B2 - B1)) x (A2 - A1) = 0,
alpha = [-(B1 - A1) x (A2 - A1)] / [(B2 - B1) x (A2 - A1)]
*/
// same as -(B1 - A1) x (A2 - A1)
alpha = A1x * dz12 - A1z * dx12 + dx12 * B1z - dz12 * B1x;
// divide by (B2 - B1) x (A2 - A1)
alpha /= dz12 * dx34 - dx12 * dz34;
/*
Now we represent P as P = A1 + beta * (A2 - A1), and we are to find beta.
B1 + alpha * (B2 - B1) = A1 + beta * (A2 - A1)
beta * (A2 - A1) = B1 + alpha * (B2 - B1) - A1
We use only 'x' part of this equation to find beta.
Actually this step could be omitted and we calculate intersection directly as B1 + alpha * (B2 - B1).
Don't know why it's done this way.
*/
alpha = (B1x + dx34 * alpha - A1x) / dx12;
x = A1x + dx12 * alpha;
z = A1z + dz12 * alpha;
} else {
/*
We represent intersection point P as P = A1 + alpha * (A2 - A1)
and solve the equation (B2 - B1) x (P - B1) = 0
*/
// same as (B2 - B1) x (B1 - A1)
alpha = B1z * dx34 + A1x * dz34 - B1z * dz34 - A1z * dx34;
// divide by (B2 - B1) x (A2 - A1)
alpha /= dz12 * dx34 - dx12 * dz34;
// Now we represent P as P = B1 + beta * (B2 - B1) and find beta
alpha = (A1x + dx12 * alpha - B1x) / dx34;
x = B1x + dx34 * alpha;
z = B1z + dz34 * alpha;
}
// (P - A1) * (P - A2) > 0 when P is outside of segment A1-A2
if ((x - A1x) * (x - A2x) + (z - A1z) * (z - A2z) > 0.0f) {
return FALSE;
}
dx = x - B1x;
dz = z - B1z;
*interX = x;
*interZ = z;
// distance between P and B1
*squared_dist = SQ(dx) + SQ(dz);
return TRUE;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel create_audio_system
/* 25F00 8004AB00 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 25F04 8004AB04 AFB00030 */ sw $s0, 0x30($sp)
/* 25F08 8004AB08 3C10800E */ lui $s0, %hi(nuAuHeap)
/* 25F0C 8004AB0C 26109248 */ addiu $s0, $s0, %lo(nuAuHeap)
/* 25F10 8004AB10 0200202D */ daddu $a0, $s0, $zero
/* 25F14 8004AB14 3C05801B */ lui $a1, %hi(AuHeapBase)
/* 25F18 8004AB18 24A5A000 */ addiu $a1, $a1, %lo(AuHeapBase)
/* 25F1C 8004AB1C 3C060005 */ lui $a2, (0x56000 >> 16)
/* 25F20 8004AB20 24020001 */ addiu $v0, $zero, 0x1
/* 25F24 8004AB24 AFBF003C */ sw $ra, 0x3C($sp)
/* 25F28 8004AB28 AFB20038 */ sw $s2, 0x38($sp)
/* 25F2C 8004AB2C AFB10034 */ sw $s1, 0x34($sp)
/* 25F30 8004AB30 3C018008 */ lui $at, %hi(nuAuTaskStop)
/* 25F34 8004AB34 A0228180 */ sb $v0, %lo(nuAuTaskStop)($at)
/* 25F38 8004AB38 3C018008 */ lui $at, %hi(nuAuPreNMI)
/* 25F3C 8004AB3C A0208170 */ sb $zero, %lo(nuAuPreNMI)($at)
/* 25F40 8004AB40 0C015FC8 */ jal alHeapInit
/* 25F44 8004AB44 34C66000 */ ori $a2, $a2, (0x56000 & 0xFFFF)
/* 25F48 8004AB48 24047D00 */ addiu $a0, $zero, 0x7D00
/* 25F4C 8004AB4C 24020018 */ addiu $v0, $zero, 0x18
/* 25F50 8004AB50 AFA20018 */ sw $v0, 0x18($sp)
/* 25F54 8004AB54 24020004 */ addiu $v0, $zero, 0x4
/* 25F58 8004AB58 0C018558 */ jal osAiSetFrequency
/* 25F5C 8004AB5C AFA2001C */ sw $v0, 0x1C($sp)
/* 25F60 8004AB60 3C03800E */ lui $v1, %hi(D_800DAAB8)
/* 25F64 8004AB64 8C63AAB8 */ lw $v1, %lo(D_800DAAB8)($v1)
/* 25F68 8004AB68 00620018 */ mult $v1, $v0
/* 25F6C 8004AB6C 00001812 */ mflo $v1
/* 25F70 8004AB70 2464003B */ addiu $a0, $v1, 0x3B
/* 25F74 8004AB74 3C038888 */ lui $v1, (0x88888889 >> 16)
/* 25F78 8004AB78 34638889 */ ori $v1, $v1, (0x88888889 & 0xFFFF)
/* 25F7C 8004AB7C 00830019 */ multu $a0, $v1
/* 25F80 8004AB80 0000882D */ daddu $s1, $zero, $zero
/* 25F84 8004AB84 3C12800A */ lui $s2, %hi(AlCmdListBuffers)
/* 25F88 8004AB88 26523510 */ addiu $s2, $s2, %lo(AlCmdListBuffers)
/* 25F8C 8004AB8C AFA20020 */ sw $v0, 0x20($sp)
/* 25F90 8004AB90 00001810 */ mfhi $v1
/* 25F94 8004AB94 3C02B216 */ lui $v0, (0xB21642C9 >> 16)
/* 25F98 8004AB98 344242C9 */ ori $v0, $v0, (0xB21642C9 & 0xFFFF)
/* 25F9C 8004AB9C 00031942 */ srl $v1, $v1, 5
/* 25FA0 8004ABA0 00620019 */ multu $v1, $v0
/* 25FA4 8004ABA4 A3A00024 */ sb $zero, 0x24($sp)
/* 25FA8 8004ABA8 AFB0002C */ sw $s0, 0x2C($sp)
/* 25FAC 8004ABAC 3C028005 */ lui $v0, %hi(nuAuDmaNew)
/* 25FB0 8004ABB0 2442B224 */ addiu $v0, $v0, %lo(nuAuDmaNew)
/* 25FB4 8004ABB4 AFA20028 */ sw $v0, 0x28($sp)
/* 25FB8 8004ABB8 00001810 */ mfhi $v1
/* 25FBC 8004ABBC 000319C2 */ srl $v1, $v1, 7
/* 25FC0 8004ABC0 24630001 */ addiu $v1, $v1, 0x1
/* 25FC4 8004ABC4 00031040 */ sll $v0, $v1, 1
/* 25FC8 8004ABC8 00431021 */ addu $v0, $v0, $v1
/* 25FCC 8004ABCC 000210C0 */ sll $v0, $v0, 3
/* 25FD0 8004ABD0 00431023 */ subu $v0, $v0, $v1
/* 25FD4 8004ABD4 000210C0 */ sll $v0, $v0, 3
/* 25FD8 8004ABD8 3C01800A */ lui $at, %hi(AlFrameSize)
/* 25FDC 8004ABDC AC223634 */ sw $v0, %lo(AlFrameSize)($at)
/* 25FE0 8004ABE0 2442FF48 */ addiu $v0, $v0, -0xB8
/* 25FE4 8004ABE4 3C01800A */ lui $at, %hi(AlMinFrameSize)
/* 25FE8 8004ABE8 AC223638 */ sw $v0, %lo(AlMinFrameSize)($at)
.L8004ABEC:
/* 25FEC 8004ABEC 24050001 */ addiu $a1, $zero, 0x1
/* 25FF0 8004ABF0 24064000 */ addiu $a2, $zero, 0x4000
/* 25FF4 8004ABF4 8FA4002C */ lw $a0, 0x2C($sp)
/* 25FF8 8004ABF8 0C015FE4 */ jal alHeapAlloc
/* 25FFC 8004ABFC 02258821 */ addu $s1, $s1, $a1
/* 26000 8004AC00 AE420000 */ sw $v0, 0x0($s2)
/* 26004 8004AC04 2E220003 */ sltiu $v0, $s1, 0x3
/* 26008 8004AC08 1440FFF8 */ bnez $v0, .L8004ABEC
/* 2600C 8004AC0C 26520004 */ addiu $s2, $s2, 0x4
/* 26010 8004AC10 0000882D */ daddu $s1, $zero, $zero
/* 26014 8004AC14 24090002 */ addiu $t1, $zero, 0x2
/* 26018 8004AC18 3C08800E */ lui $t0, %hi(rspbootUcodeBuffer)
/* 2601C 8004AC1C 25089780 */ addiu $t0, $t0, %lo(rspbootUcodeBuffer)
/* 26020 8004AC20 24070100 */ addiu $a3, $zero, 0x100
/* 26024 8004AC24 3C068007 */ lui $a2, %hi(D_800731A0)
/* 26028 8004AC28 24C631A0 */ addiu $a2, $a2, %lo(D_800731A0)
/* 2602C 8004AC2C 3C058009 */ lui $a1, %hi(D_80097A80)
/* 26030 8004AC30 24A57A80 */ addiu $a1, $a1, %lo(D_80097A80)
/* 26034 8004AC34 24040800 */ addiu $a0, $zero, 0x800
/* 26038 8004AC38 3C03800A */ lui $v1, %hi(nuAuTasks)
/* 2603C 8004AC3C 24633520 */ addiu $v1, $v1, %lo(nuAuTasks)
.L8004AC40:
/* 26040 8004AC40 AC600000 */ sw $zero, 0x0($v1)
/* 26044 8004AC44 AC600054 */ sw $zero, 0x54($v1)
/* 26048 8004AC48 AC690010 */ sw $t1, 0x10($v1)
/* 2604C 8004AC4C AC680018 */ sw $t0, 0x18($v1)
/* 26050 8004AC50 AC67001C */ sw $a3, 0x1C($v1)
/* 26054 8004AC54 AC660020 */ sw $a2, 0x20($v1)
/* 26058 8004AC58 AC650028 */ sw $a1, 0x28($v1)
/* 2605C 8004AC5C AC64002C */ sw $a0, 0x2C($v1)
/* 26060 8004AC60 AC600030 */ sw $zero, 0x30($v1)
/* 26064 8004AC64 AC600034 */ sw $zero, 0x34($v1)
/* 26068 8004AC68 AC600038 */ sw $zero, 0x38($v1)
/* 2606C 8004AC6C AC60003C */ sw $zero, 0x3C($v1)
/* 26070 8004AC70 AC600048 */ sw $zero, 0x48($v1)
/* 26074 8004AC74 AC60004C */ sw $zero, 0x4C($v1)
/* 26078 8004AC78 26310001 */ addiu $s1, $s1, 0x1
/* 2607C 8004AC7C 2E220003 */ sltiu $v0, $s1, 0x3
/* 26080 8004AC80 1440FFEF */ bnez $v0, .L8004AC40
/* 26084 8004AC84 24630058 */ addiu $v1, $v1, 0x58
/* 26088 8004AC88 0000882D */ daddu $s1, $zero, $zero
/* 2608C 8004AC8C 3C10800A */ lui $s0, %hi(D_800A3628)
/* 26090 8004AC90 26103628 */ addiu $s0, $s0, %lo(D_800A3628)
.L8004AC94:
/* 26094 8004AC94 24050001 */ addiu $a1, $zero, 0x1
/* 26098 8004AC98 02258821 */ addu $s1, $s1, $a1
/* 2609C 8004AC9C 3C06800A */ lui $a2, %hi(AlFrameSize)
/* 260A0 8004ACA0 8CC63634 */ lw $a2, %lo(AlFrameSize)($a2)
/* 260A4 8004ACA4 8FA4002C */ lw $a0, 0x2C($sp)
/* 260A8 8004ACA8 0C015FE4 */ jal alHeapAlloc
/* 260AC 8004ACAC 00063080 */ sll $a2, $a2, 2
/* 260B0 8004ACB0 AE020000 */ sw $v0, 0x0($s0)
/* 260B4 8004ACB4 2E220003 */ sltiu $v0, $s1, 0x3
/* 260B8 8004ACB8 1440FFF6 */ bnez $v0, .L8004AC94
/* 260BC 8004ACBC 26100004 */ addiu $s0, $s0, 0x4
/* 260C0 8004ACC0 0000882D */ daddu $s1, $zero, $zero
/* 260C4 8004ACC4 3C02800A */ lui $v0, %hi(nuAuDmaBufList)
/* 260C8 8004ACC8 24423BE0 */ addiu $v0, $v0, %lo(nuAuDmaBufList)
/* 260CC 8004ACCC 0040802D */ daddu $s0, $v0, $zero
/* 260D0 8004ACD0 26120014 */ addiu $s2, $s0, 0x14
/* 260D4 8004ACD4 AE000004 */ sw $zero, 0x4($s0)
/* 260D8 8004ACD8 AE000000 */ sw $zero, 0x0($s0)
.L8004ACDC:
/* 260DC 8004ACDC 0240202D */ daddu $a0, $s2, $zero
/* 260E0 8004ACE0 0C012CFB */ jal alLink
/* 260E4 8004ACE4 0200282D */ daddu $a1, $s0, $zero
/* 260E8 8004ACE8 24050001 */ addiu $a1, $zero, 0x1
/* 260EC 8004ACEC 24060500 */ addiu $a2, $zero, 0x500
/* 260F0 8004ACF0 26520014 */ addiu $s2, $s2, 0x14
/* 260F4 8004ACF4 8FA4002C */ lw $a0, 0x2C($sp)
/* 260F8 8004ACF8 0C015FE4 */ jal alHeapAlloc
/* 260FC 8004ACFC 02258821 */ addu $s1, $s1, $a1
/* 26100 8004AD00 AE020010 */ sw $v0, 0x10($s0)
/* 26104 8004AD04 2E220031 */ sltiu $v0, $s1, 0x31
/* 26108 8004AD08 1440FFF4 */ bnez $v0, .L8004ACDC
/* 2610C 8004AD0C 26100014 */ addiu $s0, $s0, 0x14
/* 26110 8004AD10 24050001 */ addiu $a1, $zero, 0x1
/* 26114 8004AD14 8FA4002C */ lw $a0, 0x2C($sp)
/* 26118 8004AD18 0C015FE4 */ jal alHeapAlloc
/* 2611C 8004AD1C 24060500 */ addiu $a2, $zero, 0x500
/* 26120 8004AD20 3C04800A */ lui $a0, %hi(nuAuDmaMesgQ)
/* 26124 8004AD24 24843640 */ addiu $a0, $a0, %lo(nuAuDmaMesgQ)
/* 26128 8004AD28 3C05800A */ lui $a1, %hi(nuAuDmaMesgBuf)
/* 2612C 8004AD2C 24A53658 */ addiu $a1, $a1, %lo(nuAuDmaMesgBuf)
/* 26130 8004AD30 00111880 */ sll $v1, $s1, 2
/* 26134 8004AD34 00711821 */ addu $v1, $v1, $s1
/* 26138 8004AD38 00031880 */ sll $v1, $v1, 2
/* 2613C 8004AD3C 3C01800A */ lui $at, %hi(D_800A3BF0)
/* 26140 8004AD40 00230821 */ addu $at, $at, $v1
/* 26144 8004AD44 AC223BF0 */ sw $v0, %lo(D_800A3BF0)($at)
/* 26148 8004AD48 0C019560 */ jal osCreateMesgQueue
/* 2614C 8004AD4C 24060032 */ addiu $a2, $zero, 0x32
/* 26150 8004AD50 3C04800C */ lui $a0, %hi(auSynDriver)
/* 26154 8004AD54 248491A0 */ addiu $a0, $a0, %lo(auSynDriver)
/* 26158 8004AD58 3C028005 */ lui $v0, %hi(nuAuPreNMIProc)
/* 2615C 8004AD5C 2442B328 */ addiu $v0, $v0, %lo(nuAuPreNMIProc)
/* 26160 8004AD60 3C018008 */ lui $at, %hi(nuAuPreNMIFunc)
/* 26164 8004AD64 AC228174 */ sw $v0, %lo(nuAuPreNMIFunc)($at)
/* 26168 8004AD68 0C015894 */ jal au_driver_init
/* 2616C 8004AD6C 27A50018 */ addiu $a1, $sp, 0x18
/* 26170 8004AD70 8FA40020 */ lw $a0, 0x20($sp)
/* 26174 8004AD74 0C014B97 */ jal au_engine_init
/* 26178 8004AD78 00000000 */ nop
/* 2617C 8004AD7C 3C10800A */ lui $s0, %hi(nuAuMgrThread)
/* 26180 8004AD80 26100F58 */ addiu $s0, $s0, %lo(nuAuMgrThread)
/* 26184 8004AD84 0200202D */ daddu $a0, $s0, $zero
/* 26188 8004AD88 24050003 */ addiu $a1, $zero, 0x3
/* 2618C 8004AD8C 3C068005 */ lui $a2, %hi(nuAuMgr)
/* 26190 8004AD90 24C6AE08 */ addiu $a2, $a2, %lo(nuAuMgr)
/* 26194 8004AD94 3C02800A */ lui $v0, %hi(AlCmdListBuffers)
/* 26198 8004AD98 24423510 */ addiu $v0, $v0, %lo(AlCmdListBuffers)
/* 2619C 8004AD9C AFA20010 */ sw $v0, 0x10($sp)
/* 261A0 8004ADA0 24020046 */ addiu $v0, $zero, 0x46
/* 261A4 8004ADA4 0000382D */ daddu $a3, $zero, $zero
/* 261A8 8004ADA8 0C019798 */ jal osCreateThread
/* 261AC 8004ADAC AFA20014 */ sw $v0, 0x14($sp)
/* 261B0 8004ADB0 0C019808 */ jal osStartThread
/* 261B4 8004ADB4 0200202D */ daddu $a0, $s0, $zero
/* 261B8 8004ADB8 8FBF003C */ lw $ra, 0x3C($sp)
/* 261BC 8004ADBC 8FB20038 */ lw $s2, 0x38($sp)
/* 261C0 8004ADC0 8FB10034 */ lw $s1, 0x34($sp)
/* 261C4 8004ADC4 8FB00030 */ lw $s0, 0x30($sp)
/* 261C8 8004ADC8 03E00008 */ jr $ra
/* 261CC 8004ADCC 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
void create_audio_system(void) {
u32 i;
u32 outputRate, frameSize;
ALConfig config;
nuAuTaskStop = NU_AU_TASK_RUN;
nuAuPreNMI = 0;
alHeapInit(&nuAuHeap, AuHeapBase, AUDIO_HEAP_SIZE);
config.num_pvoice = 24;
config.num_bus = 4;
outputRate = osAiSetFrequency(32000);
frameSize = (nusched.retraceCount * outputRate + 59) / 60;
config.outputRate = outputRate;
config.unk_0C = 0;
config.heap = &nuAuHeap;
config.dmaNew = nuAuDmaNew;
AlFrameSize = ((frameSize / AUDIO_SAMPLES) + 1) * AUDIO_SAMPLES;
AlMinFrameSize = AlFrameSize - AUDIO_SAMPLES;
for (i = 0; i < ARRAY_COUNT(AlCmdListBuffers); i++) {
AlCmdListBuffers[i] = alHeapAlloc(config.heap, 1, AUDIO_COMMAND_LIST_BUFFER_SIZE);
}
for (i = 0; i < ARRAY_COUNT(nuAuTasks); i++) {
nuAuTasks[i].next = NULL;
nuAuTasks[i].msg = 0;
nuAuTasks[i].list.t.type = M_AUDTASK;
#if VERSION_IQUE
nuAuTasks[i].list.t.ucode_boot = (u64*) rspbootTextStart;
nuAuTasks[i].list.t.ucode_boot_size = (u32) rspbootTextEnd - (u32) rspbootTextStart;
#else
nuAuTasks[i].list.t.ucode_boot = rspbootUcodeBuffer;
nuAuTasks[i].list.t.ucode_boot_size = 0x100;
#endif
nuAuTasks[i].list.t.ucode = n_aspMain_text_bin;
nuAuTasks[i].list.t.ucode_data = n_aspMain_data_bin;
nuAuTasks[i].list.t.ucode_data_size = SP_UCODE_DATA_SIZE;
nuAuTasks[i].list.t.dram_stack = NULL;
nuAuTasks[i].list.t.dram_stack_size = 0;
nuAuTasks[i].list.t.output_buff = NULL;
nuAuTasks[i].list.t.output_buff_size = 0;
nuAuTasks[i].list.t.yield_data_ptr = NULL;
nuAuTasks[i].list.t.yield_data_size = 0;
}
for (i = 0; i < ARRAY_COUNT(D_800A3628); i++) {
D_800A3628[i] = alHeapAlloc(config.heap, 1, AlFrameSize * 4);
}
nuAuDmaBufList[0].node.next = nuAuDmaBufList[0].node.prev = NULL;
for (i = 0; i < ARRAY_COUNT(nuAuDmaBufList) - 1; i++) {
alLink(&nuAuDmaBufList[i+1].node, &nuAuDmaBufList[i].node);
nuAuDmaBufList[i].ptr = alHeapAlloc(config.heap, 1, 0x500);
}
nuAuDmaBufList[i].ptr = alHeapAlloc(config.heap, 1, 0x500);
osCreateMesgQueue(&nuAuDmaMesgQ, nuAuDmaMesgBuf, 50);
nuAuPreNMIFunc = nuAuPreNMIProc;
au_driver_init(&auSynDriver, &config);
au_engine_init(config.outputRate);
osCreateThread(&nuAuMgrThread, NU_MAIN_THREAD_ID, nuAuMgr, NULL, &AuStack[NU_AU_STACK_SIZE / sizeof(u64)], NU_AU_MGR_THREAD_PRI); //why main thread?
osStartThread(&nuAuMgrThread);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_sfx_update_main
/* 26B48 8004B748 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 26B4C 8004B74C AFB40030 */ sw $s4, 0x30($sp)
/* 26B50 8004B750 0080A02D */ daddu $s4, $a0, $zero
/* 26B54 8004B754 AFBF0038 */ sw $ra, 0x38($sp)
/* 26B58 8004B758 AFB50034 */ sw $s5, 0x34($sp)
/* 26B5C 8004B75C AFB3002C */ sw $s3, 0x2C($sp)
/* 26B60 8004B760 AFB20028 */ sw $s2, 0x28($sp)
/* 26B64 8004B764 AFB10024 */ sw $s1, 0x24($sp)
/* 26B68 8004B768 AFB00020 */ sw $s0, 0x20($sp)
/* 26B6C 8004B76C 8E820030 */ lw $v0, 0x30($s4)
/* 26B70 8004B770 8E830168 */ lw $v1, 0x168($s4)
/* 26B74 8004B774 24420001 */ addiu $v0, $v0, 0x1
/* 26B78 8004B778 10600004 */ beqz $v1, .L8004B78C
/* 26B7C 8004B77C AE820030 */ sw $v0, 0x30($s4)
/* 26B80 8004B780 0C01352F */ jal au_sfx_reset_players
/* 26B84 8004B784 00000000 */ nop
/* 26B88 8004B788 AE800168 */ sw $zero, 0x168($s4)
.L8004B78C:
/* 26B8C 8004B78C 0280802D */ daddu $s0, $s4, $zero
.L8004B790:
/* 26B90 8004B790 92030090 */ lbu $v1, 0x90($s0)
/* 26B94 8004B794 10600035 */ beqz $v1, .L8004B86C
/* 26B98 8004B798 2C620002 */ sltiu $v0, $v1, 0x2
/* 26B9C 8004B79C 10400033 */ beqz $v0, .L8004B86C
/* 26BA0 8004B7A0 00031040 */ sll $v0, $v1, 1
/* 26BA4 8004B7A4 00431021 */ addu $v0, $v0, $v1
/* 26BA8 8004B7A8 00021040 */ sll $v0, $v0, 1
/* 26BAC 8004B7AC 3C038008 */ lui $v1, %hi(D_8007836A)
/* 26BB0 8004B7B0 2463836A */ addiu $v1, $v1, %lo(D_8007836A)
/* 26BB4 8004B7B4 00433021 */ addu $a2, $v0, $v1
/* 26BB8 8004B7B8 94C20002 */ lhu $v0, 0x2($a2)
/* 26BBC 8004B7BC 10400020 */ beqz $v0, .L8004B840
/* 26BC0 8004B7C0 0000882D */ daddu $s1, $zero, $zero
/* 26BC4 8004B7C4 0040282D */ daddu $a1, $v0, $zero
/* 26BC8 8004B7C8 0200202D */ daddu $a0, $s0, $zero
/* 26BCC 8004B7CC 0280182D */ daddu $v1, $s4, $zero
.L8004B7D0:
/* 26BD0 8004B7D0 94620202 */ lhu $v0, 0x202($v1)
/* 26BD4 8004B7D4 54450015 */ bnel $v0, $a1, .L8004B82C
/* 26BD8 8004B7D8 26310001 */ addiu $s1, $s1, 0x1
/* 26BDC 8004B7DC 94C20000 */ lhu $v0, 0x0($a2)
/* 26BE0 8004B7E0 A7A00012 */ sh $zero, 0x12($sp)
/* 26BE4 8004B7E4 A7A00016 */ sh $zero, 0x16($sp)
/* 26BE8 8004B7E8 A7A20010 */ sh $v0, 0x10($sp)
/* 26BEC 8004B7EC 90C20004 */ lbu $v0, 0x4($a2)
/* 26BF0 8004B7F0 30420001 */ andi $v0, $v0, 0x1
/* 26BF4 8004B7F4 50400008 */ beql $v0, $zero, .L8004B818
/* 26BF8 8004B7F8 A7A00014 */ sh $zero, 0x14($sp)
/* 26BFC 8004B7FC 90820093 */ lbu $v0, 0x93($a0)
/* 26C00 8004B800 50400005 */ beql $v0, $zero, .L8004B818
/* 26C04 8004B804 A7A00014 */ sh $zero, 0x14($sp)
/* 26C08 8004B808 90820093 */ lbu $v0, 0x93($a0)
/* 26C0C 8004B80C 00021200 */ sll $v0, $v0, 8
/* 26C10 8004B810 244200FF */ addiu $v0, $v0, 0xFF
/* 26C14 8004B814 A7A20014 */ sh $v0, 0x14($sp)
.L8004B818:
/* 26C18 8004B818 A3A00018 */ sb $zero, 0x18($sp)
/* 26C1C 8004B81C 0280202D */ daddu $a0, $s4, $zero
/* 26C20 8004B820 27A50010 */ addiu $a1, $sp, 0x10
/* 26C24 8004B824 08012E19 */ j .L8004B864
/* 26C28 8004B828 0000302D */ daddu $a2, $zero, $zero
.L8004B82C:
/* 26C2C 8004B82C 2E220008 */ sltiu $v0, $s1, 0x8
/* 26C30 8004B830 1440FFE7 */ bnez $v0, .L8004B7D0
/* 26C34 8004B834 246300AC */ addiu $v1, $v1, 0xAC
/* 26C38 8004B838 08012E1C */ j .L8004B870
/* 26C3C 8004B83C AE000090 */ sw $zero, 0x90($s0)
.L8004B840:
/* 26C40 8004B840 0280202D */ daddu $a0, $s4, $zero
/* 26C44 8004B844 27A50010 */ addiu $a1, $sp, 0x10
/* 26C48 8004B848 94C20000 */ lhu $v0, 0x0($a2)
/* 26C4C 8004B84C 0000302D */ daddu $a2, $zero, $zero
/* 26C50 8004B850 A7A00012 */ sh $zero, 0x12($sp)
/* 26C54 8004B854 A7A00014 */ sh $zero, 0x14($sp)
/* 26C58 8004B858 A7A00016 */ sh $zero, 0x16($sp)
/* 26C5C 8004B85C A3A00018 */ sb $zero, 0x18($sp)
/* 26C60 8004B860 A7A20010 */ sh $v0, 0x10($sp)
.L8004B864:
/* 26C64 8004B864 0C012E9D */ jal au_sfx_load_sound
/* 26C68 8004B868 00000000 */ nop
.L8004B86C:
/* 26C6C 8004B86C AE000090 */ sw $zero, 0x90($s0)
.L8004B870:
/* 26C70 8004B870 26100004 */ addiu $s0, $s0, 0x4
/* 26C74 8004B874 26820010 */ addiu $v0, $s4, 0x10
/* 26C78 8004B878 0202102B */ sltu $v0, $s0, $v0
/* 26C7C 8004B87C 1440FFC4 */ bnez $v0, .L8004B790
/* 26C80 8004B880 0000902D */ daddu $s2, $zero, $zero
/* 26C84 8004B884 24130001 */ addiu $s3, $zero, 0x1
/* 26C88 8004B888 241100A0 */ addiu $s1, $zero, 0xA0
/* 26C8C 8004B88C 0280802D */ daddu $s0, $s4, $zero
.L8004B890:
/* 26C90 8004B890 960200A0 */ lhu $v0, 0xA0($s0)
/* 26C94 8004B894 10400009 */ beqz $v0, .L8004B8BC
/* 26C98 8004B898 0280202D */ daddu $a0, $s4, $zero
/* 26C9C 8004B89C 27A50010 */ addiu $a1, $sp, 0x10
/* 26CA0 8004B8A0 02913021 */ addu $a2, $s4, $s1
/* 26CA4 8004B8A4 A7B30010 */ sh $s3, 0x10($sp)
/* 26CA8 8004B8A8 A7A00012 */ sh $zero, 0x12($sp)
/* 26CAC 8004B8AC A7A00014 */ sh $zero, 0x14($sp)
/* 26CB0 8004B8B0 A7A00016 */ sh $zero, 0x16($sp)
/* 26CB4 8004B8B4 0C012E9D */ jal au_sfx_load_sound
/* 26CB8 8004B8B8 A3A00018 */ sb $zero, 0x18($sp)
.L8004B8BC:
/* 26CBC 8004B8BC A60000A0 */ sh $zero, 0xA0($s0)
/* 26CC0 8004B8C0 26310006 */ addiu $s1, $s1, 0x6
/* 26CC4 8004B8C4 26520001 */ addiu $s2, $s2, 0x1
/* 26CC8 8004B8C8 2E420004 */ sltiu $v0, $s2, 0x4
/* 26CCC 8004B8CC 1440FFF0 */ bnez $v0, .L8004B890
/* 26CD0 8004B8D0 26100006 */ addiu $s0, $s0, 0x6
/* 26CD4 8004B8D4 92820164 */ lbu $v0, 0x164($s4)
/* 26CD8 8004B8D8 92830163 */ lbu $v1, 0x163($s4)
/* 26CDC 8004B8DC 0043A823 */ subu $s5, $v0, $v1
/* 26CE0 8004B8E0 06A20001 */ bltzl $s5, .L8004B8E8
/* 26CE4 8004B8E4 26B50010 */ addiu $s5, $s5, 0x10
.L8004B8E8:
/* 26CE8 8004B8E8 26A2FFFF */ addiu $v0, $s5, -0x1
/* 26CEC 8004B8EC 2C42000F */ sltiu $v0, $v0, 0xF
/* 26CF0 8004B8F0 10400033 */ beqz $v0, .L8004B9C0
/* 26CF4 8004B8F4 0060882D */ daddu $s1, $v1, $zero
/* 26CF8 8004B8F8 12A0002F */ beqz $s5, .L8004B9B8
/* 26CFC 8004B8FC 0000902D */ daddu $s2, $zero, $zero
/* 26D00 8004B900 00111080 */ sll $v0, $s1, 2
/* 26D04 8004B904 00511021 */ addu $v0, $v0, $s1
/* 26D08 8004B908 00021040 */ sll $v0, $v0, 1
/* 26D0C 8004B90C 245300C2 */ addiu $s3, $v0, 0xC2
/* 26D10 8004B910 02938021 */ addu $s0, $s4, $s3
.L8004B914:
/* 26D14 8004B914 96030000 */ lhu $v1, 0x0($s0)
/* 26D18 8004B918 306223FF */ andi $v0, $v1, 0x23FF
/* 26D1C 8004B91C 1040001B */ beqz $v0, .L8004B98C
/* 26D20 8004B920 30628000 */ andi $v0, $v1, 0x8000
/* 26D24 8004B924 10400005 */ beqz $v0, .L8004B93C
/* 26D28 8004B928 3065FFFF */ andi $a1, $v1, 0xFFFF
/* 26D2C 8004B92C 0C0130A9 */ jal au_sfx_stop_by_id
/* 26D30 8004B930 0280202D */ daddu $a0, $s4, $zero
/* 26D34 8004B934 08012E64 */ j .L8004B990
/* 26D38 8004B938 A6000000 */ sh $zero, 0x0($s0)
.L8004B93C:
/* 26D3C 8004B93C 30621C00 */ andi $v0, $v1, 0x1C00
/* 26D40 8004B940 14400007 */ bnez $v0, .L8004B960
/* 26D44 8004B944 30620C00 */ andi $v0, $v1, 0xC00
/* 26D48 8004B948 0280202D */ daddu $a0, $s4, $zero
/* 26D4C 8004B94C 0200282D */ daddu $a1, $s0, $zero
/* 26D50 8004B950 0C012E9D */ jal au_sfx_load_sound
/* 26D54 8004B954 0000302D */ daddu $a2, $zero, $zero
/* 26D58 8004B958 08012E64 */ j .L8004B990
/* 26D5C 8004B95C A6000000 */ sh $zero, 0x0($s0)
.L8004B960:
/* 26D60 8004B960 10400004 */ beqz $v0, .L8004B974
/* 26D64 8004B964 00000000 */ nop
/* 26D68 8004B968 96050000 */ lhu $a1, 0x0($s0)
/* 26D6C 8004B96C 0C01309A */ jal au_sfx_set_triggers
/* 26D70 8004B970 0280202D */ daddu $a0, $s4, $zero
.L8004B974:
/* 26D74 8004B974 96020000 */ lhu $v0, 0x0($s0)
/* 26D78 8004B978 30421000 */ andi $v0, $v0, 0x1000
/* 26D7C 8004B97C 10400003 */ beqz $v0, .L8004B98C
/* 26D80 8004B980 0280202D */ daddu $a0, $s4, $zero
/* 26D84 8004B984 0C0130D6 */ jal au_sfx_set_modifiers
/* 26D88 8004B988 0200282D */ daddu $a1, $s0, $zero
.L8004B98C:
/* 26D8C 8004B98C A6000000 */ sh $zero, 0x0($s0)
.L8004B990:
/* 26D90 8004B990 26310001 */ addiu $s1, $s1, 0x1
/* 26D94 8004B994 2E220010 */ sltiu $v0, $s1, 0x10
/* 26D98 8004B998 14400003 */ bnez $v0, .L8004B9A8
/* 26D9C 8004B99C 2673000A */ addiu $s3, $s3, 0xA
/* 26DA0 8004B9A0 241300C2 */ addiu $s3, $zero, 0xC2
/* 26DA4 8004B9A4 0000882D */ daddu $s1, $zero, $zero
.L8004B9A8:
/* 26DA8 8004B9A8 26520001 */ addiu $s2, $s2, 0x1
/* 26DAC 8004B9AC 0255102B */ sltu $v0, $s2, $s5
/* 26DB0 8004B9B0 1440FFD8 */ bnez $v0, .L8004B914
/* 26DB4 8004B9B4 02938021 */ addu $s0, $s4, $s3
.L8004B9B8:
/* 26DB8 8004B9B8 92820164 */ lbu $v0, 0x164($s4)
/* 26DBC 8004B9BC A2820163 */ sb $v0, 0x163($s4)
.L8004B9C0:
/* 26DC0 8004B9C0 8FBF0038 */ lw $ra, 0x38($sp)
/* 26DC4 8004B9C4 8FB50034 */ lw $s5, 0x34($sp)
/* 26DC8 8004B9C8 8FB40030 */ lw $s4, 0x30($sp)
/* 26DCC 8004B9CC 8FB3002C */ lw $s3, 0x2C($sp)
/* 26DD0 8004B9D0 8FB20028 */ lw $s2, 0x28($sp)
/* 26DD4 8004B9D4 8FB10024 */ lw $s1, 0x24($sp)
/* 26DD8 8004B9D8 8FB00020 */ lw $s0, 0x20($sp)
/* 26DDC 8004B9DC 03E00008 */ jr $ra
/* 26DE0 8004B9E0 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
void au_sfx_update_main(SoundManager* manager) {
SoundSFXEntry newEntry;
SoundSFXEntry* sfxEntry;
u32 i, j, k;
s32 count;
manager->playCounter++;
if (manager->resetPending) {
au_sfx_reset_players(manager);
manager->resetPending = FALSE;
}
// sounds started by special seq command FF-05
for (i = 0; i < ARRAY_COUNT(manager->bgmSounds); i++) {
k = manager->bgmSounds[i].unk_0;
if (k == 0) {
// do nothing
} else if (k < 2) {
AlUnkGemini* unkData = &D_80078370[k-1];
u16 sound2 = unkData->sound2;
if (sound2 != 0) {
for (j = 0; j < ARRAY_COUNT(manager->players); j++) {
if (manager->players[j].currentSoundID == sound2) {
newEntry.soundID = unkData->sound1;
newEntry.upperSoundID = 0;
newEntry.pitchShift = 0;
if ((unkData->flags & 1) && (manager->bgmSounds[i].volume != 0)) {
newEntry.volume = (manager->bgmSounds[i].volume << 8) + 0xFF;
} else {
newEntry.volume = 0;
}
newEntry.pan = 0;
au_sfx_load_sound(manager, &newEntry, NULL);
break;
}
}
} else {
newEntry.soundID = unkData->sound1;
newEntry.upperSoundID = 0;
newEntry.volume = 0;
newEntry.pitchShift = 0;
newEntry.pan = 0;
au_sfx_load_sound(manager, &newEntry, NULL);
}
}
manager->bgmSounds[i].s32 = 0;
}
// sounds started from sef command 17
for (i = 0; i < ARRAY_COUNT(manager->customCmdList); i++) {
if (manager->customCmdList[i].data[0] != 0) {
newEntry.soundID = 1;
newEntry.upperSoundID = 0;
newEntry.volume = 0;
newEntry.pitchShift = 0;
newEntry.pan = 0;
au_sfx_load_sound(manager, &newEntry, &manager->customCmdList[i]);
}
manager->customCmdList[i].data[0] = 0;
}
count = manager->sfxQueueNextPos - manager->sfxQueuePosOffset;
if (count < 0) {
count += ARRAY_COUNT(manager->soundQueue);
}
j = manager->sfxQueuePosOffset;
if (count > 0 && count < ARRAY_COUNT(manager->soundQueue)) {
for (i = 0; i < count; i++) {
sfxEntry = &manager->soundQueue[j];
if (sfxEntry->soundID & SOUND_ID_LOWER) {
if (sfxEntry->soundID & SOUND_ID_STOP) {
au_sfx_stop_by_id(manager, sfxEntry->soundID);
} else if (!(sfxEntry->soundID & (SOUND_ID_ADJUST | SOUND_ID_TRIGGER_MASK))) {
au_sfx_load_sound(manager, sfxEntry, NULL);
} else {
if (sfxEntry->soundID & SOUND_ID_TRIGGER_MASK) {
au_sfx_set_triggers(manager, sfxEntry->soundID);
}
if (sfxEntry->soundID & SOUND_ID_ADJUST) {
au_sfx_set_modifiers(manager, sfxEntry);
}
}
}
sfxEntry->soundID = 0;
j++;
if (j >= ARRAY_COUNT(manager->soundQueue)) {
j = 0;
}
}
manager->sfxQueuePosOffset = manager->sfxQueueNextPos;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel entity_WoodenCrate_setupGfx
/* 109DCC 802E854C 27BDFE80 */ addiu $sp, $sp, -0x180
/* 109DD0 802E8550 AFBE0148 */ sw $fp, 0x148($sp)
/* 109DD4 802E8554 0000F02D */ daddu $fp, $zero, $zero
/* 109DD8 802E8558 27A80098 */ addiu $t0, $sp, 0x98
/* 109DDC 802E855C AFB5013C */ sw $s5, 0x13C($sp)
/* 109DE0 802E8560 27B500D8 */ addiu $s5, $sp, 0xD8
/* 109DE4 802E8564 AFB40138 */ sw $s4, 0x138($sp)
/* 109DE8 802E8568 27B40058 */ addiu $s4, $sp, 0x58
/* 109DEC 802E856C AFA8011C */ sw $t0, 0x11C($sp)
/* 109DF0 802E8570 3C080001 */ lui $t0, (0x11630 >> 16)
/* 109DF4 802E8574 AFB1012C */ sw $s1, 0x12C($sp)
/* 109DF8 802E8578 3C11800A */ lui $s1, %hi(gMainGfxPos)
/* 109DFC 802E857C 8E31A66C */ lw $s1, %lo(gMainGfxPos)($s1)
/* 109E00 802E8580 35081630 */ ori $t0, $t0, (0x11630 & 0xFFFF)
/* 109E04 802E8584 AFBF014C */ sw $ra, 0x14C($sp)
/* 109E08 802E8588 AFB70144 */ sw $s7, 0x144($sp)
/* 109E0C 802E858C AFB60140 */ sw $s6, 0x140($sp)
/* 109E10 802E8590 AFB30134 */ sw $s3, 0x134($sp)
/* 109E14 802E8594 AFB20130 */ sw $s2, 0x130($sp)
/* 109E18 802E8598 AFB00128 */ sw $s0, 0x128($sp)
/* 109E1C 802E859C F7BE0178 */ sdc1 $f30, 0x178($sp)
/* 109E20 802E85A0 F7BC0170 */ sdc1 $f28, 0x170($sp)
/* 109E24 802E85A4 F7BA0168 */ sdc1 $f26, 0x168($sp)
/* 109E28 802E85A8 F7B80160 */ sdc1 $f24, 0x160($sp)
/* 109E2C 802E85AC F7B60158 */ sdc1 $f22, 0x158($sp)
/* 109E30 802E85B0 F7B40150 */ sdc1 $f20, 0x150($sp)
/* 109E34 802E85B4 0C04417A */ jal get_entity_by_index
/* 109E38 802E85B8 AFA80120 */ sw $t0, 0x120($sp)
/* 109E3C 802E85BC 0040B82D */ daddu $s7, $v0, $zero
/* 109E40 802E85C0 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 109E44 802E85C4 4481D000 */ mtc1 $at, $f26
/* 109E48 802E85C8 3C013B80 */ lui $at, (0x3B800000 >> 16)
/* 109E4C 802E85CC 4481C000 */ mtc1 $at, $f24
/* 109E50 802E85D0 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 109E54 802E85D4 4481B000 */ mtc1 $at, $f22
/* 109E58 802E85D8 8EE20040 */ lw $v0, 0x40($s7)
/* 109E5C 802E85DC 4480A000 */ mtc1 $zero, $f20
/* 109E60 802E85E0 C6E00048 */ lwc1 $f0, 0x48($s7)
/* 109E64 802E85E4 0040902D */ daddu $s2, $v0, $zero
/* 109E68 802E85E8 0240982D */ daddu $s3, $s2, $zero
/* 109E6C 802E85EC 2630FFFC */ addiu $s0, $s1, -0x4
/* 109E70 802E85F0 46000007 */ neg.s $f0, $f0
/* 109E74 802E85F4 E7A00118 */ swc1 $f0, 0x118($sp)
/* 109E78 802E85F8 C6E0004C */ lwc1 $f0, 0x4C($s7)
/* 109E7C 802E85FC C6E20050 */ lwc1 $f2, 0x50($s7)
/* 109E80 802E8600 8E560008 */ lw $s6, 0x8($s2)
/* 109E84 802E8604 46000787 */ neg.s $f30, $f0
/* 109E88 802E8608 46001707 */ neg.s $f28, $f2
.L802E860C:
/* 109E8C 802E860C 82420010 */ lb $v0, 0x10($s2)
/* 109E90 802E8610 28420002 */ slti $v0, $v0, 0x2
/* 109E94 802E8614 1040000F */ beqz $v0, .L802E8654
/* 109E98 802E8618 3C03E200 */ lui $v1, (0xE200001C >> 16)
/* 109E9C 802E861C 26100008 */ addiu $s0, $s0, 0x8
/* 109EA0 802E8620 3463001C */ ori $v1, $v1, (0xE200001C & 0xFFFF)
/* 109EA4 802E8624 3C020055 */ lui $v0, (0x552078 >> 16)
/* 109EA8 802E8628 34422078 */ ori $v0, $v0, (0x552078 & 0xFFFF)
/* 109EAC 802E862C AE03FFFC */ sw $v1, -0x4($s0)
/* 109EB0 802E8630 AE020000 */ sw $v0, 0x0($s0)
/* 109EB4 802E8634 26100008 */ addiu $s0, $s0, 0x8
/* 109EB8 802E8638 26310010 */ addiu $s1, $s1, 0x10
/* 109EBC 802E863C 3C03FC12 */ lui $v1, (0xFC121824 >> 16)
/* 109EC0 802E8640 34631824 */ ori $v1, $v1, (0xFC121824 & 0xFFFF)
/* 109EC4 802E8644 3C02FF33 */ lui $v0, (0xFF33FFFF >> 16)
/* 109EC8 802E8648 3442FFFF */ ori $v0, $v0, (0xFF33FFFF & 0xFFFF)
/* 109ECC 802E864C 080BA1A1 */ j .L802E8684
/* 109ED0 802E8650 AE03FFFC */ sw $v1, -0x4($s0)
.L802E8654:
/* 109ED4 802E8654 26100008 */ addiu $s0, $s0, 0x8
/* 109ED8 802E8658 3C03FCFF */ lui $v1, (0xFCFFC3FF >> 16)
/* 109EDC 802E865C 3463C3FF */ ori $v1, $v1, (0xFCFFC3FF & 0xFFFF)
/* 109EE0 802E8660 3C02FF30 */ lui $v0, (0xFF30FE7F >> 16)
/* 109EE4 802E8664 3442FE7F */ ori $v0, $v0, (0xFF30FE7F & 0xFFFF)
/* 109EE8 802E8668 AE03FFFC */ sw $v1, -0x4($s0)
/* 109EEC 802E866C AE020000 */ sw $v0, 0x0($s0)
/* 109EF0 802E8670 26100008 */ addiu $s0, $s0, 0x8
/* 109EF4 802E8674 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 109EF8 802E8678 AE02FFFC */ sw $v0, -0x4($s0)
/* 109EFC 802E867C 92420034 */ lbu $v0, 0x34($s2)
/* 109F00 802E8680 26310010 */ addiu $s1, $s1, 0x10
.L802E8684:
/* 109F04 802E8684 AE020000 */ sw $v0, 0x0($s0)
/* 109F08 802E8688 8FA50118 */ lw $a1, 0x118($sp)
/* 109F0C 802E868C 4406F000 */ mfc1 $a2, $f30
/* 109F10 802E8690 4407E000 */ mfc1 $a3, $f28
/* 109F14 802E8694 0C019E40 */ jal guTranslateF
/* 109F18 802E8698 27A40018 */ addiu $a0, $sp, 0x18
/* 109F1C 802E869C 92420058 */ lbu $v0, 0x58($s2)
/* 109F20 802E86A0 44820000 */ mtc1 $v0, $f0
/* 109F24 802E86A4 00000000 */ nop
/* 109F28 802E86A8 46800020 */ cvt.s.w $f0, $f0
/* 109F2C 802E86AC 461A0002 */ mul.s $f0, $f0, $f26
/* 109F30 802E86B0 00000000 */ nop
/* 109F34 802E86B4 46180002 */ mul.s $f0, $f0, $f24
/* 109F38 802E86B8 00000000 */ nop
/* 109F3C 802E86BC 4406B000 */ mfc1 $a2, $f22
/* 109F40 802E86C0 4407A000 */ mfc1 $a3, $f20
/* 109F44 802E86C4 8FA4011C */ lw $a0, 0x11C($sp)
/* 109F48 802E86C8 44050000 */ mfc1 $a1, $f0
/* 109F4C 802E86CC 0C019EC8 */ jal guRotateF
/* 109F50 802E86D0 E7B40010 */ swc1 $f20, 0x10($sp)
/* 109F54 802E86D4 9242007C */ lbu $v0, 0x7C($s2)
/* 109F58 802E86D8 44820000 */ mtc1 $v0, $f0
/* 109F5C 802E86DC 00000000 */ nop
/* 109F60 802E86E0 46800020 */ cvt.s.w $f0, $f0
/* 109F64 802E86E4 461A0002 */ mul.s $f0, $f0, $f26
/* 109F68 802E86E8 00000000 */ nop
/* 109F6C 802E86EC 26100008 */ addiu $s0, $s0, 0x8
/* 109F70 802E86F0 26310018 */ addiu $s1, $s1, 0x18
/* 109F74 802E86F4 46180002 */ mul.s $f0, $f0, $f24
/* 109F78 802E86F8 00000000 */ nop
/* 109F7C 802E86FC 27DE0001 */ addiu $fp, $fp, 0x1
/* 109F80 802E8700 02A0202D */ daddu $a0, $s5, $zero
/* 109F84 802E8704 4406A000 */ mfc1 $a2, $f20
/* 109F88 802E8708 4407B000 */ mfc1 $a3, $f22
/* 109F8C 802E870C 44050000 */ mfc1 $a1, $f0
/* 109F90 802E8710 26520001 */ addiu $s2, $s2, 0x1
/* 109F94 802E8714 0C019EC8 */ jal guRotateF
/* 109F98 802E8718 E7B40010 */ swc1 $f20, 0x10($sp)
/* 109F9C 802E871C 02A0282D */ daddu $a1, $s5, $zero
/* 109FA0 802E8720 8FA4011C */ lw $a0, 0x11C($sp)
/* 109FA4 802E8724 0C019D80 */ jal guMtxCatF
/* 109FA8 802E8728 02A0302D */ daddu $a2, $s5, $zero
/* 109FAC 802E872C 02A0202D */ daddu $a0, $s5, $zero
/* 109FB0 802E8730 27A50018 */ addiu $a1, $sp, 0x18
/* 109FB4 802E8734 0C019D80 */ jal guMtxCatF
/* 109FB8 802E8738 00A0302D */ daddu $a2, $a1, $zero
/* 109FBC 802E873C 0280202D */ daddu $a0, $s4, $zero
/* 109FC0 802E8740 8E650154 */ lw $a1, 0x154($s3)
/* 109FC4 802E8744 8E6601E4 */ lw $a2, 0x1E4($s3)
/* 109FC8 802E8748 8E670274 */ lw $a3, 0x274($s3)
/* 109FCC 802E874C 0C019E40 */ jal guTranslateF
/* 109FD0 802E8750 26730004 */ addiu $s3, $s3, 0x4
/* 109FD4 802E8754 27A40018 */ addiu $a0, $sp, 0x18
/* 109FD8 802E8758 0280282D */ daddu $a1, $s4, $zero
/* 109FDC 802E875C 0C019D80 */ jal guMtxCatF
/* 109FE0 802E8760 0280302D */ daddu $a2, $s4, $zero
/* 109FE4 802E8764 0280202D */ daddu $a0, $s4, $zero
/* 109FE8 802E8768 3C058007 */ lui $a1, %hi(gMatrixListPos)
/* 109FEC 802E876C 94A541F0 */ lhu $a1, %lo(gMatrixListPos)($a1)
/* 109FF0 802E8770 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 109FF4 802E8774 8C42A674 */ lw $v0, %lo(gDisplayContext)($v0)
/* 109FF8 802E8778 8FA80120 */ lw $t0, 0x120($sp)
/* 109FFC 802E877C 00052980 */ sll $a1, $a1, 6
/* 10A000 802E8780 00A82821 */ addu $a1, $a1, $t0
/* 10A004 802E8784 0C019D40 */ jal guMtxF2L
/* 10A008 802E8788 00452821 */ addu $a1, $v0, $a1
/* 10A00C 802E878C 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* 10A010 802E8790 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* 10A014 802E8794 3C028007 */ lui $v0, %hi(gMatrixListPos)
/* 10A018 802E8798 944241F0 */ lhu $v0, %lo(gMatrixListPos)($v0)
/* 10A01C 802E879C 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 10A020 802E87A0 AE03FFFC */ sw $v1, -0x4($s0)
/* 10A024 802E87A4 8FA80120 */ lw $t0, 0x120($sp)
/* 10A028 802E87A8 24430001 */ addiu $v1, $v0, 0x1
/* 10A02C 802E87AC 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 10A030 802E87B0 00021180 */ sll $v0, $v0, 6
/* 10A034 802E87B4 3C018007 */ lui $at, %hi(gMatrixListPos)
/* 10A038 802E87B8 A42341F0 */ sh $v1, %lo(gMatrixListPos)($at)
/* 10A03C 802E87BC 3C03800A */ lui $v1, %hi(gDisplayContext)
/* 10A040 802E87C0 8C63A674 */ lw $v1, %lo(gDisplayContext)($v1)
/* 10A044 802E87C4 00481021 */ addu $v0, $v0, $t0
/* 10A048 802E87C8 00621821 */ addu $v1, $v1, $v0
/* 10A04C 802E87CC AE030000 */ sw $v1, 0x0($s0)
/* 10A050 802E87D0 96C40002 */ lhu $a0, 0x2($s6)
/* 10A054 802E87D4 26D60004 */ addiu $s6, $s6, 0x4
/* 10A058 802E87D8 26100008 */ addiu $s0, $s0, 0x8
/* 10A05C 802E87DC 8EE30044 */ lw $v1, 0x44($s7)
/* 10A060 802E87E0 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 10A064 802E87E4 AE02FFFC */ sw $v0, -0x4($s0)
/* 10A068 802E87E8 24020040 */ addiu $v0, $zero, 0x40
/* 10A06C 802E87EC 00641821 */ addu $v1, $v1, $a0
/* 10A070 802E87F0 AE030000 */ sw $v1, 0x0($s0)
/* 10A074 802E87F4 26100008 */ addiu $s0, $s0, 0x8
/* 10A078 802E87F8 AE020000 */ sw $v0, 0x0($s0)
/* 10A07C 802E87FC 2BC20023 */ slti $v0, $fp, 0x23
/* 10A080 802E8800 1440FF82 */ bnez $v0, .L802E860C
/* 10A084 802E8804 AE05FFFC */ sw $a1, -0x4($s0)
/* 10A088 802E8808 8FBF014C */ lw $ra, 0x14C($sp)
/* 10A08C 802E880C 8FBE0148 */ lw $fp, 0x148($sp)
/* 10A090 802E8810 8FB70144 */ lw $s7, 0x144($sp)
/* 10A094 802E8814 8FB60140 */ lw $s6, 0x140($sp)
/* 10A098 802E8818 8FB5013C */ lw $s5, 0x13C($sp)
/* 10A09C 802E881C 8FB40138 */ lw $s4, 0x138($sp)
/* 10A0A0 802E8820 8FB30134 */ lw $s3, 0x134($sp)
/* 10A0A4 802E8824 8FB20130 */ lw $s2, 0x130($sp)
/* 10A0A8 802E8828 3C01800A */ lui $at, %hi(gMainGfxPos)
/* 10A0AC 802E882C AC31A66C */ sw $s1, %lo(gMainGfxPos)($at)
/* 10A0B0 802E8830 8FB1012C */ lw $s1, 0x12C($sp)
/* 10A0B4 802E8834 8FB00128 */ lw $s0, 0x128($sp)
/* 10A0B8 802E8838 D7BE0178 */ ldc1 $f30, 0x178($sp)
/* 10A0BC 802E883C D7BC0170 */ ldc1 $f28, 0x170($sp)
/* 10A0C0 802E8840 D7BA0168 */ ldc1 $f26, 0x168($sp)
/* 10A0C4 802E8844 D7B80160 */ ldc1 $f24, 0x160($sp)
/* 10A0C8 802E8848 D7B60158 */ ldc1 $f22, 0x158($sp)
/* 10A0CC 802E884C D7B40150 */ ldc1 $f20, 0x150($sp)
/* 10A0D0 802E8850 03E00008 */ jr $ra
/* 10A0D4 802E8854 27BD0180 */ addiu $sp, $sp, 0x180
### DECOMPILED C INSTRUCTIONS:
void entity_WoodenCrate_setupGfx(s32 entityIndex) {
s32 i;
Matrix4f mtxTransInv;
Matrix4f mtx;
Matrix4f mtxRotX;
Matrix4f mtxRotY;
f32 x_inv;
f32 y_inv;
f32 z_inv;
Gfx* gfxPos = gMainGfxPos;
Entity* entity = get_entity_by_index(entityIndex);
WoodenCrateData* data = entity->dataBuf.crate;
Gfx* fragmentDlist;
Gfx** gfx = data->fragmentsGfx;
x_inv = -entity->position.x;
y_inv = -entity->position.y;
z_inv = -entity->position.z;
for (i = 0; i < 35; i++) {
if (data->fragmentRebounds[i] < 2) {
gDPSetRenderMode(gfxPos++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gDPSetCombineMode(gfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
} else {
gDPSetCombineMode(gfxPos++, PM_CC_11, PM_CC_12);
gDPSetPrimColor(gfxPos++, 0, 0, 0, 0, 0, data->fragmentMoveAngle[i]);
}
guTranslateF(mtxTransInv, x_inv, y_inv, z_inv);
guRotateF(mtxRotX, data->fragmentRotX[i] * 360.0f / 256, 1.0f, 0.0f, 0.0f);
guRotateF(mtxRotY, data->fragmentRotY[i] * 360.0f / 256, 0.0f, 1.0f, 0.0f);
guMtxCatF(mtxRotX, mtxRotY, mtxRotY);
guMtxCatF(mtxRotY, mtxTransInv, mtxTransInv);
guTranslateF(mtx, data->fragmentPosX[i], data->fragmentPosY[i], data->fragmentPosZ[i]);
guMtxCatF(mtxTransInv, mtx, mtx);
guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
fragmentDlist = ENTITY_ADDR(entity, Gfx*, *gfx++);
gSPDisplayList(gfxPos++, fragmentDlist);
gSPPopMatrix(gfxPos++, G_MTX_MODELVIEW);
}
gMainGfxPos = gfxPos;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_bgm_update_main
/* 28910 8004D510 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 28914 8004D514 AFB10014 */ sw $s1, 0x14($sp)
/* 28918 8004D518 0080882D */ daddu $s1, $a0, $zero
/* 2891C 8004D51C AFB3001C */ sw $s3, 0x1C($sp)
/* 28920 8004D520 0000982D */ daddu $s3, $zero, $zero
/* 28924 8004D524 2406FFFF */ addiu $a2, $zero, -0x1
/* 28928 8004D528 AFBF0020 */ sw $ra, 0x20($sp)
/* 2892C 8004D52C AFB20018 */ sw $s2, 0x18($sp)
/* 28930 8004D530 AFB00010 */ sw $s0, 0x10($sp)
/* 28934 8004D534 8E220014 */ lw $v0, 0x14($s1)
/* 28938 8004D538 92230258 */ lbu $v1, 0x258($s1)
/* 2893C 8004D53C 24420001 */ addiu $v0, $v0, 0x1
/* 28940 8004D540 1060008D */ beqz $v1, .L8004D778
/* 28944 8004D544 AE220014 */ sw $v0, 0x14($s1)
/* 28948 8004D548 2C620008 */ sltiu $v0, $v1, 0x8
/* 2894C 8004D54C 10400023 */ beqz $v0, .L8004D5DC
/* 28950 8004D550 0263102B */ sltu $v0, $s3, $v1
/* 28954 8004D554 92240259 */ lbu $a0, 0x259($s1)
/* 28958 8004D558 10400015 */ beqz $v0, .L8004D5B0
/* 2895C 8004D55C 0260282D */ daddu $a1, $s3, $zero
/* 28960 8004D560 0060382D */ daddu $a3, $v1, $zero
/* 28964 8004D564 308200FF */ andi $v0, $a0, 0xFF
.L8004D568:
/* 28968 8004D568 00021080 */ sll $v0, $v0, 2
/* 2896C 8004D56C 02221021 */ addu $v0, $s1, $v0
/* 28970 8004D570 8C430238 */ lw $v1, 0x238($v0)
/* 28974 8004D574 10600009 */ beqz $v1, .L8004D59C
/* 28978 8004D578 2C620010 */ sltiu $v0, $v1, 0x10
/* 2897C 8004D57C 10400003 */ beqz $v0, .L8004D58C
/* 28980 8004D580 24840001 */ addiu $a0, $a0, 0x1
/* 28984 8004D584 30660003 */ andi $a2, $v1, 0x3
/* 28988 8004D588 00039882 */ srl $s3, $v1, 2
.L8004D58C:
/* 2898C 8004D58C 308200FF */ andi $v0, $a0, 0xFF
/* 28990 8004D590 2C420008 */ sltiu $v0, $v0, 0x8
/* 28994 8004D594 50400001 */ beql $v0, $zero, .L8004D59C
/* 28998 8004D598 0000202D */ daddu $a0, $zero, $zero
.L8004D59C:
/* 2899C 8004D59C 24A50001 */ addiu $a1, $a1, 0x1
/* 289A0 8004D5A0 30A200FF */ andi $v0, $a1, 0xFF
/* 289A4 8004D5A4 0047102B */ sltu $v0, $v0, $a3
/* 289A8 8004D5A8 1440FFEF */ bnez $v0, .L8004D568
/* 289AC 8004D5AC 308200FF */ andi $v0, $a0, 0xFF
.L8004D5B0:
/* 289B0 8004D5B0 9223025A */ lbu $v1, 0x25A($s1)
/* 289B4 8004D5B4 92220259 */ lbu $v0, 0x259($s1)
/* 289B8 8004D5B8 00622023 */ subu $a0, $v1, $v0
/* 289BC 8004D5BC 04820001 */ bltzl $a0, .L8004D5C4
/* 289C0 8004D5C0 24840008 */ addiu $a0, $a0, 0x8
.L8004D5C4:
/* 289C4 8004D5C4 92220258 */ lbu $v0, 0x258($s1)
/* 289C8 8004D5C8 9223025A */ lbu $v1, 0x25A($s1)
/* 289CC 8004D5CC 00441023 */ subu $v0, $v0, $a0
/* 289D0 8004D5D0 A2220258 */ sb $v0, 0x258($s1)
/* 289D4 8004D5D4 08013578 */ j .L8004D5E0
/* 289D8 8004D5D8 A2230259 */ sb $v1, 0x259($s1)
.L8004D5DC:
/* 289DC 8004D5DC A2200258 */ sb $zero, 0x258($s1)
.L8004D5E0:
/* 289E0 8004D5E0 2402FFFF */ addiu $v0, $zero, -0x1
/* 289E4 8004D5E4 10C20064 */ beq $a2, $v0, .L8004D778
/* 289E8 8004D5E8 00000000 */ nop
/* 289EC 8004D5EC 10C00058 */ beqz $a2, .L8004D750
/* 289F0 8004D5F0 00000000 */ nop
/* 289F4 8004D5F4 96220058 */ lhu $v0, 0x58($s1)
/* 289F8 8004D5F8 10C2005F */ beq $a2, $v0, .L8004D778
/* 289FC 8004D5FC 3C030002 */ lui $v1, (0x2625A >> 16)
/* 28A00 8004D600 3463625A */ ori $v1, $v1, (0x2625A & 0xFFFF)
/* 28A04 8004D604 30C200FF */ andi $v0, $a2, 0xFF
/* 28A08 8004D608 A6220058 */ sh $v0, 0x58($s1)
/* 28A0C 8004D60C A622005A */ sh $v0, 0x5A($s1)
/* 28A10 8004D610 24020003 */ addiu $v0, $zero, 0x3
/* 28A14 8004D614 A2220221 */ sb $v0, 0x221($s1)
/* 28A18 8004D618 24020002 */ addiu $v0, $zero, 0x2
/* 28A1C 8004D61C 14C20004 */ bne $a2, $v0, .L8004D630
/* 28A20 8004D620 AE230008 */ sw $v1, 0x8($s1)
/* 28A24 8004D624 8E220000 */ lw $v0, 0x0($s1)
/* 28A28 8004D628 0801358E */ j .L8004D638
/* 28A2C 8004D62C 8C500060 */ lw $s0, 0x60($v0)
.L8004D630:
/* 28A30 8004D630 8E220000 */ lw $v0, 0x0($s1)
/* 28A34 8004D634 8C50005C */ lw $s0, 0x5C($v0)
.L8004D638:
/* 28A38 8004D638 8E220074 */ lw $v0, 0x74($s1)
/* 28A3C 8004D63C 0220202D */ daddu $a0, $s1, $zero
/* 28A40 8004D640 AE300064 */ sw $s0, 0x64($s1)
/* 28A44 8004D644 90420000 */ lbu $v0, 0x0($v0)
/* 28A48 8004D648 3C050002 */ lui $a1, (0x2625A >> 16)
/* 28A4C 8004D64C 30420007 */ andi $v0, $v0, 0x7
/* 28A50 8004D650 3C068008 */ lui $a2, %hi(D_80078510)
/* 28A54 8004D654 00C23021 */ addu $a2, $a2, $v0
/* 28A58 8004D658 90C68510 */ lbu $a2, %lo(D_80078510)($a2)
/* 28A5C 8004D65C 0C013A20 */ jal func_8004E880
/* 28A60 8004D660 34A5625A */ ori $a1, $a1, (0x2625A & 0xFFFF)
/* 28A64 8004D664 26120010 */ addiu $s2, $s0, 0x10
/* 28A68 8004D668 00131040 */ sll $v0, $s3, 1
/* 28A6C 8004D66C 02421021 */ addu $v0, $s2, $v0
/* 28A70 8004D670 94420004 */ lhu $v0, 0x4($v0)
/* 28A74 8004D674 14400003 */ bnez $v0, .L8004D684
/* 28A78 8004D678 00021080 */ sll $v0, $v0, 2
/* 28A7C 8004D67C 96020014 */ lhu $v0, 0x14($s0)
/* 28A80 8004D680 00021080 */ sll $v0, $v0, 2
.L8004D684:
/* 28A84 8004D684 00501021 */ addu $v0, $v0, $s0
/* 28A88 8004D688 AE22006C */ sw $v0, 0x6C($s1)
/* 28A8C 8004D68C AE220068 */ sw $v0, 0x68($s1)
/* 28A90 8004D690 9602001C */ lhu $v0, 0x1C($s0)
/* 28A94 8004D694 10400020 */ beqz $v0, .L8004D718
/* 28A98 8004D698 00021080 */ sll $v0, $v0, 2
/* 28A9C 8004D69C 8E230064 */ lw $v1, 0x64($s1)
/* 28AA0 8004D6A0 00431021 */ addu $v0, $v0, $v1
/* 28AA4 8004D6A4 AE220078 */ sw $v0, 0x78($s1)
/* 28AA8 8004D6A8 9202001F */ lbu $v0, 0x1F($s0)
/* 28AAC 8004D6AC A222021C */ sb $v0, 0x21C($s1)
/* 28AB0 8004D6B0 304200FF */ andi $v0, $v0, 0xFF
/* 28AB4 8004D6B4 1040000C */ beqz $v0, .L8004D6E8
/* 28AB8 8004D6B8 0000182D */ daddu $v1, $zero, $zero
/* 28ABC 8004D6BC 0220282D */ daddu $a1, $s1, $zero
/* 28AC0 8004D6C0 0060202D */ daddu $a0, $v1, $zero
.L8004D6C4:
/* 28AC4 8004D6C4 8E220078 */ lw $v0, 0x78($s1)
/* 28AC8 8004D6C8 24630001 */ addiu $v1, $v1, 0x1
/* 28ACC 8004D6CC 00441021 */ addu $v0, $v0, $a0
/* 28AD0 8004D6D0 ACA20080 */ sw $v0, 0x80($a1)
/* 28AD4 8004D6D4 24A50004 */ addiu $a1, $a1, 0x4
/* 28AD8 8004D6D8 9222021C */ lbu $v0, 0x21C($s1)
/* 28ADC 8004D6DC 0062102B */ sltu $v0, $v1, $v0
/* 28AE0 8004D6E0 1440FFF8 */ bnez $v0, .L8004D6C4
/* 28AE4 8004D6E4 2484000C */ addiu $a0, $a0, 0xC
.L8004D6E8:
/* 28AE8 8004D6E8 2C62000C */ sltiu $v0, $v1, 0xC
/* 28AEC 8004D6EC 1040000C */ beqz $v0, .L8004D720
/* 28AF0 8004D6F0 00031080 */ sll $v0, $v1, 2
/* 28AF4 8004D6F4 00512021 */ addu $a0, $v0, $s1
.L8004D6F8:
/* 28AF8 8004D6F8 8E220080 */ lw $v0, 0x80($s1)
/* 28AFC 8004D6FC 24630001 */ addiu $v1, $v1, 0x1
/* 28B00 8004D700 AC820080 */ sw $v0, 0x80($a0)
/* 28B04 8004D704 2C62000C */ sltiu $v0, $v1, 0xC
/* 28B08 8004D708 1440FFFB */ bnez $v0, .L8004D6F8
/* 28B0C 8004D70C 24840004 */ addiu $a0, $a0, 0x4
/* 28B10 8004D710 080135C8 */ j .L8004D720
/* 28B14 8004D714 00000000 */ nop
.L8004D718:
/* 28B18 8004D718 AE200078 */ sw $zero, 0x78($s1)
/* 28B1C 8004D71C A220021C */ sb $zero, 0x21C($s1)
.L8004D720:
/* 28B20 8004D720 96420010 */ lhu $v0, 0x10($s2)
/* 28B24 8004D724 10400007 */ beqz $v0, .L8004D744
/* 28B28 8004D728 00021080 */ sll $v0, $v0, 2
/* 28B2C 8004D72C 8E230064 */ lw $v1, 0x64($s1)
/* 28B30 8004D730 00431021 */ addu $v0, $v0, $v1
/* 28B34 8004D734 AE22007C */ sw $v0, 0x7C($s1)
/* 28B38 8004D738 92420013 */ lbu $v0, 0x13($s2)
/* 28B3C 8004D73C 080135DE */ j .L8004D778
/* 28B40 8004D740 A222021D */ sb $v0, 0x21D($s1)
.L8004D744:
/* 28B44 8004D744 AE20007C */ sw $zero, 0x7C($s1)
/* 28B48 8004D748 080135DE */ j .L8004D778
/* 28B4C 8004D74C A220021D */ sb $zero, 0x21D($s1)
.L8004D750:
/* 28B50 8004D750 96220058 */ lhu $v0, 0x58($s1)
/* 28B54 8004D754 10400006 */ beqz $v0, .L8004D770
/* 28B58 8004D758 24020004 */ addiu $v0, $zero, 0x4
/* 28B5C 8004D75C A2220221 */ sb $v0, 0x221($s1)
/* 28B60 8004D760 24020001 */ addiu $v0, $zero, 0x1
/* 28B64 8004D764 AE220010 */ sw $v0, 0x10($s1)
/* 28B68 8004D768 080135DE */ j .L8004D778
/* 28B6C 8004D76C AE220008 */ sw $v0, 0x8($s1)
.L8004D770:
/* 28B70 8004D770 0C0136AA */ jal au_bgm_stop_player
/* 28B74 8004D774 0220202D */ daddu $a0, $s1, $zero
.L8004D778:
/* 28B78 8004D778 8FBF0020 */ lw $ra, 0x20($sp)
/* 28B7C 8004D77C 8FB3001C */ lw $s3, 0x1C($sp)
/* 28B80 8004D780 8FB20018 */ lw $s2, 0x18($sp)
/* 28B84 8004D784 8FB10014 */ lw $s1, 0x14($sp)
/* 28B88 8004D788 8FB00010 */ lw $s0, 0x10($sp)
/* 28B8C 8004D78C 03E00008 */ jr $ra
/* 28B90 8004D790 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void au_bgm_update_main(BGMPlayer* player) {
BGMHeader* bgmFile;
BGMFileInfo* bgmData;
s32 unkType;
u32 segmentID;
s32 segmentOffset;
u32 value;
s32 delta;
u8 var_a1;
u8 pos;
u32 i;
segmentID = 0;
unkType = -1;
player->updateCounter++;
if (player->unk_258 != 0) {
if (player->unk_258 < ARRAY_COUNT(player->unk_238)) {
pos = player->unk_259;
for (var_a1 = 0; var_a1 < player->unk_258; var_a1++) {
value = player->unk_238[pos];
if (value != 0) {
if (value < 16) {
unkType = value & 3;
segmentID = value >> 2;
}
pos++;
if (pos >= ARRAY_COUNT(player->unk_238)) {
pos = 0;
}
}
}
delta = player->unk_25A - player->unk_259;
if (delta < 0) {
delta += ARRAY_COUNT(player->unk_238);
}
player->unk_258 -= delta;
player->unk_259 = player->unk_25A;
} else {
player->unk_258 = 0;
}
if (unkType != -1) {
if (unkType != 0) {
if (unkType != player->unk_58) {
player->unk_58 = unkType & 0xFF;
player->unk_5A = unkType & 0xFF;
player->masterState = BGM_PLAY_STATE_INIT;
player->nextUpdateStep = BGM_SAMPLE_RATE;
if (unkType == 2) {
bgmFile = player->globals->dataBGM[1];
} else {
bgmFile = player->globals->dataBGM[0];
}
player->bgmFile = bgmFile;
bgmData = &bgmFile->info;
func_8004E880(player, BGM_SAMPLE_RATE, BgmDivisors[((u8*)player->unk_74)[0] & 7]); //TODO revise unk_74 typing
segmentOffset = bgmData->segments[segmentID];
if (segmentOffset == 0) {
segmentOffset = bgmData->segments[0];
}
player->segmentStartPos = AU_FILE_RELATIVE(bgmFile, segmentOffset << 2);
player->segmentReadPos = AU_FILE_RELATIVE(bgmFile, segmentOffset << 2);
if (bgmData->drums != 0) {
player->drumsInfo = AU_FILE_RELATIVE(player->bgmFile, bgmData->drums << 2);
player->bgmDrumCount = bgmData->drumCount;
for (i = 0; i < player->bgmDrumCount; i++) {
BGMDrumInfo* drum = &player->drumsInfo[i];
player->drums[i] = drum;
}
for (; i < 12; i++) {
player->drums[i] = player->drums[0];
}
} else {
player->drumsInfo = NULL;
player->bgmDrumCount = 0;
}
if (bgmData->instruments != 0) {
player->instrumentsInfo = AU_FILE_RELATIVE(player->bgmFile, bgmData->instruments << 2);
player->bgmInstrumentCount = bgmData->instrumentCount;
return;
}
player->instrumentsInfo = NULL;
player->bgmInstrumentCount = 0;
}
} else {
if (player->unk_58 != 0) {
player->masterState = BGM_PLAY_STATE_STOP;
player->nextUpdateCounter = 1;
player->nextUpdateStep = 1;
} else {
au_bgm_stop_player(player);
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel draw_content_pickup_item_header
/* CCE3C 8013673C 27BDFFD0 */ addiu $sp, $sp, -0x30
/* CCE40 80136740 AFB1001C */ sw $s1, 0x1C($sp)
/* CCE44 80136744 0080882D */ daddu $s1, $a0, $zero
/* CCE48 80136748 AFB20020 */ sw $s2, 0x20($sp)
/* CCE4C 8013674C 00A0902D */ daddu $s2, $a1, $zero
/* CCE50 80136750 AFB30024 */ sw $s3, 0x24($sp)
/* CCE54 80136754 3C048008 */ lui $a0, %hi(gItemTable)
/* CCE58 80136758 248478E0 */ addiu $a0, $a0, %lo(gItemTable)
/* CCE5C 8013675C AFBF0028 */ sw $ra, 0x28($sp)
/* CCE60 80136760 AFB00018 */ sw $s0, 0x18($sp)
/* CCE64 80136764 86230018 */ lh $v1, 0x18($s1)
/* CCE68 80136768 9222001A */ lbu $v0, 0x1A($s1)
/* CCE6C 8013676C 00031940 */ sll $v1, $v1, 5
/* CCE70 80136770 00642021 */ addu $a0, $v1, $a0
/* CCE74 80136774 2442FFFE */ addiu $v0, $v0, -0x2
/* CCE78 80136778 00021600 */ sll $v0, $v0, 24
/* CCE7C 8013677C 00021E03 */ sra $v1, $v0, 24
/* CCE80 80136780 2C62000D */ sltiu $v0, $v1, 0xD
/* CCE84 80136784 1040008B */ beqz $v0, .L801369B4
/* CCE88 80136788 00C0982D */ daddu $s3, $a2, $zero
/* CCE8C 8013678C 00031080 */ sll $v0, $v1, 2
/* CCE90 80136790 3C018015 */ lui $at, %hi(jtbl_80150E60)
/* CCE94 80136794 00220821 */ addu $at, $at, $v0
/* CCE98 80136798 8C220E60 */ lw $v0, %lo(jtbl_80150E60)($at)
/* CCE9C 8013679C 00400008 */ jr $v0
/* CCEA0 801367A0 00000000 */ nop
glabel .L801367A4
/* CCEA4 801367A4 94820018 */ lhu $v0, 0x18($a0)
/* CCEA8 801367A8 30420040 */ andi $v0, $v0, 0x40
/* CCEAC 801367AC 1440001C */ bnez $v0, .L80136820
/* CCEB0 801367B0 3C030400 */ lui $v1, (0x4000000 >> 16)
/* CCEB4 801367B4 8E220000 */ lw $v0, 0x0($s1)
/* CCEB8 801367B8 00431024 */ and $v0, $v0, $v1
/* CCEBC 801367BC 10400005 */ beqz $v0, .L801367D4
/* CCEC0 801367C0 3C10001D */ lui $s0, (0x1D0058 >> 16)
/* CCEC4 801367C4 96220006 */ lhu $v0, 0x6($s1)
/* CCEC8 801367C8 30420004 */ andi $v0, $v0, 0x4
/* CCECC 801367CC 50400002 */ beql $v0, $zero, .L801367D8
/* CCED0 801367D0 3610005A */ ori $s0, $s0, (0x1D005A & 0xFFFF)
.L801367D4:
/* CCED4 801367D4 36100058 */ ori $s0, $s0, (0x1D0058 & 0xFFFF)
.L801367D8:
/* CCED8 801367D8 8C840000 */ lw $a0, 0x0($a0)
/* CCEDC 801367DC 0C0496CF */ jal set_message_msg
/* CCEE0 801367E0 0000282D */ daddu $a1, $zero, $zero
/* CCEE4 801367E4 96230006 */ lhu $v1, 0x6($s1)
/* CCEE8 801367E8 30620010 */ andi $v0, $v1, 0x10
/* CCEEC 801367EC 10400003 */ beqz $v0, .L801367FC
/* CCEF0 801367F0 30620020 */ andi $v0, $v1, 0x20
/* CCEF4 801367F4 3C10001D */ lui $s0, (0x1D005D >> 16)
/* CCEF8 801367F8 3610005D */ ori $s0, $s0, (0x1D005D & 0xFFFF)
.L801367FC:
/* CCEFC 801367FC 10400003 */ beqz $v0, .L8013680C
/* CCF00 80136800 30620040 */ andi $v0, $v1, 0x40
/* CCF04 80136804 3C10001D */ lui $s0, (0x1D005E >> 16)
/* CCF08 80136808 3610005E */ ori $s0, $s0, (0x1D005E & 0xFFFF)
.L8013680C:
/* CCF0C 8013680C 1040001E */ beqz $v0, .L80136888
/* CCF10 80136810 00000000 */ nop
/* CCF14 80136814 3C10001D */ lui $s0, (0x1D005C >> 16)
/* CCF18 80136818 0804DA22 */ j .L80136888
/* CCF1C 8013681C 3610005C */ ori $s0, $s0, (0x1D005C & 0xFFFF)
.L80136820:
/* CCF20 80136820 8E220000 */ lw $v0, 0x0($s1)
/* CCF24 80136824 00431024 */ and $v0, $v0, $v1
/* CCF28 80136828 10400005 */ beqz $v0, .L80136840
/* CCF2C 8013682C 3C10001D */ lui $s0, (0x1D0059 >> 16)
/* CCF30 80136830 96220006 */ lhu $v0, 0x6($s1)
/* CCF34 80136834 30420004 */ andi $v0, $v0, 0x4
/* CCF38 80136838 50400002 */ beql $v0, $zero, .L80136844
/* CCF3C 8013683C 3610005B */ ori $s0, $s0, (0x1D005B & 0xFFFF)
.L80136840:
/* CCF40 80136840 36100059 */ ori $s0, $s0, (0x1D0059 & 0xFFFF)
.L80136844:
/* CCF44 80136844 96230006 */ lhu $v1, 0x6($s1)
/* CCF48 80136848 30620010 */ andi $v0, $v1, 0x10
/* CCF4C 8013684C 10400003 */ beqz $v0, .L8013685C
/* CCF50 80136850 30620020 */ andi $v0, $v1, 0x20
/* CCF54 80136854 3C10001D */ lui $s0, (0x1D005D >> 16)
/* CCF58 80136858 3610005D */ ori $s0, $s0, (0x1D005D & 0xFFFF)
.L8013685C:
/* CCF5C 8013685C 10400003 */ beqz $v0, .L8013686C
/* CCF60 80136860 30620040 */ andi $v0, $v1, 0x40
/* CCF64 80136864 3C10001D */ lui $s0, (0x1D005E >> 16)
/* CCF68 80136868 3610005E */ ori $s0, $s0, (0x1D005E & 0xFFFF)
.L8013686C:
/* CCF6C 8013686C 10400003 */ beqz $v0, .L8013687C
/* CCF70 80136870 00000000 */ nop
/* CCF74 80136874 3C10001D */ lui $s0, (0x1D005C >> 16)
/* CCF78 80136878 3610005C */ ori $s0, $s0, (0x1D005C & 0xFFFF)
.L8013687C:
/* CCF7C 8013687C 8C840000 */ lw $a0, 0x0($a0)
/* CCF80 80136880 0C0496CF */ jal set_message_msg
/* CCF84 80136884 0000282D */ daddu $a1, $zero, $zero
.L80136888:
/* CCF88 80136888 0C04992C */ jal get_msg_lines
/* CCF8C 8013688C 0200202D */ daddu $a0, $s0, $zero
/* CCF90 80136890 2442FFFF */ addiu $v0, $v0, -0x1
/* CCF94 80136894 86250018 */ lh $a1, 0x18($s1)
/* CCF98 80136898 00021040 */ sll $v0, $v0, 1
/* CCF9C 8013689C 00051940 */ sll $v1, $a1, 5
/* CCFA0 801368A0 3C048008 */ lui $a0, %hi(gItemTable + 0x18)
/* CCFA4 801368A4 00832021 */ addu $a0, $a0, $v1
/* CCFA8 801368A8 948478F8 */ lhu $a0, %lo(gItemTable + 0x18)($a0)
/* CCFAC 801368AC 3C068015 */ lui $a2, %hi(PickupMessageWindowYOffsets)
/* CCFB0 801368B0 00C23021 */ addu $a2, $a2, $v0
/* CCFB4 801368B4 84C6C6E4 */ lh $a2, %lo(PickupMessageWindowYOffsets)($a2)
/* CCFB8 801368B8 30830040 */ andi $v1, $a0, 0x40
/* CCFBC 801368BC 5460000E */ bnel $v1, $zero, .L801368F8
/* CCFC0 801368C0 0200202D */ daddu $a0, $s0, $zero
/* CCFC4 801368C4 30820008 */ andi $v0, $a0, 0x8
/* CCFC8 801368C8 5440000B */ bnel $v0, $zero, .L801368F8
/* CCFCC 801368CC 0200202D */ daddu $a0, $s0, $zero
/* CCFD0 801368D0 2402015C */ addiu $v0, $zero, 0x15C
/* CCFD4 801368D4 10A20007 */ beq $a1, $v0, .L801368F4
/* CCFD8 801368D8 30820020 */ andi $v0, $a0, 0x20
/* CCFDC 801368DC 14400006 */ bnez $v0, .L801368F8
/* CCFE0 801368E0 0200202D */ daddu $a0, $s0, $zero
/* CCFE4 801368E4 96220006 */ lhu $v0, 0x6($s1)
/* CCFE8 801368E8 30420030 */ andi $v0, $v0, 0x30
/* CCFEC 801368EC 1040000B */ beqz $v0, .L8013691C
/* CCFF0 801368F0 26450028 */ addiu $a1, $s2, 0x28
.L801368F4:
/* CCFF4 801368F4 0200202D */ daddu $a0, $s0, $zero
.L801368F8:
/* CCFF8 801368F8 2645000F */ addiu $a1, $s2, 0xF
/* CCFFC 801368FC 02663021 */ addu $a2, $s3, $a2
/* CD000 80136900 240700FF */ addiu $a3, $zero, 0xFF
/* CD004 80136904 2402002F */ addiu $v0, $zero, 0x2F
/* CD008 80136908 AFA20010 */ sw $v0, 0x10($sp)
/* CD00C 8013690C 0C04993B */ jal draw_msg
/* CD010 80136910 AFA00014 */ sw $zero, 0x14($sp)
/* CD014 80136914 0804DA6D */ j .L801369B4
/* CD018 80136918 00000000 */ nop
.L8013691C:
/* CD01C 8013691C 02663021 */ addu $a2, $s3, $a2
/* CD020 80136920 240700FF */ addiu $a3, $zero, 0xFF
/* CD024 80136924 2402002F */ addiu $v0, $zero, 0x2F
/* CD028 80136928 AFA20010 */ sw $v0, 0x10($sp)
/* CD02C 8013692C 0C04993B */ jal draw_msg
/* CD030 80136930 AFA00014 */ sw $zero, 0x14($sp)
/* CD034 80136934 96220006 */ lhu $v0, 0x6($s1)
/* CD038 80136938 30420030 */ andi $v0, $v0, 0x30
/* CD03C 8013693C 1440001D */ bnez $v0, .L801369B4
/* CD040 80136940 26450014 */ addiu $a1, $s2, 0x14
/* CD044 80136944 0804DA65 */ j .L80136994
/* CD048 80136948 00000000 */ nop
glabel .L8013694C
/* CD04C 8013694C 3C028015 */ lui $v0, %hi(D_801568EC)
/* CD050 80136950 8C4268EC */ lw $v0, %lo(D_801568EC)($v0)
/* CD054 80136954 00021140 */ sll $v0, $v0, 5
/* CD058 80136958 3C048008 */ lui $a0, %hi(gItemTable)
/* CD05C 8013695C 00822021 */ addu $a0, $a0, $v0
/* CD060 80136960 8C8478E0 */ lw $a0, %lo(gItemTable)($a0)
/* CD064 80136964 0C0496CF */ jal set_message_msg
/* CD068 80136968 0000282D */ daddu $a1, $zero, $zero
/* CD06C 8013696C 3C04001D */ lui $a0, (0x1D005F >> 16)
/* CD070 80136970 3484005F */ ori $a0, $a0, (0x1D005F & 0xFFFF)
/* CD074 80136974 26450028 */ addiu $a1, $s2, 0x28
/* CD078 80136978 26660004 */ addiu $a2, $s3, 0x4
/* CD07C 8013697C 240700FF */ addiu $a3, $zero, 0xFF
/* CD080 80136980 2402002F */ addiu $v0, $zero, 0x2F
/* CD084 80136984 AFA20010 */ sw $v0, 0x10($sp)
/* CD088 80136988 0C04993B */ jal draw_msg
/* CD08C 8013698C AFA00014 */ sw $zero, 0x14($sp)
/* CD090 80136990 26450014 */ addiu $a1, $s2, 0x14
.L80136994:
/* CD094 80136994 3C108015 */ lui $s0, %hi(ItemPickupIconID)
/* CD098 80136998 261068E0 */ addiu $s0, $s0, %lo(ItemPickupIconID)
/* CD09C 8013699C 8E040000 */ lw $a0, 0x0($s0)
/* CD0A0 801369A0 0C051261 */ jal hud_element_set_render_pos
/* CD0A4 801369A4 26660014 */ addiu $a2, $s3, 0x14
/* CD0A8 801369A8 8E040000 */ lw $a0, 0x0($s0)
/* CD0AC 801369AC 0C0511F1 */ jal hud_element_draw_next
/* CD0B0 801369B0 00000000 */ nop
glabel .L801369B4
/* CD0B4 801369B4 8FBF0028 */ lw $ra, 0x28($sp)
/* CD0B8 801369B8 8FB30024 */ lw $s3, 0x24($sp)
/* CD0BC 801369BC 8FB20020 */ lw $s2, 0x20($sp)
/* CD0C0 801369C0 8FB1001C */ lw $s1, 0x1C($sp)
/* CD0C4 801369C4 8FB00018 */ lw $s0, 0x18($sp)
/* CD0C8 801369C8 03E00008 */ jr $ra
/* CD0CC 801369CC 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void draw_content_pickup_item_header(ItemEntity* item, s32 posX, s32 posY) {
ItemData* itemData = &gItemTable[item->itemID];
s32 itemMsg;
s32 offsetY;
switch (item->state) {
case ITEM_PICKUP_STATE_SHOW_GOT_ITEM:
case ITEM_PICKUP_STATE_HIDE_GOT_ITEM:
case ITEM_PICKUP_STATE_SHOW_TOO_MANY:
case ITEM_PICKUP_STATE_HIDE_TOO_MANY:
if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BADGE)) {
if (!(item->flags & ITEM_ENTITY_FLAG_4000000) || (item->pickupMsgFlags & ITEM_PICKUP_FLAG_UNKNOWN)) {
itemMsg = MSG_Menus_0058;
} else {
itemMsg = MSG_Menus_005A;
}
set_message_msg(itemData->nameMsg, 0);
if (item->pickupMsgFlags & ITEM_PICKUP_FLAG_1_COIN) {
itemMsg = MSG_Menus_005D;
}
if (item->pickupMsgFlags & ITEM_PICKUP_FLAG_3_STAR_PIECES) {
itemMsg = MSG_Menus_005E;
}
if (item->pickupMsgFlags & ITEM_PICKUP_FLAG_UNIQUE) {
itemMsg = MSG_Menus_005C;
}
} else {
if (!(item->flags & ITEM_ENTITY_FLAG_4000000) || (item->pickupMsgFlags & ITEM_PICKUP_FLAG_UNKNOWN)) {
itemMsg = MSG_Menus_0059;
} else {
itemMsg = MSG_Menus_005B;
}
if (item->pickupMsgFlags & ITEM_PICKUP_FLAG_1_COIN) {
itemMsg = MSG_Menus_005D;
}
if (item->pickupMsgFlags & ITEM_PICKUP_FLAG_3_STAR_PIECES) {
itemMsg = MSG_Menus_005E;
}
if (item->pickupMsgFlags & ITEM_PICKUP_FLAG_UNIQUE) {
itemMsg = MSG_Menus_005C;
}
set_message_msg(itemData->nameMsg, 0);
}
offsetY = PickupMessageWindowYOffsets[get_msg_lines(itemMsg) - 1];
if ((gItemTable[item->itemID].typeFlags & ITEM_TYPE_FLAG_BADGE)
|| (gItemTable[item->itemID].typeFlags & ITEM_TYPE_FLAG_KEY)
|| item->itemID == ITEM_STAR_PIECE
|| (gItemTable[item->itemID].typeFlags & ITEM_TYPE_FLAG_GEAR)
|| (item->pickupMsgFlags & (ITEM_PICKUP_FLAG_1_COIN | ITEM_PICKUP_FLAG_3_STAR_PIECES))
) {
draw_msg(itemMsg, posX + 15, posY + offsetY, 255, MSG_PAL_2F, 0);
} else {
draw_msg(itemMsg, posX + 40, posY + offsetY, 255, MSG_PAL_2F, 0);
if (!(item->pickupMsgFlags & (ITEM_PICKUP_FLAG_1_COIN | ITEM_PICKUP_FLAG_3_STAR_PIECES))) {
hud_element_set_render_pos(ItemPickupIconID, posX + 20, posY + 20);
hud_element_draw_next(ItemPickupIconID);
}
}
break;
case ITEM_PICKUP_STATE_SHOW_THREW_AWAY:
case ITEM_PICKUP_STATE_HIDE_THREW_AWAY:
set_message_msg(gItemTable[D_801568EC].nameMsg, 0);
draw_msg(MSG_Menus_005F, posX + 40, posY + 4, 255, MSG_PAL_2F, 0);
hud_element_set_render_pos(ItemPickupIconID, posX + 20, posY + 20);
hud_element_draw_next(ItemPickupIconID);
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel entity_shattering_setupGfx
/* 104424 802E2BA4 27BDFE80 */ addiu $sp, $sp, -0x180
/* 104428 802E2BA8 AFB20130 */ sw $s2, 0x130($sp)
/* 10442C 802E2BAC 3C12800A */ lui $s2, %hi(gMainGfxPos)
/* 104430 802E2BB0 8E52A66C */ lw $s2, %lo(gMainGfxPos)($s2)
/* 104434 802E2BB4 F7BA0168 */ sdc1 $f26, 0x168($sp)
/* 104438 802E2BB8 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 10443C 802E2BBC 4481D000 */ mtc1 $at, $f26
/* 104440 802E2BC0 AFB70144 */ sw $s7, 0x144($sp)
/* 104444 802E2BC4 0000B82D */ daddu $s7, $zero, $zero
/* 104448 802E2BC8 F7B80160 */ sdc1 $f24, 0x160($sp)
/* 10444C 802E2BCC 3C013B80 */ lui $at, (0x3B800000 >> 16)
/* 104450 802E2BD0 4481C000 */ mtc1 $at, $f24
/* 104454 802E2BD4 27A80098 */ addiu $t0, $sp, 0x98
/* 104458 802E2BD8 AFB60140 */ sw $s6, 0x140($sp)
/* 10445C 802E2BDC 27B600D8 */ addiu $s6, $sp, 0xD8
/* 104460 802E2BE0 AFB5013C */ sw $s5, 0x13C($sp)
/* 104464 802E2BE4 27B50058 */ addiu $s5, $sp, 0x58
/* 104468 802E2BE8 AFA80120 */ sw $t0, 0x120($sp)
/* 10446C 802E2BEC 3C080001 */ lui $t0, (0x11630 >> 16)
/* 104470 802E2BF0 F7B60158 */ sdc1 $f22, 0x158($sp)
/* 104474 802E2BF4 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 104478 802E2BF8 4481B000 */ mtc1 $at, $f22
/* 10447C 802E2BFC 35081630 */ ori $t0, $t0, (0x11630 & 0xFFFF)
/* 104480 802E2C00 AFBF014C */ sw $ra, 0x14C($sp)
/* 104484 802E2C04 AFBE0148 */ sw $fp, 0x148($sp)
/* 104488 802E2C08 AFB40138 */ sw $s4, 0x138($sp)
/* 10448C 802E2C0C AFB30134 */ sw $s3, 0x134($sp)
/* 104490 802E2C10 AFB1012C */ sw $s1, 0x12C($sp)
/* 104494 802E2C14 AFB00128 */ sw $s0, 0x128($sp)
/* 104498 802E2C18 F7BE0178 */ sdc1 $f30, 0x178($sp)
/* 10449C 802E2C1C F7BC0170 */ sdc1 $f28, 0x170($sp)
/* 1044A0 802E2C20 F7B40150 */ sdc1 $f20, 0x150($sp)
/* 1044A4 802E2C24 0C04417A */ jal get_entity_by_index
/* 1044A8 802E2C28 AFA80124 */ sw $t0, 0x124($sp)
/* 1044AC 802E2C2C AFA2011C */ sw $v0, 0x11C($sp)
/* 1044B0 802E2C30 8C540040 */ lw $s4, 0x40($v0)
/* 1044B4 802E2C34 4480A000 */ mtc1 $zero, $f20
/* 1044B8 802E2C38 C4400048 */ lwc1 $f0, 0x48($v0)
/* 1044BC 802E2C3C 0280982D */ daddu $s3, $s4, $zero
/* 1044C0 802E2C40 2651FFFC */ addiu $s1, $s2, -0x4
/* 1044C4 802E2C44 46000007 */ neg.s $f0, $f0
/* 1044C8 802E2C48 E7A00118 */ swc1 $f0, 0x118($sp)
/* 1044CC 802E2C4C C440004C */ lwc1 $f0, 0x4C($v0)
/* 1044D0 802E2C50 C4420050 */ lwc1 $f2, 0x50($v0)
/* 1044D4 802E2C54 8E9E0034 */ lw $fp, 0x34($s4)
/* 1044D8 802E2C58 46000787 */ neg.s $f30, $f0
/* 1044DC 802E2C5C 46001707 */ neg.s $f28, $f2
.L802E2C60:
/* 1044E0 802E2C60 8683003C */ lh $v1, 0x3C($s4)
/* 1044E4 802E2C64 240200FF */ addiu $v0, $zero, 0xFF
/* 1044E8 802E2C68 1462000F */ bne $v1, $v0, .L802E2CA8
/* 1044EC 802E2C6C 26310008 */ addiu $s1, $s1, 0x8
/* 1044F0 802E2C70 3C03E200 */ lui $v1, (0xE200001C >> 16)
/* 1044F4 802E2C74 3463001C */ ori $v1, $v1, (0xE200001C & 0xFFFF)
/* 1044F8 802E2C78 3C020055 */ lui $v0, (0x552078 >> 16)
/* 1044FC 802E2C7C 34422078 */ ori $v0, $v0, (0x552078 & 0xFFFF)
/* 104500 802E2C80 AE23FFFC */ sw $v1, -0x4($s1)
/* 104504 802E2C84 AE220000 */ sw $v0, 0x0($s1)
/* 104508 802E2C88 26310008 */ addiu $s1, $s1, 0x8
/* 10450C 802E2C8C 26520010 */ addiu $s2, $s2, 0x10
/* 104510 802E2C90 3C03FC12 */ lui $v1, (0xFC121824 >> 16)
/* 104514 802E2C94 34631824 */ ori $v1, $v1, (0xFC121824 & 0xFFFF)
/* 104518 802E2C98 3C02FF33 */ lui $v0, (0xFF33FFFF >> 16)
/* 10451C 802E2C9C 3442FFFF */ ori $v0, $v0, (0xFF33FFFF & 0xFFFF)
/* 104520 802E2CA0 080B8B35 */ j .L802E2CD4
/* 104524 802E2CA4 AE23FFFC */ sw $v1, -0x4($s1)
.L802E2CA8:
/* 104528 802E2CA8 3C03FCFF */ lui $v1, (0xFCFFC3FF >> 16)
/* 10452C 802E2CAC 3463C3FF */ ori $v1, $v1, (0xFCFFC3FF & 0xFFFF)
/* 104530 802E2CB0 3C02FF30 */ lui $v0, (0xFF30FE7F >> 16)
/* 104534 802E2CB4 3442FE7F */ ori $v0, $v0, (0xFF30FE7F & 0xFFFF)
/* 104538 802E2CB8 AE23FFFC */ sw $v1, -0x4($s1)
/* 10453C 802E2CBC AE220000 */ sw $v0, 0x0($s1)
/* 104540 802E2CC0 26310008 */ addiu $s1, $s1, 0x8
/* 104544 802E2CC4 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 104548 802E2CC8 AE22FFFC */ sw $v0, -0x4($s1)
/* 10454C 802E2CCC 9282003D */ lbu $v0, 0x3D($s4)
/* 104550 802E2CD0 26520010 */ addiu $s2, $s2, 0x10
.L802E2CD4:
/* 104554 802E2CD4 AE220000 */ sw $v0, 0x0($s1)
/* 104558 802E2CD8 8FA50118 */ lw $a1, 0x118($sp)
/* 10455C 802E2CDC 4406F000 */ mfc1 $a2, $f30
/* 104560 802E2CE0 4407E000 */ mfc1 $a3, $f28
/* 104564 802E2CE4 0C019E40 */ jal guTranslateF
/* 104568 802E2CE8 27A40018 */ addiu $a0, $sp, 0x18
/* 10456C 802E2CEC 02978021 */ addu $s0, $s4, $s7
/* 104570 802E2CF0 9202008B */ lbu $v0, 0x8B($s0)
/* 104574 802E2CF4 44820000 */ mtc1 $v0, $f0
/* 104578 802E2CF8 00000000 */ nop
/* 10457C 802E2CFC 46800020 */ cvt.s.w $f0, $f0
/* 104580 802E2D00 461A0002 */ mul.s $f0, $f0, $f26
/* 104584 802E2D04 00000000 */ nop
/* 104588 802E2D08 46180002 */ mul.s $f0, $f0, $f24
/* 10458C 802E2D0C 00000000 */ nop
/* 104590 802E2D10 4406B000 */ mfc1 $a2, $f22
/* 104594 802E2D14 4407A000 */ mfc1 $a3, $f20
/* 104598 802E2D18 8FA40120 */ lw $a0, 0x120($sp)
/* 10459C 802E2D1C 44050000 */ mfc1 $a1, $f0
/* 1045A0 802E2D20 0C019EC8 */ jal guRotateF
/* 1045A4 802E2D24 E7B40010 */ swc1 $f20, 0x10($sp)
/* 1045A8 802E2D28 920200A4 */ lbu $v0, 0xA4($s0)
/* 1045AC 802E2D2C 44820000 */ mtc1 $v0, $f0
/* 1045B0 802E2D30 00000000 */ nop
/* 1045B4 802E2D34 46800020 */ cvt.s.w $f0, $f0
/* 1045B8 802E2D38 461A0002 */ mul.s $f0, $f0, $f26
/* 1045BC 802E2D3C 00000000 */ nop
/* 1045C0 802E2D40 26310008 */ addiu $s1, $s1, 0x8
/* 1045C4 802E2D44 46180002 */ mul.s $f0, $f0, $f24
/* 1045C8 802E2D48 00000000 */ nop
/* 1045CC 802E2D4C 26520018 */ addiu $s2, $s2, 0x18
/* 1045D0 802E2D50 26F70001 */ addiu $s7, $s7, 0x1
/* 1045D4 802E2D54 4406A000 */ mfc1 $a2, $f20
/* 1045D8 802E2D58 4407B000 */ mfc1 $a3, $f22
/* 1045DC 802E2D5C 44050000 */ mfc1 $a1, $f0
/* 1045E0 802E2D60 02C0202D */ daddu $a0, $s6, $zero
/* 1045E4 802E2D64 0C019EC8 */ jal guRotateF
/* 1045E8 802E2D68 E7B40010 */ swc1 $f20, 0x10($sp)
/* 1045EC 802E2D6C 02C0282D */ daddu $a1, $s6, $zero
/* 1045F0 802E2D70 8FA40120 */ lw $a0, 0x120($sp)
/* 1045F4 802E2D74 0C019D80 */ jal guMtxCatF
/* 1045F8 802E2D78 02C0302D */ daddu $a2, $s6, $zero
/* 1045FC 802E2D7C 02C0202D */ daddu $a0, $s6, $zero
/* 104600 802E2D80 27A50018 */ addiu $a1, $sp, 0x18
/* 104604 802E2D84 0C019D80 */ jal guMtxCatF
/* 104608 802E2D88 00A0302D */ daddu $a2, $a1, $zero
/* 10460C 802E2D8C 02A0202D */ daddu $a0, $s5, $zero
/* 104610 802E2D90 8E6500C0 */ lw $a1, 0xC0($s3)
/* 104614 802E2D94 8E660124 */ lw $a2, 0x124($s3)
/* 104618 802E2D98 8E670188 */ lw $a3, 0x188($s3)
/* 10461C 802E2D9C 0C019E40 */ jal guTranslateF
/* 104620 802E2DA0 26730004 */ addiu $s3, $s3, 0x4
/* 104624 802E2DA4 27A40018 */ addiu $a0, $sp, 0x18
/* 104628 802E2DA8 02A0282D */ daddu $a1, $s5, $zero
/* 10462C 802E2DAC 0C019D80 */ jal guMtxCatF
/* 104630 802E2DB0 02A0302D */ daddu $a2, $s5, $zero
/* 104634 802E2DB4 02A0202D */ daddu $a0, $s5, $zero
/* 104638 802E2DB8 3C058007 */ lui $a1, %hi(gMatrixListPos)
/* 10463C 802E2DBC 94A541F0 */ lhu $a1, %lo(gMatrixListPos)($a1)
/* 104640 802E2DC0 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 104644 802E2DC4 8C42A674 */ lw $v0, %lo(gDisplayContext)($v0)
/* 104648 802E2DC8 8FA80124 */ lw $t0, 0x124($sp)
/* 10464C 802E2DCC 00052980 */ sll $a1, $a1, 6
/* 104650 802E2DD0 00A82821 */ addu $a1, $a1, $t0
/* 104654 802E2DD4 0C019D40 */ jal guMtxF2L
/* 104658 802E2DD8 00452821 */ addu $a1, $v0, $a1
/* 10465C 802E2DDC 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* 104660 802E2DE0 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* 104664 802E2DE4 3C028007 */ lui $v0, %hi(gMatrixListPos)
/* 104668 802E2DE8 944241F0 */ lhu $v0, %lo(gMatrixListPos)($v0)
/* 10466C 802E2DEC 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 104670 802E2DF0 AE23FFFC */ sw $v1, -0x4($s1)
/* 104674 802E2DF4 8FA80124 */ lw $t0, 0x124($sp)
/* 104678 802E2DF8 24430001 */ addiu $v1, $v0, 0x1
/* 10467C 802E2DFC 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 104680 802E2E00 00021180 */ sll $v0, $v0, 6
/* 104684 802E2E04 3C018007 */ lui $at, %hi(gMatrixListPos)
/* 104688 802E2E08 A42341F0 */ sh $v1, %lo(gMatrixListPos)($at)
/* 10468C 802E2E0C 3C03800A */ lui $v1, %hi(gDisplayContext)
/* 104690 802E2E10 8C63A674 */ lw $v1, %lo(gDisplayContext)($v1)
/* 104694 802E2E14 00481021 */ addu $v0, $v0, $t0
/* 104698 802E2E18 00621821 */ addu $v1, $v1, $v0
/* 10469C 802E2E1C AE230000 */ sw $v1, 0x0($s1)
/* 1046A0 802E2E20 97C40002 */ lhu $a0, 0x2($fp)
/* 1046A4 802E2E24 27DE0004 */ addiu $fp, $fp, 0x4
/* 1046A8 802E2E28 8FA8011C */ lw $t0, 0x11C($sp)
/* 1046AC 802E2E2C 26310008 */ addiu $s1, $s1, 0x8
/* 1046B0 802E2E30 8D030044 */ lw $v1, 0x44($t0)
/* 1046B4 802E2E34 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 1046B8 802E2E38 AE22FFFC */ sw $v0, -0x4($s1)
/* 1046BC 802E2E3C 24020040 */ addiu $v0, $zero, 0x40
/* 1046C0 802E2E40 00641821 */ addu $v1, $v1, $a0
/* 1046C4 802E2E44 AE230000 */ sw $v1, 0x0($s1)
/* 1046C8 802E2E48 26310008 */ addiu $s1, $s1, 0x8
/* 1046CC 802E2E4C AE220000 */ sw $v0, 0x0($s1)
/* 1046D0 802E2E50 2AE20018 */ slti $v0, $s7, 0x18
/* 1046D4 802E2E54 1440FF82 */ bnez $v0, .L802E2C60
/* 1046D8 802E2E58 AE25FFFC */ sw $a1, -0x4($s1)
/* 1046DC 802E2E5C 8FBF014C */ lw $ra, 0x14C($sp)
/* 1046E0 802E2E60 8FBE0148 */ lw $fp, 0x148($sp)
/* 1046E4 802E2E64 8FB70144 */ lw $s7, 0x144($sp)
/* 1046E8 802E2E68 8FB60140 */ lw $s6, 0x140($sp)
/* 1046EC 802E2E6C 8FB5013C */ lw $s5, 0x13C($sp)
/* 1046F0 802E2E70 8FB40138 */ lw $s4, 0x138($sp)
/* 1046F4 802E2E74 8FB30134 */ lw $s3, 0x134($sp)
/* 1046F8 802E2E78 3C01800A */ lui $at, %hi(gMainGfxPos)
/* 1046FC 802E2E7C AC32A66C */ sw $s2, %lo(gMainGfxPos)($at)
/* 104700 802E2E80 8FB20130 */ lw $s2, 0x130($sp)
/* 104704 802E2E84 8FB1012C */ lw $s1, 0x12C($sp)
/* 104708 802E2E88 8FB00128 */ lw $s0, 0x128($sp)
/* 10470C 802E2E8C D7BE0178 */ ldc1 $f30, 0x178($sp)
/* 104710 802E2E90 D7BC0170 */ ldc1 $f28, 0x170($sp)
/* 104714 802E2E94 D7BA0168 */ ldc1 $f26, 0x168($sp)
/* 104718 802E2E98 D7B80160 */ ldc1 $f24, 0x160($sp)
/* 10471C 802E2E9C D7B60158 */ ldc1 $f22, 0x158($sp)
/* 104720 802E2EA0 D7B40150 */ ldc1 $f20, 0x150($sp)
/* 104724 802E2EA4 03E00008 */ jr $ra
/* 104728 802E2EA8 27BD0180 */ addiu $sp, $sp, 0x180
/* 10472C 802E2EAC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void entity_shattering_setupGfx(s32 entityIndex) {
s32 i;
Matrix4f mtxTransInv;
Matrix4f mtx;
Matrix4f mtxRotX;
Matrix4f mtxRotY;
f32 x_inv;
f32 y_inv;
f32 z_inv;
Gfx* gfxPos = gMainGfxPos;
Entity* entity = get_entity_by_index(entityIndex);
ShatteringBlockData* data = entity->dataBuf.shatteringBlock;
Gfx* fragmentDlist;
Gfx** gfx = data->fragmentDisplayLists;
x_inv = -entity->position.x;
y_inv = -entity->position.y;
z_inv = -entity->position.z;
for (i = 0; i < 24; i++) {
if (data->alpha == 255) {
gDPSetRenderMode(gfxPos++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gDPSetCombineMode(gfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
} else {
gDPSetCombineMode(gfxPos++, PM_CC_11, PM_CC_12);
gDPSetPrimColor(gfxPos++, 0, 0, 0, 0, 0, data->alpha);
}
guTranslateF(mtxTransInv, x_inv, y_inv, z_inv);
guRotateF(mtxRotX, data->fragmentRotX[i] * 360.0f / 256, 1.0f, 0.0f, 0.0f);
guRotateF(mtxRotY, data->fragmentRotY[i] * 360.0f / 256, 0.0f, 1.0f, 0.0f);
guMtxCatF(mtxRotX, mtxRotY, mtxRotY);
guMtxCatF(mtxRotY, mtxTransInv, mtxTransInv);
guTranslateF(mtx, data->fragmentPosX[i], data->fragmentPosY[i], data->fragmentPosZ[i]);
guMtxCatF(mtxTransInv, mtx, mtx);
guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
fragmentDlist = ENTITY_ADDR(entity, Gfx*, *gfx++);
gSPDisplayList(gfxPos++, fragmentDlist);
gSPPopMatrix(gfxPos++, G_MTX_MODELVIEW);
}
gMainGfxPos = gfxPos;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel entity_SaveBlock_setupGfx
/* 102660 802E0DE0 27BDFF28 */ addiu $sp, $sp, -0xD8
/* 102664 802E0DE4 AFB000A8 */ sw $s0, 0xA8($sp)
/* 102668 802E0DE8 3C10800A */ lui $s0, %hi(gMainGfxPos)
/* 10266C 802E0DEC 8E10A66C */ lw $s0, %lo(gMainGfxPos)($s0)
/* 102670 802E0DF0 AFBF00CC */ sw $ra, 0xCC($sp)
/* 102674 802E0DF4 AFBE00C8 */ sw $fp, 0xC8($sp)
/* 102678 802E0DF8 AFB700C4 */ sw $s7, 0xC4($sp)
/* 10267C 802E0DFC AFB600C0 */ sw $s6, 0xC0($sp)
/* 102680 802E0E00 AFB500BC */ sw $s5, 0xBC($sp)
/* 102684 802E0E04 AFB400B8 */ sw $s4, 0xB8($sp)
/* 102688 802E0E08 AFB300B4 */ sw $s3, 0xB4($sp)
/* 10268C 802E0E0C AFB200B0 */ sw $s2, 0xB0($sp)
/* 102690 802E0E10 AFB100AC */ sw $s1, 0xAC($sp)
/* 102694 802E0E14 F7B400D0 */ sdc1 $f20, 0xD0($sp)
/* 102698 802E0E18 0C04417A */ jal get_entity_by_index
/* 10269C 802E0E1C 3C170001 */ lui $s7, (0x11630 >> 16)
/* 1026A0 802E0E20 27A40018 */ addiu $a0, $sp, 0x18
/* 1026A4 802E0E24 36F71630 */ ori $s7, $s7, (0x11630 & 0xFFFF)
/* 1026A8 802E0E28 3C0DE200 */ lui $t5, (0xE200001C >> 16)
/* 1026AC 802E0E2C 35AD001C */ ori $t5, $t5, (0xE200001C & 0xFFFF)
/* 1026B0 802E0E30 AFAD0098 */ sw $t5, 0x98($sp)
/* 1026B4 802E0E34 3C0DFCFF */ lui $t5, (0xFCFFB3FF >> 16)
/* 1026B8 802E0E38 35ADB3FF */ ori $t5, $t5, (0xFCFFB3FF & 0xFFFF)
/* 1026BC 802E0E3C AFAD009C */ sw $t5, 0x9C($sp)
/* 1026C0 802E0E40 3C0DFF2C */ lui $t5, (0xFF2CFE7F >> 16)
/* 1026C4 802E0E44 35ADFE7F */ ori $t5, $t5, (0xFF2CFE7F & 0xFFFF)
/* 1026C8 802E0E48 AFAD00A0 */ sw $t5, 0xA0($sp)
/* 1026CC 802E0E4C 3C0DD838 */ lui $t5, (0xD8380000 >> 16)
/* 1026D0 802E0E50 0040B02D */ daddu $s6, $v0, $zero
/* 1026D4 802E0E54 3C140A00 */ lui $s4, %hi(D_0A003260_E94AF0)
/* 1026D8 802E0E58 26943260 */ addiu $s4, $s4, %lo(D_0A003260_E94AF0)
/* 1026DC 802E0E5C 3294FFFF */ andi $s4, $s4, 0xFFFF
/* 1026E0 802E0E60 AFAD00A4 */ sw $t5, 0xA4($sp)
/* 1026E4 802E0E64 8EC50044 */ lw $a1, 0x44($s6)
/* 1026E8 802E0E68 8ED20040 */ lw $s2, 0x40($s6)
/* 1026EC 802E0E6C 0C019D60 */ jal guMtxL2F
/* 1026F0 802E0E70 00B42821 */ addu $a1, $a1, $s4
/* 1026F4 802E0E74 27B10058 */ addiu $s1, $sp, 0x58
/* 1026F8 802E0E78 C7A0004C */ lwc1 $f0, 0x4C($sp)
/* 1026FC 802E0E7C 3C014148 */ lui $at, (0x41480000 >> 16)
/* 102700 802E0E80 4481A000 */ mtc1 $at, $f20
/* 102704 802E0E84 44801000 */ mtc1 $zero, $f2
/* 102708 802E0E88 8FAD00A4 */ lw $t5, 0xA4($sp)
/* 10270C 802E0E8C 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 102710 802E0E90 46140000 */ add.s $f0, $f0, $f20
/* 102714 802E0E94 35AD0002 */ ori $t5, $t5, 0x2
/* 102718 802E0E98 AFAD00A4 */ sw $t5, 0xA4($sp)
/* 10271C 802E0E9C E7A0004C */ swc1 $f0, 0x4C($sp)
/* 102720 802E0EA0 86420004 */ lh $v0, 0x4($s2)
/* 102724 802E0EA4 44061000 */ mfc1 $a2, $f2
/* 102728 802E0EA8 44822000 */ mtc1 $v0, $f4
/* 10272C 802E0EAC 00000000 */ nop
/* 102730 802E0EB0 46802120 */ cvt.s.w $f4, $f4
/* 102734 802E0EB4 44052000 */ mfc1 $a1, $f4
/* 102738 802E0EB8 0220202D */ daddu $a0, $s1, $zero
/* 10273C 802E0EBC 0C019EC8 */ jal guRotateF
/* 102740 802E0EC0 AFA60010 */ sw $a2, 0x10($sp)
/* 102744 802E0EC4 0220202D */ daddu $a0, $s1, $zero
/* 102748 802E0EC8 27A50018 */ addiu $a1, $sp, 0x18
/* 10274C 802E0ECC 0C019D80 */ jal guMtxCatF
/* 102750 802E0ED0 0220302D */ daddu $a2, $s1, $zero
/* 102754 802E0ED4 0220202D */ daddu $a0, $s1, $zero
/* 102758 802E0ED8 3C138007 */ lui $s3, %hi(gMatrixListPos)
/* 10275C 802E0EDC 267341F0 */ addiu $s3, $s3, %lo(gMatrixListPos)
/* 102760 802E0EE0 3C15800A */ lui $s5, %hi(gDisplayContext)
/* 102764 802E0EE4 26B5A674 */ addiu $s5, $s5, %lo(gDisplayContext)
/* 102768 802E0EE8 96650000 */ lhu $a1, 0x0($s3)
/* 10276C 802E0EEC 8EA20000 */ lw $v0, 0x0($s5)
/* 102770 802E0EF0 00052980 */ sll $a1, $a1, 6
/* 102774 802E0EF4 00B72821 */ addu $a1, $a1, $s7
/* 102778 802E0EF8 0C019D40 */ jal guMtxF2L
/* 10277C 802E0EFC 00452821 */ addu $a1, $v0, $a1
/* 102780 802E0F00 0200382D */ daddu $a3, $s0, $zero
/* 102784 802E0F04 26100008 */ addiu $s0, $s0, 0x8
/* 102788 802E0F08 0200402D */ daddu $t0, $s0, $zero
/* 10278C 802E0F0C 26100008 */ addiu $s0, $s0, 0x8
/* 102790 802E0F10 3C0C0050 */ lui $t4, (0x504B50 >> 16)
/* 102794 802E0F14 358C4B50 */ ori $t4, $t4, (0x504B50 & 0xFFFF)
/* 102798 802E0F18 0200302D */ daddu $a2, $s0, $zero
/* 10279C 802E0F1C 26100008 */ addiu $s0, $s0, 0x8
/* 1027A0 802E0F20 0200482D */ daddu $t1, $s0, $zero
/* 1027A4 802E0F24 26100008 */ addiu $s0, $s0, 0x8
/* 1027A8 802E0F28 0200502D */ daddu $t2, $s0, $zero
/* 1027AC 802E0F2C 26100008 */ addiu $s0, $s0, 0x8
/* 1027B0 802E0F30 0200582D */ daddu $t3, $s0, $zero
/* 1027B4 802E0F34 26100008 */ addiu $s0, $s0, 0x8
/* 1027B8 802E0F38 0220202D */ daddu $a0, $s1, $zero
/* 1027BC 802E0F3C 96650000 */ lhu $a1, 0x0($s3)
/* 1027C0 802E0F40 3C0DDA38 */ lui $t5, (0xDA380000 >> 16)
/* 1027C4 802E0F44 ACED0000 */ sw $t5, 0x0($a3)
/* 1027C8 802E0F48 8EA30000 */ lw $v1, 0x0($s5)
/* 1027CC 802E0F4C 30A2FFFF */ andi $v0, $a1, 0xFFFF
/* 1027D0 802E0F50 00021180 */ sll $v0, $v0, 6
/* 1027D4 802E0F54 00571021 */ addu $v0, $v0, $s7
/* 1027D8 802E0F58 00621821 */ addu $v1, $v1, $v0
/* 1027DC 802E0F5C ACE30004 */ sw $v1, 0x4($a3)
/* 1027E0 802E0F60 8FAD0098 */ lw $t5, 0x98($sp)
/* 1027E4 802E0F64 241E0040 */ addiu $fp, $zero, 0x40
/* 1027E8 802E0F68 AD0C0004 */ sw $t4, 0x4($t0)
/* 1027EC 802E0F6C AD0D0000 */ sw $t5, 0x0($t0)
/* 1027F0 802E0F70 8FAD009C */ lw $t5, 0x9C($sp)
/* 1027F4 802E0F74 3C020A00 */ lui $v0, %hi(D_0A0034E0_E94D70)
/* 1027F8 802E0F78 244234E0 */ addiu $v0, $v0, %lo(D_0A0034E0_E94D70)
/* 1027FC 802E0F7C ACCD0000 */ sw $t5, 0x0($a2)
/* 102800 802E0F80 8FAD00A0 */ lw $t5, 0xA0($sp)
/* 102804 802E0F84 24A50001 */ addiu $a1, $a1, 0x1
/* 102808 802E0F88 ACCD0004 */ sw $t5, 0x4($a2)
/* 10280C 802E0F8C 3C0DFA00 */ lui $t5, (0xFA000000 >> 16)
/* 102810 802E0F90 AD2D0000 */ sw $t5, 0x0($t1)
/* 102814 802E0F94 240D0080 */ addiu $t5, $zero, 0x80
/* 102818 802E0F98 AD2D0004 */ sw $t5, 0x4($t1)
/* 10281C 802E0F9C 3C0DDE00 */ lui $t5, (0xDE000000 >> 16)
/* 102820 802E0FA0 AD4D0000 */ sw $t5, 0x0($t2)
/* 102824 802E0FA4 AD420004 */ sw $v0, 0x4($t2)
/* 102828 802E0FA8 8FAD00A4 */ lw $t5, 0xA4($sp)
/* 10282C 802E0FAC 3C020A00 */ lui $v0, %hi(D_0A0034F0_E94D80)
/* 102830 802E0FB0 244234F0 */ addiu $v0, $v0, %lo(D_0A0034F0_E94D80)
/* 102834 802E0FB4 AD7E0004 */ sw $fp, 0x4($t3)
/* 102838 802E0FB8 AD6D0000 */ sw $t5, 0x0($t3)
/* 10283C 802E0FBC 8ED20044 */ lw $s2, 0x44($s6)
/* 102840 802E0FC0 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 102844 802E0FC4 A6650000 */ sh $a1, 0x0($s3)
/* 102848 802E0FC8 02542821 */ addu $a1, $s2, $s4
/* 10284C 802E0FCC 0C019D60 */ jal guMtxL2F
/* 102850 802E0FD0 02429021 */ addu $s2, $s2, $v0
/* 102854 802E0FD4 0200182D */ daddu $v1, $s0, $zero
/* 102858 802E0FD8 26100008 */ addiu $s0, $s0, 0x8
/* 10285C 802E0FDC 0220202D */ daddu $a0, $s1, $zero
/* 102860 802E0FE0 96650000 */ lhu $a1, 0x0($s3)
/* 102864 802E0FE4 C7A0008C */ lwc1 $f0, 0x8C($sp)
/* 102868 802E0FE8 8EA20000 */ lw $v0, 0x0($s5)
/* 10286C 802E0FEC 00052980 */ sll $a1, $a1, 6
/* 102870 802E0FF0 00B72821 */ addu $a1, $a1, $s7
/* 102874 802E0FF4 46140000 */ add.s $f0, $f0, $f20
/* 102878 802E0FF8 00452821 */ addu $a1, $v0, $a1
/* 10287C 802E0FFC 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 102880 802E1000 E7A0008C */ swc1 $f0, 0x8C($sp)
/* 102884 802E1004 AC620000 */ sw $v0, 0x0($v1)
/* 102888 802E1008 0C019D40 */ jal guMtxF2L
/* 10288C 802E100C AC600004 */ sw $zero, 0x4($v1)
/* 102890 802E1010 0200402D */ daddu $t0, $s0, $zero
/* 102894 802E1014 26100008 */ addiu $s0, $s0, 0x8
/* 102898 802E1018 0200482D */ daddu $t1, $s0, $zero
/* 10289C 802E101C 26100008 */ addiu $s0, $s0, 0x8
/* 1028A0 802E1020 3C0A0050 */ lui $t2, (0x5041D8 >> 16)
/* 1028A4 802E1024 0200202D */ daddu $a0, $s0, $zero
/* 1028A8 802E1028 26100008 */ addiu $s0, $s0, 0x8
/* 1028AC 802E102C 0200282D */ daddu $a1, $s0, $zero
/* 1028B0 802E1030 26100008 */ addiu $s0, $s0, 0x8
/* 1028B4 802E1034 0200302D */ daddu $a2, $s0, $zero
/* 1028B8 802E1038 26100008 */ addiu $s0, $s0, 0x8
/* 1028BC 802E103C 0200382D */ daddu $a3, $s0, $zero
/* 1028C0 802E1040 26100008 */ addiu $s0, $s0, 0x8
/* 1028C4 802E1044 96620000 */ lhu $v0, 0x0($s3)
/* 1028C8 802E1048 3C0DDA38 */ lui $t5, (0xDA380000 >> 16)
/* 1028CC 802E104C AD0D0000 */ sw $t5, 0x0($t0)
/* 1028D0 802E1050 3C01800A */ lui $at, %hi(gMainGfxPos)
/* 1028D4 802E1054 AC30A66C */ sw $s0, %lo(gMainGfxPos)($at)
/* 1028D8 802E1058 24430001 */ addiu $v1, $v0, 0x1
/* 1028DC 802E105C 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 1028E0 802E1060 00021180 */ sll $v0, $v0, 6
/* 1028E4 802E1064 A6630000 */ sh $v1, 0x0($s3)
/* 1028E8 802E1068 8EA30000 */ lw $v1, 0x0($s5)
/* 1028EC 802E106C 00571021 */ addu $v0, $v0, $s7
/* 1028F0 802E1070 00621821 */ addu $v1, $v1, $v0
/* 1028F4 802E1074 AD030004 */ sw $v1, 0x4($t0)
/* 1028F8 802E1078 8FAD0098 */ lw $t5, 0x98($sp)
/* 1028FC 802E107C 354A41D8 */ ori $t2, $t2, (0x5041D8 & 0xFFFF)
/* 102900 802E1080 AD2D0000 */ sw $t5, 0x0($t1)
/* 102904 802E1084 AD2A0004 */ sw $t2, 0x4($t1)
/* 102908 802E1088 8FAD009C */ lw $t5, 0x9C($sp)
/* 10290C 802E108C AC8D0000 */ sw $t5, 0x0($a0)
/* 102910 802E1090 8FAD00A0 */ lw $t5, 0xA0($sp)
/* 102914 802E1094 AC8D0004 */ sw $t5, 0x4($a0)
/* 102918 802E1098 3C0DFA00 */ lui $t5, (0xFA000000 >> 16)
/* 10291C 802E109C ACAD0000 */ sw $t5, 0x0($a1)
/* 102920 802E10A0 240D0080 */ addiu $t5, $zero, 0x80
/* 102924 802E10A4 ACAD0004 */ sw $t5, 0x4($a1)
/* 102928 802E10A8 3C0DDE00 */ lui $t5, (0xDE000000 >> 16)
/* 10292C 802E10AC ACCD0000 */ sw $t5, 0x0($a2)
/* 102930 802E10B0 ACD20004 */ sw $s2, 0x4($a2)
/* 102934 802E10B4 8FAD00A4 */ lw $t5, 0xA4($sp)
/* 102938 802E10B8 ACED0000 */ sw $t5, 0x0($a3)
/* 10293C 802E10BC ACFE0004 */ sw $fp, 0x4($a3)
/* 102940 802E10C0 8FBF00CC */ lw $ra, 0xCC($sp)
/* 102944 802E10C4 8FBE00C8 */ lw $fp, 0xC8($sp)
/* 102948 802E10C8 8FB700C4 */ lw $s7, 0xC4($sp)
/* 10294C 802E10CC 8FB600C0 */ lw $s6, 0xC0($sp)
/* 102950 802E10D0 8FB500BC */ lw $s5, 0xBC($sp)
/* 102954 802E10D4 8FB400B8 */ lw $s4, 0xB8($sp)
/* 102958 802E10D8 8FB300B4 */ lw $s3, 0xB4($sp)
/* 10295C 802E10DC 8FB200B0 */ lw $s2, 0xB0($sp)
/* 102960 802E10E0 8FB100AC */ lw $s1, 0xAC($sp)
/* 102964 802E10E4 8FB000A8 */ lw $s0, 0xA8($sp)
/* 102968 802E10E8 D7B400D0 */ ldc1 $f20, 0xD0($sp)
/* 10296C 802E10EC 03E00008 */ jr $ra
/* 102970 802E10F0 27BD00D8 */ addiu $sp, $sp, 0xD8
### DECOMPILED C INSTRUCTIONS:
void entity_SaveBlock_setupGfx(s32 index) {
Gfx* gfxPos = gMainGfxPos;
Entity* entity = get_entity_by_index(index);
SaveBlockData* blockData = entity->dataBuf.saveBlock;
Matrix4f sp18;
Matrix4f sp58;
Gfx* dlist;
guMtxL2F(sp18, ENTITY_ADDR(entity, Mtx*, &Entity_SaveBlock_Mtx));
sp18[3][1] += 12.5f;
guRotateF(sp58, blockData->angle, 0.0f, 1.0f, 0.0f);
guMtxCatF(sp58, sp18, sp58);
guMtxF2L(sp58, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetRenderMode(gfxPos++, G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2);
gDPSetCombineMode(gfxPos++, PM_CC_01, PM_CC_02);
gDPSetPrimColor(gfxPos++, 0, 0, 0, 0, 0, 128);
gSPDisplayList(gfxPos++, Entity_SaveBlock_RenderContent);
gSPPopMatrix(gfxPos++, G_MTX_MODELVIEW);
dlist = ENTITY_ADDR(entity, Gfx*, Entity_SaveBlock_RenderBlock);
guMtxL2F(sp58, ENTITY_ADDR(entity, Mtx*, &Entity_SaveBlock_Mtx));
sp58[3][1] += 12.5f;
gDPPipeSync(gfxPos++);
guMtxF2L(sp58, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetRenderMode(gfxPos++, G_RM_AA_XLU_SURF | Z_CMP, G_RM_AA_XLU_SURF2 | Z_CMP);
gDPSetCombineMode(gfxPos++, PM_CC_01, PM_CC_02);
gDPSetPrimColor(gfxPos++, 0, 0, 0, 0, 0, 128);
gSPDisplayList(gfxPos++, dlist);
gSPPopMatrix(gfxPos++, G_MTX_MODELVIEW);
gMainGfxPos = gfxPos;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel PutPartnerAway
/* F4338 802CF988 27BDFFB0 */ addiu $sp, $sp, -0x50
/* F433C 802CF98C AFB00010 */ sw $s0, 0x10($sp)
/* F4340 802CF990 00A0802D */ daddu $s0, $a1, $zero
/* F4344 802CF994 AFBF0018 */ sw $ra, 0x18($sp)
/* F4348 802CF998 AFB10014 */ sw $s1, 0x14($sp)
/* F434C 802CF99C F7BE0048 */ sdc1 $f30, 0x48($sp)
/* F4350 802CF9A0 F7BC0040 */ sdc1 $f28, 0x40($sp)
/* F4354 802CF9A4 F7BA0038 */ sdc1 $f26, 0x38($sp)
/* F4358 802CF9A8 F7B80030 */ sdc1 $f24, 0x30($sp)
/* F435C 802CF9AC F7B60028 */ sdc1 $f22, 0x28($sp)
/* F4360 802CF9B0 F7B40020 */ sdc1 $f20, 0x20($sp)
/* F4364 802CF9B4 0C00EABB */ jal get_npc_unsafe
/* F4368 802CF9B8 2404FFFC */ addiu $a0, $zero, -0x4
/* F436C 802CF9BC 3C048011 */ lui $a0, %hi(gPlayerStatus)
/* F4370 802CF9C0 2484EFC8 */ addiu $a0, $a0, %lo(gPlayerStatus)
/* F4374 802CF9C4 1200005F */ beqz $s0, .L802CFB44
/* F4378 802CF9C8 0040882D */ daddu $s1, $v0, $zero
/* F437C 802CF9CC 3C10802E */ lui $s0, %hi(wExtraPartnerID)
/* F4380 802CF9D0 2610AE40 */ addiu $s0, $s0, %lo(wExtraPartnerID)
/* F4384 802CF9D4 8E020000 */ lw $v0, 0x0($s0)
/* F4388 802CF9D8 1040009A */ beqz $v0, .L802CFC44
/* F438C 802CF9DC 2403FDFF */ addiu $v1, $zero, -0x201
/* F4390 802CF9E0 8E220000 */ lw $v0, 0x0($s1)
/* F4394 802CF9E4 C63A0038 */ lwc1 $f26, 0x38($s1)
/* F4398 802CF9E8 C63C003C */ lwc1 $f28, 0x3C($s1)
/* F439C 802CF9EC C6380040 */ lwc1 $f24, 0x40($s1)
/* F43A0 802CF9F0 00431024 */ and $v0, $v0, $v1
/* F43A4 802CF9F4 2403FFF7 */ addiu $v1, $zero, -0x9
/* F43A8 802CF9F8 00431024 */ and $v0, $v0, $v1
/* F43AC 802CF9FC AE220000 */ sw $v0, 0x0($s1)
/* F43B0 802CFA00 C4960028 */ lwc1 $f22, 0x28($a0)
/* F43B4 802CFA04 E6360060 */ swc1 $f22, 0x60($s1)
/* F43B8 802CFA08 948200B0 */ lhu $v0, 0xB0($a0)
/* F43BC 802CFA0C C482002C */ lwc1 $f2, 0x2C($a0)
/* F43C0 802CFA10 4406B000 */ mfc1 $a2, $f22
/* F43C4 802CFA14 00021400 */ sll $v0, $v0, 16
/* F43C8 802CFA18 00021C03 */ sra $v1, $v0, 16
/* F43CC 802CFA1C 000217C2 */ srl $v0, $v0, 31
/* F43D0 802CFA20 00621821 */ addu $v1, $v1, $v0
/* F43D4 802CFA24 00031843 */ sra $v1, $v1, 1
/* F43D8 802CFA28 44830000 */ mtc1 $v1, $f0
/* F43DC 802CFA2C 00000000 */ nop
/* F43E0 802CFA30 46800020 */ cvt.s.w $f0, $f0
/* F43E4 802CFA34 46001780 */ add.s $f30, $f2, $f0
/* F43E8 802CFA38 3C014080 */ lui $at, (0x40800000 >> 16)
/* F43EC 802CFA3C 44810000 */ mtc1 $at, $f0
/* F43F0 802CFA40 4600D306 */ mov.s $f12, $f26
/* F43F4 802CFA44 E63E0064 */ swc1 $f30, 0x64($s1)
/* F43F8 802CFA48 C4940030 */ lwc1 $f20, 0x30($a0)
/* F43FC 802CFA4C 3C014026 */ lui $at, (0x40266666 >> 16)
/* F4400 802CFA50 34216666 */ ori $at, $at, (0x40266666 & 0xFFFF)
/* F4404 802CFA54 44811000 */ mtc1 $at, $f2
/* F4408 802CFA58 4407A000 */ mfc1 $a3, $f20
/* F440C 802CFA5C 4600C386 */ mov.s $f14, $f24
/* F4410 802CFA60 E6200018 */ swc1 $f0, 0x18($s1)
/* F4414 802CFA64 E6220014 */ swc1 $f2, 0x14($s1)
/* F4418 802CFA68 0C00A7B5 */ jal dist2D
/* F441C 802CFA6C E6340068 */ swc1 $f20, 0x68($s1)
/* F4420 802CFA70 4600D306 */ mov.s $f12, $f26
/* F4424 802CFA74 4406B000 */ mfc1 $a2, $f22
/* F4428 802CFA78 4407A000 */ mfc1 $a3, $f20
/* F442C 802CFA7C 4600C386 */ mov.s $f14, $f24
/* F4430 802CFA80 0C00A720 */ jal atan2
/* F4434 802CFA84 E6200010 */ swc1 $f0, 0x10($s1)
/* F4438 802CFA88 C6220010 */ lwc1 $f2, 0x10($s1)
/* F443C 802CFA8C C6240018 */ lwc1 $f4, 0x18($s1)
/* F4440 802CFA90 E620000C */ swc1 $f0, 0xC($s1)
/* F4444 802CFA94 46041083 */ div.s $f2, $f2, $f4
/* F4448 802CFA98 4600118D */ trunc.w.s $f6, $f2
/* F444C 802CFA9C 44023000 */ mfc1 $v0, $f6
/* F4450 802CFAA0 00000000 */ nop
/* F4454 802CFAA4 A622008E */ sh $v0, 0x8E($s1)
/* F4458 802CFAA8 00021400 */ sll $v0, $v0, 16
/* F445C 802CFAAC 00021403 */ sra $v0, $v0, 16
/* F4460 802CFAB0 2842000A */ slti $v0, $v0, 0xA
/* F4464 802CFAB4 10400007 */ beqz $v0, .L802CFAD4
/* F4468 802CFAB8 2402000A */ addiu $v0, $zero, 0xA
/* F446C 802CFABC 3C014120 */ lui $at, (0x41200000 >> 16)
/* F4470 802CFAC0 44810000 */ mtc1 $at, $f0
/* F4474 802CFAC4 C6220010 */ lwc1 $f2, 0x10($s1)
/* F4478 802CFAC8 A622008E */ sh $v0, 0x8E($s1)
/* F447C 802CFACC 46001083 */ div.s $f2, $f2, $f0
/* F4480 802CFAD0 E6220018 */ swc1 $f2, 0x18($s1)
.L802CFAD4:
/* F4484 802CFAD4 8622008E */ lh $v0, 0x8E($s1)
/* F4488 802CFAD8 C6200014 */ lwc1 $f0, 0x14($s1)
/* F448C 802CFADC 44822000 */ mtc1 $v0, $f4
/* F4490 802CFAE0 00000000 */ nop
/* F4494 802CFAE4 46802120 */ cvt.s.w $f4, $f4
/* F4498 802CFAE8 46040002 */ mul.s $f0, $f0, $f4
/* F449C 802CFAEC 00000000 */ nop
/* F44A0 802CFAF0 46040002 */ mul.s $f0, $f0, $f4
/* F44A4 802CFAF4 00000000 */ nop
/* F44A8 802CFAF8 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* F44AC 802CFAFC 44811000 */ mtc1 $at, $f2
/* F44B0 802CFB00 00000000 */ nop
/* F44B4 802CFB04 46020002 */ mul.s $f0, $f0, $f2
/* F44B8 802CFB08 00000000 */ nop
/* F44BC 802CFB0C 8E030000 */ lw $v1, 0x0($s0)
/* F44C0 802CFB10 461CF701 */ sub.s $f28, $f30, $f28
/* F44C4 802CFB14 000310C0 */ sll $v0, $v1, 3
/* F44C8 802CFB18 4600E000 */ add.s $f0, $f28, $f0
/* F44CC 802CFB1C 00431021 */ addu $v0, $v0, $v1
/* F44D0 802CFB20 00021080 */ sll $v0, $v0, 2
/* F44D4 802CFB24 46040003 */ div.s $f0, $f0, $f4
/* F44D8 802CFB28 E620001C */ swc1 $f0, 0x1C($s1)
/* F44DC 802CFB2C 3C038010 */ lui $v1, %hi(gPartnerAnimations + 0x4)
/* F44E0 802CFB30 00621821 */ addu $v1, $v1, $v0
/* F44E4 802CFB34 8C63834C */ lw $v1, %lo(gPartnerAnimations + 0x4)($v1)
/* F44E8 802CFB38 0000102D */ daddu $v0, $zero, $zero
/* F44EC 802CFB3C 080B3F12 */ j .L802CFC48
/* F44F0 802CFB40 AE230028 */ sw $v1, 0x28($s1)
.L802CFB44:
/* F44F4 802CFB44 C620001C */ lwc1 $f0, 0x1C($s1)
/* F44F8 802CFB48 C6220014 */ lwc1 $f2, 0x14($s1)
/* F44FC 802CFB4C 46020001 */ sub.s $f0, $f0, $f2
/* F4500 802CFB50 C622003C */ lwc1 $f2, 0x3C($s1)
/* F4504 802CFB54 46001080 */ add.s $f2, $f2, $f0
/* F4508 802CFB58 4480A000 */ mtc1 $zero, $f20
/* F450C 802CFB5C 00000000 */ nop
/* F4510 802CFB60 4614003E */ c.le.s $f0, $f20
/* F4514 802CFB64 E620001C */ swc1 $f0, 0x1C($s1)
/* F4518 802CFB68 4500000A */ bc1f .L802CFB94
/* F451C 802CFB6C E622003C */ swc1 $f2, 0x3C($s1)
/* F4520 802CFB70 3C02802E */ lui $v0, %hi(wExtraPartnerID)
/* F4524 802CFB74 8C42AE40 */ lw $v0, %lo(wExtraPartnerID)($v0)
/* F4528 802CFB78 000218C0 */ sll $v1, $v0, 3
/* F452C 802CFB7C 00621821 */ addu $v1, $v1, $v0
/* F4530 802CFB80 00031880 */ sll $v1, $v1, 2
/* F4534 802CFB84 3C028010 */ lui $v0, %hi(gPartnerAnimations + 0x8)
/* F4538 802CFB88 00431021 */ addu $v0, $v0, $v1
/* F453C 802CFB8C 8C428350 */ lw $v0, %lo(gPartnerAnimations + 0x8)($v0)
/* F4540 802CFB90 AE220028 */ sw $v0, 0x28($s1)
.L802CFB94:
/* F4544 802CFB94 8E26000C */ lw $a2, 0xC($s1)
/* F4548 802CFB98 8E250018 */ lw $a1, 0x18($s1)
/* F454C 802CFB9C 0C00EA95 */ jal npc_move_heading
/* F4550 802CFBA0 0220202D */ daddu $a0, $s1, $zero
/* F4554 802CFBA4 8622008E */ lh $v0, 0x8E($s1)
/* F4558 802CFBA8 3C014120 */ lui $at, (0x41200000 >> 16)
/* F455C 802CFBAC 44811000 */ mtc1 $at, $f2
/* F4560 802CFBB0 44820000 */ mtc1 $v0, $f0
/* F4564 802CFBB4 00000000 */ nop
/* F4568 802CFBB8 46800020 */ cvt.s.w $f0, $f0
/* F456C 802CFBBC 4600103C */ c.lt.s $f2, $f0
/* F4570 802CFBC0 00000000 */ nop
/* F4574 802CFBC4 45030001 */ bc1tl .L802CFBCC
/* F4578 802CFBC8 46001006 */ mov.s $f0, $f2
.L802CFBCC:
/* F457C 802CFBCC 9622008E */ lhu $v0, 0x8E($s1)
/* F4580 802CFBD0 46020003 */ div.s $f0, $f0, $f2
/* F4584 802CFBD4 E6200054 */ swc1 $f0, 0x54($s1)
/* F4588 802CFBD8 46000086 */ mov.s $f2, $f0
/* F458C 802CFBDC E6200058 */ swc1 $f0, 0x58($s1)
/* F4590 802CFBE0 E622005C */ swc1 $f2, 0x5C($s1)
/* F4594 802CFBE4 2442FFFF */ addiu $v0, $v0, -0x1
/* F4598 802CFBE8 A622008E */ sh $v0, 0x8E($s1)
/* F459C 802CFBEC 00021400 */ sll $v0, $v0, 16
/* F45A0 802CFBF0 04410015 */ bgez $v0, .L802CFC48
/* F45A4 802CFBF4 0000102D */ daddu $v0, $zero, $zero
/* F45A8 802CFBF8 3C03802E */ lui $v1, %hi(wExtraPartnerID)
/* F45AC 802CFBFC 8C63AE40 */ lw $v1, %lo(wExtraPartnerID)($v1)
/* F45B0 802CFC00 3C04802E */ lui $a0, %hi(wExtraPartnerNpcID)
/* F45B4 802CFC04 8C84AE44 */ lw $a0, %lo(wExtraPartnerNpcID)($a0)
/* F45B8 802CFC08 C6200064 */ lwc1 $f0, 0x64($s1)
/* F45BC 802CFC0C 000310C0 */ sll $v0, $v1, 3
/* F45C0 802CFC10 00431021 */ addu $v0, $v0, $v1
/* F45C4 802CFC14 00021080 */ sll $v0, $v0, 2
/* F45C8 802CFC18 3C018010 */ lui $at, %hi(gPartnerAnimations + 0xC)
/* F45CC 802CFC1C 00220821 */ addu $at, $at, $v0
/* F45D0 802CFC20 8C228354 */ lw $v0, %lo(gPartnerAnimations + 0xC)($at)
/* F45D4 802CFC24 E634001C */ swc1 $f20, 0x1C($s1)
/* F45D8 802CFC28 E620003C */ swc1 $f0, 0x3C($s1)
/* F45DC 802CFC2C 0C00E228 */ jal free_npc_by_index
/* F45E0 802CFC30 AE220028 */ sw $v0, 0x28($s1)
/* F45E4 802CFC34 0C00EABB */ jal get_npc_unsafe
/* F45E8 802CFC38 2404FFFB */ addiu $a0, $zero, -0x5
/* F45EC 802CFC3C 2403FFFC */ addiu $v1, $zero, -0x4
/* F45F0 802CFC40 A04300A4 */ sb $v1, 0xA4($v0)
.L802CFC44:
/* F45F4 802CFC44 24020002 */ addiu $v0, $zero, 0x2
.L802CFC48:
/* F45F8 802CFC48 8FBF0018 */ lw $ra, 0x18($sp)
/* F45FC 802CFC4C 8FB10014 */ lw $s1, 0x14($sp)
/* F4600 802CFC50 8FB00010 */ lw $s0, 0x10($sp)
/* F4604 802CFC54 D7BE0048 */ ldc1 $f30, 0x48($sp)
/* F4608 802CFC58 D7BC0040 */ ldc1 $f28, 0x40($sp)
/* F460C 802CFC5C D7BA0038 */ ldc1 $f26, 0x38($sp)
/* F4610 802CFC60 D7B80030 */ ldc1 $f24, 0x30($sp)
/* F4614 802CFC64 D7B60028 */ ldc1 $f22, 0x28($sp)
/* F4618 802CFC68 D7B40020 */ ldc1 $f20, 0x20($sp)
/* F461C 802CFC6C 03E00008 */ jr $ra
/* F4620 802CFC70 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
ApiStatus PutPartnerAway(Evt* script, s32 isInitialCall) {
Npc* partner = get_npc_unsafe(NPC_PARTNER);
PlayerStatus* playerStatus = &gPlayerStatus;
f32 scale;
f32 targetX;
f32 targetY;
f32 targetZ;
f32 partnerX;
f32 partnerY;
f32 partnerZ;
if (isInitialCall) {
if (wExtraPartnerID != 0) {
partner->flags &= ~NPC_FLAG_GRAVITY;
partner->flags &= ~NPC_FLAG_8;
targetX = playerStatus->position.x;
partner->moveToPos.x = targetX;
partnerX = partner->pos.x;
targetY = playerStatus->position.y + (playerStatus->colliderHeight / 2);
partner->moveToPos.y = targetY;
partnerY = partner->pos.y;
targetZ = playerStatus->position.z;
partner->moveToPos.z = targetZ;
partnerZ = partner->pos.z;
partner->moveSpeed = 4.0f;
partner->jumpScale = 2.6f;
partner->planarFlyDist = dist2D(partnerX, partnerZ, targetX, targetZ);
partner->yaw = atan2(partnerX, partnerZ, targetX, targetZ);
partner->duration = partner->planarFlyDist / partner->moveSpeed;
if (partner->duration < 10) {
partner->duration = 10;
partner->moveSpeed = partner->planarFlyDist / partner->duration;
}
partnerY = targetY - partnerY;
partner->jumpVelocity = (partnerY + (partner->jumpScale * partner->duration * partner->duration * 0.5f)) / partner->duration;
partner->currentAnim = gPartnerAnimations[wExtraPartnerID].walk;
return ApiStatus_BLOCK;
} else {
return ApiStatus_DONE2;
}
}
partner->jumpVelocity -= partner->jumpScale;
partner->pos.y += partner->jumpVelocity;
if (partner->jumpVelocity <= 0.0f) {
partner->currentAnim = gPartnerAnimations[wExtraPartnerID].jump;
}
npc_move_heading(partner, partner->moveSpeed, partner->yaw);
scale = partner->duration;
if (scale > 10.0f) {
scale = 10.0f;
}
partner->scale.x = scale / 10.0f;
partner->scale.y = partner->scale.x;
partner->scale.z = partner->scale.x;
partner->duration--;
if (partner->duration < 0) {
partner->currentAnim = gPartnerAnimations[wExtraPartnerID].fall;
partner->jumpVelocity = 0.0f;
partner->pos.y = partner->moveToPos.y;
free_npc_by_index(wExtraPartnerNpcID);
get_npc_unsafe(-5)->npcID = NPC_PARTNER;
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel gather_energy_pink_update
/* 33B30C E002618C 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 33B310 E0026190 AFB1003C */ sw $s1, 0x3C($sp)
/* 33B314 E0026194 0080882D */ daddu $s1, $a0, $zero
/* 33B318 E0026198 AFBF0040 */ sw $ra, 0x40($sp)
/* 33B31C E002619C AFB00038 */ sw $s0, 0x38($sp)
/* 33B320 E00261A0 F7B40048 */ sdc1 $f20, 0x48($sp)
/* 33B324 E00261A4 8E30000C */ lw $s0, 0xC($s1)
/* 33B328 E00261A8 8E020028 */ lw $v0, 0x28($s0)
/* 33B32C E00261AC 2442FFFF */ addiu $v0, $v0, -0x1
/* 33B330 E00261B0 AE020028 */ sw $v0, 0x28($s0)
/* 33B334 E00261B4 8E02002C */ lw $v0, 0x2C($s0)
/* 33B338 E00261B8 8E030028 */ lw $v1, 0x28($s0)
/* 33B33C E00261BC 24440001 */ addiu $a0, $v0, 0x1
/* 33B340 E00261C0 04610005 */ bgez $v1, .LE00261D8
/* 33B344 E00261C4 AE04002C */ sw $a0, 0x2C($s0)
/* 33B348 E00261C8 0C080128 */ jal shim_remove_effect
/* 33B34C E00261CC 0220202D */ daddu $a0, $s1, $zero
/* 33B350 E00261D0 08009926 */ j .LE0026498
/* 33B354 E00261D4 00000000 */ nop
.LE00261D8:
/* 33B358 E00261D8 2882000B */ slti $v0, $a0, 0xB
/* 33B35C E00261DC 1040000B */ beqz $v0, .LE002620C
/* 33B360 E00261E0 0060282D */ daddu $a1, $v1, $zero
/* 33B364 E00261E4 3C036666 */ lui $v1, (0x66666667 >> 16)
/* 33B368 E00261E8 34636667 */ ori $v1, $v1, (0x66666667 & 0xFFFF)
/* 33B36C E00261EC 00041200 */ sll $v0, $a0, 8
/* 33B370 E00261F0 00441023 */ subu $v0, $v0, $a0
/* 33B374 E00261F4 00430018 */ mult $v0, $v1
/* 33B378 E00261F8 000217C3 */ sra $v0, $v0, 31
/* 33B37C E00261FC 00004010 */ mfhi $t0
/* 33B380 E0026200 00081883 */ sra $v1, $t0, 2
/* 33B384 E0026204 00621823 */ subu $v1, $v1, $v0
/* 33B388 E0026208 AE030024 */ sw $v1, 0x24($s0)
.LE002620C:
/* 33B38C E002620C 28A20006 */ slti $v0, $a1, 0x6
/* 33B390 E0026210 10400009 */ beqz $v0, .LE0026238
/* 33B394 E0026214 3C032AAA */ lui $v1, (0x2AAAAAAB >> 16)
/* 33B398 E0026218 3463AAAB */ ori $v1, $v1, (0x2AAAAAAB & 0xFFFF)
/* 33B39C E002621C 00051200 */ sll $v0, $a1, 8
/* 33B3A0 E0026220 00451023 */ subu $v0, $v0, $a1
/* 33B3A4 E0026224 00430018 */ mult $v0, $v1
/* 33B3A8 E0026228 000217C3 */ sra $v0, $v0, 31
/* 33B3AC E002622C 00004010 */ mfhi $t0
/* 33B3B0 E0026230 01021023 */ subu $v0, $t0, $v0
/* 33B3B4 E0026234 AE020024 */ sw $v0, 0x24($s0)
.LE0026238:
/* 33B3B8 E0026238 28A2000A */ slti $v0, $a1, 0xA
/* 33B3BC E002623C 1040000C */ beqz $v0, .LE0026270
/* 33B3C0 E0026240 00000000 */ nop
/* 33B3C4 E0026244 8E020000 */ lw $v0, 0x0($s0)
/* 33B3C8 E0026248 14400009 */ bnez $v0, .LE0026270
/* 33B3CC E002624C 00000000 */ nop
/* 33B3D0 E0026250 C600001C */ lwc1 $f0, 0x1C($s0)
/* 33B3D4 E0026254 3C01E002 */ lui $at, (0xE0026A28 >> 16)
/* 33B3D8 E0026258 D4226A28 */ ldc1 $f2, (0xE0026A28 & 0xFFFF)($at)
/* 33B3DC E002625C 46000021 */ cvt.d.s $f0, $f0
/* 33B3E0 E0026260 46220002 */ mul.d $f0, $f0, $f2
/* 33B3E4 E0026264 00000000 */ nop
/* 33B3E8 E0026268 46200020 */ cvt.s.d $f0, $f0
/* 33B3EC E002626C E600001C */ swc1 $f0, 0x1C($s0)
.LE0026270:
/* 33B3F0 E0026270 8E030000 */ lw $v1, 0x0($s0)
/* 33B3F4 E0026274 24020001 */ addiu $v0, $zero, 0x1
/* 33B3F8 E0026278 14620017 */ bne $v1, $v0, .LE00262D8
/* 33B3FC E002627C 00051080 */ sll $v0, $a1, 2
/* 33B400 E0026280 00451021 */ addu $v0, $v0, $a1
/* 33B404 E0026284 00021040 */ sll $v0, $v0, 1
/* 33B408 E0026288 44826000 */ mtc1 $v0, $f12
/* 33B40C E002628C 00000000 */ nop
/* 33B410 E0026290 0C080140 */ jal shim_sin_deg
/* 33B414 E0026294 46806320 */ cvt.s.w $f12, $f12
/* 33B418 E0026298 3C01E002 */ lui $at, (0xE0026A30 >> 16)
/* 33B41C E002629C D4226A30 */ ldc1 $f2, (0xE0026A30 & 0xFFFF)($at)
/* 33B420 E00262A0 46000021 */ cvt.d.s $f0, $f0
/* 33B424 E00262A4 46220002 */ mul.d $f0, $f0, $f2
/* 33B428 E00262A8 00000000 */ nop
/* 33B42C E00262AC C6020020 */ lwc1 $f2, 0x20($s0)
/* 33B430 E00262B0 460010A1 */ cvt.d.s $f2, $f2
/* 33B434 E00262B4 46220002 */ mul.d $f0, $f0, $f2
/* 33B438 E00262B8 00000000 */ nop
/* 33B43C E00262BC C604001C */ lwc1 $f4, 0x1C($s0)
/* 33B440 E00262C0 46201080 */ add.d $f2, $f2, $f0
/* 33B444 E00262C4 46002121 */ cvt.d.s $f4, $f4
/* 33B448 E00262C8 3C01E002 */ lui $at, (0xE0026A38 >> 16)
/* 33B44C E00262CC D4206A38 */ ldc1 $f0, (0xE0026A38 & 0xFFFF)($at)
/* 33B450 E00262D0 080098CB */ j .LE002632C
/* 33B454 E00262D4 46241081 */ sub.d $f2, $f2, $f4
.LE00262D8:
/* 33B458 E00262D8 00451021 */ addu $v0, $v0, $a1
/* 33B45C E00262DC 00021040 */ sll $v0, $v0, 1
/* 33B460 E00262E0 44826000 */ mtc1 $v0, $f12
/* 33B464 E00262E4 00000000 */ nop
/* 33B468 E00262E8 0C080140 */ jal shim_sin_deg
/* 33B46C E00262EC 46806320 */ cvt.s.w $f12, $f12
/* 33B470 E00262F0 3C01E002 */ lui $at, (0xE0026A40 >> 16)
/* 33B474 E00262F4 D4226A40 */ ldc1 $f2, (0xE0026A40 & 0xFFFF)($at)
/* 33B478 E00262F8 46000021 */ cvt.d.s $f0, $f0
/* 33B47C E00262FC 46220002 */ mul.d $f0, $f0, $f2
/* 33B480 E0026300 00000000 */ nop
/* 33B484 E0026304 C6020020 */ lwc1 $f2, 0x20($s0)
/* 33B488 E0026308 460010A1 */ cvt.d.s $f2, $f2
/* 33B48C E002630C 46220002 */ mul.d $f0, $f0, $f2
/* 33B490 E0026310 00000000 */ nop
/* 33B494 E0026314 C604001C */ lwc1 $f4, 0x1C($s0)
/* 33B498 E0026318 46201080 */ add.d $f2, $f2, $f0
/* 33B49C E002631C 46002121 */ cvt.d.s $f4, $f4
/* 33B4A0 E0026320 46241081 */ sub.d $f2, $f2, $f4
/* 33B4A4 E0026324 3C01E002 */ lui $at, (0xE0026A48 >> 16)
/* 33B4A8 E0026328 D4206A48 */ ldc1 $f0, (0xE0026A48 & 0xFFFF)($at)
.LE002632C:
/* 33B4AC E002632C 46201082 */ mul.d $f2, $f2, $f0
/* 33B4B0 E0026330 00000000 */ nop
/* 33B4B4 E0026334 46222100 */ add.d $f4, $f4, $f2
/* 33B4B8 E0026338 46202120 */ cvt.s.d $f4, $f4
/* 33B4BC E002633C E604001C */ swc1 $f4, 0x1C($s0)
/* 33B4C0 E0026340 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 33B4C4 E0026344 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 33B4C8 E0026348 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 33B4CC E002634C 4481A000 */ mtc1 $at, $f20
/* 33B4D0 E0026350 27A20028 */ addiu $v0, $sp, 0x28
/* 33B4D4 E0026354 AFA20014 */ sw $v0, 0x14($sp)
/* 33B4D8 E0026358 27A2002C */ addiu $v0, $sp, 0x2C
/* 33B4DC E002635C AFA20018 */ sw $v0, 0x18($sp)
/* 33B4E0 E0026360 27A20030 */ addiu $v0, $sp, 0x30
/* 33B4E4 E0026364 AFA2001C */ sw $v0, 0x1C($sp)
/* 33B4E8 E0026368 27A20034 */ addiu $v0, $sp, 0x34
/* 33B4EC E002636C AFA20020 */ sw $v0, 0x20($sp)
/* 33B4F0 E0026370 00032080 */ sll $a0, $v1, 2
/* 33B4F4 E0026374 00832021 */ addu $a0, $a0, $v1
/* 33B4F8 E0026378 00042080 */ sll $a0, $a0, 2
/* 33B4FC E002637C 00832023 */ subu $a0, $a0, $v1
/* 33B500 E0026380 000410C0 */ sll $v0, $a0, 3
/* 33B504 E0026384 00822021 */ addu $a0, $a0, $v0
/* 33B508 E0026388 000420C0 */ sll $a0, $a0, 3
/* 33B50C E002638C 3C02800B */ lui $v0, %hi(gCameras + 0xD4)
/* 33B510 E0026390 24421E54 */ addiu $v0, $v0, %lo(gCameras + 0xD4)
/* 33B514 E0026394 E7B40010 */ swc1 $f20, 0x10($sp)
/* 33B518 E0026398 8E050004 */ lw $a1, 0x4($s0)
/* 33B51C E002639C 8E060008 */ lw $a2, 0x8($s0)
/* 33B520 E00263A0 8E07000C */ lw $a3, 0xC($s0)
/* 33B524 E00263A4 0C080168 */ jal shim_transform_point
/* 33B528 E00263A8 00822021 */ addu $a0, $a0, $v0
/* 33B52C E00263AC C7A00034 */ lwc1 $f0, 0x34($sp)
/* 33B530 E00263B0 C7A40028 */ lwc1 $f4, 0x28($sp)
/* 33B534 E00263B4 4600A503 */ div.s $f20, $f20, $f0
/* 33B538 E00263B8 46142102 */ mul.s $f4, $f4, $f20
/* 33B53C E00263BC 00000000 */ nop
/* 33B540 E00263C0 C7A0002C */ lwc1 $f0, 0x2C($sp)
/* 33B544 E00263C4 46140002 */ mul.s $f0, $f0, $f20
/* 33B548 E00263C8 00000000 */ nop
/* 33B54C E00263CC C7A20030 */ lwc1 $f2, 0x30($sp)
/* 33B550 E00263D0 46141082 */ mul.s $f2, $f2, $f20
/* 33B554 E00263D4 00000000 */ nop
/* 33B558 E00263D8 AE000018 */ sw $zero, 0x18($s0)
/* 33B55C E00263DC E6040010 */ swc1 $f4, 0x10($s0)
/* 33B560 E00263E0 E6000014 */ swc1 $f0, 0x14($s0)
/* 33B564 E00263E4 8E220008 */ lw $v0, 0x8($s1)
/* 33B568 E00263E8 0000382D */ daddu $a3, $zero, $zero
/* 33B56C E00263EC E7B40034 */ swc1 $f20, 0x34($sp)
/* 33B570 E00263F0 E7A40028 */ swc1 $f4, 0x28($sp)
/* 33B574 E00263F4 E7A0002C */ swc1 $f0, 0x2C($sp)
/* 33B578 E00263F8 18400027 */ blez $v0, .LE0026498
/* 33B57C E00263FC E7A20030 */ swc1 $f2, 0x30($sp)
/* 33B580 E0026400 26060048 */ addiu $a2, $s0, 0x48
.LE0026404:
/* 33B584 E0026404 8CC2FFE8 */ lw $v0, -0x18($a2)
/* 33B588 E0026408 8CC3FFEC */ lw $v1, -0x14($a2)
/* 33B58C E002640C 8CC4FFF4 */ lw $a0, -0xC($a2)
/* 33B590 E0026410 8CC5FFFC */ lw $a1, -0x4($a2)
/* 33B594 E0026414 C4C40010 */ lwc1 $f4, 0x10($a2)
/* 33B598 E0026418 C4C00014 */ lwc1 $f0, 0x14($a2)
/* 33B59C E002641C C4C2000C */ lwc1 $f2, 0xC($a2)
/* 33B5A0 E0026420 00431021 */ addu $v0, $v0, $v1
/* 33B5A4 E0026424 8CC3FFF8 */ lw $v1, -0x8($a2)
/* 33B5A8 E0026428 46002100 */ add.s $f4, $f4, $f0
/* 33B5AC E002642C ACC2FFE8 */ sw $v0, -0x18($a2)
/* 33B5B0 E0026430 8CC2FFF0 */ lw $v0, -0x10($a2)
/* 33B5B4 E0026434 00651821 */ addu $v1, $v1, $a1
/* 33B5B8 E0026438 ACC3FFF8 */ sw $v1, -0x8($a2)
/* 33B5BC E002643C 8CC30000 */ lw $v1, 0x0($a2)
/* 33B5C0 E0026440 00441021 */ addu $v0, $v0, $a0
/* 33B5C4 E0026444 ACC2FFF0 */ sw $v0, -0x10($a2)
/* 33B5C8 E0026448 8CC20004 */ lw $v0, 0x4($a2)
/* 33B5CC E002644C C4C00008 */ lwc1 $f0, 0x8($a2)
/* 33B5D0 E0026450 00621821 */ addu $v1, $v1, $v0
/* 33B5D4 E0026454 8CC2FFF8 */ lw $v0, -0x8($a2)
/* 33B5D8 E0026458 46020000 */ add.s $f0, $f0, $f2
/* 33B5DC E002645C ACC30000 */ sw $v1, 0x0($a2)
/* 33B5E0 E0026460 E4C40010 */ swc1 $f4, 0x10($a2)
/* 33B5E4 E0026464 04410003 */ bgez $v0, .LE0026474
/* 33B5E8 E0026468 E4C00008 */ swc1 $f0, 0x8($a2)
/* 33B5EC E002646C 24420100 */ addiu $v0, $v0, 0x100
/* 33B5F0 E0026470 ACC2FFF8 */ sw $v0, -0x8($a2)
.LE0026474:
/* 33B5F4 E0026474 8CC20000 */ lw $v0, 0x0($a2)
/* 33B5F8 E0026478 04410003 */ bgez $v0, .LE0026488
/* 33B5FC E002647C 24E70001 */ addiu $a3, $a3, 0x1
/* 33B600 E0026480 24420100 */ addiu $v0, $v0, 0x100
/* 33B604 E0026484 ACC20000 */ sw $v0, 0x0($a2)
.LE0026488:
/* 33B608 E0026488 8E220008 */ lw $v0, 0x8($s1)
/* 33B60C E002648C 00E2102A */ slt $v0, $a3, $v0
/* 33B610 E0026490 1440FFDC */ bnez $v0, .LE0026404
/* 33B614 E0026494 24C60060 */ addiu $a2, $a2, 0x60
.LE0026498:
/* 33B618 E0026498 8FBF0040 */ lw $ra, 0x40($sp)
/* 33B61C E002649C 8FB1003C */ lw $s1, 0x3C($sp)
/* 33B620 E00264A0 8FB00038 */ lw $s0, 0x38($sp)
/* 33B624 E00264A4 D7B40048 */ ldc1 $f20, 0x48($sp)
/* 33B628 E00264A8 03E00008 */ jr $ra
/* 33B62C E00264AC 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
void gather_energy_pink_update(EffectInstance* effect) {
GatherEnergyPinkFXData* part = effect->data.gatherEnergyPink;
s32 unk_28;
s32 unk_2C;
f32 sp28;
f32 sp2C;
f32 sp30;
f32 sp34;
s32 i;
part->unk_28--;
part->unk_2C++;
if (part->unk_28 < 0) {
shim_remove_effect(effect);
return;
}
unk_28 = part->unk_28;
unk_2C = part->unk_2C;
if (unk_2C < 11) {
part->unk_24 = (unk_2C * 255) / 10;
}
if (unk_28 < 6) {
part->unk_24 = (unk_28 * 255) / 6;
}
if (unk_28 < 10 && part->unk_00 == 0) {
part->unk_1C *= 0.7;
}
if (part->unk_00 == 1) {
part->unk_1C += (part->unk_20 + shim_sin_deg(unk_28 * 10) * 0.1 * part->unk_20 - part->unk_1C) * 0.4;
} else {
part->unk_1C += (part->unk_20 + shim_sin_deg(unk_28 * 10) * 0.1 * part->unk_20 - part->unk_1C) * 0.3;
}
shim_transform_point(&gCameras[gCurrentCameraID].perspectiveMatrix[0], part->posA.x, part->posA.y, part->posA.z, 1.0f, &sp28, &sp2C, &sp30, &sp34);
sp34 = 1.0f / sp34;
sp28 *= sp34;
sp2C *= sp34;
sp30 *= sp34;
part->posB.x = sp28;
part->posB.y = sp2C;
part->posB.z = 0;
for (i = 0; i < effect->numParts; i++, part++) {
part->unk_30 += part->unk_34;
part->unk_38 += part->unk_3C;
part->unk_40 += part->unk_44;
part->unk_48 += part->unk_4C;
part->unk_58 += part->unk_5C;
part->unk_50 += part->unk_54;
if (part->unk_40 < 0) {
part->unk_40 += 256;
}
if (part->unk_48 < 0) {
part->unk_48 += 256;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel entity_base_block_update_slow_sinking
/* 104BF0 802E3370 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 104BF4 802E3374 AFB00010 */ sw $s0, 0x10($sp)
/* 104BF8 802E3378 0080802D */ daddu $s0, $a0, $zero
/* 104BFC 802E337C 3C058011 */ lui $a1, %hi(gPlayerStatus)
/* 104C00 802E3380 24A5EFC8 */ addiu $a1, $a1, %lo(gPlayerStatus)
/* 104C04 802E3384 AFB20018 */ sw $s2, 0x18($sp)
/* 104C08 802E3388 AFBF001C */ sw $ra, 0x1C($sp)
/* 104C0C 802E338C AFB10014 */ sw $s1, 0x14($sp)
/* 104C10 802E3390 9202000B */ lbu $v0, 0xB($s0)
/* 104C14 802E3394 8E110040 */ lw $s1, 0x40($s0)
/* 104C18 802E3398 2C4200FF */ sltiu $v0, $v0, 0xFF
/* 104C1C 802E339C 10400003 */ beqz $v0, .L802E33AC
/* 104C20 802E33A0 00A0902D */ daddu $s2, $a1, $zero
/* 104C24 802E33A4 080B8D29 */ j .L802E34A4
/* 104C28 802E33A8 3C03FFDF */ lui $v1, (0xFFDFFFFF >> 16)
.L802E33AC:
/* 104C2C 802E33AC 8624000E */ lh $a0, 0xE($s1)
/* 104C30 802E33B0 9623000E */ lhu $v1, 0xE($s1)
/* 104C34 802E33B4 30828000 */ andi $v0, $a0, 0x8000
/* 104C38 802E33B8 1440003F */ bnez $v0, .L802E34B8
/* 104C3C 802E33BC 28820096 */ slti $v0, $a0, 0x96
/* 104C40 802E33C0 1440009C */ bnez $v0, .L802E3634
/* 104C44 802E33C4 24620001 */ addiu $v0, $v1, 0x1
/* 104C48 802E33C8 C6220014 */ lwc1 $f2, 0x14($s1)
/* 104C4C 802E33CC 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 104C50 802E33D0 44810000 */ mtc1 $at, $f0
/* 104C54 802E33D4 00000000 */ nop
/* 104C58 802E33D8 46001001 */ sub.s $f0, $f2, $f0
/* 104C5C 802E33DC C604004C */ lwc1 $f4, 0x4C($s0)
/* 104C60 802E33E0 4600203C */ c.lt.s $f4, $f0
/* 104C64 802E33E4 00000000 */ nop
/* 104C68 802E33E8 4502000A */ bc1fl .L802E3414
/* 104C6C 802E33EC 46041081 */ sub.s $f2, $f2, $f4
/* 104C70 802E33F0 46022001 */ sub.s $f0, $f4, $f2
/* 104C74 802E33F4 3C014248 */ lui $at, (0x42480000 >> 16)
/* 104C78 802E33F8 44811000 */ mtc1 $at, $f2
/* 104C7C 802E33FC 00000000 */ nop
/* 104C80 802E3400 46020000 */ add.s $f0, $f0, $f2
/* 104C84 802E3404 3C013E00 */ lui $at, (0x3E000000 >> 16)
/* 104C88 802E3408 44811000 */ mtc1 $at, $f2
/* 104C8C 802E340C 080B8D08 */ j .L802E3420
/* 104C90 802E3410 00000000 */ nop
.L802E3414:
/* 104C94 802E3414 3C013E00 */ lui $at, (0x3E000000 >> 16)
/* 104C98 802E3418 44810000 */ mtc1 $at, $f0
/* 104C9C 802E341C 00000000 */ nop
.L802E3420:
/* 104CA0 802E3420 46001102 */ mul.s $f4, $f2, $f0
/* 104CA4 802E3424 00000000 */ nop
/* 104CA8 802E3428 3C01802F */ lui $at, %hi(D_802EB1F0)
/* 104CAC 802E342C D422B1F0 */ ldc1 $f2, %lo(D_802EB1F0)($at)
/* 104CB0 802E3430 46002021 */ cvt.d.s $f0, $f4
/* 104CB4 802E3434 4620103C */ c.lt.d $f2, $f0
/* 104CB8 802E3438 00000000 */ nop
/* 104CBC 802E343C 45000004 */ bc1f .L802E3450
/* 104CC0 802E3440 00000000 */ nop
/* 104CC4 802E3444 3C013F99 */ lui $at, (0x3F99999A >> 16)
/* 104CC8 802E3448 3421999A */ ori $at, $at, (0x3F99999A & 0xFFFF)
/* 104CCC 802E344C 44812000 */ mtc1 $at, $f4
.L802E3450:
/* 104CD0 802E3450 3C01802F */ lui $at, %hi(D_802EB1F8)
/* 104CD4 802E3454 D422B1F8 */ ldc1 $f2, %lo(D_802EB1F8)($at)
/* 104CD8 802E3458 46002021 */ cvt.d.s $f0, $f4
/* 104CDC 802E345C 4622003C */ c.lt.d $f0, $f2
/* 104CE0 802E3460 00000000 */ nop
/* 104CE4 802E3464 45000004 */ bc1f .L802E3478
/* 104CE8 802E3468 00000000 */ nop
/* 104CEC 802E346C 3C013E99 */ lui $at, (0x3E99999A >> 16)
/* 104CF0 802E3470 3421999A */ ori $at, $at, (0x3E99999A & 0xFFFF)
/* 104CF4 802E3474 44812000 */ mtc1 $at, $f4
.L802E3478:
/* 104CF8 802E3478 C600004C */ lwc1 $f0, 0x4C($s0)
/* 104CFC 802E347C 46040000 */ add.s $f0, $f0, $f4
/* 104D00 802E3480 E600004C */ swc1 $f0, 0x4C($s0)
/* 104D04 802E3484 C6220014 */ lwc1 $f2, 0x14($s1)
/* 104D08 802E3488 4600103C */ c.lt.s $f2, $f0
/* 104D0C 802E348C 00000000 */ nop
/* 104D10 802E3490 45000069 */ bc1f .L802E3638
/* 104D14 802E3494 3C03FFDF */ lui $v1, (0xFFDFFFFF >> 16)
/* 104D18 802E3498 2402FFFF */ addiu $v0, $zero, -0x1
/* 104D1C 802E349C E602004C */ swc1 $f2, 0x4C($s0)
/* 104D20 802E34A0 A622000E */ sh $v0, 0xE($s1)
.L802E34A4:
/* 104D24 802E34A4 8E020000 */ lw $v0, 0x0($s0)
/* 104D28 802E34A8 3463FFFF */ ori $v1, $v1, (0xFFDFFFFF & 0xFFFF)
/* 104D2C 802E34AC 00431024 */ and $v0, $v0, $v1
/* 104D30 802E34B0 080B8D8E */ j .L802E3638
/* 104D34 802E34B4 AE020000 */ sw $v0, 0x0($s0)
.L802E34B8:
/* 104D38 802E34B8 92020006 */ lbu $v0, 0x6($s0)
/* 104D3C 802E34BC 30420004 */ andi $v0, $v0, 0x4
/* 104D40 802E34C0 10400014 */ beqz $v0, .L802E3514
/* 104D44 802E34C4 00000000 */ nop
/* 104D48 802E34C8 8CA20000 */ lw $v0, 0x0($a1)
/* 104D4C 802E34CC 30420002 */ andi $v0, $v0, 0x2
/* 104D50 802E34D0 14400058 */ bnez $v0, .L802E3634
/* 104D54 802E34D4 24020001 */ addiu $v0, $zero, 0x1
/* 104D58 802E34D8 86040016 */ lh $a0, 0x16($s0)
/* 104D5C 802E34DC 0C044181 */ jal get_shadow_by_index
/* 104D60 802E34E0 00000000 */ nop
/* 104D64 802E34E4 10400017 */ beqz $v0, .L802E3544
/* 104D68 802E34E8 00000000 */ nop
/* 104D6C 802E34EC C600004C */ lwc1 $f0, 0x4C($s0)
/* 104D70 802E34F0 C4420014 */ lwc1 $f2, 0x14($v0)
/* 104D74 802E34F4 46020081 */ sub.s $f2, $f0, $f2
/* 104D78 802E34F8 864200B0 */ lh $v0, 0xB0($s2)
/* 104D7C 802E34FC 46020001 */ sub.s $f0, $f0, $f2
/* 104D80 802E3500 24420001 */ addiu $v0, $v0, 0x1
/* 104D84 802E3504 44821000 */ mtc1 $v0, $f2
/* 104D88 802E3508 00000000 */ nop
/* 104D8C 802E350C 080B8D4B */ j .L802E352C
/* 104D90 802E3510 468010A0 */ cvt.s.w $f2, $f2
.L802E3514:
/* 104D94 802E3514 0C044181 */ jal get_shadow_by_index
/* 104D98 802E3518 86040016 */ lh $a0, 0x16($s0)
/* 104D9C 802E351C 10400009 */ beqz $v0, .L802E3544
/* 104DA0 802E3520 00000000 */ nop
/* 104DA4 802E3524 C600004C */ lwc1 $f0, 0x4C($s0)
/* 104DA8 802E3528 C4420014 */ lwc1 $f2, 0x14($v0)
.L802E352C:
/* 104DAC 802E352C 4602003E */ c.le.s $f0, $f2
/* 104DB0 802E3530 00000000 */ nop
/* 104DB4 802E3534 45000003 */ bc1f .L802E3544
/* 104DB8 802E3538 24020001 */ addiu $v0, $zero, 0x1
/* 104DBC 802E353C E602004C */ swc1 $f2, 0x4C($s0)
/* 104DC0 802E3540 A622000E */ sh $v0, 0xE($s1)
.L802E3544:
/* 104DC4 802E3544 92020006 */ lbu $v0, 0x6($s0)
/* 104DC8 802E3548 30420004 */ andi $v0, $v0, 0x4
/* 104DCC 802E354C 14400039 */ bnez $v0, .L802E3634
/* 104DD0 802E3550 24020001 */ addiu $v0, $zero, 0x1
/* 104DD4 802E3554 C6220014 */ lwc1 $f2, 0x14($s1)
/* 104DD8 802E3558 3C0141C8 */ lui $at, (0x41C80000 >> 16)
/* 104DDC 802E355C 44810000 */ mtc1 $at, $f0
/* 104DE0 802E3560 00000000 */ nop
/* 104DE4 802E3564 46001001 */ sub.s $f0, $f2, $f0
/* 104DE8 802E3568 C604004C */ lwc1 $f4, 0x4C($s0)
/* 104DEC 802E356C 4600203C */ c.lt.s $f4, $f0
/* 104DF0 802E3570 00000000 */ nop
/* 104DF4 802E3574 4502000A */ bc1fl .L802E35A0
/* 104DF8 802E3578 46041081 */ sub.s $f2, $f2, $f4
/* 104DFC 802E357C 46022001 */ sub.s $f0, $f4, $f2
/* 104E00 802E3580 3C014248 */ lui $at, (0x42480000 >> 16)
/* 104E04 802E3584 44811000 */ mtc1 $at, $f2
/* 104E08 802E3588 00000000 */ nop
/* 104E0C 802E358C 46020000 */ add.s $f0, $f0, $f2
/* 104E10 802E3590 3C013E00 */ lui $at, (0x3E000000 >> 16)
/* 104E14 802E3594 44811000 */ mtc1 $at, $f2
/* 104E18 802E3598 080B8D6B */ j .L802E35AC
/* 104E1C 802E359C 00000000 */ nop
.L802E35A0:
/* 104E20 802E35A0 3C013E00 */ lui $at, (0x3E000000 >> 16)
/* 104E24 802E35A4 44810000 */ mtc1 $at, $f0
/* 104E28 802E35A8 00000000 */ nop
.L802E35AC:
/* 104E2C 802E35AC 46001102 */ mul.s $f4, $f2, $f0
/* 104E30 802E35B0 00000000 */ nop
/* 104E34 802E35B4 3C01802F */ lui $at, %hi(D_802EB200)
/* 104E38 802E35B8 D422B200 */ ldc1 $f2, %lo(D_802EB200)($at)
/* 104E3C 802E35BC 46002021 */ cvt.d.s $f0, $f4
/* 104E40 802E35C0 4620103C */ c.lt.d $f2, $f0
/* 104E44 802E35C4 00000000 */ nop
/* 104E48 802E35C8 45000004 */ bc1f .L802E35DC
/* 104E4C 802E35CC 00000000 */ nop
/* 104E50 802E35D0 3C013F99 */ lui $at, (0x3F99999A >> 16)
/* 104E54 802E35D4 3421999A */ ori $at, $at, (0x3F99999A & 0xFFFF)
/* 104E58 802E35D8 44812000 */ mtc1 $at, $f4
.L802E35DC:
/* 104E5C 802E35DC 3C01802F */ lui $at, %hi(D_802EB208)
/* 104E60 802E35E0 D422B208 */ ldc1 $f2, %lo(D_802EB208)($at)
/* 104E64 802E35E4 46002021 */ cvt.d.s $f0, $f4
/* 104E68 802E35E8 4622003C */ c.lt.d $f0, $f2
/* 104E6C 802E35EC 00000000 */ nop
/* 104E70 802E35F0 45000004 */ bc1f .L802E3604
/* 104E74 802E35F4 00000000 */ nop
/* 104E78 802E35F8 3C013E99 */ lui $at, (0x3E99999A >> 16)
/* 104E7C 802E35FC 3421999A */ ori $at, $at, (0x3E99999A & 0xFFFF)
/* 104E80 802E3600 44812000 */ mtc1 $at, $f4
.L802E3604:
/* 104E84 802E3604 C600004C */ lwc1 $f0, 0x4C($s0)
/* 104E88 802E3608 46040001 */ sub.s $f0, $f0, $f4
/* 104E8C 802E360C 3C014248 */ lui $at, (0x42480000 >> 16)
/* 104E90 802E3610 44811000 */ mtc1 $at, $f2
/* 104E94 802E3614 E600004C */ swc1 $f0, 0x4C($s0)
/* 104E98 802E3618 C6240014 */ lwc1 $f4, 0x14($s1)
/* 104E9C 802E361C 46022101 */ sub.s $f4, $f4, $f2
/* 104EA0 802E3620 4604003C */ c.lt.s $f0, $f4
/* 104EA4 802E3624 00000000 */ nop
/* 104EA8 802E3628 45000003 */ bc1f .L802E3638
/* 104EAC 802E362C 24020001 */ addiu $v0, $zero, 0x1
/* 104EB0 802E3630 E604004C */ swc1 $f4, 0x4C($s0)
.L802E3634:
/* 104EB4 802E3634 A622000E */ sh $v0, 0xE($s1)
.L802E3638:
/* 104EB8 802E3638 8FBF001C */ lw $ra, 0x1C($sp)
/* 104EBC 802E363C 8FB20018 */ lw $s2, 0x18($sp)
/* 104EC0 802E3640 8FB10014 */ lw $s1, 0x14($sp)
/* 104EC4 802E3644 8FB00010 */ lw $s0, 0x10($sp)
/* 104EC8 802E3648 03E00008 */ jr $ra
/* 104ECC 802E364C 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void entity_base_block_update_slow_sinking(Entity* entity) {
PlayerStatus* playerStatus = &gPlayerStatus;
BlockData* data = entity->dataBuf.block;
f32 deltaY;
if (entity->alpha < 255) {
entity->flags &= ~ENTITY_FLAG_200000;
return;
}
if (!(data->sinkingTimer & 0x8000)) {
if (data->sinkingTimer < 150) {
data->sinkingTimer++;
return;
}
if (entity->position.y < data->initialY - 25.0f) {
deltaY = (entity->position.y - data->initialY + 50.0f) * 0.125f;
} else {
deltaY = (data->initialY - entity->position.y) * 0.125f;
}
if (deltaY > 1.2) {
deltaY = 1.2f;
}
if (deltaY < 0.3) {
deltaY = 0.3f;
}
entity->position.y += deltaY;
if (data->initialY < entity->position.y) {
entity->position.y = data->initialY;
data->sinkingTimer = -1;
entity->flags &= ~ENTITY_FLAG_200000;
}
} else {
if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_CEILING) {
if (!(playerStatus->flags & PS_FLAG_JUMPING)) {
Shadow* shadow = get_shadow_by_index(entity->shadowIndex);
if (shadow != NULL) {
f32 temp2 = entity->position.y - shadow->position.y;
if (entity->position.y - temp2 <= playerStatus->colliderHeight + 1) {
entity->position.y = playerStatus->colliderHeight + 1;
data->sinkingTimer = 1;
}
}
} else {
data->sinkingTimer = 1;
return;
}
do {} while (0); // needed to match
} else {
Shadow* shadow = get_shadow_by_index(entity->shadowIndex);
if (shadow != NULL) {
if (entity->position.y <= shadow->position.y) {
entity->position.y = shadow->position.y;
data->sinkingTimer = 1;
}
}
}
if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_CEILING) {
data->sinkingTimer = 1;
return;
}
if (entity->position.y < data->initialY - 25.0f) {
deltaY = (entity->position.y - data->initialY + 50.0f) * 0.125f;
} else {
deltaY = (data->initialY - entity->position.y) * 0.125f;
}
if (deltaY > 1.2) {
deltaY = 1.2f;
}
if (deltaY < 0.3) {
deltaY = 0.3f;
}
entity->position.y -= deltaY;
if (entity->position.y < data->initialY - 50.0f) {
entity->position.y = data->initialY - 50.0f;
data->sinkingTimer = 1;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel lil_oink_appendGfx
/* 3FEE68 E0114388 27BDFF70 */ addiu $sp, $sp, -0x90
/* 3FEE6C E011438C 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 3FEE70 E0114390 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3FEE74 E0114394 3C08DC08 */ lui $t0, (0xDC08000A >> 16)
/* 3FEE78 E0114398 3508000A */ ori $t0, $t0, (0xDC08000A & 0xFFFF)
/* 3FEE7C E011439C 3C09DC08 */ lui $t1, (0xDC08030A >> 16)
/* 3FEE80 E01143A0 3529030A */ ori $t1, $t1, (0xDC08030A & 0xFFFF)
/* 3FEE84 E01143A4 AFB3006C */ sw $s3, 0x6C($sp)
/* 3FEE88 E01143A8 0000982D */ daddu $s3, $zero, $zero
/* 3FEE8C E01143AC 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 3FEE90 E01143B0 2442A674 */ addiu $v0, $v0, %lo(gDisplayContext)
/* 3FEE94 E01143B4 AFBE0080 */ sw $fp, 0x80($sp)
/* 3FEE98 E01143B8 0040F02D */ daddu $fp, $v0, $zero
/* 3FEE9C E01143BC AFB7007C */ sw $s7, 0x7C($sp)
/* 3FEEA0 E01143C0 3C178007 */ lui $s7, %hi(gMatrixListPos)
/* 3FEEA4 E01143C4 26F741F0 */ addiu $s7, $s7, %lo(gMatrixListPos)
/* 3FEEA8 E01143C8 AFB60078 */ sw $s6, 0x78($sp)
/* 3FEEAC E01143CC 3C160001 */ lui $s6, (0x11630 >> 16)
/* 3FEEB0 E01143D0 36D61630 */ ori $s6, $s6, (0x11630 & 0xFFFF)
/* 3FEEB4 E01143D4 3C02800A */ lui $v0, %hi(gMainGfxPos)
/* 3FEEB8 E01143D8 2442A66C */ addiu $v0, $v0, %lo(gMainGfxPos)
/* 3FEEBC E01143DC AFB20068 */ sw $s2, 0x68($sp)
/* 3FEEC0 E01143E0 0040902D */ daddu $s2, $v0, $zero
/* 3FEEC4 E01143E4 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3FEEC8 E01143E8 AFBF0084 */ sw $ra, 0x84($sp)
/* 3FEECC E01143EC AFB50074 */ sw $s5, 0x74($sp)
/* 3FEED0 E01143F0 AFB40070 */ sw $s4, 0x70($sp)
/* 3FEED4 E01143F4 AFB10064 */ sw $s1, 0x64($sp)
/* 3FEED8 E01143F8 AFB00060 */ sw $s0, 0x60($sp)
/* 3FEEDC E01143FC F7B40088 */ sdc1 $f20, 0x88($sp)
/* 3FEEE0 E0114400 8E430000 */ lw $v1, 0x0($s2)
/* 3FEEE4 E0114404 4480A000 */ mtc1 $zero, $f20
/* 3FEEE8 E0114408 8C95000C */ lw $s5, 0xC($a0)
/* 3FEEEC E011440C 0060282D */ daddu $a1, $v1, $zero
/* 3FEEF0 E0114410 24630008 */ addiu $v1, $v1, 0x8
/* 3FEEF4 E0114414 AE430000 */ sw $v1, 0x0($s2)
/* 3FEEF8 E0114418 8EA60004 */ lw $a2, 0x4($s5)
/* 3FEEFC E011441C 02A0882D */ daddu $s1, $s5, $zero
/* 3FEF00 E0114420 ACA20000 */ sw $v0, 0x0($a1)
/* 3FEF04 E0114424 24620008 */ addiu $v0, $v1, 0x8
/* 3FEF08 E0114428 ACA00004 */ sw $zero, 0x4($a1)
/* 3FEF0C E011442C AE420000 */ sw $v0, 0x0($s2)
/* 3FEF10 E0114430 24620010 */ addiu $v0, $v1, 0x10
/* 3FEF14 E0114434 AC670000 */ sw $a3, 0x0($v1)
/* 3FEF18 E0114438 AE420000 */ sw $v0, 0x0($s2)
/* 3FEF1C E011443C 24620018 */ addiu $v0, $v1, 0x18
/* 3FEF20 E0114440 AE420000 */ sw $v0, 0x0($s2)
/* 3FEF24 E0114444 24620020 */ addiu $v0, $v1, 0x20
/* 3FEF28 E0114448 AE420000 */ sw $v0, 0x0($s2)
/* 3FEF2C E011444C 8C840010 */ lw $a0, 0x10($a0)
/* 3FEF30 E0114450 00061100 */ sll $v0, $a2, 4
/* 3FEF34 E0114454 00461023 */ subu $v0, $v0, $a2
/* 3FEF38 E0114458 0002A040 */ sll $s4, $v0, 1
/* 3FEF3C E011445C 8C85001C */ lw $a1, 0x1C($a0)
/* 3FEF40 E0114460 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3FEF44 E0114464 AC620008 */ sw $v0, 0x8($v1)
/* 3FEF48 E0114468 8FC40000 */ lw $a0, 0x0($fp)
/* 3FEF4C E011446C 3C020900 */ lui $v0, %hi(D_09002D70_410000)
/* 3FEF50 E0114470 24422D70 */ addiu $v0, $v0, %lo(D_09002D70_410000)
/* 3FEF54 E0114474 AC62000C */ sw $v0, 0xC($v1)
/* 3FEF58 E0114478 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 3FEF5C E011447C AC680010 */ sw $t0, 0x10($v1)
/* 3FEF60 E0114480 AC690018 */ sw $t1, 0x18($v1)
/* 3FEF64 E0114484 AC640014 */ sw $a0, 0x14($v1)
/* 3FEF68 E0114488 24840010 */ addiu $a0, $a0, 0x10
/* 3FEF6C E011448C 00A22821 */ addu $a1, $a1, $v0
/* 3FEF70 E0114490 AC64001C */ sw $a0, 0x1C($v1)
/* 3FEF74 E0114494 AC650004 */ sw $a1, 0x4($v1)
.LE0114498:
/* 3FEF78 E0114498 8E220008 */ lw $v0, 0x8($s1)
/* 3FEF7C E011449C 30420001 */ andi $v0, $v0, 0x1
/* 3FEF80 E01144A0 1040006D */ beqz $v0, .LE0114658
/* 3FEF84 E01144A4 27A40020 */ addiu $a0, $sp, 0x20
/* 3FEF88 E01144A8 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3FEF8C E01144AC 44810000 */ mtc1 $at, $f0
/* 3FEF90 E01144B0 C62400B8 */ lwc1 $f4, 0xB8($s1)
/* 3FEF94 E01144B4 E7A00010 */ swc1 $f0, 0x10($sp)
/* 3FEF98 E01144B8 C6200034 */ lwc1 $f0, 0x34($s1)
/* 3FEF9C E01144BC E7A00014 */ swc1 $f0, 0x14($sp)
/* 3FEFA0 E01144C0 C6200060 */ lwc1 $f0, 0x60($s1)
/* 3FEFA4 E01144C4 C6220110 */ lwc1 $f2, 0x110($s1)
/* 3FEFA8 E01144C8 4405A000 */ mfc1 $a1, $f20
/* 3FEFAC E01144CC 46020000 */ add.s $f0, $f0, $f2
/* 3FEFB0 E01144D0 3C014334 */ lui $at, (0x43340000 >> 16)
/* 3FEFB4 E01144D4 44811000 */ mtc1 $at, $f2
/* 3FEFB8 E01144D8 4407A000 */ mfc1 $a3, $f20
/* 3FEFBC E01144DC 46041081 */ sub.s $f2, $f2, $f4
/* 3FEFC0 E01144E0 E7A00018 */ swc1 $f0, 0x18($sp)
/* 3FEFC4 E01144E4 C620008C */ lwc1 $f0, 0x8C($s1)
/* 3FEFC8 E01144E8 44061000 */ mfc1 $a2, $f2
/* 3FEFCC E01144EC 0C080180 */ jal shim_guPositionF
/* 3FEFD0 E01144F0 E7A0001C */ swc1 $f0, 0x1C($sp)
/* 3FEFD4 E01144F4 27A40020 */ addiu $a0, $sp, 0x20
/* 3FEFD8 E01144F8 96E50000 */ lhu $a1, 0x0($s7)
/* 3FEFDC E01144FC 8FC20000 */ lw $v0, 0x0($fp)
/* 3FEFE0 E0114500 00052980 */ sll $a1, $a1, 6
/* 3FEFE4 E0114504 00B62821 */ addu $a1, $a1, $s6
/* 3FEFE8 E0114508 0C080118 */ jal shim_guMtxF2L
/* 3FEFEC E011450C 00452821 */ addu $a1, $v0, $a1
/* 3FEFF0 E0114510 3C02DA38 */ lui $v0, (0xDA380002 >> 16)
/* 3FEFF4 E0114514 34420002 */ ori $v0, $v0, (0xDA380002 & 0xFFFF)
/* 3FEFF8 E0114518 02B38021 */ addu $s0, $s5, $s3
/* 3FEFFC E011451C 8E440000 */ lw $a0, 0x0($s2)
/* 3FF000 E0114520 96E30000 */ lhu $v1, 0x0($s7)
/* 3FF004 E0114524 0080282D */ daddu $a1, $a0, $zero
/* 3FF008 E0114528 24840008 */ addiu $a0, $a0, 0x8
/* 3FF00C E011452C AE440000 */ sw $a0, 0x0($s2)
/* 3FF010 E0114530 ACA20000 */ sw $v0, 0x0($a1)
/* 3FF014 E0114534 24620001 */ addiu $v0, $v1, 0x1
/* 3FF018 E0114538 3063FFFF */ andi $v1, $v1, 0xFFFF
/* 3FF01C E011453C 00031980 */ sll $v1, $v1, 6
/* 3FF020 E0114540 A6E20000 */ sh $v0, 0x0($s7)
/* 3FF024 E0114544 8FC20000 */ lw $v0, 0x0($fp)
/* 3FF028 E0114548 00761821 */ addu $v1, $v1, $s6
/* 3FF02C E011454C 00431021 */ addu $v0, $v0, $v1
/* 3FF030 E0114550 ACA20004 */ sw $v0, 0x4($a1)
/* 3FF034 E0114554 24820008 */ addiu $v0, $a0, 0x8
/* 3FF038 E0114558 3C0ADE00 */ lui $t2, (0xDE000000 >> 16)
/* 3FF03C E011455C AE420000 */ sw $v0, 0x0($s2)
/* 3FF040 E0114560 AC8A0000 */ sw $t2, 0x0($a0)
/* 3FF044 E0114564 920200E4 */ lbu $v0, 0xE4($s0)
/* 3FF048 E0114568 3C0AE011 */ lui $t2, %hi(D_E0114718)
/* 3FF04C E011456C 254A4718 */ addiu $t2, $t2, %lo(D_E0114718)
/* 3FF050 E0114570 00021080 */ sll $v0, $v0, 2
/* 3FF054 E0114574 004A1021 */ addu $v0, $v0, $t2
/* 3FF058 E0114578 8C420000 */ lw $v0, 0x0($v0)
/* 3FF05C E011457C AC820004 */ sw $v0, 0x4($a0)
/* 3FF060 E0114580 920200E4 */ lbu $v0, 0xE4($s0)
/* 3FF064 E0114584 2442FFF8 */ addiu $v0, $v0, -0x8
/* 3FF068 E0114588 2C420002 */ sltiu $v0, $v0, 0x2
/* 3FF06C E011458C 1040001B */ beqz $v0, .LE01145FC
/* 3FF070 E0114590 3C07D838 */ lui $a3, (0xD8380002 >> 16)
/* 3FF074 E0114594 44946000 */ mtc1 $s4, $f12
/* 3FF078 E0114598 00000000 */ nop
/* 3FF07C E011459C 0C080140 */ jal shim_sin_deg
/* 3FF080 E01145A0 46806320 */ cvt.s.w $f12, $f12
/* 3FF084 E01145A4 3C01427C */ lui $at, (0x427C0000 >> 16)
/* 3FF088 E01145A8 44811000 */ mtc1 $at, $f2
/* 3FF08C E01145AC 8E420000 */ lw $v0, 0x0($s2)
/* 3FF090 E01145B0 46020002 */ mul.s $f0, $f0, $f2
/* 3FF094 E01145B4 00000000 */ nop
/* 3FF098 E01145B8 0040282D */ daddu $a1, $v0, $zero
/* 3FF09C E01145BC 24420008 */ addiu $v0, $v0, 0x8
/* 3FF0A0 E01145C0 AE420000 */ sw $v0, 0x0($s2)
/* 3FF0A4 E01145C4 46020000 */ add.s $f0, $f0, $f2
/* 3FF0A8 E01145C8 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 3FF0AC E01145CC ACA20000 */ sw $v0, 0x0($a1)
/* 3FF0B0 E01145D0 4600018D */ trunc.w.s $f6, $f0
/* 3FF0B4 E01145D4 44023000 */ mfc1 $v0, $f6
/* 3FF0B8 E01145D8 00000000 */ nop
/* 3FF0BC E01145DC 304200FF */ andi $v0, $v0, 0xFF
/* 3FF0C0 E01145E0 00022600 */ sll $a0, $v0, 24
/* 3FF0C4 E01145E4 00021C00 */ sll $v1, $v0, 16
/* 3FF0C8 E01145E8 00832025 */ or $a0, $a0, $v1
/* 3FF0CC E01145EC 00021200 */ sll $v0, $v0, 8
/* 3FF0D0 E01145F0 00822025 */ or $a0, $a0, $v0
/* 3FF0D4 E01145F4 ACA40004 */ sw $a0, 0x4($a1)
/* 3FF0D8 E01145F8 3C07D838 */ lui $a3, (0xD8380002 >> 16)
.LE01145FC:
/* 3FF0DC E01145FC 8E440000 */ lw $a0, 0x0($s2)
/* 3FF0E0 E0114600 34E70002 */ ori $a3, $a3, (0xD8380002 & 0xFFFF)
/* 3FF0E4 E0114604 0080302D */ daddu $a2, $a0, $zero
/* 3FF0E8 E0114608 24840008 */ addiu $a0, $a0, 0x8
/* 3FF0EC E011460C 3C0ADE00 */ lui $t2, (0xDE000000 >> 16)
/* 3FF0F0 E0114610 AE440000 */ sw $a0, 0x0($s2)
/* 3FF0F4 E0114614 ACCA0000 */ sw $t2, 0x0($a2)
/* 3FF0F8 E0114618 3C0AE011 */ lui $t2, %hi(D_E01146A0)
/* 3FF0FC E011461C 254A46A0 */ addiu $t2, $t2, %lo(D_E01146A0)
/* 3FF100 E0114620 920500E4 */ lbu $a1, 0xE4($s0)
/* 3FF104 E0114624 92030105 */ lbu $v1, 0x105($s0)
/* 3FF108 E0114628 00051040 */ sll $v0, $a1, 1
/* 3FF10C E011462C 00451021 */ addu $v0, $v0, $a1
/* 3FF110 E0114630 00431021 */ addu $v0, $v0, $v1
/* 3FF114 E0114634 00021080 */ sll $v0, $v0, 2
/* 3FF118 E0114638 004A1021 */ addu $v0, $v0, $t2
/* 3FF11C E011463C 8C430000 */ lw $v1, 0x0($v0)
/* 3FF120 E0114640 24820008 */ addiu $v0, $a0, 0x8
/* 3FF124 E0114644 AE420000 */ sw $v0, 0x0($s2)
/* 3FF128 E0114648 24020040 */ addiu $v0, $zero, 0x40
/* 3FF12C E011464C ACC30004 */ sw $v1, 0x4($a2)
/* 3FF130 E0114650 AC870000 */ sw $a3, 0x0($a0)
/* 3FF134 E0114654 AC820004 */ sw $v0, 0x4($a0)
.LE0114658:
/* 3FF138 E0114658 26940014 */ addiu $s4, $s4, 0x14
/* 3FF13C E011465C 26730001 */ addiu $s3, $s3, 0x1
/* 3FF140 E0114660 2A62000B */ slti $v0, $s3, 0xB
/* 3FF144 E0114664 1440FF8C */ bnez $v0, .LE0114498
/* 3FF148 E0114668 26310004 */ addiu $s1, $s1, 0x4
/* 3FF14C E011466C 8FBF0084 */ lw $ra, 0x84($sp)
/* 3FF150 E0114670 8FBE0080 */ lw $fp, 0x80($sp)
/* 3FF154 E0114674 8FB7007C */ lw $s7, 0x7C($sp)
/* 3FF158 E0114678 8FB60078 */ lw $s6, 0x78($sp)
/* 3FF15C E011467C 8FB50074 */ lw $s5, 0x74($sp)
/* 3FF160 E0114680 8FB40070 */ lw $s4, 0x70($sp)
/* 3FF164 E0114684 8FB3006C */ lw $s3, 0x6C($sp)
/* 3FF168 E0114688 8FB20068 */ lw $s2, 0x68($sp)
/* 3FF16C E011468C 8FB10064 */ lw $s1, 0x64($sp)
/* 3FF170 E0114690 8FB00060 */ lw $s0, 0x60($sp)
/* 3FF174 E0114694 D7B40088 */ ldc1 $f20, 0x88($sp)
/* 3FF178 E0114698 03E00008 */ jr $ra
/* 3FF17C E011469C 27BD0090 */ addiu $sp, $sp, 0x90
### DECOMPILED C INSTRUCTIONS:
void lil_oink_appendGfx(void* effect) {
Matrix4f mtxTransform;
EffectInstance* eff = effect;
LilOinkFXData* data = eff->data.lilOink;
s32 angle = data->lifetime * 30;
s32 i;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x9, VIRTUAL_TO_PHYSICAL(eff->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09002D70_401FC0);
gSPLookAt(gMainGfxPos++, &gDisplayContext->lookAt);
for (i = 0; i < MAX_LIL_OINKS; i++) {
if (data->flags[i] & LIL_OINK_FLAG_VISIBLE) {
shim_guPositionF(mtxTransform, 0.0f, 180.0f - data->rot[i], 0.0f, 1.0f,
data->x[i], data->y[i] + data->jumpOffset[i], data->z[i]);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E0114718[data->type[i]]);
if (data->type[i] == LIL_OINK_TYPE_SILVER || data->type[i] == LIL_OINK_TYPE_GOLD) {
f32 shineVariation = shim_sin_deg(angle) * 63.0f;
s8 primColor = shineVariation + 63.0f;
gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 0);
}
gSPDisplayList(gMainGfxPos++, lil_oink_FramesGfx[data->type[i]][data->gfxFrame[i]]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
angle += 20;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel windy_leaves_main
/* 35DA00 E0056000 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 35DA04 E0056004 F7B40048 */ sdc1 $f20, 0x48($sp)
/* 35DA08 E0056008 4485A000 */ mtc1 $a1, $f20
/* 35DA0C E005600C AFB5003C */ sw $s5, 0x3C($sp)
/* 35DA10 E0056010 0080A82D */ daddu $s5, $a0, $zero
/* 35DA14 E0056014 F7B60050 */ sdc1 $f22, 0x50($sp)
/* 35DA18 E0056018 4486B000 */ mtc1 $a2, $f22
/* 35DA1C E005601C 27A40010 */ addiu $a0, $sp, 0x10
/* 35DA20 E0056020 F7B80058 */ sdc1 $f24, 0x58($sp)
/* 35DA24 E0056024 4487C000 */ mtc1 $a3, $f24
/* 35DA28 E0056028 3C02E005 */ lui $v0, %hi(windy_leaves_init)
/* 35DA2C E005602C 24426304 */ addiu $v0, $v0, %lo(windy_leaves_init)
/* 35DA30 E0056030 AFA20018 */ sw $v0, 0x18($sp)
/* 35DA34 E0056034 3C02E005 */ lui $v0, %hi(windy_leaves_update)
/* 35DA38 E0056038 2442630C */ addiu $v0, $v0, %lo(windy_leaves_update)
/* 35DA3C E005603C AFA2001C */ sw $v0, 0x1C($sp)
/* 35DA40 E0056040 3C02E005 */ lui $v0, %hi(windy_leaves_render)
/* 35DA44 E0056044 24426B8C */ addiu $v0, $v0, %lo(windy_leaves_render)
/* 35DA48 E0056048 AFA20020 */ sw $v0, 0x20($sp)
/* 35DA4C E005604C 2402002B */ addiu $v0, $zero, 0x2B
/* 35DA50 E0056050 AFBF0044 */ sw $ra, 0x44($sp)
/* 35DA54 E0056054 AFB60040 */ sw $s6, 0x40($sp)
/* 35DA58 E0056058 AFB40038 */ sw $s4, 0x38($sp)
/* 35DA5C E005605C AFB30034 */ sw $s3, 0x34($sp)
/* 35DA60 E0056060 AFB20030 */ sw $s2, 0x30($sp)
/* 35DA64 E0056064 AFB1002C */ sw $s1, 0x2C($sp)
/* 35DA68 E0056068 AFB00028 */ sw $s0, 0x28($sp)
/* 35DA6C E005606C AFA00010 */ sw $zero, 0x10($sp)
/* 35DA70 E0056070 AFA00024 */ sw $zero, 0x24($sp)
/* 35DA74 E0056074 0C080124 */ jal shim_create_effect_instance
/* 35DA78 E0056078 AFA20014 */ sw $v0, 0x14($sp)
/* 35DA7C E005607C 2404012C */ addiu $a0, $zero, 0x12C
/* 35DA80 E0056080 24160005 */ addiu $s6, $zero, 0x5
/* 35DA84 E0056084 0040802D */ daddu $s0, $v0, $zero
/* 35DA88 E0056088 0C08012C */ jal shim_general_heap_malloc
/* 35DA8C E005608C AE160008 */ sw $s6, 0x8($s0)
/* 35DA90 E0056090 0040182D */ daddu $v1, $v0, $zero
/* 35DA94 E0056094 14600003 */ bnez $v1, .LE00560A4
/* 35DA98 E0056098 AE03000C */ sw $v1, 0xC($s0)
.LE005609C:
/* 35DA9C E005609C 08015827 */ j .LE005609C
/* 35DAA0 E00560A0 00000000 */ nop
.LE00560A4:
/* 35DAA4 E00560A4 24020064 */ addiu $v0, $zero, 0x64
/* 35DAA8 E00560A8 AC750000 */ sw $s5, 0x0($v1)
/* 35DAAC E00560AC E4740004 */ swc1 $f20, 0x4($v1)
/* 35DAB0 E00560B0 E4760008 */ swc1 $f22, 0x8($v1)
/* 35DAB4 E00560B4 E478000C */ swc1 $f24, 0xC($v1)
/* 35DAB8 E00560B8 AC620028 */ sw $v0, 0x28($v1)
/* 35DABC E00560BC AC60002C */ sw $zero, 0x2C($v1)
/* 35DAC0 E00560C0 AC600024 */ sw $zero, 0x24($v1)
/* 35DAC4 E00560C4 24140001 */ addiu $s4, $zero, 0x1
/* 35DAC8 E00560C8 0296102A */ slt $v0, $s4, $s6
/* 35DACC E00560CC 10400080 */ beqz $v0, .LE00562D0
/* 35DAD0 E00560D0 2463003C */ addiu $v1, $v1, 0x3C
/* 35DAD4 E00560D4 24730014 */ addiu $s3, $v1, 0x14
/* 35DAD8 E00560D8 3C01E005 */ lui $at, (0xE0056EA0 >> 16)
/* 35DADC E00560DC D4346EA0 */ ldc1 $f20, (0xE0056EA0 & 0xFFFF)($at)
/* 35DAE0 E00560E0 3C01E005 */ lui $at, (0xE0056EA8 >> 16)
/* 35DAE4 E00560E4 D4386EA8 */ ldc1 $f24, (0xE0056EA8 & 0xFFFF)($at)
/* 35DAE8 E00560E8 3C01E005 */ lui $at, (0xE0056EB0 >> 16)
/* 35DAEC E00560EC D4366EB0 */ ldc1 $f22, (0xE0056EB0 & 0xFFFF)($at)
.LE00560F0:
/* 35DAF0 E00560F0 0C080000 */ jal effect_rand_int
/* 35DAF4 E00560F4 24040032 */ addiu $a0, $zero, 0x32
/* 35DAF8 E00560F8 24040014 */ addiu $a0, $zero, 0x14
/* 35DAFC E00560FC 0C080000 */ jal effect_rand_int
/* 35DB00 E0056100 0040802D */ daddu $s0, $v0, $zero
/* 35DB04 E0056104 24040168 */ addiu $a0, $zero, 0x168
/* 35DB08 E0056108 0C080000 */ jal effect_rand_int
/* 35DB0C E005610C 0040882D */ daddu $s1, $v0, $zero
/* 35DB10 E0056110 24040064 */ addiu $a0, $zero, 0x64
/* 35DB14 E0056114 0C080000 */ jal effect_rand_int
/* 35DB18 E0056118 0040902D */ daddu $s2, $v0, $zero
/* 35DB1C E005611C 2610004B */ addiu $s0, $s0, 0x4B
/* 35DB20 E0056120 44900000 */ mtc1 $s0, $f0
/* 35DB24 E0056124 00000000 */ nop
/* 35DB28 E0056128 46800020 */ cvt.s.w $f0, $f0
/* 35DB2C E005612C 26310046 */ addiu $s1, $s1, 0x46
/* 35DB30 E0056130 E660FFF0 */ swc1 $f0, -0x10($s3)
/* 35DB34 E0056134 44910000 */ mtc1 $s1, $f0
/* 35DB38 E0056138 00000000 */ nop
/* 35DB3C E005613C 46800020 */ cvt.s.w $f0, $f0
/* 35DB40 E0056140 E660FFF4 */ swc1 $f0, -0xC($s3)
/* 35DB44 E0056144 44920000 */ mtc1 $s2, $f0
/* 35DB48 E0056148 00000000 */ nop
/* 35DB4C E005614C 46800020 */ cvt.s.w $f0, $f0
/* 35DB50 E0056150 24030168 */ addiu $v1, $zero, 0x168
/* 35DB54 E0056154 00721823 */ subu $v1, $v1, $s2
/* 35DB58 E0056158 E6600004 */ swc1 $f0, 0x4($s3)
/* 35DB5C E005615C 44830000 */ mtc1 $v1, $f0
/* 35DB60 E0056160 00000000 */ nop
/* 35DB64 E0056164 46800020 */ cvt.s.w $f0, $f0
/* 35DB68 E0056168 0040182D */ daddu $v1, $v0, $zero
/* 35DB6C E005616C 24020001 */ addiu $v0, $zero, 0x1
/* 35DB70 E0056170 AE60FFF8 */ sw $zero, -0x8($s3)
/* 35DB74 E0056174 12A20019 */ beq $s5, $v0, .LE00561DC
/* 35DB78 E0056178 E660000C */ swc1 $f0, 0xC($s3)
/* 35DB7C E005617C 2AA20002 */ slti $v0, $s5, 0x2
/* 35DB80 E0056180 10400005 */ beqz $v0, .LE0056198
/* 35DB84 E0056184 24020002 */ addiu $v0, $zero, 0x2
/* 35DB88 E0056188 52A00007 */ beql $s5, $zero, .LE00561A8
/* 35DB8C E005618C AE60FFFC */ sw $zero, -0x4($s3)
/* 35DB90 E0056190 080158B1 */ j .LE00562C4
/* 35DB94 E0056194 26940001 */ addiu $s4, $s4, 0x1
.LE0056198:
/* 35DB98 E0056198 12A20023 */ beq $s5, $v0, .LE0056228
/* 35DB9C E005619C 2404000A */ addiu $a0, $zero, 0xA
/* 35DBA0 E00561A0 080158B1 */ j .LE00562C4
/* 35DBA4 E00561A4 26940001 */ addiu $s4, $s4, 0x1
.LE00561A8:
/* 35DBA8 E00561A8 44830000 */ mtc1 $v1, $f0
/* 35DBAC E00561AC 00000000 */ nop
/* 35DBB0 E00561B0 46800020 */ cvt.s.w $f0, $f0
/* 35DBB4 E00561B4 46000021 */ cvt.d.s $f0, $f0
/* 35DBB8 E00561B8 46340002 */ mul.d $f0, $f0, $f20
/* 35DBBC E00561BC 00000000 */ nop
/* 35DBC0 E00561C0 3C01C040 */ lui $at, (0xC0400000 >> 16)
/* 35DBC4 E00561C4 44811000 */ mtc1 $at, $f2
/* 35DBC8 E00561C8 3C014040 */ lui $at, (0x40400000 >> 16)
/* 35DBCC E00561CC 44812000 */ mtc1 $at, $f4
/* 35DBD0 E00561D0 AE600000 */ sw $zero, 0x0($s3)
/* 35DBD4 E00561D4 08015885 */ j .LE0056214
/* 35DBD8 E00561D8 AE600020 */ sw $zero, 0x20($s3)
.LE00561DC:
/* 35DBDC E00561DC 44830000 */ mtc1 $v1, $f0
/* 35DBE0 E00561E0 00000000 */ nop
/* 35DBE4 E00561E4 46800020 */ cvt.s.w $f0, $f0
/* 35DBE8 E00561E8 46000021 */ cvt.d.s $f0, $f0
/* 35DBEC E00561EC 46340002 */ mul.d $f0, $f0, $f20
/* 35DBF0 E00561F0 00000000 */ nop
/* 35DBF4 E00561F4 3C01C0C0 */ lui $at, (0xC0C00000 >> 16)
/* 35DBF8 E00561F8 44811000 */ mtc1 $at, $f2
/* 35DBFC E00561FC 3C0140C0 */ lui $at, (0x40C00000 >> 16)
/* 35DC00 E0056200 44812000 */ mtc1 $at, $f4
/* 35DC04 E0056204 AE60FFFC */ sw $zero, -0x4($s3)
/* 35DC08 E0056208 AE600000 */ sw $zero, 0x0($s3)
/* 35DC0C E005620C AE600020 */ sw $zero, 0x20($s3)
/* 35DC10 E0056210 46200000 */ add.d $f0, $f0, $f0
.LE0056214:
/* 35DC14 E0056214 E662001C */ swc1 $f2, 0x1C($s3)
/* 35DC18 E0056218 E6640024 */ swc1 $f4, 0x24($s3)
/* 35DC1C E005621C 46200020 */ cvt.s.d $f0, $f0
/* 35DC20 E0056220 080158B0 */ j .LE00562C0
/* 35DC24 E0056224 E6600008 */ swc1 $f0, 0x8($s3)
.LE0056228:
/* 35DC28 E0056228 44830000 */ mtc1 $v1, $f0
/* 35DC2C E005622C 00000000 */ nop
/* 35DC30 E0056230 46800020 */ cvt.s.w $f0, $f0
/* 35DC34 E0056234 46000021 */ cvt.d.s $f0, $f0
/* 35DC38 E0056238 46340002 */ mul.d $f0, $f0, $f20
/* 35DC3C E005623C 00000000 */ nop
/* 35DC40 E0056240 46200000 */ add.d $f0, $f0, $f0
/* 35DC44 E0056244 46200020 */ cvt.s.d $f0, $f0
/* 35DC48 E0056248 0C080138 */ jal shim_rand_int
/* 35DC4C E005624C E6600008 */ swc1 $f0, 0x8($s3)
/* 35DC50 E0056250 44821000 */ mtc1 $v0, $f2
/* 35DC54 E0056254 00000000 */ nop
/* 35DC58 E0056258 468010A1 */ cvt.d.w $f2, $f2
/* 35DC5C E005625C 46381082 */ mul.d $f2, $f2, $f24
/* 35DC60 E0056260 00000000 */ nop
/* 35DC64 E0056264 46361080 */ add.d $f2, $f2, $f22
/* 35DC68 E0056268 C660FFF0 */ lwc1 $f0, -0x10($s3)
/* 35DC6C E005626C 46000007 */ neg.s $f0, $f0
/* 35DC70 E0056270 46000021 */ cvt.d.s $f0, $f0
/* 35DC74 E0056274 46220002 */ mul.d $f0, $f0, $f2
/* 35DC78 E0056278 00000000 */ nop
/* 35DC7C E005627C 2404000A */ addiu $a0, $zero, 0xA
/* 35DC80 E0056280 46200020 */ cvt.s.d $f0, $f0
/* 35DC84 E0056284 0C080138 */ jal shim_rand_int
/* 35DC88 E0056288 E660FFFC */ swc1 $f0, -0x4($s3)
/* 35DC8C E005628C 44821000 */ mtc1 $v0, $f2
/* 35DC90 E0056290 00000000 */ nop
/* 35DC94 E0056294 468010A1 */ cvt.d.w $f2, $f2
/* 35DC98 E0056298 46381082 */ mul.d $f2, $f2, $f24
/* 35DC9C E005629C 00000000 */ nop
/* 35DCA0 E00562A0 46361080 */ add.d $f2, $f2, $f22
/* 35DCA4 E00562A4 C660FFF4 */ lwc1 $f0, -0xC($s3)
/* 35DCA8 E00562A8 46000007 */ neg.s $f0, $f0
/* 35DCAC E00562AC 46000021 */ cvt.d.s $f0, $f0
/* 35DCB0 E00562B0 46220002 */ mul.d $f0, $f0, $f2
/* 35DCB4 E00562B4 00000000 */ nop
/* 35DCB8 E00562B8 46200020 */ cvt.s.d $f0, $f0
/* 35DCBC E00562BC E6600000 */ swc1 $f0, 0x0($s3)
.LE00562C0:
/* 35DCC0 E00562C0 26940001 */ addiu $s4, $s4, 0x1
.LE00562C4:
/* 35DCC4 E00562C4 0296102A */ slt $v0, $s4, $s6
/* 35DCC8 E00562C8 1440FF89 */ bnez $v0, .LE00560F0
/* 35DCCC E00562CC 2673003C */ addiu $s3, $s3, 0x3C
.LE00562D0:
/* 35DCD0 E00562D0 8FBF0044 */ lw $ra, 0x44($sp)
/* 35DCD4 E00562D4 8FB60040 */ lw $s6, 0x40($sp)
/* 35DCD8 E00562D8 8FB5003C */ lw $s5, 0x3C($sp)
/* 35DCDC E00562DC 8FB40038 */ lw $s4, 0x38($sp)
/* 35DCE0 E00562E0 8FB30034 */ lw $s3, 0x34($sp)
/* 35DCE4 E00562E4 8FB20030 */ lw $s2, 0x30($sp)
/* 35DCE8 E00562E8 8FB1002C */ lw $s1, 0x2C($sp)
/* 35DCEC E00562EC 8FB00028 */ lw $s0, 0x28($sp)
/* 35DCF0 E00562F0 D7B80058 */ ldc1 $f24, 0x58($sp)
/* 35DCF4 E00562F4 D7B60050 */ ldc1 $f22, 0x50($sp)
/* 35DCF8 E00562F8 D7B40048 */ ldc1 $f20, 0x48($sp)
/* 35DCFC E00562FC 03E00008 */ jr $ra
/* 35DD00 E0056300 27BD0060 */ addiu $sp, $sp, 0x60
### DECOMPILED C INSTRUCTIONS:
void windy_leaves_main(s32 type, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
EffectInstance* effect;
WindyLeavesFXData* part;
s32 numParts;
s32 i;
bp.init = windy_leaves_init;
bp.update = windy_leaves_update;
bp.renderWorld = windy_leaves_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_WINDY_LEAVES;
numParts = 5;
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
effect->data.windyLeaves = part = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(part != NULL);
part->type = type;
part->unk_04.x = arg1;
part->unk_04.y = arg2;
part->unk_04.z = arg3;
part->unk_28 = 100;
part->unk_2C = 0;
part->alpha = 0;
part++;
for (i = 1; i < numParts; i++, part++) {
s32 temp_s0_2 = effect_rand_int(50);
s32 temp_s1 = effect_rand_int(20);
s32 temp_s2 = effect_rand_int(360);
s32 temp_v0_2 = effect_rand_int(100);
part->unk_04.x = temp_s0_2 + 75;
part->unk_04.y = temp_s1 + 70;
part->unk_04.z = 0;
part->unk_18 = temp_s2;
part->unk_20 = 360 - temp_s2;
switch (type) {
case 0:
part->unk_10 = 0.0f;
part->unk_14 = 0.0f;
part->unk_34 = 0;
part->unk_30 = -3.0f;
part->unk_38 = 3.0f;
part->unk_1C = (f32)temp_v0_2 * 0.1;
break;
case 1:
part->unk_10 = 0.0f;
part->unk_14 = 0.0f;
part->unk_34 = 0;
part->unk_30 = -6.0f;
part->unk_38 = 6.0f;
part->unk_1C = 2.0 * ((f32)temp_v0_2 * 0.1);
break;
case 2:
part->unk_1C = 2.0 * ((f32)temp_v0_2 * 0.1);
part->unk_10 = -part->unk_04.x * (shim_rand_int(10) * 0.008 + 0.05);
part->unk_14 = -part->unk_04.y * (shim_rand_int(10) * 0.008 + 0.05);
break;
default:
break;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel blast_appendGfx
/* 37D684 E007C1F4 27BDFEF0 */ addiu $sp, $sp, -0x110
/* 37D688 E007C1F8 0080302D */ daddu $a2, $a0, $zero
/* 37D68C E007C1FC 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 37D690 E007C200 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 37D694 E007C204 27A40018 */ addiu $a0, $sp, 0x18
/* 37D698 E007C208 AFB300E4 */ sw $s3, 0xE4($sp)
/* 37D69C E007C20C 3C130001 */ lui $s3, (0x11630 >> 16)
/* 37D6A0 E007C210 AFB400E8 */ sw $s4, 0xE8($sp)
/* 37D6A4 E007C214 3C14800A */ lui $s4, %hi(gMainGfxPos)
/* 37D6A8 E007C218 2694A66C */ addiu $s4, $s4, %lo(gMainGfxPos)
/* 37D6AC E007C21C AFBF00F0 */ sw $ra, 0xF0($sp)
/* 37D6B0 E007C220 AFB500EC */ sw $s5, 0xEC($sp)
/* 37D6B4 E007C224 AFB200E0 */ sw $s2, 0xE0($sp)
/* 37D6B8 E007C228 AFB100DC */ sw $s1, 0xDC($sp)
/* 37D6BC E007C22C AFB000D8 */ sw $s0, 0xD8($sp)
/* 37D6C0 E007C230 F7B80108 */ sdc1 $f24, 0x108($sp)
/* 37D6C4 E007C234 F7B60100 */ sdc1 $f22, 0x100($sp)
/* 37D6C8 E007C238 F7B400F8 */ sdc1 $f20, 0xF8($sp)
/* 37D6CC E007C23C 8E830000 */ lw $v1, 0x0($s4)
/* 37D6D0 E007C240 8CD1000C */ lw $s1, 0xC($a2)
/* 37D6D4 E007C244 3C014380 */ lui $at, (0x43800000 >> 16)
/* 37D6D8 E007C248 4481C000 */ mtc1 $at, $f24
/* 37D6DC E007C24C 0060282D */ daddu $a1, $v1, $zero
/* 37D6E0 E007C250 24630008 */ addiu $v1, $v1, 0x8
/* 37D6E4 E007C254 AE830000 */ sw $v1, 0x0($s4)
/* 37D6E8 E007C258 C6220020 */ lwc1 $f2, 0x20($s1)
/* 37D6EC E007C25C 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 37D6F0 E007C260 ACA20000 */ sw $v0, 0x0($a1)
/* 37D6F4 E007C264 24620008 */ addiu $v0, $v1, 0x8
/* 37D6F8 E007C268 ACA00004 */ sw $zero, 0x4($a1)
/* 37D6FC E007C26C AE820000 */ sw $v0, 0x0($s4)
/* 37D700 E007C270 24620010 */ addiu $v0, $v1, 0x10
/* 37D704 E007C274 AC670000 */ sw $a3, 0x0($v1)
/* 37D708 E007C278 AE820000 */ sw $v0, 0x0($s4)
/* 37D70C E007C27C 24620018 */ addiu $v0, $v1, 0x18
/* 37D710 E007C280 8CC50010 */ lw $a1, 0x10($a2)
/* 37D714 E007C284 3C06DE00 */ lui $a2, (0xDE000000 >> 16)
/* 37D718 E007C288 AE820000 */ sw $v0, 0x0($s4)
/* 37D71C E007C28C 8CA5001C */ lw $a1, 0x1C($a1)
/* 37D720 E007C290 3C020900 */ lui $v0, %hi(D_09001300_40E590)
/* 37D724 E007C294 24421300 */ addiu $v0, $v0, %lo(D_09001300_40E590)
/* 37D728 E007C298 AC62000C */ sw $v0, 0xC($v1)
/* 37D72C E007C29C 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 37D730 E007C2A0 AC660008 */ sw $a2, 0x8($v1)
/* 37D734 E007C2A4 AC660010 */ sw $a2, 0x10($v1)
/* 37D738 E007C2A8 00A22821 */ addu $a1, $a1, $v0
/* 37D73C E007C2AC 4600110D */ trunc.w.s $f4, $f2
/* 37D740 E007C2B0 44022000 */ mfc1 $v0, $f4
/* 37D744 E007C2B4 00000000 */ nop
/* 37D748 E007C2B8 44820000 */ mtc1 $v0, $f0
/* 37D74C E007C2BC 00000000 */ nop
/* 37D750 E007C2C0 46800020 */ cvt.s.w $f0, $f0
/* 37D754 E007C2C4 00021080 */ sll $v0, $v0, 2
/* 37D758 E007C2C8 46001081 */ sub.s $f2, $f2, $f0
/* 37D75C E007C2CC AC650004 */ sw $a1, 0x4($v1)
/* 37D760 E007C2D0 3C01E008 */ lui $at, (0xE0080000 >> 16)
/* 37D764 E007C2D4 00220821 */ addu $at, $at, $v0
/* 37D768 E007C2D8 8C22C510 */ lw $v0, -0x3AF0($at)
/* 37D76C E007C2DC 46181082 */ mul.s $f2, $f2, $f24
/* 37D770 E007C2E0 00000000 */ nop
/* 37D774 E007C2E4 AC620014 */ sw $v0, 0x14($v1)
/* 37D778 E007C2E8 8E250004 */ lw $a1, 0x4($s1)
/* 37D77C E007C2EC 8E260008 */ lw $a2, 0x8($s1)
/* 37D780 E007C2F0 8E27000C */ lw $a3, 0xC($s1)
/* 37D784 E007C2F4 4600110D */ trunc.w.s $f4, $f2
/* 37D788 E007C2F8 44152000 */ mfc1 $s5, $f4
/* 37D78C E007C2FC 0C080108 */ jal shim_guTranslateF
/* 37D790 E007C300 36731630 */ ori $s3, $s3, (0x11630 & 0xFFFF)
/* 37D794 E007C304 27B00058 */ addiu $s0, $sp, 0x58
/* 37D798 E007C308 4480B000 */ mtc1 $zero, $f22
/* 37D79C E007C30C 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 37D7A0 E007C310 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 37D7A4 E007C314 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 37D7A8 E007C318 4481A000 */ mtc1 $at, $f20
/* 37D7AC E007C31C 00031080 */ sll $v0, $v1, 2
/* 37D7B0 E007C320 00431021 */ addu $v0, $v0, $v1
/* 37D7B4 E007C324 00021080 */ sll $v0, $v0, 2
/* 37D7B8 E007C328 00431023 */ subu $v0, $v0, $v1
/* 37D7BC E007C32C 000218C0 */ sll $v1, $v0, 3
/* 37D7C0 E007C330 00431021 */ addu $v0, $v0, $v1
/* 37D7C4 E007C334 000210C0 */ sll $v0, $v0, 3
/* 37D7C8 E007C338 4406B000 */ mfc1 $a2, $f22
/* 37D7CC E007C33C 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 37D7D0 E007C340 00220821 */ addu $at, $at, $v0
/* 37D7D4 E007C344 C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 37D7D8 E007C348 4407A000 */ mfc1 $a3, $f20
/* 37D7DC E007C34C 46000007 */ neg.s $f0, $f0
/* 37D7E0 E007C350 44050000 */ mfc1 $a1, $f0
/* 37D7E4 E007C354 0200202D */ daddu $a0, $s0, $zero
/* 37D7E8 E007C358 0C080104 */ jal shim_guRotateF
/* 37D7EC E007C35C E7B60010 */ swc1 $f22, 0x10($sp)
/* 37D7F0 E007C360 0200202D */ daddu $a0, $s0, $zero
/* 37D7F4 E007C364 27A50018 */ addiu $a1, $sp, 0x18
/* 37D7F8 E007C368 27B00098 */ addiu $s0, $sp, 0x98
/* 37D7FC E007C36C 0C080114 */ jal shim_guMtxCatF
/* 37D800 E007C370 0200302D */ daddu $a2, $s0, $zero
/* 37D804 E007C374 27A40018 */ addiu $a0, $sp, 0x18
/* 37D808 E007C378 8E250010 */ lw $a1, 0x10($s1)
/* 37D80C E007C37C 4407A000 */ mfc1 $a3, $f20
/* 37D810 E007C380 0C080110 */ jal shim_guScaleF
/* 37D814 E007C384 00A0302D */ daddu $a2, $a1, $zero
/* 37D818 E007C388 27A40018 */ addiu $a0, $sp, 0x18
/* 37D81C E007C38C 0200282D */ daddu $a1, $s0, $zero
/* 37D820 E007C390 0C080114 */ jal shim_guMtxCatF
/* 37D824 E007C394 0200302D */ daddu $a2, $s0, $zero
/* 37D828 E007C398 4406B000 */ mfc1 $a2, $f22
/* 37D82C E007C39C 27A40018 */ addiu $a0, $sp, 0x18
/* 37D830 E007C3A0 E7B40010 */ swc1 $f20, 0x10($sp)
/* 37D834 E007C3A4 8E250024 */ lw $a1, 0x24($s1)
/* 37D838 E007C3A8 0C080104 */ jal shim_guRotateF
/* 37D83C E007C3AC 00C0382D */ daddu $a3, $a2, $zero
/* 37D840 E007C3B0 27A40018 */ addiu $a0, $sp, 0x18
/* 37D844 E007C3B4 0200282D */ daddu $a1, $s0, $zero
/* 37D848 E007C3B8 0C080114 */ jal shim_guMtxCatF
/* 37D84C E007C3BC 0200302D */ daddu $a2, $s0, $zero
/* 37D850 E007C3C0 0200202D */ daddu $a0, $s0, $zero
/* 37D854 E007C3C4 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 37D858 E007C3C8 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 37D85C E007C3CC 3C12800A */ lui $s2, %hi(gDisplayContext)
/* 37D860 E007C3D0 2652A674 */ addiu $s2, $s2, %lo(gDisplayContext)
/* 37D864 E007C3D4 96050000 */ lhu $a1, 0x0($s0)
/* 37D868 E007C3D8 8E420000 */ lw $v0, 0x0($s2)
/* 37D86C E007C3DC 00052980 */ sll $a1, $a1, 6
/* 37D870 E007C3E0 00B32821 */ addu $a1, $a1, $s3
/* 37D874 E007C3E4 0C080118 */ jal shim_guMtxF2L
/* 37D878 E007C3E8 00452821 */ addu $a1, $v0, $a1
/* 37D87C E007C3EC 8E850000 */ lw $a1, 0x0($s4)
/* 37D880 E007C3F0 3C014080 */ lui $at, (0x40800000 >> 16)
/* 37D884 E007C3F4 44810000 */ mtc1 $at, $f0
/* 37D888 E007C3F8 00A0202D */ daddu $a0, $a1, $zero
/* 37D88C E007C3FC 24A50008 */ addiu $a1, $a1, 0x8
/* 37D890 E007C400 AE850000 */ sw $a1, 0x0($s4)
/* 37D894 E007C404 96020000 */ lhu $v0, 0x0($s0)
/* 37D898 E007C408 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 37D89C E007C40C AC830000 */ sw $v1, 0x0($a0)
/* 37D8A0 E007C410 24430001 */ addiu $v1, $v0, 0x1
/* 37D8A4 E007C414 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 37D8A8 E007C418 00021180 */ sll $v0, $v0, 6
/* 37D8AC E007C41C A6030000 */ sh $v1, 0x0($s0)
/* 37D8B0 E007C420 8E430000 */ lw $v1, 0x0($s2)
/* 37D8B4 E007C424 00531021 */ addu $v0, $v0, $s3
/* 37D8B8 E007C428 00621821 */ addu $v1, $v1, $v0
/* 37D8BC E007C42C AC830004 */ sw $v1, 0x4($a0)
/* 37D8C0 E007C430 C6220020 */ lwc1 $f2, 0x20($s1)
/* 37D8C4 E007C434 4602003C */ c.lt.s $f0, $f2
/* 37D8C8 E007C438 00000000 */ nop
/* 37D8CC E007C43C 45000006 */ bc1f .LE007C458
/* 37D8D0 E007C440 24A20008 */ addiu $v0, $a1, 0x8
/* 37D8D4 E007C444 AE820000 */ sw $v0, 0x0($s4)
/* 37D8D8 E007C448 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 37D8DC E007C44C ACA20000 */ sw $v0, 0x0($a1)
/* 37D8E0 E007C450 0801F11A */ j .LE007C468
/* 37D8E4 E007C454 2402FF7F */ addiu $v0, $zero, -0x81
.LE007C458:
/* 37D8E8 E007C458 AE820000 */ sw $v0, 0x0($s4)
/* 37D8EC E007C45C 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 37D8F0 E007C460 ACA20000 */ sw $v0, 0x0($a1)
/* 37D8F4 E007C464 2402807F */ addiu $v0, $zero, -0x7F81
.LE007C468:
/* 37D8F8 E007C468 ACA20004 */ sw $v0, 0x4($a1)
/* 37D8FC E007C46C 3C07D838 */ lui $a3, (0xD8380002 >> 16)
/* 37D900 E007C470 3C05800A */ lui $a1, %hi(gMainGfxPos)
/* 37D904 E007C474 24A5A66C */ addiu $a1, $a1, %lo(gMainGfxPos)
/* 37D908 E007C478 34E70002 */ ori $a3, $a3, (0xD8380002 & 0xFFFF)
/* 37D90C E007C47C 3C02FB00 */ lui $v0, (0xFB000000 >> 16)
/* 37D910 E007C480 8CA40000 */ lw $a0, 0x0($a1)
/* 37D914 E007C484 24038B00 */ addiu $v1, $zero, -0x7500
/* 37D918 E007C488 0080302D */ daddu $a2, $a0, $zero
/* 37D91C E007C48C 24840008 */ addiu $a0, $a0, 0x8
/* 37D920 E007C490 ACA40000 */ sw $a0, 0x0($a1)
/* 37D924 E007C494 ACC20000 */ sw $v0, 0x0($a2)
/* 37D928 E007C498 32A200FF */ andi $v0, $s5, 0xFF
/* 37D92C E007C49C 00431025 */ or $v0, $v0, $v1
/* 37D930 E007C4A0 ACC20004 */ sw $v0, 0x4($a2)
/* 37D934 E007C4A4 24820008 */ addiu $v0, $a0, 0x8
/* 37D938 E007C4A8 ACA20000 */ sw $v0, 0x0($a1)
/* 37D93C E007C4AC 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 37D940 E007C4B0 AC820000 */ sw $v0, 0x0($a0)
/* 37D944 E007C4B4 3C020900 */ lui $v0, %hi(D_090017B0_40EA40)
/* 37D948 E007C4B8 244217B0 */ addiu $v0, $v0, %lo(D_090017B0_40EA40)
/* 37D94C E007C4BC AC820004 */ sw $v0, 0x4($a0)
/* 37D950 E007C4C0 24820010 */ addiu $v0, $a0, 0x10
/* 37D954 E007C4C4 ACA20000 */ sw $v0, 0x0($a1)
/* 37D958 E007C4C8 24020040 */ addiu $v0, $zero, 0x40
/* 37D95C E007C4CC AC870008 */ sw $a3, 0x8($a0)
/* 37D960 E007C4D0 AC82000C */ sw $v0, 0xC($a0)
/* 37D964 E007C4D4 8FBF00F0 */ lw $ra, 0xF0($sp)
/* 37D968 E007C4D8 8FB500EC */ lw $s5, 0xEC($sp)
/* 37D96C E007C4DC 8FB400E8 */ lw $s4, 0xE8($sp)
/* 37D970 E007C4E0 8FB300E4 */ lw $s3, 0xE4($sp)
/* 37D974 E007C4E4 8FB200E0 */ lw $s2, 0xE0($sp)
/* 37D978 E007C4E8 8FB100DC */ lw $s1, 0xDC($sp)
/* 37D97C E007C4EC 8FB000D8 */ lw $s0, 0xD8($sp)
/* 37D980 E007C4F0 D7B80108 */ ldc1 $f24, 0x108($sp)
/* 37D984 E007C4F4 D7B60100 */ ldc1 $f22, 0x100($sp)
/* 37D988 E007C4F8 D7B400F8 */ ldc1 $f20, 0xF8($sp)
/* 37D98C E007C4FC 03E00008 */ jr $ra
/* 37D990 E007C500 27BD0110 */ addiu $sp, $sp, 0x110
/* 37D994 E007C504 00000000 */ nop
/* 37D998 E007C508 00000000 */ nop
/* 37D99C E007C50C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void blast_appendGfx(void *effect) {
Matrix4f sp18;
Matrix4f sp58;
Matrix4f sp98;
Gfx* dlist = D_090017B0_37F180;
BlastFXData* data = ((EffectInstance*) effect)->data.blast;
s32 unk_20 = data->unk_20;
f32 t = 256.0f;
s32 envAlpha = (data->unk_20 - unk_20) * t;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09001300_37ECD0);
gSPDisplayList(gMainGfxPos++, D_E007C510[unk_20]);
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, sp98);
shim_guScaleF(sp18, data->unk_10, data->unk_10, 1.0f);
shim_guMtxCatF(sp18, sp98, sp98);
shim_guRotateF(sp18, data->unk_24, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp18, sp98, sp98);
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (data->unk_20 > 4.0f) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, 127);
} else {
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 128, 127);
}
t = !(s32)t; // required to match
gDPSetEnvColor(gMainGfxPos++, 255, 255, 139, envAlpha);
gSPDisplayList(gMainGfxPos++, dlist);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel create_npc_impl
/* 13998 80038598 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr)
/* 1399C 8003859C 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1)
/* 139A0 800385A0 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 139A4 800385A4 AFB20018 */ sw $s2, 0x18($sp)
/* 139A8 800385A8 0080902D */ daddu $s2, $a0, $zero
/* 139AC 800385AC AFB3001C */ sw $s3, 0x1C($sp)
/* 139B0 800385B0 00A0982D */ daddu $s3, $a1, $zero
/* 139B4 800385B4 AFB40020 */ sw $s4, 0x20($sp)
/* 139B8 800385B8 00C0A02D */ daddu $s4, $a2, $zero
/* 139BC 800385BC AFB10014 */ sw $s1, 0x14($sp)
/* 139C0 800385C0 0000882D */ daddu $s1, $zero, $zero
/* 139C4 800385C4 AFBF0024 */ sw $ra, 0x24($sp)
/* 139C8 800385C8 AFB00010 */ sw $s0, 0x10($sp)
.L800385CC:
/* 139CC 800385CC 8C620000 */ lw $v0, 0x0($v1)
/* 139D0 800385D0 10400006 */ beqz $v0, .L800385EC
/* 139D4 800385D4 2A220040 */ slti $v0, $s1, 0x40
/* 139D8 800385D8 26310001 */ addiu $s1, $s1, 0x1
/* 139DC 800385DC 2A220040 */ slti $v0, $s1, 0x40
/* 139E0 800385E0 1440FFFA */ bnez $v0, .L800385CC
/* 139E4 800385E4 24630004 */ addiu $v1, $v1, 0x4
/* 139E8 800385E8 2A220040 */ slti $v0, $s1, 0x40
.L800385EC:
/* 139EC 800385EC 14400003 */ bnez $v0, .L800385FC
/* 139F0 800385F0 00000000 */ nop
.L800385F4:
/* 139F4 800385F4 0800E17D */ j .L800385F4
/* 139F8 800385F8 00000000 */ nop
.L800385FC:
/* 139FC 800385FC 0C00AB39 */ jal heap_malloc
/* 13A00 80038600 24040340 */ addiu $a0, $zero, 0x340
/* 13A04 80038604 00112080 */ sll $a0, $s1, 2
/* 13A08 80038608 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr)
/* 13A0C 8003860C 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1)
/* 13A10 80038610 3C05800A */ lui $a1, %hi(gNpcCount)
/* 13A14 80038614 24A5A604 */ addiu $a1, $a1, %lo(gNpcCount)
/* 13A18 80038618 00832021 */ addu $a0, $a0, $v1
/* 13A1C 8003861C 94A30000 */ lhu $v1, 0x0($a1)
/* 13A20 80038620 0040802D */ daddu $s0, $v0, $zero
/* 13A24 80038624 AC900000 */ sw $s0, 0x0($a0)
/* 13A28 80038628 24630001 */ addiu $v1, $v1, 0x1
/* 13A2C 8003862C 16000003 */ bnez $s0, .L8003863C
/* 13A30 80038630 A4A30000 */ sh $v1, 0x0($a1)
.L80038634:
/* 13A34 80038634 0800E18D */ j .L80038634
/* 13A38 80038638 00000000 */ nop
.L8003863C:
/* 13A3C 8003863C 3C030041 */ lui $v1, (0x410011 >> 16)
/* 13A40 80038640 8E420000 */ lw $v0, 0x0($s2)
/* 13A44 80038644 34630011 */ ori $v1, $v1, (0x410011 & 0xFFFF)
/* 13A48 80038648 00431825 */ or $v1, $v0, $v1
/* 13A4C 8003864C 12800004 */ beqz $s4, .L80038660
/* 13A50 80038650 AE030000 */ sw $v1, 0x0($s0)
/* 13A54 80038654 3C024000 */ lui $v0, (0x40000000 >> 16)
/* 13A58 80038658 00621025 */ or $v0, $v1, $v0
/* 13A5C 8003865C AE020000 */ sw $v0, 0x0($s0)
.L80038660:
/* 13A60 80038660 0000202D */ daddu $a0, $zero, $zero
/* 13A64 80038664 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 13A68 80038668 44810000 */ mtc1 $at, $f0
/* 13A6C 8003866C 3C014080 */ lui $at, (0x40800000 >> 16)
/* 13A70 80038670 44811000 */ mtc1 $at, $f2
/* 13A74 80038674 24020020 */ addiu $v0, $zero, 0x20
/* 13A78 80038678 A60200A6 */ sh $v0, 0xA6($s0)
/* 13A7C 8003867C 24020040 */ addiu $v0, $zero, 0x40
/* 13A80 80038680 A60200A8 */ sh $v0, 0xA8($s0)
/* 13A84 80038684 2402000D */ addiu $v0, $zero, 0xD
/* 13A88 80038688 A20200AA */ sb $v0, 0xAA($s0)
/* 13A8C 8003868C 240200FF */ addiu $v0, $zero, 0xFF
/* 13A90 80038690 AE000020 */ sw $zero, 0x20($s0)
/* 13A94 80038694 AE00000C */ sw $zero, 0xC($s0)
/* 13A98 80038698 AE00001C */ sw $zero, 0x1C($s0)
/* 13A9C 8003869C AE000038 */ sw $zero, 0x38($s0)
/* 13AA0 800386A0 AE00003C */ sw $zero, 0x3C($s0)
/* 13AA4 800386A4 AE000040 */ sw $zero, 0x40($s0)
/* 13AA8 800386A8 AE00006C */ sw $zero, 0x6C($s0)
/* 13AAC 800386AC AE000070 */ sw $zero, 0x70($s0)
/* 13AB0 800386B0 AE000074 */ sw $zero, 0x74($s0)
/* 13AB4 800386B4 AE000050 */ sw $zero, 0x50($s0)
/* 13AB8 800386B8 AE000044 */ sw $zero, 0x44($s0)
/* 13ABC 800386BC AE000048 */ sw $zero, 0x48($s0)
/* 13AC0 800386C0 AE00004C */ sw $zero, 0x4C($s0)
/* 13AC4 800386C4 A6000090 */ sh $zero, 0x90($s0)
/* 13AC8 800386C8 A6000092 */ sh $zero, 0x92($s0)
/* 13ACC 800386CC A6000094 */ sh $zero, 0x94($s0)
/* 13AD0 800386D0 A6000096 */ sh $zero, 0x96($s0)
/* 13AD4 800386D4 A20000AB */ sb $zero, 0xAB($s0)
/* 13AD8 800386D8 A20200AC */ sb $v0, 0xAC($s0)
/* 13ADC 800386DC A20200AD */ sb $v0, 0xAD($s0)
/* 13AE0 800386E0 E6000014 */ swc1 $f0, 0x14($s0)
/* 13AE4 800386E4 E6020018 */ swc1 $f2, 0x18($s0)
/* 13AE8 800386E8 E6000054 */ swc1 $f0, 0x54($s0)
/* 13AEC 800386EC E6000058 */ swc1 $f0, 0x58($s0)
/* 13AF0 800386F0 E600005C */ swc1 $f0, 0x5C($s0)
/* 13AF4 800386F4 8E420004 */ lw $v0, 0x4($s2)
/* 13AF8 800386F8 0200182D */ daddu $v1, $s0, $zero
/* 13AFC 800386FC E6000030 */ swc1 $f0, 0x30($s0)
/* 13B00 80038700 AE000034 */ sw $zero, 0x34($s0)
/* 13B04 80038704 A6000098 */ sh $zero, 0x98($s0)
/* 13B08 80038708 AE020028 */ sw $v0, 0x28($s0)
/* 13B0C 8003870C 3C020002 */ lui $v0, (0x20000 >> 16)
/* 13B10 80038710 A60000A2 */ sh $zero, 0xA2($s0)
/* 13B14 80038714 AE020080 */ sw $v0, 0x80($s0)
/* 13B18 80038718 2402FFFF */ addiu $v0, $zero, -0x1
/* 13B1C 8003871C A6000088 */ sh $zero, 0x88($s0)
/* 13B20 80038720 A600008A */ sh $zero, 0x8A($s0)
/* 13B24 80038724 A600008C */ sh $zero, 0x8C($s0)
/* 13B28 80038728 A6020084 */ sh $v0, 0x84($s0)
/* 13B2C 8003872C A6020086 */ sh $v0, 0x86($s0)
/* 13B30 80038730 A20000B4 */ sb $zero, 0xB4($s0)
/* 13B34 80038734 A20000B5 */ sb $zero, 0xB5($s0)
/* 13B38 80038738 AE000318 */ sw $zero, 0x318($s0)
/* 13B3C 8003873C AE00031C */ sw $zero, 0x31C($s0)
/* 13B40 80038740 E6000320 */ swc1 $f0, 0x320($s0)
.L80038744:
/* 13B44 80038744 AC600324 */ sw $zero, 0x324($v1)
/* 13B48 80038748 02041021 */ addu $v0, $s0, $a0
/* 13B4C 8003874C 24840001 */ addiu $a0, $a0, 0x1
/* 13B50 80038750 A040032C */ sb $zero, 0x32C($v0)
/* 13B54 80038754 28820002 */ slti $v0, $a0, 0x2
/* 13B58 80038758 1440FFFA */ bnez $v0, .L80038744
/* 13B5C 8003875C 24630004 */ addiu $v1, $v1, 0x4
/* 13B60 80038760 8E420008 */ lw $v0, 0x8($s2)
/* 13B64 80038764 14400004 */ bnez $v0, .L80038778
/* 13B68 80038768 AE020004 */ sw $v0, 0x4($s0)
/* 13B6C 8003876C 3C028004 */ lui $v0, %hi(STUB_npc_callback)
/* 13B70 80038770 24428470 */ addiu $v0, $v0, %lo(STUB_npc_callback)
/* 13B74 80038774 AE020004 */ sw $v0, 0x4($s0)
.L80038778:
/* 13B78 80038778 8E42000C */ lw $v0, 0xC($s2)
/* 13B7C 8003877C 14400004 */ bnez $v0, .L80038790
/* 13B80 80038780 AE020008 */ sw $v0, 0x8($s0)
/* 13B84 80038784 3C028004 */ lui $v0, %hi(STUB_npc_callback)
/* 13B88 80038788 24428470 */ addiu $v0, $v0, %lo(STUB_npc_callback)
/* 13B8C 8003878C AE020008 */ sw $v0, 0x8($s0)
.L80038790:
/* 13B90 80038790 16800015 */ bnez $s4, .L800387E8
/* 13B94 80038794 3C020100 */ lui $v0, (0x1000000 >> 16)
/* 13B98 80038798 8E030000 */ lw $v1, 0x0($s0)
/* 13B9C 8003879C 00621024 */ and $v0, $v1, $v0
/* 13BA0 800387A0 1440000F */ bnez $v0, .L800387E0
/* 13BA4 800387A4 AE1300B0 */ sw $s3, 0xB0($s0)
/* 13BA8 800387A8 3C020400 */ lui $v0, (0x4000000 >> 16)
/* 13BAC 800387AC 00621024 */ and $v0, $v1, $v0
/* 13BB0 800387B0 14400004 */ bnez $v0, .L800387C4
/* 13BB4 800387B4 0260282D */ daddu $a1, $s3, $zero
/* 13BB8 800387B8 8E040028 */ lw $a0, 0x28($s0)
/* 13BBC 800387BC 0800E1F4 */ j .L800387D0
/* 13BC0 800387C0 00000000 */ nop
.L800387C4:
/* 13BC4 800387C4 8E020028 */ lw $v0, 0x28($s0)
/* 13BC8 800387C8 3C048000 */ lui $a0, (0x80000000 >> 16)
/* 13BCC 800387CC 00442025 */ or $a0, $v0, $a0
.L800387D0:
/* 13BD0 800387D0 0C0B783B */ jal spr_load_npc_sprite
/* 13BD4 800387D4 00000000 */ nop
/* 13BD8 800387D8 0800E1FA */ j .L800387E8
/* 13BDC 800387DC AE020024 */ sw $v0, 0x24($s0)
.L800387E0:
/* 13BE0 800387E0 34620002 */ ori $v0, $v1, 0x2
/* 13BE4 800387E4 AE020000 */ sw $v0, 0x0($s0)
.L800387E8:
/* 13BE8 800387E8 8E050038 */ lw $a1, 0x38($s0)
/* 13BEC 800387EC 8E06003C */ lw $a2, 0x3C($s0)
/* 13BF0 800387F0 8E070040 */ lw $a3, 0x40($s0)
/* 13BF4 800387F4 0C044898 */ jal create_shadow_type
/* 13BF8 800387F8 0000202D */ daddu $a0, $zero, $zero
/* 13BFC 800387FC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 13C00 80038800 44810000 */ mtc1 $at, $f0
/* 13C04 80038804 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 13C08 80038808 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* 13C0C 8003880C AE020078 */ sw $v0, 0x78($s0)
/* 13C10 80038810 E600007C */ swc1 $f0, 0x7C($s0)
/* 13C14 80038814 80620070 */ lb $v0, 0x70($v1)
/* 13C18 80038818 54400001 */ bnel $v0, $zero, .L80038820
/* 13C1C 8003881C 36310800 */ ori $s1, $s1, 0x800
.L80038820:
/* 13C20 80038820 0220102D */ daddu $v0, $s1, $zero
/* 13C24 80038824 8FBF0024 */ lw $ra, 0x24($sp)
/* 13C28 80038828 8FB40020 */ lw $s4, 0x20($sp)
/* 13C2C 8003882C 8FB3001C */ lw $s3, 0x1C($sp)
/* 13C30 80038830 8FB20018 */ lw $s2, 0x18($sp)
/* 13C34 80038834 8FB10014 */ lw $s1, 0x14($sp)
/* 13C38 80038838 8FB00010 */ lw $s0, 0x10($sp)
/* 13C3C 8003883C 03E00008 */ jr $ra
/* 13C40 80038840 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) {
Npc* npc;
s32 i;
s32 j;
for (i = 0; i < MAX_NPCS; i++) {
if ((*gCurrentNpcListPtr)[i] == NULL) {
break;
}
}
ASSERT(i < MAX_NPCS);
(*gCurrentNpcListPtr)[i] = npc = heap_malloc(sizeof(*npc));
gNpcCount++;
ASSERT(npc != NULL);
npc->flags = blueprint->flags | (NPC_FLAG_TOUCHES_GROUND | NPC_FLAG_DIRTY_SHADOW | NPC_FLAG_HAS_SHADOW | NPC_FLAG_ENABLED);
if (isPeachNpc) {
npc->flags |= NPC_FLAG_NO_ANIMS_LOADED;
}
npc->collisionDiameter = 32;
npc->collisionHeight = 64;
npc->renderMode = 13;
npc->blur.any = NULL;
npc->yaw = 0.0f;
npc->jumpVelocity = 0.0f;
npc->pos.x = 0.0f;
npc->pos.y = 0.0f;
npc->pos.z = 0.0f;
npc->colliderPos.x = 0.0f;
npc->colliderPos.y = 0.0f;
npc->colliderPos.z = 0.0f;
npc->rotationPivotOffsetY = 0.0f;
npc->rotation.x = 0.0f;
npc->rotation.y = 0.0f;
npc->rotation.z = 0.0f;
npc->homePos.x = 0.0f;
npc->homePos.y = 0.0f;
npc->homePos.z = 0.0f;
npc->unk_96 = 0; // TODO: fix
npc->verticalRenderOffset = 0;
npc->alpha = 255;
npc->alpha2 = 255;
npc->jumpScale = 1.0f;
npc->moveSpeed = 4.0f;
npc->scale.x = 1.0f;
npc->scale.y = 1.0f;
npc->scale.z = 1.0f;
npc->currentAnim = blueprint->initialAnim;
npc->animationSpeed = 1.0f;
npc->renderYaw = 0.0f;
npc->imgfxType = IMGFX_CLEAR;
npc->imgfxFlags = 0;
npc->collisionChannel = COLLISION_CHANNEL_20000;
npc->isFacingAway = FALSE;
npc->yawCamOffset = 0;
npc->turnAroundYawAdjustment = 0;
npc->currentFloor = NO_COLLIDER;
npc->currentWall = NO_COLLIDER;
npc->palSwapType = 0;
npc->palSwapPrevType = 0;
npc->screenSpaceOffset2D[0] = 0.0f;
npc->screenSpaceOffset2D[1] = 0.0f;
npc->verticalStretch = 1.0f;
for (j = 0; j < ARRAY_COUNT(npc->decorations); j++) {
npc->decorations[j] = 0;
npc->decorationType[j] = 0;
}
npc->onUpdate = blueprint->onUpdate;
if (npc->onUpdate == NULL) {
npc->onUpdate = &STUB_npc_callback;
}
npc->onRender = blueprint->onRender;
if (npc->onRender == NULL) {
npc->onRender = &STUB_npc_callback;
}
if (!isPeachNpc) {
npc->extraAnimList = animList;
if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
if (!(npc->flags & NPC_FLAG_PARTNER)) {
npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim, animList);
} else {
npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim | SPRITE_ID_TAIL_ALLOCATE, animList);
}
} else {
npc->flags |= NPC_FLAG_INVISIBLE;
}
}
npc->shadowIndex = create_shadow_type(0, npc->pos.x, npc->pos.y, npc->pos.z);
npc->shadowScale = 1.0f;
if (gGameStatusPtr->isBattle) {
i |= BATTLE_NPC_ID_BIT;
}
return i;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel lightning_update
/* 36E470 E006C2A0 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 36E474 E006C2A4 AFBF0020 */ sw $ra, 0x20($sp)
/* 36E478 E006C2A8 AFB3001C */ sw $s3, 0x1C($sp)
/* 36E47C E006C2AC AFB20018 */ sw $s2, 0x18($sp)
/* 36E480 E006C2B0 AFB10014 */ sw $s1, 0x14($sp)
/* 36E484 E006C2B4 AFB00010 */ sw $s0, 0x10($sp)
/* 36E488 E006C2B8 8C830000 */ lw $v1, 0x0($a0)
/* 36E48C E006C2BC 8C90000C */ lw $s0, 0xC($a0)
/* 36E490 E006C2C0 30620010 */ andi $v0, $v1, 0x10
/* 36E494 E006C2C4 10400004 */ beqz $v0, .LE006C2D8
/* 36E498 E006C2C8 2402FFEF */ addiu $v0, $zero, -0x11
/* 36E49C E006C2CC 00621024 */ and $v0, $v1, $v0
/* 36E4A0 E006C2D0 AC820000 */ sw $v0, 0x0($a0)
/* 36E4A4 E006C2D4 AE000014 */ sw $zero, 0x14($s0)
.LE006C2D8:
/* 36E4A8 E006C2D8 8E030014 */ lw $v1, 0x14($s0)
/* 36E4AC E006C2DC 8E120000 */ lw $s2, 0x0($s0)
/* 36E4B0 E006C2E0 28620064 */ slti $v0, $v1, 0x64
/* 36E4B4 E006C2E4 10400002 */ beqz $v0, .LE006C2F0
/* 36E4B8 E006C2E8 2462FFFF */ addiu $v0, $v1, -0x1
/* 36E4BC E006C2EC AE020014 */ sw $v0, 0x14($s0)
.LE006C2F0:
/* 36E4C0 E006C2F0 8E020018 */ lw $v0, 0x18($s0)
/* 36E4C4 E006C2F4 8E050014 */ lw $a1, 0x14($s0)
/* 36E4C8 E006C2F8 24420001 */ addiu $v0, $v0, 0x1
/* 36E4CC E006C2FC 04A10010 */ bgez $a1, .LE006C340
/* 36E4D0 E006C300 AE020018 */ sw $v0, 0x18($s0)
/* 36E4D4 E006C304 0C080128 */ jal shim_remove_effect
/* 36E4D8 E006C308 00000000 */ nop
/* 36E4DC E006C30C 8E040048 */ lw $a0, 0x48($s0)
/* 36E4E0 E006C310 10800004 */ beqz $a0, .LE006C324
/* 36E4E4 E006C314 00000000 */ nop
/* 36E4E8 E006C318 0C080128 */ jal shim_remove_effect
/* 36E4EC E006C31C 00000000 */ nop
/* 36E4F0 E006C320 AE000048 */ sw $zero, 0x48($s0)
.LE006C324:
/* 36E4F4 E006C324 8E040044 */ lw $a0, 0x44($s0)
/* 36E4F8 E006C328 10800096 */ beqz $a0, .LE006C584
/* 36E4FC E006C32C 00000000 */ nop
/* 36E500 E006C330 0C080128 */ jal shim_remove_effect
/* 36E504 E006C334 00000000 */ nop
/* 36E508 E006C338 0801B161 */ j .LE006C584
/* 36E50C E006C33C AE000044 */ sw $zero, 0x44($s0)
.LE006C340:
/* 36E510 E006C340 00A0982D */ daddu $s3, $a1, $zero
/* 36E514 E006C344 8E040044 */ lw $a0, 0x44($s0)
/* 36E518 E006C348 10800007 */ beqz $a0, .LE006C368
/* 36E51C E006C34C 0040882D */ daddu $s1, $v0, $zero
/* 36E520 E006C350 2A220012 */ slti $v0, $s1, 0x12
/* 36E524 E006C354 14400005 */ bnez $v0, .LE006C36C
/* 36E528 E006C358 2A420003 */ slti $v0, $s2, 0x3
/* 36E52C E006C35C 0C080128 */ jal shim_remove_effect
/* 36E530 E006C360 00000000 */ nop
/* 36E534 E006C364 AE000044 */ sw $zero, 0x44($s0)
.LE006C368:
/* 36E538 E006C368 2A420003 */ slti $v0, $s2, 0x3
.LE006C36C:
/* 36E53C E006C36C 14400003 */ bnez $v0, .LE006C37C
/* 36E540 E006C370 2A220007 */ slti $v0, $s1, 0x7
/* 36E544 E006C374 10400074 */ beqz $v0, .LE006C548
/* 36E548 E006C378 2A420003 */ slti $v0, $s2, 0x3
.LE006C37C:
/* 36E54C E006C37C C600001C */ lwc1 $f0, 0x1C($s0)
/* 36E550 E006C380 C602002C */ lwc1 $f2, 0x2C($s0)
/* 36E554 E006C384 46020080 */ add.s $f2, $f0, $f2
/* 36E558 E006C388 44800000 */ mtc1 $zero, $f0
/* 36E55C E006C38C 00000000 */ nop
/* 36E560 E006C390 4600103C */ c.lt.s $f2, $f0
/* 36E564 E006C394 00000000 */ nop
/* 36E568 E006C398 45000005 */ bc1f .LE006C3B0
/* 36E56C E006C39C E602001C */ swc1 $f2, 0x1C($s0)
/* 36E570 E006C3A0 3C014380 */ lui $at, (0x43800000 >> 16)
/* 36E574 E006C3A4 44810000 */ mtc1 $at, $f0
/* 36E578 E006C3A8 0801B0F4 */ j .LE006C3D0
/* 36E57C E006C3AC 46001000 */ add.s $f0, $f2, $f0
.LE006C3B0:
/* 36E580 E006C3B0 3C014380 */ lui $at, (0x43800000 >> 16)
/* 36E584 E006C3B4 44810000 */ mtc1 $at, $f0
/* 36E588 E006C3B8 00000000 */ nop
/* 36E58C E006C3BC 4602003C */ c.lt.s $f0, $f2
/* 36E590 E006C3C0 00000000 */ nop
/* 36E594 E006C3C4 45000003 */ bc1f .LE006C3D4
/* 36E598 E006C3C8 00000000 */ nop
/* 36E59C E006C3CC 46001001 */ sub.s $f0, $f2, $f0
.LE006C3D0:
/* 36E5A0 E006C3D0 E600001C */ swc1 $f0, 0x1C($s0)
.LE006C3D4:
/* 36E5A4 E006C3D4 8E02003C */ lw $v0, 0x3C($s0)
/* 36E5A8 E006C3D8 14400002 */ bnez $v0, .LE006C3E4
/* 36E5AC E006C3DC 0222001A */ div $zero, $s1, $v0
/* 36E5B0 E006C3E0 0007000D */ break 7
.LE006C3E4:
/* 36E5B4 E006C3E4 2401FFFF */ addiu $at, $zero, -0x1
/* 36E5B8 E006C3E8 14410004 */ bne $v0, $at, .LE006C3FC
/* 36E5BC E006C3EC 3C018000 */ lui $at, (0x80000000 >> 16)
/* 36E5C0 E006C3F0 16210002 */ bne $s1, $at, .LE006C3FC
/* 36E5C4 E006C3F4 00000000 */ nop
/* 36E5C8 E006C3F8 0006000D */ break 6
.LE006C3FC:
/* 36E5CC E006C3FC 00001810 */ mfhi $v1
/* 36E5D0 E006C400 14600017 */ bnez $v1, .LE006C460
/* 36E5D4 E006C404 00000000 */ nop
/* 36E5D8 E006C408 C6000020 */ lwc1 $f0, 0x20($s0)
/* 36E5DC E006C40C C6020030 */ lwc1 $f2, 0x30($s0)
/* 36E5E0 E006C410 46020080 */ add.s $f2, $f0, $f2
/* 36E5E4 E006C414 44800000 */ mtc1 $zero, $f0
/* 36E5E8 E006C418 00000000 */ nop
/* 36E5EC E006C41C 4600103C */ c.lt.s $f2, $f0
/* 36E5F0 E006C420 00000000 */ nop
/* 36E5F4 E006C424 45000005 */ bc1f .LE006C43C
/* 36E5F8 E006C428 E6020020 */ swc1 $f2, 0x20($s0)
/* 36E5FC E006C42C 3C014280 */ lui $at, (0x42800000 >> 16)
/* 36E600 E006C430 44810000 */ mtc1 $at, $f0
/* 36E604 E006C434 0801B117 */ j .LE006C45C
/* 36E608 E006C438 46001000 */ add.s $f0, $f2, $f0
.LE006C43C:
/* 36E60C E006C43C 3C014280 */ lui $at, (0x42800000 >> 16)
/* 36E610 E006C440 44810000 */ mtc1 $at, $f0
/* 36E614 E006C444 00000000 */ nop
/* 36E618 E006C448 4602003C */ c.lt.s $f0, $f2
/* 36E61C E006C44C 00000000 */ nop
/* 36E620 E006C450 45000003 */ bc1f .LE006C460
/* 36E624 E006C454 00000000 */ nop
/* 36E628 E006C458 46001001 */ sub.s $f0, $f2, $f0
.LE006C45C:
/* 36E62C E006C45C E6000020 */ swc1 $f0, 0x20($s0)
.LE006C460:
/* 36E630 E006C460 8E020040 */ lw $v0, 0x40($s0)
/* 36E634 E006C464 14400002 */ bnez $v0, .LE006C470
/* 36E638 E006C468 0222001A */ div $zero, $s1, $v0
/* 36E63C E006C46C 0007000D */ break 7
.LE006C470:
/* 36E640 E006C470 2401FFFF */ addiu $at, $zero, -0x1
/* 36E644 E006C474 14410004 */ bne $v0, $at, .LE006C488
/* 36E648 E006C478 3C018000 */ lui $at, (0x80000000 >> 16)
/* 36E64C E006C47C 16210002 */ bne $s1, $at, .LE006C488
/* 36E650 E006C480 00000000 */ nop
/* 36E654 E006C484 0006000D */ break 6
.LE006C488:
/* 36E658 E006C488 00001810 */ mfhi $v1
/* 36E65C E006C48C 14600017 */ bnez $v1, .LE006C4EC
/* 36E660 E006C490 00000000 */ nop
/* 36E664 E006C494 C6000024 */ lwc1 $f0, 0x24($s0)
/* 36E668 E006C498 C6020034 */ lwc1 $f2, 0x34($s0)
/* 36E66C E006C49C 46020080 */ add.s $f2, $f0, $f2
/* 36E670 E006C4A0 44800000 */ mtc1 $zero, $f0
/* 36E674 E006C4A4 00000000 */ nop
/* 36E678 E006C4A8 4600103C */ c.lt.s $f2, $f0
/* 36E67C E006C4AC 00000000 */ nop
/* 36E680 E006C4B0 45000005 */ bc1f .LE006C4C8
/* 36E684 E006C4B4 E6020024 */ swc1 $f2, 0x24($s0)
/* 36E688 E006C4B8 3C014380 */ lui $at, (0x43800000 >> 16)
/* 36E68C E006C4BC 44810000 */ mtc1 $at, $f0
/* 36E690 E006C4C0 0801B13A */ j .LE006C4E8
/* 36E694 E006C4C4 46001000 */ add.s $f0, $f2, $f0
.LE006C4C8:
/* 36E698 E006C4C8 3C014380 */ lui $at, (0x43800000 >> 16)
/* 36E69C E006C4CC 44810000 */ mtc1 $at, $f0
/* 36E6A0 E006C4D0 00000000 */ nop
/* 36E6A4 E006C4D4 4602003C */ c.lt.s $f0, $f2
/* 36E6A8 E006C4D8 00000000 */ nop
/* 36E6AC E006C4DC 45000003 */ bc1f .LE006C4EC
/* 36E6B0 E006C4E0 00000000 */ nop
/* 36E6B4 E006C4E4 46001001 */ sub.s $f0, $f2, $f0
.LE006C4E8:
/* 36E6B8 E006C4E8 E6000024 */ swc1 $f0, 0x24($s0)
.LE006C4EC:
/* 36E6BC E006C4EC C6000028 */ lwc1 $f0, 0x28($s0)
/* 36E6C0 E006C4F0 C6020038 */ lwc1 $f2, 0x38($s0)
/* 36E6C4 E006C4F4 46020080 */ add.s $f2, $f0, $f2
/* 36E6C8 E006C4F8 44800000 */ mtc1 $zero, $f0
/* 36E6CC E006C4FC 00000000 */ nop
/* 36E6D0 E006C500 4600103C */ c.lt.s $f2, $f0
/* 36E6D4 E006C504 00000000 */ nop
/* 36E6D8 E006C508 45000005 */ bc1f .LE006C520
/* 36E6DC E006C50C E6020028 */ swc1 $f2, 0x28($s0)
/* 36E6E0 E006C510 3C014280 */ lui $at, (0x42800000 >> 16)
/* 36E6E4 E006C514 44810000 */ mtc1 $at, $f0
/* 36E6E8 E006C518 0801B150 */ j .LE006C540
/* 36E6EC E006C51C 46001000 */ add.s $f0, $f2, $f0
.LE006C520:
/* 36E6F0 E006C520 3C014280 */ lui $at, (0x42800000 >> 16)
/* 36E6F4 E006C524 44810000 */ mtc1 $at, $f0
/* 36E6F8 E006C528 00000000 */ nop
/* 36E6FC E006C52C 4602003C */ c.lt.s $f0, $f2
/* 36E700 E006C530 00000000 */ nop
/* 36E704 E006C534 45000004 */ bc1f .LE006C548
/* 36E708 E006C538 2A420003 */ slti $v0, $s2, 0x3
/* 36E70C E006C53C 46001001 */ sub.s $f0, $f2, $f0
.LE006C540:
/* 36E710 E006C540 E6000028 */ swc1 $f0, 0x28($s0)
/* 36E714 E006C544 2A420003 */ slti $v0, $s2, 0x3
.LE006C548:
/* 36E718 E006C548 14400007 */ bnez $v0, .LE006C568
/* 36E71C E006C54C 2A62000A */ slti $v0, $s3, 0xA
/* 36E720 E006C550 2A220007 */ slti $v0, $s1, 0x7
/* 36E724 E006C554 1440000B */ bnez $v0, .LE006C584
/* 36E728 E006C558 00000000 */ nop
/* 36E72C E006C55C 8E020010 */ lw $v0, 0x10($s0)
/* 36E730 E006C560 0801B15E */ j .LE006C578
/* 36E734 E006C564 2442FFF3 */ addiu $v0, $v0, -0xD
.LE006C568:
/* 36E738 E006C568 10400006 */ beqz $v0, .LE006C584
/* 36E73C E006C56C 00000000 */ nop
/* 36E740 E006C570 8E020010 */ lw $v0, 0x10($s0)
/* 36E744 E006C574 2442FFE7 */ addiu $v0, $v0, -0x19
.LE006C578:
/* 36E748 E006C578 04410002 */ bgez $v0, .LE006C584
/* 36E74C E006C57C AE020010 */ sw $v0, 0x10($s0)
/* 36E750 E006C580 AE000010 */ sw $zero, 0x10($s0)
.LE006C584:
/* 36E754 E006C584 8FBF0020 */ lw $ra, 0x20($sp)
/* 36E758 E006C588 8FB3001C */ lw $s3, 0x1C($sp)
/* 36E75C E006C58C 8FB20018 */ lw $s2, 0x18($sp)
/* 36E760 E006C590 8FB10014 */ lw $s1, 0x14($sp)
/* 36E764 E006C594 8FB00010 */ lw $s0, 0x10($sp)
/* 36E768 E006C598 03E00008 */ jr $ra
/* 36E76C E006C59C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void lightning_update(EffectInstance* effect) {
LightningFXData* data = effect->data.lightning;
s32 unk_00;
if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
data->unk_14 = 0;
}
unk_00 = data->unk_00;
if (data->unk_14 < 100) {
data->unk_14--;
}
data->unk_18++;
if (data->unk_14 < 0) {
shim_remove_effect(effect);
if (data->unk_48 != NULL) {
shim_remove_effect(data->unk_48);
data->unk_48 = NULL;
}
if (data->unk_44 != NULL) {
shim_remove_effect(data->unk_44);
data->unk_44 = NULL;
}
} else {
s32 unk_14 = data->unk_14;
s32 unk_18 = data->unk_18;
if (data->unk_44 != NULL && unk_18 >= 18) {
shim_remove_effect(data->unk_44);
data->unk_44 = NULL;
}
if (unk_00 < 3 || unk_18 < 7) {
data->unk_1C += data->unk_2C;
if (data->unk_1C < 0.0f) {
data->unk_1C += 256.0f;
} else if (data->unk_1C > 256.0f) {
data->unk_1C -= 256.0f;
}
if (unk_18 % data->unk_3C == 0) {
data->unk_20 += data->unk_30;
if (data->unk_20 < 0.0f) {
data->unk_20 += 64.0f;
} else if (data->unk_20 > 64.0f) {
data->unk_20 -= 64.0f;
}
}
if (unk_18 % data->unk_40 == 0) {
data->unk_24 += data->unk_34;
if (data->unk_24 < 0.0f) {
data->unk_24 += 256.0f;
} else if (data->unk_24 > 256.0f) {
data->unk_24 -= 256.0f;
}
}
data->unk_28 += data->unk_38;
if (data->unk_28 < 0.0f) {
data->unk_28 += 64.0f;
}
else if (data->unk_28 > 64.0f) {
data->unk_28 -= 64.0f;
}
}
if (unk_00 >= 3) {
if (unk_18 >= 7) {
data->unk_10 -= 13;
if (data->unk_10 < 0) {
data->unk_10 = 0;
}
}
} else if (unk_14 < 10) {
data->unk_10 -= 25;
if (data->unk_10 < 0) {
data->unk_10 = 0;
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel pink_sparkles_main
/* 412730 E0124000 27BDFF90 */ addiu $sp, $sp, -0x70
/* 412734 E0124004 F7B40050 */ sdc1 $f20, 0x50($sp)
/* 412738 E0124008 4485A000 */ mtc1 $a1, $f20
/* 41273C E012400C F7B60058 */ sdc1 $f22, 0x58($sp)
/* 412740 E0124010 4486B000 */ mtc1 $a2, $f22
/* 412744 E0124014 AFA40070 */ sw $a0, 0x70($sp)
/* 412748 E0124018 27A40010 */ addiu $a0, $sp, 0x10
/* 41274C E012401C F7B80060 */ sdc1 $f24, 0x60($sp)
/* 412750 E0124020 4487C000 */ mtc1 $a3, $f24
/* 412754 E0124024 3C02E012 */ lui $v0, %hi(pink_sparkles_init)
/* 412758 E0124028 244242FC */ addiu $v0, $v0, %lo(pink_sparkles_init)
/* 41275C E012402C AFA20018 */ sw $v0, 0x18($sp)
/* 412760 E0124030 3C02E012 */ lui $v0, %hi(pink_sparkles_update)
/* 412764 E0124034 24424304 */ addiu $v0, $v0, %lo(pink_sparkles_update)
/* 412768 E0124038 AFA2001C */ sw $v0, 0x1C($sp)
/* 41276C E012403C 3C02E012 */ lui $v0, %hi(pink_sparkles_render)
/* 412770 E0124040 2442448C */ addiu $v0, $v0, %lo(pink_sparkles_render)
/* 412774 E0124044 AFA20020 */ sw $v0, 0x20($sp)
/* 412778 E0124048 24020084 */ addiu $v0, $zero, 0x84
/* 41277C E012404C AFBF004C */ sw $ra, 0x4C($sp)
/* 412780 E0124050 AFBE0048 */ sw $fp, 0x48($sp)
/* 412784 E0124054 AFB70044 */ sw $s7, 0x44($sp)
/* 412788 E0124058 AFB60040 */ sw $s6, 0x40($sp)
/* 41278C E012405C AFB5003C */ sw $s5, 0x3C($sp)
/* 412790 E0124060 AFB40038 */ sw $s4, 0x38($sp)
/* 412794 E0124064 AFB30034 */ sw $s3, 0x34($sp)
/* 412798 E0124068 AFB20030 */ sw $s2, 0x30($sp)
/* 41279C E012406C AFB1002C */ sw $s1, 0x2C($sp)
/* 4127A0 E0124070 AFB00028 */ sw $s0, 0x28($sp)
/* 4127A4 E0124074 F7BA0068 */ sdc1 $f26, 0x68($sp)
/* 4127A8 E0124078 AFA00010 */ sw $zero, 0x10($sp)
/* 4127AC E012407C AFA00024 */ sw $zero, 0x24($sp)
/* 4127B0 E0124080 0C080124 */ jal shim_create_effect_instance
/* 4127B4 E0124084 AFA20014 */ sw $v0, 0x14($sp)
/* 4127B8 E0124088 2404115C */ addiu $a0, $zero, 0x115C
/* 4127BC E012408C 24170065 */ addiu $s7, $zero, 0x65
/* 4127C0 E0124090 0040F02D */ daddu $fp, $v0, $zero
/* 4127C4 E0124094 0C08012C */ jal shim_general_heap_malloc
/* 4127C8 E0124098 AFD70008 */ sw $s7, 0x8($fp)
/* 4127CC E012409C 0040882D */ daddu $s1, $v0, $zero
/* 4127D0 E01240A0 16200003 */ bnez $s1, .LE01240B0
/* 4127D4 E01240A4 AFD1000C */ sw $s1, 0xC($fp)
.LE01240A8:
/* 4127D8 E01240A8 0804902A */ j .LE01240A8
/* 4127DC E01240AC 00000000 */ nop
.LE01240B0:
/* 4127E0 E01240B0 24020050 */ addiu $v0, $zero, 0x50
/* 4127E4 E01240B4 24120001 */ addiu $s2, $zero, 0x1
/* 4127E8 E01240B8 E6340004 */ swc1 $f20, 0x4($s1)
/* 4127EC E01240BC E6360008 */ swc1 $f22, 0x8($s1)
/* 4127F0 E01240C0 E638000C */ swc1 $f24, 0xC($s1)
/* 4127F4 E01240C4 AE200020 */ sw $zero, 0x20($s1)
/* 4127F8 E01240C8 8FA80070 */ lw $t0, 0x70($sp)
/* 4127FC E01240CC 3C01E012 */ lui $at, (0xE0124C00 >> 16)
/* 412800 E01240D0 D4384C00 */ ldc1 $f24, (0xE0124C00 & 0xFFFF)($at)
/* 412804 E01240D4 3C01E012 */ lui $at, (0xE0124C08 >> 16)
/* 412808 E01240D8 D4364C08 */ ldc1 $f22, (0xE0124C08 & 0xFFFF)($at)
/* 41280C E01240DC 0000A82D */ daddu $s5, $zero, $zero
/* 412810 E01240E0 AE22001C */ sw $v0, 0x1C($s1)
/* 412814 E01240E4 AE280000 */ sw $t0, 0x0($s1)
/* 412818 E01240E8 2631002C */ addiu $s1, $s1, 0x2C
/* 41281C E01240EC C7BA0084 */ lwc1 $f26, 0x84($sp)
/* 412820 E01240F0 0000982D */ daddu $s3, $zero, $zero
.LE01240F4:
/* 412824 E01240F4 2408000F */ addiu $t0, $zero, 0xF
/* 412828 E01240F8 01151023 */ subu $v0, $t0, $s5
/* 41282C E01240FC 0002B100 */ sll $s6, $v0, 4
/* 412830 E0124100 2414FFF0 */ addiu $s4, $zero, -0x10
/* 412834 E0124104 26300020 */ addiu $s0, $s1, 0x20
.LE0124108:
/* 412838 E0124108 8FA80070 */ lw $t0, 0x70($sp)
/* 41283C E012410C 02761021 */ addu $v0, $s3, $s6
/* 412840 E0124110 00081A00 */ sll $v1, $t0, 8
/* 412844 E0124114 00431021 */ addu $v0, $v0, $v1
/* 412848 E0124118 3C08E012 */ lui $t0, %hi(D_E01248C0)
/* 41284C E012411C 250848C0 */ addiu $t0, $t0, %lo(D_E01248C0)
/* 412850 E0124120 00481021 */ addu $v0, $v0, $t0
/* 412854 E0124124 80430000 */ lb $v1, 0x0($v0)
/* 412858 E0124128 2402002E */ addiu $v0, $zero, 0x2E
/* 41285C E012412C 50620049 */ beql $v1, $v0, .LE0124254
/* 412860 E0124130 26730001 */ addiu $s3, $s3, 0x1
/* 412864 E0124134 0C080138 */ jal shim_rand_int
/* 412868 E0124138 24040014 */ addiu $a0, $zero, 0x14
/* 41286C E012413C 2442FFF6 */ addiu $v0, $v0, -0xA
/* 412870 E0124140 44820000 */ mtc1 $v0, $f0
/* 412874 E0124144 00000000 */ nop
/* 412878 E0124148 46800021 */ cvt.d.w $f0, $f0
/* 41287C E012414C 46380002 */ mul.d $f0, $f0, $f24
/* 412880 E0124150 00000000 */ nop
/* 412884 E0124154 4494A000 */ mtc1 $s4, $f20
/* 412888 E0124158 00000000 */ nop
/* 41288C E012415C 4680A521 */ cvt.d.w $f20, $f20
/* 412890 E0124160 4620A500 */ add.d $f20, $f20, $f0
/* 412894 E0124164 4600D306 */ mov.s $f12, $f26
/* 412898 E0124168 0C080144 */ jal shim_cos_deg
/* 41289C E012416C 4620A520 */ cvt.s.d $f20, $f20
/* 4128A0 E0124170 4600A002 */ mul.s $f0, $f20, $f0
/* 4128A4 E0124174 00000000 */ nop
/* 4128A8 E0124178 24040014 */ addiu $a0, $zero, 0x14
/* 4128AC E012417C 0C080138 */ jal shim_rand_int
/* 4128B0 E0124180 E600FFE4 */ swc1 $f0, -0x1C($s0)
/* 4128B4 E0124184 2442FFF6 */ addiu $v0, $v0, -0xA
/* 4128B8 E0124188 44821000 */ mtc1 $v0, $f2
/* 4128BC E012418C 00000000 */ nop
/* 4128C0 E0124190 468010A1 */ cvt.d.w $f2, $f2
/* 4128C4 E0124194 46381082 */ mul.d $f2, $f2, $f24
/* 4128C8 E0124198 00000000 */ nop
/* 4128CC E012419C 00151040 */ sll $v0, $s5, 1
/* 4128D0 E01241A0 44820000 */ mtc1 $v0, $f0
/* 4128D4 E01241A4 00000000 */ nop
/* 4128D8 E01241A8 46800021 */ cvt.d.w $f0, $f0
/* 4128DC E01241AC 46220000 */ add.d $f0, $f0, $f2
/* 4128E0 E01241B0 4600D306 */ mov.s $f12, $f26
/* 4128E4 E01241B4 46200020 */ cvt.s.d $f0, $f0
/* 4128E8 E01241B8 0C080140 */ jal shim_sin_deg
/* 4128EC E01241BC E600FFE8 */ swc1 $f0, -0x18($s0)
/* 4128F0 E01241C0 C602FFE4 */ lwc1 $f2, -0x1C($s0)
/* 4128F4 E01241C4 460010A1 */ cvt.d.s $f2, $f2
/* 4128F8 E01241C8 46361082 */ mul.d $f2, $f2, $f22
/* 4128FC E01241CC 00000000 */ nop
/* 412900 E01241D0 4600A502 */ mul.s $f20, $f20, $f0
/* 412904 E01241D4 00000000 */ nop
/* 412908 E01241D8 C600FFE8 */ lwc1 $f0, -0x18($s0)
/* 41290C E01241DC 46000021 */ cvt.d.s $f0, $f0
/* 412910 E01241E0 46360002 */ mul.d $f0, $f0, $f22
/* 412914 E01241E4 00000000 */ nop
/* 412918 E01241E8 2404000A */ addiu $a0, $zero, 0xA
/* 41291C E01241EC E614FFEC */ swc1 $f20, -0x14($s0)
/* 412920 E01241F0 462010A0 */ cvt.s.d $f2, $f2
/* 412924 E01241F4 46200020 */ cvt.s.d $f0, $f0
/* 412928 E01241F8 E602FFF0 */ swc1 $f2, -0x10($s0)
/* 41292C E01241FC 0C080138 */ jal shim_rand_int
/* 412930 E0124200 E600FFF4 */ swc1 $f0, -0xC($s0)
/* 412934 E0124204 3C01E012 */ lui $at, (0xE0124C10 >> 16)
/* 412938 E0124208 D4224C10 */ ldc1 $f2, (0xE0124C10 & 0xFFFF)($at)
/* 41293C E012420C 44820000 */ mtc1 $v0, $f0
/* 412940 E0124210 00000000 */ nop
/* 412944 E0124214 46800021 */ cvt.d.w $f0, $f0
/* 412948 E0124218 46220002 */ mul.d $f0, $f0, $f2
/* 41294C E012421C 00000000 */ nop
/* 412950 E0124220 26520001 */ addiu $s2, $s2, 0x1
/* 412954 E0124224 2631002C */ addiu $s1, $s1, 0x2C
/* 412958 E0124228 24040007 */ addiu $a0, $zero, 0x7
/* 41295C E012422C 46200020 */ cvt.s.d $f0, $f0
/* 412960 E0124230 0C080138 */ jal shim_rand_int
/* 412964 E0124234 E600FFF8 */ swc1 $f0, -0x8($s0)
/* 412968 E0124238 2442001E */ addiu $v0, $v0, 0x1E
/* 41296C E012423C AE02FFFC */ sw $v0, -0x4($s0)
/* 412970 E0124240 AE000000 */ sw $zero, 0x0($s0)
/* 412974 E0124244 0257102A */ slt $v0, $s2, $s7
/* 412978 E0124248 1040001B */ beqz $v0, .LE01242B8
/* 41297C E012424C 2610002C */ addiu $s0, $s0, 0x2C
/* 412980 E0124250 26730001 */ addiu $s3, $s3, 0x1
.LE0124254:
/* 412984 E0124254 2A620010 */ slti $v0, $s3, 0x10
/* 412988 E0124258 1440FFAB */ bnez $v0, .LE0124108
/* 41298C E012425C 26940002 */ addiu $s4, $s4, 0x2
/* 412990 E0124260 0257102A */ slt $v0, $s2, $s7
/* 412994 E0124264 10400014 */ beqz $v0, .LE01242B8
/* 412998 E0124268 26B50001 */ addiu $s5, $s5, 0x1
/* 41299C E012426C 2AA20010 */ slti $v0, $s5, 0x10
/* 4129A0 E0124270 5440FFA0 */ bnel $v0, $zero, .LE01240F4
/* 4129A4 E0124274 0000982D */ daddu $s3, $zero, $zero
/* 4129A8 E0124278 44800000 */ mtc1 $zero, $f0
/* 4129AC E012427C 2404FFFF */ addiu $a0, $zero, -0x1
/* 4129B0 E0124280 26230020 */ addiu $v1, $s1, 0x20
.LE0124284:
/* 4129B4 E0124284 26520001 */ addiu $s2, $s2, 0x1
/* 4129B8 E0124288 E4600004 */ swc1 $f0, 0x4($v1)
/* 4129BC E012428C E460FFF8 */ swc1 $f0, -0x8($v1)
/* 4129C0 E0124290 E460FFF4 */ swc1 $f0, -0xC($v1)
/* 4129C4 E0124294 E460FFF0 */ swc1 $f0, -0x10($v1)
/* 4129C8 E0124298 E460FFEC */ swc1 $f0, -0x14($v1)
/* 4129CC E012429C E460FFE8 */ swc1 $f0, -0x18($v1)
/* 4129D0 E01242A0 E460FFE4 */ swc1 $f0, -0x1C($v1)
/* 4129D4 E01242A4 AC64FFFC */ sw $a0, -0x4($v1)
/* 4129D8 E01242A8 AC600000 */ sw $zero, 0x0($v1)
/* 4129DC E01242AC 0257102A */ slt $v0, $s2, $s7
/* 4129E0 E01242B0 1440FFF4 */ bnez $v0, .LE0124284
/* 4129E4 E01242B4 2463002C */ addiu $v1, $v1, 0x2C
.LE01242B8:
/* 4129E8 E01242B8 03C0102D */ daddu $v0, $fp, $zero
/* 4129EC E01242BC 8FBF004C */ lw $ra, 0x4C($sp)
/* 4129F0 E01242C0 8FBE0048 */ lw $fp, 0x48($sp)
/* 4129F4 E01242C4 8FB70044 */ lw $s7, 0x44($sp)
/* 4129F8 E01242C8 8FB60040 */ lw $s6, 0x40($sp)
/* 4129FC E01242CC 8FB5003C */ lw $s5, 0x3C($sp)
/* 412A00 E01242D0 8FB40038 */ lw $s4, 0x38($sp)
/* 412A04 E01242D4 8FB30034 */ lw $s3, 0x34($sp)
/* 412A08 E01242D8 8FB20030 */ lw $s2, 0x30($sp)
/* 412A0C E01242DC 8FB1002C */ lw $s1, 0x2C($sp)
/* 412A10 E01242E0 8FB00028 */ lw $s0, 0x28($sp)
/* 412A14 E01242E4 D7BA0068 */ ldc1 $f26, 0x68($sp)
/* 412A18 E01242E8 D7B80060 */ ldc1 $f24, 0x60($sp)
/* 412A1C E01242EC D7B60058 */ ldc1 $f22, 0x58($sp)
/* 412A20 E01242F0 D7B40050 */ ldc1 $f20, 0x50($sp)
/* 412A24 E01242F4 03E00008 */ jr $ra
/* 412A28 E01242F8 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
EffectInstance* pink_sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) {
EffectBlueprint bp;
EffectInstance* effect;
PinkSparklesFXData* part;
s32 numParts = 101;
s32 count;
f32 angle;
s32 i;
s32 j;
bp.init = pink_sparkles_init;
bp.update = pink_sparkles_update;
bp.renderWorld = pink_sparkles_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_PINK_SPARKLES;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
part = effect->data.pinkSparkles = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.pinkSparkles != NULL);
part->unk_04 = arg1;
part->unk_08 = arg2;
part->unk_0C = arg3;
part->unk_20 = 0;
part->unk_00 = arg0;
part->unk_1C = 80;
part++;
angle = arg5;
count = 1;
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
if (D_E01248C0[j + (15 - i) * 16 + arg0 * 256] != 46) {
f32 temp_f20 = j * 2 - 16 + (shim_rand_int(20) - 10) * 0.1;
part->unk_04 = temp_f20 * shim_cos_deg(angle);
part->unk_08 = i * 2 + (shim_rand_int(20) - 10) * 0.1;
part->unk_0C = temp_f20 * shim_sin_deg(angle);
part->unk_10 = part->unk_04 * 0.04;
part->unk_14 = part->unk_08 * 0.04;
part->unk_18 = shim_rand_int(10) * 0.001;
part->unk_1C = shim_rand_int(7) + 30;
part->unk_20 = 0;
count++;
part++;
if (count >= numParts) {
break;
}
}
}
if (count >= numParts) {
break;
}
}
for (; count < numParts; count++, part++) {
part->unk_04 = part->unk_08 = part->unk_0C =
part->unk_10 = part->unk_14 = part->unk_18 =
part->unk_24 = 0.0f;
part->unk_1C = -1;
part->unk_20 = 0;
};
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel firework_rocket_update
/* 3E452C E010A18C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 3E4530 E010A190 AFBF001C */ sw $ra, 0x1C($sp)
/* 3E4534 E010A194 AFB20018 */ sw $s2, 0x18($sp)
/* 3E4538 E010A198 AFB10014 */ sw $s1, 0x14($sp)
/* 3E453C E010A19C AFB00010 */ sw $s0, 0x10($sp)
/* 3E4540 E010A1A0 F7B40020 */ sdc1 $f20, 0x20($sp)
/* 3E4544 E010A1A4 8C830000 */ lw $v1, 0x0($a0)
/* 3E4548 E010A1A8 8C91000C */ lw $s1, 0xC($a0)
/* 3E454C E010A1AC 30620010 */ andi $v0, $v1, 0x10
/* 3E4550 E010A1B0 10400005 */ beqz $v0, .LE010A1C8
/* 3E4554 E010A1B4 2402FFEF */ addiu $v0, $zero, -0x11
/* 3E4558 E010A1B8 00621024 */ and $v0, $v1, $v0
/* 3E455C E010A1BC AC820000 */ sw $v0, 0x0($a0)
/* 3E4560 E010A1C0 24020010 */ addiu $v0, $zero, 0x10
/* 3E4564 E010A1C4 AE22001C */ sw $v0, 0x1C($s1)
.LE010A1C8:
/* 3E4568 E010A1C8 8E23001C */ lw $v1, 0x1C($s1)
/* 3E456C E010A1CC 286203E8 */ slti $v0, $v1, 0x3E8
/* 3E4570 E010A1D0 10400002 */ beqz $v0, .LE010A1DC
/* 3E4574 E010A1D4 2462FFFF */ addiu $v0, $v1, -0x1
/* 3E4578 E010A1D8 AE22001C */ sw $v0, 0x1C($s1)
.LE010A1DC:
/* 3E457C E010A1DC 8E220020 */ lw $v0, 0x20($s1)
/* 3E4580 E010A1E0 8E25001C */ lw $a1, 0x1C($s1)
/* 3E4584 E010A1E4 24420001 */ addiu $v0, $v0, 0x1
/* 3E4588 E010A1E8 04A10005 */ bgez $a1, .LE010A200
/* 3E458C E010A1EC AE220020 */ sw $v0, 0x20($s1)
/* 3E4590 E010A1F0 0C080128 */ jal shim_remove_effect
/* 3E4594 E010A1F4 00000000 */ nop
/* 3E4598 E010A1F8 08042921 */ j .LE010A484
/* 3E459C E010A1FC 00000000 */ nop
.LE010A200:
/* 3E45A0 E010A200 0040902D */ daddu $s2, $v0, $zero
/* 3E45A4 E010A204 28A20020 */ slti $v0, $a1, 0x20
/* 3E45A8 E010A208 10400002 */ beqz $v0, .LE010A214
/* 3E45AC E010A20C 000510C0 */ sll $v0, $a1, 3
/* 3E45B0 E010A210 AE220030 */ sw $v0, 0x30($s1)
.LE010A214:
/* 3E45B4 E010A214 8E23004C */ lw $v1, 0x4C($s1)
/* 3E45B8 E010A218 24020001 */ addiu $v0, $zero, 0x1
/* 3E45BC E010A21C 1462002F */ bne $v1, $v0, .LE010A2DC
/* 3E45C0 E010A220 24020020 */ addiu $v0, $zero, 0x20
/* 3E45C4 E010A224 C6260044 */ lwc1 $f6, 0x44($s1)
/* 3E45C8 E010A228 C6240048 */ lwc1 $f4, 0x48($s1)
/* 3E45CC E010A22C 46062101 */ sub.s $f4, $f4, $f6
/* 3E45D0 E010A230 3C01E011 */ lui $at, (0xE0110000 >> 16)
/* 3E45D4 E010A234 D420AF90 */ ldc1 $f0, -0x5070($at)
/* 3E45D8 E010A238 46002121 */ cvt.d.s $f4, $f4
/* 3E45DC E010A23C 46202102 */ mul.d $f4, $f4, $f0
/* 3E45E0 E010A240 00000000 */ nop
/* 3E45E4 E010A244 3C013F73 */ lui $at, (0x3F733333 >> 16)
/* 3E45E8 E010A248 34213333 */ ori $at, $at, (0x3F733333 & 0xFFFF)
/* 3E45EC E010A24C 44818000 */ mtc1 $at, $f16
/* 3E45F0 E010A250 C62E0010 */ lwc1 $f14, 0x10($s1)
/* 3E45F4 E010A254 46107382 */ mul.s $f14, $f14, $f16
/* 3E45F8 E010A258 00000000 */ nop
/* 3E45FC E010A25C C62C0018 */ lwc1 $f12, 0x18($s1)
/* 3E4600 E010A260 46106302 */ mul.s $f12, $f12, $f16
/* 3E4604 E010A264 00000000 */ nop
/* 3E4608 E010A268 C62A0004 */ lwc1 $f10, 0x4($s1)
/* 3E460C E010A26C C6200010 */ lwc1 $f0, 0x10($s1)
/* 3E4610 E010A270 C6280008 */ lwc1 $f8, 0x8($s1)
/* 3E4614 E010A274 46005280 */ add.s $f10, $f10, $f0
/* 3E4618 E010A278 C6200014 */ lwc1 $f0, 0x14($s1)
/* 3E461C E010A27C C622000C */ lwc1 $f2, 0xC($s1)
/* 3E4620 E010A280 46004200 */ add.s $f8, $f8, $f0
/* 3E4624 E010A284 C6200018 */ lwc1 $f0, 0x18($s1)
/* 3E4628 E010A288 46001080 */ add.s $f2, $f2, $f0
/* 3E462C E010A28C C6200014 */ lwc1 $f0, 0x14($s1)
/* 3E4630 E010A290 460031A1 */ cvt.d.s $f6, $f6
/* 3E4634 E010A294 E62E0010 */ swc1 $f14, 0x10($s1)
/* 3E4638 E010A298 E62C0018 */ swc1 $f12, 0x18($s1)
/* 3E463C E010A29C 46100002 */ mul.s $f0, $f0, $f16
/* 3E4640 E010A2A0 00000000 */ nop
/* 3E4644 E010A2A4 E62A0004 */ swc1 $f10, 0x4($s1)
/* 3E4648 E010A2A8 E6280008 */ swc1 $f8, 0x8($s1)
/* 3E464C E010A2AC E622000C */ swc1 $f2, 0xC($s1)
/* 3E4650 E010A2B0 3C01E011 */ lui $at, (0xE0110000 >> 16)
/* 3E4654 E010A2B4 D422AF98 */ ldc1 $f2, -0x5068($at)
/* 3E4658 E010A2B8 46243180 */ add.d $f6, $f6, $f4
/* 3E465C E010A2BC E6200014 */ swc1 $f0, 0x14($s1)
/* 3E4660 E010A2C0 46000021 */ cvt.d.s $f0, $f0
/* 3E4664 E010A2C4 46220001 */ sub.d $f0, $f0, $f2
/* 3E4668 E010A2C8 462031A0 */ cvt.s.d $f6, $f6
/* 3E466C E010A2CC E6260044 */ swc1 $f6, 0x44($s1)
/* 3E4670 E010A2D0 46200020 */ cvt.s.d $f0, $f0
/* 3E4674 E010A2D4 08042921 */ j .LE010A484
/* 3E4678 E010A2D8 E6200014 */ swc1 $f0, 0x14($s1)
.LE010A2DC:
/* 3E467C E010A2DC 00521023 */ subu $v0, $v0, $s2
/* 3E4680 E010A2E0 4482A000 */ mtc1 $v0, $f20
/* 3E4684 E010A2E4 00000000 */ nop
/* 3E4688 E010A2E8 4680A520 */ cvt.s.w $f20, $f20
/* 3E468C E010A2EC 32440003 */ andi $a0, $s2, 0x3
/* 3E4690 E010A2F0 00048080 */ sll $s0, $a0, 2
/* 3E4694 E010A2F4 02308021 */ addu $s0, $s1, $s0
/* 3E4698 E010A2F8 00121840 */ sll $v1, $s2, 1
/* 3E469C E010A2FC C6200010 */ lwc1 $f0, 0x10($s1)
/* 3E46A0 E010A300 00721821 */ addu $v1, $v1, $s2
/* 3E46A4 E010A304 46140002 */ mul.s $f0, $f0, $f20
/* 3E46A8 E010A308 00000000 */ nop
/* 3E46AC E010A30C 00031100 */ sll $v0, $v1, 4
/* 3E46B0 E010A310 00431023 */ subu $v0, $v0, $v1
/* 3E46B4 E010A314 C6220004 */ lwc1 $f2, 0x4($s1)
/* 3E46B8 E010A318 00021040 */ sll $v0, $v0, 1
/* 3E46BC E010A31C 46001081 */ sub.s $f2, $f2, $f0
/* 3E46C0 E010A320 00021143 */ sra $v0, $v0, 5
/* 3E46C4 E010A324 44826000 */ mtc1 $v0, $f12
/* 3E46C8 E010A328 00000000 */ nop
/* 3E46CC E010A32C 46806320 */ cvt.s.w $f12, $f12
/* 3E46D0 E010A330 0C080140 */ jal shim_sin_deg
/* 3E46D4 E010A334 E6020050 */ swc1 $f2, 0x50($s0)
/* 3E46D8 E010A338 C6260014 */ lwc1 $f6, 0x14($s1)
/* 3E46DC E010A33C 46143182 */ mul.s $f6, $f6, $f20
/* 3E46E0 E010A340 00000000 */ nop
/* 3E46E4 E010A344 3C0142A0 */ lui $at, (0x42A00000 >> 16)
/* 3E46E8 E010A348 44812000 */ mtc1 $at, $f4
/* 3E46EC E010A34C 00000000 */ nop
/* 3E46F0 E010A350 46040002 */ mul.s $f0, $f0, $f4
/* 3E46F4 E010A354 00000000 */ nop
/* 3E46F8 E010A358 C6220008 */ lwc1 $f2, 0x8($s1)
/* 3E46FC E010A35C 46061081 */ sub.s $f2, $f2, $f6
/* 3E4700 E010A360 46002101 */ sub.s $f4, $f4, $f0
/* 3E4704 E010A364 46041081 */ sub.s $f2, $f2, $f4
/* 3E4708 E010A368 E6020060 */ swc1 $f2, 0x60($s0)
/* 3E470C E010A36C C6200018 */ lwc1 $f0, 0x18($s1)
/* 3E4710 E010A370 46140002 */ mul.s $f0, $f0, $f20
/* 3E4714 E010A374 00000000 */ nop
/* 3E4718 E010A378 C622000C */ lwc1 $f2, 0xC($s1)
/* 3E471C E010A37C 46001081 */ sub.s $f2, $f2, $f0
/* 3E4720 E010A380 2404000A */ addiu $a0, $zero, 0xA
/* 3E4724 E010A384 0C080138 */ jal shim_rand_int
/* 3E4728 E010A388 E6020070 */ swc1 $f2, 0x70($s0)
/* 3E472C E010A38C 2442FFFB */ addiu $v0, $v0, -0x5
/* 3E4730 E010A390 3C013DCC */ lui $at, (0x3DCCCCCD >> 16)
/* 3E4734 E010A394 3421CCCD */ ori $at, $at, (0x3DCCCCCD & 0xFFFF)
/* 3E4738 E010A398 4481A000 */ mtc1 $at, $f20
/* 3E473C E010A39C 44820000 */ mtc1 $v0, $f0
/* 3E4740 E010A3A0 00000000 */ nop
/* 3E4744 E010A3A4 46800020 */ cvt.s.w $f0, $f0
/* 3E4748 E010A3A8 46140002 */ mul.s $f0, $f0, $f20
/* 3E474C E010A3AC 00000000 */ nop
/* 3E4750 E010A3B0 2404000A */ addiu $a0, $zero, 0xA
/* 3E4754 E010A3B4 0C080138 */ jal shim_rand_int
/* 3E4758 E010A3B8 E6000080 */ swc1 $f0, 0x80($s0)
/* 3E475C E010A3BC 2442FFFB */ addiu $v0, $v0, -0x5
/* 3E4760 E010A3C0 44820000 */ mtc1 $v0, $f0
/* 3E4764 E010A3C4 00000000 */ nop
/* 3E4768 E010A3C8 46800020 */ cvt.s.w $f0, $f0
/* 3E476C E010A3CC 46140002 */ mul.s $f0, $f0, $f20
/* 3E4770 E010A3D0 00000000 */ nop
/* 3E4774 E010A3D4 2404000A */ addiu $a0, $zero, 0xA
/* 3E4778 E010A3D8 0C080138 */ jal shim_rand_int
/* 3E477C E010A3DC E6000090 */ swc1 $f0, 0x90($s0)
/* 3E4780 E010A3E0 0000202D */ daddu $a0, $zero, $zero
/* 3E4784 E010A3E4 2442FFFB */ addiu $v0, $v0, -0x5
/* 3E4788 E010A3E8 44820000 */ mtc1 $v0, $f0
/* 3E478C E010A3EC 00000000 */ nop
/* 3E4790 E010A3F0 46800020 */ cvt.s.w $f0, $f0
/* 3E4794 E010A3F4 46140002 */ mul.s $f0, $f0, $f20
/* 3E4798 E010A3F8 00000000 */ nop
/* 3E479C E010A3FC 2A45001B */ slti $a1, $s2, 0x1B
/* 3E47A0 E010A400 3C01E011 */ lui $at, (0xE0110000 >> 16)
/* 3E47A4 E010A404 D42AAFA0 */ ldc1 $f10, -0x5060($at)
/* 3E47A8 E010A408 3C01C47A */ lui $at, (0xC47A0000 >> 16)
/* 3E47AC E010A40C 44816000 */ mtc1 $at, $f12
/* 3E47B0 E010A410 0220182D */ daddu $v1, $s1, $zero
/* 3E47B4 E010A414 E60000A0 */ swc1 $f0, 0xA0($s0)
.LE010A418:
/* 3E47B8 E010A418 C4660050 */ lwc1 $f6, 0x50($v1)
/* 3E47BC E010A41C C4600080 */ lwc1 $f0, 0x80($v1)
/* 3E47C0 E010A420 C4640070 */ lwc1 $f4, 0x70($v1)
/* 3E47C4 E010A424 46003180 */ add.s $f6, $f6, $f0
/* 3E47C8 E010A428 C46200A0 */ lwc1 $f2, 0xA0($v1)
/* 3E47CC E010A42C C4680060 */ lwc1 $f8, 0x60($v1)
/* 3E47D0 E010A430 46022100 */ add.s $f4, $f4, $f2
/* 3E47D4 E010A434 C4600090 */ lwc1 $f0, 0x90($v1)
/* 3E47D8 E010A438 46004200 */ add.s $f8, $f8, $f0
/* 3E47DC E010A43C 46000021 */ cvt.d.s $f0, $f0
/* 3E47E0 E010A440 462A0001 */ sub.d $f0, $f0, $f10
/* 3E47E4 E010A444 E4660050 */ swc1 $f6, 0x50($v1)
/* 3E47E8 E010A448 E4640070 */ swc1 $f4, 0x70($v1)
/* 3E47EC E010A44C 46200020 */ cvt.s.d $f0, $f0
/* 3E47F0 E010A450 E4680060 */ swc1 $f8, 0x60($v1)
/* 3E47F4 E010A454 14A00002 */ bnez $a1, .LE010A460
/* 3E47F8 E010A458 E4600090 */ swc1 $f0, 0x90($v1)
/* 3E47FC E010A45C E46C0060 */ swc1 $f12, 0x60($v1)
.LE010A460:
/* 3E4800 E010A460 24840001 */ addiu $a0, $a0, 0x1
/* 3E4804 E010A464 28820004 */ slti $v0, $a0, 0x4
/* 3E4808 E010A468 1440FFEB */ bnez $v0, .LE010A418
/* 3E480C E010A46C 24630004 */ addiu $v1, $v1, 0x4
/* 3E4810 E010A470 2A420020 */ slti $v0, $s2, 0x20
/* 3E4814 E010A474 14400003 */ bnez $v0, .LE010A484
/* 3E4818 E010A478 24020001 */ addiu $v0, $zero, 0x1
/* 3E481C E010A47C AE22004C */ sw $v0, 0x4C($s1)
/* 3E4820 E010A480 AE220020 */ sw $v0, 0x20($s1)
.LE010A484:
/* 3E4824 E010A484 8FBF001C */ lw $ra, 0x1C($sp)
/* 3E4828 E010A488 8FB20018 */ lw $s2, 0x18($sp)
/* 3E482C E010A48C 8FB10014 */ lw $s1, 0x14($sp)
/* 3E4830 E010A490 8FB00010 */ lw $s0, 0x10($sp)
/* 3E4834 E010A494 D7B40020 */ ldc1 $f20, 0x20($sp)
/* 3E4838 E010A498 03E00008 */ jr $ra
/* 3E483C E010A49C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void firework_rocket_update(EffectInstance* effect) {
FireworkRocketFXData* data = effect->data.fireworkRocket;
f32 factor;
s32 lifeTime;
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->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
lifeTime = data->lifeTime;
if (data->timeLeft < 32) {
data->minBlurAlpha = data->timeLeft * 8;
}
if (data->isExploded == TRUE) {
factor = 0.95f;
data->pos.x += data->velocity.x;
data->pos.y += data->velocity.y;
data->pos.z += data->velocity.z;
data->velocity.x *= factor;
data->velocity.y *= factor;
data->velocity.z *= factor;
data->radius += (data->maxRadius - data->radius) * 0.11;
data->velocity.y -= 0.15;
return;
}
i = lifeTime & 3;
data->rocketX[i] = data->pos.x - data->velocity.x * (32 - lifeTime);
data->rocketY[i] = data->pos.y - data->velocity.y * (32 - lifeTime)
- (80.0f - shim_sin_deg((s32)(lifeTime * 90) >> 5) * 80.0f);
data->rocketZ[i] = data->pos.z - data->velocity.z * (32 - lifeTime);
data->rocketVelocityX[i] = (shim_rand_int(10) - 5) * 0.1f;
data->rocketVelocityY[i] = (shim_rand_int(10) - 5) * 0.1f;
data->rocketVelocityZ[i] = (shim_rand_int(10) - 5) * 0.1f;
for (i = 0; i < 4; i++) {
data->rocketX[i] += data->rocketVelocityX[i];
data->rocketY[i] += data->rocketVelocityY[i];
data->rocketZ[i] += data->rocketVelocityZ[i];
data->rocketVelocityY[i] -= 0.15;
if (lifeTime >= 27) {
data->rocketY[i] = NPC_DISPOSE_POS_Y;
}
}
if (lifeTime >= 32) {
data->isExploded = TRUE;
data->lifeTime = 1;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel __osInitialize_common
/* 45B08 8006A708 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 45B0C 8006A70C 24020001 */ addiu $v0, $zero, 0x1
/* 45B10 8006A710 AFBF0018 */ sw $ra, 0x18($sp)
/* 45B14 8006A714 3C01800A */ lui $at, %hi(__osFinalrom)
/* 45B18 8006A718 0C01B19C */ jal __osGetSR
/* 45B1C 8006A71C AC22A660 */ sw $v0, %lo(__osFinalrom)($at)
/* 45B20 8006A720 3C042000 */ lui $a0, (0x20000000 >> 16)
/* 45B24 8006A724 0C01B1A8 */ jal __osSetSR
/* 45B28 8006A728 00442025 */ or $a0, $v0, $a0
/* 45B2C 8006A72C 3C040100 */ lui $a0, (0x1000800 >> 16)
/* 45B30 8006A730 0C01B1A4 */ jal __osSetFpcCsr
/* 45B34 8006A734 34840800 */ ori $a0, $a0, (0x1000800 & 0xFFFF)
/* 45B38 8006A738 0C01B1AC */ jal __osSetWatchLo
/* 45B3C 8006A73C 3C040490 */ lui $a0, (0x4900000 >> 16)
/* 45B40 8006A740 3C041FC0 */ lui $a0, (0x1FC007FC >> 16)
.L8006A744:
/* 45B44 8006A744 348407FC */ ori $a0, $a0, (0x1FC007FC & 0xFFFF)
/* 45B48 8006A748 0C01B1F0 */ jal __osSiRawReadIo
/* 45B4C 8006A74C 27A50010 */ addiu $a1, $sp, 0x10
/* 45B50 8006A750 1440FFFC */ bnez $v0, .L8006A744
/* 45B54 8006A754 3C041FC0 */ lui $a0, (0x1FC007FC >> 16)
.L8006A758:
/* 45B58 8006A758 8FA50010 */ lw $a1, 0x10($sp)
/* 45B5C 8006A75C 3C041FC0 */ lui $a0, (0x1FC007FC >> 16)
/* 45B60 8006A760 348407FC */ ori $a0, $a0, (0x1FC007FC & 0xFFFF)
/* 45B64 8006A764 0C01B204 */ jal __osSiRawWriteIo
/* 45B68 8006A768 34A50008 */ ori $a1, $a1, 0x8
/* 45B6C 8006A76C 1440FFFA */ bnez $v0, .L8006A758
/* 45B70 8006A770 00000000 */ nop
/* 45B74 8006A774 3C028007 */ lui $v0, %hi(__osExceptionPreamble)
/* 45B78 8006A778 2442A9F0 */ addiu $v0, $v0, %lo(__osExceptionPreamble)
/* 45B7C 8006A77C 3C068000 */ lui $a2, %hi(func_80000000)
/* 45B80 8006A780 8C430000 */ lw $v1, 0x0($v0)
/* 45B84 8006A784 8C440004 */ lw $a0, 0x4($v0)
/* 45B88 8006A788 8C450008 */ lw $a1, 0x8($v0)
/* 45B8C 8006A78C ACC30000 */ sw $v1, %lo(func_80000000)($a2)
/* 45B90 8006A790 ACC40004 */ sw $a0, %lo(D_80000004)($a2)
/* 45B94 8006A794 ACC50008 */ sw $a1, %lo(D_80000008)($a2)
/* 45B98 8006A798 8C43000C */ lw $v1, 0xC($v0)
/* 45B9C 8006A79C ACC3000C */ sw $v1, %lo(D_8000000C)($a2)
/* 45BA0 8006A7A0 3C068000 */ lui $a2, (0x80000080 >> 16)
/* 45BA4 8006A7A4 34C60080 */ ori $a2, $a2, (0x80000080 & 0xFFFF)
/* 45BA8 8006A7A8 8C430000 */ lw $v1, 0x0($v0)
/* 45BAC 8006A7AC 8C440004 */ lw $a0, 0x4($v0)
/* 45BB0 8006A7B0 8C450008 */ lw $a1, 0x8($v0)
/* 45BB4 8006A7B4 ACC30000 */ sw $v1, 0x0($a2)
/* 45BB8 8006A7B8 ACC40004 */ sw $a0, 0x4($a2)
/* 45BBC 8006A7BC ACC50008 */ sw $a1, 0x8($a2)
/* 45BC0 8006A7C0 8C43000C */ lw $v1, 0xC($v0)
/* 45BC4 8006A7C4 ACC3000C */ sw $v1, 0xC($a2)
/* 45BC8 8006A7C8 3C068000 */ lui $a2, (0x80000100 >> 16)
/* 45BCC 8006A7CC 34C60100 */ ori $a2, $a2, (0x80000100 & 0xFFFF)
/* 45BD0 8006A7D0 8C430000 */ lw $v1, 0x0($v0)
/* 45BD4 8006A7D4 8C440004 */ lw $a0, 0x4($v0)
/* 45BD8 8006A7D8 8C450008 */ lw $a1, 0x8($v0)
/* 45BDC 8006A7DC ACC30000 */ sw $v1, 0x0($a2)
/* 45BE0 8006A7E0 ACC40004 */ sw $a0, 0x4($a2)
/* 45BE4 8006A7E4 ACC50008 */ sw $a1, 0x8($a2)
/* 45BE8 8006A7E8 8C43000C */ lw $v1, 0xC($v0)
/* 45BEC 8006A7EC ACC3000C */ sw $v1, 0xC($a2)
/* 45BF0 8006A7F0 3C068000 */ lui $a2, (0x80000180 >> 16)
/* 45BF4 8006A7F4 34C60180 */ ori $a2, $a2, (0x80000180 & 0xFFFF)
/* 45BF8 8006A7F8 8C430000 */ lw $v1, 0x0($v0)
/* 45BFC 8006A7FC 8C440004 */ lw $a0, 0x4($v0)
/* 45C00 8006A800 8C450008 */ lw $a1, 0x8($v0)
/* 45C04 8006A804 ACC30000 */ sw $v1, 0x0($a2)
/* 45C08 8006A808 ACC40004 */ sw $a0, 0x4($a2)
/* 45C0C 8006A80C ACC50008 */ sw $a1, 0x8($a2)
/* 45C10 8006A810 8C43000C */ lw $v1, 0xC($v0)
/* 45C14 8006A814 ACC3000C */ sw $v1, 0xC($a2)
/* 45C18 8006A818 3C048000 */ lui $a0, (0x80000000 >> 16)
/* 45C1C 8006A81C 0C018614 */ jal osWritebackDCache
/* 45C20 8006A820 24050190 */ addiu $a1, $zero, 0x190
/* 45C24 8006A824 3C048000 */ lui $a0, (0x80000000 >> 16)
/* 45C28 8006A828 0C0185F4 */ jal osInvalICache
/* 45C2C 8006A82C 24050190 */ addiu $a1, $zero, 0x190
/* 45C30 8006A830 3C05A460 */ lui $a1, (0xA4600014 >> 16)
/* 45C34 8006A834 34A50014 */ ori $a1, $a1, (0xA4600014 & 0xFFFF)
/* 45C38 8006A838 3C06A460 */ lui $a2, (0xA4600018 >> 16)
/* 45C3C 8006A83C 34C60018 */ ori $a2, $a2, (0xA4600018 & 0xFFFF)
/* 45C40 8006A840 3C07A460 */ lui $a3, (0xA460001C >> 16)
/* 45C44 8006A844 34E7001C */ ori $a3, $a3, (0xA460001C & 0xFFFF)
/* 45C48 8006A848 3C08A460 */ lui $t0, (0xA4600020 >> 16)
/* 45C4C 8006A84C 35080020 */ ori $t0, $t0, (0xA4600020 & 0xFFFF)
/* 45C50 8006A850 3C09A460 */ lui $t1, (0xA4600024 >> 16)
/* 45C54 8006A854 35290024 */ ori $t1, $t1, (0xA4600024 & 0xFFFF)
/* 45C58 8006A858 3C04A460 */ lui $a0, (0xA4600028 >> 16)
/* 45C5C 8006A85C 34840028 */ ori $a0, $a0, (0xA4600028 & 0xFFFF)
/* 45C60 8006A860 3C03A460 */ lui $v1, (0xA460002C >> 16)
/* 45C64 8006A864 3463002C */ ori $v1, $v1, (0xA460002C & 0xFFFF)
/* 45C68 8006A868 3C02A460 */ lui $v0, (0xA4600030 >> 16)
/* 45C6C 8006A86C 34420030 */ ori $v0, $v0, (0xA4600030 & 0xFFFF)
/* 45C70 8006A870 8CA50000 */ lw $a1, 0x0($a1)
/* 45C74 8006A874 8CC60000 */ lw $a2, 0x0($a2)
/* 45C78 8006A878 8CE70000 */ lw $a3, 0x0($a3)
/* 45C7C 8006A87C 8D080000 */ lw $t0, 0x0($t0)
/* 45C80 8006A880 8D290000 */ lw $t1, 0x0($t1)
/* 45C84 8006A884 8C840000 */ lw $a0, 0x0($a0)
/* 45C88 8006A888 8C630000 */ lw $v1, 0x0($v1)
/* 45C8C 8006A88C 8C4A0000 */ lw $t2, 0x0($v0)
/* 45C90 8006A890 24020007 */ addiu $v0, $zero, 0x7
/* 45C94 8006A894 3C01800B */ lui $at, %hi(D_800B451C)
/* 45C98 8006A898 A022451C */ sb $v0, %lo(D_800B451C)($at)
/* 45C9C 8006A89C 3C01800B */ lui $at, %hi(D_800B1B0C)
/* 45CA0 8006A8A0 A0221B0C */ sb $v0, %lo(D_800B1B0C)($at)
/* 45CA4 8006A8A4 3C01800B */ lui $at, %hi(D_800B451D)
/* 45CA8 8006A8A8 A025451D */ sb $a1, %lo(D_800B451D)($at)
/* 45CAC 8006A8AC 3C01800B */ lui $at, %hi(D_800B4520)
/* 45CB0 8006A8B0 A0264520 */ sb $a2, %lo(D_800B4520)($at)
/* 45CB4 8006A8B4 3C01800B */ lui $at, %hi(D_800B451E)
/* 45CB8 8006A8B8 A027451E */ sb $a3, %lo(D_800B451E)($at)
/* 45CBC 8006A8BC 3C01800B */ lui $at, %hi(D_800B451F)
/* 45CC0 8006A8C0 A028451F */ sb $t0, %lo(D_800B451F)($at)
/* 45CC4 8006A8C4 3C01800B */ lui $at, %hi(D_800B1B0D)
/* 45CC8 8006A8C8 A0291B0D */ sb $t1, %lo(D_800B1B0D)($at)
/* 45CCC 8006A8CC 3C01800B */ lui $at, %hi(D_800B1B10)
/* 45CD0 8006A8D0 A0241B10 */ sb $a0, %lo(D_800B1B10)($at)
/* 45CD4 8006A8D4 3C01800B */ lui $at, %hi(D_800B1B0E)
/* 45CD8 8006A8D8 A0231B0E */ sb $v1, %lo(D_800B1B0E)($at)
/* 45CDC 8006A8DC 3C01800B */ lui $at, %hi(D_800B1B0F)
/* 45CE0 8006A8E0 0C019A58 */ jal osUnmapTLBAll
/* 45CE4 8006A8E4 A02A1B0F */ sb $t2, %lo(D_800B1B0F)($at)
/* 45CE8 8006A8E8 0C01B28C */ jal osMapTLBRdb
/* 45CEC 8006A8EC 00000000 */ nop
/* 45CF0 8006A8F0 3C028009 */ lui $v0, %hi(D_800958F0)
/* 45CF4 8006A8F4 8C4258F0 */ lw $v0, %lo(D_800958F0)($v0)
/* 45CF8 8006A8F8 3C038009 */ lui $v1, %hi(D_800958F4)
/* 45CFC 8006A8FC 8C6358F4 */ lw $v1, %lo(D_800958F4)($v1)
/* 45D00 8006A900 00022040 */ sll $a0, $v0, 1
/* 45D04 8006A904 000337C2 */ srl $a2, $v1, 31
/* 45D08 8006A908 00862025 */ or $a0, $a0, $a2
/* 45D0C 8006A90C 00032840 */ sll $a1, $v1, 1
/* 45D10 8006A910 00A32821 */ addu $a1, $a1, $v1
/* 45D14 8006A914 00A3302B */ sltu $a2, $a1, $v1
/* 45D18 8006A918 00822021 */ addu $a0, $a0, $v0
/* 45D1C 8006A91C 00862021 */ addu $a0, $a0, $a2
/* 45D20 8006A920 24060000 */ addiu $a2, $zero, 0x0
/* 45D24 8006A924 0C01B8C4 */ jal __udivdi3
/* 45D28 8006A928 24070004 */ addiu $a3, $zero, 0x4
/* 45D2C 8006A92C 3C048000 */ lui $a0, %hi(osResetType)
/* 45D30 8006A930 8C84030C */ lw $a0, %lo(osResetType)($a0)
/* 45D34 8006A934 3C018009 */ lui $at, %hi(D_800958F0)
/* 45D38 8006A938 AC2258F0 */ sw $v0, %lo(D_800958F0)($at)
/* 45D3C 8006A93C 3C018009 */ lui $at, %hi(D_800958F4)
/* 45D40 8006A940 14800005 */ bnez $a0, .L8006A958
/* 45D44 8006A944 AC2358F4 */ sw $v1, %lo(D_800958F4)($at)
/* 45D48 8006A948 3C048000 */ lui $a0, %hi(osAppNMIBuffer)
/* 45D4C 8006A94C 2484031C */ addiu $a0, $a0, %lo(osAppNMIBuffer)
/* 45D50 8006A950 0C01925C */ jal bzero
/* 45D54 8006A954 24050040 */ addiu $a1, $zero, 0x40
.L8006A958:
/* 45D58 8006A958 3C038000 */ lui $v1, %hi(osTvType)
/* 45D5C 8006A95C 8C630300 */ lw $v1, %lo(osTvType)($v1)
/* 45D60 8006A960 54600004 */ bnel $v1, $zero, .L8006A974
/* 45D64 8006A964 24020002 */ addiu $v0, $zero, 0x2
/* 45D68 8006A968 3C0202F5 */ lui $v0, (0x2F5B2D2 >> 16)
/* 45D6C 8006A96C 0801AA62 */ j .L8006A988
/* 45D70 8006A970 3442B2D2 */ ori $v0, $v0, (0x2F5B2D2 & 0xFFFF)
.L8006A974:
/* 45D74 8006A974 14620003 */ bne $v1, $v0, .L8006A984
/* 45D78 8006A978 3C0202E6 */ lui $v0, (0x2E6D354 >> 16)
/* 45D7C 8006A97C 0801AA62 */ j .L8006A988
/* 45D80 8006A980 3442025C */ ori $v0, $v0, (0x2E6025C & 0xFFFF)
.L8006A984:
/* 45D84 8006A984 3442D354 */ ori $v0, $v0, (0x2E6D354 & 0xFFFF)
.L8006A988:
/* 45D88 8006A988 3C018009 */ lui $at, %hi(D_800958F8)
/* 45D8C 8006A98C 0C01B198 */ jal __osGetCause
/* 45D90 8006A990 AC2258F8 */ sw $v0, %lo(D_800958F8)($at)
/* 45D94 8006A994 30421000 */ andi $v0, $v0, 0x1000
/* 45D98 8006A998 10400003 */ beqz $v0, .L8006A9A8
/* 45D9C 8006A99C 3C03A450 */ lui $v1, (0xA4500008 >> 16)
.L8006A9A0:
/* 45DA0 8006A9A0 0801AA68 */ j .L8006A9A0
/* 45DA4 8006A9A4 00000000 */ nop
.L8006A9A8:
/* 45DA8 8006A9A8 34630008 */ ori $v1, $v1, (0xA4500008 & 0xFFFF)
/* 45DAC 8006A9AC 3C04A450 */ lui $a0, (0xA4500010 >> 16)
/* 45DB0 8006A9B0 34840010 */ ori $a0, $a0, (0xA4500010 & 0xFFFF)
/* 45DB4 8006A9B4 3C05A450 */ lui $a1, (0xA4500014 >> 16)
/* 45DB8 8006A9B8 34A50014 */ ori $a1, $a1, (0xA4500014 & 0xFFFF)
/* 45DBC 8006A9BC 24020001 */ addiu $v0, $zero, 0x1
/* 45DC0 8006A9C0 AC620000 */ sw $v0, 0x0($v1)
/* 45DC4 8006A9C4 24023FFF */ addiu $v0, $zero, 0x3FFF
/* 45DC8 8006A9C8 AC820000 */ sw $v0, 0x0($a0)
/* 45DCC 8006A9CC 2402000F */ addiu $v0, $zero, 0xF
/* 45DD0 8006A9D0 ACA20000 */ sw $v0, 0x0($a1)
/* 45DD4 8006A9D4 8FBF0018 */ lw $ra, 0x18($sp)
/* 45DD8 8006A9D8 03E00008 */ jr $ra
/* 45DDC 8006A9DC 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void __osInitialize_common() {
u32 pifdata;
#ifdef _FINALROM
__osFinalrom = TRUE;
#endif
__osSetSR(__osGetSR() | SR_CU1); //enable fpu
__osSetFpcCsr(FPCSR_FS | FPCSR_EV); //flush denorm to zero, enable invalid operation
__osSetWatchLo(0x4900000);
while (__osSiRawReadIo(PIF_RAM_END - 3, &pifdata)) { //last byte of joychannel ram
;
}
while (__osSiRawWriteIo(PIF_RAM_END - 3, pifdata | 8)) {
; //todo: magic contant
}
*(__osExceptionVector *)UT_VEC = __osExceptionPreamble;
*(__osExceptionVector *)XUT_VEC = __osExceptionPreamble;
*(__osExceptionVector *)ECC_VEC = __osExceptionPreamble;
*(__osExceptionVector *)E_VEC = __osExceptionPreamble;
osWritebackDCache((void *)UT_VEC, E_VEC - UT_VEC + sizeof(__osExceptionVector));
osInvalICache((void *)UT_VEC, E_VEC - UT_VEC + sizeof(__osExceptionVector));
__createSpeedParam();
osUnmapTLBAll();
osMapTLBRdb();
osClockRate = osClockRate * 3 / 4;
if (osResetType == 0 ) { // cold reset
bzero(osAppNMIBuffer, OS_APP_NMI_BUFSIZE);
}
if (osTvType == OS_TV_PAL) {
osViClock = VI_PAL_CLOCK;
} else if (osTvType == OS_TV_MPAL) {
osViClock = VI_MPAL_CLOCK;
} else {
osViClock = VI_NTSC_CLOCK;
}
// Wait until there are no RCP interrupts
if (__osGetCause() & CAUSE_IP5) {
while (TRUE) {
;
}
}
IO_WRITE(AI_CONTROL_REG, AI_CONTROL_DMA_ON);
IO_WRITE(AI_DACRATE_REG, AI_MAX_DAC_RATE - 1);
IO_WRITE(AI_BITRATE_REG, AI_MAX_BIT_RATE - 1);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel reset_player_status
/* 7B50C 800E205C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 7B510 800E2060 2402FFFF */ addiu $v0, $zero, -0x1
/* 7B514 800E2064 3C058011 */ lui $a1, %hi(D_8010C92C)
/* 7B518 800E2068 24A5C92C */ addiu $a1, $a1, %lo(D_8010C92C)
/* 7B51C 800E206C AFB00010 */ sw $s0, 0x10($sp)
/* 7B520 800E2070 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* 7B524 800E2074 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* 7B528 800E2078 3C018011 */ lui $at, %hi(PeachDisguiseNpcIndex)
/* 7B52C 800E207C AC22C96C */ sw $v0, %lo(PeachDisguiseNpcIndex)($at)
/* 7B530 800E2080 24020001 */ addiu $v0, $zero, 0x1
/* 7B534 800E2084 AFBF0014 */ sw $ra, 0x14($sp)
/* 7B538 800E2088 3C018011 */ lui $at, %hi(TweesterTouchingPartner)
/* 7B53C 800E208C AC20C954 */ sw $zero, %lo(TweesterTouchingPartner)($at)
/* 7B540 800E2090 3C018011 */ lui $at, %hi(PulseStoneNotificationCallback)
/* 7B544 800E2094 AC20C920 */ sw $zero, %lo(PulseStoneNotificationCallback)($at)
/* 7B548 800E2098 3C018011 */ lui $at, %hi(TalkNotificationCallback)
/* 7B54C 800E209C AC20C940 */ sw $zero, %lo(TalkNotificationCallback)($at)
/* 7B550 800E20A0 3C018011 */ lui $at, %hi(InteractNotificationCallback)
/* 7B554 800E20A4 AC20C958 */ sw $zero, %lo(InteractNotificationCallback)($at)
/* 7B558 800E20A8 ACA00000 */ sw $zero, 0x0($a1)
/* 7B55C 800E20AC 3C018011 */ lui $at, %hi(PrevPlayerDirection)
/* 7B560 800E20B0 AC20C95C */ sw $zero, %lo(PrevPlayerDirection)($at)
/* 7B564 800E20B4 3C018011 */ lui $at, %hi(D_8010C980)
/* 7B568 800E20B8 AC20C980 */ sw $zero, %lo(D_8010C980)($at)
/* 7B56C 800E20BC 3C01800F */ lui $at, %hi(PrevPlayerCamRelativeYaw)
/* 7B570 800E20C0 AC207B40 */ sw $zero, %lo(PrevPlayerCamRelativeYaw)($at)
/* 7B574 800E20C4 3C01800F */ lui $at, %hi(D_800F7B44)
/* 7B578 800E20C8 AC207B44 */ sw $zero, %lo(D_800F7B44)($at)
/* 7B57C 800E20CC 3C018011 */ lui $at, %hi(D_8010C938)
/* 7B580 800E20D0 AC20C938 */ sw $zero, %lo(D_8010C938)($at)
/* 7B584 800E20D4 3C018011 */ lui $at, %hi(D_8010C990)
/* 7B588 800E20D8 AC20C990 */ sw $zero, %lo(D_8010C990)($at)
/* 7B58C 800E20DC A202000D */ sb $v0, 0xD($s0)
/* 7B590 800E20E0 2402000D */ addiu $v0, $zero, 0xD
/* 7B594 800E20E4 3C048007 */ lui $a0, %hi(gGameStatusPtr)
/* 7B598 800E20E8 2484419C */ addiu $a0, $a0, %lo(gGameStatusPtr)
/* 7B59C 800E20EC A20200BE */ sb $v0, 0xBE($s0)
/* 7B5A0 800E20F0 8C830000 */ lw $v1, 0x0($a0)
/* 7B5A4 800E20F4 240200FF */ addiu $v0, $zero, 0xFF
/* 7B5A8 800E20F8 A202000E */ sb $v0, 0xE($s0)
/* 7B5AC 800E20FC A202000F */ sb $v0, 0xF($s0)
/* 7B5B0 800E2100 9062007E */ lbu $v0, 0x7E($v1)
/* 7B5B4 800E2104 304200F7 */ andi $v0, $v0, 0xF7
/* 7B5B8 800E2108 A062007E */ sb $v0, 0x7E($v1)
/* 7B5BC 800E210C 8C830000 */ lw $v1, 0x0($a0)
/* 7B5C0 800E2110 9062007E */ lbu $v0, 0x7E($v1)
/* 7B5C4 800E2114 304200EF */ andi $v0, $v0, 0xEF
/* 7B5C8 800E2118 A062007E */ sb $v0, 0x7E($v1)
/* 7B5CC 800E211C 8C840000 */ lw $a0, 0x0($a0)
/* 7B5D0 800E2120 9082007E */ lbu $v0, 0x7E($a0)
/* 7B5D4 800E2124 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 7B5D8 800E2128 44811000 */ mtc1 $at, $f2
/* 7B5DC 800E212C 30420001 */ andi $v0, $v0, 0x1
/* 7B5E0 800E2130 1040000F */ beqz $v0, .L800E2170
/* 7B5E4 800E2134 24020037 */ addiu $v0, $zero, 0x37
/* 7B5E8 800E2138 A60200B0 */ sh $v0, 0xB0($s0)
/* 7B5EC 800E213C 8E020004 */ lw $v0, 0x4($s0)
/* 7B5F0 800E2140 24030026 */ addiu $v1, $zero, 0x26
/* 7B5F4 800E2144 A60300B2 */ sh $v1, 0xB2($s0)
/* 7B5F8 800E2148 34421000 */ ori $v0, $v0, 0x1000
/* 7B5FC 800E214C AE020004 */ sw $v0, 0x4($s0)
/* 7B600 800E2150 9082007E */ lbu $v0, 0x7E($a0)
/* 7B604 800E2154 30420002 */ andi $v0, $v0, 0x2
/* 7B608 800E2158 1040000A */ beqz $v0, .L800E2184
/* 7B60C 800E215C 24020002 */ addiu $v0, $zero, 0x2
/* 7B610 800E2160 ACA20000 */ sw $v0, 0x0($a1)
/* 7B614 800E2164 9082007F */ lbu $v0, 0x7F($a0)
/* 7B618 800E2168 08038861 */ j .L800E2184
/* 7B61C 800E216C A202000C */ sb $v0, 0xC($s0)
.L800E2170:
/* 7B620 800E2170 24020025 */ addiu $v0, $zero, 0x25
/* 7B624 800E2174 A60200B0 */ sh $v0, 0xB0($s0)
/* 7B628 800E2178 2402001A */ addiu $v0, $zero, 0x1A
/* 7B62C 800E217C A60200B2 */ sh $v0, 0xB2($s0)
/* 7B630 800E2180 A0800080 */ sb $zero, 0x80($a0)
.L800E2184:
/* 7B634 800E2184 3C02800F */ lui $v0, %hi(D_800F7B70)
/* 7B638 800E2188 24427B70 */ addiu $v0, $v0, %lo(D_800F7B70)
/* 7B63C 800E218C C4400000 */ lwc1 $f0, 0x0($v0)
/* 7B640 800E2190 46020002 */ mul.s $f0, $f0, $f2
/* 7B644 800E2194 00000000 */ nop
/* 7B648 800E2198 24420004 */ addiu $v0, $v0, 0x4
/* 7B64C 800E219C E6000058 */ swc1 $f0, 0x58($s0)
/* 7B650 800E21A0 C4400000 */ lwc1 $f0, 0x0($v0)
/* 7B654 800E21A4 46020002 */ mul.s $f0, $f0, $f2
/* 7B658 800E21A8 00000000 */ nop
/* 7B65C 800E21AC E600005C */ swc1 $f0, 0x5C($s0)
/* 7B660 800E21B0 C4400004 */ lwc1 $f0, 0x4($v0)
/* 7B664 800E21B4 46020002 */ mul.s $f0, $f0, $f2
/* 7B668 800E21B8 00000000 */ nop
/* 7B66C 800E21BC 0000202D */ daddu $a0, $zero, $zero
/* 7B670 800E21C0 0C039769 */ jal set_action_state
/* 7B674 800E21C4 E600006C */ swc1 $f0, 0x6C($s0)
/* 7B678 800E21C8 3C068007 */ lui $a2, %hi(gGameStatusPtr)
/* 7B67C 800E21CC 8CC6419C */ lw $a2, %lo(gGameStatusPtr)($a2)
/* 7B680 800E21D0 AE000054 */ sw $zero, 0x54($s0)
/* 7B684 800E21D4 AE000080 */ sw $zero, 0x80($s0)
/* 7B688 800E21D8 AE000064 */ sw $zero, 0x64($s0)
/* 7B68C 800E21DC AE000088 */ sw $zero, 0x88($s0)
/* 7B690 800E21E0 AE0000B8 */ sw $zero, 0xB8($s0)
/* 7B694 800E21E4 A60000C0 */ sh $zero, 0xC0($s0)
/* 7B698 800E21E8 AE000028 */ sw $zero, 0x28($s0)
/* 7B69C 800E21EC AE00002C */ sw $zero, 0x2C($s0)
/* 7B6A0 800E21F0 AE000030 */ sw $zero, 0x30($s0)
/* 7B6A4 800E21F4 AE000084 */ sw $zero, 0x84($s0)
/* 7B6A8 800E21F8 AE000090 */ sw $zero, 0x90($s0)
/* 7B6AC 800E21FC AE000094 */ sw $zero, 0x94($s0)
/* 7B6B0 800E2200 AE000098 */ sw $zero, 0x98($s0)
/* 7B6B4 800E2204 AE00009C */ sw $zero, 0x9C($s0)
/* 7B6B8 800E2208 84C30086 */ lh $v1, 0x86($a2)
/* 7B6BC 800E220C 84C2008C */ lh $v0, 0x8C($a2)
/* 7B6C0 800E2210 00031900 */ sll $v1, $v1, 4
/* 7B6C4 800E2214 3C018009 */ lui $at, %hi(gAreas + 0x4)
/* 7B6C8 800E2218 00230821 */ addu $at, $at, $v1
/* 7B6CC 800E221C 8C2334F4 */ lw $v1, %lo(gAreas + 0x4)($at)
/* 7B6D0 800E2220 00021140 */ sll $v0, $v0, 5
/* 7B6D4 800E2224 00431021 */ addu $v0, $v0, $v1
/* 7B6D8 800E2228 8C440004 */ lw $a0, 0x4($v0)
/* 7B6DC 800E222C 8C850014 */ lw $a1, 0x14($a0)
/* 7B6E0 800E2230 10A0001B */ beqz $a1, .L800E22A0
/* 7B6E4 800E2234 00000000 */ nop
/* 7B6E8 800E2238 84C3008E */ lh $v1, 0x8E($a2)
/* 7B6EC 800E223C 8C820018 */ lw $v0, 0x18($a0)
/* 7B6F0 800E2240 0062102A */ slt $v0, $v1, $v0
/* 7B6F4 800E2244 10400016 */ beqz $v0, .L800E22A0
/* 7B6F8 800E2248 00031100 */ sll $v0, $v1, 4
/* 7B6FC 800E224C 00451021 */ addu $v0, $v0, $a1
/* 7B700 800E2250 C4400000 */ lwc1 $f0, 0x0($v0)
/* 7B704 800E2254 E6000028 */ swc1 $f0, 0x28($s0)
/* 7B708 800E2258 84C2008E */ lh $v0, 0x8E($a2)
/* 7B70C 800E225C 8C830014 */ lw $v1, 0x14($a0)
/* 7B710 800E2260 00021100 */ sll $v0, $v0, 4
/* 7B714 800E2264 00431021 */ addu $v0, $v0, $v1
/* 7B718 800E2268 C4400004 */ lwc1 $f0, 0x4($v0)
/* 7B71C 800E226C E600002C */ swc1 $f0, 0x2C($s0)
/* 7B720 800E2270 84C2008E */ lh $v0, 0x8E($a2)
/* 7B724 800E2274 8C830014 */ lw $v1, 0x14($a0)
/* 7B728 800E2278 00021100 */ sll $v0, $v0, 4
/* 7B72C 800E227C 00431021 */ addu $v0, $v0, $v1
/* 7B730 800E2280 C4400008 */ lwc1 $f0, 0x8($v0)
/* 7B734 800E2284 E6000030 */ swc1 $f0, 0x30($s0)
/* 7B738 800E2288 84C2008E */ lh $v0, 0x8E($a2)
/* 7B73C 800E228C 8C830014 */ lw $v1, 0x14($a0)
/* 7B740 800E2290 00021100 */ sll $v0, $v0, 4
/* 7B744 800E2294 00431021 */ addu $v0, $v0, $v1
/* 7B748 800E2298 C440000C */ lwc1 $f0, 0xC($v0)
/* 7B74C 800E229C E6000084 */ swc1 $f0, 0x84($s0)
.L800E22A0:
/* 7B750 800E22A0 C6000028 */ lwc1 $f0, 0x28($s0)
/* 7B754 800E22A4 C602002C */ lwc1 $f2, 0x2C($s0)
/* 7B758 800E22A8 C6040030 */ lwc1 $f4, 0x30($s0)
/* 7B75C 800E22AC 3C02800B */ lui $v0, %hi(gCameras)
/* 7B760 800E22B0 24421D80 */ addiu $v0, $v0, %lo(gCameras)
/* 7B764 800E22B4 E4400060 */ swc1 $f0, 0x60($v0)
/* 7B768 800E22B8 E4420064 */ swc1 $f2, 0x64($v0)
/* 7B76C 800E22BC 0C039668 */ jal phys_reset_spin_history
/* 7B770 800E22C0 E4440068 */ swc1 $f4, 0x68($v0)
/* 7B774 800E22C4 3C048011 */ lui $a0, %hi(gPlayerSpinState)
/* 7B778 800E22C8 2484F250 */ addiu $a0, $a0, %lo(gPlayerSpinState)
/* 7B77C 800E22CC 0C00A580 */ jal mem_clear
/* 7B780 800E22D0 24050034 */ addiu $a1, $zero, 0x34
/* 7B784 800E22D4 8FBF0014 */ lw $ra, 0x14($sp)
/* 7B788 800E22D8 8FB00010 */ lw $s0, 0x10($sp)
/* 7B78C 800E22DC 03E00008 */ jr $ra
/* 7B790 800E22E0 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void reset_player_status(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
MapSettings* mapSettings;
f32 one;
f32* floatsTemp;
PeachDisguiseNpcIndex = -1;
TweesterTouchingPartner = NULL;
PulseStoneNotificationCallback = NULL;
TalkNotificationCallback = NULL;
InteractNotificationCallback = NULL;
D_8010C92C = 0;
PrevPlayerDirection = 0;
D_8010C980 = 0;
PrevPlayerCamRelativeYaw = 0;
D_800F7B44 = 0;
D_8010C938 = 0;
D_8010C990 = 0.0f;
playerStatus->availableDisguiseType = 1;
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
playerStatus->alpha1 = 255;
playerStatus->alpha2 = 255;
gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_8;
gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_DEPRESSED;
one = 1.0f;
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) {
playerStatus->colliderHeight = 55;
playerStatus->colliderDiameter = 38;
playerStatus->animFlags |= PA_FLAG_USING_PEACH_PHYSICS;
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DISGUISED) {
D_8010C92C = 2;
playerStatus->peachDisguise = gGameStatusPtr->peachDisguise;
}
} else {
playerStatus->colliderHeight = 37;
playerStatus->colliderDiameter = 26;
gGameStatusPtr->peachBakingIngredient = 0;
}
// TODO required to match
floatsTemp = &(&D_800F7B74)[-1]; // index of 0 does not work
playerStatus->walkSpeed = *floatsTemp++ * one;
playerStatus->runSpeed = *floatsTemp++ * one;
playerStatus->maxJumpSpeed = *floatsTemp++ * one;
set_action_state(ACTION_STATE_IDLE);
playerStatus->currentSpeed = 0.0f;
playerStatus->targetYaw = 0.0f;
playerStatus->overlapPushAmount = 0.0f;
playerStatus->overlapPushYaw = 0.0f;
playerStatus->anim = 0;
playerStatus->timeInAir = 0;
playerStatus->position.x = 0.0f;
playerStatus->position.y = 0.0f;
playerStatus->position.z = 0.0f;
playerStatus->currentYaw = 0.0f;
playerStatus->flipYaw[CAM_DEFAULT] = 0.0f;
playerStatus->flipYaw[CAM_BATTLE] = 0.0f;
playerStatus->flipYaw[CAM_TATTLE] = 0.0f;
playerStatus->flipYaw[CAM_3] = 0.0f;
mapSettings = gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID].settings;
if (mapSettings->entryList != NULL) {
if (gGameStatusPtr->entryID < mapSettings->entryCount) {
playerStatus->position.x = (*mapSettings->entryList)[gGameStatusPtr->entryID].x;
playerStatus->position.y = (*mapSettings->entryList)[gGameStatusPtr->entryID].y;
playerStatus->position.z = (*mapSettings->entryList)[gGameStatusPtr->entryID].z;
playerStatus->currentYaw = (*mapSettings->entryList)[gGameStatusPtr->entryID].yaw;
}
}
gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
phys_reset_spin_history();
mem_clear(&gPlayerSpinState, sizeof(gPlayerSpinState));
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel breaking_junk_appendGfx
/* 40389C E011849C 27BDFF30 */ addiu $sp, $sp, -0xD0
/* 4038A0 E01184A0 AFB700BC */ sw $s7, 0xBC($sp)
/* 4038A4 E01184A4 0080B82D */ daddu $s7, $a0, $zero
/* 4038A8 E01184A8 3C05DB06 */ lui $a1, (0xDB060024 >> 16)
/* 4038AC E01184AC 3C06800A */ lui $a2, %hi(gMainGfxPos)
/* 4038B0 E01184B0 24C6A66C */ addiu $a2, $a2, %lo(gMainGfxPos)
/* 4038B4 E01184B4 34A50024 */ ori $a1, $a1, (0xDB060024 & 0xFFFF)
/* 4038B8 E01184B8 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 4038BC E01184BC AFBF00C4 */ sw $ra, 0xC4($sp)
/* 4038C0 E01184C0 AFBE00C0 */ sw $fp, 0xC0($sp)
/* 4038C4 E01184C4 AFB600B8 */ sw $s6, 0xB8($sp)
/* 4038C8 E01184C8 AFB500B4 */ sw $s5, 0xB4($sp)
/* 4038CC E01184CC AFB400B0 */ sw $s4, 0xB0($sp)
/* 4038D0 E01184D0 AFB300AC */ sw $s3, 0xAC($sp)
/* 4038D4 E01184D4 AFB200A8 */ sw $s2, 0xA8($sp)
/* 4038D8 E01184D8 AFB100A4 */ sw $s1, 0xA4($sp)
/* 4038DC E01184DC AFB000A0 */ sw $s0, 0xA0($sp)
/* 4038E0 E01184E0 F7B400C8 */ sdc1 $f20, 0xC8($sp)
/* 4038E4 E01184E4 8CC40000 */ lw $a0, 0x0($a2)
/* 4038E8 E01184E8 8EE7000C */ lw $a3, 0xC($s7)
/* 4038EC E01184EC 0080182D */ daddu $v1, $a0, $zero
/* 4038F0 E01184F0 84FE0032 */ lh $fp, 0x32($a3)
/* 4038F4 E01184F4 24840008 */ addiu $a0, $a0, 0x8
/* 4038F8 E01184F8 AC620000 */ sw $v0, 0x0($v1)
/* 4038FC E01184FC AC600004 */ sw $zero, 0x4($v1)
/* 403900 E0118500 AC850000 */ sw $a1, 0x0($a0)
/* 403904 E0118504 8EE20010 */ lw $v0, 0x10($s7)
/* 403908 E0118508 0000882D */ daddu $s1, $zero, $zero
/* 40390C E011850C ACC40000 */ sw $a0, 0x0($a2)
/* 403910 E0118510 8C43001C */ lw $v1, 0x1C($v0)
/* 403914 E0118514 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 403918 E0118518 AC820008 */ sw $v0, 0x8($a0)
/* 40391C E011851C 3C028000 */ lui $v0, (0x80000000 >> 16)
/* 403920 E0118520 00621821 */ addu $v1, $v1, $v0
/* 403924 E0118524 AC830004 */ sw $v1, 0x4($a0)
/* 403928 E0118528 3C03E012 */ lui $v1, (0xE0120000 >> 16)
/* 40392C E011852C 8C6387C0 */ lw $v1, -0x7840($v1)
/* 403930 E0118530 24820008 */ addiu $v0, $a0, 0x8
/* 403934 E0118534 ACC20000 */ sw $v0, 0x0($a2)
/* 403938 E0118538 AC83000C */ sw $v1, 0xC($a0)
/* 40393C E011853C 8EE20008 */ lw $v0, 0x8($s7)
/* 403940 E0118540 24840010 */ addiu $a0, $a0, 0x10
/* 403944 E0118544 18400084 */ blez $v0, .LE0118758
/* 403948 E0118548 ACC40000 */ sw $a0, 0x0($a2)
/* 40394C E011854C 4480A000 */ mtc1 $zero, $f20
/* 403950 E0118550 27B40060 */ addiu $s4, $sp, 0x60
/* 403954 E0118554 3C16800A */ lui $s6, %hi(gDisplayContext)
/* 403958 E0118558 26D6A674 */ addiu $s6, $s6, %lo(gDisplayContext)
/* 40395C E011855C 3C158007 */ lui $s5, %hi(gMatrixListPos)
/* 403960 E0118560 26B541F0 */ addiu $s5, $s5, %lo(gMatrixListPos)
/* 403964 E0118564 3C130001 */ lui $s3, (0x11630 >> 16)
/* 403968 E0118568 36731630 */ ori $s3, $s3, (0x11630 & 0xFFFF)
/* 40396C E011856C 00C0902D */ daddu $s2, $a2, $zero
/* 403970 E0118570 24F0003A */ addiu $s0, $a3, 0x3A
.LE0118574:
/* 403974 E0118574 3C0A800B */ lui $t2, %hi(gCameras)
/* 403978 E0118578 254A1D80 */ addiu $t2, $t2, %lo(gCameras)
/* 40397C E011857C 4405A000 */ mfc1 $a1, $f20
/* 403980 E0118580 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 403984 E0118584 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 403988 E0118588 C600FFEA */ lwc1 $f0, -0x16($s0)
/* 40398C E011858C 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 403990 E0118590 44811800 */ mtc1 $at, $f3
/* 403994 E0118594 44801000 */ mtc1 $zero, $f2
/* 403998 E0118598 00031080 */ sll $v0, $v1, 2
/* 40399C E011859C 00431021 */ addu $v0, $v0, $v1
/* 4039A0 E01185A0 46000021 */ cvt.d.s $f0, $f0
/* 4039A4 E01185A4 00021080 */ sll $v0, $v0, 2
/* 4039A8 E01185A8 46220002 */ mul.d $f0, $f0, $f2
/* 4039AC E01185AC 00000000 */ nop
/* 4039B0 E01185B0 00431023 */ subu $v0, $v0, $v1
/* 4039B4 E01185B4 000218C0 */ sll $v1, $v0, 3
/* 4039B8 E01185B8 00431021 */ addu $v0, $v0, $v1
/* 4039BC E01185BC 000210C0 */ sll $v0, $v0, 3
/* 4039C0 E01185C0 004A1021 */ addu $v0, $v0, $t2
/* 4039C4 E01185C4 C442006C */ lwc1 $f2, 0x6C($v0)
/* 4039C8 E01185C8 4407A000 */ mfc1 $a3, $f20
/* 4039CC E01185CC 46001087 */ neg.s $f2, $f2
/* 4039D0 E01185D0 44061000 */ mfc1 $a2, $f2
/* 4039D4 E01185D4 46200020 */ cvt.s.d $f0, $f0
/* 4039D8 E01185D8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 4039DC E01185DC C600FFCA */ lwc1 $f0, -0x36($s0)
/* 4039E0 E01185E0 E7A00014 */ swc1 $f0, 0x14($sp)
/* 4039E4 E01185E4 C600FFCE */ lwc1 $f0, -0x32($s0)
/* 4039E8 E01185E8 E7A00018 */ swc1 $f0, 0x18($sp)
/* 4039EC E01185EC C600FFD2 */ lwc1 $f0, -0x2E($s0)
/* 4039F0 E01185F0 27A40020 */ addiu $a0, $sp, 0x20
/* 4039F4 E01185F4 0C080180 */ jal shim_guPositionF
/* 4039F8 E01185F8 E7A0001C */ swc1 $f0, 0x1C($sp)
/* 4039FC E01185FC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 403A00 E0118600 44810000 */ mtc1 $at, $f0
/* 403A04 E0118604 4406A000 */ mfc1 $a2, $f20
/* 403A08 E0118608 4407A000 */ mfc1 $a3, $f20
/* 403A0C E011860C E7A00010 */ swc1 $f0, 0x10($sp)
/* 403A10 E0118610 8E05FFEE */ lw $a1, -0x12($s0)
/* 403A14 E0118614 0C080104 */ jal shim_guRotateF
/* 403A18 E0118618 0280202D */ daddu $a0, $s4, $zero
/* 403A1C E011861C 0280202D */ daddu $a0, $s4, $zero
/* 403A20 E0118620 27A50020 */ addiu $a1, $sp, 0x20
/* 403A24 E0118624 0C080114 */ jal shim_guMtxCatF
/* 403A28 E0118628 00A0302D */ daddu $a2, $a1, $zero
/* 403A2C E011862C 27A40020 */ addiu $a0, $sp, 0x20
/* 403A30 E0118630 96A50000 */ lhu $a1, 0x0($s5)
/* 403A34 E0118634 8EC20000 */ lw $v0, 0x0($s6)
/* 403A38 E0118638 00052980 */ sll $a1, $a1, 6
/* 403A3C E011863C 00B32821 */ addu $a1, $a1, $s3
/* 403A40 E0118640 0C080118 */ jal shim_guMtxF2L
/* 403A44 E0118644 00452821 */ addu $a1, $v0, $a1
/* 403A48 E0118648 3C02DA38 */ lui $v0, (0xDA380002 >> 16)
/* 403A4C E011864C 34420002 */ ori $v0, $v0, (0xDA380002 & 0xFFFF)
/* 403A50 E0118650 3C09D838 */ lui $t1, (0xD8380002 >> 16)
/* 403A54 E0118654 35290002 */ ori $t1, $t1, (0xD8380002 & 0xFFFF)
/* 403A58 E0118658 32280003 */ andi $t0, $s1, 0x3
/* 403A5C E011865C 26310001 */ addiu $s1, $s1, 0x1
/* 403A60 E0118660 00084080 */ sll $t0, $t0, 2
/* 403A64 E0118664 8E440000 */ lw $a0, 0x0($s2)
/* 403A68 E0118668 96A30000 */ lhu $v1, 0x0($s5)
/* 403A6C E011866C 0080282D */ daddu $a1, $a0, $zero
/* 403A70 E0118670 24840008 */ addiu $a0, $a0, 0x8
/* 403A74 E0118674 AE440000 */ sw $a0, 0x0($s2)
/* 403A78 E0118678 ACA20000 */ sw $v0, 0x0($a1)
/* 403A7C E011867C 24620001 */ addiu $v0, $v1, 0x1
/* 403A80 E0118680 3063FFFF */ andi $v1, $v1, 0xFFFF
/* 403A84 E0118684 00031980 */ sll $v1, $v1, 6
/* 403A88 E0118688 A6A20000 */ sh $v0, 0x0($s5)
/* 403A8C E011868C 8EC20000 */ lw $v0, 0x0($s6)
/* 403A90 E0118690 00731821 */ addu $v1, $v1, $s3
/* 403A94 E0118694 00431021 */ addu $v0, $v0, $v1
/* 403A98 E0118698 ACA20004 */ sw $v0, 0x4($a1)
/* 403A9C E011869C 24820008 */ addiu $v0, $a0, 0x8
/* 403AA0 E01186A0 AE420000 */ sw $v0, 0x0($s2)
/* 403AA4 E01186A4 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 403AA8 E01186A8 AC820000 */ sw $v0, 0x0($a0)
/* 403AAC E01186AC 9203FFF3 */ lbu $v1, -0xD($s0)
/* 403AB0 E01186B0 9205FFF5 */ lbu $a1, -0xB($s0)
/* 403AB4 E01186B4 9206FFF7 */ lbu $a2, -0x9($s0)
/* 403AB8 E01186B8 24820010 */ addiu $v0, $a0, 0x10
/* 403ABC E01186BC AE420000 */ sw $v0, 0x0($s2)
/* 403AC0 E01186C0 3C02FB00 */ lui $v0, (0xFB000000 >> 16)
/* 403AC4 E01186C4 AC820008 */ sw $v0, 0x8($a0)
/* 403AC8 E01186C8 33C200FF */ andi $v0, $fp, 0xFF
/* 403ACC E01186CC 00031E00 */ sll $v1, $v1, 24
/* 403AD0 E01186D0 00052C00 */ sll $a1, $a1, 16
/* 403AD4 E01186D4 00651825 */ or $v1, $v1, $a1
/* 403AD8 E01186D8 00063200 */ sll $a2, $a2, 8
/* 403ADC E01186DC 00661825 */ or $v1, $v1, $a2
/* 403AE0 E01186E0 00621825 */ or $v1, $v1, $v0
/* 403AE4 E01186E4 AC830004 */ sw $v1, 0x4($a0)
/* 403AE8 E01186E8 9203FFFB */ lbu $v1, -0x5($s0)
/* 403AEC E01186EC 9205FFFD */ lbu $a1, -0x3($s0)
/* 403AF0 E01186F0 9206FFFF */ lbu $a2, -0x1($s0)
/* 403AF4 E01186F4 92070001 */ lbu $a3, 0x1($s0)
/* 403AF8 E01186F8 2610003C */ addiu $s0, $s0, 0x3C
/* 403AFC E01186FC 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 403B00 E0118700 AC820010 */ sw $v0, 0x10($a0)
/* 403B04 E0118704 00031E00 */ sll $v1, $v1, 24
/* 403B08 E0118708 00052C00 */ sll $a1, $a1, 16
/* 403B0C E011870C 00651825 */ or $v1, $v1, $a1
/* 403B10 E0118710 00063200 */ sll $a2, $a2, 8
/* 403B14 E0118714 00661825 */ or $v1, $v1, $a2
/* 403B18 E0118718 00671825 */ or $v1, $v1, $a3
/* 403B1C E011871C AC83000C */ sw $v1, 0xC($a0)
/* 403B20 E0118720 3C03E012 */ lui $v1, (0xE0120000 >> 16)
/* 403B24 E0118724 00681821 */ addu $v1, $v1, $t0
/* 403B28 E0118728 8C6387B0 */ lw $v1, -0x7850($v1)
/* 403B2C E011872C 24820018 */ addiu $v0, $a0, 0x18
/* 403B30 E0118730 AE420000 */ sw $v0, 0x0($s2)
/* 403B34 E0118734 24020040 */ addiu $v0, $zero, 0x40
/* 403B38 E0118738 AC890018 */ sw $t1, 0x18($a0)
/* 403B3C E011873C AC82001C */ sw $v0, 0x1C($a0)
/* 403B40 E0118740 AC830014 */ sw $v1, 0x14($a0)
/* 403B44 E0118744 8EE20008 */ lw $v0, 0x8($s7)
/* 403B48 E0118748 24840020 */ addiu $a0, $a0, 0x20
/* 403B4C E011874C 0222102A */ slt $v0, $s1, $v0
/* 403B50 E0118750 1440FF88 */ bnez $v0, .LE0118574
/* 403B54 E0118754 AE440000 */ sw $a0, 0x0($s2)
.LE0118758:
/* 403B58 E0118758 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 403B5C E011875C 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
/* 403B60 E0118760 8C620000 */ lw $v0, 0x0($v1)
/* 403B64 E0118764 0040202D */ daddu $a0, $v0, $zero
/* 403B68 E0118768 24420008 */ addiu $v0, $v0, 0x8
/* 403B6C E011876C AC620000 */ sw $v0, 0x0($v1)
/* 403B70 E0118770 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 403B74 E0118774 AC820000 */ sw $v0, 0x0($a0)
/* 403B78 E0118778 AC800004 */ sw $zero, 0x4($a0)
/* 403B7C E011877C 8FBF00C4 */ lw $ra, 0xC4($sp)
/* 403B80 E0118780 8FBE00C0 */ lw $fp, 0xC0($sp)
/* 403B84 E0118784 8FB700BC */ lw $s7, 0xBC($sp)
/* 403B88 E0118788 8FB600B8 */ lw $s6, 0xB8($sp)
/* 403B8C E011878C 8FB500B4 */ lw $s5, 0xB4($sp)
/* 403B90 E0118790 8FB400B0 */ lw $s4, 0xB0($sp)
/* 403B94 E0118794 8FB300AC */ lw $s3, 0xAC($sp)
/* 403B98 E0118798 8FB200A8 */ lw $s2, 0xA8($sp)
/* 403B9C E011879C 8FB100A4 */ lw $s1, 0xA4($sp)
/* 403BA0 E01187A0 8FB000A0 */ lw $s0, 0xA0($sp)
/* 403BA4 E01187A4 D7B400C8 */ ldc1 $f20, 0xC8($sp)
/* 403BA8 E01187A8 03E00008 */ jr $ra
/* 403BAC E01187AC 27BD00D0 */ addiu $sp, $sp, 0xD0
### DECOMPILED C INSTRUCTIONS:
void breaking_junk_appendGfx(void* effect) {
Matrix4f sp20, sp60;
BreakingJunkFXData* data = ((EffectInstance*)effect)->data.breakingJunk;
s32 alpha = data->primA;
s32 i;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_E01187C0[0]);
for (i = 0; i < ((EffectInstance*)effect)->numParts; i++, data++) {
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale * 0.5, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp60, data->rot, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primR, data->primG, data->primB, alpha);
gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, data->envA);
gSPDisplayList(gMainGfxPos++, D_E01187B0[(u32)i % ARRAY_COUNT(D_E01187B0)]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel __osRepairPackId
/* 44BB8 800697B8 27BDFF80 */ addiu $sp, $sp, -0x80
/* 44BBC 800697BC AFB10064 */ sw $s1, 0x64($sp)
/* 44BC0 800697C0 00808821 */ addu $s1, $a0, $zero
/* 44BC4 800697C4 AFB50074 */ sw $s5, 0x74($sp)
/* 44BC8 800697C8 00A0A821 */ addu $s5, $a1, $zero
/* 44BCC 800697CC AFB3006C */ sw $s3, 0x6C($sp)
/* 44BD0 800697D0 00C09821 */ addu $s3, $a2, $zero
/* 44BD4 800697D4 2402FFFF */ addiu $v0, $zero, -0x1
/* 44BD8 800697D8 AFBF007C */ sw $ra, 0x7C($sp)
/* 44BDC 800697DC AFB60078 */ sw $s6, 0x78($sp)
/* 44BE0 800697E0 AFB40070 */ sw $s4, 0x70($sp)
/* 44BE4 800697E4 AFB20068 */ sw $s2, 0x68($sp)
/* 44BE8 800697E8 AFB00060 */ sw $s0, 0x60($sp)
/* 44BEC 800697EC 0C019680 */ jal osGetCount
/* 44BF0 800697F0 AE620000 */ sw $v0, 0x0($s3)
/* 44BF4 800697F4 AE620004 */ sw $v0, 0x4($s3)
/* 44BF8 800697F8 8EA20008 */ lw $v0, 0x8($s5)
/* 44BFC 800697FC 8EA3000C */ lw $v1, 0xC($s5)
/* 44C00 80069800 AE620008 */ sw $v0, 0x8($s3)
/* 44C04 80069804 AE63000C */ sw $v1, 0xC($s3)
/* 44C08 80069808 8EA20010 */ lw $v0, 0x10($s5)
/* 44C0C 8006980C 8EA30014 */ lw $v1, 0x14($s5)
/* 44C10 80069810 AE620010 */ sw $v0, 0x10($s3)
/* 44C14 80069814 AE630014 */ sw $v1, 0x14($s3)
/* 44C18 80069818 92220065 */ lbu $v0, 0x65($s1)
/* 44C1C 8006981C 10400006 */ beqz $v0, .L80069838
/* 44C20 80069820 00009021 */ addu $s2, $zero, $zero
/* 44C24 80069824 02202021 */ addu $a0, $s1, $zero
/* 44C28 80069828 0C01A5B4 */ jal __osPfsSelectBank
/* 44C2C 8006982C 00002821 */ addu $a1, $zero, $zero
/* 44C30 80069830 14400092 */ bnez $v0, .L80069A7C
/* 44C34 80069834 00000000 */ nop
.L80069838:
/* 44C38 80069838 27B40018 */ addiu $s4, $sp, 0x18
/* 44C3C 8006983C 27B60038 */ addiu $s6, $sp, 0x38
/* 44C40 80069840 02202021 */ addu $a0, $s1, $zero
.L80069844:
/* 44C44 80069844 0C01A5B4 */ jal __osPfsSelectBank
/* 44C48 80069848 324500FF */ andi $a1, $s2, 0xFF
/* 44C4C 8006984C 1440008B */ bnez $v0, .L80069A7C
/* 44C50 80069850 00003021 */ addu $a2, $zero, $zero
/* 44C54 80069854 8E240004 */ lw $a0, 0x4($s1)
/* 44C58 80069858 8E250008 */ lw $a1, 0x8($s1)
/* 44C5C 8006985C 0C01A874 */ jal __osContRamRead
/* 44C60 80069860 27A70018 */ addiu $a3, $sp, 0x18
/* 44C64 80069864 14400085 */ bnez $v0, .L80069A7C
/* 44C68 80069868 26830001 */ addiu $v1, $s4, 0x1
/* 44C6C 8006986C 36420080 */ ori $v0, $s2, 0x80
/* 44C70 80069870 A3A20018 */ sb $v0, 0x18($sp)
/* 44C74 80069874 26840020 */ addiu $a0, $s4, 0x20
.L80069878:
/* 44C78 80069878 90620000 */ lbu $v0, 0x0($v1)
/* 44C7C 8006987C 00021027 */ nor $v0, $zero, $v0
/* 44C80 80069880 A0620000 */ sb $v0, 0x0($v1)
/* 44C84 80069884 24630001 */ addiu $v1, $v1, 0x1
/* 44C88 80069888 0064102A */ slt $v0, $v1, $a0
/* 44C8C 8006988C 1440FFFA */ bnez $v0, .L80069878
/* 44C90 80069890 00003021 */ addu $a2, $zero, $zero
/* 44C94 80069894 AFA00010 */ sw $zero, 0x10($sp)
/* 44C98 80069898 8E240004 */ lw $a0, 0x4($s1)
/* 44C9C 8006989C 8E250008 */ lw $a1, 0x8($s1)
/* 44CA0 800698A0 0C01A8F0 */ jal osContRamWrite
/* 44CA4 800698A4 27A70018 */ addiu $a3, $sp, 0x18
/* 44CA8 800698A8 14400074 */ bnez $v0, .L80069A7C
/* 44CAC 800698AC 00003021 */ addu $a2, $zero, $zero
/* 44CB0 800698B0 8E240004 */ lw $a0, 0x4($s1)
/* 44CB4 800698B4 8E250008 */ lw $a1, 0x8($s1)
/* 44CB8 800698B8 0C01A874 */ jal __osContRamRead
/* 44CBC 800698BC 27A70038 */ addiu $a3, $sp, 0x38
/* 44CC0 800698C0 1440006E */ bnez $v0, .L80069A7C
/* 44CC4 800698C4 00008021 */ addu $s0, $zero, $zero
/* 44CC8 800698C8 02802821 */ addu $a1, $s4, $zero
/* 44CCC 800698CC 02C02021 */ addu $a0, $s6, $zero
.L800698D0:
/* 44CD0 800698D0 90830000 */ lbu $v1, 0x0($a0)
/* 44CD4 800698D4 90A20000 */ lbu $v0, 0x0($a1)
/* 44CD8 800698D8 14620007 */ bne $v1, $v0, .L800698F8
/* 44CDC 800698DC 24020020 */ addiu $v0, $zero, 0x20
/* 44CE0 800698E0 24A50001 */ addiu $a1, $a1, 0x1
/* 44CE4 800698E4 26100001 */ addiu $s0, $s0, 0x1
/* 44CE8 800698E8 2A020020 */ slti $v0, $s0, 0x20
/* 44CEC 800698EC 1440FFF8 */ bnez $v0, .L800698D0
/* 44CF0 800698F0 24840001 */ addiu $a0, $a0, 0x1
/* 44CF4 800698F4 24020020 */ addiu $v0, $zero, 0x20
.L800698F8:
/* 44CF8 800698F8 16020015 */ bne $s0, $v0, .L80069950
/* 44CFC 800698FC 00000000 */ nop
/* 44D00 80069900 1A40000F */ blez $s2, .L80069940
/* 44D04 80069904 02202021 */ addu $a0, $s1, $zero
/* 44D08 80069908 0C01A5B4 */ jal __osPfsSelectBank
/* 44D0C 8006990C 00002821 */ addu $a1, $zero, $zero
/* 44D10 80069910 1440005A */ bnez $v0, .L80069A7C
/* 44D14 80069914 00003021 */ addu $a2, $zero, $zero
/* 44D18 80069918 8E240004 */ lw $a0, 0x4($s1)
/* 44D1C 8006991C 8E250008 */ lw $a1, 0x8($s1)
/* 44D20 80069920 0C01A874 */ jal __osContRamRead
/* 44D24 80069924 02803821 */ addu $a3, $s4, $zero
/* 44D28 80069928 14400054 */ bnez $v0, .L80069A7C
/* 44D2C 8006992C 00000000 */ nop
/* 44D30 80069930 93A30018 */ lbu $v1, 0x18($sp)
/* 44D34 80069934 24020080 */ addiu $v0, $zero, 0x80
/* 44D38 80069938 14620005 */ bne $v1, $v0, .L80069950
/* 44D3C 8006993C 00000000 */ nop
.L80069940:
/* 44D40 80069940 26520001 */ addiu $s2, $s2, 0x1
/* 44D44 80069944 2A42003E */ slti $v0, $s2, 0x3E
/* 44D48 80069948 1440FFBE */ bnez $v0, .L80069844
/* 44D4C 8006994C 02202021 */ addu $a0, $s1, $zero
.L80069950:
/* 44D50 80069950 92220065 */ lbu $v0, 0x65($s1)
/* 44D54 80069954 10400005 */ beqz $v0, .L8006996C
/* 44D58 80069958 02202021 */ addu $a0, $s1, $zero
/* 44D5C 8006995C 0C01A5B4 */ jal __osPfsSelectBank
/* 44D60 80069960 00002821 */ addu $a1, $zero, $zero
/* 44D64 80069964 14400045 */ bnez $v0, .L80069A7C
/* 44D68 80069968 00000000 */ nop
.L8006996C:
/* 44D6C 8006996C 96A20018 */ lhu $v0, 0x18($s5)
/* 44D70 80069970 2666001E */ addiu $a2, $s3, 0x1E
/* 44D74 80069974 02602021 */ addu $a0, $s3, $zero
/* 44D78 80069978 0012182A */ slt $v1, $zero, $s2
/* 44D7C 8006997C A272001A */ sb $s2, 0x1A($s3)
/* 44D80 80069980 3042FFFE */ andi $v0, $v0, 0xFFFE
/* 44D84 80069984 00621825 */ or $v1, $v1, $v0
/* 44D88 80069988 A6630018 */ sh $v1, 0x18($s3)
/* 44D8C 8006998C 92A2001B */ lbu $v0, 0x1B($s5)
/* 44D90 80069990 2665001C */ addiu $a1, $s3, 0x1C
/* 44D94 80069994 00A03821 */ addu $a3, $a1, $zero
/* 44D98 80069998 A660001E */ sh $zero, 0x1E($s3)
/* 44D9C 8006999C A660001C */ sh $zero, 0x1C($s3)
/* 44DA0 800699A0 A262001B */ sb $v0, 0x1B($s3)
.L800699A4:
/* 44DA4 800699A4 94830000 */ lhu $v1, 0x0($a0)
/* 44DA8 800699A8 94A20000 */ lhu $v0, 0x0($a1)
/* 44DAC 800699AC 00431021 */ addu $v0, $v0, $v1
/* 44DB0 800699B0 A4A20000 */ sh $v0, 0x0($a1)
/* 44DB4 800699B4 94C20000 */ lhu $v0, 0x0($a2)
/* 44DB8 800699B8 24840002 */ addiu $a0, $a0, 0x2
/* 44DBC 800699BC 00031827 */ nor $v1, $zero, $v1
/* 44DC0 800699C0 00431021 */ addu $v0, $v0, $v1
/* 44DC4 800699C4 A4C20000 */ sh $v0, 0x0($a2)
/* 44DC8 800699C8 0087102B */ sltu $v0, $a0, $a3
/* 44DCC 800699CC 1440FFF5 */ bnez $v0, .L800699A4
/* 44DD0 800699D0 00008021 */ addu $s0, $zero, $zero
/* 44DD4 800699D4 24140001 */ addiu $s4, $zero, 0x1
/* 44DD8 800699D8 27B20018 */ addiu $s2, $sp, 0x18
/* 44DDC 800699DC 24020001 */ addiu $v0, $zero, 0x1
/* 44DE0 800699E0 A7A20058 */ sh $v0, 0x58($sp)
/* 44DE4 800699E4 24020003 */ addiu $v0, $zero, 0x3
/* 44DE8 800699E8 A7A2005A */ sh $v0, 0x5A($sp)
/* 44DEC 800699EC 24020004 */ addiu $v0, $zero, 0x4
/* 44DF0 800699F0 A7A2005C */ sh $v0, 0x5C($sp)
/* 44DF4 800699F4 24020006 */ addiu $v0, $zero, 0x6
/* 44DF8 800699F8 A7A2005E */ sh $v0, 0x5E($sp)
.L800699FC:
/* 44DFC 800699FC 96460040 */ lhu $a2, 0x40($s2)
/* 44E00 80069A00 AFB40010 */ sw $s4, 0x10($sp)
/* 44E04 80069A04 8E240004 */ lw $a0, 0x4($s1)
/* 44E08 80069A08 8E250008 */ lw $a1, 0x8($s1)
/* 44E0C 80069A0C 0C01A8F0 */ jal osContRamWrite
/* 44E10 80069A10 02603821 */ addu $a3, $s3, $zero
/* 44E14 80069A14 14400019 */ bnez $v0, .L80069A7C
/* 44E18 80069A18 26100001 */ addiu $s0, $s0, 0x1
/* 44E1C 80069A1C 2A020004 */ slti $v0, $s0, 0x4
/* 44E20 80069A20 1440FFF6 */ bnez $v0, .L800699FC
/* 44E24 80069A24 26520002 */ addiu $s2, $s2, 0x2
/* 44E28 80069A28 8E240004 */ lw $a0, 0x4($s1)
/* 44E2C 80069A2C 8E250008 */ lw $a1, 0x8($s1)
/* 44E30 80069A30 24060001 */ addiu $a2, $zero, 0x1
/* 44E34 80069A34 0C01A874 */ jal __osContRamRead
/* 44E38 80069A38 27A70018 */ addiu $a3, $sp, 0x18
/* 44E3C 80069A3C 10400005 */ beqz $v0, .L80069A54
/* 44E40 80069A40 02603021 */ addu $a2, $s3, $zero
/* 44E44 80069A44 0801A69F */ j .L80069A7C
/* 44E48 80069A48 00000000 */ nop
.L80069A4C:
/* 44E4C 80069A4C 0801A69F */ j .L80069A7C
/* 44E50 80069A50 2402000B */ addiu $v0, $zero, 0xB
.L80069A54:
/* 44E54 80069A54 27A40018 */ addiu $a0, $sp, 0x18
/* 44E58 80069A58 24C50020 */ addiu $a1, $a2, 0x20
.L80069A5C:
/* 44E5C 80069A5C 90830000 */ lbu $v1, 0x0($a0)
/* 44E60 80069A60 90C20000 */ lbu $v0, 0x0($a2)
/* 44E64 80069A64 1462FFF9 */ bne $v1, $v0, .L80069A4C
/* 44E68 80069A68 24C60001 */ addiu $a2, $a2, 0x1
/* 44E6C 80069A6C 00C5102A */ slt $v0, $a2, $a1
/* 44E70 80069A70 1440FFFA */ bnez $v0, .L80069A5C
/* 44E74 80069A74 24840001 */ addiu $a0, $a0, 0x1
/* 44E78 80069A78 00001021 */ addu $v0, $zero, $zero
.L80069A7C:
/* 44E7C 80069A7C 8FBF007C */ lw $ra, 0x7C($sp)
/* 44E80 80069A80 8FB60078 */ lw $s6, 0x78($sp)
/* 44E84 80069A84 8FB50074 */ lw $s5, 0x74($sp)
/* 44E88 80069A88 8FB40070 */ lw $s4, 0x70($sp)
/* 44E8C 80069A8C 8FB3006C */ lw $s3, 0x6C($sp)
/* 44E90 80069A90 8FB20068 */ lw $s2, 0x68($sp)
/* 44E94 80069A94 8FB10064 */ lw $s1, 0x64($sp)
/* 44E98 80069A98 8FB00060 */ lw $s0, 0x60($sp)
/* 44E9C 80069A9C 03E00008 */ jr $ra
/* 44EA0 80069AA0 27BD0080 */ addiu $sp, $sp, 0x80
### DECOMPILED C INSTRUCTIONS:
s32 __osRepairPackId(OSPfs *pfs, __OSPackId *badid, __OSPackId *newid) {
s32 ret;
u8 temp[BLOCKSIZE];
u8 comp[BLOCKSIZE];
u8 mask;
int i;
int j;
u16 index[4];
//ret = 0;
//mask = 0;
newid->repaired = -1;
newid->random = osGetCount();
newid->serial_mid = badid->serial_mid;
newid->serial_low = badid->serial_low;
j = 0;
SET_ACTIVEBANK_TO_ZERO;
do {
ERRCK(__osPfsSelectBank(pfs, j))
ERRCK(__osContRamRead(pfs->queue, pfs->channel, 0, temp));
temp[0] = j | 0x80;
for (i = 1; i < ARRAY_COUNT(temp); i++) {
temp[i] = ~temp[i];
}
ERRCK(__osContRamWrite(pfs->queue, pfs->channel, 0, temp, FALSE));
ERRCK(__osContRamRead(pfs->queue, pfs->channel, 0, comp));
for (i = 0; i < ARRAY_COUNT(temp); i++) {
if (comp[i] != temp[i]) {
break;
}
}
if (i != ARRAY_COUNT(temp)) {
break;
}
if (j > 0) {
ERRCK(__osPfsSelectBank(pfs, 0));
ERRCK(__osContRamRead(pfs->queue, pfs->channel, 0, (u8*)temp));
if (temp[0] != 128) {
break; //TODO: remove magic constant
}
}
j++;
} while (j < PFS_MAX_BANKS);
SET_ACTIVEBANK_TO_ZERO;
if (j > 0) {
mask = 1;
} else {
mask = 0;
}
newid->deviceid = (badid->deviceid & (u16)~1) | mask;
newid->banks = j;
newid->version = badid->version;
__osIdCheckSum((u16*)newid, &newid->checksum, &newid->inverted_checksum);
index[0] = PFS_ID_0AREA;
index[1] = PFS_ID_1AREA;
index[2] = PFS_ID_2AREA;
index[3] = PFS_ID_3AREA;
for (i = 0; i < ARRAY_COUNT(index); i++) {
ERRCK(__osContRamWrite(pfs->queue, pfs->channel, index[i], (u8*)newid, TRUE));
}
ERRCK(__osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp));
for (i = 0; i < ARRAY_COUNT(temp); i++) {
if (temp[i] != ((u8 *)newid)[i]) {
return PFS_ERR_DEVICE;
}
}
return 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel quizmo_audience_appendGfx
/* 3A7410 E00A8320 27BDFF40 */ addiu $sp, $sp, -0xC0
/* 3A7414 E00A8324 0080302D */ daddu $a2, $a0, $zero
/* 3A7418 E00A8328 3C07DB06 */ lui $a3, (0xDB060024 >> 16)
/* 3A741C E00A832C 34E70024 */ ori $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3A7420 E00A8330 27A40018 */ addiu $a0, $sp, 0x18
/* 3A7424 E00A8334 AFB200A0 */ sw $s2, 0xA0($sp)
/* 3A7428 E00A8338 3C120001 */ lui $s2, (0x11630 >> 16)
/* 3A742C E00A833C 36521630 */ ori $s2, $s2, (0x11630 & 0xFFFF)
/* 3A7430 E00A8340 AFB400A8 */ sw $s4, 0xA8($sp)
/* 3A7434 E00A8344 0000A02D */ daddu $s4, $zero, $zero
/* 3A7438 E00A8348 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 3A743C E00A834C 2442A674 */ addiu $v0, $v0, %lo(gDisplayContext)
/* 3A7440 E00A8350 AFBE00B8 */ sw $fp, 0xB8($sp)
/* 3A7444 E00A8354 0040F02D */ daddu $fp, $v0, $zero
/* 3A7448 E00A8358 3C028007 */ lui $v0, %hi(gMatrixListPos)
/* 3A744C E00A835C 244241F0 */ addiu $v0, $v0, %lo(gMatrixListPos)
/* 3A7450 E00A8360 AFB600B0 */ sw $s6, 0xB0($sp)
/* 3A7454 E00A8364 0040B02D */ daddu $s6, $v0, $zero
/* 3A7458 E00A8368 AFB700B4 */ sw $s7, 0xB4($sp)
/* 3A745C E00A836C 3C170001 */ lui $s7, (0x11630 >> 16)
/* 3A7460 E00A8370 36F71630 */ ori $s7, $s7, (0x11630 & 0xFFFF)
/* 3A7464 E00A8374 3C02800A */ lui $v0, %hi(gMainGfxPos)
/* 3A7468 E00A8378 2442A66C */ addiu $v0, $v0, %lo(gMainGfxPos)
/* 3A746C E00A837C AFB500AC */ sw $s5, 0xAC($sp)
/* 3A7470 E00A8380 0040A82D */ daddu $s5, $v0, $zero
/* 3A7474 E00A8384 AFBF00BC */ sw $ra, 0xBC($sp)
/* 3A7478 E00A8388 AFB300A4 */ sw $s3, 0xA4($sp)
/* 3A747C E00A838C AFB1009C */ sw $s1, 0x9C($sp)
/* 3A7480 E00A8390 AFB00098 */ sw $s0, 0x98($sp)
/* 3A7484 E00A8394 8C480000 */ lw $t0, 0x0($v0)
/* 3A7488 E00A8398 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3A748C E00A839C 8CC5000C */ lw $a1, 0xC($a2)
/* 3A7490 E00A83A0 0100182D */ daddu $v1, $t0, $zero
/* 3A7494 E00A83A4 8CB00018 */ lw $s0, 0x18($a1)
/* 3A7498 E00A83A8 25080008 */ addiu $t0, $t0, 0x8
/* 3A749C E00A83AC AC620000 */ sw $v0, 0x0($v1)
/* 3A74A0 E00A83B0 AC600004 */ sw $zero, 0x4($v1)
/* 3A74A4 E00A83B4 AD070000 */ sw $a3, 0x0($t0)
/* 3A74A8 E00A83B8 8CC20010 */ lw $v0, 0x10($a2)
/* 3A74AC E00A83BC 00A0982D */ daddu $s3, $a1, $zero
/* 3A74B0 E00A83C0 AEA80000 */ sw $t0, 0x0($s5)
/* 3A74B4 E00A83C4 8C42001C */ lw $v0, 0x1C($v0)
/* 3A74B8 E00A83C8 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 3A74BC E00A83CC 00431021 */ addu $v0, $v0, $v1
/* 3A74C0 E00A83D0 AD020004 */ sw $v0, 0x4($t0)
/* 3A74C4 E00A83D4 8E65000C */ lw $a1, 0xC($s3)
/* 3A74C8 E00A83D8 8E660010 */ lw $a2, 0x10($s3)
/* 3A74CC E00A83DC 8E670014 */ lw $a3, 0x14($s3)
/* 3A74D0 E00A83E0 25080008 */ addiu $t0, $t0, 0x8
/* 3A74D4 E00A83E4 0C080108 */ jal shim_guTranslateF
/* 3A74D8 E00A83E8 AEA80000 */ sw $t0, 0x0($s5)
/* 3A74DC E00A83EC 27B10058 */ addiu $s1, $sp, 0x58
/* 3A74E0 E00A83F0 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 3A74E4 E00A83F4 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 3A74E8 E00A83F8 44800000 */ mtc1 $zero, $f0
/* 3A74EC E00A83FC 00031080 */ sll $v0, $v1, 2
/* 3A74F0 E00A8400 00431021 */ addu $v0, $v0, $v1
/* 3A74F4 E00A8404 00021080 */ sll $v0, $v0, 2
/* 3A74F8 E00A8408 00431023 */ subu $v0, $v0, $v1
/* 3A74FC E00A840C 000218C0 */ sll $v1, $v0, 3
/* 3A7500 E00A8410 00431021 */ addu $v0, $v0, $v1
/* 3A7504 E00A8414 000210C0 */ sll $v0, $v0, 3
/* 3A7508 E00A8418 44060000 */ mfc1 $a2, $f0
/* 3A750C E00A841C 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 3A7510 E00A8420 00220821 */ addu $at, $at, $v0
/* 3A7514 E00A8424 C4201DEC */ lwc1 $f0, %lo(gCameras + 0x6C)($at)
/* 3A7518 E00A8428 3C073F80 */ lui $a3, (0x3F800000 >> 16)
/* 3A751C E00A842C 46000007 */ neg.s $f0, $f0
/* 3A7520 E00A8430 44050000 */ mfc1 $a1, $f0
/* 3A7524 E00A8434 0220202D */ daddu $a0, $s1, $zero
/* 3A7528 E00A8438 0C080104 */ jal shim_guRotateF
/* 3A752C E00A843C AFA60010 */ sw $a2, 0x10($sp)
/* 3A7530 E00A8440 0220202D */ daddu $a0, $s1, $zero
/* 3A7534 E00A8444 27A50018 */ addiu $a1, $sp, 0x18
/* 3A7538 E00A8448 0C080114 */ jal shim_guMtxCatF
/* 3A753C E00A844C 00A0302D */ daddu $a2, $a1, $zero
/* 3A7540 E00A8450 27A40018 */ addiu $a0, $sp, 0x18
/* 3A7544 E00A8454 96C50000 */ lhu $a1, 0x0($s6)
/* 3A7548 E00A8458 8FC20000 */ lw $v0, 0x0($fp)
/* 3A754C E00A845C 00052980 */ sll $a1, $a1, 6
/* 3A7550 E00A8460 00B22821 */ addu $a1, $a1, $s2
/* 3A7554 E00A8464 0C080118 */ jal shim_guMtxF2L
/* 3A7558 E00A8468 00452821 */ addu $a1, $v0, $a1
/* 3A755C E00A846C 3C03DA38 */ lui $v1, (0xDA380002 >> 16)
/* 3A7560 E00A8470 34630002 */ ori $v1, $v1, (0xDA380002 & 0xFFFF)
/* 3A7564 E00A8474 321000FF */ andi $s0, $s0, 0xFF
/* 3A7568 E00A8478 8EA40000 */ lw $a0, 0x0($s5)
/* 3A756C E00A847C 96C20000 */ lhu $v0, 0x0($s6)
/* 3A7570 E00A8480 0080282D */ daddu $a1, $a0, $zero
/* 3A7574 E00A8484 24840008 */ addiu $a0, $a0, 0x8
/* 3A7578 E00A8488 AEA40000 */ sw $a0, 0x0($s5)
/* 3A757C E00A848C ACA30000 */ sw $v1, 0x0($a1)
/* 3A7580 E00A8490 24430001 */ addiu $v1, $v0, 0x1
/* 3A7584 E00A8494 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 3A7588 E00A8498 00021180 */ sll $v0, $v0, 6
/* 3A758C E00A849C A6C30000 */ sh $v1, 0x0($s6)
/* 3A7590 E00A84A0 8FC30000 */ lw $v1, 0x0($fp)
/* 3A7594 E00A84A4 00521021 */ addu $v0, $v0, $s2
/* 3A7598 E00A84A8 00621821 */ addu $v1, $v1, $v0
/* 3A759C E00A84AC 24820008 */ addiu $v0, $a0, 0x8
/* 3A75A0 E00A84B0 ACA30004 */ sw $v1, 0x4($a1)
/* 3A75A4 E00A84B4 AEA20000 */ sw $v0, 0x0($s5)
/* 3A75A8 E00A84B8 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 3A75AC E00A84BC AC820000 */ sw $v0, 0x0($a0)
/* 3A75B0 E00A84C0 00101600 */ sll $v0, $s0, 24
/* 3A75B4 E00A84C4 00101C00 */ sll $v1, $s0, 16
/* 3A75B8 E00A84C8 00431025 */ or $v0, $v0, $v1
/* 3A75BC E00A84CC 00108200 */ sll $s0, $s0, 8
/* 3A75C0 E00A84D0 00501025 */ or $v0, $v0, $s0
/* 3A75C4 E00A84D4 344200FF */ ori $v0, $v0, 0xFF
/* 3A75C8 E00A84D8 AC820004 */ sw $v0, 0x4($a0)
/* 3A75CC E00A84DC 24820010 */ addiu $v0, $a0, 0x10
/* 3A75D0 E00A84E0 AEA20000 */ sw $v0, 0x0($s5)
/* 3A75D4 E00A84E4 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3A75D8 E00A84E8 AC820008 */ sw $v0, 0x8($a0)
/* 3A75DC E00A84EC 3C020900 */ lui $v0, %hi(D_09003110_4103A0)
/* 3A75E0 E00A84F0 24423110 */ addiu $v0, $v0, %lo(D_09003110_4103A0)
/* 3A75E4 E00A84F4 AC82000C */ sw $v0, 0xC($a0)
.LE00A84F8:
/* 3A75E8 E00A84F8 27A40018 */ addiu $a0, $sp, 0x18
/* 3A75EC E00A84FC 0000382D */ daddu $a3, $zero, $zero
/* 3A75F0 E00A8500 8E6500BC */ lw $a1, 0xBC($s3)
/* 3A75F4 E00A8504 8E6600E4 */ lw $a2, 0xE4($s3)
/* 3A75F8 E00A8508 26730004 */ addiu $s3, $s3, 0x4
/* 3A75FC E00A850C 00148080 */ sll $s0, $s4, 2
/* 3A7600 E00A8510 0C080108 */ jal shim_guTranslateF
/* 3A7604 E00A8514 26940001 */ addiu $s4, $s4, 0x1
/* 3A7608 E00A8518 27A40018 */ addiu $a0, $sp, 0x18
/* 3A760C E00A851C 96C50000 */ lhu $a1, 0x0($s6)
/* 3A7610 E00A8520 8FC20000 */ lw $v0, 0x0($fp)
/* 3A7614 E00A8524 00052980 */ sll $a1, $a1, 6
/* 3A7618 E00A8528 00B72821 */ addu $a1, $a1, $s7
/* 3A761C E00A852C 0C080118 */ jal shim_guMtxF2L
/* 3A7620 E00A8530 00452821 */ addu $a1, $v0, $a1
/* 3A7624 E00A8534 3C06D838 */ lui $a2, (0xD8380002 >> 16)
/* 3A7628 E00A8538 8EA40000 */ lw $a0, 0x0($s5)
/* 3A762C E00A853C 34C60002 */ ori $a2, $a2, (0xD8380002 & 0xFFFF)
/* 3A7630 E00A8540 0080282D */ daddu $a1, $a0, $zero
/* 3A7634 E00A8544 24840008 */ addiu $a0, $a0, 0x8
/* 3A7638 E00A8548 AEA40000 */ sw $a0, 0x0($s5)
/* 3A763C E00A854C 96C20000 */ lhu $v0, 0x0($s6)
/* 3A7640 E00A8550 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 3A7644 E00A8554 ACA30000 */ sw $v1, 0x0($a1)
/* 3A7648 E00A8558 24430001 */ addiu $v1, $v0, 0x1
/* 3A764C E00A855C 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 3A7650 E00A8560 00021180 */ sll $v0, $v0, 6
/* 3A7654 E00A8564 A6C30000 */ sh $v1, 0x0($s6)
/* 3A7658 E00A8568 8FC30000 */ lw $v1, 0x0($fp)
/* 3A765C E00A856C 00571021 */ addu $v0, $v0, $s7
/* 3A7660 E00A8570 00621821 */ addu $v1, $v1, $v0
/* 3A7664 E00A8574 24820008 */ addiu $v0, $a0, 0x8
/* 3A7668 E00A8578 ACA30004 */ sw $v1, 0x4($a1)
/* 3A766C E00A857C AEA20000 */ sw $v0, 0x0($s5)
/* 3A7670 E00A8580 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3A7674 E00A8584 AC820000 */ sw $v0, 0x0($a0)
/* 3A7678 E00A8588 24820010 */ addiu $v0, $a0, 0x10
/* 3A767C E00A858C 3C03E00B */ lui $v1, (0xE00B0000 >> 16)
/* 3A7680 E00A8590 00701821 */ addu $v1, $v1, $s0
/* 3A7684 E00A8594 8C638620 */ lw $v1, -0x79E0($v1)
/* 3A7688 E00A8598 24050040 */ addiu $a1, $zero, 0x40
/* 3A768C E00A859C AEA20000 */ sw $v0, 0x0($s5)
/* 3A7690 E00A85A0 2A82000A */ slti $v0, $s4, 0xA
/* 3A7694 E00A85A4 AC860008 */ sw $a2, 0x8($a0)
/* 3A7698 E00A85A8 AC85000C */ sw $a1, 0xC($a0)
/* 3A769C E00A85AC 1440FFD2 */ bnez $v0, .LE00A84F8
/* 3A76A0 E00A85B0 AC830004 */ sw $v1, 0x4($a0)
/* 3A76A4 E00A85B4 3C04800A */ lui $a0, %hi(gMainGfxPos)
/* 3A76A8 E00A85B8 2484A66C */ addiu $a0, $a0, %lo(gMainGfxPos)
/* 3A76AC E00A85BC 8C820000 */ lw $v0, 0x0($a0)
/* 3A76B0 E00A85C0 0040182D */ daddu $v1, $v0, $zero
/* 3A76B4 E00A85C4 24420008 */ addiu $v0, $v0, 0x8
/* 3A76B8 E00A85C8 AC820000 */ sw $v0, 0x0($a0)
/* 3A76BC E00A85CC AC660000 */ sw $a2, 0x0($v1)
/* 3A76C0 E00A85D0 AC650004 */ sw $a1, 0x4($v1)
/* 3A76C4 E00A85D4 24430008 */ addiu $v1, $v0, 0x8
/* 3A76C8 E00A85D8 AC830000 */ sw $v1, 0x0($a0)
/* 3A76CC E00A85DC 3C03E700 */ lui $v1, (0xE7000000 >> 16)
/* 3A76D0 E00A85E0 AC430000 */ sw $v1, 0x0($v0)
/* 3A76D4 E00A85E4 AC400004 */ sw $zero, 0x4($v0)
/* 3A76D8 E00A85E8 8FBF00BC */ lw $ra, 0xBC($sp)
/* 3A76DC E00A85EC 8FBE00B8 */ lw $fp, 0xB8($sp)
/* 3A76E0 E00A85F0 8FB700B4 */ lw $s7, 0xB4($sp)
/* 3A76E4 E00A85F4 8FB600B0 */ lw $s6, 0xB0($sp)
/* 3A76E8 E00A85F8 8FB500AC */ lw $s5, 0xAC($sp)
/* 3A76EC E00A85FC 8FB400A8 */ lw $s4, 0xA8($sp)
/* 3A76F0 E00A8600 8FB300A4 */ lw $s3, 0xA4($sp)
/* 3A76F4 E00A8604 8FB200A0 */ lw $s2, 0xA0($sp)
/* 3A76F8 E00A8608 8FB1009C */ lw $s1, 0x9C($sp)
/* 3A76FC E00A860C 8FB00098 */ lw $s0, 0x98($sp)
/* 3A7700 E00A8610 03E00008 */ jr $ra
/* 3A7704 E00A8614 27BD00C0 */ addiu $sp, $sp, 0xC0
/* 3A7708 E00A8618 00000000 */ nop
/* 3A770C E00A861C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void quizmo_audience_appendGfx(void* effect) {
Matrix4f sp18;
Matrix4f sp58;
QuizmoAudienceFXData* data = ((EffectInstance*)effect)->data.quizmoAudience;
s32 primColor = data->primColor;
s32 i;
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_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 255);
gSPDisplayList(gMainGfxPos++, D_09003110_3AA8B0);
for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) {
shim_guTranslateF(sp18, data->compX[i], data->compY[i], 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, quizmo_audience_renderAudienceMember[i]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_BGMCmd_FF
/* 2B6F0 800502F0 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 2B6F4 800502F4 AFB20018 */ sw $s2, 0x18($sp)
/* 2B6F8 800502F8 0080902D */ daddu $s2, $a0, $zero
/* 2B6FC 800502FC AFBF0020 */ sw $ra, 0x20($sp)
/* 2B700 80050300 AFB3001C */ sw $s3, 0x1C($sp)
/* 2B704 80050304 AFB10014 */ sw $s1, 0x14($sp)
/* 2B708 80050308 AFB00010 */ sw $s0, 0x10($sp)
/* 2B70C 8005030C 924200D4 */ lbu $v0, 0xD4($s2)
/* 2B710 80050310 924300D5 */ lbu $v1, 0xD5($s2)
/* 2B714 80050314 924600D6 */ lbu $a2, 0xD6($s2)
/* 2B718 80050318 2444FFFF */ addiu $a0, $v0, -0x1
/* 2B71C 8005031C 2C820006 */ sltiu $v0, $a0, 0x6
/* 2B720 80050320 10400088 */ beqz $v0, .L80050544
/* 2B724 80050324 00041080 */ sll $v0, $a0, 2
/* 2B728 80050328 3C01800A */ lui $at, %hi(jtbl_800988D8)
/* 2B72C 8005032C 00220821 */ addu $at, $at, $v0
/* 2B730 80050330 8C2288D8 */ lw $v0, %lo(jtbl_800988D8)($at)
/* 2B734 80050334 00400008 */ jr $v0
/* 2B738 80050338 00000000 */ nop
glabel .L8005033C
/* 2B73C 8005033C 2C620004 */ sltiu $v0, $v1, 0x4
/* 2B740 80050340 10400080 */ beqz $v0, .L80050544
/* 2B744 80050344 02431021 */ addu $v0, $s2, $v1
/* 2B748 80050348 8043004C */ lb $v1, 0x4C($v0)
/* 2B74C 8005034C 0460007D */ bltz $v1, .L80050544
/* 2B750 80050350 9044004C */ lbu $a0, 0x4C($v0)
/* 2B754 80050354 8E420000 */ lw $v0, 0x0($s2)
/* 2B758 80050358 10C00010 */ beqz $a2, .L8005039C
/* 2B75C 8005035C A0440051 */ sb $a0, 0x51($v0)
/* 2B760 80050360 30C7000F */ andi $a3, $a2, 0xF
/* 2B764 80050364 00061102 */ srl $v0, $a2, 4
/* 2B768 80050368 30420001 */ andi $v0, $v0, 0x1
/* 2B76C 8005036C 8E430000 */ lw $v1, 0x0($s2)
/* 2B770 80050370 24450001 */ addiu $a1, $v0, 0x1
/* 2B774 80050374 90620052 */ lbu $v0, 0x52($v1)
/* 2B778 80050378 14470004 */ bne $v0, $a3, .L8005038C
/* 2B77C 8005037C 00A0202D */ daddu $a0, $a1, $zero
/* 2B780 80050380 90620053 */ lbu $v0, 0x53($v1)
/* 2B784 80050384 1044006F */ beq $v0, $a0, .L80050544
/* 2B788 80050388 00000000 */ nop
.L8005038C:
/* 2B78C 8005038C A0670052 */ sb $a3, 0x52($v1)
/* 2B790 80050390 8E420000 */ lw $v0, 0x0($s2)
/* 2B794 80050394 080140EC */ j .L800503B0
/* 2B798 80050398 A0450053 */ sb $a1, 0x53($v0)
.L8005039C:
/* 2B79C 8005039C 8E430000 */ lw $v1, 0x0($s2)
/* 2B7A0 800503A0 90620053 */ lbu $v0, 0x53($v1)
/* 2B7A4 800503A4 10400067 */ beqz $v0, .L80050544
/* 2B7A8 800503A8 00000000 */ nop
/* 2B7AC 800503AC A0600053 */ sb $zero, 0x53($v1)
.L800503B0:
/* 2B7B0 800503B0 8E430000 */ lw $v1, 0x0($s2)
/* 2B7B4 800503B4 24020001 */ addiu $v0, $zero, 0x1
/* 2B7B8 800503B8 08014151 */ j .L80050544
/* 2B7BC 800503BC A0620050 */ sb $v0, 0x50($v1)
glabel .L800503C0
/* 2B7C0 800503C0 2465FFFF */ addiu $a1, $v1, -0x1
/* 2B7C4 800503C4 2CA20008 */ sltiu $v0, $a1, 0x8
/* 2B7C8 800503C8 5040005E */ beql $v0, $zero, .L80050544
/* 2B7CC 800503CC A2400211 */ sb $zero, 0x211($s2)
/* 2B7D0 800503D0 A2430211 */ sb $v1, 0x211($s2)
/* 2B7D4 800503D4 0C013A11 */ jal func_8004E844
/* 2B7D8 800503D8 0240202D */ daddu $a0, $s2, $zero
/* 2B7DC 800503DC 08014151 */ j .L80050544
/* 2B7E0 800503E0 00000000 */ nop
glabel .L800503E4
/* 2B7E4 800503E4 92500211 */ lbu $s0, 0x211($s2)
/* 2B7E8 800503E8 2604FFFF */ addiu $a0, $s0, -0x1
/* 2B7EC 800503EC 2C820008 */ sltiu $v0, $a0, 0x8
/* 2B7F0 800503F0 10400054 */ beqz $v0, .L80050544
/* 2B7F4 800503F4 0080802D */ daddu $s0, $a0, $zero
/* 2B7F8 800503F8 02501021 */ addu $v0, $s2, $s0
/* 2B7FC 800503FC 90440212 */ lbu $a0, 0x212($v0)
/* 2B800 80050400 2C820008 */ sltiu $v0, $a0, 0x8
/* 2B804 80050404 1040004F */ beqz $v0, .L80050544
/* 2B808 80050408 2C620028 */ sltiu $v0, $v1, 0x28
/* 2B80C 8005040C 14400005 */ bnez $v0, .L80050424
/* 2B810 80050410 001010C0 */ sll $v0, $s0, 3
/* 2B814 80050414 00501021 */ addu $v0, $v0, $s0
/* 2B818 80050418 00441021 */ addu $v0, $v0, $a0
/* 2B81C 8005041C 0801410F */ j .L8005043C
/* 2B820 80050420 00021040 */ sll $v0, $v0, 1
.L80050424:
/* 2B824 80050424 00501021 */ addu $v0, $v0, $s0
/* 2B828 80050428 00441021 */ addu $v0, $v0, $a0
/* 2B82C 8005042C 00021040 */ sll $v0, $v0, 1
/* 2B830 80050430 3C018008 */ lui $at, %hi(D_80078558)
/* 2B834 80050434 00230821 */ addu $at, $at, $v1
/* 2B838 80050438 90238558 */ lbu $v1, %lo(D_80078558)($at)
.L8005043C:
/* 2B83C 8005043C 02421021 */ addu $v0, $s2, $v0
/* 2B840 80050440 00031A00 */ sll $v1, $v1, 8
/* 2B844 80050444 00661821 */ addu $v1, $v1, $a2
/* 2B848 80050448 A4430174 */ sh $v1, 0x174($v0)
/* 2B84C 8005044C 02501821 */ addu $v1, $s2, $s0
/* 2B850 80050450 24820001 */ addiu $v0, $a0, 0x1
/* 2B854 80050454 08014151 */ j .L80050544
/* 2B858 80050458 A0620212 */ sb $v0, 0x212($v1)
glabel .L8005045C
/* 2B85C 8005045C 2C620009 */ sltiu $v0, $v1, 0x9
/* 2B860 80050460 50400038 */ beql $v0, $zero, .L80050544
/* 2B864 80050464 A0A0004C */ sb $zero, 0x4C($a1)
/* 2B868 80050468 08014151 */ j .L80050544
/* 2B86C 8005046C A0A3004C */ sb $v1, 0x4C($a1)
glabel .L80050470
/* 2B870 80050470 8E420004 */ lw $v0, 0x4($s2)
/* 2B874 80050474 10400033 */ beqz $v0, .L80050544
/* 2B878 80050478 0000802D */ daddu $s0, $zero, $zero
/* 2B87C 8005047C 0040282D */ daddu $a1, $v0, $zero
.L80050480:
/* 2B880 80050480 00A0202D */ daddu $a0, $a1, $zero
/* 2B884 80050484 90820090 */ lbu $v0, 0x90($a0)
/* 2B888 80050488 10400022 */ beqz $v0, .L80050514
/* 2B88C 8005048C 00103080 */ sll $a2, $s0, 2
/* 2B890 80050490 26100001 */ addiu $s0, $s0, 0x1
/* 2B894 80050494 2E020004 */ sltiu $v0, $s0, 0x4
/* 2B898 80050498 1440FFF9 */ bnez $v0, .L80050480
/* 2B89C 8005049C 24850004 */ addiu $a1, $a0, 0x4
/* 2B8A0 800504A0 08014151 */ j .L80050544
/* 2B8A4 800504A4 00000000 */ nop
glabel .L800504A8
/* 2B8A8 800504A8 54600025 */ bnel $v1, $zero, .L80050540
/* 2B8AC 800504AC A0A3004F */ sb $v1, 0x4F($a1)
/* 2B8B0 800504B0 90A2004E */ lbu $v0, 0x4E($a1)
/* 2B8B4 800504B4 10400023 */ beqz $v0, .L80050544
/* 2B8B8 800504B8 0000802D */ daddu $s0, $zero, $zero
/* 2B8BC 800504BC A0A0004E */ sb $zero, 0x4E($a1)
/* 2B8C0 800504C0 2413007F */ addiu $s3, $zero, 0x7F
/* 2B8C4 800504C4 2411025C */ addiu $s1, $zero, 0x25C
.L800504C8:
/* 2B8C8 800504C8 92420171 */ lbu $v0, 0x171($s2)
/* 2B8CC 800504CC 14530004 */ bne $v0, $s3, .L800504E0
/* 2B8D0 800504D0 02512821 */ addu $a1, $s2, $s1
/* 2B8D4 800504D4 90A2004F */ lbu $v0, 0x4F($a1)
/* 2B8D8 800504D8 08014139 */ j .L800504E4
/* 2B8DC 800504DC 00000000 */ nop
.L800504E0:
/* 2B8E0 800504E0 90A20050 */ lbu $v0, 0x50($a1)
.L800504E4:
/* 2B8E4 800504E4 10400005 */ beqz $v0, .L800504FC
/* 2B8E8 800504E8 0240202D */ daddu $a0, $s2, $zero
/* 2B8EC 800504EC 0040302D */ daddu $a2, $v0, $zero
/* 2B8F0 800504F0 24070048 */ addiu $a3, $zero, 0x48
/* 2B8F4 800504F4 0C014222 */ jal func_80050888
/* 2B8F8 800504F8 A0A0004E */ sb $zero, 0x4E($a1)
.L800504FC:
/* 2B8FC 800504FC 26100001 */ addiu $s0, $s0, 0x1
/* 2B900 80050500 2E020010 */ sltiu $v0, $s0, 0x10
/* 2B904 80050504 1440FFF0 */ bnez $v0, .L800504C8
/* 2B908 80050508 26310060 */ addiu $s1, $s1, 0x60
/* 2B90C 8005050C 08014151 */ j .L80050544
/* 2B910 80050510 00000000 */ nop
.L80050514:
/* 2B914 80050514 A0A30090 */ sb $v1, 0x90($a1)
/* 2B918 80050518 9643002C */ lhu $v1, 0x2C($s2)
/* 2B91C 8005051C 9642003C */ lhu $v0, 0x3C($s2)
/* 2B920 80050520 00620018 */ mult $v1, $v0
/* 2B924 80050524 8E430004 */ lw $v1, 0x4($s2)
/* 2B928 80050528 00661821 */ addu $v1, $v1, $a2
/* 2B92C 8005052C 00004012 */ mflo $t0
/* 2B930 80050530 25027FFF */ addiu $v0, $t0, 0x7FFF
/* 2B934 80050534 000215C3 */ sra $v0, $v0, 23
/* 2B938 80050538 08014151 */ j .L80050544
/* 2B93C 8005053C A0620093 */ sb $v0, 0x93($v1)
.L80050540:
/* 2B940 80050540 A0A60050 */ sb $a2, 0x50($a1)
.L80050544:
/* 2B944 80050544 8FBF0020 */ lw $ra, 0x20($sp)
/* 2B948 80050548 8FB3001C */ lw $s3, 0x1C($sp)
/* 2B94C 8005054C 8FB20018 */ lw $s2, 0x18($sp)
/* 2B950 80050550 8FB10014 */ lw $s1, 0x14($sp)
/* 2B954 80050554 8FB00010 */ lw $s0, 0x10($sp)
/* 2B958 80050558 03E00008 */ jr $ra
/* 2B95C 8005055C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void au_BGMCmd_FF(BGMPlayer* player, BGMPlayerTrack* track) {
u32 i;
u32 j;
u8 temp_a1;
u8 temp_a3;
u32 arg0 = player->seqCmdArgs.UnkCmdFF.unk_00;
u32 arg1 = player->seqCmdArgs.UnkCmdFF.unk_01;
u32 arg2 = player->seqCmdArgs.UnkCmdFF.unk_02;
switch (arg0) {
case 1:
if ((arg1 < ARRAY_COUNT(player->effectIndices)) && ((s8)player->effectIndices[arg1] >= 0)) {
player->globals->channelDelayBusId = player->effectIndices[arg1];
if (arg2 != 0) {
temp_a3 = arg2 & 0xF;
temp_a1 = ((arg2 >> 4) & 1) + 1;
if ((player->globals->channelDelayTime != temp_a3) || (player->globals->channelDelaySide != temp_a1)) {
player->globals->channelDelayTime = temp_a3;
player->globals->channelDelaySide = temp_a1;
player->globals->channelDelayPending = 1;
}
} else {
if (player->globals->channelDelaySide != 0) {
player->globals->channelDelaySide = 0;
player->globals->channelDelayPending = 1;
}
}
}
break;
case 2:
if (arg1 - 1 < 8) {
player->unk_211 = arg1;
func_8004E844(player, arg1 - 1);
} else {
player->unk_211 = 0;
}
break;
case 3:
i = player->unk_211;
if (i - 1 < 8) {
i = i - 1; // needed to match
j = player->unk_212[i];
if (j < 8) {
if (arg1 >= 40) {
player->unk_174[i][j] = (arg1 << 8) + arg2;
} else {
player->unk_174[i][j] = (D_80078558[arg1] << 8) + arg2;
}
player->unk_212[i] = j + 1;
}
}
break;
case 4:
if (arg1 < 9) {
track->unk_4C = arg1;
} else {
track->unk_4C = 0;
}
break;
case 5:
if (player->soundManager != NULL) {
for (i = 0; i < ARRAY_COUNT(player->soundManager->bgmSounds); i++) {
if ((player->soundManager->bgmSounds[i].unk_0) == 0) {
player->soundManager->bgmSounds[i].unk_0 = arg1;
player->soundManager->bgmSounds[i].volume = ((player->fadeInfo.currentVolume.u16 * player->fadeInfo.volScale.u16) + 0x7FFF) >> 0x17;
break;
}
}
}
break;
case 6:
if (arg1 == 0) {
if (track->unk_4E != 0) {
track->unk_4E = 0;
for (i = 0; i < 16; i++) {
BGMPlayerTrack* otherTrack = &player->tracks[i];
if (player->proxMixVolume == 0x7F) {
if (otherTrack->unk_4F != 0) {
otherTrack->unk_4E = 0;
func_80050888(player, otherTrack, otherTrack->unk_4F, 72);
}
} else {
if (otherTrack->unk_50 != 0) {
otherTrack->unk_4E = 0;
func_80050888(player, otherTrack, otherTrack->unk_50, 72);
}
}
}
}
} else {
track->unk_4F = arg1;
track->unk_50 = arg2;
}
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel partner_buff_update
/* 404324 E011A104 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 404328 E011A108 AFBF002C */ sw $ra, 0x2C($sp)
/* 40432C E011A10C AFB60028 */ sw $s6, 0x28($sp)
/* 404330 E011A110 AFB50024 */ sw $s5, 0x24($sp)
/* 404334 E011A114 AFB40020 */ sw $s4, 0x20($sp)
/* 404338 E011A118 AFB3001C */ sw $s3, 0x1C($sp)
/* 40433C E011A11C AFB20018 */ sw $s2, 0x18($sp)
/* 404340 E011A120 AFB10014 */ sw $s1, 0x14($sp)
/* 404344 E011A124 AFB00010 */ sw $s0, 0x10($sp)
/* 404348 E011A128 8C830000 */ lw $v1, 0x0($a0)
/* 40434C E011A12C 8C91000C */ lw $s1, 0xC($a0)
/* 404350 E011A130 30620010 */ andi $v0, $v1, 0x10
/* 404354 E011A134 86360000 */ lh $s6, 0x0($s1)
/* 404358 E011A138 10400005 */ beqz $v0, .LE011A150
/* 40435C E011A13C 2402FFEF */ addiu $v0, $zero, -0x11
/* 404360 E011A140 00621024 */ and $v0, $v1, $v0
/* 404364 E011A144 AC820000 */ sw $v0, 0x0($a0)
/* 404368 E011A148 24020010 */ addiu $v0, $zero, 0x10
/* 40436C E011A14C AE220004 */ sw $v0, 0x4($s1)
.LE011A150:
/* 404370 E011A150 8E230004 */ lw $v1, 0x4($s1)
/* 404374 E011A154 286203E8 */ slti $v0, $v1, 0x3E8
/* 404378 E011A158 10400002 */ beqz $v0, .LE011A164
/* 40437C E011A15C 2462FFFF */ addiu $v0, $v1, -0x1
/* 404380 E011A160 AE220004 */ sw $v0, 0x4($s1)
.LE011A164:
/* 404384 E011A164 8E220008 */ lw $v0, 0x8($s1)
/* 404388 E011A168 8E230004 */ lw $v1, 0x4($s1)
/* 40438C E011A16C 24450001 */ addiu $a1, $v0, 0x1
/* 404390 E011A170 04610005 */ bgez $v1, .LE011A188
/* 404394 E011A174 AE250008 */ sw $a1, 0x8($s1)
/* 404398 E011A178 0C080128 */ jal shim_remove_effect
/* 40439C E011A17C 00000000 */ nop
/* 4043A0 E011A180 080468DC */ j .LE011A370
/* 4043A4 E011A184 00000000 */ nop
.LE011A188:
/* 4043A8 E011A188 3C028888 */ lui $v0, (0x88888889 >> 16)
/* 4043AC E011A18C 34428889 */ ori $v0, $v0, (0x88888889 & 0xFFFF)
/* 4043B0 E011A190 00A20018 */ mult $a1, $v0
/* 4043B4 E011A194 0000982D */ daddu $s3, $zero, $zero
/* 4043B8 E011A198 24140001 */ addiu $s4, $zero, 0x1
/* 4043BC E011A19C 2412000C */ addiu $s2, $zero, 0xC
/* 4043C0 E011A1A0 000517C3 */ sra $v0, $a1, 31
/* 4043C4 E011A1A4 00003010 */ mfhi $a2
/* 4043C8 E011A1A8 00C51821 */ addu $v1, $a2, $a1
/* 4043CC E011A1AC 00031903 */ sra $v1, $v1, 4
/* 4043D0 E011A1B0 00621823 */ subu $v1, $v1, $v0
/* 4043D4 E011A1B4 00031100 */ sll $v0, $v1, 4
/* 4043D8 E011A1B8 00431023 */ subu $v0, $v0, $v1
/* 4043DC E011A1BC 02821004 */ sllv $v0, $v0, $s4
/* 4043E0 E011A1C0 00A2A823 */ subu $s5, $a1, $v0
.LE011A1C4:
/* 4043E4 E011A1C4 02328021 */ addu $s0, $s1, $s2
/* 4043E8 E011A1C8 86020004 */ lh $v0, 0x4($s0)
/* 4043EC E011A1CC 04420001 */ bltzl $v0, .LE011A1D4
/* 4043F0 E011A1D0 A6000004 */ sh $zero, 0x4($s0)
.LE011A1D4:
/* 4043F4 E011A1D4 16D40006 */ bne $s6, $s4, .LE011A1F0
/* 4043F8 E011A1D8 00000000 */ nop
/* 4043FC E011A1DC 16A00004 */ bnez $s5, .LE011A1F0
/* 404400 E011A1E0 00000000 */ nop
/* 404404 E011A1E4 0C080138 */ jal shim_rand_int
/* 404408 E011A1E8 24040004 */ addiu $a0, $zero, 0x4
/* 40440C E011A1EC A6020004 */ sh $v0, 0x4($s0)
.LE011A1F0:
/* 404410 E011A1F0 86030006 */ lh $v1, 0x6($s0)
/* 404414 E011A1F4 2C620029 */ sltiu $v0, $v1, 0x29
/* 404418 E011A1F8 10400059 */ beqz $v0, .LE011A360
/* 40441C E011A1FC 00031080 */ sll $v0, $v1, 2
/* 404420 E011A200 3C01E012 */ lui $at, (0xE0120000 >> 16)
/* 404424 E011A204 00220821 */ addu $at, $at, $v0
/* 404428 E011A208 8C22AC70 */ lw $v0, -0x5390($at)
/* 40442C E011A20C 00400008 */ jr $v0
/* 404430 E011A210 00000000 */ nop
/* 404434 E011A214 86030000 */ lh $v1, 0x0($s0)
/* 404438 E011A218 240200FF */ addiu $v0, $zero, 0xFF
/* 40443C E011A21C 14620011 */ bne $v1, $v0, .LE011A264
/* 404440 E011A220 00000000 */ nop
/* 404444 E011A224 86040004 */ lh $a0, 0x4($s0)
/* 404448 E011A228 86030002 */ lh $v1, 0x2($s0)
/* 40444C E011A22C 0083102A */ slt $v0, $a0, $v1
/* 404450 E011A230 10400003 */ beqz $v0, .LE011A240
/* 404454 E011A234 0064102A */ slt $v0, $v1, $a0
/* 404458 E011A238 080468D8 */ j .LE011A360
/* 40445C E011A23C A6140006 */ sh $s4, 0x6($s0)
.LE011A240:
/* 404460 E011A240 10400003 */ beqz $v0, .LE011A250
/* 404464 E011A244 24020002 */ addiu $v0, $zero, 0x2
/* 404468 E011A248 080468D8 */ j .LE011A360
/* 40446C E011A24C A6020006 */ sh $v0, 0x6($s0)
.LE011A250:
/* 404470 E011A250 54600044 */ bnel $v1, $zero, .LE011A364
/* 404474 E011A254 26730001 */ addiu $s3, $s3, 0x1
/* 404478 E011A258 24020003 */ addiu $v0, $zero, 0x3
/* 40447C E011A25C 080468D8 */ j .LE011A360
/* 404480 E011A260 A6020006 */ sh $v0, 0x6($s0)
.LE011A264:
/* 404484 E011A264 5460003F */ bnel $v1, $zero, .LE011A364
/* 404488 E011A268 26730001 */ addiu $s3, $s3, 0x1
/* 40448C E011A26C 86020004 */ lh $v0, 0x4($s0)
/* 404490 E011A270 1840003B */ blez $v0, .LE011A360
/* 404494 E011A274 24020004 */ addiu $v0, $zero, 0x4
/* 404498 E011A278 080468D8 */ j .LE011A360
/* 40449C E011A27C A6020006 */ sh $v0, 0x6($s0)
/* 4044A0 E011A280 2402000A */ addiu $v0, $zero, 0xA
/* 4044A4 E011A284 A6000008 */ sh $zero, 0x8($s0)
/* 4044A8 E011A288 A6020006 */ sh $v0, 0x6($s0)
/* 4044AC E011A28C 96020008 */ lhu $v0, 0x8($s0)
/* 4044B0 E011A290 24420001 */ addiu $v0, $v0, 0x1
/* 4044B4 E011A294 A6020008 */ sh $v0, 0x8($s0)
/* 4044B8 E011A298 00021400 */ sll $v0, $v0, 16
/* 4044BC E011A29C 00021403 */ sra $v0, $v0, 16
/* 4044C0 E011A2A0 2842000B */ slti $v0, $v0, 0xB
/* 4044C4 E011A2A4 5440002F */ bnel $v0, $zero, .LE011A364
/* 4044C8 E011A2A8 26730001 */ addiu $s3, $s3, 0x1
/* 4044CC E011A2AC 96020002 */ lhu $v0, 0x2($s0)
/* 4044D0 E011A2B0 A6000008 */ sh $zero, 0x8($s0)
/* 4044D4 E011A2B4 A6000006 */ sh $zero, 0x6($s0)
/* 4044D8 E011A2B8 2442FFFF */ addiu $v0, $v0, -0x1
/* 4044DC E011A2BC 080468D8 */ j .LE011A360
/* 4044E0 E011A2C0 A6020002 */ sh $v0, 0x2($s0)
/* 4044E4 E011A2C4 24020014 */ addiu $v0, $zero, 0x14
/* 4044E8 E011A2C8 A6000008 */ sh $zero, 0x8($s0)
/* 4044EC E011A2CC A6020006 */ sh $v0, 0x6($s0)
/* 4044F0 E011A2D0 96020008 */ lhu $v0, 0x8($s0)
/* 4044F4 E011A2D4 24420001 */ addiu $v0, $v0, 0x1
/* 4044F8 E011A2D8 A6020008 */ sh $v0, 0x8($s0)
/* 4044FC E011A2DC 00021400 */ sll $v0, $v0, 16
/* 404500 E011A2E0 00021403 */ sra $v0, $v0, 16
/* 404504 E011A2E4 2842000B */ slti $v0, $v0, 0xB
/* 404508 E011A2E8 5440001E */ bnel $v0, $zero, .LE011A364
/* 40450C E011A2EC 26730001 */ addiu $s3, $s3, 0x1
/* 404510 E011A2F0 96020004 */ lhu $v0, 0x4($s0)
/* 404514 E011A2F4 A6000008 */ sh $zero, 0x8($s0)
/* 404518 E011A2F8 A6000006 */ sh $zero, 0x6($s0)
/* 40451C E011A2FC 080468D8 */ j .LE011A360
/* 404520 E011A300 A6020002 */ sh $v0, 0x2($s0)
/* 404524 E011A304 96020000 */ lhu $v0, 0x0($s0)
/* 404528 E011A308 2442FFE0 */ addiu $v0, $v0, -0x20
/* 40452C E011A30C A6020000 */ sh $v0, 0x0($s0)
/* 404530 E011A310 00021400 */ sll $v0, $v0, 16
/* 404534 E011A314 04430013 */ bgezl $v0, .LE011A364
/* 404538 E011A318 26730001 */ addiu $s3, $s3, 0x1
/* 40453C E011A31C 080468D7 */ j .LE011A35C
/* 404540 E011A320 A6000000 */ sh $zero, 0x0($s0)
/* 404544 E011A324 96030004 */ lhu $v1, 0x4($s0)
/* 404548 E011A328 24020028 */ addiu $v0, $zero, 0x28
/* 40454C E011A32C A6020006 */ sh $v0, 0x6($s0)
/* 404550 E011A330 A6030002 */ sh $v1, 0x2($s0)
/* 404554 E011A334 96020000 */ lhu $v0, 0x0($s0)
/* 404558 E011A338 24420040 */ addiu $v0, $v0, 0x40
/* 40455C E011A33C A6020000 */ sh $v0, 0x0($s0)
/* 404560 E011A340 00021400 */ sll $v0, $v0, 16
/* 404564 E011A344 00021403 */ sra $v0, $v0, 16
/* 404568 E011A348 28420100 */ slti $v0, $v0, 0x100
/* 40456C E011A34C 54400005 */ bnel $v0, $zero, .LE011A364
/* 404570 E011A350 26730001 */ addiu $s3, $s3, 0x1
/* 404574 E011A354 240200FF */ addiu $v0, $zero, 0xFF
/* 404578 E011A358 A6020000 */ sh $v0, 0x0($s0)
.LE011A35C:
/* 40457C E011A35C A6000006 */ sh $zero, 0x6($s0)
.LE011A360:
/* 404580 E011A360 26730001 */ addiu $s3, $s3, 0x1
.LE011A364:
/* 404584 E011A364 2A620003 */ slti $v0, $s3, 0x3
/* 404588 E011A368 1440FF96 */ bnez $v0, .LE011A1C4
/* 40458C E011A36C 2652000A */ addiu $s2, $s2, 0xA
.LE011A370:
/* 404590 E011A370 8FBF002C */ lw $ra, 0x2C($sp)
/* 404594 E011A374 8FB60028 */ lw $s6, 0x28($sp)
/* 404598 E011A378 8FB50024 */ lw $s5, 0x24($sp)
/* 40459C E011A37C 8FB40020 */ lw $s4, 0x20($sp)
/* 4045A0 E011A380 8FB3001C */ lw $s3, 0x1C($sp)
/* 4045A4 E011A384 8FB20018 */ lw $s2, 0x18($sp)
/* 4045A8 E011A388 8FB10014 */ lw $s1, 0x14($sp)
/* 4045AC E011A38C 8FB00010 */ lw $s0, 0x10($sp)
/* 4045B0 E011A390 03E00008 */ jr $ra
/* 4045B4 E011A394 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void partner_buff_update(EffectInstance* effect) {
PartnerBuffFXData* data = effect->data.partnerBuff;
s32 useRandomValues = data->useRandomValues;
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->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
time = data->lifeTime;
for (i = 0; i < ARRAY_COUNT(data->unk_0C); i++) {
BuffData* buff = &data->unk_0C[i];
if (buff->turnsLeft < 0) {
buff->turnsLeft = 0;
}
// possibly a leftover debug option
if (useRandomValues == 1 && time % 30 == 0) {
buff->turnsLeft = shim_rand_int(4);
}
switch (buff->state) {
case BUFF_STATE_IDLE:
if (buff->alpha == 255) {
if (buff->turnsLeft < buff->turnsDisplay) {
buff->state = BUFF_STATE_DECREMENT_TURNS_INIT;
} else if (buff->turnsDisplay < buff->turnsLeft) {
buff->state = BUFF_STATE_SET_TURNS_INIT;
} else if (buff->turnsDisplay == 0) {
buff->state = BUFF_STATE_FADE_OUT;
}
} else if ((buff->alpha == 0) && (buff->turnsLeft > 0)) {
buff->state = BUFF_STATE_FADE_IN_INIT;
}
break;
case BUFF_STATE_DECREMENT_TURNS_INIT:
buff->stateTimer = 0;
buff->state = BUFF_STATE_DECREMENT_TURNS;
// fallthrough
case BUFF_STATE_DECREMENT_TURNS:
buff->stateTimer++;
if (buff->stateTimer > 10) {
buff->stateTimer = 0;
buff->state = BUFF_STATE_IDLE;
buff->turnsDisplay--;
}
break;
case BUFF_STATE_SET_TURNS_INIT:
buff->stateTimer = 0;
buff->state = BUFF_STATE_SET_TURNS;
// fallthrough
case BUFF_STATE_SET_TURNS:
buff->stateTimer++;
if (buff->stateTimer > 10) {
buff->stateTimer = 0;
buff->state = BUFF_STATE_IDLE;
buff->turnsDisplay = buff->turnsLeft;
}
break;
case BUFF_STATE_FADE_OUT:
buff->alpha -= 32;
if (buff->alpha < 0) {
buff->alpha = 0;
buff->state = BUFF_STATE_IDLE;
}
break;
case BUFF_STATE_FADE_IN_INIT:
buff->state = BUFF_STATE_FADE_IN;
buff->turnsDisplay = buff->turnsLeft;
// fallthrough
case BUFF_STATE_FADE_IN:
buff->alpha += 64;
if (buff->alpha > 255) {
buff->alpha = 255;
buff->state = BUFF_STATE_IDLE;
}
break;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80259AAC
/* 18838C 80259AAC 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 188390 80259AB0 AFB20018 */ sw $s2, 0x18($sp)
/* 188394 80259AB4 0080902D */ daddu $s2, $a0, $zero
/* 188398 80259AB8 AFB10014 */ sw $s1, 0x14($sp)
/* 18839C 80259ABC 00A0882D */ daddu $s1, $a1, $zero
/* 1883A0 80259AC0 AFBF0024 */ sw $ra, 0x24($sp)
/* 1883A4 80259AC4 AFB40020 */ sw $s4, 0x20($sp)
/* 1883A8 80259AC8 AFB3001C */ sw $s3, 0x1C($sp)
/* 1883AC 80259ACC AFB00010 */ sw $s0, 0x10($sp)
/* 1883B0 80259AD0 8E3000C0 */ lw $s0, 0xC0($s1)
/* 1883B4 80259AD4 00C0982D */ daddu $s3, $a2, $zero
/* 1883B8 80259AD8 820206C1 */ lb $v0, 0x6C1($s0)
/* 1883BC 80259ADC 1040002E */ beqz $v0, .L80259B98
/* 1883C0 80259AE0 00E0A02D */ daddu $s4, $a3, $zero
/* 1883C4 80259AE4 16400016 */ bnez $s2, .L80259B40
/* 1883C8 80259AE8 00000000 */ nop
/* 1883CC 80259AEC 0C0B7830 */ jal spr_get_player_palettes
/* 1883D0 80259AF0 96240088 */ lhu $a0, 0x88($s1)
/* 1883D4 80259AF4 AE0206D0 */ sw $v0, 0x6D0($s0)
/* 1883D8 80259AF8 0040202D */ daddu $a0, $v0, $zero
/* 1883DC 80259AFC A20006CD */ sb $zero, 0x6CD($s0)
/* 1883E0 80259B00 8C830000 */ lw $v1, 0x0($a0)
/* 1883E4 80259B04 2402FFFF */ addiu $v0, $zero, -0x1
/* 1883E8 80259B08 10620021 */ beq $v1, $v0, .L80259B90
/* 1883EC 80259B0C 0080182D */ daddu $v1, $a0, $zero
/* 1883F0 80259B10 0040202D */ daddu $a0, $v0, $zero
.L80259B14:
/* 1883F4 80259B14 920206CD */ lbu $v0, 0x6CD($s0)
/* 1883F8 80259B18 24420001 */ addiu $v0, $v0, 0x1
/* 1883FC 80259B1C A20206CD */ sb $v0, 0x6CD($s0)
/* 188400 80259B20 00021600 */ sll $v0, $v0, 24
/* 188404 80259B24 00021583 */ sra $v0, $v0, 22
/* 188408 80259B28 00431021 */ addu $v0, $v0, $v1
/* 18840C 80259B2C 8C420000 */ lw $v0, 0x0($v0)
/* 188410 80259B30 1444FFF8 */ bne $v0, $a0, .L80259B14
/* 188414 80259B34 00000000 */ nop
/* 188418 80259B38 080966E5 */ j .L80259B94
/* 18841C 80259B3C A20006C2 */ sb $zero, 0x6C2($s0)
.L80259B40:
/* 188420 80259B40 96240088 */ lhu $a0, 0x88($s1)
/* 188424 80259B44 0C0B7A90 */ jal spr_get_npc_palettes
/* 188428 80259B48 00000000 */ nop
/* 18842C 80259B4C AE0206D0 */ sw $v0, 0x6D0($s0)
/* 188430 80259B50 0040202D */ daddu $a0, $v0, $zero
/* 188434 80259B54 A20006CD */ sb $zero, 0x6CD($s0)
/* 188438 80259B58 8C830000 */ lw $v1, 0x0($a0)
/* 18843C 80259B5C 2402FFFF */ addiu $v0, $zero, -0x1
/* 188440 80259B60 1062000B */ beq $v1, $v0, .L80259B90
/* 188444 80259B64 0080182D */ daddu $v1, $a0, $zero
/* 188448 80259B68 0040202D */ daddu $a0, $v0, $zero
.L80259B6C:
/* 18844C 80259B6C 920206CD */ lbu $v0, 0x6CD($s0)
/* 188450 80259B70 24420001 */ addiu $v0, $v0, 0x1
/* 188454 80259B74 A20206CD */ sb $v0, 0x6CD($s0)
/* 188458 80259B78 00021600 */ sll $v0, $v0, 24
/* 18845C 80259B7C 00021583 */ sra $v0, $v0, 22
/* 188460 80259B80 00431021 */ addu $v0, $v0, $v1
/* 188464 80259B84 8C420000 */ lw $v0, 0x0($v0)
/* 188468 80259B88 1444FFF8 */ bne $v0, $a0, .L80259B6C
/* 18846C 80259B8C 00000000 */ nop
.L80259B90:
/* 188470 80259B90 A20006C2 */ sb $zero, 0x6C2($s0)
.L80259B94:
/* 188474 80259B94 A20006C1 */ sb $zero, 0x6C1($s0)
.L80259B98:
/* 188478 80259B98 820206CD */ lb $v0, 0x6CD($s0)
/* 18847C 80259B9C 18400067 */ blez $v0, .L80259D3C
/* 188480 80259BA0 0000502D */ daddu $t2, $zero, $zero
/* 188484 80259BA4 3C0B8000 */ lui $t3, (0x80000000 >> 16)
/* 188488 80259BA8 0200602D */ daddu $t4, $s0, $zero
/* 18848C 80259BAC 3C01802A */ lui $at, %hi(D_8029D3E8)
/* 188490 80259BB0 D428D3E8 */ ldc1 $f8, %lo(D_8029D3E8)($at)
/* 188494 80259BB4 3C0141E0 */ lui $at, (0x41E00000 >> 16)
/* 188498 80259BB8 44811800 */ mtc1 $at, $f3
/* 18849C 80259BBC 44801000 */ mtc1 $zero, $f2
/* 1884A0 80259BC0 3C01802A */ lui $at, %hi(D_8029D3F0)
/* 1884A4 80259BC4 D426D3F0 */ ldc1 $f6, %lo(D_8029D3F0)($at)
/* 1884A8 80259BC8 3C01802A */ lui $at, %hi(D_8029D3F8)
/* 1884AC 80259BCC D424D3F8 */ ldc1 $f4, %lo(D_8029D3F8)($at)
.L80259BD0:
/* 1884B0 80259BD0 8E0206D0 */ lw $v0, 0x6D0($s0)
/* 1884B4 80259BD4 000A1880 */ sll $v1, $t2, 2
/* 1884B8 80259BD8 00621821 */ addu $v1, $v1, $v0
/* 1884BC 80259BDC 000A1140 */ sll $v0, $t2, 5
/* 1884C0 80259BE0 8C670000 */ lw $a3, 0x0($v1)
/* 1884C4 80259BE4 02024021 */ addu $t0, $s0, $v0
/* 1884C8 80259BE8 10E0004F */ beqz $a3, .L80259D28
/* 1884CC 80259BEC AD8806D4 */ sw $t0, 0x6D4($t4)
/* 1884D0 80259BF0 0000482D */ daddu $t1, $zero, $zero
.L80259BF4:
/* 1884D4 80259BF4 94E30000 */ lhu $v1, 0x0($a3)
/* 1884D8 80259BF8 000312C2 */ srl $v0, $v1, 11
/* 1884DC 80259BFC 44820000 */ mtc1 $v0, $f0
/* 1884E0 80259C00 00000000 */ nop
/* 1884E4 80259C04 46800021 */ cvt.d.w $f0, $f0
/* 1884E8 80259C08 46280002 */ mul.d $f0, $f0, $f8
/* 1884EC 80259C0C 00000000 */ nop
/* 1884F0 80259C10 90E40001 */ lbu $a0, 0x1($a3)
/* 1884F4 80259C14 24E70002 */ addiu $a3, $a3, 0x2
/* 1884F8 80259C18 00031182 */ srl $v0, $v1, 6
/* 1884FC 80259C1C 3042001F */ andi $v0, $v0, 0x1F
/* 188500 80259C20 00031842 */ srl $v1, $v1, 1
/* 188504 80259C24 3066001F */ andi $a2, $v1, 0x1F
/* 188508 80259C28 4620103E */ c.le.d $f2, $f0
/* 18850C 80259C2C 00000000 */ nop
/* 188510 80259C30 45010005 */ bc1t .L80259C48
/* 188514 80259C34 30840001 */ andi $a0, $a0, 0x1
/* 188518 80259C38 4620028D */ trunc.w.d $f10, $f0
/* 18851C 80259C3C 44035000 */ mfc1 $v1, $f10
/* 188520 80259C40 08096718 */ j .L80259C60
/* 188524 80259C44 304200FF */ andi $v0, $v0, 0xFF
.L80259C48:
/* 188528 80259C48 46220001 */ sub.d $f0, $f0, $f2
/* 18852C 80259C4C 4620028D */ trunc.w.d $f10, $f0
/* 188530 80259C50 44035000 */ mfc1 $v1, $f10
/* 188534 80259C54 00000000 */ nop
/* 188538 80259C58 006B1825 */ or $v1, $v1, $t3
/* 18853C 80259C5C 304200FF */ andi $v0, $v0, 0xFF
.L80259C60:
/* 188540 80259C60 44820000 */ mtc1 $v0, $f0
/* 188544 80259C64 00000000 */ nop
/* 188548 80259C68 46800021 */ cvt.d.w $f0, $f0
/* 18854C 80259C6C 46260002 */ mul.d $f0, $f0, $f6
/* 188550 80259C70 00000000 */ nop
/* 188554 80259C74 4620103E */ c.le.d $f2, $f0
/* 188558 80259C78 00000000 */ nop
/* 18855C 80259C7C 45030005 */ bc1tl .L80259C94
/* 188560 80259C80 46220001 */ sub.d $f0, $f0, $f2
/* 188564 80259C84 4620028D */ trunc.w.d $f10, $f0
/* 188568 80259C88 44055000 */ mfc1 $a1, $f10
/* 18856C 80259C8C 0809672A */ j .L80259CA8
/* 188570 80259C90 30C200FF */ andi $v0, $a2, 0xFF
.L80259C94:
/* 188574 80259C94 4620028D */ trunc.w.d $f10, $f0
/* 188578 80259C98 44055000 */ mfc1 $a1, $f10
/* 18857C 80259C9C 00000000 */ nop
/* 188580 80259CA0 00AB2825 */ or $a1, $a1, $t3
/* 188584 80259CA4 30C200FF */ andi $v0, $a2, 0xFF
.L80259CA8:
/* 188588 80259CA8 44820000 */ mtc1 $v0, $f0
/* 18858C 80259CAC 00000000 */ nop
/* 188590 80259CB0 46800021 */ cvt.d.w $f0, $f0
/* 188594 80259CB4 46240002 */ mul.d $f0, $f0, $f4
/* 188598 80259CB8 00000000 */ nop
/* 18859C 80259CBC 4620103E */ c.le.d $f2, $f0
/* 1885A0 80259CC0 00000000 */ nop
/* 1885A4 80259CC4 45010005 */ bc1t .L80259CDC
/* 1885A8 80259CC8 00A0102D */ daddu $v0, $a1, $zero
/* 1885AC 80259CCC 4620028D */ trunc.w.d $f10, $f0
/* 1885B0 80259CD0 44055000 */ mfc1 $a1, $f10
/* 1885B4 80259CD4 0809673D */ j .L80259CF4
/* 1885B8 80259CD8 306300FF */ andi $v1, $v1, 0xFF
.L80259CDC:
/* 1885BC 80259CDC 46220001 */ sub.d $f0, $f0, $f2
/* 1885C0 80259CE0 4620028D */ trunc.w.d $f10, $f0
/* 1885C4 80259CE4 44055000 */ mfc1 $a1, $f10
/* 1885C8 80259CE8 00000000 */ nop
/* 1885CC 80259CEC 00AB2825 */ or $a1, $a1, $t3
/* 1885D0 80259CF0 306300FF */ andi $v1, $v1, 0xFF
.L80259CF4:
/* 1885D4 80259CF4 00031AC0 */ sll $v1, $v1, 11
/* 1885D8 80259CF8 304200FF */ andi $v0, $v0, 0xFF
/* 1885DC 80259CFC 00021180 */ sll $v0, $v0, 6
/* 1885E0 80259D00 00621825 */ or $v1, $v1, $v0
/* 1885E4 80259D04 30A200FF */ andi $v0, $a1, 0xFF
/* 1885E8 80259D08 00021040 */ sll $v0, $v0, 1
/* 1885EC 80259D0C 00621825 */ or $v1, $v1, $v0
/* 1885F0 80259D10 00831825 */ or $v1, $a0, $v1
/* 1885F4 80259D14 A5030000 */ sh $v1, 0x0($t0)
/* 1885F8 80259D18 25290001 */ addiu $t1, $t1, 0x1
/* 1885FC 80259D1C 29220010 */ slti $v0, $t1, 0x10
/* 188600 80259D20 1440FFB4 */ bnez $v0, .L80259BF4
/* 188604 80259D24 25080002 */ addiu $t0, $t0, 0x2
.L80259D28:
/* 188608 80259D28 820206CD */ lb $v0, 0x6CD($s0)
/* 18860C 80259D2C 254A0001 */ addiu $t2, $t2, 0x1
/* 188610 80259D30 0142102A */ slt $v0, $t2, $v0
/* 188614 80259D34 1440FFA6 */ bnez $v0, .L80259BD0
/* 188618 80259D38 258C0004 */ addiu $t4, $t4, 0x4
.L80259D3C:
/* 18861C 80259D3C 820306C2 */ lb $v1, 0x6C2($s0)
/* 188620 80259D40 28620002 */ slti $v0, $v1, 0x2
/* 188624 80259D44 1040000D */ beqz $v0, .L80259D7C
/* 188628 80259D48 00000000 */ nop
/* 18862C 80259D4C 0460000B */ bltz $v1, .L80259D7C
/* 188630 80259D50 00000000 */ nop
/* 188634 80259D54 16400006 */ bnez $s2, .L80259D70
/* 188638 80259D58 0220202D */ daddu $a0, $s1, $zero
/* 18863C 80259D5C 0260282D */ daddu $a1, $s3, $zero
/* 188640 80259D60 0C096657 */ jal func_8025995C
/* 188644 80259D64 0280302D */ daddu $a2, $s4, $zero
/* 188648 80259D68 0809675F */ j .L80259D7C
/* 18864C 80259D6C 00000000 */ nop
.L80259D70:
/* 188650 80259D70 0260282D */ daddu $a1, $s3, $zero
/* 188654 80259D74 0C0965B0 */ jal func_802596C0
/* 188658 80259D78 0280302D */ daddu $a2, $s4, $zero
.L80259D7C:
/* 18865C 80259D7C 8FBF0024 */ lw $ra, 0x24($sp)
/* 188660 80259D80 8FB40020 */ lw $s4, 0x20($sp)
/* 188664 80259D84 8FB3001C */ lw $s3, 0x1C($sp)
/* 188668 80259D88 8FB20018 */ lw $s2, 0x18($sp)
/* 18866C 80259D8C 8FB10014 */ lw $s1, 0x14($sp)
/* 188670 80259D90 8FB00010 */ lw $s0, 0x10($sp)
/* 188674 80259D94 03E00008 */ jr $ra
/* 188678 80259D98 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void render_with_sleep_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, b32 skipAnimation) {
DecorationTable* decorationTable = part->decorationTable;
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++;
}
} else {
decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16);
decorationTable->originalPalettesCount = 0;
while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) {
decorationTable->originalPalettesCount++;
}
}
decorationTable->palAnimState = 0;
decorationTable->resetPalAdjust = FALSE;
}
for (i = 0; i < decorationTable->originalPalettesCount; i++) {
PAL_PTR palIn = decorationTable->originalPalettesList[i];
PAL_PTR palOut = decorationTable->copiedPalettes[0][i];
decorationTable->adjustedPalettes[i] = palOut;
if (palIn != NULL) {
for (j = 0; j < SPR_PAL_SIZE; j++) {
u8 r = UNPACK_PAL_R(*palIn);
u8 g = UNPACK_PAL_G(*palIn);
u8 b = UNPACK_PAL_B(*palIn);
u8 a = UNPACK_PAL_A(*palIn);
palIn++;
// make colors darker and bluer
r *= 0.2;
g *= 0.4;
b *= 0.7;
*palOut++ = PACK_PAL_RGBA(r, g, b, a);
}
}
}
switch (decorationTable->palAnimState) {
case 0:
case 1:
if (isNpcSprite == SPRITE_MODE_PLAYER) {
func_8025995C(part, yaw, mtx);
} else {
func_802596C0(part, yaw, mtx);
}
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_ambient_load
/* 2F380 80053F80 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 2F384 80053F84 AFB30024 */ sw $s3, 0x24($sp)
/* 2F388 80053F88 3C13800A */ lui $s3, %hi(gSoundGlobals)
/* 2F38C 80053F8C 8E73A5C0 */ lw $s3, %lo(gSoundGlobals)($s3)
/* 2F390 80053F90 AFB5002C */ sw $s5, 0x2C($sp)
/* 2F394 80053F94 0080A82D */ daddu $s5, $a0, $zero
/* 2F398 80053F98 AFB20020 */ sw $s2, 0x20($sp)
/* 2F39C 80053F9C 3C12800A */ lui $s2, %hi(gAuAmbienceManager)
/* 2F3A0 80053FA0 8E52A628 */ lw $s2, %lo(gAuAmbienceManager)($s2)
/* 2F3A4 80053FA4 2EA20010 */ sltiu $v0, $s5, 0x10
/* 2F3A8 80053FA8 AFBF0030 */ sw $ra, 0x30($sp)
/* 2F3AC 80053FAC AFB40028 */ sw $s4, 0x28($sp)
/* 2F3B0 80053FB0 AFB1001C */ sw $s1, 0x1C($sp)
/* 2F3B4 80053FB4 10400022 */ beqz $v0, .L80054040
/* 2F3B8 80053FB8 AFB00018 */ sw $s0, 0x18($sp)
/* 2F3BC 80053FBC 8E420044 */ lw $v0, 0x44($s2)
/* 2F3C0 80053FC0 14400097 */ bnez $v0, .L80054220
/* 2F3C4 80053FC4 00000000 */ nop
/* 2F3C8 80053FC8 24050040 */ addiu $a1, $zero, 0x40
/* 2F3CC 80053FCC 3C028008 */ lui $v0, %hi(D_80078580)
/* 2F3D0 80053FD0 00551021 */ addu $v0, $v0, $s5
/* 2F3D4 80053FD4 90428580 */ lbu $v0, %lo(D_80078580)($v0)
/* 2F3D8 80053FD8 8E63003C */ lw $v1, 0x3C($s3)
/* 2F3DC 80053FDC 00021040 */ sll $v0, $v0, 1
/* 2F3E0 80053FE0 00431021 */ addu $v0, $v0, $v1
/* 2F3E4 80053FE4 94440000 */ lhu $a0, 0x0($v0)
/* 2F3E8 80053FE8 0C01511F */ jal au_fetch_SBN_file
/* 2F3EC 80053FEC 27A60010 */ addiu $a2, $sp, 0x10
/* 2F3F0 80053FF0 1440008B */ bnez $v0, .L80054220
/* 2F3F4 80053FF4 3C0200FF */ lui $v0, (0xFFFFFF >> 16)
/* 2F3F8 80053FF8 3442FFFF */ ori $v0, $v0, (0xFFFFFF & 0xFFFF)
/* 2F3FC 80053FFC 8FA40010 */ lw $a0, 0x10($sp)
/* 2F400 80054000 8FA60014 */ lw $a2, 0x14($sp)
/* 2F404 80054004 8E650064 */ lw $a1, 0x64($s3)
/* 2F408 80054008 0C015380 */ jal au_read_rom
/* 2F40C 8005400C 00C23024 */ and $a2, $a2, $v0
/* 2F410 80054010 24030001 */ addiu $v1, $zero, 0x1
/* 2F414 80054014 8E620064 */ lw $v0, 0x64($s3)
/* 2F418 80054018 26440004 */ addiu $a0, $s2, 0x4
/* 2F41C 8005401C AE420010 */ sw $v0, 0x10($s2)
.L80054020:
/* 2F420 80054020 AC800010 */ sw $zero, 0x10($a0)
/* 2F424 80054024 24630001 */ addiu $v1, $v1, 0x1
/* 2F428 80054028 2C620004 */ sltiu $v0, $v1, 0x4
/* 2F42C 8005402C 1440FFFC */ bnez $v0, .L80054020
/* 2F430 80054030 24840004 */ addiu $a0, $a0, 0x4
/* 2F434 80054034 24020001 */ addiu $v0, $zero, 0x1
/* 2F438 80054038 08015088 */ j .L80054220
/* 2F43C 8005403C A2420020 */ sb $v0, 0x20($s2)
.L80054040:
/* 2F440 80054040 24020010 */ addiu $v0, $zero, 0x10
/* 2F444 80054044 16A20076 */ bne $s5, $v0, .L80054220
/* 2F448 80054048 00000000 */ nop
/* 2F44C 8005404C 8E420044 */ lw $v0, 0x44($s2)
/* 2F450 80054050 14400073 */ bnez $v0, .L80054220
/* 2F454 80054054 00000000 */ nop
/* 2F458 80054058 8E420228 */ lw $v0, 0x228($s2)
/* 2F45C 8005405C 14400070 */ bnez $v0, .L80054220
/* 2F460 80054060 00000000 */ nop
/* 2F464 80054064 8E42040C */ lw $v0, 0x40C($s2)
/* 2F468 80054068 1440006D */ bnez $v0, .L80054220
/* 2F46C 8005406C 0000182D */ daddu $v1, $zero, $zero
/* 2F470 80054070 A2400020 */ sb $zero, 0x20($s2)
/* 2F474 80054074 0240202D */ daddu $a0, $s2, $zero
.L80054078:
/* 2F478 80054078 AC800010 */ sw $zero, 0x10($a0)
/* 2F47C 8005407C 24630001 */ addiu $v1, $v1, 0x1
/* 2F480 80054080 2C620004 */ sltiu $v0, $v1, 0x4
/* 2F484 80054084 1440FFFC */ bnez $v0, .L80054078
/* 2F488 80054088 24840004 */ addiu $a0, $a0, 0x4
/* 2F48C 8005408C 8E700068 */ lw $s0, 0x68($s3)
/* 2F490 80054090 24050040 */ addiu $a1, $zero, 0x40
/* 2F494 80054094 3C148008 */ lui $s4, %hi(D_80078580)
/* 2F498 80054098 26948580 */ addiu $s4, $s4, %lo(D_80078580)
/* 2F49C 8005409C 3C028008 */ lui $v0, %hi(D_80078580)
/* 2F4A0 800540A0 00551021 */ addu $v0, $v0, $s5
/* 2F4A4 800540A4 90428580 */ lbu $v0, %lo(D_80078580)($v0)
/* 2F4A8 800540A8 8E63003C */ lw $v1, 0x3C($s3)
/* 2F4AC 800540AC 00021040 */ sll $v0, $v0, 1
/* 2F4B0 800540B0 00431021 */ addu $v0, $v0, $v1
/* 2F4B4 800540B4 94440000 */ lhu $a0, 0x0($v0)
/* 2F4B8 800540B8 0C01511F */ jal au_fetch_SBN_file
/* 2F4BC 800540BC 27A60010 */ addiu $a2, $sp, 0x10
/* 2F4C0 800540C0 14400057 */ bnez $v0, .L80054220
/* 2F4C4 800540C4 3C1100FF */ lui $s1, (0xFFFFFF >> 16)
/* 2F4C8 800540C8 3631FFFF */ ori $s1, $s1, (0xFFFFFF & 0xFFFF)
/* 2F4CC 800540CC 0200282D */ daddu $a1, $s0, $zero
/* 2F4D0 800540D0 8FA60014 */ lw $a2, 0x14($sp)
/* 2F4D4 800540D4 8FA40010 */ lw $a0, 0x10($sp)
/* 2F4D8 800540D8 0C015380 */ jal au_read_rom
/* 2F4DC 800540DC 00D13024 */ and $a2, $a2, $s1
/* 2F4E0 800540E0 24050040 */ addiu $a1, $zero, 0x40
/* 2F4E4 800540E4 27A60010 */ addiu $a2, $sp, 0x10
/* 2F4E8 800540E8 02B41021 */ addu $v0, $s5, $s4
/* 2F4EC 800540EC AE500010 */ sw $s0, 0x10($s2)
/* 2F4F0 800540F0 90430001 */ lbu $v1, 0x1($v0)
/* 2F4F4 800540F4 8E62003C */ lw $v0, 0x3C($s3)
/* 2F4F8 800540F8 00031840 */ sll $v1, $v1, 1
/* 2F4FC 800540FC 00621821 */ addu $v1, $v1, $v0
/* 2F500 80054100 8FA20014 */ lw $v0, 0x14($sp)
/* 2F504 80054104 94640000 */ lhu $a0, 0x0($v1)
/* 2F508 80054108 00451021 */ addu $v0, $v0, $a1
/* 2F50C 8005410C 00511024 */ and $v0, $v0, $s1
/* 2F510 80054110 0C01511F */ jal au_fetch_SBN_file
/* 2F514 80054114 02028021 */ addu $s0, $s0, $v0
/* 2F518 80054118 14400041 */ bnez $v0, .L80054220
/* 2F51C 8005411C 00000000 */ nop
/* 2F520 80054120 0200282D */ daddu $a1, $s0, $zero
/* 2F524 80054124 8FA60014 */ lw $a2, 0x14($sp)
/* 2F528 80054128 8FA40010 */ lw $a0, 0x10($sp)
/* 2F52C 8005412C 0C015380 */ jal au_read_rom
/* 2F530 80054130 00D13024 */ and $a2, $a2, $s1
/* 2F534 80054134 24050040 */ addiu $a1, $zero, 0x40
/* 2F538 80054138 27A60010 */ addiu $a2, $sp, 0x10
/* 2F53C 8005413C 02B41021 */ addu $v0, $s5, $s4
/* 2F540 80054140 AE500014 */ sw $s0, 0x14($s2)
/* 2F544 80054144 90430002 */ lbu $v1, 0x2($v0)
/* 2F548 80054148 8E62003C */ lw $v0, 0x3C($s3)
/* 2F54C 8005414C 00031840 */ sll $v1, $v1, 1
/* 2F550 80054150 00621821 */ addu $v1, $v1, $v0
/* 2F554 80054154 8FA20014 */ lw $v0, 0x14($sp)
/* 2F558 80054158 94640000 */ lhu $a0, 0x0($v1)
/* 2F55C 8005415C 00451021 */ addu $v0, $v0, $a1
/* 2F560 80054160 00511024 */ and $v0, $v0, $s1
/* 2F564 80054164 0C01511F */ jal au_fetch_SBN_file
/* 2F568 80054168 02028021 */ addu $s0, $s0, $v0
/* 2F56C 8005416C 1440002C */ bnez $v0, .L80054220
/* 2F570 80054170 00000000 */ nop
/* 2F574 80054174 0200282D */ daddu $a1, $s0, $zero
/* 2F578 80054178 8FA60014 */ lw $a2, 0x14($sp)
/* 2F57C 8005417C 8FA40010 */ lw $a0, 0x10($sp)
/* 2F580 80054180 0C015380 */ jal au_read_rom
/* 2F584 80054184 00D13024 */ and $a2, $a2, $s1
/* 2F588 80054188 24050040 */ addiu $a1, $zero, 0x40
/* 2F58C 8005418C 27A60010 */ addiu $a2, $sp, 0x10
/* 2F590 80054190 02B41021 */ addu $v0, $s5, $s4
/* 2F594 80054194 AE500018 */ sw $s0, 0x18($s2)
/* 2F598 80054198 90430003 */ lbu $v1, 0x3($v0)
/* 2F59C 8005419C 8E62003C */ lw $v0, 0x3C($s3)
/* 2F5A0 800541A0 00031840 */ sll $v1, $v1, 1
/* 2F5A4 800541A4 00621821 */ addu $v1, $v1, $v0
/* 2F5A8 800541A8 8FA20014 */ lw $v0, 0x14($sp)
/* 2F5AC 800541AC 94640000 */ lhu $a0, 0x0($v1)
/* 2F5B0 800541B0 00451021 */ addu $v0, $v0, $a1
/* 2F5B4 800541B4 00511024 */ and $v0, $v0, $s1
/* 2F5B8 800541B8 0C01511F */ jal au_fetch_SBN_file
/* 2F5BC 800541BC 02028021 */ addu $s0, $s0, $v0
/* 2F5C0 800541C0 14400017 */ bnez $v0, .L80054220
/* 2F5C4 800541C4 00000000 */ nop
/* 2F5C8 800541C8 0200282D */ daddu $a1, $s0, $zero
/* 2F5CC 800541CC 8FA60014 */ lw $a2, 0x14($sp)
/* 2F5D0 800541D0 8FA40010 */ lw $a0, 0x10($sp)
/* 2F5D4 800541D4 0C015380 */ jal au_read_rom
/* 2F5D8 800541D8 00D13024 */ and $a2, $a2, $s1
/* 2F5DC 800541DC 24050030 */ addiu $a1, $zero, 0x30
/* 2F5E0 800541E0 24020004 */ addiu $v0, $zero, 0x4
/* 2F5E4 800541E4 A2420020 */ sb $v0, 0x20($s2)
/* 2F5E8 800541E8 02B41021 */ addu $v0, $s5, $s4
/* 2F5EC 800541EC AE50001C */ sw $s0, 0x1C($s2)
/* 2F5F0 800541F0 90420004 */ lbu $v0, 0x4($v0)
/* 2F5F4 800541F4 8E63003C */ lw $v1, 0x3C($s3)
/* 2F5F8 800541F8 00021040 */ sll $v0, $v0, 1
/* 2F5FC 800541FC 00431021 */ addu $v0, $v0, $v1
/* 2F600 80054200 94440000 */ lhu $a0, 0x0($v0)
/* 2F604 80054204 0C01511F */ jal au_fetch_SBN_file
/* 2F608 80054208 27A60010 */ addiu $a2, $sp, 0x10
/* 2F60C 8005420C 14400004 */ bnez $v0, .L80054220
/* 2F610 80054210 00000000 */ nop
/* 2F614 80054214 8FA40010 */ lw $a0, 0x10($sp)
/* 2F618 80054218 0C015313 */ jal snd_load_BK
/* 2F61C 8005421C 24050002 */ addiu $a1, $zero, 0x2
.L80054220:
/* 2F620 80054220 8FBF0030 */ lw $ra, 0x30($sp)
/* 2F624 80054224 8FB5002C */ lw $s5, 0x2C($sp)
/* 2F628 80054228 8FB40028 */ lw $s4, 0x28($sp)
/* 2F62C 8005422C 8FB30024 */ lw $s3, 0x24($sp)
/* 2F630 80054230 8FB20020 */ lw $s2, 0x20($sp)
/* 2F634 80054234 8FB1001C */ lw $s1, 0x1C($sp)
/* 2F638 80054238 8FB00018 */ lw $s0, 0x18($sp)
/* 2F63C 8005423C 0000102D */ daddu $v0, $zero, $zero
/* 2F640 80054240 03E00008 */ jr $ra
/* 2F644 80054244 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
AuResult au_ambient_load(u32 ambSoundID) {
AmbienceManager* manager;
SBNFileEntry fileEntry;
AuGlobals* globals;
MSEQHeader* mseqFile;
u32 i;
globals = gSoundGlobals;
manager = gAuAmbienceManager;
if (ambSoundID < AMBIENT_RADIO) {
if (manager->players[0].mseqName == 0 && SBN_LOOKUP(ambSoundID, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
au_read_rom(fileEntry.offset, globals->dataMSEQ[0], fileEntry.data & 0xFFFFFF);
manager->mseqFiles[0] = globals->dataMSEQ[0];
for (i = 1; i < ARRAY_COUNT(manager->mseqFiles); i++) {
manager->mseqFiles[i] = NULL;
}
manager->numActivePlayers = 1;
}
} else if (ambSoundID == AMBIENT_RADIO
&& manager->players[0].mseqName == 0
&& manager->players[1].mseqName == 0
&& manager->players[2].mseqName == 0) {
manager->numActivePlayers = 0;
for (i = 0; i < ARRAY_COUNT(manager->mseqFiles); i++) {
manager->mseqFiles[i] = NULL;
}
mseqFile = globals->dataMSEQ[1];
if (SBN_LOOKUP(ambSoundID, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
manager->mseqFiles[0] = mseqFile;
mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
if (SBN_LOOKUP(ambSoundID + 1, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
manager->mseqFiles[1] = mseqFile;
mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
if (SBN_LOOKUP(ambSoundID + 2, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
manager->mseqFiles[2] = mseqFile;
mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
if (SBN_LOOKUP(ambSoundID + 3, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
manager->mseqFiles[3] = mseqFile;
manager->numActivePlayers = 4;
if (SBN_LOOKUP(ambSoundID + 4, AU_FMT_BK, fileEntry) == AU_RESULT_OK) {
snd_load_BK(fileEntry.offset, 2);
}
}
}
}
}
}
return AU_RESULT_OK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel test_ray_triangle_down
/* 3789C 8005C49C C4800030 */ lwc1 $f0, 0x30($a0)
/* 378A0 8005C4A0 44801000 */ mtc1 $zero, $f2
/* 378A4 8005C4A4 00000000 */ nop
/* 378A8 8005C4A8 46020032 */ c.eq.s $f0, $f2
/* 378AC 8005C4AC 00000000 */ nop
/* 378B0 8005C4B0 4500000B */ bc1f .L8005C4E0
/* 378B4 8005C4B4 00000000 */ nop
/* 378B8 8005C4B8 C4800034 */ lwc1 $f0, 0x34($a0)
/* 378BC 8005C4BC 46020032 */ c.eq.s $f0, $f2
/* 378C0 8005C4C0 00000000 */ nop
/* 378C4 8005C4C4 45000006 */ bc1f .L8005C4E0
/* 378C8 8005C4C8 00000000 */ nop
/* 378CC 8005C4CC C4800038 */ lwc1 $f0, 0x38($a0)
/* 378D0 8005C4D0 46020032 */ c.eq.s $f0, $f2
/* 378D4 8005C4D4 00000000 */ nop
/* 378D8 8005C4D8 45010050 */ bc1t .L8005C61C
/* 378DC 8005C4DC 00000000 */ nop
.L8005C4E0:
/* 378E0 8005C4E0 8C820000 */ lw $v0, 0x0($a0)
/* 378E4 8005C4E4 3C01800A */ lui $at, %hi(gCollisionRayStartX)
/* 378E8 8005C4E8 C4324230 */ lwc1 $f18, %lo(gCollisionRayStartX)($at)
/* 378EC 8005C4EC C4400000 */ lwc1 $f0, 0x0($v0)
/* 378F0 8005C4F0 46009301 */ sub.s $f12, $f18, $f0
/* 378F4 8005C4F4 C4840030 */ lwc1 $f4, 0x30($a0)
/* 378F8 8005C4F8 460C2102 */ mul.s $f4, $f4, $f12
/* 378FC 8005C4FC 00000000 */ nop
/* 37900 8005C500 3C01800A */ lui $at, %hi(gCollisionRayStartY)
/* 37904 8005C504 C4224234 */ lwc1 $f2, %lo(gCollisionRayStartY)($at)
/* 37908 8005C508 C4400004 */ lwc1 $f0, 0x4($v0)
/* 3790C 8005C50C 46001081 */ sub.s $f2, $f2, $f0
/* 37910 8005C510 C4860034 */ lwc1 $f6, 0x34($a0)
/* 37914 8005C514 46023082 */ mul.s $f2, $f6, $f2
/* 37918 8005C518 00000000 */ nop
/* 3791C 8005C51C 3C01800A */ lui $at, %hi(gCollisionRayStartZ)
/* 37920 8005C520 C42E4238 */ lwc1 $f14, %lo(gCollisionRayStartZ)($at)
/* 37924 8005C524 C4400008 */ lwc1 $f0, 0x8($v0)
/* 37928 8005C528 46007201 */ sub.s $f8, $f14, $f0
/* 3792C 8005C52C C4800038 */ lwc1 $f0, 0x38($a0)
/* 37930 8005C530 46080002 */ mul.s $f0, $f0, $f8
/* 37934 8005C534 00000000 */ nop
/* 37938 8005C538 8C830004 */ lw $v1, 0x4($a0)
/* 3793C 8005C53C 46022100 */ add.s $f4, $f4, $f2
/* 37940 8005C540 8C850008 */ lw $a1, 0x8($a0)
/* 37944 8005C544 8482003C */ lh $v0, 0x3C($a0)
/* 37948 8005C548 10400036 */ beqz $v0, .L8005C624
/* 3794C 8005C54C 46002280 */ add.s $f10, $f4, $f0
/* 37950 8005C550 44808000 */ mtc1 $zero, $f16
/* 37954 8005C554 00000000 */ nop
/* 37958 8005C558 4610503C */ c.lt.s $f10, $f16
/* 3795C 8005C55C 00000000 */ nop
/* 37960 8005C560 4501002E */ bc1t .L8005C61C
/* 37964 8005C564 00000000 */ nop
/* 37968 8005C568 4610303E */ c.le.s $f6, $f16
/* 3796C 8005C56C 00000000 */ nop
/* 37970 8005C570 4501002A */ bc1t .L8005C61C
/* 37974 8005C574 00000000 */ nop
/* 37978 8005C578 C482000C */ lwc1 $f2, 0xC($a0)
/* 3797C 8005C57C 46024082 */ mul.s $f2, $f8, $f2
/* 37980 8005C580 00000000 */ nop
/* 37984 8005C584 C4800014 */ lwc1 $f0, 0x14($a0)
/* 37988 8005C588 46006002 */ mul.s $f0, $f12, $f0
/* 3798C 8005C58C 00000000 */ nop
/* 37990 8005C590 46001081 */ sub.s $f2, $f2, $f0
/* 37994 8005C594 4610103C */ c.lt.s $f2, $f16
/* 37998 8005C598 00000000 */ nop
/* 3799C 8005C59C 4501001F */ bc1t .L8005C61C
/* 379A0 8005C5A0 00000000 */ nop
/* 379A4 8005C5A4 C4620008 */ lwc1 $f2, 0x8($v1)
/* 379A8 8005C5A8 46027081 */ sub.s $f2, $f14, $f2
/* 379AC 8005C5AC C4800018 */ lwc1 $f0, 0x18($a0)
/* 379B0 8005C5B0 46001082 */ mul.s $f2, $f2, $f0
/* 379B4 8005C5B4 00000000 */ nop
/* 379B8 8005C5B8 C4600000 */ lwc1 $f0, 0x0($v1)
/* 379BC 8005C5BC 46009001 */ sub.s $f0, $f18, $f0
/* 379C0 8005C5C0 C4840020 */ lwc1 $f4, 0x20($a0)
/* 379C4 8005C5C4 46040002 */ mul.s $f0, $f0, $f4
/* 379C8 8005C5C8 00000000 */ nop
/* 379CC 8005C5CC 46001081 */ sub.s $f2, $f2, $f0
/* 379D0 8005C5D0 4610103C */ c.lt.s $f2, $f16
/* 379D4 8005C5D4 00000000 */ nop
/* 379D8 8005C5D8 45010010 */ bc1t .L8005C61C
/* 379DC 8005C5DC 00000000 */ nop
/* 379E0 8005C5E0 C4A20008 */ lwc1 $f2, 0x8($a1)
/* 379E4 8005C5E4 46027081 */ sub.s $f2, $f14, $f2
/* 379E8 8005C5E8 C4800024 */ lwc1 $f0, 0x24($a0)
/* 379EC 8005C5EC 46001082 */ mul.s $f2, $f2, $f0
/* 379F0 8005C5F0 00000000 */ nop
/* 379F4 8005C5F4 C4A00000 */ lwc1 $f0, 0x0($a1)
/* 379F8 8005C5F8 46009001 */ sub.s $f0, $f18, $f0
/* 379FC 8005C5FC C484002C */ lwc1 $f4, 0x2C($a0)
/* 37A00 8005C600 46040002 */ mul.s $f0, $f0, $f4
/* 37A04 8005C604 00000000 */ nop
/* 37A08 8005C608 46001081 */ sub.s $f2, $f2, $f0
/* 37A0C 8005C60C 4610103C */ c.lt.s $f2, $f16
/* 37A10 8005C610 00000000 */ nop
.L8005C614:
/* 37A14 8005C614 45000039 */ bc1f .L8005C6FC
/* 37A18 8005C618 00000000 */ nop
.L8005C61C:
/* 37A1C 8005C61C 03E00008 */ jr $ra
/* 37A20 8005C620 0000102D */ daddu $v0, $zero, $zero
.L8005C624:
/* 37A24 8005C624 460A3002 */ mul.s $f0, $f6, $f10
/* 37A28 8005C628 00000000 */ nop
/* 37A2C 8005C62C 44803000 */ mtc1 $zero, $f6
/* 37A30 8005C630 00000000 */ nop
/* 37A34 8005C634 4606003E */ c.le.s $f0, $f6
/* 37A38 8005C638 00000000 */ nop
/* 37A3C 8005C63C 4501FFF7 */ bc1t .L8005C61C
/* 37A40 8005C640 00000000 */ nop
/* 37A44 8005C644 C480000C */ lwc1 $f0, 0xC($a0)
/* 37A48 8005C648 46004002 */ mul.s $f0, $f8, $f0
/* 37A4C 8005C64C 00000000 */ nop
/* 37A50 8005C650 C4820014 */ lwc1 $f2, 0x14($a0)
/* 37A54 8005C654 46026082 */ mul.s $f2, $f12, $f2
/* 37A58 8005C658 00000000 */ nop
/* 37A5C 8005C65C 46020001 */ sub.s $f0, $f0, $f2
/* 37A60 8005C660 460A0002 */ mul.s $f0, $f0, $f10
/* 37A64 8005C664 00000000 */ nop
/* 37A68 8005C668 4606003C */ c.lt.s $f0, $f6
/* 37A6C 8005C66C 00000000 */ nop
/* 37A70 8005C670 4501FFEA */ bc1t .L8005C61C
/* 37A74 8005C674 00000000 */ nop
/* 37A78 8005C678 C4600008 */ lwc1 $f0, 0x8($v1)
/* 37A7C 8005C67C 46007001 */ sub.s $f0, $f14, $f0
/* 37A80 8005C680 C4820018 */ lwc1 $f2, 0x18($a0)
/* 37A84 8005C684 46020002 */ mul.s $f0, $f0, $f2
/* 37A88 8005C688 00000000 */ nop
/* 37A8C 8005C68C C4620000 */ lwc1 $f2, 0x0($v1)
/* 37A90 8005C690 46029081 */ sub.s $f2, $f18, $f2
/* 37A94 8005C694 C4840020 */ lwc1 $f4, 0x20($a0)
/* 37A98 8005C698 46041082 */ mul.s $f2, $f2, $f4
/* 37A9C 8005C69C 00000000 */ nop
/* 37AA0 8005C6A0 46020001 */ sub.s $f0, $f0, $f2
/* 37AA4 8005C6A4 460A0002 */ mul.s $f0, $f0, $f10
/* 37AA8 8005C6A8 00000000 */ nop
/* 37AAC 8005C6AC 4606003C */ c.lt.s $f0, $f6
/* 37AB0 8005C6B0 00000000 */ nop
/* 37AB4 8005C6B4 4501FFD9 */ bc1t .L8005C61C
/* 37AB8 8005C6B8 00000000 */ nop
/* 37ABC 8005C6BC C4A00008 */ lwc1 $f0, 0x8($a1)
/* 37AC0 8005C6C0 46007001 */ sub.s $f0, $f14, $f0
/* 37AC4 8005C6C4 C4820024 */ lwc1 $f2, 0x24($a0)
/* 37AC8 8005C6C8 46020002 */ mul.s $f0, $f0, $f2
/* 37ACC 8005C6CC 00000000 */ nop
/* 37AD0 8005C6D0 C4A20000 */ lwc1 $f2, 0x0($a1)
/* 37AD4 8005C6D4 46029081 */ sub.s $f2, $f18, $f2
/* 37AD8 8005C6D8 C484002C */ lwc1 $f4, 0x2C($a0)
/* 37ADC 8005C6DC 46041082 */ mul.s $f2, $f2, $f4
/* 37AE0 8005C6E0 00000000 */ nop
/* 37AE4 8005C6E4 46020001 */ sub.s $f0, $f0, $f2
/* 37AE8 8005C6E8 460A0002 */ mul.s $f0, $f0, $f10
/* 37AEC 8005C6EC 00000000 */ nop
/* 37AF0 8005C6F0 4606003C */ c.lt.s $f0, $f6
/* 37AF4 8005C6F4 08017185 */ j .L8005C614
/* 37AF8 8005C6F8 00000000 */ nop
.L8005C6FC:
/* 37AFC 8005C6FC 3C01800A */ lui $at, %hi(gCollisionRayLength)
/* 37B00 8005C700 C4244254 */ lwc1 $f4, %lo(gCollisionRayLength)($at)
/* 37B04 8005C704 44800000 */ mtc1 $zero, $f0
/* 37B08 8005C708 C4820034 */ lwc1 $f2, 0x34($a0)
/* 37B0C 8005C70C 4604003E */ c.le.s $f0, $f4
/* 37B10 8005C710 00000000 */ nop
/* 37B14 8005C714 45000007 */ bc1f .L8005C734
/* 37B18 8005C718 46001207 */ neg.s $f8, $f2
/* 37B1C 8005C71C 46005007 */ neg.s $f0, $f10
/* 37B20 8005C720 46080003 */ div.s $f0, $f0, $f8
/* 37B24 8005C724 4600203E */ c.le.s $f4, $f0
/* 37B28 8005C728 00000000 */ nop
/* 37B2C 8005C72C 4501FFBB */ bc1t .L8005C61C
/* 37B30 8005C730 00000000 */ nop
.L8005C734:
/* 37B34 8005C734 3C01800A */ lui $at, %hi(gCollisionRayStartX)
/* 37B38 8005C738 C4204230 */ lwc1 $f0, %lo(gCollisionRayStartX)($at)
/* 37B3C 8005C73C 3C01800A */ lui $at, %hi(gCollisionRayStartZ)
/* 37B40 8005C740 C4244238 */ lwc1 $f4, %lo(gCollisionRayStartZ)($at)
/* 37B44 8005C744 C4860030 */ lwc1 $f6, 0x30($a0)
/* 37B48 8005C748 3C01800A */ lui $at, %hi(gCollisionPointX)
/* 37B4C 8005C74C E4204248 */ swc1 $f0, %lo(gCollisionPointX)($at)
/* 37B50 8005C750 3C01800A */ lui $at, %hi(gCollisionRayStartY)
/* 37B54 8005C754 C4204234 */ lwc1 $f0, %lo(gCollisionRayStartY)($at)
/* 37B58 8005C758 46005087 */ neg.s $f2, $f10
/* 37B5C 8005C75C 3C01800A */ lui $at, %hi(gCollisionPointZ)
/* 37B60 8005C760 E4244250 */ swc1 $f4, %lo(gCollisionPointZ)($at)
/* 37B64 8005C764 C4840034 */ lwc1 $f4, 0x34($a0)
/* 37B68 8005C768 46081083 */ div.s $f2, $f2, $f8
/* 37B6C 8005C76C 3C01800A */ lui $at, %hi(gCollisionRayLength)
/* 37B70 8005C770 E4224254 */ swc1 $f2, %lo(gCollisionRayLength)($at)
/* 37B74 8005C774 3C01800A */ lui $at, %hi(gCollisionNormalX)
/* 37B78 8005C778 E4264258 */ swc1 $f6, %lo(gCollisionNormalX)($at)
/* 37B7C 8005C77C C4860038 */ lwc1 $f6, 0x38($a0)
/* 37B80 8005C780 46020001 */ sub.s $f0, $f0, $f2
/* 37B84 8005C784 3C01800A */ lui $at, %hi(gCollisionNormalY)
/* 37B88 8005C788 E424425C */ swc1 $f4, %lo(gCollisionNormalY)($at)
/* 37B8C 8005C78C 3C01800A */ lui $at, %hi(gCollisionNormalZ)
/* 37B90 8005C790 E4264260 */ swc1 $f6, %lo(gCollisionNormalZ)($at)
/* 37B94 8005C794 3C01800A */ lui $at, %hi(gCollisionPointY)
/* 37B98 8005C798 E420424C */ swc1 $f0, %lo(gCollisionPointY)($at)
/* 37B9C 8005C79C 03E00008 */ jr $ra
/* 37BA0 8005C7A0 24020001 */ addiu $v0, $zero, 0x1
### DECOMPILED C INSTRUCTIONS:
s32 test_ray_triangle_down(ColliderTriangle* triangle, Vec3f* vertices) {
f32 distToTrianglePlane, cosAngle;
Vec3f* v1;
Vec3f* v2;
Vec3f* v3;
if (triangle->normal.x == 0 && triangle->normal.y == 0 && triangle->normal.z == 0) {
return FALSE;
}
v1 = triangle->v1;
v2 = triangle->v2;
v3 = triangle->v3;
distToTrianglePlane = triangle->normal.x * (gCollisionRayStartX - v1->x) +
triangle->normal.y * (gCollisionRayStartY - v1->y) +
triangle->normal.z * (gCollisionRayStartZ - v1->z);
if (triangle->oneSided) {
if (distToTrianglePlane < 0) {
return FALSE;
}
if (triangle->normal.y <= 0)
return FALSE;
if ((gCollisionRayStartZ - v1->z) * triangle->e13.x - (gCollisionRayStartX - v1->x) * triangle->e13.z < 0) {
return FALSE;
}
if ((gCollisionRayStartZ - v2->z) * triangle->e21.x - (gCollisionRayStartX - v2->x) * triangle->e21.z < 0) {
return FALSE;
}
if ((gCollisionRayStartZ - v3->z) * triangle->e32.x - (gCollisionRayStartX - v3->x) * triangle->e32.z < 0) {
return FALSE;
}
} else {
if (triangle->normal.y * distToTrianglePlane <= 0) {
return FALSE;
}
if (((gCollisionRayStartZ - v1->z) * triangle->e13.x - (gCollisionRayStartX - v1->x) * triangle->e13.z) * distToTrianglePlane < 0) {
return FALSE;
}
if (((gCollisionRayStartZ - v2->z) * triangle->e21.x - (gCollisionRayStartX - v2->x) * triangle->e21.z) * distToTrianglePlane < 0) {
return FALSE;
}
if (((gCollisionRayStartZ - v3->z) * triangle->e32.x - (gCollisionRayStartX - v3->x) * triangle->e32.z) * distToTrianglePlane < 0) {
return FALSE;
}
}
cosAngle = -triangle->normal.y;
if (gCollisionRayLength >= 0 && gCollisionRayLength <= -distToTrianglePlane / cosAngle) {
return FALSE;
}
gCollisionRayLength = -distToTrianglePlane / cosAngle;
gCollisionPointX = gCollisionRayStartX;
gCollisionPointY = gCollisionRayStartY - gCollisionRayLength;
gCollisionPointZ = gCollisionRayStartZ;
gCollisionNormalX = triangle->normal.x;
gCollisionNormalY = triangle->normal.y;
gCollisionNormalZ = triangle->normal.z;
return TRUE;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_player
/* 78BF0 800DF740 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 78BF4 800DF744 AFBF0018 */ sw $ra, 0x18($sp)
/* 78BF8 800DF748 AFB10014 */ sw $s1, 0x14($sp)
/* 78BFC 800DF74C 0C0382CE */ jal update_partner_timers
/* 78C00 800DF750 AFB00010 */ sw $s0, 0x10($sp)
/* 78C04 800DF754 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* 78C08 800DF758 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* 78C0C 800DF75C 860200C0 */ lh $v0, 0xC0($s0)
/* 78C10 800DF760 3C118016 */ lui $s1, %hi(gCollisionStatus)
/* 78C14 800DF764 2631A550 */ addiu $s1, $s1, %lo(gCollisionStatus)
/* 78C18 800DF768 28420065 */ slti $v0, $v0, 0x65
/* 78C1C 800DF76C 10400009 */ beqz $v0, .L800DF794
/* 78C20 800DF770 00000000 */ nop
/* 78C24 800DF774 C602002C */ lwc1 $f2, 0x2C($s0)
/* 78C28 800DF778 3C01C4FA */ lui $at, (0xC4FA0000 >> 16)
/* 78C2C 800DF77C 44810000 */ mtc1 $at, $f0
/* 78C30 800DF780 00000000 */ nop
/* 78C34 800DF784 4600103C */ c.lt.s $f2, $f0
/* 78C38 800DF788 00000000 */ nop
/* 78C3C 800DF78C 45000039 */ bc1f .L800DF874
/* 78C40 800DF790 2402FFFF */ addiu $v0, $zero, -0x1
.L800DF794:
/* 78C44 800DF794 8E040004 */ lw $a0, 0x4($s0)
/* 78C48 800DF798 3C021000 */ lui $v0, (0x10000000 >> 16)
/* 78C4C 800DF79C 00821024 */ and $v0, $a0, $v0
/* 78C50 800DF7A0 14400034 */ bnez $v0, .L800DF874
/* 78C54 800DF7A4 2402FFFF */ addiu $v0, $zero, -0x1
/* 78C58 800DF7A8 86020016 */ lh $v0, 0x16($s0)
/* 78C5C 800DF7AC 8603001A */ lh $v1, 0x1A($s0)
/* 78C60 800DF7B0 44820000 */ mtc1 $v0, $f0
/* 78C64 800DF7B4 00000000 */ nop
/* 78C68 800DF7B8 46800020 */ cvt.s.w $f0, $f0
/* 78C6C 800DF7BC 86020018 */ lh $v0, 0x18($s0)
/* 78C70 800DF7C0 A60000C0 */ sh $zero, 0xC0($s0)
/* 78C74 800DF7C4 E6000028 */ swc1 $f0, 0x28($s0)
/* 78C78 800DF7C8 44820000 */ mtc1 $v0, $f0
/* 78C7C 800DF7CC 00000000 */ nop
/* 78C80 800DF7D0 46800020 */ cvt.s.w $f0, $f0
/* 78C84 800DF7D4 E600002C */ swc1 $f0, 0x2C($s0)
/* 78C88 800DF7D8 44830000 */ mtc1 $v1, $f0
/* 78C8C 800DF7DC 00000000 */ nop
/* 78C90 800DF7E0 46800020 */ cvt.s.w $f0, $f0
/* 78C94 800DF7E4 3C020040 */ lui $v0, (0x400000 >> 16)
/* 78C98 800DF7E8 00821024 */ and $v0, $a0, $v0
/* 78C9C 800DF7EC 1040001E */ beqz $v0, .L800DF868
/* 78CA0 800DF7F0 E6000030 */ swc1 $f0, 0x30($s0)
/* 78CA4 800DF7F4 3C022000 */ lui $v0, (0x20000004 >> 16)
/* 78CA8 800DF7F8 34420004 */ ori $v0, $v0, (0x20000004 & 0xFFFF)
/* 78CAC 800DF7FC 00821025 */ or $v0, $a0, $v0
/* 78CB0 800DF800 2404FFFC */ addiu $a0, $zero, -0x4
/* 78CB4 800DF804 0C00EABB */ jal get_npc_unsafe
/* 78CB8 800DF808 AE020004 */ sw $v0, 0x4($s0)
/* 78CBC 800DF80C 86030016 */ lh $v1, 0x16($s0)
/* 78CC0 800DF810 44830000 */ mtc1 $v1, $f0
/* 78CC4 800DF814 00000000 */ nop
/* 78CC8 800DF818 46800020 */ cvt.s.w $f0, $f0
/* 78CCC 800DF81C E4400038 */ swc1 $f0, 0x38($v0)
/* 78CD0 800DF820 86030018 */ lh $v1, 0x18($s0)
/* 78CD4 800DF824 860400B0 */ lh $a0, 0xB0($s0)
/* 78CD8 800DF828 00641821 */ addu $v1, $v1, $a0
/* 78CDC 800DF82C 44830000 */ mtc1 $v1, $f0
/* 78CE0 800DF830 00000000 */ nop
/* 78CE4 800DF834 46800020 */ cvt.s.w $f0, $f0
/* 78CE8 800DF838 E440003C */ swc1 $f0, 0x3C($v0)
/* 78CEC 800DF83C 8603001A */ lh $v1, 0x1A($s0)
/* 78CF0 800DF840 44830000 */ mtc1 $v1, $f0
/* 78CF4 800DF844 00000000 */ nop
/* 78CF8 800DF848 46800020 */ cvt.s.w $f0, $f0
/* 78CFC 800DF84C E4400040 */ swc1 $f0, 0x40($v0)
/* 78D00 800DF850 86030018 */ lh $v1, 0x18($s0)
/* 78D04 800DF854 44830000 */ mtc1 $v1, $f0
/* 78D08 800DF858 00000000 */ nop
/* 78D0C 800DF85C 46800020 */ cvt.s.w $f0, $f0
/* 78D10 800DF860 08037E1C */ j .L800DF870
/* 78D14 800DF864 E4400064 */ swc1 $f0, 0x64($v0)
.L800DF868:
/* 78D18 800DF868 2402000A */ addiu $v0, $zero, 0xA
/* 78D1C 800DF86C A60200C0 */ sh $v0, 0xC0($s0)
.L800DF870:
/* 78D20 800DF870 2402FFFF */ addiu $v0, $zero, -0x1
.L800DF874:
/* 78D24 800DF874 A6220012 */ sh $v0, 0x12($s1)
/* 78D28 800DF878 A6220014 */ sh $v0, 0x14($s1)
/* 78D2C 800DF87C A622000A */ sh $v0, 0xA($s1)
/* 78D30 800DF880 24020001 */ addiu $v0, $zero, 0x1
/* 78D34 800DF884 0C0387E4 */ jal update_player_input
/* 78D38 800DF888 A6220006 */ sh $v0, 0x6($s1)
/* 78D3C 800DF88C 8E020000 */ lw $v0, 0x0($s0)
/* 78D40 800DF890 2403FBFF */ addiu $v1, $zero, -0x401
/* 78D44 800DF894 00431024 */ and $v0, $v0, $v1
/* 78D48 800DF898 0C037FF3 */ jal update_player_blink
/* 78D4C 800DF89C AE020000 */ sw $v0, 0x0($s0)
/* 78D50 800DF8A0 8E020000 */ lw $v0, 0x0($s0)
/* 78D54 800DF8A4 30421000 */ andi $v0, $v0, 0x1000
/* 78D58 800DF8A8 1040000B */ beqz $v0, .L800DF8D8
/* 78D5C 800DF8AC 24020017 */ addiu $v0, $zero, 0x17
/* 78D60 800DF8B0 0C03968B */ jal phys_update_action_state
/* 78D64 800DF8B4 00000000 */ nop
/* 78D68 800DF8B8 0C038082 */ jal func_800E0208
/* 78D6C 800DF8BC 00000000 */ nop
/* 78D70 800DF8C0 1440000E */ bnez $v0, .L800DF8FC
/* 78D74 800DF8C4 00000000 */ nop
/* 78D78 800DF8C8 0C038D8F */ jal collision_main_lateral
/* 78D7C 800DF8CC 00000000 */ nop
/* 78D80 800DF8D0 08037E3F */ j .L800DF8FC
/* 78D84 800DF8D4 00000000 */ nop
.L800DF8D8:
/* 78D88 800DF8D8 820300B4 */ lb $v1, 0xB4($s0)
/* 78D8C 800DF8DC 10620005 */ beq $v1, $v0, .L800DF8F4
/* 78D90 800DF8E0 00000000 */ nop
/* 78D94 800DF8E4 0C037EAB */ jal phys_update_standard
/* 78D98 800DF8E8 00000000 */ nop
/* 78D9C 800DF8EC 08037E3F */ j .L800DF8FC
/* 78DA0 800DF8F0 00000000 */ nop
.L800DF8F4:
/* 78DA4 800DF8F4 0C037EFA */ jal phys_update_lava_reset
/* 78DA8 800DF8F8 00000000 */ nop
.L800DF8FC:
/* 78DAC 800DF8FC 8E020000 */ lw $v0, 0x0($s0)
/* 78DB0 800DF900 30424000 */ andi $v0, $v0, 0x4000
/* 78DB4 800DF904 1040000B */ beqz $v0, .L800DF934
/* 78DB8 800DF908 00000000 */ nop
/* 78DBC 800DF90C 96020012 */ lhu $v0, 0x12($s0)
/* 78DC0 800DF910 2442FFFF */ addiu $v0, $v0, -0x1
/* 78DC4 800DF914 A6020012 */ sh $v0, 0x12($s0)
/* 78DC8 800DF918 00021400 */ sll $v0, $v0, 16
/* 78DCC 800DF91C 1C400005 */ bgtz $v0, .L800DF934
/* 78DD0 800DF920 2403BFFF */ addiu $v1, $zero, -0x4001
/* 78DD4 800DF924 8E020000 */ lw $v0, 0x0($s0)
/* 78DD8 800DF928 A6000012 */ sh $zero, 0x12($s0)
/* 78DDC 800DF92C 00431024 */ and $v0, $v0, $v1
/* 78DE0 800DF930 AE020000 */ sw $v0, 0x0($s0)
.L800DF934:
/* 78DE4 800DF934 8E020004 */ lw $v0, 0x4($s0)
/* 78DE8 800DF938 30421000 */ andi $v0, $v0, 0x1000
/* 78DEC 800DF93C 14400003 */ bnez $v0, .L800DF94C
/* 78DF0 800DF940 00000000 */ nop
/* 78DF4 800DF944 0C03BF42 */ jal func_800EFD08
/* 78DF8 800DF948 00000000 */ nop
.L800DF94C:
/* 78DFC 800DF94C 0C0382E4 */ jal func_800E0B90
/* 78E00 800DF950 00000000 */ nop
/* 78E04 800DF954 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 78E08 800DF958 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 78E0C 800DF95C C6000028 */ lwc1 $f0, 0x28($s0)
/* 78E10 800DF960 E4400098 */ swc1 $f0, 0x98($v0)
/* 78E14 800DF964 C600002C */ lwc1 $f0, 0x2C($s0)
/* 78E18 800DF968 E440009C */ swc1 $f0, 0x9C($v0)
/* 78E1C 800DF96C C6000030 */ lwc1 $f0, 0x30($s0)
/* 78E20 800DF970 E44000A0 */ swc1 $f0, 0xA0($v0)
/* 78E24 800DF974 C6000084 */ lwc1 $f0, 0x84($s0)
/* 78E28 800DF978 0C039B39 */ jal check_input_open_menus
/* 78E2C 800DF97C E44000A4 */ swc1 $f0, 0xA4($v0)
/* 78E30 800DF980 8E020004 */ lw $v0, 0x4($s0)
/* 78E34 800DF984 30421000 */ andi $v0, $v0, 0x1000
/* 78E38 800DF988 14400003 */ bnez $v0, .L800DF998
/* 78E3C 800DF98C 00000000 */ nop
/* 78E40 800DF990 0C039CA3 */ jal check_input_status_bar
/* 78E44 800DF994 00000000 */ nop
.L800DF998:
/* 78E48 800DF998 0C0386F1 */ jal update_player_shadow
/* 78E4C 800DF99C 00000000 */ nop
/* 78E50 800DF9A0 0C038206 */ jal check_for_interactables
/* 78E54 800DF9A4 00000000 */ nop
/* 78E58 800DF9A8 0C038160 */ jal check_for_conversation_prompt
/* 78E5C 800DF9AC 00000000 */ nop
/* 78E60 800DF9B0 0C0380E6 */ jal check_for_pulse_stone
/* 78E64 800DF9B4 00000000 */ nop
/* 78E68 800DF9B8 0C0380A5 */ jal check_for_ispy
/* 78E6C 800DF9BC 00000000 */ nop
/* 78E70 800DF9C0 8E020000 */ lw $v0, 0x0($s0)
/* 78E74 800DF9C4 2403FFEF */ addiu $v1, $zero, -0x11
/* 78E78 800DF9C8 AE00001C */ sw $zero, 0x1C($s0)
/* 78E7C 800DF9CC AE000020 */ sw $zero, 0x20($s0)
/* 78E80 800DF9D0 AE000024 */ sw $zero, 0x24($s0)
/* 78E84 800DF9D4 00431024 */ and $v0, $v0, $v1
/* 78E88 800DF9D8 AE020000 */ sw $v0, 0x0($s0)
/* 78E8C 800DF9DC 8E020004 */ lw $v0, 0x4($s0)
/* 78E90 800DF9E0 2403FFF7 */ addiu $v1, $zero, -0x9
/* 78E94 800DF9E4 00431024 */ and $v0, $v0, $v1
/* 78E98 800DF9E8 AE020004 */ sw $v0, 0x4($s0)
/* 78E9C 800DF9EC 8FBF0018 */ lw $ra, 0x18($sp)
/* 78EA0 800DF9F0 8FB10014 */ lw $s1, 0x14($sp)
/* 78EA4 800DF9F4 8FB00010 */ lw $s0, 0x10($sp)
/* 78EA8 800DF9F8 03E00008 */ jr $ra
/* 78EAC 800DF9FC 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void update_player(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
CollisionStatus* collisionStatus = &gCollisionStatus;
GameStatus* gameStatus;
update_partner_timers();
if ((playerStatus->timeInAir > 100) || (playerStatus->position.y < -2000.0f)) {
if (!(playerStatus->animFlags & PA_FLAG_NO_OOB_RESPAWN)) {
playerStatus->timeInAir = 0;
playerStatus->position.x = playerStatus->lastGoodPosition.x;
playerStatus->position.y = playerStatus->lastGoodPosition.y;
playerStatus->position.z = playerStatus->lastGoodPosition.z;
if (playerStatus->animFlags & PA_FLAG_RIDING_PARTNER) {
Npc* partner;
playerStatus->animFlags |= PA_FLAG_DISMOUNTING_ALLOWED | PA_FLAG_INTERRUPT_USE_PARTNER;
partner = get_npc_unsafe(NPC_PARTNER);
partner->pos.x = playerStatus->lastGoodPosition.x;
partner->pos.y = playerStatus->lastGoodPosition.y + playerStatus->colliderHeight;
partner->pos.z = playerStatus->lastGoodPosition.z;
partner->moveToPos.y = playerStatus->lastGoodPosition.y;
} else {
playerStatus->timeInAir = 10;
}
}
}
collisionStatus->currentWall = NO_COLLIDER;
collisionStatus->lastWallHammered = NO_COLLIDER;
collisionStatus->currentInspect = NO_COLLIDER;
collisionStatus->floorBelow = TRUE;
update_player_input();
playerStatus->flags &= ~PS_FLAG_SPECIAL_LAND;
update_player_blink();
if (playerStatus->flags & PS_FLAG_NO_STATIC_COLLISION) {
phys_update_action_state();
if (!game_scripts_disabled()) {
collision_main_lateral();
}
} else if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
phys_update_standard();
} else {
phys_update_lava_reset();
}
if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) {
playerStatus->moveFrames--;
if (playerStatus->moveFrames <= 0) {
playerStatus->moveFrames = 0;
playerStatus->flags &= ~PS_FLAG_CUTSCENE_MOVEMENT;
}
}
if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
handle_floor_behavior();
}
player_update_sprite();
gameStatus = gGameStatusPtr;
gameStatus->playerPos.x = playerStatus->position.x;
gameStatus->playerPos.y = playerStatus->position.y;
gameStatus->playerPos.z = playerStatus->position.z;
gameStatus->playerYaw = playerStatus->currentYaw;
check_input_open_menus();
if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
check_input_status_bar();
}
update_player_shadow();
check_for_interactables();
check_for_conversation_prompt();
check_for_pulse_stone();
check_for_ispy();
playerStatus->pushVelocity.x = 0.0f;
playerStatus->pushVelocity.y = 0.0f;
playerStatus->pushVelocity.z = 0.0f;
playerStatus->flags &= ~PS_FLAG_SLIDING;
playerStatus->animFlags &= ~PA_FLAG_FORCE_USE_PARTNER;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_8005904C
/* 3444C 8005904C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 34450 80059050 AFB3001C */ sw $s3, 0x1C($sp)
/* 34454 80059054 0080982D */ daddu $s3, $a0, $zero
/* 34458 80059058 30A500FF */ andi $a1, $a1, 0xFF
/* 3445C 8005905C 24A5FFFF */ addiu $a1, $a1, -0x1
/* 34460 80059060 2CA2000A */ sltiu $v0, $a1, 0xA
/* 34464 80059064 AFBF0020 */ sw $ra, 0x20($sp)
/* 34468 80059068 AFB20018 */ sw $s2, 0x18($sp)
/* 3446C 8005906C AFB10014 */ sw $s1, 0x14($sp)
/* 34470 80059070 AFB00010 */ sw $s0, 0x10($sp)
/* 34474 80059074 8E660000 */ lw $a2, 0x0($s3)
/* 34478 80059078 10400021 */ beqz $v0, .L80059100
/* 3447C 8005907C 00051080 */ sll $v0, $a1, 2
/* 34480 80059080 3C01800A */ lui $at, %hi(jtbl_80098940)
/* 34484 80059084 00220821 */ addu $at, $at, $v0
/* 34488 80059088 8C228940 */ lw $v0, %lo(jtbl_80098940)($at)
/* 3448C 8005908C 00400008 */ jr $v0
/* 34490 80059090 00000000 */ nop
glabel .L80059094
/* 34494 80059094 3C048008 */ lui $a0, %hi(SMALLROOM_PARAMS_N)
/* 34498 80059098 08016442 */ j .L80059108
/* 3449C 8005909C 2484EFE0 */ addiu $a0, $a0, %lo(SMALLROOM_PARAMS_N)
glabel .L800590A0
/* 344A0 800590A0 3C048008 */ lui $a0, %hi(D_8007F158)
/* 344A4 800590A4 08016442 */ j .L80059108
/* 344A8 800590A8 2484F158 */ addiu $a0, $a0, %lo(D_8007F158)
glabel .L800590AC
/* 344AC 800590AC 3C048008 */ lui $a0, %hi(D_8007F180)
/* 344B0 800590B0 08016442 */ j .L80059108
/* 344B4 800590B4 2484F180 */ addiu $a0, $a0, %lo(D_8007F180)
glabel .L800590B8
/* 344B8 800590B8 3C048008 */ lui $a0, %hi(D_8007F1A8)
/* 344BC 800590BC 08016442 */ j .L80059108
/* 344C0 800590C0 2484F1A8 */ addiu $a0, $a0, %lo(D_8007F1A8)
glabel .L800590C4
/* 344C4 800590C4 3C048008 */ lui $a0, %hi(AU_FX_CUSTOM_PARAMS)
/* 344C8 800590C8 08016442 */ j .L80059108
/* 344CC 800590CC 8C84F1F8 */ lw $a0, %lo(AU_FX_CUSTOM_PARAMS)($a0)
glabel .L800590D0
/* 344D0 800590D0 3C048008 */ lui $a0, %hi(D_8007F1FC)
/* 344D4 800590D4 08016442 */ j .L80059108
/* 344D8 800590D8 8C84F1FC */ lw $a0, %lo(D_8007F1FC)($a0)
glabel .L800590DC
/* 344DC 800590DC 3C048008 */ lui $a0, %hi(D_8007F200)
/* 344E0 800590E0 08016442 */ j .L80059108
/* 344E4 800590E4 8C84F200 */ lw $a0, %lo(D_8007F200)($a0)
glabel .L800590E8
/* 344E8 800590E8 3C048008 */ lui $a0, %hi(D_8007F204)
/* 344EC 800590EC 08016442 */ j .L80059108
/* 344F0 800590F0 8C84F204 */ lw $a0, %lo(D_8007F204)($a0)
glabel .L800590F4
/* 344F4 800590F4 3C048008 */ lui $a0, %hi(D_8007F048)
/* 344F8 800590F8 08016442 */ j .L80059108
/* 344FC 800590FC 2484F048 */ addiu $a0, $a0, %lo(D_8007F048)
.L80059100:
/* 34500 80059100 3C048008 */ lui $a0, %hi(D_8007F1D0)
/* 34504 80059104 2484F1D0 */ addiu $a0, $a0, %lo(D_8007F1D0)
.L80059108:
/* 34508 80059108 90820003 */ lbu $v0, 0x3($a0)
/* 3450C 8005910C A2620010 */ sb $v0, 0x10($s3)
/* 34510 80059110 8C830004 */ lw $v1, 0x4($a0)
/* 34514 80059114 8E620000 */ lw $v0, 0x0($s3)
/* 34518 80059118 24110507 */ addiu $s1, $zero, 0x507
/* 3451C 8005911C AE620004 */ sw $v0, 0x4($s3)
/* 34520 80059120 00031040 */ sll $v0, $v1, 1
/* 34524 80059124 00431021 */ addu $v0, $v0, $v1
/* 34528 80059128 000210C0 */ sll $v0, $v0, 3
/* 3452C 8005912C 00431023 */ subu $v0, $v0, $v1
/* 34530 80059130 000210C0 */ sll $v0, $v0, 3
/* 34534 80059134 AE620008 */ sw $v0, 0x8($s3)
.L80059138:
/* 34538 80059138 ACC00000 */ sw $zero, 0x0($a2)
/* 3453C 8005913C 2631FFFF */ addiu $s1, $s1, -0x1
/* 34540 80059140 0621FFFD */ bgez $s1, .L80059138
/* 34544 80059144 24C60004 */ addiu $a2, $a2, 0x4
/* 34548 80059148 92620010 */ lbu $v0, 0x10($s3)
/* 3454C 8005914C 10400069 */ beqz $v0, .L800592F4
/* 34550 80059150 0000882D */ daddu $s1, $zero, $zero
/* 34554 80059154 0220902D */ daddu $s2, $s1, $zero
/* 34558 80059158 24020002 */ addiu $v0, $zero, 0x2
/* 3455C 8005915C 00421004 */ sllv $v0, $v0, $v0
/* 34560 80059160 00448021 */ addu $s0, $v0, $a0
.L80059164:
/* 34564 80059164 8E62000C */ lw $v0, 0xC($s3)
/* 34568 80059168 8E030000 */ lw $v1, 0x0($s0)
/* 3456C 8005916C 26100004 */ addiu $s0, $s0, 0x4
/* 34570 80059170 00522021 */ addu $a0, $v0, $s2
/* 34574 80059174 00031040 */ sll $v0, $v1, 1
/* 34578 80059178 00431021 */ addu $v0, $v0, $v1
/* 3457C 8005917C 000210C0 */ sll $v0, $v0, 3
/* 34580 80059180 00431023 */ subu $v0, $v0, $v1
/* 34584 80059184 000210C0 */ sll $v0, $v0, 3
/* 34588 80059188 AC820000 */ sw $v0, 0x0($a0)
/* 3458C 8005918C 8E030000 */ lw $v1, 0x0($s0)
/* 34590 80059190 26100004 */ addiu $s0, $s0, 0x4
/* 34594 80059194 00031040 */ sll $v0, $v1, 1
/* 34598 80059198 00431021 */ addu $v0, $v0, $v1
/* 3459C 8005919C 000210C0 */ sll $v0, $v0, 3
/* 345A0 800591A0 00431023 */ subu $v0, $v0, $v1
/* 345A4 800591A4 000210C0 */ sll $v0, $v0, 3
/* 345A8 800591A8 AC820004 */ sw $v0, 0x4($a0)
/* 345AC 800591AC 96020002 */ lhu $v0, 0x2($s0)
/* 345B0 800591B0 26100004 */ addiu $s0, $s0, 0x4
/* 345B4 800591B4 A482000A */ sh $v0, 0xA($a0)
/* 345B8 800591B8 96020002 */ lhu $v0, 0x2($s0)
/* 345BC 800591BC 26100004 */ addiu $s0, $s0, 0x4
/* 345C0 800591C0 A4820008 */ sh $v0, 0x8($a0)
/* 345C4 800591C4 96020002 */ lhu $v0, 0x2($s0)
/* 345C8 800591C8 26100004 */ addiu $s0, $s0, 0x4
/* 345CC 800591CC A482000C */ sh $v0, 0xC($a0)
/* 345D0 800591D0 8E020000 */ lw $v0, 0x0($s0)
/* 345D4 800591D4 50400033 */ beql $v0, $zero, .L800592A4
/* 345D8 800591D8 AC800028 */ sw $zero, 0x28($a0)
/* 345DC 800591DC 26100004 */ addiu $s0, $s0, 0x4
/* 345E0 800591E0 44820000 */ mtc1 $v0, $f0
/* 345E4 800591E4 00000000 */ nop
/* 345E8 800591E8 46800020 */ cvt.s.w $f0, $f0
/* 345EC 800591EC 3C01447A */ lui $at, (0x447A0000 >> 16)
/* 345F0 800591F0 44811000 */ mtc1 $at, $f2
/* 345F4 800591F4 8C830004 */ lw $v1, 0x4($a0)
/* 345F8 800591F8 8C820000 */ lw $v0, 0x0($a0)
/* 345FC 800591FC 46020003 */ div.s $f0, $f0, $f2
/* 34600 80059200 46000021 */ cvt.d.s $f0, $f0
/* 34604 80059204 00621823 */ subu $v1, $v1, $v0
/* 34608 80059208 46200000 */ add.d $f0, $f0, $f0
/* 3460C 8005920C 3C028008 */ lui $v0, %hi(gActiveSynDriverPtr)
/* 34610 80059210 8C428E50 */ lw $v0, %lo(gActiveSynDriverPtr)($v0)
/* 34614 80059214 44832000 */ mtc1 $v1, $f4
/* 34618 80059218 00000000 */ nop
/* 3461C 8005921C 46802121 */ cvt.d.w $f4, $f4
/* 34620 80059220 C4420008 */ lwc1 $f2, 0x8($v0)
/* 34624 80059224 468010A1 */ cvt.d.w $f2, $f2
/* 34628 80059228 46220003 */ div.d $f0, $f0, $f2
/* 3462C 8005922C 46200020 */ cvt.s.d $f0, $f0
/* 34630 80059230 E4800010 */ swc1 $f0, 0x10($a0)
/* 34634 80059234 C6000000 */ lwc1 $f0, 0x0($s0)
/* 34638 80059238 46800020 */ cvt.s.w $f0, $f0
/* 3463C 8005923C 26100004 */ addiu $s0, $s0, 0x4
/* 34640 80059240 3C01800A */ lui $at, %hi(D_80098968)
/* 34644 80059244 D4228968 */ ldc1 $f2, %lo(D_80098968)($at)
/* 34648 80059248 46000021 */ cvt.d.s $f0, $f0
/* 3464C 8005924C 04610006 */ bgez $v1, .L80059268
/* 34650 80059250 46220083 */ div.d $f2, $f0, $f2
/* 34654 80059254 3C0141F0 */ lui $at, (0x41F00000 >> 16)
/* 34658 80059258 44810800 */ mtc1 $at, $f1
/* 3465C 8005925C 44800000 */ mtc1 $zero, $f0
/* 34660 80059260 00000000 */ nop
/* 34664 80059264 46202100 */ add.d $f4, $f4, $f0
.L80059268:
/* 34668 80059268 46241002 */ mul.d $f0, $f2, $f4
/* 3466C 8005926C 00000000 */ nop
/* 34670 80059270 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 34674 80059274 44811000 */ mtc1 $at, $f2
/* 34678 80059278 8C82002C */ lw $v0, 0x2C($a0)
/* 3467C 8005927C AC800018 */ sw $zero, 0x18($a0)
/* 34680 80059280 E4820014 */ swc1 $f2, 0x14($a0)
/* 34684 80059284 AC820028 */ sw $v0, 0x28($a0)
/* 34688 80059288 46200020 */ cvt.s.d $f0, $f0
/* 3468C 8005928C E480001C */ swc1 $f0, 0x1C($a0)
/* 34690 80059290 AC400008 */ sw $zero, 0x8($v0)
/* 34694 80059294 8C830028 */ lw $v1, 0x28($a0)
/* 34698 80059298 24020001 */ addiu $v0, $zero, 0x1
/* 3469C 8005929C 080164AA */ j .L800592A8
/* 346A0 800592A0 AC62000C */ sw $v0, 0xC($v1)
.L800592A4:
/* 346A4 800592A4 26100008 */ addiu $s0, $s0, 0x8
.L800592A8:
/* 346A8 800592A8 8E020000 */ lw $v0, 0x0($s0)
/* 346AC 800592AC 5040000A */ beql $v0, $zero, .L800592D8
/* 346B0 800592B0 AC800020 */ sw $zero, 0x20($a0)
/* 346B4 800592B4 8C830024 */ lw $v1, 0x24($a0)
/* 346B8 800592B8 AC830020 */ sw $v1, 0x20($a0)
/* 346BC 800592BC 96020002 */ lhu $v0, 0x2($s0)
/* 346C0 800592C0 A4620000 */ sh $v0, 0x0($v1)
/* 346C4 800592C4 8C840020 */ lw $a0, 0x20($a0)
/* 346C8 800592C8 0C016374 */ jal _init_lpfilter
/* 346CC 800592CC 26100004 */ addiu $s0, $s0, 0x4
/* 346D0 800592D0 080164B8 */ j .L800592E0
/* 346D4 800592D4 26520030 */ addiu $s2, $s2, 0x30
.L800592D8:
/* 346D8 800592D8 26100004 */ addiu $s0, $s0, 0x4
/* 346DC 800592DC 26520030 */ addiu $s2, $s2, 0x30
.L800592E0:
/* 346E0 800592E0 92620010 */ lbu $v0, 0x10($s3)
/* 346E4 800592E4 26310001 */ addiu $s1, $s1, 0x1
/* 346E8 800592E8 0222102A */ slt $v0, $s1, $v0
/* 346EC 800592EC 1440FF9D */ bnez $v0, .L80059164
/* 346F0 800592F0 00000000 */ nop
.L800592F4:
/* 346F4 800592F4 8FBF0020 */ lw $ra, 0x20($sp)
/* 346F8 800592F8 8FB3001C */ lw $s3, 0x1C($sp)
/* 346FC 800592FC 8FB20018 */ lw $s2, 0x18($sp)
/* 34700 80059300 8FB10014 */ lw $s1, 0x14($sp)
/* 34704 80059304 8FB00010 */ lw $s0, 0x10($sp)
/* 34708 80059308 03E00008 */ jr $ra
/* 3470C 8005930C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void func_8005904C(AuFX* fx, u8 effectType) {
s32* params;
s32* clr;
s32 i, j;
clr = (s32*)fx->base;
switch (effectType) {
case AU_FX_SMALLROOM:
params = SMALL_ROOM_PARAMS;
break;
case AU_FX_BIGROOM:
params = BIG_ROOM_PARAMS;
break;
case AU_FX_ECHO:
params = ECHO_PARAMS;
break;
case AU_FX_CHORUS:
params = CHORUS_PARAMS;
break;
case AU_FX_FLANGE:
params = FLANGE_PARAMS;
break;
case AU_FX_CUSTOM_0:
params = AU_FX_CUSTOM_PARAMS[0];
break;
case AU_FX_CUSTOM_1:
params = AU_FX_CUSTOM_PARAMS[1];
break;
case AU_FX_CUSTOM_2:
params = AU_FX_CUSTOM_PARAMS[2];
break;
case AU_FX_CUSTOM_3:
params = AU_FX_CUSTOM_PARAMS[3];
break;
case AU_FX_OTHER_BIGROOM:
params = BIG_ROOM_PARAMS;
break;
default:
params = NULL_PARAMS;
break;
}
j = 0;
fx->delayCount = params[j++];
fx->length = params[j++] * AUDIO_SAMPLES;
fx->input = fx->base;
for (i = 0; i < AU_FX_LENGTH/2; i++) {
*clr++ = 0;
}
for (i = 0; i < fx->delayCount; i++) {
AuDelay* delay = &fx->delays[i];
delay->input = params[j++] * AUDIO_SAMPLES;
delay->output = params[j++] * AUDIO_SAMPLES;
delay->fbcoef = (u16) params[j++];
delay->ffcoef = (u16) params[j++];
delay->gain = (u16) params[j++];
if (params[j]) {
delay->rsinc = (2.0 * (params[j++] / 1000.0f)) / gActiveSynDriverPtr->outputRate;
delay->rsgain = ((f32)params[j++] / CONVERT) * (delay->output - delay->input);
delay->rsval = 1.0f;
delay->rsdelta = 0.0f;
delay->resampler_28 = delay->resampler_2C;
delay->resampler_2C->delta = 0.0;
delay->resampler_28->first = 1;
} else {
delay->resampler_28 = NULL;
j++;
j++;
}
if (params[j]) {
delay->lowpass_20 = delay->lowpass_24;
delay->lowpass_20->fc = params[j++];
_init_lpfilter(delay->lowpass_20);
} else {
delay->lowpass_20 = NULL;
j++;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_bgm_player_initialize
/* 299D8 8004E5D8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 299DC 8004E5DC AFB10014 */ sw $s1, 0x14($sp)
/* 299E0 8004E5E0 0080882D */ daddu $s1, $a0, $zero
/* 299E4 8004E5E4 AFB00010 */ sw $s0, 0x10($sp)
/* 299E8 8004E5E8 0000802D */ daddu $s0, $zero, $zero
/* 299EC 8004E5EC 2408FFFF */ addiu $t0, $zero, -0x1
/* 299F0 8004E5F0 3C057FFF */ lui $a1, (0x7FFF0000 >> 16)
/* 299F4 8004E5F4 24070040 */ addiu $a3, $zero, 0x40
/* 299F8 8004E5F8 2406007F */ addiu $a2, $zero, 0x7F
/* 299FC 8004E5FC 2404025C */ addiu $a0, $zero, 0x25C
/* 29A00 8004E600 AFBF0018 */ sw $ra, 0x18($sp)
.L8004E604:
/* 29A04 8004E604 02241021 */ addu $v0, $s1, $a0
/* 29A08 8004E608 AC48000C */ sw $t0, 0xC($v0)
/* 29A0C 8004E60C AC450018 */ sw $a1, 0x18($v0)
/* 29A10 8004E610 A047004A */ sb $a3, 0x4A($v0)
/* 29A14 8004E614 A040004B */ sb $zero, 0x4B($v0)
/* 29A18 8004E618 A4400044 */ sh $zero, 0x44($v0)
/* 29A1C 8004E61C A4400046 */ sh $zero, 0x46($v0)
/* 29A20 8004E620 A0400048 */ sb $zero, 0x48($v0)
/* 29A24 8004E624 A0460049 */ sb $a2, 0x49($v0)
/* 29A28 8004E628 A040004C */ sb $zero, 0x4C($v0)
/* 29A2C 8004E62C AC45002C */ sw $a1, 0x2C($v0)
/* 29A30 8004E630 AC400004 */ sw $zero, 0x4($v0)
/* 29A34 8004E634 AC400008 */ sw $zero, 0x8($v0)
/* 29A38 8004E638 A440003E */ sh $zero, 0x3E($v0)
/* 29A3C 8004E63C A4400038 */ sh $zero, 0x38($v0)
/* 29A40 8004E640 A0400056 */ sb $zero, 0x56($v0)
/* 29A44 8004E644 A440003A */ sh $zero, 0x3A($v0)
/* 29A48 8004E648 A0400055 */ sb $zero, 0x55($v0)
/* 29A4C 8004E64C AC40001C */ sw $zero, 0x1C($v0)
/* 29A50 8004E650 AC400020 */ sw $zero, 0x20($v0)
/* 29A54 8004E654 AC400024 */ sw $zero, 0x24($v0)
/* 29A58 8004E658 AC400030 */ sw $zero, 0x30($v0)
/* 29A5C 8004E65C A4400034 */ sh $zero, 0x34($v0)
/* 29A60 8004E660 A4400036 */ sh $zero, 0x36($v0)
/* 29A64 8004E664 A040004D */ sb $zero, 0x4D($v0)
/* 29A68 8004E668 A040004E */ sb $zero, 0x4E($v0)
/* 29A6C 8004E66C A040004F */ sb $zero, 0x4F($v0)
/* 29A70 8004E670 A0400050 */ sb $zero, 0x50($v0)
/* 29A74 8004E674 A0400051 */ sb $zero, 0x51($v0)
/* 29A78 8004E678 A0400054 */ sb $zero, 0x54($v0)
/* 29A7C 8004E67C A0400057 */ sb $zero, 0x57($v0)
/* 29A80 8004E680 A0400058 */ sb $zero, 0x58($v0)
/* 29A84 8004E684 A0400059 */ sb $zero, 0x59($v0)
/* 29A88 8004E688 A040005A */ sb $zero, 0x5A($v0)
/* 29A8C 8004E68C 92230235 */ lbu $v1, 0x235($s1)
/* 29A90 8004E690 A043005B */ sb $v1, 0x5B($v0)
/* 29A94 8004E694 A050005C */ sb $s0, 0x5C($v0)
/* 29A98 8004E698 26100001 */ addiu $s0, $s0, 0x1
/* 29A9C 8004E69C 2A020010 */ slti $v0, $s0, 0x10
/* 29AA0 8004E6A0 1440FFD8 */ bnez $v0, .L8004E604
/* 29AA4 8004E6A4 24840060 */ addiu $a0, $a0, 0x60
/* 29AA8 8004E6A8 0000802D */ daddu $s0, $zero, $zero
/* 29AAC 8004E6AC 2404FFFF */ addiu $a0, $zero, -0x1
/* 29AB0 8004E6B0 3C014000 */ lui $at, (0x40000000 >> 16)
/* 29AB4 8004E6B4 44810000 */ mtc1 $at, $f0
/* 29AB8 8004E6B8 2403085C */ addiu $v1, $zero, 0x85C
.L8004E6BC:
/* 29ABC 8004E6BC 02231021 */ addu $v0, $s1, $v1
/* 29AC0 8004E6C0 26100001 */ addiu $s0, $s0, 0x1
/* 29AC4 8004E6C4 AC440000 */ sw $a0, 0x0($v0)
/* 29AC8 8004E6C8 E4400004 */ swc1 $f0, 0x4($v0)
/* 29ACC 8004E6CC A4400014 */ sh $zero, 0x14($v0)
/* 29AD0 8004E6D0 A0400016 */ sb $zero, 0x16($v0)
/* 29AD4 8004E6D4 AC40000C */ sw $zero, 0xC($v0)
/* 29AD8 8004E6D8 A0400012 */ sb $zero, 0x12($v0)
/* 29ADC 8004E6DC 2A020018 */ slti $v0, $s0, 0x18
/* 29AE0 8004E6E0 1440FFF6 */ bnez $v0, .L8004E6BC
/* 29AE4 8004E6E4 24630018 */ addiu $v1, $v1, 0x18
/* 29AE8 8004E6E8 0C014240 */ jal func_80050900
/* 29AEC 8004E6EC 0220202D */ daddu $a0, $s1, $zero
/* 29AF0 8004E6F0 0000802D */ daddu $s0, $zero, $zero
/* 29AF4 8004E6F4 3C014300 */ lui $at, (0x43000000 >> 16)
/* 29AF8 8004E6F8 44810000 */ mtc1 $at, $f0
/* 29AFC 8004E6FC 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 29B00 8004E700 44811000 */ mtc1 $at, $f2
/* 29B04 8004E704 24023CF0 */ addiu $v0, $zero, 0x3CF0
/* 29B08 8004E708 AE2200B0 */ sw $v0, 0xB0($s1)
/* 29B0C 8004E70C 2402009C */ addiu $v0, $zero, 0x9C
/* 29B10 8004E710 A6220208 */ sh $v0, 0x208($s1)
/* 29B14 8004E714 24020080 */ addiu $v0, $zero, 0x80
/* 29B18 8004E718 A222021E */ sb $v0, 0x21E($s1)
/* 29B1C 8004E71C 3C027F00 */ lui $v0, (0x7F000000 >> 16)
/* 29B20 8004E720 AE2200C0 */ sw $v0, 0xC0($s1)
/* 29B24 8004E724 24020001 */ addiu $v0, $zero, 0x1
/* 29B28 8004E728 AE200020 */ sw $zero, 0x20($s1)
/* 29B2C 8004E72C AE200074 */ sw $zero, 0x74($s1)
/* 29B30 8004E730 AE2000B8 */ sw $zero, 0xB8($s1)
/* 29B34 8004E734 A620020C */ sh $zero, 0x20C($s1)
/* 29B38 8004E738 A620020E */ sh $zero, 0x20E($s1)
/* 29B3C 8004E73C AE2000CC */ sw $zero, 0xCC($s1)
/* 29B40 8004E740 AE2000C8 */ sw $zero, 0xC8($s1)
/* 29B44 8004E744 AE2000C4 */ sw $zero, 0xC4($s1)
/* 29B48 8004E748 AE20016C */ sw $zero, 0x16C($s1)
/* 29B4C 8004E74C A2200170 */ sb $zero, 0x170($s1)
/* 29B50 8004E750 A2200171 */ sb $zero, 0x171($s1)
/* 29B54 8004E754 AE200164 */ sw $zero, 0x164($s1)
/* 29B58 8004E758 AE200160 */ sw $zero, 0x160($s1)
/* 29B5C 8004E75C AE20015C */ sw $zero, 0x15C($s1)
/* 29B60 8004E760 AE200158 */ sw $zero, 0x158($s1)
/* 29B64 8004E764 AE200168 */ sw $zero, 0x168($s1)
/* 29B68 8004E768 A2200210 */ sb $zero, 0x210($s1)
/* 29B6C 8004E76C A2200222 */ sb $zero, 0x222($s1)
/* 29B70 8004E770 A2200223 */ sb $zero, 0x223($s1)
/* 29B74 8004E774 AE200204 */ sw $zero, 0x204($s1)
/* 29B78 8004E778 A2200232 */ sb $zero, 0x232($s1)
/* 29B7C 8004E77C A2220233 */ sb $v0, 0x233($s1)
/* 29B80 8004E780 A2200211 */ sb $zero, 0x211($s1)
/* 29B84 8004E784 E62000D0 */ swc1 $f0, 0xD0($s1)
/* 29B88 8004E788 E62200D0 */ swc1 $f2, 0xD0($s1)
/* 29B8C 8004E78C 0220202D */ daddu $a0, $s1, $zero
.L8004E790:
/* 29B90 8004E790 0C013A11 */ jal func_8004E844
/* 29B94 8004E794 0200282D */ daddu $a1, $s0, $zero
/* 29B98 8004E798 26100001 */ addiu $s0, $s0, 0x1
/* 29B9C 8004E79C 2A020008 */ slti $v0, $s0, 0x8
/* 29BA0 8004E7A0 1440FFFB */ bnez $v0, .L8004E790
/* 29BA4 8004E7A4 0220202D */ daddu $a0, $s1, $zero
/* 29BA8 8004E7A8 24100003 */ addiu $s0, $zero, 0x3
/* 29BAC 8004E7AC 02301021 */ addu $v0, $s1, $s0
.L8004E7B0:
/* 29BB0 8004E7B0 A0400224 */ sb $zero, 0x224($v0)
/* 29BB4 8004E7B4 2610FFFF */ addiu $s0, $s0, -0x1
/* 29BB8 8004E7B8 0601FFFD */ bgez $s0, .L8004E7B0
/* 29BBC 8004E7BC 2442FFFF */ addiu $v0, $v0, -0x1
/* 29BC0 8004E7C0 0000802D */ daddu $s0, $zero, $zero
/* 29BC4 8004E7C4 0220182D */ daddu $v1, $s1, $zero
/* 29BC8 8004E7C8 A2200220 */ sb $zero, 0x220($s1)
/* 29BCC 8004E7CC AE200018 */ sw $zero, 0x18($s1)
.L8004E7D0:
/* 29BD0 8004E7D0 8E220068 */ lw $v0, 0x68($s1)
/* 29BD4 8004E7D4 26100001 */ addiu $s0, $s0, 0x1
/* 29BD8 8004E7D8 AC6200D8 */ sw $v0, 0xD8($v1)
/* 29BDC 8004E7DC 2A020020 */ slti $v0, $s0, 0x20
/* 29BE0 8004E7E0 1440FFFB */ bnez $v0, .L8004E7D0
/* 29BE4 8004E7E4 24630004 */ addiu $v1, $v1, 0x4
/* 29BE8 8004E7E8 8E240068 */ lw $a0, 0x68($s1)
/* 29BEC 8004E7EC 24050001 */ addiu $a1, $zero, 0x1
/* 29BF0 8004E7F0 3C07F000 */ lui $a3, (0xF0000000 >> 16)
/* 29BF4 8004E7F4 3C063000 */ lui $a2, (0x30000000 >> 16)
.L8004E7F8:
/* 29BF8 8004E7F8 8C830000 */ lw $v1, 0x0($a0)
/* 29BFC 8004E7FC 14600003 */ bnez $v1, .L8004E80C
/* 29C00 8004E800 24840004 */ addiu $a0, $a0, 0x4
/* 29C04 8004E804 08013A09 */ j .L8004E824
glabel func_8004E808
/* 29C08 8004E808 0000282D */ daddu $a1, $zero, $zero
.L8004E80C:
/* 29C0C 8004E80C 00671024 */ and $v0, $v1, $a3
/* 29C10 8004E810 14460004 */ bne $v0, $a2, .L8004E824
/* 29C14 8004E814 3062001F */ andi $v0, $v1, 0x1F
/* 29C18 8004E818 00021080 */ sll $v0, $v0, 2
/* 29C1C 8004E81C 02221021 */ addu $v0, $s1, $v0
/* 29C20 8004E820 AC4400D8 */ sw $a0, 0xD8($v0)
.L8004E824:
/* 29C24 8004E824 14A0FFF4 */ bnez $a1, .L8004E7F8
/* 29C28 8004E828 24020002 */ addiu $v0, $zero, 0x2
/* 29C2C 8004E82C A2220221 */ sb $v0, 0x221($s1)
/* 29C30 8004E830 8FBF0018 */ lw $ra, 0x18($sp)
/* 29C34 8004E834 8FB10014 */ lw $s1, 0x14($sp)
/* 29C38 8004E838 8FB00010 */ lw $s0, 0x10($sp)
/* 29C3C 8004E83C 03E00008 */ jr $ra
/* 29C40 8004E840 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void au_bgm_player_initialize(BGMPlayer* player) {
s32* buf;
s32 cmd;
s32 keepReading;
s32 i;
for (i = 0; i < ARRAY_COUNT(player->tracks); i++) {
BGMPlayerTrack* track = &player->tracks[i];
track->instrument = NO_INSTRUMENT;
track->subTrackVolume = 0x7FFF0000;
track->subTrackPan = 0x40;
track->subTrackReverb = 0;
track->patch = 0;
track->subTrackCoarseTune = 0;
track->subTrackFineTune = 0;
track->segTrackVolume = 0x7F;
track->unk_4C = 0;
track->unkVolume = 0x7FFF0000;
track->savedPos = NULL;
track->prevReadPos = NULL;
track->detourLength = 0;
track->segTrackTune = 0;
track->trackTremoloTime = 0;
track->trackTremoloAmount = 0;
track->trackTremoloSpeed = 0;
track->subTrackVolumeStep = 0;
track->subTrackVolumeTarget = 0;
track->subTrackVolumeTime = 0;
track->unkVolumeStep = 0;
track->unkVolumeTarget = 0;
track->unkVolumeTime = 0;
track->unk_4D = 0;
track->unk_4E = 0;
track->unk_4F = 0;
track->unk_50 = 0;
track->unk_51 = 0;
track->polyphonicIdx = 0;
track->unk_57 = 0;
track->isDrumTrack = FALSE;
track->parentTrackIdx = 0;
track->unk_5A = 0;
track->subtrackBusId = player->busId;
track->index = i;
}
for (i = 0; i < ARRAY_COUNT(player->notes); i++) {
SeqNote* note = &player->notes[i];
note->ins = NO_INSTRUMENT;
note->pitchRatio = 2.0f;
note->unk_14 = 0;
note->noteVelocity = 0;
note->noteLength = 0;
note->tremoloTime = 0;
}
func_80050900(player);
player->playbackRate = 128.0f; // set to 1.0 later om...
player->masterTempo = BGM_DEFAULT_TEMPO;
player->masterTempoBPM = BGM_DEFAULT_TEMPO / 100;
player->unk_21E = 0x80;
player->masterVolume = 0x7F000000;
player->fadeSongName = 0;
player->unk_74 = 0;
player->masterTempoTarget = 0;
player->masterPitchShift = 0;
player->detune = 0;
player->masterVolumeTime = 0;
player->masterVolumeTarget = 0;
player->masterVolumeStep = 0;
player->proxMixValue = 0;
player->proxMixID = 0;
player->proxMixVolume = 0;
player->segActiveLoopEndPos[3] = NULL;
player->segActiveLoopEndPos[2] = NULL;
player->segActiveLoopEndPos[1] = NULL;
player->segActiveLoopEndPos[0] = NULL;
*(s32*)player->segLoopCounters = 0;
player->segLoopDepth = 0;
player->unk_222 = 0;
player->unk_223 = 0;
player->trackVolsConfig = NULL;
player->bFadeConfigSetsVolume = FALSE;
player->unk_233 = 1;
player->unk_211 = 0;
player->playbackRate = 1.0f;
for (i = 0; i < ARRAY_COUNT(player->unk_212); i++) {
func_8004E844(player, i);
}
for (i = 0; i < ARRAY_COUNT(player->effectValues); i++) {
player->effectValues[i] = 0;
}
player->unk_220 = 0;
player->songPlayingCounter = 0;
for (i = 0; i < ARRAY_COUNT(player->segLoopStartLabels); i++) {
player->segLoopStartLabels[i] = player->segmentReadPos;
}
// find labels
buf = player->segmentReadPos;
keepReading = TRUE;
while (keepReading) {
cmd = *buf++;
if (cmd == 0) {
keepReading = FALSE;
} else if ((cmd & 0xF0000000) == BGM_SEGMENT_LABEL << 28) {
player->segLoopStartLabels[cmd & 0x1F] = buf;
}
}
player->masterState = BGM_PLAY_STATE_NEXT_SUBSEG;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel npc_raycast_down_sides
/* 7602C 800DCB7C 27BDFF80 */ addiu $sp, $sp, -0x80
/* 76030 800DCB80 AFB40048 */ sw $s4, 0x48($sp)
/* 76034 800DCB84 8FB40090 */ lw $s4, 0x90($sp)
/* 76038 800DCB88 AFBF004C */ sw $ra, 0x4C($sp)
/* 7603C 800DCB8C AFB30044 */ sw $s3, 0x44($sp)
/* 76040 800DCB90 AFB20040 */ sw $s2, 0x40($sp)
/* 76044 800DCB94 AFB1003C */ sw $s1, 0x3C($sp)
/* 76048 800DCB98 AFB00038 */ sw $s0, 0x38($sp)
/* 7604C 800DCB9C F7BE0078 */ sdc1 $f30, 0x78($sp)
/* 76050 800DCBA0 F7BC0070 */ sdc1 $f28, 0x70($sp)
/* 76054 800DCBA4 F7BA0068 */ sdc1 $f26, 0x68($sp)
/* 76058 800DCBA8 F7B80060 */ sdc1 $f24, 0x60($sp)
/* 7605C 800DCBAC F7B60058 */ sdc1 $f22, 0x58($sp)
/* 76060 800DCBB0 F7B40050 */ sdc1 $f20, 0x50($sp)
/* 76064 800DCBB4 C4A60000 */ lwc1 $f6, 0x0($a1)
/* 76068 800DCBB8 00C0882D */ daddu $s1, $a2, $zero
/* 7606C 800DCBBC E7A60028 */ swc1 $f6, 0x28($sp)
/* 76070 800DCBC0 C63E0000 */ lwc1 $f30, 0x0($s1)
/* 76074 800DCBC4 C4E60000 */ lwc1 $f6, 0x0($a3)
/* 76078 800DCBC8 3C128011 */ lui $s2, %hi(D_8010C970)
/* 7607C 800DCBCC 2652C970 */ addiu $s2, $s2, %lo(D_8010C970)
/* 76080 800DCBD0 E7A6002C */ swc1 $f6, 0x2C($sp)
/* 76084 800DCBD4 4600F18D */ trunc.w.s $f6, $f30
/* 76088 800DCBD8 E6460000 */ swc1 $f6, 0x0($s2)
/* 7608C 800DCBDC C6200000 */ lwc1 $f0, 0x0($s1)
/* 76090 800DCBE0 4600018D */ trunc.w.s $f6, $f0
/* 76094 800DCBE4 3C018011 */ lui $at, %hi(D_8010C94C)
/* 76098 800DCBE8 E426C94C */ swc1 $f6, %lo(D_8010C94C)($at)
/* 7609C 800DCBEC C6200000 */ lwc1 $f0, 0x0($s1)
/* 760A0 800DCBF0 0080982D */ daddu $s3, $a0, $zero
/* 760A4 800DCBF4 4600018D */ trunc.w.s $f6, $f0
/* 760A8 800DCBF8 3C018011 */ lui $at, %hi(D_8010C974)
/* 760AC 800DCBFC E426C974 */ swc1 $f6, %lo(D_8010C974)($at)
/* 760B0 800DCC00 C6800000 */ lwc1 $f0, 0x0($s4)
/* 760B4 800DCC04 44806000 */ mtc1 $zero, $f12
/* 760B8 800DCC08 0C00A6C9 */ jal clamp_angle
/* 760BC 800DCC0C 46000605 */ abs.s $f24, $f0
/* 760C0 800DCC10 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* 760C4 800DCC14 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* 760C8 800DCC18 44811000 */ mtc1 $at, $f2
/* 760CC 800DCC1C 00000000 */ nop
/* 760D0 800DCC20 46020002 */ mul.s $f0, $f0, $f2
/* 760D4 800DCC24 00000000 */ nop
/* 760D8 800DCC28 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 760DC 800DCC2C 44811000 */ mtc1 $at, $f2
/* 760E0 800DCC30 00000000 */ nop
/* 760E4 800DCC34 46020503 */ div.s $f20, $f0, $f2
/* 760E8 800DCC38 0C00A85B */ jal sin_rad
/* 760EC 800DCC3C 4600A306 */ mov.s $f12, $f20
/* 760F0 800DCC40 46000586 */ mov.s $f22, $f0
/* 760F4 800DCC44 0C00A874 */ jal cos_rad
/* 760F8 800DCC48 4600A306 */ mov.s $f12, $f20
/* 760FC 800DCC4C 3C014120 */ lui $at, (0x41200000 >> 16)
/* 76100 800DCC50 44813000 */ mtc1 $at, $f6
/* 76104 800DCC54 00000000 */ nop
/* 76108 800DCC58 4606B102 */ mul.s $f4, $f22, $f6
/* 7610C 800DCC5C 00000000 */ nop
/* 76110 800DCC60 0000802D */ daddu $s0, $zero, $zero
/* 76114 800DCC64 0260202D */ daddu $a0, $s3, $zero
/* 76118 800DCC68 27A50018 */ addiu $a1, $sp, 0x18
/* 7611C 800DCC6C 46003087 */ neg.s $f2, $f6
/* 76120 800DCC70 46020002 */ mul.s $f0, $f0, $f2
/* 76124 800DCC74 00000000 */ nop
/* 76128 800DCC78 27A6001C */ addiu $a2, $sp, 0x1C
/* 7612C 800DCC7C 27A70020 */ addiu $a3, $sp, 0x20
/* 76130 800DCC80 C7A60028 */ lwc1 $f6, 0x28($sp)
/* 76134 800DCC84 3C01C6FF */ lui $at, (0xC6FFFE00 >> 16)
/* 76138 800DCC88 3421FE00 */ ori $at, $at, (0xC6FFFE00 & 0xFFFF)
/* 7613C 800DCC8C 4481D000 */ mtc1 $at, $f26
/* 76140 800DCC90 46043080 */ add.s $f2, $f6, $f4
/* 76144 800DCC94 C7A6002C */ lwc1 $f6, 0x2C($sp)
/* 76148 800DCC98 27A20024 */ addiu $v0, $sp, 0x24
/* 7614C 800DCC9C E7BE001C */ swc1 $f30, 0x1C($sp)
/* 76150 800DCCA0 E7B80024 */ swc1 $f24, 0x24($sp)
/* 76154 800DCCA4 46003000 */ add.s $f0, $f6, $f0
/* 76158 800DCCA8 4600D706 */ mov.s $f28, $f26
/* 7615C 800DCCAC E7A20018 */ swc1 $f2, 0x18($sp)
/* 76160 800DCCB0 E7A00020 */ swc1 $f0, 0x20($sp)
/* 76164 800DCCB4 0C037140 */ jal npc_raycast_down
/* 76168 800DCCB8 AFA20010 */ sw $v0, 0x10($sp)
/* 7616C 800DCCBC 0440000F */ bltz $v0, .L800DCCFC
/* 76170 800DCCC0 E7B80030 */ swc1 $f24, 0x30($sp)
/* 76174 800DCCC4 C7A00024 */ lwc1 $f0, 0x24($sp)
/* 76178 800DCCC8 4618003E */ c.le.s $f0, $f24
/* 7617C 800DCCCC 00000000 */ nop
/* 76180 800DCCD0 4500000A */ bc1f .L800DCCFC
/* 76184 800DCCD4 00000000 */ nop
/* 76188 800DCCD8 46000606 */ mov.s $f24, $f0
/* 7618C 800DCCDC C7BA001C */ lwc1 $f26, 0x1C($sp)
/* 76190 800DCCE0 24100001 */ addiu $s0, $zero, 0x1
/* 76194 800DCCE4 3C018011 */ lui $at, %hi(NpcHitQueryColliderID)
/* 76198 800DCCE8 AC22C978 */ sw $v0, %lo(NpcHitQueryColliderID)($at)
/* 7619C 800DCCEC 3C018011 */ lui $at, %hi(D_8010C98C)
/* 761A0 800DCCF0 AC22C98C */ sw $v0, %lo(D_8010C98C)($at)
/* 761A4 800DCCF4 4600D18D */ trunc.w.s $f6, $f26
/* 761A8 800DCCF8 E6460000 */ swc1 $f6, 0x0($s2)
.L800DCCFC:
/* 761AC 800DCCFC 3C014334 */ lui $at, (0x43340000 >> 16)
/* 761B0 800DCD00 44816000 */ mtc1 $at, $f12
/* 761B4 800DCD04 44803000 */ mtc1 $zero, $f6
/* 761B8 800DCD08 0C00A6C9 */ jal clamp_angle
/* 761BC 800DCD0C 460C3300 */ add.s $f12, $f6, $f12
/* 761C0 800DCD10 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* 761C4 800DCD14 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* 761C8 800DCD18 44811000 */ mtc1 $at, $f2
/* 761CC 800DCD1C 00000000 */ nop
/* 761D0 800DCD20 46020002 */ mul.s $f0, $f0, $f2
/* 761D4 800DCD24 00000000 */ nop
/* 761D8 800DCD28 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 761DC 800DCD2C 44811000 */ mtc1 $at, $f2
/* 761E0 800DCD30 00000000 */ nop
/* 761E4 800DCD34 46020503 */ div.s $f20, $f0, $f2
/* 761E8 800DCD38 0C00A85B */ jal sin_rad
/* 761EC 800DCD3C 4600A306 */ mov.s $f12, $f20
/* 761F0 800DCD40 46000586 */ mov.s $f22, $f0
/* 761F4 800DCD44 0C00A874 */ jal cos_rad
/* 761F8 800DCD48 4600A306 */ mov.s $f12, $f20
/* 761FC 800DCD4C 3C014120 */ lui $at, (0x41200000 >> 16)
/* 76200 800DCD50 44813000 */ mtc1 $at, $f6
/* 76204 800DCD54 00000000 */ nop
/* 76208 800DCD58 46163102 */ mul.s $f4, $f6, $f22
/* 7620C 800DCD5C 00000000 */ nop
/* 76210 800DCD60 46003087 */ neg.s $f2, $f6
/* 76214 800DCD64 46001002 */ mul.s $f0, $f2, $f0
/* 76218 800DCD68 00000000 */ nop
/* 7621C 800DCD6C 0260202D */ daddu $a0, $s3, $zero
/* 76220 800DCD70 27A50018 */ addiu $a1, $sp, 0x18
/* 76224 800DCD74 C7A60028 */ lwc1 $f6, 0x28($sp)
/* 76228 800DCD78 27A6001C */ addiu $a2, $sp, 0x1C
/* 7622C 800DCD7C 46043080 */ add.s $f2, $f6, $f4
/* 76230 800DCD80 C7A6002C */ lwc1 $f6, 0x2C($sp)
/* 76234 800DCD84 27A70020 */ addiu $a3, $sp, 0x20
/* 76238 800DCD88 46003000 */ add.s $f0, $f6, $f0
/* 7623C 800DCD8C C7A60030 */ lwc1 $f6, 0x30($sp)
/* 76240 800DCD90 27A20024 */ addiu $v0, $sp, 0x24
/* 76244 800DCD94 E7BE001C */ swc1 $f30, 0x1C($sp)
/* 76248 800DCD98 E7A60024 */ swc1 $f6, 0x24($sp)
/* 7624C 800DCD9C E7A20018 */ swc1 $f2, 0x18($sp)
/* 76250 800DCDA0 E7A00020 */ swc1 $f0, 0x20($sp)
/* 76254 800DCDA4 0C037140 */ jal npc_raycast_down
/* 76258 800DCDA8 AFA20010 */ sw $v0, 0x10($sp)
/* 7625C 800DCDAC 04400010 */ bltz $v0, .L800DCDF0
/* 76260 800DCDB0 00000000 */ nop
/* 76264 800DCDB4 C7A00024 */ lwc1 $f0, 0x24($sp)
/* 76268 800DCDB8 4618003E */ c.le.s $f0, $f24
/* 7626C 800DCDBC 00000000 */ nop
/* 76270 800DCDC0 4500000B */ bc1f .L800DCDF0
/* 76274 800DCDC4 00000000 */ nop
/* 76278 800DCDC8 46000606 */ mov.s $f24, $f0
/* 7627C 800DCDCC C7BC001C */ lwc1 $f28, 0x1C($sp)
/* 76280 800DCDD0 24100001 */ addiu $s0, $zero, 0x1
/* 76284 800DCDD4 3C018011 */ lui $at, %hi(NpcHitQueryColliderID)
/* 76288 800DCDD8 AC22C978 */ sw $v0, %lo(NpcHitQueryColliderID)($at)
/* 7628C 800DCDDC 3C018011 */ lui $at, %hi(D_8010C968)
/* 76290 800DCDE0 AC22C968 */ sw $v0, %lo(D_8010C968)($at)
/* 76294 800DCDE4 4600E18D */ trunc.w.s $f6, $f28
/* 76298 800DCDE8 3C018011 */ lui $at, %hi(D_8010C94C)
/* 7629C 800DCDEC E426C94C */ swc1 $f6, %lo(D_8010C94C)($at)
.L800DCDF0:
/* 762A0 800DCDF0 12000011 */ beqz $s0, .L800DCE38
/* 762A4 800DCDF4 0000102D */ daddu $v0, $zero, $zero
/* 762A8 800DCDF8 461CD03C */ c.lt.s $f26, $f28
/* 762AC 800DCDFC 00000000 */ nop
/* 762B0 800DCE00 45020002 */ bc1fl .L800DCE0C
/* 762B4 800DCE04 E63A0000 */ swc1 $f26, 0x0($s1)
/* 762B8 800DCE08 E63C0000 */ swc1 $f28, 0x0($s1)
.L800DCE0C:
/* 762BC 800DCE0C C6200000 */ lwc1 $f0, 0x0($s1)
/* 762C0 800DCE10 3C01C6FF */ lui $at, (0xC6FFFE00 >> 16)
/* 762C4 800DCE14 3421FE00 */ ori $at, $at, (0xC6FFFE00 & 0xFFFF)
/* 762C8 800DCE18 44813000 */ mtc1 $at, $f6
/* 762CC 800DCE1C 00000000 */ nop
/* 762D0 800DCE20 4606003C */ c.lt.s $f0, $f6
/* 762D4 800DCE24 00000000 */ nop
/* 762D8 800DCE28 45030001 */ bc1tl .L800DCE30
/* 762DC 800DCE2C E6260000 */ swc1 $f6, 0x0($s1)
.L800DCE30:
/* 762E0 800DCE30 E6980000 */ swc1 $f24, 0x0($s4)
/* 762E4 800DCE34 24020001 */ addiu $v0, $zero, 0x1
.L800DCE38:
/* 762E8 800DCE38 8FBF004C */ lw $ra, 0x4C($sp)
/* 762EC 800DCE3C 8FB40048 */ lw $s4, 0x48($sp)
/* 762F0 800DCE40 8FB30044 */ lw $s3, 0x44($sp)
/* 762F4 800DCE44 8FB20040 */ lw $s2, 0x40($sp)
/* 762F8 800DCE48 8FB1003C */ lw $s1, 0x3C($sp)
/* 762FC 800DCE4C 8FB00038 */ lw $s0, 0x38($sp)
/* 76300 800DCE50 D7BE0078 */ ldc1 $f30, 0x78($sp)
/* 76304 800DCE54 D7BC0070 */ ldc1 $f28, 0x70($sp)
/* 76308 800DCE58 D7BA0068 */ ldc1 $f26, 0x68($sp)
/* 7630C 800DCE5C D7B80060 */ ldc1 $f24, 0x60($sp)
/* 76310 800DCE60 D7B60058 */ ldc1 $f22, 0x58($sp)
/* 76314 800DCE64 D7B40050 */ ldc1 $f20, 0x50($sp)
/* 76318 800DCE68 03E00008 */ jr $ra
/* 7631C 800DCE6C 27BD0080 */ addiu $sp, $sp, 0x80
### DECOMPILED C INSTRUCTIONS:
s32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth) {
f32 startX;
f32 startY;
f32 startZ;
f32 depth;
f32 x;
f32 y;
f32 z;
f32 originalDepth;
f32 hitYUnused;
s32 hasCollision;
f32 cosTheta;
s32 colliderID;
f32 deltaX,deltaZ;
f32 yaw;
f32 theta, sinTheta, minDepth, hitYAhead, hitYBehind, radius;
hasCollision = FALSE;
x = *posX;
y = *posY;
z = *posZ;
D_8010C970 = y;
D_8010C94C = *posY;
D_8010C974 = *posY;
hitYUnused = hitYBehind = hitYAhead = -32767.0f;
yaw = 0.0f;
minDepth = fabsf(*hitDepth);
theta = DEG_TO_RAD(clamp_angle(yaw));
sinTheta = sin_rad(theta);
cosTheta = cos_rad(theta);
radius = 10.0f;
deltaX = radius * sinTheta;
deltaZ = -radius * cosTheta;
startX = x + deltaX;
startY = y;
startZ = z + deltaZ;
originalDepth = depth = minDepth;
colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth);
if (colliderID >= 0) {
if (depth <= minDepth) {
hitYAhead = startY;
NpcHitQueryColliderID = colliderID;
D_8010C98C = colliderID;
D_8010C970 = hitYAhead;
minDepth = depth;
hasCollision = TRUE;
}
}
theta = DEG_TO_RAD(clamp_angle(yaw + 180.0f));
sinTheta = sin_rad(theta);
cosTheta = cos_rad(theta);
deltaX = radius * sinTheta;
deltaZ = -radius * cosTheta;
startX = x + deltaX;
startY = y;
startZ = z + deltaZ;
depth = originalDepth;
colliderID = npc_raycast_down(ignoreFlags, &startX, &startY, &startZ, &depth);
if (colliderID >= 0) {
if (depth <= minDepth) {
hitYBehind = startY;
NpcHitQueryColliderID = colliderID;
D_8010C968 = colliderID;
D_8010C94C = hitYBehind;
minDepth = depth;
hasCollision = TRUE;
}
}
if (hasCollision) {
*posY = MAX(hitYBehind, hitYAhead);
if (*posY < hitYUnused) {
*posY = hitYUnused;
}
*hitDepth = minDepth;
return TRUE;
}
return FALSE;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel gfx_draw_frame
/* 1F08 80026B08 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1F0C 80026B0C 3C04800A */ lui $a0, %hi(gDisplayContext)
/* 1F10 80026B10 8C84A674 */ lw $a0, %lo(gDisplayContext)($a0)
/* 1F14 80026B14 3C05800A */ lui $a1, %hi(gMainGfxPos)
/* 1F18 80026B18 24A5A66C */ addiu $a1, $a1, %lo(gMainGfxPos)
/* 1F1C 80026B1C AFB00010 */ sw $s0, 0x10($sp)
/* 1F20 80026B20 3C10800A */ lui $s0, %hi(gOverrideFlags)
/* 1F24 80026B24 2610A650 */ addiu $s0, $s0, %lo(gOverrideFlags)
/* 1F28 80026B28 AFBF0018 */ sw $ra, 0x18($sp)
/* 1F2C 80026B2C AFB10014 */ sw $s1, 0x14($sp)
/* 1F30 80026B30 3C018007 */ lui $at, %hi(gMatrixListPos)
/* 1F34 80026B34 A42041F0 */ sh $zero, %lo(gMatrixListPos)($at)
/* 1F38 80026B38 8E020000 */ lw $v0, 0x0($s0)
/* 1F3C 80026B3C 24830230 */ addiu $v1, $a0, 0x230
/* 1F40 80026B40 30420008 */ andi $v0, $v0, 0x8
/* 1F44 80026B44 10400007 */ beqz $v0, .L80026B64
/* 1F48 80026B48 ACA30000 */ sw $v1, 0x0($a1)
/* 1F4C 80026B4C 3C038007 */ lui $v1, %hi(gCurrentDisplayContextIndex)
/* 1F50 80026B50 246341F4 */ addiu $v1, $v1, %lo(gCurrentDisplayContextIndex)
/* 1F54 80026B54 8C620000 */ lw $v0, 0x0($v1)
/* 1F58 80026B58 38420001 */ xori $v0, $v0, 0x1
/* 1F5C 80026B5C 08009B72 */ j .L80026DC8
/* 1F60 80026B60 AC620000 */ sw $v0, 0x0($v1)
.L80026B64:
/* 1F64 80026B64 3C03DA38 */ lui $v1, (0xDA380003 >> 16)
/* 1F68 80026B68 34630003 */ ori $v1, $v1, (0xDA380003 & 0xFFFF)
/* 1F6C 80026B6C 24820238 */ addiu $v0, $a0, 0x238
/* 1F70 80026B70 ACA20000 */ sw $v0, 0x0($a1)
/* 1F74 80026B74 3C028007 */ lui $v0, %hi(MasterIdentityMtx)
/* 1F78 80026B78 244241A8 */ addiu $v0, $v0, %lo(MasterIdentityMtx)
/* 1F7C 80026B7C AC830230 */ sw $v1, 0x230($a0)
/* 1F80 80026B80 0C0B7698 */ jal spr_render_init
/* 1F84 80026B84 AC820234 */ sw $v0, 0x234($a0)
/* 1F88 80026B88 8E020000 */ lw $v0, 0x0($s0)
/* 1F8C 80026B8C 30420002 */ andi $v0, $v0, 0x2
/* 1F90 80026B90 14400003 */ bnez $v0, .L80026BA0
/* 1F94 80026B94 00000000 */ nop
/* 1F98 80026B98 0C00B5CF */ jal render_frame
/* 1F9C 80026B9C 0000202D */ daddu $a0, $zero, $zero
.L80026BA0:
/* 1FA0 80026BA0 0C038098 */ jal player_render_interact_prompts
/* 1FA4 80026BA4 00000000 */ nop
/* 1FA8 80026BA8 0C0B0FB9 */ jal func_802C3EE4
/* 1FAC 80026BAC 00000000 */ nop
/* 1FB0 80026BB0 0C04E088 */ jal render_screen_overlay_backUI
/* 1FB4 80026BB4 00000000 */ nop
/* 1FB8 80026BB8 0C048D54 */ jal render_workers_backUI
/* 1FBC 80026BBC 00000000 */ nop
/* 1FC0 80026BC0 0C050884 */ jal render_hud_elements_backUI
/* 1FC4 80026BC4 00000000 */ nop
/* 1FC8 80026BC8 0C0167E5 */ jal render_effects_UI
/* 1FCC 80026BCC 00000000 */ nop
/* 1FD0 80026BD0 0C044BD6 */ jal state_render_backUI
/* 1FD4 80026BD4 00000000 */ nop
/* 1FD8 80026BD8 8E020000 */ lw $v0, 0x0($s0)
/* 1FDC 80026BDC 3C030001 */ lui $v1, (0x10000 >> 16)
/* 1FE0 80026BE0 00431024 */ and $v0, $v0, $v1
/* 1FE4 80026BE4 14400003 */ bnez $v0, .L80026BF4
/* 1FE8 80026BE8 00000000 */ nop
/* 1FEC 80026BEC 0C051EB1 */ jal render_window_root
/* 1FF0 80026BF0 00000000 */ nop
.L80026BF4:
/* 1FF4 80026BF4 8E020000 */ lw $v0, 0x0($s0)
/* 1FF8 80026BF8 30420002 */ andi $v0, $v0, 0x2
/* 1FFC 80026BFC 14400009 */ bnez $v0, .L80026C24
/* 2000 80026C00 3C100010 */ lui $s0, (0x100010 >> 16)
/* 2004 80026C04 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 2008 80026C08 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 200C 80026C0C 80420078 */ lb $v0, 0x78($v0)
/* 2010 80026C10 14400004 */ bnez $v0, .L80026C24
/* 2014 80026C14 00000000 */ nop
/* 2018 80026C18 0C00B5CF */ jal render_frame
/* 201C 80026C1C 24040001 */ addiu $a0, $zero, 0x1
/* 2020 80026C20 3C100010 */ lui $s0, (0x100010 >> 16)
.L80026C24:
/* 2024 80026C24 3C11800A */ lui $s1, %hi(gOverrideFlags)
/* 2028 80026C28 2631A650 */ addiu $s1, $s1, %lo(gOverrideFlags)
/* 202C 80026C2C 8E220000 */ lw $v0, 0x0($s1)
/* 2030 80026C30 36100010 */ ori $s0, $s0, (0x100010 & 0xFFFF)
/* 2034 80026C34 00501024 */ and $v0, $v0, $s0
/* 2038 80026C38 14400003 */ bnez $v0, .L80026C48
/* 203C 80026C3C 00000000 */ nop
/* 2040 80026C40 0C049081 */ jal render_messages
/* 2044 80026C44 00000000 */ nop
.L80026C48:
/* 2048 80026C48 0C048D38 */ jal render_workers_frontUI
/* 204C 80026C4C 00000000 */ nop
/* 2050 80026C50 0C0509C7 */ jal render_hud_elements_frontUI
/* 2054 80026C54 00000000 */ nop
/* 2058 80026C58 0C04E068 */ jal render_screen_overlay_frontUI
/* 205C 80026C5C 00000000 */ nop
/* 2060 80026C60 8E220000 */ lw $v0, 0x0($s1)
/* 2064 80026C64 24030010 */ addiu $v1, $zero, 0x10
/* 2068 80026C68 00501024 */ and $v0, $v0, $s0
/* 206C 80026C6C 14430003 */ bne $v0, $v1, .L80026C7C
/* 2070 80026C70 00000000 */ nop
/* 2074 80026C74 0C049081 */ jal render_messages
/* 2078 80026C78 00000000 */ nop
.L80026C7C:
/* 207C 80026C7C 0C00AEA0 */ jal render_curtains
/* 2080 80026C80 00000000 */ nop
/* 2084 80026C84 8E220000 */ lw $v0, 0x0($s1)
/* 2088 80026C88 3C030010 */ lui $v1, (0x100000 >> 16)
/* 208C 80026C8C 00431024 */ and $v0, $v0, $v1
/* 2090 80026C90 10400003 */ beqz $v0, .L80026CA0
/* 2094 80026C94 00000000 */ nop
/* 2098 80026C98 0C049081 */ jal render_messages
/* 209C 80026C9C 00000000 */ nop
.L80026CA0:
/* 20A0 80026CA0 8E220000 */ lw $v0, 0x0($s1)
/* 20A4 80026CA4 3C030001 */ lui $v1, (0x10000 >> 16)
/* 20A8 80026CA8 00431024 */ and $v0, $v0, $v1
/* 20AC 80026CAC 10400003 */ beqz $v0, .L80026CBC
/* 20B0 80026CB0 00000000 */ nop
/* 20B4 80026CB4 0C051EB1 */ jal render_window_root
/* 20B8 80026CB8 00000000 */ nop
.L80026CBC:
/* 20BC 80026CBC 0C044BF1 */ jal state_render_frontUI
/* 20C0 80026CC0 00000000 */ nop
/* 20C4 80026CC4 8E220000 */ lw $v0, 0x0($s1)
/* 20C8 80026CC8 30420020 */ andi $v0, $v0, 0x20
/* 20CC 80026CCC 10400010 */ beqz $v0, .L80026D10
/* 20D0 80026CD0 00000000 */ nop
/* 20D4 80026CD4 3C038007 */ lui $v1, %hi(D_800741A2)
/* 20D8 80026CD8 846341A2 */ lh $v1, %lo(D_800741A2)($v1)
/* 20DC 80026CDC 28620002 */ slti $v0, $v1, 0x2
/* 20E0 80026CE0 1040000B */ beqz $v0, .L80026D10
/* 20E4 80026CE4 00000000 */ nop
/* 20E8 80026CE8 04600009 */ bltz $v1, .L80026D10
/* 20EC 80026CEC 24040007 */ addiu $a0, $zero, 0x7
/* 20F0 80026CF0 3C028007 */ lui $v0, %hi(D_800741A0)
/* 20F4 80026CF4 844241A0 */ lh $v0, %lo(D_800741A0)($v0)
/* 20F8 80026CF8 44820000 */ mtc1 $v0, $f0
/* 20FC 80026CFC 00000000 */ nop
/* 2100 80026D00 46800020 */ cvt.s.w $f0, $f0
/* 2104 80026D04 44050000 */ mfc1 $a1, $f0
/* 2108 80026D08 0C04DAA0 */ jal _render_transition_stencil
/* 210C 80026D0C 0000302D */ daddu $a2, $zero, $zero
.L80026D10:
/* 2110 80026D10 3C02800A */ lui $v0, %hi(gMainGfxPos)
/* 2114 80026D14 8C42A66C */ lw $v0, %lo(gMainGfxPos)($v0)
/* 2118 80026D18 3C03800A */ lui $v1, %hi(gDisplayContext)
/* 211C 80026D1C 8C63A674 */ lw $v1, %lo(gDisplayContext)($v1)
/* 2120 80026D20 2442FDD0 */ addiu $v0, $v0, -0x230
/* 2124 80026D24 00431023 */ subu $v0, $v0, $v1
/* 2128 80026D28 000210C2 */ srl $v0, $v0, 3
/* 212C 80026D2C 28422080 */ slti $v0, $v0, 0x2080
/* 2130 80026D30 54400003 */ bnel $v0, $zero, .L80026D40
/* 2134 80026D34 0000302D */ daddu $a2, $zero, $zero
.L80026D38:
/* 2138 80026D38 08009B4E */ j .L80026D38
/* 213C 80026D3C 00000000 */ nop
.L80026D40:
/* 2140 80026D40 3C070004 */ lui $a3, (0x40001 >> 16)
/* 2144 80026D44 3C08800A */ lui $t0, %hi(gMainGfxPos)
/* 2148 80026D48 2508A66C */ addiu $t0, $t0, %lo(gMainGfxPos)
/* 214C 80026D4C 34E70001 */ ori $a3, $a3, (0x40001 & 0xFFFF)
/* 2150 80026D50 8D030000 */ lw $v1, 0x0($t0)
/* 2154 80026D54 3C02800A */ lui $v0, %hi(gDisplayContext)
/* 2158 80026D58 8C42A674 */ lw $v0, %lo(gDisplayContext)($v0)
/* 215C 80026D5C 0060482D */ daddu $t1, $v1, $zero
/* 2160 80026D60 24630008 */ addiu $v1, $v1, 0x8
/* 2164 80026D64 24440230 */ addiu $a0, $v0, 0x230
/* 2168 80026D68 2465FDD8 */ addiu $a1, $v1, -0x228
/* 216C 80026D6C 00A22823 */ subu $a1, $a1, $v0
/* 2170 80026D70 000528C3 */ sra $a1, $a1, 3
/* 2174 80026D74 000528C0 */ sll $a1, $a1, 3
/* 2178 80026D78 3C02E900 */ lui $v0, (0xE9000000 >> 16)
/* 217C 80026D7C AD030000 */ sw $v1, 0x0($t0)
/* 2180 80026D80 AD220000 */ sw $v0, 0x0($t1)
/* 2184 80026D84 24620008 */ addiu $v0, $v1, 0x8
/* 2188 80026D88 AD200004 */ sw $zero, 0x4($t1)
/* 218C 80026D8C AD020000 */ sw $v0, 0x0($t0)
/* 2190 80026D90 3C02DF00 */ lui $v0, (0xDF000000 >> 16)
/* 2194 80026D94 AC620000 */ sw $v0, 0x0($v1)
/* 2198 80026D98 0C00B331 */ jal nuGfxTaskStart
/* 219C 80026D9C AC600004 */ sw $zero, 0x4($v1)
/* 21A0 80026DA0 24050140 */ addiu $a1, $zero, 0x140
/* 21A4 80026DA4 240600F0 */ addiu $a2, $zero, 0xF0
/* 21A8 80026DA8 3C038007 */ lui $v1, %hi(gCurrentDisplayContextIndex)
/* 21AC 80026DAC 246341F4 */ addiu $v1, $v1, %lo(gCurrentDisplayContextIndex)
/* 21B0 80026DB0 8C620000 */ lw $v0, 0x0($v1)
/* 21B4 80026DB4 3C04800A */ lui $a0, %hi(nuGfxCfb_ptr)
/* 21B8 80026DB8 8C84A64C */ lw $a0, %lo(nuGfxCfb_ptr)($a0)
/* 21BC 80026DBC 38420001 */ xori $v0, $v0, 0x1
/* 21C0 80026DC0 0C00B224 */ jal crash_screen_set_draw_info
/* 21C4 80026DC4 AC620000 */ sw $v0, 0x0($v1)
.L80026DC8:
/* 21C8 80026DC8 8FBF0018 */ lw $ra, 0x18($sp)
/* 21CC 80026DCC 8FB10014 */ lw $s1, 0x14($sp)
/* 21D0 80026DD0 8FB00010 */ lw $s0, 0x10($sp)
/* 21D4 80026DD4 03E00008 */ jr $ra
/* 21D8 80026DD8 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void gfx_draw_frame(void) {
gMatrixListPos = 0;
gMainGfxPos = &gDisplayContext->mainGfx[0];
if (gOverrideFlags & GLOBAL_OVERRIDES_8) {
gCurrentDisplayContextIndex = gCurrentDisplayContextIndex ^ 1;
return;
}
gSPMatrix(gMainGfxPos++, &MasterIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
spr_render_init();
if (!(gOverrideFlags & GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD)) {
render_frame(FALSE);
}
player_render_interact_prompts();
func_802C3EE4();
render_screen_overlay_backUI();
render_workers_backUI();
render_hud_elements_backUI();
render_effects_UI();
state_render_backUI();
if (!(gOverrideFlags & GLOBAL_OVERRIDES_WINDOWS_IN_FRONT_OF_CURTAINS)) {
render_window_root();
}
if (!(gOverrideFlags & GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD) && !gGameStatusPtr->disableScripts) {
render_frame(TRUE);
}
if (!(gOverrideFlags & (GLOBAL_OVERRIDES_MESSAGES_IN_FRONT_OF_CURTAINS | GLOBAL_OVERRIDES_10))) {
render_messages();
}
render_workers_frontUI();
render_hud_elements_frontUI();
render_screen_overlay_frontUI();
if ((gOverrideFlags & (GLOBAL_OVERRIDES_MESSAGES_IN_FRONT_OF_CURTAINS | GLOBAL_OVERRIDES_10)) == GLOBAL_OVERRIDES_10) {
render_messages();
}
render_curtains();
if (gOverrideFlags & GLOBAL_OVERRIDES_MESSAGES_IN_FRONT_OF_CURTAINS) {
render_messages();
}
if (gOverrideFlags & GLOBAL_OVERRIDES_WINDOWS_IN_FRONT_OF_CURTAINS) {
render_window_root();
}
state_render_frontUI();
if (gOverrideFlags & GLOBAL_OVERRIDES_ENABLE_TRANSITION_STENCIL) {
switch (D_800741A2) {
case 0:
case 1:
_render_transition_stencil(7, D_800741A0, NULL);
break;
}
}
ASSERT((s32)(((u32)(gMainGfxPos - gDisplayContext->mainGfx) << 3) >> 3) < ARRAY_COUNT(gDisplayContext->mainGfx));
gDPFullSync(gMainGfxPos++);
gSPEndDisplayList(gMainGfxPos++);
nuGfxTaskStart(gDisplayContext->mainGfx, (u32)(gMainGfxPos - gDisplayContext->mainGfx) * 8, NU_GFX_UCODE_F3DEX2,
NU_SC_TASK_LODABLE | NU_SC_SWAPBUFFER);
gCurrentDisplayContextIndex = gCurrentDisplayContextIndex ^ 1;
crash_screen_set_draw_info(nuGfxCfb_ptr, SCREEN_WIDTH, SCREEN_HEIGHT);
}
|