text
stringlengths 6.38k
228k
|
---|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_model_animator_with_transform
/* B5154 8011EA54 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* B5158 8011EA58 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* B515C 8011EA5C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* B5160 8011EA60 AFBF001C */ sw $ra, 0x1C($sp)
/* B5164 8011EA64 AFB20018 */ sw $s2, 0x18($sp)
/* B5168 8011EA68 AFB10014 */ sw $s1, 0x14($sp)
/* B516C 8011EA6C AFB00010 */ sw $s0, 0x10($sp)
/* B5170 8011EA70 80420070 */ lb $v0, 0x70($v0)
/* B5174 8011EA74 10400004 */ beqz $v0, .L8011EA88
/* B5178 8011EA78 00A0882D */ daddu $s1, $a1, $zero
/* B517C 8011EA7C 30820800 */ andi $v0, $a0, 0x800
/* B5180 8011EA80 10400055 */ beqz $v0, .L8011EBD8
/* B5184 8011EA84 00000000 */ nop
.L8011EA88:
/* B5188 8011EA88 2402F7FF */ addiu $v0, $zero, -0x801
/* B518C 8011EA8C 00822024 */ and $a0, $a0, $v0
/* B5190 8011EA90 3C038015 */ lui $v1, %hi(gCurrentAnimMeshListPtr)
/* B5194 8011EA94 8C633A40 */ lw $v1, %lo(gCurrentAnimMeshListPtr)($v1)
/* B5198 8011EA98 00041080 */ sll $v0, $a0, 2
/* B519C 8011EA9C 00431021 */ addu $v0, $v0, $v1
/* B51A0 8011EAA0 8C500000 */ lw $s0, 0x0($v0)
/* B51A4 8011EAA4 1200004C */ beqz $s0, .L8011EBD8
/* B51A8 8011EAA8 00000000 */ nop
/* B51AC 8011EAAC 8E040000 */ lw $a0, 0x0($s0)
/* B51B0 8011EAB0 10800049 */ beqz $a0, .L8011EBD8
/* B51B4 8011EAB4 3C020004 */ lui $v0, (0x40000 >> 16)
/* B51B8 8011EAB8 00821024 */ and $v0, $a0, $v0
/* B51BC 8011EABC 14400046 */ bnez $v0, .L8011EBD8
/* B51C0 8011EAC0 0000182D */ daddu $v1, $zero, $zero
/* B51C4 8011EAC4 C6000090 */ lwc1 $f0, 0x90($s0)
/* B51C8 8011EAC8 C6020094 */ lwc1 $f2, 0x94($s0)
/* B51CC 8011EACC 2402FFBF */ addiu $v0, $zero, -0x41
/* B51D0 8011EAD0 46020001 */ sub.s $f0, $f0, $f2
/* B51D4 8011EAD4 44801000 */ mtc1 $zero, $f2
/* B51D8 8011EAD8 00821024 */ and $v0, $a0, $v0
/* B51DC 8011EADC AE020000 */ sw $v0, 0x0($s0)
/* B51E0 8011EAE0 4602003E */ c.le.s $f0, $f2
/* B51E4 8011EAE4 00000000 */ nop
/* B51E8 8011EAE8 45000014 */ bc1f .L8011EB3C
/* B51EC 8011EAEC E6000090 */ swc1 $f0, 0x90($s0)
/* B51F0 8011EAF0 30428000 */ andi $v0, $v0, 0x8000
/* B51F4 8011EAF4 14400008 */ bnez $v0, .L8011EB18
/* B51F8 8011EAF8 0200202D */ daddu $a0, $s0, $zero
.L8011EAFC:
/* B51FC 8011EAFC 0C047AFC */ jal step_model_animator
/* B5200 8011EB00 0200202D */ daddu $a0, $s0, $zero
/* B5204 8011EB04 0040182D */ daddu $v1, $v0, $zero
/* B5208 8011EB08 1C60FFFC */ bgtz $v1, .L8011EAFC
/* B520C 8011EB0C 2402FFFF */ addiu $v0, $zero, -0x1
/* B5210 8011EB10 08047AD0 */ j .L8011EB40
/* B5214 8011EB14 00000000 */ nop
.L8011EB18:
/* B5218 8011EB18 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* B521C 8011EB1C 44810000 */ mtc1 $at, $f0
/* B5220 8011EB20 0C04819E */ jal reload_mesh_animator_tree
/* B5224 8011EB24 E6000090 */ swc1 $f0, 0x90($s0)
.L8011EB28:
/* B5228 8011EB28 0C0481BE */ jal step_mesh_animator
/* B522C 8011EB2C 0200202D */ daddu $a0, $s0, $zero
/* B5230 8011EB30 0040182D */ daddu $v1, $v0, $zero
/* B5234 8011EB34 1C60FFFC */ bgtz $v1, .L8011EB28
/* B5238 8011EB38 00000000 */ nop
.L8011EB3C:
/* B523C 8011EB3C 2402FFFF */ addiu $v0, $zero, -0x1
.L8011EB40:
/* B5240 8011EB40 10620025 */ beq $v1, $v0, .L8011EBD8
/* B5244 8011EB44 0200202D */ daddu $a0, $s0, $zero
/* B5248 8011EB48 0C047C16 */ jal animator_update_model_transforms
/* B524C 8011EB4C 0220282D */ daddu $a1, $s1, $zero
/* B5250 8011EB50 0000882D */ daddu $s1, $zero, $zero
/* B5254 8011EB54 2412FFFF */ addiu $s2, $zero, -0x1
/* B5258 8011EB58 3C108015 */ lui $s0, %hi(D_801533C0)
/* B525C 8011EB5C 261033C0 */ addiu $s0, $s0, %lo(D_801533C0)
.L8011EB60:
/* B5260 8011EB60 8E020000 */ lw $v0, 0x0($s0)
/* B5264 8011EB64 04420008 */ bltzl $v0, .L8011EB88
/* B5268 8011EB68 26310001 */ addiu $s1, $s1, 0x1
/* B526C 8011EB6C 2442FFFF */ addiu $v0, $v0, -0x1
/* B5270 8011EB70 14400004 */ bnez $v0, .L8011EB84
/* B5274 8011EB74 AE020000 */ sw $v0, 0x0($s0)
/* B5278 8011EB78 8E040004 */ lw $a0, 0x4($s0)
/* B527C 8011EB7C 0C00AB1E */ jal general_heap_free
/* B5280 8011EB80 AE120000 */ sw $s2, 0x0($s0)
.L8011EB84:
/* B5284 8011EB84 26310001 */ addiu $s1, $s1, 0x1
.L8011EB88:
/* B5288 8011EB88 2A220060 */ slti $v0, $s1, 0x60
/* B528C 8011EB8C 1440FFF4 */ bnez $v0, .L8011EB60
/* B5290 8011EB90 26100008 */ addiu $s0, $s0, 0x8
/* B5294 8011EB94 0000882D */ daddu $s1, $zero, $zero
/* B5298 8011EB98 2412FFFF */ addiu $s2, $zero, -0x1
/* B529C 8011EB9C 3C108015 */ lui $s0, %hi(D_801536C0)
/* B52A0 8011EBA0 261036C0 */ addiu $s0, $s0, %lo(D_801536C0)
.L8011EBA4:
/* B52A4 8011EBA4 8E020000 */ lw $v0, 0x0($s0)
/* B52A8 8011EBA8 04420008 */ bltzl $v0, .L8011EBCC
/* B52AC 8011EBAC 26310001 */ addiu $s1, $s1, 0x1
/* B52B0 8011EBB0 2442FFFF */ addiu $v0, $v0, -0x1
/* B52B4 8011EBB4 14400004 */ bnez $v0, .L8011EBC8
/* B52B8 8011EBB8 AE020000 */ sw $v0, 0x0($s0)
/* B52BC 8011EBBC 8E040004 */ lw $a0, 0x4($s0)
/* B52C0 8011EBC0 0C00AB1E */ jal general_heap_free
/* B52C4 8011EBC4 AE120000 */ sw $s2, 0x0($s0)
.L8011EBC8:
/* B52C8 8011EBC8 26310001 */ addiu $s1, $s1, 0x1
.L8011EBCC:
/* B52CC 8011EBCC 2A220060 */ slti $v0, $s1, 0x60
/* B52D0 8011EBD0 1440FFF4 */ bnez $v0, .L8011EBA4
/* B52D4 8011EBD4 26100008 */ addiu $s0, $s0, 0x8
.L8011EBD8:
/* B52D8 8011EBD8 8FBF001C */ lw $ra, 0x1C($sp)
/* B52DC 8011EBDC 8FB20018 */ lw $s2, 0x18($sp)
/* B52E0 8011EBE0 8FB10014 */ lw $s1, 0x14($sp)
/* B52E4 8011EBE4 8FB00010 */ lw $s0, 0x10($sp)
/* B52E8 8011EBE8 03E00008 */ jr $ra
/* B52EC 8011EBEC 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void update_model_animator_with_transform(s32 animatorID, Mtx* mtx) {
if (!gGameStatusPtr->isBattle || animatorID & 0x800) {
ModelAnimator* animator;
animatorID &= ~0x800;
animator = (*gCurrentAnimMeshListPtr)[animatorID];
if (animator != NULL && animator->flags != 0) {
s32 temp = 0;
if (!(animator->flags & MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION)) {
animator->flags &= ~MODEL_ANIMATOR_FLAG_UPDATE_PENDING;
animator->nextUpdateTime -= animator->timeScale;
if (animator->nextUpdateTime <= 0.0f) {
if (!(animator->flags & MODEL_ANIMATOR_FLAG_MESH)) {
do {
temp = step_model_animator(animator);
} while (temp > 0);
} else {
animator->nextUpdateTime = 1.0f;
reload_mesh_animator_tree(animator);
do {
temp = step_mesh_animator(animator);
} while (temp > 0);
}
}
if (temp != -1) {
s32 i;
animator_update_model_transforms(animator, mtx);
for (i = 0; i < ARRAY_COUNT(D_801533C0); i++) {
if (D_801533C0[i].ttl >= 0) {
D_801533C0[i].ttl--;
if (D_801533C0[i].ttl == 0) {
D_801533C0[i].ttl = -1;
general_heap_free(D_801533C0[i].addr);
}
}
}
for (i = 0; i < ARRAY_COUNT(D_801536C0); i++) {
if (D_801536C0[i].ttl >= 0) {
D_801536C0[i].ttl--;
if (D_801536C0[i].ttl == 0) {
D_801536C0[i].ttl = -1;
general_heap_free(D_801536C0[i].addr);
}
}
}
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8025CD40
/* 18B620 8025CD40 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 18B624 8025CD44 AFB10014 */ sw $s1, 0x14($sp)
/* 18B628 8025CD48 00A0882D */ daddu $s1, $a1, $zero
/* 18B62C 8025CD4C AFBF0020 */ sw $ra, 0x20($sp)
/* 18B630 8025CD50 AFB3001C */ sw $s3, 0x1C($sp)
/* 18B634 8025CD54 AFB20018 */ sw $s2, 0x18($sp)
/* 18B638 8025CD58 AFB00010 */ sw $s0, 0x10($sp)
/* 18B63C 8025CD5C 8E3000C0 */ lw $s0, 0xC0($s1)
/* 18B640 8025CD60 82020765 */ lb $v0, 0x765($s0)
/* 18B644 8025CD64 10400017 */ beqz $v0, .L8025CDC4
/* 18B648 8025CD68 00E0982D */ daddu $s3, $a3, $zero
/* 18B64C 8025CD6C 0C095094 */ jal func_80254250
/* 18B650 8025CD70 0220202D */ daddu $a0, $s1, $zero
/* 18B654 8025CD74 0040182D */ daddu $v1, $v0, $zero
/* 18B658 8025CD78 24040001 */ addiu $a0, $zero, 0x1
/* 18B65C 8025CD7C 10640008 */ beq $v1, $a0, .L8025CDA0
/* 18B660 8025CD80 28620002 */ slti $v0, $v1, 0x2
/* 18B664 8025CD84 1040000A */ beqz $v0, .L8025CDB0
/* 18B668 8025CD88 2402000E */ addiu $v0, $zero, 0xE
/* 18B66C 8025CD8C 54600009 */ bnel $v1, $zero, .L8025CDB4
/* 18B670 8025CD90 A2020767 */ sb $v0, 0x767($s0)
/* 18B674 8025CD94 A2040767 */ sb $a0, 0x767($s0)
/* 18B678 8025CD98 0809736F */ j .L8025CDBC
/* 18B67C 8025CD9C A2000766 */ sb $zero, 0x766($s0)
.L8025CDA0:
/* 18B680 8025CDA0 24020008 */ addiu $v0, $zero, 0x8
/* 18B684 8025CDA4 A2020767 */ sb $v0, 0x767($s0)
/* 18B688 8025CDA8 0809736F */ j .L8025CDBC
/* 18B68C 8025CDAC A2030766 */ sb $v1, 0x766($s0)
.L8025CDB0:
/* 18B690 8025CDB0 A2020767 */ sb $v0, 0x767($s0)
.L8025CDB4:
/* 18B694 8025CDB4 24020002 */ addiu $v0, $zero, 0x2
/* 18B698 8025CDB8 A2020766 */ sb $v0, 0x766($s0)
.L8025CDBC:
/* 18B69C 8025CDBC A2000768 */ sb $zero, 0x768($s0)
/* 18B6A0 8025CDC0 A2000765 */ sb $zero, 0x765($s0)
.L8025CDC4:
/* 18B6A4 8025CDC4 82020766 */ lb $v0, 0x766($s0)
/* 18B6A8 8025CDC8 24120003 */ addiu $s2, $zero, 0x3
/* 18B6AC 8025CDCC 14520004 */ bne $v0, $s2, .L8025CDE0
/* 18B6B0 8025CDD0 00000000 */ nop
/* 18B6B4 8025CDD4 A2000768 */ sb $zero, 0x768($s0)
/* 18B6B8 8025CDD8 0C099C27 */ jal func_8026709C
/* 18B6BC 8025CDDC 0220202D */ daddu $a0, $s1, $zero
.L8025CDE0:
/* 18B6C0 8025CDE0 82030766 */ lb $v1, 0x766($s0)
/* 18B6C4 8025CDE4 24020001 */ addiu $v0, $zero, 0x1
/* 18B6C8 8025CDE8 10620012 */ beq $v1, $v0, .L8025CE34
/* 18B6CC 8025CDEC 28620002 */ slti $v0, $v1, 0x2
/* 18B6D0 8025CDF0 50400005 */ beql $v0, $zero, .L8025CE08
/* 18B6D4 8025CDF4 24020002 */ addiu $v0, $zero, 0x2
/* 18B6D8 8025CDF8 10600007 */ beqz $v1, .L8025CE18
/* 18B6DC 8025CDFC 00000000 */ nop
/* 18B6E0 8025CE00 080973AB */ j .L8025CEAC
/* 18B6E4 8025CE04 00000000 */ nop
.L8025CE08:
/* 18B6E8 8025CE08 10620013 */ beq $v1, $v0, .L8025CE58
/* 18B6EC 8025CE0C 00000000 */ nop
/* 18B6F0 8025CE10 080973AB */ j .L8025CEAC
/* 18B6F4 8025CE14 00000000 */ nop
.L8025CE18:
/* 18B6F8 8025CE18 82020767 */ lb $v0, 0x767($s0)
/* 18B6FC 8025CE1C 5440001E */ bnel $v0, $zero, .L8025CE98
/* 18B700 8025CE20 A2000768 */ sb $zero, 0x768($s0)
/* 18B704 8025CE24 240200FF */ addiu $v0, $zero, 0xFF
/* 18B708 8025CE28 A2020768 */ sb $v0, 0x768($s0)
/* 18B70C 8025CE2C 080973AB */ j .L8025CEAC
/* 18B710 8025CE30 A2120766 */ sb $s2, 0x766($s0)
.L8025CE34:
/* 18B714 8025CE34 82030767 */ lb $v1, 0x767($s0)
/* 18B718 8025CE38 2C620009 */ sltiu $v0, $v1, 0x9
/* 18B71C 8025CE3C 10400016 */ beqz $v0, .L8025CE98
/* 18B720 8025CE40 00031080 */ sll $v0, $v1, 2
/* 18B724 8025CE44 3C01802A */ lui $at, %hi(jtbl_8029D420)
/* 18B728 8025CE48 00220821 */ addu $at, $at, $v0
/* 18B72C 8025CE4C 8C22D420 */ lw $v0, %lo(jtbl_8029D420)($at)
/* 18B730 8025CE50 00400008 */ jr $v0
/* 18B734 8025CE54 00000000 */ nop
.L8025CE58:
/* 18B738 8025CE58 82030767 */ lb $v1, 0x767($s0)
/* 18B73C 8025CE5C 2C62000F */ sltiu $v0, $v1, 0xF
/* 18B740 8025CE60 1040000D */ beqz $v0, .L8025CE98
/* 18B744 8025CE64 00031080 */ sll $v0, $v1, 2
/* 18B748 8025CE68 3C01802A */ lui $at, %hi(jtbl_8029D448)
/* 18B74C 8025CE6C 00220821 */ addu $at, $at, $v0
/* 18B750 8025CE70 8C22D448 */ lw $v0, %lo(jtbl_8029D448)($at)
/* 18B754 8025CE74 00400008 */ jr $v0
/* 18B758 8025CE78 00000000 */ nop
glabel .L8025CE7C
/* 18B75C 8025CE7C 080973A6 */ j .L8025CE98
/* 18B760 8025CE80 A2000768 */ sb $zero, 0x768($s0)
glabel .L8025CE84
/* 18B764 8025CE84 240200FF */ addiu $v0, $zero, 0xFF
/* 18B768 8025CE88 080973A6 */ j .L8025CE98
/* 18B76C 8025CE8C A2020768 */ sb $v0, 0x768($s0)
glabel .L8025CE90
/* 18B770 8025CE90 24020003 */ addiu $v0, $zero, 0x3
/* 18B774 8025CE94 A2020766 */ sb $v0, 0x766($s0)
.L8025CE98:
/* 18B778 8025CE98 16600004 */ bnez $s3, .L8025CEAC
/* 18B77C 8025CE9C 00000000 */ nop
/* 18B780 8025CEA0 92020767 */ lbu $v0, 0x767($s0)
/* 18B784 8025CEA4 2442FFFF */ addiu $v0, $v0, -0x1
/* 18B788 8025CEA8 A2020767 */ sb $v0, 0x767($s0)
.L8025CEAC:
/* 18B78C 8025CEAC 8FBF0020 */ lw $ra, 0x20($sp)
/* 18B790 8025CEB0 8FB3001C */ lw $s3, 0x1C($sp)
/* 18B794 8025CEB4 8FB20018 */ lw $s2, 0x18($sp)
/* 18B798 8025CEB8 8FB10014 */ lw $s1, 0x14($sp)
/* 18B79C 8025CEBC 8FB00010 */ lw $s0, 0x10($sp)
/* 18B7A0 8025CEC0 03E00008 */ jr $ra
/* 18B7A4 8025CEC4 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void func_8025CD40(s32 arg0, ActorPart* part, s32 yaw, s32 arg3) {
DecorationTable* decor = part->decorationTable;
if (decor->unk_765 != 0) {
switch (func_80254250(part)) {
case 0:
decor->unk_767 = 1;
decor->unk_766 = 0;
break;
case 1:
decor->unk_767 = 8;
decor->unk_766 = 1;
break;
case 2:
default:
decor->unk_767 = 0xE;
decor->unk_766 = 2;
break;
}
decor->unk_768 = 0;
decor->unk_765 = 0;
}
if (decor->unk_766 == 3) {
decor->unk_768 = 0;
func_8026709C(part);
}
switch (decor->unk_766) {
case 0:
switch (decor->unk_767) {
case 0:
decor->unk_768 = -1;
decor->unk_766 = 3;
break;
default:
decor->unk_768 = 0;
if (arg3 == 0) {
decor->unk_767--;
}
break;
}
break;
case 1:
switch (decor->unk_767) {
case 1:
case 2:
case 5:
case 6:
decor->unk_768 = -1;
break;
case 3:
case 4:
case 7:
case 8:
decor->unk_768 = 0;
break;
case 0:
decor->unk_766 = 3;
break;
}
if (arg3 == 0) {
decor->unk_767--;
}
break;
case 2:
switch (decor->unk_767) {
case 1:
case 2:
case 5:
case 6:
case 9:
case 10:
case 13:
case 14:
decor->unk_768 = 0;
break;
case 3:
case 4:
case 7:
case 8:
case 11:
case 12:
decor->unk_768 = -1;
break;
case 0:
decor->unk_766 = 3;
break;
}
if (arg3 == 0) {
decor->unk_767--;
}
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel spr_load_npc_sprite
/* 1011DC 802DE0EC 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 1011E0 802DE0F0 AFB50024 */ sw $s5, 0x24($sp)
/* 1011E4 802DE0F4 00A0A82D */ daddu $s5, $a1, $zero
/* 1011E8 802DE0F8 00041403 */ sra $v0, $a0, 16
/* 1011EC 802DE0FC AFB40020 */ sw $s4, 0x20($sp)
/* 1011F0 802DE100 30547FFF */ andi $s4, $v0, 0x7FFF
/* 1011F4 802DE104 000437C2 */ srl $a2, $a0, 31
/* 1011F8 802DE108 0000202D */ daddu $a0, $zero, $zero
/* 1011FC 802DE10C AFB3001C */ sw $s3, 0x1C($sp)
/* 101200 802DE110 3C13802E */ lui $s3, %hi(SpriteInstances)
/* 101204 802DE114 2673FA48 */ addiu $s3, $s3, %lo(SpriteInstances)
/* 101208 802DE118 0260182D */ daddu $v1, $s3, $zero
/* 10120C 802DE11C AFBF0028 */ sw $ra, 0x28($sp)
/* 101210 802DE120 AFB20018 */ sw $s2, 0x18($sp)
/* 101214 802DE124 AFB10014 */ sw $s1, 0x14($sp)
/* 101218 802DE128 AFB00010 */ sw $s0, 0x10($sp)
.L802DE12C:
/* 10121C 802DE12C 8C620000 */ lw $v0, 0x0($v1)
/* 101220 802DE130 10400005 */ beqz $v0, .L802DE148
/* 101224 802DE134 00000000 */ nop
/* 101228 802DE138 24840001 */ addiu $a0, $a0, 0x1
/* 10122C 802DE13C 28820033 */ slti $v0, $a0, 0x33
/* 101230 802DE140 1440FFFA */ bnez $v0, .L802DE12C
/* 101234 802DE144 24630014 */ addiu $v1, $v1, 0x14
.L802DE148:
/* 101238 802DE148 3C03802E */ lui $v1, %hi(MaxLoadedSpriteInstanceID)
/* 10123C 802DE14C 2463F530 */ addiu $v1, $v1, %lo(MaxLoadedSpriteInstanceID)
/* 101240 802DE150 8C620000 */ lw $v0, 0x0($v1)
/* 101244 802DE154 0044102A */ slt $v0, $v0, $a0
/* 101248 802DE158 54400001 */ bnel $v0, $zero, .L802DE160
/* 10124C 802DE15C AC640000 */ sw $a0, 0x0($v1)
.L802DE160:
/* 101250 802DE160 24020033 */ addiu $v0, $zero, 0x33
/* 101254 802DE164 14820003 */ bne $a0, $v0, .L802DE174
/* 101258 802DE168 00141880 */ sll $v1, $s4, 2
/* 10125C 802DE16C 080B78A2 */ j .L802DE288
/* 101260 802DE170 2402FFFF */ addiu $v0, $zero, -0x1
.L802DE174:
/* 101264 802DE174 3C02802E */ lui $v0, %hi(NpcSpriteData)
/* 101268 802DE178 2442F5B0 */ addiu $v0, $v0, %lo(NpcSpriteData)
/* 10126C 802DE17C 00628821 */ addu $s1, $v1, $v0
/* 101270 802DE180 8E220000 */ lw $v0, 0x0($s1)
/* 101274 802DE184 1040000E */ beqz $v0, .L802DE1C0
/* 101278 802DE188 0080902D */ daddu $s2, $a0, $zero
/* 10127C 802DE18C 3C03802E */ lui $v1, %hi(NpcSpriteInstanceCount)
/* 101280 802DE190 2463F958 */ addiu $v1, $v1, %lo(NpcSpriteInstanceCount)
/* 101284 802DE194 02831821 */ addu $v1, $s4, $v1
/* 101288 802DE198 90620000 */ lbu $v0, 0x0($v1)
/* 10128C 802DE19C 24420001 */ addiu $v0, $v0, 0x1
/* 101290 802DE1A0 A0620000 */ sb $v0, 0x0($v1)
/* 101294 802DE1A4 00121080 */ sll $v0, $s2, 2
/* 101298 802DE1A8 00521021 */ addu $v0, $v0, $s2
/* 10129C 802DE1AC 00021080 */ sll $v0, $v0, 2
/* 1012A0 802DE1B0 8E300000 */ lw $s0, 0x0($s1)
/* 1012A4 802DE1B4 00531021 */ addu $v0, $v0, $s3
/* 1012A8 802DE1B8 080B7882 */ j .L802DE208
/* 1012AC 802DE1BC AC500008 */ sw $s0, 0x8($v0)
.L802DE1C0:
/* 1012B0 802DE1C0 2684FFFF */ addiu $a0, $s4, -0x1
/* 1012B4 802DE1C4 24020001 */ addiu $v0, $zero, 0x1
/* 1012B8 802DE1C8 3C01802E */ lui $at, %hi(NpcSpriteInstanceCount)
/* 1012BC 802DE1CC 00340821 */ addu $at, $at, $s4
/* 1012C0 802DE1D0 A022F958 */ sb $v0, %lo(NpcSpriteInstanceCount)($at)
/* 1012C4 802DE1D4 0C0B7AC3 */ jal spr_load_sprite
/* 1012C8 802DE1D8 0000282D */ daddu $a1, $zero, $zero
/* 1012CC 802DE1DC 0040802D */ daddu $s0, $v0, $zero
/* 1012D0 802DE1E0 00121080 */ sll $v0, $s2, 2
/* 1012D4 802DE1E4 00521021 */ addu $v0, $v0, $s2
/* 1012D8 802DE1E8 00021080 */ sll $v0, $v0, 2
/* 1012DC 802DE1EC 00531021 */ addu $v0, $v0, $s3
/* 1012E0 802DE1F0 AC500008 */ sw $s0, 0x8($v0)
/* 1012E4 802DE1F4 12A00004 */ beqz $s5, .L802DE208
/* 1012E8 802DE1F8 AE300000 */ sw $s0, 0x0($s1)
/* 1012EC 802DE1FC 0200202D */ daddu $a0, $s0, $zero
/* 1012F0 802DE200 0C0B7C03 */ jal spr_load_npc_extra_anims
/* 1012F4 802DE204 02A0282D */ daddu $a1, $s5, $zero
.L802DE208:
/* 1012F8 802DE208 8E040008 */ lw $a0, 0x8($s0)
/* 1012FC 802DE20C 0C0B7CB6 */ jal spr_allocate_components
/* 101300 802DE210 00000000 */ nop
/* 101304 802DE214 0040882D */ daddu $s1, $v0, $zero
/* 101308 802DE218 00121080 */ sll $v0, $s2, 2
/* 10130C 802DE21C 00521021 */ addu $v0, $v0, $s2
/* 101310 802DE220 00021080 */ sll $v0, $v0, 2
/* 101314 802DE224 3C01802E */ lui $at, %hi(D_802DFA4C)
/* 101318 802DE228 00220821 */ addu $at, $at, $v0
/* 10131C 802DE22C AC31FA4C */ sw $s1, %lo(D_802DFA4C)($at)
/* 101320 802DE230 8E230000 */ lw $v1, 0x0($s1)
/* 101324 802DE234 2402FFFF */ addiu $v0, $zero, -0x1
/* 101328 802DE238 10620009 */ beq $v1, $v0, .L802DE260
/* 10132C 802DE23C 0040982D */ daddu $s3, $v0, $zero
.L802DE240:
/* 101330 802DE240 8E300000 */ lw $s0, 0x0($s1)
/* 101334 802DE244 0C04E9C1 */ jal imgfx_get_free_instances
/* 101338 802DE248 24040001 */ addiu $a0, $zero, 0x1
/* 10133C 802DE24C 26310004 */ addiu $s1, $s1, 0x4
/* 101340 802DE250 AE02004C */ sw $v0, 0x4C($s0)
/* 101344 802DE254 8E220000 */ lw $v0, 0x0($s1)
/* 101348 802DE258 1453FFF9 */ bne $v0, $s3, .L802DE240
/* 10134C 802DE25C 00000000 */ nop
.L802DE260:
/* 101350 802DE260 0240102D */ daddu $v0, $s2, $zero
/* 101354 802DE264 3C03802E */ lui $v1, %hi(SpriteInstances)
/* 101358 802DE268 2463FA48 */ addiu $v1, $v1, %lo(SpriteInstances)
/* 10135C 802DE26C 00022080 */ sll $a0, $v0, 2
/* 101360 802DE270 00822021 */ addu $a0, $a0, $v0
/* 101364 802DE274 00042080 */ sll $a0, $a0, 2
/* 101368 802DE278 00832021 */ addu $a0, $a0, $v1
/* 10136C 802DE27C 2403FFFF */ addiu $v1, $zero, -0x1
/* 101370 802DE280 AC940000 */ sw $s4, 0x0($a0)
/* 101374 802DE284 AC83000C */ sw $v1, 0xC($a0)
.L802DE288:
/* 101378 802DE288 8FBF0028 */ lw $ra, 0x28($sp)
/* 10137C 802DE28C 8FB50024 */ lw $s5, 0x24($sp)
/* 101380 802DE290 8FB40020 */ lw $s4, 0x20($sp)
/* 101384 802DE294 8FB3001C */ lw $s3, 0x1C($sp)
/* 101388 802DE298 8FB20018 */ lw $s2, 0x18($sp)
/* 10138C 802DE29C 8FB10014 */ lw $s1, 0x14($sp)
/* 101390 802DE2A0 8FB00010 */ lw $s0, 0x10($sp)
/* 101394 802DE2A4 03E00008 */ jr $ra
/* 101398 802DE2A8 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
s32 spr_load_npc_sprite(s32 animID, u32* extraAnimList) {
SpriteAnimData* header;
SpriteComponent** compList;
s32 listIndex;
s32 i;
s32 spriteIndex = (animID >> 0x10) & 0x7FFF;
s32 useTailAlloc = (u32)animID >> 0x1F;
for (i = 0; i < ARRAY_COUNT(SpriteInstances); i++) {
if (SpriteInstances[i].spriteIndex == 0) {
break;
}
}
if (MaxLoadedSpriteInstanceID < i) {
MaxLoadedSpriteInstanceID = i;
}
if (i == ARRAY_COUNT(SpriteInstances)) {
return -1;
}
listIndex = i;
if (NpcSpriteData[spriteIndex] != NULL) {
NpcSpriteInstanceCount[spriteIndex]++;
header = NpcSpriteData[spriteIndex];
SpriteInstances[listIndex].spriteData = header;
} else {
NpcSpriteInstanceCount[spriteIndex] = 1;
header = spr_load_sprite(spriteIndex - 1, FALSE, useTailAlloc);
SpriteInstances[listIndex].spriteData = header;
NpcSpriteData[spriteIndex] = header;
if (extraAnimList != NULL) {
spr_load_npc_extra_anims(header, extraAnimList);
}
}
compList = spr_allocate_components(header->maxComponents);
SpriteInstances[listIndex].componentList = compList;
while (*compList != PTR_LIST_END) {
SpriteComponent* comp = *compList;
comp->imgfxIdx = imgfx_get_free_instances(1);
compList++;
}
SpriteInstances[listIndex].spriteIndex = spriteIndex;
SpriteInstances[listIndex].currentAnimID = -1;
return listIndex;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel npc_raycast_up
/* 76320 800DCE70 27BDFF50 */ addiu $sp, $sp, -0xB0
/* 76324 800DCE74 AFB20078 */ sw $s2, 0x78($sp)
/* 76328 800DCE78 8FB200C0 */ lw $s2, 0xC0($sp)
/* 7632C 800DCE7C F7BA00A8 */ sdc1 $f26, 0xA8($sp)
/* 76330 800DCE80 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 76334 800DCE84 4481D000 */ mtc1 $at, $f26
/* 76338 800DCE88 AFB00070 */ sw $s0, 0x70($sp)
/* 7633C 800DCE8C 0080802D */ daddu $s0, $a0, $zero
/* 76340 800DCE90 AFB3007C */ sw $s3, 0x7C($sp)
/* 76344 800DCE94 00A0982D */ daddu $s3, $a1, $zero
/* 76348 800DCE98 AFB40080 */ sw $s4, 0x80($sp)
/* 7634C 800DCE9C 00C0A02D */ daddu $s4, $a2, $zero
/* 76350 800DCEA0 AFB50084 */ sw $s5, 0x84($sp)
/* 76354 800DCEA4 00E0A82D */ daddu $s5, $a3, $zero
/* 76358 800DCEA8 AFBF0088 */ sw $ra, 0x88($sp)
/* 7635C 800DCEAC AFB10074 */ sw $s1, 0x74($sp)
/* 76360 800DCEB0 F7B800A0 */ sdc1 $f24, 0xA0($sp)
/* 76364 800DCEB4 F7B60098 */ sdc1 $f22, 0x98($sp)
/* 76368 800DCEB8 F7B40090 */ sdc1 $f20, 0x90($sp)
/* 7636C 800DCEBC C6400000 */ lwc1 $f0, 0x0($s2)
/* 76370 800DCEC0 27A20038 */ addiu $v0, $sp, 0x38
/* 76374 800DCEC4 E7A00044 */ swc1 $f0, 0x44($sp)
/* 76378 800DCEC8 E7A00060 */ swc1 $f0, 0x60($sp)
/* 7637C 800DCECC C6760000 */ lwc1 $f22, 0x0($s3)
/* 76380 800DCED0 C6980000 */ lwc1 $f24, 0x0($s4)
/* 76384 800DCED4 C6B40000 */ lwc1 $f20, 0x0($s5)
/* 76388 800DCED8 AFA2001C */ sw $v0, 0x1C($sp)
/* 7638C 800DCEDC 27A2003C */ addiu $v0, $sp, 0x3C
/* 76390 800DCEE0 AFA20020 */ sw $v0, 0x20($sp)
/* 76394 800DCEE4 27A20040 */ addiu $v0, $sp, 0x40
/* 76398 800DCEE8 AFA20024 */ sw $v0, 0x24($sp)
/* 7639C 800DCEEC 27A20044 */ addiu $v0, $sp, 0x44
/* 763A0 800DCEF0 AFA20028 */ sw $v0, 0x28($sp)
/* 763A4 800DCEF4 27A20048 */ addiu $v0, $sp, 0x48
/* 763A8 800DCEF8 AFA2002C */ sw $v0, 0x2C($sp)
/* 763AC 800DCEFC 27A2004C */ addiu $v0, $sp, 0x4C
/* 763B0 800DCF00 AFA20030 */ sw $v0, 0x30($sp)
/* 763B4 800DCF04 4406C000 */ mfc1 $a2, $f24
/* 763B8 800DCF08 4407A000 */ mfc1 $a3, $f20
/* 763BC 800DCF0C 4405B000 */ mfc1 $a1, $f22
/* 763C0 800DCF10 27A20050 */ addiu $v0, $sp, 0x50
/* 763C4 800DCF14 AFA00010 */ sw $zero, 0x10($sp)
/* 763C8 800DCF18 E7BA0014 */ swc1 $f26, 0x14($sp)
/* 763CC 800DCF1C AFA00018 */ sw $zero, 0x18($sp)
/* 763D0 800DCF20 0C017334 */ jal test_ray_colliders
/* 763D4 800DCF24 AFA20034 */ sw $v0, 0x34($sp)
/* 763D8 800DCF28 0040882D */ daddu $s1, $v0, $zero
/* 763DC 800DCF2C 3C020004 */ lui $v0, (0x40000 >> 16)
/* 763E0 800DCF30 02028024 */ and $s0, $s0, $v0
/* 763E4 800DCF34 16000029 */ bnez $s0, .L800DCFDC
/* 763E8 800DCF38 0220182D */ daddu $v1, $s1, $zero
/* 763EC 800DCF3C 27A20054 */ addiu $v0, $sp, 0x54
/* 763F0 800DCF40 AFA20018 */ sw $v0, 0x18($sp)
/* 763F4 800DCF44 27A20058 */ addiu $v0, $sp, 0x58
/* 763F8 800DCF48 AFA2001C */ sw $v0, 0x1C($sp)
/* 763FC 800DCF4C 27A2005C */ addiu $v0, $sp, 0x5C
/* 76400 800DCF50 AFA20020 */ sw $v0, 0x20($sp)
/* 76404 800DCF54 27A20060 */ addiu $v0, $sp, 0x60
/* 76408 800DCF58 AFA20024 */ sw $v0, 0x24($sp)
/* 7640C 800DCF5C 27A20064 */ addiu $v0, $sp, 0x64
/* 76410 800DCF60 AFA20028 */ sw $v0, 0x28($sp)
/* 76414 800DCF64 27A20068 */ addiu $v0, $sp, 0x68
/* 76418 800DCF68 AFA2002C */ sw $v0, 0x2C($sp)
/* 7641C 800DCF6C 27A2006C */ addiu $v0, $sp, 0x6C
/* 76420 800DCF70 4600B306 */ mov.s $f12, $f22
/* 76424 800DCF74 44800000 */ mtc1 $zero, $f0
/* 76428 800DCF78 4406A000 */ mfc1 $a2, $f20
/* 7642C 800DCF7C 44070000 */ mfc1 $a3, $f0
/* 76430 800DCF80 4600C386 */ mov.s $f14, $f24
/* 76434 800DCF84 E7BA0010 */ swc1 $f26, 0x10($sp)
/* 76438 800DCF88 AFA20030 */ sw $v0, 0x30($sp)
/* 7643C 800DCF8C 0C017512 */ jal test_ray_entities
/* 76440 800DCF90 AFA70014 */ sw $a3, 0x14($sp)
/* 76444 800DCF94 04400010 */ bltz $v0, .L800DCFD8
/* 76448 800DCF98 34434000 */ ori $v1, $v0, 0x4000
/* 7644C 800DCF9C C7A00060 */ lwc1 $f0, 0x60($sp)
/* 76450 800DCFA0 C7A20054 */ lwc1 $f2, 0x54($sp)
/* 76454 800DCFA4 C7A40058 */ lwc1 $f4, 0x58($sp)
/* 76458 800DCFA8 C7A6005C */ lwc1 $f6, 0x5C($sp)
/* 7645C 800DCFAC C7A80064 */ lwc1 $f8, 0x64($sp)
/* 76460 800DCFB0 C7AA0068 */ lwc1 $f10, 0x68($sp)
/* 76464 800DCFB4 C7AC006C */ lwc1 $f12, 0x6C($sp)
/* 76468 800DCFB8 E7A00044 */ swc1 $f0, 0x44($sp)
/* 7646C 800DCFBC E7A20038 */ swc1 $f2, 0x38($sp)
/* 76470 800DCFC0 E7A4003C */ swc1 $f4, 0x3C($sp)
/* 76474 800DCFC4 E7A60040 */ swc1 $f6, 0x40($sp)
/* 76478 800DCFC8 E7A80048 */ swc1 $f8, 0x48($sp)
/* 7647C 800DCFCC E7AA004C */ swc1 $f10, 0x4C($sp)
/* 76480 800DCFD0 080373F7 */ j .L800DCFDC
/* 76484 800DCFD4 E7AC0050 */ swc1 $f12, 0x50($sp)
.L800DCFD8:
/* 76488 800DCFD8 0220182D */ daddu $v1, $s1, $zero
.L800DCFDC:
/* 7648C 800DCFDC 0460000D */ bltz $v1, .L800DD014
/* 76490 800DCFE0 24020001 */ addiu $v0, $zero, 0x1
/* 76494 800DCFE4 C7A00044 */ lwc1 $f0, 0x44($sp)
/* 76498 800DCFE8 E6400000 */ swc1 $f0, 0x0($s2)
/* 7649C 800DCFEC C7A00038 */ lwc1 $f0, 0x38($sp)
/* 764A0 800DCFF0 E6600000 */ swc1 $f0, 0x0($s3)
/* 764A4 800DCFF4 C7A0003C */ lwc1 $f0, 0x3C($sp)
/* 764A8 800DCFF8 E6800000 */ swc1 $f0, 0x0($s4)
/* 764AC 800DCFFC C7A00040 */ lwc1 $f0, 0x40($sp)
/* 764B0 800DD000 E6A00000 */ swc1 $f0, 0x0($s5)
/* 764B4 800DD004 3C018011 */ lui $at, %hi(NpcHitQueryColliderID)
/* 764B8 800DD008 AC23C978 */ sw $v1, %lo(NpcHitQueryColliderID)($at)
/* 764BC 800DD00C 08037406 */ j .L800DD018
/* 764C0 800DD010 00000000 */ nop
.L800DD014:
/* 764C4 800DD014 0000102D */ daddu $v0, $zero, $zero
.L800DD018:
/* 764C8 800DD018 8FBF0088 */ lw $ra, 0x88($sp)
/* 764CC 800DD01C 8FB50084 */ lw $s5, 0x84($sp)
/* 764D0 800DD020 8FB40080 */ lw $s4, 0x80($sp)
/* 764D4 800DD024 8FB3007C */ lw $s3, 0x7C($sp)
/* 764D8 800DD028 8FB20078 */ lw $s2, 0x78($sp)
/* 764DC 800DD02C 8FB10074 */ lw $s1, 0x74($sp)
/* 764E0 800DD030 8FB00070 */ lw $s0, 0x70($sp)
/* 764E4 800DD034 D7BA00A8 */ ldc1 $f26, 0xA8($sp)
/* 764E8 800DD038 D7B800A0 */ ldc1 $f24, 0xA0($sp)
/* 764EC 800DD03C D7B60098 */ ldc1 $f22, 0x98($sp)
/* 764F0 800DD040 D7B40090 */ ldc1 $f20, 0x90($sp)
/* 764F4 800DD044 03E00008 */ jr $ra
/* 764F8 800DD048 27BD00B0 */ addiu $sp, $sp, 0xB0
### DECOMPILED C INSTRUCTIONS:
s32 npc_raycast_up(s32 ignoreFlags, f32* startX, f32* startY, f32* startZ, f32* hitDepth) {
f32 cHitX;
f32 cHitY;
f32 cHitZ;
f32 cHitDepth;
f32 cHitNx;
f32 cHitNy;
f32 cHitNz;
f32 eHitX;
f32 eHitY;
f32 eHitZ;
f32 eHitDepth;
f32 eHitNx;
f32 eHitNy;
f32 eHitNz;
s32 entityID;
s32 colliderID;
f32 sx, sy, sz;
s32 ret;
eHitDepth = cHitDepth = *hitDepth;
sx = *startX;
sy = *startY;
sz = *startZ;
ret = test_ray_colliders(ignoreFlags, sx, sy, sz, 0.0f, 1.0f, 0.0f, &cHitX, &cHitY, &cHitZ, &cHitDepth, &cHitNx, &cHitNy, &cHitNz);
colliderID = ret;
if ((ignoreFlags & COLLISION_IGNORE_ENTITIES) == 0) {
entityID = test_ray_entities(sx, sy, sz, 0.0f, 1.0f, 0.0f, &eHitX, &eHitY, &eHitZ, &eHitDepth, &eHitNx, &eHitNy, &eHitNz);
ret = entityID | COLLISION_WITH_ENTITY_BIT;
if (entityID >= 0) {
cHitDepth = eHitDepth;
cHitX = eHitX;
cHitY = eHitY;
cHitZ = eHitZ;
cHitNx = eHitNx;
cHitNy = eHitNy;
cHitNz = eHitNz;
} else {
ret = colliderID;
}
}
if (ret < 0) {
// TODO find better match
colliderID = 0;
return colliderID;
} else {
*hitDepth = cHitDepth;
*startX = cHitX;
*startY = cHitY;
*startZ = cHitZ;
NpcHitQueryColliderID = ret;
return TRUE;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel draw_entity_model_B
/* B85B8 80121EB8 27BDFF60 */ addiu $sp, $sp, -0xA0
/* B85BC 80121EBC 0080402D */ daddu $t0, $a0, $zero
/* B85C0 80121EC0 AFB1008C */ sw $s1, 0x8C($sp)
/* B85C4 80121EC4 27B10028 */ addiu $s1, $sp, 0x28
/* B85C8 80121EC8 3C09800A */ lui $t1, %hi(gCurrentCamID)
/* B85CC 80121ECC 8529A634 */ lh $t1, %lo(gCurrentCamID)($t1)
/* B85D0 80121ED0 3C04800B */ lui $a0, %hi(gCameras)
/* B85D4 80121ED4 24841D80 */ addiu $a0, $a0, %lo(gCameras)
/* B85D8 80121ED8 AFBF0094 */ sw $ra, 0x94($sp)
/* B85DC 80121EDC AFB20090 */ sw $s2, 0x90($sp)
/* B85E0 80121EE0 AFB00088 */ sw $s0, 0x88($sp)
/* B85E4 80121EE4 F7B40098 */ sdc1 $f20, 0x98($sp)
/* B85E8 80121EE8 00091080 */ sll $v0, $t1, 2
/* B85EC 80121EEC 00491021 */ addu $v0, $v0, $t1
/* B85F0 80121EF0 00021080 */ sll $v0, $v0, 2
/* B85F4 80121EF4 00491023 */ subu $v0, $v0, $t1
/* B85F8 80121EF8 000218C0 */ sll $v1, $v0, 3
/* B85FC 80121EFC 00431021 */ addu $v0, $v0, $v1
/* B8600 80121F00 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* B8604 80121F04 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* B8608 80121F08 000210C0 */ sll $v0, $v0, 3
/* B860C 80121F0C 80630070 */ lb $v1, 0x70($v1)
/* B8610 80121F10 10600004 */ beqz $v1, .L80121F24
/* B8614 80121F14 00449021 */ addu $s2, $v0, $a0
/* B8618 80121F18 31020800 */ andi $v0, $t0, 0x800
/* B861C 80121F1C 10400053 */ beqz $v0, .L8012206C
/* B8620 80121F20 00000000 */ nop
.L80121F24:
/* B8624 80121F24 2402F7FF */ addiu $v0, $zero, -0x801
/* B8628 80121F28 01024024 */ and $t0, $t0, $v0
/* B862C 80121F2C 3C038015 */ lui $v1, %hi(gCurrentEntityModelList)
/* B8630 80121F30 8C634370 */ lw $v1, %lo(gCurrentEntityModelList)($v1)
/* B8634 80121F34 00081080 */ sll $v0, $t0, 2
/* B8638 80121F38 00431021 */ addu $v0, $v0, $v1
/* B863C 80121F3C 8C500000 */ lw $s0, 0x0($v0)
/* B8640 80121F40 1200004A */ beqz $s0, .L8012206C
/* B8644 80121F44 00000000 */ nop
/* B8648 80121F48 8E030000 */ lw $v1, 0x0($s0)
/* B864C 80121F4C 10600047 */ beqz $v1, .L8012206C
/* B8650 80121F50 30620100 */ andi $v0, $v1, 0x100
/* B8654 80121F54 14400045 */ bnez $v0, .L8012206C
/* B8658 80121F58 30620020 */ andi $v0, $v1, 0x20
/* B865C 80121F5C 14400043 */ bnez $v0, .L8012206C
/* B8660 80121F60 24020001 */ addiu $v0, $zero, 0x1
/* B8664 80121F64 01221004 */ sllv $v0, $v0, $t1
/* B8668 80121F68 00621024 */ and $v0, $v1, $v0
/* B866C 80121F6C 1040003F */ beqz $v0, .L8012206C
/* B8670 80121F70 26030018 */ addiu $v1, $s0, 0x18
/* B8674 80121F74 00A0102D */ daddu $v0, $a1, $zero
/* B8678 80121F78 24A40040 */ addiu $a0, $a1, 0x40
.L80121F7C:
/* B867C 80121F7C 8C4A0000 */ lw $t2, 0x0($v0)
/* B8680 80121F80 8C4B0004 */ lw $t3, 0x4($v0)
/* B8684 80121F84 8C4C0008 */ lw $t4, 0x8($v0)
/* B8688 80121F88 8C4D000C */ lw $t5, 0xC($v0)
/* B868C 80121F8C AC6A0000 */ sw $t2, 0x0($v1)
/* B8690 80121F90 AC6B0004 */ sw $t3, 0x4($v1)
/* B8694 80121F94 AC6C0008 */ sw $t4, 0x8($v1)
/* B8698 80121F98 AC6D000C */ sw $t5, 0xC($v1)
/* B869C 80121F9C 24420010 */ addiu $v0, $v0, 0x10
/* B86A0 80121FA0 1444FFF6 */ bne $v0, $a0, .L80121F7C
/* B86A4 80121FA4 24630010 */ addiu $v1, $v1, 0x10
/* B86A8 80121FA8 27A40038 */ addiu $a0, $sp, 0x38
/* B86AC 80121FAC 3C018015 */ lui $at, %hi(D_80154374)
/* B86B0 80121FB0 AC264374 */ sw $a2, %lo(D_80154374)($at)
/* B86B4 80121FB4 0C019D60 */ jal guMtxL2F
/* B86B8 80121FB8 AE07005C */ sw $a3, 0x5C($s0)
/* B86BC 80121FBC 264400D4 */ addiu $a0, $s2, 0xD4
/* B86C0 80121FC0 C7A00068 */ lwc1 $f0, 0x68($sp)
/* B86C4 80121FC4 C7A2006C */ lwc1 $f2, 0x6C($sp)
/* B86C8 80121FC8 C7B40070 */ lwc1 $f20, 0x70($sp)
/* B86CC 80121FCC 27A20078 */ addiu $v0, $sp, 0x78
/* B86D0 80121FD0 AFA20014 */ sw $v0, 0x14($sp)
/* B86D4 80121FD4 27A2007C */ addiu $v0, $sp, 0x7C
/* B86D8 80121FD8 AFA20018 */ sw $v0, 0x18($sp)
/* B86DC 80121FDC 27A20080 */ addiu $v0, $sp, 0x80
/* B86E0 80121FE0 AFA2001C */ sw $v0, 0x1C($sp)
/* B86E4 80121FE4 44050000 */ mfc1 $a1, $f0
/* B86E8 80121FE8 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* B86EC 80121FEC 44810000 */ mtc1 $at, $f0
/* B86F0 80121FF0 44061000 */ mfc1 $a2, $f2
/* B86F4 80121FF4 4407A000 */ mfc1 $a3, $f20
/* B86F8 80121FF8 27A20084 */ addiu $v0, $sp, 0x84
/* B86FC 80121FFC AFA20020 */ sw $v0, 0x20($sp)
/* B8700 80122000 0C00A588 */ jal transform_point
/* B8704 80122004 E7A00010 */ swc1 $f0, 0x10($sp)
/* B8708 80122008 82030004 */ lb $v1, 0x4($s0)
/* B870C 8012200C 3C028012 */ lui $v0, %hi(appendGfx_entity_model)
/* B8710 80122010 24421184 */ addiu $v0, $v0, %lo(appendGfx_entity_model)
/* B8714 80122014 AE300008 */ sw $s0, 0x8($s1)
/* B8718 80122018 AE22000C */ sw $v0, 0xC($s1)
/* B871C 8012201C AE230000 */ sw $v1, 0x0($s1)
/* B8720 80122020 8E020000 */ lw $v0, 0x0($s0)
/* B8724 80122024 3042F000 */ andi $v0, $v0, 0xF000
/* B8728 80122028 00021202 */ srl $v0, $v0, 8
/* B872C 8012202C 44821000 */ mtc1 $v0, $f2
/* B8730 80122030 00000000 */ nop
/* B8734 80122034 468010A1 */ cvt.d.w $f2, $f2
/* B8738 80122038 04430007 */ bgezl $v0, .L80122058
/* B873C 8012203C 46201020 */ cvt.s.d $f0, $f2
/* B8740 80122040 3C0141F0 */ lui $at, (0x41F00000 >> 16)
/* B8744 80122044 44810800 */ mtc1 $at, $f1
/* B8748 80122048 44800000 */ mtc1 $zero, $f0
/* B874C 8012204C 00000000 */ nop
/* B8750 80122050 46201080 */ add.d $f2, $f2, $f0
/* B8754 80122054 46201020 */ cvt.s.d $f0, $f2
.L80122058:
/* B8758 80122058 46140000 */ add.s $f0, $f0, $f20
/* B875C 8012205C 0220202D */ daddu $a0, $s1, $zero
/* B8760 80122060 4600010D */ trunc.w.s $f4, $f0
/* B8764 80122064 0C047644 */ jal queue_render_task
/* B8768 80122068 E4840004 */ swc1 $f4, 0x4($a0)
.L8012206C:
/* B876C 8012206C 8FBF0094 */ lw $ra, 0x94($sp)
/* B8770 80122070 8FB20090 */ lw $s2, 0x90($sp)
/* B8774 80122074 8FB1008C */ lw $s1, 0x8C($sp)
/* B8778 80122078 8FB00088 */ lw $s0, 0x88($sp)
/* B877C 8012207C D7B40098 */ ldc1 $f20, 0x98($sp)
/* B8780 80122080 03E00008 */ jr $ra
/* B8784 80122084 27BD00A0 */ addiu $sp, $sp, 0xA0
### DECOMPILED C INSTRUCTIONS:
void draw_entity_model_B(s32 modelIdx, Mtx* transformMtx, s32 vertexSegment, Vec3s* vertexArray) {
EntityModel* model;
RenderTask rt;
RenderTask* rtPtr = &rt;
Camera* camera = &gCameras[gCurrentCamID];
Matrix4f mtx;
f32 x, y, z, w;
f32 inX, inY, inZ;
if ((gGameStatusPtr->isBattle == 0) || (modelIdx & 0x800)) {
modelIdx &= ~0x800;
model = (*gCurrentEntityModelList)[modelIdx];
if (model != NULL) {
if (model->flags != 0) {
if (!(model->flags & ENTITY_MODEL_FLAG_100)) {
if (!(model->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
if (model->flags & (1 << gCurrentCamID)) {
model->transform = *transformMtx;
D_80154374 = vertexSegment;
model->vertexArray = vertexArray;
guMtxL2F(mtx, transformMtx);
inX = mtx[3][0];
inY = mtx[3][1];
inZ = mtx[3][2];
transform_point(camera->perspectiveMatrix, inX, inY, inZ, 1.0f, &x, &y, &z, &w);
rtPtr->renderMode = model->renderMode;
rtPtr->appendGfxArg = model;
rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model;
rtPtr->distance = ((u32)(model->flags & 0xF000) >> 8) + inZ;
queue_render_task(rtPtr);
}
}
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8024C7A4
/* 13FAE4 8024C7A4 3C028027 */ lui $v0, %hi(gPausePartnersCurrentPartnerIdx)
/* 13FAE8 8024C7A8 8C4206A0 */ lw $v0, %lo(gPausePartnersCurrentPartnerIdx)($v0)
/* 13FAEC 8024C7AC 00021840 */ sll $v1, $v0, 1
/* 13FAF0 8024C7B0 00621821 */ addu $v1, $v1, $v0
/* 13FAF4 8024C7B4 00031100 */ sll $v0, $v1, 4
/* 13FAF8 8024C7B8 00431023 */ subu $v0, $v0, $v1
/* 13FAFC 8024C7BC 3C038027 */ lui $v1, %hi(gPausePartnersNumPartners)
/* 13FB00 8024C7C0 8C6306B0 */ lw $v1, %lo(gPausePartnersNumPartners)($v1)
/* 13FB04 8024C7C4 000210C0 */ sll $v0, $v0, 3
/* 13FB08 8024C7C8 14600002 */ bnez $v1, .L8024C7D4
/* 13FB0C 8024C7CC 0043001A */ div $zero, $v0, $v1
D_8024C7D0_C0A050:
/* 13FB10 8024C7D0 0007000D */ break 7
.L8024C7D4:
/* 13FB14 8024C7D4 2401FFFF */ addiu $at, $zero, -0x1
/* 13FB18 8024C7D8 14610004 */ bne $v1, $at, .L8024C7EC
/* 13FB1C 8024C7DC 3C018000 */ lui $at, (0x80000000 >> 16)
/* 13FB20 8024C7E0 14410002 */ bne $v0, $at, .L8024C7EC
/* 13FB24 8024C7E4 00000000 */ nop
/* 13FB28 8024C7E8 0006000D */ break 6
.L8024C7EC:
/* 13FB2C 8024C7EC 00001012 */ mflo $v0
/* 13FB30 8024C7F0 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 13FB34 8024C7F4 AFB10014 */ sw $s1, 0x14($sp)
/* 13FB38 8024C7F8 3C118027 */ lui $s1, %hi(gPausePartnersRotAngle)
/* 13FB3C 8024C7FC 263106A8 */ addiu $s1, $s1, %lo(gPausePartnersRotAngle)
/* 13FB40 8024C800 AFBF0020 */ sw $ra, 0x20($sp)
/* 13FB44 8024C804 AFB3001C */ sw $s3, 0x1C($sp)
D_8024C808_C0A088:
/* 13FB48 8024C808 AFB20018 */ sw $s2, 0x18($sp)
/* 13FB4C 8024C80C AFB00010 */ sw $s0, 0x10($sp)
/* 13FB50 8024C810 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 13FB54 8024C814 C6220000 */ lwc1 $f2, 0x0($s1)
/* 13FB58 8024C818 44820000 */ mtc1 $v0, $f0
/* 13FB5C 8024C81C 00000000 */ nop
/* 13FB60 8024C820 46800020 */ cvt.s.w $f0, $f0
/* 13FB64 8024C824 46020501 */ sub.s $f20, $f0, $f2
/* 13FB68 8024C828 4600A10D */ trunc.w.s $f4, $f20
/* 13FB6C 8024C82C 44042000 */ mfc1 $a0, $f4
/* 13FB70 8024C830 00000000 */ nop
/* 13FB74 8024C834 04810002 */ bgez $a0, .L8024C840
/* 13FB78 8024C838 0080802D */ daddu $s0, $a0, $zero
/* 13FB7C 8024C83C 00108023 */ negu $s0, $s0
.L8024C840:
/* 13FB80 8024C840 0C00A52C */ jal sign
/* 13FB84 8024C844 00000000 */ nop
/* 13FB88 8024C848 0040182D */ daddu $v1, $v0, $zero
/* 13FB8C 8024C84C 2A020010 */ slti $v0, $s0, 0x10
/* 13FB90 8024C850 14400008 */ bnez $v0, .L8024C874
/* 13FB94 8024C854 00000000 */ nop
/* 13FB98 8024C858 3C018027 */ lui $at, %hi(D_80270048)
/* 13FB9C 8024C85C D4220048 */ ldc1 $f2, %lo(D_80270048)($at)
/* 13FBA0 8024C860 4600A021 */ cvt.d.s $f0, $f20
/* 13FBA4 8024C864 46220002 */ mul.d $f0, $f0, $f2
/* 13FBA8 8024C868 00000000 */ nop
/* 13FBAC 8024C86C 0809322D */ j .L8024C8B4
/* 13FBB0 8024C870 462000A0 */ cvt.s.d $f2, $f0
.L8024C874:
/* 13FBB4 8024C874 3C028025 */ lui $v0, %hi(D_8024F87C)
/* 13FBB8 8024C878 00501021 */ addu $v0, $v0, $s0
/* 13FBBC 8024C87C 9042F87C */ lbu $v0, %lo(D_8024F87C)($v0)
/* 13FBC0 8024C880 C6200000 */ lwc1 $f0, 0x0($s1)
/* 13FBC4 8024C884 00620018 */ mult $v1, $v0
/* 13FBC8 8024C888 4600010D */ trunc.w.s $f4, $f0
/* 13FBCC 8024C88C 44022000 */ mfc1 $v0, $f4
/* 13FBD0 8024C890 00000000 */ nop
/* 13FBD4 8024C894 44820000 */ mtc1 $v0, $f0
/* 13FBD8 8024C898 00000000 */ nop
/* 13FBDC 8024C89C 46800020 */ cvt.s.w $f0, $f0
/* 13FBE0 8024C8A0 E6200000 */ swc1 $f0, 0x0($s1)
/* 13FBE4 8024C8A4 00003812 */ mflo $a3
/* 13FBE8 8024C8A8 44871000 */ mtc1 $a3, $f2
/* 13FBEC 8024C8AC 00000000 */ nop
/* 13FBF0 8024C8B0 468010A0 */ cvt.s.w $f2, $f2
.L8024C8B4:
/* 13FBF4 8024C8B4 3C028027 */ lui $v0, %hi(gPausePartnersRotAngle)
/* 13FBF8 8024C8B8 244206A8 */ addiu $v0, $v0, %lo(gPausePartnersRotAngle)
/* 13FBFC 8024C8BC C4400000 */ lwc1 $f0, 0x0($v0)
/* 13FC00 8024C8C0 46020000 */ add.s $f0, $f0, $f2
/* 13FC04 8024C8C4 3C038027 */ lui $v1, %hi(gPausePartnersNumPartners)
/* 13FC08 8024C8C8 8C6306B0 */ lw $v1, %lo(gPausePartnersNumPartners)($v1)
/* 13FC0C 8024C8CC 0000882D */ daddu $s1, $zero, $zero
/* 13FC10 8024C8D0 18600024 */ blez $v1, .L8024C964
D_8024C8D4:
/* 13FC14 8024C8D4 E4400000 */ swc1 $f0, 0x0($v0)
/* 13FC18 8024C8D8 3C138027 */ lui $s3, %hi(gPausePartnersSpriteIDs)
/* 13FC1C 8024C8DC 26730660 */ addiu $s3, $s3, %lo(gPausePartnersSpriteIDs)
D_8024C8E0_C0A160:
/* 13FC20 8024C8E0 3C128025 */ lui $s2, %hi(D_8024F630)
/* 13FC24 8024C8E4 2652F630 */ addiu $s2, $s2, %lo(D_8024F630)
/* 13FC28 8024C8E8 3C108027 */ lui $s0, %hi(gPausePartnersPartnerIdx)
/* 13FC2C 8024C8EC 26100680 */ addiu $s0, $s0, %lo(gPausePartnersPartnerIdx)
.L8024C8F0:
/* 13FC30 8024C8F0 3C028027 */ lui $v0, %hi(gPausePartnersCurrentPartnerIdx)
/* 13FC34 8024C8F4 8C4206A0 */ lw $v0, %lo(gPausePartnersCurrentPartnerIdx)($v0)
/* 13FC38 8024C8F8 1622000A */ bne $s1, $v0, .L8024C924
/* 13FC3C 8024C8FC 00000000 */ nop
/* 13FC40 8024C900 8E030000 */ lw $v1, 0x0($s0)
/* 13FC44 8024C904 3C063F80 */ lui $a2, (0x3F800000 >> 16)
/* 13FC48 8024C908 00031080 */ sll $v0, $v1, 2
/* 13FC4C 8024C90C 00531021 */ addu $v0, $v0, $s3
/* 13FC50 8024C910 00031900 */ sll $v1, $v1, 4
.L8024C914:
/* 13FC54 8024C914 00721821 */ addu $v1, $v1, $s2
D_8024C918_C0A198:
/* 13FC58 8024C918 8C440000 */ lw $a0, 0x0($v0)
/* 13FC5C 8024C91C 08093251 */ j func_8024C944
/* 13FC60 8024C920 8C650004 */ lw $a1, 0x4($v1)
.L8024C924:
/* 13FC64 8024C924 8E030000 */ lw $v1, 0x0($s0)
/* 13FC68 8024C928 3C063F80 */ lui $a2, (0x3F800000 >> 16)
/* 13FC6C 8024C92C 00031080 */ sll $v0, $v1, 2
/* 13FC70 8024C930 00531021 */ addu $v0, $v0, $s3
/* 13FC74 8024C934 00031900 */ sll $v1, $v1, 4
/* 13FC78 8024C938 00721821 */ addu $v1, $v1, $s2
/* 13FC7C 8024C93C 8C440000 */ lw $a0, 0x0($v0)
/* 13FC80 8024C940 8C650000 */ lw $a1, 0x0($v1)
glabel func_8024C944
/* 13FC84 8024C944 0C0B78AB */ jal spr_update_sprite
/* 13FC88 8024C948 26100004 */ addiu $s0, $s0, 0x4
/* 13FC8C 8024C94C 3C028027 */ lui $v0, %hi(gPausePartnersNumPartners)
/* 13FC90 8024C950 8C4206B0 */ lw $v0, %lo(gPausePartnersNumPartners)($v0)
/* 13FC94 8024C954 26310001 */ addiu $s1, $s1, 0x1
/* 13FC98 8024C958 0222102A */ slt $v0, $s1, $v0
/* 13FC9C 8024C95C 1440FFE4 */ bnez $v0, .L8024C8F0
/* 13FCA0 8024C960 00000000 */ nop
.L8024C964:
/* 13FCA4 8024C964 8FBF0020 */ lw $ra, 0x20($sp)
/* 13FCA8 8024C968 8FB3001C */ lw $s3, 0x1C($sp)
/* 13FCAC 8024C96C 8FB20018 */ lw $s2, 0x18($sp)
/* 13FCB0 8024C970 8FB10014 */ lw $s1, 0x14($sp)
/* 13FCB4 8024C974 8FB00010 */ lw $s0, 0x10($sp)
/* 13FCB8 8024C978 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 13FCBC 8024C97C 03E00008 */ jr $ra
/* 13FCC0 8024C980 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void pause_partners_update(MenuPanel* panel) {
s32 i;
f32 delta;
s32 absValue;
f32 deltaBefore;
s32 sgn;
deltaBefore = gPausePartnersCurrentPartnerIdx * 360 / gPausePartnersNumPartners - gPausePartnersRotAngle;
absValue = abs(deltaBefore);
sgn = sign(deltaBefore);
if (absValue >= 16) {
delta = deltaBefore * 0.3;
} else {
delta = sgn * gPausePartnersPortraitScrollInterpTable[absValue];
gPausePartnersRotAngle = (int)gPausePartnersRotAngle;
}
gPausePartnersRotAngle += delta;
for (i = 0; i < gPausePartnersNumPartners; i++) {
if (i == gPausePartnersCurrentPartnerIdx) {
spr_update_sprite(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[i]], gPausePartnersSpriteAnims[gPausePartnersPartnerIdx[i]][1], 1.0f);
} else {
spr_update_sprite(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[i]], gPausePartnersSpriteAnims[gPausePartnersPartnerIdx[i]][0], 1.0f);
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_load_INIT
/* 2F6BC 800542BC 27BDFF70 */ addiu $sp, $sp, -0x90
/* 2F6C0 800542C0 AFB3007C */ sw $s3, 0x7C($sp)
/* 2F6C4 800542C4 0080982D */ daddu $s3, $a0, $zero
/* 2F6C8 800542C8 AFB10074 */ sw $s1, 0x74($sp)
/* 2F6CC 800542CC 00A0882D */ daddu $s1, $a1, $zero
/* 2F6D0 800542D0 AFB40080 */ sw $s4, 0x80($sp)
/* 2F6D4 800542D4 00C0A02D */ daddu $s4, $a2, $zero
/* 2F6D8 800542D8 0220202D */ daddu $a0, $s1, $zero
/* 2F6DC 800542DC 27A50010 */ addiu $a1, $sp, 0x10
/* 2F6E0 800542E0 24060040 */ addiu $a2, $zero, 0x40
/* 2F6E4 800542E4 AFB50084 */ sw $s5, 0x84($sp)
/* 2F6E8 800542E8 2675001C */ addiu $s5, $s3, 0x1C
/* 2F6EC 800542EC AFBF0088 */ sw $ra, 0x88($sp)
/* 2F6F0 800542F0 AFB20078 */ sw $s2, 0x78($sp)
/* 2F6F4 800542F4 0C015380 */ jal au_read_rom
/* 2F6F8 800542F8 AFB00070 */ sw $s0, 0x70($sp)
/* 2F6FC 800542FC 0280202D */ daddu $a0, $s4, $zero
/* 2F700 80054300 8FB00024 */ lw $s0, 0x24($sp)
/* 2F704 80054304 24050001 */ addiu $a1, $zero, 0x1
/* 2F708 80054308 AE71001C */ sw $s1, 0x1C($s3)
/* 2F70C 8005430C 8FA20024 */ lw $v0, 0x24($sp)
/* 2F710 80054310 001080C0 */ sll $s0, $s0, 3
/* 2F714 80054314 0200302D */ daddu $a2, $s0, $zero
/* 2F718 80054318 0C015FE4 */ jal alHeapAlloc
/* 2F71C 8005431C AE620024 */ sw $v0, 0x24($s3)
/* 2F720 80054320 0040282D */ daddu $a1, $v0, $zero
/* 2F724 80054324 8E62001C */ lw $v0, 0x1C($s3)
/* 2F728 80054328 AE650020 */ sw $a1, 0x20($s3)
/* 2F72C 8005432C 8FA40020 */ lw $a0, 0x20($sp)
/* 2F730 80054330 0200302D */ daddu $a2, $s0, $zero
/* 2F734 80054334 0C015380 */ jal au_read_rom
/* 2F738 80054338 00442021 */ addu $a0, $v0, $a0
/* 2F73C 8005433C 8FA20024 */ lw $v0, 0x24($sp)
/* 2F740 80054340 8E650020 */ lw $a1, 0x20($s3)
/* 2F744 80054344 0040182D */ daddu $v1, $v0, $zero
/* 2F748 80054348 2442FFFF */ addiu $v0, $v0, -0x1
/* 2F74C 8005434C 10600013 */ beqz $v1, .L8005439C
/* 2F750 80054350 AFA20024 */ sw $v0, 0x24($sp)
/* 2F754 80054354 3C0600FF */ lui $a2, (0xFFFFFF >> 16)
/* 2F758 80054358 34C6FFFF */ ori $a2, $a2, (0xFFFFFF & 0xFFFF)
/* 2F75C 8005435C 2407FFF0 */ addiu $a3, $zero, -0x10
/* 2F760 80054360 24A40004 */ addiu $a0, $a1, 0x4
.L80054364:
/* 2F764 80054364 8CA20000 */ lw $v0, 0x0($a1)
/* 2F768 80054368 00461024 */ and $v0, $v0, $a2
/* 2F76C 8005436C 1040000B */ beqz $v0, .L8005439C
/* 2F770 80054370 24A50008 */ addiu $a1, $a1, 0x8
/* 2F774 80054374 8C920000 */ lw $s2, 0x0($a0)
/* 2F778 80054378 2642000F */ addiu $v0, $s2, 0xF
/* 2F77C 8005437C 00471024 */ and $v0, $v0, $a3
/* 2F780 80054380 AC820000 */ sw $v0, 0x0($a0)
/* 2F784 80054384 8FA20024 */ lw $v0, 0x24($sp)
/* 2F788 80054388 24840008 */ addiu $a0, $a0, 0x8
/* 2F78C 8005438C 0040182D */ daddu $v1, $v0, $zero
/* 2F790 80054390 2442FFFF */ addiu $v0, $v0, -0x1
/* 2F794 80054394 1460FFF3 */ bnez $v1, .L80054364
/* 2F798 80054398 AFA20024 */ sw $v0, 0x24($sp)
.L8005439C:
/* 2F79C 8005439C 8FA20034 */ lw $v0, 0x34($sp)
/* 2F7A0 800543A0 1040002D */ beqz $v0, .L80054458
/* 2F7A4 800543A4 27A50050 */ addiu $a1, $sp, 0x50
/* 2F7A8 800543A8 8EB10000 */ lw $s1, 0x0($s5)
/* 2F7AC 800543AC 24060020 */ addiu $a2, $zero, 0x20
/* 2F7B0 800543B0 02228821 */ addu $s1, $s1, $v0
/* 2F7B4 800543B4 0C015380 */ jal au_read_rom
/* 2F7B8 800543B8 0220202D */ daddu $a0, $s1, $zero
/* 2F7BC 800543BC 0280202D */ daddu $a0, $s4, $zero
/* 2F7C0 800543C0 24050001 */ addiu $a1, $zero, 0x1
/* 2F7C4 800543C4 97A2005E */ lhu $v0, 0x5E($sp)
/* 2F7C8 800543C8 97B0005C */ lhu $s0, 0x5C($sp)
/* 2F7CC 800543CC 2442000F */ addiu $v0, $v0, 0xF
/* 2F7D0 800543D0 3052FFF0 */ andi $s2, $v0, 0xFFF0
/* 2F7D4 800543D4 0240302D */ daddu $a2, $s2, $zero
/* 2F7D8 800543D8 0C015FE4 */ jal alHeapAlloc
/* 2F7DC 800543DC 02308021 */ addu $s0, $s1, $s0
/* 2F7E0 800543E0 0200202D */ daddu $a0, $s0, $zero
/* 2F7E4 800543E4 0040282D */ daddu $a1, $v0, $zero
/* 2F7E8 800543E8 0240302D */ daddu $a2, $s2, $zero
/* 2F7EC 800543EC 0C015380 */ jal au_read_rom
/* 2F7F0 800543F0 AE65002C */ sw $a1, 0x2C($s3)
/* 2F7F4 800543F4 0280202D */ daddu $a0, $s4, $zero
/* 2F7F8 800543F8 24050001 */ addiu $a1, $zero, 0x1
/* 2F7FC 800543FC 97A20062 */ lhu $v0, 0x62($sp)
/* 2F800 80054400 97B00060 */ lhu $s0, 0x60($sp)
/* 2F804 80054404 2442000F */ addiu $v0, $v0, 0xF
/* 2F808 80054408 3052FFF0 */ andi $s2, $v0, 0xFFF0
/* 2F80C 8005440C 0240302D */ daddu $a2, $s2, $zero
/* 2F810 80054410 0C015FE4 */ jal alHeapAlloc
/* 2F814 80054414 02308021 */ addu $s0, $s1, $s0
/* 2F818 80054418 0200202D */ daddu $a0, $s0, $zero
/* 2F81C 8005441C 0040282D */ daddu $a1, $v0, $zero
/* 2F820 80054420 0240302D */ daddu $a2, $s2, $zero
/* 2F824 80054424 0C015380 */ jal au_read_rom
/* 2F828 80054428 AE65003C */ sw $a1, 0x3C($s3)
/* 2F82C 8005442C 97A20058 */ lhu $v0, 0x58($sp)
/* 2F830 80054430 02228821 */ addu $s1, $s1, $v0
/* 2F834 80054434 AE710034 */ sw $s1, 0x34($s3)
/* 2F838 80054438 97A2005A */ lhu $v0, 0x5A($sp)
/* 2F83C 8005443C 2442000F */ addiu $v0, $v0, 0xF
/* 2F840 80054440 3042FFF0 */ andi $v0, $v0, 0xFFF0
/* 2F844 80054444 AE620038 */ sw $v0, 0x38($s3)
/* 2F848 80054448 97A2005E */ lhu $v0, 0x5E($sp)
/* 2F84C 8005444C 000210C2 */ srl $v0, $v0, 3
/* 2F850 80054450 2442FFFF */ addiu $v0, $v0, -0x1
/* 2F854 80054454 AE620030 */ sw $v0, 0x30($s3)
.L80054458:
/* 2F858 80054458 8FBF0088 */ lw $ra, 0x88($sp)
/* 2F85C 8005445C 8FB50084 */ lw $s5, 0x84($sp)
/* 2F860 80054460 8FB40080 */ lw $s4, 0x80($sp)
/* 2F864 80054464 8FB3007C */ lw $s3, 0x7C($sp)
/* 2F868 80054468 8FB20078 */ lw $s2, 0x78($sp)
/* 2F86C 8005446C 8FB10074 */ lw $s1, 0x74($sp)
/* 2F870 80054470 8FB00070 */ lw $s0, 0x70($sp)
/* 2F874 80054474 03E00008 */ jr $ra
/* 2F878 80054478 27BD0090 */ addiu $sp, $sp, 0x90
### DECOMPILED C INSTRUCTIONS:
void au_load_INIT(AuGlobals* arg0, s32 romAddr, ALHeap* heap) {
SBNHeader sbnHeader;
INITHeader initHeader;
SBNFileEntry* entry;
s32 tableSize, initBase, size;
s32 tblAddr, shortsAddr;
s32* data;
s32 numEntries;
s32 tblOffset, shortsOffset;
s32* romPtr = &arg0->baseRomOffset;
au_read_rom(romAddr, &sbnHeader, sizeof(sbnHeader));
numEntries = sbnHeader.numEntries;
arg0->baseRomOffset = romAddr;
tableSize = numEntries * sizeof(SBNFileEntry);
arg0->fileListLength = sbnHeader.numEntries;
arg0->sbnFileList = alHeapAlloc(heap, 1, tableSize);
au_read_rom(arg0->baseRomOffset + sbnHeader.tableOffset, arg0->sbnFileList, tableSize);
entry = arg0->sbnFileList;
while (sbnHeader.numEntries--) {
if ((entry->offset & 0xFFFFFF) == 0) {
break;
}
size = entry->data;
entry->data = (size + 0xF) & ~0xF;
entry++;
}
if (sbnHeader.INIToffset != 0) {
initBase = *romPtr + sbnHeader.INIToffset;
au_read_rom(initBase, &initHeader, sizeof(initHeader));
tblOffset = initHeader.tblOffset;
size = (initHeader.tblSize + 0xF) & 0xFFF0;
tblAddr = initBase + tblOffset;
arg0->songList = alHeapAlloc(heap, 1, size);
au_read_rom(tblAddr, arg0->songList, size);
shortsOffset = initHeader.shortsOffset;
size = (initHeader.shortsSize + 0xF) & 0xFFF0;
shortsAddr = initBase + shortsOffset;
arg0->mseqFileList = alHeapAlloc(heap, 1, size);
au_read_rom(shortsAddr, arg0->mseqFileList, size);
arg0->bkFileListOffset = initBase + initHeader.entriesOffset;
arg0->bkListLength = (initHeader.entriesSize + 0xF) & 0xFFF0;
arg0->songListLength = initHeader.tblSize / sizeof(InitSongEntry) - 1;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel draw_entity_model_A
/* B83E8 80121CE8 27BDFF60 */ addiu $sp, $sp, -0xA0
/* B83EC 80121CEC 0080302D */ daddu $a2, $a0, $zero
/* B83F0 80121CF0 AFB1008C */ sw $s1, 0x8C($sp)
/* B83F4 80121CF4 27B10028 */ addiu $s1, $sp, 0x28
/* B83F8 80121CF8 3C07800A */ lui $a3, %hi(gCurrentCamID)
/* B83FC 80121CFC 84E7A634 */ lh $a3, %lo(gCurrentCamID)($a3)
/* B8400 80121D00 3C04800B */ lui $a0, %hi(gCameras)
/* B8404 80121D04 24841D80 */ addiu $a0, $a0, %lo(gCameras)
/* B8408 80121D08 AFBF0094 */ sw $ra, 0x94($sp)
/* B840C 80121D0C AFB20090 */ sw $s2, 0x90($sp)
/* B8410 80121D10 AFB00088 */ sw $s0, 0x88($sp)
/* B8414 80121D14 F7B40098 */ sdc1 $f20, 0x98($sp)
/* B8418 80121D18 00071080 */ sll $v0, $a3, 2
/* B841C 80121D1C 00471021 */ addu $v0, $v0, $a3
/* B8420 80121D20 00021080 */ sll $v0, $v0, 2
/* B8424 80121D24 00471023 */ subu $v0, $v0, $a3
/* B8428 80121D28 000218C0 */ sll $v1, $v0, 3
/* B842C 80121D2C 00431021 */ addu $v0, $v0, $v1
/* B8430 80121D30 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* B8434 80121D34 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* B8438 80121D38 000210C0 */ sll $v0, $v0, 3
/* B843C 80121D3C 80630070 */ lb $v1, 0x70($v1)
/* B8440 80121D40 10600004 */ beqz $v1, .L80121D54
/* B8444 80121D44 00449021 */ addu $s2, $v0, $a0
/* B8448 80121D48 30C20800 */ andi $v0, $a2, 0x800
/* B844C 80121D4C 10400053 */ beqz $v0, .L80121E9C
/* B8450 80121D50 00000000 */ nop
.L80121D54:
/* B8454 80121D54 2402F7FF */ addiu $v0, $zero, -0x801
/* B8458 80121D58 00C23024 */ and $a2, $a2, $v0
/* B845C 80121D5C 3C038015 */ lui $v1, %hi(gCurrentEntityModelList)
/* B8460 80121D60 8C634370 */ lw $v1, %lo(gCurrentEntityModelList)($v1)
/* B8464 80121D64 00061080 */ sll $v0, $a2, 2
/* B8468 80121D68 00431021 */ addu $v0, $v0, $v1
/* B846C 80121D6C 8C500000 */ lw $s0, 0x0($v0)
/* B8470 80121D70 1200004A */ beqz $s0, .L80121E9C
/* B8474 80121D74 00000000 */ nop
/* B8478 80121D78 8E030000 */ lw $v1, 0x0($s0)
/* B847C 80121D7C 10600047 */ beqz $v1, .L80121E9C
/* B8480 80121D80 30620100 */ andi $v0, $v1, 0x100
/* B8484 80121D84 14400045 */ bnez $v0, .L80121E9C
/* B8488 80121D88 30620020 */ andi $v0, $v1, 0x20
/* B848C 80121D8C 14400043 */ bnez $v0, .L80121E9C
/* B8490 80121D90 30620040 */ andi $v0, $v1, 0x40
/* B8494 80121D94 14400041 */ bnez $v0, .L80121E9C
/* B8498 80121D98 24020001 */ addiu $v0, $zero, 0x1
/* B849C 80121D9C 00E21004 */ sllv $v0, $v0, $a3
/* B84A0 80121DA0 00621024 */ and $v0, $v1, $v0
/* B84A4 80121DA4 1040003D */ beqz $v0, .L80121E9C
/* B84A8 80121DA8 26030018 */ addiu $v1, $s0, 0x18
/* B84AC 80121DAC 00A0102D */ daddu $v0, $a1, $zero
/* B84B0 80121DB0 24A40040 */ addiu $a0, $a1, 0x40
.L80121DB4:
/* B84B4 80121DB4 8C480000 */ lw $t0, 0x0($v0)
/* B84B8 80121DB8 8C490004 */ lw $t1, 0x4($v0)
/* B84BC 80121DBC 8C4A0008 */ lw $t2, 0x8($v0)
/* B84C0 80121DC0 8C4B000C */ lw $t3, 0xC($v0)
/* B84C4 80121DC4 AC680000 */ sw $t0, 0x0($v1)
/* B84C8 80121DC8 AC690004 */ sw $t1, 0x4($v1)
/* B84CC 80121DCC AC6A0008 */ sw $t2, 0x8($v1)
/* B84D0 80121DD0 AC6B000C */ sw $t3, 0xC($v1)
/* B84D4 80121DD4 24420010 */ addiu $v0, $v0, 0x10
/* B84D8 80121DD8 1444FFF6 */ bne $v0, $a0, .L80121DB4
/* B84DC 80121DDC 24630010 */ addiu $v1, $v1, 0x10
/* B84E0 80121DE0 27A40038 */ addiu $a0, $sp, 0x38
/* B84E4 80121DE4 0C019D60 */ jal guMtxL2F
/* B84E8 80121DE8 AE00005C */ sw $zero, 0x5C($s0)
/* B84EC 80121DEC 264400D4 */ addiu $a0, $s2, 0xD4
/* B84F0 80121DF0 C7A00068 */ lwc1 $f0, 0x68($sp)
/* B84F4 80121DF4 C7A2006C */ lwc1 $f2, 0x6C($sp)
/* B84F8 80121DF8 C7B40070 */ lwc1 $f20, 0x70($sp)
/* B84FC 80121DFC 27A20078 */ addiu $v0, $sp, 0x78
/* B8500 80121E00 AFA20014 */ sw $v0, 0x14($sp)
/* B8504 80121E04 27A2007C */ addiu $v0, $sp, 0x7C
/* B8508 80121E08 AFA20018 */ sw $v0, 0x18($sp)
/* B850C 80121E0C 27A20080 */ addiu $v0, $sp, 0x80
/* B8510 80121E10 AFA2001C */ sw $v0, 0x1C($sp)
/* B8514 80121E14 44050000 */ mfc1 $a1, $f0
/* B8518 80121E18 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* B851C 80121E1C 44810000 */ mtc1 $at, $f0
/* B8520 80121E20 44061000 */ mfc1 $a2, $f2
/* B8524 80121E24 4407A000 */ mfc1 $a3, $f20
/* B8528 80121E28 27A20084 */ addiu $v0, $sp, 0x84
/* B852C 80121E2C AFA20020 */ sw $v0, 0x20($sp)
/* B8530 80121E30 0C00A588 */ jal transform_point
/* B8534 80121E34 E7A00010 */ swc1 $f0, 0x10($sp)
/* B8538 80121E38 82030004 */ lb $v1, 0x4($s0)
/* B853C 80121E3C 3C028012 */ lui $v0, %hi(appendGfx_entity_model)
/* B8540 80121E40 24421184 */ addiu $v0, $v0, %lo(appendGfx_entity_model)
/* B8544 80121E44 AE300008 */ sw $s0, 0x8($s1)
/* B8548 80121E48 AE22000C */ sw $v0, 0xC($s1)
/* B854C 80121E4C AE230000 */ sw $v1, 0x0($s1)
/* B8550 80121E50 8E020000 */ lw $v0, 0x0($s0)
/* B8554 80121E54 3042F000 */ andi $v0, $v0, 0xF000
/* B8558 80121E58 00021202 */ srl $v0, $v0, 8
/* B855C 80121E5C 44821000 */ mtc1 $v0, $f2
/* B8560 80121E60 00000000 */ nop
/* B8564 80121E64 468010A1 */ cvt.d.w $f2, $f2
/* B8568 80121E68 04430007 */ bgezl $v0, .L80121E88
/* B856C 80121E6C 46201020 */ cvt.s.d $f0, $f2
/* B8570 80121E70 3C0141F0 */ lui $at, (0x41F00000 >> 16)
/* B8574 80121E74 44810800 */ mtc1 $at, $f1
/* B8578 80121E78 44800000 */ mtc1 $zero, $f0
/* B857C 80121E7C 00000000 */ nop
/* B8580 80121E80 46201080 */ add.d $f2, $f2, $f0
/* B8584 80121E84 46201020 */ cvt.s.d $f0, $f2
.L80121E88:
/* B8588 80121E88 46140000 */ add.s $f0, $f0, $f20
/* B858C 80121E8C 0220202D */ daddu $a0, $s1, $zero
/* B8590 80121E90 4600010D */ trunc.w.s $f4, $f0
/* B8594 80121E94 0C047644 */ jal queue_render_task
/* B8598 80121E98 E4840004 */ swc1 $f4, 0x4($a0)
.L80121E9C:
/* B859C 80121E9C 8FBF0094 */ lw $ra, 0x94($sp)
/* B85A0 80121EA0 8FB20090 */ lw $s2, 0x90($sp)
/* B85A4 80121EA4 8FB1008C */ lw $s1, 0x8C($sp)
/* B85A8 80121EA8 8FB00088 */ lw $s0, 0x88($sp)
/* B85AC 80121EAC D7B40098 */ ldc1 $f20, 0x98($sp)
/* B85B0 80121EB0 03E00008 */ jr $ra
/* B85B4 80121EB4 27BD00A0 */ addiu $sp, $sp, 0xA0
### DECOMPILED C INSTRUCTIONS:
void draw_entity_model_A(s32 modelIdx, Mtx* transformMtx) {
EntityModel* model;
RenderTask rt;
RenderTask* rtPtr = &rt;
Camera* camera = &gCameras[gCurrentCamID];
Matrix4f mtx;
f32 x, y, z, w;
f32 inX, inY, inZ;
if ((gGameStatusPtr->isBattle == 0) || (modelIdx & 0x800)) {
modelIdx &= ~0x800;
model = (*gCurrentEntityModelList)[modelIdx];
if (model != NULL) {
if (model->flags != 0) {
if (!(model->flags & ENTITY_MODEL_FLAG_100)) {
if (!(model->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
if (!(model->flags & ENTITY_MODEL_FLAG_40) && (model->flags & (1 << gCurrentCamID))) {
model->transform = *transformMtx;
model->vertexArray = NULL;
guMtxL2F(mtx, transformMtx);
inX = mtx[3][0];
inY = mtx[3][1];
inZ = mtx[3][2];
transform_point(camera->perspectiveMatrix, inX, inY, inZ, 1.0f, &x, &y, &z, &w);
rtPtr->renderMode = model->renderMode;
rtPtr->appendGfxArg = model;
rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model;
rtPtr->distance = ((u32)(model->flags & 0xF000) >> 8) + inZ;
queue_render_task(rtPtr);
}
}
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel partner_do_player_collision
/* 88AF0 800EF640 27BDFF98 */ addiu $sp, $sp, -0x68
/* 88AF4 800EF644 AFB1004C */ sw $s1, 0x4C($sp)
/* 88AF8 800EF648 0080882D */ daddu $s1, $a0, $zero
/* 88AFC 800EF64C AFB30054 */ sw $s3, 0x54($sp)
/* 88B00 800EF650 3C13800B */ lui $s3, %hi(gCameras + 0xD4)
/* 88B04 800EF654 26731E54 */ addiu $s3, $s3, %lo(gCameras + 0xD4)
/* 88B08 800EF658 0260202D */ daddu $a0, $s3, $zero
/* 88B0C 800EF65C AFB20050 */ sw $s2, 0x50($sp)
/* 88B10 800EF660 3C128011 */ lui $s2, %hi(gPlayerStatus)
/* 88B14 800EF664 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus)
/* 88B18 800EF668 AFBF005C */ sw $ra, 0x5C($sp)
/* 88B1C 800EF66C AFB40058 */ sw $s4, 0x58($sp)
/* 88B20 800EF670 AFB00048 */ sw $s0, 0x48($sp)
/* 88B24 800EF674 F7B40060 */ sdc1 $f20, 0x60($sp)
/* 88B28 800EF678 8E450028 */ lw $a1, 0x28($s2)
/* 88B2C 800EF67C 8E46002C */ lw $a2, 0x2C($s2)
/* 88B30 800EF680 8E470030 */ lw $a3, 0x30($s2)
/* 88B34 800EF684 27A20028 */ addiu $v0, $sp, 0x28
/* 88B38 800EF688 AFA20014 */ sw $v0, 0x14($sp)
/* 88B3C 800EF68C 27A2002C */ addiu $v0, $sp, 0x2C
/* 88B40 800EF690 AFA20018 */ sw $v0, 0x18($sp)
/* 88B44 800EF694 27A20030 */ addiu $v0, $sp, 0x30
/* 88B48 800EF698 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 88B4C 800EF69C 4481A000 */ mtc1 $at, $f20
/* 88B50 800EF6A0 27B00034 */ addiu $s0, $sp, 0x34
/* 88B54 800EF6A4 AFA2001C */ sw $v0, 0x1C($sp)
/* 88B58 800EF6A8 AFB00020 */ sw $s0, 0x20($sp)
/* 88B5C 800EF6AC 0C00A588 */ jal transform_point
/* 88B60 800EF6B0 E7B40010 */ swc1 $f20, 0x10($sp)
/* 88B64 800EF6B4 0260202D */ daddu $a0, $s3, $zero
/* 88B68 800EF6B8 27A20038 */ addiu $v0, $sp, 0x38
/* 88B6C 800EF6BC AFA20014 */ sw $v0, 0x14($sp)
/* 88B70 800EF6C0 27A2003C */ addiu $v0, $sp, 0x3C
/* 88B74 800EF6C4 AFA20018 */ sw $v0, 0x18($sp)
/* 88B78 800EF6C8 27A20040 */ addiu $v0, $sp, 0x40
/* 88B7C 800EF6CC AFB00020 */ sw $s0, 0x20($sp)
/* 88B80 800EF6D0 26300038 */ addiu $s0, $s1, 0x38
/* 88B84 800EF6D4 E7B40010 */ swc1 $f20, 0x10($sp)
/* 88B88 800EF6D8 AFA2001C */ sw $v0, 0x1C($sp)
/* 88B8C 800EF6DC 8E250038 */ lw $a1, 0x38($s1)
/* 88B90 800EF6E0 8E26003C */ lw $a2, 0x3C($s1)
/* 88B94 800EF6E4 8E270040 */ lw $a3, 0x40($s1)
/* 88B98 800EF6E8 0C00A588 */ jal transform_point
/* 88B9C 800EF6EC 26340040 */ addiu $s4, $s1, 0x40
/* 88BA0 800EF6F0 862200A6 */ lh $v0, 0xA6($s1)
/* 88BA4 800EF6F4 864300B2 */ lh $v1, 0xB2($s2)
/* 88BA8 800EF6F8 3C013F66 */ lui $at, (0x3F666666 >> 16)
/* 88BAC 800EF6FC 34216666 */ ori $at, $at, (0x3F666666 & 0xFFFF)
/* 88BB0 800EF700 44810000 */ mtc1 $at, $f0
/* 88BB4 800EF704 00431021 */ addu $v0, $v0, $v1
/* 88BB8 800EF708 44824000 */ mtc1 $v0, $f8
/* 88BBC 800EF70C 00000000 */ nop
/* 88BC0 800EF710 46804220 */ cvt.s.w $f8, $f8
/* 88BC4 800EF714 46004202 */ mul.s $f8, $f8, $f0
/* 88BC8 800EF718 00000000 */ nop
/* 88BCC 800EF71C C7A60028 */ lwc1 $f6, 0x28($sp)
/* 88BD0 800EF720 C7A00038 */ lwc1 $f0, 0x38($sp)
/* 88BD4 800EF724 C7A4002C */ lwc1 $f4, 0x2C($sp)
/* 88BD8 800EF728 46003181 */ sub.s $f6, $f6, $f0
/* 88BDC 800EF72C C7A0003C */ lwc1 $f0, 0x3C($sp)
/* 88BE0 800EF730 C7A20030 */ lwc1 $f2, 0x30($sp)
/* 88BE4 800EF734 46002101 */ sub.s $f4, $f4, $f0
/* 88BE8 800EF738 C7A00040 */ lwc1 $f0, 0x40($sp)
/* 88BEC 800EF73C 46001081 */ sub.s $f2, $f2, $f0
/* 88BF0 800EF740 46003185 */ abs.s $f6, $f6
/* 88BF4 800EF744 E7A60028 */ swc1 $f6, 0x28($sp)
/* 88BF8 800EF748 46002105 */ abs.s $f4, $f4
/* 88BFC 800EF74C 4608303E */ c.le.s $f6, $f8
/* 88C00 800EF750 E7A4002C */ swc1 $f4, 0x2C($sp)
/* 88C04 800EF754 46001285 */ abs.s $f10, $f2
/* 88C08 800EF758 4500002B */ bc1f .L800EF808
/* 88C0C 800EF75C E7AA0030 */ swc1 $f10, 0x30($sp)
/* 88C10 800EF760 862200A8 */ lh $v0, 0xA8($s1)
/* 88C14 800EF764 864300B0 */ lh $v1, 0xB0($s2)
/* 88C18 800EF768 00431021 */ addu $v0, $v0, $v1
/* 88C1C 800EF76C 44820000 */ mtc1 $v0, $f0
/* 88C20 800EF770 00000000 */ nop
/* 88C24 800EF774 46800020 */ cvt.s.w $f0, $f0
/* 88C28 800EF778 4600203E */ c.le.s $f4, $f0
/* 88C2C 800EF77C 00000000 */ nop
/* 88C30 800EF780 45000021 */ bc1f .L800EF808
/* 88C34 800EF784 00000000 */ nop
/* 88C38 800EF788 3C014010 */ lui $at, (0x40100000 >> 16)
/* 88C3C 800EF78C 44811800 */ mtc1 $at, $f3
/* 88C40 800EF790 44801000 */ mtc1 $zero, $f2
/* 88C44 800EF794 46005021 */ cvt.d.s $f0, $f10
/* 88C48 800EF798 4622003E */ c.le.d $f0, $f2
/* 88C4C 800EF79C 00000000 */ nop
/* 88C50 800EF7A0 45000019 */ bc1f .L800EF808
/* 88C54 800EF7A4 00000000 */ nop
/* 88C58 800EF7A8 8E260038 */ lw $a2, 0x38($s1)
/* 88C5C 800EF7AC 8E270040 */ lw $a3, 0x40($s1)
/* 88C60 800EF7B0 C64C0028 */ lwc1 $f12, 0x28($s2)
/* 88C64 800EF7B4 0C00A720 */ jal atan2
/* 88C68 800EF7B8 C64E0030 */ lwc1 $f14, 0x30($s2)
/* 88C6C 800EF7BC 4405A000 */ mfc1 $a1, $f20
/* 88C70 800EF7C0 44060000 */ mfc1 $a2, $f0
/* 88C74 800EF7C4 0C00EA95 */ jal npc_move_heading
/* 88C78 800EF7C8 0220202D */ daddu $a0, $s1, $zero
/* 88C7C 800EF7CC 0200202D */ daddu $a0, $s0, $zero
/* 88C80 800EF7D0 3C028007 */ lui $v0, %hi(gCurrentCameraID)
/* 88C84 800EF7D4 8C427410 */ lw $v0, %lo(gCurrentCameraID)($v0)
/* 88C88 800EF7D8 3C064000 */ lui $a2, (0x40000000 >> 16)
/* 88C8C 800EF7DC 00021880 */ sll $v1, $v0, 2
/* 88C90 800EF7E0 00621821 */ addu $v1, $v1, $v0
/* 88C94 800EF7E4 00031880 */ sll $v1, $v1, 2
/* 88C98 800EF7E8 00621823 */ subu $v1, $v1, $v0
/* 88C9C 800EF7EC 000310C0 */ sll $v0, $v1, 3
/* 88CA0 800EF7F0 00621821 */ addu $v1, $v1, $v0
/* 88CA4 800EF7F4 000318C0 */ sll $v1, $v1, 3
/* 88CA8 800EF7F8 02631821 */ addu $v1, $s3, $v1
/* 88CAC 800EF7FC 8C67FF98 */ lw $a3, -0x68($v1)
/* 88CB0 800EF800 0C00A7E7 */ jal add_vec2D_polar
/* 88CB4 800EF804 0280282D */ daddu $a1, $s4, $zero
.L800EF808:
/* 88CB8 800EF808 8FBF005C */ lw $ra, 0x5C($sp)
/* 88CBC 800EF80C 8FB40058 */ lw $s4, 0x58($sp)
/* 88CC0 800EF810 8FB30054 */ lw $s3, 0x54($sp)
/* 88CC4 800EF814 8FB20050 */ lw $s2, 0x50($sp)
/* 88CC8 800EF818 8FB1004C */ lw $s1, 0x4C($sp)
/* 88CCC 800EF81C 8FB00048 */ lw $s0, 0x48($sp)
/* 88CD0 800EF820 D7B40060 */ ldc1 $f20, 0x60($sp)
/* 88CD4 800EF824 03E00008 */ jr $ra
/* 88CD8 800EF828 27BD0068 */ addiu $sp, $sp, 0x68
### DECOMPILED C INSTRUCTIONS:
void partner_do_player_collision(Npc* partner) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 playerScreenX;
f32 playerScreenY;
f32 playerScreenZ;
f32 partnerScreenX;
f32 partnerScreenY;
f32 partnerScreenZ;
f32 W;
transform_point(gCameras[CAM_DEFAULT].perspectiveMatrix,
playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 1.0f,
&playerScreenX, &playerScreenY, &playerScreenZ, &W);
transform_point(gCameras[CAM_DEFAULT].perspectiveMatrix, partner->pos.x, partner->pos.y, partner->pos.z, 1.0f,
&partnerScreenX, &partnerScreenY, &partnerScreenZ, &W);
playerScreenX = fabsf(playerScreenX - partnerScreenX);
playerScreenY = fabsf(playerScreenY - partnerScreenY);
playerScreenZ = fabsf(playerScreenZ - partnerScreenZ);
if (playerScreenX <= (partner->collisionDiameter + playerStatus->colliderDiameter) * 0.9f &&
playerScreenY <= partner->collisionHeight + playerStatus->colliderHeight && playerScreenZ <= 4.0)
{
npc_move_heading(partner, 1.0f,
atan2(playerStatus->position.x, playerStatus->position.z, partner->pos.x, partner->pos.z));
add_vec2D_polar(&partner->pos.x, &partner->pos.z, 2.0f, gCameras[gCurrentCameraID].currentYaw);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_model_animator
/* B4FBC 8011E8BC 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* B4FC0 8011E8C0 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* B4FC4 8011E8C4 27BDFFE0 */ addiu $sp, $sp, -0x20
/* B4FC8 8011E8C8 AFBF001C */ sw $ra, 0x1C($sp)
/* B4FCC 8011E8CC AFB20018 */ sw $s2, 0x18($sp)
/* B4FD0 8011E8D0 AFB10014 */ sw $s1, 0x14($sp)
/* B4FD4 8011E8D4 AFB00010 */ sw $s0, 0x10($sp)
/* B4FD8 8011E8D8 80420070 */ lb $v0, 0x70($v0)
/* B4FDC 8011E8DC 10400003 */ beqz $v0, .L8011E8EC
/* B4FE0 8011E8E0 30820800 */ andi $v0, $a0, 0x800
/* B4FE4 8011E8E4 10400055 */ beqz $v0, .L8011EA3C
/* B4FE8 8011E8E8 00000000 */ nop
.L8011E8EC:
/* B4FEC 8011E8EC 2402F7FF */ addiu $v0, $zero, -0x801
/* B4FF0 8011E8F0 00822024 */ and $a0, $a0, $v0
/* B4FF4 8011E8F4 3C038015 */ lui $v1, %hi(gCurrentAnimMeshListPtr)
/* B4FF8 8011E8F8 8C633A40 */ lw $v1, %lo(gCurrentAnimMeshListPtr)($v1)
/* B4FFC 8011E8FC 00041080 */ sll $v0, $a0, 2
/* B5000 8011E900 00431021 */ addu $v0, $v0, $v1
/* B5004 8011E904 8C500000 */ lw $s0, 0x0($v0)
/* B5008 8011E908 1200004C */ beqz $s0, .L8011EA3C
/* B500C 8011E90C 00000000 */ nop
/* B5010 8011E910 8E040000 */ lw $a0, 0x0($s0)
/* B5014 8011E914 10800049 */ beqz $a0, .L8011EA3C
/* B5018 8011E918 3C020004 */ lui $v0, (0x40000 >> 16)
/* B501C 8011E91C 00821024 */ and $v0, $a0, $v0
/* B5020 8011E920 14400046 */ bnez $v0, .L8011EA3C
/* B5024 8011E924 0000182D */ daddu $v1, $zero, $zero
/* B5028 8011E928 C6000090 */ lwc1 $f0, 0x90($s0)
/* B502C 8011E92C C6020094 */ lwc1 $f2, 0x94($s0)
/* B5030 8011E930 2402FFBF */ addiu $v0, $zero, -0x41
/* B5034 8011E934 46020001 */ sub.s $f0, $f0, $f2
/* B5038 8011E938 44801000 */ mtc1 $zero, $f2
/* B503C 8011E93C 00821024 */ and $v0, $a0, $v0
/* B5040 8011E940 AE020000 */ sw $v0, 0x0($s0)
/* B5044 8011E944 4602003E */ c.le.s $f0, $f2
/* B5048 8011E948 00000000 */ nop
/* B504C 8011E94C 45000014 */ bc1f .L8011E9A0
/* B5050 8011E950 E6000090 */ swc1 $f0, 0x90($s0)
/* B5054 8011E954 30428000 */ andi $v0, $v0, 0x8000
/* B5058 8011E958 14400008 */ bnez $v0, .L8011E97C
/* B505C 8011E95C 0200202D */ daddu $a0, $s0, $zero
.L8011E960:
/* B5060 8011E960 0C047AFC */ jal step_model_animator
/* B5064 8011E964 0200202D */ daddu $a0, $s0, $zero
/* B5068 8011E968 0040182D */ daddu $v1, $v0, $zero
/* B506C 8011E96C 1C60FFFC */ bgtz $v1, .L8011E960
/* B5070 8011E970 2402FFFF */ addiu $v0, $zero, -0x1
/* B5074 8011E974 08047A69 */ j .L8011E9A4
/* B5078 8011E978 00000000 */ nop
.L8011E97C:
/* B507C 8011E97C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* B5080 8011E980 44810000 */ mtc1 $at, $f0
/* B5084 8011E984 0C04819E */ jal reload_mesh_animator_tree
/* B5088 8011E988 E6000090 */ swc1 $f0, 0x90($s0)
.L8011E98C:
/* B508C 8011E98C 0C0481BE */ jal step_mesh_animator
/* B5090 8011E990 0200202D */ daddu $a0, $s0, $zero
/* B5094 8011E994 0040182D */ daddu $v1, $v0, $zero
/* B5098 8011E998 1C60FFFC */ bgtz $v1, .L8011E98C
/* B509C 8011E99C 00000000 */ nop
.L8011E9A0:
/* B50A0 8011E9A0 2402FFFF */ addiu $v0, $zero, -0x1
.L8011E9A4:
/* B50A4 8011E9A4 10620025 */ beq $v1, $v0, .L8011EA3C
/* B50A8 8011E9A8 0200202D */ daddu $a0, $s0, $zero
/* B50AC 8011E9AC 0C047C16 */ jal animator_update_model_transforms
/* B50B0 8011E9B0 0000282D */ daddu $a1, $zero, $zero
/* B50B4 8011E9B4 0000882D */ daddu $s1, $zero, $zero
/* B50B8 8011E9B8 2412FFFF */ addiu $s2, $zero, -0x1
/* B50BC 8011E9BC 3C108015 */ lui $s0, %hi(D_801533C0)
/* B50C0 8011E9C0 261033C0 */ addiu $s0, $s0, %lo(D_801533C0)
.L8011E9C4:
/* B50C4 8011E9C4 8E020000 */ lw $v0, 0x0($s0)
/* B50C8 8011E9C8 04420008 */ bltzl $v0, .L8011E9EC
/* B50CC 8011E9CC 26310001 */ addiu $s1, $s1, 0x1
/* B50D0 8011E9D0 2442FFFF */ addiu $v0, $v0, -0x1
/* B50D4 8011E9D4 14400004 */ bnez $v0, .L8011E9E8
/* B50D8 8011E9D8 AE020000 */ sw $v0, 0x0($s0)
/* B50DC 8011E9DC 8E040004 */ lw $a0, 0x4($s0)
/* B50E0 8011E9E0 0C00AB1E */ jal general_heap_free
/* B50E4 8011E9E4 AE120000 */ sw $s2, 0x0($s0)
.L8011E9E8:
/* B50E8 8011E9E8 26310001 */ addiu $s1, $s1, 0x1
.L8011E9EC:
/* B50EC 8011E9EC 2A220060 */ slti $v0, $s1, 0x60
/* B50F0 8011E9F0 1440FFF4 */ bnez $v0, .L8011E9C4
/* B50F4 8011E9F4 26100008 */ addiu $s0, $s0, 0x8
/* B50F8 8011E9F8 0000882D */ daddu $s1, $zero, $zero
/* B50FC 8011E9FC 2412FFFF */ addiu $s2, $zero, -0x1
/* B5100 8011EA00 3C108015 */ lui $s0, %hi(D_801536C0)
/* B5104 8011EA04 261036C0 */ addiu $s0, $s0, %lo(D_801536C0)
.L8011EA08:
/* B5108 8011EA08 8E020000 */ lw $v0, 0x0($s0)
/* B510C 8011EA0C 04420008 */ bltzl $v0, .L8011EA30
/* B5110 8011EA10 26310001 */ addiu $s1, $s1, 0x1
/* B5114 8011EA14 2442FFFF */ addiu $v0, $v0, -0x1
/* B5118 8011EA18 14400004 */ bnez $v0, .L8011EA2C
/* B511C 8011EA1C AE020000 */ sw $v0, 0x0($s0)
/* B5120 8011EA20 8E040004 */ lw $a0, 0x4($s0)
/* B5124 8011EA24 0C00AB1E */ jal general_heap_free
/* B5128 8011EA28 AE120000 */ sw $s2, 0x0($s0)
.L8011EA2C:
/* B512C 8011EA2C 26310001 */ addiu $s1, $s1, 0x1
.L8011EA30:
/* B5130 8011EA30 2A220060 */ slti $v0, $s1, 0x60
/* B5134 8011EA34 1440FFF4 */ bnez $v0, .L8011EA08
/* B5138 8011EA38 26100008 */ addiu $s0, $s0, 0x8
.L8011EA3C:
/* B513C 8011EA3C 8FBF001C */ lw $ra, 0x1C($sp)
/* B5140 8011EA40 8FB20018 */ lw $s2, 0x18($sp)
/* B5144 8011EA44 8FB10014 */ lw $s1, 0x14($sp)
/* B5148 8011EA48 8FB00010 */ lw $s0, 0x10($sp)
/* B514C 8011EA4C 03E00008 */ jr $ra
/* B5150 8011EA50 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void update_model_animator(s32 animatorID) {
if (!gGameStatusPtr->isBattle || animatorID & 0x800) {
ModelAnimator* animator;
animatorID &= ~0x800;
animator = (*gCurrentAnimMeshListPtr)[animatorID];
if (animator != NULL && animator->flags != 0) {
s32 temp = 0;
if (!(animator->flags & MODEL_ANIMATOR_FLAG_FREEZE_ANIMATION)) {
animator->flags &= ~MODEL_ANIMATOR_FLAG_UPDATE_PENDING;
animator->nextUpdateTime -= animator->timeScale;
if (animator->nextUpdateTime <= 0.0f) {
if (!(animator->flags & MODEL_ANIMATOR_FLAG_MESH)) {
do {
temp = step_model_animator(animator);
} while (temp > 0);
} else {
animator->nextUpdateTime = 1.0f;
reload_mesh_animator_tree(animator);
do {
temp = step_mesh_animator(animator);
} while (temp > 0);
}
}
if (temp != -1) {
s32 i;
animator_update_model_transforms(animator, NULL);
for (i = 0; i < ARRAY_COUNT(D_801533C0); i++) {
if (D_801533C0[i].ttl >= 0) {
D_801533C0[i].ttl--;
if (D_801533C0[i].ttl == 0) {
D_801533C0[i].ttl = -1;
general_heap_free(D_801533C0[i].addr);
}
}
}
for (i = 0; i < ARRAY_COUNT(D_801536C0); i++) {
if (D_801536C0[i].ttl >= 0) {
D_801536C0[i].ttl--;
if (D_801536C0[i].ttl == 0) {
D_801536C0[i].ttl = -1;
general_heap_free(D_801536C0[i].addr);
}
}
}
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80260E90
/* 18F770 80260E90 27BDFF98 */ addiu $sp, $sp, -0x68
/* 18F774 80260E94 AFB50044 */ sw $s5, 0x44($sp)
/* 18F778 80260E98 0080A82D */ daddu $s5, $a0, $zero
/* 18F77C 80260E9C AFB10034 */ sw $s1, 0x34($sp)
/* 18F780 80260EA0 0000882D */ daddu $s1, $zero, $zero
/* 18F784 80260EA4 2405001D */ addiu $a1, $zero, 0x1D
/* 18F788 80260EA8 F7B40050 */ sdc1 $f20, 0x50($sp)
/* 18F78C 80260EAC 4480A000 */ mtc1 $zero, $f20
/* 18F790 80260EB0 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 18F794 80260EB4 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 18F798 80260EB8 AFBF0048 */ sw $ra, 0x48($sp)
/* 18F79C 80260EBC AFB40040 */ sw $s4, 0x40($sp)
/* 18F7A0 80260EC0 AFB3003C */ sw $s3, 0x3C($sp)
/* 18F7A4 80260EC4 AFB20038 */ sw $s2, 0x38($sp)
/* 18F7A8 80260EC8 AFB00030 */ sw $s0, 0x30($sp)
/* 18F7AC 80260ECC F7B80060 */ sdc1 $f24, 0x60($sp)
/* 18F7B0 80260ED0 F7B60058 */ sdc1 $f22, 0x58($sp)
/* 18F7B4 80260ED4 8C5300D8 */ lw $s3, 0xD8($v0)
/* 18F7B8 80260ED8 8442017A */ lh $v0, 0x17A($v0)
/* 18F7BC 80260EDC 0260202D */ daddu $a0, $s3, $zero
/* 18F7C0 80260EE0 00021140 */ sll $v0, $v0, 5
/* 18F7C4 80260EE4 3C128008 */ lui $s2, %hi(gItemTable + 0xC)
/* 18F7C8 80260EE8 02429021 */ addu $s2, $s2, $v0
/* 18F7CC 80260EEC 865278EC */ lh $s2, %lo(gItemTable + 0xC)($s2)
/* 18F7D0 80260EF0 92620191 */ lbu $v0, 0x191($s3)
/* 18F7D4 80260EF4 C6620148 */ lwc1 $f2, 0x148($s3)
/* 18F7D8 80260EF8 44820000 */ mtc1 $v0, $f0
/* 18F7DC 80260EFC 00000000 */ nop
/* 18F7E0 80260F00 46800020 */ cvt.s.w $f0, $f0
/* 18F7E4 80260F04 0C099CAB */ jal player_team_is_ability_active
/* 18F7E8 80260F08 46001580 */ add.s $f22, $f2, $f0
/* 18F7EC 80260F0C 50400048 */ beql $v0, $zero, .L80261030
/* 18F7F0 80260F10 AEB10084 */ sw $s1, 0x84($s5)
/* 18F7F4 80260F14 1A400045 */ blez $s2, .L8026102C
/* 18F7F8 80260F18 3C0451EB */ lui $a0, (0x51EB851F >> 16)
/* 18F7FC 80260F1C 3484851F */ ori $a0, $a0, (0x51EB851F & 0xFFFF)
/* 18F800 80260F20 00121880 */ sll $v1, $s2, 2
/* 18F804 80260F24 00721821 */ addu $v1, $v1, $s2
/* 18F808 80260F28 00031100 */ sll $v0, $v1, 4
/* 18F80C 80260F2C 00431023 */ subu $v0, $v0, $v1
/* 18F810 80260F30 24420063 */ addiu $v0, $v0, 0x63
/* 18F814 80260F34 00440018 */ mult $v0, $a0
/* 18F818 80260F38 000217C3 */ sra $v0, $v0, 31
/* 18F81C 80260F3C 00004010 */ mfhi $t0
/* 18F820 80260F40 00081943 */ sra $v1, $t0, 5
/* 18F824 80260F44 00629023 */ subu $s2, $v1, $v0
/* 18F828 80260F48 0232102A */ slt $v0, $s1, $s2
/* 18F82C 80260F4C 10400019 */ beqz $v0, .L80260FB4
/* 18F830 80260F50 0220802D */ daddu $s0, $s1, $zero
/* 18F834 80260F54 24140017 */ addiu $s4, $zero, 0x17
/* 18F838 80260F58 3C0141F0 */ lui $at, (0x41F00000 >> 16)
/* 18F83C 80260F5C 4481C000 */ mtc1 $at, $f24
/* 18F840 80260F60 24110001 */ addiu $s1, $zero, 0x1
.L80260F64:
/* 18F844 80260F64 C6600144 */ lwc1 $f0, 0x144($s3)
/* 18F848 80260F68 C662014C */ lwc1 $f2, 0x14C($s3)
/* 18F84C 80260F6C 4600A10D */ trunc.w.s $f4, $f20
/* 18F850 80260F70 E7A40018 */ swc1 $f4, 0x18($sp)
/* 18F854 80260F74 24040157 */ addiu $a0, $zero, 0x157
/* 18F858 80260F78 AFB10014 */ sw $s1, 0x14($sp)
/* 18F85C 80260F7C 26310003 */ addiu $s1, $s1, 0x3
/* 18F860 80260F80 26100001 */ addiu $s0, $s0, 0x1
/* 18F864 80260F84 4406B000 */ mfc1 $a2, $f22
/* 18F868 80260F88 44050000 */ mfc1 $a1, $f0
/* 18F86C 80260F8C 44071000 */ mfc1 $a3, $f2
/* 18F870 80260F90 4618A500 */ add.s $f20, $f20, $f24
/* 18F874 80260F94 AFB40010 */ sw $s4, 0x10($sp)
/* 18F878 80260F98 0C04C4FD */ jal make_item_entity
/* 18F87C 80260F9C AFA0001C */ sw $zero, 0x1C($sp)
/* 18F880 80260FA0 0C03A830 */ jal add_coins
/* 18F884 80260FA4 24040001 */ addiu $a0, $zero, 0x1
/* 18F888 80260FA8 0212102A */ slt $v0, $s0, $s2
/* 18F88C 80260FAC 1440FFED */ bnez $v0, .L80260F64
/* 18F890 80260FB0 00000000 */ nop
.L80260FB4:
/* 18F894 80260FB4 00101040 */ sll $v0, $s0, 1
/* 18F898 80260FB8 00501021 */ addu $v0, $v0, $s0
/* 18F89C 80260FBC 2451001E */ addiu $s1, $v0, 0x1E
/* 18F8A0 80260FC0 C6600144 */ lwc1 $f0, 0x144($s3)
/* 18F8A4 80260FC4 C6760148 */ lwc1 $f22, 0x148($s3)
/* 18F8A8 80260FC8 C662014C */ lwc1 $f2, 0x14C($s3)
/* 18F8AC 80260FCC 3C048007 */ lui $a0, %hi(gCurrentCameraID)
/* 18F8B0 80260FD0 8C847410 */ lw $a0, %lo(gCurrentCameraID)($a0)
/* 18F8B4 80260FD4 27A20020 */ addiu $v0, $sp, 0x20
/* 18F8B8 80260FD8 AFA20010 */ sw $v0, 0x10($sp)
/* 18F8BC 80260FDC 27A20024 */ addiu $v0, $sp, 0x24
/* 18F8C0 80260FE0 AFA20014 */ sw $v0, 0x14($sp)
/* 18F8C4 80260FE4 44050000 */ mfc1 $a1, $f0
/* 18F8C8 80260FE8 4406B000 */ mfc1 $a2, $f22
/* 18F8CC 80260FEC 44071000 */ mfc1 $a3, $f2
/* 18F8D0 80260FF0 27A20028 */ addiu $v0, $sp, 0x28
/* 18F8D4 80260FF4 0C00B94E */ jal get_screen_coords
/* 18F8D8 80260FF8 AFA20018 */ sw $v0, 0x18($sp)
/* 18F8DC 80260FFC 3C048011 */ lui $a0, %hi(HES_Refund)
/* 18F8E0 80261000 24848A64 */ addiu $a0, $a0, %lo(HES_Refund)
/* 18F8E4 80261004 0C050529 */ jal hud_element_create
/* 18F8E8 80261008 00000000 */ nop
/* 18F8EC 8026100C 8FA50020 */ lw $a1, 0x20($sp)
/* 18F8F0 80261010 8FA60024 */ lw $a2, 0x24($sp)
/* 18F8F4 80261014 0040202D */ daddu $a0, $v0, $zero
/* 18F8F8 80261018 3C01802A */ lui $at, %hi(RefundHudElem)
/* 18F8FC 8026101C AC24FBA0 */ sw $a0, %lo(RefundHudElem)($at)
/* 18F900 80261020 24A50024 */ addiu $a1, $a1, 0x24
/* 18F904 80261024 0C051261 */ jal hud_element_set_render_pos
/* 18F908 80261028 24C6FFC1 */ addiu $a2, $a2, -0x3F
.L8026102C:
/* 18F90C 8026102C AEB10084 */ sw $s1, 0x84($s5)
.L80261030:
/* 18F910 80261030 8FBF0048 */ lw $ra, 0x48($sp)
/* 18F914 80261034 8FB50044 */ lw $s5, 0x44($sp)
/* 18F918 80261038 8FB40040 */ lw $s4, 0x40($sp)
/* 18F91C 8026103C 8FB3003C */ lw $s3, 0x3C($sp)
/* 18F920 80261040 8FB20038 */ lw $s2, 0x38($sp)
/* 18F924 80261044 8FB10034 */ lw $s1, 0x34($sp)
/* 18F928 80261048 8FB00030 */ lw $s0, 0x30($sp)
/* 18F92C 8026104C D7B80060 */ ldc1 $f24, 0x60($sp)
/* 18F930 80261050 D7B60058 */ ldc1 $f22, 0x58($sp)
/* 18F934 80261054 D7B40050 */ ldc1 $f20, 0x50($sp)
/* 18F938 80261058 24020002 */ addiu $v0, $zero, 0x2
/* 18F93C 8026105C 03E00008 */ jr $ra
/* 18F940 80261060 27BD0068 */ addiu $sp, $sp, 0x68
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(GiveRefund) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
s32 sellValue = gItemTable[battleStatus->moveArgument].sellValue;
f32 angle = 0.0f;
s32 delayTime = 0;
f32 posX, posY, posZ;
posY = player->currentPos.y + player->size.y;
if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) {
s32 i;
s32 iconPosX, iconPosY, iconPosZ;
// 75% of the item's sell value, rounded up
sellValue = (sellValue * 75 + 99) / 100;
for (i = 0; i < sellValue; i++) {
posX = player->currentPos.x;
posZ = player->currentPos.z;
make_item_entity(ITEM_COIN, posX, posY, posZ, ITEM_SPAWN_MODE_TOSS_FADE1, (i * 3) + 1, angle, 0);
add_coins(1);
angle += 30.0f;
}
delayTime = (i * 3) + 30;
posX = player->currentPos.x;
posY = player->currentPos.y;
posZ = player->currentPos.z;
get_screen_coords(gCurrentCameraID, posX, posY, posZ, &iconPosX, &iconPosY, &iconPosZ);
RefundHudElem = hud_element_create(&HES_Refund);
hud_element_set_render_pos(RefundHudElem, iconPosX + 36, iconPosY - 63);
}
script->varTable[0] = delayTime;
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel add_anim_node
/* B4E18 8011E718 27BDFFD8 */ addiu $sp, $sp, -0x28
/* B4E1C 8011E71C AFB20018 */ sw $s2, 0x18($sp)
/* B4E20 8011E720 0080902D */ daddu $s2, $a0, $zero
/* B4E24 8011E724 AFB3001C */ sw $s3, 0x1C($sp)
/* B4E28 8011E728 00A0982D */ daddu $s3, $a1, $zero
/* B4E2C 8011E72C AFB10014 */ sw $s1, 0x14($sp)
/* B4E30 8011E730 00C0882D */ daddu $s1, $a2, $zero
/* B4E34 8011E734 24040100 */ addiu $a0, $zero, 0x100
/* B4E38 8011E738 AFBF0020 */ sw $ra, 0x20($sp)
/* B4E3C 8011E73C 0C00AB39 */ jal heap_malloc
/* B4E40 8011E740 AFB00010 */ sw $s0, 0x10($sp)
/* B4E44 8011E744 0040802D */ daddu $s0, $v0, $zero
/* B4E48 8011E748 16000003 */ bnez $s0, .L8011E758
/* B4E4C 8011E74C 24020010 */ addiu $v0, $zero, 0x10
.L8011E750:
/* B4E50 8011E750 080479D4 */ j .L8011E750
/* B4E54 8011E754 00000000 */ nop
.L8011E758:
/* B4E58 8011E758 A60200F4 */ sh $v0, 0xF4($s0)
/* B4E5C 8011E75C 8E220000 */ lw $v0, 0x0($s1)
/* B4E60 8011E760 AE020000 */ sw $v0, 0x0($s0)
/* B4E64 8011E764 C6200004 */ lwc1 $f0, 0x4($s1)
/* B4E68 8011E768 E6000084 */ swc1 $f0, 0x84($s0)
/* B4E6C 8011E76C C6200008 */ lwc1 $f0, 0x8($s1)
/* B4E70 8011E770 E6000088 */ swc1 $f0, 0x88($s0)
/* B4E74 8011E774 C620000C */ lwc1 $f0, 0xC($s1)
/* B4E78 8011E778 AE000090 */ sw $zero, 0x90($s0)
/* B4E7C 8011E77C AE000094 */ sw $zero, 0x94($s0)
/* B4E80 8011E780 AE000098 */ sw $zero, 0x98($s0)
/* B4E84 8011E784 E600008C */ swc1 $f0, 0x8C($s0)
/* B4E88 8011E788 C6200010 */ lwc1 $f0, 0x10($s1)
/* B4E8C 8011E78C 2404001F */ addiu $a0, $zero, 0x1F
/* B4E90 8011E790 E600009C */ swc1 $f0, 0x9C($s0)
/* B4E94 8011E794 C6200014 */ lwc1 $f0, 0x14($s1)
/* B4E98 8011E798 2603007C */ addiu $v1, $s0, 0x7C
/* B4E9C 8011E79C E60000A0 */ swc1 $f0, 0xA0($s0)
/* B4EA0 8011E7A0 C6220018 */ lwc1 $f2, 0x18($s1)
/* B4EA4 8011E7A4 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* B4EA8 8011E7A8 44810000 */ mtc1 $at, $f0
/* B4EAC 8011E7AC 2402FFFF */ addiu $v0, $zero, -0x1
/* B4EB0 8011E7B0 A60200F8 */ sh $v0, 0xF8($s0)
/* B4EB4 8011E7B4 E60000A8 */ swc1 $f0, 0xA8($s0)
/* B4EB8 8011E7B8 E60000AC */ swc1 $f0, 0xAC($s0)
/* B4EBC 8011E7BC E60000B0 */ swc1 $f0, 0xB0($s0)
/* B4EC0 8011E7C0 E60200A4 */ swc1 $f2, 0xA4($s0)
.L8011E7C4:
/* B4EC4 8011E7C4 AC600004 */ sw $zero, 0x4($v1)
/* B4EC8 8011E7C8 2484FFFF */ addiu $a0, $a0, -0x1
/* B4ECC 8011E7CC 0481FFFD */ bgez $a0, .L8011E7C4
/* B4ED0 8011E7D0 2463FFFC */ addiu $v1, $v1, -0x4
/* B4ED4 8011E7D4 92510014 */ lbu $s1, 0x14($s2)
/* B4ED8 8011E7D8 1660001A */ bnez $s3, .L8011E844
/* B4EDC 8011E7DC 26310001 */ addiu $s1, $s1, 0x1
/* B4EE0 8011E7E0 8E420010 */ lw $v0, 0x10($s2)
/* B4EE4 8011E7E4 14400003 */ bnez $v0, .L8011E7F4
/* B4EE8 8011E7E8 A61100F6 */ sh $s1, 0xF6($s0)
/* B4EEC 8011E7EC 08047A26 */ j .L8011E898
/* B4EF0 8011E7F0 AE500010 */ sw $s0, 0x10($s2)
.L8011E7F4:
/* B4EF4 8011E7F4 8E440010 */ lw $a0, 0x10($s2)
/* B4EF8 8011E7F8 0C047837 */ jal get_animator_child_with_id
/* B4EFC 8011E7FC 24050001 */ addiu $a1, $zero, 0x1
/* B4F00 8011E800 14400003 */ bnez $v0, .L8011E810
/* B4F04 8011E804 0000202D */ daddu $a0, $zero, $zero
.L8011E808:
/* B4F08 8011E808 08047A02 */ j .L8011E808
/* B4F0C 8011E80C 00000000 */ nop
.L8011E810:
/* B4F10 8011E810 0040182D */ daddu $v1, $v0, $zero
.L8011E814:
/* B4F14 8011E814 8C620004 */ lw $v0, 0x4($v1)
/* B4F18 8011E818 50400005 */ beql $v0, $zero, .L8011E830
/* B4F1C 8011E81C AC700004 */ sw $s0, 0x4($v1)
/* B4F20 8011E820 24840001 */ addiu $a0, $a0, 0x1
/* B4F24 8011E824 28820020 */ slti $v0, $a0, 0x20
/* B4F28 8011E828 1440FFFA */ bnez $v0, .L8011E814
/* B4F2C 8011E82C 24630004 */ addiu $v1, $v1, 0x4
.L8011E830:
/* B4F30 8011E830 28820020 */ slti $v0, $a0, 0x20
/* B4F34 8011E834 14400019 */ bnez $v0, .L8011E89C
/* B4F38 8011E838 0200102D */ daddu $v0, $s0, $zero
.L8011E83C:
/* B4F3C 8011E83C 08047A0F */ j .L8011E83C
/* B4F40 8011E840 00000000 */ nop
.L8011E844:
/* B4F44 8011E844 A61100F6 */ sh $s1, 0xF6($s0)
/* B4F48 8011E848 8E440010 */ lw $a0, 0x10($s2)
/* B4F4C 8011E84C 0C047837 */ jal get_animator_child_with_id
/* B4F50 8011E850 0260282D */ daddu $a1, $s3, $zero
/* B4F54 8011E854 14400003 */ bnez $v0, .L8011E864
/* B4F58 8011E858 0000202D */ daddu $a0, $zero, $zero
.L8011E85C:
/* B4F5C 8011E85C 08047A17 */ j .L8011E85C
/* B4F60 8011E860 00000000 */ nop
.L8011E864:
/* B4F64 8011E864 0040182D */ daddu $v1, $v0, $zero
.L8011E868:
/* B4F68 8011E868 8C620004 */ lw $v0, 0x4($v1)
/* B4F6C 8011E86C 50400005 */ beql $v0, $zero, .L8011E884
/* B4F70 8011E870 AC700004 */ sw $s0, 0x4($v1)
/* B4F74 8011E874 24840001 */ addiu $a0, $a0, 0x1
/* B4F78 8011E878 28820020 */ slti $v0, $a0, 0x20
/* B4F7C 8011E87C 1440FFFA */ bnez $v0, .L8011E868
/* B4F80 8011E880 24630004 */ addiu $v1, $v1, 0x4
.L8011E884:
/* B4F84 8011E884 28820020 */ slti $v0, $a0, 0x20
/* B4F88 8011E888 14400004 */ bnez $v0, .L8011E89C
/* B4F8C 8011E88C 0200102D */ daddu $v0, $s0, $zero
.L8011E890:
/* B4F90 8011E890 08047A24 */ j .L8011E890
/* B4F94 8011E894 00000000 */ nop
.L8011E898:
/* B4F98 8011E898 0200102D */ daddu $v0, $s0, $zero
.L8011E89C:
/* B4F9C 8011E89C A2510014 */ sb $s1, 0x14($s2)
/* B4FA0 8011E8A0 8FBF0020 */ lw $ra, 0x20($sp)
/* B4FA4 8011E8A4 8FB3001C */ lw $s3, 0x1C($sp)
/* B4FA8 8011E8A8 8FB20018 */ lw $s2, 0x18($sp)
/* B4FAC 8011E8AC 8FB10014 */ lw $s1, 0x14($sp)
/* B4FB0 8011E8B0 8FB00010 */ lw $s0, 0x10($sp)
/* B4FB4 8011E8B4 03E00008 */ jr $ra
/* B4FB8 8011E8B8 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
AnimatorNode* add_anim_node(ModelAnimator* animator, s32 parentNodeID, AnimatorNodeBlueprint* nodeBP) {
AnimatorNode* ret;
AnimatorNode* child;
s32 nextUniqueID;
s32 nullRootNode;
s32 i;
ret = heap_malloc(sizeof(*ret));
ASSERT(ret != NULL);
ret->flags = MODEL_ANIMATOR_FLAG_ENABLED;
ret->displayList = nodeBP->displayList;
ret->basePos.x = nodeBP->basePos.x;
ret->basePos.y = nodeBP->basePos.y;
ret->basePos.z = nodeBP->basePos.z;
ret->pos.x = 0.0f;
ret->pos.y = 0.0f;
ret->pos.z = 0.0f;
ret->rotation.x = nodeBP->rotation.x;
ret->rotation.y = nodeBP->rotation.y;
ret->rotation.z = nodeBP->rotation.z;
ret->scale.x = 1.0f;
ret->scale.y = 1.0f;
ret->scale.z = 1.0f;
ret->vertexStartOffset = -1;
for (i = 0; i < ARRAY_COUNT(ret->children); i++) {
ret->children[i] = NULL;
}
nextUniqueID = animator->nextUniqueID;
nextUniqueID = nextUniqueID + 1;
if (parentNodeID == 0) {
s32 nullRootNode = animator->rootNode == NULL; // todo ???
ret->uniqueIndex = nextUniqueID;
if (nullRootNode) {
animator->rootNode = ret;
} else {
child = get_animator_child_with_id(animator->rootNode, 1);
ASSERT(child != NULL);
for (i = 0; i < ARRAY_COUNT(child->children); i++) {
if (child->children[i] == NULL) {
child->children[i] = ret;
break;
}
}
ASSERT(i < ARRAY_COUNT(child->children));
}
} else {
ret->uniqueIndex = nextUniqueID;
child = get_animator_child_with_id(animator->rootNode, parentNodeID);
ASSERT(child != NULL);
for (i = 0; i < ARRAY_COUNT(child->children); i++) {
if (child->children[i] == NULL) {
child->children[i] = ret;
break;
}
}
ASSERT(i < ARRAY_COUNT(child->children));
}
animator->nextUniqueID = nextUniqueID;
return ret;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel step_entity_commandlist
/* A62D8 8010FBD8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* A62DC 8010FBDC AFB10014 */ sw $s1, 0x14($sp)
/* A62E0 8010FBE0 0080882D */ daddu $s1, $a0, $zero
/* A62E4 8010FBE4 AFBF0018 */ sw $ra, 0x18($sp)
/* A62E8 8010FBE8 AFB00010 */ sw $s0, 0x10($sp)
/* A62EC 8010FBEC 8E300018 */ lw $s0, 0x18($s1)
/* A62F0 8010FBF0 8E030000 */ lw $v1, 0x0($s0)
/* A62F4 8010FBF4 2C62000A */ sltiu $v0, $v1, 0xA
/* A62F8 8010FBF8 10400052 */ beqz $v0, .L8010FD44
/* A62FC 8010FBFC 26100004 */ addiu $s0, $s0, 0x4
/* A6300 8010FC00 00031080 */ sll $v0, $v1, 2
/* A6304 8010FC04 3C018015 */ lui $at, %hi(jtbl_8014F740)
/* A6308 8010FC08 00220821 */ addu $at, $at, $v0
/* A630C 8010FC0C 8C22F740 */ lw $v0, %lo(jtbl_8014F740)($at)
/* A6310 8010FC10 00400008 */ jr $v0
/* A6314 8010FC14 00000000 */ nop
glabel .L8010FC18
/* A6318 8010FC18 0000202D */ daddu $a0, $zero, $zero
/* A631C 8010FC1C 240200FF */ addiu $v0, $zero, 0xFF
/* A6320 8010FC20 A2220009 */ sb $v0, 0x9($s1)
/* A6324 8010FC24 AE20001C */ sw $zero, 0x1C($s1)
/* A6328 8010FC28 08043F54 */ j .L8010FD50
/* A632C 8010FC2C AE200018 */ sw $zero, 0x18($s1)
glabel .L8010FC30
/* A6330 8010FC30 8E020000 */ lw $v0, 0x0($s0)
/* A6334 8010FC34 24040001 */ addiu $a0, $zero, 0x1
/* A6338 8010FC38 AE220018 */ sw $v0, 0x18($s1)
/* A633C 8010FC3C 0040182D */ daddu $v1, $v0, $zero
/* A6340 8010FC40 0080102D */ daddu $v0, $a0, $zero
/* A6344 8010FC44 A2220009 */ sb $v0, 0x9($s1)
/* A6348 8010FC48 08043F54 */ j .L8010FD50
/* A634C 8010FC4C AE23002C */ sw $v1, 0x2C($s1)
glabel .L8010FC50
/* A6350 8010FC50 8E020000 */ lw $v0, 0x0($s0)
/* A6354 8010FC54 26100004 */ addiu $s0, $s0, 0x4
/* A6358 8010FC58 0220202D */ daddu $a0, $s1, $zero
/* A635C 8010FC5C 0040F809 */ jalr $v0
/* A6360 8010FC60 AC900018 */ sw $s0, 0x18($a0)
/* A6364 8010FC64 08043F54 */ j .L8010FD50
/* A6368 8010FC68 24040001 */ addiu $a0, $zero, 0x1
glabel .L8010FC6C
/* A636C 8010FC6C 92020003 */ lbu $v0, 0x3($s0)
/* A6370 8010FC70 26100004 */ addiu $s0, $s0, 0x4
/* A6374 8010FC74 0000202D */ daddu $a0, $zero, $zero
/* A6378 8010FC78 A2220009 */ sb $v0, 0x9($s1)
/* A637C 8010FC7C 8E020000 */ lw $v0, 0x0($s0)
/* A6380 8010FC80 26100004 */ addiu $s0, $s0, 0x4
/* A6384 8010FC84 AE300018 */ sw $s0, 0x18($s1)
/* A6388 8010FC88 08043F54 */ j .L8010FD50
/* A638C 8010FC8C AE22001C */ sw $v0, 0x1C($s1)
glabel .L8010FC90
/* A6390 8010FC90 8E020000 */ lw $v0, 0x0($s0)
/* A6394 8010FC94 00021080 */ sll $v0, $v0, 2
/* A6398 8010FC98 02221021 */ addu $v0, $s1, $v0
/* A639C 8010FC9C 8C42002C */ lw $v0, 0x2C($v0)
/* A63A0 8010FCA0 24040001 */ addiu $a0, $zero, 0x1
/* A63A4 8010FCA4 08043F54 */ j .L8010FD50
/* A63A8 8010FCA8 AE220018 */ sw $v0, 0x18($s1)
glabel .L8010FCAC
/* A63AC 8010FCAC 8E020000 */ lw $v0, 0x0($s0)
/* A63B0 8010FCB0 26100004 */ addiu $s0, $s0, 0x4
/* A63B4 8010FCB4 24040001 */ addiu $a0, $zero, 0x1
/* A63B8 8010FCB8 00021080 */ sll $v0, $v0, 2
/* A63BC 8010FCBC 02221021 */ addu $v0, $s1, $v0
/* A63C0 8010FCC0 AC50002C */ sw $s0, 0x2C($v0)
/* A63C4 8010FCC4 08043F54 */ j .L8010FD50
/* A63C8 8010FCC8 AE300018 */ sw $s0, 0x18($s1)
glabel .L8010FCCC
/* A63CC 8010FCCC 8E220028 */ lw $v0, 0x28($s1)
/* A63D0 8010FCD0 1040001D */ beqz $v0, .L8010FD48
/* A63D4 8010FCD4 3C030100 */ lui $v1, (0x1000000 >> 16)
/* A63D8 8010FCD8 8E220000 */ lw $v0, 0x0($s1)
/* A63DC 8010FCDC 00431025 */ or $v0, $v0, $v1
/* A63E0 8010FCE0 08043F52 */ j .L8010FD48
/* A63E4 8010FCE4 AE220000 */ sw $v0, 0x0($s1)
glabel .L8010FCE8
/* A63E8 8010FCE8 8E030000 */ lw $v1, 0x0($s0)
/* A63EC 8010FCEC 26100004 */ addiu $s0, $s0, 0x4
/* A63F0 8010FCF0 8E220000 */ lw $v0, 0x0($s1)
/* A63F4 8010FCF4 24040001 */ addiu $a0, $zero, 0x1
/* A63F8 8010FCF8 AE300018 */ sw $s0, 0x18($s1)
/* A63FC 8010FCFC 00431025 */ or $v0, $v0, $v1
/* A6400 8010FD00 08043F54 */ j .L8010FD50
/* A6404 8010FD04 AE220000 */ sw $v0, 0x0($s1)
glabel .L8010FD08
/* A6408 8010FD08 8E030000 */ lw $v1, 0x0($s0)
/* A640C 8010FD0C 26100004 */ addiu $s0, $s0, 0x4
/* A6410 8010FD10 8E220000 */ lw $v0, 0x0($s1)
/* A6414 8010FD14 24040001 */ addiu $a0, $zero, 0x1
/* A6418 8010FD18 AE300018 */ sw $s0, 0x18($s1)
/* A641C 8010FD1C 00031827 */ nor $v1, $zero, $v1
/* A6420 8010FD20 00431024 */ and $v0, $v0, $v1
/* A6424 8010FD24 08043F54 */ j .L8010FD50
/* A6428 8010FD28 AE220000 */ sw $v0, 0x0($s1)
glabel .L8010FD2C
/* A642C 8010FD2C 8E040000 */ lw $a0, 0x0($s0)
/* A6430 8010FD30 0C05272D */ jal sfx_play_sound
/* A6434 8010FD34 26100004 */ addiu $s0, $s0, 0x4
/* A6438 8010FD38 24040001 */ addiu $a0, $zero, 0x1
/* A643C 8010FD3C 08043F54 */ j .L8010FD50
/* A6440 8010FD40 AE300018 */ sw $s0, 0x18($s1)
.L8010FD44:
/* A6444 8010FD44 26100004 */ addiu $s0, $s0, 0x4
.L8010FD48:
/* A6448 8010FD48 AE300018 */ sw $s0, 0x18($s1)
/* A644C 8010FD4C 24040001 */ addiu $a0, $zero, 0x1
.L8010FD50:
/* A6450 8010FD50 8FBF0018 */ lw $ra, 0x18($sp)
/* A6454 8010FD54 8FB10014 */ lw $s1, 0x14($sp)
/* A6458 8010FD58 8FB00010 */ lw $s0, 0x10($sp)
/* A645C 8010FD5C 0080102D */ daddu $v0, $a0, $zero
/* A6460 8010FD60 03E00008 */ jr $ra
/* A6464 8010FD64 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
s32 step_entity_commandlist(Entity* entity) {
s32* args = entity->scriptReadPos;
s32 ret;
s32 labelId;
void (*tempfunc)(Entity*);
switch (*args++) {
case ENTITY_SCRIPT_OP_End:
entity->scriptDelay = -1;
entity->updateScriptCallback = NULL;
entity->scriptReadPos = NULL;
ret = FALSE;
break;
case ENTITY_SCRIPT_OP_Jump:
entity->scriptReadPos = (s32*)*args;
entity->scriptDelay = 1;
entity->savedReadPos[0] = entity->scriptReadPos;
ret = TRUE;
break;
case ENTITY_SCRIPT_OP_Call:
tempfunc = (void (*)(Entity*))(*args++);
entity->scriptReadPos = args;
(tempfunc)(entity);
ret = TRUE;
break;
case ENTITY_SCRIPT_OP_SetCallback:
entity->scriptDelay = *args++;
entity->updateScriptCallback = (s32 (*)(Entity*)) *args++;
entity->scriptReadPos = args++;
ret = FALSE;
break;
case ENTITY_SCRIPT_OP_Goto:
entity->scriptReadPos = entity->savedReadPos[*args];
ret = TRUE;
break;
case ENTITY_SCRIPT_OP_Label:
labelId = *args++;
entity->savedReadPos[labelId] = args;
entity->scriptReadPos = args;
ret = TRUE;
break;
case ENTITY_SCRIPT_OP_RestartBoundScript:
if (entity->boundScriptBytecode != NULL) {
entity->flags |= ENTITY_FLAG_BOUND_SCRIPT_DIRTY;
}
entity->scriptReadPos = args++;
ret = TRUE;
break;
case ENTITY_SCRIPT_OP_SetFlags:
entity->flags |= *args++;
entity->scriptReadPos = args++;
ret = TRUE;
break;
case ENTITY_SCRIPT_OP_ClearFlags:
entity->flags &= ~*args++;
entity->scriptReadPos = args++;
ret = TRUE;
break;
case ENTITY_SCRIPT_OP_PlaySound:
sfx_play_sound(*args++);
entity->scriptReadPos = args++;
ret = TRUE;
break;
default:
args++;
entity->scriptReadPos = args++;
ret = TRUE;
break;
}
return ret;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel au_syn_set_mixer_params
/* 3276C 8005736C 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 32770 80057370 AFB50024 */ sw $s5, 0x24($sp)
/* 32774 80057374 00C0A82D */ daddu $s5, $a2, $zero
/* 32778 80057378 AFB3001C */ sw $s3, 0x1C($sp)
/* 3277C 8005737C 00A0982D */ daddu $s3, $a1, $zero
/* 32780 80057380 AFB40020 */ sw $s4, 0x20($sp)
/* 32784 80057384 00E0A02D */ daddu $s4, $a3, $zero
/* 32788 80057388 308400FF */ andi $a0, $a0, 0xFF
/* 3278C 8005738C 00041140 */ sll $v0, $a0, 5
/* 32790 80057390 00441023 */ subu $v0, $v0, $a0
/* 32794 80057394 3C038008 */ lui $v1, %hi(gSynDriverPtr)
/* 32798 80057398 8C638E54 */ lw $v1, %lo(gSynDriverPtr)($v1)
/* 3279C 8005739C 00021080 */ sll $v0, $v0, 2
/* 327A0 800573A0 AFBF0028 */ sw $ra, 0x28($sp)
/* 327A4 800573A4 AFB20018 */ sw $s2, 0x18($sp)
/* 327A8 800573A8 AFB10014 */ sw $s1, 0x14($sp)
/* 327AC 800573AC AFB00010 */ sw $s0, 0x10($sp)
/* 327B0 800573B0 8C63001C */ lw $v1, 0x1C($v1)
/* 327B4 800573B4 93B20043 */ lbu $s2, 0x43($sp)
/* 327B8 800573B8 00628021 */ addu $s0, $v1, $v0
/* 327BC 800573BC 8E050064 */ lw $a1, 0x64($s0)
/* 327C0 800573C0 8E030068 */ lw $v1, 0x68($s0)
/* 327C4 800573C4 00A3102A */ slt $v0, $a1, $v1
/* 327C8 800573C8 14400029 */ bnez $v0, .L80057470
/* 327CC 800573CC 26110048 */ addiu $s1, $s0, 0x48
/* 327D0 800573D0 3C028008 */ lui $v0, %hi(AuSynUseStereo)
/* 327D4 800573D4 24428181 */ addiu $v0, $v0, %lo(AuSynUseStereo)
/* 327D8 800573D8 90420000 */ lbu $v0, 0x0($v0)
/* 327DC 800573DC 1440000E */ bnez $v0, .L80057418
/* 327E0 800573E0 AE030064 */ sw $v1, 0x64($s0)
/* 327E4 800573E4 3C048008 */ lui $a0, %hi(AlCosineBlend)
/* 327E8 800573E8 24848E60 */ addiu $a0, $a0, %lo(AlCosineBlend)
/* 327EC 800573EC 8603004E */ lh $v1, 0x4E($s0)
/* 327F0 800573F0 84820080 */ lh $v0, 0x80($a0)
/* 327F4 800573F4 00620018 */ mult $v1, $v0
/* 327F8 800573F8 00004012 */ mflo $t0
/* 327FC 800573FC 000813C3 */ sra $v0, $t0, 15
/* 32800 80057400 A6020050 */ sh $v0, 0x50($s0)
/* 32804 80057404 84820080 */ lh $v0, 0x80($a0)
/* 32808 80057408 00620018 */ mult $v1, $v0
/* 3280C 8005740C 00004012 */ mflo $t0
/* 32810 80057410 08015D26 */ j .L80057498
/* 32814 80057414 000813C3 */ sra $v0, $t0, 15
.L80057418:
/* 32818 80057418 8602004C */ lh $v0, 0x4C($s0)
/* 3281C 8005741C 8603004E */ lh $v1, 0x4E($s0)
/* 32820 80057420 00021040 */ sll $v0, $v0, 1
/* 32824 80057424 3C018008 */ lui $at, %hi(AlCosineBlend)
/* 32828 80057428 00220821 */ addu $at, $at, $v0
/* 3282C 8005742C 84228E60 */ lh $v0, %lo(AlCosineBlend)($at)
/* 32830 80057430 00620018 */ mult $v1, $v0
/* 32834 80057434 8603004C */ lh $v1, 0x4C($s0)
/* 32838 80057438 00004012 */ mflo $t0
/* 3283C 8005743C 000813C3 */ sra $v0, $t0, 15
/* 32840 80057440 A6020050 */ sh $v0, 0x50($s0)
/* 32844 80057444 2402007F */ addiu $v0, $zero, 0x7F
/* 32848 80057448 00431023 */ subu $v0, $v0, $v1
/* 3284C 8005744C 00021040 */ sll $v0, $v0, 1
/* 32850 80057450 8603004E */ lh $v1, 0x4E($s0)
/* 32854 80057454 3C018008 */ lui $at, %hi(AlCosineBlend)
/* 32858 80057458 00220821 */ addu $at, $at, $v0
/* 3285C 8005745C 84228E60 */ lh $v0, %lo(AlCosineBlend)($at)
/* 32860 80057460 00620018 */ mult $v1, $v0
/* 32864 80057464 00004012 */ mflo $t0
/* 32868 80057468 08015D26 */ j .L80057498
/* 3286C 8005746C 000813C3 */ sra $v0, $t0, 15
.L80057470:
/* 32870 80057470 86040050 */ lh $a0, 0x50($s0)
/* 32874 80057474 8606005A */ lh $a2, 0x5A($s0)
/* 32878 80057478 0C016001 */ jal func_80058004
/* 3287C 8005747C 96070058 */ lhu $a3, 0x58($s0)
/* 32880 80057480 86040052 */ lh $a0, 0x52($s0)
/* 32884 80057484 8E050064 */ lw $a1, 0x64($s0)
/* 32888 80057488 86060060 */ lh $a2, 0x60($s0)
/* 3288C 8005748C 9607005E */ lhu $a3, 0x5E($s0)
/* 32890 80057490 0C016001 */ jal func_80058004
/* 32894 80057494 A6020050 */ sh $v0, 0x50($s0)
.L80057498:
/* 32898 80057498 A6020052 */ sh $v0, 0x52($s0)
/* 3289C 8005749C 86220008 */ lh $v0, 0x8($s1)
/* 328A0 800574A0 14400002 */ bnez $v0, .L800574AC
/* 328A4 800574A4 24020001 */ addiu $v0, $zero, 0x1
/* 328A8 800574A8 A6220008 */ sh $v0, 0x8($s1)
.L800574AC:
/* 328AC 800574AC 8622000A */ lh $v0, 0xA($s1)
/* 328B0 800574B0 14400004 */ bnez $v0, .L800574C4
/* 328B4 800574B4 00131400 */ sll $v0, $s3, 16
/* 328B8 800574B8 24020001 */ addiu $v0, $zero, 0x1
/* 328BC 800574BC A622000A */ sh $v0, 0xA($s1)
/* 328C0 800574C0 00131400 */ sll $v0, $s3, 16
.L800574C4:
/* 328C4 800574C4 00021403 */ sra $v0, $v0, 16
/* 328C8 800574C8 00420018 */ mult $v0, $v0
/* 328CC 800574CC 328200FF */ andi $v0, $s4, 0xFF
/* 328D0 800574D0 324300FF */ andi $v1, $s2, 0xFF
/* 328D4 800574D4 AE20001C */ sw $zero, 0x1C($s1)
/* 328D8 800574D8 AE350020 */ sw $s5, 0x20($s1)
/* 328DC 800574DC A6220004 */ sh $v0, 0x4($s1)
/* 328E0 800574E0 00004012 */ mflo $t0
/* 328E4 800574E4 000813C3 */ sra $v0, $t0, 15
/* 328E8 800574E8 A6220006 */ sh $v0, 0x6($s1)
/* 328EC 800574EC 00031040 */ sll $v0, $v1, 1
/* 328F0 800574F0 3C018008 */ lui $at, %hi(AlCosineBlend)
/* 328F4 800574F4 00220821 */ addu $at, $at, $v0
/* 328F8 800574F8 94228E60 */ lhu $v0, %lo(AlCosineBlend)($at)
/* 328FC 800574FC A622000C */ sh $v0, 0xC($s1)
/* 32900 80057500 2402007F */ addiu $v0, $zero, 0x7F
/* 32904 80057504 00431023 */ subu $v0, $v0, $v1
/* 32908 80057508 00021040 */ sll $v0, $v0, 1
/* 3290C 8005750C 3C038008 */ lui $v1, %hi(AlCosineBlend)
/* 32910 80057510 00621821 */ addu $v1, $v1, $v0
/* 32914 80057514 94638E60 */ lhu $v1, %lo(AlCosineBlend)($v1)
/* 32918 80057518 24020001 */ addiu $v0, $zero, 0x1
/* 3291C 8005751C AE220024 */ sw $v0, 0x24($s1)
/* 32920 80057520 A623000E */ sh $v1, 0xE($s1)
/* 32924 80057524 8FBF0028 */ lw $ra, 0x28($sp)
/* 32928 80057528 8FB50024 */ lw $s5, 0x24($sp)
/* 3292C 8005752C 8FB40020 */ lw $s4, 0x20($sp)
/* 32930 80057530 8FB3001C */ lw $s3, 0x1C($sp)
/* 32934 80057534 8FB20018 */ lw $s2, 0x18($sp)
/* 32938 80057538 8FB10014 */ lw $s1, 0x14($sp)
/* 3293C 8005753C 8FB00010 */ lw $s0, 0x10($sp)
/* 32940 80057540 03E00008 */ jr $ra
/* 32944 80057544 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void au_syn_set_mixer_params(u8 voiceIdx, s16 volume, s32 delta, u8 pan, u8 fxMix) {
AuPVoice* pvoice = &gSynDriverPtr->pvoices[voiceIdx];
AuEnvMixer* envMixer = &pvoice->envMixer;
if (envMixer->delta >= envMixer->segEnd) {
envMixer->delta = envMixer->segEnd;
if (!AuSynUseStereo) {
envMixer->cvolL = (envMixer->volume * AuEqPower[AU_EQPOW_MID_IDX]) >> 0xF;
envMixer->cvolR = (envMixer->volume * AuEqPower[AU_EQPOW_MID_IDX]) >> 0xF;
} else {
envMixer->cvolL = (envMixer->volume * AuEqPower[envMixer->pan]) >> 0xF;
envMixer->cvolR = (envMixer->volume * AuEqPower[AU_EQPOW_MAX_IDX - envMixer->pan]) >> 0xF;
}
} else {
envMixer->cvolL = _getVol(envMixer->cvolL, envMixer->delta, envMixer->lratm, envMixer->lratl);
envMixer->cvolR = _getVol(envMixer->cvolR, envMixer->delta, envMixer->rratm, envMixer->rratl);
}
if (envMixer->cvolL == 0) {
envMixer->cvolL = 1;
}
if (envMixer->cvolR == 0) {
envMixer->cvolR = 1;
}
envMixer->delta = 0;
envMixer->segEnd = delta;
envMixer->pan = pan;
envMixer->volume = SQ(volume) >> 0xF;
envMixer->dryamt = AuEqPower[fxMix];
envMixer->wetamt = AuEqPower[AU_EQPOW_MAX_IDX - fxMix];
envMixer->first = 1;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel quizmo_audience_update
/* 3A71F4 E00A8104 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 3A71F8 E00A8108 AFBF0020 */ sw $ra, 0x20($sp)
/* 3A71FC E00A810C AFB3001C */ sw $s3, 0x1C($sp)
/* 3A7200 E00A8110 AFB20018 */ sw $s2, 0x18($sp)
/* 3A7204 E00A8114 AFB10014 */ sw $s1, 0x14($sp)
/* 3A7208 E00A8118 AFB00010 */ sw $s0, 0x10($sp)
/* 3A720C E00A811C 8C830000 */ lw $v1, 0x0($a0)
/* 3A7210 E00A8120 8C85000C */ lw $a1, 0xC($a0)
/* 3A7214 E00A8124 30620010 */ andi $v0, $v1, 0x10
/* 3A7218 E00A8128 10400005 */ beqz $v0, .LE00A8140
/* 3A721C E00A812C 2402FFEF */ addiu $v0, $zero, -0x11
/* 3A7220 E00A8130 00621024 */ and $v0, $v1, $v0
/* 3A7224 E00A8134 AC820000 */ sw $v0, 0x0($a0)
/* 3A7228 E00A8138 2402001E */ addiu $v0, $zero, 0x1E
/* 3A722C E00A813C ACA20004 */ sw $v0, 0x4($a1)
.LE00A8140:
/* 3A7230 E00A8140 8CA30004 */ lw $v1, 0x4($a1)
/* 3A7234 E00A8144 28620064 */ slti $v0, $v1, 0x64
/* 3A7238 E00A8148 10400002 */ beqz $v0, .LE00A8154
/* 3A723C E00A814C 2462FFFF */ addiu $v0, $v1, -0x1
/* 3A7240 E00A8150 ACA20004 */ sw $v0, 0x4($a1)
.LE00A8154:
/* 3A7244 E00A8154 8CA20008 */ lw $v0, 0x8($a1)
/* 3A7248 E00A8158 8CA30004 */ lw $v1, 0x4($a1)
/* 3A724C E00A815C 24420001 */ addiu $v0, $v0, 0x1
/* 3A7250 E00A8160 04610005 */ bgez $v1, .LE00A8178
/* 3A7254 E00A8164 ACA20008 */ sw $v0, 0x8($a1)
/* 3A7258 E00A8168 0C080128 */ jal shim_remove_effect
/* 3A725C E00A816C 00000000 */ nop
/* 3A7260 E00A8170 0802A0AE */ j .LE00A82B8
/* 3A7264 E00A8174 00000000 */ nop
.LE00A8178:
/* 3A7268 E00A8178 28620010 */ slti $v0, $v1, 0x10
/* 3A726C E00A817C 10400002 */ beqz $v0, .LE00A8188
/* 3A7270 E00A8180 00031100 */ sll $v0, $v1, 4
/* 3A7274 E00A8184 ACA20018 */ sw $v0, 0x18($a1)
.LE00A8188:
/* 3A7278 E00A8188 0000882D */ daddu $s1, $zero, $zero
/* 3A727C E00A818C 24120001 */ addiu $s2, $zero, 0x1
/* 3A7280 E00A8190 3C13E00B */ lui $s3, %hi(D_E00A8690)
/* 3A7284 E00A8194 26738690 */ addiu $s3, $s3, %lo(D_E00A8690)
/* 3A7288 E00A8198 00A0802D */ daddu $s0, $a1, $zero
.LE00A819C:
/* 3A728C E00A819C 8E02001C */ lw $v0, 0x1C($s0)
/* 3A7290 E00A81A0 10400005 */ beqz $v0, .LE00A81B8
/* 3A7294 E00A81A4 00000000 */ nop
/* 3A7298 E00A81A8 1052001E */ beq $v0, $s2, .LE00A8224
/* 3A729C E00A81AC 00000000 */ nop
/* 3A72A0 E00A81B0 0802A0AA */ j .LE00A82A8
/* 3A72A4 E00A81B4 26100004 */ addiu $s0, $s0, 0x4
.LE00A81B8:
/* 3A72A8 E00A81B8 0C080138 */ jal shim_rand_int
/* 3A72AC E00A81BC 2404000A */ addiu $a0, $zero, 0xA
/* 3A72B0 E00A81C0 2403000A */ addiu $v1, $zero, 0xA
/* 3A72B4 E00A81C4 54430038 */ bnel $v0, $v1, .LE00A82A8
/* 3A72B8 E00A81C8 26100004 */ addiu $s0, $s0, 0x4
/* 3A72BC E00A81CC 24040001 */ addiu $a0, $zero, 0x1
/* 3A72C0 E00A81D0 0C080138 */ jal shim_rand_int
/* 3A72C4 E00A81D4 AE12001C */ sw $s2, 0x1C($s0)
/* 3A72C8 E00A81D8 24040032 */ addiu $a0, $zero, 0x32
/* 3A72CC E00A81DC AE020044 */ sw $v0, 0x44($s0)
/* 3A72D0 E00A81E0 0C080138 */ jal shim_rand_int
/* 3A72D4 E00A81E4 AE00006C */ sw $zero, 0x6C($s0)
/* 3A72D8 E00A81E8 3C01E00B */ lui $at, (0xE00B0000 >> 16)
/* 3A72DC E00A81EC D42086A0 */ ldc1 $f0, -0x7960($at)
/* 3A72E0 E00A81F0 44821000 */ mtc1 $v0, $f2
/* 3A72E4 E00A81F4 00000000 */ nop
/* 3A72E8 E00A81F8 468010A1 */ cvt.d.w $f2, $f2
/* 3A72EC E00A81FC 46201082 */ mul.d $f2, $f2, $f0
/* 3A72F0 E00A8200 00000000 */ nop
/* 3A72F4 E00A8204 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 3A72F8 E00A8208 44810800 */ mtc1 $at, $f1
/* 3A72FC E00A820C 44800000 */ mtc1 $zero, $f0
/* 3A7300 E00A8210 00000000 */ nop
/* 3A7304 E00A8214 46201080 */ add.d $f2, $f2, $f0
/* 3A7308 E00A8218 462010A0 */ cvt.s.d $f2, $f2
/* 3A730C E00A821C 0802A0A9 */ j .LE00A82A4
/* 3A7310 E00A8220 E6020094 */ swc1 $f2, 0x94($s0)
.LE00A8224:
/* 3A7314 E00A8224 8E020044 */ lw $v0, 0x44($s0)
/* 3A7318 E00A8228 8E03006C */ lw $v1, 0x6C($s0)
/* 3A731C E00A822C 000210C0 */ sll $v0, $v0, 3
/* 3A7320 E00A8230 00532021 */ addu $a0, $v0, $s3
/* 3A7324 E00A8234 90820004 */ lbu $v0, 0x4($a0)
/* 3A7328 E00A8238 0062102A */ slt $v0, $v1, $v0
/* 3A732C E00A823C 14400003 */ bnez $v0, .LE00A824C
/* 3A7330 E00A8240 00031840 */ sll $v1, $v1, 1
/* 3A7334 E00A8244 0802A0A9 */ j .LE00A82A4
/* 3A7338 E00A8248 AE00001C */ sw $zero, 0x1C($s0)
.LE00A824C:
/* 3A733C E00A824C 8C820000 */ lw $v0, 0x0($a0)
/* 3A7340 E00A8250 00621021 */ addu $v0, $v1, $v0
/* 3A7344 E00A8254 80420000 */ lb $v0, 0x0($v0)
/* 3A7348 E00A8258 C6020094 */ lwc1 $f2, 0x94($s0)
/* 3A734C E00A825C 44820000 */ mtc1 $v0, $f0
/* 3A7350 E00A8260 00000000 */ nop
/* 3A7354 E00A8264 46800020 */ cvt.s.w $f0, $f0
/* 3A7358 E00A8268 46020002 */ mul.s $f0, $f0, $f2
/* 3A735C E00A826C 00000000 */ nop
/* 3A7360 E00A8270 E60000BC */ swc1 $f0, 0xBC($s0)
/* 3A7364 E00A8274 8C820000 */ lw $v0, 0x0($a0)
/* 3A7368 E00A8278 00621821 */ addu $v1, $v1, $v0
/* 3A736C E00A827C 80620001 */ lb $v0, 0x1($v1)
/* 3A7370 E00A8280 44820000 */ mtc1 $v0, $f0
/* 3A7374 E00A8284 00000000 */ nop
/* 3A7378 E00A8288 46800020 */ cvt.s.w $f0, $f0
/* 3A737C E00A828C 46020002 */ mul.s $f0, $f0, $f2
/* 3A7380 E00A8290 00000000 */ nop
/* 3A7384 E00A8294 8E02006C */ lw $v0, 0x6C($s0)
/* 3A7388 E00A8298 24420001 */ addiu $v0, $v0, 0x1
/* 3A738C E00A829C AE02006C */ sw $v0, 0x6C($s0)
/* 3A7390 E00A82A0 E60000E4 */ swc1 $f0, 0xE4($s0)
.LE00A82A4:
/* 3A7394 E00A82A4 26100004 */ addiu $s0, $s0, 0x4
.LE00A82A8:
/* 3A7398 E00A82A8 26310001 */ addiu $s1, $s1, 0x1
/* 3A739C E00A82AC 2A22000A */ slti $v0, $s1, 0xA
/* 3A73A0 E00A82B0 1440FFBA */ bnez $v0, .LE00A819C
/* 3A73A4 E00A82B4 00000000 */ nop
.LE00A82B8:
/* 3A73A8 E00A82B8 8FBF0020 */ lw $ra, 0x20($sp)
/* 3A73AC E00A82BC 8FB3001C */ lw $s3, 0x1C($sp)
/* 3A73B0 E00A82C0 8FB20018 */ lw $s2, 0x18($sp)
/* 3A73B4 E00A82C4 8FB10014 */ lw $s1, 0x14($sp)
/* 3A73B8 E00A82C8 8FB00010 */ lw $s0, 0x10($sp)
/* 3A73BC E00A82CC 03E00008 */ jr $ra
/* 3A73C0 E00A82D0 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void quizmo_audience_update(EffectInstance* effect) {
QuizmoAudienceFXData* data = effect->data.quizmoAudience;
QuizmoAudiencePositonOffsets* unkStruct;
s32 posIdx;
s32 i;
if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
data->timeLeft = 30;
}
if (data->timeLeft < 100) {
data->timeLeft--;
}
data->lifeTime++;
if (data->timeLeft < 0) {
shim_remove_effect(effect);
return;
}
if (data->timeLeft < 16) {
data->primColor = data->timeLeft * 16;
}
for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) {
switch (data->compState[i]) {
case 0:
if (shim_rand_int(10) == 10) {
data->compState[i] = 1;
data->compType[i] = shim_rand_int(1);
data->compPosIdx[i] = 0;
data->compMoveMagnitude[i] = (shim_rand_int(50) * 0.01) + 0.5;
}
break;
case 1:
posIdx = data->compPosIdx[i];
unkStruct = &quizmo_audience_positionOffsets[data->compType[i]];
if (data->compPosIdx[i] >= unkStruct->count) {
data->compState[i] = 0;
} else {
data->compX[i] = unkStruct->offsets[posIdx].x * data->compMoveMagnitude[i];
data->compY[i] = unkStruct->offsets[posIdx].y * data->compMoveMagnitude[i];
data->compPosIdx[i]++;
}
break;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel NpcFaceNpc
/* F3830 802CEE80 27BDFFD0 */ addiu $sp, $sp, -0x30
/* F3834 802CEE84 AFB10014 */ sw $s1, 0x14($sp)
/* F3838 802CEE88 0080882D */ daddu $s1, $a0, $zero
/* F383C 802CEE8C AFB60028 */ sw $s6, 0x28($sp)
/* F3840 802CEE90 26360074 */ addiu $s6, $s1, 0x74
/* F3844 802CEE94 AFB50024 */ sw $s5, 0x24($sp)
/* F3848 802CEE98 26350078 */ addiu $s5, $s1, 0x78
/* F384C 802CEE9C AFB40020 */ sw $s4, 0x20($sp)
/* F3850 802CEEA0 AFBF002C */ sw $ra, 0x2C($sp)
/* F3854 802CEEA4 AFB3001C */ sw $s3, 0x1C($sp)
/* F3858 802CEEA8 AFB20018 */ sw $s2, 0x18($sp)
/* F385C 802CEEAC AFB00010 */ sw $s0, 0x10($sp)
/* F3860 802CEEB0 8E32000C */ lw $s2, 0xC($s1)
/* F3864 802CEEB4 10A00040 */ beqz $a1, .L802CEFB8
/* F3868 802CEEB8 2634007C */ addiu $s4, $s1, 0x7C
/* F386C 802CEEBC 8E450000 */ lw $a1, 0x0($s2)
/* F3870 802CEEC0 0C0B1EAF */ jal evt_get_variable
/* F3874 802CEEC4 26520004 */ addiu $s2, $s2, 0x4
/* F3878 802CEEC8 8E450000 */ lw $a1, 0x0($s2)
/* F387C 802CEECC 26520004 */ addiu $s2, $s2, 0x4
/* F3880 802CEED0 0220202D */ daddu $a0, $s1, $zero
/* F3884 802CEED4 0C0B1EAF */ jal evt_get_variable
/* F3888 802CEED8 0040802D */ daddu $s0, $v0, $zero
/* F388C 802CEEDC 0220202D */ daddu $a0, $s1, $zero
/* F3890 802CEEE0 0C0B36B0 */ jal resolve_npc
/* F3894 802CEEE4 0040282D */ daddu $a1, $v0, $zero
/* F3898 802CEEE8 0040982D */ daddu $s3, $v0, $zero
/* F389C 802CEEEC 12600006 */ beqz $s3, .L802CEF08
/* F38A0 802CEEF0 0220202D */ daddu $a0, $s1, $zero
/* F38A4 802CEEF4 0C0B36B0 */ jal resolve_npc
/* F38A8 802CEEF8 0200282D */ daddu $a1, $s0, $zero
/* F38AC 802CEEFC 0040802D */ daddu $s0, $v0, $zero
/* F38B0 802CEF00 16000003 */ bnez $s0, .L802CEF10
/* F38B4 802CEF04 00000000 */ nop
.L802CEF08:
/* F38B8 802CEF08 080B3C0E */ j .L802CF038
/* F38BC 802CEF0C 24020002 */ addiu $v0, $zero, 0x2
.L802CEF10:
/* F38C0 802CEF10 C600000C */ lwc1 $f0, 0xC($s0)
/* F38C4 802CEF14 E6200074 */ swc1 $f0, 0x74($s1)
/* F38C8 802CEF18 C60C0038 */ lwc1 $f12, 0x38($s0)
/* F38CC 802CEF1C C60E0040 */ lwc1 $f14, 0x40($s0)
/* F38D0 802CEF20 8E660038 */ lw $a2, 0x38($s3)
/* F38D4 802CEF24 0C00A720 */ jal atan2
/* F38D8 802CEF28 8E670040 */ lw $a3, 0x40($s3)
/* F38DC 802CEF2C C6220074 */ lwc1 $f2, 0x74($s1)
/* F38E0 802CEF30 46020001 */ sub.s $f0, $f0, $f2
/* F38E4 802CEF34 AE300070 */ sw $s0, 0x70($s1)
/* F38E8 802CEF38 E6200078 */ swc1 $f0, 0x78($s1)
/* F38EC 802CEF3C 8E450000 */ lw $a1, 0x0($s2)
/* F38F0 802CEF40 0C0B1EAF */ jal evt_get_variable
/* F38F4 802CEF44 0220202D */ daddu $a0, $s1, $zero
/* F38F8 802CEF48 AE22007C */ sw $v0, 0x7C($s1)
/* F38FC 802CEF4C A600008E */ sh $zero, 0x8E($s0)
/* F3900 802CEF50 C6220078 */ lwc1 $f2, 0x78($s1)
/* F3904 802CEF54 3C01C334 */ lui $at, (0xC3340000 >> 16)
/* F3908 802CEF58 44810000 */ mtc1 $at, $f0
/* F390C 802CEF5C 00000000 */ nop
/* F3910 802CEF60 4600103C */ c.lt.s $f2, $f0
/* F3914 802CEF64 00000000 */ nop
/* F3918 802CEF68 45000007 */ bc1f .L802CEF88
/* F391C 802CEF6C 00000000 */ nop
/* F3920 802CEF70 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* F3924 802CEF74 44810000 */ mtc1 $at, $f0
/* F3928 802CEF78 00000000 */ nop
/* F392C 802CEF7C 46001000 */ add.s $f0, $f2, $f0
/* F3930 802CEF80 E6200078 */ swc1 $f0, 0x78($s1)
/* F3934 802CEF84 C6220078 */ lwc1 $f2, 0x78($s1)
.L802CEF88:
/* F3938 802CEF88 3C014334 */ lui $at, (0x43340000 >> 16)
/* F393C 802CEF8C 44810000 */ mtc1 $at, $f0
/* F3940 802CEF90 00000000 */ nop
/* F3944 802CEF94 4602003C */ c.lt.s $f0, $f2
/* F3948 802CEF98 00000000 */ nop
/* F394C 802CEF9C 45000006 */ bc1f .L802CEFB8
/* F3950 802CEFA0 00000000 */ nop
/* F3954 802CEFA4 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* F3958 802CEFA8 44810000 */ mtc1 $at, $f0
/* F395C 802CEFAC 00000000 */ nop
/* F3960 802CEFB0 46001001 */ sub.s $f0, $f2, $f0
/* F3964 802CEFB4 E6200078 */ swc1 $f0, 0x78($s1)
.L802CEFB8:
/* F3968 802CEFB8 8E820000 */ lw $v0, 0x0($s4)
/* F396C 802CEFBC 8E300070 */ lw $s0, 0x70($s1)
/* F3970 802CEFC0 1C400006 */ bgtz $v0, .L802CEFDC
/* F3974 802CEFC4 24020002 */ addiu $v0, $zero, 0x2
/* F3978 802CEFC8 C600000C */ lwc1 $f0, 0xC($s0)
/* F397C 802CEFCC C6A20000 */ lwc1 $f2, 0x0($s5)
/* F3980 802CEFD0 46020000 */ add.s $f0, $f0, $f2
/* F3984 802CEFD4 080B3C0E */ j .L802CF038
/* F3988 802CEFD8 E600000C */ swc1 $f0, 0xC($s0)
.L802CEFDC:
/* F398C 802CEFDC 9602008E */ lhu $v0, 0x8E($s0)
/* F3990 802CEFE0 24420001 */ addiu $v0, $v0, 0x1
/* F3994 802CEFE4 A602008E */ sh $v0, 0x8E($s0)
/* F3998 802CEFE8 00021400 */ sll $v0, $v0, 16
/* F399C 802CEFEC 00021403 */ sra $v0, $v0, 16
/* F39A0 802CEFF0 C6A00000 */ lwc1 $f0, 0x0($s5)
/* F39A4 802CEFF4 44821000 */ mtc1 $v0, $f2
/* F39A8 802CEFF8 00000000 */ nop
/* F39AC 802CEFFC 468010A0 */ cvt.s.w $f2, $f2
/* F39B0 802CF000 46020002 */ mul.s $f0, $f0, $f2
/* F39B4 802CF004 00000000 */ nop
/* F39B8 802CF008 C6CC0000 */ lwc1 $f12, 0x0($s6)
/* F39BC 802CF00C C6820000 */ lwc1 $f2, 0x0($s4)
/* F39C0 802CF010 468010A0 */ cvt.s.w $f2, $f2
/* F39C4 802CF014 46020003 */ div.s $f0, $f0, $f2
/* F39C8 802CF018 46006300 */ add.s $f12, $f12, $f0
/* F39CC 802CF01C 0C00A6C9 */ jal clamp_angle
/* F39D0 802CF020 E60C000C */ swc1 $f12, 0xC($s0)
/* F39D4 802CF024 8602008E */ lh $v0, 0x8E($s0)
/* F39D8 802CF028 E600000C */ swc1 $f0, 0xC($s0)
/* F39DC 802CF02C 8E830000 */ lw $v1, 0x0($s4)
/* F39E0 802CF030 0043102A */ slt $v0, $v0, $v1
/* F39E4 802CF034 38420001 */ xori $v0, $v0, 0x1
.L802CF038:
/* F39E8 802CF038 8FBF002C */ lw $ra, 0x2C($sp)
/* F39EC 802CF03C 8FB60028 */ lw $s6, 0x28($sp)
/* F39F0 802CF040 8FB50024 */ lw $s5, 0x24($sp)
/* F39F4 802CF044 8FB40020 */ lw $s4, 0x20($sp)
/* F39F8 802CF048 8FB3001C */ lw $s3, 0x1C($sp)
/* F39FC 802CF04C 8FB20018 */ lw $s2, 0x18($sp)
/* F3A00 802CF050 8FB10014 */ lw $s1, 0x14($sp)
/* F3A04 802CF054 8FB00010 */ lw $s0, 0x10($sp)
/* F3A08 802CF058 03E00008 */ jr $ra
/* F3A0C 802CF05C 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
ApiStatus NpcFaceNpc(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
f32* initialYaw = &script->functionTempF[1];
f32* deltaYaw = &script->functionTempF[2];
s32* turnTime = &script->functionTemp[3];
Npc* targetNpc;
Npc* turningNpc;
if (isInitialCall) {
s32 turningNpcID = evt_get_variable(script, *args++);
s32 targetNpcID = evt_get_variable(script, *args++);
targetNpc = resolve_npc(script, targetNpcID);
if (targetNpc == NULL) {
return ApiStatus_DONE2;
}
turningNpc = resolve_npc(script, turningNpcID);
if (turningNpc == NULL) {
return ApiStatus_DONE2;
}
*initialYaw = turningNpc->yaw;
*deltaYaw = atan2(turningNpc->pos.x, turningNpc->pos.z, targetNpc->pos.x, targetNpc->pos.z) - *initialYaw;
script->functionTempPtr[0] = turningNpc;
*turnTime = evt_get_variable(script, *args++);
turningNpc->duration = 0;
if (*deltaYaw < -180.0f) {
*deltaYaw += 360.0f;
}
if (*deltaYaw > 180.0f) {
*deltaYaw -= 360.0f;
}
}
turningNpc = script->functionTempPtr[0];
if (*turnTime > 0) {
turningNpc->duration++;
turningNpc->yaw = *initialYaw + ((*deltaYaw * turningNpc->duration) / *turnTime);
turningNpc->yaw = clamp_angle(turningNpc->yaw);
return !(turningNpc->duration < *turnTime) * ApiStatus_DONE1;
}
turningNpc->yaw += *deltaYaw;
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel create_effect_instance
/* 356BC 8005A2BC 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 356C0 8005A2C0 AFB20018 */ sw $s2, 0x18($sp)
/* 356C4 8005A2C4 0080902D */ daddu $s2, $a0, $zero
/* 356C8 8005A2C8 AFB00010 */ sw $s0, 0x10($sp)
/* 356CC 8005A2CC 0000802D */ daddu $s0, $zero, $zero
/* 356D0 8005A2D0 3C03800B */ lui $v1, %hi(gEffectInstances)
/* 356D4 8005A2D4 24634398 */ addiu $v1, $v1, %lo(gEffectInstances)
/* 356D8 8005A2D8 AFBF001C */ sw $ra, 0x1C($sp)
/* 356DC 8005A2DC AFB10014 */ sw $s1, 0x14($sp)
.L8005A2E0:
/* 356E0 8005A2E0 8C620000 */ lw $v0, 0x0($v1)
/* 356E4 8005A2E4 10400006 */ beqz $v0, .L8005A300
/* 356E8 8005A2E8 2A020060 */ slti $v0, $s0, 0x60
/* 356EC 8005A2EC 26100001 */ addiu $s0, $s0, 0x1
/* 356F0 8005A2F0 2A020060 */ slti $v0, $s0, 0x60
/* 356F4 8005A2F4 1440FFFA */ bnez $v0, .L8005A2E0
/* 356F8 8005A2F8 24630004 */ addiu $v1, $v1, 0x4
/* 356FC 8005A2FC 2A020060 */ slti $v0, $s0, 0x60
.L8005A300:
/* 35700 8005A300 14400003 */ bnez $v0, .L8005A310
/* 35704 8005A304 00000000 */ nop
.L8005A308:
/* 35708 8005A308 080168C2 */ j .L8005A308
/* 3570C 8005A30C 00000000 */ nop
.L8005A310:
/* 35710 8005A310 0C00AB0A */ jal general_heap_malloc
/* 35714 8005A314 24040014 */ addiu $a0, $zero, 0x14
/* 35718 8005A318 00101880 */ sll $v1, $s0, 2
/* 3571C 8005A31C 0040882D */ daddu $s1, $v0, $zero
/* 35720 8005A320 3C01800B */ lui $at, %hi(gEffectInstances)
/* 35724 8005A324 00230821 */ addu $at, $at, $v1
/* 35728 8005A328 AC314398 */ sw $s1, %lo(gEffectInstances)($at)
/* 3572C 8005A32C 16200003 */ bnez $s1, .L8005A33C
/* 35730 8005A330 0000802D */ daddu $s0, $zero, $zero
.L8005A334:
/* 35734 8005A334 080168CD */ j .L8005A334
/* 35738 8005A338 00000000 */ nop
.L8005A33C:
/* 3573C 8005A33C 3C04800A */ lui $a0, %hi(gEffectGraphicsData)
/* 35740 8005A340 24844000 */ addiu $a0, $a0, %lo(gEffectGraphicsData)
/* 35744 8005A344 8E430004 */ lw $v1, 0x4($s2)
/* 35748 8005A348 24020001 */ addiu $v0, $zero, 0x1
/* 3574C 8005A34C AE220000 */ sw $v0, 0x0($s1)
/* 35750 8005A350 AE230004 */ sw $v1, 0x4($s1)
.L8005A354:
/* 35754 8005A354 8C820000 */ lw $v0, 0x0($a0)
/* 35758 8005A358 30420001 */ andi $v0, $v0, 0x1
/* 3575C 8005A35C 50400006 */ beql $v0, $zero, .L8005A378
/* 35760 8005A360 26100001 */ addiu $s0, $s0, 0x1
/* 35764 8005A364 8C830004 */ lw $v1, 0x4($a0)
/* 35768 8005A368 8E420004 */ lw $v0, 0x4($s2)
/* 3576C 8005A36C 10620006 */ beq $v1, $v0, .L8005A388
/* 35770 8005A370 2A02000F */ slti $v0, $s0, 0xF
/* 35774 8005A374 26100001 */ addiu $s0, $s0, 0x1
.L8005A378:
/* 35778 8005A378 2A02000F */ slti $v0, $s0, 0xF
/* 3577C 8005A37C 1440FFF5 */ bnez $v0, .L8005A354
/* 35780 8005A380 24840020 */ addiu $a0, $a0, 0x20
/* 35784 8005A384 2A02000F */ slti $v0, $s0, 0xF
.L8005A388:
/* 35788 8005A388 14400003 */ bnez $v0, .L8005A398
/* 3578C 8005A38C 00000000 */ nop
.L8005A390:
/* 35790 8005A390 080168E4 */ j .L8005A390
/* 35794 8005A394 00000000 */ nop
.L8005A398:
/* 35798 8005A398 8C820008 */ lw $v0, 0x8($a0)
/* 3579C 8005A39C 14400016 */ bnez $v0, .L8005A3F8
/* 357A0 8005A3A0 24420001 */ addiu $v0, $v0, 0x1
/* 357A4 8005A3A4 8E42000C */ lw $v0, 0xC($s2)
/* 357A8 8005A3A8 14400004 */ bnez $v0, .L8005A3BC
/* 357AC 8005A3AC AC820010 */ sw $v0, 0x10($a0)
/* 357B0 8005A3B0 3C028006 */ lui $v0, %hi(stub_effect_delegate)
/* 357B4 8005A3B4 24429C80 */ addiu $v0, $v0, %lo(stub_effect_delegate)
/* 357B8 8005A3B8 AC820014 */ sw $v0, 0x14($a0)
.L8005A3BC:
/* 357BC 8005A3BC 8E420010 */ lw $v0, 0x10($s2)
/* 357C0 8005A3C0 8C830018 */ lw $v1, 0x18($a0)
/* 357C4 8005A3C4 14600004 */ bnez $v1, .L8005A3D8
/* 357C8 8005A3C8 AC820014 */ sw $v0, 0x14($a0)
/* 357CC 8005A3CC 3C028006 */ lui $v0, %hi(stub_effect_delegate)
/* 357D0 8005A3D0 24429C80 */ addiu $v0, $v0, %lo(stub_effect_delegate)
/* 357D4 8005A3D4 AC820018 */ sw $v0, 0x18($a0)
.L8005A3D8:
/* 357D8 8005A3D8 8E420014 */ lw $v0, 0x14($s2)
/* 357DC 8005A3DC 14400004 */ bnez $v0, .L8005A3F0
/* 357E0 8005A3E0 AC820018 */ sw $v0, 0x18($a0)
/* 357E4 8005A3E4 3C028006 */ lui $v0, %hi(stub_effect_delegate)
/* 357E8 8005A3E8 24429C80 */ addiu $v0, $v0, %lo(stub_effect_delegate)
/* 357EC 8005A3EC AC820018 */ sw $v0, 0x18($a0)
.L8005A3F0:
/* 357F0 8005A3F0 8C820008 */ lw $v0, 0x8($a0)
/* 357F4 8005A3F4 24420001 */ addiu $v0, $v0, 0x1
.L8005A3F8:
/* 357F8 8005A3F8 AC820008 */ sw $v0, 0x8($a0)
/* 357FC 8005A3FC AE240010 */ sw $a0, 0x10($s1)
/* 35800 8005A400 8E420008 */ lw $v0, 0x8($s2)
/* 35804 8005A404 10400003 */ beqz $v0, .L8005A414
/* 35808 8005A408 00000000 */ nop
/* 3580C 8005A40C 0040F809 */ jalr $v0
/* 35810 8005A410 0220202D */ daddu $a0, $s1, $zero
.L8005A414:
/* 35814 8005A414 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 35818 8005A418 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 3581C 8005A41C 80420070 */ lb $v0, 0x70($v0)
/* 35820 8005A420 10400005 */ beqz $v0, .L8005A438
/* 35824 8005A424 0220102D */ daddu $v0, $s1, $zero
/* 35828 8005A428 8E220000 */ lw $v0, 0x0($s1)
/* 3582C 8005A42C 34420004 */ ori $v0, $v0, 0x4
/* 35830 8005A430 AE220000 */ sw $v0, 0x0($s1)
/* 35834 8005A434 0220102D */ daddu $v0, $s1, $zero
.L8005A438:
/* 35838 8005A438 8FBF001C */ lw $ra, 0x1C($sp)
/* 3583C 8005A43C 8FB20018 */ lw $s2, 0x18($sp)
/* 35840 8005A440 8FB10014 */ lw $s1, 0x14($sp)
/* 35844 8005A444 8FB00010 */ lw $s0, 0x10($sp)
/* 35848 8005A448 03E00008 */ jr $ra
/* 3584C 8005A44C 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
EffectInstance* create_effect_instance(EffectBlueprint* effectBp) {
EffectInstance* newEffectInst;
EffectGraphics* effectGraphics;
s32 i;
// Search for an unused instance
for (i = 0; i < ARRAY_COUNT(gEffectInstances); i++) {
if (gEffectInstances[i] == NULL) {
break;
}
}
ASSERT(i < ARRAY_COUNT(gEffectInstances));
// Allocate space for the new instance
gEffectInstances[i] = newEffectInst = general_heap_malloc(sizeof(*newEffectInst));
ASSERT(newEffectInst != NULL);
effectGraphics = &gEffectGraphicsData[0];
newEffectInst->effectIndex = effectBp->effectID;
newEffectInst->flags = FX_INSTANCE_FLAG_ENABLED;
// Look for a loaded effect of the proper index
for (i = 0; i < ARRAY_COUNT(gEffectGraphicsData); i++) {
if ((effectGraphics->flags & FX_GRAPHICS_LOADED) && (effectGraphics->effectIndex == effectBp->effectID)) {
break;
}
effectGraphics++;
}
ASSERT(i < ARRAY_COUNT(gEffectGraphicsData));
// If this is the first new instance of the effect, initialize the function pointers
if (effectGraphics->instanceCounter == 0) {
effectGraphics->update = effectBp->update;
if (effectGraphics->update == NULL) {
effectGraphics->renderWorld = stub_effect_delegate;
}
effectGraphics->renderWorld = effectBp->renderWorld;
// @bug? null check for renderUI instead of renderWorld
if (effectGraphics->renderUI == NULL) {
effectGraphics->renderUI = stub_effect_delegate;
}
effectGraphics->renderUI = effectBp->renderUI;
if (effectGraphics->renderUI == NULL) {
effectGraphics->renderUI = stub_effect_delegate;
}
}
effectGraphics->instanceCounter++;
newEffectInst->graphics = effectGraphics;
if (effectBp->init != NULL) {
effectBp->init(newEffectInst);
}
if (gGameStatusPtr->isBattle) {
newEffectInst->flags |= FX_INSTANCE_FLAG_BATTLE;
}
return newEffectInst;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel spawn_flower_surface_effects
/* 18E38 8003DA38 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 18E3C 8003DA3C AFB00018 */ sw $s0, 0x18($sp)
/* 18E40 8003DA40 24020002 */ addiu $v0, $zero, 0x2
/* 18E44 8003DA44 AFBF0020 */ sw $ra, 0x20($sp)
/* 18E48 8003DA48 AFB1001C */ sw $s1, 0x1C($sp)
/* 18E4C 8003DA4C F7B80038 */ sdc1 $f24, 0x38($sp)
/* 18E50 8003DA50 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 18E54 8003DA54 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 18E58 8003DA58 14A20019 */ bne $a1, $v0, .L8003DAC0
/* 18E5C 8003DA5C 0080802D */ daddu $s0, $a0, $zero
/* 18E60 8003DA60 3C118007 */ lui $s1, %hi(D_80077C1E)
/* 18E64 8003DA64 26317C1E */ addiu $s1, $s1, %lo(D_80077C1E)
/* 18E68 8003DA68 86230000 */ lh $v1, 0x0($s1)
/* 18E6C 8003DA6C 24020005 */ addiu $v0, $zero, 0x5
/* 18E70 8003DA70 14620013 */ bne $v1, $v0, .L8003DAC0
/* 18E74 8003DA74 00000000 */ nop
/* 18E78 8003DA78 C60C0038 */ lwc1 $f12, 0x38($s0)
/* 18E7C 8003DA7C 8E060040 */ lw $a2, 0x40($s0)
/* 18E80 8003DA80 C600003C */ lwc1 $f0, 0x3C($s0)
/* 18E84 8003DA84 3C014160 */ lui $at, (0x41600000 >> 16)
/* 18E88 8003DA88 44817000 */ mtc1 $at, $f14
/* 18E8C 8003DA8C 3C108007 */ lui $s0, %hi(D_80077C18)
/* 18E90 8003DA90 26107C18 */ addiu $s0, $s0, %lo(D_80077C18)
/* 18E94 8003DA94 8E070000 */ lw $a3, 0x0($s0)
/* 18E98 8003DA98 0C01BEE4 */ jal fx_flower_splash
/* 18E9C 8003DA9C 460E0380 */ add.s $f14, $f0, $f14
/* 18EA0 8003DAA0 C6000000 */ lwc1 $f0, 0x0($s0)
/* 18EA4 8003DAA4 3C01420C */ lui $at, (0x420C0000 >> 16)
/* 18EA8 8003DAA8 44816000 */ mtc1 $at, $f12
/* 18EAC 8003DAAC 0C00A6C9 */ jal clamp_angle
/* 18EB0 8003DAB0 460C0300 */ add.s $f12, $f0, $f12
/* 18EB4 8003DAB4 E6000000 */ swc1 $f0, 0x0($s0)
/* 18EB8 8003DAB8 0800F706 */ j .L8003DC18
/* 18EBC 8003DABC A6200000 */ sh $zero, 0x0($s1)
.L8003DAC0:
/* 18EC0 8003DAC0 3C038007 */ lui $v1, %hi(D_80077C1E)
/* 18EC4 8003DAC4 24637C1E */ addiu $v1, $v1, %lo(D_80077C1E)
/* 18EC8 8003DAC8 94620000 */ lhu $v0, 0x0($v1)
/* 18ECC 8003DACC 24420001 */ addiu $v0, $v0, 0x1
/* 18ED0 8003DAD0 A4620000 */ sh $v0, 0x0($v1)
/* 18ED4 8003DAD4 00021400 */ sll $v0, $v0, 16
/* 18ED8 8003DAD8 00021403 */ sra $v0, $v0, 16
/* 18EDC 8003DADC 28420006 */ slti $v0, $v0, 0x6
/* 18EE0 8003DAE0 14400002 */ bnez $v0, .L8003DAEC
/* 18EE4 8003DAE4 24020005 */ addiu $v0, $zero, 0x5
/* 18EE8 8003DAE8 A4620000 */ sh $v0, 0x0($v1)
.L8003DAEC:
/* 18EEC 8003DAEC 3C048007 */ lui $a0, %hi(D_80077C1C)
/* 18EF0 8003DAF0 24847C1C */ addiu $a0, $a0, %lo(D_80077C1C)
/* 18EF4 8003DAF4 94820000 */ lhu $v0, 0x0($a0)
/* 18EF8 8003DAF8 24430001 */ addiu $v1, $v0, 0x1
/* 18EFC 8003DAFC 00021400 */ sll $v0, $v0, 16
/* 18F00 8003DB00 18400045 */ blez $v0, .L8003DC18
/* 18F04 8003DB04 A4830000 */ sh $v1, 0x0($a0)
/* 18F08 8003DB08 C60C000C */ lwc1 $f12, 0xC($s0)
/* 18F0C 8003DB0C A4800000 */ sh $zero, 0x0($a0)
/* 18F10 8003DB10 0C00A6C9 */ jal clamp_angle
/* 18F14 8003DB14 46006307 */ neg.s $f12, $f12
/* 18F18 8003DB18 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* 18F1C 8003DB1C 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* 18F20 8003DB20 44811000 */ mtc1 $at, $f2
/* 18F24 8003DB24 00000000 */ nop
/* 18F28 8003DB28 46020502 */ mul.s $f20, $f0, $f2
/* 18F2C 8003DB2C 00000000 */ nop
/* 18F30 8003DB30 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 18F34 8003DB34 44810000 */ mtc1 $at, $f0
/* 18F38 8003DB38 00000000 */ nop
/* 18F3C 8003DB3C 4600A503 */ div.s $f20, $f20, $f0
/* 18F40 8003DB40 0C00A85B */ jal sin_rad
/* 18F44 8003DB44 4600A306 */ mov.s $f12, $f20
/* 18F48 8003DB48 4600A306 */ mov.s $f12, $f20
/* 18F4C 8003DB4C 0C00A874 */ jal cos_rad
/* 18F50 8003DB50 46000506 */ mov.s $f20, $f0
/* 18F54 8003DB54 860200A6 */ lh $v0, 0xA6($s0)
/* 18F58 8003DB58 44821000 */ mtc1 $v0, $f2
/* 18F5C 8003DB5C 00000000 */ nop
/* 18F60 8003DB60 468010A0 */ cvt.s.w $f2, $f2
/* 18F64 8003DB64 46141502 */ mul.s $f20, $f2, $f20
/* 18F68 8003DB68 00000000 */ nop
/* 18F6C 8003DB6C 46001082 */ mul.s $f2, $f2, $f0
/* 18F70 8003DB70 00000000 */ nop
/* 18F74 8003DB74 3C01BECC */ lui $at, (0xBECCCCCD >> 16)
/* 18F78 8003DB78 3421CCCD */ ori $at, $at, (0xBECCCCCD & 0xFFFF)
/* 18F7C 8003DB7C 44810000 */ mtc1 $at, $f0
/* 18F80 8003DB80 00000000 */ nop
/* 18F84 8003DB84 4600A502 */ mul.s $f20, $f20, $f0
/* 18F88 8003DB88 00000000 */ nop
/* 18F8C 8003DB8C 46001082 */ mul.s $f2, $f2, $f0
/* 18F90 8003DB90 00000000 */ nop
/* 18F94 8003DB94 C6000038 */ lwc1 $f0, 0x38($s0)
/* 18F98 8003DB98 46140600 */ add.s $f24, $f0, $f20
/* 18F9C 8003DB9C C6000040 */ lwc1 $f0, 0x40($s0)
/* 18FA0 8003DBA0 C604003C */ lwc1 $f4, 0x3C($s0)
/* 18FA4 8003DBA4 46020580 */ add.s $f22, $f0, $f2
/* 18FA8 8003DBA8 3C014178 */ lui $at, (0x41780000 >> 16)
/* 18FAC 8003DBAC 44810000 */ mtc1 $at, $f0
/* 18FB0 8003DBB0 2404000A */ addiu $a0, $zero, 0xA
/* 18FB4 8003DBB4 0C00A67F */ jal rand_int
/* 18FB8 8003DBB8 46002500 */ add.s $f20, $f4, $f0
/* 18FBC 8003DBBC 24040001 */ addiu $a0, $zero, 0x1
/* 18FC0 8003DBC0 44821000 */ mtc1 $v0, $f2
/* 18FC4 8003DBC4 00000000 */ nop
/* 18FC8 8003DBC8 468010A0 */ cvt.s.w $f2, $f2
/* 18FCC 8003DBCC C600000C */ lwc1 $f0, 0xC($s0)
/* 18FD0 8003DBD0 3C108007 */ lui $s0, %hi(D_80077C20)
/* 18FD4 8003DBD4 26107C20 */ addiu $s0, $s0, %lo(D_80077C20)
/* 18FD8 8003DBD8 4405C000 */ mfc1 $a1, $f24
/* 18FDC 8003DBDC 4407B000 */ mfc1 $a3, $f22
/* 18FE0 8003DBE0 46000007 */ neg.s $f0, $f0
/* 18FE4 8003DBE4 46020000 */ add.s $f0, $f0, $f2
/* 18FE8 8003DBE8 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 18FEC 8003DBEC 44811000 */ mtc1 $at, $f2
/* 18FF0 8003DBF0 4406A000 */ mfc1 $a2, $f20
/* 18FF4 8003DBF4 46020001 */ sub.s $f0, $f0, $f2
/* 18FF8 8003DBF8 C6020000 */ lwc1 $f2, 0x0($s0)
/* 18FFC 8003DBFC 468010A0 */ cvt.s.w $f2, $f2
/* 19000 8003DC00 E7A20014 */ swc1 $f2, 0x14($sp)
/* 19004 8003DC04 0C01BEFC */ jal fx_flower_trail
/* 19008 8003DC08 E7A00010 */ swc1 $f0, 0x10($sp)
/* 1900C 8003DC0C 8E020000 */ lw $v0, 0x0($s0)
/* 19010 8003DC10 2C420001 */ sltiu $v0, $v0, 0x1
/* 19014 8003DC14 AE020000 */ sw $v0, 0x0($s0)
.L8003DC18:
/* 19018 8003DC18 8FBF0020 */ lw $ra, 0x20($sp)
/* 1901C 8003DC1C 8FB1001C */ lw $s1, 0x1C($sp)
/* 19020 8003DC20 8FB00018 */ lw $s0, 0x18($sp)
/* 19024 8003DC24 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 19028 8003DC28 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 1902C 8003DC2C D7B40028 */ ldc1 $f20, 0x28($sp)
/* 19030 8003DC30 03E00008 */ jr $ra
/* 19034 8003DC34 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
void spawn_flower_surface_effects(Npc* npc, SurfaceInteractMode mode) {
f32 theta;
f32 sinTheta;
f32 cosTheta;
f32 x, y, z;
if (mode == SURFACE_INTERACT_LAND && D_80077C1E == 5) {
x = npc->pos.x;
y = npc->pos.y + + 14.0f;
z = npc->pos.z;
fx_flower_splash(x, y, z, D_80077C18);
D_80077C18 = clamp_angle(D_80077C18 + 35.0f);
D_80077C1E = 0;
return;
}
D_80077C1E++;
if (D_80077C1E > 5) {
D_80077C1E = 5;
}
if (D_80077C1C++ > 0) {
D_80077C1C = 0;
theta = DEG_TO_RAD(clamp_angle(-npc->yaw));
sinTheta = sin_rad(theta);
cosTheta = cos_rad(theta);
x = npc->pos.x + (npc->collisionDiameter * sinTheta * -0.4f);
z = npc->pos.z + (npc->collisionDiameter * cosTheta * -0.4f);
y = npc->pos.y + 15.5f;
fx_flower_trail(1, x, y, z, -npc->yaw + rand_int(10) - 5.0f, D_80077C20);
D_80077C20 = D_80077C20 == 0;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel floating_flower_update
/* 330054 E001A224 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 330058 E001A228 AFBF0010 */ sw $ra, 0x10($sp)
/* 33005C E001A22C 8C85000C */ lw $a1, 0xC($a0)
/* 330060 E001A230 8CA20034 */ lw $v0, 0x34($a1)
/* 330064 E001A234 8CA60000 */ lw $a2, 0x0($a1)
/* 330068 E001A238 28420096 */ slti $v0, $v0, 0x96
/* 33006C E001A23C 10400039 */ beqz $v0, .LE001A324
/* 330070 E001A240 00000000 */ nop
/* 330074 E001A244 C4A00010 */ lwc1 $f0, 0x10($a1)
/* 330078 E001A248 3C01E002 */ lui $at, (0xE0020000 >> 16)
/* 33007C E001A24C D422A620 */ ldc1 $f2, -0x59E0($at)
/* 330080 E001A250 C4A6000C */ lwc1 $f6, 0xC($a1)
/* 330084 E001A254 46000021 */ cvt.d.s $f0, $f0
/* 330088 E001A258 46220001 */ sub.d $f0, $f0, $f2
/* 33008C E001A25C C4A20018 */ lwc1 $f2, 0x18($a1)
/* 330090 E001A260 C4A40024 */ lwc1 $f4, 0x24($a1)
/* 330094 E001A264 46023180 */ add.s $f6, $f6, $f2
/* 330098 E001A268 C4A2002C */ lwc1 $f2, 0x2C($a1)
/* 33009C E001A26C 46022100 */ add.s $f4, $f4, $f2
/* 3300A0 E001A270 C4A20004 */ lwc1 $f2, 0x4($a1)
/* 3300A4 E001A274 46200020 */ cvt.s.d $f0, $f0
/* 3300A8 E001A278 E4A00010 */ swc1 $f0, 0x10($a1)
/* 3300AC E001A27C 46001080 */ add.s $f2, $f2, $f0
/* 3300B0 E001A280 E4A6000C */ swc1 $f6, 0xC($a1)
/* 3300B4 E001A284 E4A40024 */ swc1 $f4, 0x24($a1)
/* 3300B8 E001A288 14C00018 */ bnez $a2, .LE001A2EC
/* 3300BC E001A28C E4A20004 */ swc1 $f2, 0x4($a1)
/* 3300C0 E001A290 3C014120 */ lui $at, (0x41200000 >> 16)
/* 3300C4 E001A294 44811000 */ mtc1 $at, $f2
/* 3300C8 E001A298 00000000 */ nop
/* 3300CC E001A29C 4602203C */ c.lt.s $f4, $f2
/* 3300D0 E001A2A0 00000000 */ nop
/* 3300D4 E001A2A4 45000005 */ bc1f .LE001A2BC
/* 3300D8 E001A2A8 00000000 */ nop
/* 3300DC E001A2AC C4A0002C */ lwc1 $f0, 0x2C($a1)
/* 3300E0 E001A2B0 E4A20024 */ swc1 $f2, 0x24($a1)
/* 3300E4 E001A2B4 46000007 */ neg.s $f0, $f0
/* 3300E8 E001A2B8 E4A0002C */ swc1 $f0, 0x2C($a1)
.LE001A2BC:
/* 3300EC E001A2BC C4A00024 */ lwc1 $f0, 0x24($a1)
/* 3300F0 E001A2C0 3C014234 */ lui $at, (0x42340000 >> 16)
/* 3300F4 E001A2C4 44811000 */ mtc1 $at, $f2
/* 3300F8 E001A2C8 00000000 */ nop
/* 3300FC E001A2CC 4600103C */ c.lt.s $f2, $f0
/* 330100 E001A2D0 00000000 */ nop
/* 330104 E001A2D4 45000005 */ bc1f .LE001A2EC
/* 330108 E001A2D8 00000000 */ nop
/* 33010C E001A2DC C4A0002C */ lwc1 $f0, 0x2C($a1)
/* 330110 E001A2E0 E4A20024 */ swc1 $f2, 0x24($a1)
/* 330114 E001A2E4 46000007 */ neg.s $f0, $f0
/* 330118 E001A2E8 E4A0002C */ swc1 $f0, 0x2C($a1)
.LE001A2EC:
/* 33011C E001A2EC C4A00028 */ lwc1 $f0, 0x28($a1)
/* 330120 E001A2F0 C4A20030 */ lwc1 $f2, 0x30($a1)
/* 330124 E001A2F4 46020000 */ add.s $f0, $f0, $f2
/* 330128 E001A2F8 14C00006 */ bnez $a2, .LE001A314
/* 33012C E001A2FC E4A00028 */ swc1 $f0, 0x28($a1)
/* 330130 E001A300 3C013FB3 */ lui $at, (0x3FB33333 >> 16)
/* 330134 E001A304 34213333 */ ori $at, $at, (0x3FB33333 & 0xFFFF)
/* 330138 E001A308 44810000 */ mtc1 $at, $f0
/* 33013C E001A30C 080068DC */ j .LE001A370
/* 330140 E001A310 E4A00014 */ swc1 $f0, 0x14($a1)
.LE001A314:
/* 330144 E001A314 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 330148 E001A318 44810000 */ mtc1 $at, $f0
/* 33014C E001A31C 080068DC */ j .LE001A370
/* 330150 E001A320 E4A00014 */ swc1 $f0, 0x14($a1)
.LE001A324:
/* 330154 E001A324 C4A00020 */ lwc1 $f0, 0x20($a1)
/* 330158 E001A328 3C01E002 */ lui $at, (0xE0020000 >> 16)
/* 33015C E001A32C D422A628 */ ldc1 $f2, -0x59D8($at)
/* 330160 E001A330 46000021 */ cvt.d.s $f0, $f0
/* 330164 E001A334 46220000 */ add.d $f0, $f0, $f2
/* 330168 E001A338 C4A4001C */ lwc1 $f4, 0x1C($a1)
/* 33016C E001A33C 46200020 */ cvt.s.d $f0, $f0
/* 330170 E001A340 46002100 */ add.s $f4, $f4, $f0
/* 330174 E001A344 C4A20014 */ lwc1 $f2, 0x14($a1)
/* 330178 E001A348 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 33017C E001A34C 44813000 */ mtc1 $at, $f6
/* 330180 E001A350 46041080 */ add.s $f2, $f2, $f4
/* 330184 E001A354 E4A00020 */ swc1 $f0, 0x20($a1)
/* 330188 E001A358 E4A4001C */ swc1 $f4, 0x1C($a1)
/* 33018C E001A35C 4602303C */ c.lt.s $f6, $f2
/* 330190 E001A360 00000000 */ nop
/* 330194 E001A364 45000002 */ bc1f .LE001A370
/* 330198 E001A368 E4A20014 */ swc1 $f2, 0x14($a1)
/* 33019C E001A36C E4A60014 */ swc1 $f6, 0x14($a1)
.LE001A370:
/* 3301A0 E001A370 24020001 */ addiu $v0, $zero, 0x1
/* 3301A4 E001A374 14C20010 */ bne $a2, $v0, .LE001A3B8
/* 3301A8 E001A378 00000000 */ nop
/* 3301AC E001A37C 8CA20040 */ lw $v0, 0x40($a1)
/* 3301B0 E001A380 8CA3003C */ lw $v1, 0x3C($a1)
/* 3301B4 E001A384 00431821 */ addu $v1, $v0, $v1
/* 3301B8 E001A388 28620014 */ slti $v0, $v1, 0x14
/* 3301BC E001A38C 14400006 */ bnez $v0, .LE001A3A8
/* 3301C0 E001A390 ACA30040 */ sw $v1, 0x40($a1)
/* 3301C4 E001A394 24020014 */ addiu $v0, $zero, 0x14
/* 3301C8 E001A398 ACA20040 */ sw $v0, 0x40($a1)
/* 3301CC E001A39C 2402FFFF */ addiu $v0, $zero, -0x1
/* 3301D0 E001A3A0 080068EE */ j .LE001A3B8
/* 3301D4 E001A3A4 ACA2003C */ sw $v0, 0x3C($a1)
.LE001A3A8:
/* 3301D8 E001A3A8 1C600003 */ bgtz $v1, .LE001A3B8
/* 3301DC E001A3AC 00000000 */ nop
/* 3301E0 E001A3B0 ACA00040 */ sw $zero, 0x40($a1)
/* 3301E4 E001A3B4 ACA6003C */ sw $a2, 0x3C($a1)
.LE001A3B8:
/* 3301E8 E001A3B8 C4A00008 */ lwc1 $f0, 0x8($a1)
/* 3301EC E001A3BC 8CA20034 */ lw $v0, 0x34($a1)
/* 3301F0 E001A3C0 C4A20014 */ lwc1 $f2, 0x14($a1)
/* 3301F4 E001A3C4 2442FFFF */ addiu $v0, $v0, -0x1
/* 3301F8 E001A3C8 46020000 */ add.s $f0, $f0, $f2
/* 3301FC E001A3CC ACA20034 */ sw $v0, 0x34($a1)
/* 330200 E001A3D0 8CA20038 */ lw $v0, 0x38($a1)
/* 330204 E001A3D4 8CA30034 */ lw $v1, 0x34($a1)
/* 330208 E001A3D8 24420001 */ addiu $v0, $v0, 0x1
/* 33020C E001A3DC ACA20038 */ sw $v0, 0x38($a1)
/* 330210 E001A3E0 04610003 */ bgez $v1, .LE001A3F0
/* 330214 E001A3E4 E4A00008 */ swc1 $f0, 0x8($a1)
/* 330218 E001A3E8 0C080128 */ jal shim_remove_effect
/* 33021C E001A3EC 00000000 */ nop
.LE001A3F0:
/* 330220 E001A3F0 8FBF0010 */ lw $ra, 0x10($sp)
/* 330224 E001A3F4 03E00008 */ jr $ra
/* 330228 E001A3F8 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void floating_flower_update(EffectInstance* effect) {
FloatingFlowerFXData* data = effect->data.floatingFlower;
s32 type = data->type;
if (data->timeLeft < 150) {
data->vel.x -= 0.001;
data->pos.x += data->vel.x;
data->pos.z += data->vel.z;
data->rot.x += data->angularVel.x;
if (type == 0) {
if (data->rot.x < 10.0f) {
data->rot.x = 10.0f;
data->angularVel.x = -data->angularVel.x;
}
if (data->rot.x > 45.0f) {
data->rot.x = 45.0f;
data->angularVel.x = -data->angularVel.x;
}
}
data->rot.y += data->angularVel.y;
if (type == 0) {
data->vel.y = 1.4f;
} else {
data->vel.y = 1.0f;
}
} else {
data->jerkY += 0.0007;
data->accelY += data->jerkY;
data->vel.y += data->accelY;
if (data->vel.y > 1.0f) {
data->vel.y = 1.0f;
}
}
if (type == 1) {
data->unk_40 += data->unk_3C;
if (data->unk_40 >= 20) {
data->unk_40 = 20;
data->unk_3C = -1;
} else if (data->unk_40 <= 0) {
data->unk_40 = 0;
data->unk_3C = type;
}
}
data->pos.y += data->vel.y;
data->timeLeft--;
data->lifetime++;
if (data->timeLeft < 0) {
shim_remove_effect(effect);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel DropStarPoints
/* 1AB184 8027C8A4 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 1AB188 8027C8A8 AFB00020 */ sw $s0, 0x20($sp)
/* 1AB18C 8027C8AC 0080802D */ daddu $s0, $a0, $zero
/* 1AB190 8027C8B0 AFBF0034 */ sw $ra, 0x34($sp)
/* 1AB194 8027C8B4 AFB40030 */ sw $s4, 0x30($sp)
/* 1AB198 8027C8B8 AFB3002C */ sw $s3, 0x2C($sp)
/* 1AB19C 8027C8BC AFB20028 */ sw $s2, 0x28($sp)
/* 1AB1A0 8027C8C0 AFB10024 */ sw $s1, 0x24($sp)
/* 1AB1A4 8027C8C4 8E02000C */ lw $v0, 0xC($s0)
/* 1AB1A8 8027C8C8 0C0B1EAF */ jal evt_get_variable
/* 1AB1AC 8027C8CC 8C450000 */ lw $a1, 0x0($v0)
/* 1AB1B0 8027C8D0 0040202D */ daddu $a0, $v0, $zero
/* 1AB1B4 8027C8D4 3C14800E */ lui $s4, %hi(gBattleStatus)
/* 1AB1B8 8027C8D8 2694C070 */ addiu $s4, $s4, %lo(gBattleStatus)
/* 1AB1BC 8027C8DC 2402FF81 */ addiu $v0, $zero, -0x7F
/* 1AB1C0 8027C8E0 14820002 */ bne $a0, $v0, .L8027C8EC
/* 1AB1C4 8027C8E4 00000000 */ nop
/* 1AB1C8 8027C8E8 8E040148 */ lw $a0, 0x148($s0)
.L8027C8EC:
/* 1AB1CC 8027C8EC 0C09A75B */ jal get_actor
/* 1AB1D0 8027C8F0 00000000 */ nop
/* 1AB1D4 8027C8F4 0040882D */ daddu $s1, $v0, $zero
/* 1AB1D8 8027C8F8 8E220008 */ lw $v0, 0x8($s1)
/* 1AB1DC 8027C8FC 90420006 */ lbu $v0, 0x6($v0)
/* 1AB1E0 8027C900 44800000 */ mtc1 $zero, $f0
/* 1AB1E4 8027C904 44823000 */ mtc1 $v0, $f6
/* 1AB1E8 8027C908 00000000 */ nop
/* 1AB1EC 8027C90C 468031A0 */ cvt.s.w $f6, $f6
/* 1AB1F0 8027C910 46003032 */ c.eq.s $f6, $f0
/* 1AB1F4 8027C914 00000000 */ nop
/* 1AB1F8 8027C918 45000003 */ bc1f .L8027C928
/* 1AB1FC 8027C91C 00000000 */ nop
/* 1AB200 8027C920 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 1AB204 8027C924 44813000 */ mtc1 $at, $f6
.L8027C928:
/* 1AB208 8027C928 3C028011 */ lui $v0, %hi(gPlayerData)
/* 1AB20C 8027C92C 2442F290 */ addiu $v0, $v0, %lo(gPlayerData)
/* 1AB210 8027C930 80430009 */ lb $v1, 0x9($v0)
/* 1AB214 8027C934 44832000 */ mtc1 $v1, $f4
/* 1AB218 8027C938 00000000 */ nop
/* 1AB21C 8027C93C 46802120 */ cvt.s.w $f4, $f4
/* 1AB220 8027C940 46002032 */ c.eq.s $f4, $f0
/* 1AB224 8027C944 00000000 */ nop
/* 1AB228 8027C948 45000004 */ bc1f .L8027C95C
/* 1AB22C 8027C94C 00000000 */ nop
/* 1AB230 8027C950 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 1AB234 8027C954 44812000 */ mtc1 $at, $f4
/* 1AB238 8027C958 00000000 */ nop
.L8027C95C:
/* 1AB23C 8027C95C 4604303C */ c.lt.s $f6, $f4
/* 1AB240 8027C960 00000000 */ nop
/* 1AB244 8027C964 45010017 */ bc1t .L8027C9C4
/* 1AB248 8027C968 46000086 */ mov.s $f2, $f0
/* 1AB24C 8027C96C 46043081 */ sub.s $f2, $f6, $f4
/* 1AB250 8027C970 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 1AB254 8027C974 44810000 */ mtc1 $at, $f0
/* 1AB258 8027C978 00000000 */ nop
/* 1AB25C 8027C97C 46001082 */ mul.s $f2, $f2, $f0
/* 1AB260 8027C980 00000000 */ nop
/* 1AB264 8027C984 8282008E */ lb $v0, 0x8E($s4)
/* 1AB268 8027C988 00021080 */ sll $v0, $v0, 2
/* 1AB26C 8027C98C 3C018029 */ lui $at, %hi(D_802946E0)
/* 1AB270 8027C990 00220821 */ addu $at, $at, $v0
/* 1AB274 8027C994 C42046E0 */ lwc1 $f0, %lo(D_802946E0)($at)
/* 1AB278 8027C998 46800020 */ cvt.s.w $f0, $f0
/* 1AB27C 8027C99C 46001082 */ mul.s $f2, $f2, $f0
/* 1AB280 8027C9A0 00000000 */ nop
/* 1AB284 8027C9A4 3C014248 */ lui $at, (0x42480000 >> 16)
/* 1AB288 8027C9A8 44810000 */ mtc1 $at, $f0
/* 1AB28C 8027C9AC 00000000 */ nop
/* 1AB290 8027C9B0 46001000 */ add.s $f0, $f2, $f0
/* 1AB294 8027C9B4 3C0142C8 */ lui $at, (0x42C80000 >> 16)
/* 1AB298 8027C9B8 44811000 */ mtc1 $at, $f2
/* 1AB29C 8027C9BC 00000000 */ nop
/* 1AB2A0 8027C9C0 46020083 */ div.s $f2, $f0, $f2
.L8027C9C4:
/* 1AB2A4 8027C9C4 4600120D */ trunc.w.s $f8, $f2
/* 1AB2A8 8027C9C8 44134000 */ mfc1 $s3, $f8
/* 1AB2AC 8027C9CC 2862001B */ slti $v0, $v1, 0x1B
/* 1AB2B0 8027C9D0 10400019 */ beqz $v0, .L8027CA38
/* 1AB2B4 8027C9D4 00000000 */ nop
/* 1AB2B8 8027C9D8 8E220000 */ lw $v0, 0x0($s1)
/* 1AB2BC 8027C9DC 30420800 */ andi $v0, $v0, 0x800
/* 1AB2C0 8027C9E0 10400002 */ beqz $v0, .L8027C9EC
/* 1AB2C4 8027C9E4 24120017 */ addiu $s2, $zero, 0x17
/* 1AB2C8 8027C9E8 24120019 */ addiu $s2, $zero, 0x19
.L8027C9EC:
/* 1AB2CC 8027C9EC 1A60000D */ blez $s3, .L8027CA24
/* 1AB2D0 8027C9F0 0000802D */ daddu $s0, $zero, $zero
/* 1AB2D4 8027C9F4 24040159 */ addiu $a0, $zero, 0x159
.L8027C9F8:
/* 1AB2D8 8027C9F8 AFB20010 */ sw $s2, 0x10($sp)
/* 1AB2DC 8027C9FC AFB00014 */ sw $s0, 0x14($sp)
/* 1AB2E0 8027CA00 AFA00018 */ sw $zero, 0x18($sp)
/* 1AB2E4 8027CA04 8E250144 */ lw $a1, 0x144($s1)
/* 1AB2E8 8027CA08 8E260148 */ lw $a2, 0x148($s1)
/* 1AB2EC 8027CA0C 8E27014C */ lw $a3, 0x14C($s1)
/* 1AB2F0 8027CA10 0C04C6B2 */ jal make_item_entity_delayed
/* 1AB2F4 8027CA14 26100001 */ addiu $s0, $s0, 0x1
/* 1AB2F8 8027CA18 0213102A */ slt $v0, $s0, $s3
/* 1AB2FC 8027CA1C 1440FFF6 */ bnez $v0, .L8027C9F8
/* 1AB300 8027CA20 24040159 */ addiu $a0, $zero, 0x159
.L8027CA24:
/* 1AB304 8027CA24 92820079 */ lbu $v0, 0x79($s4)
/* 1AB308 8027CA28 24030028 */ addiu $v1, $zero, 0x28
/* 1AB30C 8027CA2C A283007A */ sb $v1, 0x7A($s4)
/* 1AB310 8027CA30 00531021 */ addu $v0, $v0, $s3
/* 1AB314 8027CA34 A2820079 */ sb $v0, 0x79($s4)
.L8027CA38:
/* 1AB318 8027CA38 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1AB31C 8027CA3C 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1AB320 8027CA40 8C640000 */ lw $a0, 0x0($v1)
/* 1AB324 8027CA44 3C050100 */ lui $a1, (0x1000000 >> 16)
/* 1AB328 8027CA48 00852025 */ or $a0, $a0, $a1
/* 1AB32C 8027CA4C AC640000 */ sw $a0, 0x0($v1)
/* 1AB330 8027CA50 8FBF0034 */ lw $ra, 0x34($sp)
/* 1AB334 8027CA54 8FB40030 */ lw $s4, 0x30($sp)
/* 1AB338 8027CA58 8FB3002C */ lw $s3, 0x2C($sp)
/* 1AB33C 8027CA5C 8FB20028 */ lw $s2, 0x28($sp)
/* 1AB340 8027CA60 8FB10024 */ lw $s1, 0x24($sp)
/* 1AB344 8027CA64 8FB00020 */ lw $s0, 0x20($sp)
/* 1AB348 8027CA68 24020002 */ addiu $v0, $zero, 0x2
/* 1AB34C 8027CA6C 03E00008 */ jr $ra
/* 1AB350 8027CA70 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
ApiStatus DropStarPoints(Evt* script, s32 isInitialCall) {
BattleStatus* battleStatus = &gBattleStatus;
PlayerData* playerData = &gPlayerData;
Bytecode* args = script->ptrReadPos;
Actor* dropper;
f32 playerLevel;
f32 enemyLevel;
s32 actorID;
f32 ntd;
s32 numToDrop;
actorID = evt_get_variable(script, *args++);
if (actorID == ACTOR_SELF) {
actorID = script->owner1.enemyID;
}
dropper = get_actor(actorID);
enemyLevel = dropper->actorBlueprint->level;
if (dropper->actorBlueprint->level == 0.0f) {
enemyLevel = 1.0f;
}
playerLevel = playerData->level;
if (playerLevel == 0.0f) {
playerLevel = 1.0f;
}
ntd = 0.0f;
if (!(enemyLevel < playerLevel)) {
ntd = ((enemyLevel - playerLevel) * 0.5f) * D_802946E0[battleStatus->initialEnemyCount];
ntd = (ntd + 50.0f) / 100.0f;
}
numToDrop = ntd;
if (playerData->level < 27) {
s32 spawnMode;
s32 i;
if (dropper->flags & ACTOR_FLAG_UPSIDE_DOWN) {
spawnMode = ITEM_SPAWN_MODE_TOSS_FADE3;
} else {
spawnMode = ITEM_SPAWN_MODE_TOSS_FADE1;
}
for (i = 0; i < numToDrop; i++) {
make_item_entity_delayed(ITEM_STAR_POINT,
dropper->currentPos.x, dropper->currentPos.y, dropper->currentPos.z, spawnMode, i, 0);
}
battleStatus->incrementStarPointDelay = 40;
battleStatus->pendingStarPoints += numToDrop;
}
gBattleStatus.flags1 |= BS_FLAGS1_STAR_POINTS_DROPPED;
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel is_debug_print
/* 1174 80025D74 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 1178 80025D78 AFB30024 */ sw $s3, 0x24($sp)
/* 117C 80025D7C 00A0982D */ daddu $s3, $a1, $zero
/* 1180 80025D80 AFB40028 */ sw $s4, 0x28($sp)
/* 1184 80025D84 00C0A02D */ daddu $s4, $a2, $zero
/* 1188 80025D88 3C05B3FF */ lui $a1, (0xB3FF0000 >> 16)
/* 118C 80025D8C AFB1001C */ sw $s1, 0x1C($sp)
/* 1190 80025D90 3C11800A */ lui $s1, %hi(nuPiCartHandle)
/* 1194 80025D94 2631A638 */ addiu $s1, $s1, %lo(nuPiCartHandle)
/* 1198 80025D98 AFB00018 */ sw $s0, 0x18($sp)
/* 119C 80025D9C 27B00010 */ addiu $s0, $sp, 0x10
/* 11A0 80025DA0 AFBF003C */ sw $ra, 0x3C($sp)
/* 11A4 80025DA4 AFBE0038 */ sw $fp, 0x38($sp)
/* 11A8 80025DA8 AFB70034 */ sw $s7, 0x34($sp)
/* 11AC 80025DAC AFB60030 */ sw $s6, 0x30($sp)
/* 11B0 80025DB0 AFB5002C */ sw $s5, 0x2C($sp)
/* 11B4 80025DB4 AFB20020 */ sw $s2, 0x20($sp)
/* 11B8 80025DB8 8E240000 */ lw $a0, 0x0($s1)
/* 11BC 80025DBC 0C018370 */ jal osEPiReadIo
/* 11C0 80025DC0 0200302D */ daddu $a2, $s0, $zero
/* 11C4 80025DC4 3C034953 */ lui $v1, (0x49533634 >> 16)
/* 11C8 80025DC8 8FA20010 */ lw $v0, 0x10($sp)
/* 11CC 80025DCC 34633634 */ ori $v1, $v1, (0x49533634 & 0xFFFF)
/* 11D0 80025DD0 14430050 */ bne $v0, $v1, .L80025F14
/* 11D4 80025DD4 24020001 */ addiu $v0, $zero, 0x1
/* 11D8 80025DD8 3C05B3FF */ lui $a1, (0xB3FF0004 >> 16)
/* 11DC 80025DDC 34A50004 */ ori $a1, $a1, (0xB3FF0004 & 0xFFFF)
/* 11E0 80025DE0 8E240000 */ lw $a0, 0x0($s1)
/* 11E4 80025DE4 0C018370 */ jal osEPiReadIo
/* 11E8 80025DE8 0200302D */ daddu $a2, $s0, $zero
/* 11EC 80025DEC 3C05B3FF */ lui $a1, (0xB3FF0014 >> 16)
/* 11F0 80025DF0 0200302D */ daddu $a2, $s0, $zero
/* 11F4 80025DF4 8E240000 */ lw $a0, 0x0($s1)
/* 11F8 80025DF8 8FB00010 */ lw $s0, 0x10($sp)
/* 11FC 80025DFC 0C018370 */ jal osEPiReadIo
/* 1200 80025E00 34A50014 */ ori $a1, $a1, (0xB3FF0014 & 0xFFFF)
/* 1204 80025E04 8FB20010 */ lw $s2, 0x10($sp)
/* 1208 80025E08 3402FFDF */ ori $v0, $zero, 0xFFDF
/* 120C 80025E0C 02541821 */ addu $v1, $s2, $s4
/* 1210 80025E10 0043102A */ slt $v0, $v0, $v1
/* 1214 80025E14 1040000B */ beqz $v0, .L80025E44
/* 1218 80025E18 3C02FFFF */ lui $v0, (0xFFFF0020 >> 16)
/* 121C 80025E1C 34420020 */ ori $v0, $v0, (0xFFFF0020 & 0xFFFF)
/* 1220 80025E20 00621821 */ addu $v1, $v1, $v0
/* 1224 80025E24 0203102A */ slt $v0, $s0, $v1
/* 1228 80025E28 1440003A */ bnez $v0, .L80025F14
/* 122C 80025E2C 24020001 */ addiu $v0, $zero, 0x1
/* 1230 80025E30 0250102A */ slt $v0, $s2, $s0
/* 1234 80025E34 10400008 */ beqz $v0, .L80025E58
/* 1238 80025E38 24020001 */ addiu $v0, $zero, 0x1
/* 123C 80025E3C 080097C5 */ j .L80025F14
/* 1240 80025E40 00000000 */ nop
.L80025E44:
/* 1244 80025E44 0250102A */ slt $v0, $s2, $s0
/* 1248 80025E48 10400003 */ beqz $v0, .L80025E58
/* 124C 80025E4C 0203102A */ slt $v0, $s0, $v1
/* 1250 80025E50 14400030 */ bnez $v0, .L80025F14
/* 1254 80025E54 24020001 */ addiu $v0, $zero, 0x1
.L80025E58:
/* 1258 80025E58 12800027 */ beqz $s4, .L80025EF8
/* 125C 80025E5C 3C1E0FFF */ lui $fp, (0xFFFFFFC >> 16)
/* 1260 80025E60 37DEFFFC */ ori $fp, $fp, (0xFFFFFFC & 0xFFFF)
/* 1264 80025E64 3C17B3FF */ lui $s7, (0xB3FF0020 >> 16)
/* 1268 80025E68 36F70020 */ ori $s7, $s7, (0xB3FF0020 & 0xFFFF)
/* 126C 80025E6C 3C15800A */ lui $s5, %hi(nuPiCartHandle)
/* 1270 80025E70 26B5A638 */ addiu $s5, $s5, %lo(nuPiCartHandle)
/* 1274 80025E74 3C16FFFF */ lui $s6, (0xFFFF0020 >> 16)
/* 1278 80025E78 36D60020 */ ori $s6, $s6, (0xFFFF0020 & 0xFFFF)
.L80025E7C:
/* 127C 80025E7C 92620000 */ lbu $v0, 0x0($s3)
/* 1280 80025E80 1040001A */ beqz $v0, .L80025EEC
/* 1284 80025E84 025E8824 */ and $s1, $s2, $fp
/* 1288 80025E88 02378821 */ addu $s1, $s1, $s7
/* 128C 80025E8C 0220282D */ daddu $a1, $s1, $zero
/* 1290 80025E90 27A60010 */ addiu $a2, $sp, 0x10
/* 1294 80025E94 32500003 */ andi $s0, $s2, 0x3
/* 1298 80025E98 26520001 */ addiu $s2, $s2, 0x1
/* 129C 80025E9C 24070003 */ addiu $a3, $zero, 0x3
/* 12A0 80025EA0 00F08023 */ subu $s0, $a3, $s0
/* 12A4 80025EA4 8EA40000 */ lw $a0, 0x0($s5)
/* 12A8 80025EA8 0C018370 */ jal osEPiReadIo
/* 12AC 80025EAC 00F08004 */ sllv $s0, $s0, $a3
/* 12B0 80025EB0 0220282D */ daddu $a1, $s1, $zero
/* 12B4 80025EB4 240700FF */ addiu $a3, $zero, 0xFF
/* 12B8 80025EB8 02071004 */ sllv $v0, $a3, $s0
/* 12BC 80025EBC 00021027 */ nor $v0, $zero, $v0
/* 12C0 80025EC0 8EA40000 */ lw $a0, 0x0($s5)
/* 12C4 80025EC4 8FA30010 */ lw $v1, 0x10($sp)
/* 12C8 80025EC8 92660000 */ lbu $a2, 0x0($s3)
/* 12CC 80025ECC 00621824 */ and $v1, $v1, $v0
/* 12D0 80025ED0 02063004 */ sllv $a2, $a2, $s0
/* 12D4 80025ED4 0C018358 */ jal osEPiWriteIo
/* 12D8 80025ED8 00663025 */ or $a2, $v1, $a2
/* 12DC 80025EDC 3407FFDF */ ori $a3, $zero, 0xFFDF
/* 12E0 80025EE0 00F2102A */ slt $v0, $a3, $s2
/* 12E4 80025EE4 54400001 */ bnel $v0, $zero, .L80025EEC
/* 12E8 80025EE8 02569021 */ addu $s2, $s2, $s6
.L80025EEC:
/* 12EC 80025EEC 2694FFFF */ addiu $s4, $s4, -0x1
/* 12F0 80025EF0 1680FFE2 */ bnez $s4, .L80025E7C
/* 12F4 80025EF4 26730001 */ addiu $s3, $s3, 0x1
.L80025EF8:
/* 12F8 80025EF8 3C04800A */ lui $a0, %hi(nuPiCartHandle)
/* 12FC 80025EFC 8C84A638 */ lw $a0, %lo(nuPiCartHandle)($a0)
/* 1300 80025F00 3C05B3FF */ lui $a1, (0xB3FF0014 >> 16)
/* 1304 80025F04 34A50014 */ ori $a1, $a1, (0xB3FF0014 & 0xFFFF)
/* 1308 80025F08 0C018358 */ jal osEPiWriteIo
/* 130C 80025F0C 0240302D */ daddu $a2, $s2, $zero
/* 1310 80025F10 24020001 */ addiu $v0, $zero, 0x1
.L80025F14:
/* 1314 80025F14 8FBF003C */ lw $ra, 0x3C($sp)
/* 1318 80025F18 8FBE0038 */ lw $fp, 0x38($sp)
/* 131C 80025F1C 8FB70034 */ lw $s7, 0x34($sp)
/* 1320 80025F20 8FB60030 */ lw $s6, 0x30($sp)
/* 1324 80025F24 8FB5002C */ lw $s5, 0x2C($sp)
/* 1328 80025F28 8FB40028 */ lw $s4, 0x28($sp)
/* 132C 80025F2C 8FB30024 */ lw $s3, 0x24($sp)
/* 1330 80025F30 8FB20020 */ lw $s2, 0x20($sp)
/* 1334 80025F34 8FB1001C */ lw $s1, 0x1C($sp)
/* 1338 80025F38 8FB00018 */ lw $s0, 0x18($sp)
/* 133C 80025F3C 03E00008 */ jr $ra
/* 1340 80025F40 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
char* is_debug_print(char* arg0, const char* str, size_t count) {
u32 data;
s32 pos;
s32 start;
s32 end;
osEPiReadIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->magic, &data);
if (data != ASCII_TO_U32('I', 'S', '6', '4')) {
return (char*) 1;
}
osEPiReadIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->get, &data);
pos = data;
osEPiReadIo(nuPiCartHandle, (u32) &gISVDbgPrnAdrs->put, &data);
start = data;
end = start + count;
if (end >= 0xffe0) {
end -= 0xffe0;
if (pos < end || start < pos) {
return (char*) 1;
}
} else {
if (start < pos && pos < end) {
return (char*) 1;
}
}
while (count) {
u8 c = *str;
if (c != 0) {
u32 addr = (u32) &gISVDbgPrnAdrs->data + (start & 0xffffffc);
s32 shift = ((3 - (start & 3)) * 8);
osEPiReadIo(nuPiCartHandle, addr, &data);
osEPiWriteIo(nuPiCartHandle, addr, (data & ~(0xff << shift)) | ((u8)*str << shift));
start++;
if (start >= 0xffe0) {
start -= 0xffe0;
}
}
count--;
str++;
}
osEPiWriteIo(nuPiCartHandle, (u32)&gISVDbgPrnAdrs->put, start);
return (char*) 1;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel initialize_next_camera
/* 956C 8002E16C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 9570 8002E170 0080382D */ daddu $a3, $a0, $zero
/* 9574 8002E174 0000202D */ daddu $a0, $zero, $zero
/* 9578 8002E178 3C03800B */ lui $v1, %hi(gCameras)
/* 957C 8002E17C 24631D80 */ addiu $v1, $v1, %lo(gCameras)
/* 9580 8002E180 AFBF001C */ sw $ra, 0x1C($sp)
/* 9584 8002E184 AFB00018 */ sw $s0, 0x18($sp)
.L8002E188:
/* 9588 8002E188 0060802D */ daddu $s0, $v1, $zero
/* 958C 8002E18C 96020000 */ lhu $v0, 0x0($s0)
/* 9590 8002E190 10400006 */ beqz $v0, .L8002E1AC
/* 9594 8002E194 28820004 */ slti $v0, $a0, 0x4
/* 9598 8002E198 24840001 */ addiu $a0, $a0, 0x1
/* 959C 8002E19C 28820004 */ slti $v0, $a0, 0x4
/* 95A0 8002E1A0 1440FFF9 */ bnez $v0, .L8002E188
/* 95A4 8002E1A4 26030558 */ addiu $v1, $s0, 0x558
/* 95A8 8002E1A8 28820004 */ slti $v0, $a0, 0x4
.L8002E1AC:
/* 95AC 8002E1AC 54400003 */ bnel $v0, $zero, .L8002E1BC
/* 95B0 8002E1B0 24030001 */ addiu $v1, $zero, 0x1
.L8002E1B4:
/* 95B4 8002E1B4 0800B86D */ j .L8002E1B4
/* 95B8 8002E1B8 00000000 */ nop
.L8002E1BC:
/* 95BC 8002E1BC 94E20000 */ lhu $v0, 0x0($a3)
/* 95C0 8002E1C0 3C01C2C8 */ lui $at, (0xC2C80000 >> 16)
/* 95C4 8002E1C4 44810000 */ mtc1 $at, $f0
/* 95C8 8002E1C8 A6000002 */ sh $zero, 0x2($s0)
/* 95CC 8002E1CC AE00003C */ sw $zero, 0x3C($s0)
/* 95D0 8002E1D0 AE000040 */ sw $zero, 0x40($s0)
/* 95D4 8002E1D4 AE000044 */ sw $zero, 0x44($s0)
/* 95D8 8002E1D8 AE000048 */ sw $zero, 0x48($s0)
/* 95DC 8002E1DC AE00004C */ sw $zero, 0x4C($s0)
/* 95E0 8002E1E0 AE00006C */ sw $zero, 0x6C($s0)
/* 95E4 8002E1E4 AE000078 */ sw $zero, 0x78($s0)
/* 95E8 8002E1E8 AE00007C */ sw $zero, 0x7C($s0)
/* 95EC 8002E1EC AE000084 */ sw $zero, 0x84($s0)
/* 95F0 8002E1F0 AE000088 */ sw $zero, 0x88($s0)
/* 95F4 8002E1F4 AE00008C */ sw $zero, 0x8C($s0)
/* 95F8 8002E1F8 34420005 */ ori $v0, $v0, 0x5
/* 95FC 8002E1FC A6020000 */ sh $v0, 0x0($s0)
/* 9600 8002E200 E6000050 */ swc1 $f0, 0x50($s0)
/* 9604 8002E204 90E20002 */ lbu $v0, 0x2($a3)
/* 9608 8002E208 A6030006 */ sh $v1, 0x6($s0)
/* 960C 8002E20C 00021600 */ sll $v0, $v0, 24
/* 9610 8002E210 00021603 */ sra $v0, $v0, 24
/* 9614 8002E214 A6020004 */ sh $v0, 0x4($s0)
/* 9618 8002E218 94E2000C */ lhu $v0, 0xC($a3)
/* 961C 8002E21C A6020012 */ sh $v0, 0x12($s0)
/* 9620 8002E220 94E2000E */ lhu $v0, 0xE($a3)
/* 9624 8002E224 00042400 */ sll $a0, $a0, 16
/* 9628 8002E228 A6020014 */ sh $v0, 0x14($s0)
/* 962C 8002E22C 84E30010 */ lh $v1, 0x10($a3)
/* 9630 8002E230 24020064 */ addiu $v0, $zero, 0x64
/* 9634 8002E234 A602002A */ sh $v0, 0x2A($s0)
/* 9638 8002E238 44830000 */ mtc1 $v1, $f0
/* 963C 8002E23C 00000000 */ nop
/* 9640 8002E240 46800020 */ cvt.s.w $f0, $f0
/* 9644 8002E244 E6000018 */ swc1 $f0, 0x18($s0)
/* 9648 8002E248 84E20006 */ lh $v0, 0x6($a3)
/* 964C 8002E24C 84E50008 */ lh $a1, 0x8($a3)
/* 9650 8002E250 84E6000A */ lh $a2, 0xA($a3)
/* 9654 8002E254 84E70004 */ lh $a3, 0x4($a3)
/* 9658 8002E258 00042403 */ sra $a0, $a0, 16
/* 965C 8002E25C 0C00B8C5 */ jal set_cam_viewport
/* 9660 8002E260 AFA20010 */ sw $v0, 0x10($sp)
/* 9664 8002E264 3C01447A */ lui $at, (0x447A0000 >> 16)
/* 9668 8002E268 44810000 */ mtc1 $at, $f0
/* 966C 8002E26C 3C013E4C */ lui $at, (0x3E4CCCCD >> 16)
/* 9670 8002E270 3421CCCD */ ori $at, $at, (0x3E4CCCCD & 0xFFFF)
/* 9674 8002E274 44811000 */ mtc1 $at, $f2
/* 9678 8002E278 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 967C 8002E27C 44812000 */ mtc1 $at, $f4
/* 9680 8002E280 2402FFFF */ addiu $v0, $zero, -0x1
/* 9684 8002E284 A6020212 */ sh $v0, 0x212($s0)
/* 9688 8002E288 24020001 */ addiu $v0, $zero, 0x1
/* 968C 8002E28C AE020530 */ sw $v0, 0x530($s0)
/* 9690 8002E290 0200102D */ daddu $v0, $s0, $zero
/* 9694 8002E294 A600002C */ sh $zero, 0x2C($s0)
/* 9698 8002E298 A600002E */ sh $zero, 0x2E($s0)
/* 969C 8002E29C A6000030 */ sh $zero, 0x30($s0)
/* 96A0 8002E2A0 AE0000C0 */ sw $zero, 0xC0($s0)
/* 96A4 8002E2A4 AE000054 */ sw $zero, 0x54($s0)
/* 96A8 8002E2A8 AE000058 */ sw $zero, 0x58($s0)
/* 96AC 8002E2AC AE00005C */ sw $zero, 0x5C($s0)
/* 96B0 8002E2B0 AE000060 */ sw $zero, 0x60($s0)
/* 96B4 8002E2B4 AE000064 */ sw $zero, 0x64($s0)
/* 96B8 8002E2B8 AE000068 */ sw $zero, 0x68($s0)
/* 96BC 8002E2BC AE000098 */ sw $zero, 0x98($s0)
/* 96C0 8002E2C0 AE00009C */ sw $zero, 0x9C($s0)
/* 96C4 8002E2C4 AE0001FC */ sw $zero, 0x1FC($s0)
/* 96C8 8002E2C8 AE000200 */ sw $zero, 0x200($s0)
/* 96CC 8002E2CC AE00050C */ sw $zero, 0x50C($s0)
/* 96D0 8002E2D0 AE000510 */ sw $zero, 0x510($s0)
/* 96D4 8002E2D4 AE000514 */ sw $zero, 0x514($s0)
/* 96D8 8002E2D8 AE000518 */ sw $zero, 0x518($s0)
/* 96DC 8002E2DC AE00051C */ sw $zero, 0x51C($s0)
/* 96E0 8002E2E0 AE000524 */ sw $zero, 0x524($s0)
/* 96E4 8002E2E4 AE000528 */ sw $zero, 0x528($s0)
/* 96E8 8002E2E8 AE00052C */ sw $zero, 0x52C($s0)
/* 96EC 8002E2EC AE000534 */ sw $zero, 0x534($s0)
/* 96F0 8002E2F0 A6000506 */ sh $zero, 0x506($s0)
/* 96F4 8002E2F4 A6000504 */ sh $zero, 0x504($s0)
/* 96F8 8002E2F8 E60000C4 */ swc1 $f0, 0xC4($s0)
/* 96FC 8002E2FC E6020520 */ swc1 $f2, 0x520($s0)
/* 9700 8002E300 E6040490 */ swc1 $f4, 0x490($s0)
/* 9704 8002E304 8FBF001C */ lw $ra, 0x1C($sp)
/* 9708 8002E308 8FB00018 */ lw $s0, 0x18($sp)
/* 970C 8002E30C 03E00008 */ jr $ra
/* 9710 8002E310 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
Camera* initialize_next_camera(CameraInitData* initData) {
Camera* camera;
s32 camID;
for (camID = 0; camID < ARRAY_COUNT(gCameras); camID++) {
camera = &gCameras[camID];
if (camera->flags == 0) {
break;
}
}
ASSERT(camID < ARRAY_COUNT(gCameras));
camera->flags = initData->flags | (CAMERA_FLAG_1 | CAMERA_FLAG_LEAD_PLAYER);
camera->moveFlags = 0;
camera->lookAt_eye.x = 0;
camera->lookAt_eye.y = 0;
camera->lookAt_eye.z = 0;
camera->lookAt_obj.x = 0;
camera->lookAt_obj.y = 0;
camera->lookAt_obj.z = -100.0f;
camera->currentYaw = 0;
camera->currentBoomLength = 0;
camera->currentYOffset = 0;
camera->trueRotation.x = 0.0f;
camera->trueRotation.y = 0.0f;
camera->trueRotation.z = 0.0f;
camera->updateMode = initData->updateMode;
camera->needsInit = TRUE;
camera->nearClip = initData->nearClip;
camera->farClip = initData->farClip;
camera->vfov = initData->vfov;
camera->zoomPercent = 100;
set_cam_viewport(camID, initData->viewStartX, initData->viewStartY, initData->viewWidth, initData->viewHeight);
camera->unk_212 = -1;
camera->unk_530 = 1;
camera->bgColor[0] = 0;
camera->bgColor[1] = 0;
camera->bgColor[2] = 0;
camera->unk_C0 = 0;
camera->lookAt_obj_target.x = 0;
camera->lookAt_obj_target.y = 0;
camera->lookAt_obj_target.z = 0;
camera->targetPos.x = 0;
camera->targetPos.y = 0;
camera->targetPos.z = 0;
camera->unk_98 = 0;
camera->unk_9C = 0;
camera->fpDoPreRender = NULL;
camera->fpDoPostRender = NULL;
camera->leadAmount = 0;
camera->unk_510 = 0.0f;
camera->unk_514 = 0.0f;
camera->unk_518 = 0.0f;
camera->unk_51C = 0;
camera->unk_524 = 0.0f;
camera->unk_528 = 0.0f;
camera->unk_52C = 0;
camera->aabbForZoneBelow = 0;
camera->panActive = FALSE;
camera->followPlayer = 0;
camera->unk_C4 = 1000.0f;
camera->unk_520 = 0.2f;
camera->moveSpeed = 1.0f;
return camera;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel big_snowflakes_main
/* 363160 E0060000 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 363164 E0060004 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 363168 E0060008 4485A000 */ mtc1 $a1, $f20
/* 36316C E006000C AFB20030 */ sw $s2, 0x30($sp)
/* 363170 E0060010 0080902D */ daddu $s2, $a0, $zero
/* 363174 E0060014 F7B60048 */ sdc1 $f22, 0x48($sp)
/* 363178 E0060018 4486B000 */ mtc1 $a2, $f22
/* 36317C E006001C 27A40010 */ addiu $a0, $sp, 0x10
/* 363180 E0060020 F7B80050 */ sdc1 $f24, 0x50($sp)
/* 363184 E0060024 4487C000 */ mtc1 $a3, $f24
/* 363188 E0060028 3C02E006 */ lui $v0, %hi(big_snowflakes_init)
/* 36318C E006002C 244201D8 */ addiu $v0, $v0, %lo(big_snowflakes_init)
/* 363190 E0060030 AFA20018 */ sw $v0, 0x18($sp)
/* 363194 E0060034 3C02E006 */ lui $v0, %hi(big_snowflakes_update)
/* 363198 E0060038 244201E0 */ addiu $v0, $v0, %lo(big_snowflakes_update)
/* 36319C E006003C AFA2001C */ sw $v0, 0x1C($sp)
/* 3631A0 E0060040 3C02E006 */ lui $v0, %hi(big_snowflakes_render)
/* 3631A4 E0060044 2442040C */ addiu $v0, $v0, %lo(big_snowflakes_render)
/* 3631A8 E0060048 AFA20020 */ sw $v0, 0x20($sp)
/* 3631AC E006004C 24020030 */ addiu $v0, $zero, 0x30
/* 3631B0 E0060050 AFBF003C */ sw $ra, 0x3C($sp)
/* 3631B4 E0060054 AFB40038 */ sw $s4, 0x38($sp)
/* 3631B8 E0060058 AFB30034 */ sw $s3, 0x34($sp)
/* 3631BC E006005C AFB1002C */ sw $s1, 0x2C($sp)
/* 3631C0 E0060060 AFB00028 */ sw $s0, 0x28($sp)
/* 3631C4 E0060064 AFA00010 */ sw $zero, 0x10($sp)
/* 3631C8 E0060068 AFA00024 */ sw $zero, 0x24($sp)
/* 3631CC E006006C 0C080124 */ jal shim_create_effect_instance
/* 3631D0 E0060070 AFA20014 */ sw $v0, 0x14($sp)
/* 3631D4 E0060074 240401B0 */ addiu $a0, $zero, 0x1B0
/* 3631D8 E0060078 24130009 */ addiu $s3, $zero, 0x9
/* 3631DC E006007C 0040802D */ daddu $s0, $v0, $zero
/* 3631E0 E0060080 0C08012C */ jal shim_general_heap_malloc
/* 3631E4 E0060084 AE130008 */ sw $s3, 0x8($s0)
/* 3631E8 E0060088 0040882D */ daddu $s1, $v0, $zero
/* 3631EC E006008C 16200003 */ bnez $s1, .LE006009C
/* 3631F0 E0060090 AE11000C */ sw $s1, 0xC($s0)
.LE0060094:
/* 3631F4 E0060094 08018025 */ j .LE0060094
/* 3631F8 E0060098 00000000 */ nop
.LE006009C:
/* 3631FC E006009C 0220202D */ daddu $a0, $s1, $zero
/* 363200 E00600A0 00132840 */ sll $a1, $s3, 1
/* 363204 E00600A4 00B32821 */ addu $a1, $a1, $s3
/* 363208 E00600A8 0C080130 */ jal shim_mem_clear
/* 36320C E00600AC 00052900 */ sll $a1, $a1, 4
/* 363210 E00600B0 2402001E */ addiu $v0, $zero, 0x1E
/* 363214 E00600B4 AE320000 */ sw $s2, 0x0($s1)
/* 363218 E00600B8 E6340004 */ swc1 $f20, 0x4($s1)
/* 36321C E00600BC E6360008 */ swc1 $f22, 0x8($s1)
/* 363220 E00600C0 E638000C */ swc1 $f24, 0xC($s1)
/* 363224 E00600C4 AE220028 */ sw $v0, 0x28($s1)
/* 363228 E00600C8 AE20002C */ sw $zero, 0x2C($s1)
/* 36322C E00600CC AE200024 */ sw $zero, 0x24($s1)
/* 363230 E00600D0 24120001 */ addiu $s2, $zero, 0x1
/* 363234 E00600D4 0253102A */ slt $v0, $s2, $s3
/* 363238 E00600D8 10400034 */ beqz $v0, .LE00601AC
/* 36323C E00600DC 26310030 */ addiu $s1, $s1, 0x30
/* 363240 E00600E0 3C146666 */ lui $s4, (0x66666667 >> 16)
/* 363244 E00600E4 36946667 */ ori $s4, $s4, (0x66666667 & 0xFFFF)
/* 363248 E00600E8 26300014 */ addiu $s0, $s1, 0x14
/* 36324C E00600EC 3C014120 */ lui $at, (0x41200000 >> 16)
/* 363250 E00600F0 4481B000 */ mtc1 $at, $f22
/* 363254 E00600F4 3C014000 */ lui $at, (0x40000000 >> 16)
/* 363258 E00600F8 4481A000 */ mtc1 $at, $f20
.LE00600FC:
/* 36325C E00600FC 0C080000 */ jal effect_rand_int
/* 363260 E0060100 2404000A */ addiu $a0, $zero, 0xA
/* 363264 E0060104 2404000A */ addiu $a0, $zero, 0xA
/* 363268 E0060108 2442FFFB */ addiu $v0, $v0, -0x5
/* 36326C E006010C 44820000 */ mtc1 $v0, $f0
/* 363270 E0060110 00000000 */ nop
/* 363274 E0060114 46800020 */ cvt.s.w $f0, $f0
/* 363278 E0060118 0C080000 */ jal effect_rand_int
/* 36327C E006011C E600FFF0 */ swc1 $f0, -0x10($s0)
/* 363280 E0060120 24040168 */ addiu $a0, $zero, 0x168
/* 363284 E0060124 24420005 */ addiu $v0, $v0, 0x5
/* 363288 E0060128 44820000 */ mtc1 $v0, $f0
/* 36328C E006012C 00000000 */ nop
/* 363290 E0060130 46800020 */ cvt.s.w $f0, $f0
/* 363294 E0060134 E600FFF4 */ swc1 $f0, -0xC($s0)
/* 363298 E0060138 0C080000 */ jal effect_rand_int
/* 36329C E006013C E616FFF8 */ swc1 $f22, -0x8($s0)
/* 3632A0 E0060140 24040168 */ addiu $a0, $zero, 0x168
/* 3632A4 E0060144 44820000 */ mtc1 $v0, $f0
/* 3632A8 E0060148 00000000 */ nop
/* 3632AC E006014C 46800020 */ cvt.s.w $f0, $f0
/* 3632B0 E0060150 0C080000 */ jal effect_rand_int
/* 3632B4 E0060154 E6000004 */ swc1 $f0, 0x4($s0)
/* 3632B8 E0060158 24040064 */ addiu $a0, $zero, 0x64
/* 3632BC E006015C 44820000 */ mtc1 $v0, $f0
/* 3632C0 E0060160 00000000 */ nop
/* 3632C4 E0060164 46800020 */ cvt.s.w $f0, $f0
/* 3632C8 E0060168 0C080000 */ jal effect_rand_int
/* 3632CC E006016C E600000C */ swc1 $f0, 0xC($s0)
/* 3632D0 E0060170 00540018 */ mult $v0, $s4
/* 3632D4 E0060174 26520001 */ addiu $s2, $s2, 0x1
/* 3632D8 E0060178 000217C3 */ sra $v0, $v0, 31
/* 3632DC E006017C AE00FFFC */ sw $zero, -0x4($s0)
/* 3632E0 E0060180 E6140000 */ swc1 $f20, 0x0($s0)
/* 3632E4 E0060184 00004010 */ mfhi $t0
/* 3632E8 E0060188 00081883 */ sra $v1, $t0, 2
/* 3632EC E006018C 00621823 */ subu $v1, $v1, $v0
/* 3632F0 E0060190 44830000 */ mtc1 $v1, $f0
/* 3632F4 E0060194 00000000 */ nop
/* 3632F8 E0060198 46800020 */ cvt.s.w $f0, $f0
/* 3632FC E006019C E6000008 */ swc1 $f0, 0x8($s0)
/* 363300 E00601A0 0253102A */ slt $v0, $s2, $s3
/* 363304 E00601A4 1440FFD5 */ bnez $v0, .LE00600FC
/* 363308 E00601A8 26100030 */ addiu $s0, $s0, 0x30
.LE00601AC:
/* 36330C E00601AC 8FBF003C */ lw $ra, 0x3C($sp)
/* 363310 E00601B0 8FB40038 */ lw $s4, 0x38($sp)
/* 363314 E00601B4 8FB30034 */ lw $s3, 0x34($sp)
/* 363318 E00601B8 8FB20030 */ lw $s2, 0x30($sp)
/* 36331C E00601BC 8FB1002C */ lw $s1, 0x2C($sp)
/* 363320 E00601C0 8FB00028 */ lw $s0, 0x28($sp)
/* 363324 E00601C4 D7B80050 */ ldc1 $f24, 0x50($sp)
/* 363328 E00601C8 D7B60048 */ ldc1 $f22, 0x48($sp)
/* 36332C E00601CC D7B40040 */ ldc1 $f20, 0x40($sp)
/* 363330 E00601D0 03E00008 */ jr $ra
/* 363334 E00601D4 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
void big_snowflakes_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
EffectInstance* effect;
BigSnowflakesFXData* data;
s32 numParts = 9;
s32 i;
bp.unk_00 = 0;
bp.init = big_snowflakes_init;
bp.update = big_snowflakes_update;
bp.renderWorld = big_snowflakes_render;
bp.renderUI = NULL;
bp.effectID = EFFECT_BIG_SNOWFLAKES;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = shim_general_heap_malloc(effect->numParts * sizeof(*data));
effect->data.bigSnowflakes = data;
ASSERT(data != NULL);
shim_mem_clear(data, numParts * sizeof(*data));
data->unk_00 = arg0;
data->unk_04 = arg1;
data->unk_08 = arg2;
data->unk_0C = arg3;
data->unk_28 = 30;
data->unk_2C = 0;
data->unk_24 = 0;
data++;
for (i = 1; i < numParts; i++, data++) {
data->unk_04 = effect_rand_int(10) - 5;
data->unk_08 = effect_rand_int(10) + 5;
data->unk_0C = 10.0f;
data->unk_18 = effect_rand_int(360);
data->unk_20 = effect_rand_int(360);
data->unk_1C = effect_rand_int(100) / 10;
data->unk_10 = 0;
data->unk_14 = 2.0f;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8024F5AC
/* 17DE8C 8024F5AC 27BDFD60 */ addiu $sp, $sp, -0x2A0
/* 17DE90 8024F5B0 AFB40278 */ sw $s4, 0x278($sp)
/* 17DE94 8024F5B4 AFBF028C */ sw $ra, 0x28C($sp)
D_8024F5B8_C0CE38:
/* 17DE98 8024F5B8 AFBE0288 */ sw $fp, 0x288($sp)
/* 17DE9C 8024F5BC AFB70284 */ sw $s7, 0x284($sp)
mac_04_Quizmo_StageEffect:
/* 17DEA0 8024F5C0 AFB60280 */ sw $s6, 0x280($sp)
mac_04_Quizmo_AudienceEffect:
/* 17DEA4 8024F5C4 AFB5027C */ sw $s5, 0x27C($sp)
mac_04_Quizmo_VannaTEffect:
/* 17DEA8 8024F5C8 AFB30274 */ sw $s3, 0x274($sp)
/* 17DEAC 8024F5CC AFB20270 */ sw $s2, 0x270($sp)
mac_04_D_8024F5D0:
/* 17DEB0 8024F5D0 AFB1026C */ sw $s1, 0x26C($sp)
/* 17DEB4 8024F5D4 AFB00268 */ sw $s0, 0x268($sp)
/* 17DEB8 8024F5D8 F7B60298 */ sdc1 $f22, 0x298($sp)
/* 17DEBC 8024F5DC F7B40290 */ sdc1 $f20, 0x290($sp)
/* 17DEC0 8024F5E0 AFA40258 */ sw $a0, 0x258($sp)
D_8024F5E4:
/* 17DEC4 8024F5E4 84820012 */ lh $v0, 0x12($a0)
/* 17DEC8 8024F5E8 8C930018 */ lw $s3, 0x18($a0)
/* 17DECC 8024F5EC 18400050 */ blez $v0, .L8024F730
D_8024F5F0_C0CE70:
/* 17DED0 8024F5F0 0000A02D */ daddu $s4, $zero, $zero
/* 17DED4 8024F5F4 27A30058 */ addiu $v1, $sp, 0x58
/* 17DED8 8024F5F8 AFA3025C */ sw $v1, 0x25C($sp)
/* 17DEDC 8024F5FC 27A30098 */ addiu $v1, $sp, 0x98
D_8024F600:
/* 17DEE0 8024F600 AFA30260 */ sw $v1, 0x260($sp)
/* 17DEE4 8024F604 27A300D8 */ addiu $v1, $sp, 0xD8
/* 17DEE8 8024F608 27BE01D8 */ addiu $fp, $sp, 0x1D8
/* 17DEEC 8024F60C 27B20158 */ addiu $s2, $sp, 0x158
/* 17DEF0 8024F610 27B70118 */ addiu $s7, $sp, 0x118
/* 17DEF4 8024F614 27B60198 */ addiu $s6, $sp, 0x198
D_8024F618:
/* 17DEF8 8024F618 27B50218 */ addiu $s5, $sp, 0x218
/* 17DEFC 8024F61C 4480A000 */ mtc1 $zero, $f20
D_8024F620:
/* 17DF00 8024F620 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 17DF04 8024F624 4481B000 */ mtc1 $at, $f22
/* 17DF08 8024F628 26710034 */ addiu $s1, $s3, 0x34
/* 17DF0C 8024F62C AFA30264 */ sw $v1, 0x264($sp)
D_8024F630:
/* 17DF10 8024F630 8E620000 */ lw $v0, 0x0($s3)
D_8024F634:
/* 17DF14 8024F634 50400038 */ beql $v0, $zero, D_8024F718
/* 17DF18 8024F638 26940001 */ addiu $s4, $s4, 0x1
/* 17DF1C 8024F63C 8E22FFF0 */ lw $v0, -0x10($s1)
/* 17DF20 8024F640 1440003B */ bnez $v0, .L8024F730
/* 17DF24 8024F644 00000000 */ nop
/* 17DF28 8024F648 8E250004 */ lw $a1, 0x4($s1)
/* 17DF2C 8024F64C 8E260008 */ lw $a2, 0x8($s1)
D_8024F650_C0CED0:
/* 17DF30 8024F650 8E27000C */ lw $a3, 0xC($s1)
/* 17DF34 8024F654 8E30FFD0 */ lw $s0, -0x30($s1)
/* 17DF38 8024F658 0C019E40 */ jal guTranslateF
/* 17DF3C 8024F65C 27A40018 */ addiu $a0, $sp, 0x18
/* 17DF40 8024F660 4405A000 */ mfc1 $a1, $f20
/* 17DF44 8024F664 4406B000 */ mfc1 $a2, $f22
/* 17DF48 8024F668 4407A000 */ mfc1 $a3, $f20
/* 17DF4C 8024F66C 8FA4025C */ lw $a0, 0x25C($sp)
/* 17DF50 8024F670 0C019EC8 */ jal guRotateF
/* 17DF54 8024F674 E7B40010 */ swc1 $f20, 0x10($sp)
/* 17DF58 8024F678 E7B40010 */ swc1 $f20, 0x10($sp)
/* 17DF5C 8024F67C 8E25FFFC */ lw $a1, -0x4($s1)
/* 17DF60 8024F680 4406A000 */ mfc1 $a2, $f20
/* 17DF64 8024F684 4407B000 */ mfc1 $a3, $f22
D_8024F688_C0CF08:
/* 17DF68 8024F688 8FA40260 */ lw $a0, 0x260($sp)
/* 17DF6C 8024F68C 0C019EC8 */ jal guRotateF
/* 17DF70 8024F690 26940001 */ addiu $s4, $s4, 0x1
/* 17DF74 8024F694 E7B60010 */ swc1 $f22, 0x10($sp)
/* 17DF78 8024F698 8E25FFF4 */ lw $a1, -0xC($s1)
/* 17DF7C 8024F69C 4406A000 */ mfc1 $a2, $f20
/* 17DF80 8024F6A0 4407A000 */ mfc1 $a3, $f20
/* 17DF84 8024F6A4 0C019EC8 */ jal guRotateF
/* 17DF88 8024F6A8 8FA40264 */ lw $a0, 0x264($sp)
/* 17DF8C 8024F6AC 8E250000 */ lw $a1, 0x0($s1)
D_8024F6B0:
/* 17DF90 8024F6B0 03C0202D */ daddu $a0, $fp, $zero
/* 17DF94 8024F6B4 00A0302D */ daddu $a2, $a1, $zero
/* 17DF98 8024F6B8 0C019DF0 */ jal guScaleF
D_8024F6BC:
/* 17DF9C 8024F6BC 00A0382D */ daddu $a3, $a1, $zero
/* 17DFA0 8024F6C0 8FA40264 */ lw $a0, 0x264($sp)
/* 17DFA4 8024F6C4 8FA5025C */ lw $a1, 0x25C($sp)
/* 17DFA8 8024F6C8 0C019D80 */ jal guMtxCatF
/* 17DFAC 8024F6CC 0240302D */ daddu $a2, $s2, $zero
D_8024F6D0:
/* 17DFB0 8024F6D0 0240202D */ daddu $a0, $s2, $zero
/* 17DFB4 8024F6D4 8FA50260 */ lw $a1, 0x260($sp)
/* 17DFB8 8024F6D8 0C019D80 */ jal guMtxCatF
/* 17DFBC 8024F6DC 02E0302D */ daddu $a2, $s7, $zero
/* 17DFC0 8024F6E0 03C0202D */ daddu $a0, $fp, $zero
/* 17DFC4 8024F6E4 02E0282D */ daddu $a1, $s7, $zero
D_8024F6E8_C0CF68:
/* 17DFC8 8024F6E8 0C019D80 */ jal guMtxCatF
/* 17DFCC 8024F6EC 0240302D */ daddu $a2, $s2, $zero
D_8024F6F0:
/* 17DFD0 8024F6F0 0240202D */ daddu $a0, $s2, $zero
/* 17DFD4 8024F6F4 27A50018 */ addiu $a1, $sp, 0x18
/* 17DFD8 8024F6F8 0C019D80 */ jal guMtxCatF
/* 17DFDC 8024F6FC 02C0302D */ daddu $a2, $s6, $zero
/* 17DFE0 8024F700 02C0202D */ daddu $a0, $s6, $zero
/* 17DFE4 8024F704 0C019D40 */ jal guMtxF2L
/* 17DFE8 8024F708 02A0282D */ daddu $a1, $s5, $zero
/* 17DFEC 8024F70C 0200202D */ daddu $a0, $s0, $zero
D_8024F710:
/* 17DFF0 8024F710 0C04873A */ jal draw_entity_model_A
/* 17DFF4 8024F714 02A0282D */ daddu $a1, $s5, $zero
D_8024F718:
/* 17DFF8 8024F718 8FA30258 */ lw $v1, 0x258($sp)
/* 17DFFC 8024F71C 2631004C */ addiu $s1, $s1, 0x4C
D_8024F720_C0CFA0:
/* 17E000 8024F720 84620012 */ lh $v0, 0x12($v1)
/* 17E004 8024F724 0282102A */ slt $v0, $s4, $v0
/* 17E008 8024F728 1440FFC1 */ bnez $v0, D_8024F630
/* 17E00C 8024F72C 2673004C */ addiu $s3, $s3, 0x4C
.L8024F730:
/* 17E010 8024F730 8FBF028C */ lw $ra, 0x28C($sp)
/* 17E014 8024F734 8FBE0288 */ lw $fp, 0x288($sp)
/* 17E018 8024F738 8FB70284 */ lw $s7, 0x284($sp)
D_8024F73C:
/* 17E01C 8024F73C 8FB60280 */ lw $s6, 0x280($sp)
/* 17E020 8024F740 8FB5027C */ lw $s5, 0x27C($sp)
D_8024F744:
/* 17E024 8024F744 8FB40278 */ lw $s4, 0x278($sp)
D_8024F748:
/* 17E028 8024F748 8FB30274 */ lw $s3, 0x274($sp)
D_8024F74C:
/* 17E02C 8024F74C 8FB20270 */ lw $s2, 0x270($sp)
D_8024F750:
/* 17E030 8024F750 8FB1026C */ lw $s1, 0x26C($sp)
/* 17E034 8024F754 8FB00268 */ lw $s0, 0x268($sp)
/* 17E038 8024F758 D7B60298 */ ldc1 $f22, 0x298($sp)
/* 17E03C 8024F75C D7B40290 */ ldc1 $f20, 0x290($sp)
/* 17E040 8024F760 03E00008 */ jr $ra
/* 17E044 8024F764 27BD02A0 */ addiu $sp, $sp, 0x2A0
### DECOMPILED C INSTRUCTIONS:
void btl_bonk_render(void* data) {
PopupMessage* popup = data;
Message* message = popup->message;
Matrix4f sp18;
Matrix4f mtxRotX;
Matrix4f mtxRotY;
Matrix4f mtxRotZ;
Matrix4f sp118;
Matrix4f sp158;
Matrix4f sp198;
Matrix4f mtxScale;
Mtx sp218;
s32 i;
for (i = 0; i < popup->messageIndex; i++, message++) {
if (message->unk_00) {
if (message->unk_24 != 0) {
break;
} else {
s32 modelIdx = message->entityModelIndex;
guTranslateF(sp18, message->pos.x, message->pos.y, message->pos.z);
guRotateF(mtxRotX, 0.0f, 1.0f, 0.0f, 0.0f);
guRotateF(mtxRotY, message->rotY, 0.0f, 1.0f, 0.0f);
guRotateF(mtxRotZ, message->rotZ, 0.0f, 0.0f, 1.0f);
guScaleF(mtxScale, message->scale, message->scale, message->scale);
guMtxCatF(mtxRotZ, mtxRotX, sp158);
guMtxCatF(sp158, mtxRotY, sp118);
guMtxCatF(mtxScale, sp118, sp158);
guMtxCatF(sp158, sp18, sp198);
guMtxF2L(sp198, &sp218);
draw_entity_model_A(modelIdx, &sp218);
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel attack_result_text_main
/* 38F900 E0090000 27BDFF98 */ addiu $sp, $sp, -0x68
/* 38F904 E0090004 F7B80050 */ sdc1 $f24, 0x50($sp)
/* 38F908 E0090008 4485C000 */ mtc1 $a1, $f24
/* 38F90C E009000C F7BA0058 */ sdc1 $f26, 0x58($sp)
/* 38F910 E0090010 4486D000 */ mtc1 $a2, $f26
/* 38F914 E0090014 F7BC0060 */ sdc1 $f28, 0x60($sp)
/* 38F918 E0090018 4487E000 */ mtc1 $a3, $f28
/* 38F91C E009001C AFB20030 */ sw $s2, 0x30($sp)
/* 38F920 E0090020 0080902D */ daddu $s2, $a0, $zero
/* 38F924 E0090024 F7B60048 */ sdc1 $f22, 0x48($sp)
/* 38F928 E0090028 C7B60078 */ lwc1 $f22, 0x78($sp)
/* 38F92C E009002C 27A40010 */ addiu $a0, $sp, 0x10
/* 38F930 E0090030 AFB30034 */ sw $s3, 0x34($sp)
/* 38F934 E0090034 8FB3007C */ lw $s3, 0x7C($sp)
/* 38F938 E0090038 3C02E009 */ lui $v0, %hi(attack_result_text_init)
/* 38F93C E009003C 244201C0 */ addiu $v0, $v0, %lo(attack_result_text_init)
/* 38F940 E0090040 AFA20018 */ sw $v0, 0x18($sp)
/* 38F944 E0090044 3C02E009 */ lui $v0, %hi(attack_result_text_update)
/* 38F948 E0090048 244201C8 */ addiu $v0, $v0, %lo(attack_result_text_update)
/* 38F94C E009004C AFA2001C */ sw $v0, 0x1C($sp)
/* 38F950 E0090050 3C02E009 */ lui $v0, %hi(attack_result_text_render)
/* 38F954 E0090054 24420420 */ addiu $v0, $v0, %lo(attack_result_text_render)
/* 38F958 E0090058 AFA20020 */ sw $v0, 0x20($sp)
/* 38F95C E009005C 3C02E009 */ lui $v0, %hi(func_E0090428)
/* 38F960 E0090060 24420428 */ addiu $v0, $v0, %lo(func_E0090428)
/* 38F964 E0090064 AFA20024 */ sw $v0, 0x24($sp)
/* 38F968 E0090068 24020048 */ addiu $v0, $zero, 0x48
/* 38F96C E009006C AFBF0038 */ sw $ra, 0x38($sp)
/* 38F970 E0090070 AFB1002C */ sw $s1, 0x2C($sp)
/* 38F974 E0090074 AFB00028 */ sw $s0, 0x28($sp)
/* 38F978 E0090078 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 38F97C E009007C AFA00010 */ sw $zero, 0x10($sp)
/* 38F980 E0090080 0C080124 */ jal shim_create_effect_instance
/* 38F984 E0090084 AFA20014 */ sw $v0, 0x14($sp)
/* 38F988 E0090088 24040038 */ addiu $a0, $zero, 0x38
/* 38F98C E009008C 24030001 */ addiu $v1, $zero, 0x1
/* 38F990 E0090090 0040882D */ daddu $s1, $v0, $zero
/* 38F994 E0090094 0C08012C */ jal shim_general_heap_malloc
/* 38F998 E0090098 AE230008 */ sw $v1, 0x8($s1)
/* 38F99C E009009C 0040802D */ daddu $s0, $v0, $zero
/* 38F9A0 E00900A0 16000003 */ bnez $s0, .LE00900B0
/* 38F9A4 E00900A4 AE22000C */ sw $v0, 0xC($s1)
.LE00900A8:
/* 38F9A8 E00900A8 0802402A */ j .LE00900A8
/* 38F9AC E00900AC 00000000 */ nop
.LE00900B0:
/* 38F9B0 E00900B0 3C036666 */ lui $v1, (0x66666667 >> 16)
/* 38F9B4 E00900B4 34636667 */ ori $v1, $v1, (0x66666667 & 0xFFFF)
/* 38F9B8 E00900B8 24020001 */ addiu $v0, $zero, 0x1
/* 38F9BC E00900BC 02430018 */ mult $s2, $v1
/* 38F9C0 E00900C0 AE020024 */ sw $v0, 0x24($s0)
/* 38F9C4 E00900C4 AE000020 */ sw $zero, 0x20($s0)
/* 38F9C8 E00900C8 AE120000 */ sw $s2, 0x0($s0)
/* 38F9CC E00900CC AE00001C */ sw $zero, 0x1C($s0)
/* 38F9D0 E00900D0 00004010 */ mfhi $t0
/* 38F9D4 E00900D4 00481807 */ srav $v1, $t0, $v0
/* 38F9D8 E00900D8 001217C3 */ sra $v0, $s2, 31
/* 38F9DC E00900DC 00621823 */ subu $v1, $v1, $v0
/* 38F9E0 E00900E0 00031080 */ sll $v0, $v1, 2
/* 38F9E4 E00900E4 00431021 */ addu $v0, $v0, $v1
/* 38F9E8 E00900E8 02421023 */ subu $v0, $s2, $v0
/* 38F9EC E00900EC 1E600004 */ bgtz $s3, .LE0090100
/* 38F9F0 E00900F0 AE020004 */ sw $v0, 0x4($s0)
/* 38F9F4 E00900F4 24020064 */ addiu $v0, $zero, 0x64
/* 38F9F8 E00900F8 08024041 */ j .LE0090104
/* 38F9FC E00900FC AE020018 */ sw $v0, 0x18($s0)
.LE0090100:
/* 38FA00 E0090100 AE130018 */ sw $s3, 0x18($s0)
.LE0090104:
/* 38FA04 E0090104 240200FF */ addiu $v0, $zero, 0xFF
/* 38FA08 E0090108 AE020014 */ sw $v0, 0x14($s0)
/* 38FA0C E009010C 2A420005 */ slti $v0, $s2, 0x5
/* 38FA10 E0090110 50400014 */ beql $v0, $zero, .LE0090164
/* 38FA14 E0090114 AE000010 */ sw $zero, 0x10($s0)
/* 38FA18 E0090118 3C0141F0 */ lui $at, (0x41F00000 >> 16)
/* 38FA1C E009011C 4481A000 */ mtc1 $at, $f20
/* 38FA20 E0090120 E6180008 */ swc1 $f24, 0x8($s0)
/* 38FA24 E0090124 E61A000C */ swc1 $f26, 0xC($s0)
/* 38FA28 E0090128 E61C0010 */ swc1 $f28, 0x10($s0)
/* 38FA2C E009012C 0C080140 */ jal shim_sin_deg
/* 38FA30 E0090130 4600A306 */ mov.s $f12, $f20
/* 38FA34 E0090134 46000007 */ neg.s $f0, $f0
/* 38FA38 E0090138 46160002 */ mul.s $f0, $f0, $f22
/* 38FA3C E009013C 00000000 */ nop
/* 38FA40 E0090140 46000000 */ add.s $f0, $f0, $f0
/* 38FA44 E0090144 4600A306 */ mov.s $f12, $f20
/* 38FA48 E0090148 0C080144 */ jal shim_cos_deg
/* 38FA4C E009014C E6000030 */ swc1 $f0, 0x30($s0)
/* 38FA50 E0090150 46160002 */ mul.s $f0, $f0, $f22
/* 38FA54 E0090154 00000000 */ nop
/* 38FA58 E0090158 46000000 */ add.s $f0, $f0, $f0
/* 38FA5C E009015C 08024063 */ j .LE009018C
/* 38FA60 E0090160 E6000034 */ swc1 $f0, 0x34($s0)
.LE0090164:
/* 38FA64 E0090164 3C01C2C8 */ lui $at, (0xC2C80000 >> 16)
/* 38FA68 E0090168 44810000 */ mtc1 $at, $f0
/* 38FA6C E009016C 3C014220 */ lui $at, (0x42200000 >> 16)
/* 38FA70 E0090170 44811000 */ mtc1 $at, $f2
/* 38FA74 E0090174 3C0142E6 */ lui $at, (0x42E60000 >> 16)
/* 38FA78 E0090178 44812000 */ mtc1 $at, $f4
/* 38FA7C E009017C AE000034 */ sw $zero, 0x34($s0)
/* 38FA80 E0090180 E6000008 */ swc1 $f0, 0x8($s0)
/* 38FA84 E0090184 E602000C */ swc1 $f2, 0xC($s0)
/* 38FA88 E0090188 E6040030 */ swc1 $f4, 0x30($s0)
.LE009018C:
/* 38FA8C E009018C 0220102D */ daddu $v0, $s1, $zero
/* 38FA90 E0090190 8FBF0038 */ lw $ra, 0x38($sp)
/* 38FA94 E0090194 8FB30034 */ lw $s3, 0x34($sp)
/* 38FA98 E0090198 8FB20030 */ lw $s2, 0x30($sp)
/* 38FA9C E009019C 8FB1002C */ lw $s1, 0x2C($sp)
/* 38FAA0 E00901A0 8FB00028 */ lw $s0, 0x28($sp)
/* 38FAA4 E00901A4 D7BC0060 */ ldc1 $f28, 0x60($sp)
/* 38FAA8 E00901A8 D7BA0058 */ ldc1 $f26, 0x58($sp)
/* 38FAAC E00901AC D7B80050 */ ldc1 $f24, 0x50($sp)
/* 38FAB0 E00901B0 D7B60048 */ ldc1 $f22, 0x48($sp)
/* 38FAB4 E00901B4 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 38FAB8 E00901B8 03E00008 */ jr $ra
/* 38FABC E00901BC 27BD0068 */ addiu $sp, $sp, 0x68
### DECOMPILED C INSTRUCTIONS:
EffectInstance* attack_result_text_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 appearVel, s32 duration) {
EffectBlueprint bp;
EffectInstance* effect;
AttackResultTextFXData* data;
s32 numParts = 1;
bp.unk_00 = 0;
bp.init = attack_result_text_init;
bp.update = attack_result_text_update;
bp.renderWorld = attack_result_text_render;
bp.renderUI = func_E0090428;
bp.effectID = EFFECT_ATTACK_RESULT_TEXT;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = effect->data.attackResultText = shim_general_heap_malloc(effect->numParts * sizeof(*data));
ASSERT(data != NULL);
data->isVisible = TRUE;
data->unk_20 = 0;
data->type = type;
data->lifetime = 0;
data->unk_04 = type % 5;
if (duration <= 0) {
data->timeLeft = 100;
} else {
data->timeLeft = duration;
}
data->alpha = 0xFF;
if (type < 5) {
data->pos.x = posX;
data->pos.y = posY;
data->pos.z = posZ;
data->vel.x = 2.0f * (-shim_sin_deg(30.0f) * appearVel);
data->vel.y = 2.0f * (shim_cos_deg(30.0f) * appearVel);
} else {
data->pos.x = -100.0f;
data->pos.y = 40.0f;
data->pos.z = 0.0f;
data->vel.x = 115.0f;
data->vel.y = 0.0f;
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_800E24F8
/* 7B9A8 800E24F8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 7B9AC 800E24FC AFB00010 */ sw $s0, 0x10($sp)
/* 7B9B0 800E2500 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* 7B9B4 800E2504 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* 7B9B8 800E2508 AFBF0014 */ sw $ra, 0x14($sp)
/* 7B9BC 800E250C 0C044181 */ jal get_shadow_by_index
/* 7B9C0 800E2510 8E0400CC */ lw $a0, 0xCC($s0)
/* 7B9C4 800E2514 C4400028 */ lwc1 $f0, 0x28($v0)
/* 7B9C8 800E2518 3C018011 */ lui $at, %hi(D_8010BD30)
/* 7B9CC 800E251C D424BD30 */ ldc1 $f4, %lo(D_8010BD30)($at)
/* 7B9D0 800E2520 C4420030 */ lwc1 $f2, 0x30($v0)
/* 7B9D4 800E2524 46000021 */ cvt.d.s $f0, $f0
/* 7B9D8 800E2528 46240000 */ add.d $f0, $f0, $f4
/* 7B9DC 800E252C 3C05800B */ lui $a1, %hi(gCameras)
/* 7B9E0 800E2530 24A51D80 */ addiu $a1, $a1, %lo(gCameras)
/* 7B9E4 800E2534 460010A1 */ cvt.d.s $f2, $f2
/* 7B9E8 800E2538 46241080 */ add.d $f2, $f2, $f4
/* 7B9EC 800E253C 44802000 */ mtc1 $zero, $f4
/* 7B9F0 800E2540 46200020 */ cvt.s.d $f0, $f0
/* 7B9F4 800E2544 46040032 */ c.eq.s $f0, $f4
/* 7B9F8 800E2548 00000000 */ nop
/* 7B9FC 800E254C 45000005 */ bc1f .L800E2564
/* 7BA00 800E2550 462010A0 */ cvt.s.d $f2, $f2
/* 7BA04 800E2554 46041032 */ c.eq.s $f2, $f4
/* 7BA08 800E2558 00000000 */ nop
/* 7BA0C 800E255C 4501003D */ bc1t .L800E2654
/* 7BA10 800E2560 00000000 */ nop
.L800E2564:
/* 7BA14 800E2564 920200B4 */ lbu $v0, 0xB4($s0)
/* 7BA18 800E2568 2442FFFF */ addiu $v0, $v0, -0x1
/* 7BA1C 800E256C 00021600 */ sll $v0, $v0, 24
/* 7BA20 800E2570 00021E03 */ sra $v1, $v0, 24
/* 7BA24 800E2574 2C620011 */ sltiu $v0, $v1, 0x11
/* 7BA28 800E2578 1040002D */ beqz $v0, .L800E2630
/* 7BA2C 800E257C 00031080 */ sll $v0, $v1, 2
/* 7BA30 800E2580 3C018011 */ lui $at, %hi(jtbl_8010BD38)
/* 7BA34 800E2584 00220821 */ addu $at, $at, $v0
/* 7BA38 800E2588 8C22BD38 */ lw $v0, %lo(jtbl_8010BD38)($at)
/* 7BA3C 800E258C 00400008 */ jr $v0
/* 7BA40 800E2590 00000000 */ nop
glabel .L800E2594
/* 7BA44 800E2594 3C014200 */ lui $at, (0x42000000 >> 16)
/* 7BA48 800E2598 44812000 */ mtc1 $at, $f4
/* 7BA4C 800E259C 080389A5 */ j .L800E2694
/* 7BA50 800E25A0 E4A4049C */ swc1 $f4, 0x49C($a1)
glabel .L800E25A4
/* 7BA54 800E25A4 84A20034 */ lh $v0, 0x34($a1)
/* 7BA58 800E25A8 28420082 */ slti $v0, $v0, 0x82
/* 7BA5C 800E25AC 10400005 */ beqz $v0, .L800E25C4
/* 7BA60 800E25B0 00000000 */ nop
/* 7BA64 800E25B4 3C014040 */ lui $at, (0x40400000 >> 16)
/* 7BA68 800E25B8 44810000 */ mtc1 $at, $f0
/* 7BA6C 800E25BC 080389A5 */ j .L800E2694
/* 7BA70 800E25C0 E4A0049C */ swc1 $f0, 0x49C($a1)
.L800E25C4:
/* 7BA74 800E25C4 3C048011 */ lui $a0, %hi(D_8010C9A0)
/* 7BA78 800E25C8 2484C9A0 */ addiu $a0, $a0, %lo(D_8010C9A0)
/* 7BA7C 800E25CC 8C820000 */ lw $v0, 0x0($a0)
/* 7BA80 800E25D0 3C014040 */ lui $at, (0x40400000 >> 16)
/* 7BA84 800E25D4 44812000 */ mtc1 $at, $f4
/* 7BA88 800E25D8 0040182D */ daddu $v1, $v0, $zero
/* 7BA8C 800E25DC 24420001 */ addiu $v0, $v0, 0x1
/* 7BA90 800E25E0 2863000B */ slti $v1, $v1, 0xB
/* 7BA94 800E25E4 1460002B */ bnez $v1, .L800E2694
/* 7BA98 800E25E8 AC820000 */ sw $v0, 0x0($a0)
/* 7BA9C 800E25EC C4A0049C */ lwc1 $f0, 0x49C($a1)
/* 7BAA0 800E25F0 3C014000 */ lui $at, (0x40000000 >> 16)
/* 7BAA4 800E25F4 44811000 */ mtc1 $at, $f2
/* 7BAA8 800E25F8 00000000 */ nop
/* 7BAAC 800E25FC 46020001 */ sub.s $f0, $f0, $f2
/* 7BAB0 800E2600 2402000A */ addiu $v0, $zero, 0xA
/* 7BAB4 800E2604 AC820000 */ sw $v0, 0x0($a0)
.L800E2608:
/* 7BAB8 800E2608 4604003C */ c.lt.s $f0, $f4
/* 7BABC 800E260C 00000000 */ nop
/* 7BAC0 800E2610 45000020 */ bc1f .L800E2694
/* 7BAC4 800E2614 E4A0049C */ swc1 $f0, 0x49C($a1)
/* 7BAC8 800E2618 080389A5 */ j .L800E2694
/* 7BACC 800E261C E4A4049C */ swc1 $f4, 0x49C($a1)
glabel .L800E2620
/* 7BAD0 800E2620 3C014040 */ lui $at, (0x40400000 >> 16)
/* 7BAD4 800E2624 44812000 */ mtc1 $at, $f4
/* 7BAD8 800E2628 080389A5 */ j .L800E2694
/* 7BADC 800E262C E4A4049C */ swc1 $f4, 0x49C($a1)
glabel .L800E2630
/* 7BAE0 800E2630 C4A0049C */ lwc1 $f0, 0x49C($a1)
/* 7BAE4 800E2634 3C014000 */ lui $at, (0x40000000 >> 16)
/* 7BAE8 800E2638 44811000 */ mtc1 $at, $f2
/* 7BAEC 800E263C 3C014040 */ lui $at, (0x40400000 >> 16)
/* 7BAF0 800E2640 44812000 */ mtc1 $at, $f4
/* 7BAF4 800E2644 3C018011 */ lui $at, %hi(D_8010C9A0)
/* 7BAF8 800E2648 AC20C9A0 */ sw $zero, %lo(D_8010C9A0)($at)
/* 7BAFC 800E264C 08038982 */ j .L800E2608
/* 7BB00 800E2650 46020001 */ sub.s $f0, $f0, $f2
.L800E2654:
/* 7BB04 800E2654 820300B4 */ lb $v1, 0xB4($s0)
/* 7BB08 800E2658 1860000A */ blez $v1, .L800E2684
/* 7BB0C 800E265C 28620004 */ slti $v0, $v1, 0x4
/* 7BB10 800E2660 14400003 */ bnez $v0, .L800E2670
/* 7BB14 800E2664 24020011 */ addiu $v0, $zero, 0x11
/* 7BB18 800E2668 14620006 */ bne $v1, $v0, .L800E2684
/* 7BB1C 800E266C 00000000 */ nop
.L800E2670:
/* 7BB20 800E2670 3C0140E6 */ lui $at, (0x40E66666 >> 16)
/* 7BB24 800E2674 34216666 */ ori $at, $at, (0x40E66666 & 0xFFFF)
/* 7BB28 800E2678 44812000 */ mtc1 $at, $f4
/* 7BB2C 800E267C 080389A5 */ j .L800E2694
/* 7BB30 800E2680 E4A4049C */ swc1 $f4, 0x49C($a1)
.L800E2684:
/* 7BB34 800E2684 3C0141C0 */ lui $at, (0x41C00000 >> 16)
/* 7BB38 800E2688 44812000 */ mtc1 $at, $f4
/* 7BB3C 800E268C 00000000 */ nop
/* 7BB40 800E2690 E4A4049C */ swc1 $f4, 0x49C($a1)
.L800E2694:
/* 7BB44 800E2694 8FBF0014 */ lw $ra, 0x14($sp)
/* 7BB48 800E2698 8FB00010 */ lw $s0, 0x10($sp)
/* 7BB4C 800E269C 03E00008 */ jr $ra
/* 7BB50 800E26A0 27BD0018 */ addiu $sp, $sp, 0x18
/* 7BB54 800E26A4 00000000 */ nop
/* 7BB58 800E26A8 00000000 */ nop
/* 7BB5C 800E26AC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void func_800E24F8(void) {
Shadow* shadow = get_shadow_by_index(gPlayerStatus.shadowID);
f32 x = shadow->rotation.x + 180.0;
f32 z = shadow->rotation.z + 180.0;
Camera* camera = &gCameras[CAM_DEFAULT];
f32 temp;
if (x != 0.0f || z != 0.0f) {
switch (gPlayerStatus.actionState) {
case ACTION_STATE_JUMP:
case ACTION_STATE_FALLING:
temp = 32.0f;
camera->unk_49C = temp;
break;
case ACTION_STATE_WALK:
case ACTION_STATE_RUN:
if (camera->targetScreenCoords.y < 130) {
camera->unk_49C = 3.0f;
break;
}
temp = 3.0f;
if (D_8010C9A0++ > 10) {
D_8010C9A0 = 10;
camera->unk_49C -= 2.0f;
if (camera->unk_49C < temp) {
camera->unk_49C = temp;
}
}
break;
case ACTION_STATE_SLIDING:
temp = 3.0f;
camera->unk_49C = temp;
break;
default:
temp = 3.0f;
D_8010C9A0 = 0;
camera->unk_49C -= 2.0f;
if (camera->unk_49C < temp) {
camera->unk_49C = temp;
}
break;
}
} else {
switch (gPlayerStatus.actionState) {
case ACTION_STATE_WALK:
case ACTION_STATE_RUN:
case ACTION_STATE_JUMP:
case ACTION_STATE_SLIDING:
temp = 7.2f;
break;
default:
temp = 24.0f;
break;
}
camera->unk_49C = temp;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel disable_x_main
/* 385640 E0082000 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 385644 E0082004 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 385648 E0082008 4485A000 */ mtc1 $a1, $f20
/* 38564C E008200C AFB00028 */ sw $s0, 0x28($sp)
/* 385650 E0082010 0080802D */ daddu $s0, $a0, $zero
/* 385654 E0082014 F7B60040 */ sdc1 $f22, 0x40($sp)
/* 385658 E0082018 4486B000 */ mtc1 $a2, $f22
/* 38565C E008201C 27A40010 */ addiu $a0, $sp, 0x10
/* 385660 E0082020 F7B80048 */ sdc1 $f24, 0x48($sp)
/* 385664 E0082024 4487C000 */ mtc1 $a3, $f24
/* 385668 E0082028 3C02E008 */ lui $v0, %hi(disable_x_init)
/* 38566C E008202C 244221B0 */ addiu $v0, $v0, %lo(disable_x_init)
/* 385670 E0082030 AFA20018 */ sw $v0, 0x18($sp)
/* 385674 E0082034 3C02E008 */ lui $v0, %hi(disable_x_update)
/* 385678 E0082038 244221B8 */ addiu $v0, $v0, %lo(disable_x_update)
/* 38567C E008203C AFA2001C */ sw $v0, 0x1C($sp)
/* 385680 E0082040 3C02E008 */ lui $v0, %hi(disable_x_render)
/* 385684 E0082044 24422520 */ addiu $v0, $v0, %lo(disable_x_render)
/* 385688 E0082048 AFA20020 */ sw $v0, 0x20($sp)
/* 38568C E008204C 3C02E008 */ lui $v0, %hi(func_E0082528)
/* 385690 E0082050 24422528 */ addiu $v0, $v0, %lo(func_E0082528)
/* 385694 E0082054 AFA20024 */ sw $v0, 0x24($sp)
/* 385698 E0082058 24020041 */ addiu $v0, $zero, 0x41
/* 38569C E008205C AFBF0034 */ sw $ra, 0x34($sp)
/* 3856A0 E0082060 AFB20030 */ sw $s2, 0x30($sp)
/* 3856A4 E0082064 AFB1002C */ sw $s1, 0x2C($sp)
/* 3856A8 E0082068 AFA00010 */ sw $zero, 0x10($sp)
/* 3856AC E008206C 0C080124 */ jal shim_create_effect_instance
/* 3856B0 E0082070 AFA20014 */ sw $v0, 0x14($sp)
/* 3856B4 E0082074 24040090 */ addiu $a0, $zero, 0x90
/* 3856B8 E0082078 24120002 */ addiu $s2, $zero, 0x2
/* 3856BC E008207C 0040882D */ daddu $s1, $v0, $zero
/* 3856C0 E0082080 0C08012C */ jal shim_general_heap_malloc
/* 3856C4 E0082084 AE320008 */ sw $s2, 0x8($s1)
/* 3856C8 E0082088 0040182D */ daddu $v1, $v0, $zero
/* 3856CC E008208C 14600003 */ bnez $v1, .LE008209C
/* 3856D0 E0082090 AE23000C */ sw $v1, 0xC($s1)
.LE0082094:
/* 3856D4 E0082094 08020825 */ j .LE0082094
/* 3856D8 E0082098 00000000 */ nop
.LE008209C:
/* 3856DC E008209C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3856E0 E00820A0 44810000 */ mtc1 $at, $f0
/* 3856E4 E00820A4 24020001 */ addiu $v0, $zero, 0x1
/* 3856E8 E00820A8 AC700000 */ sw $s0, 0x0($v1)
/* 3856EC E00820AC 16020004 */ bne $s0, $v0, .LE00820C0
/* 3856F0 E00820B0 E4600034 */ swc1 $f0, 0x34($v1)
/* 3856F4 E00820B4 AC700038 */ sw $s0, 0x38($v1)
/* 3856F8 E00820B8 08020834 */ j .LE00820D0
/* 3856FC E00820BC AC60003C */ sw $zero, 0x3C($v1)
.LE00820C0:
/* 385700 E00820C0 AC600038 */ sw $zero, 0x38($v1)
/* 385704 E00820C4 8FA20060 */ lw $v0, 0x60($sp)
/* 385708 E00820C8 AC62003C */ sw $v0, 0x3C($v1)
/* 38570C E00820CC 24020001 */ addiu $v0, $zero, 0x1
.LE00820D0:
/* 385710 E00820D0 E4740008 */ swc1 $f20, 0x8($v1)
/* 385714 E00820D4 E476000C */ swc1 $f22, 0xC($v1)
/* 385718 E00820D8 1202000E */ beq $s0, $v0, .LE0082114
/* 38571C E00820DC E4780010 */ swc1 $f24, 0x10($v1)
/* 385720 E00820E0 2A020002 */ slti $v0, $s0, 0x2
/* 385724 E00820E4 10400005 */ beqz $v0, .LE00820FC
/* 385728 E00820E8 2402000A */ addiu $v0, $zero, 0xA
/* 38572C E00820EC 12000007 */ beqz $s0, .LE008210C
/* 385730 E00820F0 24020001 */ addiu $v0, $zero, 0x1
/* 385734 E00820F4 0802084B */ j .LE008212C
/* 385738 E00820F8 AC60002C */ sw $zero, 0x2C($v1)
.LE00820FC:
/* 38573C E00820FC 12020007 */ beq $s0, $v0, .LE008211C
/* 385740 E0082100 24020001 */ addiu $v0, $zero, 0x1
/* 385744 E0082104 0802084B */ j .LE008212C
/* 385748 E0082108 AC60002C */ sw $zero, 0x2C($v1)
.LE008210C:
/* 38574C E008210C 08020848 */ j .LE0082120
/* 385750 E0082110 24020064 */ addiu $v0, $zero, 0x64
.LE0082114:
/* 385754 E0082114 08020848 */ j .LE0082120
/* 385758 E0082118 24020064 */ addiu $v0, $zero, 0x64
.LE008211C:
/* 38575C E008211C 24020015 */ addiu $v0, $zero, 0x15
.LE0082120:
/* 385760 E0082120 AC620028 */ sw $v0, 0x28($v1)
/* 385764 E0082124 24020001 */ addiu $v0, $zero, 0x1
/* 385768 E0082128 AC60002C */ sw $zero, 0x2C($v1)
.LE008212C:
/* 38576C E008212C AC600044 */ sw $zero, 0x44($v1)
/* 385770 E0082130 AC620004 */ sw $v0, 0x4($v1)
/* 385774 E0082134 0040202D */ daddu $a0, $v0, $zero
/* 385778 E0082138 0092102A */ slt $v0, $a0, $s2
/* 38577C E008213C 10400012 */ beqz $v0, .LE0082188
/* 385780 E0082140 24630048 */ addiu $v1, $v1, 0x48
/* 385784 E0082144 44800000 */ mtc1 $zero, $f0
/* 385788 E0082148 240500FF */ addiu $a1, $zero, 0xFF
/* 38578C E008214C 24630024 */ addiu $v1, $v1, 0x24
.LE0082150:
/* 385790 E0082150 24840001 */ addiu $a0, $a0, 0x1
/* 385794 E0082154 E460FFEC */ swc1 $f0, -0x14($v1)
/* 385798 E0082158 E460FFE8 */ swc1 $f0, -0x18($v1)
/* 38579C E008215C E460FFE4 */ swc1 $f0, -0x1C($v1)
/* 3857A0 E0082160 E460FFFC */ swc1 $f0, -0x4($v1)
/* 3857A4 E0082164 E460FFF8 */ swc1 $f0, -0x8($v1)
/* 3857A8 E0082168 E460FFF4 */ swc1 $f0, -0xC($v1)
/* 3857AC E008216C E460FFF0 */ swc1 $f0, -0x10($v1)
/* 3857B0 E0082170 E460001C */ swc1 $f0, 0x1C($v1)
/* 3857B4 E0082174 AC600004 */ sw $zero, 0x4($v1)
/* 3857B8 E0082178 AC650000 */ sw $a1, 0x0($v1)
/* 3857BC E008217C 0092102A */ slt $v0, $a0, $s2
/* 3857C0 E0082180 1440FFF3 */ bnez $v0, .LE0082150
/* 3857C4 E0082184 24630048 */ addiu $v1, $v1, 0x48
.LE0082188:
/* 3857C8 E0082188 0220102D */ daddu $v0, $s1, $zero
/* 3857CC E008218C 8FBF0034 */ lw $ra, 0x34($sp)
/* 3857D0 E0082190 8FB20030 */ lw $s2, 0x30($sp)
/* 3857D4 E0082194 8FB1002C */ lw $s1, 0x2C($sp)
/* 3857D8 E0082198 8FB00028 */ lw $s0, 0x28($sp)
/* 3857DC E008219C D7B80048 */ ldc1 $f24, 0x48($sp)
/* 3857E0 E00821A0 D7B60040 */ ldc1 $f22, 0x40($sp)
/* 3857E4 E00821A4 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 3857E8 E00821A8 03E00008 */ jr $ra
/* 3857EC E00821AC 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
EffectInstance* disable_x_main(s32 type, f32 x, f32 y, f32 z, s32 arg4) {
EffectBlueprint bp;
EffectInstance* effect;
DisableXFXData* data;
s32 numParts = 2;
s32 i;
bp.unk_00 = 0;
bp.init = disable_x_init;
bp.update = disable_x_update;
bp.renderWorld = disable_x_render;
bp.renderUI = func_E0082528;
bp.effectID = EFFECT_DISABLE_X;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data.disableX = data;
ASSERT(effect->data.disableX != NULL);
data->type = type;
data->scale = 1.0f;
if (type == 1) {
data->unk_38 = type;
data->koDuration = 0;
} else {
data->unk_38 = 0;
data->koDuration = arg4;
}
data->pos.x = x;
data->pos.y = y;
data->pos.z = z;
switch (type) {
case 0:
data->unk_28 = 100;
break;
case 1:
data->unk_28 = 100;
break;
case 10:
data->unk_28 = 21;
break;
}
data->unk_2C = 0;
data->unk_44 = 0;
data->unk_04 = 1;
data++;
for (i = 1; i < numParts; i++, data++) {
data->pos.x = data->pos.y = data->pos.z = 0.0f;
data->unk_18 = data->unk_1C = data->unk_20 = 0.0f;
data->unk_14 = 0.0f;
data->unk_40 = 0.0f;
data->unk_28 = 0;
data->alpha = 255;
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel clear_entity_data
/* A73B8 80110CB8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* A73BC 80110CBC 3C058007 */ lui $a1, %hi(gGameStatusPtr)
/* A73C0 80110CC0 24A5419C */ addiu $a1, $a1, %lo(gGameStatusPtr)
/* A73C4 80110CC4 AFBF0014 */ sw $ra, 0x14($sp)
/* A73C8 80110CC8 AFB00010 */ sw $s0, 0x10($sp)
/* A73CC 80110CCC 8CA20000 */ lw $v0, 0x0($a1)
/* A73D0 80110CD0 24030001 */ addiu $v1, $zero, 0x1
/* A73D4 80110CD4 3C018015 */ lui $at, %hi(D_801516FC)
/* A73D8 80110CD8 AC2316FC */ sw $v1, %lo(D_801516FC)($at)
/* A73DC 80110CDC 3C018015 */ lui $at, %hi(entity_numEntities)
/* A73E0 80110CE0 AC2012C0 */ sw $zero, %lo(entity_numEntities)($at)
/* A73E4 80110CE4 3C018015 */ lui $at, %hi(D_80151324)
/* A73E8 80110CE8 AC201324 */ sw $zero, %lo(D_80151324)($at)
/* A73EC 80110CEC 3C018015 */ lui $at, %hi(entity_updateCounter)
/* A73F0 80110CF0 AC201330 */ sw $zero, %lo(entity_updateCounter)($at)
/* A73F4 80110CF4 3C018015 */ lui $at, %hi(D_80151304)
/* A73F8 80110CF8 AC201304 */ sw $zero, %lo(D_80151304)($at)
/* A73FC 80110CFC 80420070 */ lb $v0, 0x70($v0)
/* A7400 80110D00 14400003 */ bnez $v0, .L80110D10
/* A7404 80110D04 00000000 */ nop
/* A7408 80110D08 3C018015 */ lui $at, %hi(gEntityHideMode)
/* A740C 80110D0C AC201310 */ sw $zero, %lo(gEntityHideMode)($at)
.L80110D10:
/* A7410 80110D10 3C028016 */ lui $v0, %hi(gCurrentHiddenPanels)
/* A7414 80110D14 2442A578 */ addiu $v0, $v0, %lo(gCurrentHiddenPanels)
/* A7418 80110D18 3C018015 */ lui $at, %hi(D_8015132C)
/* A741C 80110D1C AC20132C */ sw $zero, %lo(D_8015132C)($at)
/* A7420 80110D20 A0400001 */ sb $zero, 0x1($v0)
/* A7424 80110D24 14800003 */ bnez $a0, .L80110D34
/* A7428 80110D28 A0400002 */ sb $zero, 0x2($v0)
/* A742C 80110D2C 3C018015 */ lui $at, %hi(D_80151344)
/* A7430 80110D30 AC201344 */ sw $zero, %lo(D_80151344)($at)
.L80110D34:
/* A7434 80110D34 8CA20000 */ lw $v0, 0x0($a1)
/* A7438 80110D38 240300FF */ addiu $v1, $zero, 0xFF
/* A743C 80110D3C 3C018015 */ lui $at, %hi(D_8014AFB0)
/* A7440 80110D40 AC23AFB0 */ sw $v1, %lo(D_8014AFB0)($at)
/* A7444 80110D44 80420070 */ lb $v0, 0x70($v0)
/* A7448 80110D48 1440000C */ bnez $v0, .L80110D7C
/* A744C 80110D4C 24040003 */ addiu $a0, $zero, 0x3
/* A7450 80110D50 3C018015 */ lui $at, %hi(wEntityBlueprintSize)
/* A7454 80110D54 AC20165C */ sw $zero, %lo(wEntityBlueprintSize)($at)
/* A7458 80110D58 2404001D */ addiu $a0, $zero, 0x1D
/* A745C 80110D5C 3C028015 */ lui $v0, %hi(D_801516DC)
/* A7460 80110D60 244216DC */ addiu $v0, $v0, %lo(D_801516DC)
.L80110D64:
/* A7464 80110D64 AC400000 */ sw $zero, 0x0($v0)
/* A7468 80110D68 2484FFFF */ addiu $a0, $a0, -0x1
/* A746C 80110D6C 0481FFFD */ bgez $a0, .L80110D64
/* A7470 80110D70 2442FFFC */ addiu $v0, $v0, -0x4
/* A7474 80110D74 08044367 */ j .L80110D9C
/* A7478 80110D78 00000000 */ nop
.L80110D7C:
/* A747C 80110D7C 3C018015 */ lui $at, %hi(bEntityBlueprintSize)
/* A7480 80110D80 AC201660 */ sw $zero, %lo(bEntityBlueprintSize)($at)
/* A7484 80110D84 3C028015 */ lui $v0, %hi(D_801516F4)
/* A7488 80110D88 244216F4 */ addiu $v0, $v0, %lo(D_801516F4)
.L80110D8C:
/* A748C 80110D8C AC400000 */ sw $zero, 0x0($v0)
/* A7490 80110D90 2484FFFF */ addiu $a0, $a0, -0x1
/* A7494 80110D94 0481FFFD */ bgez $a0, .L80110D8C
/* A7498 80110D98 2442FFFC */ addiu $v0, $v0, -0x4
.L80110D9C:
/* A749C 80110D9C 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* A74A0 80110DA0 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* A74A4 80110DA4 80420070 */ lb $v0, 0x70($v0)
/* A74A8 80110DA8 14400009 */ bnez $v0, .L80110DD0
/* A74AC 80110DAC 3C028025 */ lui $v0, (0x80250000 >> 16)
/* A74B0 80110DB0 3C038026 */ lui $v1, (0x80267FF0 >> 16)
/* A74B4 80110DB4 34637FF0 */ ori $v1, $v1, (0x80267FF0 & 0xFFFF)
/* A74B8 80110DB8 3C018015 */ lui $at, %hi(D_80151300)
/* A74BC 80110DBC AC221300 */ sw $v0, %lo(D_80151300)($at)
/* A74C0 80110DC0 3C018015 */ lui $at, %hi(gEntityHeapBase)
/* A74C4 80110DC4 AC2312C4 */ sw $v1, %lo(gEntityHeapBase)($at)
/* A74C8 80110DC8 0804437B */ j .L80110DEC
/* A74CC 80110DCC 00000000 */ nop
.L80110DD0:
/* A74D0 80110DD0 3C02801A */ lui $v0, %hi(BattleEntityHeapBottom)
/* A74D4 80110DD4 24427000 */ addiu $v0, $v0, %lo(BattleEntityHeapBottom)
/* A74D8 80110DD8 3C018015 */ lui $at, %hi(D_80151300)
/* A74DC 80110DDC AC221300 */ sw $v0, %lo(D_80151300)($at)
/* A74E0 80110DE0 24423000 */ addiu $v0, $v0, 0x3000
/* A74E4 80110DE4 3C018015 */ lui $at, %hi(gEntityHeapBase)
/* A74E8 80110DE8 AC2212C4 */ sw $v0, %lo(gEntityHeapBase)($at)
.L80110DEC:
/* A74EC 80110DEC 0C044188 */ jal get_entity_list
/* A74F0 80110DF0 00000000 */ nop
/* A74F4 80110DF4 3C108015 */ lui $s0, %hi(gCurrentEntityListPtr)
/* A74F8 80110DF8 26101470 */ addiu $s0, $s0, %lo(gCurrentEntityListPtr)
/* A74FC 80110DFC 0C044193 */ jal get_shadow_list
/* A7500 80110E00 AE020000 */ sw $v0, 0x0($s0)
/* A7504 80110E04 8E030000 */ lw $v1, 0x0($s0)
/* A7508 80110E08 2404001D */ addiu $a0, $zero, 0x1D
/* A750C 80110E0C 3C018015 */ lui $at, %hi(gCurrentShadowListPtr)
/* A7510 80110E10 AC221658 */ sw $v0, %lo(gCurrentShadowListPtr)($at)
/* A7514 80110E14 24630074 */ addiu $v1, $v1, 0x74
.L80110E18:
/* A7518 80110E18 AC600000 */ sw $zero, 0x0($v1)
/* A751C 80110E1C 2484FFFF */ addiu $a0, $a0, -0x1
/* A7520 80110E20 0481FFFD */ bgez $a0, .L80110E18
/* A7524 80110E24 2463FFFC */ addiu $v1, $v1, -0x4
/* A7528 80110E28 3C028015 */ lui $v0, %hi(gCurrentShadowListPtr)
/* A752C 80110E2C 8C421658 */ lw $v0, %lo(gCurrentShadowListPtr)($v0)
/* A7530 80110E30 2404003B */ addiu $a0, $zero, 0x3B
/* A7534 80110E34 244200EC */ addiu $v0, $v0, 0xEC
.L80110E38:
/* A7538 80110E38 AC400000 */ sw $zero, 0x0($v0)
/* A753C 80110E3C 2484FFFF */ addiu $a0, $a0, -0x1
/* A7540 80110E40 0481FFFD */ bgez $a0, .L80110E38
/* A7544 80110E44 2442FFFC */ addiu $v0, $v0, -0x4
/* A7548 80110E48 8FBF0014 */ lw $ra, 0x14($sp)
/* A754C 80110E4C 8FB00010 */ lw $s0, 0x10($sp)
/* A7550 80110E50 03E00008 */ jr $ra
/* A7554 80110E54 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void clear_entity_data(s32 arg0) {
s32 i;
D_801516FC = 1;
entity_numEntities = 0;
entity_numShadows = 0;
entity_updateCounter = 0;
D_80151304 = 0;
if (!gGameStatusPtr->isBattle) {
gEntityHideMode = ENTITY_HIDE_MODE_0;
}
entity_area_specific_data_is_loaded = FALSE;
gCurrentHiddenPanels.panelsCount = 0;
gCurrentHiddenPanels.activateISpy = FALSE;
if (!arg0) {
D_80151344 = 0;
}
D_8014AFB0 = 0xFF;
if (!gGameStatusPtr->isBattle) {
wEntityDataLoadedSize = 0;
for (i = 0; i < MAX_ENTITIES; i++) {
wEntityBlueprint[i] = NULL;
}
} else {
bEntityDataLoadedSize = 0;
for (i = 0; i < 4; i++) {
bEntityBlueprint[i] = NULL;
}
}
if (!gGameStatusPtr->isBattle) {
gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM;
gEntityHeapBase = WORLD_ENTITY_HEAP_BASE;
} else {
gEntityHeapBottom = (s32) BattleEntityHeapBottom;
gEntityHeapBase = gEntityHeapBottom + 0x3000;
}
gCurrentEntityListPtr = get_entity_list();
gCurrentShadowListPtr = get_shadow_list();
for (i = 0; i < MAX_ENTITIES; i++) {
(*gCurrentEntityListPtr)[i] = NULL;
}
for (i = 0; i < MAX_SHADOWS; i++) {
(*gCurrentShadowListPtr)[i] = NULL;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel floating_flower_appendGfx
/* 330270 E001A440 27BDFF40 */ addiu $sp, $sp, -0xC0
/* 330274 E001A444 0080382D */ daddu $a3, $a0, $zero
/* 330278 E001A448 3C08DB06 */ lui $t0, (0xDB060024 >> 16)
/* 33027C E001A44C 35080024 */ ori $t0, $t0, (0xDB060024 & 0xFFFF)
/* 330280 E001A450 AFB400B8 */ sw $s4, 0xB8($sp)
/* 330284 E001A454 3C14800A */ lui $s4, %hi(gMainGfxPos)
/* 330288 E001A458 2694A66C */ addiu $s4, $s4, %lo(gMainGfxPos)
/* 33028C E001A45C 27A40020 */ addiu $a0, $sp, 0x20
/* 330290 E001A460 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 330294 E001A464 AFBF00BC */ sw $ra, 0xBC($sp)
/* 330298 E001A468 AFB300B4 */ sw $s3, 0xB4($sp)
/* 33029C E001A46C AFB200B0 */ sw $s2, 0xB0($sp)
/* 3302A0 E001A470 AFB100AC */ sw $s1, 0xAC($sp)
/* 3302A4 E001A474 AFB000A8 */ sw $s0, 0xA8($sp)
/* 3302A8 E001A478 8E830000 */ lw $v1, 0x0($s4)
/* 3302AC E001A47C 8CE6000C */ lw $a2, 0xC($a3)
/* 3302B0 E001A480 0060282D */ daddu $a1, $v1, $zero
/* 3302B4 E001A484 24630008 */ addiu $v1, $v1, 0x8
/* 3302B8 E001A488 ACA20000 */ sw $v0, 0x0($a1)
/* 3302BC E001A48C ACA00004 */ sw $zero, 0x4($a1)
/* 3302C0 E001A490 AC680000 */ sw $t0, 0x0($v1)
/* 3302C4 E001A494 8CE20010 */ lw $v0, 0x10($a3)
/* 3302C8 E001A498 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3302CC E001A49C 44810000 */ mtc1 $at, $f0
/* 3302D0 E001A4A0 8C42001C */ lw $v0, 0x1C($v0)
/* 3302D4 E001A4A4 3C058000 */ lui $a1, (0x80000000 >> 16)
/* 3302D8 E001A4A8 00451021 */ addu $v0, $v0, $a1
/* 3302DC E001A4AC AC620004 */ sw $v0, 0x4($v1)
/* 3302E0 E001A4B0 E7A00010 */ swc1 $f0, 0x10($sp)
/* 3302E4 E001A4B4 C4C00004 */ lwc1 $f0, 0x4($a2)
/* 3302E8 E001A4B8 3C120001 */ lui $s2, (0x11630 >> 16)
/* 3302EC E001A4BC E7A00014 */ swc1 $f0, 0x14($sp)
/* 3302F0 E001A4C0 C4C00008 */ lwc1 $f0, 0x8($a2)
/* 3302F4 E001A4C4 36521630 */ ori $s2, $s2, (0x11630 & 0xFFFF)
/* 3302F8 E001A4C8 E7A00018 */ swc1 $f0, 0x18($sp)
/* 3302FC E001A4CC C4C0000C */ lwc1 $f0, 0xC($a2)
/* 330300 E001A4D0 0000382D */ daddu $a3, $zero, $zero
/* 330304 E001A4D4 AE830000 */ sw $v1, 0x0($s4)
/* 330308 E001A4D8 E7A0001C */ swc1 $f0, 0x1C($sp)
/* 33030C E001A4DC 8CC50024 */ lw $a1, 0x24($a2)
/* 330310 E001A4E0 8CC60028 */ lw $a2, 0x28($a2)
/* 330314 E001A4E4 24630008 */ addiu $v1, $v1, 0x8
/* 330318 E001A4E8 0C080180 */ jal shim_guPositionF
/* 33031C E001A4EC AE830000 */ sw $v1, 0x0($s4)
/* 330320 E001A4F0 27A40020 */ addiu $a0, $sp, 0x20
/* 330324 E001A4F4 3C108007 */ lui $s0, %hi(gMatrixListPos)
/* 330328 E001A4F8 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos)
/* 33032C E001A4FC 3C11800A */ lui $s1, %hi(gDisplayContext)
/* 330330 E001A500 2631A674 */ addiu $s1, $s1, %lo(gDisplayContext)
/* 330334 E001A504 96050000 */ lhu $a1, 0x0($s0)
/* 330338 E001A508 8E220000 */ lw $v0, 0x0($s1)
/* 33033C E001A50C 00052980 */ sll $a1, $a1, 6
/* 330340 E001A510 00B22821 */ addu $a1, $a1, $s2
/* 330344 E001A514 0C080118 */ jal shim_guMtxF2L
/* 330348 E001A518 00452821 */ addu $a1, $v0, $a1
/* 33034C E001A51C 8E820000 */ lw $v0, 0x0($s4)
/* 330350 E001A520 241300FF */ addiu $s3, $zero, 0xFF
/* 330354 E001A524 A3B300A1 */ sb $s3, 0xA1($sp)
/* 330358 E001A528 0040282D */ daddu $a1, $v0, $zero
/* 33035C E001A52C 24420008 */ addiu $v0, $v0, 0x8
/* 330360 E001A530 AE820000 */ sw $v0, 0x0($s4)
/* 330364 E001A534 96020000 */ lhu $v0, 0x0($s0)
/* 330368 E001A538 3C03DA38 */ lui $v1, (0xDA380000 >> 16)
/* 33036C E001A53C ACA30000 */ sw $v1, 0x0($a1)
/* 330370 E001A540 24430001 */ addiu $v1, $v0, 0x1
/* 330374 E001A544 3042FFFF */ andi $v0, $v0, 0xFFFF
/* 330378 E001A548 00021180 */ sll $v0, $v0, 6
/* 33037C E001A54C 00521021 */ addu $v0, $v0, $s2
/* 330380 E001A550 A6030000 */ sh $v1, 0x0($s0)
/* 330384 E001A554 8E230000 */ lw $v1, 0x0($s1)
/* 330388 E001A558 3C048015 */ lui $a0, %hi(gBackgroundFogModePtr)
/* 33038C E001A55C 8C8412F0 */ lw $a0, %lo(gBackgroundFogModePtr)($a0)
/* 330390 E001A560 00621821 */ addu $v1, $v1, $v0
/* 330394 E001A564 ACA30004 */ sw $v1, 0x4($a1)
/* 330398 E001A568 90830000 */ lbu $v1, 0x0($a0)
/* 33039C E001A56C 24020001 */ addiu $v0, $zero, 0x1
/* 3303A0 E001A570 14620007 */ bne $v1, $v0, .LE001A590
/* 3303A4 E001A574 27A400A0 */ addiu $a0, $sp, 0xA0
/* 3303A8 E001A578 0080282D */ daddu $a1, $a0, $zero
/* 3303AC E001A57C 0080302D */ daddu $a2, $a0, $zero
/* 3303B0 E001A580 0C08019C */ jal shim_get_background_color_blend
/* 3303B4 E001A584 27A700A1 */ addiu $a3, $sp, 0xA1
/* 3303B8 E001A588 93A200A1 */ lbu $v0, 0xA1($sp)
/* 3303BC E001A58C 02629823 */ subu $s3, $s3, $v0
.LE001A590:
/* 3303C0 E001A590 12600016 */ beqz $s3, .LE001A5EC
/* 3303C4 E001A594 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* 3303C8 E001A598 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* 3303CC E001A59C 8E830000 */ lw $v1, 0x0($s4)
/* 3303D0 E001A5A0 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 3303D4 E001A5A4 0060202D */ daddu $a0, $v1, $zero
/* 3303D8 E001A5A8 24630008 */ addiu $v1, $v1, 0x8
/* 3303DC E001A5AC AE830000 */ sw $v1, 0x0($s4)
/* 3303E0 E001A5B0 AC820000 */ sw $v0, 0x0($a0)
/* 3303E4 E001A5B4 326200FF */ andi $v0, $s3, 0xFF
/* 3303E8 E001A5B8 AC820004 */ sw $v0, 0x4($a0)
/* 3303EC E001A5BC 24620008 */ addiu $v0, $v1, 0x8
/* 3303F0 E001A5C0 AE820000 */ sw $v0, 0x0($s4)
/* 3303F4 E001A5C4 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3303F8 E001A5C8 AC620000 */ sw $v0, 0x0($v1)
/* 3303FC E001A5CC 3C020900 */ lui $v0, %hi(D_090002F0_415350)
/* 330400 E001A5D0 244202F0 */ addiu $v0, $v0, %lo(D_090002F0_415350)
/* 330404 E001A5D4 AC620004 */ sw $v0, 0x4($v1)
/* 330408 E001A5D8 24620010 */ addiu $v0, $v1, 0x10
/* 33040C E001A5DC AE820000 */ sw $v0, 0x0($s4)
/* 330410 E001A5E0 24020040 */ addiu $v0, $zero, 0x40
/* 330414 E001A5E4 AC650008 */ sw $a1, 0x8($v1)
/* 330418 E001A5E8 AC62000C */ sw $v0, 0xC($v1)
.LE001A5EC:
/* 33041C E001A5EC 8FBF00BC */ lw $ra, 0xBC($sp)
/* 330420 E001A5F0 8FB400B8 */ lw $s4, 0xB8($sp)
/* 330424 E001A5F4 8FB300B4 */ lw $s3, 0xB4($sp)
/* 330428 E001A5F8 8FB200B0 */ lw $s2, 0xB0($sp)
/* 33042C E001A5FC 8FB100AC */ lw $s1, 0xAC($sp)
/* 330430 E001A600 8FB000A8 */ lw $s0, 0xA8($sp)
/* 330434 E001A604 03E00008 */ jr $ra
/* 330438 E001A608 27BD00C0 */ addiu $sp, $sp, 0xC0
/* 33043C E001A60C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void floating_flower_appendGfx(void* effect) {
Matrix4f mtxTransform, mtxUnused;
EffectInstance* effectTemp = effect;
FloatingFlowerFXData* part = effectTemp->data.floatingFlower;
u32 alpha;
u8 rgb, a;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
shim_guPositionF(mtxTransform, part->rot.x, part->rot.y, 0.0f, 1.0f, part->pos.x, part->pos.y, part->pos.z);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
a = alpha = 255;
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (*gBackgroundFogModePtr == FOG_MODE_1) {
shim_get_background_color_blend(&rgb, &rgb, &rgb, &a);
alpha -= a;
}
if (alpha != 0) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
gSPDisplayList(gMainGfxPos++, D_090002F0_330750);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel play_hit_sound
/* 1A58E4 80277004 44850000 */ mtc1 $a1, $f0
/* 1A58E8 80277008 44861000 */ mtc1 $a2, $f2
/* 1A58EC 8027700C 44872000 */ mtc1 $a3, $f4
/* 1A58F0 80277010 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1A58F4 80277014 AFBF0018 */ sw $ra, 0x18($sp)
/* 1A58F8 80277018 94820192 */ lhu $v0, 0x192($a0)
/* 1A58FC 8027701C 8FA40030 */ lw $a0, 0x30($sp)
/* 1A5900 80277020 30430700 */ andi $v1, $v0, 0x700
/* 1A5904 80277024 2C820006 */ sltiu $v0, $a0, 0x6
/* 1A5908 80277028 1040004A */ beqz $v0, .L80277154
/* 1A590C 8027702C 00041080 */ sll $v0, $a0, 2
/* 1A5910 80277030 3C01802A */ lui $at, %hi(jtbl_8029D990)
/* 1A5914 80277034 00220821 */ addu $at, $at, $v0
/* 1A5918 80277038 8C22D990 */ lw $v0, %lo(jtbl_8029D990)($at)
/* 1A591C 8027703C 00400008 */ jr $v0
/* 1A5920 80277040 00000000 */ nop
glabel .L80277044
/* 1A5924 80277044 0809DC50 */ j .L80277140
/* 1A5928 80277048 2404010C */ addiu $a0, $zero, 0x10C
glabel .L8027704C
/* 1A592C 8027704C 0809DC50 */ j .L80277140
/* 1A5930 80277050 2404010D */ addiu $a0, $zero, 0x10D
glabel .L80277054
/* 1A5934 80277054 24020100 */ addiu $v0, $zero, 0x100
/* 1A5938 80277058 1062000B */ beq $v1, $v0, .L80277088
/* 1A593C 8027705C 28620101 */ slti $v0, $v1, 0x101
/* 1A5940 80277060 50400005 */ beql $v0, $zero, .L80277078
/* 1A5944 80277064 24020200 */ addiu $v0, $zero, 0x200
/* 1A5948 80277068 10600035 */ beqz $v1, .L80277140
/* 1A594C 8027706C 240400E1 */ addiu $a0, $zero, 0xE1
/* 1A5950 80277070 0809DC55 */ j .L80277154
/* 1A5954 80277074 00000000 */ nop
.L80277078:
/* 1A5958 80277078 10620031 */ beq $v1, $v0, .L80277140
/* 1A595C 8027707C 240400E9 */ addiu $a0, $zero, 0xE9
/* 1A5960 80277080 0809DC55 */ j .L80277154
/* 1A5964 80277084 00000000 */ nop
.L80277088:
/* 1A5968 80277088 0809DC50 */ j .L80277140
/* 1A596C 8027708C 240400E9 */ addiu $a0, $zero, 0xE9
glabel .L80277090
/* 1A5970 80277090 24020100 */ addiu $v0, $zero, 0x100
/* 1A5974 80277094 1062000B */ beq $v1, $v0, .L802770C4
/* 1A5978 80277098 28620101 */ slti $v0, $v1, 0x101
/* 1A597C 8027709C 50400005 */ beql $v0, $zero, .L802770B4
/* 1A5980 802770A0 24020200 */ addiu $v0, $zero, 0x200
/* 1A5984 802770A4 10600026 */ beqz $v1, .L80277140
/* 1A5988 802770A8 240400E2 */ addiu $a0, $zero, 0xE2
/* 1A598C 802770AC 0809DC55 */ j .L80277154
/* 1A5990 802770B0 00000000 */ nop
.L802770B4:
/* 1A5994 802770B4 10620022 */ beq $v1, $v0, .L80277140
/* 1A5998 802770B8 240400EA */ addiu $a0, $zero, 0xEA
/* 1A599C 802770BC 0809DC55 */ j .L80277154
/* 1A59A0 802770C0 00000000 */ nop
.L802770C4:
/* 1A59A4 802770C4 0809DC50 */ j .L80277140
/* 1A59A8 802770C8 240400EA */ addiu $a0, $zero, 0xEA
glabel .L802770CC
/* 1A59AC 802770CC 24020100 */ addiu $v0, $zero, 0x100
/* 1A59B0 802770D0 1062000B */ beq $v1, $v0, .L80277100
/* 1A59B4 802770D4 28620101 */ slti $v0, $v1, 0x101
/* 1A59B8 802770D8 50400005 */ beql $v0, $zero, .L802770F0
/* 1A59BC 802770DC 24020200 */ addiu $v0, $zero, 0x200
/* 1A59C0 802770E0 10600017 */ beqz $v1, .L80277140
/* 1A59C4 802770E4 240400E3 */ addiu $a0, $zero, 0xE3
/* 1A59C8 802770E8 0809DC55 */ j .L80277154
/* 1A59CC 802770EC 00000000 */ nop
.L802770F0:
/* 1A59D0 802770F0 10620013 */ beq $v1, $v0, .L80277140
/* 1A59D4 802770F4 240400EB */ addiu $a0, $zero, 0xEB
/* 1A59D8 802770F8 0809DC55 */ j .L80277154
/* 1A59DC 802770FC 00000000 */ nop
.L80277100:
/* 1A59E0 80277100 0809DC50 */ j .L80277140
/* 1A59E4 80277104 240400EB */ addiu $a0, $zero, 0xEB
glabel .L80277108
/* 1A59E8 80277108 24020100 */ addiu $v0, $zero, 0x100
/* 1A59EC 8027710C 1062000B */ beq $v1, $v0, .L8027713C
/* 1A59F0 80277110 28620101 */ slti $v0, $v1, 0x101
/* 1A59F4 80277114 50400005 */ beql $v0, $zero, .L8027712C
/* 1A59F8 80277118 24020200 */ addiu $v0, $zero, 0x200
/* 1A59FC 8027711C 10600008 */ beqz $v1, .L80277140
/* 1A5A00 80277120 2404037A */ addiu $a0, $zero, 0x37A
/* 1A5A04 80277124 0809DC55 */ j .L80277154
/* 1A5A08 80277128 00000000 */ nop
.L8027712C:
/* 1A5A0C 8027712C 10620004 */ beq $v1, $v0, .L80277140
/* 1A5A10 80277130 2404037B */ addiu $a0, $zero, 0x37B
/* 1A5A14 80277134 0809DC55 */ j .L80277154
/* 1A5A18 80277138 00000000 */ nop
.L8027713C:
/* 1A5A1C 8027713C 2404037B */ addiu $a0, $zero, 0x37B
.L80277140:
/* 1A5A20 80277140 44060000 */ mfc1 $a2, $f0
/* 1A5A24 80277144 44071000 */ mfc1 $a3, $f2
/* 1A5A28 80277148 0000282D */ daddu $a1, $zero, $zero
/* 1A5A2C 8027714C 0C052757 */ jal sfx_play_sound_at_position
/* 1A5A30 80277150 E7A40010 */ swc1 $f4, 0x10($sp)
.L80277154:
/* 1A5A34 80277154 8FBF0018 */ lw $ra, 0x18($sp)
/* 1A5A38 80277158 03E00008 */ jr $ra
/* 1A5A3C 8027715C 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void play_hit_sound(Actor* actor, f32 x, f32 y, f32 z, u32 hitSound) {
s32 actorClass = actor->actorID & ACTOR_CLASS_MASK;
switch (hitSound) {
case HIT_SOUND_MISS:
sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, x, y, z);
break;
case HIT_SOUND_BONES:
sfx_play_sound_at_position(SOUND_HIT_BONES, SOUND_SPACE_MODE_0, x, y, z);
break;
case HIT_SOUND_NORMAL:
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_PARTNER:
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_ENEMY:
sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, x, y, z);
break;
}
break;
case HIT_SOUND_FIRE:
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_PARTNER:
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_ENEMY:
sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, x, y, z);
break;
}
break;
case HIT_SOUND_ICE:
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
sfx_play_sound_at_position(SOUND_HIT_PLAYER_ICE, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_PARTNER:
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_ENEMY:
sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, x, y, z);
break;
}
break;
case HIT_SOUND_SHOCK:
switch (actorClass) {
case ACTOR_CLASS_PLAYER:
sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_PARTNER:
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, x, y, z);
break;
case ACTOR_CLASS_ENEMY:
sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, x, y, z);
break;
}
break;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel render_player_model
/* 7A618 800E1168 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 7A61C 800E116C AFB10044 */ sw $s1, 0x44($sp)
/* 7A620 800E1170 AFB00040 */ sw $s0, 0x40($sp)
/* 7A624 800E1174 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* 7A628 800E1178 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* 7A62C 800E117C AFBF0048 */ sw $ra, 0x48($sp)
/* 7A630 800E1180 8E030000 */ lw $v1, 0x0($s0)
/* 7A634 800E1184 3C024000 */ lui $v0, (0x40000000 >> 16)
/* 7A638 800E1188 00621024 */ and $v0, $v1, $v0
/* 7A63C 800E118C 10400054 */ beqz $v0, .L800E12E0
/* 7A640 800E1190 27B10020 */ addiu $s1, $sp, 0x20
/* 7A644 800E1194 3C02BFFF */ lui $v0, (0xBFFFFFFF >> 16)
/* 7A648 800E1198 3442FFFF */ ori $v0, $v0, (0xBFFFFFFF & 0xFFFF)
/* 7A64C 800E119C 8E050028 */ lw $a1, 0x28($s0)
/* 7A650 800E11A0 8E06002C */ lw $a2, 0x2C($s0)
/* 7A654 800E11A4 8E070030 */ lw $a3, 0x30($s0)
/* 7A658 800E11A8 3C04800A */ lui $a0, %hi(gCurrentCamID)
/* 7A65C 800E11AC 8484A634 */ lh $a0, %lo(gCurrentCamID)($a0)
/* 7A660 800E11B0 00621024 */ and $v0, $v1, $v0
/* 7A664 800E11B4 AE020000 */ sw $v0, 0x0($s0)
/* 7A668 800E11B8 27A20030 */ addiu $v0, $sp, 0x30
/* 7A66C 800E11BC AFA20010 */ sw $v0, 0x10($sp)
/* 7A670 800E11C0 27A20034 */ addiu $v0, $sp, 0x34
/* 7A674 800E11C4 AFA20014 */ sw $v0, 0x14($sp)
/* 7A678 800E11C8 27A20038 */ addiu $v0, $sp, 0x38
/* 7A67C 800E11CC 0C00B94E */ jal get_screen_coords
/* 7A680 800E11D0 AFA20018 */ sw $v0, 0x18($sp)
/* 7A684 800E11D4 8E020000 */ lw $v0, 0x0($s0)
/* 7A688 800E11D8 3C030002 */ lui $v1, (0x20000 >> 16)
/* 7A68C 800E11DC 00431024 */ and $v0, $v0, $v1
/* 7A690 800E11E0 14400026 */ bnez $v0, .L800E127C
/* 7A694 800E11E4 24020011 */ addiu $v0, $zero, 0x11
/* 7A698 800E11E8 9203000E */ lbu $v1, 0xE($s0)
/* 7A69C 800E11EC 9202000F */ lbu $v0, 0xF($s0)
/* 7A6A0 800E11F0 1062001F */ beq $v1, $v0, .L800E1270
/* 7A6A4 800E11F4 2C6200FE */ sltiu $v0, $v1, 0xFE
/* 7A6A8 800E11F8 10400011 */ beqz $v0, .L800E1240
/* 7A6AC 800E11FC 3C030100 */ lui $v1, (0x1000000 >> 16)
/* 7A6B0 800E1200 8E020004 */ lw $v0, 0x4($s0)
/* 7A6B4 800E1204 00431024 */ and $v0, $v0, $v1
/* 7A6B8 800E1208 14400002 */ bnez $v0, .L800E1214
/* 7A6BC 800E120C 24080016 */ addiu $t0, $zero, 0x16
/* 7A6C0 800E1210 24080011 */ addiu $t0, $zero, 0x11
.L800E1214:
/* 7A6C4 800E1214 0000202D */ daddu $a0, $zero, $zero
/* 7A6C8 800E1218 2405FFFF */ addiu $a1, $zero, -0x1
/* 7A6CC 800E121C 24060007 */ addiu $a2, $zero, 0x7
/* 7A6D0 800E1220 9202000E */ lbu $v0, 0xE($s0)
/* 7A6D4 800E1224 0080382D */ daddu $a3, $a0, $zero
/* 7A6D8 800E1228 A20800BE */ sb $t0, 0xBE($s0)
/* 7A6DC 800E122C AFA00010 */ sw $zero, 0x10($sp)
/* 7A6E0 800E1230 AFA00014 */ sw $zero, 0x14($sp)
/* 7A6E4 800E1234 AFA0001C */ sw $zero, 0x1C($sp)
/* 7A6E8 800E1238 0803849A */ j .L800E1268
/* 7A6EC 800E123C AFA20018 */ sw $v0, 0x18($sp)
.L800E1240:
/* 7A6F0 800E1240 0000202D */ daddu $a0, $zero, $zero
/* 7A6F4 800E1244 2405FFFF */ addiu $a1, $zero, -0x1
/* 7A6F8 800E1248 0080302D */ daddu $a2, $a0, $zero
/* 7A6FC 800E124C 0080382D */ daddu $a3, $a0, $zero
/* 7A700 800E1250 2402000D */ addiu $v0, $zero, 0xD
/* 7A704 800E1254 A20200BE */ sb $v0, 0xBE($s0)
/* 7A708 800E1258 AFA00010 */ sw $zero, 0x10($sp)
/* 7A70C 800E125C AFA00014 */ sw $zero, 0x14($sp)
/* 7A710 800E1260 AFA00018 */ sw $zero, 0x18($sp)
/* 7A714 800E1264 AFA0001C */ sw $zero, 0x1C($sp)
.L800E1268:
/* 7A718 800E1268 0C0B77B9 */ jal set_player_imgfx_comp
/* 7A71C 800E126C 00000000 */ nop
.L800E1270:
/* 7A720 800E1270 9202000E */ lbu $v0, 0xE($s0)
/* 7A724 800E1274 080384A1 */ j .L800E1284
/* 7A728 800E1278 A202000F */ sb $v0, 0xF($s0)
.L800E127C:
/* 7A72C 800E127C A20200BE */ sb $v0, 0xBE($s0)
/* 7A730 800E1280 A200000F */ sb $zero, 0xF($s0)
.L800E1284:
/* 7A734 800E1284 8E020004 */ lw $v0, 0x4($s0)
/* 7A738 800E1288 30422000 */ andi $v0, $v0, 0x2000
/* 7A73C 800E128C 14400012 */ bnez $v0, .L800E12D8
/* 7A740 800E1290 3C030002 */ lui $v1, (0x20000 >> 16)
/* 7A744 800E1294 8FA20038 */ lw $v0, 0x38($sp)
/* 7A748 800E1298 AE300008 */ sw $s0, 0x8($s1)
/* 7A74C 800E129C 00021023 */ negu $v0, $v0
/* 7A750 800E12A0 AE220004 */ sw $v0, 0x4($s1)
/* 7A754 800E12A4 820200BE */ lb $v0, 0xBE($s0)
/* 7A758 800E12A8 3C04800E */ lui $a0, %hi(appendGfx_player_spin)
/* 7A75C 800E12AC 24841704 */ addiu $a0, $a0, %lo(appendGfx_player_spin)
/* 7A760 800E12B0 AE220000 */ sw $v0, 0x0($s1)
/* 7A764 800E12B4 8E020000 */ lw $v0, 0x0($s0)
/* 7A768 800E12B8 00431024 */ and $v0, $v0, $v1
/* 7A76C 800E12BC 54400004 */ bnel $v0, $zero, .L800E12D0
/* 7A770 800E12C0 AE24000C */ sw $a0, 0xC($s1)
/* 7A774 800E12C4 3C04800E */ lui $a0, %hi(appendGfx_player)
/* 7A778 800E12C8 248412F4 */ addiu $a0, $a0, %lo(appendGfx_player)
/* 7A77C 800E12CC AE24000C */ sw $a0, 0xC($s1)
.L800E12D0:
/* 7A780 800E12D0 0C047644 */ jal queue_render_task
/* 7A784 800E12D4 0220202D */ daddu $a0, $s1, $zero
.L800E12D8:
/* 7A788 800E12D8 0C03C327 */ jal func_800F0C9C
/* 7A78C 800E12DC 00000000 */ nop
.L800E12E0:
/* 7A790 800E12E0 8FBF0048 */ lw $ra, 0x48($sp)
/* 7A794 800E12E4 8FB10044 */ lw $s1, 0x44($sp)
/* 7A798 800E12E8 8FB00040 */ lw $s0, 0x40($sp)
/* 7A79C 800E12EC 03E00008 */ jr $ra
/* 7A7A0 800E12F0 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
void render_player_model(void) {
RenderTask task;
RenderTask* rtPtr = &task;
PlayerStatus* playerStatus = &gPlayerStatus;
s32 x, y, z;
s8 renderModeTemp;
void (*appendGfx)(void*);
if (playerStatus->flags & PS_FLAG_SPRITE_REDRAW) {
playerStatus->flags &= ~PS_FLAG_SPRITE_REDRAW;
get_screen_coords(gCurrentCamID, playerStatus->position.x, playerStatus->position.y,
playerStatus->position.z, &x, &y, &z);
if (!(playerStatus->flags & PS_FLAG_SPINNING)) {
if (playerStatus->alpha1 != playerStatus->alpha2) {
if (playerStatus->alpha1 < 254) {
if (!(playerStatus->animFlags & PA_FLAG_MAP_HAS_SWITCH)) {
renderModeTemp = RENDER_MODE_SURFACE_XLU_LAYER1;
} else {
renderModeTemp = RENDER_MODE_SURFACE_XLU_LAYER2;
}
playerStatus->renderMode = renderModeTemp;
set_player_imgfx_comp(PLAYER_SPRITE_MAIN, -1, IMGFX_SET_ALPHA, 0, 0, 0, playerStatus->alpha1, 0);
} else {
playerStatus->renderMode = RENDER_MODE_ALPHATEST;
set_player_imgfx_comp(PLAYER_SPRITE_MAIN, -1, IMGFX_CLEAR, 0, 0, 0, 0, 0);
}
}
playerStatus->alpha2 = playerStatus->alpha1;
} else {
playerStatus->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1;
playerStatus->alpha2 = 0;
}
if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) {
rtPtr->appendGfxArg = playerStatus;
rtPtr->distance = -z;
rtPtr->renderMode = playerStatus->renderMode;
if (!(playerStatus->flags & PS_FLAG_SPINNING)) {
appendGfx = appendGfx_player;
} else {
appendGfx = appendGfx_player_spin;
}
rtPtr->appendGfx = appendGfx;
queue_render_task(rtPtr);
}
func_800F0C9C();
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80242D04
/* 136044 80242D04 27BDFFD8 */ addiu $sp, $sp, -0x28
.L80242D08:
/* 136048 80242D08 AFB20018 */ sw $s2, 0x18($sp)
glabel func_80242D0C
/* 13604C 80242D0C 00A0902D */ daddu $s2, $a1, $zero
/* 136050 80242D10 AFB3001C */ sw $s3, 0x1C($sp)
glabel func_80242D14
/* 136054 80242D14 00C0982D */ daddu $s3, $a2, $zero
.L80242D18:
/* 136058 80242D18 AFB40020 */ sw $s4, 0x20($sp)
glabel func_80242D1C
/* 13605C 80242D1C 3C148016 */ lui $s4, %hi(gWindows)
glabel func_80242D20
/* 136060 80242D20 26949D50 */ addiu $s4, $s4, %lo(gWindows)
.L80242D24:
/* 136064 80242D24 00042140 */ sll $a0, $a0, 5
glabel func_80242D28
/* 136068 80242D28 AFB10014 */ sw $s1, 0x14($sp)
glabel func_80242D2C
/* 13606C 80242D2C 3C118025 */ lui $s1, %hi(D_8024EFB4)
.L80242D30:
/* 136070 80242D30 2631EFB4 */ addiu $s1, $s1, %lo(D_8024EFB4)
D_80242D34:
/* 136074 80242D34 AFBF0024 */ sw $ra, 0x24($sp)
glabel func_80242D38
/* 136078 80242D38 AFB00010 */ sw $s0, 0x10($sp)
glabel func_80242D3C
/* 13607C 80242D3C 8E220000 */ lw $v0, 0x0($s1)
D_80242D40:
/* 136080 80242D40 14400012 */ bnez $v0, func_80242D8C
.L80242D44:
/* 136084 80242D44 00948021 */ addu $s0, $a0, $s4
glabel func_80242D48
/* 136088 80242D48 0C00CD4A */ jal get_game_mode
glabel func_80242D4C
/* 13608C 80242D4C 00000000 */ nop
D_80242D50:
/* 136090 80242D50 00021400 */ sll $v0, $v0, 16
glabel .L80242D54
/* 136094 80242D54 00021403 */ sra $v0, $v0, 16
glabel func_80242D58
/* 136098 80242D58 2403000F */ addiu $v1, $zero, 0xF
.L80242D5C:
/* 13609C 80242D5C 10430008 */ beq $v0, $v1, D_80242D80
D_80242D60:
/* 1360A0 80242D60 00000000 */ nop
glabel func_80242D64
/* 1360A4 80242D64 0C00CD4A */ jal get_game_mode
.L80242D68:
/* 1360A8 80242D68 00000000 */ nop
.L80242D6C:
/* 1360AC 80242D6C 00021400 */ sll $v0, $v0, 16
D_80242D70:
/* 1360B0 80242D70 00021403 */ sra $v0, $v0, 16
.L80242D74:
/* 1360B4 80242D74 2403000D */ addiu $v1, $zero, 0xD
.L80242D78:
/* 1360B8 80242D78 14430024 */ bne $v0, $v1, func_80242E0C
.L80242D7C:
/* 1360BC 80242D7C 00000000 */ nop
D_80242D80:
/* 1360C0 80242D80 8E220000 */ lw $v0, 0x0($s1)
.L80242D84:
/* 1360C4 80242D84 10400018 */ beqz $v0, func_80242DE8
.L80242D88:
/* 1360C8 80242D88 00000000 */ nop
glabel func_80242D8C
/* 1360CC 80242D8C 24040016 */ addiu $a0, $zero, 0x16
glabel func_80242D90
/* 1360D0 80242D90 2406FFFF */ addiu $a2, $zero, -0x1
glabel func_80242D94
/* 1360D4 80242D94 0080282D */ daddu $a1, $a0, $zero
glabel func_80242D98
/* 1360D8 80242D98 3C038016 */ lui $v1, %hi(D_8015A010)
.L80242D9C:
/* 1360DC 80242D9C 2463A010 */ addiu $v1, $v1, %lo(D_8015A010)
.L80242DA0:
/* 1360E0 80242DA0 80620003 */ lb $v0, 0x3($v1)
.L80242DA4:
/* 1360E4 80242DA4 10460003 */ beq $v0, $a2, .L80242DB4
glabel dead_kzn_17_LetterDelivery_RestoreNpcAnim
/* 1360E8 80242DA8 00000000 */ nop
D_80242DAC:
/* 1360EC 80242DAC 54450006 */ bnel $v0, $a1, D_80242DC8
glabel func_80242DB0
/* 1360F0 80242DB0 24840001 */ addiu $a0, $a0, 0x1
.L80242DB4:
/* 1360F4 80242DB4 90620000 */ lbu $v0, 0x0($v1)
glabel func_80242DB8
/* 1360F8 80242DB8 30420008 */ andi $v0, $v0, 0x8
glabel func_80242DBC
/* 1360FC 80242DBC 14400006 */ bnez $v0, func_80242DD8
.L80242DC0:
/* 136100 80242DC0 2882002C */ slti $v0, $a0, 0x2C
D_80242DC4:
/* 136104 80242DC4 24840001 */ addiu $a0, $a0, 0x1
D_80242DC8:
/* 136108 80242DC8 2882002C */ slti $v0, $a0, 0x2C
.L80242DCC:
/* 13610C 80242DCC 1440FFF4 */ bnez $v0, .L80242DA0
.L80242DD0:
/* 136110 80242DD0 24630020 */ addiu $v1, $v1, 0x20
/* 136114 80242DD4 2882002C */ slti $v0, $a0, 0x2C
glabel func_80242DD8
/* 136118 80242DD8 14400003 */ bnez $v0, func_80242DE8
.L80242DDC:
/* 13611C 80242DDC 00000000 */ nop
glabel func_80242DE0
/* 136120 80242DE0 3C018025 */ lui $at, %hi(D_8024EFB4)
glabel func_80242DE4
/* 136124 80242DE4 AC20EFB4 */ sw $zero, %lo(D_8024EFB4)($at)
glabel func_80242DE8
/* 136128 80242DE8 3C018025 */ lui $at, %hi(dro_02_8024EFA8)
glabel func_80242DEC
/* 13612C 80242DEC AC32EFA8 */ sw $s2, %lo(dro_02_8024EFA8)($at)
glabel func_80242DF0
/* 136130 80242DF0 3C018025 */ lui $at, %hi(D_8024EF9C)
.L80242DF4:
/* 136134 80242DF4 AC32EF9C */ sw $s2, %lo(D_8024EF9C)($at)
.L80242DF8:
/* 136138 80242DF8 3C018025 */ lui $at, %hi(dro_02_pad_D_8024EFAC)
.L80242DFC:
/* 13613C 80242DFC AC33EFAC */ sw $s3, %lo(dro_02_pad_D_8024EFAC)($at)
glabel dead_kzn_17_GetActingPartner
/* 136140 80242E00 3C018025 */ lui $at, %hi(dro_02_Quizmo_Worker)
.L80242E04:
/* 136144 80242E04 08090B93 */ j .L80242E4C
.L80242E08:
/* 136148 80242E08 AC33EFA0 */ sw $s3, %lo(dro_02_Quizmo_Worker)($at)
glabel func_80242E0C
/* 13614C 80242E0C 92020000 */ lbu $v0, 0x0($s0)
.L80242E10:
/* 136150 80242E10 30420008 */ andi $v0, $v0, 0x8
glabel func_80242E14
/* 136154 80242E14 1440000D */ bnez $v0, .L80242E4C
.L80242E18:
/* 136158 80242E18 2402FFFF */ addiu $v0, $zero, -0x1
.L80242E1C:
/* 13615C 80242E1C 82040003 */ lb $a0, 0x3($s0)
glabel func_80242E20
/* 136160 80242E20 10820006 */ beq $a0, $v0, .L80242E3C
.L80242E24:
/* 136164 80242E24 00041140 */ sll $v0, $a0, 5
D_80242E28:
/* 136168 80242E28 00541021 */ addu $v0, $v0, $s4
glabel dead_kzn_17_UnkFunc46
/* 13616C 80242E2C 90420000 */ lbu $v0, 0x0($v0)
/* 136170 80242E30 30420008 */ andi $v0, $v0, 0x8
/* 136174 80242E34 14400005 */ bnez $v0, .L80242E4C
.L80242E38:
/* 136178 80242E38 00000000 */ nop
.L80242E3C:
/* 13617C 80242E3C 3C018025 */ lui $at, %hi(dro_02_8024EFA8)
.L80242E40:
/* 136180 80242E40 AC32EFA8 */ sw $s2, %lo(dro_02_8024EFA8)($at)
.L80242E44:
/* 136184 80242E44 3C018025 */ lui $at, %hi(dro_02_pad_D_8024EFAC)
.L80242E48:
/* 136188 80242E48 AC33EFAC */ sw $s3, %lo(dro_02_pad_D_8024EFAC)($at)
.L80242E4C:
/* 13618C 80242E4C 8FBF0024 */ lw $ra, 0x24($sp)
.L80242E50:
/* 136190 80242E50 8FB40020 */ lw $s4, 0x20($sp)
glabel func_80242E54
/* 136194 80242E54 8FB3001C */ lw $s3, 0x1C($sp)
.L80242E58:
/* 136198 80242E58 8FB20018 */ lw $s2, 0x18($sp)
.L80242E5C:
/* 13619C 80242E5C 8FB10014 */ lw $s1, 0x14($sp)
.L80242E60:
/* 1361A0 80242E60 8FB00010 */ lw $s0, 0x10($sp)
.L80242E64:
/* 1361A4 80242E64 03E00008 */ jr $ra
.L80242E68:
/* 1361A8 80242E68 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void pause_set_cursor_pos_immediate(s32 windowID, s32 posX, s32 posY) {
Window* window = &gWindows[windowID];
if (D_8024EFB4 != 0
|| get_game_mode() == GAME_MODE_END_FILE_SELECT
|| get_game_mode() == GAME_MODE_END_LANGUAGE_SELECT) {
if (D_8024EFB4 != 0) {
s32 i;
for (i = WINDOW_ID_PAUSE_MAIN; i < WINDOW_ID_PAUSE_CURSOR; i++) {
Window* window = &gWindows[i];
s8 parent = window->parent;
if ((parent == WINDOW_ID_NONE || parent == WINDOW_ID_PAUSE_MAIN) && (window->flags & WINDOW_FLAG_INITIAL_ANIMATION)) {
break;
}
}
if (i >= WINDOW_ID_PAUSE_CURSOR) {
D_8024EFB4 = 0;
}
}
gPauseCursorTargetPosX = posX;
gPauseCursorPosX = posX;
gPauseCursorTargetPosY = posY;
gPauseCursorPosY = posY;
} else if ((window->flags & WINDOW_FLAG_INITIAL_ANIMATION) == 0 && (window->parent == -1 || !(gWindows[window->parent].flags & WINDOW_FLAG_INITIAL_ANIMATION))) {
gPauseCursorTargetPosX = posX;
gPauseCursorPosX = posX;
gPauseCursorTargetPosY = posY;
gPauseCursorPosY = posY;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel action_command_draw
/* 1973D8 80268AF8 3C03802A */ lui $v1, %hi(D_8029FC2A)
/* 1973DC 80268AFC 8463FC2A */ lh $v1, %lo(D_8029FC2A)($v1)
/* 1973E0 80268B00 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1973E4 80268B04 2C620018 */ sltiu $v0, $v1, 0x18
/* 1973E8 80268B08 10400061 */ beqz $v0, .L80268C90
/* 1973EC 80268B0C AFBF0010 */ sw $ra, 0x10($sp)
/* 1973F0 80268B10 00031080 */ sll $v0, $v1, 2
/* 1973F4 80268B14 3C01802A */ lui $at, %hi(jtbl_8029D700)
/* 1973F8 80268B18 00220821 */ addu $at, $at, $v0
/* 1973FC 80268B1C 8C22D700 */ lw $v0, %lo(jtbl_8029D700)($at)
/* 197400 80268B20 00400008 */ jr $v0
/* 197404 80268B24 00000000 */ nop
glabel .L80268B28
/* 197408 80268B28 0C0AA551 */ jal func_802A9544
/* 19740C 80268B2C 00000000 */ nop
/* 197410 80268B30 0809A324 */ j .L80268C90
/* 197414 80268B34 00000000 */ nop
glabel .L80268B38
/* 197418 80268B38 0C0AA675 */ jal func_802A99D4
/* 19741C 80268B3C 00000000 */ nop
/* 197420 80268B40 0809A324 */ j .L80268C90
/* 197424 80268B44 00000000 */ nop
glabel .L80268B48
/* 197428 80268B48 0C0AA5BD */ jal func_802A96F4
/* 19742C 80268B4C 00000000 */ nop
/* 197430 80268B50 0809A324 */ j .L80268C90
/* 197434 80268B54 00000000 */ nop
glabel .L80268B58
/* 197438 80268B58 0C0AA5AE */ jal func_802A96B8
/* 19743C 80268B5C 00000000 */ nop
/* 197440 80268B60 0809A324 */ j .L80268C90
/* 197444 80268B64 00000000 */ nop
glabel .L80268B68
/* 197448 80268B68 0C0AA5D1 */ jal func_802A9744
/* 19744C 80268B6C 00000000 */ nop
/* 197450 80268B70 0809A324 */ j .L80268C90
/* 197454 80268B74 00000000 */ nop
glabel .L80268B78
/* 197458 80268B78 0C0AA529 */ jal func_802A94A4
/* 19745C 80268B7C 00000000 */ nop
/* 197460 80268B80 0809A324 */ j .L80268C90
/* 197464 80268B84 00000000 */ nop
glabel .L80268B88
/* 197468 80268B88 0C0AA536 */ jal func_802A94D8
/* 19746C 80268B8C 00000000 */ nop
/* 197470 80268B90 0809A324 */ j .L80268C90
/* 197474 80268B94 00000000 */ nop
glabel .L80268B98
/* 197478 80268B98 0C0AA5B7 */ jal func_802A96DC
/* 19747C 80268B9C 00000000 */ nop
/* 197480 80268BA0 0809A324 */ j .L80268C90
/* 197484 80268BA4 00000000 */ nop
glabel .L80268BA8
/* 197488 80268BA8 0C0AA60D */ jal func_802A9834
/* 19748C 80268BAC 00000000 */ nop
/* 197490 80268BB0 0809A324 */ j .L80268C90
/* 197494 80268BB4 00000000 */ nop
glabel .L80268BB8
/* 197498 80268BB8 0C0AA557 */ jal func_802A955C
/* 19749C 80268BBC 00000000 */ nop
/* 1974A0 80268BC0 0809A324 */ j .L80268C90
/* 1974A4 80268BC4 00000000 */ nop
glabel .L80268BC8
/* 1974A8 80268BC8 0C0AA5BB */ jal func_802A96EC
/* 1974AC 80268BCC 00000000 */ nop
/* 1974B0 80268BD0 0809A324 */ j .L80268C90
/* 1974B4 80268BD4 00000000 */ nop
glabel .L80268BD8
/* 1974B8 80268BD8 0C0AA599 */ jal func_802A9664
/* 1974BC 80268BDC 00000000 */ nop
/* 1974C0 80268BE0 0809A324 */ j .L80268C90
/* 1974C4 80268BE4 00000000 */ nop
glabel .L80268BE8
/* 1974C8 80268BE8 0C0AA5BB */ jal func_802A96EC
/* 1974CC 80268BEC 00000000 */ nop
/* 1974D0 80268BF0 0809A324 */ j .L80268C90
/* 1974D4 80268BF4 00000000 */ nop
glabel .L80268BF8
/* 1974D8 80268BF8 0C0AA613 */ jal func_802A984C
/* 1974DC 80268BFC 00000000 */ nop
/* 1974E0 80268C00 0809A324 */ j .L80268C90
/* 1974E4 80268C04 00000000 */ nop
glabel .L80268C08
/* 1974E8 80268C08 0C0AA58D */ jal func_802A9634
/* 1974EC 80268C0C 00000000 */ nop
/* 1974F0 80268C10 0809A324 */ j .L80268C90
/* 1974F4 80268C14 00000000 */ nop
glabel .L80268C18
/* 1974F8 80268C18 0C0AA634 */ jal func_802A98D0
/* 1974FC 80268C1C 00000000 */ nop
/* 197500 80268C20 0809A324 */ j .L80268C90
/* 197504 80268C24 00000000 */ nop
glabel .L80268C28
/* 197508 80268C28 0C0AA5FE */ jal func_802A97F8
/* 19750C 80268C2C 00000000 */ nop
/* 197510 80268C30 0809A324 */ j .L80268C90
/* 197514 80268C34 00000000 */ nop
glabel .L80268C38
/* 197518 80268C38 0C0AA62C */ jal func_802A98B0_7B1250
/* 19751C 80268C3C 00000000 */ nop
/* 197520 80268C40 0809A324 */ j .L80268C90
/* 197524 80268C44 00000000 */ nop
glabel .L80268C48
/* 197528 80268C48 0C0AA5CF */ jal func_802A973C
/* 19752C 80268C4C 00000000 */ nop
/* 197530 80268C50 0809A324 */ j .L80268C90
/* 197534 80268C54 00000000 */ nop
glabel .L80268C58
/* 197538 80268C58 0C0AA5EB */ jal func_802A97AC
/* 19753C 80268C5C 00000000 */ nop
/* 197540 80268C60 0809A324 */ j .L80268C90
/* 197544 80268C64 00000000 */ nop
glabel .L80268C68
/* 197548 80268C68 0C0AA5FF */ jal func_802A97FC
/* 19754C 80268C6C 00000000 */ nop
/* 197550 80268C70 0809A324 */ j .L80268C90
/* 197554 80268C74 00000000 */ nop
glabel .L80268C78
/* 197558 80268C78 0C0AA805 */ jal func_802AA014
/* 19755C 80268C7C 00000000 */ nop
/* 197560 80268C80 0809A324 */ j .L80268C90
/* 197564 80268C84 00000000 */ nop
glabel .L80268C88
/* 197568 80268C88 0C0AA5C6 */ jal func_802A9718
/* 19756C 80268C8C 00000000 */ nop
glabel .L80268C90
/* 197570 80268C90 8FBF0010 */ lw $ra, 0x10($sp)
/* 197574 80268C94 03E00008 */ jr $ra
/* 197578 80268C98 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void action_command_draw(void) {
switch (gActionCommandStatus.actionCommandID) {
case ACTION_COMMAND_NONE:
break;
case ACTION_COMMAND_JUMP:
action_command_jump_draw();
break;
case ACTION_COMMAND_SMASH:
action_command_hammer_draw();
break;
case ACTION_COMMAND_FLEE:
action_command_flee_draw();
break;
case ACTION_COMMAND_BREAK_FREE:
action_command_break_free_draw();
break;
case ACTION_COMMAND_WHIRLWIND:
action_command_whirlwind_draw();
break;
case ACTION_COMMAND_STOP_LEECH:
action_command_stop_leech_draw();
break;
case ACTION_COMMAND_07:
action_command_07_draw();
break;
case ACTION_COMMAND_DIZZY_SHELL:
action_command_dizzy_shell_draw();
break;
case ACTION_COMMAND_FIRE_SHELL:
action_command_fire_shell_draw();
break;
case ACTION_COMMAND_0A:
action_command_0A_draw();
break;
case ACTION_COMMAND_BOMB:
action_command_bomb_draw();
break;
case ACTION_COMMAND_BODY_SLAM:
action_command_body_slam_draw();
break;
case ACTION_COMMAND_AIR_LIFT:
action_command_air_lift_draw();
break;
case ACTION_COMMAND_AIR_RAID:
action_command_air_raid_draw();
break;
case ACTION_COMMAND_SQUIRT:
action_command_squirt_draw();
break;
case ACTION_COMMAND_POWER_SHOCK:
action_command_power_shock_draw();
break;
case ACTION_COMMAND_MEGA_SHOCK:
action_command_mega_shock_draw();
break;
case ACTION_COMMAND_SMACK:
action_command_smack_draw();
break;
case ACTION_COMMAND_SPINY_SURGE:
action_command_spiny_surge_draw();
break;
case ACTION_COMMAND_HURRICANE:
action_command_hurricane_draw();
break;
case ACTION_COMMAND_SPOOK:
action_command_spook_draw();
break;
case ACTION_COMMAND_WATER_BLOCK:
action_command_water_block_draw();
break;
case ACTION_COMMAND_TIDAL_WAVE:
action_command_tidal_wave_draw();
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80243570
/* 1368B0 80243570 27BDFFC8 */ addiu $sp, $sp, -0x38
glabel func_80243574
/* 1368B4 80243574 AFB20020 */ sw $s2, 0x20($sp)
glabel func_80243578
/* 1368B8 80243578 3C128027 */ lui $s2, %hi(gPauseShownDescMsg)
.L8024357C:
/* 1368BC 8024357C 8E520108 */ lw $s2, %lo(gPauseShownDescMsg)($s2)
glabel func_80243580
/* 1368C0 80243580 AFB60030 */ sw $s6, 0x30($sp)
glabel func_80243584_EE1F44
/* 1368C4 80243584 8FB60048 */ lw $s6, 0x48($sp)
glabel func_80243588
/* 1368C8 80243588 AFB30024 */ sw $s3, 0x24($sp)
/* 1368CC 8024358C 00A0982D */ daddu $s3, $a1, $zero
glabel .L80243590
/* 1368D0 80243590 AFB40028 */ sw $s4, 0x28($sp)
.L80243594:
/* 1368D4 80243594 00C0A02D */ daddu $s4, $a2, $zero
glabel func_80243598
/* 1368D8 80243598 AFB5002C */ sw $s5, 0x2C($sp)
D_8024359C:
/* 1368DC 8024359C 00E0A82D */ daddu $s5, $a3, $zero
glabel func_802435A0
/* 1368E0 802435A0 AFBF0034 */ sw $ra, 0x34($sp)
/* 1368E4 802435A4 AFB1001C */ sw $s1, 0x1C($sp)
D_802435A8:
/* 1368E8 802435A8 12400088 */ beqz $s2, func_802437CC
/* 1368EC 802435AC AFB00018 */ sw $s0, 0x18($sp)
D_802435B0:
/* 1368F0 802435B0 3C118027 */ lui $s1, %hi(gPauseDescTextPos)
D_802435B4:
/* 1368F4 802435B4 26310110 */ addiu $s1, $s1, %lo(gPauseDescTextPos)
D_802435B8:
/* 1368F8 802435B8 8E220000 */ lw $v0, 0x0($s1)
.L802435BC:
/* 1368FC 802435BC 1040000B */ beqz $v0, D_802435EC
D_802435C0:
/* 136900 802435C0 02752821 */ addu $a1, $s3, $s5
glabel func_802435C4
/* 136904 802435C4 24A5FFFC */ addiu $a1, $a1, -0x4
D_802435C8:
/* 136908 802435C8 3C108027 */ lui $s0, %hi(gPauseCommonIconIDs)
glabel func_802435CC
/* 13690C 802435CC 261000E8 */ addiu $s0, $s0, %lo(gPauseCommonIconIDs)
D_802435D0:
/* 136910 802435D0 8E040004 */ lw $a0, 0x4($s0)
D_802435D4:
/* 136914 802435D4 0C051261 */ jal hud_element_set_render_pos
D_802435D8:
/* 136918 802435D8 26860004 */ addiu $a2, $s4, 0x4
/* 13691C 802435DC 8E040004 */ lw $a0, 0x4($s0)
D_802435E0:
/* 136920 802435E0 0C0511F8 */ jal hud_element_draw_without_clipping
D_802435E4:
/* 136924 802435E4 00000000 */ nop
D_802435E8:
/* 136928 802435E8 8E220000 */ lw $v0, 0x0($s1)
D_802435EC:
/* 13692C 802435EC 3C038027 */ lui $v1, %hi(gPauseDescTextMaxPos)
D_802435F0:
/* 136930 802435F0 8C63010C */ lw $v1, %lo(gPauseDescTextMaxPos)($v1)
/* 136934 802435F4 0043102A */ slt $v0, $v0, $v1
D_802435F8:
/* 136938 802435F8 1040000B */ beqz $v0, D_80243628
.L802435FC:
/* 13693C 802435FC 02752821 */ addu $a1, $s3, $s5
D_80243600:
/* 136940 80243600 24A5FFFC */ addiu $a1, $a1, -0x4
D_80243604:
/* 136944 80243604 3C108027 */ lui $s0, %hi(gPauseCommonIconIDs)
D_80243608:
/* 136948 80243608 261000E8 */ addiu $s0, $s0, %lo(gPauseCommonIconIDs)
D_8024360C:
/* 13694C 8024360C 02963021 */ addu $a2, $s4, $s6
glabel func_80243610
/* 136950 80243610 8E040008 */ lw $a0, 0x8($s0)
D_80243614:
/* 136954 80243614 0C051261 */ jal hud_element_set_render_pos
.L80243618:
/* 136958 80243618 24C6FFFC */ addiu $a2, $a2, -0x4
/* 13695C 8024361C 8E040008 */ lw $a0, 0x8($s0)
glabel .L80243620
/* 136960 80243620 0C0511F8 */ jal hud_element_draw_without_clipping
glabel func_80243624
/* 136964 80243624 00000000 */ nop
D_80243628:
/* 136968 80243628 0240202D */ daddu $a0, $s2, $zero
D_8024362C:
/* 13696C 8024362C 3C11800A */ lui $s1, %hi(gMainGfxPos)
/* 136970 80243630 2631A66C */ addiu $s1, $s1, %lo(gMainGfxPos)
.L80243634:
/* 136974 80243634 2665000A */ addiu $a1, $s3, 0xA
glabel .L80243638
/* 136978 80243638 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 13697C 8024363C 3C10ED00 */ lui $s0, (0xED000000 >> 16)
glabel func_80243640
/* 136980 80243640 8E280000 */ lw $t0, 0x0($s1)
D_80243644:
/* 136984 80243644 3C068027 */ lui $a2, %hi(gPauseDescTextOffset)
/* 136988 80243648 8CC60114 */ lw $a2, %lo(gPauseDescTextOffset)($a2)
.L8024364C:
/* 13698C 8024364C 3C014080 */ lui $at, (0x40800000 >> 16)
glabel func_80243650
/* 136990 80243650 44812000 */ mtc1 $at, $f4
arn_04_pad_3654:
/* 136994 80243654 0100182D */ daddu $v1, $t0, $zero
D_80243658:
/* 136998 80243658 25080008 */ addiu $t0, $t0, 0x8
dead_flo_09_FlyingAI_JumpVels:
/* 13699C 8024365C 02863023 */ subu $a2, $s4, $a2
D_80243660:
/* 1369A0 80243660 AE280000 */ sw $t0, 0x0($s1)
glabel func_80243664
/* 1369A4 80243664 AC620000 */ sw $v0, 0x0($v1)
/* 1369A8 80243668 26620001 */ addiu $v0, $s3, 0x1
glabel func_8024366C
/* 1369AC 8024366C 44821000 */ mtc1 $v0, $f2
D_80243670:
/* 1369B0 80243670 00000000 */ nop
D_80243674:
/* 1369B4 80243674 468010A0 */ cvt.s.w $f2, $f2
.L80243678:
/* 1369B8 80243678 AC600004 */ sw $zero, 0x4($v1)
D_8024367C:
/* 1369BC 8024367C 25030008 */ addiu $v1, $t0, 0x8
glabel dead_flo_13_LoadPartyImage
/* 1369C0 80243680 46041082 */ mul.s $f2, $f2, $f4
D_80243684:
/* 1369C4 80243684 00000000 */ nop
glabel .L80243688
/* 1369C8 80243688 26820001 */ addiu $v0, $s4, 0x1
D_8024368C:
/* 1369CC 8024368C 44820000 */ mtc1 $v0, $f0
D_80243690:
/* 1369D0 80243690 00000000 */ nop
.L80243694:
/* 1369D4 80243694 46800020 */ cvt.s.w $f0, $f0
glabel func_80243698
/* 1369D8 80243698 02751021 */ addu $v0, $s3, $s5
D_8024369C:
/* 1369DC 8024369C 2442FFFF */ addiu $v0, $v0, -0x1
glabel .L802436A0
/* 1369E0 802436A0 46040002 */ mul.s $f0, $f0, $f4
/* 1369E4 802436A4 00000000 */ nop
/* 1369E8 802436A8 AE230000 */ sw $v1, 0x0($s1)
D_802436AC:
/* 1369EC 802436AC 4600118D */ trunc.w.s $f6, $f2
D_802436B0:
/* 1369F0 802436B0 44033000 */ mfc1 $v1, $f6
D_802436B4:
/* 1369F4 802436B4 00000000 */ nop
D_802436B8:
/* 1369F8 802436B8 30630FFF */ andi $v1, $v1, 0xFFF
D_802436BC:
/* 1369FC 802436BC 00031B00 */ sll $v1, $v1, 12
glabel func_802436C0
/* 136A00 802436C0 4600018D */ trunc.w.s $f6, $f0
/* 136A04 802436C4 44073000 */ mfc1 $a3, $f6
.L802436C8:
/* 136A08 802436C8 00000000 */ nop
.L802436CC:
/* 136A0C 802436CC 30E70FFF */ andi $a3, $a3, 0xFFF
D_802436D0:
/* 136A10 802436D0 00F03825 */ or $a3, $a3, $s0
glabel func_802436D4
/* 136A14 802436D4 44821000 */ mtc1 $v0, $f2
### DECOMPILED C INSTRUCTIONS:
void pause_textbox_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
s32 msgID = gPauseShownDescMsg;
if (msgID == MSG_NONE) {
return;
}
if (gPauseDescTextPos != 0) {
hud_element_set_render_pos(gPauseCommonIconIDs[1], baseX + width - 4, baseY + 4);
hud_element_draw_without_clipping(gPauseCommonIconIDs[1]);
}
if (gPauseDescTextPos < gPauseDescTextMaxPos) {
hud_element_set_render_pos(gPauseCommonIconIDs[2], baseX + width - 4, baseY + height - 4);
hud_element_draw_without_clipping(gPauseCommonIconIDs[2]);
}
gDPPipeSync(gMainGfxPos++);
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, baseX + 1, baseY + 1, baseX + width - 1, baseY + height - 1);
draw_msg(msgID, baseX + 10, baseY - gPauseDescTextOffset, 255, MSG_PAL_STANDARD, 0);
if (gPauseShownDescIconScript != 0) {
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
hud_element_set_render_pos(gPauseCommonIconIDs[3], baseX - 4, baseY + 16);
hud_element_set_script(gPauseCommonIconIDs[3], gPauseShownDescIconScript);
hud_element_set_flags(gPauseCommonIconIDs[3], HUD_ELEMENT_FLAG_DROP_SHADOW);
hud_element_clear_flags(gPauseCommonIconIDs[3], HUD_ELEMENT_FLAG_FILTER_TEX);
hud_element_set_scale(gPauseCommonIconIDs[3], 1.0f);
hud_element_draw_without_clipping(gPauseCommonIconIDs[3]);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel StartBossBattle
/* 1FC9C 8004489C 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 1FCA0 800448A0 AFBF0028 */ sw $ra, 0x28($sp)
/* 1FCA4 800448A4 AFB50024 */ sw $s5, 0x24($sp)
/* 1FCA8 800448A8 AFB40020 */ sw $s4, 0x20($sp)
/* 1FCAC 800448AC AFB3001C */ sw $s3, 0x1C($sp)
/* 1FCB0 800448B0 AFB20018 */ sw $s2, 0x18($sp)
/* 1FCB4 800448B4 AFB10014 */ sw $s1, 0x14($sp)
/* 1FCB8 800448B8 AFB00010 */ sw $s0, 0x10($sp)
/* 1FCBC 800448BC 8C82000C */ lw $v0, 0xC($a0)
/* 1FCC0 800448C0 8C450000 */ lw $a1, 0x0($v0)
/* 1FCC4 800448C4 0C0B1EAF */ jal evt_get_variable
/* 1FCC8 800448C8 8C910148 */ lw $s1, 0x148($a0)
/* 1FCCC 800448CC 24040001 */ addiu $a0, $zero, 0x1
/* 1FCD0 800448D0 0C0B1192 */ jal resume_all_group
/* 1FCD4 800448D4 0040802D */ daddu $s0, $v0, $zero
/* 1FCD8 800448D8 3C13800B */ lui $s3, %hi(gCurrentEncounter)
/* 1FCDC 800448DC 26730F10 */ addiu $s3, $s3, %lo(gCurrentEncounter)
/* 1FCE0 800448E0 24030001 */ addiu $v1, $zero, 0x1
/* 1FCE4 800448E4 A2630005 */ sb $v1, 0x5($s3)
/* 1FCE8 800448E8 A2230005 */ sb $v1, 0x5($s1)
/* 1FCEC 800448EC AE71008C */ sw $s1, 0x8C($s3)
/* 1FCF0 800448F0 82220004 */ lb $v0, 0x4($s1)
/* 1FCF4 800448F4 00021080 */ sll $v0, $v0, 2
/* 1FCF8 800448F8 00531021 */ addu $v0, $v0, $s3
/* 1FCFC 800448FC 8C440028 */ lw $a0, 0x28($v0)
/* 1FD00 80044900 2402FFFF */ addiu $v0, $zero, -0x1
/* 1FD04 80044904 A2600004 */ sb $zero, 0x4($s3)
/* 1FD08 80044908 A2630011 */ sb $v1, 0x11($s3)
/* 1FD0C 8004490C AE700014 */ sw $s0, 0x14($s3)
/* 1FD10 80044910 AE620018 */ sw $v0, 0x18($s3)
/* 1FD14 80044914 AE640088 */ sw $a0, 0x88($s3)
/* 1FD18 80044918 8E22003C */ lw $v0, 0x3C($s1)
/* 1FD1C 8004491C 10400003 */ beqz $v0, .L8004492C
/* 1FD20 80044920 00000000 */ nop
/* 1FD24 80044924 0C0B1108 */ jal suspend_all_script
/* 1FD28 80044928 8E240054 */ lw $a0, 0x54($s1)
.L8004492C:
/* 1FD2C 8004492C 8E220044 */ lw $v0, 0x44($s1)
/* 1FD30 80044930 10400003 */ beqz $v0, .L80044940
/* 1FD34 80044934 00000000 */ nop
/* 1FD38 80044938 0C0B1108 */ jal suspend_all_script
/* 1FD3C 8004493C 8E24005C */ lw $a0, 0x5C($s1)
.L80044940:
/* 1FD40 80044940 0C03805E */ jal disable_player_input
/* 1FD44 80044944 0000802D */ daddu $s0, $zero, $zero
/* 1FD48 80044948 0C03BD8A */ jal partner_disable_input
/* 1FD4C 8004494C 00000000 */ nop
/* 1FD50 80044950 8E740088 */ lw $s4, 0x88($s3)
/* 1FD54 80044954 8E820000 */ lw $v0, 0x0($s4)
/* 1FD58 80044958 18400021 */ blez $v0, .L800449E0
/* 1FD5C 8004495C 24150001 */ addiu $s5, $zero, 0x1
/* 1FD60 80044960 0280902D */ daddu $s2, $s4, $zero
.L80044964:
/* 1FD64 80044964 8E510004 */ lw $s1, 0x4($s2)
/* 1FD68 80044968 12200018 */ beqz $s1, .L800449CC
/* 1FD6C 8004496C 00000000 */ nop
/* 1FD70 80044970 8E220000 */ lw $v0, 0x0($s1)
/* 1FD74 80044974 30420008 */ andi $v0, $v0, 0x8
/* 1FD78 80044978 10400004 */ beqz $v0, .L8004498C
/* 1FD7C 8004497C 00000000 */ nop
/* 1FD80 80044980 8E62008C */ lw $v0, 0x8C($s3)
/* 1FD84 80044984 16220011 */ bne $s1, $v0, .L800449CC
/* 1FD88 80044988 00000000 */ nop
.L8004498C:
/* 1FD8C 8004498C 8E220028 */ lw $v0, 0x28($s1)
/* 1FD90 80044990 1040000E */ beqz $v0, .L800449CC
/* 1FD94 80044994 0040202D */ daddu $a0, $v0, $zero
/* 1FD98 80044998 2405000A */ addiu $a1, $zero, 0xA
/* 1FD9C 8004499C 0000302D */ daddu $a2, $zero, $zero
/* 1FDA0 800449A0 0C0B0CF8 */ jal start_script
/* 1FDA4 800449A4 A2350005 */ sb $s5, 0x5($s1)
/* 1FDA8 800449A8 0040202D */ daddu $a0, $v0, $zero
/* 1FDAC 800449AC AE240040 */ sw $a0, 0x40($s1)
/* 1FDB0 800449B0 8C820144 */ lw $v0, 0x144($a0)
/* 1FDB4 800449B4 AE220058 */ sw $v0, 0x58($s1)
/* 1FDB8 800449B8 AC910148 */ sw $s1, 0x148($a0)
/* 1FDBC 800449BC 86220008 */ lh $v0, 0x8($s1)
/* 1FDC0 800449C0 AC82014C */ sw $v0, 0x14C($a0)
/* 1FDC4 800449C4 92220006 */ lbu $v0, 0x6($s1)
/* 1FDC8 800449C8 A0820004 */ sb $v0, 0x4($a0)
.L800449CC:
/* 1FDCC 800449CC 8E820000 */ lw $v0, 0x0($s4)
/* 1FDD0 800449D0 26100001 */ addiu $s0, $s0, 0x1
/* 1FDD4 800449D4 0202102A */ slt $v0, $s0, $v0
/* 1FDD8 800449D8 1440FFE2 */ bnez $v0, .L80044964
/* 1FDDC 800449DC 26520004 */ addiu $s2, $s2, 0x4
.L800449E0:
/* 1FDE0 800449E0 24020001 */ addiu $v0, $zero, 0x1
/* 1FDE4 800449E4 0040182D */ daddu $v1, $v0, $zero
/* 1FDE8 800449E8 AE600090 */ sw $zero, 0x90($s3)
/* 1FDEC 800449EC AE600094 */ sw $zero, 0x94($s3)
/* 1FDF0 800449F0 A2630012 */ sb $v1, 0x12($s3)
/* 1FDF4 800449F4 8FBF0028 */ lw $ra, 0x28($sp)
/* 1FDF8 800449F8 8FB50024 */ lw $s5, 0x24($sp)
/* 1FDFC 800449FC 8FB40020 */ lw $s4, 0x20($sp)
/* 1FE00 80044A00 8FB3001C */ lw $s3, 0x1C($sp)
/* 1FE04 80044A04 8FB20018 */ lw $s2, 0x18($sp)
/* 1FE08 80044A08 8FB10014 */ lw $s1, 0x14($sp)
/* 1FE0C 80044A0C 8FB00010 */ lw $s0, 0x10($sp)
/* 1FE10 80044A10 24030003 */ addiu $v1, $zero, 0x3
/* 1FE14 80044A14 3C01800A */ lui $at, %hi(gEncounterState)
/* 1FE18 80044A18 AC23A600 */ sw $v1, %lo(gEncounterState)($at)
/* 1FE1C 80044A1C 0040182D */ daddu $v1, $v0, $zero
/* 1FE20 80044A20 3C01800A */ lui $at, %hi(D_8009A678)
/* 1FE24 80044A24 AC23A678 */ sw $v1, %lo(D_8009A678)($at)
/* 1FE28 80044A28 3C01800A */ lui $at, %hi(gEncounterSubState)
/* 1FE2C 80044A2C AC20A5D0 */ sw $zero, %lo(gEncounterSubState)($at)
/* 1FE30 80044A30 03E00008 */ jr $ra
/* 1FE34 80044A34 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
ApiStatus StartBossBattle(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
EncounterStatus* currentEncounter = &gCurrentEncounter;
Enemy* enemy = script->owner1.enemy;
s32 songID = evt_get_variable(script, *args++);
Encounter* encounter;
s32 i;
resume_all_group(EVT_GROUP_01);
currentEncounter->hitType = ENCOUNTER_TRIGGER_NONE;
enemy->encountered = TRUE;
currentEncounter->currentEnemy = enemy;
currentEncounter->currentEncounter = currentEncounter->encounterList[enemy->encounterIndex];
currentEncounter->firstStrikeType = FIRST_STRIKE_NONE;
currentEncounter->allowFleeing = TRUE;
currentEncounter->songID = songID;
currentEncounter->unk_18 = -1;
if (enemy->aiScript != NULL) {
suspend_all_script(enemy->aiScriptID);
}
if (enemy->auxScript != NULL) {
suspend_all_script(enemy->auxScriptID);
}
disable_player_input();
partner_disable_input();
encounter = currentEncounter->currentEncounter;
for (i = 0; i < encounter->count; i++) {
enemy = encounter->enemy[i];
if ((enemy != NULL && (
!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->currentEnemy)
) && enemy->hitBytecode != NULL) {
enemy->encountered = TRUE;
script = start_script(enemy->hitBytecode, EVT_PRIORITY_A, 0);
enemy->hitScript = script;
enemy->hitScriptID = script->id;
script = enemy->hitScript;
script->owner1.enemy = enemy;
script->owner2.npcID = enemy->npcID;
script->groupFlags = enemy->scriptGroup;
}
}
currentEncounter->fadeOutAmount = 0;
currentEncounter->unk_94 = 0;
currentEncounter->scriptedBattle = TRUE;
gEncounterState = ENCOUNTER_STATE_PRE_BATTLE;
D_8009A678 = 1;
gEncounterSubState = ENCOUNTER_SUBSTATE_PRE_BATTLE_INIT;
return ApiStatus_DONE1;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel partner_flying_enable
/* 867C0 800ED310 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 867C4 800ED314 AFB00010 */ sw $s0, 0x10($sp)
/* 867C8 800ED318 0080802D */ daddu $s0, $a0, $zero
/* 867CC 800ED31C 3C048011 */ lui $a0, %hi(D_8010CD38)
/* 867D0 800ED320 2484CD38 */ addiu $a0, $a0, %lo(D_8010CD38)
/* 867D4 800ED324 0000302D */ daddu $a2, $zero, $zero
/* 867D8 800ED328 3C028010 */ lui $v0, %hi(wSavedPartnerPosX)
/* 867DC 800ED32C 2442833C */ addiu $v0, $v0, %lo(wSavedPartnerPosX)
/* 867E0 800ED330 0040482D */ daddu $t1, $v0, $zero
/* 867E4 800ED334 3C028010 */ lui $v0, %hi(wSavedPartnerPosY)
/* 867E8 800ED338 24428340 */ addiu $v0, $v0, %lo(wSavedPartnerPosY)
/* 867EC 800ED33C 0040402D */ daddu $t0, $v0, $zero
/* 867F0 800ED340 3C028010 */ lui $v0, %hi(wSavedPartnerPosZ)
/* 867F4 800ED344 24428344 */ addiu $v0, $v0, %lo(wSavedPartnerPosZ)
/* 867F8 800ED348 0040382D */ daddu $a3, $v0, $zero
/* 867FC 800ED34C AFBF0014 */ sw $ra, 0x14($sp)
/* 86800 800ED350 C5200000 */ lwc1 $f0, 0x0($t1)
/* 86804 800ED354 C5020000 */ lwc1 $f2, 0x0($t0)
/* 86808 800ED358 C4E40000 */ lwc1 $f4, 0x0($a3)
/* 8680C 800ED35C 2483000C */ addiu $v1, $a0, 0xC
/* 86810 800ED360 E6000038 */ swc1 $f0, 0x38($s0)
/* 86814 800ED364 E602003C */ swc1 $f2, 0x3C($s0)
/* 86818 800ED368 E6040040 */ swc1 $f4, 0x40($s0)
.L800ED36C:
/* 8681C 800ED36C 24C60001 */ addiu $a2, $a2, 0x1
/* 86820 800ED370 C5200000 */ lwc1 $f0, 0x0($t1)
/* 86824 800ED374 C5020000 */ lwc1 $f2, 0x0($t0)
/* 86828 800ED378 C4E40000 */ lwc1 $f4, 0x0($a3)
/* 8682C 800ED37C 28C20028 */ slti $v0, $a2, 0x28
/* 86830 800ED380 E460FFF8 */ swc1 $f0, -0x8($v1)
/* 86834 800ED384 E462FFFC */ swc1 $f2, -0x4($v1)
/* 86838 800ED388 E4640000 */ swc1 $f4, 0x0($v1)
/* 8683C 800ED38C 24630010 */ addiu $v1, $v1, 0x10
/* 86840 800ED390 A0800000 */ sb $zero, 0x0($a0)
/* 86844 800ED394 1440FFF5 */ bnez $v0, .L800ED36C
/* 86848 800ED398 24840010 */ addiu $a0, $a0, 0x10
/* 8684C 800ED39C 3C018011 */ lui $at, %hi(gPlayerMoveHistoryIndex)
/* 86850 800ED3A0 AC20CFB8 */ sw $zero, %lo(gPlayerMoveHistoryIndex)($at)
/* 86854 800ED3A4 3C018011 */ lui $at, %hi(D_8010CFBC)
/* 86858 800ED3A8 AC20CFBC */ sw $zero, %lo(D_8010CFBC)($at)
/* 8685C 800ED3AC 14A00005 */ bnez $a1, .L800ED3C4
/* 86860 800ED3B0 00000000 */ nop
/* 86864 800ED3B4 3C018011 */ lui $at, %hi(wPartnerFollowState)
/* 86868 800ED3B8 A420CFC8 */ sh $zero, %lo(wPartnerFollowState)($at)
/* 8686C 800ED3BC 0803B50B */ j .L800ED42C
/* 86870 800ED3C0 00000000 */ nop
.L800ED3C4:
/* 86874 800ED3C4 3C048011 */ lui $a0, %hi(D_8010CFC4)
/* 86878 800ED3C8 2484CFC4 */ addiu $a0, $a0, %lo(D_8010CFC4)
/* 8687C 800ED3CC 8C830000 */ lw $v1, 0x0($a0)
/* 86880 800ED3D0 14600009 */ bnez $v1, .L800ED3F8
/* 86884 800ED3D4 24020001 */ addiu $v0, $zero, 0x1
/* 86888 800ED3D8 2402000F */ addiu $v0, $zero, 0xF
/* 8688C 800ED3DC 3C018011 */ lui $at, %hi(wPartnerFollowState)
/* 86890 800ED3E0 A422CFC8 */ sh $v0, %lo(wPartnerFollowState)($at)
/* 86894 800ED3E4 24020002 */ addiu $v0, $zero, 0x2
/* 86898 800ED3E8 3C018011 */ lui $at, %hi(D_8010CFCA)
/* 8689C 800ED3EC A422CFCA */ sh $v0, %lo(D_8010CFCA)($at)
/* 868A0 800ED3F0 0803B50D */ j .L800ED434
/* 868A4 800ED3F4 00000000 */ nop
.L800ED3F8:
/* 868A8 800ED3F8 10620003 */ beq $v1, $v0, .L800ED408
/* 868AC 800ED3FC 24020003 */ addiu $v0, $zero, 0x3
/* 868B0 800ED400 14620006 */ bne $v1, $v0, .L800ED41C
/* 868B4 800ED404 24020002 */ addiu $v0, $zero, 0x2
.L800ED408:
/* 868B8 800ED408 AC800000 */ sw $zero, 0x0($a0)
/* 868BC 800ED40C 3C018011 */ lui $at, %hi(wPartnerFollowState)
/* 868C0 800ED410 A420CFC8 */ sh $zero, %lo(wPartnerFollowState)($at)
/* 868C4 800ED414 0803B50B */ j .L800ED42C
/* 868C8 800ED418 00000000 */ nop
.L800ED41C:
/* 868CC 800ED41C 14620005 */ bne $v1, $v0, .L800ED434
/* 868D0 800ED420 24020032 */ addiu $v0, $zero, 0x32
/* 868D4 800ED424 3C018011 */ lui $at, %hi(wPartnerFollowState)
/* 868D8 800ED428 A422CFC8 */ sh $v0, %lo(wPartnerFollowState)($at)
.L800ED42C:
/* 868DC 800ED42C 3C018011 */ lui $at, %hi(D_8010CFCA)
/* 868E0 800ED430 A420CFCA */ sh $zero, %lo(D_8010CFCA)($at)
.L800ED434:
/* 868E4 800ED434 3C038011 */ lui $v1, %hi(wCurrentPartnerId)
/* 868E8 800ED438 8C63CFD8 */ lw $v1, %lo(wCurrentPartnerId)($v1)
/* 868EC 800ED43C 3C014220 */ lui $at, (0x42200000 >> 16)
/* 868F0 800ED440 44810000 */ mtc1 $at, $f0
/* 868F4 800ED444 0200202D */ daddu $a0, $s0, $zero
/* 868F8 800ED448 3C018011 */ lui $at, %hi(D_8010CFCE)
/* 868FC 800ED44C A420CFCE */ sh $zero, %lo(D_8010CFCE)($at)
/* 86900 800ED450 3C018011 */ lui $at, %hi(D_8010CFCC)
/* 86904 800ED454 A420CFCC */ sh $zero, %lo(D_8010CFCC)($at)
/* 86908 800ED458 000310C0 */ sll $v0, $v1, 3
/* 8690C 800ED45C 00431021 */ addu $v0, $v0, $v1
/* 86910 800ED460 00021080 */ sll $v0, $v0, 2
/* 86914 800ED464 3C038010 */ lui $v1, %hi(gPartnerAnimations + 0x14)
/* 86918 800ED468 00621821 */ addu $v1, $v1, $v0
/* 8691C 800ED46C 8C63835C */ lw $v1, %lo(gPartnerAnimations + 0x14)($v1)
/* 86920 800ED470 24020010 */ addiu $v0, $zero, 0x10
/* 86924 800ED474 3C018010 */ lui $at, %hi(wPartnerMoveTime)
/* 86928 800ED478 AC22802C */ sw $v0, %lo(wPartnerMoveTime)($at)
/* 8692C 800ED47C 3C018011 */ lui $at, %hi(wPartnerTetherDistance)
/* 86930 800ED480 E420CFC0 */ swc1 $f0, %lo(wPartnerTetherDistance)($at)
/* 86934 800ED484 0C03A96E */ jal func_800EA5B8
/* 86938 800ED488 AE030028 */ sw $v1, 0x28($s0)
/* 8693C 800ED48C 8E020000 */ lw $v0, 0x0($s0)
/* 86940 800ED490 3C030001 */ lui $v1, (0x10000 >> 16)
/* 86944 800ED494 AE030080 */ sw $v1, 0x80($s0)
/* 86948 800ED498 2403FDFF */ addiu $v1, $zero, -0x201
/* 8694C 800ED49C 34420100 */ ori $v0, $v0, 0x100
/* 86950 800ED4A0 00431024 */ and $v0, $v0, $v1
/* 86954 800ED4A4 AE020000 */ sw $v0, 0x0($s0)
/* 86958 800ED4A8 8FBF0014 */ lw $ra, 0x14($sp)
/* 8695C 800ED4AC 8FB00010 */ lw $s0, 0x10($sp)
/* 86960 800ED4B0 03E00008 */ jr $ra
/* 86964 800ED4B4 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void partner_flying_enable(Npc* partner, s32 val) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerPathElement* it = gPlayerMoveHistory;
s32 i;
partner->pos.x = wSavedPartnerPosX;
partner->pos.y = wSavedPartnerPosY;
partner->pos.z = wSavedPartnerPosZ;
for (i = 0; i < ARRAY_COUNT(gPlayerMoveHistory); i++, it++) {
it->pos.x = wSavedPartnerPosX;
it->pos.y = wSavedPartnerPosY;
it->pos.z = wSavedPartnerPosZ;
it->isJumping = FALSE;
}
gPlayerMoveHistoryIndex = 0;
D_8010CFBC = 0;
if (!val) {
wPartnerFollowState = 0;
D_8010CFCA = 0;
} else if (D_8010CFC4 == 0) {
wPartnerFollowState = 15;
D_8010CFCA = 2;
} else if (D_8010CFC4 == 1 || D_8010CFC4 == 3) {
D_8010CFC4 = 0;
wPartnerFollowState = 0;
D_8010CFCA = 0;
} else if (D_8010CFC4 == 2) {
wPartnerFollowState = 50;
D_8010CFCA = 0;
}
D_8010CFCE = 0;
D_8010CFCC = 0;
wPartnerMoveTime = 16;
wPartnerTetherDistance = 40.0f;
partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle;
func_800EA5B8(partner);
partner->collisionChannel = COLLISION_CHANNEL_10000;
partner->flags |= NPC_FLAG_IGNORE_PLAYER_COLLISION;
partner->flags &= ~NPC_FLAG_GRAVITY;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel peach_star_beam_update
/* 3E5658 E010C198 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 3E565C E010C19C AFBF0028 */ sw $ra, 0x28($sp)
/* 3E5660 E010C1A0 AFB50024 */ sw $s5, 0x24($sp)
/* 3E5664 E010C1A4 AFB40020 */ sw $s4, 0x20($sp)
/* 3E5668 E010C1A8 AFB3001C */ sw $s3, 0x1C($sp)
/* 3E566C E010C1AC AFB20018 */ sw $s2, 0x18($sp)
/* 3E5670 E010C1B0 AFB10014 */ sw $s1, 0x14($sp)
/* 3E5674 E010C1B4 AFB00010 */ sw $s0, 0x10($sp)
/* 3E5678 E010C1B8 F7BE0058 */ sdc1 $f30, 0x58($sp)
/* 3E567C E010C1BC F7BC0050 */ sdc1 $f28, 0x50($sp)
/* 3E5680 E010C1C0 F7BA0048 */ sdc1 $f26, 0x48($sp)
/* 3E5684 E010C1C4 F7B80040 */ sdc1 $f24, 0x40($sp)
/* 3E5688 E010C1C8 F7B60038 */ sdc1 $f22, 0x38($sp)
/* 3E568C E010C1CC F7B40030 */ sdc1 $f20, 0x30($sp)
/* 3E5690 E010C1D0 8C830000 */ lw $v1, 0x0($a0)
/* 3E5694 E010C1D4 8C91000C */ lw $s1, 0xC($a0)
/* 3E5698 E010C1D8 30620010 */ andi $v0, $v1, 0x10
/* 3E569C E010C1DC 10400005 */ beqz $v0, .LE010C1F4
/* 3E56A0 E010C1E0 2402FFEF */ addiu $v0, $zero, -0x11
/* 3E56A4 E010C1E4 00621024 */ and $v0, $v1, $v0
/* 3E56A8 E010C1E8 AC820000 */ sw $v0, 0x0($a0)
/* 3E56AC E010C1EC 24020010 */ addiu $v0, $zero, 0x10
/* 3E56B0 E010C1F0 AE220010 */ sw $v0, 0x10($s1)
.LE010C1F4:
/* 3E56B4 E010C1F4 8E230010 */ lw $v1, 0x10($s1)
/* 3E56B8 E010C1F8 286203E8 */ slti $v0, $v1, 0x3E8
/* 3E56BC E010C1FC 10400002 */ beqz $v0, .LE010C208
/* 3E56C0 E010C200 2462FFFF */ addiu $v0, $v1, -0x1
/* 3E56C4 E010C204 AE220010 */ sw $v0, 0x10($s1)
.LE010C208:
/* 3E56C8 E010C208 8E220014 */ lw $v0, 0x14($s1)
/* 3E56CC E010C20C 8E230010 */ lw $v1, 0x10($s1)
/* 3E56D0 E010C210 24420001 */ addiu $v0, $v0, 0x1
/* 3E56D4 E010C214 04610005 */ bgez $v1, .LE010C22C
/* 3E56D8 E010C218 AE220014 */ sw $v0, 0x14($s1)
/* 3E56DC E010C21C 0C080128 */ jal shim_remove_effect
/* 3E56E0 E010C220 00000000 */ nop
/* 3E56E4 E010C224 080430C6 */ j .LE010C318
/* 3E56E8 E010C228 00000000 */ nop
.LE010C22C:
/* 3E56EC E010C22C 0000982D */ daddu $s3, $zero, $zero
/* 3E56F0 E010C230 3C159249 */ lui $s5, (0x92492493 >> 16)
/* 3E56F4 E010C234 36B52493 */ ori $s5, $s5, (0x92492493 & 0xFFFF)
/* 3E56F8 E010C238 2412FE98 */ addiu $s2, $zero, -0x168
/* 3E56FC E010C23C 2414005C */ addiu $s4, $zero, 0x5C
/* 3E5700 E010C240 C63C0048 */ lwc1 $f28, 0x48($s1)
/* 3E5704 E010C244 C6200044 */ lwc1 $f0, 0x44($s1)
/* 3E5708 E010C248 C6220040 */ lwc1 $f2, 0x40($s1)
/* 3E570C E010C24C C63A004C */ lwc1 $f26, 0x4C($s1)
/* 3E5710 E010C250 46020000 */ add.s $f0, $f0, $f2
/* 3E5714 E010C254 C6380050 */ lwc1 $f24, 0x50($s1)
/* 3E5718 E010C258 C6360054 */ lwc1 $f22, 0x54($s1)
/* 3E571C E010C25C 46000786 */ mov.s $f30, $f0
/* 3E5720 E010C260 E63E0044 */ swc1 $f30, 0x44($s1)
.LE010C264:
/* 3E5724 E010C264 16600007 */ bnez $s3, .LE010C284
/* 3E5728 E010C268 02348021 */ addu $s0, $s1, $s4
/* 3E572C E010C26C E61A0004 */ swc1 $f26, 0x4($s0)
/* 3E5730 E010C270 C6200058 */ lwc1 $f0, 0x58($s1)
/* 3E5734 E010C274 4600C000 */ add.s $f0, $f24, $f0
/* 3E5738 E010C278 E616000C */ swc1 $f22, 0xC($s0)
/* 3E573C E010C27C 080430B8 */ j .LE010C2E0
/* 3E5740 E010C280 E6000008 */ swc1 $f0, 0x8($s0)
.LE010C284:
/* 3E5744 E010C284 02550018 */ mult $s2, $s5
/* 3E5748 E010C288 00121FC3 */ sra $v1, $s2, 31
/* 3E574C E010C28C 00002810 */ mfhi $a1
/* 3E5750 E010C290 00B21021 */ addu $v0, $a1, $s2
/* 3E5754 E010C294 00021083 */ sra $v0, $v0, 2
/* 3E5758 E010C298 00431023 */ subu $v0, $v0, $v1
/* 3E575C E010C29C 4482A000 */ mtc1 $v0, $f20
/* 3E5760 E010C2A0 00000000 */ nop
/* 3E5764 E010C2A4 4680A520 */ cvt.s.w $f20, $f20
/* 3E5768 E010C2A8 4614F500 */ add.s $f20, $f30, $f20
/* 3E576C E010C2AC 0C080140 */ jal shim_sin_deg
/* 3E5770 E010C2B0 4600A306 */ mov.s $f12, $f20
/* 3E5774 E010C2B4 4600E002 */ mul.s $f0, $f28, $f0
/* 3E5778 E010C2B8 00000000 */ nop
/* 3E577C E010C2BC 4600D000 */ add.s $f0, $f26, $f0
/* 3E5780 E010C2C0 4600A306 */ mov.s $f12, $f20
/* 3E5784 E010C2C4 E6180008 */ swc1 $f24, 0x8($s0)
/* 3E5788 E010C2C8 0C080144 */ jal shim_cos_deg
/* 3E578C E010C2CC E6000004 */ swc1 $f0, 0x4($s0)
/* 3E5790 E010C2D0 4600E002 */ mul.s $f0, $f28, $f0
/* 3E5794 E010C2D4 00000000 */ nop
/* 3E5798 E010C2D8 4600B000 */ add.s $f0, $f22, $f0
/* 3E579C E010C2DC E600000C */ swc1 $f0, 0xC($s0)
.LE010C2E0:
/* 3E57A0 E010C2E0 8E020000 */ lw $v0, 0x0($s0)
/* 3E57A4 E010C2E4 30420002 */ andi $v0, $v0, 0x2
/* 3E57A8 E010C2E8 14400007 */ bnez $v0, .LE010C308
/* 3E57AC E010C2EC 26520168 */ addiu $s2, $s2, 0x168
/* 3E57B0 E010C2F0 C6000004 */ lwc1 $f0, 0x4($s0)
/* 3E57B4 E010C2F4 C6020008 */ lwc1 $f2, 0x8($s0)
/* 3E57B8 E010C2F8 C604000C */ lwc1 $f4, 0xC($s0)
/* 3E57BC E010C2FC E6000010 */ swc1 $f0, 0x10($s0)
/* 3E57C0 E010C300 E6020014 */ swc1 $f2, 0x14($s0)
/* 3E57C4 E010C304 E6040018 */ swc1 $f4, 0x18($s0)
.LE010C308:
/* 3E57C8 E010C308 26730001 */ addiu $s3, $s3, 0x1
/* 3E57CC E010C30C 2A620008 */ slti $v0, $s3, 0x8
/* 3E57D0 E010C310 1440FFD4 */ bnez $v0, .LE010C264
/* 3E57D4 E010C314 2694001C */ addiu $s4, $s4, 0x1C
.LE010C318:
/* 3E57D8 E010C318 8FBF0028 */ lw $ra, 0x28($sp)
/* 3E57DC E010C31C 8FB50024 */ lw $s5, 0x24($sp)
/* 3E57E0 E010C320 8FB40020 */ lw $s4, 0x20($sp)
/* 3E57E4 E010C324 8FB3001C */ lw $s3, 0x1C($sp)
/* 3E57E8 E010C328 8FB20018 */ lw $s2, 0x18($sp)
/* 3E57EC E010C32C 8FB10014 */ lw $s1, 0x14($sp)
/* 3E57F0 E010C330 8FB00010 */ lw $s0, 0x10($sp)
/* 3E57F4 E010C334 D7BE0058 */ ldc1 $f30, 0x58($sp)
/* 3E57F8 E010C338 D7BC0050 */ ldc1 $f28, 0x50($sp)
/* 3E57FC E010C33C D7BA0048 */ ldc1 $f26, 0x48($sp)
/* 3E5800 E010C340 D7B80040 */ ldc1 $f24, 0x40($sp)
/* 3E5804 E010C344 D7B60038 */ ldc1 $f22, 0x38($sp)
/* 3E5808 E010C348 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 3E580C E010C34C 03E00008 */ jr $ra
/* 3E5810 E010C350 27BD0060 */ addiu $sp, $sp, 0x60
### DECOMPILED C INSTRUCTIONS:
void peach_star_beam_update(EffectInstance* effect) {
PeachStarBeamFXData* data = effect->data.peachStarBeam;
f32 rotationAngle;
f32 radius;
f32 centerX;
f32 centerY;
f32 centerZ;
f32 spiritAngle;
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;
}
data->rotationAngle += data->rotationSpeed;
rotationAngle = data->rotationAngle;
radius = data->circleRadius;
centerX = data->circleCenter.x;
centerY = data->circleCenter.y;
centerZ = data->circleCenter.z;
for (i = 0; i < ARRAY_COUNT(data->spirits); i++) {
PeachStarBeamSpirit* part = &data->spirits[i];
if (i == 0) {
part->pos.x = centerX;
part->pos.y = centerY + data->twinkYOffset;
part->pos.z = centerZ;
} else {
spiritAngle = rotationAngle + ((-360 + (360 * i)) / 7);
part->pos.x = centerX + radius * shim_sin_deg(spiritAngle);
part->pos.y = centerY;
part->pos.z = centerZ + radius * shim_cos_deg(spiritAngle);
}
if (!(part->flags & 2)) {
part->lockedPos.x = part->pos.x;
part->lockedPos.y = part->pos.y;
part->lockedPos.z = part->pos.z;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_8011B950
/* B2050 8011B950 3084FFFF */ andi $a0, $a0, 0xFFFF
/* B2054 8011B954 3C0A800A */ lui $t2, %hi(mdl_currentModelTreeNodeInfo)
/* B2058 8011B958 8D4AA5F4 */ lw $t2, %lo(mdl_currentModelTreeNodeInfo)($t2)
/* B205C 8011B95C 00041080 */ sll $v0, $a0, 2
/* B2060 8011B960 004A4021 */ addu $t0, $v0, $t2
/* B2064 8011B964 91030000 */ lbu $v1, 0x0($t0)
/* B2068 8011B968 286200FF */ slti $v0, $v1, 0xFF
/* B206C 8011B96C 10400004 */ beqz $v0, .L8011B980
/* B2070 8011B970 2409FFFF */ addiu $t1, $zero, -0x1
/* B2074 8011B974 0060482D */ daddu $t1, $v1, $zero
/* B2078 8011B978 08046E74 */ j .L8011B9D0
/* B207C 8011B97C 0120582D */ daddu $t3, $t1, $zero
.L8011B980:
/* B2080 8011B980 2484FFFF */ addiu $a0, $a0, -0x1
/* B2084 8011B984 910C0001 */ lbu $t4, 0x1($t0)
/* B2088 8011B988 04800011 */ bltz $a0, .L8011B9D0
/* B208C 8011B98C 00041080 */ sll $v0, $a0, 2
/* B2090 8011B990 240DFFFF */ addiu $t5, $zero, -0x1
/* B2094 8011B994 004A4021 */ addu $t0, $v0, $t2
.L8011B998:
/* B2098 8011B998 91020001 */ lbu $v0, 0x1($t0)
/* B209C 8011B99C 0182102A */ slt $v0, $t4, $v0
/* B20A0 8011B9A0 1040000C */ beqz $v0, .L8011B9D4
/* B20A4 8011B9A4 0000502D */ daddu $t2, $zero, $zero
/* B20A8 8011B9A8 91030000 */ lbu $v1, 0x0($t0)
/* B20AC 8011B9AC 286200FF */ slti $v0, $v1, 0xFF
/* B20B0 8011B9B0 50400005 */ beql $v0, $zero, .L8011B9C8
/* B20B4 8011B9B4 2484FFFF */ addiu $a0, $a0, -0x1
/* B20B8 8011B9B8 512D0001 */ beql $t1, $t5, .L8011B9C0
/* B20BC 8011B9BC 0060482D */ daddu $t1, $v1, $zero
.L8011B9C0:
/* B20C0 8011B9C0 0060582D */ daddu $t3, $v1, $zero
/* B20C4 8011B9C4 2484FFFF */ addiu $a0, $a0, -0x1
.L8011B9C8:
/* B20C8 8011B9C8 0481FFF3 */ bgez $a0, .L8011B998
/* B20CC 8011B9CC 2508FFFC */ addiu $t0, $t0, -0x4
.L8011B9D0:
/* B20D0 8011B9D0 0000502D */ daddu $t2, $zero, $zero
.L8011B9D4:
/* B20D4 8011B9D4 04A10003 */ bgez $a1, .L8011B9E4
/* B20D8 8011B9D8 0140402D */ daddu $t0, $t2, $zero
/* B20DC 8011B9DC 2408000F */ addiu $t0, $zero, 0xF
/* B20E0 8011B9E0 0140282D */ daddu $a1, $t2, $zero
.L8011B9E4:
/* B20E4 8011B9E4 04C10004 */ bgez $a2, .L8011B9F8
/* B20E8 8011B9E8 00061100 */ sll $v0, $a2, 4
/* B20EC 8011B9EC 240A00F0 */ addiu $t2, $zero, 0xF0
/* B20F0 8011B9F0 0000302D */ daddu $a2, $zero, $zero
/* B20F4 8011B9F4 00061100 */ sll $v0, $a2, 4
.L8011B9F8:
/* B20F8 8011B9F8 14E00015 */ bnez $a3, .L8011BA50
/* B20FC 8011B9FC 00A22821 */ addu $a1, $a1, $v0
/* B2100 8011BA00 0160202D */ daddu $a0, $t3, $zero
/* B2104 8011BA04 0124102A */ slt $v0, $t1, $a0
/* B2108 8011BA08 1440000F */ bnez $v0, .L8011BA48
/* B210C 8011BA0C 010A3021 */ addu $a2, $t0, $t2
/* B2110 8011BA10 3C078015 */ lui $a3, %hi(gCurrentModels)
/* B2114 8011BA14 24E712CC */ addiu $a3, $a3, %lo(gCurrentModels)
.L8011BA18:
/* B2118 8011BA18 8CE30000 */ lw $v1, 0x0($a3)
/* B211C 8011BA1C 00041080 */ sll $v0, $a0, 2
/* B2120 8011BA20 00431021 */ addu $v0, $v0, $v1
/* B2124 8011BA24 8C430000 */ lw $v1, 0x0($v0)
/* B2128 8011BA28 906200A5 */ lbu $v0, 0xA5($v1)
/* B212C 8011BA2C 24840001 */ addiu $a0, $a0, 0x1
/* B2130 8011BA30 00461024 */ and $v0, $v0, $a2
/* B2134 8011BA34 00451021 */ addu $v0, $v0, $a1
/* B2138 8011BA38 A06200A5 */ sb $v0, 0xA5($v1)
/* B213C 8011BA3C 0124102A */ slt $v0, $t1, $a0
/* B2140 8011BA40 1040FFF5 */ beqz $v0, .L8011BA18
/* B2144 8011BA44 00000000 */ nop
.L8011BA48:
/* B2148 8011BA48 03E00008 */ jr $ra
/* B214C 8011BA4C 00000000 */ nop
.L8011BA50:
/* B2150 8011BA50 19600010 */ blez $t3, .L8011BA94
/* B2154 8011BA54 0000202D */ daddu $a0, $zero, $zero
/* B2158 8011BA58 3C078015 */ lui $a3, %hi(gCurrentModels)
/* B215C 8011BA5C 24E712CC */ addiu $a3, $a3, %lo(gCurrentModels)
/* B2160 8011BA60 010A3021 */ addu $a2, $t0, $t2
.L8011BA64:
/* B2164 8011BA64 8CE30000 */ lw $v1, 0x0($a3)
/* B2168 8011BA68 00041080 */ sll $v0, $a0, 2
/* B216C 8011BA6C 00431021 */ addu $v0, $v0, $v1
/* B2170 8011BA70 8C430000 */ lw $v1, 0x0($v0)
/* B2174 8011BA74 906200A5 */ lbu $v0, 0xA5($v1)
/* B2178 8011BA78 24840001 */ addiu $a0, $a0, 0x1
/* B217C 8011BA7C 00461024 */ and $v0, $v0, $a2
/* B2180 8011BA80 00451021 */ addu $v0, $v0, $a1
/* B2184 8011BA84 A06200A5 */ sb $v0, 0xA5($v1)
/* B2188 8011BA88 008B102A */ slt $v0, $a0, $t3
/* B218C 8011BA8C 1440FFF5 */ bnez $v0, .L8011BA64
/* B2190 8011BA90 00000000 */ nop
.L8011BA94:
/* B2194 8011BA94 25240001 */ addiu $a0, $t1, 0x1
/* B2198 8011BA98 28820100 */ slti $v0, $a0, 0x100
/* B219C 8011BA9C 1040FFEA */ beqz $v0, .L8011BA48
/* B21A0 8011BAA0 010A3021 */ addu $a2, $t0, $t2
/* B21A4 8011BAA4 3C078015 */ lui $a3, %hi(gCurrentModels)
/* B21A8 8011BAA8 24E712CC */ addiu $a3, $a3, %lo(gCurrentModels)
.L8011BAAC:
/* B21AC 8011BAAC 8CE30000 */ lw $v1, 0x0($a3)
/* B21B0 8011BAB0 00041080 */ sll $v0, $a0, 2
/* B21B4 8011BAB4 00431021 */ addu $v0, $v0, $v1
/* B21B8 8011BAB8 8C430000 */ lw $v1, 0x0($v0)
/* B21BC 8011BABC 10600005 */ beqz $v1, .L8011BAD4
/* B21C0 8011BAC0 24840001 */ addiu $a0, $a0, 0x1
/* B21C4 8011BAC4 906200A5 */ lbu $v0, 0xA5($v1)
/* B21C8 8011BAC8 00461024 */ and $v0, $v0, $a2
/* B21CC 8011BACC 00451021 */ addu $v0, $v0, $a1
/* B21D0 8011BAD0 A06200A5 */ sb $v0, 0xA5($v1)
.L8011BAD4:
/* B21D4 8011BAD4 28820100 */ slti $v0, $a0, 0x100
/* B21D8 8011BAD8 1440FFF4 */ bnez $v0, .L8011BAAC
/* B21DC 8011BADC 00000000 */ nop
/* B21E0 8011BAE0 03E00008 */ jr $ra
/* B21E4 8011BAE4 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void func_8011B950(u16 treeIndex, s32 customGfxIndex, s32 fogType, s32 arg3) {
s32 maxGroupIndex = -1;
s32 i;
s32 minGroupIndex;
s32 modelIndex = (*mdl_currentModelTreeNodeInfo)[treeIndex].modelIndex;
s32 siblingIndex;
s32 maskLow, maskHigh, newIndex;
if (modelIndex < MAX_MODELS - 1) {
minGroupIndex = maxGroupIndex = modelIndex;
} else {
s32 treeDepth = (*mdl_currentModelTreeNodeInfo)[treeIndex].treeDepth;
for (i = treeIndex - 1; i >= 0; i--) {
if ((*mdl_currentModelTreeNodeInfo)[i].treeDepth <= treeDepth) {
break;
}
siblingIndex = (*mdl_currentModelTreeNodeInfo)[i].modelIndex;
if (siblingIndex < MAX_MODELS - 1) {
if (maxGroupIndex == -1) {
maxGroupIndex = siblingIndex;
}
minGroupIndex = siblingIndex;
}
}
}
maskLow = maskHigh = 0;
if (customGfxIndex < 0) {
maskLow = 0xF;
customGfxIndex = 0;
}
if (fogType < 0) {
maskHigh = 0xF0;
fogType = 0;
}
newIndex = customGfxIndex + (fogType << 4);
if (arg3 == 0) {
for (i = minGroupIndex; i <= maxGroupIndex; i++) {
Model* model = (*gCurrentModels)[i];
model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + newIndex;
}
} else {
for (i = 0; i < minGroupIndex; i++) {
Model* model = (*gCurrentModels)[i];
model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + newIndex;
}
for (i = maxGroupIndex + 1; i < MAX_MODELS; i++) {
Model* model = (*gCurrentModels)[i];
if (model != NULL) {
model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + newIndex;
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel get_screen_coords
/* 9938 8002E538 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 993C 8002E53C AFB20040 */ sw $s2, 0x40($sp)
/* 9940 8002E540 8FB20060 */ lw $s2, 0x60($sp)
/* 9944 8002E544 AFB30044 */ sw $s3, 0x44($sp)
/* 9948 8002E548 8FB30064 */ lw $s3, 0x64($sp)
/* 994C 8002E54C AFB1003C */ sw $s1, 0x3C($sp)
/* 9950 8002E550 8FB10068 */ lw $s1, 0x68($sp)
/* 9954 8002E554 27A20028 */ addiu $v0, $sp, 0x28
/* 9958 8002E558 AFA20014 */ sw $v0, 0x14($sp)
/* 995C 8002E55C 27A2002C */ addiu $v0, $sp, 0x2C
/* 9960 8002E560 AFA20018 */ sw $v0, 0x18($sp)
/* 9964 8002E564 27A20030 */ addiu $v0, $sp, 0x30
/* 9968 8002E568 AFA2001C */ sw $v0, 0x1C($sp)
/* 996C 8002E56C 27A20034 */ addiu $v0, $sp, 0x34
/* 9970 8002E570 3C08800B */ lui $t0, %hi(gCameras)
/* 9974 8002E574 25081D80 */ addiu $t0, $t0, %lo(gCameras)
/* 9978 8002E578 AFA20020 */ sw $v0, 0x20($sp)
/* 997C 8002E57C 00041080 */ sll $v0, $a0, 2
/* 9980 8002E580 00441021 */ addu $v0, $v0, $a0
/* 9984 8002E584 00021080 */ sll $v0, $v0, 2
/* 9988 8002E588 00441023 */ subu $v0, $v0, $a0
/* 998C 8002E58C 000218C0 */ sll $v1, $v0, 3
/* 9990 8002E590 00431021 */ addu $v0, $v0, $v1
/* 9994 8002E594 000210C0 */ sll $v0, $v0, 3
/* 9998 8002E598 AFB00038 */ sw $s0, 0x38($sp)
/* 999C 8002E59C 00488021 */ addu $s0, $v0, $t0
/* 99A0 8002E5A0 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 99A4 8002E5A4 44810000 */ mtc1 $at, $f0
/* 99A8 8002E5A8 260400D4 */ addiu $a0, $s0, 0xD4
/* 99AC 8002E5AC AFBF0048 */ sw $ra, 0x48($sp)
/* 99B0 8002E5B0 0C00A588 */ jal transform_point
/* 99B4 8002E5B4 E7A00010 */ swc1 $f0, 0x10($sp)
/* 99B8 8002E5B8 C7A00030 */ lwc1 $f0, 0x30($sp)
/* 99BC 8002E5BC 3C01459C */ lui $at, (0x459C4000 >> 16)
/* 99C0 8002E5C0 34214000 */ ori $at, $at, (0x459C4000 & 0xFFFF)
/* 99C4 8002E5C4 44811000 */ mtc1 $at, $f2
/* 99C8 8002E5C8 00000000 */ nop
/* 99CC 8002E5CC 46020000 */ add.s $f0, $f0, $f2
/* 99D0 8002E5D0 4600020D */ trunc.w.s $f8, $f0
/* 99D4 8002E5D4 44024000 */ mfc1 $v0, $f8
/* 99D8 8002E5D8 00000000 */ nop
/* 99DC 8002E5DC 04410003 */ bgez $v0, .L8002E5EC
/* 99E0 8002E5E0 AE220000 */ sw $v0, 0x0($s1)
/* 99E4 8002E5E4 0800B97F */ j .L8002E5FC
/* 99E8 8002E5E8 AE200000 */ sw $zero, 0x0($s1)
.L8002E5EC:
/* 99EC 8002E5EC 28422711 */ slti $v0, $v0, 0x2711
/* 99F0 8002E5F0 14400002 */ bnez $v0, .L8002E5FC
/* 99F4 8002E5F4 24022710 */ addiu $v0, $zero, 0x2710
/* 99F8 8002E5F8 AE220000 */ sw $v0, 0x0($s1)
.L8002E5FC:
/* 99FC 8002E5FC C7A20034 */ lwc1 $f2, 0x34($sp)
/* 9A00 8002E600 3C01800A */ lui $at, %hi(D_80098200)
/* 9A04 8002E604 D4208200 */ ldc1 $f0, %lo(D_80098200)($at)
/* 9A08 8002E608 460010A1 */ cvt.d.s $f2, $f2
/* 9A0C 8002E60C 4620103C */ c.lt.d $f2, $f0
/* 9A10 8002E610 00000000 */ nop
/* 9A14 8002E614 4500000B */ bc1f .L8002E644
/* 9A18 8002E618 00000000 */ nop
/* 9A1C 8002E61C 3C01800A */ lui $at, %hi(D_80098208)
/* 9A20 8002E620 D4208208 */ ldc1 $f0, %lo(D_80098208)($at)
/* 9A24 8002E624 4622003C */ c.lt.d $f0, $f2
/* 9A28 8002E628 00000000 */ nop
/* 9A2C 8002E62C 45000005 */ bc1f .L8002E644
/* 9A30 8002E630 00000000 */ nop
/* 9A34 8002E634 AE400000 */ sw $zero, 0x0($s2)
/* 9A38 8002E638 AE600000 */ sw $zero, 0x0($s3)
/* 9A3C 8002E63C 0800B9CE */ j .L8002E738
/* 9A40 8002E640 AE200000 */ sw $zero, 0x0($s1)
.L8002E644:
/* 9A44 8002E644 C7A00034 */ lwc1 $f0, 0x34($sp)
/* 9A48 8002E648 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 9A4C 8002E64C 44812000 */ mtc1 $at, $f4
/* 9A50 8002E650 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 9A54 8002E654 9603000A */ lhu $v1, 0xA($s0)
/* 9A58 8002E658 46002103 */ div.s $f4, $f4, $f0
/* 9A5C 8002E65C 46041082 */ mul.s $f2, $f2, $f4
/* 9A60 8002E660 00000000 */ nop
/* 9A64 8002E664 00031C00 */ sll $v1, $v1, 16
/* 9A68 8002E668 00031403 */ sra $v0, $v1, 16
/* 9A6C 8002E66C 44820000 */ mtc1 $v0, $f0
/* 9A70 8002E670 00000000 */ nop
/* 9A74 8002E674 46800020 */ cvt.s.w $f0, $f0
/* 9A78 8002E678 46001082 */ mul.s $f2, $f2, $f0
/* 9A7C 8002E67C 00000000 */ nop
/* 9A80 8002E680 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 9A84 8002E684 44813000 */ mtc1 $at, $f6
/* 9A88 8002E688 00000000 */ nop
/* 9A8C 8002E68C 46061082 */ mul.s $f2, $f2, $f6
/* 9A90 8002E690 00000000 */ nop
/* 9A94 8002E694 00031FC2 */ srl $v1, $v1, 31
/* 9A98 8002E698 00431021 */ addu $v0, $v0, $v1
/* 9A9C 8002E69C 00021043 */ sra $v0, $v0, 1
/* 9AA0 8002E6A0 44820000 */ mtc1 $v0, $f0
/* 9AA4 8002E6A4 00000000 */ nop
/* 9AA8 8002E6A8 46800020 */ cvt.s.w $f0, $f0
/* 9AAC 8002E6AC 46020000 */ add.s $f0, $f0, $f2
/* 9AB0 8002E6B0 E7A40034 */ swc1 $f4, 0x34($sp)
/* 9AB4 8002E6B4 8603000E */ lh $v1, 0xE($s0)
/* 9AB8 8002E6B8 4600020D */ trunc.w.s $f8, $f0
/* 9ABC 8002E6BC 44024000 */ mfc1 $v0, $f8
/* 9AC0 8002E6C0 00000000 */ nop
/* 9AC4 8002E6C4 00431021 */ addu $v0, $v0, $v1
/* 9AC8 8002E6C8 AE420000 */ sw $v0, 0x0($s2)
/* 9ACC 8002E6CC C7A2002C */ lwc1 $f2, 0x2C($sp)
/* 9AD0 8002E6D0 C7A00034 */ lwc1 $f0, 0x34($sp)
/* 9AD4 8002E6D4 9603000C */ lhu $v1, 0xC($s0)
/* 9AD8 8002E6D8 46001082 */ mul.s $f2, $f2, $f0
/* 9ADC 8002E6DC 00000000 */ nop
/* 9AE0 8002E6E0 00031C00 */ sll $v1, $v1, 16
/* 9AE4 8002E6E4 00031403 */ sra $v0, $v1, 16
/* 9AE8 8002E6E8 44820000 */ mtc1 $v0, $f0
/* 9AEC 8002E6EC 00000000 */ nop
/* 9AF0 8002E6F0 46800020 */ cvt.s.w $f0, $f0
/* 9AF4 8002E6F4 46001082 */ mul.s $f2, $f2, $f0
/* 9AF8 8002E6F8 00000000 */ nop
/* 9AFC 8002E6FC 46061082 */ mul.s $f2, $f2, $f6
/* 9B00 8002E700 00000000 */ nop
/* 9B04 8002E704 00031FC2 */ srl $v1, $v1, 31
/* 9B08 8002E708 00431021 */ addu $v0, $v0, $v1
/* 9B0C 8002E70C 00021043 */ sra $v0, $v0, 1
/* 9B10 8002E710 44820000 */ mtc1 $v0, $f0
/* 9B14 8002E714 00000000 */ nop
/* 9B18 8002E718 46800020 */ cvt.s.w $f0, $f0
/* 9B1C 8002E71C 46020001 */ sub.s $f0, $f0, $f2
/* 9B20 8002E720 86030010 */ lh $v1, 0x10($s0)
/* 9B24 8002E724 4600020D */ trunc.w.s $f8, $f0
/* 9B28 8002E728 44024000 */ mfc1 $v0, $f8
/* 9B2C 8002E72C 00000000 */ nop
/* 9B30 8002E730 00431021 */ addu $v0, $v0, $v1
/* 9B34 8002E734 AE620000 */ sw $v0, 0x0($s3)
.L8002E738:
/* 9B38 8002E738 8FBF0048 */ lw $ra, 0x48($sp)
/* 9B3C 8002E73C 8FB30044 */ lw $s3, 0x44($sp)
/* 9B40 8002E740 8FB20040 */ lw $s2, 0x40($sp)
/* 9B44 8002E744 8FB1003C */ lw $s1, 0x3C($sp)
/* 9B48 8002E748 8FB00038 */ lw $s0, 0x38($sp)
/* 9B4C 8002E74C 03E00008 */ jr $ra
/* 9B50 8002E750 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32* screenX, s32* screenY, s32* screenZ) {
Camera* camera = &gCameras[camID];
f32 tW;
f32 tZ;
f32 tY;
f32 tX;
transform_point(camera->perspectiveMatrix, x, y, z, 1.0f, &tX, &tY, &tZ, &tW);
*screenZ = tZ + 5000.0f;
if (*screenZ < 0) {
*screenZ = 0;
} else if (*screenZ > 10000) {
*screenZ = 10000;
}
if (tW < 0.01 && tW > -0.01) {
*screenX = 0;
*screenY = 0;
*screenZ = 0;
} else {
tW = 1.0f / tW;
*screenX = (s32) ((camera->viewportW / 2) + (tX * tW * camera->viewportW * 0.5f)) + camera->viewportStartX;
*screenY = (s32) ((camera->viewportH / 2) - (tY * tW * camera->viewportH * 0.5f)) + camera->viewportStartY;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel sweat_main
/* 35BFD0 E0050000 27BDFF58 */ addiu $sp, $sp, -0xA8
/* 35BFD4 E0050004 F7B80090 */ sdc1 $f24, 0x90($sp)
/* 35BFD8 E0050008 4485C000 */ mtc1 $a1, $f24
/* 35BFDC E005000C F7BA0098 */ sdc1 $f26, 0x98($sp)
/* 35BFE0 E0050010 4486D000 */ mtc1 $a2, $f26
/* 35BFE4 E0050014 AFB20078 */ sw $s2, 0x78($sp)
/* 35BFE8 E0050018 0080902D */ daddu $s2, $a0, $zero
/* 35BFEC E005001C F7BC00A0 */ sdc1 $f28, 0xA0($sp)
/* 35BFF0 E0050020 4487E000 */ mtc1 $a3, $f28
/* 35BFF4 E0050024 27A40018 */ addiu $a0, $sp, 0x18
/* 35BFF8 E0050028 F7B60088 */ sdc1 $f22, 0x88($sp)
/* 35BFFC E005002C C7B600BC */ lwc1 $f22, 0xBC($sp)
/* 35C000 E0050030 3C02E005 */ lui $v0, %hi(sweat_init)
/* 35C004 E0050034 244201D0 */ addiu $v0, $v0, %lo(sweat_init)
/* 35C008 E0050038 AFA20020 */ sw $v0, 0x20($sp)
/* 35C00C E005003C 3C02E005 */ lui $v0, %hi(sweat_update)
/* 35C010 E0050040 244201D8 */ addiu $v0, $v0, %lo(sweat_update)
/* 35C014 E0050044 AFA20024 */ sw $v0, 0x24($sp)
/* 35C018 E0050048 3C02E005 */ lui $v0, %hi(sweat_render)
/* 35C01C E005004C 244202C4 */ addiu $v0, $v0, %lo(sweat_render)
/* 35C020 E0050050 AFA20028 */ sw $v0, 0x28($sp)
/* 35C024 E0050054 24020028 */ addiu $v0, $zero, 0x28
/* 35C028 E0050058 AFBF007C */ sw $ra, 0x7C($sp)
/* 35C02C E005005C AFB10074 */ sw $s1, 0x74($sp)
/* 35C030 E0050060 AFB00070 */ sw $s0, 0x70($sp)
/* 35C034 E0050064 F7B40080 */ sdc1 $f20, 0x80($sp)
/* 35C038 E0050068 AFA00018 */ sw $zero, 0x18($sp)
/* 35C03C E005006C AFA0002C */ sw $zero, 0x2C($sp)
/* 35C040 E0050070 0C080124 */ jal shim_create_effect_instance
/* 35C044 E0050074 AFA2001C */ sw $v0, 0x1C($sp)
/* 35C048 E0050078 24040028 */ addiu $a0, $zero, 0x28
/* 35C04C E005007C 24030001 */ addiu $v1, $zero, 0x1
/* 35C050 E0050080 0040802D */ daddu $s0, $v0, $zero
/* 35C054 E0050084 0C08012C */ jal shim_general_heap_malloc
/* 35C058 E0050088 AE030008 */ sw $v1, 0x8($s0)
/* 35C05C E005008C 0040882D */ daddu $s1, $v0, $zero
/* 35C060 E0050090 16200003 */ bnez $s1, .LE00500A0
/* 35C064 E0050094 AE02000C */ sw $v0, 0xC($s0)
.LE0050098:
/* 35C068 E0050098 08014026 */ j .LE0050098
/* 35C06C E005009C 00000000 */ nop
.LE00500A0:
/* 35C070 E00500A0 3C108007 */ lui $s0, %hi(gCurrentCameraID)
/* 35C074 E00500A4 26107410 */ addiu $s0, $s0, %lo(gCurrentCameraID)
/* 35C078 E00500A8 8E030000 */ lw $v1, 0x0($s0)
/* 35C07C E00500AC AE320000 */ sw $s2, 0x0($s1)
/* 35C080 E00500B0 00031080 */ sll $v0, $v1, 2
/* 35C084 E00500B4 00431021 */ addu $v0, $v0, $v1
/* 35C088 E00500B8 00021080 */ sll $v0, $v0, 2
/* 35C08C E00500BC 00431023 */ subu $v0, $v0, $v1
/* 35C090 E00500C0 000218C0 */ sll $v1, $v0, 3
/* 35C094 E00500C4 00431021 */ addu $v0, $v0, $v1
/* 35C098 E00500C8 000210C0 */ sll $v0, $v0, 3
/* 35C09C E00500CC 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 35C0A0 E00500D0 00220821 */ addu $at, $at, $v0
/* 35C0A4 E00500D4 C42C1DEC */ lwc1 $f12, %lo(gCameras + 0x6C)($at)
/* 35C0A8 E00500D8 0C080140 */ jal shim_sin_deg
/* 35C0AC E00500DC 00000000 */ nop
/* 35C0B0 E00500E0 8E030000 */ lw $v1, 0x0($s0)
/* 35C0B4 E00500E4 00031080 */ sll $v0, $v1, 2
/* 35C0B8 E00500E8 00431021 */ addu $v0, $v0, $v1
/* 35C0BC E00500EC 00021080 */ sll $v0, $v0, 2
/* 35C0C0 E00500F0 00431023 */ subu $v0, $v0, $v1
/* 35C0C4 E00500F4 000218C0 */ sll $v1, $v0, 3
/* 35C0C8 E00500F8 00431021 */ addu $v0, $v0, $v1
/* 35C0CC E00500FC 000210C0 */ sll $v0, $v0, 3
/* 35C0D0 E0050100 3C01800B */ lui $at, %hi(gCameras + 0x6C)
/* 35C0D4 E0050104 00220821 */ addu $at, $at, $v0
/* 35C0D8 E0050108 C42C1DEC */ lwc1 $f12, %lo(gCameras + 0x6C)($at)
/* 35C0DC E005010C 0C080144 */ jal shim_cos_deg
/* 35C0E0 E0050110 46000506 */ mov.s $f20, $f0
/* 35C0E4 E0050114 27A40030 */ addiu $a0, $sp, 0x30
/* 35C0E8 E0050118 0000382D */ daddu $a3, $zero, $zero
/* 35C0EC E005011C 4600B107 */ neg.s $f4, $f22
/* 35C0F0 E0050120 4406A000 */ mfc1 $a2, $f20
/* 35C0F4 E0050124 44052000 */ mfc1 $a1, $f4
/* 35C0F8 E0050128 46000007 */ neg.s $f0, $f0
/* 35C0FC E005012C 0C080104 */ jal shim_guRotateF
/* 35C100 E0050130 E7A00010 */ swc1 $f0, 0x10($sp)
/* 35C104 E0050134 3C014180 */ lui $at, (0x41800000 >> 16)
/* 35C108 E0050138 44810000 */ mtc1 $at, $f0
/* 35C10C E005013C C7A200B8 */ lwc1 $f2, 0xB8($sp)
/* 35C110 E0050140 46001080 */ add.s $f2, $f2, $f0
/* 35C114 E0050144 C7A00040 */ lwc1 $f0, 0x40($sp)
/* 35C118 E0050148 46020002 */ mul.s $f0, $f0, $f2
/* 35C11C E005014C 00000000 */ nop
/* 35C120 E0050150 4600C000 */ add.s $f0, $f24, $f0
/* 35C124 E0050154 E6200004 */ swc1 $f0, 0x4($s1)
/* 35C128 E0050158 C7A00044 */ lwc1 $f0, 0x44($sp)
/* 35C12C E005015C 46020002 */ mul.s $f0, $f0, $f2
/* 35C130 E0050160 00000000 */ nop
/* 35C134 E0050164 4600D000 */ add.s $f0, $f26, $f0
/* 35C138 E0050168 E6200008 */ swc1 $f0, 0x8($s1)
/* 35C13C E005016C C7A00048 */ lwc1 $f0, 0x48($sp)
/* 35C140 E0050170 46020002 */ mul.s $f0, $f0, $f2
/* 35C144 E0050174 00000000 */ nop
/* 35C148 E0050178 4600E000 */ add.s $f0, $f28, $f0
/* 35C14C E005017C E620000C */ swc1 $f0, 0xC($s1)
/* 35C150 E0050180 C7A00040 */ lwc1 $f0, 0x40($sp)
/* 35C154 E0050184 E6200018 */ swc1 $f0, 0x18($s1)
/* 35C158 E0050188 C7A00044 */ lwc1 $f0, 0x44($sp)
/* 35C15C E005018C E620001C */ swc1 $f0, 0x1C($s1)
/* 35C160 E0050190 C7A00048 */ lwc1 $f0, 0x48($sp)
/* 35C164 E0050194 E6360010 */ swc1 $f22, 0x10($s1)
/* 35C168 E0050198 8FA200C0 */ lw $v0, 0xC0($sp)
/* 35C16C E005019C AE220024 */ sw $v0, 0x24($s1)
/* 35C170 E00501A0 E6200020 */ swc1 $f0, 0x20($s1)
/* 35C174 E00501A4 8FBF007C */ lw $ra, 0x7C($sp)
/* 35C178 E00501A8 8FB20078 */ lw $s2, 0x78($sp)
/* 35C17C E00501AC 8FB10074 */ lw $s1, 0x74($sp)
/* 35C180 E00501B0 8FB00070 */ lw $s0, 0x70($sp)
/* 35C184 E00501B4 D7BC00A0 */ ldc1 $f28, 0xA0($sp)
/* 35C188 E00501B8 D7BA0098 */ ldc1 $f26, 0x98($sp)
/* 35C18C E00501BC D7B80090 */ ldc1 $f24, 0x90($sp)
/* 35C190 E00501C0 D7B60088 */ ldc1 $f22, 0x88($sp)
/* 35C194 E00501C4 D7B40080 */ ldc1 $f20, 0x80($sp)
/* 35C198 E00501C8 03E00008 */ jr $ra
/* 35C19C E00501CC 27BD00A8 */ addiu $sp, $sp, 0xA8
### DECOMPILED C INSTRUCTIONS:
void sweat_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, s32 timeLeft) {
EffectBlueprint effectBp;
EffectInstance* effect;
SweatFXData* data;
Matrix4f matrix;
f32 temp_f2;
s32 numParts = 1;
effectBp.init = (void*)sweat_init;
effectBp.update = sweat_update;
effectBp.renderWorld = sweat_render;
effectBp.unk_00 = 0;
effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_SWEAT;
effect = shim_create_effect_instance(&effectBp);
effect->numParts = numParts;
data = effect->data.sweat = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL);
data->unk_00 = arg0;
shim_guRotateF(matrix, -arg5, shim_sin_deg(gCameras[gCurrentCameraID].currentYaw), 0.0f, -shim_cos_deg(gCameras[gCurrentCameraID].currentYaw));
temp_f2 = arg4 + 16.0f;
data->pos.x = arg1 + (matrix[1][0] * temp_f2);
data->pos.y = arg2 + (matrix[1][1] * temp_f2);
data->pos.z = arg3 + (matrix[1][2] * temp_f2);
data->unk_18 = matrix[1][0];
data->unk_1C = matrix[1][1];
data->unk_20 = matrix[1][2];
data->unk_10 = arg5;
data->timeLeft = timeLeft;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel imgfx_mesh_make_grid
/* D2748 8013C048 0080582D */ daddu $t3, $a0, $zero
/* D274C 8013C04C 3C098015 */ lui $t1, %hi(imgfx_vtxCount)
/* D2750 8013C050 2529EE14 */ addiu $t1, $t1, %lo(imgfx_vtxCount)
/* D2754 8013C054 0000402D */ daddu $t0, $zero, $zero
/* D2758 8013C058 91660004 */ lbu $a2, 0x4($t3)
/* D275C 8013C05C 44804000 */ mtc1 $zero, $f8
/* D2760 8013C060 95220000 */ lhu $v0, 0x0($t1)
/* D2764 8013C064 3C038015 */ lui $v1, %hi(imgfx_vtxBuf)
/* D2768 8013C068 8C636950 */ lw $v1, %lo(imgfx_vtxBuf)($v1)
/* D276C 8013C06C 3C0A8015 */ lui $t2, %hi(ImgFXCurrentTexturePtr)
/* D2770 8013C070 254AEE10 */ addiu $t2, $t2, %lo(ImgFXCurrentTexturePtr)
/* D2774 8013C074 A5620008 */ sh $v0, 0x8($t3)
/* D2778 8013C078 95220000 */ lhu $v0, 0x0($t1)
/* D277C 8013C07C 8D450000 */ lw $a1, 0x0($t2)
/* D2780 8013C080 00021100 */ sll $v0, $v0, 4
/* D2784 8013C084 00623821 */ addu $a3, $v1, $v0
/* D2788 8013C088 84A4000E */ lh $a0, 0xE($a1)
/* D278C 8013C08C 94A20008 */ lhu $v0, 0x8($a1)
/* D2790 8013C090 91630003 */ lbu $v1, 0x3($t3)
/* D2794 8013C094 44843000 */ mtc1 $a0, $f6
/* D2798 8013C098 00000000 */ nop
/* D279C 8013C09C 468031A0 */ cvt.s.w $f6, $f6
/* D27A0 8013C0A0 44821000 */ mtc1 $v0, $f2
/* D27A4 8013C0A4 00000000 */ nop
/* D27A8 8013C0A8 468010A0 */ cvt.s.w $f2, $f2
/* D27AC 8013C0AC 44830000 */ mtc1 $v1, $f0
/* D27B0 8013C0B0 00000000 */ nop
/* D27B4 8013C0B4 46800020 */ cvt.s.w $f0, $f0
/* D27B8 8013C0B8 46001283 */ div.s $f10, $f2, $f0
/* D27BC 8013C0BC 94A2000A */ lhu $v0, 0xA($a1)
/* D27C0 8013C0C0 44860000 */ mtc1 $a2, $f0
/* D27C4 8013C0C4 00000000 */ nop
/* D27C8 8013C0C8 46800020 */ cvt.s.w $f0, $f0
/* D27CC 8013C0CC 44821000 */ mtc1 $v0, $f2
/* D27D0 8013C0D0 00000000 */ nop
/* D27D4 8013C0D4 468010A0 */ cvt.s.w $f2, $f2
/* D27D8 8013C0D8 00C8102A */ slt $v0, $a2, $t0
/* D27DC 8013C0DC 1440004B */ bnez $v0, .L8013C20C
/* D27E0 8013C0E0 46001083 */ div.s $f2, $f2, $f0
/* D27E4 8013C0E4 0140282D */ daddu $a1, $t2, $zero
/* D27E8 8013C0E8 0120602D */ daddu $t4, $t1, $zero
.L8013C0EC:
/* D27EC 8013C0EC 1506000B */ bne $t0, $a2, .L8013C11C
/* D27F0 8013C0F0 0000302D */ daddu $a2, $zero, $zero
/* D27F4 8013C0F4 8CA20000 */ lw $v0, 0x0($a1)
/* D27F8 8013C0F8 9443000A */ lhu $v1, 0xA($v0)
/* D27FC 8013C0FC 8442000E */ lh $v0, 0xE($v0)
/* D2800 8013C100 44834000 */ mtc1 $v1, $f8
/* D2804 8013C104 00000000 */ nop
/* D2808 8013C108 46804220 */ cvt.s.w $f8, $f8
/* D280C 8013C10C 00431023 */ subu $v0, $v0, $v1
/* D2810 8013C110 44823000 */ mtc1 $v0, $f6
/* D2814 8013C114 00000000 */ nop
/* D2818 8013C118 468031A0 */ cvt.s.w $f6, $f6
.L8013C11C:
/* D281C 8013C11C 8CA20000 */ lw $v0, 0x0($a1)
/* D2820 8013C120 44802000 */ mtc1 $zero, $f4
/* D2824 8013C124 8442000C */ lh $v0, 0xC($v0)
/* D2828 8013C128 91630003 */ lbu $v1, 0x3($t3)
/* D282C 8013C12C 44820000 */ mtc1 $v0, $f0
/* D2830 8013C130 00000000 */ nop
/* D2834 8013C134 46800020 */ cvt.s.w $f0, $f0
/* D2838 8013C138 0066102A */ slt $v0, $v1, $a2
/* D283C 8013C13C 5440002E */ bnel $v0, $zero, .L8013C1F8
/* D2840 8013C140 46023181 */ sub.s $f6, $f6, $f2
/* D2844 8013C144 4600330D */ trunc.w.s $f12, $f6
/* D2848 8013C148 440A6000 */ mfc1 $t2, $f12
/* D284C 8013C14C 4600430D */ trunc.w.s $f12, $f8
/* D2850 8013C150 44026000 */ mfc1 $v0, $f12
/* D2854 8013C154 00000000 */ nop
/* D2858 8013C158 24420100 */ addiu $v0, $v0, 0x100
/* D285C 8013C15C 00024940 */ sll $t1, $v0, 5
/* D2860 8013C160 24E4000A */ addiu $a0, $a3, 0xA
.L8013C164:
/* D2864 8013C164 14C3000B */ bne $a2, $v1, .L8013C194
/* D2868 8013C168 00000000 */ nop
/* D286C 8013C16C 8CA20000 */ lw $v0, 0x0($a1)
/* D2870 8013C170 94430008 */ lhu $v1, 0x8($v0)
/* D2874 8013C174 8442000C */ lh $v0, 0xC($v0)
/* D2878 8013C178 44832000 */ mtc1 $v1, $f4
/* D287C 8013C17C 00000000 */ nop
/* D2880 8013C180 46802120 */ cvt.s.w $f4, $f4
/* D2884 8013C184 00431021 */ addu $v0, $v0, $v1
/* D2888 8013C188 44820000 */ mtc1 $v0, $f0
/* D288C 8013C18C 00000000 */ nop
/* D2890 8013C190 46800020 */ cvt.s.w $f0, $f0
.L8013C194:
/* D2894 8013C194 4600030D */ trunc.w.s $f12, $f0
/* D2898 8013C198 44026000 */ mfc1 $v0, $f12
/* D289C 8013C19C 00000000 */ nop
/* D28A0 8013C1A0 A4E20000 */ sh $v0, 0x0($a3)
/* D28A4 8013C1A4 4600230D */ trunc.w.s $f12, $f4
/* D28A8 8013C1A8 44026000 */ mfc1 $v0, $f12
/* D28AC 8013C1AC 00000000 */ nop
/* D28B0 8013C1B0 24420100 */ addiu $v0, $v0, 0x100
/* D28B4 8013C1B4 00021140 */ sll $v0, $v0, 5
/* D28B8 8013C1B8 A48AFFF8 */ sh $t2, -0x8($a0)
/* D28BC 8013C1BC A480FFFA */ sh $zero, -0x6($a0)
/* D28C0 8013C1C0 A482FFFE */ sh $v0, -0x2($a0)
/* D28C4 8013C1C4 A4890000 */ sh $t1, 0x0($a0)
/* D28C8 8013C1C8 24840010 */ addiu $a0, $a0, 0x10
/* D28CC 8013C1CC 24E70010 */ addiu $a3, $a3, 0x10
/* D28D0 8013C1D0 24C60001 */ addiu $a2, $a2, 0x1
/* D28D4 8013C1D4 95820000 */ lhu $v0, 0x0($t4)
/* D28D8 8013C1D8 460A0000 */ add.s $f0, $f0, $f10
/* D28DC 8013C1DC 24420001 */ addiu $v0, $v0, 0x1
/* D28E0 8013C1E0 A5820000 */ sh $v0, 0x0($t4)
/* D28E4 8013C1E4 91630003 */ lbu $v1, 0x3($t3)
/* D28E8 8013C1E8 0066102A */ slt $v0, $v1, $a2
/* D28EC 8013C1EC 1040FFDD */ beqz $v0, .L8013C164
/* D28F0 8013C1F0 460A2100 */ add.s $f4, $f4, $f10
/* D28F4 8013C1F4 46023181 */ sub.s $f6, $f6, $f2
.L8013C1F8:
/* D28F8 8013C1F8 25080001 */ addiu $t0, $t0, 0x1
/* D28FC 8013C1FC 91660004 */ lbu $a2, 0x4($t3)
/* D2900 8013C200 00C8102A */ slt $v0, $a2, $t0
/* D2904 8013C204 1040FFB9 */ beqz $v0, .L8013C0EC
/* D2908 8013C208 46024200 */ add.s $f8, $f8, $f2
.L8013C20C:
/* D290C 8013C20C 3C028015 */ lui $v0, %hi(imgfx_vtxCount)
/* D2910 8013C210 9442EE14 */ lhu $v0, %lo(imgfx_vtxCount)($v0)
/* D2914 8013C214 2442FFFF */ addiu $v0, $v0, -0x1
/* D2918 8013C218 03E00008 */ jr $ra
/* D291C 8013C21C A562000A */ sh $v0, 0xA($t3)
### DECOMPILED C INSTRUCTIONS:
void imgfx_mesh_make_grid(ImgFXState* state) {
f32 divSizeX;
f32 divSizeY;
f32 posX;
f32 posY;
f32 texU;
f32 texV;
Vtx* vtx;
s32 i;
state->firstVtxIdx = imgfx_vtxCount;
divSizeX = ImgFXCurrentTexturePtr->tex.width / (f32) state->subdivX;
divSizeY = ImgFXCurrentTexturePtr->tex.height / (f32) state->subdivY;
posY = ImgFXCurrentTexturePtr->tex.yOffset;
texV = 0.0f;
vtx = &imgfx_vtxBuf[imgfx_vtxCount];
for (i = 0; i <= state->subdivY; i++) {
s32 j;
if (i == state->subdivY) {
texV = ImgFXCurrentTexturePtr->tex.height;
posY = ImgFXCurrentTexturePtr->tex.yOffset - ImgFXCurrentTexturePtr->tex.height;
}
posX = ImgFXCurrentTexturePtr->tex.xOffset;
texU = 0.0f;
for (j = 0; j <= state->subdivX; vtx++, j++) {
if (j == state->subdivX) {
texU = ImgFXCurrentTexturePtr->tex.width;
posX = ImgFXCurrentTexturePtr->tex.xOffset + ImgFXCurrentTexturePtr->tex.width;
}
vtx->n.ob[0] = posX;
vtx->n.ob[1] = posY;
vtx->n.ob[2] = 0;
vtx->n.tc[0] = ((s32) texU + 256) * 32;
vtx->n.tc[1] = ((s32) texV + 256) * 32;
imgfx_vtxCount++;
posX += divSizeX;
texU += divSizeX;
}
posY -= divSizeY;
texV += divSizeY;
}
state->lastVtxIdx = imgfx_vtxCount - 1;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_8025950C
/* 187DEC 8025950C 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 187DF0 80259510 AFB1001C */ sw $s1, 0x1C($sp)
/* 187DF4 80259514 0080882D */ daddu $s1, $a0, $zero
/* 187DF8 80259518 AFB20020 */ sw $s2, 0x20($sp)
/* 187DFC 8025951C 00A0902D */ daddu $s2, $a1, $zero
/* 187E00 80259520 AFB30024 */ sw $s3, 0x24($sp)
/* 187E04 80259524 00C0982D */ daddu $s3, $a2, $zero
/* 187E08 80259528 240600FF */ addiu $a2, $zero, 0xFF
/* 187E0C 8025952C AFBF0028 */ sw $ra, 0x28($sp)
/* 187E10 80259530 AFB00018 */ sw $s0, 0x18($sp)
/* 187E14 80259534 86230098 */ lh $v1, 0x98($s1)
/* 187E18 80259538 8E3000C0 */ lw $s0, 0xC0($s1)
/* 187E1C 8025953C 0066102A */ slt $v0, $v1, $a2
/* 187E20 80259540 10400003 */ beqz $v0, .L80259550
/* 187E24 80259544 0000382D */ daddu $a3, $zero, $zero
/* 187E28 80259548 3C078000 */ lui $a3, (0x80000000 >> 16)
/* 187E2C 8025954C 0060302D */ daddu $a2, $v1, $zero
.L80259550:
/* 187E30 80259550 8E220000 */ lw $v0, 0x0($s1)
/* 187E34 80259554 30420100 */ andi $v0, $v0, 0x100
/* 187E38 80259558 1040000C */ beqz $v0, .L8025958C
/* 187E3C 8025955C 3C038080 */ lui $v1, (0x80808081 >> 16)
/* 187E40 80259560 34638081 */ ori $v1, $v1, (0x80808081 & 0xFFFF)
/* 187E44 80259564 00061100 */ sll $v0, $a2, 4
/* 187E48 80259568 00461023 */ subu $v0, $v0, $a2
/* 187E4C 8025956C 000210C0 */ sll $v0, $v0, 3
/* 187E50 80259570 00430018 */ mult $v0, $v1
/* 187E54 80259574 3C078000 */ lui $a3, (0x80000000 >> 16)
/* 187E58 80259578 00004010 */ mfhi $t0
/* 187E5C 8025957C 01021821 */ addu $v1, $t0, $v0
/* 187E60 80259580 000319C3 */ sra $v1, $v1, 7
/* 187E64 80259584 000217C3 */ sra $v0, $v0, 31
/* 187E68 80259588 00623023 */ subu $a2, $v1, $v0
.L8025958C:
/* 187E6C 8025958C 92020768 */ lbu $v0, 0x768($s0)
/* 187E70 80259590 1040003F */ beqz $v0, .L80259690
/* 187E74 80259594 0240282D */ daddu $a1, $s2, $zero
/* 187E78 80259598 96240088 */ lhu $a0, 0x88($s1)
/* 187E7C 8025959C 0C0B7A90 */ jal spr_get_npc_palettes
/* 187E80 802595A0 00000000 */ nop
/* 187E84 802595A4 AE0206D0 */ sw $v0, 0x6D0($s0)
/* 187E88 802595A8 0040202D */ daddu $a0, $v0, $zero
/* 187E8C 802595AC A20006CD */ sb $zero, 0x6CD($s0)
/* 187E90 802595B0 8C830000 */ lw $v1, 0x0($a0)
/* 187E94 802595B4 2402FFFF */ addiu $v0, $zero, -0x1
/* 187E98 802595B8 1062000C */ beq $v1, $v0, .L802595EC
/* 187E9C 802595BC 00000000 */ nop
/* 187EA0 802595C0 0080182D */ daddu $v1, $a0, $zero
/* 187EA4 802595C4 0040202D */ daddu $a0, $v0, $zero
.L802595C8:
/* 187EA8 802595C8 920206CD */ lbu $v0, 0x6CD($s0)
/* 187EAC 802595CC 24420001 */ addiu $v0, $v0, 0x1
/* 187EB0 802595D0 A20206CD */ sb $v0, 0x6CD($s0)
/* 187EB4 802595D4 00021600 */ sll $v0, $v0, 24
/* 187EB8 802595D8 00021583 */ sra $v0, $v0, 22
/* 187EBC 802595DC 00431021 */ addu $v0, $v0, $v1
/* 187EC0 802595E0 8C420000 */ lw $v0, 0x0($v0)
/* 187EC4 802595E4 1444FFF8 */ bne $v0, $a0, .L802595C8
/* 187EC8 802595E8 00000000 */ nop
.L802595EC:
/* 187ECC 802595EC 820206CD */ lb $v0, 0x6CD($s0)
/* 187ED0 802595F0 18400016 */ blez $v0, .L8025964C
/* 187ED4 802595F4 0000302D */ daddu $a2, $zero, $zero
.L802595F8:
/* 187ED8 802595F8 8E0206D0 */ lw $v0, 0x6D0($s0)
/* 187EDC 802595FC 00061880 */ sll $v1, $a2, 2
/* 187EE0 80259600 00621821 */ addu $v1, $v1, $v0
/* 187EE4 80259604 00061140 */ sll $v0, $a2, 5
/* 187EE8 80259608 8C630000 */ lw $v1, 0x0($v1)
/* 187EEC 8025960C 10600009 */ beqz $v1, .L80259634
/* 187EF0 80259610 02022821 */ addu $a1, $s0, $v0
/* 187EF4 80259614 0000202D */ daddu $a0, $zero, $zero
.L80259618:
/* 187EF8 80259618 94620000 */ lhu $v0, 0x0($v1)
/* 187EFC 8025961C 24630002 */ addiu $v1, $v1, 0x2
/* 187F00 80259620 24840001 */ addiu $a0, $a0, 0x1
/* 187F04 80259624 A4A20000 */ sh $v0, 0x0($a1)
/* 187F08 80259628 28820010 */ slti $v0, $a0, 0x10
/* 187F0C 8025962C 1440FFFA */ bnez $v0, .L80259618
/* 187F10 80259630 24A50002 */ addiu $a1, $a1, 0x2
.L80259634:
/* 187F14 80259634 820206CD */ lb $v0, 0x6CD($s0)
/* 187F18 80259638 24C60001 */ addiu $a2, $a2, 0x1
/* 187F1C 8025963C 00C2102A */ slt $v0, $a2, $v0
/* 187F20 80259640 1440FFED */ bnez $v0, .L802595F8
/* 187F24 80259644 00000000 */ nop
/* 187F28 80259648 820206CD */ lb $v0, 0x6CD($s0)
.L8025964C:
/* 187F2C 8025964C 1840000A */ blez $v0, .L80259678
/* 187F30 80259650 0000302D */ daddu $a2, $zero, $zero
/* 187F34 80259654 0200202D */ daddu $a0, $s0, $zero
/* 187F38 80259658 0200182D */ daddu $v1, $s0, $zero
.L8025965C:
/* 187F3C 8025965C AC6406D4 */ sw $a0, 0x6D4($v1)
/* 187F40 80259660 24840020 */ addiu $a0, $a0, 0x20
/* 187F44 80259664 820206CD */ lb $v0, 0x6CD($s0)
/* 187F48 80259668 24C60001 */ addiu $a2, $a2, 0x1
/* 187F4C 8025966C 00C2102A */ slt $v0, $a2, $v0
/* 187F50 80259670 1440FFFA */ bnez $v0, .L8025965C
/* 187F54 80259674 24630004 */ addiu $v1, $v1, 0x4
.L80259678:
/* 187F58 80259678 0220202D */ daddu $a0, $s1, $zero
/* 187F5C 8025967C 0240282D */ daddu $a1, $s2, $zero
/* 187F60 80259680 0C0965B0 */ jal func_802596C0
/* 187F64 80259684 0260302D */ daddu $a2, $s3, $zero
/* 187F68 80259688 080965A9 */ j .L802596A4
/* 187F6C 8025968C 00000000 */ nop
.L80259690:
/* 187F70 80259690 8E240084 */ lw $a0, 0x84($s1)
/* 187F74 80259694 AFB30010 */ sw $s3, 0x10($sp)
/* 187F78 80259698 00872025 */ or $a0, $a0, $a3
/* 187F7C 8025969C 0C0B78F6 */ jal spr_draw_npc_sprite
/* 187F80 802596A0 0000382D */ daddu $a3, $zero, $zero
.L802596A4:
/* 187F84 802596A4 8FBF0028 */ lw $ra, 0x28($sp)
/* 187F88 802596A8 8FB30024 */ lw $s3, 0x24($sp)
/* 187F8C 802596AC 8FB20020 */ lw $s2, 0x20($sp)
/* 187F90 802596B0 8FB1001C */ lw $s1, 0x1C($sp)
/* 187F94 802596B4 8FB00018 */ lw $s0, 0x18($sp)
/* 187F98 802596B8 03E00008 */ jr $ra
/* 187F9C 802596BC 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void func_8025950C(ActorPart* part, s32 yaw, Matrix4f mtx) {
DecorationTable* decor = part->decorationTable;
s32 opacity = 255;
s32 idMask = 0;
PAL_PTR dest;
PAL_PTR src;
s32 i, j;
if (part->opacity < 255) {
idMask = DRAW_SPRITE_OVERRIDE_ALPHA;
opacity = part->opacity;
}
if (part->flags & ACTOR_PART_FLAG_100) {
idMask = DRAW_SPRITE_OVERRIDE_ALPHA;
opacity = (opacity * 120) / 255;
}
if (decor->unk_768 != 0) {
decor->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 0x10);
decor->originalPalettesCount = 0;
while (decor->originalPalettesList[decor->originalPalettesCount] != (PAL_PTR) -1) {
decor->originalPalettesCount++;
}
for (i = 0; i < decor->originalPalettesCount; i++) {
src = decor->originalPalettesList[i];
dest = decor->copiedPalettes[0][i];
if (src != NULL) {
for (j = 0; j < ARRAY_COUNT(decor->copiedPalettes[0][i]); j++) {
*dest = *src;
src++;
dest++;
}
}
}
for (i = 0; i < decor->originalPalettesCount; i++) {
decor->adjustedPalettes[i] = decor->copiedPalettes[0][i];
}
func_802596C0(part, yaw, mtx);
} else {
spr_draw_npc_sprite(part->spriteInstanceID | idMask, yaw, opacity, NULL, mtx);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_E00828B4
/* 385EF4 E00828B4 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 385EF8 E00828B8 AFB50024 */ sw $s5, 0x24($sp)
/* 385EFC E00828BC 0080A82D */ daddu $s5, $a0, $zero
/* 385F00 E00828C0 3C06DB06 */ lui $a2, (0xDB060024 >> 16)
/* 385F04 E00828C4 34C60024 */ ori $a2, $a2, (0xDB060024 & 0xFFFF)
/* 385F08 E00828C8 AFB20018 */ sw $s2, 0x18($sp)
/* 385F0C E00828CC 24120001 */ addiu $s2, $zero, 0x1
/* 385F10 E00828D0 AFB00010 */ sw $s0, 0x10($sp)
/* 385F14 E00828D4 3C10800A */ lui $s0, %hi(gMainGfxPos)
/* 385F18 E00828D8 2610A66C */ addiu $s0, $s0, %lo(gMainGfxPos)
/* 385F1C E00828DC 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 385F20 E00828E0 AFBF0034 */ sw $ra, 0x34($sp)
/* 385F24 E00828E4 AFBE0030 */ sw $fp, 0x30($sp)
/* 385F28 E00828E8 AFB7002C */ sw $s7, 0x2C($sp)
/* 385F2C E00828EC AFB60028 */ sw $s6, 0x28($sp)
/* 385F30 E00828F0 AFB40020 */ sw $s4, 0x20($sp)
/* 385F34 E00828F4 AFB3001C */ sw $s3, 0x1C($sp)
/* 385F38 E00828F8 AFB10014 */ sw $s1, 0x14($sp)
/* 385F3C E00828FC 8E050000 */ lw $a1, 0x0($s0)
/* 385F40 E0082900 8EB1000C */ lw $s1, 0xC($s5)
/* 385F44 E0082904 00A0182D */ daddu $v1, $a1, $zero
/* 385F48 E0082908 24A50008 */ addiu $a1, $a1, 0x8
/* 385F4C E008290C 0220202D */ daddu $a0, $s1, $zero
/* 385F50 E0082910 AE050000 */ sw $a1, 0x0($s0)
/* 385F54 E0082914 AC620000 */ sw $v0, 0x0($v1)
/* 385F58 E0082918 AC600004 */ sw $zero, 0x4($v1)
/* 385F5C E008291C ACA60000 */ sw $a2, 0x0($a1)
/* 385F60 E0082920 8EA30010 */ lw $v1, 0x10($s5)
/* 385F64 E0082924 24A20008 */ addiu $v0, $a1, 0x8
/* 385F68 E0082928 AE020000 */ sw $v0, 0x0($s0)
/* 385F6C E008292C 8C62001C */ lw $v0, 0x1C($v1)
/* 385F70 E0082930 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 385F74 E0082934 00431021 */ addu $v0, $v0, $v1
/* 385F78 E0082938 0C020960 */ jal func_E0082580
/* 385F7C E008293C ACA20004 */ sw $v0, 0x4($a1)
/* 385F80 E0082940 8E360038 */ lw $s6, 0x38($s1)
/* 385F84 E0082944 8E330000 */ lw $s3, 0x0($s1)
/* 385F88 E0082948 8EA20008 */ lw $v0, 0x8($s5)
/* 385F8C E008294C 0242102A */ slt $v0, $s2, $v0
/* 385F90 E0082950 10400030 */ beqz $v0, .LE0082A14
/* 385F94 E0082954 26310048 */ addiu $s1, $s1, 0x48
/* 385F98 E0082958 0240F02D */ daddu $fp, $s2, $zero
/* 385F9C E008295C 3C14DE00 */ lui $s4, (0xDE000000 >> 16)
/* 385FA0 E0082960 3C170900 */ lui $s7, %hi(D_09002198_40F428)
/* 385FA4 E0082964 26F72198 */ addiu $s7, $s7, %lo(D_09002198_40F428)
.LE0082968:
/* 385FA8 E0082968 1EC00003 */ bgtz $s6, .LE0082978
/* 385FAC E008296C 2407000A */ addiu $a3, $zero, 0xA
/* 385FB0 E0082970 56670024 */ bnel $s3, $a3, .LE0082A04
/* 385FB4 E0082974 26520001 */ addiu $s2, $s2, 0x1
.LE0082978:
/* 385FB8 E0082978 167E0008 */ bne $s3, $fp, .LE008299C
/* 385FBC E008297C 00000000 */ nop
/* 385FC0 E0082980 8E020000 */ lw $v0, 0x0($s0)
/* 385FC4 E0082984 0040182D */ daddu $v1, $v0, $zero
/* 385FC8 E0082988 24420008 */ addiu $v0, $v0, 0x8
/* 385FCC E008298C AE020000 */ sw $v0, 0x0($s0)
/* 385FD0 E0082990 AC740000 */ sw $s4, 0x0($v1)
/* 385FD4 E0082994 08020A6F */ j .LE00829BC
/* 385FD8 E0082998 AC770004 */ sw $s7, 0x4($v1)
.LE008299C:
/* 385FDC E008299C 8E020000 */ lw $v0, 0x0($s0)
/* 385FE0 E00829A0 0040182D */ daddu $v1, $v0, $zero
/* 385FE4 E00829A4 24420008 */ addiu $v0, $v0, 0x8
/* 385FE8 E00829A8 AE020000 */ sw $v0, 0x0($s0)
/* 385FEC E00829AC 3C020900 */ lui $v0, %hi(D_09002100_40F390)
/* 385FF0 E00829B0 24422100 */ addiu $v0, $v0, %lo(D_09002100_40F390)
/* 385FF4 E00829B4 AC740000 */ sw $s4, 0x0($v1)
/* 385FF8 E00829B8 AC620004 */ sw $v0, 0x4($v1)
.LE00829BC:
/* 385FFC E00829BC 0C0209B1 */ jal func_E00826C4
/* 386000 E00829C0 0220202D */ daddu $a0, $s1, $zero
/* 386004 E00829C4 3C05D838 */ lui $a1, (0xD8380002 >> 16)
/* 386008 E00829C8 34A50002 */ ori $a1, $a1, (0xD8380002 & 0xFFFF)
/* 38600C E00829CC 8E030000 */ lw $v1, 0x0($s0)
/* 386010 E00829D0 3C020900 */ lui $v0, %hi(D_09002230_40F4C0)
/* 386014 E00829D4 24422230 */ addiu $v0, $v0, %lo(D_09002230_40F4C0)
/* 386018 E00829D8 0060202D */ daddu $a0, $v1, $zero
/* 38601C E00829DC 24630008 */ addiu $v1, $v1, 0x8
/* 386020 E00829E0 AE030000 */ sw $v1, 0x0($s0)
/* 386024 E00829E4 AC820004 */ sw $v0, 0x4($a0)
/* 386028 E00829E8 24620008 */ addiu $v0, $v1, 0x8
/* 38602C E00829EC AC940000 */ sw $s4, 0x0($a0)
/* 386030 E00829F0 AE020000 */ sw $v0, 0x0($s0)
/* 386034 E00829F4 24020040 */ addiu $v0, $zero, 0x40
/* 386038 E00829F8 AC650000 */ sw $a1, 0x0($v1)
/* 38603C E00829FC AC620004 */ sw $v0, 0x4($v1)
/* 386040 E0082A00 26520001 */ addiu $s2, $s2, 0x1
.LE0082A04:
/* 386044 E0082A04 8EA20008 */ lw $v0, 0x8($s5)
/* 386048 E0082A08 0242102A */ slt $v0, $s2, $v0
/* 38604C E0082A0C 1440FFD6 */ bnez $v0, .LE0082968
/* 386050 E0082A10 26310048 */ addiu $s1, $s1, 0x48
.LE0082A14:
/* 386054 E0082A14 3C03D838 */ lui $v1, (0xD8380002 >> 16)
/* 386058 E0082A18 3C04800A */ lui $a0, %hi(gMainGfxPos)
/* 38605C E0082A1C 2484A66C */ addiu $a0, $a0, %lo(gMainGfxPos)
/* 386060 E0082A20 8C820000 */ lw $v0, 0x0($a0)
/* 386064 E0082A24 34630002 */ ori $v1, $v1, (0xD8380002 & 0xFFFF)
/* 386068 E0082A28 0040282D */ daddu $a1, $v0, $zero
/* 38606C E0082A2C 24420008 */ addiu $v0, $v0, 0x8
/* 386070 E0082A30 AC820000 */ sw $v0, 0x0($a0)
/* 386074 E0082A34 ACA30000 */ sw $v1, 0x0($a1)
/* 386078 E0082A38 24030040 */ addiu $v1, $zero, 0x40
/* 38607C E0082A3C ACA30004 */ sw $v1, 0x4($a1)
/* 386080 E0082A40 24430008 */ addiu $v1, $v0, 0x8
/* 386084 E0082A44 AC830000 */ sw $v1, 0x0($a0)
/* 386088 E0082A48 3C03E700 */ lui $v1, (0xE7000000 >> 16)
/* 38608C E0082A4C AC430000 */ sw $v1, 0x0($v0)
/* 386090 E0082A50 AC400004 */ sw $zero, 0x4($v0)
/* 386094 E0082A54 8FBF0034 */ lw $ra, 0x34($sp)
/* 386098 E0082A58 8FBE0030 */ lw $fp, 0x30($sp)
/* 38609C E0082A5C 8FB7002C */ lw $s7, 0x2C($sp)
/* 3860A0 E0082A60 8FB60028 */ lw $s6, 0x28($sp)
/* 3860A4 E0082A64 8FB50024 */ lw $s5, 0x24($sp)
/* 3860A8 E0082A68 8FB40020 */ lw $s4, 0x20($sp)
/* 3860AC E0082A6C 8FB3001C */ lw $s3, 0x1C($sp)
/* 3860B0 E0082A70 8FB20018 */ lw $s2, 0x18($sp)
/* 3860B4 E0082A74 8FB10014 */ lw $s1, 0x14($sp)
/* 3860B8 E0082A78 8FB00010 */ lw $s0, 0x10($sp)
/* 3860BC E0082A7C 03E00008 */ jr $ra
/* 3860C0 E0082A80 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void func_E00828B4(EffectInstance* effect) {
DisableXFXData* data = effect->data.disableX;
s32 type;
s32 unk_38;
s32 i;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data));
func_E0082580(data);
unk_38 = data->unk_38;
type = data->type;
data++;
for (i = 1; i < effect->numParts; i++, data++) {
if (unk_38 > 0 || type == 10) {
if (type == 1) {
gSPDisplayList(gMainGfxPos++, D_09002198_388548);
} else {
gSPDisplayList(gMainGfxPos++, D_09002100_3884B0);
}
func_E00826C4(data);
gSPDisplayList(gMainGfxPos++, D_09002230_3885E0);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}
}
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPPipeSync(gMainGfxPos++);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel create_standard_popup_menu
/* 8E2F0 800F4E40 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 8E2F4 800F4E44 AFB00010 */ sw $s0, 0x10($sp)
/* 8E2F8 800F4E48 AFBF0014 */ sw $ra, 0x14($sp)
/* 8E2FC 800F4E4C 0C03A635 */ jal func_800E98D4
/* 8E300 800F4E50 0080802D */ daddu $s0, $a0, $zero
/* 8E304 800F4E54 3C018011 */ lui $at, %hi(D_8010D69A)
/* 8E308 800F4E58 A022D69A */ sb $v0, %lo(D_8010D69A)($at)
/* 8E30C 800F4E5C 0C03A625 */ jal status_bar_ignore_changes
/* 8E310 800F4E60 00000000 */ nop
/* 8E314 800F4E64 0C03A5E3 */ jal open_status_bar_short
/* 8E318 800F4E68 00000000 */ nop
/* 8E31C 800F4E6C 3C048011 */ lui $a0, %hi(PopupDipMode)
/* 8E320 800F4E70 2484D699 */ addiu $a0, $a0, %lo(PopupDipMode)
/* 8E324 800F4E74 3C068011 */ lui $a2, %hi(PopupNotDipping)
/* 8E328 800F4E78 24C6D698 */ addiu $a2, $a2, %lo(PopupNotDipping)
/* 8E32C 800F4E7C 3C018011 */ lui $at, %hi(gPopupMenu)
/* 8E330 800F4E80 AC30D69C */ sw $s0, %lo(gPopupMenu)($at)
/* 8E334 800F4E84 A600032C */ sh $zero, 0x32C($s0)
/* 8E338 800F4E88 AE00031C */ sw $zero, 0x31C($s0)
/* 8E33C 800F4E8C AE000320 */ sw $zero, 0x320($s0)
/* 8E340 800F4E90 A0800000 */ sb $zero, 0x0($a0)
/* 8E344 800F4E94 8E030318 */ lw $v1, 0x318($s0)
/* 8E348 800F4E98 24050001 */ addiu $a1, $zero, 0x1
/* 8E34C 800F4E9C 28620064 */ slti $v0, $v1, 0x64
/* 8E350 800F4EA0 1440000C */ bnez $v0, .L800F4ED4
/* 8E354 800F4EA4 A0C50000 */ sb $a1, 0x0($a2)
/* 8E358 800F4EA8 2462FF9C */ addiu $v0, $v1, -0x64
/* 8E35C 800F4EAC AE020318 */ sw $v0, 0x318($s0)
/* 8E360 800F4EB0 0040182D */ daddu $v1, $v0, $zero
/* 8E364 800F4EB4 28620064 */ slti $v0, $v1, 0x64
/* 8E368 800F4EB8 14400005 */ bnez $v0, .L800F4ED0
/* 8E36C 800F4EBC A0850000 */ sb $a1, 0x0($a0)
/* 8E370 800F4EC0 2462FF9C */ addiu $v0, $v1, -0x64
/* 8E374 800F4EC4 AE020318 */ sw $v0, 0x318($s0)
/* 8E378 800F4EC8 24020002 */ addiu $v0, $zero, 0x2
/* 8E37C 800F4ECC A0820000 */ sb $v0, 0x0($a0)
.L800F4ED0:
/* 8E380 800F4ED0 A0C00000 */ sb $zero, 0x0($a2)
.L800F4ED4:
/* 8E384 800F4ED4 3C058011 */ lui $a1, %hi(gPopupMenu)
/* 8E388 800F4ED8 8CA5D69C */ lw $a1, %lo(gPopupMenu)($a1)
/* 8E38C 800F4EDC 24020001 */ addiu $v0, $zero, 0x1
/* 8E390 800F4EE0 3C018011 */ lui $at, %hi(PopupNotBattle)
/* 8E394 800F4EE4 A022D68E */ sb $v0, %lo(PopupNotBattle)($at)
/* 8E398 800F4EE8 24020006 */ addiu $v0, $zero, 0x6
/* 8E39C 800F4EEC 3C018011 */ lui $at, %hi(PopupMenu_MaxDisplayableEntryCount)
/* 8E3A0 800F4EF0 A022D68F */ sb $v0, %lo(PopupMenu_MaxDisplayableEntryCount)($at)
/* 8E3A4 800F4EF4 8CA20328 */ lw $v0, 0x328($a1)
/* 8E3A8 800F4EF8 8CA40324 */ lw $a0, 0x324($a1)
/* 8E3AC 800F4EFC 3C038011 */ lui $v1, %hi(PopupMenu_SelectedIndex)
/* 8E3B0 800F4F00 2463D648 */ addiu $v1, $v1, %lo(PopupMenu_SelectedIndex)
/* 8E3B4 800F4F04 3C018011 */ lui $at, %hi(gPopupState)
/* 8E3B8 800F4F08 AC20D640 */ sw $zero, %lo(gPopupState)($at)
/* 8E3BC 800F4F0C AC620000 */ sw $v0, 0x0($v1)
/* 8E3C0 800F4F10 0044102A */ slt $v0, $v0, $a0
/* 8E3C4 800F4F14 14400002 */ bnez $v0, .L800F4F20
/* 8E3C8 800F4F18 2482FFFF */ addiu $v0, $a0, -0x1
/* 8E3CC 800F4F1C AC620000 */ sw $v0, 0x0($v1)
.L800F4F20:
/* 8E3D0 800F4F20 8C620000 */ lw $v0, 0x0($v1)
/* 8E3D4 800F4F24 3C048011 */ lui $a0, %hi(PopupMenu_DisplayedEntryCount)
/* 8E3D8 800F4F28 2484D656 */ addiu $a0, $a0, %lo(PopupMenu_DisplayedEntryCount)
/* 8E3DC 800F4F2C 3C018011 */ lui $at, %hi(PopupMenu_FirstDisplayIndex)
/* 8E3E0 800F4F30 A020D654 */ sb $zero, %lo(PopupMenu_FirstDisplayIndex)($at)
/* 8E3E4 800F4F34 3C018011 */ lui $at, %hi(PopupMenu_PrevSelectedIndex)
/* 8E3E8 800F4F38 AC22D64C */ sw $v0, %lo(PopupMenu_PrevSelectedIndex)($at)
/* 8E3EC 800F4F3C 90A20327 */ lbu $v0, 0x327($a1)
/* 8E3F0 800F4F40 24030006 */ addiu $v1, $zero, 0x6
/* 8E3F4 800F4F44 A0820000 */ sb $v0, 0x0($a0)
/* 8E3F8 800F4F48 00021600 */ sll $v0, $v0, 24
/* 8E3FC 800F4F4C 00021603 */ sra $v0, $v0, 24
/* 8E400 800F4F50 0062102A */ slt $v0, $v1, $v0
/* 8E404 800F4F54 54400001 */ bnel $v0, $zero, .L800F4F5C
/* 8E408 800F4F58 A0830000 */ sb $v1, 0x0($a0)
.L800F4F5C:
/* 8E40C 800F4F5C 8CA20324 */ lw $v0, 0x324($a1)
/* 8E410 800F4F60 3C048011 */ lui $a0, %hi(PopupMenu_LastDisplayIndex)
/* 8E414 800F4F64 2484D655 */ addiu $a0, $a0, %lo(PopupMenu_LastDisplayIndex)
/* 8E418 800F4F68 28420006 */ slti $v0, $v0, 0x6
/* 8E41C 800F4F6C 10400003 */ beqz $v0, .L800F4F7C
/* 8E420 800F4F70 A0830000 */ sb $v1, 0x0($a0)
/* 8E424 800F4F74 90A20327 */ lbu $v0, 0x327($a1)
/* 8E428 800F4F78 A0820000 */ sb $v0, 0x0($a0)
.L800F4F7C:
/* 8E42C 800F4F7C 240200FF */ addiu $v0, $zero, 0xFF
/* 8E430 800F4F80 3C018011 */ lui $at, %hi(PopupMenu_Alpha)
/* 8E434 800F4F84 AC22D650 */ sw $v0, %lo(PopupMenu_Alpha)($at)
/* 8E438 800F4F88 24020004 */ addiu $v0, $zero, 0x4
/* 8E43C 800F4F8C 3C04800F */ lui $a0, %hi(popup_menu_update)
/* 8E440 800F4F90 24841A10 */ addiu $a0, $a0, %lo(popup_menu_update)
/* 8E444 800F4F94 3C018011 */ lui $at, %hi(D_8010D691)
/* 8E448 800F4F98 A022D691 */ sb $v0, %lo(D_8010D691)($at)
/* 8E44C 800F4F9C 3C018011 */ lui $at, %hi(D_8010D692)
/* 8E450 800F4FA0 A023D692 */ sb $v1, %lo(D_8010D692)($at)
/* 8E454 800F4FA4 0C048C8F */ jal create_worker_frontUI
/* 8E458 800F4FA8 0000282D */ daddu $a1, $zero, $zero
/* 8E45C 800F4FAC 8FBF0014 */ lw $ra, 0x14($sp)
/* 8E460 800F4FB0 8FB00010 */ lw $s0, 0x10($sp)
/* 8E464 800F4FB4 3C018011 */ lui $at, %hi(gPopupWorker)
/* 8E468 800F4FB8 AC22D694 */ sw $v0, %lo(gPopupWorker)($at)
/* 8E46C 800F4FBC 03E00008 */ jr $ra
/* 8E470 800F4FC0 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void create_standard_popup_menu(PopupMenu* popup) {
PopupMenu* otherPopup;
s8 entryCount;
s32 initialPos;
s32 numEntries;
D_8010D69A = func_800E98D4();
status_bar_ignore_changes();
open_status_bar_short();
gPopupMenu = popup;
popup->result = POPUP_RESULT_CHOOSING;
popup->dipMode = 0;
popup->titleNumber = 0;
PopupDipMode = 0;
PopupNotDipping = TRUE;
if (popup->popupType >= POPUP_MENU_DOUBLE_DIP) {
popup->popupType -= POPUP_MENU_DOUBLE_DIP;
PopupDipMode = 1;
if (popup->popupType >= POPUP_MENU_DOUBLE_DIP) {
popup->popupType -= POPUP_MENU_DOUBLE_DIP;
PopupDipMode = 2;
}
PopupNotDipping = FALSE;
}
PopupNotBattle = TRUE;
PopupMenu_MaxDisplayableEntryCount = 6;
gPopupState = POPUP_STATE_INIT;
initialPos = gPopupMenu->initialPos;
numEntries = gPopupMenu->numEntries;
PopupMenu_SelectedIndex = initialPos;
if (initialPos >= numEntries) {
PopupMenu_SelectedIndex = numEntries - 1;
}
PopupMenu_FirstDisplayIndex = 0;
PopupMenu_PrevSelectedIndex = PopupMenu_SelectedIndex;
entryCount = gPopupMenu->numEntries;
PopupMenu_DisplayedEntryCount = entryCount;
if (PopupMenu_MaxDisplayableEntryCount < entryCount) {
PopupMenu_DisplayedEntryCount = 6;
}
PopupMenu_LastDisplayIndex = 6;
if (gPopupMenu->numEntries < PopupMenu_MaxDisplayableEntryCount) {
PopupMenu_LastDisplayIndex = gPopupMenu->numEntries;
}
PopupMenu_Alpha = 255;
D_8010D691 = 4;
D_8010D692 = 6;
gPopupWorker = create_worker_frontUI((void (*) (void)) popup_menu_update, NULL);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel water_splash_update
/* 3BC304 E00BE3A4 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 3BC308 E00BE3A8 AFBF0010 */ sw $ra, 0x10($sp)
/* 3BC30C E00BE3AC F7B40018 */ sdc1 $f20, 0x18($sp)
/* 3BC310 E00BE3B0 8C850000 */ lw $a1, 0x0($a0)
/* 3BC314 E00BE3B4 8C83000C */ lw $v1, 0xC($a0)
/* 3BC318 E00BE3B8 30A20010 */ andi $v0, $a1, 0x10
/* 3BC31C E00BE3BC 8C660000 */ lw $a2, 0x0($v1)
/* 3BC320 E00BE3C0 10400005 */ beqz $v0, .LE00BE3D8
/* 3BC324 E00BE3C4 2402FFEF */ addiu $v0, $zero, -0x11
/* 3BC328 E00BE3C8 00A21024 */ and $v0, $a1, $v0
/* 3BC32C E00BE3CC AC820000 */ sw $v0, 0x0($a0)
/* 3BC330 E00BE3D0 24020010 */ addiu $v0, $zero, 0x10
/* 3BC334 E00BE3D4 AC62001C */ sw $v0, 0x1C($v1)
.LE00BE3D8:
/* 3BC338 E00BE3D8 8C65001C */ lw $a1, 0x1C($v1)
/* 3BC33C E00BE3DC 28A203E8 */ slti $v0, $a1, 0x3E8
/* 3BC340 E00BE3E0 10400002 */ beqz $v0, .LE00BE3EC
/* 3BC344 E00BE3E4 24A2FFFF */ addiu $v0, $a1, -0x1
/* 3BC348 E00BE3E8 AC62001C */ sw $v0, 0x1C($v1)
.LE00BE3EC:
/* 3BC34C E00BE3EC 8C620020 */ lw $v0, 0x20($v1)
/* 3BC350 E00BE3F0 8C65001C */ lw $a1, 0x1C($v1)
/* 3BC354 E00BE3F4 24420001 */ addiu $v0, $v0, 0x1
/* 3BC358 E00BE3F8 04A10005 */ bgez $a1, .LE00BE410
/* 3BC35C E00BE3FC AC620020 */ sw $v0, 0x20($v1)
/* 3BC360 E00BE400 0C080128 */ jal shim_remove_effect
/* 3BC364 E00BE404 00000000 */ nop
/* 3BC368 E00BE408 0802F95A */ j .LE00BE568
/* 3BC36C E00BE40C 00000000 */ nop
.LE00BE410:
/* 3BC370 E00BE410 28A20004 */ slti $v0, $a1, 0x4
/* 3BC374 E00BE414 10400002 */ beqz $v0, .LE00BE420
/* 3BC378 E00BE418 00051180 */ sll $v0, $a1, 6
/* 3BC37C E00BE41C AC620030 */ sw $v0, 0x30($v1)
.LE00BE420:
/* 3BC380 E00BE420 8C820008 */ lw $v0, 0x8($a0)
/* 3BC384 E00BE424 24050001 */ addiu $a1, $zero, 0x1
/* 3BC388 E00BE428 00A2102A */ slt $v0, $a1, $v0
/* 3BC38C E00BE42C 1040004E */ beqz $v0, .LE00BE568
/* 3BC390 E00BE430 24630038 */ addiu $v1, $v1, 0x38
/* 3BC394 E00BE434 24080002 */ addiu $t0, $zero, 0x2
/* 3BC398 E00BE438 24070003 */ addiu $a3, $zero, 0x3
/* 3BC39C E00BE43C 24630034 */ addiu $v1, $v1, 0x34
/* 3BC3A0 E00BE440 3C01E00C */ lui $at, (0xE00C0000 >> 16)
/* 3BC3A4 E00BE444 D42AEB00 */ ldc1 $f10, -0x1500($at)
/* 3BC3A8 E00BE448 3C01E00C */ lui $at, (0xE00C0000 >> 16)
/* 3BC3AC E00BE44C D432EB08 */ ldc1 $f18, -0x14F8($at)
/* 3BC3B0 E00BE450 3C01E00C */ lui $at, (0xE00C0000 >> 16)
/* 3BC3B4 E00BE454 D430EB10 */ ldc1 $f16, -0x14F0($at)
/* 3BC3B8 E00BE458 3C01E00C */ lui $at, (0xE00C0000 >> 16)
/* 3BC3BC E00BE45C D42EEB18 */ ldc1 $f14, -0x14E8($at)
/* 3BC3C0 E00BE460 3C01E00C */ lui $at, (0xE00C0000 >> 16)
/* 3BC3C4 E00BE464 D42CEB20 */ ldc1 $f12, -0x14E0($at)
.LE00BE468:
/* 3BC3C8 E00BE468 C464FFFC */ lwc1 $f4, -0x4($v1)
/* 3BC3CC E00BE46C 46802121 */ cvt.d.w $f4, $f4
/* 3BC3D0 E00BE470 462A2102 */ mul.d $f4, $f4, $f10
/* 3BC3D4 E00BE474 00000000 */ nop
/* 3BC3D8 E00BE478 C468FFD0 */ lwc1 $f8, -0x30($v1)
/* 3BC3DC E00BE47C C460FFDC */ lwc1 $f0, -0x24($v1)
/* 3BC3E0 E00BE480 C466FFD4 */ lwc1 $f6, -0x2C($v1)
/* 3BC3E4 E00BE484 46004200 */ add.s $f8, $f8, $f0
/* 3BC3E8 E00BE488 C460FFE0 */ lwc1 $f0, -0x20($v1)
/* 3BC3EC E00BE48C C462FFD8 */ lwc1 $f2, -0x28($v1)
/* 3BC3F0 E00BE490 46003180 */ add.s $f6, $f6, $f0
/* 3BC3F4 E00BE494 C460FFE4 */ lwc1 $f0, -0x1C($v1)
/* 3BC3F8 E00BE498 46001080 */ add.s $f2, $f2, $f0
/* 3BC3FC E00BE49C E468FFD0 */ swc1 $f8, -0x30($v1)
/* 3BC400 E00BE4A0 E466FFD4 */ swc1 $f6, -0x2C($v1)
/* 3BC404 E00BE4A4 E462FFD8 */ swc1 $f2, -0x28($v1)
/* 3BC408 E00BE4A8 4620250D */ trunc.w.d $f20, $f4
/* 3BC40C E00BE4AC 14C80006 */ bne $a2, $t0, .LE00BE4C8
/* 3BC410 E00BE4B0 E474FFFC */ swc1 $f20, -0x4($v1)
/* 3BC414 E00BE4B4 C460FFE0 */ lwc1 $f0, -0x20($v1)
/* 3BC418 E00BE4B8 46000021 */ cvt.d.s $f0, $f0
/* 3BC41C E00BE4BC 46320000 */ add.d $f0, $f0, $f18
/* 3BC420 E00BE4C0 46200020 */ cvt.s.d $f0, $f0
/* 3BC424 E00BE4C4 E460FFE0 */ swc1 $f0, -0x20($v1)
.LE00BE4C8:
/* 3BC428 E00BE4C8 C464FFDC */ lwc1 $f4, -0x24($v1)
/* 3BC42C E00BE4CC 46002121 */ cvt.d.s $f4, $f4
/* 3BC430 E00BE4D0 462A2102 */ mul.d $f4, $f4, $f10
/* 3BC434 E00BE4D4 00000000 */ nop
/* 3BC438 E00BE4D8 C462FFE4 */ lwc1 $f2, -0x1C($v1)
/* 3BC43C E00BE4DC 460010A1 */ cvt.d.s $f2, $f2
/* 3BC440 E00BE4E0 462A1082 */ mul.d $f2, $f2, $f10
/* 3BC444 E00BE4E4 00000000 */ nop
/* 3BC448 E00BE4E8 C460FFE0 */ lwc1 $f0, -0x20($v1)
/* 3BC44C E00BE4EC 46000021 */ cvt.d.s $f0, $f0
/* 3BC450 E00BE4F0 46300000 */ add.d $f0, $f0, $f16
/* 3BC454 E00BE4F4 46200020 */ cvt.s.d $f0, $f0
/* 3BC458 E00BE4F8 E460FFE0 */ swc1 $f0, -0x20($v1)
/* 3BC45C E00BE4FC 46000021 */ cvt.d.s $f0, $f0
/* 3BC460 E00BE500 462A0002 */ mul.d $f0, $f0, $f10
/* 3BC464 E00BE504 00000000 */ nop
/* 3BC468 E00BE508 46202120 */ cvt.s.d $f4, $f4
/* 3BC46C E00BE50C 462010A0 */ cvt.s.d $f2, $f2
/* 3BC470 E00BE510 E464FFDC */ swc1 $f4, -0x24($v1)
/* 3BC474 E00BE514 E462FFE4 */ swc1 $f2, -0x1C($v1)
/* 3BC478 E00BE518 46200020 */ cvt.s.d $f0, $f0
/* 3BC47C E00BE51C 14C70007 */ bne $a2, $a3, .LE00BE53C
/* 3BC480 E00BE520 E460FFE0 */ swc1 $f0, -0x20($v1)
/* 3BC484 E00BE524 C4600000 */ lwc1 $f0, 0x0($v1)
/* 3BC488 E00BE528 46000021 */ cvt.d.s $f0, $f0
/* 3BC48C E00BE52C 462E0002 */ mul.d $f0, $f0, $f14
/* 3BC490 E00BE530 00000000 */ nop
/* 3BC494 E00BE534 0802F954 */ j .LE00BE550
/* 3BC498 E00BE538 46200020 */ cvt.s.d $f0, $f0
.LE00BE53C:
/* 3BC49C E00BE53C C4600000 */ lwc1 $f0, 0x0($v1)
/* 3BC4A0 E00BE540 46000021 */ cvt.d.s $f0, $f0
/* 3BC4A4 E00BE544 462C0002 */ mul.d $f0, $f0, $f12
/* 3BC4A8 E00BE548 00000000 */ nop
/* 3BC4AC E00BE54C 46200020 */ cvt.s.d $f0, $f0
.LE00BE550:
/* 3BC4B0 E00BE550 E4600000 */ swc1 $f0, 0x0($v1)
/* 3BC4B4 E00BE554 24A50001 */ addiu $a1, $a1, 0x1
/* 3BC4B8 E00BE558 8C820008 */ lw $v0, 0x8($a0)
/* 3BC4BC E00BE55C 00A2102A */ slt $v0, $a1, $v0
/* 3BC4C0 E00BE560 1440FFC1 */ bnez $v0, .LE00BE468
/* 3BC4C4 E00BE564 24630038 */ addiu $v1, $v1, 0x38
.LE00BE568:
/* 3BC4C8 E00BE568 8FBF0010 */ lw $ra, 0x10($sp)
/* 3BC4CC E00BE56C D7B40018 */ ldc1 $f20, 0x18($sp)
/* 3BC4D0 E00BE570 03E00008 */ jr $ra
/* 3BC4D4 E00BE574 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
void water_splash_update(EffectInstance *effect) {
WaterSplashFXData *part;
s32 temp_a1_3;
s32 temp_a2;
s32 i;
part = effect->data.waterSplash;
temp_a2 = part->unk_00;
if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
part->unk_1C = 0x10;
}
if (part->unk_1C < 1000) {
part->unk_1C--;
}
temp_a1_3 = part->unk_1C;
part->unk_20++;
if (temp_a1_3 < 0) {
shim_remove_effect(effect);
return;
}
if (temp_a1_3 < 4) {
part->unk_30 = temp_a1_3 * 64;
}
part++;
for (i = 1; i < effect->numParts; i++, part++) {
part->unk_04.x += part->unk_10.x;
part->unk_04.y += part->unk_10.y;
part->unk_04.z += part->unk_10.z;
part->unk_30 *= 0.98;
if (temp_a2 == 2) {
part->unk_10.y += -0.8;
}
part->unk_10.y += -0.1;
part->unk_10.x *= 0.98;
part->unk_10.y *= 0.98;
part->unk_10.z *= 0.98;
if (temp_a2 == 3) {
part->unk_34 *= 1.2;
} else {
part->unk_34 *= 0.9;
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel purple_ring_update
/* 352840 E003E400 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 352844 E003E404 AFBF0010 */ sw $ra, 0x10($sp)
/* 352848 E003E408 F7B60020 */ sdc1 $f22, 0x20($sp)
/* 35284C E003E40C F7B40018 */ sdc1 $f20, 0x18($sp)
/* 352850 E003E410 8C83000C */ lw $v1, 0xC($a0)
/* 352854 E003E414 8C62006C */ lw $v0, 0x6C($v1)
/* 352858 E003E418 2442FFFF */ addiu $v0, $v0, -0x1
/* 35285C E003E41C AC62006C */ sw $v0, 0x6C($v1)
/* 352860 E003E420 8C620070 */ lw $v0, 0x70($v1)
/* 352864 E003E424 8C65006C */ lw $a1, 0x6C($v1)
/* 352868 E003E428 24420001 */ addiu $v0, $v0, 0x1
/* 35286C E003E42C 04A10005 */ bgez $a1, .LE003E444
/* 352870 E003E430 AC620070 */ sw $v0, 0x70($v1)
/* 352874 E003E434 0C080128 */ jal shim_remove_effect
/* 352878 E003E438 00000000 */ nop
/* 35287C E003E43C 0800F978 */ j .LE003E5E0
/* 352880 E003E440 00000000 */ nop
.LE003E444:
/* 352884 E003E444 8C820008 */ lw $v0, 0x8($a0)
/* 352888 E003E448 18400065 */ blez $v0, .LE003E5E0
/* 35288C E003E44C 0000302D */ daddu $a2, $zero, $zero
/* 352890 E003E450 28A80006 */ slti $t0, $a1, 0x6
/* 352894 E003E454 240900FF */ addiu $t1, $zero, 0xFF
/* 352898 E003E458 28A70005 */ slti $a3, $a1, 0x5
/* 35289C E003E45C 24650064 */ addiu $a1, $v1, 0x64
/* 3528A0 E003E460 3C01E004 */ lui $at, (0xE0040000 >> 16)
/* 3528A4 E003E464 D434E878 */ ldc1 $f20, -0x1788($at)
/* 3528A8 E003E468 3C01E004 */ lui $at, (0xE0040000 >> 16)
/* 3528AC E003E46C D42EE880 */ ldc1 $f14, -0x1780($at)
/* 3528B0 E003E470 3C01E004 */ lui $at, (0xE0040000 >> 16)
/* 3528B4 E003E474 D432E888 */ ldc1 $f18, -0x1778($at)
/* 3528B8 E003E478 3C01E004 */ lui $at, (0xE0040000 >> 16)
/* 3528BC E003E47C D42CE890 */ ldc1 $f12, -0x1770($at)
/* 3528C0 E003E480 3C01E004 */ lui $at, (0xE0040000 >> 16)
/* 3528C4 E003E484 D430E898 */ ldc1 $f16, -0x1768($at)
.LE003E488:
/* 3528C8 E003E488 15000020 */ bnez $t0, .LE003E50C
/* 3528CC E003E48C 00000000 */ nop
/* 3528D0 E003E490 C4A2FFAC */ lwc1 $f2, -0x54($a1)
/* 3528D4 E003E494 460010A1 */ cvt.d.s $f2, $f2
/* 3528D8 E003E498 462E1082 */ mul.d $f2, $f2, $f14
/* 3528DC E003E49C 00000000 */ nop
/* 3528E0 E003E4A0 C4A0FFB0 */ lwc1 $f0, -0x50($a1)
/* 3528E4 E003E4A4 46000021 */ cvt.d.s $f0, $f0
/* 3528E8 E003E4A8 462E0002 */ mul.d $f0, $f0, $f14
/* 3528EC E003E4AC 00000000 */ nop
/* 3528F0 E003E4B0 C4A4FFB4 */ lwc1 $f4, -0x4C($a1)
/* 3528F4 E003E4B4 46002121 */ cvt.d.s $f4, $f4
/* 3528F8 E003E4B8 462E2102 */ mul.d $f4, $f4, $f14
/* 3528FC E003E4BC 00000000 */ nop
/* 352900 E003E4C0 8CA30004 */ lw $v1, 0x4($a1)
/* 352904 E003E4C4 01231023 */ subu $v0, $t1, $v1
/* 352908 E003E4C8 44823000 */ mtc1 $v0, $f6
/* 35290C E003E4CC 00000000 */ nop
/* 352910 E003E4D0 468031A1 */ cvt.d.w $f6, $f6
/* 352914 E003E4D4 46343182 */ mul.d $f6, $f6, $f20
/* 352918 E003E4D8 00000000 */ nop
/* 35291C E003E4DC 462010A0 */ cvt.s.d $f2, $f2
/* 352920 E003E4E0 46200020 */ cvt.s.d $f0, $f0
/* 352924 E003E4E4 E4A0FFB0 */ swc1 $f0, -0x50($a1)
/* 352928 E003E4E8 44830000 */ mtc1 $v1, $f0
/* 35292C E003E4EC 00000000 */ nop
/* 352930 E003E4F0 46800021 */ cvt.d.w $f0, $f0
/* 352934 E003E4F4 46202120 */ cvt.s.d $f4, $f4
/* 352938 E003E4F8 46260000 */ add.d $f0, $f0, $f6
/* 35293C E003E4FC E4A2FFAC */ swc1 $f2, -0x54($a1)
/* 352940 E003E500 E4A4FFB4 */ swc1 $f4, -0x4C($a1)
/* 352944 E003E504 4620058D */ trunc.w.d $f22, $f0
/* 352948 E003E508 E4B60004 */ swc1 $f22, 0x4($a1)
.LE003E50C:
/* 35294C E003E50C 10E00019 */ beqz $a3, .LE003E574
/* 352950 E003E510 00000000 */ nop
/* 352954 E003E514 C4A60004 */ lwc1 $f6, 0x4($a1)
/* 352958 E003E518 468031A1 */ cvt.d.w $f6, $f6
/* 35295C E003E51C 46323182 */ mul.d $f6, $f6, $f18
/* 352960 E003E520 00000000 */ nop
/* 352964 E003E524 C4A4FFAC */ lwc1 $f4, -0x54($a1)
/* 352968 E003E528 46002121 */ cvt.d.s $f4, $f4
/* 35296C E003E52C 462C2102 */ mul.d $f4, $f4, $f12
/* 352970 E003E530 00000000 */ nop
/* 352974 E003E534 C4A2FFB0 */ lwc1 $f2, -0x50($a1)
/* 352978 E003E538 460010A1 */ cvt.d.s $f2, $f2
/* 35297C E003E53C 462C1082 */ mul.d $f2, $f2, $f12
/* 352980 E003E540 00000000 */ nop
/* 352984 E003E544 C4A0FFB4 */ lwc1 $f0, -0x4C($a1)
/* 352988 E003E548 46000021 */ cvt.d.s $f0, $f0
/* 35298C E003E54C 462C0002 */ mul.d $f0, $f0, $f12
/* 352990 E003E550 00000000 */ nop
/* 352994 E003E554 4620358D */ trunc.w.d $f22, $f6
/* 352998 E003E558 E4B60004 */ swc1 $f22, 0x4($a1)
/* 35299C E003E55C 46202120 */ cvt.s.d $f4, $f4
/* 3529A0 E003E560 462010A0 */ cvt.s.d $f2, $f2
/* 3529A4 E003E564 46200020 */ cvt.s.d $f0, $f0
/* 3529A8 E003E568 E4A4FFAC */ swc1 $f4, -0x54($a1)
/* 3529AC E003E56C E4A2FFB0 */ swc1 $f2, -0x50($a1)
/* 3529B0 E003E570 E4A0FFB4 */ swc1 $f0, -0x4C($a1)
.LE003E574:
/* 3529B4 E003E574 C4A20000 */ lwc1 $f2, 0x0($a1)
/* 3529B8 E003E578 460010A1 */ cvt.d.s $f2, $f2
/* 3529BC E003E57C 46301082 */ mul.d $f2, $f2, $f16
/* 3529C0 E003E580 00000000 */ nop
/* 3529C4 E003E584 C4AAFFA0 */ lwc1 $f10, -0x60($a1)
/* 3529C8 E003E588 C4A0FFAC */ lwc1 $f0, -0x54($a1)
/* 3529CC E003E58C C4A8FFA4 */ lwc1 $f8, -0x5C($a1)
/* 3529D0 E003E590 46005280 */ add.s $f10, $f10, $f0
/* 3529D4 E003E594 C4A0FFB0 */ lwc1 $f0, -0x50($a1)
/* 3529D8 E003E598 C4A4FFA8 */ lwc1 $f4, -0x58($a1)
/* 3529DC E003E59C 46004200 */ add.s $f8, $f8, $f0
/* 3529E0 E003E5A0 C4A0FFB4 */ lwc1 $f0, -0x4C($a1)
/* 3529E4 E003E5A4 C4A6FFFC */ lwc1 $f6, -0x4($a1)
/* 3529E8 E003E5A8 46002100 */ add.s $f4, $f4, $f0
/* 3529EC E003E5AC C4A0FFF8 */ lwc1 $f0, -0x8($a1)
/* 3529F0 E003E5B0 24C60001 */ addiu $a2, $a2, 0x1
/* 3529F4 E003E5B4 E4AAFFA0 */ swc1 $f10, -0x60($a1)
/* 3529F8 E003E5B8 46060000 */ add.s $f0, $f0, $f6
/* 3529FC E003E5BC E4A8FFA4 */ swc1 $f8, -0x5C($a1)
/* 352A00 E003E5C0 E4A4FFA8 */ swc1 $f4, -0x58($a1)
/* 352A04 E003E5C4 E4A0FFF8 */ swc1 $f0, -0x8($a1)
/* 352A08 E003E5C8 462010A0 */ cvt.s.d $f2, $f2
/* 352A0C E003E5CC E4A20000 */ swc1 $f2, 0x0($a1)
/* 352A10 E003E5D0 8C820008 */ lw $v0, 0x8($a0)
/* 352A14 E003E5D4 00C2102A */ slt $v0, $a2, $v0
/* 352A18 E003E5D8 1440FFAB */ bnez $v0, .LE003E488
/* 352A1C E003E5DC 24A5007C */ addiu $a1, $a1, 0x7C
.LE003E5E0:
/* 352A20 E003E5E0 8FBF0010 */ lw $ra, 0x10($sp)
/* 352A24 E003E5E4 D7B60020 */ ldc1 $f22, 0x20($sp)
/* 352A28 E003E5E8 D7B40018 */ ldc1 $f20, 0x18($sp)
/* 352A2C E003E5EC 03E00008 */ jr $ra
/* 352A30 E003E5F0 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void purple_ring_update(EffectInstance* effect) {
PurpleRingFXData* part = effect->data.purpleRing;
s32 unk_6C;
s32 i;
part->unk_6C--;
part->unk_70++;
if (part->unk_6C < 0) {
shim_remove_effect(effect);
return;
}
unk_6C = part->unk_6C;
for (i = 0; i < effect->numParts; i++, part++) {
if (unk_6C >= 6) {
part->unk_68 += (255 - part->unk_68) * 0.3;
part->unk_10 *= 0.8;
part->unk_14 *= 0.8;
part->unk_18 *= 0.8;
}
if (unk_6C < 5) {
part->unk_68 *= 0.6;
part->unk_10 *= 0.7;
part->unk_14 *= 0.7;
part->unk_18 *= 0.7;
}
part->unk_04 += part->unk_10;
part->unk_08 += part->unk_14;
part->unk_0C += part->unk_18;
part->unk_5C += part->unk_60;
part->unk_64 *= 1.05;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel kill_enemy
/* 19BAC 8003E7AC 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 19BB0 8003E7B0 AFB00010 */ sw $s0, 0x10($sp)
/* 19BB4 8003E7B4 0080802D */ daddu $s0, $a0, $zero
/* 19BB8 8003E7B8 AFBF0020 */ sw $ra, 0x20($sp)
/* 19BBC 8003E7BC AFB3001C */ sw $s3, 0x1C($sp)
/* 19BC0 8003E7C0 AFB20018 */ sw $s2, 0x18($sp)
/* 19BC4 8003E7C4 AFB10014 */ sw $s1, 0x14($sp)
/* 19BC8 8003E7C8 82020004 */ lb $v0, 0x4($s0)
/* 19BCC 8003E7CC 00021080 */ sll $v0, $v0, 2
/* 19BD0 8003E7D0 3C13800B */ lui $s3, %hi(gCurrentEncounter + 0x28)
/* 19BD4 8003E7D4 02629821 */ addu $s3, $s3, $v0
/* 19BD8 8003E7D8 8E730F38 */ lw $s3, %lo(gCurrentEncounter + 0x28)($s3)
/* 19BDC 8003E7DC 8E640000 */ lw $a0, 0x0($s3)
/* 19BE0 8003E7E0 3C12800B */ lui $s2, %hi(gCurrentEncounter)
/* 19BE4 8003E7E4 26520F10 */ addiu $s2, $s2, %lo(gCurrentEncounter)
/* 19BE8 8003E7E8 18800009 */ blez $a0, .L8003E810
/* 19BEC 8003E7EC 0000882D */ daddu $s1, $zero, $zero
/* 19BF0 8003E7F0 0260182D */ daddu $v1, $s3, $zero
.L8003E7F4:
/* 19BF4 8003E7F4 8C620004 */ lw $v0, 0x4($v1)
/* 19BF8 8003E7F8 10500005 */ beq $v0, $s0, .L8003E810
/* 19BFC 8003E7FC 00000000 */ nop
/* 19C00 8003E800 26310001 */ addiu $s1, $s1, 0x1
/* 19C04 8003E804 0224102A */ slt $v0, $s1, $a0
/* 19C08 8003E808 1440FFFA */ bnez $v0, .L8003E7F4
/* 19C0C 8003E80C 24630004 */ addiu $v1, $v1, 0x4
.L8003E810:
/* 19C10 8003E810 8E020034 */ lw $v0, 0x34($s0)
/* 19C14 8003E814 10400003 */ beqz $v0, .L8003E824
/* 19C18 8003E818 00000000 */ nop
/* 19C1C 8003E81C 0C0B102B */ jal kill_script_by_ID
/* 19C20 8003E820 8E04004C */ lw $a0, 0x4C($s0)
.L8003E824:
/* 19C24 8003E824 8E020038 */ lw $v0, 0x38($s0)
/* 19C28 8003E828 10400003 */ beqz $v0, .L8003E838
/* 19C2C 8003E82C 00000000 */ nop
/* 19C30 8003E830 0C0B102B */ jal kill_script_by_ID
/* 19C34 8003E834 8E040050 */ lw $a0, 0x50($s0)
.L8003E838:
/* 19C38 8003E838 8E02003C */ lw $v0, 0x3C($s0)
/* 19C3C 8003E83C 10400003 */ beqz $v0, .L8003E84C
/* 19C40 8003E840 00000000 */ nop
/* 19C44 8003E844 0C0B102B */ jal kill_script_by_ID
/* 19C48 8003E848 8E040054 */ lw $a0, 0x54($s0)
.L8003E84C:
/* 19C4C 8003E84C 8E020040 */ lw $v0, 0x40($s0)
/* 19C50 8003E850 10400003 */ beqz $v0, .L8003E860
/* 19C54 8003E854 00000000 */ nop
/* 19C58 8003E858 0C0B102B */ jal kill_script_by_ID
/* 19C5C 8003E85C 8E040058 */ lw $a0, 0x58($s0)
.L8003E860:
/* 19C60 8003E860 8E020044 */ lw $v0, 0x44($s0)
/* 19C64 8003E864 10400003 */ beqz $v0, .L8003E874
/* 19C68 8003E868 00000000 */ nop
/* 19C6C 8003E86C 0C0B102B */ jal kill_script_by_ID
/* 19C70 8003E870 8E04005C */ lw $a0, 0x5C($s0)
.L8003E874:
/* 19C74 8003E874 8E020048 */ lw $v0, 0x48($s0)
/* 19C78 8003E878 10400003 */ beqz $v0, .L8003E888
/* 19C7C 8003E87C 00000000 */ nop
/* 19C80 8003E880 0C0B102B */ jal kill_script_by_ID
/* 19C84 8003E884 8E040060 */ lw $a0, 0x60($s0)
.L8003E888:
/* 19C88 8003E888 86040008 */ lh $a0, 0x8($s0)
/* 19C8C 8003E88C AE000020 */ sw $zero, 0x20($s0)
/* 19C90 8003E890 AE000024 */ sw $zero, 0x24($s0)
/* 19C94 8003E894 AE000028 */ sw $zero, 0x28($s0)
/* 19C98 8003E898 AE00002C */ sw $zero, 0x2C($s0)
/* 19C9C 8003E89C 0C00EABB */ jal get_npc_unsafe
/* 19CA0 8003E8A0 AE000030 */ sw $zero, 0x30($s0)
/* 19CA4 8003E8A4 0C00E273 */ jal free_npc
/* 19CA8 8003E8A8 0040202D */ daddu $a0, $v0, $zero
/* 19CAC 8003E8AC 8E040064 */ lw $a0, 0x64($s0)
/* 19CB0 8003E8B0 50800004 */ beql $a0, $zero, .L8003E8C4
/* 19CB4 8003E8B4 0000202D */ daddu $a0, $zero, $zero
/* 19CB8 8003E8B8 0C00AB4B */ jal heap_free
/* 19CBC 8003E8BC 00000000 */ nop
/* 19CC0 8003E8C0 0000202D */ daddu $a0, $zero, $zero
.L8003E8C4:
/* 19CC4 8003E8C4 0260182D */ daddu $v1, $s3, $zero
.L8003E8C8:
/* 19CC8 8003E8C8 8C620004 */ lw $v0, 0x4($v1)
/* 19CCC 8003E8CC 50500001 */ beql $v0, $s0, .L8003E8D4
/* 19CD0 8003E8D0 AC600004 */ sw $zero, 0x4($v1)
.L8003E8D4:
/* 19CD4 8003E8D4 24840001 */ addiu $a0, $a0, 0x1
/* 19CD8 8003E8D8 28820010 */ slti $v0, $a0, 0x10
/* 19CDC 8003E8DC 1440FFFA */ bnez $v0, .L8003E8C8
/* 19CE0 8003E8E0 24630004 */ addiu $v1, $v1, 0x4
/* 19CE4 8003E8E4 8E030000 */ lw $v1, 0x0($s0)
/* 19CE8 8003E8E8 30620004 */ andi $v0, $v1, 0x4
/* 19CEC 8003E8EC 1440000E */ bnez $v0, .L8003E928
/* 19CF0 8003E8F0 30620008 */ andi $v0, $v1, 0x8
/* 19CF4 8003E8F4 10400004 */ beqz $v0, .L8003E908
/* 19CF8 8003E8F8 30620001 */ andi $v0, $v1, 0x1
/* 19CFC 8003E8FC 8E42008C */ lw $v0, 0x8C($s2)
/* 19D00 8003E900 16020009 */ bne $s0, $v0, .L8003E928
/* 19D04 8003E904 30620001 */ andi $v0, $v1, 0x1
.L8003E908:
/* 19D08 8003E908 14400007 */ bnez $v0, .L8003E928
/* 19D0C 8003E90C 30620010 */ andi $v0, $v1, 0x10
/* 19D10 8003E910 14400005 */ bnez $v0, .L8003E928
/* 19D14 8003E914 00000000 */ nop
/* 19D18 8003E918 86650048 */ lh $a1, 0x48($s3)
/* 19D1C 8003E91C 82440020 */ lb $a0, 0x20($s2)
/* 19D20 8003E920 0C00F8B8 */ jal COPY_set_defeated
/* 19D24 8003E924 00B12821 */ addu $a1, $a1, $s1
.L8003E928:
/* 19D28 8003E928 0C00AB4B */ jal heap_free
/* 19D2C 8003E92C 0200202D */ daddu $a0, $s0, $zero
/* 19D30 8003E930 8FBF0020 */ lw $ra, 0x20($sp)
/* 19D34 8003E934 8FB3001C */ lw $s3, 0x1C($sp)
/* 19D38 8003E938 8FB20018 */ lw $s2, 0x18($sp)
/* 19D3C 8003E93C 8FB10014 */ lw $s1, 0x14($sp)
/* 19D40 8003E940 8FB00010 */ lw $s0, 0x10($sp)
/* 19D44 8003E944 03E00008 */ jr $ra
/* 19D48 8003E948 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void kill_enemy(Enemy* enemy) {
EncounterStatus* encounterStatus = &gCurrentEncounter;
Encounter* encounter = encounterStatus->encounterList[enemy->encounterIndex];
s32 i;
s32 j;
for (i = 0; i < encounter->count; i++) {
Enemy* currentEnemy = encounter->enemy[i];
if (currentEnemy == enemy) {
break;
}
}
if (enemy->initScript != NULL) {
kill_script_by_ID(enemy->initScriptID);
}
if (enemy->interactScript != NULL) {
kill_script_by_ID(enemy->interactScriptID);
}
if (enemy->aiScript != NULL) {
kill_script_by_ID(enemy->aiScriptID);
}
if (enemy->hitScript != NULL) {
kill_script_by_ID(enemy->hitScriptID);
}
if (enemy->auxScript != NULL) {
kill_script_by_ID(enemy->auxScriptID);
}
if (enemy->defeatScript != NULL) {
kill_script_by_ID(enemy->defeatScriptID);
}
enemy->interactBytecode = NULL;
enemy->aiBytecode = NULL;
enemy->hitBytecode = NULL;
enemy->auxBytecode = NULL;
enemy->defeatBytecode = NULL;
free_npc(get_npc_unsafe(enemy->npcID));
if (enemy->unk_64 != NULL) {
heap_free(enemy->unk_64);
}
for (j = 0; j < ARRAY_COUNT(encounter->enemy); j++) {
if (encounter->enemy[j] == enemy) {
encounter->enemy[j] = NULL;
}
}
do {
if (!(enemy->flags & ENEMY_FLAG_4)
&& (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || (enemy == encounterStatus->currentEnemy))
&& !(enemy->flags & ENEMY_FLAG_PASSIVE)
) {
if (!(enemy->flags & ENEMY_FLAG_FLED)) {
COPY_set_defeated(encounterStatus->mapID, encounter->encounterID + i);
}
}
} while (0); // required to match
heap_free(enemy);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel set_model_group_visibility
/* B1EC0 8011B7C0 3084FFFF */ andi $a0, $a0, 0xFFFF
/* B1EC4 8011B7C4 3C0A800A */ lui $t2, %hi(mdl_currentModelTreeNodeInfo)
/* B1EC8 8011B7C8 8D4AA5F4 */ lw $t2, %lo(mdl_currentModelTreeNodeInfo)($t2)
/* B1ECC 8011B7CC 00041080 */ sll $v0, $a0, 2
/* B1ED0 8011B7D0 004A3821 */ addu $a3, $v0, $t2
/* B1ED4 8011B7D4 90E30000 */ lbu $v1, 0x0($a3)
/* B1ED8 8011B7D8 286200FF */ slti $v0, $v1, 0xFF
/* B1EDC 8011B7DC 10400004 */ beqz $v0, .L8011B7F0
/* B1EE0 8011B7E0 2408FFFF */ addiu $t0, $zero, -0x1
/* B1EE4 8011B7E4 0060402D */ daddu $t0, $v1, $zero
/* B1EE8 8011B7E8 08046E10 */ j .L8011B840
/* B1EEC 8011B7EC 0100482D */ daddu $t1, $t0, $zero
.L8011B7F0:
/* B1EF0 8011B7F0 2484FFFF */ addiu $a0, $a0, -0x1
/* B1EF4 8011B7F4 90EB0001 */ lbu $t3, 0x1($a3)
/* B1EF8 8011B7F8 04800011 */ bltz $a0, .L8011B840
/* B1EFC 8011B7FC 00041080 */ sll $v0, $a0, 2
/* B1F00 8011B800 240CFFFF */ addiu $t4, $zero, -0x1
/* B1F04 8011B804 004A3821 */ addu $a3, $v0, $t2
.L8011B808:
/* B1F08 8011B808 90E20001 */ lbu $v0, 0x1($a3)
/* B1F0C 8011B80C 0162102A */ slt $v0, $t3, $v0
/* B1F10 8011B810 1040000C */ beqz $v0, .L8011B844
/* B1F14 8011B814 28C20002 */ slti $v0, $a2, 0x2
/* B1F18 8011B818 90E30000 */ lbu $v1, 0x0($a3)
/* B1F1C 8011B81C 286200FF */ slti $v0, $v1, 0xFF
/* B1F20 8011B820 50400005 */ beql $v0, $zero, .L8011B838
/* B1F24 8011B824 2484FFFF */ addiu $a0, $a0, -0x1
/* B1F28 8011B828 510C0001 */ beql $t0, $t4, .L8011B830
/* B1F2C 8011B82C 0060402D */ daddu $t0, $v1, $zero
.L8011B830:
/* B1F30 8011B830 0060482D */ daddu $t1, $v1, $zero
/* B1F34 8011B834 2484FFFF */ addiu $a0, $a0, -0x1
.L8011B838:
/* B1F38 8011B838 0481FFF3 */ bgez $a0, .L8011B808
/* B1F3C 8011B83C 24E7FFFC */ addiu $a3, $a3, -0x4
.L8011B840:
/* B1F40 8011B840 28C20002 */ slti $v0, $a2, 0x2
.L8011B844:
/* B1F44 8011B844 10400016 */ beqz $v0, .L8011B8A0
/* B1F48 8011B848 0120202D */ daddu $a0, $t1, $zero
/* B1F4C 8011B84C 0104102A */ slt $v0, $t0, $a0
/* B1F50 8011B850 14400011 */ bnez $v0, .L8011B898
/* B1F54 8011B854 00054827 */ nor $t1, $zero, $a1
/* B1F58 8011B858 3C038015 */ lui $v1, %hi(gCurrentModels)
/* B1F5C 8011B85C 8C6312CC */ lw $v1, %lo(gCurrentModels)($v1)
/* B1F60 8011B860 00041080 */ sll $v0, $a0, 2
/* B1F64 8011B864 00433821 */ addu $a3, $v0, $v1
.L8011B868:
/* B1F68 8011B868 10C00004 */ beqz $a2, .L8011B87C
/* B1F6C 8011B86C 8CE30000 */ lw $v1, 0x0($a3)
/* B1F70 8011B870 94620000 */ lhu $v0, 0x0($v1)
/* B1F74 8011B874 08046E21 */ j .L8011B884
/* B1F78 8011B878 00491024 */ and $v0, $v0, $t1
.L8011B87C:
/* B1F7C 8011B87C 94620000 */ lhu $v0, 0x0($v1)
/* B1F80 8011B880 00451025 */ or $v0, $v0, $a1
.L8011B884:
/* B1F84 8011B884 A4620000 */ sh $v0, 0x0($v1)
/* B1F88 8011B888 24840001 */ addiu $a0, $a0, 0x1
/* B1F8C 8011B88C 0104102A */ slt $v0, $t0, $a0
/* B1F90 8011B890 1040FFF5 */ beqz $v0, .L8011B868
/* B1F94 8011B894 24E70004 */ addiu $a3, $a3, 0x4
.L8011B898:
/* B1F98 8011B898 03E00008 */ jr $ra
/* B1F9C 8011B89C 00000000 */ nop
.L8011B8A0:
/* B1FA0 8011B8A0 19200011 */ blez $t1, .L8011B8E8
/* B1FA4 8011B8A4 0000202D */ daddu $a0, $zero, $zero
/* B1FA8 8011B8A8 240B0003 */ addiu $t3, $zero, 0x3
/* B1FAC 8011B8AC 00055027 */ nor $t2, $zero, $a1
/* B1FB0 8011B8B0 3C078015 */ lui $a3, %hi(gCurrentModels)
/* B1FB4 8011B8B4 8CE712CC */ lw $a3, %lo(gCurrentModels)($a3)
.L8011B8B8:
/* B1FB8 8011B8B8 14CB0004 */ bne $a2, $t3, .L8011B8CC
/* B1FBC 8011B8BC 8CE30000 */ lw $v1, 0x0($a3)
/* B1FC0 8011B8C0 94620000 */ lhu $v0, 0x0($v1)
/* B1FC4 8011B8C4 08046E35 */ j .L8011B8D4
/* B1FC8 8011B8C8 004A1024 */ and $v0, $v0, $t2
.L8011B8CC:
/* B1FCC 8011B8CC 94620000 */ lhu $v0, 0x0($v1)
/* B1FD0 8011B8D0 00451025 */ or $v0, $v0, $a1
.L8011B8D4:
/* B1FD4 8011B8D4 A4620000 */ sh $v0, 0x0($v1)
/* B1FD8 8011B8D8 24840001 */ addiu $a0, $a0, 0x1
/* B1FDC 8011B8DC 0089102A */ slt $v0, $a0, $t1
/* B1FE0 8011B8E0 1440FFF5 */ bnez $v0, .L8011B8B8
/* B1FE4 8011B8E4 24E70004 */ addiu $a3, $a3, 0x4
.L8011B8E8:
/* B1FE8 8011B8E8 25040001 */ addiu $a0, $t0, 0x1
/* B1FEC 8011B8EC 28820100 */ slti $v0, $a0, 0x100
/* B1FF0 8011B8F0 1040FFE9 */ beqz $v0, .L8011B898
/* B1FF4 8011B8F4 24090003 */ addiu $t1, $zero, 0x3
/* B1FF8 8011B8F8 00054027 */ nor $t0, $zero, $a1
/* B1FFC 8011B8FC 3C038015 */ lui $v1, %hi(gCurrentModels)
/* B2000 8011B900 8C6312CC */ lw $v1, %lo(gCurrentModels)($v1)
/* B2004 8011B904 00041080 */ sll $v0, $a0, 2
/* B2008 8011B908 00433821 */ addu $a3, $v0, $v1
.L8011B90C:
/* B200C 8011B90C 8CE30000 */ lw $v1, 0x0($a3)
/* B2010 8011B910 5060000A */ beql $v1, $zero, .L8011B93C
/* B2014 8011B914 24840001 */ addiu $a0, $a0, 0x1
/* B2018 8011B918 14C90004 */ bne $a2, $t1, .L8011B92C
/* B201C 8011B91C 00000000 */ nop
/* B2020 8011B920 94620000 */ lhu $v0, 0x0($v1)
/* B2024 8011B924 08046E4D */ j .L8011B934
/* B2028 8011B928 00481024 */ and $v0, $v0, $t0
.L8011B92C:
/* B202C 8011B92C 94620000 */ lhu $v0, 0x0($v1)
/* B2030 8011B930 00451025 */ or $v0, $v0, $a1
.L8011B934:
/* B2034 8011B934 A4620000 */ sh $v0, 0x0($v1)
/* B2038 8011B938 24840001 */ addiu $a0, $a0, 0x1
.L8011B93C:
/* B203C 8011B93C 28820100 */ slti $v0, $a0, 0x100
/* B2040 8011B940 1440FFF2 */ bnez $v0, .L8011B90C
/* B2044 8011B944 24E70004 */ addiu $a3, $a3, 0x4
/* B2048 8011B948 03E00008 */ jr $ra
/* B204C 8011B94C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void set_model_group_visibility(u16 treeIndex, s32 flags, s32 mode) {
s32 maxGroupIndex = -1;
s32 minGroupIndex;
s32 modelIndex = (*mdl_currentModelTreeNodeInfo)[treeIndex].modelIndex;
s32 siblingIndex;
s32 i;
if (modelIndex < MAX_MODELS - 1) {
minGroupIndex = maxGroupIndex = modelIndex;
} else {
s32 treeDepth = (*mdl_currentModelTreeNodeInfo)[treeIndex].treeDepth;
for (i = treeIndex - 1; i >= 0; i--) {
if ((*mdl_currentModelTreeNodeInfo)[i].treeDepth <= treeDepth) {
break;
}
siblingIndex = (*mdl_currentModelTreeNodeInfo)[i].modelIndex;
if (siblingIndex < MAX_MODELS - 1) {
if (maxGroupIndex == -1) {
maxGroupIndex = siblingIndex;
}
minGroupIndex = siblingIndex;
}
}
}
if (mode < 2) {
for (i = minGroupIndex; i <= maxGroupIndex; i++) {
Model* model = (*gCurrentModels)[i];
if (mode != MODEL_GROUP_HIDDEN) {
model->flags &= ~flags;
} else {
model->flags |= flags;
}
}
} else {
for (i = 0; i < minGroupIndex; i++) {
Model* model = (*gCurrentModels)[i];
if (mode == MODEL_GROUP_OTHERS_VISIBLE) {
model->flags &= ~flags;
} else {
model->flags |= flags;
}
}
for (i = maxGroupIndex + 1; i < MAX_MODELS; i++) {
Model* model = (*gCurrentModels)[i];
if (model != NULL) {
if (mode == MODEL_GROUP_OTHERS_VISIBLE) {
model->flags &= ~flags;
} else {
model->flags |= flags;
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel npc_raycast_up_corner
/* 764FC 800DD04C 27BDFF60 */ addiu $sp, $sp, -0xA0
/* 76500 800DD050 AFB20060 */ sw $s2, 0x60($sp)
/* 76504 800DD054 00A0902D */ daddu $s2, $a1, $zero
/* 76508 800DD058 AFB30064 */ sw $s3, 0x64($sp)
/* 7650C 800DD05C 00C0982D */ daddu $s3, $a2, $zero
/* 76510 800DD060 AFB40068 */ sw $s4, 0x68($sp)
/* 76514 800DD064 00E0A02D */ daddu $s4, $a3, $zero
/* 76518 800DD068 AFB00058 */ sw $s0, 0x58($sp)
/* 7651C 800DD06C 2410FFFF */ addiu $s0, $zero, -0x1
/* 76520 800DD070 AFBF006C */ sw $ra, 0x6C($sp)
/* 76524 800DD074 AFB1005C */ sw $s1, 0x5C($sp)
/* 76528 800DD078 F7BE0098 */ sdc1 $f30, 0x98($sp)
/* 7652C 800DD07C F7BC0090 */ sdc1 $f28, 0x90($sp)
/* 76530 800DD080 F7BA0088 */ sdc1 $f26, 0x88($sp)
/* 76534 800DD084 F7B80080 */ sdc1 $f24, 0x80($sp)
/* 76538 800DD088 F7B60078 */ sdc1 $f22, 0x78($sp)
/* 7653C 800DD08C F7B40070 */ sdc1 $f20, 0x70($sp)
/* 76540 800DD090 C6580000 */ lwc1 $f24, 0x0($s2)
/* 76544 800DD094 C6760000 */ lwc1 $f22, 0x0($s3)
/* 76548 800DD098 C6940000 */ lwc1 $f20, 0x0($s4)
/* 7654C 800DD09C 8FB100B0 */ lw $s1, 0xB0($sp)
/* 76550 800DD0A0 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 76554 800DD0A4 44811000 */ mtc1 $at, $f2
/* 76558 800DD0A8 4406B000 */ mfc1 $a2, $f22
/* 7655C 800DD0AC 4407A000 */ mfc1 $a3, $f20
/* 76560 800DD0B0 C6200000 */ lwc1 $f0, 0x0($s1)
/* 76564 800DD0B4 4405C000 */ mfc1 $a1, $f24
/* 76568 800DD0B8 27A20038 */ addiu $v0, $sp, 0x38
/* 7656C 800DD0BC E7A00044 */ swc1 $f0, 0x44($sp)
/* 76570 800DD0C0 AFA2001C */ sw $v0, 0x1C($sp)
/* 76574 800DD0C4 27A2003C */ addiu $v0, $sp, 0x3C
/* 76578 800DD0C8 AFA20020 */ sw $v0, 0x20($sp)
/* 7657C 800DD0CC 27A20040 */ addiu $v0, $sp, 0x40
/* 76580 800DD0D0 AFA20024 */ sw $v0, 0x24($sp)
/* 76584 800DD0D4 27A20044 */ addiu $v0, $sp, 0x44
/* 76588 800DD0D8 AFA20028 */ sw $v0, 0x28($sp)
/* 7658C 800DD0DC 27A20048 */ addiu $v0, $sp, 0x48
/* 76590 800DD0E0 AFA2002C */ sw $v0, 0x2C($sp)
/* 76594 800DD0E4 27A2004C */ addiu $v0, $sp, 0x4C
/* 76598 800DD0E8 AFA20030 */ sw $v0, 0x30($sp)
/* 7659C 800DD0EC 27A20050 */ addiu $v0, $sp, 0x50
/* 765A0 800DD0F0 AFA00010 */ sw $zero, 0x10($sp)
/* 765A4 800DD0F4 E7A20014 */ swc1 $f2, 0x14($sp)
/* 765A8 800DD0F8 AFA00018 */ sw $zero, 0x18($sp)
/* 765AC 800DD0FC 0C017334 */ jal test_ray_colliders
/* 765B0 800DD100 AFA20034 */ sw $v0, 0x34($sp)
/* 765B4 800DD104 4600C686 */ mov.s $f26, $f24
/* 765B8 800DD108 4600B706 */ mov.s $f28, $f22
/* 765BC 800DD10C 0440000C */ bltz $v0, .L800DD140
/* 765C0 800DD110 4600A786 */ mov.s $f30, $f20
/* 765C4 800DD114 C6200000 */ lwc1 $f0, 0x0($s1)
/* 765C8 800DD118 C7A20044 */ lwc1 $f2, 0x44($sp)
/* 765CC 800DD11C 4600103C */ c.lt.s $f2, $f0
/* 765D0 800DD120 00000000 */ nop
/* 765D4 800DD124 45020007 */ bc1fl .L800DD144
/* 765D8 800DD128 4600D606 */ mov.s $f24, $f26
/* 765DC 800DD12C 0040802D */ daddu $s0, $v0, $zero
/* 765E0 800DD130 E6220000 */ swc1 $f2, 0x0($s1)
/* 765E4 800DD134 E6580000 */ swc1 $f24, 0x0($s2)
/* 765E8 800DD138 E6760000 */ swc1 $f22, 0x0($s3)
/* 765EC 800DD13C E6940000 */ swc1 $f20, 0x0($s4)
.L800DD140:
/* 765F0 800DD140 4600D606 */ mov.s $f24, $f26
.L800DD144:
/* 765F4 800DD144 4600E586 */ mov.s $f22, $f28
/* 765F8 800DD148 3C014120 */ lui $at, (0x41200000 >> 16)
/* 765FC 800DD14C 44811000 */ mtc1 $at, $f2
/* 76600 800DD150 44802000 */ mtc1 $zero, $f4
/* 76604 800DD154 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 76608 800DD158 44810000 */ mtc1 $at, $f0
/* 7660C 800DD15C 27A20038 */ addiu $v0, $sp, 0x38
/* 76610 800DD160 E7A20044 */ swc1 $f2, 0x44($sp)
/* 76614 800DD164 AFA20018 */ sw $v0, 0x18($sp)
/* 76618 800DD168 27A2003C */ addiu $v0, $sp, 0x3C
/* 7661C 800DD16C AFA2001C */ sw $v0, 0x1C($sp)
/* 76620 800DD170 27A20040 */ addiu $v0, $sp, 0x40
/* 76624 800DD174 AFA20020 */ sw $v0, 0x20($sp)
/* 76628 800DD178 27A20044 */ addiu $v0, $sp, 0x44
/* 7662C 800DD17C AFA20024 */ sw $v0, 0x24($sp)
/* 76630 800DD180 27A20048 */ addiu $v0, $sp, 0x48
/* 76634 800DD184 AFA20028 */ sw $v0, 0x28($sp)
/* 76638 800DD188 27A2004C */ addiu $v0, $sp, 0x4C
/* 7663C 800DD18C AFA2002C */ sw $v0, 0x2C($sp)
/* 76640 800DD190 27A20050 */ addiu $v0, $sp, 0x50
/* 76644 800DD194 E7A00010 */ swc1 $f0, 0x10($sp)
/* 76648 800DD198 E7A40014 */ swc1 $f4, 0x14($sp)
/* 7664C 800DD19C AFA20030 */ sw $v0, 0x30($sp)
/* 76650 800DD1A0 8E860000 */ lw $a2, 0x0($s4)
/* 76654 800DD1A4 44072000 */ mfc1 $a3, $f4
/* 76658 800DD1A8 C64C0000 */ lwc1 $f12, 0x0($s2)
/* 7665C 800DD1AC C66E0000 */ lwc1 $f14, 0x0($s3)
/* 76660 800DD1B0 0C017512 */ jal test_ray_entities
/* 76664 800DD1B4 4600F506 */ mov.s $f20, $f30
/* 76668 800DD1B8 0442000D */ bltzl $v0, .L800DD1F0
/* 7666C 800DD1BC 0200102D */ daddu $v0, $s0, $zero
/* 76670 800DD1C0 C6200000 */ lwc1 $f0, 0x0($s1)
/* 76674 800DD1C4 C7A20044 */ lwc1 $f2, 0x44($sp)
/* 76678 800DD1C8 4600103C */ c.lt.s $f2, $f0
/* 7667C 800DD1CC 00000000 */ nop
/* 76680 800DD1D0 45020007 */ bc1fl .L800DD1F0
/* 76684 800DD1D4 0200102D */ daddu $v0, $s0, $zero
/* 76688 800DD1D8 34504000 */ ori $s0, $v0, 0x4000
/* 7668C 800DD1DC E6220000 */ swc1 $f2, 0x0($s1)
/* 76690 800DD1E0 E6580000 */ swc1 $f24, 0x0($s2)
/* 76694 800DD1E4 E6760000 */ swc1 $f22, 0x0($s3)
/* 76698 800DD1E8 E6940000 */ swc1 $f20, 0x0($s4)
/* 7669C 800DD1EC 0200102D */ daddu $v0, $s0, $zero
.L800DD1F0:
/* 766A0 800DD1F0 8FBF006C */ lw $ra, 0x6C($sp)
/* 766A4 800DD1F4 8FB40068 */ lw $s4, 0x68($sp)
/* 766A8 800DD1F8 8FB30064 */ lw $s3, 0x64($sp)
/* 766AC 800DD1FC 8FB20060 */ lw $s2, 0x60($sp)
/* 766B0 800DD200 8FB1005C */ lw $s1, 0x5C($sp)
/* 766B4 800DD204 8FB00058 */ lw $s0, 0x58($sp)
/* 766B8 800DD208 D7BE0098 */ ldc1 $f30, 0x98($sp)
/* 766BC 800DD20C D7BC0090 */ ldc1 $f28, 0x90($sp)
/* 766C0 800DD210 D7BA0088 */ ldc1 $f26, 0x88($sp)
/* 766C4 800DD214 D7B80080 */ ldc1 $f24, 0x80($sp)
/* 766C8 800DD218 D7B60078 */ ldc1 $f22, 0x78($sp)
/* 766CC 800DD21C D7B40070 */ ldc1 $f20, 0x70($sp)
/* 766D0 800DD220 03E00008 */ jr $ra
/* 766D4 800DD224 27BD00A0 */ addiu $sp, $sp, 0xA0
### DECOMPILED C INSTRUCTIONS:
s32 npc_raycast_up_corner(s32 ignoreFlags, f32* x, f32* y, f32* z, f32* length) {
f32 hitX;
f32 hitY;
f32 hitZ;
f32 hitDepth;
f32 hitNx;
f32 hitNy;
f32 hitNz;
s32 colliderID;
s32 entityID;
f32 sx, sy, sz;
f32 sx2, sy2, sz2;
s32 ret = -1;
// needed to match
sx2 = sx = *x;
sy2 = sy = *y;
sz2 = sz = *z;
hitDepth = *length;
colliderID = test_ray_colliders(ignoreFlags, sx, sy, sz, 0.0f, 1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
if (colliderID >= 0 && *length > hitDepth) {
*length = hitDepth;
ret = colliderID;
*x = sx = sx2;
*y = sy = sy2;
*z = sz = sz2;
}
hitDepth = 10.0f;
entityID = test_ray_entities(*x, *y, *z, 0.0f, 1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &hitNx, &hitNy, &hitNz);
sx = sx2;
sy = sy2;
sz = sz2;
if (entityID >= 0 && *length > hitDepth) {
ret = entityID | COLLISION_WITH_ENTITY_BIT;
*length = hitDepth;
*x = sx;
*y = sy;
*z = sz;
}
return ret;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80244858
/* 137B98 80244858 2882F581 */ slti $v0, $a0, -0xA7F
.L8024485C:
/* 137B9C 8024485C 8FA90014 */ lw $t1, 0x14($sp)
D_80244860:
/* 137BA0 80244860 8FAA0018 */ lw $t2, 0x18($sp)
/* 137BA4 80244864 8FAB001C */ lw $t3, 0x1C($sp)
D_80244868:
/* 137BA8 80244868 8FAC0020 */ lw $t4, 0x20($sp)
glabel func_8024486C
/* 137BAC 8024486C 14400075 */ bnez $v0, .L80244A44
jtbl_80244870:
/* 137BB0 80244870 28A2F581 */ slti $v0, $a1, -0xA7F
/* 137BB4 80244874 14400073 */ bnez $v0, .L80244A44
D_80244878:
/* 137BB8 80244878 00000000 */ nop
/* 137BBC 8024487C 18C00071 */ blez $a2, .L80244A44
D_80244880:
/* 137BC0 80244880 00000000 */ nop
/* 137BC4 80244884 18E0006F */ blez $a3, .L80244A44
D_80244888:
/* 137BC8 80244888 28820500 */ slti $v0, $a0, 0x500
.L8024488C:
/* 137BCC 8024488C 1040006D */ beqz $v0, .L80244A44
D_80244890:
/* 137BD0 80244890 28A203C0 */ slti $v0, $a1, 0x3C0
.L80244894:
/* 137BD4 80244894 1040006B */ beqz $v0, .L80244A44
jtbl_80244898:
/* 137BD8 80244898 28C20A80 */ slti $v0, $a2, 0xA80
/* 137BDC 8024489C 10400069 */ beqz $v0, .L80244A44
D_802448A0:
/* 137BE0 802448A0 28E20A80 */ slti $v0, $a3, 0xA80
/* 137BE4 802448A4 10400067 */ beqz $v0, .L80244A44
D_802448A8:
/* 137BE8 802448A8 00000000 */ nop
/* 137BEC 802448AC 3C02800A */ lui $v0, %hi(gMainGfxPos)
D_802448B0:
/* 137BF0 802448B0 2442A66C */ addiu $v0, $v0, %lo(gMainGfxPos)
/* 137BF4 802448B4 8C480000 */ lw $t0, 0x0($v0)
jtbl_802448B8:
/* 137BF8 802448B8 25030008 */ addiu $v1, $t0, 0x8
D_802448BC:
/* 137BFC 802448BC AC430000 */ sw $v1, 0x0($v0)
D_802448C0:
/* 137C00 802448C0 00061400 */ sll $v0, $a2, 16
/* 137C04 802448C4 00021403 */ sra $v0, $v0, 16
.L802448C8:
/* 137C08 802448C8 18400005 */ blez $v0, func_802448E0
/* 137C0C 802448CC 30420FFF */ andi $v0, $v0, 0xFFF
/* 137C10 802448D0 00021300 */ sll $v0, $v0, 12
/* 137C14 802448D4 3C03E400 */ lui $v1, (0xE4000000 >> 16)
jtbl_802448D8:
/* 137C18 802448D8 08091239 */ j .L802448E4
/* 137C1C 802448DC 00431825 */ or $v1, $v0, $v1
glabel func_802448E0
/* 137C20 802448E0 3C03E400 */ lui $v1, (0xE4000000 >> 16)
.L802448E4:
/* 137C24 802448E4 00071400 */ sll $v0, $a3, 16
/* 137C28 802448E8 00021403 */ sra $v0, $v0, 16
/* 137C2C 802448EC 18400004 */ blez $v0, D_80244900
/* 137C30 802448F0 AD030000 */ sw $v1, 0x0($t0)
D_802448F4:
/* 137C34 802448F4 30420FFF */ andi $v0, $v0, 0xFFF
/* 137C38 802448F8 00621025 */ or $v0, $v1, $v0
D_802448FC:
/* 137C3C 802448FC AD020000 */ sw $v0, 0x0($t0)
D_80244900:
/* 137C40 80244900 8FA20010 */ lw $v0, 0x10($sp)
/* 137C44 80244904 30420007 */ andi $v0, $v0, 0x7
/* 137C48 80244908 00021E00 */ sll $v1, $v0, 24
D_8024490C:
/* 137C4C 8024490C 00041400 */ sll $v0, $a0, 16
jtbl_80244910:
/* 137C50 80244910 00023403 */ sra $a2, $v0, 16
/* 137C54 80244914 18C00003 */ blez $a2, .L80244924
.L80244918:
/* 137C58 80244918 30C20FFF */ andi $v0, $a2, 0xFFF
.L8024491C:
/* 137C5C 8024491C 00021300 */ sll $v0, $v0, 12
D_80244920:
/* 137C60 80244920 00621825 */ or $v1, $v1, $v0
.L80244924:
/* 137C64 80244924 00051400 */ sll $v0, $a1, 16
/* 137C68 80244928 00021403 */ sra $v0, $v0, 16
/* 137C6C 8024492C 18400004 */ blez $v0, .L80244940
/* 137C70 80244930 AD030004 */ sw $v1, 0x4($t0)
glabel func_80244934
/* 137C74 80244934 30420FFF */ andi $v0, $v0, 0xFFF
/* 137C78 80244938 00621025 */ or $v0, $v1, $v0
/* 137C7C 8024493C AD020004 */ sw $v0, 0x4($t0)
.L80244940:
/* 137C80 80244940 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 137C84 80244944 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
.L80244948:
/* 137C88 80244948 8C620000 */ lw $v0, 0x0($v1)
/* 137C8C 8024494C 0040202D */ daddu $a0, $v0, $zero
/* 137C90 80244950 24420008 */ addiu $v0, $v0, 0x8
.L80244954:
/* 137C94 80244954 AC620000 */ sw $v0, 0x0($v1)
/* 137C98 80244958 3C02E100 */ lui $v0, (0xE1000000 >> 16)
/* 137C9C 8024495C AC820000 */ sw $v0, 0x0($a0)
D_80244960:
/* 137CA0 80244960 04C10012 */ bgez $a2, .L802449AC
.L80244964:
/* 137CA4 80244964 24840004 */ addiu $a0, $a0, 0x4
D_80244968:
/* 137CA8 80244968 000B1400 */ sll $v0, $t3, 16
/* 137CAC 8024496C 00021403 */ sra $v0, $v0, 16
/* 137CB0 80244970 04410007 */ bgez $v0, .L80244990
.L80244974:
/* 137CB4 80244974 00C20018 */ mult $a2, $v0
/* 137CB8 80244978 00006812 */ mflo $t5
/* 137CBC 8024497C 000D11C3 */ sra $v0, $t5, 7
/* 137CC0 80244980 04410008 */ bgez $v0, .L802449A4
glabel func_80244984
/* 137CC4 80244984 01221023 */ subu $v0, $t1, $v0
D_80244988:
/* 137CC8 80244988 08091268 */ j .L802449A0
.L8024498C:
/* 137CCC 8024498C 0000102D */ daddu $v0, $zero, $zero
.L80244990:
/* 137CD0 80244990 00006812 */ mflo $t5
/* 137CD4 80244994 000D11C3 */ sra $v0, $t5, 7
D_80244998:
/* 137CD8 80244998 5C400001 */ bgtzl $v0, .L802449A0
/* 137CDC 8024499C 0000102D */ daddu $v0, $zero, $zero
.L802449A0:
/* 137CE0 802449A0 01221023 */ subu $v0, $t1, $v0
.L802449A4:
/* 137CE4 802449A4 0809126C */ j D_802449B0
/* 137CE8 802449A8 00023400 */ sll $a2, $v0, 16
.L802449AC:
/* 137CEC 802449AC 00093400 */ sll $a2, $t1, 16
D_802449B0:
/* 137CF0 802449B0 04A10016 */ bgez $a1, D_80244A0C
.L802449B4:
/* 137CF4 802449B4 3142FFFF */ andi $v0, $t2, 0xFFFF
.L802449B8:
/* 137CF8 802449B8 000C1400 */ sll $v0, $t4, 16
/* 137CFC 802449BC 00021C03 */ sra $v1, $v0, 16
/* 137D00 802449C0 0461000A */ bgez $v1, D_802449EC
D_802449C4:
/* 137D04 802449C4 00051400 */ sll $v0, $a1, 16
.L802449C8:
/* 137D08 802449C8 00021403 */ sra $v0, $v0, 16
D_802449CC:
/* 137D0C 802449CC 00430018 */ mult $v0, $v1
D_802449D0:
/* 137D10 802449D0 00006812 */ mflo $t5
/* 137D14 802449D4 000D11C3 */ sra $v0, $t5, 7
D_802449D8:
/* 137D18 802449D8 04420001 */ bltzl $v0, .L802449E0
.L802449DC:
/* 137D1C 802449DC 0000102D */ daddu $v0, $zero, $zero
.L802449E0:
/* 137D20 802449E0 01421023 */ subu $v0, $t2, $v0
glabel func_802449E4
/* 137D24 802449E4 08091283 */ j D_80244A0C
/* 137D28 802449E8 3042FFFF */ andi $v0, $v0, 0xFFFF
D_802449EC:
/* 137D2C 802449EC 00021403 */ sra $v0, $v0, 16
D_802449F0:
/* 137D30 802449F0 00430018 */ mult $v0, $v1
D_802449F4:
/* 137D34 802449F4 00006812 */ mflo $t5
glabel func_802449F8
/* 137D38 802449F8 000D11C3 */ sra $v0, $t5, 7
D_802449FC:
/* 137D3C 802449FC 5C400001 */ bgtzl $v0, D_80244A04
jtbl_80244A00:
/* 137D40 80244A00 0000102D */ daddu $v0, $zero, $zero
D_80244A04:
/* 137D44 80244A04 01421023 */ subu $v0, $t2, $v0
/* 137D48 80244A08 3042FFFF */ andi $v0, $v0, 0xFFFF
D_80244A0C:
/* 137D4C 80244A0C 00C21025 */ or $v0, $a2, $v0
D_80244A10:
/* 137D50 80244A10 AC820000 */ sw $v0, 0x0($a0)
/* 137D54 80244A14 3C03800A */ lui $v1, %hi(gMainGfxPos)
/* 137D58 80244A18 2463A66C */ addiu $v1, $v1, %lo(gMainGfxPos)
.L80244A1C:
/* 137D5C 80244A1C 8C620000 */ lw $v0, 0x0($v1)
### DECOMPILED C INSTRUCTIONS:
void pause_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileDescriptor, s32 uls, s32 ult, s32 dsdx, s32 dtdy) {
if (ulx <= -2688 || uly <= -2688 || lrx <= 0 || lry <= 0) {
return;
}
if (ulx >= 1280 || uly >= 960 || lrx >= 2688 || lry >= 2688) {
return;
}
gSPScisTextureRectangle(gMainGfxPos++, ulx, uly, lrx, lry, tileDescriptor, uls, ult, dsdx, dtdy);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel __osGetId
/* 45008 80069C08 27BDFF98 */ addiu $sp, $sp, -0x68
/* 4500C 80069C0C AFB00058 */ sw $s0, 0x58($sp)
/* 45010 80069C10 00808021 */ addu $s0, $a0, $zero
/* 45014 80069C14 AFBF0060 */ sw $ra, 0x60($sp)
/* 45018 80069C18 AFB1005C */ sw $s1, 0x5C($sp)
/* 4501C 80069C1C 92020065 */ lbu $v0, 0x65($s0)
/* 45020 80069C20 10400006 */ beqz $v0, .L80069C3C
/* 45024 80069C24 00000000 */ nop
/* 45028 80069C28 0C01A5B4 */ jal __osPfsSelectBank
/* 4502C 80069C2C 00002821 */ addu $a1, $zero, $zero
/* 45030 80069C30 00401821 */ addu $v1, $v0, $zero
/* 45034 80069C34 14600062 */ bnez $v1, .L80069DC0
/* 45038 80069C38 00000000 */ nop
.L80069C3C:
/* 4503C 80069C3C 8E040004 */ lw $a0, 0x4($s0)
/* 45040 80069C40 8E050008 */ lw $a1, 0x8($s0)
/* 45044 80069C44 24060001 */ addiu $a2, $zero, 0x1
/* 45048 80069C48 0C01A874 */ jal __osContRamRead
/* 4504C 80069C4C 27A70010 */ addiu $a3, $sp, 0x10
/* 45050 80069C50 00401821 */ addu $v1, $v0, $zero
/* 45054 80069C54 1460005A */ bnez $v1, .L80069DC0
/* 45058 80069C58 27A50010 */ addiu $a1, $sp, 0x10
/* 4505C 80069C5C 27A7002C */ addiu $a3, $sp, 0x2C
/* 45060 80069C60 A7A00052 */ sh $zero, 0x52($sp)
/* 45064 80069C64 A7A00050 */ sh $zero, 0x50($sp)
.L80069C68:
/* 45068 80069C68 94A20000 */ lhu $v0, 0x0($a1)
/* 4506C 80069C6C 97A30050 */ lhu $v1, 0x50($sp)
/* 45070 80069C70 97A40052 */ lhu $a0, 0x52($sp)
/* 45074 80069C74 24A50002 */ addiu $a1, $a1, 0x2
/* 45078 80069C78 00623021 */ addu $a2, $v1, $v0
/* 4507C 80069C7C 00021027 */ nor $v0, $zero, $v0
/* 45080 80069C80 00822021 */ addu $a0, $a0, $v0
/* 45084 80069C84 00A7102B */ sltu $v0, $a1, $a3
/* 45088 80069C88 A7A60050 */ sh $a2, 0x50($sp)
/* 4508C 80069C8C 1440FFF6 */ bnez $v0, .L80069C68
/* 45090 80069C90 A7A40052 */ sh $a0, 0x52($sp)
/* 45094 80069C94 97A3002C */ lhu $v1, 0x2C($sp)
/* 45098 80069C98 30C2FFFF */ andi $v0, $a2, 0xFFFF
/* 4509C 80069C9C 14620005 */ bne $v1, $v0, .L80069CB4
/* 450A0 80069CA0 27B10010 */ addiu $s1, $sp, 0x10
/* 450A4 80069CA4 97A3002E */ lhu $v1, 0x2E($sp)
/* 450A8 80069CA8 3082FFFF */ andi $v0, $a0, 0xFFFF
/* 450AC 80069CAC 10620013 */ beq $v1, $v0, .L80069CFC
/* 450B0 80069CB0 00000000 */ nop
.L80069CB4:
/* 450B4 80069CB4 02002021 */ addu $a0, $s0, $zero
/* 450B8 80069CB8 0C01A6A9 */ jal __osCheckPackId
/* 450BC 80069CBC 02202821 */ addu $a1, $s1, $zero
/* 450C0 80069CC0 00401821 */ addu $v1, $v0, $zero
/* 450C4 80069CC4 2402000A */ addiu $v0, $zero, 0xA
/* 450C8 80069CC8 1462000A */ bne $v1, $v0, .L80069CF4
/* 450CC 80069CCC 02002021 */ addu $a0, $s0, $zero
/* 450D0 80069CD0 02202821 */ addu $a1, $s1, $zero
/* 450D4 80069CD4 27B10030 */ addiu $s1, $sp, 0x30
/* 450D8 80069CD8 0C01A5EE */ jal __osRepairPackId
/* 450DC 80069CDC 02203021 */ addu $a2, $s1, $zero
/* 450E0 80069CE0 00401821 */ addu $v1, $v0, $zero
/* 450E4 80069CE4 10600005 */ beqz $v1, .L80069CFC
/* 450E8 80069CE8 00000000 */ nop
/* 450EC 80069CEC 0801A770 */ j .L80069DC0
/* 450F0 80069CF0 00000000 */ nop
.L80069CF4:
/* 450F4 80069CF4 14600032 */ bnez $v1, .L80069DC0
/* 450F8 80069CF8 00601021 */ addu $v0, $v1, $zero
.L80069CFC:
/* 450FC 80069CFC 96220018 */ lhu $v0, 0x18($s1)
/* 45100 80069D00 30420001 */ andi $v0, $v0, 0x1
/* 45104 80069D04 1440000F */ bnez $v0, .L80069D44
/* 45108 80069D08 02202021 */ addu $a0, $s1, $zero
/* 4510C 80069D0C 02002021 */ addu $a0, $s0, $zero
/* 45110 80069D10 02202821 */ addu $a1, $s1, $zero
/* 45114 80069D14 27B10030 */ addiu $s1, $sp, 0x30
/* 45118 80069D18 0C01A5EE */ jal __osRepairPackId
/* 4511C 80069D1C 02203021 */ addu $a2, $s1, $zero
/* 45120 80069D20 00401821 */ addu $v1, $v0, $zero
/* 45124 80069D24 14600026 */ bnez $v1, .L80069DC0
/* 45128 80069D28 00000000 */ nop
/* 4512C 80069D2C 97A20048 */ lhu $v0, 0x48($sp)
/* 45130 80069D30 30420001 */ andi $v0, $v0, 0x1
/* 45134 80069D34 14400003 */ bnez $v0, .L80069D44
/* 45138 80069D38 02202021 */ addu $a0, $s1, $zero
/* 4513C 80069D3C 0801A770 */ j .L80069DC0
/* 45140 80069D40 2402000B */ addiu $v0, $zero, 0xB
.L80069D44:
/* 45144 80069D44 2605000C */ addiu $a1, $s0, 0xC
/* 45148 80069D48 0C019194 */ jal bcopy
/* 4514C 80069D4C 24060020 */ addiu $a2, $zero, 0x20
/* 45150 80069D50 8E040004 */ lw $a0, 0x4($s0)
/* 45154 80069D54 8E050008 */ lw $a1, 0x8($s0)
/* 45158 80069D58 9222001B */ lbu $v0, 0x1B($s1)
/* 4515C 80069D5C 24060007 */ addiu $a2, $zero, 0x7
/* 45160 80069D60 AE02004C */ sw $v0, 0x4C($s0)
/* 45164 80069D64 9223001A */ lbu $v1, 0x1A($s1)
/* 45168 80069D68 2607002C */ addiu $a3, $s0, 0x2C
/* 4516C 80069D6C 24020010 */ addiu $v0, $zero, 0x10
/* 45170 80069D70 AE020050 */ sw $v0, 0x50($s0)
/* 45174 80069D74 24020008 */ addiu $v0, $zero, 0x8
/* 45178 80069D78 AE020054 */ sw $v0, 0x54($s0)
/* 4517C 80069D7C A2030064 */ sb $v1, 0x64($s0)
/* 45180 80069D80 92020064 */ lbu $v0, 0x64($s0)
/* 45184 80069D84 00031840 */ sll $v1, $v1, 1
/* 45188 80069D88 24630003 */ addiu $v1, $v1, 0x3
/* 4518C 80069D8C AE030060 */ sw $v1, 0x60($s0)
/* 45190 80069D90 92030064 */ lbu $v1, 0x64($s0)
/* 45194 80069D94 24420001 */ addiu $v0, $v0, 0x1
/* 45198 80069D98 000210C0 */ sll $v0, $v0, 3
/* 4519C 80069D9C 000318C0 */ sll $v1, $v1, 3
/* 451A0 80069DA0 AE020058 */ sw $v0, 0x58($s0)
/* 451A4 80069DA4 00431021 */ addu $v0, $v0, $v1
/* 451A8 80069DA8 0C01A874 */ jal __osContRamRead
/* 451AC 80069DAC AE02005C */ sw $v0, 0x5C($s0)
/* 451B0 80069DB0 00401821 */ addu $v1, $v0, $zero
/* 451B4 80069DB4 0003102B */ sltu $v0, $zero, $v1
/* 451B8 80069DB8 00021023 */ negu $v0, $v0
/* 451BC 80069DBC 00621024 */ and $v0, $v1, $v0
.L80069DC0:
/* 451C0 80069DC0 8FBF0060 */ lw $ra, 0x60($sp)
/* 451C4 80069DC4 8FB1005C */ lw $s1, 0x5C($sp)
/* 451C8 80069DC8 8FB00058 */ lw $s0, 0x58($sp)
/* 451CC 80069DCC 03E00008 */ jr $ra
/* 451D0 80069DD0 27BD0068 */ addiu $sp, $sp, 0x68
### DECOMPILED C INSTRUCTIONS:
s32 __osGetId(OSPfs *pfs) {
int k;
u16 sum;
u16 isum;
u8 temp[BLOCKSIZE];
__OSPackId newid;
s32 ret;
__OSPackId *id;
SET_ACTIVEBANK_TO_ZERO;
ERRCK(__osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp));
__osIdCheckSum((u16*)temp, &sum, &isum);
id = (__OSPackId*)temp;
if (id->checksum != sum || id->inverted_checksum != isum) {
ret = __osCheckPackId(pfs, id);
if (ret == PFS_ERR_ID_FATAL) {
ERRCK(__osRepairPackId(pfs, id, &newid));
id = &newid;
} else if (ret != 0) {
return ret;
}
}
if ((id->deviceid & 1) == 0) { //TODO: remove magic constant
ERRCK(__osRepairPackId(pfs, id, &newid));
id = &newid;
if ((id->deviceid & 1) == 0) {
return PFS_ERR_DEVICE;
}
}
bcopy(id, pfs->id, ARRAY_COUNT(pfs->id));
pfs->version = id->version;
pfs->banks = id->banks;
pfs->inode_start_page = pfs->banks * 2 + 3; //TODO: loads of magic constants..
pfs->dir_size = 16;
pfs->inode_table = 8;
pfs->minode_table = (pfs->banks + 1) * PFS_ONE_PAGE;
pfs->dir_table = pfs->minode_table + pfs->banks * PFS_ONE_PAGE;
ERRCK(__osContRamRead(pfs->queue, pfs->channel, 7, pfs->label));
return 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel npc_test_move_without_slipping
/* 76DAC 800DD8FC 27BDFF68 */ addiu $sp, $sp, -0x98
/* 76DB0 800DD900 C7AC00AC */ lwc1 $f12, 0xAC($sp)
/* 76DB4 800DD904 3C0140C9 */ lui $at, (0x40C90FD0 >> 16)
/* 76DB8 800DD908 34210FD0 */ ori $at, $at, (0x40C90FD0 & 0xFFFF)
/* 76DBC 800DD90C 44810000 */ mtc1 $at, $f0
/* 76DC0 800DD910 AFB10064 */ sw $s1, 0x64($sp)
/* 76DC4 800DD914 0080882D */ daddu $s1, $a0, $zero
/* 76DC8 800DD918 AFB3006C */ sw $s3, 0x6C($sp)
/* 76DCC 800DD91C 00A0982D */ daddu $s3, $a1, $zero
/* 76DD0 800DD920 AFB00060 */ sw $s0, 0x60($sp)
/* 76DD4 800DD924 00C0802D */ daddu $s0, $a2, $zero
/* 76DD8 800DD928 AFB40070 */ sw $s4, 0x70($sp)
/* 76DDC 800DD92C 00E0A02D */ daddu $s4, $a3, $zero
/* 76DE0 800DD930 F7B60080 */ sdc1 $f22, 0x80($sp)
/* 76DE4 800DD934 C7B600A8 */ lwc1 $f22, 0xA8($sp)
/* 76DE8 800DD938 27A50038 */ addiu $a1, $sp, 0x38
/* 76DEC 800DD93C F7B40078 */ sdc1 $f20, 0x78($sp)
/* 76DF0 800DD940 C7B400B0 */ lwc1 $f20, 0xB0($sp)
/* 76DF4 800DD944 46006302 */ mul.s $f12, $f12, $f0
/* 76DF8 800DD948 00000000 */ nop
/* 76DFC 800DD94C 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* 76E00 800DD950 44810000 */ mtc1 $at, $f0
/* 76E04 800DD954 27A6003C */ addiu $a2, $sp, 0x3C
/* 76E08 800DD958 AFBF0074 */ sw $ra, 0x74($sp)
/* 76E0C 800DD95C AFB20068 */ sw $s2, 0x68($sp)
/* 76E10 800DD960 F7BA0090 */ sdc1 $f26, 0x90($sp)
/* 76E14 800DD964 F7B80088 */ sdc1 $f24, 0x88($sp)
/* 76E18 800DD968 0C00A82D */ jal sin_cos_rad
/* 76E1C 800DD96C 46006303 */ div.s $f12, $f12, $f0
/* 76E20 800DD970 3C013F00 */ lui $at, (0x3F000000 >> 16)
/* 76E24 800DD974 44813000 */ mtc1 $at, $f6
/* 76E28 800DD978 00000000 */ nop
/* 76E2C 800DD97C 4606A082 */ mul.s $f2, $f20, $f6
/* 76E30 800DD980 00000000 */ nop
/* 76E34 800DD984 4614B000 */ add.s $f0, $f22, $f20
/* 76E38 800DD988 46020600 */ add.s $f24, $f0, $f2
/* 76E3C 800DD98C C7A00038 */ lwc1 $f0, 0x38($sp)
/* 76E40 800DD990 4600B682 */ mul.s $f26, $f22, $f0
/* 76E44 800DD994 00000000 */ nop
/* 76E48 800DD998 2412FFFF */ addiu $s2, $zero, -0x1
/* 76E4C 800DD99C 27A20040 */ addiu $v0, $sp, 0x40
/* 76E50 800DD9A0 C7A2003C */ lwc1 $f2, 0x3C($sp)
/* 76E54 800DD9A4 46001087 */ neg.s $f2, $f2
/* 76E58 800DD9A8 4600A102 */ mul.s $f4, $f20, $f0
/* 76E5C 800DD9AC 00000000 */ nop
/* 76E60 800DD9B0 E7A2003C */ swc1 $f2, 0x3C($sp)
/* 76E64 800DD9B4 E7B8004C */ swc1 $f24, 0x4C($sp)
/* 76E68 800DD9B8 C6680000 */ lwc1 $f8, 0x0($s3)
/* 76E6C 800DD9BC C68A0000 */ lwc1 $f10, 0x0($s4)
/* 76E70 800DD9C0 4602A502 */ mul.s $f20, $f20, $f2
/* 76E74 800DD9C4 00000000 */ nop
/* 76E78 800DD9C8 AFA2001C */ sw $v0, 0x1C($sp)
/* 76E7C 800DD9CC 27A20044 */ addiu $v0, $sp, 0x44
/* 76E80 800DD9D0 AFA20020 */ sw $v0, 0x20($sp)
/* 76E84 800DD9D4 27A20048 */ addiu $v0, $sp, 0x48
/* 76E88 800DD9D8 AFA20024 */ sw $v0, 0x24($sp)
/* 76E8C 800DD9DC 27A2004C */ addiu $v0, $sp, 0x4C
/* 76E90 800DD9E0 46062102 */ mul.s $f4, $f4, $f6
/* 76E94 800DD9E4 00000000 */ nop
/* 76E98 800DD9E8 AFA20028 */ sw $v0, 0x28($sp)
/* 76E9C 800DD9EC 27A20050 */ addiu $v0, $sp, 0x50
/* 76EA0 800DD9F0 AFA2002C */ sw $v0, 0x2C($sp)
/* 76EA4 800DD9F4 27A20054 */ addiu $v0, $sp, 0x54
/* 76EA8 800DD9F8 4606A502 */ mul.s $f20, $f20, $f6
/* 76EAC 800DD9FC 00000000 */ nop
/* 76EB0 800DDA00 AFA20030 */ sw $v0, 0x30($sp)
/* 76EB4 800DDA04 27A20058 */ addiu $v0, $sp, 0x58
/* 76EB8 800DDA08 E7A00010 */ swc1 $f0, 0x10($sp)
/* 76EBC 800DDA0C AFA00014 */ sw $zero, 0x14($sp)
/* 76EC0 800DDA10 46044201 */ sub.s $f8, $f8, $f4
/* 76EC4 800DDA14 E7A20018 */ swc1 $f2, 0x18($sp)
/* 76EC8 800DDA18 AFA20034 */ sw $v0, 0x34($sp)
/* 76ECC 800DDA1C 46145281 */ sub.s $f10, $f10, $f20
/* 76ED0 800DDA20 8E060000 */ lw $a2, 0x0($s0)
/* 76ED4 800DDA24 44054000 */ mfc1 $a1, $f8
/* 76ED8 800DDA28 44075000 */ mfc1 $a3, $f10
/* 76EDC 800DDA2C 4602B582 */ mul.s $f22, $f22, $f2
/* 76EE0 800DDA30 00000000 */ nop
/* 76EE4 800DDA34 0C037513 */ jal npc_raycast_general
/* 76EE8 800DDA38 0220202D */ daddu $a0, $s1, $zero
/* 76EEC 800DDA3C 04400016 */ bltz $v0, .L800DDA98
/* 76EF0 800DDA40 00000000 */ nop
/* 76EF4 800DDA44 C7A4004C */ lwc1 $f4, 0x4C($sp)
/* 76EF8 800DDA48 4618203E */ c.le.s $f4, $f24
/* 76EFC 800DDA4C 00000000 */ nop
/* 76F00 800DDA50 45000011 */ bc1f .L800DDA98
/* 76F04 800DDA54 00000000 */ nop
/* 76F08 800DDA58 46182101 */ sub.s $f4, $f4, $f24
/* 76F0C 800DDA5C C7A00038 */ lwc1 $f0, 0x38($sp)
/* 76F10 800DDA60 46002002 */ mul.s $f0, $f4, $f0
/* 76F14 800DDA64 00000000 */ nop
/* 76F18 800DDA68 C6620000 */ lwc1 $f2, 0x0($s3)
/* 76F1C 800DDA6C 46001080 */ add.s $f2, $f2, $f0
/* 76F20 800DDA70 C7A0003C */ lwc1 $f0, 0x3C($sp)
/* 76F24 800DDA74 46002102 */ mul.s $f4, $f4, $f0
/* 76F28 800DDA78 00000000 */ nop
/* 76F2C 800DDA7C E6620000 */ swc1 $f2, 0x0($s3)
/* 76F30 800DDA80 C6800000 */ lwc1 $f0, 0x0($s4)
/* 76F34 800DDA84 46040000 */ add.s $f0, $f0, $f4
/* 76F38 800DDA88 0040902D */ daddu $s2, $v0, $zero
/* 76F3C 800DDA8C E6800000 */ swc1 $f0, 0x0($s4)
/* 76F40 800DDA90 3C018011 */ lui $at, %hi(NpcHitQueryColliderID)
/* 76F44 800DDA94 AC32C978 */ sw $s2, %lo(NpcHitQueryColliderID)($at)
.L800DDA98:
/* 76F48 800DDA98 C6600000 */ lwc1 $f0, 0x0($s3)
/* 76F4C 800DDA9C 461A0000 */ add.s $f0, $f0, $f26
/* 76F50 800DDAA0 E6600000 */ swc1 $f0, 0x0($s3)
/* 76F54 800DDAA4 C6800000 */ lwc1 $f0, 0x0($s4)
/* 76F58 800DDAA8 46160000 */ add.s $f0, $f0, $f22
/* 76F5C 800DDAAC 0240102D */ daddu $v0, $s2, $zero
/* 76F60 800DDAB0 E6800000 */ swc1 $f0, 0x0($s4)
/* 76F64 800DDAB4 8FBF0074 */ lw $ra, 0x74($sp)
/* 76F68 800DDAB8 8FB40070 */ lw $s4, 0x70($sp)
/* 76F6C 800DDABC 8FB3006C */ lw $s3, 0x6C($sp)
/* 76F70 800DDAC0 8FB20068 */ lw $s2, 0x68($sp)
/* 76F74 800DDAC4 8FB10064 */ lw $s1, 0x64($sp)
/* 76F78 800DDAC8 8FB00060 */ lw $s0, 0x60($sp)
/* 76F7C 800DDACC D7BA0090 */ ldc1 $f26, 0x90($sp)
/* 76F80 800DDAD0 D7B80088 */ ldc1 $f24, 0x88($sp)
/* 76F84 800DDAD4 D7B60080 */ ldc1 $f22, 0x80($sp)
/* 76F88 800DDAD8 D7B40078 */ ldc1 $f20, 0x78($sp)
/* 76F8C 800DDADC 03E00008 */ jr $ra
/* 76F90 800DDAE0 27BD0098 */ addiu $sp, $sp, 0x98
### DECOMPILED C INSTRUCTIONS:
s32 npc_test_move_without_slipping(s32 ignoreFlags, f32* x, f32* y, f32* z, f32 length, f32 yaw, f32 radius) {
s32 ret = -1;
f32 depth;
f32 originalDepth;
f32 dirY;
f32 cosTheta;
f32 hitNx, hitNy, hitNz;
f32 hitX, hitY, hitZ;
s32 hitID;
f32 temp1;
f32 temp2;
sin_cos_rad(DEG_TO_RAD(yaw), &dirY, &cosTheta);
cosTheta = -cosTheta;
originalDepth = length + radius + (radius * 0.5f);
depth = originalDepth;
temp1 = length * dirY;
temp2 = length * cosTheta;
hitID = npc_raycast_general(ignoreFlags, *x - (radius * dirY * 0.5f), *y, *z - (radius * cosTheta * 0.5f), dirY,
0.0f, cosTheta, &hitX, &hitY, &hitZ, &depth, &hitNx, &hitNy, &hitNz);
if (hitID >= 0 && depth <= originalDepth) {
f32 depthDiff = depth - originalDepth;
f32 cosThetaTemp = cosTheta; // needed to match
*x += depthDiff * dirY;
*z += depthDiff * cosThetaTemp;
NpcHitQueryColliderID = hitID;
ret = hitID;
}
*x += temp1;
*z += temp2;
return ret;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_802597B0
/* 188090 802597B0 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 188094 802597B4 AFB1001C */ sw $s1, 0x1C($sp)
/* 188098 802597B8 0080882D */ daddu $s1, $a0, $zero
/* 18809C 802597BC AFB30024 */ sw $s3, 0x24($sp)
/* 1880A0 802597C0 00A0982D */ daddu $s3, $a1, $zero
/* 1880A4 802597C4 AFB20020 */ sw $s2, 0x20($sp)
/* 1880A8 802597C8 00C0902D */ daddu $s2, $a2, $zero
/* 1880AC 802597CC 240600FF */ addiu $a2, $zero, 0xFF
/* 1880B0 802597D0 AFBF0028 */ sw $ra, 0x28($sp)
/* 1880B4 802597D4 AFB00018 */ sw $s0, 0x18($sp)
/* 1880B8 802597D8 86230098 */ lh $v1, 0x98($s1)
/* 1880BC 802597DC 8E3000C0 */ lw $s0, 0xC0($s1)
/* 1880C0 802597E0 0066102A */ slt $v0, $v1, $a2
/* 1880C4 802597E4 10400003 */ beqz $v0, .L802597F4
/* 1880C8 802597E8 0000202D */ daddu $a0, $zero, $zero
/* 1880CC 802597EC 3C048000 */ lui $a0, (0x80000000 >> 16)
/* 1880D0 802597F0 0060302D */ daddu $a2, $v1, $zero
.L802597F4:
/* 1880D4 802597F4 8E220000 */ lw $v0, 0x0($s1)
/* 1880D8 802597F8 30420100 */ andi $v0, $v0, 0x100
/* 1880DC 802597FC 1040000C */ beqz $v0, .L80259830
/* 1880E0 80259800 3C038080 */ lui $v1, (0x80808081 >> 16)
/* 1880E4 80259804 34638081 */ ori $v1, $v1, (0x80808081 & 0xFFFF)
/* 1880E8 80259808 00061100 */ sll $v0, $a2, 4
/* 1880EC 8025980C 00461023 */ subu $v0, $v0, $a2
/* 1880F0 80259810 000210C0 */ sll $v0, $v0, 3
/* 1880F4 80259814 00430018 */ mult $v0, $v1
/* 1880F8 80259818 3C048000 */ lui $a0, (0x80000000 >> 16)
/* 1880FC 8025981C 00004010 */ mfhi $t0
/* 188100 80259820 01021821 */ addu $v1, $t0, $v0
/* 188104 80259824 000319C3 */ sra $v1, $v1, 7
/* 188108 80259828 000217C3 */ sra $v0, $v0, 31
/* 18810C 8025982C 00623023 */ subu $a2, $v1, $v0
.L80259830:
/* 188110 80259830 92020768 */ lbu $v0, 0x768($s0)
/* 188114 80259834 5040003F */ beql $v0, $zero, .L80259934
/* 188118 80259838 AFB20010 */ sw $s2, 0x10($sp)
/* 18811C 8025983C 96240088 */ lhu $a0, 0x88($s1)
/* 188120 80259840 0C0B7830 */ jal spr_get_player_palettes
/* 188124 80259844 00000000 */ nop
/* 188128 80259848 AE0206D0 */ sw $v0, 0x6D0($s0)
/* 18812C 8025984C 0040202D */ daddu $a0, $v0, $zero
/* 188130 80259850 A20006CD */ sb $zero, 0x6CD($s0)
/* 188134 80259854 8C830000 */ lw $v1, 0x0($a0)
/* 188138 80259858 2402FFFF */ addiu $v0, $zero, -0x1
/* 18813C 8025985C 1062000C */ beq $v1, $v0, .L80259890
/* 188140 80259860 00000000 */ nop
/* 188144 80259864 0080182D */ daddu $v1, $a0, $zero
/* 188148 80259868 0040202D */ daddu $a0, $v0, $zero
.L8025986C:
/* 18814C 8025986C 920206CD */ lbu $v0, 0x6CD($s0)
/* 188150 80259870 24420001 */ addiu $v0, $v0, 0x1
/* 188154 80259874 A20206CD */ sb $v0, 0x6CD($s0)
/* 188158 80259878 00021600 */ sll $v0, $v0, 24
/* 18815C 8025987C 00021583 */ sra $v0, $v0, 22
/* 188160 80259880 00431021 */ addu $v0, $v0, $v1
/* 188164 80259884 8C420000 */ lw $v0, 0x0($v0)
/* 188168 80259888 1444FFF8 */ bne $v0, $a0, .L8025986C
/* 18816C 8025988C 00000000 */ nop
.L80259890:
/* 188170 80259890 820206CD */ lb $v0, 0x6CD($s0)
/* 188174 80259894 18400016 */ blez $v0, .L802598F0
/* 188178 80259898 0000302D */ daddu $a2, $zero, $zero
.L8025989C:
/* 18817C 8025989C 8E0206D0 */ lw $v0, 0x6D0($s0)
/* 188180 802598A0 00061880 */ sll $v1, $a2, 2
/* 188184 802598A4 00621821 */ addu $v1, $v1, $v0
/* 188188 802598A8 00061140 */ sll $v0, $a2, 5
/* 18818C 802598AC 8C630000 */ lw $v1, 0x0($v1)
/* 188190 802598B0 10600009 */ beqz $v1, .L802598D8
/* 188194 802598B4 02022821 */ addu $a1, $s0, $v0
/* 188198 802598B8 0000202D */ daddu $a0, $zero, $zero
.L802598BC:
/* 18819C 802598BC 94620000 */ lhu $v0, 0x0($v1)
/* 1881A0 802598C0 24630002 */ addiu $v1, $v1, 0x2
/* 1881A4 802598C4 24840001 */ addiu $a0, $a0, 0x1
/* 1881A8 802598C8 A4A20000 */ sh $v0, 0x0($a1)
/* 1881AC 802598CC 28820010 */ slti $v0, $a0, 0x10
/* 1881B0 802598D0 1440FFFA */ bnez $v0, .L802598BC
/* 1881B4 802598D4 24A50002 */ addiu $a1, $a1, 0x2
.L802598D8:
/* 1881B8 802598D8 820206CD */ lb $v0, 0x6CD($s0)
/* 1881BC 802598DC 24C60001 */ addiu $a2, $a2, 0x1
/* 1881C0 802598E0 00C2102A */ slt $v0, $a2, $v0
/* 1881C4 802598E4 1440FFED */ bnez $v0, .L8025989C
/* 1881C8 802598E8 00000000 */ nop
/* 1881CC 802598EC 820206CD */ lb $v0, 0x6CD($s0)
.L802598F0:
/* 1881D0 802598F0 1840000A */ blez $v0, .L8025991C
/* 1881D4 802598F4 0000302D */ daddu $a2, $zero, $zero
/* 1881D8 802598F8 0200202D */ daddu $a0, $s0, $zero
/* 1881DC 802598FC 0200182D */ daddu $v1, $s0, $zero
.L80259900:
/* 1881E0 80259900 AC6406D4 */ sw $a0, 0x6D4($v1)
/* 1881E4 80259904 24840020 */ addiu $a0, $a0, 0x20
/* 1881E8 80259908 820206CD */ lb $v0, 0x6CD($s0)
/* 1881EC 8025990C 24C60001 */ addiu $a2, $a2, 0x1
/* 1881F0 80259910 00C2102A */ slt $v0, $a2, $v0
/* 1881F4 80259914 1440FFFA */ bnez $v0, .L80259900
/* 1881F8 80259918 24630004 */ addiu $v1, $v1, 0x4
.L8025991C:
/* 1881FC 8025991C 0220202D */ daddu $a0, $s1, $zero
/* 188200 80259920 0260282D */ daddu $a1, $s3, $zero
/* 188204 80259924 0C096657 */ jal func_8025995C
/* 188208 80259928 0240302D */ daddu $a2, $s2, $zero
/* 18820C 8025992C 08096650 */ j .L80259940
/* 188210 80259930 00000000 */ nop
.L80259934:
/* 188214 80259934 0260282D */ daddu $a1, $s3, $zero
/* 188218 80259938 0C0B7710 */ jal spr_draw_player_sprite
/* 18821C 8025993C 0000382D */ daddu $a3, $zero, $zero
.L80259940:
/* 188220 80259940 8FBF0028 */ lw $ra, 0x28($sp)
/* 188224 80259944 8FB30024 */ lw $s3, 0x24($sp)
/* 188228 80259948 8FB20020 */ lw $s2, 0x20($sp)
/* 18822C 8025994C 8FB1001C */ lw $s1, 0x1C($sp)
/* 188230 80259950 8FB00018 */ lw $s0, 0x18($sp)
/* 188234 80259954 03E00008 */ jr $ra
/* 188238 80259958 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void func_802597B0(ActorPart* part, s32 yaw, Matrix4f mtx) {
DecorationTable* decor = part->decorationTable;
s32 opacity = 255;
s32 idMask = 0;
PAL_PTR src;
PAL_PTR dest;
s32 i, j;
if (part->opacity < 255) {
idMask = DRAW_SPRITE_OVERRIDE_ALPHA;
opacity = part->opacity;
}
if (part->flags & ACTOR_PART_FLAG_100) {
idMask = DRAW_SPRITE_OVERRIDE_ALPHA;
opacity = (opacity * 120) / 255;
}
if (decor->unk_768 != 0) {
decor->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16);
decor->originalPalettesCount = 0;
while (decor->originalPalettesList[decor->originalPalettesCount] != (PAL_PTR) -1) {
decor->originalPalettesCount++;
}
for (i = 0; i < decor->originalPalettesCount; i++) {
src = decor->originalPalettesList[i];
dest = decor->copiedPalettes[0][i];
if (decor->originalPalettesList[i] != NULL) {
for (j = 0; j < ARRAY_COUNT(decor->copiedPalettes[0][i]); j++) {
*dest = *src;
dest++;
src++;
}
}
}
for (i = 0; i < decor->originalPalettesCount; i++) {
decor->adjustedPalettes[i] = decor->copiedPalettes[0][i];
}
func_8025995C(part, yaw, mtx);
} else {
spr_draw_player_sprite(PLAYER_SPRITE_MAIN | idMask, yaw, opacity, NULL, mtx);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80261DF4
/* 1906D4 80261DF4 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 1906D8 80261DF8 AFB10014 */ sw $s1, 0x14($sp)
/* 1906DC 80261DFC 0080882D */ daddu $s1, $a0, $zero
/* 1906E0 80261E00 AFBF0018 */ sw $ra, 0x18($sp)
/* 1906E4 80261E04 AFB00010 */ sw $s0, 0x10($sp)
/* 1906E8 80261E08 8E2400AC */ lw $a0, 0xAC($s1)
/* 1906EC 80261E0C 0C04C3D6 */ jal get_item_entity
/* 1906F0 80261E10 00A0802D */ daddu $s0, $a1, $zero
/* 1906F4 80261E14 12000003 */ beqz $s0, .L80261E24
/* 1906F8 80261E18 0040202D */ daddu $a0, $v0, $zero
/* 1906FC 80261E1C AE200070 */ sw $zero, 0x70($s1)
/* 190700 80261E20 AE200074 */ sw $zero, 0x74($s1)
.L80261E24:
/* 190704 80261E24 8E230074 */ lw $v1, 0x74($s1)
/* 190708 80261E28 24050001 */ addiu $a1, $zero, 0x1
/* 19070C 80261E2C 10650020 */ beq $v1, $a1, .L80261EB0
/* 190710 80261E30 28620002 */ slti $v0, $v1, 0x2
/* 190714 80261E34 10400005 */ beqz $v0, .L80261E4C
/* 190718 80261E38 24020002 */ addiu $v0, $zero, 0x2
/* 19071C 80261E3C 10600009 */ beqz $v1, .L80261E64
/* 190720 80261E40 0000102D */ daddu $v0, $zero, $zero
/* 190724 80261E44 080987E8 */ j .L80261FA0
/* 190728 80261E48 00000000 */ nop
.L80261E4C:
/* 19072C 80261E4C 10620033 */ beq $v1, $v0, .L80261F1C
/* 190730 80261E50 24020003 */ addiu $v0, $zero, 0x3
/* 190734 80261E54 10620049 */ beq $v1, $v0, .L80261F7C
/* 190738 80261E58 0000102D */ daddu $v0, $zero, $zero
/* 19073C 80261E5C 080987E8 */ j .L80261FA0
/* 190740 80261E60 00000000 */ nop
.L80261E64:
/* 190744 80261E64 8E220070 */ lw $v0, 0x70($s1)
/* 190748 80261E68 2442FFFF */ addiu $v0, $v0, -0x1
/* 19074C 80261E6C AE220070 */ sw $v0, 0x70($s1)
/* 190750 80261E70 C480000C */ lwc1 $f0, 0xC($a0)
/* 190754 80261E74 44821000 */ mtc1 $v0, $f2
/* 190758 80261E78 00000000 */ nop
/* 19075C 80261E7C 468010A0 */ cvt.s.w $f2, $f2
/* 190760 80261E80 46020000 */ add.s $f0, $f0, $f2
/* 190764 80261E84 44801000 */ mtc1 $zero, $f2
/* 190768 80261E88 00000000 */ nop
/* 19076C 80261E8C 4602003C */ c.lt.s $f0, $f2
/* 190770 80261E90 00000000 */ nop
/* 190774 80261E94 45000041 */ bc1f .L80261F9C
/* 190778 80261E98 E480000C */ swc1 $f0, 0xC($a0)
/* 19077C 80261E9C 24020008 */ addiu $v0, $zero, 0x8
/* 190780 80261EA0 E482000C */ swc1 $f2, 0xC($a0)
/* 190784 80261EA4 AE220070 */ sw $v0, 0x70($s1)
/* 190788 80261EA8 080987E7 */ j .L80261F9C
/* 19078C 80261EAC AE250074 */ sw $a1, 0x74($s1)
.L80261EB0:
/* 190790 80261EB0 8E220070 */ lw $v0, 0x70($s1)
/* 190794 80261EB4 2442FFFF */ addiu $v0, $v0, -0x1
/* 190798 80261EB8 AE220070 */ sw $v0, 0x70($s1)
/* 19079C 80261EBC C480000C */ lwc1 $f0, 0xC($a0)
/* 1907A0 80261EC0 44821000 */ mtc1 $v0, $f2
/* 1907A4 80261EC4 00000000 */ nop
/* 1907A8 80261EC8 468010A0 */ cvt.s.w $f2, $f2
/* 1907AC 80261ECC 46020000 */ add.s $f0, $f0, $f2
/* 1907B0 80261ED0 44802000 */ mtc1 $zero, $f4
/* 1907B4 80261ED4 E480000C */ swc1 $f0, 0xC($a0)
/* 1907B8 80261ED8 C4800008 */ lwc1 $f0, 0x8($a0)
/* 1907BC 80261EDC 3C013FF8 */ lui $at, (0x3FF80000 >> 16)
/* 1907C0 80261EE0 44811800 */ mtc1 $at, $f3
/* 1907C4 80261EE4 44801000 */ mtc1 $zero, $f2
/* 1907C8 80261EE8 46000021 */ cvt.d.s $f0, $f0
/* 1907CC 80261EEC 46220000 */ add.d $f0, $f0, $f2
/* 1907D0 80261EF0 C482000C */ lwc1 $f2, 0xC($a0)
/* 1907D4 80261EF4 4604103C */ c.lt.s $f2, $f4
/* 1907D8 80261EF8 46200020 */ cvt.s.d $f0, $f0
/* 1907DC 80261EFC 45000027 */ bc1f .L80261F9C
/* 1907E0 80261F00 E4800008 */ swc1 $f0, 0x8($a0)
/* 1907E4 80261F04 24020004 */ addiu $v0, $zero, 0x4
/* 1907E8 80261F08 E484000C */ swc1 $f4, 0xC($a0)
/* 1907EC 80261F0C AE220070 */ sw $v0, 0x70($s1)
/* 1907F0 80261F10 24020002 */ addiu $v0, $zero, 0x2
/* 1907F4 80261F14 080987E7 */ j .L80261F9C
/* 1907F8 80261F18 AE220074 */ sw $v0, 0x74($s1)
.L80261F1C:
/* 1907FC 80261F1C 8E220070 */ lw $v0, 0x70($s1)
/* 190800 80261F20 2442FFFF */ addiu $v0, $v0, -0x1
/* 190804 80261F24 AE220070 */ sw $v0, 0x70($s1)
/* 190808 80261F28 C480000C */ lwc1 $f0, 0xC($a0)
/* 19080C 80261F2C 44821000 */ mtc1 $v0, $f2
/* 190810 80261F30 00000000 */ nop
/* 190814 80261F34 468010A0 */ cvt.s.w $f2, $f2
/* 190818 80261F38 46020000 */ add.s $f0, $f0, $f2
/* 19081C 80261F3C 44802000 */ mtc1 $zero, $f4
D_80261F40:
/* 190820 80261F40 E480000C */ swc1 $f0, 0xC($a0)
/* 190824 80261F44 C4800008 */ lwc1 $f0, 0x8($a0)
/* 190828 80261F48 3C01802A */ lui $at, %hi(D_8029D598)
/* 19082C 80261F4C D422D598 */ ldc1 $f2, %lo(D_8029D598)($at)
/* 190830 80261F50 46000021 */ cvt.d.s $f0, $f0
/* 190834 80261F54 46220000 */ add.d $f0, $f0, $f2
/* 190838 80261F58 C482000C */ lwc1 $f2, 0xC($a0)
/* 19083C 80261F5C 4604103C */ c.lt.s $f2, $f4
/* 190840 80261F60 46200020 */ cvt.s.d $f0, $f0
/* 190844 80261F64 4500000D */ bc1f .L80261F9C
/* 190848 80261F68 E4800008 */ swc1 $f0, 0x8($a0)
/* 19084C 80261F6C 24020003 */ addiu $v0, $zero, 0x3
/* 190850 80261F70 E484000C */ swc1 $f4, 0xC($a0)
/* 190854 80261F74 080987E7 */ j .L80261F9C
/* 190858 80261F78 AE220074 */ sw $v0, 0x74($s1)
.L80261F7C:
/* 19085C 80261F7C 24020002 */ addiu $v0, $zero, 0x2
/* 190860 80261F80 3C04802A */ lui $a0, %hi(D_8029FBB0)
/* 190864 80261F84 2484FBB0 */ addiu $a0, $a0, %lo(D_8029FBB0)
/* 190868 80261F88 24030014 */ addiu $v1, $zero, 0x14
/* 19086C 80261F8C AC830000 */ sw $v1, 0x0($a0)
/* 190870 80261F90 AC830004 */ sw $v1, 0x4($a0)
/* 190874 80261F94 080987E8 */ j .L80261FA0
/* 190878 80261F98 AC830008 */ sw $v1, 0x8($a0)
.L80261F9C:
/* 19087C 80261F9C 0000102D */ daddu $v0, $zero, $zero
.L80261FA0:
/* 190880 80261FA0 8FBF0018 */ lw $ra, 0x18($sp)
/* 190884 80261FA4 8FB10014 */ lw $s1, 0x14($sp)
/* 190888 80261FA8 8FB00010 */ lw $s0, 0x10($sp)
/* 19088C 80261FAC 03E00008 */ jr $ra
/* 190890 80261FB0 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(func_80261DF4) {
ItemEntity* item = get_item_entity(script->varTable[10]);
if (isInitialCall) {
script->functionTemp[0] = 0;
script->functionTemp[1] = 0;
}
switch (script->functionTemp[1]) {
case 0:
script->functionTemp[0]--;
item->position.y += script->functionTemp[0];
if (item->position.y < 0.0f) {
item->position.y = 0.0f;
script->functionTemp[0] = 8;
script->functionTemp[1] = 1;
}
break;
case 1:
script->functionTemp[0]--;
item->position.y += script->functionTemp[0];
item->position.x += 1.5;
if (item->position.y < 0.0f) {
item->position.y = 0.0f;
script->functionTemp[0] = 4;
script->functionTemp[1] = 2;
}
break;
case 2:
script->functionTemp[0]--;
item->position.y += script->functionTemp[0];
item->position.x += 1.2;
if (item->position.y < 0.0f) {
item->position.y = 0.0f;
script->functionTemp[1] = 3;
}
break;
case 3:
D_8029FBB0[0] = 20;
D_8029FBB0[1] = 20;
D_8029FBB0[2] = 20;
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel snaking_static_main
/* 3B2350 E00AE000 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 3B2354 E00AE004 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 3B2358 E00AE008 4485A000 */ mtc1 $a1, $f20
/* 3B235C E00AE00C F7B60048 */ sdc1 $f22, 0x48($sp)
/* 3B2360 E00AE010 4486B000 */ mtc1 $a2, $f22
/* 3B2364 E00AE014 AFB30034 */ sw $s3, 0x34($sp)
/* 3B2368 E00AE018 0080982D */ daddu $s3, $a0, $zero
/* 3B236C E00AE01C F7B80050 */ sdc1 $f24, 0x50($sp)
/* 3B2370 E00AE020 4487C000 */ mtc1 $a3, $f24
/* 3B2374 E00AE024 27A40010 */ addiu $a0, $sp, 0x10
/* 3B2378 E00AE028 AFB20030 */ sw $s2, 0x30($sp)
/* 3B237C E00AE02C 8FB2006C */ lw $s2, 0x6C($sp)
/* 3B2380 E00AE030 3C02E00B */ lui $v0, %hi(snaking_static_init)
/* 3B2384 E00AE034 2442E1AC */ addiu $v0, $v0, %lo(snaking_static_init)
/* 3B2388 E00AE038 AFA20018 */ sw $v0, 0x18($sp)
/* 3B238C E00AE03C 3C02E00B */ lui $v0, %hi(snaking_static_update)
/* 3B2390 E00AE040 2442E1B4 */ addiu $v0, $v0, %lo(snaking_static_update)
/* 3B2394 E00AE044 AFA2001C */ sw $v0, 0x1C($sp)
/* 3B2398 E00AE048 3C02E00B */ lui $v0, %hi(snaking_static_render)
/* 3B239C E00AE04C 2442E4FC */ addiu $v0, $v0, %lo(snaking_static_render)
/* 3B23A0 E00AE050 AFA20020 */ sw $v0, 0x20($sp)
/* 3B23A4 E00AE054 24020057 */ addiu $v0, $zero, 0x57
/* 3B23A8 E00AE058 AFBF0038 */ sw $ra, 0x38($sp)
/* 3B23AC E00AE05C AFB1002C */ sw $s1, 0x2C($sp)
/* 3B23B0 E00AE060 AFB00028 */ sw $s0, 0x28($sp)
/* 3B23B4 E00AE064 AFA00010 */ sw $zero, 0x10($sp)
/* 3B23B8 E00AE068 AFA00024 */ sw $zero, 0x24($sp)
/* 3B23BC E00AE06C 0C080124 */ jal shim_create_effect_instance
/* 3B23C0 E00AE070 AFA20014 */ sw $v0, 0x14($sp)
/* 3B23C4 E00AE074 240405D8 */ addiu $a0, $zero, 0x5D8
/* 3B23C8 E00AE078 24110016 */ addiu $s1, $zero, 0x16
/* 3B23CC E00AE07C 0040802D */ daddu $s0, $v0, $zero
/* 3B23D0 E00AE080 0C08012C */ jal shim_general_heap_malloc
/* 3B23D4 E00AE084 AE110008 */ sw $s1, 0x8($s0)
/* 3B23D8 E00AE088 0040202D */ daddu $a0, $v0, $zero
/* 3B23DC E00AE08C 14800003 */ bnez $a0, .LE00AE09C
/* 3B23E0 E00AE090 AE04000C */ sw $a0, 0xC($s0)
.LE00AE094:
/* 3B23E4 E00AE094 0802B825 */ j .LE00AE094
/* 3B23E8 E00AE098 00000000 */ nop
.LE00AE09C:
/* 3B23EC E00AE09C AC930000 */ sw $s3, 0x0($a0)
/* 3B23F0 E00AE0A0 1E400004 */ bgtz $s2, .LE00AE0B4
/* 3B23F4 E00AE0A4 AC800014 */ sw $zero, 0x14($a0)
/* 3B23F8 E00AE0A8 240203E8 */ addiu $v0, $zero, 0x3E8
/* 3B23FC E00AE0AC 0802B82E */ j .LE00AE0B8
/* 3B2400 E00AE0B0 AC820010 */ sw $v0, 0x10($a0)
.LE00AE0B4:
/* 3B2404 E00AE0B4 AC920010 */ sw $s2, 0x10($a0)
.LE00AE0B8:
/* 3B2408 E00AE0B8 240300FF */ addiu $v1, $zero, 0xFF
/* 3B240C E00AE0BC 240200E6 */ addiu $v0, $zero, 0xE6
/* 3B2410 E00AE0C0 AC800024 */ sw $zero, 0x24($a0)
/* 3B2414 E00AE0C4 E4940004 */ swc1 $f20, 0x4($a0)
/* 3B2418 E00AE0C8 E4960008 */ swc1 $f22, 0x8($a0)
/* 3B241C E00AE0CC E498000C */ swc1 $f24, 0xC($a0)
/* 3B2420 E00AE0D0 C7A00068 */ lwc1 $f0, 0x68($sp)
/* 3B2424 E00AE0D4 24060001 */ addiu $a2, $zero, 0x1
/* 3B2428 E00AE0D8 AC82001C */ sw $v0, 0x1C($a0)
/* 3B242C E00AE0DC 00D1102A */ slt $v0, $a2, $s1
/* 3B2430 E00AE0E0 AC830018 */ sw $v1, 0x18($a0)
/* 3B2434 E00AE0E4 AC800020 */ sw $zero, 0x20($a0)
/* 3B2438 E00AE0E8 AC830028 */ sw $v1, 0x28($a0)
/* 3B243C E00AE0EC AC83002C */ sw $v1, 0x2C($a0)
/* 3B2440 E00AE0F0 AC830030 */ sw $v1, 0x30($a0)
/* 3B2444 E00AE0F4 E4800038 */ swc1 $f0, 0x38($a0)
/* 3B2448 E00AE0F8 10400021 */ beqz $v0, .LE00AE180
/* 3B244C E00AE0FC 24840044 */ addiu $a0, $a0, 0x44
/* 3B2450 E00AE100 24080014 */ addiu $t0, $zero, 0x14
/* 3B2454 E00AE104 2627FFFF */ addiu $a3, $s1, -0x1
/* 3B2458 E00AE108 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3B245C E00AE10C 44811000 */ mtc1 $at, $f2
/* 3B2460 E00AE110 24840040 */ addiu $a0, $a0, 0x40
/* 3B2464 E00AE114 0000282D */ daddu $a1, $zero, $zero
.LE00AE118:
/* 3B2468 E00AE118 14E00002 */ bnez $a3, .LE00AE124
/* 3B246C E00AE11C 00A7001A */ div $zero, $a1, $a3
/* 3B2470 E00AE120 0007000D */ break 7
.LE00AE124:
/* 3B2474 E00AE124 2401FFFF */ addiu $at, $zero, -0x1
/* 3B2478 E00AE128 14E10004 */ bne $a3, $at, .LE00AE13C
/* 3B247C E00AE12C 3C018000 */ lui $at, (0x80000000 >> 16)
/* 3B2480 E00AE130 14A10002 */ bne $a1, $at, .LE00AE13C
/* 3B2484 E00AE134 00000000 */ nop
/* 3B2488 E00AE138 0006000D */ break 6
.LE00AE13C:
/* 3B248C E00AE13C 00001812 */ mflo $v1
/* 3B2490 E00AE140 24A50168 */ addiu $a1, $a1, 0x168
/* 3B2494 E00AE144 30C2000F */ andi $v0, $a2, 0xF
/* 3B2498 E00AE148 24C60001 */ addiu $a2, $a2, 0x1
/* 3B249C E00AE14C AC820000 */ sw $v0, 0x0($a0)
/* 3B24A0 E00AE150 00D1102A */ slt $v0, $a2, $s1
/* 3B24A4 E00AE154 AC88FFD0 */ sw $t0, -0x30($a0)
/* 3B24A8 E00AE158 AC80FFD4 */ sw $zero, -0x2C($a0)
/* 3B24AC E00AE15C AC80FFC4 */ sw $zero, -0x3C($a0)
/* 3B24B0 E00AE160 AC80FFC8 */ sw $zero, -0x38($a0)
/* 3B24B4 E00AE164 E482FFF4 */ swc1 $f2, -0xC($a0)
/* 3B24B8 E00AE168 44830000 */ mtc1 $v1, $f0
/* 3B24BC E00AE16C 00000000 */ nop
/* 3B24C0 E00AE170 46800020 */ cvt.s.w $f0, $f0
/* 3B24C4 E00AE174 E480FFFC */ swc1 $f0, -0x4($a0)
/* 3B24C8 E00AE178 1440FFE7 */ bnez $v0, .LE00AE118
/* 3B24CC E00AE17C 24840044 */ addiu $a0, $a0, 0x44
.LE00AE180:
/* 3B24D0 E00AE180 0200102D */ daddu $v0, $s0, $zero
/* 3B24D4 E00AE184 8FBF0038 */ lw $ra, 0x38($sp)
/* 3B24D8 E00AE188 8FB30034 */ lw $s3, 0x34($sp)
/* 3B24DC E00AE18C 8FB20030 */ lw $s2, 0x30($sp)
/* 3B24E0 E00AE190 8FB1002C */ lw $s1, 0x2C($sp)
/* 3B24E4 E00AE194 8FB00028 */ lw $s0, 0x28($sp)
/* 3B24E8 E00AE198 D7B80050 */ ldc1 $f24, 0x50($sp)
/* 3B24EC E00AE19C D7B60048 */ ldc1 $f22, 0x48($sp)
/* 3B24F0 E00AE1A0 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 3B24F4 E00AE1A4 03E00008 */ jr $ra
/* 3B24F8 E00AE1A8 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
EffectInstance* snaking_static_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 timeLeft) {
EffectBlueprint effectBp;
EffectInstance* effect;
SnakingStaticFXData* data;
s32 numParts = 22;
s32 i;
effectBp.init = snaking_static_init;
effectBp.update = snaking_static_update;
effectBp.renderWorld = snaking_static_render;
effectBp.unk_00 = 0;
effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_SNAKING_STATIC;
effect = shim_create_effect_instance(&effectBp);
effect->numParts = numParts;
data = effect->data.snakingStatic = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL);
data->unk_00 = arg0;
data->lifeTime = 0;
if (timeLeft <= 0) {
data->timeLeft = 1000;
} else {
data->timeLeft = timeLeft;
}
data->unk_24 = 0;
data->pos.x = posX;
data->pos.y = posY;
data->pos.z = posZ;
data->unk_38 = arg4;
data->unk_18 = 255;
data->unk_1C = 230;
data->unk_20 = 0;
data->unk_28 = 255;
data->unk_2C = 255;
data->unk_30 = 255;
data++;
for(i = 1; i < numParts; i++, data++) {
data->timeLeft = 20;
data->unk_3C = (i - 1) * 360 / (numParts - 1);
data->lifeTime = 0;
data->pos.x = 0;
data->pos.y = 0;
data->unk_34 = 1.0f;
data->unk_40 = i & 15;
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel energy_orb_wave_main
/* 3A37E0 E00A4000 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 3A37E4 E00A4004 F7B60040 */ sdc1 $f22, 0x40($sp)
/* 3A37E8 E00A4008 4485B000 */ mtc1 $a1, $f22
/* 3A37EC E00A400C F7B80048 */ sdc1 $f24, 0x48($sp)
/* 3A37F0 E00A4010 4486C000 */ mtc1 $a2, $f24
/* 3A37F4 E00A4014 F7BA0050 */ sdc1 $f26, 0x50($sp)
/* 3A37F8 E00A4018 4487D000 */ mtc1 $a3, $f26
/* 3A37FC E00A401C AFB1002C */ sw $s1, 0x2C($sp)
/* 3A3800 E00A4020 0080882D */ daddu $s1, $a0, $zero
/* 3A3804 E00A4024 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 3A3808 E00A4028 C7B40068 */ lwc1 $f20, 0x68($sp)
/* 3A380C E00A402C 27A40010 */ addiu $a0, $sp, 0x10
/* 3A3810 E00A4030 AFB20030 */ sw $s2, 0x30($sp)
/* 3A3814 E00A4034 8FB2006C */ lw $s2, 0x6C($sp)
/* 3A3818 E00A4038 3C02E00A */ lui $v0, %hi(energy_orb_wave_init)
/* 3A381C E00A403C 244241A4 */ addiu $v0, $v0, %lo(energy_orb_wave_init)
/* 3A3820 E00A4040 AFA20018 */ sw $v0, 0x18($sp)
/* 3A3824 E00A4044 3C02E00A */ lui $v0, %hi(energy_orb_wave_update)
/* 3A3828 E00A4048 244241AC */ addiu $v0, $v0, %lo(energy_orb_wave_update)
/* 3A382C E00A404C AFA2001C */ sw $v0, 0x1C($sp)
/* 3A3830 E00A4050 3C02E00A */ lui $v0, %hi(energy_orb_wave_render)
/* 3A3834 E00A4054 244245DC */ addiu $v0, $v0, %lo(energy_orb_wave_render)
/* 3A3838 E00A4058 AFA20020 */ sw $v0, 0x20($sp)
/* 3A383C E00A405C 24020052 */ addiu $v0, $zero, 0x52
/* 3A3840 E00A4060 AFBF0034 */ sw $ra, 0x34($sp)
/* 3A3844 E00A4064 AFB00028 */ sw $s0, 0x28($sp)
/* 3A3848 E00A4068 AFA00010 */ sw $zero, 0x10($sp)
/* 3A384C E00A406C AFA00024 */ sw $zero, 0x24($sp)
/* 3A3850 E00A4070 0C080124 */ jal shim_create_effect_instance
/* 3A3854 E00A4074 AFA20014 */ sw $v0, 0x14($sp)
/* 3A3858 E00A4078 24040038 */ addiu $a0, $zero, 0x38
/* 3A385C E00A407C 24030001 */ addiu $v1, $zero, 0x1
/* 3A3860 E00A4080 0040802D */ daddu $s0, $v0, $zero
/* 3A3864 E00A4084 0C08012C */ jal shim_general_heap_malloc
/* 3A3868 E00A4088 AE030008 */ sw $v1, 0x8($s0)
/* 3A386C E00A408C 0040182D */ daddu $v1, $v0, $zero
/* 3A3870 E00A4090 14600003 */ bnez $v1, .LE00A40A0
/* 3A3874 E00A4094 AE02000C */ sw $v0, 0xC($s0)
.LE00A4098:
/* 3A3878 E00A4098 08029026 */ j .LE00A4098
/* 3A387C E00A409C 00000000 */ nop
.LE00A40A0:
/* 3A3880 E00A40A0 AC710000 */ sw $s1, 0x0($v1)
/* 3A3884 E00A40A4 1E400004 */ bgtz $s2, .LE00A40B8
/* 3A3888 E00A40A8 AC600014 */ sw $zero, 0x14($v1)
/* 3A388C E00A40AC 24020064 */ addiu $v0, $zero, 0x64
/* 3A3890 E00A40B0 0802902F */ j .LE00A40BC
/* 3A3894 E00A40B4 AC620010 */ sw $v0, 0x10($v1)
.LE00A40B8:
/* 3A3898 E00A40B8 AC720010 */ sw $s2, 0x10($v1)
.LE00A40BC:
/* 3A389C E00A40BC 2E220007 */ sltiu $v0, $s1, 0x7
/* 3A38A0 E00A40C0 AC60002C */ sw $zero, 0x2C($v1)
/* 3A38A4 E00A40C4 E4760004 */ swc1 $f22, 0x4($v1)
/* 3A38A8 E00A40C8 E4780008 */ swc1 $f24, 0x8($v1)
/* 3A38AC E00A40CC E47A000C */ swc1 $f26, 0xC($v1)
/* 3A38B0 E00A40D0 E4740030 */ swc1 $f20, 0x30($v1)
/* 3A38B4 E00A40D4 1040001B */ beqz $v0, .LE00A4144
/* 3A38B8 E00A40D8 AC600018 */ sw $zero, 0x18($v1)
/* 3A38BC E00A40DC 00111080 */ sll $v0, $s1, 2
/* 3A38C0 E00A40E0 3C01E00A */ lui $at, (0xE00A4AD0 >> 16)
/* 3A38C4 E00A40E4 00220821 */ addu $at, $at, $v0
/* 3A38C8 E00A40E8 8C224AD0 */ lw $v0, (0xE00A4AD0 & 0xFFFF)($at)
/* 3A38CC E00A40EC 00400008 */ jr $v0
/* 3A38D0 E00A40F0 00000000 */ nop
/* 3A38D4 E00A40F4 0802905E */ j .LE00A4178
/* 3A38D8 E00A40F8 AC60001C */ sw $zero, 0x1C($v1)
/* 3A38DC E00A40FC 24020002 */ addiu $v0, $zero, 0x2
/* 3A38E0 E00A4100 0802905E */ j .LE00A4178
/* 3A38E4 E00A4104 AC62001C */ sw $v0, 0x1C($v1)
/* 3A38E8 E00A4108 24020004 */ addiu $v0, $zero, 0x4
/* 3A38EC E00A410C 0802905E */ j .LE00A4178
/* 3A38F0 E00A4110 AC62001C */ sw $v0, 0x1C($v1)
/* 3A38F4 E00A4114 24020006 */ addiu $v0, $zero, 0x6
/* 3A38F8 E00A4118 0802905E */ j .LE00A4178
/* 3A38FC E00A411C AC62001C */ sw $v0, 0x1C($v1)
/* 3A3900 E00A4120 24020007 */ addiu $v0, $zero, 0x7
/* 3A3904 E00A4124 0802905E */ j .LE00A4178
/* 3A3908 E00A4128 AC62001C */ sw $v0, 0x1C($v1)
/* 3A390C E00A412C 24020008 */ addiu $v0, $zero, 0x8
/* 3A3910 E00A4130 0802905E */ j .LE00A4178
/* 3A3914 E00A4134 AC62001C */ sw $v0, 0x1C($v1)
/* 3A3918 E00A4138 24020009 */ addiu $v0, $zero, 0x9
/* 3A391C E00A413C 0802905E */ j .LE00A4178
/* 3A3920 E00A4140 AC62001C */ sw $v0, 0x1C($v1)
.LE00A4144:
/* 3A3924 E00A4144 2402000A */ addiu $v0, $zero, 0xA
/* 3A3928 E00A4148 3C01E00A */ lui $at, (0xE00A4AF0 >> 16)
/* 3A392C E00A414C D4224AF0 */ ldc1 $f2, (0xE00A4AF0 & 0xFFFF)($at)
/* 3A3930 E00A4150 4600A021 */ cvt.d.s $f0, $f20
/* 3A3934 E00A4154 46220001 */ sub.d $f0, $f0, $f2
/* 3A3938 E00A4158 AC62001C */ sw $v0, 0x1C($v1)
/* 3A393C E00A415C 44921000 */ mtc1 $s2, $f2
/* 3A3940 E00A4160 00000000 */ nop
/* 3A3944 E00A4164 468010A1 */ cvt.d.w $f2, $f2
/* 3A3948 E00A4168 46200007 */ neg.d $f0, $f0
/* 3A394C E00A416C 46220003 */ div.d $f0, $f0, $f2
/* 3A3950 E00A4170 46200020 */ cvt.s.d $f0, $f0
/* 3A3954 E00A4174 E4600034 */ swc1 $f0, 0x34($v1)
.LE00A4178:
/* 3A3958 E00A4178 0200102D */ daddu $v0, $s0, $zero
/* 3A395C E00A417C 8FBF0034 */ lw $ra, 0x34($sp)
/* 3A3960 E00A4180 8FB20030 */ lw $s2, 0x30($sp)
/* 3A3964 E00A4184 8FB1002C */ lw $s1, 0x2C($sp)
/* 3A3968 E00A4188 8FB00028 */ lw $s0, 0x28($sp)
/* 3A396C E00A418C D7BA0050 */ ldc1 $f26, 0x50($sp)
/* 3A3970 E00A4190 D7B80048 */ ldc1 $f24, 0x48($sp)
/* 3A3974 E00A4194 D7B60040 */ ldc1 $f22, 0x40($sp)
/* 3A3978 E00A4198 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 3A397C E00A419C 03E00008 */ jr $ra
/* 3A3980 E00A41A0 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
EffectInstance* energy_orb_wave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
EffectBlueprint bp;
EffectInstance* effect;
EnergyOrbWaveFXData* data;
s32 numParts = 1;
bp.init = energy_orb_wave_init;
bp.update = energy_orb_wave_update;
bp.renderWorld = energy_orb_wave_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_ENERGY_ORB_WAVE;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = effect->data.energyOrbWave = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.energyOrbWave != NULL);
data->unk_00 = arg0;
data->unk_14 = 0;
if (arg5 <= 0) {
data->unk_10 = 100;
} else {
data->unk_10 = arg5;
}
data->unk_2C = 0;
data->pos.x = arg1;
data->pos.y = arg2;
data->pos.z = arg3;
data->scale = arg4;
data->unk_18 = 0;
switch (arg0) {
case 0:
data->unk_1C = 0;
break;
case 1:
data->unk_1C = 2;
break;
case 2:
data->unk_1C = 4;
break;
case 3:
data->unk_1C = 6;
break;
case 4:
data->unk_1C = 7;
break;
case 5:
data->unk_1C = 8;
break;
case 6:
data->unk_1C = 9;
break;
default:
data->unk_1C = 10;
data->unk_34 = -(arg4 - 0.1) / arg5;
break;
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel osCreateViManager
/* 41E70 80066A70 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 41E74 80066A74 AFB40028 */ sw $s4, 0x28($sp)
/* 41E78 80066A78 3C148009 */ lui $s4, %hi(D_80094680)
/* 41E7C 80066A7C 26944680 */ addiu $s4, $s4, %lo(D_80094680)
/* 41E80 80066A80 AFBF002C */ sw $ra, 0x2C($sp)
/* 41E84 80066A84 AFB30024 */ sw $s3, 0x24($sp)
/* 41E88 80066A88 AFB20020 */ sw $s2, 0x20($sp)
/* 41E8C 80066A8C AFB1001C */ sw $s1, 0x1C($sp)
/* 41E90 80066A90 AFB00018 */ sw $s0, 0x18($sp)
/* 41E94 80066A94 8E820000 */ lw $v0, 0x0($s4)
/* 41E98 80066A98 14400055 */ bnez $v0, .L80066BF0
/* 41E9C 80066A9C 00808821 */ addu $s1, $a0, $zero
/* 41EA0 80066AA0 0C019920 */ jal __osTimerServicesInit
/* 41EA4 80066AA4 2412FFFF */ addiu $s2, $zero, -0x1
/* 41EA8 80066AA8 3C13800B */ lui $s3, %hi(viEventQueue)
/* 41EAC 80066AAC 26730AD0 */ addiu $s3, $s3, %lo(viEventQueue)
/* 41EB0 80066AB0 02602021 */ addu $a0, $s3, $zero
/* 41EB4 80066AB4 3C05800B */ lui $a1, %hi(viEventBuf)
/* 41EB8 80066AB8 24A50AE8 */ addiu $a1, $a1, %lo(viEventBuf)
/* 41EBC 80066ABC 3C018009 */ lui $at, %hi(D_8009469C)
/* 41EC0 80066AC0 AC20469C */ sw $zero, %lo(D_8009469C)($at)
/* 41EC4 80066AC4 0C019560 */ jal osCreateMesgQueue
/* 41EC8 80066AC8 24060005 */ addiu $a2, $zero, 0x5
/* 41ECC 80066ACC 24040007 */ addiu $a0, $zero, 0x7
/* 41ED0 80066AD0 3C06800B */ lui $a2, %hi(viRetraceMsg)
/* 41ED4 80066AD4 24C60B00 */ addiu $a2, $a2, %lo(viRetraceMsg)
/* 41ED8 80066AD8 2402000D */ addiu $v0, $zero, 0xD
/* 41EDC 80066ADC 3C10800B */ lui $s0, %hi(viCounterMsg)
/* 41EE0 80066AE0 26100B18 */ addiu $s0, $s0, %lo(viCounterMsg)
/* 41EE4 80066AE4 A4C20000 */ sh $v0, 0x0($a2)
/* 41EE8 80066AE8 2402000E */ addiu $v0, $zero, 0xE
/* 41EEC 80066AEC 3C01800B */ lui $at, %hi(D_800B0B02)
/* 41EF0 80066AF0 A0200B02 */ sb $zero, %lo(D_800B0B02)($at)
/* 41EF4 80066AF4 3C01800B */ lui $at, %hi(D_800B0B04)
/* 41EF8 80066AF8 AC200B04 */ sw $zero, %lo(D_800B0B04)($at)
/* 41EFC 80066AFC A6020000 */ sh $v0, 0x0($s0)
/* 41F00 80066B00 3C01800B */ lui $at, %hi(D_800B0B1A)
/* 41F04 80066B04 A0200B1A */ sb $zero, %lo(D_800B0B1A)($at)
/* 41F08 80066B08 3C01800B */ lui $at, %hi(D_800B0B1C)
/* 41F0C 80066B0C AC200B1C */ sw $zero, %lo(D_800B0B1C)($at)
/* 41F10 80066B10 0C019654 */ jal osSetEventMesg
/* 41F14 80066B14 02602821 */ addu $a1, $s3, $zero
/* 41F18 80066B18 24040003 */ addiu $a0, $zero, 0x3
/* 41F1C 80066B1C 02602821 */ addu $a1, $s3, $zero
/* 41F20 80066B20 0C019654 */ jal osSetEventMesg
/* 41F24 80066B24 02003021 */ addu $a2, $s0, $zero
/* 41F28 80066B28 0C0197CC */ jal osGetThreadPri
/* 41F2C 80066B2C 00002021 */ addu $a0, $zero, $zero
/* 41F30 80066B30 00401821 */ addu $v1, $v0, $zero
/* 41F34 80066B34 0071102A */ slt $v0, $v1, $s1
/* 41F38 80066B38 10400005 */ beqz $v0, .L80066B50
/* 41F3C 80066B3C 00000000 */ nop
/* 41F40 80066B40 00609021 */ addu $s2, $v1, $zero
/* 41F44 80066B44 00002021 */ addu $a0, $zero, $zero
/* 41F48 80066B48 0C0197D4 */ jal osSetThreadPri
/* 41F4C 80066B4C 02202821 */ addu $a1, $s1, $zero
.L80066B50:
/* 41F50 80066B50 0C01ACD8 */ jal __osDisableInt
/* 41F54 80066B54 00000000 */ nop
/* 41F58 80066B58 3C10800B */ lui $s0, %hi(viThread)
/* 41F5C 80066B5C 2610F918 */ addiu $s0, $s0, %lo(viThread)
/* 41F60 80066B60 02002021 */ addu $a0, $s0, $zero
/* 41F64 80066B64 00002821 */ addu $a1, $zero, $zero
/* 41F68 80066B68 3C068006 */ lui $a2, %hi(viMgrMain)
/* 41F6C 80066B6C 24C66C10 */ addiu $a2, $a2, %lo(viMgrMain)
/* 41F70 80066B70 24030001 */ addiu $v1, $zero, 0x1
/* 41F74 80066B74 AE830000 */ sw $v1, 0x0($s4)
/* 41F78 80066B78 3C03800B */ lui $v1, %hi(viEventQueue)
/* 41F7C 80066B7C 24630AD0 */ addiu $v1, $v1, %lo(viEventQueue)
/* 41F80 80066B80 AFB10014 */ sw $s1, 0x14($sp)
/* 41F84 80066B84 00408821 */ addu $s1, $v0, $zero
/* 41F88 80066B88 02803821 */ addu $a3, $s4, $zero
/* 41F8C 80066B8C 3C018009 */ lui $at, %hi(D_80094684)
/* 41F90 80066B90 AC304684 */ sw $s0, %lo(D_80094684)($at)
/* 41F94 80066B94 3C018009 */ lui $at, %hi(D_80094688)
/* 41F98 80066B98 AC334688 */ sw $s3, %lo(D_80094688)($at)
/* 41F9C 80066B9C 3C018009 */ lui $at, %hi(D_8009468C)
/* 41FA0 80066BA0 AC33468C */ sw $s3, %lo(D_8009468C)($at)
/* 41FA4 80066BA4 3C018009 */ lui $at, %hi(D_80094690)
/* 41FA8 80066BA8 AC204690 */ sw $zero, %lo(D_80094690)($at)
/* 41FAC 80066BAC 3C018009 */ lui $at, %hi(D_80094694)
/* 41FB0 80066BB0 AC204694 */ sw $zero, %lo(D_80094694)($at)
/* 41FB4 80066BB4 3C018009 */ lui $at, %hi(D_80094698)
/* 41FB8 80066BB8 AC204698 */ sw $zero, %lo(D_80094698)($at)
/* 41FBC 80066BBC 0C019798 */ jal osCreateThread
/* 41FC0 80066BC0 AFA30010 */ sw $v1, 0x10($sp)
/* 41FC4 80066BC4 0C01B2A4 */ jal __osViInit
/* 41FC8 80066BC8 00000000 */ nop
/* 41FCC 80066BCC 0C019808 */ jal osStartThread
/* 41FD0 80066BD0 02002021 */ addu $a0, $s0, $zero
/* 41FD4 80066BD4 0C01ACF4 */ jal __osRestoreInt
/* 41FD8 80066BD8 02202021 */ addu $a0, $s1, $zero
/* 41FDC 80066BDC 2402FFFF */ addiu $v0, $zero, -0x1
/* 41FE0 80066BE0 12420003 */ beq $s2, $v0, .L80066BF0
/* 41FE4 80066BE4 00002021 */ addu $a0, $zero, $zero
/* 41FE8 80066BE8 0C0197D4 */ jal osSetThreadPri
/* 41FEC 80066BEC 02402821 */ addu $a1, $s2, $zero
.L80066BF0:
/* 41FF0 80066BF0 8FBF002C */ lw $ra, 0x2C($sp)
/* 41FF4 80066BF4 8FB40028 */ lw $s4, 0x28($sp)
/* 41FF8 80066BF8 8FB30024 */ lw $s3, 0x24($sp)
/* 41FFC 80066BFC 8FB20020 */ lw $s2, 0x20($sp)
/* 42000 80066C00 8FB1001C */ lw $s1, 0x1C($sp)
/* 42004 80066C04 8FB00018 */ lw $s0, 0x18($sp)
/* 42008 80066C08 03E00008 */ jr $ra
/* 4200C 80066C0C 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void osCreateViManager(OSPri pri) {
u32 savedMask;
OSPri myPri;
OSPri oldPri;
if (!__osViDevMgr.active) {
__osTimerServicesInit();
__additional_scanline = 0;
osCreateMesgQueue(&viEventQueue, viEventBuf, ARRAY_COUNT(viEventBuf));
viRetraceMsg.hdr.type = OS_MESG_TYPE_VRETRACE;
viRetraceMsg.hdr.pri = OS_MESG_PRI_NORMAL;
viRetraceMsg.hdr.retQueue = NULL;
viCounterMsg.hdr.type = OS_MESG_TYPE_COUNTER;
viCounterMsg.hdr.pri = OS_MESG_PRI_NORMAL;
viCounterMsg.hdr.retQueue = NULL;
osSetEventMesg(OS_EVENT_VI, &viEventQueue, &viRetraceMsg);
osSetEventMesg(OS_EVENT_COUNTER, &viEventQueue, &viCounterMsg);
oldPri = -1;
myPri = osGetThreadPri(NULL);
if (myPri < pri) {
oldPri = myPri;
osSetThreadPri(NULL, pri);
}
savedMask = __osDisableInt();
__osViDevMgr.active = TRUE;
__osViDevMgr.thread = &viThread;
__osViDevMgr.cmdQueue = &viEventQueue;
__osViDevMgr.evtQueue = &viEventQueue;
__osViDevMgr.acsQueue = NULL;
__osViDevMgr.dma = NULL;
__osViDevMgr.edma = NULL;
osCreateThread(&viThread, 0, viMgrMain, &__osViDevMgr, &viThreadStack[OS_VIM_STACKSIZE], pri);
__osViInit();
osStartThread(&viThread);
__osRestoreInt(savedMask);
if (oldPri != -1) {
osSetThreadPri(0, oldPri);
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel osPfsFindFile
/* 441C0 80068DC0 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 441C4 80068DC4 AFB30044 */ sw $s3, 0x44($sp)
/* 441C8 80068DC8 8FB30070 */ lw $s3, 0x70($sp)
/* 441CC 80068DCC AFB00038 */ sw $s0, 0x38($sp)
/* 441D0 80068DD0 00808021 */ addu $s0, $a0, $zero
/* 441D4 80068DD4 AFBE0058 */ sw $fp, 0x58($sp)
/* 441D8 80068DD8 00C0F021 */ addu $fp, $a2, $zero
/* 441DC 80068DDC AFB20040 */ sw $s2, 0x40($sp)
/* 441E0 80068DE0 00E09021 */ addu $s2, $a3, $zero
/* 441E4 80068DE4 AFBF005C */ sw $ra, 0x5C($sp)
/* 441E8 80068DE8 AFB70054 */ sw $s7, 0x54($sp)
/* 441EC 80068DEC AFB60050 */ sw $s6, 0x50($sp)
/* 441F0 80068DF0 AFB5004C */ sw $s5, 0x4C($sp)
/* 441F4 80068DF4 AFB40048 */ sw $s4, 0x48($sp)
/* 441F8 80068DF8 AFB1003C */ sw $s1, 0x3C($sp)
/* 441FC 80068DFC 8E020000 */ lw $v0, 0x0($s0)
/* 44200 80068E00 8FB40074 */ lw $s4, 0x74($sp)
/* 44204 80068E04 30420001 */ andi $v0, $v0, 0x1
/* 44208 80068E08 1040004E */ beqz $v0, .L80068F44
/* 4420C 80068E0C 00A0B821 */ addu $s7, $a1, $zero
/* 44210 80068E10 0C01A775 */ jal __osCheckId
/* 44214 80068E14 02002021 */ addu $a0, $s0, $zero
/* 44218 80068E18 00403821 */ addu $a3, $v0, $zero
/* 4421C 80068E1C 14E0004A */ bnez $a3, .L80068F48
/* 44220 80068E20 00000000 */ nop
/* 44224 80068E24 8E020050 */ lw $v0, 0x50($s0)
/* 44228 80068E28 18400044 */ blez $v0, .L80068F3C
/* 4422C 80068E2C 00008821 */ addu $s1, $zero, $zero
/* 44230 80068E30 27B60020 */ addiu $s6, $sp, 0x20
/* 44234 80068E34 27B5001C */ addiu $s5, $sp, 0x1C
.L80068E38:
/* 44238 80068E38 8E06005C */ lw $a2, 0x5C($s0)
/* 4423C 80068E3C 8E040004 */ lw $a0, 0x4($s0)
/* 44240 80068E40 8E050008 */ lw $a1, 0x8($s0)
/* 44244 80068E44 27A70010 */ addiu $a3, $sp, 0x10
/* 44248 80068E48 00D13021 */ addu $a2, $a2, $s1
/* 4424C 80068E4C 0C01A874 */ jal __osContRamRead
/* 44250 80068E50 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 44254 80068E54 00403821 */ addu $a3, $v0, $zero
/* 44258 80068E58 14E0003B */ bnez $a3, .L80068F48
/* 4425C 80068E5C 00E01021 */ addu $v0, $a3, $zero
/* 44260 80068E60 8E040004 */ lw $a0, 0x4($s0)
/* 44264 80068E64 0C01A530 */ jal __osPfsGetStatus
/* 44268 80068E68 8E050008 */ lw $a1, 0x8($s0)
/* 4426C 80068E6C 00403821 */ addu $a3, $v0, $zero
/* 44270 80068E70 14E00027 */ bnez $a3, .L80068F10
/* 44274 80068E74 32E2FFFF */ andi $v0, $s7, 0xFFFF
/* 44278 80068E78 97A30014 */ lhu $v1, 0x14($sp)
/* 4427C 80068E7C 1462002A */ bne $v1, $v0, .L80068F28
/* 44280 80068E80 00000000 */ nop
/* 44284 80068E84 8FA20010 */ lw $v0, 0x10($sp)
/* 44288 80068E88 145E0027 */ bne $v0, $fp, .L80068F28
/* 4428C 80068E8C 00000000 */ nop
/* 44290 80068E90 1240000C */ beqz $s2, .L80068EC4
/* 44294 80068E94 00004021 */ addu $t0, $zero, $zero
/* 44298 80068E98 00002021 */ addu $a0, $zero, $zero
/* 4429C 80068E9C 02403021 */ addu $a2, $s2, $zero
/* 442A0 80068EA0 02C02821 */ addu $a1, $s6, $zero
.L80068EA4:
/* 442A4 80068EA4 90A30000 */ lbu $v1, 0x0($a1)
/* 442A8 80068EA8 90C20000 */ lbu $v0, 0x0($a2)
/* 442AC 80068EAC 1462001C */ bne $v1, $v0, .L80068F20
/* 442B0 80068EB0 24C60001 */ addiu $a2, $a2, 0x1
/* 442B4 80068EB4 24840001 */ addiu $a0, $a0, 0x1
/* 442B8 80068EB8 28820010 */ slti $v0, $a0, 0x10
/* 442BC 80068EBC 1440FFF9 */ bnez $v0, .L80068EA4
/* 442C0 80068EC0 24A50001 */ addiu $a1, $a1, 0x1
.L80068EC4:
/* 442C4 80068EC4 0013102B */ sltu $v0, $zero, $s3
/* 442C8 80068EC8 2D030001 */ sltiu $v1, $t0, 0x1
/* 442CC 80068ECC 00431024 */ and $v0, $v0, $v1
/* 442D0 80068ED0 1040000C */ beqz $v0, .L80068F04
/* 442D4 80068ED4 00000000 */ nop
/* 442D8 80068ED8 00002021 */ addu $a0, $zero, $zero
/* 442DC 80068EDC 02603021 */ addu $a2, $s3, $zero
/* 442E0 80068EE0 02A02821 */ addu $a1, $s5, $zero
.L80068EE4:
/* 442E4 80068EE4 90A30000 */ lbu $v1, 0x0($a1)
/* 442E8 80068EE8 90C20000 */ lbu $v0, 0x0($a2)
/* 442EC 80068EEC 1462000A */ bne $v1, $v0, .L80068F18
/* 442F0 80068EF0 24C60001 */ addiu $a2, $a2, 0x1
/* 442F4 80068EF4 24840001 */ addiu $a0, $a0, 0x1
/* 442F8 80068EF8 28820004 */ slti $v0, $a0, 0x4
/* 442FC 80068EFC 1440FFF9 */ bnez $v0, .L80068EE4
/* 44300 80068F00 24A50001 */ addiu $a1, $a1, 0x1
.L80068F04:
/* 44304 80068F04 15000008 */ bnez $t0, .L80068F28
/* 44308 80068F08 00000000 */ nop
/* 4430C 80068F0C AE910000 */ sw $s1, 0x0($s4)
.L80068F10:
/* 44310 80068F10 0801A3D2 */ j .L80068F48
/* 44314 80068F14 00E01021 */ addu $v0, $a3, $zero
.L80068F18:
/* 44318 80068F18 0801A3C1 */ j .L80068F04
/* 4431C 80068F1C 24080001 */ addiu $t0, $zero, 0x1
.L80068F20:
/* 44320 80068F20 0801A3B1 */ j .L80068EC4
/* 44324 80068F24 24080001 */ addiu $t0, $zero, 0x1
.L80068F28:
/* 44328 80068F28 8E020050 */ lw $v0, 0x50($s0)
/* 4432C 80068F2C 26310001 */ addiu $s1, $s1, 0x1
/* 44330 80068F30 0222102A */ slt $v0, $s1, $v0
/* 44334 80068F34 1440FFC0 */ bnez $v0, .L80068E38
/* 44338 80068F38 00000000 */ nop
.L80068F3C:
/* 4433C 80068F3C 2402FFFF */ addiu $v0, $zero, -0x1
/* 44340 80068F40 AE820000 */ sw $v0, 0x0($s4)
.L80068F44:
/* 44344 80068F44 24020005 */ addiu $v0, $zero, 0x5
.L80068F48:
/* 44348 80068F48 8FBF005C */ lw $ra, 0x5C($sp)
/* 4434C 80068F4C 8FBE0058 */ lw $fp, 0x58($sp)
/* 44350 80068F50 8FB70054 */ lw $s7, 0x54($sp)
/* 44354 80068F54 8FB60050 */ lw $s6, 0x50($sp)
/* 44358 80068F58 8FB5004C */ lw $s5, 0x4C($sp)
/* 4435C 80068F5C 8FB40048 */ lw $s4, 0x48($sp)
/* 44360 80068F60 8FB30044 */ lw $s3, 0x44($sp)
/* 44364 80068F64 8FB20040 */ lw $s2, 0x40($sp)
/* 44368 80068F68 8FB1003C */ lw $s1, 0x3C($sp)
/* 4436C 80068F6C 8FB00038 */ lw $s0, 0x38($sp)
/* 44370 80068F70 03E00008 */ jr $ra
/* 44374 80068F74 27BD0060 */ addiu $sp, $sp, 0x60
/* 44378 80068F78 00000000 */ nop
/* 4437C 80068F7C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo) {
s32 j;
s32 i;
__OSDir dir;
s32 ret = 0;
s32 err;
PFS_CHECK_STATUS;
if ((ret = __osCheckId(pfs)) != 0) {
return ret;
}
for (j = 0; j < pfs->dir_size; j++) {
if ((ret = __osContRamRead(pfs->queue, pfs->channel, pfs->dir_table + j, (u8*)&dir)) != 0) {
return ret;
}
if ((ret = __osPfsGetStatus(pfs->queue, pfs->channel)) != 0) {
return ret;
}
if ((dir.company_code == companyCode) && (dir.game_code == gameCode)) {
err = 0;
if (gameName != 0) {
for (i = 0; i < PFS_FILE_NAME_LEN; i++) {
if (dir.game_name[i] != gameName[i]) {
err = 1;
break;
}
}
}
if ((extName != 0) && (err == 0)) {
for (i = 0; i < PFS_FILE_EXT_LEN; i++) {
if (dir.ext_name[i] != extName[i]) {
err = 1;
break;
}
}
}
if (err == 0) {
*fileNo = j;
return ret;
}
}
}
*fileNo = -1;
return PFS_ERR_INVALID;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel dead_kzn_17_GetActingPartner
/* 163660 80242E00 27BDFFD8 */ addiu $sp, $sp, -0x28
.L80242E04:
/* 163664 80242E04 AFB20018 */ sw $s2, 0x18($sp)
.L80242E08:
/* 163668 80242E08 00A0902D */ daddu $s2, $a1, $zero
glabel func_80242E0C
/* 16366C 80242E0C AFB3001C */ sw $s3, 0x1C($sp)
.L80242E10:
/* 163670 80242E10 00C0982D */ daddu $s3, $a2, $zero
glabel func_80242E14
/* 163674 80242E14 AFB40020 */ sw $s4, 0x20($sp)
.L80242E18:
/* 163678 80242E18 3C148016 */ lui $s4, %hi(gWindows)
.L80242E1C:
/* 16367C 80242E1C 26949D50 */ addiu $s4, $s4, %lo(gWindows)
glabel func_80242E20
/* 163680 80242E20 00042140 */ sll $a0, $a0, 5
.L80242E24:
/* 163684 80242E24 AFB10014 */ sw $s1, 0x14($sp)
D_80242E28:
/* 163688 80242E28 3C118025 */ lui $s1, %hi(D_80249BB0)
glabel dead_kzn_17_UnkFunc46
/* 16368C 80242E2C 26319BB0 */ addiu $s1, $s1, %lo(D_80249BB0)
/* 163690 80242E30 AFBF0024 */ sw $ra, 0x24($sp)
/* 163694 80242E34 AFB00010 */ sw $s0, 0x10($sp)
.L80242E38:
/* 163698 80242E38 8E220000 */ lw $v0, 0x0($s1)
.L80242E3C:
/* 16369C 80242E3C 14400012 */ bnez $v0, D_80242E88
.L80242E40:
/* 1636A0 80242E40 00948021 */ addu $s0, $a0, $s4
.L80242E44:
/* 1636A4 80242E44 0C00CD4A */ jal get_game_mode
.L80242E48:
/* 1636A8 80242E48 00000000 */ nop
.L80242E4C:
/* 1636AC 80242E4C 00021400 */ sll $v0, $v0, 16
.L80242E50:
/* 1636B0 80242E50 00021403 */ sra $v0, $v0, 16
glabel func_80242E54
/* 1636B4 80242E54 2403000F */ addiu $v1, $zero, 0xF
.L80242E58:
/* 1636B8 80242E58 10430008 */ beq $v0, $v1, .L80242E7C
.L80242E5C:
/* 1636BC 80242E5C 00000000 */ nop
.L80242E60:
/* 1636C0 80242E60 0C00CD4A */ jal get_game_mode
.L80242E64:
/* 1636C4 80242E64 00000000 */ nop
.L80242E68:
/* 1636C8 80242E68 00021400 */ sll $v0, $v0, 16
glabel func_80242E6C
/* 1636CC 80242E6C 00021403 */ sra $v0, $v0, 16
glabel func_80242E70
/* 1636D0 80242E70 2403000D */ addiu $v1, $zero, 0xD
.L80242E74:
/* 1636D4 80242E74 14430024 */ bne $v0, $v1, func_80242F08
glabel func_80242E78
/* 1636D8 80242E78 00000000 */ nop
.L80242E7C:
/* 1636DC 80242E7C 8E220000 */ lw $v0, 0x0($s1)
.L80242E80:
/* 1636E0 80242E80 10400018 */ beqz $v0, .L80242EE4
glabel func_80242E84
/* 1636E4 80242E84 00000000 */ nop
D_80242E88:
/* 1636E8 80242E88 2404002C */ addiu $a0, $zero, 0x2C
glabel func_80242E8C
/* 1636EC 80242E8C 2406FFFF */ addiu $a2, $zero, -0x1
D_80242E90:
/* 1636F0 80242E90 0080282D */ daddu $a1, $a0, $zero
glabel .L80242E94
/* 1636F4 80242E94 3C038016 */ lui $v1, %hi(D_8015A2D0)
jtbl_80242E98:
/* 1636F8 80242E98 2463A2D0 */ addiu $v1, $v1, %lo(D_8015A2D0)
.L80242E9C:
/* 1636FC 80242E9C 80620003 */ lb $v0, 0x3($v1)
D_80242EA0:
/* 163700 80242EA0 10460003 */ beq $v0, $a2, D_80242EB0
.L80242EA4:
/* 163704 80242EA4 00000000 */ nop
flo_08_pad_2EA8:
/* 163708 80242EA8 54450006 */ bnel $v0, $a1, func_80242EC4_EA37C4
D_80242EAC:
/* 16370C 80242EAC 24840001 */ addiu $a0, $a0, 0x1
D_80242EB0:
/* 163710 80242EB0 90620000 */ lbu $v0, 0x0($v1)
glabel func_80242EB4
/* 163714 80242EB4 30420008 */ andi $v0, $v0, 0x8
glabel func_80242EB8
/* 163718 80242EB8 14400006 */ bnez $v0, .L80242ED4
glabel func_80242EBC
/* 16371C 80242EBC 28820040 */ slti $v0, $a0, 0x40
.L80242EC0:
/* 163720 80242EC0 24840001 */ addiu $a0, $a0, 0x1
glabel func_80242EC4_EA37C4
/* 163724 80242EC4 28820040 */ slti $v0, $a0, 0x40
.L80242EC8:
/* 163728 80242EC8 1440FFF4 */ bnez $v0, .L80242E9C
D_80242ECC:
/* 16372C 80242ECC 24630020 */ addiu $v1, $v1, 0x20
.L80242ED0:
/* 163730 80242ED0 28820040 */ slti $v0, $a0, 0x40
.L80242ED4:
/* 163734 80242ED4 14400003 */ bnez $v0, .L80242EE4
.L80242ED8:
/* 163738 80242ED8 00000000 */ nop
.L80242EDC:
/* 16373C 80242EDC 3C018025 */ lui $at, %hi(D_80249BB0)
D_80242EE0:
/* 163740 80242EE0 AC209BB0 */ sw $zero, %lo(D_80249BB0)($at)
.L80242EE4:
/* 163744 80242EE4 3C018025 */ lui $at, %hi(D_80249BA0)
D_80242EE8:
/* 163748 80242EE8 AC329BA0 */ sw $s2, %lo(D_80249BA0)($at)
.L80242EEC:
/* 16374C 80242EEC 3C018025 */ lui $at, %hi(D_80249B94)
D_80242EF0:
/* 163750 80242EF0 AC329B94 */ sw $s2, %lo(D_80249B94)($at)
.L80242EF4:
/* 163754 80242EF4 3C018025 */ lui $at, %hi(D_80249BA4)
glabel func_80242EF8
/* 163758 80242EF8 AC339BA4 */ sw $s3, %lo(D_80249BA4)($at)
.L80242EFC:
/* 16375C 80242EFC 3C018025 */ lui $at, %hi(D_80249B98)
D_80242F00:
/* 163760 80242F00 08090BD2 */ j .L80242F48
/* 163764 80242F04 AC339B98 */ sw $s3, %lo(D_80249B98)($at)
glabel func_80242F08
/* 163768 80242F08 92020000 */ lbu $v0, 0x0($s0)
.L80242F0C:
/* 16376C 80242F0C 30420008 */ andi $v0, $v0, 0x8
D_80242F10:
/* 163770 80242F10 1440000D */ bnez $v0, .L80242F48
glabel func_80242F14
/* 163774 80242F14 2402FFFF */ addiu $v0, $zero, -0x1
.L80242F18:
/* 163778 80242F18 82040003 */ lb $a0, 0x3($s0)
glabel func_80242F1C
/* 16377C 80242F1C 10820006 */ beq $a0, $v0, D_80242F38
glabel func_80242F20
/* 163780 80242F20 00041140 */ sll $v0, $a0, 5
/* 163784 80242F24 00541021 */ addu $v0, $v0, $s4
D_80242F28:
/* 163788 80242F28 90420000 */ lbu $v0, 0x0($v0)
.L80242F2C:
/* 16378C 80242F2C 30420008 */ andi $v0, $v0, 0x8
D_80242F30:
/* 163790 80242F30 14400005 */ bnez $v0, .L80242F48
D_80242F34:
/* 163794 80242F34 00000000 */ nop
D_80242F38:
/* 163798 80242F38 3C018025 */ lui $at, %hi(D_80249BA0)
glabel func_80242F3C
/* 16379C 80242F3C AC329BA0 */ sw $s2, %lo(D_80249BA0)($at)
D_80242F40:
/* 1637A0 80242F40 3C018025 */ lui $at, %hi(D_80249BA4)
glabel func_80242F44
/* 1637A4 80242F44 AC339BA4 */ sw $s3, %lo(D_80249BA4)($at)
.L80242F48:
/* 1637A8 80242F48 8FBF0024 */ lw $ra, 0x24($sp)
.L80242F4C:
/* 1637AC 80242F4C 8FB40020 */ lw $s4, 0x20($sp)
D_80242F50:
/* 1637B0 80242F50 8FB3001C */ lw $s3, 0x1C($sp)
glabel func_80242F54
/* 1637B4 80242F54 8FB20018 */ lw $s2, 0x18($sp)
D_80242F58:
/* 1637B8 80242F58 8FB10014 */ lw $s1, 0x14($sp)
.L80242F5C:
/* 1637BC 80242F5C 8FB00010 */ lw $s0, 0x10($sp)
D_80242F60:
/* 1637C0 80242F60 03E00008 */ jr $ra
glabel dead_kzn_17_UnkFunc48
/* 1637C4 80242F64 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void filemenu_set_cursor_goal_pos(s32 windowID, s32 posX, s32 posY) {
Window* window = &gWindows[windowID];
if (D_80249BB0
|| get_game_mode() == GAME_MODE_END_FILE_SELECT
|| get_game_mode() == GAME_MODE_END_LANGUAGE_SELECT) {
if (D_80249BB0) {
s32 i;
for (i = WINDOW_ID_FILEMENU_MAIN; i < ARRAY_COUNT(gWindows); i++) {
Window* window = &gWindows[i];
s8 parent = window->parent;
if ((parent == -1 || parent == WINDOW_ID_FILEMENU_MAIN) && (window->flags & WINDOW_FLAG_INITIAL_ANIMATION)) {
break;
}
}
if (i >= ARRAY_COUNT(gWindows)) {
D_80249BB0 = FALSE;
}
}
filemenu_cursor_targetX = posX;
filemenu_cursor_posX = posX;
filemenu_cursor_targetY = posY;
filemenu_cursor_posY = posY;
} else if (!(window->flags & WINDOW_FLAG_INITIAL_ANIMATION) &&
(window->parent == -1 || !(gWindows[window->parent].flags & WINDOW_FLAG_INITIAL_ANIMATION))) {
filemenu_cursor_targetX = posX;
filemenu_cursor_targetY = posY;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_80218C74_48DE14
/* 48DE14 80218C74 27BDFFB8 */ addiu $sp, $sp, -0x48
D_80218C78:
/* 48DE18 80218C78 AFB10014 */ sw $s1, 0x14($sp)
glabel b_area_omo3_StartRumbleWithParams
/* 48DE1C 80218C7C 0080882D */ daddu $s1, $a0, $zero
.L80218C80:
/* 48DE20 80218C80 AFBF0024 */ sw $ra, 0x24($sp)
.L80218C84:
/* 48DE24 80218C84 AFB40020 */ sw $s4, 0x20($sp)
glabel dup2_b_area_pra_UnkFunc52
/* 48DE28 80218C88 AFB3001C */ sw $s3, 0x1C($sp)
b_area_omo2_general_guy_attack_throw_bomb:
/* 48DE2C 80218C8C AFB20018 */ sw $s2, 0x18($sp)
.L80218C90:
/* 48DE30 80218C90 AFB00010 */ sw $s0, 0x10($sp)
/* 48DE34 80218C94 F7BA0040 */ sdc1 $f26, 0x40($sp)
.L80218C98:
/* 48DE38 80218C98 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 48DE3C 80218C9C F7B60030 */ sdc1 $f22, 0x30($sp)
/* 48DE40 80218CA0 F7B40028 */ sdc1 $f20, 0x28($sp)
.L80218CA4:
/* 48DE44 80218CA4 8E30000C */ lw $s0, 0xC($s1)
/* 48DE48 80218CA8 8E050000 */ lw $a1, 0x0($s0)
/* 48DE4C 80218CAC 0C0B1EAF */ jal evt_get_variable
b_area_trd_part_1_Formations:
/* 48DE50 80218CB0 26100004 */ addiu $s0, $s0, 0x4
/* 48DE54 80218CB4 0220202D */ daddu $a0, $s1, $zero
/* 48DE58 80218CB8 8E050000 */ lw $a1, 0x0($s0)
/* 48DE5C 80218CBC 0C0B1EAF */ jal evt_get_variable
glabel func_80218CC0
/* 48DE60 80218CC0 0040902D */ daddu $s2, $v0, $zero
.L80218CC4:
/* 48DE64 80218CC4 24040168 */ addiu $a0, $zero, 0x168
b_area_isk_part_1_pokey_mummy_ActorParts:
/* 48DE68 80218CC8 0C00A67F */ jal rand_int
.L80218CCC:
/* 48DE6C 80218CCC 0040982D */ daddu $s3, $v0, $zero
glabel b_area_trd_part_2_red_ninja_koopa_GetKoopaBrosWithState
/* 48DE70 80218CD0 4482B000 */ mtc1 $v0, $f22
.L80218CD4:
/* 48DE74 80218CD4 00000000 */ nop
/* 48DE78 80218CD8 4680B5A0 */ cvt.s.w $f22, $f22
/* 48DE7C 80218CDC 3C014238 */ lui $at, (0x42380000 >> 16)
glabel func_80218CE0
/* 48DE80 80218CE0 4481C000 */ mtc1 $at, $f24
glabel func_80218CE4
/* 48DE84 80218CE4 0C00A8D4 */ jal cos_deg
/* 48DE88 80218CE8 4600B306 */ mov.s $f12, $f22
glabel func_80218CEC
/* 48DE8C 80218CEC 46180002 */ mul.s $f0, $f0, $f24
.L80218CF0:
/* 48DE90 80218CF0 00000000 */ nop
glabel b_area_omo_spy_guy_SpyGuyActionFunc
/* 48DE94 80218CF4 4492A000 */ mtc1 $s2, $f20
/* 48DE98 80218CF8 00000000 */ nop
/* 48DE9C 80218CFC 4680A520 */ cvt.s.w $f20, $f20
.L80218D00:
/* 48DEA0 80218D00 4600A000 */ add.s $f0, $f20, $f0
.L80218D04:
/* 48DEA4 80218D04 4600008D */ trunc.w.s $f2, $f0
.L80218D08:
/* 48DEA8 80218D08 44121000 */ mfc1 $s2, $f2
glabel b_area_kzn_white_magikoopa_GetBootsHammerLevel
/* 48DEAC 80218D0C 0C00A8BB */ jal sin_deg
glabel b_area_kpa3_UnkActorPosFunc
/* 48DEB0 80218D10 4600B306 */ mov.s $f12, $f22
/* 48DEB4 80218D14 46180002 */ mul.s $f0, $f0, $f24
.L80218D18:
/* 48DEB8 80218D18 00000000 */ nop
.L80218D1C:
/* 48DEBC 80218D1C 4493C000 */ mtc1 $s3, $f24
.L80218D20:
/* 48DEC0 80218D20 00000000 */ nop
D_80218D24:
/* 48DEC4 80218D24 4680C620 */ cvt.s.w $f24, $f24
glabel b_area_kmr_part_3_final_jr_troopa_CalculateRotationZ
/* 48DEC8 80218D28 4600C000 */ add.s $f0, $f24, $f0
.L80218D2C:
/* 48DECC 80218D2C 3C014278 */ lui $at, (0x42780000 >> 16)
/* 48DED0 80218D30 4481D000 */ mtc1 $at, $f26
D_80218D34:
/* 48DED4 80218D34 4600008D */ trunc.w.s $f2, $f0
.L80218D38:
/* 48DED8 80218D38 44131000 */ mfc1 $s3, $f2
.L80218D3C:
/* 48DEDC 80218D3C 0C00A8D4 */ jal cos_deg
glabel b_area_kzn2_petit_piranha_SetFlameUnk2C
/* 48DEE0 80218D40 4600B306 */ mov.s $f12, $f22
.L80218D44:
/* 48DEE4 80218D44 461A0002 */ mul.s $f0, $f0, $f26
b_area_dgb_tubba_blubba:
/* 48DEE8 80218D48 00000000 */ nop
glabel func_80218D4C
/* 48DEEC 80218D4C 4600A500 */ add.s $f20, $f20, $f0
glabel dup3_b_area_pra_ShrinkActor
/* 48DEF0 80218D50 4600A08D */ trunc.w.s $f2, $f20
glabel func_80218D54
/* 48DEF4 80218D54 44141000 */ mfc1 $s4, $f2
b_area_kgr_fuzzipede_idle_80218D58:
/* 48DEF8 80218D58 0C00A8BB */ jal sin_deg
.L80218D5C:
/* 48DEFC 80218D5C 4600B306 */ mov.s $f12, $f22
.L80218D60:
/* 48DF00 80218D60 461A0002 */ mul.s $f0, $f0, $f26
glabel b_area_pra3_duplighost_UnkActorPosFunc
/* 48DF04 80218D64 00000000 */ nop
D_80218D68:
/* 48DF08 80218D68 26100004 */ addiu $s0, $s0, 0x4
glabel b_area_kzn_white_magikoopa_UnkBattleFunc5
/* 48DF0C 80218D6C 8E050000 */ lw $a1, 0x0($s0)
b_area_trd_part_2_red_ninja_koopa_GetTowerFallPosition:
/* 48DF10 80218D70 26100004 */ addiu $s0, $s0, 0x4
.L80218D74:
/* 48DF14 80218D74 4600C600 */ add.s $f24, $f24, $f0
glabel b_area_sam2_sam_01_Set80071270_0_16
/* 48DF18 80218D78 0240302D */ daddu $a2, $s2, $zero
b_area_jan_spear_guy_80218D7C:
/* 48DF1C 80218D7C 4600C08D */ trunc.w.s $f2, $f24
/* 48DF20 80218D80 44121000 */ mfc1 $s2, $f2
/* 48DF24 80218D84 0C0B2026 */ jal evt_set_variable
/* 48DF28 80218D88 0220202D */ daddu $a0, $s1, $zero
/* 48DF2C 80218D8C 8E050000 */ lw $a1, 0x0($s0)
glabel b_area_kzn2_petit_piranha_SetFlameX
/* 48DF30 80218D90 26100004 */ addiu $s0, $s0, 0x4
.L80218D94:
/* 48DF34 80218D94 0220202D */ daddu $a0, $s1, $zero
glabel dup2_b_area_flo_GetSelectedMoveID
/* 48DF38 80218D98 0C0B2026 */ jal evt_set_variable
glabel func_80218D9C
/* 48DF3C 80218D9C 0260302D */ daddu $a2, $s3, $zero
b_area_isk_part_1_pokey_mummy:
/* 48DF40 80218DA0 8E050000 */ lw $a1, 0x0($s0)
.L80218DA4:
/* 48DF44 80218DA4 26100004 */ addiu $s0, $s0, 0x4
.L80218DA8:
/* 48DF48 80218DA8 0220202D */ daddu $a0, $s1, $zero
/* 48DF4C 80218DAC 0C0B2026 */ jal evt_set_variable
glabel b_area_omo_sky_guy_StartRumbleWithParams
/* 48DF50 80218DB0 0280302D */ daddu $a2, $s4, $zero
.L80218DB4:
/* 48DF54 80218DB4 0220202D */ daddu $a0, $s1, $zero
/* 48DF58 80218DB8 8E050000 */ lw $a1, 0x0($s0)
.L80218DBC:
/* 48DF5C 80218DBC 0C0B2026 */ jal evt_set_variable
.L80218DC0:
/* 48DF60 80218DC0 0240302D */ daddu $a2, $s2, $zero
glabel dup4_b_area_flo_SetAbsoluteStatusOffsets
/* 48DF64 80218DC4 8FBF0024 */ lw $ra, 0x24($sp)
D_80218DC8:
/* 48DF68 80218DC8 8FB40020 */ lw $s4, 0x20($sp)
.L80218DCC:
/* 48DF6C 80218DCC 8FB3001C */ lw $s3, 0x1C($sp)
glabel func_80218DD0_5CF460
/* 48DF70 80218DD0 8FB20018 */ lw $s2, 0x18($sp)
.L80218DD4:
/* 48DF74 80218DD4 8FB10014 */ lw $s1, 0x14($sp)
/* 48DF78 80218DD8 8FB00010 */ lw $s0, 0x10($sp)
.L80218DDC:
/* 48DF7C 80218DDC D7BA0040 */ ldc1 $f26, 0x40($sp)
.L80218DE0:
/* 48DF80 80218DE0 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 48DF84 80218DE4 D7B60030 */ ldc1 $f22, 0x30($sp)
.L80218DE8:
/* 48DF88 80218DE8 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 48DF8C 80218DEC 24020002 */ addiu $v0, $zero, 0x2
glabel func_80218DF0
/* 48DF90 80218DF0 03E00008 */ jr $ra
glabel func_80218DF4
/* 48DF94 80218DF4 27BD0048 */ addiu $sp, $sp, 0x48
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(func_80218C74_48DE14) {
Bytecode* args = script->ptrReadPos;
s32 x = evt_get_variable(script, *args++);
s32 z = evt_get_variable(script, *args++);
f32 rand = rand_int(0x168);
f32 fx = x;
f32 fz = z;
s32 outX1 = fx + cos_deg(rand) * 46.0f;
s32 outZ1 = fz + sin_deg(rand) * 46.0f;
s32 outX2 = fx + cos_deg(rand) * 62.0f;
s32 outZ2 = fz + sin_deg(rand) * 62.0f;
evt_set_variable(script, *args++, outX1);
evt_set_variable(script, *args++, outZ1);
evt_set_variable(script, *args++, outX2);
evt_set_variable(script, *args++, outZ2);
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel func_80260BF4
/* 18F4D4 80260BF4 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 18F4D8 80260BF8 AFB20018 */ sw $s2, 0x18($sp)
/* 18F4DC 80260BFC 0080902D */ daddu $s2, $a0, $zero
/* 18F4E0 80260C00 AFB00010 */ sw $s0, 0x10($sp)
/* 18F4E4 80260C04 3C108028 */ lui $s0, %hi(D_80280FC0)
/* 18F4E8 80260C08 26100FC0 */ addiu $s0, $s0, %lo(D_80280FC0)
/* 18F4EC 80260C0C AFBF001C */ sw $ra, 0x1C($sp)
/* 18F4F0 80260C10 AFB10014 */ sw $s1, 0x14($sp)
/* 18F4F4 80260C14 86020000 */ lh $v0, 0x0($s0)
/* 18F4F8 80260C18 86040002 */ lh $a0, 0x2($s0)
/* 18F4FC 80260C1C 0C00A67F */ jal rand_int
/* 18F500 80260C20 00442021 */ addu $a0, $v0, $a0
/* 18F504 80260C24 86030000 */ lh $v1, 0x0($s0)
/* 18F508 80260C28 3C118011 */ lui $s1, %hi(gPlayerData)
/* 18F50C 80260C2C 2631F290 */ addiu $s1, $s1, %lo(gPlayerData)
/* 18F510 80260C30 0043102A */ slt $v0, $v0, $v1
/* 18F514 80260C34 10400019 */ beqz $v0, .L80260C9C
/* 18F518 80260C38 0000202D */ daddu $a0, $zero, $zero
/* 18F51C 80260C3C 0080182D */ daddu $v1, $a0, $zero
/* 18F520 80260C40 0200282D */ daddu $a1, $s0, $zero
.L80260C44:
/* 18F524 80260C44 8CA20004 */ lw $v0, 0x4($a1)
/* 18F528 80260C48 24630001 */ addiu $v1, $v1, 0x1
/* 18F52C 80260C4C 00822021 */ addu $a0, $a0, $v0
/* 18F530 80260C50 28620008 */ slti $v0, $v1, 0x8
/* 18F534 80260C54 1440FFFB */ bnez $v0, .L80260C44
/* 18F538 80260C58 24A50008 */ addiu $a1, $a1, 0x8
/* 18F53C 80260C5C 0C00A67F */ jal rand_int
/* 18F540 80260C60 00000000 */ nop
/* 18F544 80260C64 0040202D */ daddu $a0, $v0, $zero
/* 18F548 80260C68 0000182D */ daddu $v1, $zero, $zero
/* 18F54C 80260C6C 0200282D */ daddu $a1, $s0, $zero
.L80260C70:
/* 18F550 80260C70 8CA20004 */ lw $v0, 0x4($a1)
/* 18F554 80260C74 00822023 */ subu $a0, $a0, $v0
/* 18F558 80260C78 18800006 */ blez $a0, .L80260C94
/* 18F55C 80260C7C 000310C0 */ sll $v0, $v1, 3
/* 18F560 80260C80 24630001 */ addiu $v1, $v1, 0x1
/* 18F564 80260C84 28620008 */ slti $v0, $v1, 0x8
/* 18F568 80260C88 1440FFF9 */ bnez $v0, .L80260C70
/* 18F56C 80260C8C 24A50008 */ addiu $a1, $a1, 0x8
/* 18F570 80260C90 000310C0 */ sll $v0, $v1, 3
.L80260C94:
/* 18F574 80260C94 08098364 */ j .L80260D90
/* 18F578 80260C98 34420004 */ ori $v0, $v0, 0x4
.L80260C9C:
/* 18F57C 80260C9C 82220002 */ lb $v0, 0x2($s1)
/* 18F580 80260CA0 82230003 */ lb $v1, 0x3($s1)
/* 18F584 80260CA4 44820000 */ mtc1 $v0, $f0
/* 18F588 80260CA8 00000000 */ nop
/* 18F58C 80260CAC 46800020 */ cvt.s.w $f0, $f0
/* 18F590 80260CB0 44831000 */ mtc1 $v1, $f2
/* 18F594 80260CB4 00000000 */ nop
/* 18F598 80260CB8 468010A0 */ cvt.s.w $f2, $f2
/* 18F59C 80260CBC 46020003 */ div.s $f0, $f0, $f2
/* 18F5A0 80260CC0 3C013FD0 */ lui $at, (0x3FD00000 >> 16)
/* 18F5A4 80260CC4 44811800 */ mtc1 $at, $f3
/* 18F5A8 80260CC8 44801000 */ mtc1 $zero, $f2
/* 18F5AC 80260CCC 46000121 */ cvt.d.s $f4, $f0
/* 18F5B0 80260CD0 4622203E */ c.le.d $f4, $f2
/* 18F5B4 80260CD4 00000000 */ nop
/* 18F5B8 80260CD8 45000003 */ bc1f .L80260CE8
/* 18F5BC 80260CDC 00000000 */ nop
/* 18F5C0 80260CE0 0809834D */ j .L80260D34
/* 18F5C4 80260CE4 26100044 */ addiu $s0, $s0, 0x44
.L80260CE8:
/* 18F5C8 80260CE8 3C013FE0 */ lui $at, (0x3FE00000 >> 16)
/* 18F5CC 80260CEC 44810800 */ mtc1 $at, $f1
/* 18F5D0 80260CF0 44800000 */ mtc1 $zero, $f0
/* 18F5D4 80260CF4 00000000 */ nop
/* 18F5D8 80260CF8 4620203E */ c.le.d $f4, $f0
/* 18F5DC 80260CFC 00000000 */ nop
/* 18F5E0 80260D00 45000003 */ bc1f .L80260D10
/* 18F5E4 80260D04 00000000 */ nop
/* 18F5E8 80260D08 0809834D */ j .L80260D34
/* 18F5EC 80260D0C 26100084 */ addiu $s0, $s0, 0x84
.L80260D10:
/* 18F5F0 80260D10 3C013FE8 */ lui $at, (0x3FE80000 >> 16)
/* 18F5F4 80260D14 44810800 */ mtc1 $at, $f1
/* 18F5F8 80260D18 44800000 */ mtc1 $zero, $f0
/* 18F5FC 80260D1C 00000000 */ nop
/* 18F600 80260D20 4620203E */ c.le.d $f4, $f0
/* 18F604 80260D24 00000000 */ nop
/* 18F608 80260D28 45020002 */ bc1fl .L80260D34
/* 18F60C 80260D2C 26100104 */ addiu $s0, $s0, 0x104
/* 18F610 80260D30 261000C4 */ addiu $s0, $s0, 0xC4
.L80260D34:
/* 18F614 80260D34 0000202D */ daddu $a0, $zero, $zero
/* 18F618 80260D38 0080182D */ daddu $v1, $a0, $zero
/* 18F61C 80260D3C 0200282D */ daddu $a1, $s0, $zero
.L80260D40:
/* 18F620 80260D40 8CA20000 */ lw $v0, 0x0($a1)
/* 18F624 80260D44 24630001 */ addiu $v1, $v1, 0x1
/* 18F628 80260D48 00822021 */ addu $a0, $a0, $v0
/* 18F62C 80260D4C 28620008 */ slti $v0, $v1, 0x8
/* 18F630 80260D50 1440FFFB */ bnez $v0, .L80260D40
/* 18F634 80260D54 24A50008 */ addiu $a1, $a1, 0x8
/* 18F638 80260D58 0C00A67F */ jal rand_int
/* 18F63C 80260D5C 00000000 */ nop
/* 18F640 80260D60 0040202D */ daddu $a0, $v0, $zero
/* 18F644 80260D64 0000182D */ daddu $v1, $zero, $zero
/* 18F648 80260D68 0200282D */ daddu $a1, $s0, $zero
.L80260D6C:
/* 18F64C 80260D6C 8CA20000 */ lw $v0, 0x0($a1)
/* 18F650 80260D70 00822023 */ subu $a0, $a0, $v0
/* 18F654 80260D74 18800006 */ blez $a0, .L80260D90
/* 18F658 80260D78 000310C0 */ sll $v0, $v1, 3
/* 18F65C 80260D7C 24630001 */ addiu $v1, $v1, 0x1
/* 18F660 80260D80 28620008 */ slti $v0, $v1, 0x8
/* 18F664 80260D84 1440FFF9 */ bnez $v0, .L80260D6C
/* 18F668 80260D88 24A50008 */ addiu $a1, $a1, 0x8
/* 18F66C 80260D8C 000310C0 */ sll $v0, $v1, 3
.L80260D90:
/* 18F670 80260D90 00501021 */ addu $v0, $v0, $s0
/* 18F674 80260D94 8C420004 */ lw $v0, 0x4($v0)
/* 18F678 80260D98 AE420084 */ sw $v0, 0x84($s2)
/* 18F67C 80260D9C 8FBF001C */ lw $ra, 0x1C($sp)
/* 18F680 80260DA0 8FB20018 */ lw $s2, 0x18($sp)
/* 18F684 80260DA4 8FB10014 */ lw $s1, 0x14($sp)
/* 18F688 80260DA8 8FB00010 */ lw $s0, 0x10($sp)
/* 18F68C 80260DAC 24020002 */ addiu $v0, $zero, 0x2
/* 18F690 80260DB0 03E00008 */ jr $ra
/* 18F694 80260DB4 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
API_CALLABLE(ChoosePlayerCelebrationAnim) {
PlayerCelebrationAnimOptions* pcao = &D_80280FC0;
PlayerData* playerData = &gPlayerData;
s32 temp;
s32 i;
if (rand_int(pcao->randomChance + pcao->hpBasedChance) < pcao->randomChance) {
temp = 0;
for (i = 0; i < 8; i++) {
temp += pcao->options[i * 2];
}
temp = rand_int(temp);
for (i = 0; i < 8; i++) {
temp -= pcao->options[i * 2];
if (temp <= 0) {
break;
}
}
script->varTable[0] = pcao->options[i * 2 + 1];
} else {
s32* opts;
f32 healthRatio = playerData->curHP / (f32) playerData->curMaxHP;
if (healthRatio <= 0.25) {
opts = &pcao->options[16];
} else if (healthRatio <= 0.5) {
opts = &pcao->options[32];
} else if (healthRatio <= 0.75) {
opts = &pcao->options[48];
} else {
opts = &pcao->options[64];
}
temp = 0;
for (i = 0; i < 8; i++) {
temp += opts[i * 2];
}
temp = rand_int(temp);
for (i = 0; i < 8; i++) {
temp -= opts[i * 2];
if (temp <= 0) {
break;
}
}
script->varTable[0] = opts[i * 2 + 1];
}
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel start_battle
/* 1FAB4 800446B4 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 1FAB8 800446B8 AFB00010 */ sw $s0, 0x10($sp)
/* 1FABC 800446BC 00A0802D */ daddu $s0, $a1, $zero
/* 1FAC0 800446C0 AFBF0028 */ sw $ra, 0x28($sp)
/* 1FAC4 800446C4 AFB50024 */ sw $s5, 0x24($sp)
/* 1FAC8 800446C8 AFB40020 */ sw $s4, 0x20($sp)
/* 1FACC 800446CC AFB3001C */ sw $s3, 0x1C($sp)
/* 1FAD0 800446D0 AFB20018 */ sw $s2, 0x18($sp)
/* 1FAD4 800446D4 AFB10014 */ sw $s1, 0x14($sp)
/* 1FAD8 800446D8 8C910148 */ lw $s1, 0x148($a0)
/* 1FADC 800446DC 0C0B1192 */ jal resume_all_group
/* 1FAE0 800446E0 24040001 */ addiu $a0, $zero, 0x1
/* 1FAE4 800446E4 3C13800B */ lui $s3, %hi(gCurrentEncounter)
/* 1FAE8 800446E8 26730F10 */ addiu $s3, $s3, %lo(gCurrentEncounter)
/* 1FAEC 800446EC 24020001 */ addiu $v0, $zero, 0x1
/* 1FAF0 800446F0 A2620005 */ sb $v0, 0x5($s3)
/* 1FAF4 800446F4 A2220005 */ sb $v0, 0x5($s1)
/* 1FAF8 800446F8 AE71008C */ sw $s1, 0x8C($s3)
/* 1FAFC 800446FC 82220004 */ lb $v0, 0x4($s1)
/* 1FB00 80044700 00021080 */ sll $v0, $v0, 2
/* 1FB04 80044704 00531021 */ addu $v0, $v0, $s3
/* 1FB08 80044708 8C430028 */ lw $v1, 0x28($v0)
/* 1FB0C 8004470C 2402FFFF */ addiu $v0, $zero, -0x1
/* 1FB10 80044710 A2600004 */ sb $zero, 0x4($s3)
/* 1FB14 80044714 A2600011 */ sb $zero, 0x11($s3)
/* 1FB18 80044718 AE700014 */ sw $s0, 0x14($s3)
/* 1FB1C 8004471C AE620018 */ sw $v0, 0x18($s3)
/* 1FB20 80044720 AE630088 */ sw $v1, 0x88($s3)
/* 1FB24 80044724 8E22003C */ lw $v0, 0x3C($s1)
/* 1FB28 80044728 10400003 */ beqz $v0, .L80044738
/* 1FB2C 8004472C 00000000 */ nop
/* 1FB30 80044730 0C0B1108 */ jal suspend_all_script
/* 1FB34 80044734 8E240054 */ lw $a0, 0x54($s1)
.L80044738:
/* 1FB38 80044738 8E220044 */ lw $v0, 0x44($s1)
/* 1FB3C 8004473C 10400003 */ beqz $v0, .L8004474C
/* 1FB40 80044740 00000000 */ nop
/* 1FB44 80044744 0C0B1108 */ jal suspend_all_script
/* 1FB48 80044748 8E24005C */ lw $a0, 0x5C($s1)
.L8004474C:
/* 1FB4C 8004474C 0C03805E */ jal disable_player_input
/* 1FB50 80044750 0000802D */ daddu $s0, $zero, $zero
/* 1FB54 80044754 0C03BD8A */ jal partner_disable_input
/* 1FB58 80044758 00000000 */ nop
/* 1FB5C 8004475C 8E740088 */ lw $s4, 0x88($s3)
/* 1FB60 80044760 8E820000 */ lw $v0, 0x0($s4)
/* 1FB64 80044764 18400021 */ blez $v0, .L800447EC
/* 1FB68 80044768 24150001 */ addiu $s5, $zero, 0x1
/* 1FB6C 8004476C 0280902D */ daddu $s2, $s4, $zero
.L80044770:
/* 1FB70 80044770 8E510004 */ lw $s1, 0x4($s2)
/* 1FB74 80044774 12200018 */ beqz $s1, .L800447D8
/* 1FB78 80044778 00000000 */ nop
/* 1FB7C 8004477C 8E220000 */ lw $v0, 0x0($s1)
/* 1FB80 80044780 30420008 */ andi $v0, $v0, 0x8
/* 1FB84 80044784 10400004 */ beqz $v0, .L80044798
/* 1FB88 80044788 00000000 */ nop
/* 1FB8C 8004478C 8E62008C */ lw $v0, 0x8C($s3)
/* 1FB90 80044790 16220011 */ bne $s1, $v0, .L800447D8
/* 1FB94 80044794 00000000 */ nop
.L80044798:
/* 1FB98 80044798 8E220028 */ lw $v0, 0x28($s1)
/* 1FB9C 8004479C 1040000E */ beqz $v0, .L800447D8
/* 1FBA0 800447A0 0040202D */ daddu $a0, $v0, $zero
/* 1FBA4 800447A4 2405000A */ addiu $a1, $zero, 0xA
/* 1FBA8 800447A8 0000302D */ daddu $a2, $zero, $zero
/* 1FBAC 800447AC 0C0B0CF8 */ jal start_script
/* 1FBB0 800447B0 A2350005 */ sb $s5, 0x5($s1)
/* 1FBB4 800447B4 0040182D */ daddu $v1, $v0, $zero
/* 1FBB8 800447B8 AE230040 */ sw $v1, 0x40($s1)
/* 1FBBC 800447BC 8C620144 */ lw $v0, 0x144($v1)
/* 1FBC0 800447C0 AE220058 */ sw $v0, 0x58($s1)
/* 1FBC4 800447C4 AC710148 */ sw $s1, 0x148($v1)
/* 1FBC8 800447C8 86220008 */ lh $v0, 0x8($s1)
/* 1FBCC 800447CC AC62014C */ sw $v0, 0x14C($v1)
/* 1FBD0 800447D0 92220006 */ lbu $v0, 0x6($s1)
/* 1FBD4 800447D4 A0620004 */ sb $v0, 0x4($v1)
.L800447D8:
/* 1FBD8 800447D8 8E820000 */ lw $v0, 0x0($s4)
/* 1FBDC 800447DC 26100001 */ addiu $s0, $s0, 0x1
/* 1FBE0 800447E0 0202102A */ slt $v0, $s0, $v0
/* 1FBE4 800447E4 1440FFE2 */ bnez $v0, .L80044770
/* 1FBE8 800447E8 26520004 */ addiu $s2, $s2, 0x4
.L800447EC:
/* 1FBEC 800447EC 24020001 */ addiu $v0, $zero, 0x1
/* 1FBF0 800447F0 AE600090 */ sw $zero, 0x90($s3)
/* 1FBF4 800447F4 AE600094 */ sw $zero, 0x94($s3)
/* 1FBF8 800447F8 A2620012 */ sb $v0, 0x12($s3)
/* 1FBFC 800447FC 8FBF0028 */ lw $ra, 0x28($sp)
/* 1FC00 80044800 8FB50024 */ lw $s5, 0x24($sp)
/* 1FC04 80044804 8FB40020 */ lw $s4, 0x20($sp)
/* 1FC08 80044808 8FB3001C */ lw $s3, 0x1C($sp)
/* 1FC0C 8004480C 8FB20018 */ lw $s2, 0x18($sp)
/* 1FC10 80044810 8FB10014 */ lw $s1, 0x14($sp)
/* 1FC14 80044814 8FB00010 */ lw $s0, 0x10($sp)
/* 1FC18 80044818 24020003 */ addiu $v0, $zero, 0x3
/* 1FC1C 8004481C 3C01800A */ lui $at, %hi(gEncounterState)
/* 1FC20 80044820 AC22A600 */ sw $v0, %lo(gEncounterState)($at)
/* 1FC24 80044824 24020001 */ addiu $v0, $zero, 0x1
/* 1FC28 80044828 3C01800A */ lui $at, %hi(D_8009A678)
/* 1FC2C 8004482C AC22A678 */ sw $v0, %lo(D_8009A678)($at)
/* 1FC30 80044830 3C01800A */ lui $at, %hi(gEncounterSubState)
/* 1FC34 80044834 AC20A5D0 */ sw $zero, %lo(gEncounterSubState)($at)
/* 1FC38 80044838 03E00008 */ jr $ra
/* 1FC3C 8004483C 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void start_battle(Evt* script, s32 songID) {
EncounterStatus* currentEncounter = &gCurrentEncounter;
Enemy* enemy = script->owner1.enemy;
Encounter* encounter;
s32 i;
resume_all_group(EVT_GROUP_01);
currentEncounter->hitType = ENCOUNTER_TRIGGER_NONE;
enemy->encountered = TRUE;
currentEncounter->currentEnemy = enemy;
currentEncounter->currentEncounter = currentEncounter->encounterList[enemy->encounterIndex];
currentEncounter->firstStrikeType = FIRST_STRIKE_NONE;
currentEncounter->allowFleeing = FALSE;
currentEncounter->songID = songID;
currentEncounter->unk_18 = -1;
if (enemy->aiScript != NULL) {
suspend_all_script(enemy->aiScriptID);
}
if (enemy->auxScript != NULL) {
suspend_all_script(enemy->auxScriptID);
}
disable_player_input();
partner_disable_input();
encounter = currentEncounter->currentEncounter;
for (i = 0; i < encounter->count; i++) {
enemy = encounter->enemy[i];
if (enemy != NULL && (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->currentEnemy)) {
if (enemy->hitBytecode != NULL) {
Evt* hitEvtInstance;
enemy->encountered = TRUE;
hitEvtInstance = start_script(enemy->hitBytecode, EVT_PRIORITY_A, 0);
enemy->hitScript = hitEvtInstance;
enemy->hitScriptID = hitEvtInstance->id;
hitEvtInstance = enemy->hitScript;
hitEvtInstance->owner1.enemy = enemy;
hitEvtInstance->owner2.npcID = enemy->npcID;
hitEvtInstance->groupFlags = enemy->scriptGroup;
}
}
}
currentEncounter->fadeOutAmount = 0;
currentEncounter->unk_94 = 0;
currentEncounter->scriptedBattle = TRUE;
gEncounterState = ENCOUNTER_STATE_PRE_BATTLE;
D_8009A678 = 1;
gEncounterSubState = ENCOUNTER_SUBSTATE_PRE_BATTLE_INIT;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel virtual_entity_list_render_world
/* F79D8 802D3028 27BDFD68 */ addiu $sp, $sp, -0x298
/* F79DC 802D302C F7B60290 */ sdc1 $f22, 0x290($sp)
/* F79E0 802D3030 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* F79E4 802D3034 4481B000 */ mtc1 $at, $f22
/* F79E8 802D3038 AFB20268 */ sw $s2, 0x268($sp)
/* F79EC 802D303C 0000902D */ daddu $s2, $zero, $zero
/* F79F0 802D3040 F7B40288 */ sdc1 $f20, 0x288($sp)
/* F79F4 802D3044 4480A000 */ mtc1 $zero, $f20
/* F79F8 802D3048 27A80058 */ addiu $t0, $sp, 0x58
/* F79FC 802D304C AFBE0280 */ sw $fp, 0x280($sp)
/* F7A00 802D3050 27BE0098 */ addiu $fp, $sp, 0x98
/* F7A04 802D3054 AFB7027C */ sw $s7, 0x27C($sp)
/* F7A08 802D3058 27B700D8 */ addiu $s7, $sp, 0xD8
/* F7A0C 802D305C AFB60278 */ sw $s6, 0x278($sp)
/* F7A10 802D3060 27B601D8 */ addiu $s6, $sp, 0x1D8
/* F7A14 802D3064 AFB10264 */ sw $s1, 0x264($sp)
/* F7A18 802D3068 27B10158 */ addiu $s1, $sp, 0x158
/* F7A1C 802D306C AFB50274 */ sw $s5, 0x274($sp)
/* F7A20 802D3070 27B50118 */ addiu $s5, $sp, 0x118
/* F7A24 802D3074 AFB40270 */ sw $s4, 0x270($sp)
/* F7A28 802D3078 27B40198 */ addiu $s4, $sp, 0x198
/* F7A2C 802D307C AFB3026C */ sw $s3, 0x26C($sp)
/* F7A30 802D3080 27B30218 */ addiu $s3, $sp, 0x218
/* F7A34 802D3084 AFBF0284 */ sw $ra, 0x284($sp)
/* F7A38 802D3088 AFB00260 */ sw $s0, 0x260($sp)
/* F7A3C 802D308C AFA80258 */ sw $t0, 0x258($sp)
.L802D3090:
/* F7A40 802D3090 3C03802E */ lui $v1, %hi(gCurrentVirtualEntityListPtr)
/* F7A44 802D3094 8C63B7C0 */ lw $v1, %lo(gCurrentVirtualEntityListPtr)($v1)
/* F7A48 802D3098 00121080 */ sll $v0, $s2, 2
/* F7A4C 802D309C 00431021 */ addu $v0, $v0, $v1
/* F7A50 802D30A0 8C500000 */ lw $s0, 0x0($v0)
/* F7A54 802D30A4 5200003D */ beql $s0, $zero, .L802D319C
/* F7A58 802D30A8 26520001 */ addiu $s2, $s2, 0x1
/* F7A5C 802D30AC 8E040000 */ lw $a0, 0x0($s0)
/* F7A60 802D30B0 0482003A */ bltzl $a0, .L802D319C
/* F7A64 802D30B4 26520001 */ addiu $s2, $s2, 0x1
/* F7A68 802D30B8 0C048B77 */ jal get_entity_model
/* F7A6C 802D30BC 00000000 */ nop
/* F7A70 802D30C0 8C420000 */ lw $v0, 0x0($v0)
/* F7A74 802D30C4 30420008 */ andi $v0, $v0, 0x8
/* F7A78 802D30C8 54400034 */ bnel $v0, $zero, .L802D319C
/* F7A7C 802D30CC 26520001 */ addiu $s2, $s2, 0x1
/* F7A80 802D30D0 8E050004 */ lw $a1, 0x4($s0)
/* F7A84 802D30D4 8E060008 */ lw $a2, 0x8($s0)
/* F7A88 802D30D8 8E07000C */ lw $a3, 0xC($s0)
/* F7A8C 802D30DC 0C019E40 */ jal guTranslateF
/* F7A90 802D30E0 27A40018 */ addiu $a0, $sp, 0x18
/* F7A94 802D30E4 E7B40010 */ swc1 $f20, 0x10($sp)
/* F7A98 802D30E8 8E050010 */ lw $a1, 0x10($s0)
/* F7A9C 802D30EC 4406B000 */ mfc1 $a2, $f22
/* F7AA0 802D30F0 4407A000 */ mfc1 $a3, $f20
/* F7AA4 802D30F4 8FA40258 */ lw $a0, 0x258($sp)
/* F7AA8 802D30F8 0C019EC8 */ jal guRotateF
/* F7AAC 802D30FC 26520001 */ addiu $s2, $s2, 0x1
/* F7AB0 802D3100 E7B40010 */ swc1 $f20, 0x10($sp)
/* F7AB4 802D3104 8E050014 */ lw $a1, 0x14($s0)
/* F7AB8 802D3108 4406A000 */ mfc1 $a2, $f20
/* F7ABC 802D310C 4407B000 */ mfc1 $a3, $f22
/* F7AC0 802D3110 0C019EC8 */ jal guRotateF
/* F7AC4 802D3114 03C0202D */ daddu $a0, $fp, $zero
/* F7AC8 802D3118 E7B60010 */ swc1 $f22, 0x10($sp)
/* F7ACC 802D311C 8E050018 */ lw $a1, 0x18($s0)
/* F7AD0 802D3120 4406A000 */ mfc1 $a2, $f20
/* F7AD4 802D3124 4407A000 */ mfc1 $a3, $f20
/* F7AD8 802D3128 0C019EC8 */ jal guRotateF
/* F7ADC 802D312C 02E0202D */ daddu $a0, $s7, $zero
/* F7AE0 802D3130 8E05001C */ lw $a1, 0x1C($s0)
/* F7AE4 802D3134 8E060020 */ lw $a2, 0x20($s0)
/* F7AE8 802D3138 8E070024 */ lw $a3, 0x24($s0)
/* F7AEC 802D313C 0C019DF0 */ jal guScaleF
/* F7AF0 802D3140 02C0202D */ daddu $a0, $s6, $zero
/* F7AF4 802D3144 02E0202D */ daddu $a0, $s7, $zero
/* F7AF8 802D3148 8FA50258 */ lw $a1, 0x258($sp)
/* F7AFC 802D314C 0C019D80 */ jal guMtxCatF
/* F7B00 802D3150 0220302D */ daddu $a2, $s1, $zero
/* F7B04 802D3154 0220202D */ daddu $a0, $s1, $zero
/* F7B08 802D3158 03C0282D */ daddu $a1, $fp, $zero
/* F7B0C 802D315C 0C019D80 */ jal guMtxCatF
/* F7B10 802D3160 02A0302D */ daddu $a2, $s5, $zero
/* F7B14 802D3164 02C0202D */ daddu $a0, $s6, $zero
/* F7B18 802D3168 02A0282D */ daddu $a1, $s5, $zero
/* F7B1C 802D316C 0C019D80 */ jal guMtxCatF
/* F7B20 802D3170 0220302D */ daddu $a2, $s1, $zero
/* F7B24 802D3174 0220202D */ daddu $a0, $s1, $zero
/* F7B28 802D3178 27A50018 */ addiu $a1, $sp, 0x18
/* F7B2C 802D317C 0C019D80 */ jal guMtxCatF
/* F7B30 802D3180 0280302D */ daddu $a2, $s4, $zero
/* F7B34 802D3184 0280202D */ daddu $a0, $s4, $zero
/* F7B38 802D3188 0C019D40 */ jal guMtxF2L
/* F7B3C 802D318C 0260282D */ daddu $a1, $s3, $zero
/* F7B40 802D3190 8E040000 */ lw $a0, 0x0($s0)
/* F7B44 802D3194 0C04873A */ jal draw_entity_model_A
/* F7B48 802D3198 0260282D */ daddu $a1, $s3, $zero
.L802D319C:
/* F7B4C 802D319C 2A420040 */ slti $v0, $s2, 0x40
/* F7B50 802D31A0 1440FFBB */ bnez $v0, .L802D3090
/* F7B54 802D31A4 00000000 */ nop
/* F7B58 802D31A8 8FBF0284 */ lw $ra, 0x284($sp)
/* F7B5C 802D31AC 8FBE0280 */ lw $fp, 0x280($sp)
/* F7B60 802D31B0 8FB7027C */ lw $s7, 0x27C($sp)
/* F7B64 802D31B4 8FB60278 */ lw $s6, 0x278($sp)
/* F7B68 802D31B8 8FB50274 */ lw $s5, 0x274($sp)
/* F7B6C 802D31BC 8FB40270 */ lw $s4, 0x270($sp)
/* F7B70 802D31C0 8FB3026C */ lw $s3, 0x26C($sp)
/* F7B74 802D31C4 8FB20268 */ lw $s2, 0x268($sp)
/* F7B78 802D31C8 8FB10264 */ lw $s1, 0x264($sp)
/* F7B7C 802D31CC 8FB00260 */ lw $s0, 0x260($sp)
/* F7B80 802D31D0 D7B60290 */ ldc1 $f22, 0x290($sp)
/* F7B84 802D31D4 D7B40288 */ ldc1 $f20, 0x288($sp)
/* F7B88 802D31D8 03E00008 */ jr $ra
/* F7B8C 802D31DC 27BD0298 */ addiu $sp, $sp, 0x298
### DECOMPILED C INSTRUCTIONS:
void virtual_entity_list_render_world(void) {
Matrix4f translation;
Matrix4f xRot;
Matrix4f yRot;
Matrix4f zRot;
Matrix4f rotation;
Matrix4f temp;
Matrix4f transform;
Matrix4f scale;
Mtx transformMtxL;
VirtualEntity* virtualEntity;
s32 i;
for (i = 0; i < ARRAY_COUNT(*gCurrentVirtualEntityListPtr); i++) {
virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
if (virtualEntity != NULL) {
if (!(virtualEntity->entityModelIndex < 0 || get_entity_model(virtualEntity->entityModelIndex)->flags & ENTITY_MODEL_FLAG_CAM3)) {
guTranslateF(translation, virtualEntity->pos.x, virtualEntity->pos.y, virtualEntity->pos.z);
guRotateF(xRot, virtualEntity->rot.x, 1.0f, 0.0f, 0.0f);
guRotateF(yRot, virtualEntity->rot.y, 0.0f, 1.0f, 0.0f);
guRotateF(zRot, virtualEntity->rot.z, 0.0f, 0.0f, 1.0f);
guScaleF(scale, virtualEntity->scale.x, virtualEntity->scale.y, virtualEntity->scale.z);
guMtxCatF(zRot, xRot, temp);
guMtxCatF(temp, yRot, rotation);
guMtxCatF(scale, rotation, temp);
guMtxCatF(temp, translation, transform);
guMtxF2L(transform, &transformMtxL);
draw_entity_model_A(virtualEntity->entityModelIndex, &transformMtxL);
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel big_smoke_puff_main
/* 3278F0 E0002000 27BDFF88 */ addiu $sp, $sp, -0x78
/* 3278F4 E0002004 F7BA0060 */ sdc1 $f26, 0x60($sp)
/* 3278F8 E0002008 46006686 */ mov.s $f26, $f12
/* 3278FC E000200C F7BC0068 */ sdc1 $f28, 0x68($sp)
/* 327900 E0002010 46007706 */ mov.s $f28, $f14
/* 327904 E0002014 27A40010 */ addiu $a0, $sp, 0x10
/* 327908 E0002018 F7BE0070 */ sdc1 $f30, 0x70($sp)
/* 32790C E000201C 4486F000 */ mtc1 $a2, $f30
/* 327910 E0002020 3C02E000 */ lui $v0, %hi(big_smoke_puff_init)
/* 327914 E0002024 244221B4 */ addiu $v0, $v0, %lo(big_smoke_puff_init)
/* 327918 E0002028 AFA20018 */ sw $v0, 0x18($sp)
/* 32791C E000202C 3C02E000 */ lui $v0, %hi(big_smoke_puff_update)
/* 327920 E0002030 244221BC */ addiu $v0, $v0, %lo(big_smoke_puff_update)
/* 327924 E0002034 AFA2001C */ sw $v0, 0x1C($sp)
/* 327928 E0002038 3C02E000 */ lui $v0, %hi(big_smoke_puff_render)
/* 32792C E000203C 244222BC */ addiu $v0, $v0, %lo(big_smoke_puff_render)
/* 327930 E0002040 AFA20020 */ sw $v0, 0x20($sp)
/* 327934 E0002044 24020001 */ addiu $v0, $zero, 0x1
/* 327938 E0002048 AFBF0044 */ sw $ra, 0x44($sp)
/* 32793C E000204C AFB60040 */ sw $s6, 0x40($sp)
/* 327940 E0002050 AFB5003C */ sw $s5, 0x3C($sp)
/* 327944 E0002054 AFB40038 */ sw $s4, 0x38($sp)
/* 327948 E0002058 AFB30034 */ sw $s3, 0x34($sp)
/* 32794C E000205C AFB20030 */ sw $s2, 0x30($sp)
/* 327950 E0002060 AFB1002C */ sw $s1, 0x2C($sp)
/* 327954 E0002064 AFB00028 */ sw $s0, 0x28($sp)
/* 327958 E0002068 F7B80058 */ sdc1 $f24, 0x58($sp)
/* 32795C E000206C F7B60050 */ sdc1 $f22, 0x50($sp)
/* 327960 E0002070 F7B40048 */ sdc1 $f20, 0x48($sp)
/* 327964 E0002074 AFA00010 */ sw $zero, 0x10($sp)
/* 327968 E0002078 AFA00024 */ sw $zero, 0x24($sp)
/* 32796C E000207C 0C080124 */ jal shim_create_effect_instance
/* 327970 E0002080 AFA20014 */ sw $v0, 0x14($sp)
/* 327974 E0002084 240401B8 */ addiu $a0, $zero, 0x1B8
/* 327978 E0002088 2403000A */ addiu $v1, $zero, 0xA
/* 32797C E000208C 0040A82D */ daddu $s5, $v0, $zero
/* 327980 E0002090 0C08012C */ jal shim_general_heap_malloc
/* 327984 E0002094 AEA30008 */ sw $v1, 0x8($s5)
/* 327988 E0002098 0040882D */ daddu $s1, $v0, $zero
/* 32798C E000209C 16200003 */ bnez $s1, .LE00020AC
/* 327990 E00020A0 AEB1000C */ sw $s1, 0xC($s5)
.LE00020A4:
/* 327994 E00020A4 08000829 */ j .LE00020A4
/* 327998 E00020A8 00000000 */ nop
.LE00020AC:
/* 32799C E00020AC 8EA20008 */ lw $v0, 0x8($s5)
/* 3279A0 E00020B0 18400030 */ blez $v0, .LE0002174
/* 3279A4 E00020B4 0000902D */ daddu $s2, $zero, $zero
/* 3279A8 E00020B8 24160004 */ addiu $s6, $zero, 0x4
/* 3279AC E00020BC 3C0142B4 */ lui $at, (0x42B40000 >> 16)
/* 3279B0 E00020C0 4481C000 */ mtc1 $at, $f24
/* 3279B4 E00020C4 26300024 */ addiu $s0, $s1, 0x24
/* 3279B8 E00020C8 3C14E000 */ lui $s4, %hi(D_E0002788)
/* 3279BC E00020CC 26942788 */ addiu $s4, $s4, %lo(D_E0002788)
/* 3279C0 E00020D0 3C13E000 */ lui $s3, %hi(D_E0002760)
/* 3279C4 E00020D4 26732760 */ addiu $s3, $s3, %lo(D_E0002760)
.LE00020D8:
/* 3279C8 E00020D8 24040006 */ addiu $a0, $zero, 0x6
/* 3279CC E00020DC 0C080000 */ jal effect_rand_int
/* 3279D0 E00020E0 A6200000 */ sh $zero, 0x0($s1)
/* 3279D4 E00020E4 24420010 */ addiu $v0, $v0, 0x10
/* 3279D8 E00020E8 A602FFE0 */ sh $v0, -0x20($s0)
/* 3279DC E00020EC A602FFDE */ sh $v0, -0x22($s0)
/* 3279E0 E00020F0 A616FFE2 */ sh $s6, -0x1E($s0)
/* 3279E4 E00020F4 AE00FFE4 */ sw $zero, -0x1C($s0)
/* 3279E8 E00020F8 E61AFFE8 */ swc1 $f26, -0x18($s0)
/* 3279EC E00020FC E61CFFEC */ swc1 $f28, -0x14($s0)
/* 3279F0 E0002100 E61EFFF0 */ swc1 $f30, -0x10($s0)
/* 3279F4 E0002104 AE00FFF4 */ sw $zero, -0xC($s0)
/* 3279F8 E0002108 AE00FFF8 */ sw $zero, -0x8($s0)
/* 3279FC E000210C C6760000 */ lwc1 $f22, 0x0($s3)
/* 327A00 E0002110 C6940000 */ lwc1 $f20, 0x0($s4)
/* 327A04 E0002114 4618B580 */ add.s $f22, $f22, $f24
/* 327A08 E0002118 4600A521 */ cvt.d.s $f20, $f20
/* 327A0C E000211C 4634A500 */ add.d $f20, $f20, $f20
/* 327A10 E0002120 4600B306 */ mov.s $f12, $f22
/* 327A14 E0002124 0C080140 */ jal shim_sin_deg
/* 327A18 E0002128 4620A520 */ cvt.s.d $f20, $f20
/* 327A1C E000212C 4600B306 */ mov.s $f12, $f22
/* 327A20 E0002130 0C080144 */ jal shim_cos_deg
/* 327A24 E0002134 46000586 */ mov.s $f22, $f0
/* 327A28 E0002138 4616A582 */ mul.s $f22, $f20, $f22
/* 327A2C E000213C 00000000 */ nop
/* 327A30 E0002140 26940004 */ addiu $s4, $s4, 0x4
/* 327A34 E0002144 4600A507 */ neg.s $f20, $f20
/* 327A38 E0002148 4600A502 */ mul.s $f20, $f20, $f0
/* 327A3C E000214C 00000000 */ nop
/* 327A40 E0002150 26730004 */ addiu $s3, $s3, 0x4
/* 327A44 E0002154 26520001 */ addiu $s2, $s2, 0x1
/* 327A48 E0002158 2631002C */ addiu $s1, $s1, 0x2C
/* 327A4C E000215C E616FFFC */ swc1 $f22, -0x4($s0)
/* 327A50 E0002160 E6140000 */ swc1 $f20, 0x0($s0)
/* 327A54 E0002164 8EA20008 */ lw $v0, 0x8($s5)
/* 327A58 E0002168 0242102A */ slt $v0, $s2, $v0
/* 327A5C E000216C 1440FFDA */ bnez $v0, .LE00020D8
/* 327A60 E0002170 2610002C */ addiu $s0, $s0, 0x2C
.LE0002174:
/* 327A64 E0002174 8FBF0044 */ lw $ra, 0x44($sp)
/* 327A68 E0002178 8FB60040 */ lw $s6, 0x40($sp)
/* 327A6C E000217C 8FB5003C */ lw $s5, 0x3C($sp)
/* 327A70 E0002180 8FB40038 */ lw $s4, 0x38($sp)
/* 327A74 E0002184 8FB30034 */ lw $s3, 0x34($sp)
/* 327A78 E0002188 8FB20030 */ lw $s2, 0x30($sp)
/* 327A7C E000218C 8FB1002C */ lw $s1, 0x2C($sp)
/* 327A80 E0002190 8FB00028 */ lw $s0, 0x28($sp)
/* 327A84 E0002194 D7BE0070 */ ldc1 $f30, 0x70($sp)
/* 327A88 E0002198 D7BC0068 */ ldc1 $f28, 0x68($sp)
/* 327A8C E000219C D7BA0060 */ ldc1 $f26, 0x60($sp)
/* 327A90 E00021A0 D7B80058 */ ldc1 $f24, 0x58($sp)
/* 327A94 E00021A4 D7B60050 */ ldc1 $f22, 0x50($sp)
/* 327A98 E00021A8 D7B40048 */ ldc1 $f20, 0x48($sp)
/* 327A9C E00021AC 03E00008 */ jr $ra
/* 327AA0 E00021B0 27BD0078 */ addiu $sp, $sp, 0x78
### DECOMPILED C INSTRUCTIONS:
void big_smoke_puff_main(f32 x, f32 y, f32 z) {
EffectBlueprint bp;
EffectInstance* effect;
BigSmokePuffFXData* data;
f32 theta;
f32 temp_f20;
f32 cosTheta;
f32 sinTheta;
s32 numParts = 10;
s32 i;
bp.unk_00 = 0;
bp.init = big_smoke_puff_init;
bp.update = big_smoke_puff_update;
bp.renderWorld = big_smoke_puff_render;
bp.renderUI = NULL;
bp.effectID = EFFECT_BIG_SMOKE_PUFF;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = shim_general_heap_malloc(effect->numParts * sizeof(*data));
effect->data.bigSmokePuff = data;
ASSERT(data != NULL);
for (i = 0; i < effect->numParts; i++, data++) {
data->unk_00 = 0;
data->unk_02 = data->unk_04 = effect_rand_int(6) + 0x10;
data->unk_06 = 4;
data->unk_08 = 0;
data->x = x;
data->y = y;
data->z = z;
data->partX = 0;
data->partY = 0;
theta = D_E0002760[i] + 90.0f;
temp_f20 = 2.0 * D_E0002788[i];
sinTheta = shim_sin_deg(theta);
cosTheta = shim_cos_deg(theta);
data->unk_20 = temp_f20 * sinTheta;
data->unk_24 = -temp_f20 * cosTheta;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel virtual_entity_list_render_UI
/* F7B90 802D31E0 27BDFD68 */ addiu $sp, $sp, -0x298
/* F7B94 802D31E4 F7B60290 */ sdc1 $f22, 0x290($sp)
/* F7B98 802D31E8 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* F7B9C 802D31EC 4481B000 */ mtc1 $at, $f22
/* F7BA0 802D31F0 AFB20268 */ sw $s2, 0x268($sp)
/* F7BA4 802D31F4 0000902D */ daddu $s2, $zero, $zero
/* F7BA8 802D31F8 F7B40288 */ sdc1 $f20, 0x288($sp)
/* F7BAC 802D31FC 4480A000 */ mtc1 $zero, $f20
/* F7BB0 802D3200 27A80058 */ addiu $t0, $sp, 0x58
/* F7BB4 802D3204 AFBE0280 */ sw $fp, 0x280($sp)
/* F7BB8 802D3208 27BE0098 */ addiu $fp, $sp, 0x98
/* F7BBC 802D320C AFB7027C */ sw $s7, 0x27C($sp)
/* F7BC0 802D3210 27B700D8 */ addiu $s7, $sp, 0xD8
/* F7BC4 802D3214 AFB60278 */ sw $s6, 0x278($sp)
/* F7BC8 802D3218 27B601D8 */ addiu $s6, $sp, 0x1D8
/* F7BCC 802D321C AFB10264 */ sw $s1, 0x264($sp)
/* F7BD0 802D3220 27B10158 */ addiu $s1, $sp, 0x158
/* F7BD4 802D3224 AFB50274 */ sw $s5, 0x274($sp)
/* F7BD8 802D3228 27B50118 */ addiu $s5, $sp, 0x118
/* F7BDC 802D322C AFB40270 */ sw $s4, 0x270($sp)
/* F7BE0 802D3230 27B40198 */ addiu $s4, $sp, 0x198
/* F7BE4 802D3234 AFB3026C */ sw $s3, 0x26C($sp)
/* F7BE8 802D3238 27B30218 */ addiu $s3, $sp, 0x218
/* F7BEC 802D323C AFBF0284 */ sw $ra, 0x284($sp)
/* F7BF0 802D3240 AFB00260 */ sw $s0, 0x260($sp)
/* F7BF4 802D3244 AFA80258 */ sw $t0, 0x258($sp)
.L802D3248:
/* F7BF8 802D3248 3C03802E */ lui $v1, %hi(gCurrentVirtualEntityListPtr)
/* F7BFC 802D324C 8C63B7C0 */ lw $v1, %lo(gCurrentVirtualEntityListPtr)($v1)
/* F7C00 802D3250 00121080 */ sll $v0, $s2, 2
/* F7C04 802D3254 00431021 */ addu $v0, $v0, $v1
/* F7C08 802D3258 8C500000 */ lw $s0, 0x0($v0)
/* F7C0C 802D325C 5200003D */ beql $s0, $zero, .L802D3354
/* F7C10 802D3260 26520001 */ addiu $s2, $s2, 0x1
/* F7C14 802D3264 8E040000 */ lw $a0, 0x0($s0)
/* F7C18 802D3268 0482003A */ bltzl $a0, .L802D3354
/* F7C1C 802D326C 26520001 */ addiu $s2, $s2, 0x1
/* F7C20 802D3270 0C048B77 */ jal get_entity_model
/* F7C24 802D3274 00000000 */ nop
/* F7C28 802D3278 8C420000 */ lw $v0, 0x0($v0)
/* F7C2C 802D327C 30420008 */ andi $v0, $v0, 0x8
/* F7C30 802D3280 50400034 */ beql $v0, $zero, .L802D3354
/* F7C34 802D3284 26520001 */ addiu $s2, $s2, 0x1
/* F7C38 802D3288 8E050004 */ lw $a1, 0x4($s0)
/* F7C3C 802D328C 8E060008 */ lw $a2, 0x8($s0)
/* F7C40 802D3290 8E07000C */ lw $a3, 0xC($s0)
/* F7C44 802D3294 0C019E40 */ jal guTranslateF
/* F7C48 802D3298 27A40018 */ addiu $a0, $sp, 0x18
/* F7C4C 802D329C E7B40010 */ swc1 $f20, 0x10($sp)
/* F7C50 802D32A0 8E050010 */ lw $a1, 0x10($s0)
/* F7C54 802D32A4 4406B000 */ mfc1 $a2, $f22
/* F7C58 802D32A8 4407A000 */ mfc1 $a3, $f20
/* F7C5C 802D32AC 8FA40258 */ lw $a0, 0x258($sp)
/* F7C60 802D32B0 0C019EC8 */ jal guRotateF
/* F7C64 802D32B4 26520001 */ addiu $s2, $s2, 0x1
/* F7C68 802D32B8 E7B40010 */ swc1 $f20, 0x10($sp)
/* F7C6C 802D32BC 8E050014 */ lw $a1, 0x14($s0)
/* F7C70 802D32C0 4406A000 */ mfc1 $a2, $f20
/* F7C74 802D32C4 4407B000 */ mfc1 $a3, $f22
/* F7C78 802D32C8 0C019EC8 */ jal guRotateF
/* F7C7C 802D32CC 03C0202D */ daddu $a0, $fp, $zero
/* F7C80 802D32D0 E7B60010 */ swc1 $f22, 0x10($sp)
/* F7C84 802D32D4 8E050018 */ lw $a1, 0x18($s0)
/* F7C88 802D32D8 4406A000 */ mfc1 $a2, $f20
/* F7C8C 802D32DC 4407A000 */ mfc1 $a3, $f20
/* F7C90 802D32E0 0C019EC8 */ jal guRotateF
/* F7C94 802D32E4 02E0202D */ daddu $a0, $s7, $zero
/* F7C98 802D32E8 8E05001C */ lw $a1, 0x1C($s0)
/* F7C9C 802D32EC 8E060020 */ lw $a2, 0x20($s0)
/* F7CA0 802D32F0 8E070024 */ lw $a3, 0x24($s0)
/* F7CA4 802D32F4 0C019DF0 */ jal guScaleF
/* F7CA8 802D32F8 02C0202D */ daddu $a0, $s6, $zero
/* F7CAC 802D32FC 02E0202D */ daddu $a0, $s7, $zero
/* F7CB0 802D3300 8FA50258 */ lw $a1, 0x258($sp)
/* F7CB4 802D3304 0C019D80 */ jal guMtxCatF
/* F7CB8 802D3308 0220302D */ daddu $a2, $s1, $zero
/* F7CBC 802D330C 0220202D */ daddu $a0, $s1, $zero
/* F7CC0 802D3310 03C0282D */ daddu $a1, $fp, $zero
/* F7CC4 802D3314 0C019D80 */ jal guMtxCatF
/* F7CC8 802D3318 02A0302D */ daddu $a2, $s5, $zero
/* F7CCC 802D331C 02C0202D */ daddu $a0, $s6, $zero
/* F7CD0 802D3320 02A0282D */ daddu $a1, $s5, $zero
/* F7CD4 802D3324 0C019D80 */ jal guMtxCatF
/* F7CD8 802D3328 0220302D */ daddu $a2, $s1, $zero
/* F7CDC 802D332C 0220202D */ daddu $a0, $s1, $zero
/* F7CE0 802D3330 27A50018 */ addiu $a1, $sp, 0x18
/* F7CE4 802D3334 0C019D80 */ jal guMtxCatF
/* F7CE8 802D3338 0280302D */ daddu $a2, $s4, $zero
/* F7CEC 802D333C 0280202D */ daddu $a0, $s4, $zero
/* F7CF0 802D3340 0C019D40 */ jal guMtxF2L
/* F7CF4 802D3344 0260282D */ daddu $a1, $s3, $zero
/* F7CF8 802D3348 8E040000 */ lw $a0, 0x0($s0)
/* F7CFC 802D334C 0C0488A2 */ jal draw_entity_model_E
/* F7D00 802D3350 0260282D */ daddu $a1, $s3, $zero
.L802D3354:
/* F7D04 802D3354 2A420040 */ slti $v0, $s2, 0x40
/* F7D08 802D3358 1440FFBB */ bnez $v0, .L802D3248
/* F7D0C 802D335C 00000000 */ nop
/* F7D10 802D3360 8FBF0284 */ lw $ra, 0x284($sp)
/* F7D14 802D3364 8FBE0280 */ lw $fp, 0x280($sp)
/* F7D18 802D3368 8FB7027C */ lw $s7, 0x27C($sp)
/* F7D1C 802D336C 8FB60278 */ lw $s6, 0x278($sp)
/* F7D20 802D3370 8FB50274 */ lw $s5, 0x274($sp)
/* F7D24 802D3374 8FB40270 */ lw $s4, 0x270($sp)
/* F7D28 802D3378 8FB3026C */ lw $s3, 0x26C($sp)
/* F7D2C 802D337C 8FB20268 */ lw $s2, 0x268($sp)
/* F7D30 802D3380 8FB10264 */ lw $s1, 0x264($sp)
/* F7D34 802D3384 8FB00260 */ lw $s0, 0x260($sp)
/* F7D38 802D3388 D7B60290 */ ldc1 $f22, 0x290($sp)
/* F7D3C 802D338C D7B40288 */ ldc1 $f20, 0x288($sp)
/* F7D40 802D3390 03E00008 */ jr $ra
/* F7D44 802D3394 27BD0298 */ addiu $sp, $sp, 0x298
### DECOMPILED C INSTRUCTIONS:
void virtual_entity_list_render_UI(void) {
Matrix4f translation;
Matrix4f xRot;
Matrix4f yRot;
Matrix4f zRot;
Matrix4f rotation;
Matrix4f temp;
Matrix4f transform;
Matrix4f scale;
Mtx transformMtxL;
VirtualEntity* virtualEntity;
s32 i;
for (i = 0; i < ARRAY_COUNT(*gCurrentVirtualEntityListPtr); i++) {
virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
if (virtualEntity != NULL) {
if (!(virtualEntity->entityModelIndex < 0 || !(get_entity_model(virtualEntity->entityModelIndex)->flags & ENTITY_MODEL_FLAG_CAM3))) {
guTranslateF(translation, virtualEntity->pos.x, virtualEntity->pos.y, virtualEntity->pos.z);
guRotateF(xRot, virtualEntity->rot.x, 1.0f, 0.0f, 0.0f);
guRotateF(yRot, virtualEntity->rot.y, 0.0f, 1.0f, 0.0f);
guRotateF(zRot, virtualEntity->rot.z, 0.0f, 0.0f, 1.0f);
guScaleF(scale, virtualEntity->scale.x, virtualEntity->scale.y, virtualEntity->scale.z);
guMtxCatF(zRot, xRot, temp);
guMtxCatF(temp, yRot, rotation);
guMtxCatF(scale, rotation, temp);
guMtxCatF(temp, translation, transform);
guMtxF2L(transform, &transformMtxL);
draw_entity_model_E(virtualEntity->entityModelIndex, &transformMtxL);
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel quizmo_answer_main
/* 3A2290 E00A0000 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 3A2294 E00A0004 AFB00028 */ sw $s0, 0x28($sp)
/* 3A2298 E00A0008 0080802D */ daddu $s0, $a0, $zero
/* 3A229C E00A000C 27A40010 */ addiu $a0, $sp, 0x10
/* 3A22A0 E00A0010 24020050 */ addiu $v0, $zero, 0x50
/* 3A22A4 E00A0014 AFBF002C */ sw $ra, 0x2C($sp)
/* 3A22A8 E00A0018 AFA00010 */ sw $zero, 0x10($sp)
/* 3A22AC E00A001C AFA00018 */ sw $zero, 0x18($sp)
/* 3A22B0 E00A0020 AFA0001C */ sw $zero, 0x1C($sp)
/* 3A22B4 E00A0024 AFA00020 */ sw $zero, 0x20($sp)
/* 3A22B8 E00A0028 AFA00024 */ sw $zero, 0x24($sp)
/* 3A22BC E00A002C 0C080124 */ jal shim_create_effect_instance
/* 3A22C0 E00A0030 AFA20014 */ sw $v0, 0x14($sp)
/* 3A22C4 E00A0034 3C04DB06 */ lui $a0, (0xDB060024 >> 16)
/* 3A22C8 E00A0038 34840024 */ ori $a0, $a0, (0xDB060024 & 0xFFFF)
/* 3A22CC E00A003C 3C06800A */ lui $a2, %hi(gMainGfxPos)
/* 3A22D0 E00A0040 24C6A66C */ addiu $a2, $a2, %lo(gMainGfxPos)
/* 3A22D4 E00A0044 0040582D */ daddu $t3, $v0, $zero
/* 3A22D8 E00A0048 8CC50000 */ lw $a1, 0x0($a2)
/* 3A22DC E00A004C 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 3A22E0 E00A0050 AD60000C */ sw $zero, 0xC($t3)
/* 3A22E4 E00A0054 00A0182D */ daddu $v1, $a1, $zero
/* 3A22E8 E00A0058 24A50008 */ addiu $a1, $a1, 0x8
/* 3A22EC E00A005C ACC50000 */ sw $a1, 0x0($a2)
/* 3A22F0 E00A0060 AC620000 */ sw $v0, 0x0($v1)
/* 3A22F4 E00A0064 AC600004 */ sw $zero, 0x4($v1)
/* 3A22F8 E00A0068 ACA40000 */ sw $a0, 0x0($a1)
/* 3A22FC E00A006C 8D630010 */ lw $v1, 0x10($t3)
/* 3A2300 E00A0070 24A20008 */ addiu $v0, $a1, 0x8
/* 3A2304 E00A0074 ACC20000 */ sw $v0, 0x0($a2)
/* 3A2308 E00A0078 8C62001C */ lw $v0, 0x1C($v1)
/* 3A230C E00A007C 3C038000 */ lui $v1, (0x80000000 >> 16)
/* 3A2310 E00A0080 00431021 */ addu $v0, $v0, $v1
/* 3A2314 E00A0084 1600000A */ bnez $s0, .LE00A00B0
/* 3A2318 E00A0088 ACA20004 */ sw $v0, 0x4($a1)
/* 3A231C E00A008C 3C03FF40 */ lui $v1, (0xFF4040E6 >> 16)
/* 3A2320 E00A0090 24A20010 */ addiu $v0, $a1, 0x10
/* 3A2324 E00A0094 ACC20000 */ sw $v0, 0x0($a2)
/* 3A2328 E00A0098 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3A232C E00A009C ACA20008 */ sw $v0, 0x8($a1)
/* 3A2330 E00A00A0 3C020900 */ lui $v0, %hi(D_09000400_415460)
/* 3A2334 E00A00A4 24420400 */ addiu $v0, $v0, %lo(D_09000400_415460)
/* 3A2338 E00A00A8 08028034 */ j .LE00A00D0
/* 3A233C E00A00AC 346340E6 */ ori $v1, $v1, (0xFF4040E6 & 0xFFFF)
.LE00A00B0:
/* 3A2340 E00A00B0 3C035050 */ lui $v1, (0x5050FFE6 >> 16)
/* 3A2344 E00A00B4 3463FFE6 */ ori $v1, $v1, (0x5050FFE6 & 0xFFFF)
/* 3A2348 E00A00B8 24A20010 */ addiu $v0, $a1, 0x10
/* 3A234C E00A00BC ACC20000 */ sw $v0, 0x0($a2)
/* 3A2350 E00A00C0 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 3A2354 E00A00C4 ACA20008 */ sw $v0, 0x8($a1)
/* 3A2358 E00A00C8 3C020900 */ lui $v0, %hi(D_090004A8_415508)
/* 3A235C E00A00CC 244204A8 */ addiu $v0, $v0, %lo(D_090004A8_415508)
.LE00A00D0:
/* 3A2360 E00A00D0 ACA2000C */ sw $v0, 0xC($a1)
/* 3A2364 E00A00D4 24A20018 */ addiu $v0, $a1, 0x18
/* 3A2368 E00A00D8 ACC20000 */ sw $v0, 0x0($a2)
/* 3A236C E00A00DC 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 3A2370 E00A00E0 ACA20010 */ sw $v0, 0x10($a1)
/* 3A2374 E00A00E4 ACA30014 */ sw $v1, 0x14($a1)
/* 3A2378 E00A00E8 3C070050 */ lui $a3, (0x5003C0 >> 16)
/* 3A237C E00A00EC 34E703C0 */ ori $a3, $a3, (0x5003C0 & 0xFFFF)
/* 3A2380 E00A00F0 3C09E430 */ lui $t1, (0xE4300230 >> 16)
/* 3A2384 E00A00F4 35290230 */ ori $t1, $t1, (0xE4300230 & 0xFFFF)
/* 3A2388 E00A00F8 3C080020 */ lui $t0, (0x200130 >> 16)
/* 3A238C E00A00FC 35080130 */ ori $t0, $t0, (0x200130 & 0xFFFF)
/* 3A2390 E00A0100 3C0A0400 */ lui $t2, (0x4000400 >> 16)
/* 3A2394 E00A0104 354A0400 */ ori $t2, $t2, (0x4000400 & 0xFFFF)
/* 3A2398 E00A0108 3C05800A */ lui $a1, %hi(gMainGfxPos)
/* 3A239C E00A010C 24A5A66C */ addiu $a1, $a1, %lo(gMainGfxPos)
/* 3A23A0 E00A0110 0160202D */ daddu $a0, $t3, $zero
/* 3A23A4 E00A0114 8CA20000 */ lw $v0, 0x0($a1)
/* 3A23A8 E00A0118 3C03ED00 */ lui $v1, (0xED000000 >> 16)
/* 3A23AC E00A011C 0040302D */ daddu $a2, $v0, $zero
/* 3A23B0 E00A0120 24420008 */ addiu $v0, $v0, 0x8
/* 3A23B4 E00A0124 ACA20000 */ sw $v0, 0x0($a1)
/* 3A23B8 E00A0128 ACC30000 */ sw $v1, 0x0($a2)
/* 3A23BC E00A012C 24430008 */ addiu $v1, $v0, 0x8
/* 3A23C0 E00A0130 ACC70004 */ sw $a3, 0x4($a2)
/* 3A23C4 E00A0134 ACA30000 */ sw $v1, 0x0($a1)
/* 3A23C8 E00A0138 24430010 */ addiu $v1, $v0, 0x10
/* 3A23CC E00A013C AC490000 */ sw $t1, 0x0($v0)
/* 3A23D0 E00A0140 AC480004 */ sw $t0, 0x4($v0)
/* 3A23D4 E00A0144 ACA30000 */ sw $v1, 0x0($a1)
/* 3A23D8 E00A0148 3C03E100 */ lui $v1, (0xE1000000 >> 16)
/* 3A23DC E00A014C AC430008 */ sw $v1, 0x8($v0)
/* 3A23E0 E00A0150 24030400 */ addiu $v1, $zero, 0x400
/* 3A23E4 E00A0154 AC43000C */ sw $v1, 0xC($v0)
/* 3A23E8 E00A0158 24430018 */ addiu $v1, $v0, 0x18
/* 3A23EC E00A015C ACA30000 */ sw $v1, 0x0($a1)
/* 3A23F0 E00A0160 3C03F100 */ lui $v1, (0xF1000000 >> 16)
/* 3A23F4 E00A0164 AC430010 */ sw $v1, 0x10($v0)
/* 3A23F8 E00A0168 24430020 */ addiu $v1, $v0, 0x20
/* 3A23FC E00A016C AC4A0014 */ sw $t2, 0x14($v0)
/* 3A2400 E00A0170 ACA30000 */ sw $v1, 0x0($a1)
/* 3A2404 E00A0174 3C03E700 */ lui $v1, (0xE7000000 >> 16)
/* 3A2408 E00A0178 AC430018 */ sw $v1, 0x18($v0)
/* 3A240C E00A017C 24430028 */ addiu $v1, $v0, 0x28
/* 3A2410 E00A0180 AC40001C */ sw $zero, 0x1C($v0)
/* 3A2414 E00A0184 ACA30000 */ sw $v1, 0x0($a1)
/* 3A2418 E00A0188 3C03DB06 */ lui $v1, (0xDB060000 >> 16)
/* 3A241C E00A018C AC430020 */ sw $v1, 0x20($v0)
/* 3A2420 E00A0190 0C080128 */ jal shim_remove_effect
/* 3A2424 E00A0194 AC400024 */ sw $zero, 0x24($v0)
/* 3A2428 E00A0198 8FBF002C */ lw $ra, 0x2C($sp)
/* 3A242C E00A019C 8FB00028 */ lw $s0, 0x28($sp)
/* 3A2430 E00A01A0 0000102D */ daddu $v0, $zero, $zero
/* 3A2434 E00A01A4 03E00008 */ jr $ra
/* 3A2438 E00A01A8 27BD0030 */ addiu $sp, $sp, 0x30
/* 3A243C E00A01AC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
EffectInstance* quizmo_answer_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
EffectInstance* effect;
bp.unk_00 = 0;
bp.init = NULL;
bp.update = NULL;
bp.renderWorld = NULL;
bp.renderUI = NULL;
bp.effectID = EFFECT_QUIZMO_ANSWER;
effect = shim_create_effect_instance(&bp);
effect->data.quizmoAnswer = NULL;
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data));
if (arg0 == 0) {
gSPDisplayList(gMainGfxPos++, D_09000400_3A2840);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 64, 64, 230);
} else {
gSPDisplayList(gMainGfxPos++, D_090004A8_3A28E8);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 80, 80, 255, 230);
}
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, 320, 240);
gSPTextureRectangle(gMainGfxPos++, 512, 304, 768, 560, G_TX_RENDERTILE, 0, 1024, 1024, 1024);
gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x00, NULL);
shim_remove_effect(effect);
return NULL;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel action_update_peach_land
/* E24BEC 802B62CC 27BDFFD8 */ addiu $sp, $sp, -0x28
Munchlesia_LaunchVelocity:
/* E24BF0 802B62D0 AFB1001C */ sw $s1, 0x1C($sp)
Munchlesia_LateralVelocity:
/* E24BF4 802B62D4 3C118016 */ lui $s1, %hi(gCollisionStatus)
Munchlesia_LaunchAccel:
/* E24BF8 802B62D8 2631A550 */ addiu $s1, $s1, %lo(gCollisionStatus)
Munchlesia_LaunchYaw:
/* E24BFC 802B62DC AFB00018 */ sw $s0, 0x18($sp)
D_802B62E0:
/* E24C00 802B62E0 3C108011 */ lui $s0, %hi(gPlayerStatus)
.L802B62E4:
/* E24C04 802B62E4 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* E24C08 802B62E8 AFBF0024 */ sw $ra, 0x24($sp)
/* E24C0C 802B62EC AFB20020 */ sw $s2, 0x20($sp)
/* E24C10 802B62F0 8E030000 */ lw $v1, 0x0($s0)
/* E24C14 802B62F4 0461001A */ bgez $v1, D_802B6360
glabel func_802B62F8
/* E24C18 802B62F8 0220902D */ daddu $s2, $s1, $zero
.L802B62FC:
/* E24C1C 802B62FC 3C027FFF */ lui $v0, (0x7FFFFFFF >> 16)
D_802B6300:
/* E24C20 802B6300 3442FFFF */ ori $v0, $v0, (0x7FFFFFFF & 0xFFFF)
/* E24C24 802B6304 24040148 */ addiu $a0, $zero, 0x148
.L802B6308:
/* E24C28 802B6308 0000282D */ daddu $a1, $zero, $zero
.L802B630C:
/* E24C2C 802B630C 00621024 */ and $v0, $v1, $v0
.L802B6310:
/* E24C30 802B6310 C6000028 */ lwc1 $f0, 0x28($s0)
/* E24C34 802B6314 C6020030 */ lwc1 $f2, 0x30($s0)
/* E24C38 802B6318 2403FFF1 */ addiu $v1, $zero, -0xF
glabel .L802B631C
/* E24C3C 802B631C AE020000 */ sw $v0, 0x0($s0)
.L802B6320:
/* E24C40 802B6320 00431024 */ and $v0, $v0, $v1
glabel .L802B6324
/* E24C44 802B6324 A20000B6 */ sb $zero, 0xB6($s0)
.L802B6328:
/* E24C48 802B6328 A60000C0 */ sh $zero, 0xC0($s0)
glabel .L802B632C
/* E24C4C 802B632C A60000C2 */ sh $zero, 0xC2($s0)
.L802B6330:
/* E24C50 802B6330 AE020000 */ sw $v0, 0x0($s0)
/* E24C54 802B6334 E6000044 */ swc1 $f0, 0x44($s0)
.L802B6338:
/* E24C58 802B6338 0C052736 */ jal sfx_play_sound_at_player
/* E24C5C 802B633C E6020048 */ swc1 $f2, 0x48($s0)
.L802B6340:
/* E24C60 802B6340 96220002 */ lhu $v0, 0x2($s1)
/* E24C64 802B6344 30424000 */ andi $v0, $v0, 0x4000
glabel func_802B6348
/* E24C68 802B6348 14400004 */ bnez $v0, .L802B635C
/* E24C6C 802B634C 2402FFFF */ addiu $v0, $zero, -0x1
PlayerTweesterPhysicsPtr:
/* E24C70 802B6350 0C03954C */ jal phys_adjust_cam_on_landing
glabel .L802B6354
/* E24C74 802B6354 00000000 */ nop
/* E24C78 802B6358 2402FFFF */ addiu $v0, $zero, -0x1
.L802B635C:
/* E24C7C 802B635C A6420004 */ sh $v0, 0x4($s2)
D_802B6360:
/* E24C80 802B6360 C6000054 */ lwc1 $f0, 0x54($s0)
.L802B6364:
/* E24C84 802B6364 3C013F19 */ lui $at, (0x3F19999A >> 16)
/* E24C88 802B6368 3421999A */ ori $at, $at, (0x3F19999A & 0xFFFF)
.L802B636C:
/* E24C8C 802B636C 44811000 */ mtc1 $at, $f2
glabel .L802B6370
/* E24C90 802B6370 27A40010 */ addiu $a0, $sp, 0x10
.L802B6374:
/* E24C94 802B6374 46020002 */ mul.s $f0, $f0, $f2
/* E24C98 802B6378 00000000 */ nop
glabel .L802B637C
/* E24C9C 802B637C 920200B6 */ lbu $v0, 0xB6($s0)
/* E24CA0 802B6380 27A50014 */ addiu $a1, $sp, 0x14
/* E24CA4 802B6384 24420001 */ addiu $v0, $v0, 0x1
/* E24CA8 802B6388 A20200B6 */ sb $v0, 0xB6($s0)
/* E24CAC 802B638C 0C0388C1 */ jal player_input_to_move_vector
/* E24CB0 802B6390 E6000054 */ swc1 $f0, 0x54($s0)
glabel .L802B6394
/* E24CB4 802B6394 C7A00014 */ lwc1 $f0, 0x14($sp)
.L802B6398:
/* E24CB8 802B6398 44801000 */ mtc1 $zero, $f2
.L802B639C:
/* E24CBC 802B639C 00000000 */ nop
/* E24CC0 802B63A0 46020032 */ c.eq.s $f0, $f2
/* E24CC4 802B63A4 00000000 */ nop
.L802B63A8:
/* E24CC8 802B63A8 45010020 */ bc1t .L802B642C
.L802B63AC:
/* E24CCC 802B63AC 0000202D */ daddu $a0, $zero, $zero
glabel .L802B63B0
/* E24CD0 802B63B0 45010003 */ bc1t .L802B63C0
/* E24CD4 802B63B4 00000000 */ nop
/* E24CD8 802B63B8 C7A00010 */ lwc1 $f0, 0x10($sp)
/* E24CDC 802B63BC E6000080 */ swc1 $f0, 0x80($s0)
.L802B63C0:
/* E24CE0 802B63C0 8E0200E8 */ lw $v0, 0xE8($s0)
.L802B63C4:
/* E24CE4 802B63C4 00420018 */ mult $v0, $v0
.L802B63C8:
/* E24CE8 802B63C8 00001812 */ mflo $v1
.L802B63CC:
/* E24CEC 802B63CC 8E0200EC */ lw $v0, 0xEC($s0)
.L802B63D0:
/* E24CF0 802B63D0 00000000 */ nop
glabel action_update_first_strike
/* E24CF4 802B63D4 00420018 */ mult $v0, $v0
.L802B63D8:
/* E24CF8 802B63D8 00003812 */ mflo $a3
glabel .L802B63DC
/* E24CFC 802B63DC 00671021 */ addu $v0, $v1, $a3
.L802B63E0:
/* E24D00 802B63E0 44826000 */ mtc1 $v0, $f12
.L802B63E4:
/* E24D04 802B63E4 00000000 */ nop
/* E24D08 802B63E8 46806320 */ cvt.s.w $f12, $f12
/* E24D0C 802B63EC 46006084 */ sqrt.s $f2, $f12
.L802B63F0:
/* E24D10 802B63F0 46021032 */ c.eq.s $f2, $f2
.L802B63F4:
/* E24D14 802B63F4 00000000 */ nop
/* E24D18 802B63F8 45010004 */ bc1t .L802B640C
/* E24D1C 802B63FC 00000000 */ nop
.L802B6400:
/* E24D20 802B6400 0C0187BC */ jal sqrtf
/* E24D24 802B6404 00000000 */ nop
/* E24D28 802B6408 46000086 */ mov.s $f2, $f0
.L802B640C:
/* E24D2C 802B640C 3C01425C */ lui $at, (0x425C0000 >> 16)
/* E24D30 802B6410 44810000 */ mtc1 $at, $f0
.L802B6414:
/* E24D34 802B6414 00000000 */ nop
.L802B6418:
/* E24D38 802B6418 4602003C */ c.lt.s $f0, $f2
/* E24D3C 802B641C 00000000 */ nop
.L802B6420:
/* E24D40 802B6420 45000002 */ bc1f .L802B642C
.L802B6424:
/* E24D44 802B6424 24040001 */ addiu $a0, $zero, 0x1
.L802B6428:
/* E24D48 802B6428 24040002 */ addiu $a0, $zero, 0x2
.L802B642C:
/* E24D4C 802B642C 0C039769 */ jal set_action_state
D_802B6430:
/* E24D50 802B6430 00000000 */ nop
/* E24D54 802B6434 8FBF0024 */ lw $ra, 0x24($sp)
/* E24D58 802B6438 8FB20020 */ lw $s2, 0x20($sp)
/* E24D5C 802B643C 8FB1001C */ lw $s1, 0x1C($sp)
/* E24D60 802B6440 8FB00018 */ lw $s0, 0x18($sp)
/* E24D64 802B6444 03E00008 */ jr $ra
.L802B6448:
/* E24D68 802B6448 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void action_update_peach_land(void) {
CollisionStatus* collisionStatus = &gCollisionStatus;
PlayerStatus* playerStatus = &gPlayerStatus;
f32 inputMoveMagnitude;
f32 inputMoveAngle;
if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
playerStatus->actionSubstate = SUBSTATE_INIT;
playerStatus->timeInAir = 0;
playerStatus->peakJumpTime = 0;
playerStatus->flags &= ~PS_FLAG_AIRBORNE;
playerStatus->landPos.x = playerStatus->position.x;
playerStatus->landPos.z = playerStatus->position.z;
sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0);
if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
phys_adjust_cam_on_landing();
}
collisionStatus->lastTouchedFloor = -1;
}
playerStatus->actionSubstate++; // SUBSTATE_DONE
playerStatus->currentSpeed *= 0.6f;
player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude);
if (inputMoveMagnitude == 0.0f) {
set_action_state(ACTION_STATE_IDLE);
} else {
if (inputMoveMagnitude != 0.0f) {
playerStatus->targetYaw = inputMoveAngle;
}
if (sqrtf(SQ(playerStatus->stickAxis[0]) + SQ(playerStatus->stickAxis[1])) > 55.0f) {
set_action_state(ACTION_STATE_RUN);
} else {
set_action_state(ACTION_STATE_WALK);
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel create_battle_popup_menu
/* 8E5EC 800F513C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 8E5F0 800F5140 AFB00010 */ sw $s0, 0x10($sp)
/* 8E5F4 800F5144 3C108011 */ lui $s0, %hi(gPopupMenu)
/* 8E5F8 800F5148 2610D69C */ addiu $s0, $s0, %lo(gPopupMenu)
/* 8E5FC 800F514C AFBF0014 */ sw $ra, 0x14($sp)
/* 8E600 800F5150 AE040000 */ sw $a0, 0x0($s0)
/* 8E604 800F5154 90820323 */ lbu $v0, 0x323($a0)
/* 8E608 800F5158 A480032C */ sh $zero, 0x32C($a0)
/* 8E60C 800F515C 3C018011 */ lui $at, %hi(D_8010D693)
/* 8E610 800F5160 A022D693 */ sb $v0, %lo(D_8010D693)($at)
/* 8E614 800F5164 0C03A635 */ jal func_800E98D4
/* 8E618 800F5168 00000000 */ nop
/* 8E61C 800F516C 3C048011 */ lui $a0, %hi(PopupDipMode)
/* 8E620 800F5170 2484D699 */ addiu $a0, $a0, %lo(PopupDipMode)
/* 8E624 800F5174 3C018011 */ lui $at, %hi(D_8010D69A)
/* 8E628 800F5178 A022D69A */ sb $v0, %lo(D_8010D69A)($at)
/* 8E62C 800F517C A0800000 */ sb $zero, 0x0($a0)
/* 8E630 800F5180 8E100000 */ lw $s0, 0x0($s0)
/* 8E634 800F5184 3C068011 */ lui $a2, %hi(PopupNotDipping)
/* 8E638 800F5188 24C6D698 */ addiu $a2, $a2, %lo(PopupNotDipping)
/* 8E63C 800F518C 8E030318 */ lw $v1, 0x318($s0)
/* 8E640 800F5190 24050001 */ addiu $a1, $zero, 0x1
/* 8E644 800F5194 28620064 */ slti $v0, $v1, 0x64
/* 8E648 800F5198 1440000C */ bnez $v0, .L800F51CC
/* 8E64C 800F519C A0C50000 */ sb $a1, 0x0($a2)
/* 8E650 800F51A0 2462FF9C */ addiu $v0, $v1, -0x64
/* 8E654 800F51A4 AE020318 */ sw $v0, 0x318($s0)
/* 8E658 800F51A8 0040182D */ daddu $v1, $v0, $zero
/* 8E65C 800F51AC 28620064 */ slti $v0, $v1, 0x64
/* 8E660 800F51B0 14400005 */ bnez $v0, .L800F51C8
/* 8E664 800F51B4 A0850000 */ sb $a1, 0x0($a0)
/* 8E668 800F51B8 2462FF9C */ addiu $v0, $v1, -0x64
/* 8E66C 800F51BC AE020318 */ sw $v0, 0x318($s0)
/* 8E670 800F51C0 24020002 */ addiu $v0, $zero, 0x2
/* 8E674 800F51C4 A0820000 */ sb $v0, 0x0($a0)
.L800F51C8:
/* 8E678 800F51C8 A0C00000 */ sb $zero, 0x0($a2)
.L800F51CC:
/* 8E67C 800F51CC 3C058011 */ lui $a1, %hi(gPopupMenu)
/* 8E680 800F51D0 8CA5D69C */ lw $a1, %lo(gPopupMenu)($a1)
/* 8E684 800F51D4 24020006 */ addiu $v0, $zero, 0x6
/* 8E688 800F51D8 3C018011 */ lui $at, %hi(PopupMenu_MaxDisplayableEntryCount)
/* 8E68C 800F51DC A022D68F */ sb $v0, %lo(PopupMenu_MaxDisplayableEntryCount)($at)
/* 8E690 800F51E0 8CA20328 */ lw $v0, 0x328($a1)
/* 8E694 800F51E4 8CA40324 */ lw $a0, 0x324($a1)
/* 8E698 800F51E8 3C038011 */ lui $v1, %hi(PopupMenu_SelectedIndex)
/* 8E69C 800F51EC 2463D648 */ addiu $v1, $v1, %lo(PopupMenu_SelectedIndex)
/* 8E6A0 800F51F0 3C018011 */ lui $at, %hi(PopupNotBattle)
/* 8E6A4 800F51F4 A020D68E */ sb $zero, %lo(PopupNotBattle)($at)
/* 8E6A8 800F51F8 3C018011 */ lui $at, %hi(gPopupState)
/* 8E6AC 800F51FC AC20D640 */ sw $zero, %lo(gPopupState)($at)
/* 8E6B0 800F5200 AC620000 */ sw $v0, 0x0($v1)
/* 8E6B4 800F5204 0044102A */ slt $v0, $v0, $a0
/* 8E6B8 800F5208 14400002 */ bnez $v0, .L800F5214
/* 8E6BC 800F520C 2482FFFF */ addiu $v0, $a0, -0x1
/* 8E6C0 800F5210 AC620000 */ sw $v0, 0x0($v1)
.L800F5214:
/* 8E6C4 800F5214 8C620000 */ lw $v0, 0x0($v1)
/* 8E6C8 800F5218 3C048011 */ lui $a0, %hi(PopupMenu_DisplayedEntryCount)
/* 8E6CC 800F521C 2484D656 */ addiu $a0, $a0, %lo(PopupMenu_DisplayedEntryCount)
/* 8E6D0 800F5220 3C018011 */ lui $at, %hi(PopupMenu_FirstDisplayIndex)
/* 8E6D4 800F5224 A020D654 */ sb $zero, %lo(PopupMenu_FirstDisplayIndex)($at)
/* 8E6D8 800F5228 3C018011 */ lui $at, %hi(PopupMenu_PrevSelectedIndex)
/* 8E6DC 800F522C AC22D64C */ sw $v0, %lo(PopupMenu_PrevSelectedIndex)($at)
/* 8E6E0 800F5230 90A20327 */ lbu $v0, 0x327($a1)
/* 8E6E4 800F5234 24030006 */ addiu $v1, $zero, 0x6
/* 8E6E8 800F5238 A0820000 */ sb $v0, 0x0($a0)
/* 8E6EC 800F523C 00021600 */ sll $v0, $v0, 24
/* 8E6F0 800F5240 00021603 */ sra $v0, $v0, 24
/* 8E6F4 800F5244 0062102A */ slt $v0, $v1, $v0
/* 8E6F8 800F5248 54400001 */ bnel $v0, $zero, .L800F5250
/* 8E6FC 800F524C A0830000 */ sb $v1, 0x0($a0)
.L800F5250:
/* 8E700 800F5250 8CA20324 */ lw $v0, 0x324($a1)
/* 8E704 800F5254 3C048011 */ lui $a0, %hi(PopupMenu_LastDisplayIndex)
/* 8E708 800F5258 2484D655 */ addiu $a0, $a0, %lo(PopupMenu_LastDisplayIndex)
/* 8E70C 800F525C 28420006 */ slti $v0, $v0, 0x6
/* 8E710 800F5260 10400003 */ beqz $v0, .L800F5270
/* 8E714 800F5264 A0830000 */ sb $v1, 0x0($a0)
/* 8E718 800F5268 90A20327 */ lbu $v0, 0x327($a1)
/* 8E71C 800F526C A0820000 */ sb $v0, 0x0($a0)
.L800F5270:
/* 8E720 800F5270 240200FF */ addiu $v0, $zero, 0xFF
/* 8E724 800F5274 3C018011 */ lui $at, %hi(PopupMenu_Alpha)
/* 8E728 800F5278 AC22D650 */ sw $v0, %lo(PopupMenu_Alpha)($at)
/* 8E72C 800F527C 24020009 */ addiu $v0, $zero, 0x9
/* 8E730 800F5280 3C018011 */ lui $at, %hi(D_8010D691)
/* 8E734 800F5284 A022D691 */ sb $v0, %lo(D_8010D691)($at)
/* 8E738 800F5288 24020002 */ addiu $v0, $zero, 0x2
/* 8E73C 800F528C 3C04800F */ lui $a0, %hi(popup_menu_update)
/* 8E740 800F5290 24841A10 */ addiu $a0, $a0, %lo(popup_menu_update)
/* 8E744 800F5294 3C018011 */ lui $at, %hi(D_8010D692)
/* 8E748 800F5298 A022D692 */ sb $v0, %lo(D_8010D692)($at)
/* 8E74C 800F529C 0C048C8F */ jal create_worker_frontUI
/* 8E750 800F52A0 0000282D */ daddu $a1, $zero, $zero
/* 8E754 800F52A4 8FBF0014 */ lw $ra, 0x14($sp)
/* 8E758 800F52A8 8FB00010 */ lw $s0, 0x10($sp)
/* 8E75C 800F52AC 3C018011 */ lui $at, %hi(gPopupWorker)
/* 8E760 800F52B0 AC22D694 */ sw $v0, %lo(gPopupWorker)($at)
/* 8E764 800F52B4 03E00008 */ jr $ra
/* 8E768 800F52B8 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void create_battle_popup_menu(PopupMenu* popup) {
gPopupMenu = popup;
popup->result = POPUP_RESULT_CHOOSING;
D_8010D693 = popup->titleNumber;
D_8010D69A = func_800E98D4();
PopupDipMode = 0;
PopupNotDipping = TRUE;
if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) {
gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP;
PopupDipMode = 1;
if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) {
gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP;
PopupDipMode = 2;
}
PopupNotDipping = FALSE;
}
PopupNotBattle = FALSE;
PopupMenu_MaxDisplayableEntryCount = 6;
gPopupState = POPUP_STATE_INIT;
PopupMenu_SelectedIndex = gPopupMenu->initialPos;
if (PopupMenu_SelectedIndex >= gPopupMenu->numEntries) {
PopupMenu_SelectedIndex = gPopupMenu->numEntries - 1;
}
PopupMenu_FirstDisplayIndex = 0;
PopupMenu_PrevSelectedIndex = PopupMenu_SelectedIndex;
PopupMenu_DisplayedEntryCount = gPopupMenu->numEntries;
if (PopupMenu_DisplayedEntryCount > PopupMenu_MaxDisplayableEntryCount) {
PopupMenu_DisplayedEntryCount = PopupMenu_MaxDisplayableEntryCount;
}
PopupMenu_LastDisplayIndex = PopupMenu_MaxDisplayableEntryCount;
if (gPopupMenu->numEntries < PopupMenu_MaxDisplayableEntryCount) {
PopupMenu_LastDisplayIndex = gPopupMenu->numEntries;
}
PopupMenu_Alpha = 255;
D_8010D691 = 9;
D_8010D692 = 2;
gPopupWorker = create_worker_frontUI((void (*) (void)) popup_menu_update, NULL);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel partner_walking_enable
/* 84D58 800EB8A8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 84D5C 800EB8AC AFB00010 */ sw $s0, 0x10($sp)
/* 84D60 800EB8B0 0080802D */ daddu $s0, $a0, $zero
/* 84D64 800EB8B4 3C078011 */ lui $a3, %hi(gPlayerStatus)
/* 84D68 800EB8B8 24E7EFC8 */ addiu $a3, $a3, %lo(gPlayerStatus)
/* 84D6C 800EB8BC 3C048011 */ lui $a0, %hi(D_8010CD38)
/* 84D70 800EB8C0 2484CD38 */ addiu $a0, $a0, %lo(D_8010CD38)
/* 84D74 800EB8C4 0000302D */ daddu $a2, $zero, $zero
/* 84D78 800EB8C8 3C018010 */ lui $at, %hi(wSavedPartnerPosX)
/* 84D7C 800EB8CC C420833C */ lwc1 $f0, %lo(wSavedPartnerPosX)($at)
/* 84D80 800EB8D0 3C018010 */ lui $at, %hi(wSavedPartnerPosY)
/* 84D84 800EB8D4 C4228340 */ lwc1 $f2, %lo(wSavedPartnerPosY)($at)
/* 84D88 800EB8D8 3C018010 */ lui $at, %hi(wSavedPartnerPosZ)
/* 84D8C 800EB8DC C4248344 */ lwc1 $f4, %lo(wSavedPartnerPosZ)($at)
/* 84D90 800EB8E0 2483000C */ addiu $v1, $a0, 0xC
/* 84D94 800EB8E4 AFBF0014 */ sw $ra, 0x14($sp)
/* 84D98 800EB8E8 E6000038 */ swc1 $f0, 0x38($s0)
/* 84D9C 800EB8EC E602003C */ swc1 $f2, 0x3C($s0)
/* 84DA0 800EB8F0 E6040040 */ swc1 $f4, 0x40($s0)
.L800EB8F4:
/* 84DA4 800EB8F4 C4E00028 */ lwc1 $f0, 0x28($a3)
/* 84DA8 800EB8F8 E460FFF8 */ swc1 $f0, -0x8($v1)
/* 84DAC 800EB8FC C4E0002C */ lwc1 $f0, 0x2C($a3)
/* 84DB0 800EB900 24C60001 */ addiu $a2, $a2, 0x1
/* 84DB4 800EB904 E460FFFC */ swc1 $f0, -0x4($v1)
/* 84DB8 800EB908 C4E00030 */ lwc1 $f0, 0x30($a3)
/* 84DBC 800EB90C 28C20028 */ slti $v0, $a2, 0x28
/* 84DC0 800EB910 E4600000 */ swc1 $f0, 0x0($v1)
/* 84DC4 800EB914 24630010 */ addiu $v1, $v1, 0x10
/* 84DC8 800EB918 A0800000 */ sb $zero, 0x0($a0)
/* 84DCC 800EB91C 1440FFF5 */ bnez $v0, .L800EB8F4
/* 84DD0 800EB920 24840010 */ addiu $a0, $a0, 0x10
/* 84DD4 800EB924 3C038011 */ lui $v1, %hi(D_8010CFCA)
/* 84DD8 800EB928 2463CFCA */ addiu $v1, $v1, %lo(D_8010CFCA)
/* 84DDC 800EB92C 3C018011 */ lui $at, %hi(gPlayerMoveHistoryIndex)
/* 84DE0 800EB930 AC20CFB8 */ sw $zero, %lo(gPlayerMoveHistoryIndex)($at)
/* 84DE4 800EB934 3C018011 */ lui $at, %hi(D_8010CFBC)
/* 84DE8 800EB938 AC20CFBC */ sw $zero, %lo(D_8010CFBC)($at)
/* 84DEC 800EB93C 10A00003 */ beqz $a1, .L800EB94C
/* 84DF0 800EB940 24020002 */ addiu $v0, $zero, 0x2
/* 84DF4 800EB944 0803AE54 */ j .L800EB950
/* 84DF8 800EB948 A4620000 */ sh $v0, 0x0($v1)
.L800EB94C:
/* 84DFC 800EB94C A4600000 */ sh $zero, 0x0($v1)
.L800EB950:
/* 84E00 800EB950 3C048011 */ lui $a0, %hi(wPartnerFollowState)
/* 84E04 800EB954 2484CFC8 */ addiu $a0, $a0, %lo(wPartnerFollowState)
/* 84E08 800EB958 3C058011 */ lui $a1, %hi(D_8010CFC4)
/* 84E0C 800EB95C 24A5CFC4 */ addiu $a1, $a1, %lo(D_8010CFC4)
/* 84E10 800EB960 A4800000 */ sh $zero, 0x0($a0)
/* 84E14 800EB964 8CA30000 */ lw $v1, 0x0($a1)
/* 84E18 800EB968 24020001 */ addiu $v0, $zero, 0x1
/* 84E1C 800EB96C 10620003 */ beq $v1, $v0, .L800EB97C
/* 84E20 800EB970 24020003 */ addiu $v0, $zero, 0x3
/* 84E24 800EB974 14620006 */ bne $v1, $v0, .L800EB990
/* 84E28 800EB978 24020002 */ addiu $v0, $zero, 0x2
.L800EB97C:
/* 84E2C 800EB97C ACA00000 */ sw $zero, 0x0($a1)
/* 84E30 800EB980 3C018011 */ lui $at, %hi(D_8010CFCA)
/* 84E34 800EB984 A420CFCA */ sh $zero, %lo(D_8010CFCA)($at)
/* 84E38 800EB988 0803AE69 */ j .L800EB9A4
/* 84E3C 800EB98C A4800000 */ sh $zero, 0x0($a0)
.L800EB990:
/* 84E40 800EB990 14620004 */ bne $v1, $v0, .L800EB9A4
/* 84E44 800EB994 24020032 */ addiu $v0, $zero, 0x32
/* 84E48 800EB998 3C018011 */ lui $at, %hi(D_8010CFCA)
/* 84E4C 800EB99C A420CFCA */ sh $zero, %lo(D_8010CFCA)($at)
/* 84E50 800EB9A0 A4820000 */ sh $v0, 0x0($a0)
.L800EB9A4:
/* 84E54 800EB9A4 3C038011 */ lui $v1, %hi(wCurrentPartnerId)
/* 84E58 800EB9A8 8C63CFD8 */ lw $v1, %lo(wCurrentPartnerId)($v1)
/* 84E5C 800EB9AC 3C014220 */ lui $at, (0x42200000 >> 16)
/* 84E60 800EB9B0 44810000 */ mtc1 $at, $f0
/* 84E64 800EB9B4 0200202D */ daddu $a0, $s0, $zero
/* 84E68 800EB9B8 3C018011 */ lui $at, %hi(D_8010CFCE)
/* 84E6C 800EB9BC A420CFCE */ sh $zero, %lo(D_8010CFCE)($at)
/* 84E70 800EB9C0 3C018011 */ lui $at, %hi(D_8010CFCC)
/* 84E74 800EB9C4 A420CFCC */ sh $zero, %lo(D_8010CFCC)($at)
/* 84E78 800EB9C8 000310C0 */ sll $v0, $v1, 3
/* 84E7C 800EB9CC 00431021 */ addu $v0, $v0, $v1
/* 84E80 800EB9D0 00021080 */ sll $v0, $v0, 2
/* 84E84 800EB9D4 3C038010 */ lui $v1, %hi(gPartnerAnimations + 0x14)
/* 84E88 800EB9D8 00621821 */ addu $v1, $v1, $v0
/* 84E8C 800EB9DC 8C63835C */ lw $v1, %lo(gPartnerAnimations + 0x14)($v1)
/* 84E90 800EB9E0 24020010 */ addiu $v0, $zero, 0x10
/* 84E94 800EB9E4 3C018010 */ lui $at, %hi(wPartnerMoveTime)
/* 84E98 800EB9E8 AC22802C */ sw $v0, %lo(wPartnerMoveTime)($at)
/* 84E9C 800EB9EC 3C018011 */ lui $at, %hi(wPartnerTetherDistance)
/* 84EA0 800EB9F0 E420CFC0 */ swc1 $f0, %lo(wPartnerTetherDistance)($at)
/* 84EA4 800EB9F4 0C03A96E */ jal func_800EA5B8
/* 84EA8 800EB9F8 AE030028 */ sw $v1, 0x28($s0)
/* 84EAC 800EB9FC 3C030040 */ lui $v1, (0x400300 >> 16)
/* 84EB0 800EBA00 3C020001 */ lui $v0, (0x10000 >> 16)
/* 84EB4 800EBA04 AE020080 */ sw $v0, 0x80($s0)
/* 84EB8 800EBA08 8E020000 */ lw $v0, 0x0($s0)
/* 84EBC 800EBA0C 3C013FE6 */ lui $at, (0x3FE66666 >> 16)
/* 84EC0 800EBA10 34216666 */ ori $at, $at, (0x3FE66666 & 0xFFFF)
/* 84EC4 800EBA14 44810000 */ mtc1 $at, $f0
/* 84EC8 800EBA18 34630300 */ ori $v1, $v1, (0x400300 & 0xFFFF)
/* 84ECC 800EBA1C AE00001C */ sw $zero, 0x1C($s0)
/* 84ED0 800EBA20 00431025 */ or $v0, $v0, $v1
/* 84ED4 800EBA24 AE020000 */ sw $v0, 0x0($s0)
/* 84ED8 800EBA28 E6000014 */ swc1 $f0, 0x14($s0)
/* 84EDC 800EBA2C 8FBF0014 */ lw $ra, 0x14($sp)
/* 84EE0 800EBA30 8FB00010 */ lw $s0, 0x10($sp)
/* 84EE4 800EBA34 03E00008 */ jr $ra
/* 84EE8 800EBA38 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void partner_walking_enable(Npc* partner, s32 val) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerPathElement* it = gPlayerMoveHistory;
s32 i;
partner->pos.x = wSavedPartnerPosX;
partner->pos.y = wSavedPartnerPosY;
partner->pos.z = wSavedPartnerPosZ;
for (i = 0; i < ARRAY_COUNT(gPlayerMoveHistory); i++, it++) {
it->pos.x = playerStatus->position.x;
it->pos.y = playerStatus->position.y;
it->pos.z = playerStatus->position.z;
it->isJumping = FALSE;
}
gPlayerMoveHistoryIndex = 0;
D_8010CFBC = 0;
D_8010CFCA = val ? 2 : 0;
wPartnerFollowState = 0;
if (D_8010CFC4 == 1 || D_8010CFC4 == 3) {
D_8010CFC4 = 0;
D_8010CFCA = 0;
wPartnerFollowState = 0;
} else if (D_8010CFC4 == 2) {
D_8010CFCA = 0;
wPartnerFollowState = 50;
}
D_8010CFCE = 0;
D_8010CFCC = 0;
wPartnerMoveTime = 16;
wPartnerTetherDistance = 40.0f;
partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle;
func_800EA5B8(partner);
partner->collisionChannel = COLLISION_CHANNEL_10000;
partner->jumpVelocity = 0.0f;
partner->flags |= NPC_FLAG_TOUCHES_GROUND | NPC_FLAG_GRAVITY | NPC_FLAG_IGNORE_PLAYER_COLLISION;
partner->jumpScale = 1.8f;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel btl_appendGfx_prim_quad
/* 19615C 8026787C 27BDFFF8 */ addiu $sp, $sp, -0x8
/* 196160 80267880 0080602D */ daddu $t4, $a0, $zero
/* 196164 80267884 00A0682D */ daddu $t5, $a1, $zero
/* 196168 80267888 00E0582D */ daddu $t3, $a3, $zero
/* 19616C 8026788C 3C08800A */ lui $t0, %hi(gMainGfxPos)
/* 196170 80267890 2508A66C */ addiu $t0, $t0, %lo(gMainGfxPos)
/* 196174 80267894 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 196178 80267898 AFB00000 */ sw $s0, 0x0($sp)
/* 19617C 8026789C 8D070000 */ lw $a3, 0x0($t0)
/* 196180 802678A0 97B9001A */ lhu $t9, 0x1A($sp)
/* 196184 802678A4 97B0001E */ lhu $s0, 0x1E($sp)
/* 196188 802678A8 97AF0022 */ lhu $t7, 0x22($sp)
/* 19618C 802678AC 97B80026 */ lhu $t8, 0x26($sp)
/* 196190 802678B0 00E0182D */ daddu $v1, $a3, $zero
/* 196194 802678B4 24E70008 */ addiu $a3, $a3, 0x8
/* 196198 802678B8 AD070000 */ sw $a3, 0x0($t0)
/* 19619C 802678BC AC620000 */ sw $v0, 0x0($v1)
/* 1961A0 802678C0 24E20008 */ addiu $v0, $a3, 0x8
/* 1961A4 802678C4 AC600004 */ sw $zero, 0x4($v1)
/* 1961A8 802678C8 AD020000 */ sw $v0, 0x0($t0)
/* 1961AC 802678CC 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 1961B0 802678D0 ACE20000 */ sw $v0, 0x0($a3)
/* 1961B4 802678D4 3C028029 */ lui $v0, %hi(D_80293970)
/* 1961B8 802678D8 24423970 */ addiu $v0, $v0, %lo(D_80293970)
/* 1961BC 802678DC 316300FF */ andi $v1, $t3, 0xFF
/* 1961C0 802678E0 ACE20004 */ sw $v0, 0x4($a3)
/* 1961C4 802678E4 240200FF */ addiu $v0, $zero, 0xFF
/* 1961C8 802678E8 1462000A */ bne $v1, $v0, .L80267914
/* 1961CC 802678EC 00C0702D */ daddu $t6, $a2, $zero
/* 1961D0 802678F0 3C05E200 */ lui $a1, (0xE200001C >> 16)
/* 1961D4 802678F4 34A5001C */ ori $a1, $a1, (0xE200001C & 0xFFFF)
/* 1961D8 802678F8 3C030F0A */ lui $v1, (0xF0A4000 >> 16)
/* 1961DC 802678FC 34634000 */ ori $v1, $v1, (0xF0A4000 & 0xFFFF)
/* 1961E0 80267900 3C06FCFF */ lui $a2, (0xFCFFFFFF >> 16)
/* 1961E4 80267904 34C6FFFF */ ori $a2, $a2, (0xFCFFFFFF & 0xFFFF)
/* 1961E8 80267908 3C04FFFD */ lui $a0, (0xFFFDFCFE >> 16)
/* 1961EC 8026790C 08099E4D */ j .L80267934
/* 1961F0 80267910 3484FCFE */ ori $a0, $a0, (0xFFFDFCFE & 0xFFFF)
.L80267914:
/* 1961F4 80267914 3C05E200 */ lui $a1, (0xE200001C >> 16)
/* 1961F8 80267918 34A5001C */ ori $a1, $a1, (0xE200001C & 0xFFFF)
/* 1961FC 8026791C 3C030050 */ lui $v1, (0x504240 >> 16)
/* 196200 80267920 34634240 */ ori $v1, $v1, (0x504240 & 0xFFFF)
/* 196204 80267924 3C06FCFF */ lui $a2, (0xFCFFFFFF >> 16)
/* 196208 80267928 34C6FFFF */ ori $a2, $a2, (0xFCFFFFFF & 0xFFFF)
/* 19620C 8026792C 3C04FFFD */ lui $a0, (0xFFFDF6FB >> 16)
/* 196210 80267930 3484F6FB */ ori $a0, $a0, (0xFFFDF6FB & 0xFFFF)
.L80267934:
/* 196214 80267934 24E20010 */ addiu $v0, $a3, 0x10
/* 196218 80267938 AD020000 */ sw $v0, 0x0($t0)
/* 19621C 8026793C 24E20018 */ addiu $v0, $a3, 0x18
/* 196220 80267940 ACE50008 */ sw $a1, 0x8($a3)
/* 196224 80267944 ACE3000C */ sw $v1, 0xC($a3)
/* 196228 80267948 AD020000 */ sw $v0, 0x0($t0)
/* 19622C 8026794C ACE60010 */ sw $a2, 0x10($a3)
/* 196230 80267950 ACE40014 */ sw $a0, 0x14($a3)
/* 196234 80267954 3C09E200 */ lui $t1, (0xE200001C >> 16)
/* 196238 80267958 3529001C */ ori $t1, $t1, (0xE200001C & 0xFFFF)
/* 19623C 8026795C 3C070F0A */ lui $a3, (0xF0A7008 >> 16)
/* 196240 80267960 34E77008 */ ori $a3, $a3, (0xF0A7008 & 0xFFFF)
/* 196244 80267964 3C0AFCFF */ lui $t2, (0xFCFFFFFF >> 16)
/* 196248 80267968 354AFFFF */ ori $t2, $t2, (0xFCFFFFFF & 0xFFFF)
/* 19624C 8026796C 3C08FFFC */ lui $t0, (0xFFFCF279 >> 16)
/* 196250 80267970 3C06800A */ lui $a2, %hi(gMainGfxPos)
/* 196254 80267974 24C6A66C */ addiu $a2, $a2, %lo(gMainGfxPos)
/* 196258 80267978 3508F279 */ ori $t0, $t0, (0xFFFCF279 & 0xFFFF)
/* 19625C 8026797C 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 196260 80267980 8CC50000 */ lw $a1, 0x0($a2)
/* 196264 80267984 000C1E00 */ sll $v1, $t4, 24
/* 196268 80267988 00A0202D */ daddu $a0, $a1, $zero
/* 19626C 8026798C 24A50008 */ addiu $a1, $a1, 0x8
/* 196270 80267990 ACC50000 */ sw $a1, 0x0($a2)
/* 196274 80267994 AC820000 */ sw $v0, 0x0($a0)
/* 196278 80267998 31A200FF */ andi $v0, $t5, 0xFF
/* 19627C 8026799C 00021400 */ sll $v0, $v0, 16
/* 196280 802679A0 00621825 */ or $v1, $v1, $v0
/* 196284 802679A4 31C200FF */ andi $v0, $t6, 0xFF
/* 196288 802679A8 00021200 */ sll $v0, $v0, 8
/* 19628C 802679AC 00621825 */ or $v1, $v1, $v0
/* 196290 802679B0 316200FF */ andi $v0, $t3, 0xFF
/* 196294 802679B4 00621825 */ or $v1, $v1, $v0
/* 196298 802679B8 24A20008 */ addiu $v0, $a1, 0x8
/* 19629C 802679BC AC830004 */ sw $v1, 0x4($a0)
/* 1962A0 802679C0 31E403FF */ andi $a0, $t7, 0x3FF
/* 1962A4 802679C4 00042380 */ sll $a0, $a0, 14
/* 1962A8 802679C8 ACC20000 */ sw $v0, 0x0($a2)
/* 1962AC 802679CC 330203FF */ andi $v0, $t8, 0x3FF
/* 1962B0 802679D0 00021080 */ sll $v0, $v0, 2
/* 1962B4 802679D4 3C03F600 */ lui $v1, (0xF6000000 >> 16)
/* 1962B8 802679D8 00431025 */ or $v0, $v0, $v1
/* 1962BC 802679DC 00822025 */ or $a0, $a0, $v0
/* 1962C0 802679E0 332303FF */ andi $v1, $t9, 0x3FF
/* 1962C4 802679E4 00031B80 */ sll $v1, $v1, 14
/* 1962C8 802679E8 320203FF */ andi $v0, $s0, 0x3FF
/* 1962CC 802679EC 00021080 */ sll $v0, $v0, 2
/* 1962D0 802679F0 00621825 */ or $v1, $v1, $v0
/* 1962D4 802679F4 24A20010 */ addiu $v0, $a1, 0x10
/* 1962D8 802679F8 ACA40000 */ sw $a0, 0x0($a1)
/* 1962DC 802679FC ACA30004 */ sw $v1, 0x4($a1)
/* 1962E0 80267A00 ACC20000 */ sw $v0, 0x0($a2)
/* 1962E4 80267A04 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 1962E8 80267A08 ACA20008 */ sw $v0, 0x8($a1)
/* 1962EC 80267A0C 24A20018 */ addiu $v0, $a1, 0x18
/* 1962F0 80267A10 ACA0000C */ sw $zero, 0xC($a1)
/* 1962F4 80267A14 ACC20000 */ sw $v0, 0x0($a2)
/* 1962F8 80267A18 24A20020 */ addiu $v0, $a1, 0x20
/* 1962FC 80267A1C ACA90010 */ sw $t1, 0x10($a1)
/* 196300 80267A20 ACA70014 */ sw $a3, 0x14($a1)
/* 196304 80267A24 ACC20000 */ sw $v0, 0x0($a2)
/* 196308 80267A28 ACAA0018 */ sw $t2, 0x18($a1)
/* 19630C 80267A2C ACA8001C */ sw $t0, 0x1C($a1)
/* 196310 80267A30 8FB00000 */ lw $s0, 0x0($sp)
/* 196314 80267A34 03E00008 */ jr $ra
/* 196318 80267A38 27BD0008 */ addiu $sp, $sp, 0x8
### DECOMPILED C INSTRUCTIONS:
void btl_appendGfx_prim_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 right, u16 bottom) {
gDPPipeSync(gMainGfxPos++);
gSPDisplayList(gMainGfxPos++, D_80293970);
if (a == 255) {
gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08);
} else {
gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
}
gDPSetPrimColor(gMainGfxPos++, 0, 0, r, g, b, a);
gDPFillRectangle(gMainGfxPos++, left, top, right, bottom);
gDPPipeSync(gMainGfxPos++);
gDPSetRenderMode(gMainGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel render_transform_group_node
/* AE574 80117E74 27BDFFD8 */ addiu $sp, $sp, -0x28
/* AE578 80117E78 AFB20018 */ sw $s2, 0x18($sp)
/* AE57C 80117E7C 0080902D */ daddu $s2, $a0, $zero
/* AE580 80117E80 AFB3001C */ sw $s3, 0x1C($sp)
/* AE584 80117E84 3C13800A */ lui $s3, %hi(gMainGfxPos)
/* AE588 80117E88 2673A66C */ addiu $s3, $s3, %lo(gMainGfxPos)
/* AE58C 80117E8C AFBF0020 */ sw $ra, 0x20($sp)
/* AE590 80117E90 AFB10014 */ sw $s1, 0x14($sp)
/* AE594 80117E94 12400056 */ beqz $s2, .L80117FF0
/* AE598 80117E98 AFB00010 */ sw $s0, 0x10($sp)
/* AE59C 80117E9C 8E430000 */ lw $v1, 0x0($s2)
/* AE5A0 80117EA0 24020005 */ addiu $v0, $zero, 0x5
/* AE5A4 80117EA4 14620017 */ bne $v1, $v0, .L80117F04
/* AE5A8 80117EA8 24020002 */ addiu $v0, $zero, 0x2
/* AE5AC 80117EAC 0C0456C3 */ jal get_model_property
/* AE5B0 80117EB0 24050060 */ addiu $a1, $zero, 0x60
/* AE5B4 80117EB4 10400011 */ beqz $v0, .L80117EFC
/* AE5B8 80117EB8 00000000 */ nop
/* AE5BC 80117EBC 8C420008 */ lw $v0, 0x8($v0)
/* AE5C0 80117EC0 1040000E */ beqz $v0, .L80117EFC
/* AE5C4 80117EC4 00000000 */ nop
/* AE5C8 80117EC8 3C108015 */ lui $s0, %hi(mdl_currentTransformGroupChildIndex)
/* AE5CC 80117ECC 2610336C */ addiu $s0, $s0, %lo(mdl_currentTransformGroupChildIndex)
/* AE5D0 80117ED0 0C046B4C */ jal get_model_from_list_index
/* AE5D4 80117ED4 96040000 */ lhu $a0, 0x0($s0)
/* AE5D8 80117ED8 0040202D */ daddu $a0, $v0, $zero
/* AE5DC 80117EDC 94820000 */ lhu $v0, 0x0($a0)
/* AE5E0 80117EE0 30420002 */ andi $v0, $v0, 0x2
/* AE5E4 80117EE4 1440003F */ bnez $v0, .L80117FE4
/* AE5E8 80117EE8 00000000 */ nop
/* AE5EC 80117EEC 0C045F25 */ jal appendGfx_model_group
/* AE5F0 80117EF0 00000000 */ nop
/* AE5F4 80117EF4 08045FF9 */ j .L80117FE4
/* AE5F8 80117EF8 00000000 */ nop
.L80117EFC:
/* AE5FC 80117EFC 8E430000 */ lw $v1, 0x0($s2)
/* AE600 80117F00 24020002 */ addiu $v0, $zero, 0x2
.L80117F04:
/* AE604 80117F04 1062002C */ beq $v1, $v0, .L80117FB8
/* AE608 80117F08 00000000 */ nop
/* AE60C 80117F0C 8E420010 */ lw $v0, 0x10($s2)
/* AE610 80117F10 10400037 */ beqz $v0, .L80117FF0
/* AE614 80117F14 00000000 */ nop
/* AE618 80117F18 8C420000 */ lw $v0, 0x0($v0)
/* AE61C 80117F1C 10400009 */ beqz $v0, .L80117F44
/* AE620 80117F20 3C02DA38 */ lui $v0, (0xDA380000 >> 16)
/* AE624 80117F24 8E630000 */ lw $v1, 0x0($s3)
/* AE628 80117F28 0060202D */ daddu $a0, $v1, $zero
/* AE62C 80117F2C AC820000 */ sw $v0, 0x0($a0)
/* AE630 80117F30 8E420010 */ lw $v0, 0x10($s2)
/* AE634 80117F34 8C420000 */ lw $v0, 0x0($v0)
/* AE638 80117F38 24630008 */ addiu $v1, $v1, 0x8
/* AE63C 80117F3C AE630000 */ sw $v1, 0x0($s3)
/* AE640 80117F40 AC820004 */ sw $v0, 0x4($a0)
.L80117F44:
/* AE644 80117F44 8E420010 */ lw $v0, 0x10($s2)
/* AE648 80117F48 8C51000C */ lw $s1, 0xC($v0)
/* AE64C 80117F4C 1220000E */ beqz $s1, .L80117F88
/* AE650 80117F50 00000000 */ nop
/* AE654 80117F54 1A20000C */ blez $s1, .L80117F88
/* AE658 80117F58 0000802D */ daddu $s0, $zero, $zero
.L80117F5C:
/* AE65C 80117F5C 8E420010 */ lw $v0, 0x10($s2)
/* AE660 80117F60 8C430010 */ lw $v1, 0x10($v0)
/* AE664 80117F64 00101080 */ sll $v0, $s0, 2
/* AE668 80117F68 00431021 */ addu $v0, $v0, $v1
/* AE66C 80117F6C 8C440000 */ lw $a0, 0x0($v0)
/* AE670 80117F70 0C045F9D */ jal render_transform_group_node
/* AE674 80117F74 26100001 */ addiu $s0, $s0, 0x1
/* AE678 80117F78 0211102A */ slt $v0, $s0, $s1
/* AE67C 80117F7C 1440FFF7 */ bnez $v0, .L80117F5C
/* AE680 80117F80 00000000 */ nop
/* AE684 80117F84 8E420010 */ lw $v0, 0x10($s2)
.L80117F88:
/* AE688 80117F88 8C420000 */ lw $v0, 0x0($v0)
/* AE68C 80117F8C 10400018 */ beqz $v0, .L80117FF0
/* AE690 80117F90 3C04D838 */ lui $a0, (0xD8380002 >> 16)
/* AE694 80117F94 8E620000 */ lw $v0, 0x0($s3)
/* AE698 80117F98 34840002 */ ori $a0, $a0, (0xD8380002 & 0xFFFF)
/* AE69C 80117F9C 0040182D */ daddu $v1, $v0, $zero
/* AE6A0 80117FA0 24420008 */ addiu $v0, $v0, 0x8
/* AE6A4 80117FA4 AE620000 */ sw $v0, 0x0($s3)
/* AE6A8 80117FA8 24020040 */ addiu $v0, $zero, 0x40
/* AE6AC 80117FAC AC640000 */ sw $a0, 0x0($v1)
/* AE6B0 80117FB0 08045FFC */ j .L80117FF0
/* AE6B4 80117FB4 AC620004 */ sw $v0, 0x4($v1)
.L80117FB8:
/* AE6B8 80117FB8 3C108015 */ lui $s0, %hi(mdl_currentTransformGroupChildIndex)
/* AE6BC 80117FBC 2610336C */ addiu $s0, $s0, %lo(mdl_currentTransformGroupChildIndex)
/* AE6C0 80117FC0 0C046B4C */ jal get_model_from_list_index
/* AE6C4 80117FC4 96040000 */ lhu $a0, 0x0($s0)
/* AE6C8 80117FC8 0040202D */ daddu $a0, $v0, $zero
/* AE6CC 80117FCC 94820000 */ lhu $v0, 0x0($a0)
/* AE6D0 80117FD0 30420002 */ andi $v0, $v0, 0x2
/* AE6D4 80117FD4 14400003 */ bnez $v0, .L80117FE4
/* AE6D8 80117FD8 00000000 */ nop
/* AE6DC 80117FDC 0C044C24 */ jal appendGfx_model
/* AE6E0 80117FE0 00000000 */ nop
.L80117FE4:
/* AE6E4 80117FE4 96020000 */ lhu $v0, 0x0($s0)
/* AE6E8 80117FE8 24420001 */ addiu $v0, $v0, 0x1
/* AE6EC 80117FEC A6020000 */ sh $v0, 0x0($s0)
.L80117FF0:
/* AE6F0 80117FF0 8FBF0020 */ lw $ra, 0x20($sp)
/* AE6F4 80117FF4 8FB3001C */ lw $s3, 0x1C($sp)
/* AE6F8 80117FF8 8FB20018 */ lw $s2, 0x18($sp)
/* AE6FC 80117FFC 8FB10014 */ lw $s1, 0x14($sp)
/* AE700 80118000 8FB00010 */ lw $s0, 0x10($sp)
/* AE704 80118004 03E00008 */ jr $ra
/* AE708 80118008 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void render_transform_group_node(ModelNode* node) {
Gfx** gfx = &gMainGfxPos;
Model* model;
if (node != NULL) {
if (node->type == SHAPE_TYPE_GROUP) {
ModelNodeProperty* groupTypeProp = get_model_property(node, MODEL_PROP_KEY_GROUP_TYPE);
if (groupTypeProp != NULL && groupTypeProp->data.s != 0) {
model = get_model_from_list_index(mdl_currentTransformGroupChildIndex);
if (!(model->flags & MODEL_FLAG_HIDDEN)) {
appendGfx_model_group(model);
}
mdl_currentTransformGroupChildIndex++;
return;
}
}
if (node->type != SHAPE_TYPE_MODEL) {
if (node->groupData != NULL) {
s32 numChildren;
s32 i;
if (node->groupData->transformMatrix != NULL) {
gSPMatrix((*gfx)++, node->groupData->transformMatrix,
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
}
numChildren = node->groupData->numChildren;
if (numChildren != 0) {
for (i = 0; i < numChildren; i++) {
render_transform_group_node(node->groupData->childList[i]);
}
}
if (node->groupData->transformMatrix != NULL) {
gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW);
}
}
return;
}
model = get_model_from_list_index(mdl_currentTransformGroupChildIndex);
if (!(model->flags & MODEL_FLAG_HIDDEN)) {
appendGfx_model(model);
}
mdl_currentTransformGroupChildIndex++;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel initialize_printer
/* BBDA4 801256A4 0000182D */ daddu $v1, $zero, $zero
/* BBDA8 801256A8 2406FFFF */ addiu $a2, $zero, -0x1
/* BBDAC 801256AC 0080282D */ daddu $a1, $a0, $zero
/* BBDB0 801256B0 24020440 */ addiu $v0, $zero, 0x440
/* BBDB4 801256B4 A4820450 */ sh $v0, 0x450($a0)
/* BBDB8 801256B8 240200FB */ addiu $v0, $zero, 0xFB
/* BBDBC 801256BC A0820010 */ sb $v0, 0x10($a0)
/* BBDC0 801256C0 24020001 */ addiu $v0, $zero, 0x1
/* BBDC4 801256C4 A082045E */ sb $v0, 0x45E($a0)
/* BBDC8 801256C8 A082045F */ sb $v0, 0x45F($a0)
/* BBDCC 801256CC 24020006 */ addiu $v0, $zero, 0x6
/* BBDD0 801256D0 A0820464 */ sb $v0, 0x464($a0)
/* BBDD4 801256D4 240200FF */ addiu $v0, $zero, 0xFF
/* BBDD8 801256D8 AC800000 */ sw $zero, 0x0($a0)
/* BBDDC 801256DC AC800008 */ sw $zero, 0x8($a0)
/* BBDE0 801256E0 A480000E */ sh $zero, 0xE($a0)
/* BBDE4 801256E4 A4800456 */ sh $zero, 0x456($a0)
/* BBDE8 801256E8 A4800458 */ sh $zero, 0x458($a0)
/* BBDEC 801256EC A480045A */ sh $zero, 0x45A($a0)
/* BBDF0 801256F0 A480045C */ sh $zero, 0x45C($a0)
/* BBDF4 801256F4 A080047C */ sb $zero, 0x47C($a0)
/* BBDF8 801256F8 A480047E */ sh $zero, 0x47E($a0)
/* BBDFC 801256FC A4800482 */ sh $zero, 0x482($a0)
/* BBE00 80125700 A4800484 */ sh $zero, 0x484($a0)
/* BBE04 80125704 A0800486 */ sb $zero, 0x486($a0)
/* BBE08 80125708 A0800487 */ sb $zero, 0x487($a0)
/* BBE0C 8012570C A08004CE */ sb $zero, 0x4CE($a0)
/* BBE10 80125710 A08004E9 */ sb $zero, 0x4E9($a0)
/* BBE14 80125714 A08004E8 */ sb $zero, 0x4E8($a0)
/* BBE18 80125718 A08004EE */ sb $zero, 0x4EE($a0)
/* BBE1C 8012571C A08204EA */ sb $v0, 0x4EA($a0)
/* BBE20 80125720 A08004F8 */ sb $zero, 0x4F8($a0)
/* BBE24 80125724 AC8004FC */ sw $zero, 0x4FC($a0)
/* BBE28 80125728 A4800500 */ sh $zero, 0x500($a0)
/* BBE2C 8012572C AC800504 */ sw $zero, 0x504($a0)
/* BBE30 80125730 A4800004 */ sh $zero, 0x4($a0)
/* BBE34 80125734 A480000C */ sh $zero, 0xC($a0)
/* BBE38 80125738 A0800454 */ sb $zero, 0x454($a0)
/* BBE3C 8012573C A0800455 */ sb $zero, 0x455($a0)
/* BBE40 80125740 A4800452 */ sh $zero, 0x452($a0)
/* BBE44 80125744 AC800460 */ sw $zero, 0x460($a0)
/* BBE48 80125748 AC80046C */ sw $zero, 0x46C($a0)
/* BBE4C 8012574C A0800468 */ sb $zero, 0x468($a0)
.L80125750:
/* BBE50 80125750 00831021 */ addu $v0, $a0, $v1
/* BBE54 80125754 A0400470 */ sb $zero, 0x470($v0)
/* BBE58 80125758 A4A60474 */ sh $a2, 0x474($a1)
/* BBE5C 8012575C 24630001 */ addiu $v1, $v1, 0x1
/* BBE60 80125760 28620004 */ slti $v0, $v1, 0x4
/* BBE64 80125764 1440FFFA */ bnez $v0, .L80125750
/* BBE68 80125768 24A50002 */ addiu $a1, $a1, 0x2
/* BBE6C 8012576C 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* BBE70 80125770 44810000 */ mtc1 $at, $f0
/* BBE74 80125774 240200A0 */ addiu $v0, $zero, 0xA0
/* BBE78 80125778 A482050A */ sh $v0, 0x50A($a0)
/* BBE7C 8012577C 24020028 */ addiu $v0, $zero, 0x28
/* BBE80 80125780 A482050C */ sh $v0, 0x50C($a0)
/* BBE84 80125784 2402FFFF */ addiu $v0, $zero, -0x1
/* BBE88 80125788 A0820518 */ sb $v0, 0x518($a0)
/* BBE8C 8012578C 24020040 */ addiu $v0, $zero, 0x40
/* BBE90 80125790 A082051A */ sb $v0, 0x51A($a0)
/* BBE94 80125794 2402004B */ addiu $v0, $zero, 0x4B
/* BBE98 80125798 A0820519 */ sb $v0, 0x519($a0)
/* BBE9C 8012579C 240200FF */ addiu $v0, $zero, 0xFF
/* BBEA0 801257A0 A480047E */ sh $zero, 0x47E($a0)
/* BBEA4 801257A4 A0800508 */ sb $zero, 0x508($a0)
/* BBEA8 801257A8 A0800509 */ sb $zero, 0x509($a0)
/* BBEAC 801257AC A480050E */ sh $zero, 0x50E($a0)
/* BBEB0 801257B0 A4800510 */ sh $zero, 0x510($a0)
/* BBEB4 801257B4 A0800512 */ sb $zero, 0x512($a0)
/* BBEB8 801257B8 A4800516 */ sh $zero, 0x516($a0)
/* BBEBC 801257BC A4800514 */ sh $zero, 0x514($a0)
/* BBEC0 801257C0 A480051C */ sh $zero, 0x51C($a0)
/* BBEC4 801257C4 AC800520 */ sw $zero, 0x520($a0)
/* BBEC8 801257C8 AC800524 */ sw $zero, 0x524($a0)
/* BBECC 801257CC A4800528 */ sh $zero, 0x528($a0)
/* BBED0 801257D0 A080052B */ sb $zero, 0x52B($a0)
/* BBED4 801257D4 A480052C */ sh $zero, 0x52C($a0)
/* BBED8 801257D8 A480052E */ sh $zero, 0x52E($a0)
/* BBEDC 801257DC A0800530 */ sb $zero, 0x530($a0)
/* BBEE0 801257E0 A0820531 */ sb $v0, 0x531($a0)
/* BBEE4 801257E4 A0800533 */ sb $zero, 0x533($a0)
/* BBEE8 801257E8 A4800534 */ sh $zero, 0x534($a0)
/* BBEEC 801257EC AC800544 */ sw $zero, 0x544($a0)
/* BBEF0 801257F0 AC800548 */ sw $zero, 0x548($a0)
/* BBEF4 801257F4 AC80054C */ sw $zero, 0x54C($a0)
/* BBEF8 801257F8 AC800550 */ sw $zero, 0x550($a0)
/* BBEFC 801257FC 03E00008 */ jr $ra
/* BBF00 80125800 E4800540 */ swc1 $f0, 0x540($a0)
### DECOMPILED C INSTRUCTIONS:
void initialize_printer(MessagePrintState* printer, s32 arg1, s32 arg2) {
s32 i;
printer->printBufferSize = ARRAY_COUNT(printer->printBuffer);
printer->printBuffer[0] = MSG_CHAR_PRINT_END;
printer->printDelayTime = 1;
printer->charsPerChunk = 1;
printer->unk_464 = 6;
printer->srcBuffer = NULL;
printer->msgID = 0;
printer->currentPrintDelay = 0;
printer->windowOffsetPos.x = 0;
printer->windowOffsetPos.y = 0;
printer->windowBasePos.x = 0;
printer->windowBasePos.y = 0;
printer->rewindArrowAnimState = REWIND_ARROW_STATE_INIT;
printer->rewindArrowCounter = 0;
printer->rewindArrowPos.x = 0;
printer->rewindArrowPos.y = 0;
printer->currentLine = 0;
printer->unkArraySize = 0;
printer->maxOption = 0;
printer->madeChoice = 0;
printer->currentOption = 0;
printer->selectedOption = 0;
printer->cancelOption = -1;
printer->windowState = MSG_WINDOW_STATE_DONE;
printer->stateFlags = 0;
printer->delayFlags = 0;
printer->closedWritebackBool = NULL;
printer->printBufferPos = 0;
printer->srcBufferPos = 0;
printer->font = 0;
printer->fontVariant = 0;
printer->effectFrameCounter = 0;
printer->curLinePos = 0;
printer->unk_46C = 0;
printer->lineCount = 0;
for (i = 0; i < ARRAY_COUNT(printer->animTimers); i++) {
printer->currentAnimFrame[i] = 0;
printer->animTimers[i] = -1;
}
printer->initOpenPos.x = 160;
printer->initOpenPos.y = 40;
printer->speechSoundType = -1;
printer->speechPan = 64;
printer->volume = 75;
printer->rewindArrowCounter = 0;
printer->style = 0;
printer->fadeInCounter = 0;
printer->openStartPos.x = 0;
printer->openStartPos.y = 0;
printer->fadeOutCounter = 0;
printer->windowSize.y = 0;
printer->windowSize.x = 0;
printer->speechVolumePitch = 0;
printer->speedSoundIDA = 0;
printer->speedSoundIDB = 0;
printer->varBufferReadPos = 0;
printer->currentImageIndex = 0;
printer->varImageScreenPos.x = 0;
printer->varImageScreenPos.y = 0;
printer->varImgHasBorder = 0;
printer->varImgFinalAlpha = 255;
printer->varImageDisplayState = 0;
printer->varImageFadeTimer = 0;
printer->letterBackgroundImg = NULL;
printer->letterBackgroundPal = NULL;
printer->letterContentImg = NULL;
printer->letterContentPal = NULL;
printer->sizeScale = 1.0f;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel small_gold_sparkle_main
/* 391D30 E0092000 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 391D34 E0092004 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 391D38 E0092008 4485A000 */ mtc1 $a1, $f20
/* 391D3C E009200C F7B60040 */ sdc1 $f22, 0x40($sp)
/* 391D40 E0092010 4486B000 */ mtc1 $a2, $f22
/* 391D44 E0092014 AFB20030 */ sw $s2, 0x30($sp)
/* 391D48 E0092018 0080902D */ daddu $s2, $a0, $zero
/* 391D4C E009201C F7B80048 */ sdc1 $f24, 0x48($sp)
/* 391D50 E0092020 4487C000 */ mtc1 $a3, $f24
/* 391D54 E0092024 27A40010 */ addiu $a0, $sp, 0x10
/* 391D58 E0092028 F7BA0050 */ sdc1 $f26, 0x50($sp)
/* 391D5C E009202C C7BA0068 */ lwc1 $f26, 0x68($sp)
/* 391D60 E0092030 3C02E009 */ lui $v0, %hi(small_gold_sparkle_init)
/* 391D64 E0092034 244221AC */ addiu $v0, $v0, %lo(small_gold_sparkle_init)
/* 391D68 E0092038 AFA20018 */ sw $v0, 0x18($sp)
/* 391D6C E009203C 3C02E009 */ lui $v0, %hi(small_gold_sparkle_update)
/* 391D70 E0092040 244221B4 */ addiu $v0, $v0, %lo(small_gold_sparkle_update)
/* 391D74 E0092044 AFA2001C */ sw $v0, 0x1C($sp)
/* 391D78 E0092048 3C02E009 */ lui $v0, %hi(small_gold_sparkle_render)
/* 391D7C E009204C 24422258 */ addiu $v0, $v0, %lo(small_gold_sparkle_render)
/* 391D80 E0092050 AFA20020 */ sw $v0, 0x20($sp)
/* 391D84 E0092054 24020049 */ addiu $v0, $zero, 0x49
/* 391D88 E0092058 AFBF0034 */ sw $ra, 0x34($sp)
/* 391D8C E009205C AFB1002C */ sw $s1, 0x2C($sp)
/* 391D90 E0092060 AFB00028 */ sw $s0, 0x28($sp)
/* 391D94 E0092064 AFA00010 */ sw $zero, 0x10($sp)
/* 391D98 E0092068 AFA00024 */ sw $zero, 0x24($sp)
/* 391D9C E009206C 0C080124 */ jal shim_create_effect_instance
/* 391DA0 E0092070 AFA20014 */ sw $v0, 0x14($sp)
/* 391DA4 E0092074 240400B4 */ addiu $a0, $zero, 0xB4
/* 391DA8 E0092078 24110005 */ addiu $s1, $zero, 0x5
/* 391DAC E009207C 0040802D */ daddu $s0, $v0, $zero
/* 391DB0 E0092080 0C08012C */ jal shim_general_heap_malloc
/* 391DB4 E0092084 AE110008 */ sw $s1, 0x8($s0)
/* 391DB8 E0092088 0040182D */ daddu $v1, $v0, $zero
/* 391DBC E009208C 14600003 */ bnez $v1, .LE009209C
/* 391DC0 E0092090 AE03000C */ sw $v1, 0xC($s0)
.LE0092094:
/* 391DC4 E0092094 08024825 */ j .LE0092094
/* 391DC8 E0092098 00000000 */ nop
.LE009209C:
/* 391DCC E009209C 2402000E */ addiu $v0, $zero, 0xE
/* 391DD0 E00920A0 AC720000 */ sw $s2, 0x0($v1)
/* 391DD4 E00920A4 AC600018 */ sw $zero, 0x18($v1)
/* 391DD8 E00920A8 AC620014 */ sw $v0, 0x14($v1)
/* 391DDC E00920AC E4740008 */ swc1 $f20, 0x8($v1)
/* 391DE0 E00920B0 E476000C */ swc1 $f22, 0xC($v1)
/* 391DE4 E00920B4 E4780010 */ swc1 $f24, 0x10($v1)
/* 391DE8 E00920B8 24040001 */ addiu $a0, $zero, 0x1
/* 391DEC E00920BC 0091102A */ slt $v0, $a0, $s1
/* 391DF0 E00920C0 1040002F */ beqz $v0, .LE0092180
/* 391DF4 E00920C4 24630024 */ addiu $v1, $v1, 0x24
/* 391DF8 E00920C8 3C08E009 */ lui $t0, %hi(D_E00926A4)
/* 391DFC E00920CC 250826A4 */ addiu $t0, $t0, %lo(D_E00926A4)
/* 391E00 E00920D0 240BFFFF */ addiu $t3, $zero, -0x1
/* 391E04 E00920D4 3C01E009 */ lui $at, (0xE0092700 >> 16)
/* 391E08 E00920D8 D4222700 */ ldc1 $f2, (0xE0092700 & 0xFFFF)($at)
/* 391E0C E00920DC 2463001C */ addiu $v1, $v1, 0x1C
/* 391E10 E00920E0 240A0010 */ addiu $t2, $zero, 0x10
/* 391E14 E00920E4 0000482D */ daddu $t1, $zero, $zero
/* 391E18 E00920E8 2407000C */ addiu $a3, $zero, 0xC
/* 391E1C E00920EC 24060008 */ addiu $a2, $zero, 0x8
/* 391E20 E00920F0 24050004 */ addiu $a1, $zero, 0x4
.LE00920F4:
/* 391E24 E00920F4 00A81021 */ addu $v0, $a1, $t0
/* 391E28 E00920F8 C4400000 */ lwc1 $f0, 0x0($v0)
/* 391E2C E00920FC 46800020 */ cvt.s.w $f0, $f0
/* 391E30 E0092100 00C81021 */ addu $v0, $a2, $t0
/* 391E34 E0092104 E460FFEC */ swc1 $f0, -0x14($v1)
/* 391E38 E0092108 C4400000 */ lwc1 $f0, 0x0($v0)
/* 391E3C E009210C 46800020 */ cvt.s.w $f0, $f0
/* 391E40 E0092110 00E81021 */ addu $v0, $a3, $t0
/* 391E44 E0092114 E460FFF0 */ swc1 $f0, -0x10($v1)
/* 391E48 E0092118 C4400000 */ lwc1 $f0, 0x0($v0)
/* 391E4C E009211C 46800020 */ cvt.s.w $f0, $f0
/* 391E50 E0092120 01281021 */ addu $v0, $t1, $t0
/* 391E54 E0092124 E460FFF4 */ swc1 $f0, -0xC($v1)
/* 391E58 E0092128 AC6BFFE8 */ sw $t3, -0x18($v1)
/* 391E5C E009212C 8C420000 */ lw $v0, 0x0($v0)
/* 391E60 E0092130 AC620004 */ sw $v0, 0x4($v1)
/* 391E64 E0092134 01481021 */ addu $v0, $t2, $t0
/* 391E68 E0092138 C4400000 */ lwc1 $f0, 0x0($v0)
/* 391E6C E009213C 46800020 */ cvt.s.w $f0, $f0
/* 391E70 E0092140 4600D002 */ mul.s $f0, $f26, $f0
/* 391E74 E0092144 00000000 */ nop
/* 391E78 E0092148 46000021 */ cvt.d.s $f0, $f0
/* 391E7C E009214C 46220002 */ mul.d $f0, $f0, $f2
/* 391E80 E0092150 00000000 */ nop
/* 391E84 E0092154 25290014 */ addiu $t1, $t1, 0x14
/* 391E88 E0092158 24E70014 */ addiu $a3, $a3, 0x14
/* 391E8C E009215C 24C60014 */ addiu $a2, $a2, 0x14
/* 391E90 E0092160 24A50014 */ addiu $a1, $a1, 0x14
/* 391E94 E0092164 24840001 */ addiu $a0, $a0, 0x1
/* 391E98 E0092168 254A0014 */ addiu $t2, $t2, 0x14
/* 391E9C E009216C 0091102A */ slt $v0, $a0, $s1
/* 391EA0 E0092170 46200020 */ cvt.s.d $f0, $f0
/* 391EA4 E0092174 E4600000 */ swc1 $f0, 0x0($v1)
/* 391EA8 E0092178 1440FFDE */ bnez $v0, .LE00920F4
/* 391EAC E009217C 24630024 */ addiu $v1, $v1, 0x24
.LE0092180:
/* 391EB0 E0092180 0200102D */ daddu $v0, $s0, $zero
/* 391EB4 E0092184 8FBF0034 */ lw $ra, 0x34($sp)
/* 391EB8 E0092188 8FB20030 */ lw $s2, 0x30($sp)
/* 391EBC E009218C 8FB1002C */ lw $s1, 0x2C($sp)
/* 391EC0 E0092190 8FB00028 */ lw $s0, 0x28($sp)
/* 391EC4 E0092194 D7BA0050 */ ldc1 $f26, 0x50($sp)
/* 391EC8 E0092198 D7B80048 */ ldc1 $f24, 0x48($sp)
/* 391ECC E009219C D7B60040 */ ldc1 $f22, 0x40($sp)
/* 391ED0 E00921A0 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 391ED4 E00921A4 03E00008 */ jr $ra
/* 391ED8 E00921A8 27BD0058 */ addiu $sp, $sp, 0x58
### DECOMPILED C INSTRUCTIONS:
EffectInstance* small_gold_sparkle_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
EffectBlueprint bp;
EffectInstance* effect;
SmallGoldSparkleFXData* data;
SmallGoldSparkleFXData* part;
s32 numParts = 5;
s32 i;
bp.init = small_gold_sparkle_init;
bp.update = small_gold_sparkle_update;
bp.renderWorld = small_gold_sparkle_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_SMALL_GOLD_SPARKLE;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data));
effect->data.smallGoldSparkle = data;
part = data;
ASSERT(data != NULL);
part->unk_00 = arg0;
part->unk_18 = 0;
part->unk_14 = 14;
part->unk_08 = arg1;
part->unk_0C = arg2;
part->unk_10 = arg3;
part++;
for (i = 1; i < numParts; i++, part++) {
part->unk_08 = sPartParams[1 + (i - 1) * 5];
part->unk_0C = sPartParams[2 + (i - 1) * 5];
part->unk_10 = sPartParams[3 + (i - 1) * 5];
part->unk_04 = -1;
part->unk_20 = sPartParams[0 + (i - 1) * 5];
part->unk_1C = (arg4 * sPartParams[4 + (i - 1) * 5]) * 0.01;
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel UseEntryHeading
/* F6920 802D1F70 27BDFFC0 */ addiu $sp, $sp, -0x40
/* F6924 802D1F74 AFB20020 */ sw $s2, 0x20($sp)
/* F6928 802D1F78 0080902D */ daddu $s2, $a0, $zero
/* F692C 802D1F7C AFBF0028 */ sw $ra, 0x28($sp)
/* F6930 802D1F80 AFB30024 */ sw $s3, 0x24($sp)
/* F6934 802D1F84 AFB1001C */ sw $s1, 0x1C($sp)
/* F6938 802D1F88 AFB00018 */ sw $s0, 0x18($sp)
/* F693C 802D1F8C F7B60038 */ sdc1 $f22, 0x38($sp)
/* F6940 802D1F90 F7B40030 */ sdc1 $f20, 0x30($sp)
/* F6944 802D1F94 0C016AFA */ jal get_current_map_settings
/* F6948 802D1F98 8E50000C */ lw $s0, 0xC($s2)
/* F694C 802D1F9C 0240202D */ daddu $a0, $s2, $zero
/* F6950 802D1FA0 0040882D */ daddu $s1, $v0, $zero
/* F6954 802D1FA4 8E050000 */ lw $a1, 0x0($s0)
/* F6958 802D1FA8 0C0B1EAF */ jal evt_get_variable
/* F695C 802D1FAC 26100004 */ addiu $s0, $s0, 0x4
/* F6960 802D1FB0 0240202D */ daddu $a0, $s2, $zero
/* F6964 802D1FB4 8E050000 */ lw $a1, 0x0($s0)
/* F6968 802D1FB8 0C0B1EAF */ jal evt_get_variable
/* F696C 802D1FBC 0040982D */ daddu $s3, $v0, $zero
/* F6970 802D1FC0 3C108007 */ lui $s0, %hi(gGameStatusPtr)
/* F6974 802D1FC4 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr)
/* F6978 802D1FC8 8E050000 */ lw $a1, 0x0($s0)
/* F697C 802D1FCC 84A3008E */ lh $v1, 0x8E($a1)
/* F6980 802D1FD0 8E240014 */ lw $a0, 0x14($s1)
/* F6984 802D1FD4 00031900 */ sll $v1, $v1, 4
/* F6988 802D1FD8 00641821 */ addu $v1, $v1, $a0
/* F698C 802D1FDC C4600000 */ lwc1 $f0, 0x0($v1)
/* F6990 802D1FE0 4600020D */ trunc.w.s $f8, $f0
/* F6994 802D1FE4 44074000 */ mfc1 $a3, $f8
/* F6998 802D1FE8 00000000 */ nop
/* F699C 802D1FEC AE470088 */ sw $a3, 0x88($s2)
/* F69A0 802D1FF0 84A3008E */ lh $v1, 0x8E($a1)
/* F69A4 802D1FF4 8E240014 */ lw $a0, 0x14($s1)
/* F69A8 802D1FF8 00031900 */ sll $v1, $v1, 4
/* F69AC 802D1FFC 00641821 */ addu $v1, $v1, $a0
/* F69B0 802D2000 C4600004 */ lwc1 $f0, 0x4($v1)
/* F69B4 802D2004 4600020D */ trunc.w.s $f8, $f0
/* F69B8 802D2008 E648008C */ swc1 $f8, 0x8C($s2)
/* F69BC 802D200C 84A3008E */ lh $v1, 0x8E($a1)
/* F69C0 802D2010 8E240014 */ lw $a0, 0x14($s1)
/* F69C4 802D2014 00031900 */ sll $v1, $v1, 4
/* F69C8 802D2018 00641821 */ addu $v1, $v1, $a0
/* F69CC 802D201C C4600008 */ lwc1 $f0, 0x8($v1)
/* F69D0 802D2020 3C014334 */ lui $at, (0x43340000 >> 16)
/* F69D4 802D2024 44816000 */ mtc1 $at, $f12
/* F69D8 802D2028 4600020D */ trunc.w.s $f8, $f0
/* F69DC 802D202C 44064000 */ mfc1 $a2, $f8
/* F69E0 802D2030 00000000 */ nop
/* F69E4 802D2034 AE460090 */ sw $a2, 0x90($s2)
/* F69E8 802D2038 84A3008E */ lh $v1, 0x8E($a1)
/* F69EC 802D203C 8E240014 */ lw $a0, 0x14($s1)
/* F69F0 802D2040 00031900 */ sll $v1, $v1, 4
/* F69F4 802D2044 00641821 */ addu $v1, $v1, $a0
/* F69F8 802D2048 C460000C */ lwc1 $f0, 0xC($v1)
/* F69FC 802D204C 4487A000 */ mtc1 $a3, $f20
/* F6A00 802D2050 00000000 */ nop
/* F6A04 802D2054 4680A520 */ cvt.s.w $f20, $f20
/* F6A08 802D2058 460C0300 */ add.s $f12, $f0, $f12
/* F6A0C 802D205C 4486B000 */ mtc1 $a2, $f22
/* F6A10 802D2060 00000000 */ nop
/* F6A14 802D2064 4680B5A0 */ cvt.s.w $f22, $f22
/* F6A18 802D2068 0C00A6C9 */ jal clamp_angle
/* F6A1C 802D206C 0040882D */ daddu $s1, $v0, $zero
/* F6A20 802D2070 46000306 */ mov.s $f12, $f0
/* F6A24 802D2074 27A50010 */ addiu $a1, $sp, 0x10
/* F6A28 802D2078 0C00A88D */ jal sin_cos_deg
/* F6A2C 802D207C 27A60014 */ addiu $a2, $sp, 0x14
/* F6A30 802D2080 C7A40010 */ lwc1 $f4, 0x10($sp)
/* F6A34 802D2084 44937000 */ mtc1 $s3, $f14
/* F6A38 802D2088 00000000 */ nop
/* F6A3C 802D208C 468073A0 */ cvt.s.w $f14, $f14
/* F6A40 802D2090 46047302 */ mul.s $f12, $f14, $f4
/* F6A44 802D2094 00000000 */ nop
/* F6A48 802D2098 8E020000 */ lw $v0, 0x0($s0)
/* F6A4C 802D209C 3C013E99 */ lui $at, (0x3E99999A >> 16)
/* F6A50 802D20A0 3421999A */ ori $at, $at, (0x3E99999A & 0xFFFF)
/* F6A54 802D20A4 44810000 */ mtc1 $at, $f0
/* F6A58 802D20A8 C4420094 */ lwc1 $f2, 0x94($v0)
/* F6A5C 802D20AC 46001082 */ mul.s $f2, $f2, $f0
/* F6A60 802D20B0 00000000 */ nop
/* F6A64 802D20B4 C7A00014 */ lwc1 $f0, 0x14($sp)
/* F6A68 802D20B8 46007382 */ mul.s $f14, $f14, $f0
/* F6A6C 802D20BC 00000000 */ nop
/* F6A70 802D20C0 46001182 */ mul.s $f6, $f2, $f0
/* F6A74 802D20C4 00000000 */ nop
/* F6A78 802D20C8 46041082 */ mul.s $f2, $f2, $f4
/* F6A7C 802D20CC 00000000 */ nop
/* F6A80 802D20D0 460CA300 */ add.s $f12, $f20, $f12
/* F6A84 802D20D4 460EB381 */ sub.s $f14, $f22, $f14
/* F6A88 802D20D8 46066301 */ sub.s $f12, $f12, $f6
/* F6A8C 802D20DC 4406A000 */ mfc1 $a2, $f20
/* F6A90 802D20E0 4407B000 */ mfc1 $a3, $f22
/* F6A94 802D20E4 46027381 */ sub.s $f14, $f14, $f2
/* F6A98 802D20E8 3C108011 */ lui $s0, %hi(gPlayerStatus)
/* F6A9C 802D20EC 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
/* F6AA0 802D20F0 E60C0028 */ swc1 $f12, 0x28($s0)
/* F6AA4 802D20F4 0C00A7B5 */ jal dist2D
/* F6AA8 802D20F8 E60E0030 */ swc1 $f14, 0x30($s0)
/* F6AAC 802D20FC 44911000 */ mtc1 $s1, $f2
/* F6AB0 802D2100 00000000 */ nop
/* F6AB4 802D2104 468010A0 */ cvt.s.w $f2, $f2
/* F6AB8 802D2108 46020003 */ div.s $f0, $f0, $f2
/* F6ABC 802D210C E6400098 */ swc1 $f0, 0x98($s2)
/* F6AC0 802D2110 8E030000 */ lw $v1, 0x0($s0)
/* F6AC4 802D2114 3C040400 */ lui $a0, (0x4000000 >> 16)
/* F6AC8 802D2118 00641825 */ or $v1, $v1, $a0
/* F6ACC 802D211C AE030000 */ sw $v1, 0x0($s0)
/* F6AD0 802D2120 8FBF0028 */ lw $ra, 0x28($sp)
/* F6AD4 802D2124 8FB30024 */ lw $s3, 0x24($sp)
/* F6AD8 802D2128 8FB20020 */ lw $s2, 0x20($sp)
/* F6ADC 802D212C 8FB1001C */ lw $s1, 0x1C($sp)
/* F6AE0 802D2130 8FB00018 */ lw $s0, 0x18($sp)
/* F6AE4 802D2134 D7B60038 */ ldc1 $f22, 0x38($sp)
/* F6AE8 802D2138 D7B40030 */ ldc1 $f20, 0x30($sp)
/* F6AEC 802D213C 24020002 */ addiu $v0, $zero, 0x2
/* F6AF0 802D2140 03E00008 */ jr $ra
/* F6AF4 802D2144 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
ApiStatus UseEntryHeading(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
MapSettings* mapSettings = get_current_map_settings();
s32 var1 = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args++);
f32 entryX = script->varTable[1] = (*mapSettings->entryList)[gGameStatusPtr->entryID].x;
f32 entryY = script->varTable[2] = (*mapSettings->entryList)[gGameStatusPtr->entryID].y;
f32 entryZ = script->varTable[3] = (*mapSettings->entryList)[gGameStatusPtr->entryID].z;
f32 cosTheta;
f32 sinTheta;
f32 exitTangentFrac;
sin_cos_deg(clamp_angle((*mapSettings->entryList)[gGameStatusPtr->entryID].yaw + 180.0f), &sinTheta, &cosTheta);
exitTangentFrac = gGameStatusPtr->exitTangent * 0.3f;
gPlayerStatus.position.x = (entryX + (var1 * sinTheta)) - (exitTangentFrac * cosTheta);
gPlayerStatus.position.z = (entryZ - (var1 * cosTheta)) - (exitTangentFrac * sinTheta);
script->varTableF[5] = dist2D(gPlayerStatus.position.x, gPlayerStatus.position.z, entryX, entryZ) / var2;
gPlayerStatus.flags |= PS_FLAG_CAMERA_DOESNT_FOLLOW;
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_enter_map_screen_overlay
/* CECD4 801385D4 3C038015 */ lui $v1, %hi(CurrentScreenTransition)
/* CECD8 801385D8 8C63C6F0 */ lw $v1, %lo(CurrentScreenTransition)($v1)
/* CECDC 801385DC 27BDFFD8 */ addiu $sp, $sp, -0x28
/* CECE0 801385E0 AFB20018 */ sw $s2, 0x18($sp)
/* CECE4 801385E4 0080902D */ daddu $s2, $a0, $zero
/* CECE8 801385E8 AFB10014 */ sw $s1, 0x14($sp)
/* CECEC 801385EC 0000882D */ daddu $s1, $zero, $zero
/* CECF0 801385F0 AFB00010 */ sw $s0, 0x10($sp)
/* CECF4 801385F4 24100014 */ addiu $s0, $zero, 0x14
/* CECF8 801385F8 AFB3001C */ sw $s3, 0x1C($sp)
/* CECFC 801385FC 0220982D */ daddu $s3, $s1, $zero
/* CED00 80138600 2C620011 */ sltiu $v0, $v1, 0x11
/* CED04 80138604 10400030 */ beqz $v0, .L801386C8
/* CED08 80138608 AFBF0020 */ sw $ra, 0x20($sp)
/* CED0C 8013860C 00031080 */ sll $v0, $v1, 2
/* CED10 80138610 3C018015 */ lui $at, %hi(jtbl_80150F38)
/* CED14 80138614 00220821 */ addu $at, $at, $v0
/* CED18 80138618 8C220F38 */ lw $v0, %lo(jtbl_80150F38)($at)
/* CED1C 8013861C 00400008 */ jr $v0
/* CED20 80138620 00000000 */ nop
glabel .L80138624
/* CED24 80138624 0000202D */ daddu $a0, $zero, $zero
/* CED28 80138628 240500D0 */ addiu $a1, $zero, 0xD0
/* CED2C 8013862C 00A0302D */ daddu $a2, $a1, $zero
/* CED30 80138630 0C04DF84 */ jal set_screen_overlay_color
/* CED34 80138634 00A0382D */ daddu $a3, $a1, $zero
/* CED38 80138638 0804E1B2 */ j .L801386C8
/* CED3C 8013863C 24100032 */ addiu $s0, $zero, 0x32
glabel .L80138640
/* CED40 80138640 24110001 */ addiu $s1, $zero, 0x1
/* CED44 80138644 0804E1B2 */ j .L801386C8
/* CED48 80138648 24100032 */ addiu $s0, $zero, 0x32
glabel .L8013864C
/* CED4C 8013864C 24110001 */ addiu $s1, $zero, 0x1
/* CED50 80138650 0804E1B2 */ j .L801386C8
/* CED54 80138654 24100007 */ addiu $s0, $zero, 0x7
glabel .L80138658
/* CED58 80138658 0804E1B2 */ j .L801386C8
/* CED5C 8013865C 24110001 */ addiu $s1, $zero, 0x1
glabel .L80138660
/* CED60 80138660 0804E1B2 */ j .L801386C8
/* CED64 80138664 24110004 */ addiu $s1, $zero, 0x4
glabel .L80138668
/* CED68 80138668 24110005 */ addiu $s1, $zero, 0x5
/* CED6C 8013866C 0804E1B2 */ j .L801386C8
/* CED70 80138670 24100007 */ addiu $s0, $zero, 0x7
glabel .L80138674
/* CED74 80138674 24110004 */ addiu $s1, $zero, 0x4
/* CED78 80138678 0804E1B2 */ j .L801386C8
/* CED7C 8013867C 24100007 */ addiu $s0, $zero, 0x7
glabel .L80138680
/* CED80 80138680 0000202D */ daddu $a0, $zero, $zero
/* CED84 80138684 0080282D */ daddu $a1, $a0, $zero
/* CED88 80138688 2406000F */ addiu $a2, $zero, 0xF
/* CED8C 8013868C 0C04DF93 */ jal set_screen_overlay_center
/* CED90 80138690 2407001C */ addiu $a3, $zero, 0x1C
/* CED94 80138694 0000202D */ daddu $a0, $zero, $zero
/* CED98 80138698 24050001 */ addiu $a1, $zero, 0x1
/* CED9C 8013869C 24060131 */ addiu $a2, $zero, 0x131
/* CEDA0 801386A0 0C04DF93 */ jal set_screen_overlay_center
/* CEDA4 801386A4 2407009C */ addiu $a3, $zero, 0x9C
/* CEDA8 801386A8 86420000 */ lh $v0, 0x0($s2)
/* CEDAC 801386AC 2404000C */ addiu $a0, $zero, 0xC
/* CEDB0 801386B0 44820000 */ mtc1 $v0, $f0
/* CEDB4 801386B4 00000000 */ nop
/* CEDB8 801386B8 46800020 */ cvt.s.w $f0, $f0
/* CEDBC 801386BC 44050000 */ mfc1 $a1, $f0
/* CEDC0 801386C0 0C04DF62 */ jal set_screen_overlay_params_front
/* CEDC4 801386C4 24100002 */ addiu $s0, $zero, 0x2
.L801386C8:
/* CEDC8 801386C8 3C038015 */ lui $v1, %hi(CurrentScreenTransition)
/* CEDCC 801386CC 8C63C6F0 */ lw $v1, %lo(CurrentScreenTransition)($v1)
/* CEDD0 801386D0 24020010 */ addiu $v0, $zero, 0x10
/* CEDD4 801386D4 10620008 */ beq $v1, $v0, .L801386F8
/* CEDD8 801386D8 00000000 */ nop
/* CEDDC 801386DC 86420000 */ lh $v0, 0x0($s2)
/* CEDE0 801386E0 44820000 */ mtc1 $v0, $f0
/* CEDE4 801386E4 00000000 */ nop
/* CEDE8 801386E8 46800020 */ cvt.s.w $f0, $f0
/* CEDEC 801386EC 44050000 */ mfc1 $a1, $f0
/* CEDF0 801386F0 0C04DF62 */ jal set_screen_overlay_params_front
/* CEDF4 801386F4 0220202D */ daddu $a0, $s1, $zero
.L801386F8:
/* CEDF8 801386F8 86420000 */ lh $v0, 0x0($s2)
/* CEDFC 801386FC 96430000 */ lhu $v1, 0x0($s2)
/* CEE00 80138700 50400001 */ beql $v0, $zero, .L80138708
/* CEE04 80138704 24130001 */ addiu $s3, $zero, 0x1
.L80138708:
/* CEE08 80138708 00701023 */ subu $v0, $v1, $s0
/* CEE0C 8013870C A6420000 */ sh $v0, 0x0($s2)
/* CEE10 80138710 00021400 */ sll $v0, $v0, 16
/* CEE14 80138714 04420001 */ bltzl $v0, .L8013871C
/* CEE18 80138718 A6400000 */ sh $zero, 0x0($s2)
.L8013871C:
/* CEE1C 8013871C 0260102D */ daddu $v0, $s3, $zero
/* CEE20 80138720 8FBF0020 */ lw $ra, 0x20($sp)
/* CEE24 80138724 8FB3001C */ lw $s3, 0x1C($sp)
/* CEE28 80138728 8FB20018 */ lw $s2, 0x18($sp)
/* CEE2C 8013872C 8FB10014 */ lw $s1, 0x14($sp)
/* CEE30 80138730 8FB00010 */ lw $s0, 0x10($sp)
/* CEE34 80138734 03E00008 */ jr $ra
/* CEE38 80138738 27BD0028 */ addiu $sp, $sp, 0x28
/* CEE3C 8013873C 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
s16 update_enter_map_screen_overlay(s16* progress) {
u8 fadeInType = OVERLAY_SCREEN_COLOR;
s32 fadeRate = STANDARD_FADE_RATE;
u8 ret = FALSE;
switch (CurrentScreenTransition) {
case TRANSITION_END_DEMO_SCENE_WHITE:
set_screen_overlay_color(SCREEN_LAYER_FRONT, 208, 208, 208);
fadeRate = FAST_FADE_RATE;
break;
case TRANSITION_END_DEMO_SCENE_BLACK:
fadeInType = OVERLAY_VIEWPORT_COLOR;
fadeRate = FAST_FADE_RATE;
break;
case TRANSITION_BEGIN_OR_END_GAME:
case TRANSITION_OUTRO_END_SCENE:
case TRANSITION_SLOW_FADE_TO_WHITE:
case TRANSITION_MARIO_WHITE:
case TRANSITION_MARIO_BLACK:
fadeInType = OVERLAY_VIEWPORT_COLOR;
fadeRate = SLOW_FADE_RATE;
break;
case TRANSITION_STANDARD:
case TRANSITION_TOY_TRAIN:
case TRANSITION_BEGIN_OR_END_CHAPTER:
case TRANSITION_PEACH_CAPTURED:
case TRANSITION_GET_STAR_CARD:
fadeInType = OVERLAY_VIEWPORT_COLOR;
break;
case TRANSITION_ENTER_WORLD:
case TRANSITION_END_CHAPTER_INTERRUPTED:
fadeInType = OVERLAY_VIEWPORT_MARIO;
break;
case TRANSITION_AFTER_SAVE_PROMPT:
fadeInType = OVERLAY_VIEWPORT_STAR;
fadeRate = SLOW_FADE_RATE;
break;
case TRANSITION_END_PEACH_INTERLUDE:
fadeInType = OVERLAY_VIEWPORT_MARIO;
fadeRate = SLOW_FADE_RATE;
break;
case TRANSITION_SLOW_BLUR_MOTION:
set_screen_overlay_center(SCREEN_LAYER_FRONT, 0, 15, 28);
set_screen_overlay_center(SCREEN_LAYER_FRONT, 1, 305, 156);
set_screen_overlay_params_front(OVERLAY_BLUR, *progress);
fadeRate = VERY_SLOW_FADE_RATE;
break;
}
if (CurrentScreenTransition != TRANSITION_SLOW_BLUR_MOTION) {
set_screen_overlay_params_front(fadeInType, *progress);
}
if (*progress == 0) {
ret = TRUE;
}
*progress -= fadeRate;
if (*progress < 0) {
*progress = 0;
}
return ret;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_8004DCB8
/* 290B8 8004DCB8 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 290BC 8004DCBC AFB20018 */ sw $s2, 0x18($sp)
/* 290C0 8004DCC0 0080902D */ daddu $s2, $a0, $zero
/* 290C4 8004DCC4 AFB50024 */ sw $s5, 0x24($sp)
/* 290C8 8004DCC8 00A0A82D */ daddu $s5, $a1, $zero
/* 290CC 8004DCCC AFB3001C */ sw $s3, 0x1C($sp)
/* 290D0 8004DCD0 AFBF0028 */ sw $ra, 0x28($sp)
/* 290D4 8004DCD4 AFB40020 */ sw $s4, 0x20($sp)
/* 290D8 8004DCD8 AFB10014 */ sw $s1, 0x14($sp)
/* 290DC 8004DCDC AFB00010 */ sw $s0, 0x10($sp)
/* 290E0 8004DCE0 8E510000 */ lw $s1, 0x0($s2)
/* 290E4 8004DCE4 8E540010 */ lw $s4, 0x10($s2)
/* 290E8 8004DCE8 12200045 */ beqz $s1, .L8004DE00
/* 290EC 8004DCEC 0000982D */ daddu $s3, $zero, $zero
/* 290F0 8004DCF0 0C0135E5 */ jal au_bgm_get_player_with_song_name
/* 290F4 8004DCF4 0220202D */ daddu $a0, $s1, $zero
/* 290F8 8004DCF8 0040802D */ daddu $s0, $v0, $zero
/* 290FC 8004DCFC 52000041 */ beql $s0, $zero, .L8004DE04
/* 29100 8004DD00 24130002 */ addiu $s3, $zero, 0x2
/* 29104 8004DD04 8E420014 */ lw $v0, 0x14($s2)
/* 29108 8004DD08 14400032 */ bnez $v0, .L8004DDD4
/* 2910C 8004DD0C 00000000 */ nop
/* 29110 8004DD10 0C014FD9 */ jal func_80053F64
/* 29114 8004DD14 0280202D */ daddu $a0, $s4, $zero
/* 29118 8004DD18 0040402D */ daddu $t0, $v0, $zero
/* 2911C 8004DD1C 51000039 */ beql $t0, $zero, .L8004DE04
/* 29120 8004DD20 24130004 */ addiu $s3, $zero, 0x4
/* 29124 8004DD24 8E02001C */ lw $v0, 0x1C($s0)
/* 29128 8004DD28 16220037 */ bne $s1, $v0, .L8004DE08
/* 2912C 8004DD2C 0260102D */ daddu $v0, $s3, $zero
/* 29130 8004DD30 16A00015 */ bnez $s5, .L8004DD88
/* 29134 8004DD34 001428C0 */ sll $a1, $s4, 3
/* 29138 8004DD38 0260382D */ daddu $a3, $s3, $zero
/* 2913C 8004DD3C 2406025C */ addiu $a2, $zero, 0x25C
.L8004DD40:
/* 29140 8004DD40 02062821 */ addu $a1, $s0, $a2
/* 29144 8004DD44 8CA20000 */ lw $v0, 0x0($a1)
/* 29148 8004DD48 5040000B */ beql $v0, $zero, .L8004DD78
/* 2914C 8004DD4C 24E70001 */ addiu $a3, $a3, 0x1
/* 29150 8004DD50 90A30052 */ lbu $v1, 0x52($a1)
/* 29154 8004DD54 90A40053 */ lbu $a0, 0x53($a1)
/* 29158 8004DD58 0064102B */ sltu $v0, $v1, $a0
/* 2915C 8004DD5C 50400006 */ beql $v0, $zero, .L8004DD78
/* 29160 8004DD60 24E70001 */ addiu $a3, $a3, 0x1
.L8004DD64:
/* 29164 8004DD64 24630001 */ addiu $v1, $v1, 0x1
/* 29168 8004DD68 0064102B */ sltu $v0, $v1, $a0
/* 2916C 8004DD6C 1440FFFD */ bnez $v0, .L8004DD64
/* 29170 8004DD70 ACA00040 */ sw $zero, 0x40($a1)
/* 29174 8004DD74 24E70001 */ addiu $a3, $a3, 0x1
.L8004DD78:
/* 29178 8004DD78 2CE20010 */ sltiu $v0, $a3, 0x10
/* 2917C 8004DD7C 1440FFF0 */ bnez $v0, .L8004DD40
/* 29180 8004DD80 24C60060 */ addiu $a2, $a2, 0x60
/* 29184 8004DD84 001428C0 */ sll $a1, $s4, 3
.L8004DD88:
/* 29188 8004DD88 0200202D */ daddu $a0, $s0, $zero
/* 2918C 8004DD8C 24060A9C */ addiu $a2, $zero, 0xA9C
/* 29190 8004DD90 8E020000 */ lw $v0, 0x0($s0)
/* 29194 8004DD94 92030234 */ lbu $v1, 0x234($s0)
/* 29198 8004DD98 00451021 */ addu $v0, $v0, $a1
/* 2919C 8004DD9C A0430071 */ sb $v1, 0x71($v0)
/* 291A0 8004DDA0 8E020000 */ lw $v0, 0x0($s0)
/* 291A4 8004DDA4 24030001 */ addiu $v1, $zero, 0x1
/* 291A8 8004DDA8 00451021 */ addu $v0, $v0, $a1
/* 291AC 8004DDAC 0100282D */ daddu $a1, $t0, $zero
/* 291B0 8004DDB0 A0430070 */ sb $v1, 0x70($v0)
/* 291B4 8004DDB4 0C0153DD */ jal au_copy_words
/* 291B8 8004DDB8 AE000020 */ sw $zero, 0x20($s0)
/* 291BC 8004DDBC 16A00012 */ bnez $s5, .L8004DE08
/* 291C0 8004DDC0 0260102D */ daddu $v0, $s3, $zero
/* 291C4 8004DDC4 0C0136AA */ jal au_bgm_stop_player
/* 291C8 8004DDC8 0200202D */ daddu $a0, $s0, $zero
/* 291CC 8004DDCC 08013782 */ j .L8004DE08
/* 291D0 8004DDD0 0260102D */ daddu $v0, $s3, $zero
.L8004DDD4:
/* 291D4 8004DDD4 8E02001C */ lw $v0, 0x1C($s0)
/* 291D8 8004DDD8 1622000B */ bne $s1, $v0, .L8004DE08
/* 291DC 8004DDDC 0260102D */ daddu $v0, $s3, $zero
/* 291E0 8004DDE0 92020221 */ lbu $v0, 0x221($s0)
/* 291E4 8004DDE4 10400007 */ beqz $v0, .L8004DE04
/* 291E8 8004DDE8 24020001 */ addiu $v0, $zero, 0x1
/* 291EC 8004DDEC A2020220 */ sb $v0, 0x220($s0)
/* 291F0 8004DDF0 0C014240 */ jal func_80050900
/* 291F4 8004DDF4 0200202D */ daddu $a0, $s0, $zero
/* 291F8 8004DDF8 08013782 */ j .L8004DE08
/* 291FC 8004DDFC 0260102D */ daddu $v0, $s3, $zero
.L8004DE00:
/* 29200 8004DE00 24130003 */ addiu $s3, $zero, 0x3
.L8004DE04:
/* 29204 8004DE04 0260102D */ daddu $v0, $s3, $zero
.L8004DE08:
/* 29208 8004DE08 8FBF0028 */ lw $ra, 0x28($sp)
/* 2920C 8004DE0C 8FB50024 */ lw $s5, 0x24($sp)
/* 29210 8004DE10 8FB40020 */ lw $s4, 0x20($sp)
/* 29214 8004DE14 8FB3001C */ lw $s3, 0x1C($sp)
/* 29218 8004DE18 8FB20018 */ lw $s2, 0x18($sp)
/* 2921C 8004DE1C 8FB10014 */ lw $s1, 0x14($sp)
/* 29220 8004DE20 8FB00010 */ lw $s0, 0x10($sp)
/* 29224 8004DE24 03E00008 */ jr $ra
/* 29228 8004DE28 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
AuResult func_8004DCB8(SongUpdateEvent* update, s32 clearChanged) {
AuResult status;
BGMPlayer* playerA;
BGMPlayer* playerB;
s32 songName;
s32 variation;
u32 i;
u32 j;
songName = update->songName;
variation = update->variation;
status = AU_RESULT_OK;
if (songName != 0) {
playerA = au_bgm_get_player_with_song_name(songName);
if (playerA != NULL) {
if (update->unk14 == 0) {
playerB = func_80053F64(variation);
if (playerB != NULL) {
if (songName == playerA->songName) {
if (!clearChanged) {
for (i = 0; i < ARRAY_COUNT(playerA->tracks); i++) {
BGMPlayerTrack* track = &playerA->tracks[i];
if (track->bgmReadPos != 0) {
for (j = track->unk_52; j < track->unk_53; j++) {
track->changed.all = 0;
}
}
}
}
playerA->globals->unk_globals_6C[variation].unk_5 = playerA->priority;
playerA->globals->unk_globals_6C[variation].unk_4 = 1;
playerA->fadeSongName = 0;
au_copy_words(playerA, playerB, sizeof(*playerA));
if (clearChanged == 0) {
au_bgm_stop_player(playerA);
}
}
} else {
status = AU_ERROR_INVALID_SONG_DURATION;
}
} else {
if (songName == playerA->songName) {
if (playerA->masterState != BGM_PLAY_STATE_IDLE) {
playerA->unk_220 = 1;
func_80050900(playerA);
}
}
}
} else {
status = AU_ERROR_SONG_NOT_PLAYING;
}
} else {
status = AU_ERROR_NULL_SONG_NAME;
}
return status;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel peach_star_beam_main
/* 3E54C0 E010C000 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 3E54C4 E010C004 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 3E54C8 E010C008 4485A000 */ mtc1 $a1, $f20
/* 3E54CC E010C00C F7B80048 */ sdc1 $f24, 0x48($sp)
/* 3E54D0 E010C010 4486C000 */ mtc1 $a2, $f24
/* 3E54D4 E010C014 AFB20030 */ sw $s2, 0x30($sp)
/* 3E54D8 E010C018 0080902D */ daddu $s2, $a0, $zero
/* 3E54DC E010C01C F7B60040 */ sdc1 $f22, 0x40($sp)
/* 3E54E0 E010C020 4487B000 */ mtc1 $a3, $f22
/* 3E54E4 E010C024 27A40010 */ addiu $a0, $sp, 0x10
/* 3E54E8 E010C028 AFB1002C */ sw $s1, 0x2C($sp)
/* 3E54EC E010C02C 8FB10064 */ lw $s1, 0x64($sp)
/* 3E54F0 E010C030 3C02E011 */ lui $v0, %hi(peach_star_beam_init)
/* 3E54F4 E010C034 2442C190 */ addiu $v0, $v0, %lo(peach_star_beam_init)
/* 3E54F8 E010C038 AFA20018 */ sw $v0, 0x18($sp)
/* 3E54FC E010C03C 3C02E011 */ lui $v0, %hi(peach_star_beam_update)
/* 3E5500 E010C040 2442C198 */ addiu $v0, $v0, %lo(peach_star_beam_update)
/* 3E5504 E010C044 AFA2001C */ sw $v0, 0x1C($sp)
/* 3E5508 E010C048 3C02E011 */ lui $v0, %hi(peach_star_beam_render)
/* 3E550C E010C04C 2442C354 */ addiu $v0, $v0, %lo(peach_star_beam_render)
/* 3E5510 E010C050 AFA20020 */ sw $v0, 0x20($sp)
/* 3E5514 E010C054 24020078 */ addiu $v0, $zero, 0x78
/* 3E5518 E010C058 AFBF0034 */ sw $ra, 0x34($sp)
/* 3E551C E010C05C AFB00028 */ sw $s0, 0x28($sp)
/* 3E5520 E010C060 AFA00010 */ sw $zero, 0x10($sp)
/* 3E5524 E010C064 AFA00024 */ sw $zero, 0x24($sp)
/* 3E5528 E010C068 0C080124 */ jal shim_create_effect_instance
/* 3E552C E010C06C AFA20014 */ sw $v0, 0x14($sp)
/* 3E5530 E010C070 2404013C */ addiu $a0, $zero, 0x13C
/* 3E5534 E010C074 24030001 */ addiu $v1, $zero, 0x1
/* 3E5538 E010C078 0040802D */ daddu $s0, $v0, $zero
/* 3E553C E010C07C 0C08012C */ jal shim_general_heap_malloc
/* 3E5540 E010C080 AE030008 */ sw $v1, 0x8($s0)
/* 3E5544 E010C084 0040202D */ daddu $a0, $v0, $zero
/* 3E5548 E010C088 14800003 */ bnez $a0, .LE010C098
/* 3E554C E010C08C AE02000C */ sw $v0, 0xC($s0)
.LE010C090:
/* 3E5550 E010C090 08043024 */ j .LE010C090
/* 3E5554 E010C094 00000000 */ nop
.LE010C098:
/* 3E5558 E010C098 AC920000 */ sw $s2, 0x0($a0)
/* 3E555C E010C09C 1E200004 */ bgtz $s1, .LE010C0B0
/* 3E5560 E010C0A0 AC800014 */ sw $zero, 0x14($a0)
/* 3E5564 E010C0A4 240203E8 */ addiu $v0, $zero, 0x3E8
/* 3E5568 E010C0A8 0804302D */ j .LE010C0B4
/* 3E556C E010C0AC AC820010 */ sw $v0, 0x10($a0)
.LE010C0B0:
/* 3E5570 E010C0B0 AC910010 */ sw $s1, 0x10($a0)
.LE010C0B4:
/* 3E5574 E010C0B4 0000282D */ daddu $a1, $zero, $zero
/* 3E5578 E010C0B8 240200E0 */ addiu $v0, $zero, 0xE0
/* 3E557C E010C0BC AC820024 */ sw $v0, 0x24($a0)
/* 3E5580 E010C0C0 240200FF */ addiu $v0, $zero, 0xFF
/* 3E5584 E010C0C4 E4940004 */ swc1 $f20, 0x4($a0)
/* 3E5588 E010C0C8 E4980008 */ swc1 $f24, 0x8($a0)
/* 3E558C E010C0CC E496000C */ swc1 $f22, 0xC($a0)
/* 3E5590 E010C0D0 AC82003C */ sw $v0, 0x3C($a0)
/* 3E5594 E010C0D4 C7A00060 */ lwc1 $f0, 0x60($sp)
/* 3E5598 E010C0D8 3C0140A0 */ lui $at, (0x40A00000 >> 16)
/* 3E559C E010C0DC 44811000 */ mtc1 $at, $f2
/* 3E55A0 E010C0E0 24070001 */ addiu $a3, $zero, 0x1
/* 3E55A4 E010C0E4 E4800038 */ swc1 $f0, 0x38($a0)
/* 3E55A8 E010C0E8 3C0142A0 */ lui $at, (0x42A00000 >> 16)
/* 3E55AC E010C0EC 44810000 */ mtc1 $at, $f0
/* 3E55B0 E010C0F0 2406005C */ addiu $a2, $zero, 0x5C
/* 3E55B4 E010C0F4 E4800048 */ swc1 $f0, 0x48($a0)
/* 3E55B8 E010C0F8 3C014248 */ lui $at, (0x42480000 >> 16)
/* 3E55BC E010C0FC 44810000 */ mtc1 $at, $f0
/* 3E55C0 E010C100 24030078 */ addiu $v1, $zero, 0x78
/* 3E55C4 E010C104 AC820018 */ sw $v0, 0x18($a0)
/* 3E55C8 E010C108 AC82001C */ sw $v0, 0x1C($a0)
/* 3E55CC E010C10C AC830020 */ sw $v1, 0x20($a0)
/* 3E55D0 E010C110 AC820028 */ sw $v0, 0x28($a0)
/* 3E55D4 E010C114 AC82002C */ sw $v0, 0x2C($a0)
/* 3E55D8 E010C118 AC820030 */ sw $v0, 0x30($a0)
/* 3E55DC E010C11C AC820034 */ sw $v0, 0x34($a0)
/* 3E55E0 E010C120 AC800044 */ sw $zero, 0x44($a0)
/* 3E55E4 E010C124 E494004C */ swc1 $f20, 0x4C($a0)
/* 3E55E8 E010C128 E4960054 */ swc1 $f22, 0x54($a0)
/* 3E55EC E010C12C 4600C100 */ add.s $f4, $f24, $f0
/* 3E55F0 E010C130 E4820040 */ swc1 $f2, 0x40($a0)
/* 3E55F4 E010C134 E4800058 */ swc1 $f0, 0x58($a0)
/* 3E55F8 E010C138 E4840050 */ swc1 $f4, 0x50($a0)
.LE010C13C:
/* 3E55FC E010C13C 16400005 */ bnez $s2, .LE010C154
/* 3E5600 E010C140 00861021 */ addu $v0, $a0, $a2
/* 3E5604 E010C144 54A00004 */ bnel $a1, $zero, .LE010C158
/* 3E5608 E010C148 AC470000 */ sw $a3, 0x0($v0)
/* 3E560C E010C14C 08043056 */ j .LE010C158
/* 3E5610 E010C150 AC400000 */ sw $zero, 0x0($v0)
.LE010C154:
/* 3E5614 E010C154 AC470000 */ sw $a3, 0x0($v0)
.LE010C158:
/* 3E5618 E010C158 24A50001 */ addiu $a1, $a1, 0x1
/* 3E561C E010C15C 28A20008 */ slti $v0, $a1, 0x8
/* 3E5620 E010C160 1440FFF6 */ bnez $v0, .LE010C13C
/* 3E5624 E010C164 24C6001C */ addiu $a2, $a2, 0x1C
/* 3E5628 E010C168 0200102D */ daddu $v0, $s0, $zero
/* 3E562C E010C16C 8FBF0034 */ lw $ra, 0x34($sp)
/* 3E5630 E010C170 8FB20030 */ lw $s2, 0x30($sp)
/* 3E5634 E010C174 8FB1002C */ lw $s1, 0x2C($sp)
/* 3E5638 E010C178 8FB00028 */ lw $s0, 0x28($sp)
/* 3E563C E010C17C D7B80048 */ ldc1 $f24, 0x48($sp)
/* 3E5640 E010C180 D7B60040 */ ldc1 $f22, 0x40($sp)
/* 3E5644 E010C184 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 3E5648 E010C188 03E00008 */ jr $ra
/* 3E564C E010C18C 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s32 duration) {
EffectBlueprint bp;
EffectInstance* effect;
PeachStarBeamFXData* data;
s32 numParts = 1;
s32 i;
bp.unk_00 = 0;
bp.init = peach_star_beam_init;
bp.update = peach_star_beam_update;
bp.renderWorld = peach_star_beam_render;
bp.renderUI = NULL;
bp.effectID = EFFECT_PEACH_STAR_BEAM;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = effect->data.peachStarBeam = shim_general_heap_malloc(sizeof(*data));
ASSERT(effect->data.peachStarBeam != NULL);
data->type = type;
data->lifetime = 0;
if (duration <= 0) {
data->timeLeft = 1000;
} else {
data->timeLeft = duration;
}
data->beamAlpha = 224;
data->pos.x = x;
data->pos.y = y;
data->pos.z = z;
data->unk_3C = 255;
data->beamScale = arg4;
data->circleRadius = 80.0f;
data->twinkYOffset = 50.0f;
data->primR = 255;
data->primG = 255;
data->primB = 120;
data->envR = 255;
data->envG = 255;
data->envB = 255;
data->envA = 255;
data->rotationSpeed = 5.0f;
data->rotationAngle = 0;
data->circleCenter.x = x;
data->circleCenter.y = y + 50.0f;
data->circleCenter.z = z;
for (i = 0; i < ARRAY_COUNT(data->spirits); i++) {
PeachStarBeamSpirit* part = &data->spirits[i];
if (type == 0 && i == 0) {
part->flags = 0;
} else {
part->flags = 1;
}
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel create_shop_popup_menu
/* 8E474 800F4FC4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 8E478 800F4FC8 AFB00010 */ sw $s0, 0x10($sp)
/* 8E47C 800F4FCC 3C108011 */ lui $s0, %hi(gPopupMenu)
/* 8E480 800F4FD0 2610D69C */ addiu $s0, $s0, %lo(gPopupMenu)
/* 8E484 800F4FD4 AFBF0014 */ sw $ra, 0x14($sp)
/* 8E488 800F4FD8 AE040000 */ sw $a0, 0x0($s0)
/* 8E48C 800F4FDC A480032C */ sh $zero, 0x32C($a0)
/* 8E490 800F4FE0 AC80031C */ sw $zero, 0x31C($a0)
/* 8E494 800F4FE4 0C03A635 */ jal func_800E98D4
/* 8E498 800F4FE8 AC800320 */ sw $zero, 0x320($a0)
/* 8E49C 800F4FEC 3C048011 */ lui $a0, %hi(PopupDipMode)
/* 8E4A0 800F4FF0 2484D699 */ addiu $a0, $a0, %lo(PopupDipMode)
/* 8E4A4 800F4FF4 3C018011 */ lui $at, %hi(D_8010D69A)
/* 8E4A8 800F4FF8 A022D69A */ sb $v0, %lo(D_8010D69A)($at)
/* 8E4AC 800F4FFC A0800000 */ sb $zero, 0x0($a0)
/* 8E4B0 800F5000 8E100000 */ lw $s0, 0x0($s0)
/* 8E4B4 800F5004 3C068011 */ lui $a2, %hi(PopupNotDipping)
/* 8E4B8 800F5008 24C6D698 */ addiu $a2, $a2, %lo(PopupNotDipping)
/* 8E4BC 800F500C 8E030318 */ lw $v1, 0x318($s0)
/* 8E4C0 800F5010 24050001 */ addiu $a1, $zero, 0x1
/* 8E4C4 800F5014 28620064 */ slti $v0, $v1, 0x64
/* 8E4C8 800F5018 1440000C */ bnez $v0, .L800F504C
/* 8E4CC 800F501C A0C50000 */ sb $a1, 0x0($a2)
/* 8E4D0 800F5020 2462FF9C */ addiu $v0, $v1, -0x64
/* 8E4D4 800F5024 AE020318 */ sw $v0, 0x318($s0)
/* 8E4D8 800F5028 0040182D */ daddu $v1, $v0, $zero
/* 8E4DC 800F502C 28620064 */ slti $v0, $v1, 0x64
/* 8E4E0 800F5030 14400005 */ bnez $v0, .L800F5048
/* 8E4E4 800F5034 A0850000 */ sb $a1, 0x0($a0)
/* 8E4E8 800F5038 2462FF9C */ addiu $v0, $v1, -0x64
/* 8E4EC 800F503C AE020318 */ sw $v0, 0x318($s0)
/* 8E4F0 800F5040 24020002 */ addiu $v0, $zero, 0x2
/* 8E4F4 800F5044 A0820000 */ sb $v0, 0x0($a0)
.L800F5048:
/* 8E4F8 800F5048 A0C00000 */ sb $zero, 0x0($a2)
.L800F504C:
/* 8E4FC 800F504C 3C058011 */ lui $a1, %hi(gPopupMenu)
/* 8E500 800F5050 8CA5D69C */ lw $a1, %lo(gPopupMenu)($a1)
/* 8E504 800F5054 24020001 */ addiu $v0, $zero, 0x1
/* 8E508 800F5058 3C018011 */ lui $at, %hi(PopupNotBattle)
/* 8E50C 800F505C A022D68E */ sb $v0, %lo(PopupNotBattle)($at)
/* 8E510 800F5060 24020006 */ addiu $v0, $zero, 0x6
/* 8E514 800F5064 3C018011 */ lui $at, %hi(PopupMenu_MaxDisplayableEntryCount)
/* 8E518 800F5068 A022D68F */ sb $v0, %lo(PopupMenu_MaxDisplayableEntryCount)($at)
/* 8E51C 800F506C 8CA20328 */ lw $v0, 0x328($a1)
/* 8E520 800F5070 8CA40324 */ lw $a0, 0x324($a1)
/* 8E524 800F5074 3C038011 */ lui $v1, %hi(PopupMenu_SelectedIndex)
/* 8E528 800F5078 2463D648 */ addiu $v1, $v1, %lo(PopupMenu_SelectedIndex)
/* 8E52C 800F507C 3C018011 */ lui $at, %hi(gPopupState)
/* 8E530 800F5080 AC20D640 */ sw $zero, %lo(gPopupState)($at)
/* 8E534 800F5084 AC620000 */ sw $v0, 0x0($v1)
/* 8E538 800F5088 0044102A */ slt $v0, $v0, $a0
/* 8E53C 800F508C 14400002 */ bnez $v0, .L800F5098
/* 8E540 800F5090 2482FFFF */ addiu $v0, $a0, -0x1
/* 8E544 800F5094 AC620000 */ sw $v0, 0x0($v1)
.L800F5098:
/* 8E548 800F5098 8C620000 */ lw $v0, 0x0($v1)
/* 8E54C 800F509C 3C048011 */ lui $a0, %hi(PopupMenu_DisplayedEntryCount)
/* 8E550 800F50A0 2484D656 */ addiu $a0, $a0, %lo(PopupMenu_DisplayedEntryCount)
/* 8E554 800F50A4 3C018011 */ lui $at, %hi(PopupMenu_FirstDisplayIndex)
/* 8E558 800F50A8 A020D654 */ sb $zero, %lo(PopupMenu_FirstDisplayIndex)($at)
/* 8E55C 800F50AC 3C018011 */ lui $at, %hi(PopupMenu_PrevSelectedIndex)
/* 8E560 800F50B0 AC22D64C */ sw $v0, %lo(PopupMenu_PrevSelectedIndex)($at)
/* 8E564 800F50B4 90A20327 */ lbu $v0, 0x327($a1)
/* 8E568 800F50B8 24030006 */ addiu $v1, $zero, 0x6
/* 8E56C 800F50BC A0820000 */ sb $v0, 0x0($a0)
/* 8E570 800F50C0 00021600 */ sll $v0, $v0, 24
/* 8E574 800F50C4 00021603 */ sra $v0, $v0, 24
/* 8E578 800F50C8 0062102A */ slt $v0, $v1, $v0
/* 8E57C 800F50CC 54400001 */ bnel $v0, $zero, .L800F50D4
/* 8E580 800F50D0 A0830000 */ sb $v1, 0x0($a0)
.L800F50D4:
/* 8E584 800F50D4 8CA20324 */ lw $v0, 0x324($a1)
/* 8E588 800F50D8 3C048011 */ lui $a0, %hi(PopupMenu_LastDisplayIndex)
/* 8E58C 800F50DC 2484D655 */ addiu $a0, $a0, %lo(PopupMenu_LastDisplayIndex)
/* 8E590 800F50E0 28420006 */ slti $v0, $v0, 0x6
/* 8E594 800F50E4 10400003 */ beqz $v0, .L800F50F4
/* 8E598 800F50E8 A0830000 */ sb $v1, 0x0($a0)
/* 8E59C 800F50EC 90A20327 */ lbu $v0, 0x327($a1)
/* 8E5A0 800F50F0 A0820000 */ sb $v0, 0x0($a0)
.L800F50F4:
/* 8E5A4 800F50F4 240200FF */ addiu $v0, $zero, 0xFF
/* 8E5A8 800F50F8 3C018011 */ lui $at, %hi(PopupMenu_Alpha)
/* 8E5AC 800F50FC AC22D650 */ sw $v0, %lo(PopupMenu_Alpha)($at)
/* 8E5B0 800F5100 24020004 */ addiu $v0, $zero, 0x4
/* 8E5B4 800F5104 3C04800F */ lui $a0, %hi(popup_menu_update)
/* 8E5B8 800F5108 24841A10 */ addiu $a0, $a0, %lo(popup_menu_update)
/* 8E5BC 800F510C 3C018011 */ lui $at, %hi(D_8010D691)
/* 8E5C0 800F5110 A022D691 */ sb $v0, %lo(D_8010D691)($at)
/* 8E5C4 800F5114 3C018011 */ lui $at, %hi(D_8010D692)
/* 8E5C8 800F5118 A023D692 */ sb $v1, %lo(D_8010D692)($at)
/* 8E5CC 800F511C 0C048C8F */ jal create_worker_frontUI
/* 8E5D0 800F5120 0000282D */ daddu $a1, $zero, $zero
/* 8E5D4 800F5124 8FBF0014 */ lw $ra, 0x14($sp)
/* 8E5D8 800F5128 8FB00010 */ lw $s0, 0x10($sp)
/* 8E5DC 800F512C 3C018011 */ lui $at, %hi(gPopupWorker)
/* 8E5E0 800F5130 AC22D694 */ sw $v0, %lo(gPopupWorker)($at)
/* 8E5E4 800F5134 03E00008 */ jr $ra
/* 8E5E8 800F5138 27BD0018 */ addiu $sp, $sp, 0x18
### DECOMPILED C INSTRUCTIONS:
void create_shop_popup_menu(PopupMenu* popup) {
gPopupMenu = popup;
popup->result = POPUP_RESULT_CHOOSING;
popup->dipMode = 0;
popup->titleNumber = 0;
D_8010D69A = func_800E98D4();
PopupDipMode = 0;
PopupNotDipping = TRUE;
if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) {
gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP;
PopupDipMode = 1;
if (gPopupMenu->popupType >= POPUP_MENU_DOUBLE_DIP) {
gPopupMenu->popupType -= POPUP_MENU_DOUBLE_DIP;
PopupDipMode = 2;
}
PopupNotDipping = FALSE;
}
PopupNotBattle = TRUE;
PopupMenu_MaxDisplayableEntryCount = 6;
gPopupState = POPUP_STATE_INIT;
PopupMenu_SelectedIndex = gPopupMenu->initialPos;
if (PopupMenu_SelectedIndex >= gPopupMenu->numEntries) {
PopupMenu_SelectedIndex = gPopupMenu->numEntries - 1;
}
PopupMenu_FirstDisplayIndex = 0;
PopupMenu_PrevSelectedIndex = PopupMenu_SelectedIndex;
PopupMenu_DisplayedEntryCount = gPopupMenu->numEntries;
if (PopupMenu_DisplayedEntryCount > PopupMenu_MaxDisplayableEntryCount) {
PopupMenu_DisplayedEntryCount = PopupMenu_MaxDisplayableEntryCount;
}
PopupMenu_LastDisplayIndex = PopupMenu_MaxDisplayableEntryCount;
if (gPopupMenu->numEntries < PopupMenu_MaxDisplayableEntryCount) {
PopupMenu_LastDisplayIndex = gPopupMenu->numEntries;
}
PopupMenu_Alpha = 255;
D_8010D691 = 4;
D_8010D692 = 6;
gPopupWorker = create_worker_frontUI((void (*) (void)) popup_menu_update, NULL);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
dlabel D_8024BBAC
/* 13EEEC 8024BBAC 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 13EEF0 8024BBB0 AFB00018 */ sw $s0, 0x18($sp)
/* 13EEF4 8024BBB4 3C108027 */ lui $s0, %hi(gPausePartnersCurrentPartnerIdx)
D_8024BBB8:
/* 13EEF8 8024BBB8 261006A0 */ addiu $s0, $s0, %lo(gPausePartnersCurrentPartnerIdx)
/* 13EEFC 8024BBBC AFBF002C */ sw $ra, 0x2C($sp)
.L8024BBC0:
/* 13EF00 8024BBC0 AFB40028 */ sw $s4, 0x28($sp)
/* 13EF04 8024BBC4 AFB30024 */ sw $s3, 0x24($sp)
/* 13EF08 8024BBC8 AFB20020 */ sw $s2, 0x20($sp)
/* 13EF0C 8024BBCC AFB1001C */ sw $s1, 0x1C($sp)
D_8024BBD0:
/* 13EF10 8024BBD0 8E020000 */ lw $v0, 0x0($s0)
/* 13EF14 8024BBD4 00A0902D */ daddu $s2, $a1, $zero
/* 13EF18 8024BBD8 00021080 */ sll $v0, $v0, 2
/* 13EF1C 8024BBDC 3C018027 */ lui $at, %hi(gPausePartnersPartnerIdx)
/* 13EF20 8024BBE0 00220821 */ addu $at, $at, $v0
/* 13EF24 8024BBE4 8C220680 */ lw $v0, %lo(gPausePartnersPartnerIdx)($at)
D_8024BBE8:
/* 13EF28 8024BBE8 00C0982D */ daddu $s3, $a2, $zero
/* 13EF2C 8024BBEC 00021080 */ sll $v0, $v0, 2
/* 13EF30 8024BBF0 3C018025 */ lui $at, %hi(D_8024F6B0)
/* 13EF34 8024BBF4 00220821 */ addu $at, $at, $v0
/* 13EF38 8024BBF8 8C22F6B0 */ lw $v0, %lo(D_8024F6B0)($at)
/* 13EF3C 8024BBFC 00021100 */ sll $v0, $v0, 4
/* 13EF40 8024BC00 3C118009 */ lui $s1, %hi(gPartnerPopupProperties)
/* 13EF44 8024BC04 02228821 */ addu $s1, $s1, $v0
/* 13EF48 8024BC08 8E31EF20 */ lw $s1, %lo(gPartnerPopupProperties)($s1)
/* 13EF4C 8024BC0C 0C039D59 */ jal get_player_data
/* 13EF50 8024BC10 00E0A02D */ daddu $s4, $a3, $zero
/* 13EF54 8024BC14 8E030000 */ lw $v1, 0x0($s0)
/* 13EF58 8024BC18 00031880 */ sll $v1, $v1, 2
/* 13EF5C 8024BC1C 3C018027 */ lui $at, %hi(gPausePartnersPartnerIdx)
D_8024BC20:
/* 13EF60 8024BC20 00230821 */ addu $at, $at, $v1
D_8024BC24:
/* 13EF64 8024BC24 8C230680 */ lw $v1, %lo(gPausePartnersPartnerIdx)($at)
/* 13EF68 8024BC28 0000282D */ daddu $a1, $zero, $zero
/* 13EF6C 8024BC2C 00031880 */ sll $v1, $v1, 2
/* 13EF70 8024BC30 3C018025 */ lui $at, %hi(D_8024F6B0)
/* 13EF74 8024BC34 00230821 */ addu $at, $at, $v1
/* 13EF78 8024BC38 8C23F6B0 */ lw $v1, %lo(D_8024F6B0)($at)
/* 13EF7C 8024BC3C 000318C0 */ sll $v1, $v1, 3
/* 13EF80 8024BC40 00431021 */ addu $v0, $v0, $v1
/* 13EF84 8024BC44 80500015 */ lb $s0, 0x15($v0)
D_8024BC48_C094C8:
/* 13EF88 8024BC48 0C04991D */ jal get_msg_width
/* 13EF8C 8024BC4C 0220202D */ daddu $a0, $s1, $zero
/* 13EF90 8024BC50 0040302D */ daddu $a2, $v0, $zero
D_8024BC54:
/* 13EF94 8024BC54 24020001 */ addiu $v0, $zero, 0x1
D_8024BC58:
/* 13EF98 8024BC58 12020005 */ beq $s0, $v0, .L8024BC70
/* 13EF9C 8024BC5C 24030010 */ addiu $v1, $zero, 0x10
/* 13EFA0 8024BC60 24020002 */ addiu $v0, $zero, 0x2
/* 13EFA4 8024BC64 16020002 */ bne $s0, $v0, .L8024BC70
/* 13EFA8 8024BC68 0000182D */ daddu $v1, $zero, $zero
/* 13EFAC 8024BC6C 24030014 */ addiu $v1, $zero, 0x14
.L8024BC70:
/* 13EFB0 8024BC70 54600001 */ bnel $v1, $zero, .L8024BC78
/* 13EFB4 8024BC74 24C60004 */ addiu $a2, $a2, 0x4
.L8024BC78:
/* 13EFB8 8024BC78 0220202D */ daddu $a0, $s1, $zero
/* 13EFBC 8024BC7C 02832823 */ subu $a1, $s4, $v1
/* 13EFC0 8024BC80 00A62823 */ subu $a1, $a1, $a2
/* 13EFC4 8024BC84 00052843 */ sra $a1, $a1, 1
/* 13EFC8 8024BC88 02452821 */ addu $a1, $s2, $a1
/* 13EFCC 8024BC8C 26660001 */ addiu $a2, $s3, 0x1
D_8024BC90:
/* 13EFD0 8024BC90 240700FF */ addiu $a3, $zero, 0xFF
/* 13EFD4 8024BC94 AFA00010 */ sw $zero, 0x10($sp)
/* 13EFD8 8024BC98 0C04993B */ jal draw_msg
/* 13EFDC 8024BC9C AFA00014 */ sw $zero, 0x14($sp)
/* 13EFE0 8024BCA0 24020001 */ addiu $v0, $zero, 0x1
/* 13EFE4 8024BCA4 1602000A */ bne $s0, $v0, .L8024BCD0
/* 13EFE8 8024BCA8 24020002 */ addiu $v0, $zero, 0x2
D_8024BCAC:
/* 13EFEC 8024BCAC 2645005F */ addiu $a1, $s2, 0x5F
/* 13EFF0 8024BCB0 3C108027 */ lui $s0, %hi(gPausePartnersIconIDs)
/* 13EFF4 8024BCB4 26100640 */ addiu $s0, $s0, %lo(gPausePartnersIconIDs)
/* 13EFF8 8024BCB8 8E040008 */ lw $a0, 0x8($s0)
/* 13EFFC 8024BCBC 0C051261 */ jal hud_element_set_render_pos
/* 13F000 8024BCC0 2666000A */ addiu $a2, $s3, 0xA
/* 13F004 8024BCC4 8E040008 */ lw $a0, 0x8($s0)
D_8024BCC8:
/* 13F008 8024BCC8 08092F44 */ j .L8024BD10
/* 13F00C 8024BCCC 00000000 */ nop
.L8024BCD0:
/* 13F010 8024BCD0 16020011 */ bne $s0, $v0, .L8024BD18
D_8024BCD4:
/* 13F014 8024BCD4 2645005B */ addiu $a1, $s2, 0x5B
/* 13F018 8024BCD8 3C108027 */ lui $s0, %hi(gPausePartnersIconIDs)
/* 13F01C 8024BCDC 26100640 */ addiu $s0, $s0, %lo(gPausePartnersIconIDs)
/* 13F020 8024BCE0 2671000A */ addiu $s1, $s3, 0xA
/* 13F024 8024BCE4 8E040008 */ lw $a0, 0x8($s0)
/* 13F028 8024BCE8 0C051261 */ jal hud_element_set_render_pos
/* 13F02C 8024BCEC 0220302D */ daddu $a2, $s1, $zero
/* 13F030 8024BCF0 8E040008 */ lw $a0, 0x8($s0)
/* 13F034 8024BCF4 0C0511F8 */ jal hud_element_draw_without_clipping
dgb_01_D_8024BCF8_C09578:
/* 13F038 8024BCF8 00000000 */ nop
D_8024BCFC:
/* 13F03C 8024BCFC 26450065 */ addiu $a1, $s2, 0x65
D_8024BD00:
/* 13F040 8024BD00 8E04000C */ lw $a0, 0xC($s0)
/* 13F044 8024BD04 0C051261 */ jal hud_element_set_render_pos
/* 13F048 8024BD08 0220302D */ daddu $a2, $s1, $zero
/* 13F04C 8024BD0C 8E04000C */ lw $a0, 0xC($s0)
.L8024BD10:
/* 13F050 8024BD10 0C0511F8 */ jal hud_element_draw_without_clipping
/* 13F054 8024BD14 00000000 */ nop
.L8024BD18:
/* 13F058 8024BD18 8FBF002C */ lw $ra, 0x2C($sp)
/* 13F05C 8024BD1C 8FB40028 */ lw $s4, 0x28($sp)
/* 13F060 8024BD20 8FB30024 */ lw $s3, 0x24($sp)
/* 13F064 8024BD24 8FB20020 */ lw $s2, 0x20($sp)
D_8024BD28:
/* 13F068 8024BD28 8FB1001C */ lw $s1, 0x1C($sp)
/* 13F06C 8024BD2C 8FB00018 */ lw $s0, 0x18($sp)
/* 13F070 8024BD30 03E00008 */ jr $ra
/* 13F074 8024BD34 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
void pause_partners_draw_title(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
s32 msgID = gPartnerPopupProperties[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].nameMsg;
s32 level = get_player_data()->partners[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].level;
s32 msgWidth = get_msg_width(msgID, 0);
s32 offset = 16;
if (level != 1) {
offset = 0;
if (level == 2) {
offset = 20;
}
}
if (offset != 0) {
msgWidth += 4;
}
draw_msg(msgID, baseX + ((width - offset - msgWidth) >> 1), baseY + 1, 255, MSG_PAL_WHITE, 0);
if (level == 1) {
hud_element_set_render_pos(gPausePartnersIconIDs[2], baseX + 95, baseY + 10);
hud_element_draw_without_clipping(gPausePartnersIconIDs[2]);
} else if (level == 2) {
hud_element_set_render_pos(gPausePartnersIconIDs[2], baseX + 91, baseY + 10);
hud_element_draw_without_clipping(gPausePartnersIconIDs[2]);
hud_element_set_render_pos(gPausePartnersIconIDs[3], baseX + 101, baseY + 10);
hud_element_draw_without_clipping(gPausePartnersIconIDs[3]);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel osPfsDeleteFile
/* 439C0 800685C0 27BDFEA0 */ addiu $sp, $sp, -0x160
/* 439C4 800685C4 AFB10144 */ sw $s1, 0x144($sp)
/* 439C8 800685C8 00808821 */ addu $s1, $a0, $zero
/* 439CC 800685CC 8FA80170 */ lw $t0, 0x170($sp)
/* 439D0 800685D0 30A5FFFF */ andi $a1, $a1, 0xFFFF
/* 439D4 800685D4 2CA20001 */ sltiu $v0, $a1, 0x1
/* 439D8 800685D8 2CC30001 */ sltiu $v1, $a2, 0x1
/* 439DC 800685DC 00431025 */ or $v0, $v0, $v1
/* 439E0 800685E0 AFBF0158 */ sw $ra, 0x158($sp)
/* 439E4 800685E4 AFB50154 */ sw $s5, 0x154($sp)
/* 439E8 800685E8 AFB40150 */ sw $s4, 0x150($sp)
/* 439EC 800685EC AFB3014C */ sw $s3, 0x14C($sp)
/* 439F0 800685F0 AFB20148 */ sw $s2, 0x148($sp)
/* 439F4 800685F4 10400003 */ beqz $v0, .L80068604
/* 439F8 800685F8 AFB00140 */ sw $s0, 0x140($sp)
/* 439FC 800685FC 0801A1D2 */ j .L80068748
/* 43A00 80068600 24020005 */ addiu $v0, $zero, 0x5
.L80068604:
/* 43A04 80068604 02202021 */ addu $a0, $s1, $zero
/* 43A08 80068608 27A20138 */ addiu $v0, $sp, 0x138
/* 43A0C 8006860C AFA80010 */ sw $t0, 0x10($sp)
/* 43A10 80068610 0C01A370 */ jal osPfsFindFile
/* 43A14 80068614 AFA20014 */ sw $v0, 0x14($sp)
/* 43A18 80068618 1440004B */ bnez $v0, .L80068748
/* 43A1C 8006861C 00000000 */ nop
/* 43A20 80068620 92220065 */ lbu $v0, 0x65($s1)
/* 43A24 80068624 10400005 */ beqz $v0, .L8006863C
/* 43A28 80068628 02202021 */ addu $a0, $s1, $zero
/* 43A2C 8006862C 0C01A5B4 */ jal __osPfsSelectBank
/* 43A30 80068630 00002821 */ addu $a1, $zero, $zero
/* 43A34 80068634 14400044 */ bnez $v0, .L80068748
/* 43A38 80068638 00000000 */ nop
.L8006863C:
/* 43A3C 8006863C 8E240004 */ lw $a0, 0x4($s1)
/* 43A40 80068640 8E26005C */ lw $a2, 0x5C($s1)
/* 43A44 80068644 8FA20138 */ lw $v0, 0x138($sp)
/* 43A48 80068648 8E250008 */ lw $a1, 0x8($s1)
/* 43A4C 8006864C 27A70118 */ addiu $a3, $sp, 0x118
/* 43A50 80068650 00C23021 */ addu $a2, $a2, $v0
/* 43A54 80068654 0C01A874 */ jal __osContRamRead
/* 43A58 80068658 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 43A5C 8006865C 1440003A */ bnez $v0, .L80068748
/* 43A60 80068660 00000000 */ nop
/* 43A64 80068664 93B3011E */ lbu $s3, 0x11E($sp)
/* 43A68 80068668 92220064 */ lbu $v0, 0x64($s1)
/* 43A6C 8006866C 93B2011F */ lbu $s2, 0x11F($sp)
/* 43A70 80068670 327000FF */ andi $s0, $s3, 0xFF
/* 43A74 80068674 0202102B */ sltu $v0, $s0, $v0
/* 43A78 80068678 10400032 */ beqz $v0, .L80068744
/* 43A7C 8006867C 27B4013C */ addiu $s4, $sp, 0x13C
/* 43A80 80068680 24150001 */ addiu $s5, $zero, 0x1
/* 43A84 80068684 02202021 */ addu $a0, $s1, $zero
.L80068688:
/* 43A88 80068688 27A50018 */ addiu $a1, $sp, 0x18
/* 43A8C 8006868C 00003021 */ addu $a2, $zero, $zero
/* 43A90 80068690 0C01A7A3 */ jal __osPfsRWInode
/* 43A94 80068694 02003821 */ addu $a3, $s0, $zero
/* 43A98 80068698 1440002B */ bnez $v0, .L80068748
/* 43A9C 8006869C 02202021 */ addu $a0, $s1, $zero
/* 43AA0 800686A0 AFB40010 */ sw $s4, 0x10($sp)
/* 43AA4 800686A4 27A50018 */ addiu $a1, $sp, 0x18
/* 43AA8 800686A8 02403021 */ addu $a2, $s2, $zero
/* 43AAC 800686AC 0C01A1DB */ jal osPfsReleasePages
/* 43AB0 800686B0 02003821 */ addu $a3, $s0, $zero
/* 43AB4 800686B4 14400024 */ bnez $v0, .L80068748
/* 43AB8 800686B8 02202021 */ addu $a0, $s1, $zero
/* 43ABC 800686BC 27A50018 */ addiu $a1, $sp, 0x18
/* 43AC0 800686C0 24060001 */ addiu $a2, $zero, 0x1
/* 43AC4 800686C4 0C01A7A3 */ jal __osPfsRWInode
/* 43AC8 800686C8 02003821 */ addu $a3, $s0, $zero
/* 43ACC 800686CC 1440001E */ bnez $v0, .L80068748
/* 43AD0 800686D0 00000000 */ nop
/* 43AD4 800686D4 97A2013C */ lhu $v0, 0x13C($sp)
/* 43AD8 800686D8 10550008 */ beq $v0, $s5, .L800686FC
/* 43ADC 800686DC 00000000 */ nop
/* 43AE0 800686E0 93B3013C */ lbu $s3, 0x13C($sp)
/* 43AE4 800686E4 92220064 */ lbu $v0, 0x64($s1)
/* 43AE8 800686E8 93B2013D */ lbu $s2, 0x13D($sp)
/* 43AEC 800686EC 327000FF */ andi $s0, $s3, 0xFF
/* 43AF0 800686F0 0202102B */ sltu $v0, $s0, $v0
/* 43AF4 800686F4 1440FFE4 */ bnez $v0, .L80068688
/* 43AF8 800686F8 02202021 */ addu $a0, $s1, $zero
.L800686FC:
/* 43AFC 800686FC 92220064 */ lbu $v0, 0x64($s1)
/* 43B00 80068700 0262102B */ sltu $v0, $s3, $v0
/* 43B04 80068704 1040000F */ beqz $v0, .L80068744
/* 43B08 80068708 27B00118 */ addiu $s0, $sp, 0x118
/* 43B0C 8006870C 02002021 */ addu $a0, $s0, $zero
/* 43B10 80068710 0C01925C */ jal bzero
/* 43B14 80068714 24050020 */ addiu $a1, $zero, 0x20
/* 43B18 80068718 8E26005C */ lw $a2, 0x5C($s1)
/* 43B1C 8006871C 8FA20138 */ lw $v0, 0x138($sp)
/* 43B20 80068720 AFA00010 */ sw $zero, 0x10($sp)
/* 43B24 80068724 8E240004 */ lw $a0, 0x4($s1)
/* 43B28 80068728 8E250008 */ lw $a1, 0x8($s1)
/* 43B2C 8006872C 02003821 */ addu $a3, $s0, $zero
/* 43B30 80068730 00C23021 */ addu $a2, $a2, $v0
/* 43B34 80068734 0C01A8F0 */ jal osContRamWrite
/* 43B38 80068738 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 43B3C 8006873C 0801A1D2 */ j .L80068748
/* 43B40 80068740 00000000 */ nop
.L80068744:
/* 43B44 80068744 24020003 */ addiu $v0, $zero, 0x3
.L80068748:
/* 43B48 80068748 8FBF0158 */ lw $ra, 0x158($sp)
/* 43B4C 8006874C 8FB50154 */ lw $s5, 0x154($sp)
/* 43B50 80068750 8FB40150 */ lw $s4, 0x150($sp)
/* 43B54 80068754 8FB3014C */ lw $s3, 0x14C($sp)
/* 43B58 80068758 8FB20148 */ lw $s2, 0x148($sp)
/* 43B5C 8006875C 8FB10144 */ lw $s1, 0x144($sp)
/* 43B60 80068760 8FB00140 */ lw $s0, 0x140($sp)
/* 43B64 80068764 03E00008 */ jr $ra
/* 43B68 80068768 27BD0160 */ addiu $sp, $sp, 0x160
### DECOMPILED C INSTRUCTIONS:
s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName) {
s32 file_no;
s32 ret;
__OSInode inode;
__OSDir dir;
__OSInodeUnit last_page;
u8 startpage;
u8 bank;
if ((companyCode == 0) || (gameCode == 0)) {
return PFS_ERR_INVALID;
}
if ((ret = osPfsFindFile(pfs, companyCode, gameCode, gameName, extName, &file_no)) != 0) {
return ret;
}
if ((pfs->activebank != 0) && (ret = __osPfsSelectBank(pfs, 0)) != 0) {
return ret;
}
if ((ret = __osContRamRead(pfs->queue, pfs->channel, pfs->dir_table + file_no, (u8*)&dir)) != 0) {
return ret;
}
startpage = dir.start_page.inode_t.page;
for (bank = dir.start_page.inode_t.bank; bank < pfs->banks;) {
if ((ret = __osPfsRWInode(pfs, &inode, PFS_READ, bank)) != 0) {
return ret;
}
if ((ret = __osPfsReleasePages(pfs, &inode, startpage, bank, &last_page)) != 0) {
return ret;
}
if ((ret = __osPfsRWInode(pfs, &inode, PFS_WRITE, bank)) != 0) {
return ret;
}
if (last_page.ipage == PFS_EOF) {
break;
}
bank = last_page.inode_t.bank;
startpage = last_page.inode_t.page;
}
if (bank >= pfs->banks) {
return PFS_ERR_INCONSISTENT;
}
bzero(&dir, sizeof(__OSDir));
ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->dir_table + file_no, (u8*)&dir, 0);
return ret;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel nuGfxTaskMgrInit
/* 7F38 8002CB38 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 7F3C 8002CB3C 24020008 */ addiu $v0, $zero, 0x8
/* 7F40 8002CB40 3C01800A */ lui $at, %hi(taskDoneMsg)
/* 7F44 8002CB44 A422C514 */ sh $v0, %lo(taskDoneMsg)($at)
/* 7F48 8002CB48 24020004 */ addiu $v0, $zero, 0x4
/* 7F4C 8002CB4C 3C01800A */ lui $at, %hi(swapBufMsg)
/* 7F50 8002CB50 A422C516 */ sh $v0, %lo(swapBufMsg)($at)
/* 7F54 8002CB54 3C02800A */ lui $v0, %hi(nuGfxTaskSpool)
/* 7F58 8002CB58 2442A618 */ addiu $v0, $v0, %lo(nuGfxTaskSpool)
/* 7F5C 8002CB5C AFBF0038 */ sw $ra, 0x38($sp)
/* 7F60 8002CB60 AFB70034 */ sw $s7, 0x34($sp)
/* 7F64 8002CB64 AFB60030 */ sw $s6, 0x30($sp)
/* 7F68 8002CB68 AFB5002C */ sw $s5, 0x2C($sp)
/* 7F6C 8002CB6C AFB40028 */ sw $s4, 0x28($sp)
/* 7F70 8002CB70 AFB30024 */ sw $s3, 0x24($sp)
/* 7F74 8002CB74 AFB20020 */ sw $s2, 0x20($sp)
/* 7F78 8002CB78 AFB1001C */ sw $s1, 0x1C($sp)
/* 7F7C 8002CB7C AFB00018 */ sw $s0, 0x18($sp)
/* 7F80 8002CB80 AC400000 */ sw $zero, 0x0($v0)
/* 7F84 8002CB84 0C017D00 */ jal nuGfxDisplayOff
/* 7F88 8002CB88 0000902D */ daddu $s2, $zero, $zero
/* 7F8C 8002CB8C 3C10800A */ lui $s0, %hi(GfxTaskMgrThread)
/* 7F90 8002CB90 2610C518 */ addiu $s0, $s0, %lo(GfxTaskMgrThread)
/* 7F94 8002CB94 0200202D */ daddu $a0, $s0, $zero
/* 7F98 8002CB98 24050005 */ addiu $a1, $zero, 0x5
/* 7F9C 8002CB9C 3C068003 */ lui $a2, %hi(nuGfxTaskMgr)
/* 7FA0 8002CBA0 24C6CA40 */ addiu $a2, $a2, %lo(nuGfxTaskMgr)
/* 7FA4 8002CBA4 3C02800A */ lui $v0, %hi(D_8009E6D0)
/* 7FA8 8002CBA8 2442E6D0 */ addiu $v0, $v0, %lo(D_8009E6D0)
/* 7FAC 8002CBAC AFA20010 */ sw $v0, 0x10($sp)
/* 7FB0 8002CBB0 2402003C */ addiu $v0, $zero, 0x3C
/* 7FB4 8002CBB4 0000382D */ daddu $a3, $zero, $zero
/* 7FB8 8002CBB8 0C019798 */ jal osCreateThread
/* 7FBC 8002CBBC AFA20014 */ sw $v0, 0x14($sp)
/* 7FC0 8002CBC0 0C019808 */ jal osStartThread
/* 7FC4 8002CBC4 0200202D */ daddu $a0, $s0, $zero
/* 7FC8 8002CBC8 3C17800E */ lui $s7, %hi(D_800DAC90)
/* 7FCC 8002CBCC 26F7AC90 */ addiu $s7, $s7, %lo(D_800DAC90)
/* 7FD0 8002CBD0 24160001 */ addiu $s6, $zero, 0x1
/* 7FD4 8002CBD4 3C13800E */ lui $s3, %hi(rspbootUcodeBuffer)
/* 7FD8 8002CBD8 26739780 */ addiu $s3, $s3, %lo(rspbootUcodeBuffer)
/* 7FDC 8002CBDC 24150100 */ addiu $s5, $zero, 0x100
/* 7FE0 8002CBE0 24141000 */ addiu $s4, $zero, 0x1000
/* 7FE4 8002CBE4 3C02800E */ lui $v0, %hi(nuGfxTask)
/* 7FE8 8002CBE8 24429278 */ addiu $v0, $v0, %lo(nuGfxTask)
/* 7FEC 8002CBEC 0040802D */ daddu $s0, $v0, $zero
/* 7FF0 8002CBF0 26110058 */ addiu $s1, $s0, 0x58
.L8002CBF4:
/* 7FF4 8002CBF4 3C04B000 */ lui $a0, (0xB0000B70 >> 16)
/* 7FF8 8002CBF8 34840B70 */ ori $a0, $a0, (0xB0000B70 & 0xFFFF)
/* 7FFC 8002CBFC 3C05B000 */ lui $a1, (0xB0000C70 >> 16)
/* 8000 8002CC00 34A50C70 */ ori $a1, $a1, (0xB0000C70 & 0xFFFF)
/* 8004 8002CC04 0260302D */ daddu $a2, $s3, $zero
/* 8008 8002CC08 AE110000 */ sw $s1, 0x0($s0)
/* 800C 8002CC0C AE170050 */ sw $s7, 0x50($s0)
/* 8010 8002CC10 AE160010 */ sw $s6, 0x10($s0)
/* 8014 8002CC14 0C00A5CF */ jal dma_copy
/* 8018 8002CC18 AE000014 */ sw $zero, 0x14($s0)
/* 801C 8002CC1C 24020800 */ addiu $v0, $zero, 0x800
/* 8020 8002CC20 AE02002C */ sw $v0, 0x2C($s0)
/* 8024 8002CC24 3C02800E */ lui $v0, %hi(D_800DA040)
/* 8028 8002CC28 2442A040 */ addiu $v0, $v0, %lo(D_800DA040)
/* 802C 8002CC2C AE020030 */ sw $v0, 0x30($s0)
/* 8030 8002CC30 24020400 */ addiu $v0, $zero, 0x400
/* 8034 8002CC34 AE020034 */ sw $v0, 0x34($s0)
/* 8038 8002CC38 3C02800C */ lui $v0, %hi(D_800B91D0)
/* 803C 8002CC3C 244291D0 */ addiu $v0, $v0, %lo(D_800B91D0)
/* 8040 8002CC40 AE020038 */ sw $v0, 0x38($s0)
/* 8044 8002CC44 3C02800E */ lui $v0, %hi(gZoneCollisionData)
/* 8048 8002CC48 244291D0 */ addiu $v0, $v0, %lo(gZoneCollisionData)
/* 804C 8002CC4C AE02003C */ sw $v0, 0x3C($s0)
/* 8050 8002CC50 3C02800C */ lui $v0, %hi(nuYieldBuf)
/* 8054 8002CC54 24428590 */ addiu $v0, $v0, %lo(nuYieldBuf)
/* 8058 8002CC58 AE020048 */ sw $v0, 0x48($s0)
/* 805C 8002CC5C 24020C10 */ addiu $v0, $zero, 0xC10
/* 8060 8002CC60 AE130018 */ sw $s3, 0x18($s0)
/* 8064 8002CC64 AE15001C */ sw $s5, 0x1C($s0)
/* 8068 8002CC68 AE140024 */ sw $s4, 0x24($s0)
/* 806C 8002CC6C AE02004C */ sw $v0, 0x4C($s0)
/* 8070 8002CC70 26100058 */ addiu $s0, $s0, 0x58
/* 8074 8002CC74 26520001 */ addiu $s2, $s2, 0x1
/* 8078 8002CC78 2E42000A */ sltiu $v0, $s2, 0xA
/* 807C 8002CC7C 1440FFDD */ bnez $v0, .L8002CBF4
/* 8080 8002CC80 26310058 */ addiu $s1, $s1, 0x58
/* 8084 8002CC84 3C02800E */ lui $v0, %hi(nuGfxTask)
/* 8088 8002CC88 24429278 */ addiu $v0, $v0, %lo(nuGfxTask)
/* 808C 8002CC8C AC420318 */ sw $v0, 0x318($v0)
/* 8090 8002CC90 8FBF0038 */ lw $ra, 0x38($sp)
/* 8094 8002CC94 8FB70034 */ lw $s7, 0x34($sp)
/* 8098 8002CC98 8FB60030 */ lw $s6, 0x30($sp)
/* 809C 8002CC9C 8FB5002C */ lw $s5, 0x2C($sp)
/* 80A0 8002CCA0 8FB40028 */ lw $s4, 0x28($sp)
/* 80A4 8002CCA4 8FB30024 */ lw $s3, 0x24($sp)
/* 80A8 8002CCA8 8FB20020 */ lw $s2, 0x20($sp)
/* 80AC 8002CCAC 8FB1001C */ lw $s1, 0x1C($sp)
/* 80B0 8002CCB0 8FB00018 */ lw $s0, 0x18($sp)
/* 80B4 8002CCB4 3C01800A */ lui $at, %hi(nuGfxTask_ptr)
/* 80B8 8002CCB8 AC22C510 */ sw $v0, %lo(nuGfxTask_ptr)($at)
/* 80BC 8002CCBC 03E00008 */ jr $ra
/* 80C0 8002CCC0 27BD0040 */ addiu $sp, $sp, 0x40
### DECOMPILED C INSTRUCTIONS:
void nuGfxTaskMgrInit(void) {
u32 i;
taskDoneMsg = NU_SC_GTASKEND_MSG;
swapBufMsg = NU_SC_SWAPBUFFER_MSG;
nuGfxTaskSpool = 0;
nuGfxDisplayOff();
osCreateThread(&GfxTaskMgrThread, NU_GFX_TASKMGR_THREAD_ID, nuGfxTaskMgr, NULL, &GfxTaskMgrStack[NU_GFX_TASKMGR_STACK_SIZE / sizeof(u64)], NU_GFX_TASKMGR_THREAD_PRI);
osStartThread(&GfxTaskMgrThread);
for (i = 0; i < NU_GFX_TASK_NUM; i++) {
nuGfxTask[i].next = &nuGfxTask[i + 1];
nuGfxTask[i].msgQ = &D_800DAC90;
nuGfxTask[i].list.t.type = M_GFXTASK;
nuGfxTask[i].list.t.flags = 0;
#if VERSION_IQUE
nuGfxTask[i].list.t.ucode_boot = (u64*) rspbootTextStart;
nuGfxTask[i].list.t.ucode_boot_size = (u32) rspbootTextEnd - (u32) rspbootTextStart;
#else
dma_copy((u8* )0xB0000B70, (u8* )0xB0000C70, rspbootUcodeBuffer);
nuGfxTask[i].list.t.ucode_boot = (u64*) rspbootUcodeBuffer;
nuGfxTask[i].list.t.ucode_boot_size = 0x100;
#endif
nuGfxTask[i].list.t.ucode_size = SP_UCODE_SIZE;
nuGfxTask[i].list.t.ucode_data_size = SP_UCODE_DATA_SIZE;
nuGfxTask[i].list.t.dram_stack = (u64*) &D_800DA040;
nuGfxTask[i].list.t.dram_stack_size = SP_DRAM_STACK_SIZE8;
nuGfxTask[i].list.t.output_buff = (u64*) &D_800B91D0;
nuGfxTask[i].list.t.output_buff_size = (u64*) &D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)];
nuGfxTask[i].list.t.yield_data_ptr = (u64*) &nuYieldBuf;
nuGfxTask[i].list.t.yield_data_size = NU_GFX_YIELD_BUF_SIZE;
}
nuGfxTask[NU_GFX_TASK_NUM - 1].next = &nuGfxTask[0];
nuGfxTask_ptr = &nuGfxTask[0];
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_802B61E4
/* E23444 802B61E4 27BDFFE0 */ addiu $sp, $sp, -0x20
.L802B61E8:
/* E23448 802B61E8 AFB00018 */ sw $s0, 0x18($sp)
.L802B61EC:
/* E2344C 802B61EC 3C108011 */ lui $s0, %hi(gPlayerStatus)
.L802B61F0:
/* E23450 802B61F0 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus)
.L802B61F4:
/* E23454 802B61F4 AFBF001C */ sw $ra, 0x1C($sp)
.L802B61F8:
/* E23458 802B61F8 8E030000 */ lw $v1, 0x0($s0)
.L802B61FC:
/* E2345C 802B61FC 0461002A */ bgez $v1, .L802B62A8
.L802B6200:
/* E23460 802B6200 3C027FFF */ lui $v0, (0x7FFFFFFF >> 16)
.L802B6204:
/* E23464 802B6204 3442FFFF */ ori $v0, $v0, (0x7FFFFFFF & 0xFFFF)
glabel .L802B6208
/* E23468 802B6208 00621024 */ and $v0, $v1, $v0
/* E2346C 802B620C 8E030004 */ lw $v1, 0x4($s0)
.L802B6210:
/* E23470 802B6210 2404FFF1 */ addiu $a0, $zero, -0xF
.L802B6214:
/* E23474 802B6214 AE020000 */ sw $v0, 0x0($s0)
glabel .L802B6218
/* E23478 802B6218 00441024 */ and $v0, $v0, $a0
/* E2347C 802B621C A20000B6 */ sb $zero, 0xB6($s0)
.L802B6220:
/* E23480 802B6220 A6000008 */ sh $zero, 0x8($s0)
.L802B6224:
/* E23484 802B6224 A60000C0 */ sh $zero, 0xC0($s0)
glabel .L802B6228
/* E23488 802B6228 A60000C2 */ sh $zero, 0xC2($s0)
.L802B622C:
/* E2348C 802B622C AE000054 */ sw $zero, 0x54($s0)
glabel action_update_step_up_peach
/* E23490 802B6230 30632000 */ andi $v1, $v1, 0x2000
/* E23494 802B6234 14600013 */ bnez $v1, .L802B6284
glabel .L802B6238
/* E23498 802B6238 AE020000 */ sw $v0, 0x0($s0)
glabel .L802B623C
/* E2349C 802B623C 3C038007 */ lui $v1, %hi(gGameStatusPtr)
glabel .L802B6240
/* E234A0 802B6240 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
glabel .L802B6244
/* E234A4 802B6244 9062007E */ lbu $v0, 0x7E($v1)
glabel .L802B6248
/* E234A8 802B6248 30420010 */ andi $v0, $v0, 0x10
/* E234AC 802B624C 14400009 */ bnez $v0, .L802B6274
glabel .L802B6250
/* E234B0 802B6250 3C04000C */ lui $a0, (0xC000E >> 16)
.L802B6254:
/* E234B4 802B6254 90620080 */ lbu $v0, 0x80($v1)
glabel .L802B6258
/* E234B8 802B6258 00021080 */ sll $v0, $v0, 2
.L802B625C:
/* E234BC 802B625C 3C04802B */ lui $a0, %hi(D_802B6430)
/* E234C0 802B6260 00822021 */ addu $a0, $a0, $v0
/* E234C4 802B6264 0C037FBF */ jal suggest_player_anim_allow_backward
.L802B6268:
/* E234C8 802B6268 8C846430 */ lw $a0, %lo(D_802B6430)($a0)
.L802B626C:
/* E234CC 802B626C 080AD8AA */ j .L802B62A8
/* E234D0 802B6270 00000000 */ nop
.L802B6274:
/* E234D4 802B6274 0C037FBF */ jal suggest_player_anim_allow_backward
glabel .L802B6278
/* E234D8 802B6278 3484000E */ ori $a0, $a0, (0xC000E & 0xFFFF)
/* E234DC 802B627C 080AD8AA */ j .L802B62A8
.L802B6280:
/* E234E0 802B6280 00000000 */ nop
.L802B6284:
/* E234E4 802B6284 8203000C */ lb $v1, 0xC($s0)
glabel action_update_run
/* E234E8 802B6288 00031040 */ sll $v0, $v1, 1
/* E234EC 802B628C 00431021 */ addu $v0, $v0, $v1
.L802B6290:
/* E234F0 802B6290 000210C0 */ sll $v0, $v0, 3
glabel func_802B6294
/* E234F4 802B6294 3C04800F */ lui $a0, %hi(BasicPeachDisguiseAnims)
glabel .L802B6298
/* E234F8 802B6298 00822021 */ addu $a0, $a0, $v0
/* E234FC 802B629C 8C847C1C */ lw $a0, %lo(BasicPeachDisguiseAnims)($a0)
/* E23500 802B62A0 0C0398DB */ jal peach_set_disguise_anim
glabel func_802B62A4
/* E23504 802B62A4 00000000 */ nop
.L802B62A8:
/* E23508 802B62A8 8E020004 */ lw $v0, 0x4($s0)
/* E2350C 802B62AC 30422000 */ andi $v0, $v0, 0x2000
jtbl_802B62B0:
/* E23510 802B62B0 1440004C */ bnez $v0, .L802B63E4
.L802B62B4:
/* E23514 802B62B4 27A40010 */ addiu $a0, $sp, 0x10
glabel .L802B62B8
/* E23518 802B62B8 24020001 */ addiu $v0, $zero, 0x1
/* E2351C 802B62BC 820300B6 */ lb $v1, 0xB6($s0)
/* E23520 802B62C0 920500B6 */ lbu $a1, 0xB6($s0)
/* E23524 802B62C4 10620022 */ beq $v1, $v0, PlayerTweesterPhysicsPtr
.L802B62C8:
/* E23528 802B62C8 28620002 */ slti $v0, $v1, 0x2
glabel action_update_peach_land
/* E2352C 802B62CC 10400005 */ beqz $v0, .L802B62E4
### DECOMPILED C INSTRUCTIONS:
void action_update_idle_peach(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
PlayerData* playerData = &gPlayerData;
f32 angle, magnitude;
if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT;
playerStatus->currentStateTime = 0;
playerStatus->timeInAir = 0;
playerStatus->peakJumpTime = 0;
playerStatus->currentSpeed = 0.0f;
playerStatus->flags &= ~PS_FLAG_AIRBORNE;
if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) {
if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) {
suggest_player_anim_allow_backward(IdlePeachAnims[gGameStatusPtr->peachBakingIngredient]);
} else {
suggest_player_anim_allow_backward(ANIM_Peach2_SadStill);
}
} else {
peach_set_disguise_anim(BasicPeachDisguiseAnims[gPlayerStatus.peachDisguise].idle);
}
}
if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) {
switch (playerStatus->actionSubstate) {
case SUBSTATE_IDLE_DEFAULT:
if (!(playerStatus->flags & (PS_FLAG_NO_STATIC_COLLISION | PS_FLAG_INPUT_DISABLED))
&& (playerStatus->peachItemHeld == 0)) {
if (playerStatus->currentStateTime > 1800) {
// begin first yawm
playerStatus->actionSubstate++;
suggest_player_anim_allow_backward(ANIM_Peach2_Yawn);
return;
}
playerStatus->currentStateTime++;
}
break;
case SUBSTATE_IDLE_STRETCH:
// waiting for yawn to finish
if (playerStatus->animNotifyValue != 0) {
playerStatus->actionSubstate++;
playerStatus->currentStateTime = 0;
suggest_player_anim_allow_backward(ANIM_Peach1_Idle);
}
break;
case SUBSTATE_DELAY_SLEEP:
// delay before next yawn and sleep
playerStatus->currentStateTime++;
if (playerStatus->currentStateTime > 200) {
playerStatus->actionSubstate++;
suggest_player_anim_allow_backward(ANIM_Peach2_Yawn);
}
break;
case SUBSTATE_IDLE_SLEEP:
// peach is asleep
if (playerStatus->flags & (PS_FLAG_NO_STATIC_COLLISION | PS_FLAG_INPUT_DISABLED)) {
suggest_player_anim_allow_backward(ANIM_Peach1_Idle);
playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT;
} else if (playerStatus->animNotifyValue != 0) {
suggest_player_anim_allow_backward(ANIM_Peach2_Sleep);
}
break;
}
}
player_input_to_move_vector(&angle, &magnitude);
phys_update_interact_collider();
if (magnitude != 0.0f) {
playerStatus->currentStateTime = 0;
playerStatus->targetYaw = angle;
set_action_state(ACTION_STATE_WALK);
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel InterpPlayerYaw
/* F62EC 802D193C 27BDFFD0 */ addiu $sp, $sp, -0x30
/* F62F0 802D1940 AFB10014 */ sw $s1, 0x14($sp)
/* F62F4 802D1944 0080882D */ daddu $s1, $a0, $zero
/* F62F8 802D1948 AFB50024 */ sw $s5, 0x24($sp)
/* F62FC 802D194C 3C158011 */ lui $s5, %hi(gPlayerStatus)
/* F6300 802D1950 26B5EFC8 */ addiu $s5, $s5, %lo(gPlayerStatus)
/* F6304 802D1954 AFB60028 */ sw $s6, 0x28($sp)
/* F6308 802D1958 26360074 */ addiu $s6, $s1, 0x74
/* F630C 802D195C AFB40020 */ sw $s4, 0x20($sp)
/* F6310 802D1960 26340078 */ addiu $s4, $s1, 0x78
/* F6314 802D1964 AFB3001C */ sw $s3, 0x1C($sp)
/* F6318 802D1968 AFBF002C */ sw $ra, 0x2C($sp)
/* F631C 802D196C AFB20018 */ sw $s2, 0x18($sp)
/* F6320 802D1970 AFB00010 */ sw $s0, 0x10($sp)
/* F6324 802D1974 8E32000C */ lw $s2, 0xC($s1)
/* F6328 802D1978 10A0002C */ beqz $a1, .L802D1A2C
/* F632C 802D197C 2633007C */ addiu $s3, $s1, 0x7C
/* F6330 802D1980 3C10802E */ lui $s0, %hi(playerNpc)
/* F6334 802D1984 26109D20 */ addiu $s0, $s0, %lo(playerNpc)
/* F6338 802D1988 8E020000 */ lw $v0, 0x0($s0)
/* F633C 802D198C C6A00080 */ lwc1 $f0, 0x80($s5)
/* F6340 802D1990 E440000C */ swc1 $f0, 0xC($v0)
/* F6344 802D1994 E6200074 */ swc1 $f0, 0x74($s1)
/* F6348 802D1998 8E450000 */ lw $a1, 0x0($s2)
/* F634C 802D199C 0C0B210B */ jal evt_get_float_variable
/* F6350 802D19A0 26520004 */ addiu $s2, $s2, 0x4
/* F6354 802D19A4 C6220074 */ lwc1 $f2, 0x74($s1)
/* F6358 802D19A8 46020001 */ sub.s $f0, $f0, $f2
/* F635C 802D19AC E6200078 */ swc1 $f0, 0x78($s1)
/* F6360 802D19B0 8E450000 */ lw $a1, 0x0($s2)
/* F6364 802D19B4 0C0B1EAF */ jal evt_get_variable
/* F6368 802D19B8 0220202D */ daddu $a0, $s1, $zero
/* F636C 802D19BC AE22007C */ sw $v0, 0x7C($s1)
/* F6370 802D19C0 8E020000 */ lw $v0, 0x0($s0)
/* F6374 802D19C4 3C01C334 */ lui $at, (0xC3340000 >> 16)
/* F6378 802D19C8 44810000 */ mtc1 $at, $f0
/* F637C 802D19CC A440008E */ sh $zero, 0x8E($v0)
/* F6380 802D19D0 C6220078 */ lwc1 $f2, 0x78($s1)
/* F6384 802D19D4 4600103C */ c.lt.s $f2, $f0
/* F6388 802D19D8 00000000 */ nop
/* F638C 802D19DC 45000007 */ bc1f .L802D19FC
/* F6390 802D19E0 00000000 */ nop
/* F6394 802D19E4 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* F6398 802D19E8 44810000 */ mtc1 $at, $f0
/* F639C 802D19EC 00000000 */ nop
/* F63A0 802D19F0 46001000 */ add.s $f0, $f2, $f0
/* F63A4 802D19F4 E6200078 */ swc1 $f0, 0x78($s1)
/* F63A8 802D19F8 C6220078 */ lwc1 $f2, 0x78($s1)
.L802D19FC:
/* F63AC 802D19FC 3C014334 */ lui $at, (0x43340000 >> 16)
/* F63B0 802D1A00 44810000 */ mtc1 $at, $f0
/* F63B4 802D1A04 00000000 */ nop
/* F63B8 802D1A08 4602003C */ c.lt.s $f0, $f2
/* F63BC 802D1A0C 00000000 */ nop
/* F63C0 802D1A10 45000006 */ bc1f .L802D1A2C
/* F63C4 802D1A14 00000000 */ nop
/* F63C8 802D1A18 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* F63CC 802D1A1C 44810000 */ mtc1 $at, $f0
/* F63D0 802D1A20 00000000 */ nop
/* F63D4 802D1A24 46001001 */ sub.s $f0, $f2, $f0
/* F63D8 802D1A28 E6200078 */ swc1 $f0, 0x78($s1)
.L802D1A2C:
/* F63DC 802D1A2C 8E620000 */ lw $v0, 0x0($s3)
/* F63E0 802D1A30 1C40000E */ bgtz $v0, .L802D1A6C
/* F63E4 802D1A34 00000000 */ nop
/* F63E8 802D1A38 3C10802E */ lui $s0, %hi(playerNpc)
/* F63EC 802D1A3C 26109D20 */ addiu $s0, $s0, %lo(playerNpc)
/* F63F0 802D1A40 8E020000 */ lw $v0, 0x0($s0)
/* F63F4 802D1A44 C6800000 */ lwc1 $f0, 0x0($s4)
/* F63F8 802D1A48 C44C000C */ lwc1 $f12, 0xC($v0)
/* F63FC 802D1A4C 46006300 */ add.s $f12, $f12, $f0
/* F6400 802D1A50 0C00A6C9 */ jal clamp_angle
/* F6404 802D1A54 E44C000C */ swc1 $f12, 0xC($v0)
/* F6408 802D1A58 8E030000 */ lw $v1, 0x0($s0)
/* F640C 802D1A5C 24020002 */ addiu $v0, $zero, 0x2
/* F6410 802D1A60 E460000C */ swc1 $f0, 0xC($v1)
/* F6414 802D1A64 080B46B7 */ j .L802D1ADC
/* F6418 802D1A68 E6A00080 */ swc1 $f0, 0x80($s5)
.L802D1A6C:
/* F641C 802D1A6C 3C10802E */ lui $s0, %hi(playerNpc)
/* F6420 802D1A70 26109D20 */ addiu $s0, $s0, %lo(playerNpc)
/* F6424 802D1A74 8E030000 */ lw $v1, 0x0($s0)
/* F6428 802D1A78 9462008E */ lhu $v0, 0x8E($v1)
/* F642C 802D1A7C 24420001 */ addiu $v0, $v0, 0x1
/* F6430 802D1A80 A462008E */ sh $v0, 0x8E($v1)
/* F6434 802D1A84 00021400 */ sll $v0, $v0, 16
/* F6438 802D1A88 00021403 */ sra $v0, $v0, 16
/* F643C 802D1A8C C6800000 */ lwc1 $f0, 0x0($s4)
/* F6440 802D1A90 44821000 */ mtc1 $v0, $f2
/* F6444 802D1A94 00000000 */ nop
/* F6448 802D1A98 468010A0 */ cvt.s.w $f2, $f2
/* F644C 802D1A9C 46020002 */ mul.s $f0, $f0, $f2
/* F6450 802D1AA0 00000000 */ nop
/* F6454 802D1AA4 C6CC0000 */ lwc1 $f12, 0x0($s6)
/* F6458 802D1AA8 C6620000 */ lwc1 $f2, 0x0($s3)
/* F645C 802D1AAC 468010A0 */ cvt.s.w $f2, $f2
/* F6460 802D1AB0 46020003 */ div.s $f0, $f0, $f2
/* F6464 802D1AB4 46006300 */ add.s $f12, $f12, $f0
/* F6468 802D1AB8 0C00A6C9 */ jal clamp_angle
/* F646C 802D1ABC E46C000C */ swc1 $f12, 0xC($v1)
/* F6470 802D1AC0 8E020000 */ lw $v0, 0x0($s0)
/* F6474 802D1AC4 E440000C */ swc1 $f0, 0xC($v0)
/* F6478 802D1AC8 E6A00080 */ swc1 $f0, 0x80($s5)
/* F647C 802D1ACC 8442008E */ lh $v0, 0x8E($v0)
/* F6480 802D1AD0 8E630000 */ lw $v1, 0x0($s3)
/* F6484 802D1AD4 0043102A */ slt $v0, $v0, $v1
/* F6488 802D1AD8 38420001 */ xori $v0, $v0, 0x1
.L802D1ADC:
/* F648C 802D1ADC 8FBF002C */ lw $ra, 0x2C($sp)
/* F6490 802D1AE0 8FB60028 */ lw $s6, 0x28($sp)
/* F6494 802D1AE4 8FB50024 */ lw $s5, 0x24($sp)
/* F6498 802D1AE8 8FB40020 */ lw $s4, 0x20($sp)
/* F649C 802D1AEC 8FB3001C */ lw $s3, 0x1C($sp)
/* F64A0 802D1AF0 8FB20018 */ lw $s2, 0x18($sp)
/* F64A4 802D1AF4 8FB10014 */ lw $s1, 0x14($sp)
/* F64A8 802D1AF8 8FB00010 */ lw $s0, 0x10($sp)
/* F64AC 802D1AFC 03E00008 */ jr $ra
/* F64B0 802D1B00 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
ApiStatus InterpPlayerYaw(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
PlayerStatus* playerStatus = &gPlayerStatus;
f32* initialYaw = &script->functionTempF[1];
f32* deltaYaw = &script->functionTempF[2];
s32* time = &script->functionTemp[3];
if (isInitialCall) {
playerNpc->yaw = playerStatus->targetYaw;
*initialYaw = playerNpc->yaw;
*deltaYaw = evt_get_float_variable(script, *args++) - *initialYaw;
*time = evt_get_variable(script, *args++);
playerNpc->duration = 0;
if (*deltaYaw < -180.0f) {
*deltaYaw += 360.0f;
}
if (*deltaYaw > 180.0f) {
*deltaYaw -= 360.0f;
}
}
if (*time > 0) {
playerNpc->duration++;
playerNpc->yaw = *initialYaw + ((*deltaYaw * playerNpc->duration) / *time);
playerNpc->yaw = clamp_angle(playerNpc->yaw);
playerStatus->targetYaw = playerNpc->yaw;
return !(playerNpc->duration < *time);
} else {
playerNpc->yaw += *deltaYaw;
playerNpc->yaw = clamp_angle(playerNpc->yaw);
playerStatus->targetYaw = playerNpc->yaw;
return ApiStatus_DONE2;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel npc_reload_all
/* 165B0 8003B1B0 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 165B4 8003B1B4 AFB20018 */ sw $s2, 0x18($sp)
/* 165B8 8003B1B8 0000902D */ daddu $s2, $zero, $zero
/* 165BC 8003B1BC AFB40020 */ sw $s4, 0x20($sp)
/* 165C0 8003B1C0 3C144000 */ lui $s4, (0x40000000 >> 16)
/* 165C4 8003B1C4 AFB3001C */ sw $s3, 0x1C($sp)
/* 165C8 8003B1C8 3C130100 */ lui $s3, (0x1000000 >> 16)
/* 165CC 8003B1CC AFBF0024 */ sw $ra, 0x24($sp)
/* 165D0 8003B1D0 AFB10014 */ sw $s1, 0x14($sp)
/* 165D4 8003B1D4 AFB00010 */ sw $s0, 0x10($sp)
.L8003B1D8:
/* 165D8 8003B1D8 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr)
/* 165DC 8003B1DC 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1)
/* 165E0 8003B1E0 00121080 */ sll $v0, $s2, 2
/* 165E4 8003B1E4 00431021 */ addu $v0, $v0, $v1
/* 165E8 8003B1E8 8C510000 */ lw $s1, 0x0($v0)
/* 165EC 8003B1EC 52200049 */ beql $s1, $zero, .L8003B314
/* 165F0 8003B1F0 26520001 */ addiu $s2, $s2, 0x1
/* 165F4 8003B1F4 8E230000 */ lw $v1, 0x0($s1)
/* 165F8 8003B1F8 50600046 */ beql $v1, $zero, .L8003B314
/* 165FC 8003B1FC 26520001 */ addiu $s2, $s2, 0x1
/* 16600 8003B200 00741024 */ and $v0, $v1, $s4
/* 16604 8003B204 54400043 */ bnel $v0, $zero, .L8003B314
/* 16608 8003B208 26520001 */ addiu $s2, $s2, 0x1
/* 1660C 8003B20C 00731024 */ and $v0, $v1, $s3
/* 16610 8003B210 14400010 */ bnez $v0, .L8003B254
/* 16614 8003B214 00741024 */ and $v0, $v1, $s4
/* 16618 8003B218 3C020400 */ lui $v0, (0x4000000 >> 16)
/* 1661C 8003B21C 00621024 */ and $v0, $v1, $v0
/* 16620 8003B220 14400004 */ bnez $v0, .L8003B234
/* 16624 8003B224 3C048000 */ lui $a0, (0x80000000 >> 16)
/* 16628 8003B228 8E240028 */ lw $a0, 0x28($s1)
/* 1662C 8003B22C 0800EC90 */ j .L8003B240
/* 16630 8003B230 8E2500B0 */ lw $a1, 0xB0($s1)
.L8003B234:
/* 16634 8003B234 8E220028 */ lw $v0, 0x28($s1)
/* 16638 8003B238 8E2500B0 */ lw $a1, 0xB0($s1)
/* 1663C 8003B23C 00442025 */ or $a0, $v0, $a0
.L8003B240:
/* 16640 8003B240 0C0B783B */ jal spr_load_npc_sprite
/* 16644 8003B244 00000000 */ nop
/* 16648 8003B248 AE220024 */ sw $v0, 0x24($s1)
/* 1664C 8003B24C 8E230000 */ lw $v1, 0x0($s1)
/* 16650 8003B250 00741024 */ and $v0, $v1, $s4
.L8003B254:
/* 16654 8003B254 5440002F */ bnel $v0, $zero, .L8003B314
/* 16658 8003B258 26520001 */ addiu $s2, $s2, 0x1
/* 1665C 8003B25C 00731024 */ and $v0, $v1, $s3
/* 16660 8003B260 1440001A */ bnez $v0, .L8003B2CC
/* 16664 8003B264 00000000 */ nop
/* 16668 8003B268 822200B4 */ lb $v0, 0xB4($s1)
/* 1666C 8003B26C 10400017 */ beqz $v0, .L8003B2CC
/* 16670 8003B270 00000000 */ nop
/* 16674 8003B274 0C0B7A90 */ jal spr_get_npc_palettes
/* 16678 8003B278 96240028 */ lhu $a0, 0x28($s1)
/* 1667C 8003B27C AE2200C4 */ sw $v0, 0xC4($s1)
/* 16680 8003B280 0040202D */ daddu $a0, $v0, $zero
/* 16684 8003B284 A22000C1 */ sb $zero, 0xC1($s1)
/* 16688 8003B288 8C830000 */ lw $v1, 0x0($a0)
/* 1668C 8003B28C 2402FFFF */ addiu $v0, $zero, -0x1
/* 16690 8003B290 1062000B */ beq $v1, $v0, .L8003B2C0
/* 16694 8003B294 0080182D */ daddu $v1, $a0, $zero
/* 16698 8003B298 0040202D */ daddu $a0, $v0, $zero
.L8003B29C:
/* 1669C 8003B29C 922200C1 */ lbu $v0, 0xC1($s1)
/* 166A0 8003B2A0 24420001 */ addiu $v0, $v0, 0x1
/* 166A4 8003B2A4 A22200C1 */ sb $v0, 0xC1($s1)
/* 166A8 8003B2A8 00021600 */ sll $v0, $v0, 24
/* 166AC 8003B2AC 00021583 */ sra $v0, $v0, 22
/* 166B0 8003B2B0 00431021 */ addu $v0, $v0, $v1
/* 166B4 8003B2B4 8C420000 */ lw $v0, 0x0($v0)
/* 166B8 8003B2B8 1444FFF8 */ bne $v0, $a0, .L8003B29C
/* 166BC 8003B2BC 00000000 */ nop
.L8003B2C0:
/* 166C0 8003B2C0 0C0B7A9B */ jal spr_get_npc_color_variations
/* 166C4 8003B2C4 96240028 */ lhu $a0, 0x28($s1)
/* 166C8 8003B2C8 A22200C0 */ sb $v0, 0xC0($s1)
.L8003B2CC:
/* 166CC 8003B2CC 8E230000 */ lw $v1, 0x0($s1)
/* 166D0 8003B2D0 00741024 */ and $v0, $v1, $s4
/* 166D4 8003B2D4 5440000F */ bnel $v0, $zero, .L8003B314
/* 166D8 8003B2D8 26520001 */ addiu $s2, $s2, 0x1
/* 166DC 8003B2DC 00731024 */ and $v0, $v1, $s3
/* 166E0 8003B2E0 5440000C */ bnel $v0, $zero, .L8003B314
/* 166E4 8003B2E4 26520001 */ addiu $s2, $s2, 0x1
/* 166E8 8003B2E8 0000802D */ daddu $s0, $zero, $zero
/* 166EC 8003B2EC 0220202D */ daddu $a0, $s1, $zero
.L8003B2F0:
/* 166F0 8003B2F0 0C00F187 */ jal npc_reset_current_decoration
/* 166F4 8003B2F4 0200282D */ daddu $a1, $s0, $zero
/* 166F8 8003B2F8 26100001 */ addiu $s0, $s0, 0x1
/* 166FC 8003B2FC 2A020002 */ slti $v0, $s0, 0x2
/* 16700 8003B300 1440FFFB */ bnez $v0, .L8003B2F0
/* 16704 8003B304 0220202D */ daddu $a0, $s1, $zero
/* 16708 8003B308 0C00F4EF */ jal npc_imgfx_update
/* 1670C 8003B30C 0220202D */ daddu $a0, $s1, $zero
/* 16710 8003B310 26520001 */ addiu $s2, $s2, 0x1
.L8003B314:
/* 16714 8003B314 2A420040 */ slti $v0, $s2, 0x40
/* 16718 8003B318 1440FFAF */ bnez $v0, .L8003B1D8
/* 1671C 8003B31C 00000000 */ nop
/* 16720 8003B320 8FBF0024 */ lw $ra, 0x24($sp)
/* 16724 8003B324 8FB40020 */ lw $s4, 0x20($sp)
/* 16728 8003B328 8FB3001C */ lw $s3, 0x1C($sp)
/* 1672C 8003B32C 8FB20018 */ lw $s2, 0x18($sp)
/* 16730 8003B330 8FB10014 */ lw $s1, 0x14($sp)
/* 16734 8003B334 8FB00010 */ lw $s0, 0x10($sp)
/* 16738 8003B338 03E00008 */ jr $ra
/* 1673C 8003B33C 27BD0028 */ addiu $sp, $sp, 0x28
### DECOMPILED C INSTRUCTIONS:
void npc_reload_all(void) {
s32 i;
s32 j;
for (i = 0; i < MAX_NPCS; i++) {
Npc* npc = (*gCurrentNpcListPtr)[i];
if (npc != NULL) {
if (npc->flags && !(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
if (!(npc->flags & NPC_FLAG_PARTNER)) {
npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim, npc->extraAnimList);
} else {
npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim | SPRITE_ID_TAIL_ALLOCATE, npc->extraAnimList);
}
}
if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->palSwapType != 0)) {
npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16);
npc->paletteCount = 0;
while (npc->spritePaletteList[npc->paletteCount] != (PAL_PTR) -1) {
npc->paletteCount++;
}
npc->unk_C0 = spr_get_npc_color_variations(npc->currentAnim >> 16);
}
if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) {
for (j = 0; j < 2; j++) {
npc_reset_current_decoration(npc, j);
}
npc_imgfx_update(npc);
}
}
}
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel InterpNpcYaw
/* F34B4 802CEB04 27BDFFD0 */ addiu $sp, $sp, -0x30
/* F34B8 802CEB08 AFB20018 */ sw $s2, 0x18($sp)
/* F34BC 802CEB0C 0080902D */ daddu $s2, $a0, $zero
/* F34C0 802CEB10 AFB50024 */ sw $s5, 0x24($sp)
/* F34C4 802CEB14 26550074 */ addiu $s5, $s2, 0x74
/* F34C8 802CEB18 AFB40020 */ sw $s4, 0x20($sp)
/* F34CC 802CEB1C 26540078 */ addiu $s4, $s2, 0x78
/* F34D0 802CEB20 AFB3001C */ sw $s3, 0x1C($sp)
/* F34D4 802CEB24 AFBF0028 */ sw $ra, 0x28($sp)
/* F34D8 802CEB28 AFB10014 */ sw $s1, 0x14($sp)
/* F34DC 802CEB2C AFB00010 */ sw $s0, 0x10($sp)
/* F34E0 802CEB30 8E51000C */ lw $s1, 0xC($s2)
/* F34E4 802CEB34 10A0003B */ beqz $a1, .L802CEC24
/* F34E8 802CEB38 2653007C */ addiu $s3, $s2, 0x7C
/* F34EC 802CEB3C 8E250000 */ lw $a1, 0x0($s1)
/* F34F0 802CEB40 0C0B1EAF */ jal evt_get_variable
/* F34F4 802CEB44 26310004 */ addiu $s1, $s1, 0x4
/* F34F8 802CEB48 0240202D */ daddu $a0, $s2, $zero
/* F34FC 802CEB4C 0C0B36B0 */ jal resolve_npc
/* F3500 802CEB50 0040282D */ daddu $a1, $v0, $zero
/* F3504 802CEB54 0040802D */ daddu $s0, $v0, $zero
/* F3508 802CEB58 12000052 */ beqz $s0, .L802CECA4
/* F350C 802CEB5C 24020002 */ addiu $v0, $zero, 0x2
/* F3510 802CEB60 C600000C */ lwc1 $f0, 0xC($s0)
/* F3514 802CEB64 E6400074 */ swc1 $f0, 0x74($s2)
/* F3518 802CEB68 8E250000 */ lw $a1, 0x0($s1)
/* F351C 802CEB6C 0C0B1EAF */ jal evt_get_variable
/* F3520 802CEB70 0240202D */ daddu $a0, $s2, $zero
/* F3524 802CEB74 C6420074 */ lwc1 $f2, 0x74($s2)
/* F3528 802CEB78 44820000 */ mtc1 $v0, $f0
/* F352C 802CEB7C 00000000 */ nop
/* F3530 802CEB80 46800020 */ cvt.s.w $f0, $f0
/* F3534 802CEB84 46020001 */ sub.s $f0, $f0, $f2
/* F3538 802CEB88 26310004 */ addiu $s1, $s1, 0x4
/* F353C 802CEB8C AE500070 */ sw $s0, 0x70($s2)
/* F3540 802CEB90 E6400078 */ swc1 $f0, 0x78($s2)
/* F3544 802CEB94 8E250000 */ lw $a1, 0x0($s1)
/* F3548 802CEB98 0C0B1EAF */ jal evt_get_variable
/* F354C 802CEB9C 0240202D */ daddu $a0, $s2, $zero
/* F3550 802CEBA0 14400005 */ bnez $v0, .L802CEBB8
/* F3554 802CEBA4 AE42007C */ sw $v0, 0x7C($s2)
/* F3558 802CEBA8 C600000C */ lwc1 $f0, 0xC($s0)
/* F355C 802CEBAC C6420078 */ lwc1 $f2, 0x78($s2)
/* F3560 802CEBB0 080B3B0F */ j .L802CEC3C
/* F3564 802CEBB4 46020000 */ add.s $f0, $f0, $f2
.L802CEBB8:
/* F3568 802CEBB8 A600008E */ sh $zero, 0x8E($s0)
/* F356C 802CEBBC C6420078 */ lwc1 $f2, 0x78($s2)
/* F3570 802CEBC0 3C01C334 */ lui $at, (0xC3340000 >> 16)
/* F3574 802CEBC4 44810000 */ mtc1 $at, $f0
/* F3578 802CEBC8 00000000 */ nop
/* F357C 802CEBCC 4600103C */ c.lt.s $f2, $f0
/* F3580 802CEBD0 00000000 */ nop
/* F3584 802CEBD4 45000007 */ bc1f .L802CEBF4
/* F3588 802CEBD8 00000000 */ nop
/* F358C 802CEBDC 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* F3590 802CEBE0 44810000 */ mtc1 $at, $f0
/* F3594 802CEBE4 00000000 */ nop
/* F3598 802CEBE8 46001000 */ add.s $f0, $f2, $f0
/* F359C 802CEBEC E6400078 */ swc1 $f0, 0x78($s2)
/* F35A0 802CEBF0 C6420078 */ lwc1 $f2, 0x78($s2)
.L802CEBF4:
/* F35A4 802CEBF4 3C014334 */ lui $at, (0x43340000 >> 16)
/* F35A8 802CEBF8 44810000 */ mtc1 $at, $f0
/* F35AC 802CEBFC 00000000 */ nop
/* F35B0 802CEC00 4602003C */ c.lt.s $f0, $f2
/* F35B4 802CEC04 00000000 */ nop
/* F35B8 802CEC08 45000006 */ bc1f .L802CEC24
/* F35BC 802CEC0C 00000000 */ nop
/* F35C0 802CEC10 3C0143B4 */ lui $at, (0x43B40000 >> 16)
/* F35C4 802CEC14 44810000 */ mtc1 $at, $f0
/* F35C8 802CEC18 00000000 */ nop
/* F35CC 802CEC1C 46001001 */ sub.s $f0, $f2, $f0
/* F35D0 802CEC20 E6400078 */ swc1 $f0, 0x78($s2)
.L802CEC24:
/* F35D4 802CEC24 8E620000 */ lw $v0, 0x0($s3)
/* F35D8 802CEC28 1C400007 */ bgtz $v0, .L802CEC48
/* F35DC 802CEC2C 8E500070 */ lw $s0, 0x70($s2)
/* F35E0 802CEC30 C600000C */ lwc1 $f0, 0xC($s0)
/* F35E4 802CEC34 C6820000 */ lwc1 $f2, 0x0($s4)
/* F35E8 802CEC38 46020000 */ add.s $f0, $f0, $f2
.L802CEC3C:
/* F35EC 802CEC3C 24020002 */ addiu $v0, $zero, 0x2
/* F35F0 802CEC40 080B3B29 */ j .L802CECA4
/* F35F4 802CEC44 E600000C */ swc1 $f0, 0xC($s0)
.L802CEC48:
/* F35F8 802CEC48 9602008E */ lhu $v0, 0x8E($s0)
/* F35FC 802CEC4C 24420001 */ addiu $v0, $v0, 0x1
/* F3600 802CEC50 A602008E */ sh $v0, 0x8E($s0)
/* F3604 802CEC54 00021400 */ sll $v0, $v0, 16
/* F3608 802CEC58 00021403 */ sra $v0, $v0, 16
/* F360C 802CEC5C C6800000 */ lwc1 $f0, 0x0($s4)
/* F3610 802CEC60 44821000 */ mtc1 $v0, $f2
/* F3614 802CEC64 00000000 */ nop
/* F3618 802CEC68 468010A0 */ cvt.s.w $f2, $f2
/* F361C 802CEC6C 46020002 */ mul.s $f0, $f0, $f2
/* F3620 802CEC70 00000000 */ nop
/* F3624 802CEC74 C6AC0000 */ lwc1 $f12, 0x0($s5)
/* F3628 802CEC78 C6620000 */ lwc1 $f2, 0x0($s3)
/* F362C 802CEC7C 468010A0 */ cvt.s.w $f2, $f2
/* F3630 802CEC80 46020003 */ div.s $f0, $f0, $f2
/* F3634 802CEC84 46006300 */ add.s $f12, $f12, $f0
/* F3638 802CEC88 0C00A6C9 */ jal clamp_angle
/* F363C 802CEC8C E60C000C */ swc1 $f12, 0xC($s0)
/* F3640 802CEC90 8602008E */ lh $v0, 0x8E($s0)
/* F3644 802CEC94 E600000C */ swc1 $f0, 0xC($s0)
/* F3648 802CEC98 8E630000 */ lw $v1, 0x0($s3)
/* F364C 802CEC9C 0043102A */ slt $v0, $v0, $v1
/* F3650 802CECA0 38420001 */ xori $v0, $v0, 0x1
.L802CECA4:
/* F3654 802CECA4 8FBF0028 */ lw $ra, 0x28($sp)
/* F3658 802CECA8 8FB50024 */ lw $s5, 0x24($sp)
/* F365C 802CECAC 8FB40020 */ lw $s4, 0x20($sp)
/* F3660 802CECB0 8FB3001C */ lw $s3, 0x1C($sp)
/* F3664 802CECB4 8FB20018 */ lw $s2, 0x18($sp)
/* F3668 802CECB8 8FB10014 */ lw $s1, 0x14($sp)
/* F366C 802CECBC 8FB00010 */ lw $s0, 0x10($sp)
/* F3670 802CECC0 03E00008 */ jr $ra
/* F3674 802CECC4 27BD0030 */ addiu $sp, $sp, 0x30
### DECOMPILED C INSTRUCTIONS:
ApiStatus InterpNpcYaw(Evt* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
f32* initialYaw = &script->functionTempF[1];
f32* deltaYaw = &script->functionTempF[2];
s32* turnTime = &script->functionTemp[3];
Npc* npc;
if (isInitialCall) {
s32 npcID = evt_get_variable(script, *args++);
npc = resolve_npc(script, npcID);
if (npc == NULL) {
return ApiStatus_DONE2;
}
*initialYaw = npc->yaw;
*deltaYaw = evt_get_variable(script, *args++) - *initialYaw;
script->functionTempPtr[0] = npc;
*turnTime = evt_get_variable(script, *args++);
if (*turnTime == 0) {
npc->yaw += *deltaYaw;
return ApiStatus_DONE2;
}
npc->duration = 0;
if (*deltaYaw < -180.0f) {
*deltaYaw += 360.0f;
}
if (*deltaYaw > 180.0f) {
*deltaYaw -= 360.0f;
}
}
npc = script->functionTempPtr[0];
if (*turnTime > 0) {
npc->duration++;
npc->yaw = *initialYaw + ((*deltaYaw * npc->duration) / *turnTime);
npc->yaw = clamp_angle(npc->yaw);
return !(npc->duration < *turnTime) * ApiStatus_DONE1;
}
npc->yaw += *deltaYaw;
return ApiStatus_DONE2;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel func_8011B1D8
/* B18D8 8011B1D8 27BDFFC8 */ addiu $sp, $sp, -0x38
/* B18DC 8011B1DC AFB50024 */ sw $s5, 0x24($sp)
/* B18E0 8011B1E0 0080A82D */ daddu $s5, $a0, $zero
/* B18E4 8011B1E4 AFBF0030 */ sw $ra, 0x30($sp)
/* B18E8 8011B1E8 AFB7002C */ sw $s7, 0x2C($sp)
/* B18EC 8011B1EC AFB60028 */ sw $s6, 0x28($sp)
/* B18F0 8011B1F0 AFB40020 */ sw $s4, 0x20($sp)
/* B18F4 8011B1F4 AFB3001C */ sw $s3, 0x1C($sp)
/* B18F8 8011B1F8 AFB20018 */ sw $s2, 0x18($sp)
/* B18FC 8011B1FC AFB10014 */ sw $s1, 0x14($sp)
/* B1900 8011B200 AFB00010 */ sw $s0, 0x10($sp)
/* B1904 8011B204 8EA30000 */ lw $v1, 0x0($s5)
/* B1908 8011B208 24020002 */ addiu $v0, $zero, 0x2
/* B190C 8011B20C 14620007 */ bne $v1, $v0, .L8011B22C
/* B1910 8011B210 24020005 */ addiu $v0, $zero, 0x5
/* B1914 8011B214 3C028015 */ lui $v0, %hi(D_80153226)
/* B1918 8011B218 94423226 */ lhu $v0, %lo(D_80153226)($v0)
/* B191C 8011B21C 3C018015 */ lui $at, %hi(D_80153376)
/* B1920 8011B220 A4223376 */ sh $v0, %lo(D_80153376)($at)
/* B1924 8011B224 08046CD4 */ j .L8011B350
/* B1928 8011B228 00000000 */ nop
.L8011B22C:
/* B192C 8011B22C 14620019 */ bne $v1, $v0, .L8011B294
/* B1930 8011B230 02A0202D */ daddu $a0, $s5, $zero
/* B1934 8011B234 0C0456C3 */ jal get_model_property
/* B1938 8011B238 24050060 */ addiu $a1, $zero, 0x60
/* B193C 8011B23C 10400015 */ beqz $v0, .L8011B294
/* B1940 8011B240 00000000 */ nop
/* B1944 8011B244 8C420008 */ lw $v0, 0x8($v0)
/* B1948 8011B248 10400012 */ beqz $v0, .L8011B294
/* B194C 8011B24C 00000000 */ nop
/* B1950 8011B250 0C04572A */ jal mdl_get_child_count
/* B1954 8011B254 02A0202D */ daddu $a0, $s5, $zero
/* B1958 8011B258 3C038015 */ lui $v1, %hi(mdl_treeIterPos)
/* B195C 8011B25C 24633224 */ addiu $v1, $v1, %lo(mdl_treeIterPos)
/* B1960 8011B260 8C640000 */ lw $a0, 0x0($v1)
/* B1964 8011B264 00822021 */ addu $a0, $a0, $v0
/* B1968 8011B268 AC640000 */ sw $a0, 0x0($v1)
/* B196C 8011B26C 94620002 */ lhu $v0, 0x2($v1)
/* B1970 8011B270 3C018015 */ lui $at, %hi(D_80153376)
/* B1974 8011B274 A4223376 */ sh $v0, %lo(D_80153376)($at)
/* B1978 8011B278 08046CD4 */ j .L8011B350
/* B197C 8011B27C 00000000 */ nop
.L8011B280:
/* B1980 8011B280 AED00000 */ sw $s0, 0x0($s6)
/* B1984 8011B284 3C018015 */ lui $at, %hi(D_80153374)
/* B1988 8011B288 A4323374 */ sh $s2, %lo(D_80153374)($at)
/* B198C 8011B28C 08046CD4 */ j .L8011B350
/* B1990 8011B290 00000000 */ nop
.L8011B294:
/* B1994 8011B294 8EA20010 */ lw $v0, 0x10($s5)
/* B1998 8011B298 1040002D */ beqz $v0, .L8011B350
/* B199C 8011B29C 00000000 */ nop
/* B19A0 8011B2A0 8C53000C */ lw $s3, 0xC($v0)
/* B19A4 8011B2A4 1260002A */ beqz $s3, .L8011B350
/* B19A8 8011B2A8 00000000 */ nop
/* B19AC 8011B2AC 1A600028 */ blez $s3, .L8011B350
/* B19B0 8011B2B0 0000882D */ daddu $s1, $zero, $zero
/* B19B4 8011B2B4 3C148015 */ lui $s4, %hi(mdl_treeIterPos)
/* B19B8 8011B2B8 26943224 */ addiu $s4, $s4, %lo(mdl_treeIterPos)
/* B19BC 8011B2BC 24170005 */ addiu $s7, $zero, 0x5
/* B19C0 8011B2C0 3C168015 */ lui $s6, %hi(D_80153370)
/* B19C4 8011B2C4 26D63370 */ addiu $s6, $s6, %lo(D_80153370)
.L8011B2C8:
/* B19C8 8011B2C8 8EA20010 */ lw $v0, 0x10($s5)
/* B19CC 8011B2CC 8C430010 */ lw $v1, 0x10($v0)
/* B19D0 8011B2D0 00111080 */ sll $v0, $s1, 2
/* B19D4 8011B2D4 00431021 */ addu $v0, $v0, $v1
/* B19D8 8011B2D8 8C500000 */ lw $s0, 0x0($v0)
/* B19DC 8011B2DC 8E020000 */ lw $v0, 0x0($s0)
/* B19E0 8011B2E0 96920002 */ lhu $s2, 0x2($s4)
/* B19E4 8011B2E4 1457000B */ bne $v0, $s7, .L8011B314
/* B19E8 8011B2E8 0200202D */ daddu $a0, $s0, $zero
/* B19EC 8011B2EC 0C0456C3 */ jal get_model_property
/* B19F0 8011B2F0 24050060 */ addiu $a1, $zero, 0x60
/* B19F4 8011B2F4 10400007 */ beqz $v0, .L8011B314
/* B19F8 8011B2F8 00000000 */ nop
/* B19FC 8011B2FC 8C420008 */ lw $v0, 0x8($v0)
/* B1A00 8011B300 10400004 */ beqz $v0, .L8011B314
/* B1A04 8011B304 00000000 */ nop
/* B1A08 8011B308 0C04572A */ jal mdl_get_child_count
/* B1A0C 8011B30C 0200202D */ daddu $a0, $s0, $zero
/* B1A10 8011B310 02429021 */ addu $s2, $s2, $v0
.L8011B314:
/* B1A14 8011B314 0C046C76 */ jal func_8011B1D8
/* B1A18 8011B318 0200202D */ daddu $a0, $s0, $zero
/* B1A1C 8011B31C 8EC20000 */ lw $v0, 0x0($s6)
/* B1A20 8011B320 1440000B */ bnez $v0, .L8011B350
/* B1A24 8011B324 00000000 */ nop
/* B1A28 8011B328 3C028015 */ lui $v0, %hi(D_8015336E)
/* B1A2C 8011B32C 9442336E */ lhu $v0, %lo(D_8015336E)($v0)
/* B1A30 8011B330 8E830000 */ lw $v1, 0x0($s4)
/* B1A34 8011B334 1043FFD2 */ beq $v0, $v1, .L8011B280
/* B1A38 8011B338 24620001 */ addiu $v0, $v1, 0x1
/* B1A3C 8011B33C AE820000 */ sw $v0, 0x0($s4)
/* B1A40 8011B340 26310001 */ addiu $s1, $s1, 0x1
/* B1A44 8011B344 0233102A */ slt $v0, $s1, $s3
/* B1A48 8011B348 1440FFDF */ bnez $v0, .L8011B2C8
/* B1A4C 8011B34C 00000000 */ nop
.L8011B350:
/* B1A50 8011B350 8FBF0030 */ lw $ra, 0x30($sp)
/* B1A54 8011B354 8FB7002C */ lw $s7, 0x2C($sp)
/* B1A58 8011B358 8FB60028 */ lw $s6, 0x28($sp)
/* B1A5C 8011B35C 8FB50024 */ lw $s5, 0x24($sp)
/* B1A60 8011B360 8FB40020 */ lw $s4, 0x20($sp)
/* B1A64 8011B364 8FB3001C */ lw $s3, 0x1C($sp)
/* B1A68 8011B368 8FB20018 */ lw $s2, 0x18($sp)
/* B1A6C 8011B36C 8FB10014 */ lw $s1, 0x14($sp)
/* B1A70 8011B370 8FB00010 */ lw $s0, 0x10($sp)
/* B1A74 8011B374 03E00008 */ jr $ra
/* B1A78 8011B378 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void func_8011B1D8(ModelNode* node) {
ModelNode* childNode;
ModelNodeProperty* prop;
s32 numChildren;
s32 i;
u16 childCount;
if (node->type == SHAPE_TYPE_MODEL) {
D_80153376 = D_80153226;
return;
}
if (node->type == SHAPE_TYPE_GROUP) {
prop = get_model_property(node, MODEL_PROP_KEY_GROUP_TYPE);
if (prop != NULL && prop->data.s != 0) {
mdl_treeIterPos += mdl_get_child_count(node);
D_80153376 = mdl_treeIterPos;
return;
}
}
if (node->groupData != NULL) {
numChildren = node->groupData->numChildren;
if (numChildren != 0) {
for (i = 0; i < numChildren; i++) {
childNode = node->groupData->childList[i];
childCount = mdl_treeIterPos;
if (childNode->type == SHAPE_TYPE_GROUP) {
prop = get_model_property(childNode, MODEL_PROP_KEY_GROUP_TYPE);
if (prop != NULL && prop->data.s != 0) {
childCount += mdl_get_child_count(childNode);
}
}
func_8011B1D8(childNode);
if (D_80153370 != NULL) {
break;
}
if (D_8015336E == mdl_treeIterPos) {
D_80153370 = childNode;
D_80153374 = childCount;
break;
}
mdl_treeIterPos++;
}
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel get_path_position
/* F9C20 802D5270 24C6FFFF */ addiu $a2, $a2, -0x1
/* F9C24 802D5274 18C00010 */ blez $a2, .L802D52B8
/* F9C28 802D5278 0000202D */ daddu $a0, $zero, $zero
/* F9C2C 802D527C 00861021 */ addu $v0, $a0, $a2
.L802D5280:
/* F9C30 802D5280 00021FC2 */ srl $v1, $v0, 31
/* F9C34 802D5284 00431021 */ addu $v0, $v0, $v1
/* F9C38 802D5288 00021843 */ sra $v1, $v0, 1
/* F9C3C 802D528C 00031080 */ sll $v0, $v1, 2
/* F9C40 802D5290 00471021 */ addu $v0, $v0, $a3
/* F9C44 802D5294 C4400000 */ lwc1 $f0, 0x0($v0)
/* F9C48 802D5298 460C003C */ c.lt.s $f0, $f12
/* F9C4C 802D529C 00000000 */ nop
/* F9C50 802D52A0 45020002 */ bc1fl .L802D52AC
/* F9C54 802D52A4 0060302D */ daddu $a2, $v1, $zero
/* F9C58 802D52A8 24640001 */ addiu $a0, $v1, 0x1
.L802D52AC:
/* F9C5C 802D52AC 0086102A */ slt $v0, $a0, $a2
/* F9C60 802D52B0 1440FFF3 */ bnez $v0, .L802D5280
/* F9C64 802D52B4 00861021 */ addu $v0, $a0, $a2
.L802D52B8:
/* F9C68 802D52B8 5C800001 */ bgtzl $a0, .L802D52C0
/* F9C6C 802D52BC 2484FFFF */ addiu $a0, $a0, -0x1
.L802D52C0:
/* F9C70 802D52C0 00041080 */ sll $v0, $a0, 2
/* F9C74 802D52C4 00471021 */ addu $v0, $v0, $a3
/* F9C78 802D52C8 00041840 */ sll $v1, $a0, 1
/* F9C7C 802D52CC 00641821 */ addu $v1, $v1, $a0
/* F9C80 802D52D0 00031880 */ sll $v1, $v1, 2
/* F9C84 802D52D4 8FA40014 */ lw $a0, 0x14($sp)
/* F9C88 802D52D8 C4480000 */ lwc1 $f8, 0x0($v0)
/* F9C8C 802D52DC 00642021 */ addu $a0, $v1, $a0
/* F9C90 802D52E0 C4840000 */ lwc1 $f4, 0x0($a0)
/* F9C94 802D52E4 46086281 */ sub.s $f10, $f12, $f8
/* F9C98 802D52E8 3C014040 */ lui $at, (0x40400000 >> 16)
/* F9C9C 802D52EC 44816000 */ mtc1 $at, $f12
/* F9CA0 802D52F0 00000000 */ nop
/* F9CA4 802D52F4 460C2002 */ mul.s $f0, $f4, $f12
/* F9CA8 802D52F8 00000000 */ nop
/* F9CAC 802D52FC C48E000C */ lwc1 $f14, 0xC($a0)
/* F9CB0 802D5300 46047081 */ sub.s $f2, $f14, $f4
/* F9CB4 802D5304 460A1082 */ mul.s $f2, $f2, $f10
/* F9CB8 802D5308 00000000 */ nop
/* F9CBC 802D530C C4460004 */ lwc1 $f6, 0x4($v0)
/* F9CC0 802D5310 46083181 */ sub.s $f6, $f6, $f8
/* F9CC4 802D5314 46042100 */ add.s $f4, $f4, $f4
/* F9CC8 802D5318 460E2100 */ add.s $f4, $f4, $f14
/* F9CCC 802D531C 46062102 */ mul.s $f4, $f4, $f6
/* F9CD0 802D5320 00000000 */ nop
/* F9CD4 802D5324 46061083 */ div.s $f2, $f2, $f6
/* F9CD8 802D5328 46001080 */ add.s $f2, $f2, $f0
/* F9CDC 802D532C 8FA20010 */ lw $v0, 0x10($sp)
/* F9CE0 802D5330 460A1082 */ mul.s $f2, $f2, $f10
/* F9CE4 802D5334 00000000 */ nop
/* F9CE8 802D5338 00621821 */ addu $v1, $v1, $v0
/* F9CEC 802D533C C4680000 */ lwc1 $f8, 0x0($v1)
/* F9CF0 802D5340 C460000C */ lwc1 $f0, 0xC($v1)
/* F9CF4 802D5344 46080001 */ sub.s $f0, $f0, $f8
/* F9CF8 802D5348 46060003 */ div.s $f0, $f0, $f6
/* F9CFC 802D534C 46040001 */ sub.s $f0, $f0, $f4
/* F9D00 802D5350 46001080 */ add.s $f2, $f2, $f0
/* F9D04 802D5354 460A1082 */ mul.s $f2, $f2, $f10
/* F9D08 802D5358 00000000 */ nop
/* F9D0C 802D535C 46081080 */ add.s $f2, $f2, $f8
/* F9D10 802D5360 E4A20000 */ swc1 $f2, 0x0($a1)
/* F9D14 802D5364 C4840004 */ lwc1 $f4, 0x4($a0)
/* F9D18 802D5368 460C2002 */ mul.s $f0, $f4, $f12
/* F9D1C 802D536C 00000000 */ nop
/* F9D20 802D5370 C4880010 */ lwc1 $f8, 0x10($a0)
/* F9D24 802D5374 46044081 */ sub.s $f2, $f8, $f4
/* F9D28 802D5378 460A1082 */ mul.s $f2, $f2, $f10
/* F9D2C 802D537C 00000000 */ nop
/* F9D30 802D5380 46042100 */ add.s $f4, $f4, $f4
/* F9D34 802D5384 46082100 */ add.s $f4, $f4, $f8
/* F9D38 802D5388 46062102 */ mul.s $f4, $f4, $f6
/* F9D3C 802D538C 00000000 */ nop
/* F9D40 802D5390 46061083 */ div.s $f2, $f2, $f6
/* F9D44 802D5394 46001080 */ add.s $f2, $f2, $f0
/* F9D48 802D5398 460A1082 */ mul.s $f2, $f2, $f10
/* F9D4C 802D539C 00000000 */ nop
/* F9D50 802D53A0 C4680004 */ lwc1 $f8, 0x4($v1)
/* F9D54 802D53A4 C4600010 */ lwc1 $f0, 0x10($v1)
/* F9D58 802D53A8 46080001 */ sub.s $f0, $f0, $f8
/* F9D5C 802D53AC 46060003 */ div.s $f0, $f0, $f6
/* F9D60 802D53B0 46040001 */ sub.s $f0, $f0, $f4
/* F9D64 802D53B4 46001080 */ add.s $f2, $f2, $f0
/* F9D68 802D53B8 460A1082 */ mul.s $f2, $f2, $f10
/* F9D6C 802D53BC 00000000 */ nop
/* F9D70 802D53C0 46081080 */ add.s $f2, $f2, $f8
/* F9D74 802D53C4 E4A20004 */ swc1 $f2, 0x4($a1)
/* F9D78 802D53C8 C4840008 */ lwc1 $f4, 0x8($a0)
/* F9D7C 802D53CC 460C2302 */ mul.s $f12, $f4, $f12
/* F9D80 802D53D0 00000000 */ nop
/* F9D84 802D53D4 C4800014 */ lwc1 $f0, 0x14($a0)
/* F9D88 802D53D8 46040081 */ sub.s $f2, $f0, $f4
/* F9D8C 802D53DC 460A1082 */ mul.s $f2, $f2, $f10
/* F9D90 802D53E0 00000000 */ nop
/* F9D94 802D53E4 46042100 */ add.s $f4, $f4, $f4
/* F9D98 802D53E8 46002100 */ add.s $f4, $f4, $f0
/* F9D9C 802D53EC 46062102 */ mul.s $f4, $f4, $f6
/* F9DA0 802D53F0 00000000 */ nop
/* F9DA4 802D53F4 46061083 */ div.s $f2, $f2, $f6
/* F9DA8 802D53F8 460C1080 */ add.s $f2, $f2, $f12
/* F9DAC 802D53FC 460A1082 */ mul.s $f2, $f2, $f10
/* F9DB0 802D5400 00000000 */ nop
/* F9DB4 802D5404 C4680008 */ lwc1 $f8, 0x8($v1)
/* F9DB8 802D5408 C4600014 */ lwc1 $f0, 0x14($v1)
/* F9DBC 802D540C 46080001 */ sub.s $f0, $f0, $f8
/* F9DC0 802D5410 46060003 */ div.s $f0, $f0, $f6
/* F9DC4 802D5414 46040001 */ sub.s $f0, $f0, $f4
/* F9DC8 802D5418 46001080 */ add.s $f2, $f2, $f0
/* F9DCC 802D541C 460A1082 */ mul.s $f2, $f2, $f10
/* F9DD0 802D5420 00000000 */ nop
/* F9DD4 802D5424 46081080 */ add.s $f2, $f2, $f8
/* F9DD8 802D5428 03E00008 */ jr $ra
/* F9DDC 802D542C E4A20008 */ swc1 $f2, 0x8($a1)
### DECOMPILED C INSTRUCTIONS:
void get_path_position(f32 alpha, Vec3f* outPos, s32 numVectors, f32* normalizedLengths, Vec3f* pathPoints, Vec3f* vectors) {
s32 limit = numVectors - 1;
f32 curLength;
f32 curProgress;
f32 ax, ay, az, bx, by, bz, dx, dy, dz;
s32 i;
for (i = 0; i < limit;) {
s32 temp_v1 = (i + limit) / 2;
if (normalizedLengths[temp_v1] < alpha) {
i = temp_v1 + 1;
} else {
limit = temp_v1;
}
}
if (i > 0) {
i--;
}
curLength = normalizedLengths[i+1] - normalizedLengths[i];
curProgress = alpha - normalizedLengths[i];
dx = (pathPoints[i+1].x - pathPoints[i].x) / curLength;
ax = (((vectors[i+1].x - vectors[i].x) * curProgress / curLength) + (3.0f * vectors[i].x)) * curProgress;
bx = dx - (((2.0f * vectors[i].x) + vectors[i+1].x) * curLength);
outPos->x = ((ax + bx) * curProgress) + pathPoints[i].x;
dy = (pathPoints[i+1].y - pathPoints[i].y) / curLength;
ay = (((vectors[i+1].y - vectors[i].y) * curProgress / curLength) + (3.0f * vectors[i].y)) * curProgress;
by = dy - (((2.0f * vectors[i].y) + vectors[i+1].y) * curLength);
outPos->y = ((ay + by) * curProgress) + pathPoints[i].y;
dz = (pathPoints[i+1].z - pathPoints[i].z) / curLength;
az = (((vectors[i+1].z - vectors[i].z) * curProgress / curLength) + (3.0f * vectors[i].z)) * curProgress;
bz = dz - (((2.0f * vectors[i].z) + vectors[i+1].z) * curLength);
outPos->z = ((az + bz) * curProgress) + pathPoints[i].z;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel set_cam_viewport
/* 9714 8002E314 3C08800B */ lui $t0, %hi(gCameras)
/* 9718 8002E318 25081D80 */ addiu $t0, $t0, %lo(gCameras)
/* 971C 8002E31C 00042400 */ sll $a0, $a0, 16
/* 9720 8002E320 00042403 */ sra $a0, $a0, 16
/* 9724 8002E324 00041880 */ sll $v1, $a0, 2
/* 9728 8002E328 00641821 */ addu $v1, $v1, $a0
/* 972C 8002E32C 00031880 */ sll $v1, $v1, 2
/* 9730 8002E330 00641823 */ subu $v1, $v1, $a0
/* 9734 8002E334 000310C0 */ sll $v0, $v1, 3
/* 9738 8002E338 00621821 */ addu $v1, $v1, $v0
/* 973C 8002E33C 000318C0 */ sll $v1, $v1, 3
/* 9740 8002E340 00681821 */ addu $v1, $v1, $t0
/* 9744 8002E344 A467000A */ sh $a3, 0xA($v1)
/* 9748 8002E348 A465000E */ sh $a1, 0xE($v1)
/* 974C 8002E34C 00E0282D */ daddu $a1, $a3, $zero
/* 9750 8002E350 A4660010 */ sh $a2, 0x10($v1)
/* 9754 8002E354 8FA40010 */ lw $a0, 0x10($sp)
/* 9758 8002E358 240201FF */ addiu $v0, $zero, 0x1FF
/* 975C 8002E35C A46200A4 */ sh $v0, 0xA4($v1)
/* 9760 8002E360 A46200AC */ sh $v0, 0xAC($v1)
/* 9764 8002E364 A46200B4 */ sh $v0, 0xB4($v1)
/* 9768 8002E368 9462000E */ lhu $v0, 0xE($v1)
/* 976C 8002E36C 00052C00 */ sll $a1, $a1, 16
/* 9770 8002E370 A46000A6 */ sh $zero, 0xA6($v1)
/* 9774 8002E374 A46000AE */ sh $zero, 0xAE($v1)
/* 9778 8002E378 A46000B6 */ sh $zero, 0xB6($v1)
/* 977C 8002E37C A464000C */ sh $a0, 0xC($v1)
/* 9780 8002E380 00052403 */ sra $a0, $a1, 16
/* 9784 8002E384 00052FC2 */ srl $a1, $a1, 31
/* 9788 8002E388 00852021 */ addu $a0, $a0, $a1
/* 978C 8002E38C 00042043 */ sra $a0, $a0, 1
/* 9790 8002E390 00441021 */ addu $v0, $v0, $a0
/* 9794 8002E394 00021400 */ sll $v0, $v0, 16
/* 9798 8002E398 8464000A */ lh $a0, 0xA($v1)
/* 979C 8002E39C 00021383 */ sra $v0, $v0, 14
/* 97A0 8002E3A0 A46200A8 */ sh $v0, 0xA8($v1)
/* 97A4 8002E3A4 9462000C */ lhu $v0, 0xC($v1)
/* 97A8 8002E3A8 44840000 */ mtc1 $a0, $f0
/* 97AC 8002E3AC 00000000 */ nop
/* 97B0 8002E3B0 46800020 */ cvt.s.w $f0, $f0
/* 97B4 8002E3B4 00021400 */ sll $v0, $v0, 16
/* 97B8 8002E3B8 00022403 */ sra $a0, $v0, 16
/* 97BC 8002E3BC 000217C2 */ srl $v0, $v0, 31
/* 97C0 8002E3C0 00822021 */ addu $a0, $a0, $v0
/* 97C4 8002E3C4 00C0102D */ daddu $v0, $a2, $zero
/* 97C8 8002E3C8 00042043 */ sra $a0, $a0, 1
/* 97CC 8002E3CC 00441021 */ addu $v0, $v0, $a0
/* 97D0 8002E3D0 00021400 */ sll $v0, $v0, 16
/* 97D4 8002E3D4 00021383 */ sra $v0, $v0, 14
/* 97D8 8002E3D8 46000000 */ add.s $f0, $f0, $f0
/* 97DC 8002E3DC A46200AA */ sh $v0, 0xAA($v1)
/* 97E0 8002E3E0 8462000A */ lh $v0, 0xA($v1)
/* 97E4 8002E3E4 4600010D */ trunc.w.s $f4, $f0
/* 97E8 8002E3E8 44042000 */ mfc1 $a0, $f4
/* 97EC 8002E3EC 44820000 */ mtc1 $v0, $f0
/* 97F0 8002E3F0 00000000 */ nop
/* 97F4 8002E3F4 46800020 */ cvt.s.w $f0, $f0
/* 97F8 8002E3F8 46000000 */ add.s $f0, $f0, $f0
/* 97FC 8002E3FC 8462000C */ lh $v0, 0xC($v1)
/* 9800 8002E400 3C068007 */ lui $a2, %hi(gGameStatusPtr)
/* 9804 8002E404 8CC6419C */ lw $a2, %lo(gGameStatusPtr)($a2)
/* 9808 8002E408 44821000 */ mtc1 $v0, $f2
/* 980C 8002E40C 00000000 */ nop
/* 9810 8002E410 468010A0 */ cvt.s.w $f2, $f2
/* 9814 8002E414 4600010D */ trunc.w.s $f4, $f0
/* 9818 8002E418 44022000 */ mfc1 $v0, $f4
/* 981C 8002E41C 00000000 */ nop
/* 9820 8002E420 A46200B0 */ sh $v0, 0xB0($v1)
/* 9824 8002E424 8462000C */ lh $v0, 0xC($v1)
/* 9828 8002E428 46021080 */ add.s $f2, $f2, $f2
/* 982C 8002E42C A46400A0 */ sh $a0, 0xA0($v1)
/* 9830 8002E430 44820000 */ mtc1 $v0, $f0
/* 9834 8002E434 00000000 */ nop
/* 9838 8002E438 46800020 */ cvt.s.w $f0, $f0
/* 983C 8002E43C 46000000 */ add.s $f0, $f0, $f0
/* 9840 8002E440 4600110D */ trunc.w.s $f4, $f2
/* 9844 8002E444 44042000 */ mfc1 $a0, $f4
/* 9848 8002E448 00000000 */ nop
/* 984C 8002E44C A46400A2 */ sh $a0, 0xA2($v1)
/* 9850 8002E450 4600010D */ trunc.w.s $f4, $f0
/* 9854 8002E454 44022000 */ mfc1 $v0, $f4
/* 9858 8002E458 00000000 */ nop
/* 985C 8002E45C A46200B2 */ sh $v0, 0xB2($v1)
/* 9860 8002E460 00E0102D */ daddu $v0, $a3, $zero
/* 9864 8002E464 00021400 */ sll $v0, $v0, 16
/* 9868 8002E468 00022403 */ sra $a0, $v0, 16
/* 986C 8002E46C 000217C2 */ srl $v0, $v0, 31
/* 9870 8002E470 00822021 */ addu $a0, $a0, $v0
/* 9874 8002E474 00042043 */ sra $a0, $a0, 1
/* 9878 8002E478 90C50082 */ lbu $a1, 0x82($a2)
/* 987C 8002E47C 9462000E */ lhu $v0, 0xE($v1)
/* 9880 8002E480 00052E00 */ sll $a1, $a1, 24
/* 9884 8002E484 00052E03 */ sra $a1, $a1, 24
/* 9888 8002E488 00441021 */ addu $v0, $v0, $a0
/* 988C 8002E48C 00021400 */ sll $v0, $v0, 16
/* 9890 8002E490 00021383 */ sra $v0, $v0, 14
/* 9894 8002E494 00A22821 */ addu $a1, $a1, $v0
/* 9898 8002E498 A46500B8 */ sh $a1, 0xB8($v1)
/* 989C 8002E49C 90C50083 */ lbu $a1, 0x83($a2)
/* 98A0 8002E4A0 9462000C */ lhu $v0, 0xC($v1)
/* 98A4 8002E4A4 00052E00 */ sll $a1, $a1, 24
/* 98A8 8002E4A8 00052E03 */ sra $a1, $a1, 24
/* 98AC 8002E4AC 00021400 */ sll $v0, $v0, 16
/* 98B0 8002E4B0 00022403 */ sra $a0, $v0, 16
/* 98B4 8002E4B4 000217C2 */ srl $v0, $v0, 31
/* 98B8 8002E4B8 00822021 */ addu $a0, $a0, $v0
/* 98BC 8002E4BC 94620010 */ lhu $v0, 0x10($v1)
/* 98C0 8002E4C0 00042043 */ sra $a0, $a0, 1
/* 98C4 8002E4C4 00441021 */ addu $v0, $v0, $a0
/* 98C8 8002E4C8 00021400 */ sll $v0, $v0, 16
/* 98CC 8002E4CC 00021383 */ sra $v0, $v0, 14
/* 98D0 8002E4D0 00A22821 */ addu $a1, $a1, $v0
/* 98D4 8002E4D4 24020200 */ addiu $v0, $zero, 0x200
/* 98D8 8002E4D8 A46500BA */ sh $a1, 0xBA($v1)
/* 98DC 8002E4DC A46200BC */ sh $v0, 0xBC($v1)
/* 98E0 8002E4E0 03E00008 */ jr $ra
/* 98E4 8002E4E4 A46000BE */ sh $zero, 0xBE($v1)
### DECOMPILED C INSTRUCTIONS:
void set_cam_viewport(s16 id, s16 x, s16 y, s16 width, s16 height) {
Camera* camera = &gCameras[id];
camera->viewportW = width;
camera->viewportH = height;
camera->viewportStartX = x;
camera->viewportStartY = y;
camera->vp.vp.vscale[0] = 2.0f * camera->viewportW;
camera->vp.vp.vscale[1] = 2.0f * camera->viewportH;
camera->vp.vp.vscale[2] = 0x1FF;
camera->vp.vp.vscale[3] = 0;
camera->vp.vp.vtrans[0] = 4 * (s16) ((u16) camera->viewportStartX + (camera->viewportW / 2));
camera->vp.vp.vtrans[1] = (s16) ((u16) camera->viewportStartY + (camera->viewportH / 2));
camera->vp.vp.vtrans[1] = 4 * camera->vp.vp.vtrans[1];
camera->vp.vp.vtrans[2] = 0x1FF;
camera->vp.vp.vtrans[3] = 0;
camera->vpAlt.vp.vscale[0] = 2.0f * camera->viewportW;
camera->vpAlt.vp.vscale[1] = 2.0f * camera->viewportH;
camera->vpAlt.vp.vscale[2] = 0x1FF;
camera->vpAlt.vp.vscale[3] = 0;
camera->vpAlt.vp.vtrans[0] = gGameStatusPtr->unk_82 + 4 * (s16) ((u16) camera->viewportStartX + (camera->viewportW / 2));
camera->vpAlt.vp.vtrans[1] = gGameStatusPtr->unk_83 + 4 * (s16) ((u16) camera->viewportStartY + (camera->viewportH / 2));
camera->vpAlt.vp.vtrans[2] = 0x200;
camera->vpAlt.vp.vtrans[3] = 0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel spr_transform_point
/* FFDF0 802DCD00 27BDFF20 */ addiu $sp, $sp, -0xE0
/* FFDF4 802DCD04 F7B800C8 */ sdc1 $f24, 0xC8($sp)
/* FFDF8 802DCD08 4487C000 */ mtc1 $a3, $f24
/* FFDFC 802DCD0C F7BA00D0 */ sdc1 $f26, 0xD0($sp)
/* FFE00 802DCD10 C7BA00F0 */ lwc1 $f26, 0xF0($sp)
/* FFE04 802DCD14 F7BC00D8 */ sdc1 $f28, 0xD8($sp)
/* FFE08 802DCD18 C7BC00F4 */ lwc1 $f28, 0xF4($sp)
/* FFE0C 802DCD1C AFB300A4 */ sw $s3, 0xA4($sp)
/* FFE10 802DCD20 8FB300F8 */ lw $s3, 0xF8($sp)
/* FFE14 802DCD24 AFB400A8 */ sw $s4, 0xA8($sp)
/* FFE18 802DCD28 8FB400FC */ lw $s4, 0xFC($sp)
/* FFE1C 802DCD2C AFB500AC */ sw $s5, 0xAC($sp)
/* FFE20 802DCD30 8FB50100 */ lw $s5, 0x100($sp)
/* FFE24 802DCD34 AFB200A0 */ sw $s2, 0xA0($sp)
/* FFE28 802DCD38 0080902D */ daddu $s2, $a0, $zero
/* FFE2C 802DCD3C AFB1009C */ sw $s1, 0x9C($sp)
/* FFE30 802DCD40 AFBF00B0 */ sw $ra, 0xB0($sp)
/* FFE34 802DCD44 AFB00098 */ sw $s0, 0x98($sp)
/* FFE38 802DCD48 F7B600C0 */ sdc1 $f22, 0xC0($sp)
/* FFE3C 802DCD4C F7B400B8 */ sdc1 $f20, 0xB8($sp)
/* FFE40 802DCD50 16400009 */ bnez $s2, .L802DCD78
/* FFE44 802DCD54 00C0882D */ daddu $s1, $a2, $zero
/* FFE48 802DCD58 14A00007 */ bnez $a1, .L802DCD78
/* FFE4C 802DCD5C 00000000 */ nop
/* FFE50 802DCD60 16200005 */ bnez $s1, .L802DCD78
/* FFE54 802DCD64 00000000 */ nop
/* FFE58 802DCD68 E6780000 */ swc1 $f24, 0x0($s3)
/* FFE5C 802DCD6C E69A0000 */ swc1 $f26, 0x0($s4)
/* FFE60 802DCD70 080B73A9 */ j .L802DCEA4
/* FFE64 802DCD74 E6BC0000 */ swc1 $f28, 0x0($s5)
.L802DCD78:
/* FFE68 802DCD78 44859000 */ mtc1 $a1, $f18
/* FFE6C 802DCD7C 00000000 */ nop
/* FFE70 802DCD80 468094A0 */ cvt.s.w $f18, $f18
/* FFE74 802DCD84 4480A000 */ mtc1 $zero, $f20
/* FFE78 802DCD88 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* FFE7C 802DCD8C 4481B000 */ mtc1 $at, $f22
/* FFE80 802DCD90 44059000 */ mfc1 $a1, $f18
/* FFE84 802DCD94 4406A000 */ mfc1 $a2, $f20
/* FFE88 802DCD98 4407B000 */ mfc1 $a3, $f22
/* FFE8C 802DCD9C 27A40018 */ addiu $a0, $sp, 0x18
/* FFE90 802DCDA0 0C019EC8 */ jal guRotateF
/* FFE94 802DCDA4 E7B40010 */ swc1 $f20, 0x10($sp)
/* FFE98 802DCDA8 27B00058 */ addiu $s0, $sp, 0x58
/* FFE9C 802DCDAC 44919000 */ mtc1 $s1, $f18
/* FFEA0 802DCDB0 00000000 */ nop
/* FFEA4 802DCDB4 468094A0 */ cvt.s.w $f18, $f18
/* FFEA8 802DCDB8 4406A000 */ mfc1 $a2, $f20
/* FFEAC 802DCDBC 4407A000 */ mfc1 $a3, $f20
/* FFEB0 802DCDC0 44059000 */ mfc1 $a1, $f18
/* FFEB4 802DCDC4 0200202D */ daddu $a0, $s0, $zero
/* FFEB8 802DCDC8 0C019EC8 */ jal guRotateF
/* FFEBC 802DCDCC E7B60010 */ swc1 $f22, 0x10($sp)
/* FFEC0 802DCDD0 0200202D */ daddu $a0, $s0, $zero
/* FFEC4 802DCDD4 27A50018 */ addiu $a1, $sp, 0x18
/* FFEC8 802DCDD8 0C019D80 */ jal guMtxCatF
/* FFECC 802DCDDC 00A0302D */ daddu $a2, $a1, $zero
/* FFED0 802DCDE0 44929000 */ mtc1 $s2, $f18
/* FFED4 802DCDE4 00000000 */ nop
/* FFED8 802DCDE8 468094A0 */ cvt.s.w $f18, $f18
/* FFEDC 802DCDEC 4406B000 */ mfc1 $a2, $f22
/* FFEE0 802DCDF0 4407A000 */ mfc1 $a3, $f20
/* FFEE4 802DCDF4 44059000 */ mfc1 $a1, $f18
/* FFEE8 802DCDF8 0200202D */ daddu $a0, $s0, $zero
/* FFEEC 802DCDFC 0C019EC8 */ jal guRotateF
/* FFEF0 802DCE00 AFA70010 */ sw $a3, 0x10($sp)
/* FFEF4 802DCE04 0200202D */ daddu $a0, $s0, $zero
/* FFEF8 802DCE08 27A50018 */ addiu $a1, $sp, 0x18
/* FFEFC 802DCE0C 0C019D80 */ jal guMtxCatF
/* FFF00 802DCE10 00A0302D */ daddu $a2, $a1, $zero
/* FFF04 802DCE14 C7A80018 */ lwc1 $f8, 0x18($sp)
/* FFF08 802DCE18 46184202 */ mul.s $f8, $f8, $f24
/* FFF0C 802DCE1C 00000000 */ nop
/* FFF10 802DCE20 C7B00028 */ lwc1 $f16, 0x28($sp)
/* FFF14 802DCE24 461A8402 */ mul.s $f16, $f16, $f26
/* FFF18 802DCE28 00000000 */ nop
/* FFF1C 802DCE2C C7AE0038 */ lwc1 $f14, 0x38($sp)
/* FFF20 802DCE30 461C7382 */ mul.s $f14, $f14, $f28
/* FFF24 802DCE34 00000000 */ nop
/* FFF28 802DCE38 C7A2001C */ lwc1 $f2, 0x1C($sp)
/* FFF2C 802DCE3C 46181082 */ mul.s $f2, $f2, $f24
/* FFF30 802DCE40 00000000 */ nop
/* FFF34 802DCE44 C7AA002C */ lwc1 $f10, 0x2C($sp)
/* FFF38 802DCE48 461A5282 */ mul.s $f10, $f10, $f26
/* FFF3C 802DCE4C 00000000 */ nop
/* FFF40 802DCE50 C7AC003C */ lwc1 $f12, 0x3C($sp)
/* FFF44 802DCE54 461C6302 */ mul.s $f12, $f12, $f28
/* FFF48 802DCE58 00000000 */ nop
/* FFF4C 802DCE5C C7A00020 */ lwc1 $f0, 0x20($sp)
/* FFF50 802DCE60 46180002 */ mul.s $f0, $f0, $f24
/* FFF54 802DCE64 00000000 */ nop
/* FFF58 802DCE68 C7A40030 */ lwc1 $f4, 0x30($sp)
/* FFF5C 802DCE6C 461A2102 */ mul.s $f4, $f4, $f26
/* FFF60 802DCE70 00000000 */ nop
/* FFF64 802DCE74 C7A60040 */ lwc1 $f6, 0x40($sp)
/* FFF68 802DCE78 461C3182 */ mul.s $f6, $f6, $f28
/* FFF6C 802DCE7C 00000000 */ nop
/* FFF70 802DCE80 46104200 */ add.s $f8, $f8, $f16
/* FFF74 802DCE84 460A1080 */ add.s $f2, $f2, $f10
/* FFF78 802DCE88 46040000 */ add.s $f0, $f0, $f4
/* FFF7C 802DCE8C 460E4200 */ add.s $f8, $f8, $f14
/* FFF80 802DCE90 460C1080 */ add.s $f2, $f2, $f12
/* FFF84 802DCE94 46060000 */ add.s $f0, $f0, $f6
/* FFF88 802DCE98 E6680000 */ swc1 $f8, 0x0($s3)
/* FFF8C 802DCE9C E6820000 */ swc1 $f2, 0x0($s4)
/* FFF90 802DCEA0 E6A00000 */ swc1 $f0, 0x0($s5)
.L802DCEA4:
/* FFF94 802DCEA4 8FBF00B0 */ lw $ra, 0xB0($sp)
/* FFF98 802DCEA8 8FB500AC */ lw $s5, 0xAC($sp)
/* FFF9C 802DCEAC 8FB400A8 */ lw $s4, 0xA8($sp)
/* FFFA0 802DCEB0 8FB300A4 */ lw $s3, 0xA4($sp)
/* FFFA4 802DCEB4 8FB200A0 */ lw $s2, 0xA0($sp)
/* FFFA8 802DCEB8 8FB1009C */ lw $s1, 0x9C($sp)
/* FFFAC 802DCEBC 8FB00098 */ lw $s0, 0x98($sp)
/* FFFB0 802DCEC0 D7BC00D8 */ ldc1 $f28, 0xD8($sp)
/* FFFB4 802DCEC4 D7BA00D0 */ ldc1 $f26, 0xD0($sp)
/* FFFB8 802DCEC8 D7B800C8 */ ldc1 $f24, 0xC8($sp)
/* FFFBC 802DCECC D7B600C0 */ ldc1 $f22, 0xC0($sp)
/* FFFC0 802DCED0 D7B400B8 */ ldc1 $f20, 0xB8($sp)
/* FFFC4 802DCED4 03E00008 */ jr $ra
/* FFFC8 802DCED8 27BD00E0 */ addiu $sp, $sp, 0xE0
### DECOMPILED C INSTRUCTIONS:
void spr_transform_point(s32 rotX, s32 rotY, s32 rotZ, f32 inX, f32 inY, f32 inZ, f32* outX, f32* outY, f32* outZ) {
if (rotX == 0 && rotY == 0 && rotZ == 0) {
*outX = inX;
*outY = inY;
*outZ = inZ;
} else {
Matrix4f mtxTransform, mtxTemp;
f32 xx, yx, zx, xy, yy, zy, xz, yz, zz;
guRotateF(mtxTransform, rotY, 0.0f, 1.0f, 0.0f);
guRotateF(mtxTemp, rotZ, 0.0f, 0.0f, 1.0f);
guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
guRotateF(mtxTemp, rotX, 1.0f, 0.0f, 0.0f);
guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
xx = (mtxTransform[0][0] * inX);
yx = (mtxTransform[1][0] * inY);
zx = (mtxTransform[2][0] * inZ);
xy = (mtxTransform[0][1] * inX);
yy = (mtxTransform[1][1] * inY);
zy = (mtxTransform[2][1] * inZ);
xz = (mtxTransform[0][2] * inX);
yz = (mtxTransform[1][2] * inY);
zz = (mtxTransform[2][2] * inZ);
*outX = xx + yx + zx;
*outY = xy + yy + zy;
*outZ = xz + yz + zz;
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel appendGfx_startup_prim_rect
/* 5D04 8002A904 27BDFFF8 */ addiu $sp, $sp, -0x8
/* 5D08 8002A908 0080602D */ daddu $t4, $a0, $zero
/* 5D0C 8002A90C 00A0682D */ daddu $t5, $a1, $zero
glabel func_8002A910
/* 5D10 8002A910 00E0582D */ daddu $t3, $a3, $zero
/* 5D14 8002A914 3C08800A */ lui $t0, %hi(gMainGfxPos)
/* 5D18 8002A918 2508A66C */ addiu $t0, $t0, %lo(gMainGfxPos)
/* 5D1C 8002A91C 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 5D20 8002A920 AFB00000 */ sw $s0, 0x0($sp)
/* 5D24 8002A924 8D070000 */ lw $a3, 0x0($t0)
/* 5D28 8002A928 97B9001A */ lhu $t9, 0x1A($sp)
/* 5D2C 8002A92C 97B0001E */ lhu $s0, 0x1E($sp)
/* 5D30 8002A930 97AF0022 */ lhu $t7, 0x22($sp)
/* 5D34 8002A934 97B80026 */ lhu $t8, 0x26($sp)
/* 5D38 8002A938 00E0182D */ daddu $v1, $a3, $zero
/* 5D3C 8002A93C 24E70008 */ addiu $a3, $a3, 0x8
/* 5D40 8002A940 AD070000 */ sw $a3, 0x0($t0)
/* 5D44 8002A944 AC620000 */ sw $v0, 0x0($v1)
/* 5D48 8002A948 24E20008 */ addiu $v0, $a3, 0x8
/* 5D4C 8002A94C AC600004 */ sw $zero, 0x4($v1)
/* 5D50 8002A950 AD020000 */ sw $v0, 0x0($t0)
/* 5D54 8002A954 3C02DE00 */ lui $v0, (0xDE000000 >> 16)
/* 5D58 8002A958 ACE20000 */ sw $v0, 0x0($a3)
/* 5D5C 8002A95C 3C028007 */ lui $v0, %hi(D_80074580)
/* 5D60 8002A960 24424580 */ addiu $v0, $v0, %lo(D_80074580)
/* 5D64 8002A964 316300FF */ andi $v1, $t3, 0xFF
/* 5D68 8002A968 ACE20004 */ sw $v0, 0x4($a3)
/* 5D6C 8002A96C 240200FF */ addiu $v0, $zero, 0xFF
/* 5D70 8002A970 1462000A */ bne $v1, $v0, .L8002A99C
/* 5D74 8002A974 00C0702D */ daddu $t6, $a2, $zero
/* 5D78 8002A978 3C05E200 */ lui $a1, (0xE200001C >> 16)
/* 5D7C 8002A97C 34A5001C */ ori $a1, $a1, (0xE200001C & 0xFFFF)
/* 5D80 8002A980 3C030F0A */ lui $v1, (0xF0A4000 >> 16)
/* 5D84 8002A984 34634000 */ ori $v1, $v1, (0xF0A4000 & 0xFFFF)
/* 5D88 8002A988 3C06FCFF */ lui $a2, (0xFCFFFFFF >> 16)
/* 5D8C 8002A98C 34C6FFFF */ ori $a2, $a2, (0xFCFFFFFF & 0xFFFF)
/* 5D90 8002A990 3C04FFFD */ lui $a0, (0xFFFDFCFE >> 16)
/* 5D94 8002A994 0800AA6F */ j .L8002A9BC
/* 5D98 8002A998 3484FCFE */ ori $a0, $a0, (0xFFFDFCFE & 0xFFFF)
.L8002A99C:
/* 5D9C 8002A99C 3C05E200 */ lui $a1, (0xE200001C >> 16)
/* 5DA0 8002A9A0 34A5001C */ ori $a1, $a1, (0xE200001C & 0xFFFF)
/* 5DA4 8002A9A4 3C030050 */ lui $v1, (0x504240 >> 16)
/* 5DA8 8002A9A8 34634240 */ ori $v1, $v1, (0x504240 & 0xFFFF)
/* 5DAC 8002A9AC 3C06FCFF */ lui $a2, (0xFCFFFFFF >> 16)
/* 5DB0 8002A9B0 34C6FFFF */ ori $a2, $a2, (0xFCFFFFFF & 0xFFFF)
/* 5DB4 8002A9B4 3C04FFFD */ lui $a0, (0xFFFDF6FB >> 16)
/* 5DB8 8002A9B8 3484F6FB */ ori $a0, $a0, (0xFFFDF6FB & 0xFFFF)
.L8002A9BC:
/* 5DBC 8002A9BC 24E20010 */ addiu $v0, $a3, 0x10
/* 5DC0 8002A9C0 AD020000 */ sw $v0, 0x0($t0)
/* 5DC4 8002A9C4 24E20018 */ addiu $v0, $a3, 0x18
/* 5DC8 8002A9C8 ACE50008 */ sw $a1, 0x8($a3)
/* 5DCC 8002A9CC ACE3000C */ sw $v1, 0xC($a3)
/* 5DD0 8002A9D0 AD020000 */ sw $v0, 0x0($t0)
/* 5DD4 8002A9D4 ACE60010 */ sw $a2, 0x10($a3)
/* 5DD8 8002A9D8 ACE40014 */ sw $a0, 0x14($a3)
/* 5DDC 8002A9DC 3C09E200 */ lui $t1, (0xE200001C >> 16)
/* 5DE0 8002A9E0 3529001C */ ori $t1, $t1, (0xE200001C & 0xFFFF)
/* 5DE4 8002A9E4 3C070F0A */ lui $a3, (0xF0A7008 >> 16)
/* 5DE8 8002A9E8 34E77008 */ ori $a3, $a3, (0xF0A7008 & 0xFFFF)
/* 5DEC 8002A9EC 3C0AFCFF */ lui $t2, (0xFCFFFFFF >> 16)
/* 5DF0 8002A9F0 354AFFFF */ ori $t2, $t2, (0xFCFFFFFF & 0xFFFF)
/* 5DF4 8002A9F4 3C08FFFC */ lui $t0, (0xFFFCF279 >> 16)
/* 5DF8 8002A9F8 3C06800A */ lui $a2, %hi(gMainGfxPos)
/* 5DFC 8002A9FC 24C6A66C */ addiu $a2, $a2, %lo(gMainGfxPos)
/* 5E00 8002AA00 3508F279 */ ori $t0, $t0, (0xFFFCF279 & 0xFFFF)
/* 5E04 8002AA04 3C02FA00 */ lui $v0, (0xFA000000 >> 16)
/* 5E08 8002AA08 8CC50000 */ lw $a1, 0x0($a2)
/* 5E0C 8002AA0C 000C1E00 */ sll $v1, $t4, 24
/* 5E10 8002AA10 00A0202D */ daddu $a0, $a1, $zero
/* 5E14 8002AA14 24A50008 */ addiu $a1, $a1, 0x8
/* 5E18 8002AA18 ACC50000 */ sw $a1, 0x0($a2)
/* 5E1C 8002AA1C AC820000 */ sw $v0, 0x0($a0)
/* 5E20 8002AA20 31A200FF */ andi $v0, $t5, 0xFF
/* 5E24 8002AA24 00021400 */ sll $v0, $v0, 16
/* 5E28 8002AA28 00621825 */ or $v1, $v1, $v0
glabel func_8002AA2C
/* 5E2C 8002AA2C 31C200FF */ andi $v0, $t6, 0xFF
/* 5E30 8002AA30 00021200 */ sll $v0, $v0, 8
/* 5E34 8002AA34 00621825 */ or $v1, $v1, $v0
/* 5E38 8002AA38 316200FF */ andi $v0, $t3, 0xFF
/* 5E3C 8002AA3C 00621825 */ or $v1, $v1, $v0
/* 5E40 8002AA40 24A20008 */ addiu $v0, $a1, 0x8
/* 5E44 8002AA44 AC830004 */ sw $v1, 0x4($a0)
/* 5E48 8002AA48 31E403FF */ andi $a0, $t7, 0x3FF
/* 5E4C 8002AA4C 00042380 */ sll $a0, $a0, 14
/* 5E50 8002AA50 ACC20000 */ sw $v0, 0x0($a2)
/* 5E54 8002AA54 330203FF */ andi $v0, $t8, 0x3FF
/* 5E58 8002AA58 00021080 */ sll $v0, $v0, 2
/* 5E5C 8002AA5C 3C03F600 */ lui $v1, (0xF6000000 >> 16)
/* 5E60 8002AA60 00431025 */ or $v0, $v0, $v1
/* 5E64 8002AA64 00822025 */ or $a0, $a0, $v0
/* 5E68 8002AA68 332303FF */ andi $v1, $t9, 0x3FF
/* 5E6C 8002AA6C 00031B80 */ sll $v1, $v1, 14
/* 5E70 8002AA70 320203FF */ andi $v0, $s0, 0x3FF
/* 5E74 8002AA74 00021080 */ sll $v0, $v0, 2
/* 5E78 8002AA78 00621825 */ or $v1, $v1, $v0
/* 5E7C 8002AA7C 24A20010 */ addiu $v0, $a1, 0x10
/* 5E80 8002AA80 ACA40000 */ sw $a0, 0x0($a1)
/* 5E84 8002AA84 ACA30004 */ sw $v1, 0x4($a1)
/* 5E88 8002AA88 ACC20000 */ sw $v0, 0x0($a2)
/* 5E8C 8002AA8C 3C02E700 */ lui $v0, (0xE7000000 >> 16)
/* 5E90 8002AA90 ACA20008 */ sw $v0, 0x8($a1)
/* 5E94 8002AA94 24A20018 */ addiu $v0, $a1, 0x18
/* 5E98 8002AA98 ACA0000C */ sw $zero, 0xC($a1)
/* 5E9C 8002AA9C ACC20000 */ sw $v0, 0x0($a2)
/* 5EA0 8002AAA0 24A20020 */ addiu $v0, $a1, 0x20
/* 5EA4 8002AAA4 ACA90010 */ sw $t1, 0x10($a1)
/* 5EA8 8002AAA8 ACA70014 */ sw $a3, 0x14($a1)
/* 5EAC 8002AAAC ACC20000 */ sw $v0, 0x0($a2)
/* 5EB0 8002AAB0 ACAA0018 */ sw $t2, 0x18($a1)
/* 5EB4 8002AAB4 ACA8001C */ sw $t0, 0x1C($a1)
/* 5EB8 8002AAB8 8FB00000 */ lw $s0, 0x0($sp)
/* 5EBC 8002AABC 03E00008 */ jr $ra
/* 5EC0 8002AAC0 27BD0008 */ addiu $sp, $sp, 0x8
### DECOMPILED C INSTRUCTIONS:
void appendGfx_startup_prim_rect(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 right, u16 bottom) {
gDPPipeSync(gMainGfxPos++);
gSPDisplayList(gMainGfxPos++, D_80074580);
if (a == 255) {
gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08);
} else {
gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
}
gDPSetPrimColor(gMainGfxPos++, 0, 0, r, g, b, a);
gDPFillRectangle(gMainGfxPos++, left, top, right, bottom);
gDPPipeSync(gMainGfxPos++);
gDPSetRenderMode(gMainGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel green_impact_main
/* 364F10 E0064000 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 364F14 E0064004 F7B40040 */ sdc1 $f20, 0x40($sp)
/* 364F18 E0064008 4485A000 */ mtc1 $a1, $f20
/* 364F1C E006400C F7B60048 */ sdc1 $f22, 0x48($sp)
/* 364F20 E0064010 4486B000 */ mtc1 $a2, $f22
/* 364F24 E0064014 F7B80050 */ sdc1 $f24, 0x50($sp)
/* 364F28 E0064018 4487C000 */ mtc1 $a3, $f24
/* 364F2C E006401C AFB30034 */ sw $s3, 0x34($sp)
/* 364F30 E0064020 0080982D */ daddu $s3, $a0, $zero
/* 364F34 E0064024 AFB1002C */ sw $s1, 0x2C($sp)
/* 364F38 E0064028 24110001 */ addiu $s1, $zero, 0x1
/* 364F3C E006402C F7BA0058 */ sdc1 $f26, 0x58($sp)
/* 364F40 E0064030 C7BA0070 */ lwc1 $f26, 0x70($sp)
/* 364F44 E0064034 27A40010 */ addiu $a0, $sp, 0x10
/* 364F48 E0064038 AFBF0038 */ sw $ra, 0x38($sp)
/* 364F4C E006403C AFB20030 */ sw $s2, 0x30($sp)
/* 364F50 E0064040 16600002 */ bnez $s3, .LE006404C
/* 364F54 E0064044 AFB00028 */ sw $s0, 0x28($sp)
/* 364F58 E0064048 24110004 */ addiu $s1, $zero, 0x4
.LE006404C:
/* 364F5C E006404C 26310001 */ addiu $s1, $s1, 0x1
/* 364F60 E0064050 3C02E006 */ lui $v0, %hi(green_impact_init)
/* 364F64 E0064054 2442419C */ addiu $v0, $v0, %lo(green_impact_init)
/* 364F68 E0064058 AFA00010 */ sw $zero, 0x10($sp)
/* 364F6C E006405C AC820008 */ sw $v0, 0x8($a0)
/* 364F70 E0064060 3C02E006 */ lui $v0, %hi(green_impact_update)
/* 364F74 E0064064 244241A4 */ addiu $v0, $v0, %lo(green_impact_update)
/* 364F78 E0064068 AC82000C */ sw $v0, 0xC($a0)
/* 364F7C E006406C 3C02E006 */ lui $v0, %hi(green_impact_render)
/* 364F80 E0064070 244243DC */ addiu $v0, $v0, %lo(green_impact_render)
/* 364F84 E0064074 AC820010 */ sw $v0, 0x10($a0)
/* 364F88 E0064078 24020032 */ addiu $v0, $zero, 0x32
/* 364F8C E006407C AC800014 */ sw $zero, 0x14($a0)
/* 364F90 E0064080 0C080124 */ jal shim_create_effect_instance
/* 364F94 E0064084 AC820004 */ sw $v0, 0x4($a0)
/* 364F98 E0064088 00112040 */ sll $a0, $s1, 1
/* 364F9C E006408C 00912021 */ addu $a0, $a0, $s1
/* 364FA0 E0064090 00042080 */ sll $a0, $a0, 2
/* 364FA4 E0064094 00912023 */ subu $a0, $a0, $s1
/* 364FA8 E0064098 000420C0 */ sll $a0, $a0, 3
/* 364FAC E006409C 0040902D */ daddu $s2, $v0, $zero
/* 364FB0 E00640A0 0C08012C */ jal shim_general_heap_malloc
/* 364FB4 E00640A4 AE510008 */ sw $s1, 0x8($s2)
/* 364FB8 E00640A8 0040802D */ daddu $s0, $v0, $zero
/* 364FBC E00640AC 16000003 */ bnez $s0, .LE00640BC
/* 364FC0 E00640B0 AE50000C */ sw $s0, 0xC($s2)
.LE00640B4:
/* 364FC4 E00640B4 0801902D */ j .LE00640B4
/* 364FC8 E00640B8 00000000 */ nop
.LE00640BC:
/* 364FCC E00640BC 0200202D */ daddu $a0, $s0, $zero
/* 364FD0 E00640C0 00112840 */ sll $a1, $s1, 1
/* 364FD4 E00640C4 00B12821 */ addu $a1, $a1, $s1
/* 364FD8 E00640C8 00052880 */ sll $a1, $a1, 2
/* 364FDC E00640CC 00B12823 */ subu $a1, $a1, $s1
/* 364FE0 E00640D0 0C080130 */ jal shim_mem_clear
/* 364FE4 E00640D4 000528C0 */ sll $a1, $a1, 3
/* 364FE8 E00640D8 2402003C */ addiu $v0, $zero, 0x3C
/* 364FEC E00640DC 240300FF */ addiu $v1, $zero, 0xFF
/* 364FF0 E00640E0 AE020028 */ sw $v0, 0x28($s0)
/* 364FF4 E00640E4 2402007A */ addiu $v0, $zero, 0x7A
/* 364FF8 E00640E8 A2020052 */ sb $v0, 0x52($s0)
/* 364FFC E00640EC 240200F0 */ addiu $v0, $zero, 0xF0
/* 365000 E00640F0 A2020053 */ sb $v0, 0x53($s0)
/* 365004 E00640F4 240200FA */ addiu $v0, $zero, 0xFA
/* 365008 E00640F8 AE00002C */ sw $zero, 0x2C($s0)
/* 36500C E00640FC A6130000 */ sh $s3, 0x0($s0)
/* 365010 E0064100 E6140004 */ swc1 $f20, 0x4($s0)
/* 365014 E0064104 E6160008 */ swc1 $f22, 0x8($s0)
/* 365018 E0064108 E618000C */ swc1 $f24, 0xC($s0)
/* 36501C E006410C AE030038 */ sw $v1, 0x38($s0)
/* 365020 E0064110 A2000050 */ sb $zero, 0x50($s0)
/* 365024 E0064114 A2030051 */ sb $v1, 0x51($s0)
/* 365028 E0064118 A2030054 */ sb $v1, 0x54($s0)
/* 36502C E006411C A2020055 */ sb $v0, 0x55($s0)
/* 365030 E0064120 24030001 */ addiu $v1, $zero, 0x1
/* 365034 E0064124 0071102A */ slt $v0, $v1, $s1
/* 365038 E0064128 10400010 */ beqz $v0, .LE006416C
/* 36503C E006412C 26100058 */ addiu $s0, $s0, 0x58
/* 365040 E0064130 26040030 */ addiu $a0, $s0, 0x30
/* 365044 E0064134 2406001E */ addiu $a2, $zero, 0x1E
/* 365048 E0064138 2405FFFF */ addiu $a1, $zero, -0x1
.LE006413C:
/* 36504C E006413C 44860000 */ mtc1 $a2, $f0
/* 365050 E0064140 00000000 */ nop
/* 365054 E0064144 46800020 */ cvt.s.w $f0, $f0
/* 365058 E0064148 24C6001E */ addiu $a2, $a2, 0x1E
/* 36505C E006414C AC85001C */ sw $a1, 0x1C($a0)
/* 365060 E0064150 24A5FFFC */ addiu $a1, $a1, -0x4
/* 365064 E0064154 24630001 */ addiu $v1, $v1, 0x1
/* 365068 E0064158 E49A0004 */ swc1 $f26, 0x4($a0)
/* 36506C E006415C E4800000 */ swc1 $f0, 0x0($a0)
/* 365070 E0064160 0071102A */ slt $v0, $v1, $s1
/* 365074 E0064164 1440FFF5 */ bnez $v0, .LE006413C
/* 365078 E0064168 24840058 */ addiu $a0, $a0, 0x58
.LE006416C:
/* 36507C E006416C 0240102D */ daddu $v0, $s2, $zero
/* 365080 E0064170 8FBF0038 */ lw $ra, 0x38($sp)
/* 365084 E0064174 8FB30034 */ lw $s3, 0x34($sp)
/* 365088 E0064178 8FB20030 */ lw $s2, 0x30($sp)
/* 36508C E006417C 8FB1002C */ lw $s1, 0x2C($sp)
/* 365090 E0064180 8FB00028 */ lw $s0, 0x28($sp)
/* 365094 E0064184 D7BA0058 */ ldc1 $f26, 0x58($sp)
/* 365098 E0064188 D7B80050 */ ldc1 $f24, 0x50($sp)
/* 36509C E006418C D7B60048 */ ldc1 $f22, 0x48($sp)
/* 3650A0 E0064190 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 3650A4 E0064194 03E00008 */ jr $ra
/* 3650A8 E0064198 27BD0060 */ addiu $sp, $sp, 0x60
### DECOMPILED C INSTRUCTIONS:
EffectInstance* green_impact_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
EffectInstance* effect;
GreenImpactFXData* part;
s32 numParts;
s32 temp;
s32 i;
if (arg0 == 0) {
numParts = 4;
} else {
temp = 1; // Required to match
numParts = temp;
}
numParts++;
bpPtr->unk_00 = 0;
bpPtr->init = green_impact_init;
bpPtr->update = green_impact_update;
bpPtr->renderWorld = green_impact_render;
bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_GREEN_IMPACT;
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data.greenImpact = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.greenImpact != NULL);
shim_mem_clear(part, numParts * sizeof(*part));
part->unk_2C = 0;
part->unk_00 = arg0;
part->unk_04 = arg1;
part->unk_08 = arg2;
part->unk_0C = arg3;
part->unk_28 = 60;
part->unk_38 = 255;
part->unk_50.r = 0;
part->unk_50.g = 255;
part->unk_50.b = 122;
part->unk_53.r = 240;
part->unk_53.g = 255;
part->unk_53.b = 250;
part++;
for (i = 1; i < numParts; i++, part++) {
part->unk_4C = -1 + (i - 1) * (-4);
part->unk_34 = arg4;
part->unk_30 = i * 30;
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel emote_main
/* 33418C E00202CC 27BDFF90 */ addiu $sp, $sp, -0x70
/* 334190 E00202D0 F7B80058 */ sdc1 $f24, 0x58($sp)
/* 334194 E00202D4 4486C000 */ mtc1 $a2, $f24
/* 334198 E00202D8 F7BC0068 */ sdc1 $f28, 0x68($sp)
/* 33419C E00202DC 4487E000 */ mtc1 $a3, $f28
/* 3341A0 E00202E0 AFB00028 */ sw $s0, 0x28($sp)
/* 3341A4 E00202E4 8FB0008C */ lw $s0, 0x8C($sp)
/* 3341A8 E00202E8 F7B60050 */ sdc1 $f22, 0x50($sp)
/* 3341AC E00202EC C7B60080 */ lwc1 $f22, 0x80($sp)
/* 3341B0 E00202F0 F7BA0060 */ sdc1 $f26, 0x60($sp)
/* 3341B4 E00202F4 C7BA0084 */ lwc1 $f26, 0x84($sp)
/* 3341B8 E00202F8 AFB20030 */ sw $s2, 0x30($sp)
/* 3341BC E00202FC 0080902D */ daddu $s2, $a0, $zero
/* 3341C0 E0020300 AFB5003C */ sw $s5, 0x3C($sp)
/* 3341C4 E0020304 00A0A82D */ daddu $s5, $a1, $zero
/* 3341C8 E0020308 AFB30034 */ sw $s3, 0x34($sp)
/* 3341CC E002030C 24130001 */ addiu $s3, $zero, 0x1
/* 3341D0 E0020310 F7B40048 */ sdc1 $f20, 0x48($sp)
/* 3341D4 E0020314 C7B40088 */ lwc1 $f20, 0x88($sp)
/* 3341D8 E0020318 27A40010 */ addiu $a0, $sp, 0x10
/* 3341DC E002031C AFBF0040 */ sw $ra, 0x40($sp)
/* 3341E0 E0020320 AFB40038 */ sw $s4, 0x38($sp)
/* 3341E4 E0020324 16530002 */ bne $s2, $s3, .LE0020330
/* 3341E8 E0020328 AFB1002C */ sw $s1, 0x2C($sp)
/* 3341EC E002032C 24130003 */ addiu $s3, $zero, 0x3
.LE0020330:
/* 3341F0 E0020330 3C02E002 */ lui $v0, %hi(emote_init)
/* 3341F4 E0020334 24420460 */ addiu $v0, $v0, %lo(emote_init)
/* 3341F8 E0020338 AFA20018 */ sw $v0, 0x18($sp)
/* 3341FC E002033C 3C02E002 */ lui $v0, %hi(emote_update)
/* 334200 E0020340 24420468 */ addiu $v0, $v0, %lo(emote_update)
/* 334204 E0020344 AFA2001C */ sw $v0, 0x1C($sp)
/* 334208 E0020348 3C02E002 */ lui $v0, %hi(emote_render)
/* 33420C E002034C 2442058C */ addiu $v0, $v0, %lo(emote_render)
/* 334210 E0020350 AFA20020 */ sw $v0, 0x20($sp)
/* 334214 E0020354 24020010 */ addiu $v0, $zero, 0x10
/* 334218 E0020358 AFA00010 */ sw $zero, 0x10($sp)
/* 33421C E002035C AFA00024 */ sw $zero, 0x24($sp)
/* 334220 E0020360 0C080124 */ jal shim_create_effect_instance
/* 334224 E0020364 AFA20014 */ sw $v0, 0x14($sp)
/* 334228 E0020368 00132180 */ sll $a0, $s3, 6
/* 33422C E002036C 0040A02D */ daddu $s4, $v0, $zero
/* 334230 E0020370 0C08012C */ jal shim_general_heap_malloc
/* 334234 E0020374 AE930008 */ sw $s3, 0x8($s4)
/* 334238 E0020378 0040882D */ daddu $s1, $v0, $zero
/* 33423C E002037C 16200003 */ bnez $s1, .LE002038C
/* 334240 E0020380 AE91000C */ sw $s1, 0xC($s4)
.LE0020384:
/* 334244 E0020384 080080E1 */ j .LE0020384
/* 334248 E0020388 00000000 */ nop
.LE002038C:
/* 33424C E002038C AE35003C */ sw $s5, 0x3C($s1)
/* 334250 E0020390 AE320000 */ sw $s2, 0x0($s1)
/* 334254 E0020394 1E000002 */ bgtz $s0, .LE00203A0
/* 334258 E0020398 AE320030 */ sw $s2, 0x30($s1)
/* 33425C E002039C 24102710 */ addiu $s0, $zero, 0x2710
.LE00203A0:
/* 334260 E00203A0 24020001 */ addiu $v0, $zero, 0x1
/* 334264 E00203A4 AE30002C */ sw $s0, 0x2C($s1)
/* 334268 E00203A8 16420014 */ bne $s2, $v0, .LE00203FC
/* 33426C E00203AC AE200034 */ sw $zero, 0x34($s1)
/* 334270 E00203B0 1260001B */ beqz $s3, .LE0020420
/* 334274 E00203B4 0000902D */ daddu $s2, $zero, $zero
/* 334278 E00203B8 2630003C */ addiu $s0, $s1, 0x3C
.LE00203BC:
/* 33427C E00203BC 0220202D */ daddu $a0, $s1, $zero
/* 334280 E00203C0 0240282D */ daddu $a1, $s2, $zero
/* 334284 E00203C4 E618FFD4 */ swc1 $f24, -0x2C($s0)
/* 334288 E00203C8 E61CFFD8 */ swc1 $f28, -0x28($s0)
/* 33428C E00203CC E616FFDC */ swc1 $f22, -0x24($s0)
/* 334290 E00203D0 E614FFE0 */ swc1 $f20, -0x20($s0)
/* 334294 E00203D4 E61AFFE4 */ swc1 $f26, -0x1C($s0)
/* 334298 E00203D8 0C008000 */ jal func_E0020000
/* 33429C E00203DC AE150000 */ sw $s5, 0x0($s0)
/* 3342A0 E00203E0 26520001 */ addiu $s2, $s2, 0x1
/* 3342A4 E00203E4 26100040 */ addiu $s0, $s0, 0x40
/* 3342A8 E00203E8 0253102A */ slt $v0, $s2, $s3
/* 3342AC E00203EC 1440FFF3 */ bnez $v0, .LE00203BC
/* 3342B0 E00203F0 26310040 */ addiu $s1, $s1, 0x40
/* 3342B4 E00203F4 08008108 */ j .LE0020420
/* 3342B8 E00203F8 00000000 */ nop
.LE00203FC:
/* 3342BC E00203FC 0220202D */ daddu $a0, $s1, $zero
/* 3342C0 E0020400 24050001 */ addiu $a1, $zero, 0x1
/* 3342C4 E0020404 E4980010 */ swc1 $f24, 0x10($a0)
/* 3342C8 E0020408 E49C0014 */ swc1 $f28, 0x14($a0)
/* 3342CC E002040C E4960018 */ swc1 $f22, 0x18($a0)
/* 3342D0 E0020410 E494001C */ swc1 $f20, 0x1C($a0)
/* 3342D4 E0020414 E49A0020 */ swc1 $f26, 0x20($a0)
/* 3342D8 E0020418 0C008000 */ jal func_E0020000
/* 3342DC E002041C AC95003C */ sw $s5, 0x3C($a0)
.LE0020420:
/* 3342E0 E0020420 8FA20090 */ lw $v0, 0x90($sp)
/* 3342E4 E0020424 AC540000 */ sw $s4, 0x0($v0)
/* 3342E8 E0020428 8FBF0040 */ lw $ra, 0x40($sp)
/* 3342EC E002042C 8FB5003C */ lw $s5, 0x3C($sp)
/* 3342F0 E0020430 8FB40038 */ lw $s4, 0x38($sp)
/* 3342F4 E0020434 8FB30034 */ lw $s3, 0x34($sp)
/* 3342F8 E0020438 8FB20030 */ lw $s2, 0x30($sp)
/* 3342FC E002043C 8FB1002C */ lw $s1, 0x2C($sp)
/* 334300 E0020440 8FB00028 */ lw $s0, 0x28($sp)
/* 334304 E0020444 D7BC0068 */ ldc1 $f28, 0x68($sp)
/* 334308 E0020448 D7BA0060 */ ldc1 $f26, 0x60($sp)
/* 33430C E002044C D7B80058 */ ldc1 $f24, 0x58($sp)
/* 334310 E0020450 D7B60050 */ ldc1 $f22, 0x50($sp)
/* 334314 E0020454 D7B40048 */ ldc1 $f20, 0x48($sp)
/* 334318 E0020458 03E00008 */ jr $ra
/* 33431C E002045C 27BD0070 */ addiu $sp, $sp, 0x70
### DECOMPILED C INSTRUCTIONS:
void emote_main(s32 arg0, Npc* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s32 arg7, EffectInstance** arg8) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
EmoteFXData* data;
EffectInstance* effect;
s32 numParts;
if (arg0 == 1) {
numParts = 3;
} else {
numParts = 1;
}
bp.unk_00 = 0;
bp.init = emote_init;
bp.update = emote_update;
bp.renderWorld = emote_render;
bp.renderUI = NULL;
bp.effectID = EFFECT_EMOTE;
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
data = effect->data.emote = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.emote != NULL);
data->unk_3C = arg1;
data->unk_00 = arg0;
data->unk_30 = arg0;
if (arg7 <= 0) {
arg7 = 10000;
}
data->unk_2C = arg7;
data->unk_34 = 0;
if (arg0 == 1) {
s32 i;
for (i = 0; i < numParts; i++, data++) {
data->unk_10 = arg2;
data->unk_14 = arg3;
data->unk_18 = arg4;
data->unk_1C = arg6;
data->unk_20 = arg5;
data->unk_3C = arg1;
func_E0020000(data, i);
}
} else {
data->unk_10 = arg2;
data->unk_14 = arg3;
data->unk_18 = arg4;
data->unk_1C = arg6;
data->unk_20 = arg5;
data->unk_3C = arg1;
func_E0020000(data, 1);
}
*arg8 = effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel osCreatePiManager
/* 3BDE0 800609E0 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 3BDE4 800609E4 AFB00018 */ sw $s0, 0x18($sp)
/* 3BDE8 800609E8 00808021 */ addu $s0, $a0, $zero
/* 3BDEC 800609EC AFB5002C */ sw $s5, 0x2C($sp)
/* 3BDF0 800609F0 00A0A821 */ addu $s5, $a1, $zero
/* 3BDF4 800609F4 AFB40028 */ sw $s4, 0x28($sp)
/* 3BDF8 800609F8 3C148009 */ lui $s4, %hi(__osPiDevMgr)
/* 3BDFC 800609FC 26943D50 */ addiu $s4, $s4, %lo(__osPiDevMgr)
/* 3BE00 80060A00 AFBF0030 */ sw $ra, 0x30($sp)
/* 3BE04 80060A04 AFB30024 */ sw $s3, 0x24($sp)
/* 3BE08 80060A08 AFB20020 */ sw $s2, 0x20($sp)
/* 3BE0C 80060A0C AFB1001C */ sw $s1, 0x1C($sp)
/* 3BE10 80060A10 8E820000 */ lw $v0, 0x0($s4)
/* 3BE14 80060A14 00C02821 */ addu $a1, $a2, $zero
/* 3BE18 80060A18 1440004C */ bnez $v0, .L80060B4C
/* 3BE1C 80060A1C 00E03021 */ addu $a2, $a3, $zero
/* 3BE20 80060A20 0C019560 */ jal osCreateMesgQueue
/* 3BE24 80060A24 02A02021 */ addu $a0, $s5, $zero
/* 3BE28 80060A28 3C13800B */ lui $s3, %hi(piEventQueue)
/* 3BE2C 80060A2C 2673F890 */ addiu $s3, $s3, %lo(piEventQueue)
/* 3BE30 80060A30 02602021 */ addu $a0, $s3, $zero
/* 3BE34 80060A34 3C05800B */ lui $a1, %hi(piEventBuf)
/* 3BE38 80060A38 24A5F8A8 */ addiu $a1, $a1, %lo(piEventBuf)
/* 3BE3C 80060A3C 0C019560 */ jal osCreateMesgQueue
/* 3BE40 80060A40 24060001 */ addiu $a2, $zero, 0x1
/* 3BE44 80060A44 3C028009 */ lui $v0, %hi(__osPiAccessQueueEnabled)
/* 3BE48 80060A48 8C423D90 */ lw $v0, %lo(__osPiAccessQueueEnabled)($v0)
/* 3BE4C 80060A4C 54400004 */ bnel $v0, $zero, .L80060A60
/* 3BE50 80060A50 24040008 */ addiu $a0, $zero, 0x8
/* 3BE54 80060A54 0C018514 */ jal __osPiCreateAccessQueue
/* 3BE58 80060A58 00000000 */ nop
/* 3BE5C 80060A5C 24040008 */ addiu $a0, $zero, 0x8
.L80060A60:
/* 3BE60 80060A60 02602821 */ addu $a1, $s3, $zero
/* 3BE64 80060A64 3C062222 */ lui $a2, (0x22222222 >> 16)
/* 3BE68 80060A68 0C019654 */ jal osSetEventMesg
/* 3BE6C 80060A6C 34C62222 */ ori $a2, $a2, (0x22222222 & 0xFFFF)
/* 3BE70 80060A70 2412FFFF */ addiu $s2, $zero, -0x1
/* 3BE74 80060A74 0C0197CC */ jal osGetThreadPri
/* 3BE78 80060A78 00002021 */ addu $a0, $zero, $zero
/* 3BE7C 80060A7C 00401821 */ addu $v1, $v0, $zero
/* 3BE80 80060A80 0070102A */ slt $v0, $v1, $s0
/* 3BE84 80060A84 10400005 */ beqz $v0, .L80060A9C
/* 3BE88 80060A88 00000000 */ nop
/* 3BE8C 80060A8C 00609021 */ addu $s2, $v1, $zero
/* 3BE90 80060A90 00002021 */ addu $a0, $zero, $zero
/* 3BE94 80060A94 0C0197D4 */ jal osSetThreadPri
/* 3BE98 80060A98 02002821 */ addu $a1, $s0, $zero
.L80060A9C:
/* 3BE9C 80060A9C 0C01ACD8 */ jal __osDisableInt
/* 3BEA0 80060AA0 00000000 */ nop
/* 3BEA4 80060AA4 3C11800B */ lui $s1, %hi(piThread)
/* 3BEA8 80060AA8 2631E6E0 */ addiu $s1, $s1, %lo(piThread)
/* 3BEAC 80060AAC 02202021 */ addu $a0, $s1, $zero
/* 3BEB0 80060AB0 00002821 */ addu $a1, $zero, $zero
/* 3BEB4 80060AB4 3C068006 */ lui $a2, %hi(__osDevMgrMain)
/* 3BEB8 80060AB8 24C61090 */ addiu $a2, $a2, %lo(__osDevMgrMain)
/* 3BEBC 80060ABC 24030001 */ addiu $v1, $zero, 0x1
/* 3BEC0 80060AC0 AE830000 */ sw $v1, 0x0($s4)
/* 3BEC4 80060AC4 3C03800B */ lui $v1, %hi(__osPiAccessQueue)
/* 3BEC8 80060AC8 24634380 */ addiu $v1, $v1, %lo(__osPiAccessQueue)
/* 3BECC 80060ACC 3C018009 */ lui $at, %hi(__osPiDevMgr + 0x10)
/* 3BED0 80060AD0 AC233D60 */ sw $v1, %lo(__osPiDevMgr + 0x10)($at)
/* 3BED4 80060AD4 3C038007 */ lui $v1, %hi(__osPiRawStartDma)
/* 3BED8 80060AD8 2463B480 */ addiu $v1, $v1, %lo(__osPiRawStartDma)
/* 3BEDC 80060ADC 3C018009 */ lui $at, %hi(__osPiDevMgr + 0x14)
/* 3BEE0 80060AE0 AC233D64 */ sw $v1, %lo(__osPiDevMgr + 0x14)($at)
/* 3BEE4 80060AE4 3C038006 */ lui $v1, %hi(__osEPiRawStartDma)
/* 3BEE8 80060AE8 24630B70 */ addiu $v1, $v1, %lo(__osEPiRawStartDma)
/* 3BEEC 80060AEC 3C018009 */ lui $at, %hi(__osPiDevMgr + 0x18)
/* 3BEF0 80060AF0 AC233D68 */ sw $v1, %lo(__osPiDevMgr + 0x18)($at)
/* 3BEF4 80060AF4 3C03800B */ lui $v1, %hi(piEventQueue)
/* 3BEF8 80060AF8 2463F890 */ addiu $v1, $v1, %lo(piEventQueue)
/* 3BEFC 80060AFC AFB00014 */ sw $s0, 0x14($sp)
/* 3BF00 80060B00 00408021 */ addu $s0, $v0, $zero
/* 3BF04 80060B04 02803821 */ addu $a3, $s4, $zero
/* 3BF08 80060B08 3C018009 */ lui $at, %hi(__osPiDevMgr + 0x4)
/* 3BF0C 80060B0C AC313D54 */ sw $s1, %lo(__osPiDevMgr + 0x4)($at)
/* 3BF10 80060B10 3C018009 */ lui $at, %hi(__osPiDevMgr + 0x8)
/* 3BF14 80060B14 AC353D58 */ sw $s5, %lo(__osPiDevMgr + 0x8)($at)
/* 3BF18 80060B18 3C018009 */ lui $at, %hi(__osPiDevMgr + 0xC)
/* 3BF1C 80060B1C AC333D5C */ sw $s3, %lo(__osPiDevMgr + 0xC)($at)
/* 3BF20 80060B20 0C019798 */ jal osCreateThread
/* 3BF24 80060B24 AFA30010 */ sw $v1, 0x10($sp)
/* 3BF28 80060B28 0C019808 */ jal osStartThread
/* 3BF2C 80060B2C 02202021 */ addu $a0, $s1, $zero
/* 3BF30 80060B30 0C01ACF4 */ jal __osRestoreInt
/* 3BF34 80060B34 02002021 */ addu $a0, $s0, $zero
/* 3BF38 80060B38 2402FFFF */ addiu $v0, $zero, -0x1
/* 3BF3C 80060B3C 12420003 */ beq $s2, $v0, .L80060B4C
/* 3BF40 80060B40 00002021 */ addu $a0, $zero, $zero
/* 3BF44 80060B44 0C0197D4 */ jal osSetThreadPri
/* 3BF48 80060B48 02402821 */ addu $a1, $s2, $zero
.L80060B4C:
/* 3BF4C 80060B4C 8FBF0030 */ lw $ra, 0x30($sp)
/* 3BF50 80060B50 8FB5002C */ lw $s5, 0x2C($sp)
/* 3BF54 80060B54 8FB40028 */ lw $s4, 0x28($sp)
/* 3BF58 80060B58 8FB30024 */ lw $s3, 0x24($sp)
/* 3BF5C 80060B5C 8FB20020 */ lw $s2, 0x20($sp)
/* 3BF60 80060B60 8FB1001C */ lw $s1, 0x1C($sp)
/* 3BF64 80060B64 8FB00018 */ lw $s0, 0x18($sp)
/* 3BF68 80060B68 03E00008 */ jr $ra
/* 3BF6C 80060B6C 27BD0038 */ addiu $sp, $sp, 0x38
### DECOMPILED C INSTRUCTIONS:
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt) {
u32 savedMask;
OSPri oldPri;
OSPri myPri;
if (!__osPiDevMgr.active) {
osCreateMesgQueue(cmdQ, cmdBuf, cmdMsgCnt);
osCreateMesgQueue(&piEventQueue, (OSMesg*)piEventBuf, 1);
if (!__osPiAccessQueueEnabled) {
__osPiCreateAccessQueue();
}
osSetEventMesg(OS_EVENT_PI, &piEventQueue, (OSMesg)0x22222222);
oldPri = -1;
myPri = osGetThreadPri(NULL);
if (myPri < pri) {
oldPri = myPri;
osSetThreadPri(NULL, pri);
}
savedMask = __osDisableInt();
__osPiDevMgr.active = 1;
__osPiDevMgr.thread = &piThread;
__osPiDevMgr.cmdQueue = cmdQ;
__osPiDevMgr.evtQueue = &piEventQueue;
__osPiDevMgr.acsQueue = &__osPiAccessQueue;
__osPiDevMgr.dma = __osPiRawStartDma;
__osPiDevMgr.edma = __osEPiRawStartDma;
osCreateThread(&piThread, 0, __osDevMgrMain, &__osPiDevMgr, &piThreadStack[OS_PIM_STACKSIZE], pri);
osStartThread(&piThread);
__osRestoreInt(savedMask);
if (oldPri != -1) {
osSetThreadPri(NULL, oldPri);
}
}
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel draw_digit
/* BDBC0 801274C0 3C0A800A */ lui $t2, %hi(gMainGfxPos)
/* BDBC4 801274C4 254AA66C */ addiu $t2, $t2, %lo(gMainGfxPos)
/* BDBC8 801274C8 3C028015 */ lui $v0, %hi(gMsgNumbers)
/* BDBCC 801274CC 2442C340 */ addiu $v0, $v0, %lo(gMsgNumbers)
/* BDBD0 801274D0 00054880 */ sll $t1, $a1, 2
/* BDBD4 801274D4 01254821 */ addu $t1, $t1, $a1
/* BDBD8 801274D8 00094880 */ sll $t1, $t1, 2
/* BDBDC 801274DC 01224821 */ addu $t1, $t1, $v0
/* BDBE0 801274E0 8D480000 */ lw $t0, 0x0($t2)
/* BDBE4 801274E4 3C050700 */ lui $a1, (0x7000000 >> 16)
/* BDBE8 801274E8 0100582D */ daddu $t3, $t0, $zero
/* BDBEC 801274EC 25080008 */ addiu $t0, $t0, 0x8
/* BDBF0 801274F0 AD480000 */ sw $t0, 0x0($t2)
/* BDBF4 801274F4 91220005 */ lbu $v0, 0x5($t1)
/* BDBF8 801274F8 25030008 */ addiu $v1, $t0, 0x8
/* BDBFC 801274FC AD640004 */ sw $a0, 0x4($t3)
/* BDC00 80127500 AD430000 */ sw $v1, 0x0($t2)
/* BDC04 80127504 3C03FD48 */ lui $v1, (0xFD480000 >> 16)
/* BDC08 80127508 00021042 */ srl $v0, $v0, 1
/* BDC0C 8012750C 2442FFFF */ addiu $v0, $v0, -0x1
/* BDC10 80127510 30420FFF */ andi $v0, $v0, 0xFFF
/* BDC14 80127514 00431025 */ or $v0, $v0, $v1
/* BDC18 80127518 AD620000 */ sw $v0, 0x0($t3)
/* BDC1C 8012751C 91220005 */ lbu $v0, 0x5($t1)
/* BDC20 80127520 25030010 */ addiu $v1, $t0, 0x10
/* BDC24 80127524 AD050004 */ sw $a1, 0x4($t0)
/* BDC28 80127528 AD430000 */ sw $v1, 0x0($t2)
/* BDC2C 8012752C 3C03E600 */ lui $v1, (0xE6000000 >> 16)
/* BDC30 80127530 AD030008 */ sw $v1, 0x8($t0)
/* BDC34 80127534 25030018 */ addiu $v1, $t0, 0x18
/* BDC38 80127538 AD00000C */ sw $zero, 0xC($t0)
/* BDC3C 8012753C AD430000 */ sw $v1, 0x0($t2)
/* BDC40 80127540 3C03F400 */ lui $v1, (0xF4000000 >> 16)
/* BDC44 80127544 AD030010 */ sw $v1, 0x10($t0)
/* BDC48 80127548 3C03F548 */ lui $v1, (0xF5480000 >> 16)
/* BDC4C 8012754C 00021042 */ srl $v0, $v0, 1
/* BDC50 80127550 24420007 */ addiu $v0, $v0, 0x7
/* BDC54 80127554 000210C2 */ srl $v0, $v0, 3
/* BDC58 80127558 00021240 */ sll $v0, $v0, 9
/* BDC5C 8012755C 00431025 */ or $v0, $v0, $v1
/* BDC60 80127560 AD020000 */ sw $v0, 0x0($t0)
/* BDC64 80127564 91220005 */ lbu $v0, 0x5($t1)
/* BDC68 80127568 91240006 */ lbu $a0, 0x6($t1)
/* BDC6C 8012756C 25030020 */ addiu $v1, $t0, 0x20
/* BDC70 80127570 AD430000 */ sw $v1, 0x0($t2)
/* BDC74 80127574 3C03E700 */ lui $v1, (0xE7000000 >> 16)
/* BDC78 80127578 AD030018 */ sw $v1, 0x18($t0)
/* BDC7C 8012757C 25030028 */ addiu $v1, $t0, 0x28
/* BDC80 80127580 AD00001C */ sw $zero, 0x1C($t0)
/* BDC84 80127584 AD430000 */ sw $v1, 0x0($t2)
/* BDC88 80127588 25030030 */ addiu $v1, $t0, 0x30
/* BDC8C 8012758C 2442FFFF */ addiu $v0, $v0, -0x1
/* BDC90 80127590 00021040 */ sll $v0, $v0, 1
/* BDC94 80127594 30420FFF */ andi $v0, $v0, 0xFFF
/* BDC98 80127598 00021300 */ sll $v0, $v0, 12
/* BDC9C 8012759C 2484FFFF */ addiu $a0, $a0, -0x1
/* BDCA0 801275A0 00042080 */ sll $a0, $a0, 2
/* BDCA4 801275A4 30840FFF */ andi $a0, $a0, 0xFFF
/* BDCA8 801275A8 00852025 */ or $a0, $a0, $a1
/* BDCAC 801275AC 00441025 */ or $v0, $v0, $a0
/* BDCB0 801275B0 AD020014 */ sw $v0, 0x14($t0)
/* BDCB4 801275B4 91220005 */ lbu $v0, 0x5($t1)
/* BDCB8 801275B8 3C050400 */ lui $a1, (0x4000400 >> 16)
/* BDCBC 801275BC AD000024 */ sw $zero, 0x24($t0)
/* BDCC0 801275C0 AD430000 */ sw $v1, 0x0($t2)
/* BDCC4 801275C4 3C03F200 */ lui $v1, (0xF2000000 >> 16)
/* BDCC8 801275C8 AD030028 */ sw $v1, 0x28($t0)
/* BDCCC 801275CC 3C03F540 */ lui $v1, (0xF5400000 >> 16)
/* BDCD0 801275D0 25040038 */ addiu $a0, $t0, 0x38
/* BDCD4 801275D4 00021042 */ srl $v0, $v0, 1
/* BDCD8 801275D8 24420007 */ addiu $v0, $v0, 0x7
/* BDCDC 801275DC 000210C2 */ srl $v0, $v0, 3
/* BDCE0 801275E0 00021240 */ sll $v0, $v0, 9
/* BDCE4 801275E4 00431025 */ or $v0, $v0, $v1
/* BDCE8 801275E8 AD020020 */ sw $v0, 0x20($t0)
/* BDCEC 801275EC 91220005 */ lbu $v0, 0x5($t1)
/* BDCF0 801275F0 91230006 */ lbu $v1, 0x6($t1)
/* BDCF4 801275F4 34A50400 */ ori $a1, $a1, (0x4000400 & 0xFFFF)
/* BDCF8 801275F8 AD440000 */ sw $a0, 0x0($t2)
/* BDCFC 801275FC 3C04E400 */ lui $a0, (0xE4000000 >> 16)
/* BDD00 80127600 2442FFFF */ addiu $v0, $v0, -0x1
/* BDD04 80127604 00021080 */ sll $v0, $v0, 2
/* BDD08 80127608 30420FFF */ andi $v0, $v0, 0xFFF
/* BDD0C 8012760C 00021300 */ sll $v0, $v0, 12
/* BDD10 80127610 2463FFFF */ addiu $v1, $v1, -0x1
/* BDD14 80127614 00031880 */ sll $v1, $v1, 2
/* BDD18 80127618 30630FFF */ andi $v1, $v1, 0xFFF
/* BDD1C 8012761C 00431025 */ or $v0, $v0, $v1
/* BDD20 80127620 AD02002C */ sw $v0, 0x2C($t0)
/* BDD24 80127624 91230005 */ lbu $v1, 0x5($t1)
/* BDD28 80127628 91220006 */ lbu $v0, 0x6($t1)
/* BDD2C 8012762C 00C31821 */ addu $v1, $a2, $v1
/* BDD30 80127630 00031880 */ sll $v1, $v1, 2
/* BDD34 80127634 30630FFF */ andi $v1, $v1, 0xFFF
/* BDD38 80127638 00031B00 */ sll $v1, $v1, 12
/* BDD3C 8012763C 00E21021 */ addu $v0, $a3, $v0
/* BDD40 80127640 00021080 */ sll $v0, $v0, 2
/* BDD44 80127644 30420FFF */ andi $v0, $v0, 0xFFF
/* BDD48 80127648 00441025 */ or $v0, $v0, $a0
/* BDD4C 8012764C 00621825 */ or $v1, $v1, $v0
/* BDD50 80127650 00063080 */ sll $a2, $a2, 2
/* BDD54 80127654 30C60FFF */ andi $a2, $a2, 0xFFF
/* BDD58 80127658 00063300 */ sll $a2, $a2, 12
/* BDD5C 8012765C 00073880 */ sll $a3, $a3, 2
/* BDD60 80127660 30E70FFF */ andi $a3, $a3, 0xFFF
/* BDD64 80127664 00C73025 */ or $a2, $a2, $a3
/* BDD68 80127668 25020040 */ addiu $v0, $t0, 0x40
/* BDD6C 8012766C AD030030 */ sw $v1, 0x30($t0)
/* BDD70 80127670 AD060034 */ sw $a2, 0x34($t0)
/* BDD74 80127674 AD420000 */ sw $v0, 0x0($t2)
/* BDD78 80127678 3C02E100 */ lui $v0, (0xE1000000 >> 16)
/* BDD7C 8012767C AD020038 */ sw $v0, 0x38($t0)
/* BDD80 80127680 25020048 */ addiu $v0, $t0, 0x48
/* BDD84 80127684 AD00003C */ sw $zero, 0x3C($t0)
/* BDD88 80127688 AD420000 */ sw $v0, 0x0($t2)
/* BDD8C 8012768C 3C02F100 */ lui $v0, (0xF1000000 >> 16)
/* BDD90 80127690 AD020040 */ sw $v0, 0x40($t0)
/* BDD94 80127694 03E00008 */ jr $ra
/* BDD98 80127698 AD050044 */ sw $a1, 0x44($t0)
### DECOMPILED C INSTRUCTIONS:
void draw_digit(IMG_PTR img, s32 charset, s32 posX, s32 posY) {
MessageNumber* num = &gMsgNumbers[charset];
gDPLoadTextureTile_4b(gMainGfxPos++,
img, G_IM_FMT_CI,
num->texWidth , num->texHeight,
0, 0,
num->texWidth - 1, num->texHeight - 1,
0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(gMainGfxPos++,
4 * posX, 4 * posY,
4 * (posX + num->texWidth), 4 * (posY + num->texHeight),
G_TX_RENDERTILE,
0, 0,
1 << 10, 1 << 10);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel osPfsFileState
/* 44020 80068C20 27BDFEB0 */ addiu $sp, $sp, -0x150
/* 44024 80068C24 AFB10134 */ sw $s1, 0x134($sp)
/* 44028 80068C28 00808821 */ addu $s1, $a0, $zero
/* 4402C 80068C2C AFB00130 */ sw $s0, 0x130($sp)
/* 44030 80068C30 00A08021 */ addu $s0, $a1, $zero
/* 44034 80068C34 AFBF0148 */ sw $ra, 0x148($sp)
/* 44038 80068C38 AFB50144 */ sw $s5, 0x144($sp)
/* 4403C 80068C3C AFB40140 */ sw $s4, 0x140($sp)
/* 44040 80068C40 AFB3013C */ sw $s3, 0x13C($sp)
/* 44044 80068C44 AFB20138 */ sw $s2, 0x138($sp)
/* 44048 80068C48 8E220050 */ lw $v0, 0x50($s1)
/* 4404C 80068C4C 00101FC2 */ srl $v1, $s0, 31
/* 44050 80068C50 0202102A */ slt $v0, $s0, $v0
/* 44054 80068C54 38420001 */ xori $v0, $v0, 0x1
/* 44058 80068C58 00431025 */ or $v0, $v0, $v1
/* 4405C 80068C5C 1440001F */ bnez $v0, .L80068CDC
/* 44060 80068C60 00C0A021 */ addu $s4, $a2, $zero
/* 44064 80068C64 8E220000 */ lw $v0, 0x0($s1)
/* 44068 80068C68 30420001 */ andi $v0, $v0, 0x1
/* 4406C 80068C6C 10400048 */ beqz $v0, .L80068D90
/* 44070 80068C70 24020005 */ addiu $v0, $zero, 0x5
/* 44074 80068C74 0C01A775 */ jal __osCheckId
/* 44078 80068C78 02202021 */ addu $a0, $s1, $zero
/* 4407C 80068C7C 14400044 */ bnez $v0, .L80068D90
/* 44080 80068C80 00000000 */ nop
/* 44084 80068C84 92220065 */ lbu $v0, 0x65($s1)
/* 44088 80068C88 10400005 */ beqz $v0, .L80068CA0
/* 4408C 80068C8C 02202021 */ addu $a0, $s1, $zero
/* 44090 80068C90 0C01A5B4 */ jal __osPfsSelectBank
/* 44094 80068C94 00002821 */ addu $a1, $zero, $zero
/* 44098 80068C98 1440003D */ bnez $v0, .L80068D90
/* 4409C 80068C9C 00000000 */ nop
.L80068CA0:
/* 440A0 80068CA0 8E240004 */ lw $a0, 0x4($s1)
/* 440A4 80068CA4 8E26005C */ lw $a2, 0x5C($s1)
/* 440A8 80068CA8 8E250008 */ lw $a1, 0x8($s1)
/* 440AC 80068CAC 27A70110 */ addiu $a3, $sp, 0x110
/* 440B0 80068CB0 00D03021 */ addu $a2, $a2, $s0
/* 440B4 80068CB4 0C01A874 */ jal __osContRamRead
/* 440B8 80068CB8 30C6FFFF */ andi $a2, $a2, 0xFFFF
/* 440BC 80068CBC 14400034 */ bnez $v0, .L80068D90
/* 440C0 80068CC0 00000000 */ nop
/* 440C4 80068CC4 97A20114 */ lhu $v0, 0x114($sp)
/* 440C8 80068CC8 10400031 */ beqz $v0, .L80068D90
/* 440CC 80068CCC 24020005 */ addiu $v0, $zero, 0x5
/* 440D0 80068CD0 8FA20110 */ lw $v0, 0x110($sp)
/* 440D4 80068CD4 14400003 */ bnez $v0, .L80068CE4
/* 440D8 80068CD8 00009821 */ addu $s3, $zero, $zero
.L80068CDC:
/* 440DC 80068CDC 0801A364 */ j .L80068D90
/* 440E0 80068CE0 24020005 */ addiu $v0, $zero, 0x5
.L80068CE4:
/* 440E4 80068CE4 97B00116 */ lhu $s0, 0x116($sp)
/* 440E8 80068CE8 241200FF */ addiu $s2, $zero, 0xFF
/* 440EC 80068CEC 27B50010 */ addiu $s5, $sp, 0x10
.L80068CF0:
/* 440F0 80068CF0 8E220060 */ lw $v0, 0x60($s1)
/* 440F4 80068CF4 3203FFFF */ andi $v1, $s0, 0xFFFF
/* 440F8 80068CF8 0062102A */ slt $v0, $v1, $v0
/* 440FC 80068CFC 14400010 */ bnez $v0, .L80068D40
/* 44100 80068D00 00031202 */ srl $v0, $v1, 8
/* 44104 80068D04 304700FF */ andi $a3, $v0, 0xFF
/* 44108 80068D08 10F20007 */ beq $a3, $s2, .L80068D28
/* 4410C 80068D0C 02202021 */ addu $a0, $s1, $zero
/* 44110 80068D10 00409021 */ addu $s2, $v0, $zero
/* 44114 80068D14 27A50010 */ addiu $a1, $sp, 0x10
/* 44118 80068D18 0C01A7A3 */ jal __osPfsRWInode
/* 4411C 80068D1C 00003021 */ addu $a2, $zero, $zero
/* 44120 80068D20 1440001B */ bnez $v0, .L80068D90
/* 44124 80068D24 00000000 */ nop
.L80068D28:
/* 44128 80068D28 320200FF */ andi $v0, $s0, 0xFF
/* 4412C 80068D2C 00021040 */ sll $v0, $v0, 1
/* 44130 80068D30 00551021 */ addu $v0, $v0, $s5
/* 44134 80068D34 94500000 */ lhu $s0, 0x0($v0)
/* 44138 80068D38 0801A33C */ j .L80068CF0
/* 4413C 80068D3C 26730001 */ addiu $s3, $s3, 0x1
.L80068D40:
/* 44140 80068D40 24020001 */ addiu $v0, $zero, 0x1
/* 44144 80068D44 14620012 */ bne $v1, $v0, .L80068D90
/* 44148 80068D48 24020003 */ addiu $v0, $zero, 0x3
/* 4414C 80068D4C 00131200 */ sll $v0, $s3, 8
/* 44150 80068D50 AE820000 */ sw $v0, 0x0($s4)
/* 44154 80068D54 97A20114 */ lhu $v0, 0x114($sp)
/* 44158 80068D58 27A40120 */ addiu $a0, $sp, 0x120
/* 4415C 80068D5C A6820008 */ sh $v0, 0x8($s4)
/* 44160 80068D60 8FA20110 */ lw $v0, 0x110($sp)
/* 44164 80068D64 2685000E */ addiu $a1, $s4, 0xE
/* 44168 80068D68 24060010 */ addiu $a2, $zero, 0x10
/* 4416C 80068D6C 0C019194 */ jal bcopy
/* 44170 80068D70 AE820004 */ sw $v0, 0x4($s4)
/* 44174 80068D74 27A4011C */ addiu $a0, $sp, 0x11C
/* 44178 80068D78 2685000A */ addiu $a1, $s4, 0xA
/* 4417C 80068D7C 0C019194 */ jal bcopy
/* 44180 80068D80 24060004 */ addiu $a2, $zero, 0x4
/* 44184 80068D84 8E240004 */ lw $a0, 0x4($s1)
/* 44188 80068D88 0C01A530 */ jal __osPfsGetStatus
/* 4418C 80068D8C 8E250008 */ lw $a1, 0x8($s1)
.L80068D90:
/* 44190 80068D90 8FBF0148 */ lw $ra, 0x148($sp)
/* 44194 80068D94 8FB50144 */ lw $s5, 0x144($sp)
/* 44198 80068D98 8FB40140 */ lw $s4, 0x140($sp)
/* 4419C 80068D9C 8FB3013C */ lw $s3, 0x13C($sp)
/* 441A0 80068DA0 8FB20138 */ lw $s2, 0x138($sp)
/* 441A4 80068DA4 8FB10134 */ lw $s1, 0x134($sp)
/* 441A8 80068DA8 8FB00130 */ lw $s0, 0x130($sp)
/* 441AC 80068DAC 03E00008 */ jr $ra
/* 441B0 80068DB0 27BD0150 */ addiu $sp, $sp, 0x150
/* 441B4 80068DB4 00000000 */ nop
/* 441B8 80068DB8 00000000 */ nop
/* 441BC 80068DBC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state) {
s32 ret;
s32 pages;
__OSInode inode;
__OSDir dir;
__OSInodeUnit page;
u8 bank;
if (fileNo >= pfs->dir_size || fileNo < 0) {
return PFS_ERR_INVALID;
}
if (!(pfs->status & PFS_INITIALIZED)) {
return PFS_ERR_INVALID;
}
if ((ret = __osCheckId(pfs)) != 0) {
return ret;
}
if (pfs->activebank != 0 && (ret = __osPfsSelectBank(pfs, 0)) != 0) {
return ret;
}
if ((ret = __osContRamRead(pfs->queue, pfs->channel, pfs->dir_table + fileNo, (u8*)&dir)) != 0) {
return ret;
}
if (dir.company_code == 0 || dir.game_code == 0) {
return PFS_ERR_INVALID;
}
page = dir.start_page;
pages = 0;
bank = 0xFF;
while (TRUE) {
if (page.ipage < pfs->inode_start_page) {
break;
}
if (page.inode_t.bank != bank) {
bank = page.inode_t.bank;
if ((ret = __osPfsRWInode(pfs, &inode, PFS_READ, bank)) != 0) {
return ret;
}
}
pages++;
page = inode.inode_page[page.inode_t.page];
}
if (page.ipage != PFS_EOF) {
return PFS_ERR_INCONSISTENT;
}
state->file_size = pages * PFS_ONE_PAGE * BLOCKSIZE;
state->company_code = dir.company_code;
state->game_code = dir.game_code;
bcopy(&dir.game_name, state->game_name, PFS_FILE_NAME_LEN);
bcopy(&dir.ext_name, state->ext_name, PFS_FILE_EXT_LEN);
return __osPfsGetStatus(pfs->queue, pfs->channel);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel hud_element_set_scale
/* DB320 80144C20 2402F7FF */ addiu $v0, $zero, -0x801
/* DB324 80144C24 00822024 */ and $a0, $a0, $v0
/* DB328 80144C28 00042080 */ sll $a0, $a0, 2
/* DB32C 80144C2C 3C028015 */ lui $v0, %hi(gHudElements)
/* DB330 80144C30 8C427960 */ lw $v0, %lo(gHudElements)($v0)
/* DB334 80144C34 44853000 */ mtc1 $a1, $f6
/* DB338 80144C38 00822021 */ addu $a0, $a0, $v0
/* DB33C 80144C3C 8C850000 */ lw $a1, 0x0($a0)
/* DB340 80144C40 8CA20000 */ lw $v0, 0x0($a1)
/* DB344 80144C44 3C030010 */ lui $v1, (0x100000 >> 16)
/* DB348 80144C48 00431024 */ and $v0, $v0, $v1
/* DB34C 80144C4C 14400012 */ bnez $v0, .L80144C98
/* DB350 80144C50 E4A60030 */ swc1 $f6, 0x30($a1)
/* DB354 80144C54 80A30046 */ lb $v1, 0x46($a1)
/* DB358 80144C58 3C048015 */ lui $a0, %hi(gHudElementSizes)
/* DB35C 80144C5C 2484EFCC */ addiu $a0, $a0, %lo(gHudElementSizes)
/* DB360 80144C60 00031040 */ sll $v0, $v1, 1
/* DB364 80144C64 00431021 */ addu $v0, $v0, $v1
/* DB368 80144C68 00021040 */ sll $v0, $v0, 1
/* DB36C 80144C6C 00441021 */ addu $v0, $v0, $a0
/* DB370 80144C70 84480000 */ lh $t0, 0x0($v0)
/* DB374 80144C74 80A30045 */ lb $v1, 0x45($a1)
/* DB378 80144C78 84490002 */ lh $t1, 0x2($v0)
/* DB37C 80144C7C 00031040 */ sll $v0, $v1, 1
/* DB380 80144C80 00431021 */ addu $v0, $v0, $v1
/* DB384 80144C84 00021040 */ sll $v0, $v0, 1
/* DB388 80144C88 00441021 */ addu $v0, $v0, $a0
/* DB38C 80144C8C 84440000 */ lh $a0, 0x0($v0)
/* DB390 80144C90 0805132A */ j .L80144CA8
/* DB394 80144C94 84460002 */ lh $a2, 0x2($v0)
.L80144C98:
/* DB398 80144C98 90A8004E */ lbu $t0, 0x4E($a1)
/* DB39C 80144C9C 90A9004F */ lbu $t1, 0x4F($a1)
/* DB3A0 80144CA0 90A40050 */ lbu $a0, 0x50($a1)
/* DB3A4 80144CA4 90A60051 */ lbu $a2, 0x51($a1)
.L80144CA8:
/* DB3A8 80144CA8 44840000 */ mtc1 $a0, $f0
/* DB3AC 80144CAC 00000000 */ nop
/* DB3B0 80144CB0 46800020 */ cvt.s.w $f0, $f0
/* DB3B4 80144CB4 46060002 */ mul.s $f0, $f0, $f6
/* DB3B8 80144CB8 00000000 */ nop
/* DB3BC 80144CBC 3C014F00 */ lui $at, (0x4F000000 >> 16)
/* DB3C0 80144CC0 44811000 */ mtc1 $at, $f2
/* DB3C4 80144CC4 00000000 */ nop
/* DB3C8 80144CC8 4600103E */ c.le.s $f2, $f0
/* DB3CC 80144CCC 00000000 */ nop
/* DB3D0 80144CD0 45010005 */ bc1t .L80144CE8
/* DB3D4 80144CD4 24A70048 */ addiu $a3, $a1, 0x48
/* DB3D8 80144CD8 4600020D */ trunc.w.s $f8, $f0
/* DB3DC 80144CDC 44034000 */ mfc1 $v1, $f8
/* DB3E0 80144CE0 08051340 */ j .L80144D00
/* DB3E4 80144CE4 00000000 */ nop
.L80144CE8:
/* DB3E8 80144CE8 46020001 */ sub.s $f0, $f0, $f2
/* DB3EC 80144CEC 3C028000 */ lui $v0, (0x80000000 >> 16)
/* DB3F0 80144CF0 4600020D */ trunc.w.s $f8, $f0
/* DB3F4 80144CF4 44034000 */ mfc1 $v1, $f8
/* DB3F8 80144CF8 00000000 */ nop
/* DB3FC 80144CFC 00621825 */ or $v1, $v1, $v0
.L80144D00:
/* DB400 80144D00 44860000 */ mtc1 $a2, $f0
/* DB404 80144D04 00000000 */ nop
/* DB408 80144D08 46800020 */ cvt.s.w $f0, $f0
/* DB40C 80144D0C 46060002 */ mul.s $f0, $f0, $f6
/* DB410 80144D10 00000000 */ nop
/* DB414 80144D14 3C014F00 */ lui $at, (0x4F000000 >> 16)
/* DB418 80144D18 44811000 */ mtc1 $at, $f2
/* DB41C 80144D1C A0E30000 */ sb $v1, 0x0($a3)
/* DB420 80144D20 4600103E */ c.le.s $f2, $f0
/* DB424 80144D24 00000000 */ nop
/* DB428 80144D28 45010005 */ bc1t .L80144D40
/* DB42C 80144D2C 24A70049 */ addiu $a3, $a1, 0x49
/* DB430 80144D30 4600020D */ trunc.w.s $f8, $f0
/* DB434 80144D34 44034000 */ mfc1 $v1, $f8
/* DB438 80144D38 08051356 */ j .L80144D58
/* DB43C 80144D3C 00000000 */ nop
.L80144D40:
/* DB440 80144D40 46020001 */ sub.s $f0, $f0, $f2
/* DB444 80144D44 3C028000 */ lui $v0, (0x80000000 >> 16)
/* DB448 80144D48 4600020D */ trunc.w.s $f8, $f0
/* DB44C 80144D4C 44034000 */ mfc1 $v1, $f8
/* DB450 80144D50 00000000 */ nop
/* DB454 80144D54 00621825 */ or $v1, $v1, $v0
.L80144D58:
/* DB458 80144D58 44842000 */ mtc1 $a0, $f4
/* DB45C 80144D5C 00000000 */ nop
/* DB460 80144D60 46802120 */ cvt.s.w $f4, $f4
/* DB464 80144D64 44880000 */ mtc1 $t0, $f0
/* DB468 80144D68 00000000 */ nop
/* DB46C 80144D6C 46800020 */ cvt.s.w $f0, $f0
/* DB470 80144D70 46002103 */ div.s $f4, $f4, $f0
/* DB474 80144D74 46062102 */ mul.s $f4, $f4, $f6
/* DB478 80144D78 00000000 */ nop
/* DB47C 80144D7C 44861000 */ mtc1 $a2, $f2
/* DB480 80144D80 00000000 */ nop
/* DB484 80144D84 468010A0 */ cvt.s.w $f2, $f2
/* DB488 80144D88 44890000 */ mtc1 $t1, $f0
/* DB48C 80144D8C 00000000 */ nop
/* DB490 80144D90 46800020 */ cvt.s.w $f0, $f0
/* DB494 80144D94 46001083 */ div.s $f2, $f2, $f0
/* DB498 80144D98 46061082 */ mul.s $f2, $f2, $f6
/* DB49C 80144D9C 00000000 */ nop
/* DB4A0 80144DA0 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* DB4A4 80144DA4 44810000 */ mtc1 $at, $f0
/* DB4A8 80144DA8 3C014480 */ lui $at, (0x44800000 >> 16)
/* DB4AC 80144DAC 44813000 */ mtc1 $at, $f6
/* DB4B0 80144DB0 46040103 */ div.s $f4, $f0, $f4
/* DB4B4 80144DB4 46062102 */ mul.s $f4, $f4, $f6
/* DB4B8 80144DB8 00000000 */ nop
/* DB4BC 80144DBC A0E30000 */ sb $v1, 0x0($a3)
/* DB4C0 80144DC0 2403FEFF */ addiu $v1, $zero, -0x101
/* DB4C4 80144DC4 8CA20000 */ lw $v0, 0x0($a1)
/* DB4C8 80144DC8 46020083 */ div.s $f2, $f0, $f2
/* DB4CC 80144DCC 46061082 */ mul.s $f2, $f2, $f6
/* DB4D0 80144DD0 00000000 */ nop
/* DB4D4 80144DD4 00431024 */ and $v0, $v0, $v1
/* DB4D8 80144DD8 34420810 */ ori $v0, $v0, 0x810
/* DB4DC 80144DDC ACA20000 */ sw $v0, 0x0($a1)
/* DB4E0 80144DE0 4600220D */ trunc.w.s $f8, $f4
/* DB4E4 80144DE4 E4A80034 */ swc1 $f8, 0x34($a1)
/* DB4E8 80144DE8 4600120D */ trunc.w.s $f8, $f2
/* DB4EC 80144DEC 03E00008 */ jr $ra
/* DB4F0 80144DF0 E4A80038 */ swc1 $f8, 0x38($a1)
### DECOMPILED C INSTRUCTIONS:
void hud_element_set_scale(s32 index, f32 scale) {
HudElement* elem = (*gHudElements)[index & ~HUD_ELEMENT_BATTLE_ID_MASK];
s32 drawSizeX;
s32 drawSizeY;
s32 imgSizeX;
s32 imgSizeY;
f32 xScaled, yScaled;
elem->uniformScale = scale;
if (!(elem->flags & HUD_ELEMENT_FLAG_CUSTOM_SIZE)) {
imgSizeX = gHudElementSizes[elem->tileSizePreset].width;
imgSizeY = gHudElementSizes[elem->tileSizePreset].height;
drawSizeX = gHudElementSizes[elem->drawSizePreset].width;
drawSizeY = gHudElementSizes[elem->drawSizePreset].height;
} else {
imgSizeX = elem->customImageSize.x;
imgSizeY = elem->customImageSize.y;
drawSizeX = elem->customDrawSize.x;
drawSizeY = elem->customDrawSize.y;
}
elem->sizeX = drawSizeX * scale;
elem->sizeY = drawSizeY * scale;
elem->flags &= ~HUD_ELEMENT_FLAG_FIXEDSCALE;
elem->flags |= HUD_ELEMENT_FLAG_REPEATED | HUD_ELEMENT_FLAG_SCALED;
xScaled = ((f32) drawSizeX / (f32) imgSizeX) * scale;
yScaled = ((f32) drawSizeY / (f32) imgSizeY) * scale;
xScaled = 1.0f / xScaled;
yScaled = 1.0f / yScaled;
elem->widthScale = X10(xScaled);
elem->heightScale = X10(yScaled);
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel firework_rocket_main
/* 3E43A0 E010A000 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 3E43A4 E010A004 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 3E43A8 E010A008 4485A000 */ mtc1 $a1, $f20
/* 3E43AC E010A00C F7B60040 */ sdc1 $f22, 0x40($sp)
/* 3E43B0 E010A010 4486B000 */ mtc1 $a2, $f22
/* 3E43B4 E010A014 AFB20030 */ sw $s2, 0x30($sp)
/* 3E43B8 E010A018 0080902D */ daddu $s2, $a0, $zero
/* 3E43BC E010A01C F7B80048 */ sdc1 $f24, 0x48($sp)
/* 3E43C0 E010A020 4487C000 */ mtc1 $a3, $f24
/* 3E43C4 E010A024 27A40010 */ addiu $a0, $sp, 0x10
/* 3E43C8 E010A028 AFB1002C */ sw $s1, 0x2C($sp)
/* 3E43CC E010A02C 8FB10070 */ lw $s1, 0x70($sp)
/* 3E43D0 E010A030 3C02E011 */ lui $v0, %hi(firework_rocket_init)
/* 3E43D4 E010A034 2442A184 */ addiu $v0, $v0, %lo(firework_rocket_init)
/* 3E43D8 E010A038 AFA20018 */ sw $v0, 0x18($sp)
/* 3E43DC E010A03C 3C02E011 */ lui $v0, %hi(firework_rocket_update)
/* 3E43E0 E010A040 2442A18C */ addiu $v0, $v0, %lo(firework_rocket_update)
/* 3E43E4 E010A044 AFA2001C */ sw $v0, 0x1C($sp)
/* 3E43E8 E010A048 3C02E011 */ lui $v0, %hi(firework_rocket_render)
/* 3E43EC E010A04C 2442A4A0 */ addiu $v0, $v0, %lo(firework_rocket_render)
/* 3E43F0 E010A050 AFA20020 */ sw $v0, 0x20($sp)
/* 3E43F4 E010A054 24020077 */ addiu $v0, $zero, 0x77
/* 3E43F8 E010A058 AFBF0034 */ sw $ra, 0x34($sp)
/* 3E43FC E010A05C AFB00028 */ sw $s0, 0x28($sp)
/* 3E4400 E010A060 AFA00010 */ sw $zero, 0x10($sp)
/* 3E4404 E010A064 AFA00024 */ sw $zero, 0x24($sp)
/* 3E4408 E010A068 0C080124 */ jal shim_create_effect_instance
/* 3E440C E010A06C AFA20014 */ sw $v0, 0x14($sp)
/* 3E4410 E010A070 240400B0 */ addiu $a0, $zero, 0xB0
/* 3E4414 E010A074 24030001 */ addiu $v1, $zero, 0x1
/* 3E4418 E010A078 0040802D */ daddu $s0, $v0, $zero
/* 3E441C E010A07C 0C08012C */ jal shim_general_heap_malloc
/* 3E4420 E010A080 AE030008 */ sw $v1, 0x8($s0)
/* 3E4424 E010A084 0040202D */ daddu $a0, $v0, $zero
/* 3E4428 E010A088 14800003 */ bnez $a0, .LE010A098
/* 3E442C E010A08C AE02000C */ sw $v0, 0xC($s0)
.LE010A090:
/* 3E4430 E010A090 08042824 */ j .LE010A090
/* 3E4434 E010A094 00000000 */ nop
.LE010A098:
/* 3E4438 E010A098 AC920000 */ sw $s2, 0x0($a0)
/* 3E443C E010A09C 1E200003 */ bgtz $s1, .LE010A0AC
/* 3E4440 E010A0A0 AC800020 */ sw $zero, 0x20($a0)
/* 3E4444 E010A0A4 0804282C */ j .LE010A0B0
/* 3E4448 E010A0A8 240203E8 */ addiu $v0, $zero, 0x3E8
.LE010A0AC:
/* 3E444C E010A0AC 26220020 */ addiu $v0, $s1, 0x20
.LE010A0B0:
/* 3E4450 E010A0B0 AC82001C */ sw $v0, 0x1C($a0)
/* 3E4454 E010A0B4 240300FF */ addiu $v1, $zero, 0xFF
/* 3E4458 E010A0B8 AC80004C */ sw $zero, 0x4C($a0)
/* 3E445C E010A0BC AC830030 */ sw $v1, 0x30($a0)
/* 3E4460 E010A0C0 E4940004 */ swc1 $f20, 0x4($a0)
/* 3E4464 E010A0C4 E4960008 */ swc1 $f22, 0x8($a0)
/* 3E4468 E010A0C8 E498000C */ swc1 $f24, 0xC($a0)
/* 3E446C E010A0CC AC800044 */ sw $zero, 0x44($a0)
/* 3E4470 E010A0D0 C7A00060 */ lwc1 $f0, 0x60($sp)
/* 3E4474 E010A0D4 3C01447A */ lui $at, (0x447A0000 >> 16)
/* 3E4478 E010A0D8 44811000 */ mtc1 $at, $f2
/* 3E447C E010A0DC E4800010 */ swc1 $f0, 0x10($a0)
/* 3E4480 E010A0E0 C7A00064 */ lwc1 $f0, 0x64($sp)
/* 3E4484 E010A0E4 0000302D */ daddu $a2, $zero, $zero
/* 3E4488 E010A0E8 E4800014 */ swc1 $f0, 0x14($a0)
/* 3E448C E010A0EC C7A00068 */ lwc1 $f0, 0x68($sp)
/* 3E4490 E010A0F0 0080282D */ daddu $a1, $a0, $zero
/* 3E4494 E010A0F4 E4800018 */ swc1 $f0, 0x18($a0)
/* 3E4498 E010A0F8 C7A0006C */ lwc1 $f0, 0x6C($sp)
/* 3E449C E010A0FC 24020064 */ addiu $v0, $zero, 0x64
/* 3E44A0 E010A100 AC82002C */ sw $v0, 0x2C($a0)
/* 3E44A4 E010A104 AC820038 */ sw $v0, 0x38($a0)
/* 3E44A8 E010A108 24020096 */ addiu $v0, $zero, 0x96
/* 3E44AC E010A10C AC830024 */ sw $v1, 0x24($a0)
/* 3E44B0 E010A110 AC830028 */ sw $v1, 0x28($a0)
/* 3E44B4 E010A114 AC830034 */ sw $v1, 0x34($a0)
/* 3E44B8 E010A118 AC82003C */ sw $v0, 0x3C($a0)
/* 3E44BC E010A11C AC830040 */ sw $v1, 0x40($a0)
/* 3E44C0 E010A120 E4800048 */ swc1 $f0, 0x48($a0)
.LE010A124:
/* 3E44C4 E010A124 C4800004 */ lwc1 $f0, 0x4($a0)
/* 3E44C8 E010A128 E4A00050 */ swc1 $f0, 0x50($a1)
/* 3E44CC E010A12C C4800008 */ lwc1 $f0, 0x8($a0)
/* 3E44D0 E010A130 46020001 */ sub.s $f0, $f0, $f2
/* 3E44D4 E010A134 24C60001 */ addiu $a2, $a2, 0x1
/* 3E44D8 E010A138 E4A00060 */ swc1 $f0, 0x60($a1)
/* 3E44DC E010A13C C480000C */ lwc1 $f0, 0xC($a0)
/* 3E44E0 E010A140 28C20004 */ slti $v0, $a2, 0x4
/* 3E44E4 E010A144 ACA00080 */ sw $zero, 0x80($a1)
/* 3E44E8 E010A148 ACA00090 */ sw $zero, 0x90($a1)
/* 3E44EC E010A14C ACA000A0 */ sw $zero, 0xA0($a1)
/* 3E44F0 E010A150 E4A00070 */ swc1 $f0, 0x70($a1)
/* 3E44F4 E010A154 1440FFF3 */ bnez $v0, .LE010A124
/* 3E44F8 E010A158 24A50004 */ addiu $a1, $a1, 0x4
/* 3E44FC E010A15C 0200102D */ daddu $v0, $s0, $zero
/* 3E4500 E010A160 8FBF0034 */ lw $ra, 0x34($sp)
/* 3E4504 E010A164 8FB20030 */ lw $s2, 0x30($sp)
/* 3E4508 E010A168 8FB1002C */ lw $s1, 0x2C($sp)
/* 3E450C E010A16C 8FB00028 */ lw $s0, 0x28($sp)
/* 3E4510 E010A170 D7B80048 */ ldc1 $f24, 0x48($sp)
/* 3E4514 E010A174 D7B60040 */ ldc1 $f22, 0x40($sp)
/* 3E4518 E010A178 D7B40038 */ ldc1 $f20, 0x38($sp)
/* 3E451C E010A17C 03E00008 */ jr $ra
/* 3E4520 E010A180 27BD0050 */ addiu $sp, $sp, 0x50
### DECOMPILED C INSTRUCTIONS:
EffectInstance* firework_rocket_main(s32 variation, f32 centerX, f32 centerY, f32 centerZ, f32 velX, f32 velY, f32 velZ, f32 radius, s32 duration) {
EffectBlueprint bp;
EffectInstance* effect;
FireworkRocketFXData* data;
s32 numParts = 1;
s32 i;
bp.init = firework_rocket_init;
bp.update = firework_rocket_update;
bp.renderWorld = firework_rocket_render;
bp.unk_00 = 0;
bp.renderUI = NULL;
bp.effectID = EFFECT_FIREWORK_ROCKET;
effect = shim_create_effect_instance(&bp);
effect->numParts = numParts;
data = effect->data.fireworkRocket = shim_general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.fireworkRocket != NULL);
data->variation = variation;
data->lifeTime = 0;
if (duration <= 0) {
data->timeLeft = 1000;
} else {
data->timeLeft = duration + 32;
}
data->isExploded = FALSE;
data->minBlurAlpha = 255;
data->pos.x = centerX;
data->pos.y = centerY;
data->pos.z = centerZ;
data->radius = 0;
data->velocity.x = velX;
data->velocity.y = velY;
data->velocity.z = velZ;
data->maxRadius = radius;
data->r = 255;
data->g = 255;
data->b = 100;
data->unk_34 = 255;
data->unk_38 = 100;
data->unk_3C = 150;
data->unk_40 = 255;
for (i = 0; i < 4; i++) {
data->rocketX[i] = data->pos.x;
data->rocketY[i] = data->pos.y - 1000.0f;
data->rocketZ[i] = data->pos.z;
data->rocketVelocityX[i] = 0;
data->rocketVelocityY[i] = 0;
data->rocketVelocityZ[i] = 0;
}
return effect;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel guPosition
/* 3F4E8 800640E8 3C018009 */ lui $at, %hi(dtor)
/* 3F4EC 800640EC C4203DC0 */ lwc1 $f0, %lo(dtor)($at)
/* 3F4F0 800640F0 44859000 */ mtc1 $a1, $f18
/* 3F4F4 800640F4 27BDFF70 */ addiu $sp, $sp, -0x90
/* 3F4F8 800640F8 F7B40060 */ sdc1 $f20, 0x60($sp)
/* 3F4FC 800640FC 46009502 */ mul.s $f20, $f18, $f0
/* 3F500 80064100 44869000 */ mtc1 $a2, $f18
/* 3F504 80064104 F7BA0078 */ sdc1 $f26, 0x78($sp)
/* 3F508 80064108 F7B80070 */ sdc1 $f24, 0x70($sp)
/* 3F50C 8006410C 46009682 */ mul.s $f26, $f18, $f0
/* 3F510 80064110 C7B800A0 */ lwc1 $f24, 0xA0($sp)
/* 3F514 80064114 AFB10054 */ sw $s1, 0x54($sp)
/* 3F518 80064118 44879000 */ mtc1 $a3, $f18
/* 3F51C 8006411C 00808821 */ addu $s1, $a0, $zero
/* 3F520 80064120 46009482 */ mul.s $f18, $f18, $f0
/* 3F524 80064124 AFBF0058 */ sw $ra, 0x58($sp)
/* 3F528 80064128 AFB00050 */ sw $s0, 0x50($sp)
/* 3F52C 8006412C F7BE0088 */ sdc1 $f30, 0x88($sp)
/* 3F530 80064130 F7BC0080 */ sdc1 $f28, 0x80($sp)
/* 3F534 80064134 F7B60068 */ sdc1 $f22, 0x68($sp)
/* 3F538 80064138 44109000 */ mfc1 $s0, $f18
/* 3F53C 8006413C 00000000 */ nop
/* 3F540 80064140 0C00A85B */ jal sin_rad
/* 3F544 80064144 4600A306 */ mov.s $f12, $f20
/* 3F548 80064148 4600A306 */ mov.s $f12, $f20
/* 3F54C 8006414C 0C00A874 */ jal cos_rad
/* 3F550 80064150 46000786 */ mov.s $f30, $f0
/* 3F554 80064154 4600D306 */ mov.s $f12, $f26
/* 3F558 80064158 0C00A85B */ jal sin_rad
/* 3F55C 8006415C 46000586 */ mov.s $f22, $f0
/* 3F560 80064160 4600D306 */ mov.s $f12, $f26
/* 3F564 80064164 0C00A874 */ jal cos_rad
/* 3F568 80064168 46000506 */ mov.s $f20, $f0
/* 3F56C 8006416C 44906000 */ mtc1 $s0, $f12
/* 3F570 80064170 00000000 */ nop
/* 3F574 80064174 0C00A85B */ jal sin_rad
/* 3F578 80064178 46000706 */ mov.s $f28, $f0
/* 3F57C 8006417C 44906000 */ mtc1 $s0, $f12
/* 3F580 80064180 00000000 */ nop
/* 3F584 80064184 0C00A874 */ jal cos_rad
/* 3F588 80064188 46000686 */ mov.s $f26, $f0
/* 3F58C 8006418C 00000000 */ nop
/* 3F590 80064190 4600E382 */ mul.s $f14, $f28, $f0
/* 3F594 80064194 00000000 */ nop
/* 3F598 80064198 461AE402 */ mul.s $f16, $f28, $f26
/* 3F59C 8006419C 00000000 */ nop
/* 3F5A0 800641A0 4614F102 */ mul.s $f4, $f30, $f20
/* 3F5A4 800641A4 00000000 */ nop
/* 3F5A8 800641A8 461AB082 */ mul.s $f2, $f22, $f26
/* 3F5AC 800641AC 00000000 */ nop
/* 3F5B0 800641B0 4600B182 */ mul.s $f6, $f22, $f0
/* 3F5B4 800641B4 4600A307 */ neg.s $f12, $f20
/* 3F5B8 800641B8 4614B502 */ mul.s $f20, $f22, $f20
/* 3F5BC 800641BC 00000000 */ nop
/* 3F5C0 800641C0 461CF282 */ mul.s $f10, $f30, $f28
/* 3F5C4 800641C4 00000000 */ nop
/* 3F5C8 800641C8 461CB582 */ mul.s $f22, $f22, $f28
/* 3F5CC 800641CC 00000000 */ nop
/* 3F5D0 800641D0 46186302 */ mul.s $f12, $f12, $f24
/* 3F5D4 800641D4 00000000 */ nop
/* 3F5D8 800641D8 46187382 */ mul.s $f14, $f14, $f24
/* 3F5DC 800641DC 00000000 */ nop
/* 3F5E0 800641E0 46188402 */ mul.s $f16, $f16, $f24
/* 3F5E4 800641E4 00000000 */ nop
/* 3F5E8 800641E8 46002202 */ mul.s $f8, $f4, $f0
/* 3F5EC 800641EC 00000000 */ nop
/* 3F5F0 800641F0 461A2102 */ mul.s $f4, $f4, $f26
/* 3F5F4 800641F4 00000000 */ nop
/* 3F5F8 800641F8 46185282 */ mul.s $f10, $f10, $f24
/* 3F5FC 800641FC 00000000 */ nop
/* 3F600 80064200 4618B582 */ mul.s $f22, $f22, $f24
/* 3F604 80064204 46062100 */ add.s $f4, $f4, $f6
/* 3F608 80064208 4600A182 */ mul.s $f6, $f20, $f0
/* 3F60C 8006420C 46024201 */ sub.s $f8, $f8, $f2
/* 3F610 80064210 461AF082 */ mul.s $f2, $f30, $f26
/* 3F614 80064214 00000000 */ nop
/* 3F618 80064218 461AA502 */ mul.s $f20, $f20, $f26
/* 3F61C 8006421C 00000000 */ nop
/* 3F620 80064220 4600F782 */ mul.s $f30, $f30, $f0
/* 3F624 80064224 C7B200A4 */ lwc1 $f18, 0xA4($sp)
/* 3F628 80064228 46184202 */ mul.s $f8, $f8, $f24
/* 3F62C 8006422C E7B20040 */ swc1 $f18, 0x40($sp)
/* 3F630 80064230 C7B200A8 */ lwc1 $f18, 0xA8($sp)
/* 3F634 80064234 27A40010 */ addiu $a0, $sp, 0x10
/* 3F638 80064238 E7B20044 */ swc1 $f18, 0x44($sp)
/* 3F63C 8006423C 46182102 */ mul.s $f4, $f4, $f24
/* 3F640 80064240 C7B200AC */ lwc1 $f18, 0xAC($sp)
/* 3F644 80064244 3C013F80 */ lui $at, (0x3F800000 >> 16)
/* 3F648 80064248 44810000 */ mtc1 $at, $f0
/* 3F64C 8006424C 46023180 */ add.s $f6, $f6, $f2
/* 3F650 80064250 02202821 */ addu $a1, $s1, $zero
/* 3F654 80064254 AFA0001C */ sw $zero, 0x1C($sp)
/* 3F658 80064258 AFA0002C */ sw $zero, 0x2C($sp)
/* 3F65C 8006425C 46183182 */ mul.s $f6, $f6, $f24
/* 3F660 80064260 AFA0003C */ sw $zero, 0x3C($sp)
/* 3F664 80064264 E7B20048 */ swc1 $f18, 0x48($sp)
/* 3F668 80064268 461EA501 */ sub.s $f20, $f20, $f30
/* 3F66C 8006426C E7AC0018 */ swc1 $f12, 0x18($sp)
/* 3F670 80064270 E7AE0010 */ swc1 $f14, 0x10($sp)
/* 3F674 80064274 E7B00014 */ swc1 $f16, 0x14($sp)
/* 3F678 80064278 4618A502 */ mul.s $f20, $f20, $f24
/* 3F67C 8006427C E7AA0028 */ swc1 $f10, 0x28($sp)
/* 3F680 80064280 E7B60038 */ swc1 $f22, 0x38($sp)
/* 3F684 80064284 E7A0004C */ swc1 $f0, 0x4C($sp)
/* 3F688 80064288 E7A80020 */ swc1 $f8, 0x20($sp)
/* 3F68C 8006428C E7A40024 */ swc1 $f4, 0x24($sp)
/* 3F690 80064290 E7A60030 */ swc1 $f6, 0x30($sp)
/* 3F694 80064294 0C019D40 */ jal guMtxF2L
/* 3F698 80064298 E7B40034 */ swc1 $f20, 0x34($sp)
/* 3F69C 8006429C 8FBF0058 */ lw $ra, 0x58($sp)
/* 3F6A0 800642A0 8FB10054 */ lw $s1, 0x54($sp)
/* 3F6A4 800642A4 8FB00050 */ lw $s0, 0x50($sp)
/* 3F6A8 800642A8 D7BE0088 */ ldc1 $f30, 0x88($sp)
/* 3F6AC 800642AC D7BC0080 */ ldc1 $f28, 0x80($sp)
/* 3F6B0 800642B0 D7BA0078 */ ldc1 $f26, 0x78($sp)
/* 3F6B4 800642B4 D7B80070 */ ldc1 $f24, 0x70($sp)
/* 3F6B8 800642B8 D7B60068 */ ldc1 $f22, 0x68($sp)
/* 3F6BC 800642BC D7B40060 */ ldc1 $f20, 0x60($sp)
/* 3F6C0 800642C0 03E00008 */ jr $ra
/* 3F6C4 800642C4 27BD0090 */ addiu $sp, $sp, 0x90
/* 3F6C8 800642C8 00000000 */ nop
/* 3F6CC 800642CC 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void guPositionF(f32 mf[4][4], f32 r, f32 p, f32 h, f32 s, f32 x, f32 y, f32 z) {
static f32 dtor = 3.1415926 / 180.0;
f32 sinr, sinp, sinh;
f32 cosr, cosp, cosh;
r *= dtor;
p *= dtor;
h *= dtor;
sinr = sin_rad(r);
cosr = cos_rad(r);
sinp = sin_rad(p);
cosp = cos_rad(p);
sinh = sin_rad(h);
cosh = cos_rad(h);
mf[0][0] = (cosp * cosh) * s;
mf[0][1] = (cosp * sinh) * s;
mf[0][2] = (-sinp) * s;
mf[0][3] = 0.0;
mf[1][0] = (sinr * sinp * cosh - cosr * sinh) * s;
mf[1][1] = (sinr * sinp * sinh + cosr * cosh) * s;
mf[1][2] = (sinr * cosp) * s;
mf[1][3] = 0.0;
mf[2][0] = (cosr * sinp * cosh + sinr * sinh) * s;
mf[2][1] = (cosr * sinp * sinh - sinr * cosh) * s;
mf[2][2] = (cosr * cosp) * s;
mf[2][3] = 0.0;
mf[3][0] = x;
mf[3][1] = y;
mf[3][2] = z;
mf[3][3] = 1.0;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel imgfx_appendGfx_component
/* D1670 8013AF70 27BDFFE0 */ addiu $sp, $sp, -0x20
/* D1674 8013AF74 0080402D */ daddu $t0, $a0, $zero
/* D1678 8013AF78 AFB20018 */ sw $s2, 0x18($sp)
/* D167C 8013AF7C 00E0902D */ daddu $s2, $a3, $zero
/* D1680 8013AF80 AFB10014 */ sw $s1, 0x14($sp)
/* D1684 8013AF84 0000882D */ daddu $s1, $zero, $zero
/* D1688 8013AF88 00081140 */ sll $v0, $t0, 5
/* D168C 8013AF8C 00481023 */ subu $v0, $v0, $t0
/* D1690 8013AF90 3C038015 */ lui $v1, %hi(ImgFXInstances)
/* D1694 8013AF94 8C636954 */ lw $v1, %lo(ImgFXInstances)($v1)
/* D1698 8013AF98 00021080 */ sll $v0, $v0, 2
/* D169C 8013AF9C AFBF001C */ sw $ra, 0x1C($sp)
/* D16A0 8013AFA0 AFB00010 */ sw $s0, 0x10($sp)
/* D16A4 8013AFA4 90A40010 */ lbu $a0, 0x10($a1)
/* D16A8 8013AFA8 10800049 */ beqz $a0, .L8013B0D0
/* D16AC 8013AFAC 00628021 */ addu $s0, $v1, $v0
/* D16B0 8013AFB0 8E020014 */ lw $v0, 0x14($s0)
/* D16B4 8013AFB4 A2080000 */ sb $t0, 0x0($s0)
/* D16B8 8013AFB8 3C038015 */ lui $v1, %hi(ImgFXCurrentTexturePtr)
/* D16BC 8013AFBC 8C63EE10 */ lw $v1, %lo(ImgFXCurrentTexturePtr)($v1)
/* D16C0 8013AFC0 00461025 */ or $v0, $v0, $a2
/* D16C4 8013AFC4 AE020014 */ sw $v0, 0x14($s0)
/* D16C8 8013AFC8 8CA20000 */ lw $v0, 0x0($a1)
/* D16CC 8013AFCC AC620000 */ sw $v0, 0x0($v1)
/* D16D0 8013AFD0 8CA20004 */ lw $v0, 0x4($a1)
/* D16D4 8013AFD4 AC620004 */ sw $v0, 0x4($v1)
/* D16D8 8013AFD8 94A20008 */ lhu $v0, 0x8($a1)
/* D16DC 8013AFDC A4620008 */ sh $v0, 0x8($v1)
/* D16E0 8013AFE0 94A2000A */ lhu $v0, 0xA($a1)
/* D16E4 8013AFE4 A462000A */ sh $v0, 0xA($v1)
/* D16E8 8013AFE8 94A2000C */ lhu $v0, 0xC($a1)
/* D16EC 8013AFEC A462000C */ sh $v0, 0xC($v1)
/* D16F0 8013AFF0 94A2000E */ lhu $v0, 0xE($a1)
/* D16F4 8013AFF4 A4600018 */ sh $zero, 0x18($v1)
/* D16F8 8013AFF8 A460001E */ sh $zero, 0x1E($v1)
/* D16FC 8013AFFC A462000E */ sh $v0, 0xE($v1)
/* D1700 8013B000 90A20010 */ lbu $v0, 0x10($a1)
/* D1704 8013B004 A0620024 */ sb $v0, 0x24($v1)
/* D1708 8013B008 2D02005A */ sltiu $v0, $t0, 0x5A
/* D170C 8013B00C 14400003 */ bnez $v0, .L8013B01C
/* D1710 8013B010 2902005A */ slti $v0, $t0, 0x5A
/* D1714 8013B014 0804EC35 */ j .L8013B0D4
/* D1718 8013B018 0000102D */ daddu $v0, $zero, $zero
.L8013B01C:
/* D171C 8013B01C 1040002D */ beqz $v0, .L8013B0D4
/* D1720 8013B020 0000102D */ daddu $v0, $zero, $zero
/* D1724 8013B024 1200002B */ beqz $s0, .L8013B0D4
/* D1728 8013B028 00000000 */ nop
/* D172C 8013B02C 0C04EC3B */ jal imgfx_make_mesh
/* D1730 8013B030 0200202D */ daddu $a0, $s0, $zero
/* D1734 8013B034 0200202D */ daddu $a0, $s0, $zero
/* D1738 8013B038 0C04EC6C */ jal imgfx_appendGfx_mesh
/* D173C 8013B03C 0240282D */ daddu $a1, $s2, $zero
/* D1740 8013B040 8E030014 */ lw $v1, 0x14($s0)
/* D1744 8013B044 30621000 */ andi $v0, $v1, 0x1000
/* D1748 8013B048 1040000F */ beqz $v0, .L8013B088
/* D174C 8013B04C 0200202D */ daddu $a0, $s0, $zero
/* D1750 8013B050 24110001 */ addiu $s1, $zero, 0x1
/* D1754 8013B054 2402FFFF */ addiu $v0, $zero, -0x1
/* D1758 8013B058 AC82001C */ sw $v0, 0x1C($a0)
/* D175C 8013B05C AC82002C */ sw $v0, 0x2C($a0)
/* D1760 8013B060 8C820014 */ lw $v0, 0x14($a0)
/* D1764 8013B064 2403E67F */ addiu $v1, $zero, -0x1981
/* D1768 8013B068 A0800005 */ sb $zero, 0x5($a0)
/* D176C 8013B06C A0800001 */ sb $zero, 0x1($a0)
/* D1770 8013B070 A0800002 */ sb $zero, 0x2($a0)
/* D1774 8013B074 00431024 */ and $v0, $v0, $v1
/* D1778 8013B078 0C04EA4F */ jal imgfx_cache_instance_data
/* D177C 8013B07C AC820014 */ sw $v0, 0x14($a0)
/* D1780 8013B080 0804EC35 */ j .L8013B0D4
/* D1784 8013B084 0220102D */ daddu $v0, $s1, $zero
.L8013B088:
/* D1788 8013B088 30624000 */ andi $v0, $v1, 0x4000
/* D178C 8013B08C 10400003 */ beqz $v0, .L8013B09C
/* D1790 8013B090 3C020002 */ lui $v0, (0x20000 >> 16)
/* D1794 8013B094 0804EC34 */ j .L8013B0D0
/* D1798 8013B098 24110002 */ addiu $s1, $zero, 0x2
.L8013B09C:
/* D179C 8013B09C 00621024 */ and $v0, $v1, $v0
/* D17A0 8013B0A0 1040000B */ beqz $v0, .L8013B0D0
/* D17A4 8013B0A4 2403FFFF */ addiu $v1, $zero, -0x1
/* D17A8 8013B0A8 24110001 */ addiu $s1, $zero, 0x1
/* D17AC 8013B0AC 8E020014 */ lw $v0, 0x14($s0)
/* D17B0 8013B0B0 A2000005 */ sb $zero, 0x5($s0)
/* D17B4 8013B0B4 A2000006 */ sb $zero, 0x6($s0)
/* D17B8 8013B0B8 A2000001 */ sb $zero, 0x1($s0)
/* D17BC 8013B0BC A2000002 */ sb $zero, 0x2($s0)
/* D17C0 8013B0C0 AE03001C */ sw $v1, 0x1C($s0)
/* D17C4 8013B0C4 AE03002C */ sw $v1, 0x2C($s0)
/* D17C8 8013B0C8 00511024 */ and $v0, $v0, $s1
/* D17CC 8013B0CC AE020014 */ sw $v0, 0x14($s0)
.L8013B0D0:
/* D17D0 8013B0D0 0220102D */ daddu $v0, $s1, $zero
.L8013B0D4:
/* D17D4 8013B0D4 8FBF001C */ lw $ra, 0x1C($sp)
/* D17D8 8013B0D8 8FB20018 */ lw $s2, 0x18($sp)
/* D17DC 8013B0DC 8FB10014 */ lw $s1, 0x14($sp)
/* D17E0 8013B0E0 8FB00010 */ lw $s0, 0x10($sp)
/* D17E4 8013B0E4 03E00008 */ jr $ra
/* D17E8 8013B0E8 27BD0020 */ addiu $sp, $sp, 0x20
### DECOMPILED C INSTRUCTIONS:
s32 imgfx_appendGfx_component(s32 idx, ImgFXTexture* ifxImg, u32 flagBits, Matrix4f mtx) {
ImgFXState* state = &(*ImgFXInstances)[idx];
s32 ret = 0;
if (ifxImg->alpha == 0) {
return 0;
}
state->arrayIdx = idx;
state->flags |= flagBits;
ImgFXCurrentTexturePtr->tex.raster = ifxImg->raster;
ImgFXCurrentTexturePtr->tex.palette = ifxImg->palette;
ImgFXCurrentTexturePtr->tex.width = ifxImg->width;
ImgFXCurrentTexturePtr->tex.height = ifxImg->height;
ImgFXCurrentTexturePtr->tex.xOffset = ifxImg->xOffset;
ImgFXCurrentTexturePtr->tex.yOffset = ifxImg->yOffset;
ImgFXCurrentTexturePtr->unk_18 = 0;
ImgFXCurrentTexturePtr->unk_1E = 0;
ImgFXCurrentTexturePtr->alphaMultiplier = ifxImg->alpha;
if (idx < 0 || idx >= MAX_IMGFX_INSTANCES) {
return 0;
}
if (idx >= MAX_IMGFX_INSTANCES || state == NULL) {
return 0;
}
imgfx_make_mesh(state);
imgfx_appendGfx_mesh(state, mtx);
if (state->flags & IMGFX_FLAG_ANIM_DONE) {
state->ints.raw[0][0] = -1;
state->ints.raw[1][0] = -1;
state->lastAnimCmd = IMGFX_CLEAR;
state->meshType = 0;
state->renderType = IMGFX_RENDER_DEFAULT;
state->flags &= ~(IMGFX_FLAG_ANIM_DONE | IMGFX_FLAG_800 | IMGFX_FLAG_REVERSE_ANIM | IMGFX_FLAG_LOOP_ANIM);
imgfx_cache_instance_data(state);
ret = 1;
} else if (state->flags & IMGFX_FLAG_4000) {
ret = 2;
} else if (state->flags & IMGFX_FLAG_20000) {
state->lastAnimCmd = IMGFX_CLEAR;
state->lastColorCmd = IMGFX_CLEAR;
state->meshType = IMGFX_MESH_DEFAULT;
state->renderType = IMGFX_RENDER_DEFAULT;
state->ints.raw[0][0] = -1;
state->ints.raw[1][0] = -1;
state->flags &= IMGFX_FLAG_IN_USE;
ret = 1;
}
return ret;
}
|
### RAW ASSEMBLY INSTRUCTIONS:
glabel update_action_ratings
/* 195258 80266978 0000302D */ daddu $a2, $zero, $zero
/* 19525C 8026697C 2409003C */ addiu $t1, $zero, 0x3C
/* 195260 80266980 24080005 */ addiu $t0, $zero, 0x5
/* 195264 80266984 3C07800E */ lui $a3, %hi(gBattleStatus)
/* 195268 80266988 24E7C070 */ addiu $a3, $a3, %lo(gBattleStatus)
/* 19526C 8026698C 00E0282D */ daddu $a1, $a3, $zero
.L80266990:
/* 195270 80266990 8CA400E0 */ lw $a0, 0xE0($a1)
/* 195274 80266994 50800018 */ beql $a0, $zero, .L802669F8
/* 195278 80266998 24C60001 */ addiu $a2, $a2, 0x1
/* 19527C 8026699C 80820205 */ lb $v0, 0x205($a0)
/* 195280 802669A0 14490007 */ bne $v0, $t1, .L802669C0
/* 195284 802669A4 00000000 */ nop
/* 195288 802669A8 8C820200 */ lw $v0, 0x200($a0)
/* 19528C 802669AC 10400003 */ beqz $v0, .L802669BC
/* 195290 802669B0 00000000 */ nop
/* 195294 802669B4 8C42000C */ lw $v0, 0xC($v0)
/* 195298 802669B8 AC400024 */ sw $zero, 0x24($v0)
.L802669BC:
/* 19529C 802669BC 80820205 */ lb $v0, 0x205($a0)
.L802669C0:
/* 1952A0 802669C0 14480007 */ bne $v0, $t0, .L802669E0
/* 1952A4 802669C4 00000000 */ nop
/* 1952A8 802669C8 8C820200 */ lw $v0, 0x200($a0)
/* 1952AC 802669CC 10400004 */ beqz $v0, .L802669E0
/* 1952B0 802669D0 00000000 */ nop
/* 1952B4 802669D4 8C42000C */ lw $v0, 0xC($v0)
/* 1952B8 802669D8 AC400018 */ sw $zero, 0x18($v0)
/* 1952BC 802669DC AC800200 */ sw $zero, 0x200($a0)
.L802669E0:
/* 1952C0 802669E0 80820205 */ lb $v0, 0x205($a0)
/* 1952C4 802669E4 90830205 */ lbu $v1, 0x205($a0)
/* 1952C8 802669E8 18400003 */ blez $v0, .L802669F8
/* 1952CC 802669EC 24C60001 */ addiu $a2, $a2, 0x1
/* 1952D0 802669F0 2462FFFF */ addiu $v0, $v1, -0x1
/* 1952D4 802669F4 A0820205 */ sb $v0, 0x205($a0)
.L802669F8:
/* 1952D8 802669F8 28C20018 */ slti $v0, $a2, 0x18
/* 1952DC 802669FC 1440FFE4 */ bnez $v0, .L80266990
/* 1952E0 80266A00 24A50004 */ addiu $a1, $a1, 0x4
/* 1952E4 80266A04 8CE400D8 */ lw $a0, 0xD8($a3)
/* 1952E8 80266A08 10800018 */ beqz $a0, .L80266A6C
/* 1952EC 80266A0C 2402003C */ addiu $v0, $zero, 0x3C
/* 1952F0 80266A10 80830205 */ lb $v1, 0x205($a0)
/* 1952F4 80266A14 14620008 */ bne $v1, $v0, .L80266A38
/* 1952F8 80266A18 24020005 */ addiu $v0, $zero, 0x5
/* 1952FC 80266A1C 8C820200 */ lw $v0, 0x200($a0)
/* 195300 80266A20 50400005 */ beql $v0, $zero, .L80266A38
/* 195304 80266A24 24020005 */ addiu $v0, $zero, 0x5
/* 195308 80266A28 8C42000C */ lw $v0, 0xC($v0)
/* 19530C 80266A2C AC400024 */ sw $zero, 0x24($v0)
/* 195310 80266A30 80830205 */ lb $v1, 0x205($a0)
/* 195314 80266A34 24020005 */ addiu $v0, $zero, 0x5
.L80266A38:
/* 195318 80266A38 14620007 */ bne $v1, $v0, .L80266A58
/* 19531C 80266A3C 00000000 */ nop
/* 195320 80266A40 8C820200 */ lw $v0, 0x200($a0)
/* 195324 80266A44 10400004 */ beqz $v0, .L80266A58
/* 195328 80266A48 00000000 */ nop
/* 19532C 80266A4C 8C42000C */ lw $v0, 0xC($v0)
/* 195330 80266A50 AC400018 */ sw $zero, 0x18($v0)
/* 195334 80266A54 AC800200 */ sw $zero, 0x200($a0)
.L80266A58:
/* 195338 80266A58 80820205 */ lb $v0, 0x205($a0)
/* 19533C 80266A5C 90830205 */ lbu $v1, 0x205($a0)
/* 195340 80266A60 18400002 */ blez $v0, .L80266A6C
/* 195344 80266A64 2462FFFF */ addiu $v0, $v1, -0x1
/* 195348 80266A68 A0820205 */ sb $v0, 0x205($a0)
.L80266A6C:
/* 19534C 80266A6C 8CE400DC */ lw $a0, 0xDC($a3)
/* 195350 80266A70 10800018 */ beqz $a0, .L80266AD4
/* 195354 80266A74 2402003C */ addiu $v0, $zero, 0x3C
/* 195358 80266A78 80830205 */ lb $v1, 0x205($a0)
/* 19535C 80266A7C 14620008 */ bne $v1, $v0, .L80266AA0
/* 195360 80266A80 24020005 */ addiu $v0, $zero, 0x5
/* 195364 80266A84 8C820200 */ lw $v0, 0x200($a0)
/* 195368 80266A88 50400005 */ beql $v0, $zero, .L80266AA0
/* 19536C 80266A8C 24020005 */ addiu $v0, $zero, 0x5
/* 195370 80266A90 8C42000C */ lw $v0, 0xC($v0)
/* 195374 80266A94 AC400024 */ sw $zero, 0x24($v0)
/* 195378 80266A98 80830205 */ lb $v1, 0x205($a0)
/* 19537C 80266A9C 24020005 */ addiu $v0, $zero, 0x5
.L80266AA0:
/* 195380 80266AA0 14620007 */ bne $v1, $v0, .L80266AC0
/* 195384 80266AA4 00000000 */ nop
/* 195388 80266AA8 8C820200 */ lw $v0, 0x200($a0)
/* 19538C 80266AAC 10400004 */ beqz $v0, .L80266AC0
/* 195390 80266AB0 00000000 */ nop
/* 195394 80266AB4 8C42000C */ lw $v0, 0xC($v0)
/* 195398 80266AB8 AC400018 */ sw $zero, 0x18($v0)
/* 19539C 80266ABC AC800200 */ sw $zero, 0x200($a0)
.L80266AC0:
/* 1953A0 80266AC0 80820205 */ lb $v0, 0x205($a0)
/* 1953A4 80266AC4 90830205 */ lbu $v1, 0x205($a0)
/* 1953A8 80266AC8 18400002 */ blez $v0, .L80266AD4
/* 1953AC 80266ACC 2462FFFF */ addiu $v0, $v1, -0x1
/* 1953B0 80266AD0 A0820205 */ sb $v0, 0x205($a0)
.L80266AD4:
/* 1953B4 80266AD4 03E00008 */ jr $ra
/* 1953B8 80266AD8 00000000 */ nop
### DECOMPILED C INSTRUCTIONS:
void update_action_ratings(void) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* actor;
s32 i;
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
actor = gBattleStatus.enemyActors[i];
if (actor != NULL) {
if (actor->actionRatingTime == 60) {
if (actor->attackResultEffect != NULL) {
actor->attackResultEffect->data.attackResultText->isVisible = FALSE;
}
}
if (actor->actionRatingTime == 5) {
if (actor->attackResultEffect != NULL) {
actor->attackResultEffect->data.attackResultText->timeLeft = 0;
actor->attackResultEffect = NULL;
}
}
if (actor->actionRatingTime > 0) {
actor->actionRatingTime--;
}
}
}
actor = battleStatus->playerActor;
if (actor != NULL) {
if (actor->actionRatingTime == 60) {
if (actor->attackResultEffect != NULL) {
actor->attackResultEffect->data.attackResultText->isVisible = FALSE;
}
}
if (actor->actionRatingTime == 5) {
if (actor->attackResultEffect != NULL) {
actor->attackResultEffect->data.attackResultText->timeLeft = 0;
actor->attackResultEffect = NULL;
}
}
if (actor->actionRatingTime > 0) {
actor->actionRatingTime--;
}
}
actor = battleStatus->partnerActor;
if (actor != NULL) {
if (actor->actionRatingTime == 60) {
if (actor->attackResultEffect != NULL) {
actor->attackResultEffect->data.attackResultText->isVisible = FALSE;
}
}
if (actor->actionRatingTime == 5) {
if (actor->attackResultEffect != NULL) {
actor->attackResultEffect->data.attackResultText->timeLeft = 0;
actor->attackResultEffect = NULL;
}
}
if (actor->actionRatingTime > 0) {
actor->actionRatingTime--;
}
}
}
|