diff --git a/asm/nonmatchings/code_ef070_len_3400/AddAnimModelPosition.s b/asm/nonmatchings/code_ef070_len_3400/AddAnimModelPosition.s index b3b3c73154..0ac33d097c 100644 --- a/asm/nonmatchings/code_ef070_len_3400/AddAnimModelPosition.s +++ b/asm/nonmatchings/code_ef070_len_3400/AddAnimModelPosition.s @@ -28,8 +28,8 @@ glabel AddAnimModelPosition /* F1B38 802CD188 8E050000 */ lw $a1, ($s0) /* F1B3C 802CD18C 0C0B210B */ jal get_float_variable /* F1B40 802CD190 46000506 */ mov.s $f20, $f0 -/* F1B44 802CD194 3C02802E */ lui $v0, 0x802e -/* F1B48 802CD198 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F1B44 802CD194 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F1B48 802CD198 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F1B4C 802CD19C 00118880 */ sll $s1, $s1, 2 /* F1B50 802CD1A0 02228821 */ addu $s1, $s1, $v0 /* F1B54 802CD1A4 8E230000 */ lw $v1, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/ChangeModelAnimation.s b/asm/nonmatchings/code_ef070_len_3400/ChangeModelAnimation.s index 0f3cc62d3c..506cfc35ec 100644 --- a/asm/nonmatchings/code_ef070_len_3400/ChangeModelAnimation.s +++ b/asm/nonmatchings/code_ef070_len_3400/ChangeModelAnimation.s @@ -15,8 +15,8 @@ glabel ChangeModelAnimation /* F1944 802CCF94 8E050000 */ lw $a1, ($s0) /* F1948 802CCF98 0C0B1EAF */ jal get_variable /* F194C 802CCF9C 0040802D */ daddu $s0, $v0, $zero -/* F1950 802CCFA0 3C03802E */ lui $v1, 0x802e -/* F1954 802CCFA4 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F1950 802CCFA0 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F1954 802CCFA4 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F1958 802CCFA8 00108080 */ sll $s0, $s0, 2 /* F195C 802CCFAC 02038021 */ addu $s0, $s0, $v1 /* F1960 802CCFB0 8E100000 */ lw $s0, ($s0) diff --git a/asm/nonmatchings/code_ef070_len_3400/GetAnimModelPosition.s b/asm/nonmatchings/code_ef070_len_3400/GetAnimModelPosition.s index 8bce268b25..ca442837e9 100644 --- a/asm/nonmatchings/code_ef070_len_3400/GetAnimModelPosition.s +++ b/asm/nonmatchings/code_ef070_len_3400/GetAnimModelPosition.s @@ -15,8 +15,8 @@ glabel GetAnimModelPosition /* F1A68 802CD0B8 26100004 */ addiu $s0, $s0, 4 /* F1A6C 802CD0BC 8E050000 */ lw $a1, ($s0) /* F1A70 802CD0C0 26100004 */ addiu $s0, $s0, 4 -/* F1A74 802CD0C4 3C03802E */ lui $v1, 0x802e -/* F1A78 802CD0C8 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F1A74 802CD0C4 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F1A78 802CD0C8 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F1A7C 802CD0CC 00021080 */ sll $v0, $v0, 2 /* F1A80 802CD0D0 00431021 */ addu $v0, $v0, $v1 /* F1A84 802CD0D4 8C510000 */ lw $s1, ($v0) diff --git a/asm/nonmatchings/code_ef070_len_3400/LoadModelAnimation.s b/asm/nonmatchings/code_ef070_len_3400/LoadModelAnimation.s index 5b04945c29..8dfce044bb 100644 --- a/asm/nonmatchings/code_ef070_len_3400/LoadModelAnimation.s +++ b/asm/nonmatchings/code_ef070_len_3400/LoadModelAnimation.s @@ -17,8 +17,8 @@ glabel LoadModelAnimation /* F16CC 802CCD1C 0C0B1EAF */ jal get_variable /* F16D0 802CCD20 0040802D */ daddu $s0, $v0, $zero /* F16D4 802CCD24 0040902D */ daddu $s2, $v0, $zero -/* F16D8 802CCD28 3C02802E */ lui $v0, 0x802e -/* F16DC 802CCD2C 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F16D8 802CCD28 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F16DC 802CCD2C 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F16E0 802CCD30 00108080 */ sll $s0, $s0, 2 /* F16E4 802CCD34 02028021 */ addu $s0, $s0, $v0 /* F16E8 802CCD38 8E100000 */ lw $s0, ($s0) diff --git a/asm/nonmatchings/code_ef070_len_3400/PlayModelAnimation.s b/asm/nonmatchings/code_ef070_len_3400/PlayModelAnimation.s index 43da86fe35..689c4fce49 100644 --- a/asm/nonmatchings/code_ef070_len_3400/PlayModelAnimation.s +++ b/asm/nonmatchings/code_ef070_len_3400/PlayModelAnimation.s @@ -15,8 +15,8 @@ glabel PlayModelAnimation /* F1844 802CCE94 8E050000 */ lw $a1, ($s0) /* F1848 802CCE98 0C0B1EAF */ jal get_variable /* F184C 802CCE9C 0040802D */ daddu $s0, $v0, $zero -/* F1850 802CCEA0 3C03802E */ lui $v1, 0x802e -/* F1854 802CCEA4 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F1850 802CCEA0 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F1854 802CCEA4 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F1858 802CCEA8 00108080 */ sll $s0, $s0, 2 /* F185C 802CCEAC 02038021 */ addu $s0, $s0, $v1 /* F1860 802CCEB0 8E030000 */ lw $v1, ($s0) diff --git a/asm/nonmatchings/code_ef070_len_3400/SetAnimModelPosition.s b/asm/nonmatchings/code_ef070_len_3400/SetAnimModelPosition.s index 555a2456d2..f4c9789ee1 100644 --- a/asm/nonmatchings/code_ef070_len_3400/SetAnimModelPosition.s +++ b/asm/nonmatchings/code_ef070_len_3400/SetAnimModelPosition.s @@ -28,8 +28,8 @@ glabel SetAnimModelPosition /* F19F0 802CD040 8E050000 */ lw $a1, ($s0) /* F19F4 802CD044 0C0B210B */ jal get_float_variable /* F19F8 802CD048 46000506 */ mov.s $f20, $f0 -/* F19FC 802CD04C 3C02802E */ lui $v0, 0x802e -/* F1A00 802CD050 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F19FC 802CD04C 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F1A00 802CD050 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F1A04 802CD054 00118880 */ sll $s1, $s1, 2 /* F1A08 802CD058 02228821 */ addu $s1, $s1, $v0 /* F1A0C 802CD05C 8E230000 */ lw $v1, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/SetAnimModelRotation.s b/asm/nonmatchings/code_ef070_len_3400/SetAnimModelRotation.s index 18827ada1e..515d4a83a5 100644 --- a/asm/nonmatchings/code_ef070_len_3400/SetAnimModelRotation.s +++ b/asm/nonmatchings/code_ef070_len_3400/SetAnimModelRotation.s @@ -28,8 +28,8 @@ glabel SetAnimModelRotation /* F1BFC 802CD24C 8E050000 */ lw $a1, ($s0) /* F1C00 802CD250 0C0B210B */ jal get_float_variable /* F1C04 802CD254 46000506 */ mov.s $f20, $f0 -/* F1C08 802CD258 3C02802E */ lui $v0, 0x802e -/* F1C0C 802CD25C 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F1C08 802CD258 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F1C0C 802CD25C 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F1C10 802CD260 00118880 */ sll $s1, $s1, 2 /* F1C14 802CD264 02228821 */ addu $s1, $s1, $v0 /* F1C18 802CD268 8E230000 */ lw $v1, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/SetAnimModelScale.s b/asm/nonmatchings/code_ef070_len_3400/SetAnimModelScale.s index b0d82161d0..d344d5709f 100644 --- a/asm/nonmatchings/code_ef070_len_3400/SetAnimModelScale.s +++ b/asm/nonmatchings/code_ef070_len_3400/SetAnimModelScale.s @@ -28,8 +28,8 @@ glabel SetAnimModelScale /* F1CA8 802CD2F8 8E050000 */ lw $a1, ($s0) /* F1CAC 802CD2FC 0C0B210B */ jal get_float_variable /* F1CB0 802CD300 46000506 */ mov.s $f20, $f0 -/* F1CB4 802CD304 3C02802E */ lui $v0, 0x802e -/* F1CB8 802CD308 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F1CB4 802CD304 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F1CB8 802CD308 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F1CBC 802CD30C 00118880 */ sll $s1, $s1, 2 /* F1CC0 802CD310 02228821 */ addu $s1, $s1, $v0 /* F1CC4 802CD314 8E230000 */ lw $v1, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/draw_anim_models.s b/asm/nonmatchings/code_ef070_len_3400/draw_anim_models.s index ffdc2de8a0..bfe5be11ce 100644 --- a/asm/nonmatchings/code_ef070_len_3400/draw_anim_models.s +++ b/asm/nonmatchings/code_ef070_len_3400/draw_anim_models.s @@ -28,8 +28,8 @@ glabel draw_anim_models /* F1524 802CCB74 AFB00220 */ sw $s0, 0x220($sp) /* F1528 802CCB78 AFA80218 */ sw $t0, 0x218($sp) .L802CCB7C: -/* F152C 802CCB7C 3C02802E */ lui $v0, 0x802e -/* F1530 802CCB80 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F152C 802CCB7C 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F1530 802CCB80 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F1534 802CCB84 00131880 */ sll $v1, $s3, 2 /* F1538 802CCB88 00621821 */ addu $v1, $v1, $v0 /* F153C 802CCB8C 8C710000 */ lw $s1, ($v1) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CA988.s b/asm/nonmatchings/code_ef070_len_3400/func_802CA988.s deleted file mode 100644 index 359ea0efd3..0000000000 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CA988.s +++ /dev/null @@ -1,105 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802CA988 -/* EF338 802CA988 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* EF33C 802CA98C AFB20018 */ sw $s2, 0x18($sp) -/* EF340 802CA990 0080902D */ daddu $s2, $a0, $zero -/* EF344 802CA994 AFBF0028 */ sw $ra, 0x28($sp) -/* EF348 802CA998 AFB50024 */ sw $s5, 0x24($sp) -/* EF34C 802CA99C AFB40020 */ sw $s4, 0x20($sp) -/* EF350 802CA9A0 AFB3001C */ sw $s3, 0x1c($sp) -/* EF354 802CA9A4 AFB10014 */ sw $s1, 0x14($sp) -/* EF358 802CA9A8 AFB00010 */ sw $s0, 0x10($sp) -/* EF35C 802CA9AC 8E50000C */ lw $s0, 0xc($s2) -/* EF360 802CA9B0 8E050000 */ lw $a1, ($s0) -/* EF364 802CA9B4 0C0B1EAF */ jal get_variable -/* EF368 802CA9B8 26100004 */ addiu $s0, $s0, 4 -/* EF36C 802CA9BC 8E140000 */ lw $s4, ($s0) -/* EF370 802CA9C0 26100004 */ addiu $s0, $s0, 4 -/* EF374 802CA9C4 8E150000 */ lw $s5, ($s0) -/* EF378 802CA9C8 26100004 */ addiu $s0, $s0, 4 -/* EF37C 802CA9CC 3C04800B */ lui $a0, %hi(gCameras) -/* EF380 802CA9D0 24841D80 */ addiu $a0, $a0, %lo(gCameras) -/* EF384 802CA9D4 00021880 */ sll $v1, $v0, 2 -/* EF388 802CA9D8 00621821 */ addu $v1, $v1, $v0 -/* EF38C 802CA9DC 00031880 */ sll $v1, $v1, 2 -/* EF390 802CA9E0 00621823 */ subu $v1, $v1, $v0 -/* EF394 802CA9E4 000310C0 */ sll $v0, $v1, 3 -/* EF398 802CA9E8 00621821 */ addu $v1, $v1, $v0 -/* EF39C 802CA9EC 000318C0 */ sll $v1, $v1, 3 -/* EF3A0 802CA9F0 00648821 */ addu $s1, $v1, $a0 -/* EF3A4 802CA9F4 C62C0094 */ lwc1 $f12, 0x94($s1) -/* EF3A8 802CA9F8 8E130000 */ lw $s3, ($s0) -/* EF3AC 802CA9FC 8E100004 */ lw $s0, 4($s0) -/* EF3B0 802CAA00 24020002 */ addiu $v0, $zero, 2 -/* EF3B4 802CAA04 A6220004 */ sh $v0, 4($s1) -/* EF3B8 802CAA08 0C00A6B1 */ jal round -/* EF3BC 802CAA0C A6200006 */ sh $zero, 6($s1) -/* EF3C0 802CAA10 C6220048 */ lwc1 $f2, 0x48($s1) -/* EF3C4 802CAA14 C620003C */ lwc1 $f0, 0x3c($s1) -/* EF3C8 802CAA18 46001081 */ sub.s $f2, $f2, $f0 -/* EF3CC 802CAA1C 46021082 */ mul.s $f2, $f2, $f2 -/* EF3D0 802CAA20 00000000 */ nop -/* EF3D4 802CAA24 C624004C */ lwc1 $f4, 0x4c($s1) -/* EF3D8 802CAA28 C6200040 */ lwc1 $f0, 0x40($s1) -/* EF3DC 802CAA2C 46002101 */ sub.s $f4, $f4, $f0 -/* EF3E0 802CAA30 46042102 */ mul.s $f4, $f4, $f4 -/* EF3E4 802CAA34 00000000 */ nop -/* EF3E8 802CAA38 C6260050 */ lwc1 $f6, 0x50($s1) -/* EF3EC 802CAA3C C6200044 */ lwc1 $f0, 0x44($s1) -/* EF3F0 802CAA40 46003181 */ sub.s $f6, $f6, $f0 -/* EF3F4 802CAA44 46063182 */ mul.s $f6, $f6, $f6 -/* EF3F8 802CAA48 00000000 */ nop -/* EF3FC 802CAA4C C6200090 */ lwc1 $f0, 0x90($s1) -/* EF400 802CAA50 46041080 */ add.s $f2, $f2, $f4 -/* EF404 802CAA54 00021023 */ negu $v0, $v0 -/* EF408 802CAA58 A622001C */ sh $v0, 0x1c($s1) -/* EF40C 802CAA5C 46000007 */ neg.s $f0, $f0 -/* EF410 802CAA60 46061300 */ add.s $f12, $f2, $f6 -/* EF414 802CAA64 4600020D */ trunc.w.s $f8, $f0 -/* EF418 802CAA68 44024000 */ mfc1 $v0, $f8 -/* EF41C 802CAA6C 46006004 */ sqrt.s $f0, $f12 -/* EF420 802CAA70 46000032 */ c.eq.s $f0, $f0 -/* EF424 802CAA74 00000000 */ nop -/* EF428 802CAA78 45010003 */ bc1t .L802CAA88 -/* EF42C 802CAA7C A622001E */ sh $v0, 0x1e($s1) -/* EF430 802CAA80 0C0187BC */ jal sqrtf -/* EF434 802CAA84 00000000 */ nop -.L802CAA88: -/* EF438 802CAA88 0C00A6B1 */ jal round -/* EF43C 802CAA8C 46000306 */ mov.s $f12, $f0 -/* EF440 802CAA90 0240202D */ daddu $a0, $s2, $zero -/* EF444 802CAA94 8626001C */ lh $a2, 0x1c($s1) -/* EF448 802CAA98 C6200048 */ lwc1 $f0, 0x48($s1) -/* EF44C 802CAA9C C622004C */ lwc1 $f2, 0x4c($s1) -/* EF450 802CAAA0 C6240050 */ lwc1 $f4, 0x50($s1) -/* EF454 802CAAA4 0280282D */ daddu $a1, $s4, $zero -/* EF458 802CAAA8 A6220020 */ sh $v0, 0x20($s1) -/* EF45C 802CAAAC A6200022 */ sh $zero, 0x22($s1) -/* EF460 802CAAB0 E6200054 */ swc1 $f0, 0x54($s1) -/* EF464 802CAAB4 E6220058 */ swc1 $f2, 0x58($s1) -/* EF468 802CAAB8 0C0B2026 */ jal set_variable -/* EF46C 802CAABC E624005C */ swc1 $f4, 0x5c($s1) -/* EF470 802CAAC0 0240202D */ daddu $a0, $s2, $zero -/* EF474 802CAAC4 8626001E */ lh $a2, 0x1e($s1) -/* EF478 802CAAC8 0C0B2026 */ jal set_variable -/* EF47C 802CAACC 02A0282D */ daddu $a1, $s5, $zero -/* EF480 802CAAD0 0240202D */ daddu $a0, $s2, $zero -/* EF484 802CAAD4 86260020 */ lh $a2, 0x20($s1) -/* EF488 802CAAD8 0C0B2026 */ jal set_variable -/* EF48C 802CAADC 0260282D */ daddu $a1, $s3, $zero -/* EF490 802CAAE0 0240202D */ daddu $a0, $s2, $zero -/* EF494 802CAAE4 86260022 */ lh $a2, 0x22($s1) -/* EF498 802CAAE8 0C0B2026 */ jal set_variable -/* EF49C 802CAAEC 0200282D */ daddu $a1, $s0, $zero -/* EF4A0 802CAAF0 8FBF0028 */ lw $ra, 0x28($sp) -/* EF4A4 802CAAF4 8FB50024 */ lw $s5, 0x24($sp) -/* EF4A8 802CAAF8 8FB40020 */ lw $s4, 0x20($sp) -/* EF4AC 802CAAFC 8FB3001C */ lw $s3, 0x1c($sp) -/* EF4B0 802CAB00 8FB20018 */ lw $s2, 0x18($sp) -/* EF4B4 802CAB04 8FB10014 */ lw $s1, 0x14($sp) -/* EF4B8 802CAB08 8FB00010 */ lw $s0, 0x10($sp) -/* EF4BC 802CAB0C 24020002 */ addiu $v0, $zero, 2 -/* EF4C0 802CAB10 03E00008 */ jr $ra -/* EF4C4 802CAB14 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CCAC0.s b/asm/nonmatchings/code_ef070_len_3400/func_802CCAC0.s index d1db5a17bb..415a1da8fb 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CCAC0.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CCAC0.s @@ -7,8 +7,8 @@ glabel func_802CCAC0 /* F1478 802CCAC8 0000802D */ daddu $s0, $zero, $zero /* F147C 802CCACC AFBF0014 */ sw $ra, 0x14($sp) .L802CCAD0: -/* F1480 802CCAD0 3C03802E */ lui $v1, 0x802e -/* F1484 802CCAD4 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F1480 802CCAD0 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F1484 802CCAD4 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F1488 802CCAD8 00101080 */ sll $v0, $s0, 2 /* F148C 802CCADC 00431021 */ addu $v0, $v0, $v1 /* F1490 802CCAE0 8C420000 */ lw $v0, ($v0) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CCCB0.s b/asm/nonmatchings/code_ef070_len_3400/func_802CCCB0.s index f00a0d1c95..843e352f97 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CCCB0.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CCCB0.s @@ -15,7 +15,7 @@ glabel func_802CCCB0 /* F1684 802CCCD4 3C02802E */ lui $v0, 0x802e /* F1688 802CCCD8 2442ADB0 */ addiu $v0, $v0, -0x5250 .L802CCCDC: -/* F168C 802CCCDC 3C01802E */ lui $at, 0x802e -/* F1690 802CCCE0 AC22AE30 */ sw $v0, -0x51d0($at) +/* F168C 802CCCDC 3C01802E */ lui $at, %hi(gAnimatedMeshesPtr) +/* F1690 802CCCE0 AC22AE30 */ sw $v0, %lo(gAnimatedMeshesPtr)($at) /* F1694 802CCCE4 03E00008 */ jr $ra /* F1698 802CCCE8 24020002 */ addiu $v0, $zero, 2 diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CCDAC.s b/asm/nonmatchings/code_ef070_len_3400/func_802CCDAC.s index a9adf9aae4..190f75001e 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CCDAC.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CCDAC.s @@ -17,8 +17,8 @@ glabel func_802CCDAC /* F178C 802CCDDC 0C0B1EAF */ jal get_variable /* F1790 802CCDE0 0040802D */ daddu $s0, $v0, $zero /* F1794 802CCDE4 0040902D */ daddu $s2, $v0, $zero -/* F1798 802CCDE8 3C02802E */ lui $v0, 0x802e -/* F179C 802CCDEC 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F1798 802CCDE8 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F179C 802CCDEC 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F17A0 802CCDF0 00108080 */ sll $s0, $s0, 2 /* F17A4 802CCDF4 02028021 */ addu $s0, $s0, $v0 /* F17A8 802CCDF8 8E100000 */ lw $s0, ($s0) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CCEDC.s b/asm/nonmatchings/code_ef070_len_3400/func_802CCEDC.s index 97776038fc..3ad5040621 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CCEDC.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CCEDC.s @@ -21,8 +21,8 @@ glabel func_802CCEDC /* F18CC 802CCF1C 8E050000 */ lw $a1, ($s0) /* F18D0 802CCF20 0C0B1EAF */ jal get_variable /* F18D4 802CCF24 0040802D */ daddu $s0, $v0, $zero -/* F18D8 802CCF28 3C03802E */ lui $v1, 0x802e -/* F18DC 802CCF2C 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F18D8 802CCF28 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F18DC 802CCF2C 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F18E0 802CCF30 00118880 */ sll $s1, $s1, 2 /* F18E4 802CCF34 02238821 */ addu $s1, $s1, $v1 /* F18E8 802CCF38 8E230000 */ lw $v1, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD348.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD348.s index d1933ca720..5de604dcfb 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD348.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD348.s @@ -15,8 +15,8 @@ glabel func_802CD348 /* F1D20 802CD370 8E050000 */ lw $a1, ($s0) /* F1D24 802CD374 0C0B210B */ jal get_float_variable /* F1D28 802CD378 0040802D */ daddu $s0, $v0, $zero -/* F1D2C 802CD37C 3C02802E */ lui $v0, 0x802e -/* F1D30 802CD380 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F1D2C 802CD37C 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F1D30 802CD380 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F1D34 802CD384 00108080 */ sll $s0, $s0, 2 /* F1D38 802CD388 02028021 */ addu $s0, $s0, $v0 /* F1D3C 802CD38C 8E020000 */ lw $v0, ($s0) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD3C0.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD3C0.s index b7ccfc4097..99c9f226a4 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD3C0.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD3C0.s @@ -8,8 +8,8 @@ glabel func_802CD3C0 /* F1D7C 802CD3CC 8C82000C */ lw $v0, 0xc($a0) /* F1D80 802CD3D0 0C0B1EAF */ jal get_variable /* F1D84 802CD3D4 8C450000 */ lw $a1, ($v0) -/* F1D88 802CD3D8 3C03802E */ lui $v1, 0x802e -/* F1D8C 802CD3DC 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F1D88 802CD3D8 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F1D8C 802CD3DC 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F1D90 802CD3E0 00021080 */ sll $v0, $v0, 2 /* F1D94 802CD3E4 00431021 */ addu $v0, $v0, $v1 /* F1D98 802CD3E8 8C500000 */ lw $s0, ($v0) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD418.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD418.s index 98299832db..6b7ec0c39a 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD418.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD418.s @@ -17,8 +17,8 @@ glabel func_802CD418 /* F1DF8 802CD448 8E120000 */ lw $s2, ($s0) /* F1DFC 802CD44C 0C0B1EAF */ jal get_variable /* F1E00 802CD450 0040882D */ daddu $s1, $v0, $zero -/* F1E04 802CD454 3C03802E */ lui $v1, 0x802e -/* F1E08 802CD458 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F1E04 802CD454 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F1E08 802CD458 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F1E0C 802CD45C 00118880 */ sll $s1, $s1, 2 /* F1E10 802CD460 02238821 */ addu $s1, $s1, $v1 /* F1E14 802CD464 8E230000 */ lw $v1, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD4B4.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD4B4.s index c06a97357c..17fac9a61d 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD4B4.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD4B4.s @@ -20,16 +20,16 @@ glabel func_802CD4B4 /* F1E9C 802CD4EC 3C02802E */ lui $v0, 0x802e /* F1EA0 802CD4F0 2442ADB0 */ addiu $v0, $v0, -0x5250 .L802CD4F4: -/* F1EA4 802CD4F4 3C01802E */ lui $at, 0x802e -/* F1EA8 802CD4F8 AC22AE30 */ sw $v0, -0x51d0($at) +/* F1EA4 802CD4F4 3C01802E */ lui $at, %hi(gAnimatedMeshesPtr) +/* F1EA8 802CD4F8 AC22AE30 */ sw $v0, %lo(gAnimatedMeshesPtr)($at) /* F1EAC 802CD4FC 0000882D */ daddu $s1, $zero, $zero /* F1EB0 802CD500 2412FFFF */ addiu $s2, $zero, -1 /* F1EB4 802CD504 0220802D */ daddu $s0, $s1, $zero .L802CD508: /* F1EB8 802CD508 0C00AB39 */ jal heap_malloc /* F1EBC 802CD50C 24040070 */ addiu $a0, $zero, 0x70 -/* F1EC0 802CD510 3C03802E */ lui $v1, 0x802e -/* F1EC4 802CD514 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F1EC0 802CD510 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F1EC4 802CD514 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F1EC8 802CD518 02031821 */ addu $v1, $s0, $v1 /* F1ECC 802CD51C 14400003 */ bnez $v0, .L802CD52C /* F1ED0 802CD520 AC620000 */ sw $v0, ($v1) @@ -37,8 +37,8 @@ glabel func_802CD4B4 /* F1ED4 802CD524 080B3549 */ j .L802CD524 /* F1ED8 802CD528 00000000 */ nop .L802CD52C: -/* F1EDC 802CD52C 3C02802E */ lui $v0, 0x802e -/* F1EE0 802CD530 8C42AE30 */ lw $v0, -0x51d0($v0) +/* F1EDC 802CD52C 3C02802E */ lui $v0, %hi(gAnimatedMeshesPtr) +/* F1EE0 802CD530 8C42AE30 */ lw $v0, %lo(gAnimatedMeshesPtr)($v0) /* F1EE4 802CD534 26310001 */ addiu $s1, $s1, 1 /* F1EE8 802CD538 02021021 */ addu $v0, $s0, $v0 /* F1EEC 802CD53C 8C420000 */ lw $v0, ($v0) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD57C.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD57C.s index cdfdf8596f..f7a235528e 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD57C.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD57C.s @@ -9,14 +9,14 @@ glabel func_802CD57C /* F1F3C 802CD58C 00000000 */ nop /* F1F40 802CD590 3C02802E */ lui $v0, 0x802e /* F1F44 802CD594 2442ADF0 */ addiu $v0, $v0, -0x5210 -/* F1F48 802CD598 3C01802E */ lui $at, 0x802e -/* F1F4C 802CD59C AC22AE30 */ sw $v0, -0x51d0($at) +/* F1F48 802CD598 3C01802E */ lui $at, %hi(gAnimatedMeshesPtr) +/* F1F4C 802CD59C AC22AE30 */ sw $v0, %lo(gAnimatedMeshesPtr)($at) /* F1F50 802CD5A0 03E00008 */ jr $ra /* F1F54 802CD5A4 00000000 */ nop .L802CD5A8: /* F1F58 802CD5A8 3C02802E */ lui $v0, 0x802e /* F1F5C 802CD5AC 2442ADB0 */ addiu $v0, $v0, -0x5250 -/* F1F60 802CD5B0 3C01802E */ lui $at, 0x802e -/* F1F64 802CD5B4 AC22AE30 */ sw $v0, -0x51d0($at) +/* F1F60 802CD5B0 3C01802E */ lui $at, %hi(gAnimatedMeshesPtr) +/* F1F64 802CD5B4 AC22AE30 */ sw $v0, %lo(gAnimatedMeshesPtr)($at) /* F1F68 802CD5B8 03E00008 */ jr $ra /* F1F6C 802CD5BC 00000000 */ nop diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD5C0.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD5C0.s index 72d6462d46..85b1d66239 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD5C0.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD5C0.s @@ -23,8 +23,8 @@ glabel func_802CD5C0 /* F1FB8 802CD608 00118880 */ sll $s1, $s1, 2 /* F1FBC 802CD60C 8E140000 */ lw $s4, ($s0) /* F1FC0 802CD610 26100004 */ addiu $s0, $s0, 4 -/* F1FC4 802CD614 3C03802E */ lui $v1, 0x802e -/* F1FC8 802CD618 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F1FC4 802CD614 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F1FC8 802CD618 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F1FCC 802CD61C 8E150000 */ lw $s5, ($s0) /* F1FD0 802CD620 02238821 */ addu $s1, $s1, $v1 /* F1FD4 802CD624 8E330000 */ lw $s3, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD6E0.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD6E0.s index f4abed9e66..6f0d7dca0f 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD6E0.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD6E0.s @@ -23,8 +23,8 @@ glabel func_802CD6E0 /* F20D8 802CD728 00118880 */ sll $s1, $s1, 2 /* F20DC 802CD72C 8E130000 */ lw $s3, ($s0) /* F20E0 802CD730 26100004 */ addiu $s0, $s0, 4 -/* F20E4 802CD734 3C03802E */ lui $v1, 0x802e -/* F20E8 802CD738 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F20E4 802CD734 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F20E8 802CD738 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F20EC 802CD73C 8E140000 */ lw $s4, ($s0) /* F20F0 802CD740 02238821 */ addu $s1, $s1, $v1 /* F20F4 802CD744 8E230000 */ lw $v1, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD7D8.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD7D8.s index 740e3a17aa..631537bc1c 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD7D8.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD7D8.s @@ -23,8 +23,8 @@ glabel func_802CD7D8 /* F21D0 802CD820 00118880 */ sll $s1, $s1, 2 /* F21D4 802CD824 8E140000 */ lw $s4, ($s0) /* F21D8 802CD828 26100004 */ addiu $s0, $s0, 4 -/* F21DC 802CD82C 3C03802E */ lui $v1, 0x802e -/* F21E0 802CD830 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F21DC 802CD82C 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F21E0 802CD830 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F21E4 802CD834 8E150000 */ lw $s5, ($s0) /* F21E8 802CD838 02238821 */ addu $s1, $s1, $v1 /* F21EC 802CD83C 8E330000 */ lw $s3, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD8F8.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD8F8.s index d0293261a4..575f1f4f91 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD8F8.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD8F8.s @@ -23,8 +23,8 @@ glabel func_802CD8F8 /* F22F0 802CD940 00118880 */ sll $s1, $s1, 2 /* F22F4 802CD944 8E130000 */ lw $s3, ($s0) /* F22F8 802CD948 26100004 */ addiu $s0, $s0, 4 -/* F22FC 802CD94C 3C03802E */ lui $v1, 0x802e -/* F2300 802CD950 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F22FC 802CD94C 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F2300 802CD950 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F2304 802CD954 8E140000 */ lw $s4, ($s0) /* F2308 802CD958 02238821 */ addu $s1, $s1, $v1 /* F230C 802CD95C 8E230000 */ lw $v1, ($s1) diff --git a/asm/nonmatchings/code_ef070_len_3400/func_802CD9F0.s b/asm/nonmatchings/code_ef070_len_3400/func_802CD9F0.s index 29f3168982..a1dd7b41ef 100644 --- a/asm/nonmatchings/code_ef070_len_3400/func_802CD9F0.s +++ b/asm/nonmatchings/code_ef070_len_3400/func_802CD9F0.s @@ -23,8 +23,8 @@ glabel func_802CD9F0 /* F23E8 802CDA38 8E130000 */ lw $s3, ($s0) /* F23EC 802CDA3C 0C0B1EAF */ jal get_variable /* F23F0 802CDA40 0040902D */ daddu $s2, $v0, $zero -/* F23F4 802CDA44 3C03802E */ lui $v1, 0x802e -/* F23F8 802CDA48 8C63AE30 */ lw $v1, -0x51d0($v1) +/* F23F4 802CDA44 3C03802E */ lui $v1, %hi(gAnimatedMeshesPtr) +/* F23F8 802CDA48 8C63AE30 */ lw $v1, %lo(gAnimatedMeshesPtr)($v1) /* F23FC 802CDA4C 00118880 */ sll $s1, $s1, 2 /* F2400 802CDA50 02238821 */ addu $s1, $s1, $v1 /* F2404 802CDA54 8E230000 */ lw $v1, ($s1) diff --git a/include/variables.h b/include/variables.h index 99f0f47f87..e18c758128 100644 --- a/include/variables.h +++ b/include/variables.h @@ -88,6 +88,7 @@ extern PrintContext* D_802DB268; // Animation related extern PartnerAnimations gPartnerAnimations[12]; +extern AnimatedModel** gAnimatedMeshesPtr; // Triggers extern s16 gTriggerCount; diff --git a/src/code_ED510.c b/src/code_ED510.c index 5e01933cf2..2d5371141c 100644 --- a/src/code_ED510.c +++ b/src/code_ED510.c @@ -325,9 +325,7 @@ INCLUDE_ASM(s32, "code_ED510", ResetFromLava, ScriptInstance* script, s32 isInit INCLUDE_ASM(s32, "code_ED510", func_802C9FD4); ApiStatus GetColliderCenter(ScriptInstance* script, s32 initialCall) { - f32 x; - f32 y; - f32 z; + f32 x, y, z; get_collider_center(get_variable(script, *script->ptrReadPos), &x, &y, &z); diff --git a/src/code_ef070_len_3400.c b/src/code_ef070_len_3400.c index c145c181f3..9f892bd319 100644 --- a/src/code_ef070_len_3400.c +++ b/src/code_ef070_len_3400.c @@ -57,15 +57,13 @@ ApiStatus func_802CA90C(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_ef070_len_3400", func_802CA988, ScriptInstance* script, s32 isInitialCall); -/* ApiStatus func_802CA988(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - Bytecode id = get_variable(script, *ptrReadPos++); - Bytecode outVar1 = *ptrReadPos++; - Bytecode outVar2 = *ptrReadPos++; - Bytecode outVar3 = *ptrReadPos++; - Bytecode outVar4 = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + Bytecode id = get_variable(script, *args++); + Bytecode outVar1 = *args++; + Bytecode outVar2 = *args++; + Bytecode outVar3 = *args++; + Bytecode outVar4 = *args++; f32 temp1, temp2, temp3; CAM(id)->mode = 2; @@ -77,7 +75,7 @@ ApiStatus func_802CA988(ScriptInstance* script, s32 isInitialCall) { temp2 = CAM(id)->lookAt_obj.y - CAM(id)->lookAt_eye[1]; temp3 = CAM(id)->lookAt_obj.z - CAM(id)->lookAt_eye[2]; - CAM(id)->unk_20 = round(sqrtf((temp1 * temp1) + (temp2 * temp2) + (temp3 * temp3))); + CAM(id)->unk_20 = round(sqrtf(SQ(temp1) + SQ(temp2) + SQ(temp3))); CAM(id)->unk_22 = 0; CAM(id)->unk_54 = CAM(id)->lookAt_obj.x; CAM(id)->unk_58 = CAM(id)->lookAt_obj.y; @@ -89,7 +87,6 @@ ApiStatus func_802CA988(ScriptInstance* script, s32 isInitialCall) { set_variable(script, outVar4, CAM(id)->unk_22); return ApiStatus_DONE2; } -*/ ApiStatus SetCamViewport(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; diff --git a/tools/symbol_addrs.txt b/tools/symbol_addrs.txt index 8f95a5a907..d8d888cc08 100644 --- a/tools/symbol_addrs.txt +++ b/tools/symbol_addrs.txt @@ -1891,6 +1891,7 @@ gGlobalTimeSpace = 0x802D9CA8; ShakeCam1 = 0x802D9CB0; ShakeCamX = 0x802D9CE8; D_802D9D50 = 0x802D9D50; +gAnimatedMeshesPtr = 0x802DAE30; gWorldMapFlags = 0x802DBC70; // size:0xC gWorldMapVars = 0x802DBCA8; // size:0x40 gBattleMapVars = 0x802DBCE8; // size:0x40 diff --git a/undefined_syms.txt b/undefined_syms.txt index 05a40653d2..eb8954ce0c 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -229,6 +229,7 @@ gCurrentSaveFile = 0x800DACC0; gMapFlags = 0x802DA480; gMapVars = 0x802DA484; +gAnimatedMeshesPtr = 0x802DAE30; gEffectTable = 0x8007F214;