From b8a0751518e4da775d299fbe2bedc50d274cab48 Mon Sep 17 00:00:00 2001 From: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com> Date: Tue, 21 Apr 2020 17:40:56 -0400 Subject: [PATCH 1/6] Match coss.c (#86) * Match coss.c * Remove asm file. * Update src/libultra_code/coss.c Co-Authored-By: Lucas Shaw <49287729+shawlucas@users.noreply.github.com> Co-authored-by: Lucas Shaw <49287729+shawlucas@users.noreply.github.com> --- asm/non_matchings/code/coss/coss.s | 13 ------------- src/libultra_code/coss.c | 5 ++++- 2 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 asm/non_matchings/code/coss/coss.s diff --git a/asm/non_matchings/code/coss/coss.s b/asm/non_matchings/code/coss/coss.s deleted file mode 100644 index 78d6843b43..0000000000 --- a/asm/non_matchings/code/coss/coss.s +++ /dev/null @@ -1,13 +0,0 @@ -glabel coss -/* B7B920 80104780 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* B7B924 80104784 AFA40018 */ sw $a0, 0x18($sp) -/* B7B928 80104788 00802825 */ move $a1, $a0 -/* B7B92C 8010478C 24A44000 */ addiu $a0, $a1, 0x4000 -/* B7B930 80104790 AFBF0014 */ sw $ra, 0x14($sp) -/* B7B934 80104794 308EFFFF */ andi $t6, $a0, 0xffff -/* B7B938 80104798 0C040114 */ jal sins -/* B7B93C 8010479C 01C02025 */ move $a0, $t6 -/* B7B940 801047A0 8FBF0014 */ lw $ra, 0x14($sp) -/* B7B944 801047A4 27BD0018 */ addiu $sp, $sp, 0x18 -/* B7B948 801047A8 03E00008 */ jr $ra -/* B7B94C 801047AC 00000000 */ nop diff --git a/src/libultra_code/coss.c b/src/libultra_code/coss.c index 0158b34802..1f2a260dd6 100644 --- a/src/libultra_code/coss.c +++ b/src/libultra_code/coss.c @@ -1,3 +1,6 @@ #include "libultra_internal.h" +#include -#pragma GLOBAL_ASM("asm/non_matchings/code/coss/coss.s") +s16 coss(u16 angle) { + return sins(angle + 0x4000); +} From 06b731c494b44e71422231872750acc35445392c Mon Sep 17 00:00:00 2001 From: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com> Date: Wed, 22 Apr 2020 12:18:53 -0400 Subject: [PATCH 2/6] Match sys_math.c and one in z_scene_table.c (#90) * Match func_800CA63C * Remove func_800CA63C.s * Match func_8009BEEC? * Remove func_8009BEEC.s --- .../code/sys_math/func_800CA63C.s | 53 -------- .../code/z_scene_table/func_8009BEEC.s | 124 ------------------ src/code/sys_math.c | 6 +- src/code/z_scene_table.c | 6 - 4 files changed, 1 insertion(+), 188 deletions(-) delete mode 100644 asm/non_matchings/code/sys_math/func_800CA63C.s delete mode 100644 asm/non_matchings/code/z_scene_table/func_8009BEEC.s diff --git a/asm/non_matchings/code/sys_math/func_800CA63C.s b/asm/non_matchings/code/sys_math/func_800CA63C.s deleted file mode 100644 index 8b13b39af7..0000000000 --- a/asm/non_matchings/code/sys_math/func_800CA63C.s +++ /dev/null @@ -1,53 +0,0 @@ -glabel func_800CA63C -/* B417DC 800CA63C 2C81000D */ sltiu $at, $a0, 0xd -/* B417E0 800CA640 14200029 */ bnez $at, .L800CA6E8 -/* B417E4 800CA644 00044880 */ sll $t1, $a0, 2 -/* B417E8 800CA648 3C018013 */ lui $at, %hi(sFactorialTbl) -/* B417EC 800CA64C C422D300 */ lwc1 $f2, %lo(sFactorialTbl + 0x30)($at) -/* B417F0 800CA650 2881000D */ slti $at, $a0, 0xd -/* B417F4 800CA654 14200027 */ bnez $at, .L800CA6F4 -/* B417F8 800CA658 2402000D */ li $v0, 13 -/* B417FC 800CA65C 2485FFF4 */ addiu $a1, $a0, -0xc -/* B41800 800CA660 30A50003 */ andi $a1, $a1, 3 -/* B41804 800CA664 10A0000A */ beqz $a1, .L800CA690 -/* B41808 800CA668 24A3000D */ addiu $v1, $a1, 0xd -/* B4180C 800CA66C 44822000 */ mtc1 $v0, $f4 -.L800CA670: -/* B41810 800CA670 24420001 */ addiu $v0, $v0, 1 -/* B41814 800CA674 468021A0 */ cvt.s.w $f6, $f4 -/* B41818 800CA678 46061082 */ mul.s $f2, $f2, $f6 -/* B4181C 800CA67C 5462FFFC */ bnel $v1, $v0, .L800CA670 -/* B41820 800CA680 44822000 */ mtc1 $v0, $f4 -/* B41824 800CA684 248E0001 */ addiu $t6, $a0, 1 -/* B41828 800CA688 11C2001A */ beq $t6, $v0, .L800CA6F4 -/* B4182C 800CA68C 00000000 */ nop -.L800CA690: -/* B41830 800CA690 44824000 */ mtc1 $v0, $f8 -/* B41834 800CA694 244F0001 */ addiu $t7, $v0, 1 -/* B41838 800CA698 448F8000 */ mtc1 $t7, $f16 -/* B4183C 800CA69C 468042A0 */ cvt.s.w $f10, $f8 -/* B41840 800CA6A0 24580002 */ addiu $t8, $v0, 2 -/* B41844 800CA6A4 44982000 */ mtc1 $t8, $f4 -/* B41848 800CA6A8 24590003 */ addiu $t9, $v0, 3 -/* B4184C 800CA6AC 44994000 */ mtc1 $t9, $f8 -/* B41850 800CA6B0 468084A0 */ cvt.s.w $f18, $f16 -/* B41854 800CA6B4 460A1082 */ mul.s $f2, $f2, $f10 -/* B41858 800CA6B8 24420004 */ addiu $v0, $v0, 4 -/* B4185C 800CA6BC 24880001 */ addiu $t0, $a0, 1 -/* B41860 800CA6C0 468021A0 */ cvt.s.w $f6, $f4 -/* B41864 800CA6C4 46121082 */ mul.s $f2, $f2, $f18 -/* B41868 800CA6C8 468042A0 */ cvt.s.w $f10, $f8 -/* B4186C 800CA6CC 46061082 */ mul.s $f2, $f2, $f6 -/* B41870 800CA6D0 00000000 */ nop -/* B41874 800CA6D4 460A1082 */ mul.s $f2, $f2, $f10 -/* B41878 800CA6D8 1502FFED */ bne $t0, $v0, .L800CA690 -/* B4187C 800CA6DC 00000000 */ nop -/* B41880 800CA6E0 03E00008 */ jr $ra -/* B41884 800CA6E4 46001006 */ mov.s $f0, $f2 -.L800CA6E8: -/* B41888 800CA6E8 3C018013 */ lui $at, %hi(sFactorialTbl) -/* B4188C 800CA6EC 00290821 */ addu $at, $at, $t1 -/* B41890 800CA6F0 C422D2D0 */ lwc1 $f2, %lo(sFactorialTbl)($at) -.L800CA6F4: -/* B41894 800CA6F4 03E00008 */ jr $ra -/* B41898 800CA6F8 46001006 */ mov.s $f0, $f2 diff --git a/asm/non_matchings/code/z_scene_table/func_8009BEEC.s b/asm/non_matchings/code/z_scene_table/func_8009BEEC.s deleted file mode 100644 index e3a4107e28..0000000000 --- a/asm/non_matchings/code/z_scene_table/func_8009BEEC.s +++ /dev/null @@ -1,124 +0,0 @@ -.late_rodata -glabel D_8013FF18 - .float 0.6 - -glabel D_8013FF1C - .float 3000.0 - -.text -glabel func_8009BEEC -/* B1308C 8009BEEC 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* B13090 8009BEF0 3C010001 */ lui $at, 1 -/* B13094 8009BEF4 AFBF0024 */ sw $ra, 0x24($sp) -/* B13098 8009BEF8 AFB10020 */ sw $s1, 0x20($sp) -/* B1309C 8009BEFC AFB0001C */ sw $s0, 0x1c($sp) -/* B130A0 8009BF00 00811021 */ addu $v0, $a0, $at -/* B130A4 8009BF04 8C431DE4 */ lw $v1, 0x1de4($v0) -/* B130A8 8009BF08 2401000D */ li $at, 13 -/* B130AC 8009BF0C 00808825 */ move $s1, $a0 -/* B130B0 8009BF10 306E007F */ andi $t6, $v1, 0x7f -/* B130B4 8009BF14 55C1001C */ bnel $t6, $at, .L8009BF88 -/* B130B8 8009BF18 3069003F */ andi $t1, $v1, 0x3f -/* B130BC 8009BF1C 848F07A0 */ lh $t7, 0x7a0($a0) -/* B130C0 8009BF20 24050002 */ li $a1, 2 -/* B130C4 8009BF24 000FC080 */ sll $t8, $t7, 2 -/* B130C8 8009BF28 0098C821 */ addu $t9, $a0, $t8 -/* B130CC 8009BF2C 8F240790 */ lw $a0, 0x790($t9) -/* B130D0 8009BF30 0C024BE2 */ jal Quake_Add -/* B130D4 8009BF34 AFA2002C */ sw $v0, 0x2c($sp) -/* B130D8 8009BF38 00022400 */ sll $a0, $v0, 0x10 -/* B130DC 8009BF3C AFA20034 */ sw $v0, 0x34($sp) -/* B130E0 8009BF40 00042403 */ sra $a0, $a0, 0x10 -/* B130E4 8009BF44 0C024B6B */ jal Quake_SetSpeed -/* B130E8 8009BF48 24052710 */ li $a1, 10000 -/* B130EC 8009BF4C 87B00036 */ lh $s0, 0x36($sp) -/* B130F0 8009BF50 24050004 */ li $a1, 4 -/* B130F4 8009BF54 00003025 */ move $a2, $zero -/* B130F8 8009BF58 00102400 */ sll $a0, $s0, 0x10 -/* B130FC 8009BF5C 00042403 */ sra $a0, $a0, 0x10 -/* B13100 8009BF60 00003825 */ move $a3, $zero -/* B13104 8009BF64 0C024B9C */ jal Quake_SetQuakeValues -/* B13108 8009BF68 AFA00010 */ sw $zero, 0x10($sp) -/* B1310C 8009BF6C 00102400 */ sll $a0, $s0, 0x10 -/* B13110 8009BF70 00042403 */ sra $a0, $a0, 0x10 -/* B13114 8009BF74 0C024B7C */ jal Quake_SetCountdown -/* B13118 8009BF78 2405007F */ li $a1, 127 -/* B1311C 8009BF7C 8FA8002C */ lw $t0, 0x2c($sp) -/* B13120 8009BF80 8D031DE4 */ lw $v1, 0x1de4($t0) -/* B13124 8009BF84 3069003F */ andi $t1, $v1, 0x3f -.L8009BF88: -/* B13128 8009BF88 55200044 */ bnezl $t1, .L8009C09C -/* B1312C 8009BF8C 8FBF0024 */ lw $ra, 0x24($sp) -/* B13130 8009BF90 0C03F66B */ jal Math_Rand_ZeroOne -/* B13134 8009BF94 00000000 */ nop -/* B13138 8009BF98 3C018014 */ lui $at, %hi(D_8013FF18) -/* B1313C 8009BF9C C424FF18 */ lwc1 $f4, %lo(D_8013FF18)($at) -/* B13140 8009BFA0 4600203C */ c.lt.s $f4, $f0 -/* B13144 8009BFA4 00000000 */ nop -/* B13148 8009BFA8 4502003C */ bc1fl .L8009C09C -/* B1314C 8009BFAC 8FBF0024 */ lw $ra, 0x24($sp) -/* B13150 8009BFB0 862A07A0 */ lh $t2, 0x7a0($s1) -/* B13154 8009BFB4 24050003 */ li $a1, 3 -/* B13158 8009BFB8 000A5880 */ sll $t3, $t2, 2 -/* B1315C 8009BFBC 022B6021 */ addu $t4, $s1, $t3 -/* B13160 8009BFC0 0C024BE2 */ jal Quake_Add -/* B13164 8009BFC4 8D840790 */ lw $a0, 0x790($t4) -/* B13168 8009BFC8 0C03F66B */ jal Math_Rand_ZeroOne -/* B1316C 8009BFCC AFA20034 */ sw $v0, 0x34($sp) -/* B13170 8009BFD0 3C018014 */ lui $at, %hi(D_8013FF1C) -/* B13174 8009BFD4 C426FF1C */ lwc1 $f6, %lo(D_8013FF1C)($at) -/* B13178 8009BFD8 3C0146FA */ li $at, 0x46FA0000 # 0.000000 -/* B1317C 8009BFDC 44815000 */ mtc1 $at, $f10 -/* B13180 8009BFE0 46060202 */ mul.s $f8, $f0, $f6 -/* B13184 8009BFE4 87B00036 */ lh $s0, 0x36($sp) -/* B13188 8009BFE8 00102400 */ sll $a0, $s0, 0x10 -/* B1318C 8009BFEC 00042403 */ sra $a0, $a0, 0x10 -/* B13190 8009BFF0 460A4400 */ add.s $f16, $f8, $f10 -/* B13194 8009BFF4 4600848D */ trunc.w.s $f18, $f16 -/* B13198 8009BFF8 44059000 */ mfc1 $a1, $f18 -/* B1319C 8009BFFC 00000000 */ nop -/* B131A0 8009C000 00052C00 */ sll $a1, $a1, 0x10 -/* B131A4 8009C004 0C024B6B */ jal Quake_SetSpeed -/* B131A8 8009C008 00052C03 */ sra $a1, $a1, 0x10 -/* B131AC 8009C00C 0C03F66B */ jal Math_Rand_ZeroOne -/* B131B0 8009C010 00000000 */ nop -/* B131B4 8009C014 3C014120 */ li $at, 0x41200000 # 0.000000 -/* B131B8 8009C018 44812000 */ mtc1 $at, $f4 -/* B131BC 8009C01C 3C014110 */ li $at, 0x41100000 # 0.000000 -/* B131C0 8009C020 44813000 */ mtc1 $at, $f6 -/* B131C4 8009C024 00102400 */ sll $a0, $s0, 0x10 -/* B131C8 8009C028 00042403 */ sra $a0, $a0, 0x10 -/* B131CC 8009C02C 46060202 */ mul.s $f8, $f0, $f6 -/* B131D0 8009C030 00003025 */ move $a2, $zero -/* B131D4 8009C034 00003825 */ move $a3, $zero -/* B131D8 8009C038 AFA00010 */ sw $zero, 0x10($sp) -/* B131DC 8009C03C 46082281 */ sub.s $f10, $f4, $f8 -/* B131E0 8009C040 4600540D */ trunc.w.s $f16, $f10 -/* B131E4 8009C044 44058000 */ mfc1 $a1, $f16 -/* B131E8 8009C048 00000000 */ nop -/* B131EC 8009C04C 00052C00 */ sll $a1, $a1, 0x10 -/* B131F0 8009C050 0C024B9C */ jal Quake_SetQuakeValues -/* B131F4 8009C054 00052C03 */ sra $a1, $a1, 0x10 -/* B131F8 8009C058 0C03F66B */ jal Math_Rand_ZeroOne -/* B131FC 8009C05C 00000000 */ nop -/* B13200 8009C060 3C014240 */ li $at, 0x42400000 # 0.000000 -/* B13204 8009C064 44819000 */ mtc1 $at, $f18 -/* B13208 8009C068 3C014170 */ li $at, 0x41700000 # 0.000000 -/* B1320C 8009C06C 44813000 */ mtc1 $at, $f6 -/* B13210 8009C070 00102400 */ sll $a0, $s0, 0x10 -/* B13214 8009C074 00042403 */ sra $a0, $a0, 0x10 -/* B13218 8009C078 46060102 */ mul.s $f4, $f0, $f6 -/* B1321C 8009C07C 46049201 */ sub.s $f8, $f18, $f4 -/* B13220 8009C080 4600428D */ trunc.w.s $f10, $f8 -/* B13224 8009C084 44055000 */ mfc1 $a1, $f10 -/* B13228 8009C088 00000000 */ nop -/* B1322C 8009C08C 00052C00 */ sll $a1, $a1, 0x10 -/* B13230 8009C090 0C024B7C */ jal Quake_SetCountdown -/* B13234 8009C094 00052C03 */ sra $a1, $a1, 0x10 -/* B13238 8009C098 8FBF0024 */ lw $ra, 0x24($sp) -.L8009C09C: -/* B1323C 8009C09C 8FB0001C */ lw $s0, 0x1c($sp) -/* B13240 8009C0A0 8FB10020 */ lw $s1, 0x20($sp) -/* B13244 8009C0A4 03E00008 */ jr $ra -/* B13248 8009C0A8 27BD0038 */ addiu $sp, $sp, 0x38 - diff --git a/src/code/sys_math.c b/src/code/sys_math.c index 25af276ec2..994f664752 100644 --- a/src/code/sys_math.c +++ b/src/code/sys_math.c @@ -12,13 +12,12 @@ f32 func_800CA540(f32 arg0) { return ret; } -#ifdef NON_MATCHING f32 func_800CA63C(u32 arg0) { f32 ret; s32 i; if (arg0 > 12) { ret = sFactorialTbl[12]; - for (i = 13; i < (s32)arg0; i++) { + for (i = 13; i <= (s32)arg0; i++) { ret *= i; } } else { @@ -26,9 +25,6 @@ f32 func_800CA63C(u32 arg0) { } return ret; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math/func_800CA63C.s") -#endif f32 func_800CA6FC(f32 arg0, s32 arg1) { f32 ret = 1.0f; diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 381c167a0c..d0e1d88754 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -1495,8 +1495,6 @@ void func_8009BC44(GlobalContext* globalCtx) { } // Screen Shake for Ganon's Tower Collapse -#ifdef NON_MATCHING -// regalloc differences void func_8009BEEC(GlobalContext* globalCtx) { s32 var; @@ -1514,10 +1512,6 @@ void func_8009BEEC(GlobalContext* globalCtx) { Quake_SetCountdown(var, 48.0f - (Math_Rand_ZeroOne() * 15.0f)); } } -#else -void func_8009BEEC(GlobalContext* globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_scene_table/func_8009BEEC.s") -#endif // Scene Draw Config 38 void func_8009C0AC(GlobalContext* globalCtx) { From 3c440ef7f1172f49aba2618922cd401155392599 Mon Sep 17 00:00:00 2001 From: Lucas Shaw <49287729+shawlucas@users.noreply.github.com> Date: Wed, 22 Apr 2020 10:20:49 -0700 Subject: [PATCH 3/6] Finished code_801031F0.c, guPosition.c, guLookAtHilite.c (#84) * started microcode decomp * Modified spec to fix error * osContGetQuery OK * Decompiled guLookAtHilite.c * guPosition.c OK * Fixed formatting * osViSetEvent.c OK * Deleted unnecessary files * Made suggested changes, merged playblack.c * Removed line breaks from comments * Removed argument listing --- asm/code_800B29D0.s | 2 +- asm/code_800B2E30.s | 2 +- asm/code_800FCD40.s | 2 +- asm/code_80103BB0.s | 145 ----- asm/code_80103DC0.s | 2 +- asm/code_80104450.s | 2 +- asm/cosf.s | 108 ---- asm/{code_80101B40.s => guMtxIdentF.s} | 4 +- .../code/code_801031F0/func_801031F0.s | 10 - .../code/code_801031F0/func_8010328C.s | 11 - .../code/code_801031F0/func_801032B0.s | 519 ------------------ .../code/code_801031F0/func_80103A70.s | 47 -- .../code/guLookAtRef/guLookAtReflect.s | 30 + .../code/guLookAtRef/guLookAtReflectF.s} | 45 +- .../code/z_player_lib/func_80091A24.s | 2 +- asm/non_matchings/code/z_view/func_800AB9EC.s | 2 +- asm/osViSetEvent.s | 35 -- data/code_80103BB0.data.s | 11 - include/functions.h | 19 +- spec | 10 +- src/code/irqmgr.c | 2 +- src/code/padmgr.c | 2 +- src/code/z_actor.c | 5 +- src/code/z_sample.c | 2 +- src/code/z_view.c | 16 +- src/libultra_code/code_801031F0.c | 22 +- src/libultra_code/guLookAtHilite.c | 153 ++++++ src/libultra_code/guLookAtRef.c | 6 + src/libultra_code/guPosition.c | 55 ++ src/libultra_code/libultra_internal.h | 3 +- src/libultra_code/osViSetEvent.c | 12 + 31 files changed, 313 insertions(+), 973 deletions(-) delete mode 100644 asm/code_80103BB0.s delete mode 100644 asm/cosf.s rename asm/{code_80101B40.s => guMtxIdentF.s} (96%) delete mode 100644 asm/non_matchings/code/code_801031F0/func_801031F0.s delete mode 100644 asm/non_matchings/code/code_801031F0/func_8010328C.s delete mode 100644 asm/non_matchings/code/code_801031F0/func_801032B0.s delete mode 100644 asm/non_matchings/code/code_801031F0/func_80103A70.s create mode 100644 asm/non_matchings/code/guLookAtRef/guLookAtReflect.s rename asm/{code_80101B90.s => non_matchings/code/guLookAtRef/guLookAtReflectF.s} (82%) delete mode 100644 asm/osViSetEvent.s delete mode 100644 data/code_80103BB0.data.s create mode 100644 src/libultra_code/guLookAtHilite.c create mode 100644 src/libultra_code/guLookAtRef.c create mode 100644 src/libultra_code/guPosition.c create mode 100644 src/libultra_code/osViSetEvent.c diff --git a/asm/code_800B29D0.s b/asm/code_800B29D0.s index e060dbc26a..3fade8e8d5 100644 --- a/asm/code_800B29D0.s +++ b/asm/code_800B29D0.s @@ -51,7 +51,7 @@ glabel func_800B29D0 /* B29C00 800B2A60 E7A00018 */ swc1 $f0, 0x18($sp) /* B29C04 800B2A64 E7A0001C */ swc1 $f0, 0x1c($sp) /* B29C08 800B2A68 E7A00024 */ swc1 $f0, 0x24($sp) -/* B29C0C 800B2A6C 0C04078D */ jal func_80101E34 +/* B29C0C 800B2A6C 0C04078D */ jal guLookAtReflect /* B29C10 800B2A70 E7AA0020 */ swc1 $f10, 0x20($sp) /* B29C14 800B2A74 8FBF0034 */ lw $ra, 0x34($sp) /* B29C18 800B2A78 8FB00030 */ lw $s0, 0x30($sp) diff --git a/asm/code_800B2E30.s b/asm/code_800B2E30.s index 450bc3ebb8..87c524ad70 100644 --- a/asm/code_800B2E30.s +++ b/asm/code_800B2E30.s @@ -139,7 +139,7 @@ glabel func_800B2E30 /* B2A194 800B2FF4 E7A00018 */ swc1 $f0, 0x18($sp) /* B2A198 800B2FF8 E7A0001C */ swc1 $f0, 0x1c($sp) /* B2A19C 800B2FFC E7A00024 */ swc1 $f0, 0x24($sp) -/* B2A1A0 800B3000 0C04078D */ jal func_80101E34 +/* B2A1A0 800B3000 0C04078D */ jal guLookAtReflect /* B2A1A4 800B3004 E7AA0020 */ swc1 $f10, 0x20($sp) /* B2A1A8 800B3008 8FBF0034 */ lw $ra, 0x34($sp) /* B2A1AC 800B300C 8FB00030 */ lw $s0, 0x30($sp) diff --git a/asm/code_800FCD40.s b/asm/code_800FCD40.s index 32c06f144d..afe483f1a2 100644 --- a/asm/code_800FCD40.s +++ b/asm/code_800FCD40.s @@ -42,7 +42,7 @@ glabel func_800FCD40 /* B73F4C 800FCDAC 24060001 */ li $a2, 1 /* B73F50 800FCDB0 0C000CA0 */ jal osRecvMesg /* B73F54 800FCDB4 AFA70024 */ sw $a3, 0x24($sp) -/* B73F58 800FCDB8 0C040CA3 */ jal func_8010328C +/* B73F58 800FCDB8 0C040CA3 */ jal osContGetQuery /* B73F5C 800FCDBC 02002025 */ move $a0, $s0 /* B73F60 800FCDC0 8FA70024 */ lw $a3, 0x24($sp) /* B73F64 800FCDC4 02001025 */ move $v0, $s0 diff --git a/asm/code_80103BB0.s b/asm/code_80103BB0.s deleted file mode 100644 index a7c15b784e..0000000000 --- a/asm/code_80103BB0.s +++ /dev/null @@ -1,145 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .text - -.align 4 - -glabel func_80103BB0 -/* B7AD50 80103BB0 3C018013 */ lui $at, %hi(D_80134D00) -/* B7AD54 80103BB4 C4204D00 */ lwc1 $f0, %lo(D_80134D00)($at) -/* B7AD58 80103BB8 44856000 */ mtc1 $a1, $f12 -/* B7AD5C 80103BBC 44867000 */ mtc1 $a2, $f14 -/* B7AD60 80103BC0 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* B7AD64 80103BC4 46006302 */ mul.s $f12, $f12, $f0 -/* B7AD68 80103BC8 F7B40018 */ sdc1 $f20, 0x18($sp) -/* B7AD6C 80103BCC 4487A000 */ mtc1 $a3, $f20 -/* B7AD70 80103BD0 46007382 */ mul.s $f14, $f14, $f0 -/* B7AD74 80103BD4 AFBF002C */ sw $ra, 0x2c($sp) -/* B7AD78 80103BD8 AFB00028 */ sw $s0, 0x28($sp) -/* B7AD7C 80103BDC 4600A502 */ mul.s $f20, $f20, $f0 -/* B7AD80 80103BE0 00808025 */ move $s0, $a0 -/* B7AD84 80103BE4 F7B60020 */ sdc1 $f22, 0x20($sp) -/* B7AD88 80103BE8 E7AC004C */ swc1 $f12, 0x4c($sp) -/* B7AD8C 80103BEC E7AE0050 */ swc1 $f14, 0x50($sp) -/* B7AD90 80103BF0 0C0400A4 */ jal sinf -/* B7AD94 80103BF4 E7B40054 */ swc1 $f20, 0x54($sp) -/* B7AD98 80103BF8 C7AC004C */ lwc1 $f12, 0x4c($sp) -/* B7AD9C 80103BFC 0C041184 */ jal cosf -/* B7ADA0 80103C00 46000506 */ mov.s $f20, $f0 -/* B7ADA4 80103C04 46000586 */ mov.s $f22, $f0 -/* B7ADA8 80103C08 0C0400A4 */ jal sinf -/* B7ADAC 80103C0C C7AC0050 */ lwc1 $f12, 0x50($sp) -/* B7ADB0 80103C10 E7A00040 */ swc1 $f0, 0x40($sp) -/* B7ADB4 80103C14 0C041184 */ jal cosf -/* B7ADB8 80103C18 C7AC0050 */ lwc1 $f12, 0x50($sp) -/* B7ADBC 80103C1C C7AC0054 */ lwc1 $f12, 0x54($sp) -/* B7ADC0 80103C20 0C0400A4 */ jal sinf -/* B7ADC4 80103C24 E7A00034 */ swc1 $f0, 0x34($sp) -/* B7ADC8 80103C28 C7AC0054 */ lwc1 $f12, 0x54($sp) -/* B7ADCC 80103C2C 0C041184 */ jal cosf -/* B7ADD0 80103C30 E7A0003C */ swc1 $f0, 0x3c($sp) -/* B7ADD4 80103C34 C7B00034 */ lwc1 $f16, 0x34($sp) -/* B7ADD8 80103C38 C7A20058 */ lwc1 $f2, 0x58($sp) -/* B7ADDC 80103C3C C7AE003C */ lwc1 $f14, 0x3c($sp) -/* B7ADE0 80103C40 46008102 */ mul.s $f4, $f16, $f0 -/* B7ADE4 80103C44 44809000 */ mtc1 $zero, $f18 -/* B7ADE8 80103C48 3C013F80 */ li $at, 0x3F800000 # 0.000000 -/* B7ADEC 80103C4C 46022182 */ mul.s $f6, $f4, $f2 -/* B7ADF0 80103C50 00000000 */ nop -/* B7ADF4 80103C54 460E8202 */ mul.s $f8, $f16, $f14 -/* B7ADF8 80103C58 E6060000 */ swc1 $f6, ($s0) -/* B7ADFC 80103C5C 46024282 */ mul.s $f10, $f8, $f2 -/* B7AE00 80103C60 E60A0004 */ swc1 $f10, 4($s0) -/* B7AE04 80103C64 C7A40040 */ lwc1 $f4, 0x40($sp) -/* B7AE08 80103C68 E612000C */ swc1 $f18, 0xc($s0) -/* B7AE0C 80103C6C 46002187 */ neg.s $f6, $f4 -/* B7AE10 80103C70 46023202 */ mul.s $f8, $f6, $f2 -/* B7AE14 80103C74 E6080008 */ swc1 $f8, 8($s0) -/* B7AE18 80103C78 C7AA0040 */ lwc1 $f10, 0x40($sp) -/* B7AE1C 80103C7C E612001C */ swc1 $f18, 0x1c($s0) -/* B7AE20 80103C80 460AA302 */ mul.s $f12, $f20, $f10 -/* B7AE24 80103C84 00000000 */ nop -/* B7AE28 80103C88 46006102 */ mul.s $f4, $f12, $f0 -/* B7AE2C 80103C8C 00000000 */ nop -/* B7AE30 80103C90 460EB182 */ mul.s $f6, $f22, $f14 -/* B7AE34 80103C94 46062201 */ sub.s $f8, $f4, $f6 -/* B7AE38 80103C98 46024282 */ mul.s $f10, $f8, $f2 -/* B7AE3C 80103C9C 00000000 */ nop -/* B7AE40 80103CA0 460E6102 */ mul.s $f4, $f12, $f14 -/* B7AE44 80103CA4 00000000 */ nop -/* B7AE48 80103CA8 4600B182 */ mul.s $f6, $f22, $f0 -/* B7AE4C 80103CAC E60A0010 */ swc1 $f10, 0x10($s0) -/* B7AE50 80103CB0 46062200 */ add.s $f8, $f4, $f6 -/* B7AE54 80103CB4 46024282 */ mul.s $f10, $f8, $f2 -/* B7AE58 80103CB8 00000000 */ nop -/* B7AE5C 80103CBC 4610A102 */ mul.s $f4, $f20, $f16 -/* B7AE60 80103CC0 E60A0014 */ swc1 $f10, 0x14($s0) -/* B7AE64 80103CC4 46022182 */ mul.s $f6, $f4, $f2 -/* B7AE68 80103CC8 E6060018 */ swc1 $f6, 0x18($s0) -/* B7AE6C 80103CCC C7A80040 */ lwc1 $f8, 0x40($sp) -/* B7AE70 80103CD0 E612002C */ swc1 $f18, 0x2c($s0) -/* B7AE74 80103CD4 4608B302 */ mul.s $f12, $f22, $f8 -/* B7AE78 80103CD8 00000000 */ nop -/* B7AE7C 80103CDC 46006282 */ mul.s $f10, $f12, $f0 -/* B7AE80 80103CE0 00000000 */ nop -/* B7AE84 80103CE4 460EA102 */ mul.s $f4, $f20, $f14 -/* B7AE88 80103CE8 46045180 */ add.s $f6, $f10, $f4 -/* B7AE8C 80103CEC 46023202 */ mul.s $f8, $f6, $f2 -/* B7AE90 80103CF0 00000000 */ nop -/* B7AE94 80103CF4 460E6282 */ mul.s $f10, $f12, $f14 -/* B7AE98 80103CF8 00000000 */ nop -/* B7AE9C 80103CFC 4600A102 */ mul.s $f4, $f20, $f0 -/* B7AEA0 80103D00 E6080020 */ swc1 $f8, 0x20($s0) -/* B7AEA4 80103D04 46045181 */ sub.s $f6, $f10, $f4 -/* B7AEA8 80103D08 46023202 */ mul.s $f8, $f6, $f2 -/* B7AEAC 80103D0C 00000000 */ nop -/* B7AEB0 80103D10 4610B282 */ mul.s $f10, $f22, $f16 -/* B7AEB4 80103D14 E6080024 */ swc1 $f8, 0x24($s0) -/* B7AEB8 80103D18 46025102 */ mul.s $f4, $f10, $f2 -/* B7AEBC 80103D1C E6040028 */ swc1 $f4, 0x28($s0) -/* B7AEC0 80103D20 C7A6005C */ lwc1 $f6, 0x5c($sp) -/* B7AEC4 80103D24 44812000 */ mtc1 $at, $f4 -/* B7AEC8 80103D28 E6060030 */ swc1 $f6, 0x30($s0) -/* B7AECC 80103D2C C7A80060 */ lwc1 $f8, 0x60($sp) -/* B7AED0 80103D30 E6080034 */ swc1 $f8, 0x34($s0) -/* B7AED4 80103D34 C7AA0064 */ lwc1 $f10, 0x64($sp) -/* B7AED8 80103D38 E604003C */ swc1 $f4, 0x3c($s0) -/* B7AEDC 80103D3C E60A0038 */ swc1 $f10, 0x38($s0) -/* B7AEE0 80103D40 8FBF002C */ lw $ra, 0x2c($sp) -/* B7AEE4 80103D44 8FB00028 */ lw $s0, 0x28($sp) -/* B7AEE8 80103D48 D7B60020 */ ldc1 $f22, 0x20($sp) -/* B7AEEC 80103D4C D7B40018 */ ldc1 $f20, 0x18($sp) -/* B7AEF0 80103D50 03E00008 */ jr $ra -/* B7AEF4 80103D54 27BD0048 */ addiu $sp, $sp, 0x48 - -glabel func_80103D58 -/* B7AEF8 80103D58 27BDFF98 */ addiu $sp, $sp, -0x68 -/* B7AEFC 80103D5C 44856000 */ mtc1 $a1, $f12 -/* B7AF00 80103D60 44867000 */ mtc1 $a2, $f14 -/* B7AF04 80103D64 C7A40078 */ lwc1 $f4, 0x78($sp) -/* B7AF08 80103D68 C7A6007C */ lwc1 $f6, 0x7c($sp) -/* B7AF0C 80103D6C C7A80080 */ lwc1 $f8, 0x80($sp) -/* B7AF10 80103D70 C7AA0084 */ lwc1 $f10, 0x84($sp) -/* B7AF14 80103D74 AFBF0024 */ sw $ra, 0x24($sp) -/* B7AF18 80103D78 AFA40068 */ sw $a0, 0x68($sp) -/* B7AF1C 80103D7C 44056000 */ mfc1 $a1, $f12 -/* B7AF20 80103D80 44067000 */ mfc1 $a2, $f14 -/* B7AF24 80103D84 AFA70074 */ sw $a3, 0x74($sp) -/* B7AF28 80103D88 27A40028 */ addiu $a0, $sp, 0x28 -/* B7AF2C 80103D8C E7A40010 */ swc1 $f4, 0x10($sp) -/* B7AF30 80103D90 E7A60014 */ swc1 $f6, 0x14($sp) -/* B7AF34 80103D94 E7A80018 */ swc1 $f8, 0x18($sp) -/* B7AF38 80103D98 0C040EEC */ jal func_80103BB0 -/* B7AF3C 80103D9C E7AA001C */ swc1 $f10, 0x1c($sp) -/* B7AF40 80103DA0 27A40028 */ addiu $a0, $sp, 0x28 -/* B7AF44 80103DA4 0C041938 */ jal func_801064E0 -/* B7AF48 80103DA8 8FA50068 */ lw $a1, 0x68($sp) -/* B7AF4C 80103DAC 8FBF0024 */ lw $ra, 0x24($sp) -/* B7AF50 80103DB0 27BD0068 */ addiu $sp, $sp, 0x68 -/* B7AF54 80103DB4 03E00008 */ jr $ra -/* B7AF58 80103DB8 00000000 */ nop diff --git a/asm/code_80103DC0.s b/asm/code_80103DC0.s index 01d666e00e..d48f8cc021 100644 --- a/asm/code_80103DC0.s +++ b/asm/code_80103DC0.s @@ -77,7 +77,7 @@ glabel func_80103E20 /* B7B04C 80103EAC 460C2202 */ mul.s $f8, $f4, $f12 /* B7B050 80103EB0 E7AA0038 */ swc1 $f10, 0x38($sp) /* B7B054 80103EB4 46024182 */ mul.s $f6, $f8, $f2 -/* B7B058 80103EB8 0C0406D0 */ jal func_80101B40 +/* B7B058 80103EB8 0C0406D0 */ jal guMtxIdentF /* B7B05C 80103EBC E7A60034 */ swc1 $f6, 0x34($sp) /* B7B060 80103EC0 C7AE0044 */ lwc1 $f14, 0x44($sp) /* B7B064 80103EC4 C7AA0050 */ lwc1 $f10, 0x50($sp) diff --git a/asm/code_80104450.s b/asm/code_80104450.s index 292479638a..07fd9f3e3a 100644 --- a/asm/code_80104450.s +++ b/asm/code_80104450.s @@ -15,7 +15,7 @@ glabel func_80104450 /* B7B5F8 80104458 AFA5001C */ sw $a1, 0x1c($sp) /* B7B5FC 8010445C AFA60020 */ sw $a2, 0x20($sp) /* B7B600 80104460 AFA70024 */ sw $a3, 0x24($sp) -/* B7B604 80104464 0C0406D0 */ jal func_80101B40 +/* B7B604 80104464 0C0406D0 */ jal guMtxIdentF /* B7B608 80104468 AFA40018 */ sw $a0, 0x18($sp) /* B7B60C 8010446C C7A40020 */ lwc1 $f4, 0x20($sp) /* B7B610 80104470 C7A6001C */ lwc1 $f6, 0x1c($sp) diff --git a/asm/cosf.s b/asm/cosf.s deleted file mode 100644 index 042189cf08..0000000000 --- a/asm/cosf.s +++ /dev/null @@ -1,108 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .text - -.align 4 - -glabel cosf -/* B7B7B0 80104610 E7AC0000 */ swc1 $f12, ($sp) -/* B7B7B4 80104614 8FA20000 */ lw $v0, ($sp) -/* B7B7B8 80104618 C7A60000 */ lwc1 $f6, ($sp) -/* B7B7BC 8010461C C7AA0000 */ lwc1 $f10, ($sp) -/* B7B7C0 80104620 00027583 */ sra $t6, $v0, 0x16 -/* B7B7C4 80104624 31CF01FF */ andi $t7, $t6, 0x1ff -/* B7B7C8 80104628 29E10136 */ slti $at, $t7, 0x136 -/* B7B7CC 8010462C 50200049 */ beql $at, $zero, .L80104754 -/* B7B7D0 80104630 460A5032 */ c.eq.s $f10, $f10 -/* B7B7D4 80104634 44802000 */ mtc1 $zero, $f4 -/* B7B7D8 80104638 3C013FE0 */ li $at, 0x3FE00000 # 0.000000 -/* B7B7DC 8010463C 44819800 */ mtc1 $at, $f19 -/* B7B7E0 80104640 4606203C */ c.lt.s $f4, $f6 -/* B7B7E4 80104644 C7A00000 */ lwc1 $f0, ($sp) -/* B7B7E8 80104648 3C018015 */ lui $at, %hi(D_8014B2A8) -/* B7B7EC 8010464C 45020004 */ bc1fl .L80104660 -/* B7B7F0 80104650 46000007 */ neg.s $f0, $f0 -/* B7B7F4 80104654 10000002 */ b .L80104660 -/* B7B7F8 80104658 46003006 */ mov.s $f0, $f6 -/* B7B7FC 8010465C 46000007 */ neg.s $f0, $f0 -.L80104660: -/* B7B800 80104660 D428B2A8 */ ldc1 $f8, %lo(D_8014B2A8)($at) -/* B7B804 80104664 46000321 */ cvt.d.s $f12, $f0 -/* B7B808 80104668 44809000 */ mtc1 $zero, $f18 -/* B7B80C 8010466C 46286282 */ mul.d $f10, $f12, $f8 -/* B7B810 80104670 44802800 */ mtc1 $zero, $f5 -/* B7B814 80104674 44802000 */ mtc1 $zero, $f4 -/* B7B818 80104678 46325380 */ add.d $f14, $f10, $f18 -/* B7B81C 8010467C 462E203E */ c.le.d $f4, $f14 -/* B7B820 80104680 00000000 */ nop -/* B7B824 80104684 45020007 */ bc1fl .L801046A4 -/* B7B828 80104688 46327281 */ sub.d $f10, $f14, $f18 -/* B7B82C 8010468C 46327180 */ add.d $f6, $f14, $f18 -/* B7B830 80104690 4620320D */ trunc.w.d $f8, $f6 -/* B7B834 80104694 44024000 */ mfc1 $v0, $f8 -/* B7B838 80104698 10000006 */ b .L801046B4 -/* B7B83C 8010469C 44823000 */ mtc1 $v0, $f6 -/* B7B840 801046A0 46327281 */ sub.d $f10, $f14, $f18 -.L801046A4: -/* B7B844 801046A4 4620510D */ trunc.w.d $f4, $f10 -/* B7B848 801046A8 44022000 */ mfc1 $v0, $f4 -/* B7B84C 801046AC 00000000 */ nop -/* B7B850 801046B0 44823000 */ mtc1 $v0, $f6 -.L801046B4: -/* B7B854 801046B4 3C018015 */ lui $at, %hi(D_8014B2B0) -/* B7B858 801046B8 D42AB2B0 */ ldc1 $f10, %lo(D_8014B2B0)($at) -/* B7B85C 801046BC 46803221 */ cvt.d.w $f8, $f6 -/* B7B860 801046C0 3C018015 */ lui $at, %hi(D_8014B2B8) -/* B7B864 801046C4 D426B2B8 */ ldc1 $f6, %lo(D_8014B2B8)($at) -/* B7B868 801046C8 3C038015 */ lui $v1, %hi(D_8014B280) # $v1, 0x8015 -/* B7B86C 801046CC 2463B280 */ addiu $v1, %lo(D_8014B280) # addiu $v1, $v1, -0x4d80 -/* B7B870 801046D0 46324001 */ sub.d $f0, $f8, $f18 -/* B7B874 801046D4 30480001 */ andi $t0, $v0, 1 -/* B7B878 801046D8 462A0102 */ mul.d $f4, $f0, $f10 -/* B7B87C 801046DC D46A0020 */ ldc1 $f10, 0x20($v1) -/* B7B880 801046E0 46260202 */ mul.d $f8, $f0, $f6 -/* B7B884 801046E4 D4660018 */ ldc1 $f6, 0x18($v1) -/* B7B888 801046E8 46246081 */ sub.d $f2, $f12, $f4 -/* B7B88C 801046EC 46281081 */ sub.d $f2, $f2, $f8 -/* B7B890 801046F0 46221382 */ mul.d $f14, $f2, $f2 -/* B7B894 801046F4 00000000 */ nop -/* B7B898 801046F8 462E5102 */ mul.d $f4, $f10, $f14 -/* B7B89C 801046FC 46262200 */ add.d $f8, $f4, $f6 -/* B7B8A0 80104700 D4640010 */ ldc1 $f4, 0x10($v1) -/* B7B8A4 80104704 462E4282 */ mul.d $f10, $f8, $f14 -/* B7B8A8 80104708 46245180 */ add.d $f6, $f10, $f4 -/* B7B8AC 8010470C D46A0008 */ ldc1 $f10, 8($v1) -/* B7B8B0 80104710 462E3202 */ mul.d $f8, $f6, $f14 -/* B7B8B4 80104714 15000007 */ bnez $t0, .L80104734 -/* B7B8B8 80104718 46285400 */ add.d $f16, $f10, $f8 -/* B7B8BC 8010471C 462E1102 */ mul.d $f4, $f2, $f14 -/* B7B8C0 80104720 00000000 */ nop -/* B7B8C4 80104724 46302182 */ mul.d $f6, $f4, $f16 -/* B7B8C8 80104728 46223280 */ add.d $f10, $f6, $f2 -/* B7B8CC 8010472C 03E00008 */ jr $ra -/* B7B8D0 80104730 46205020 */ cvt.s.d $f0, $f10 -.L80104734: -/* B7B8D4 80104734 462E1202 */ mul.d $f8, $f2, $f14 -/* B7B8D8 80104738 00000000 */ nop -/* B7B8DC 8010473C 46304102 */ mul.d $f4, $f8, $f16 -/* B7B8E0 80104740 46222180 */ add.d $f6, $f4, $f2 -/* B7B8E4 80104744 46203020 */ cvt.s.d $f0, $f6 -/* B7B8E8 80104748 03E00008 */ jr $ra -/* B7B8EC 8010474C 46000007 */ neg.s $f0, $f0 -/* B7B8F0 80104750 460A5032 */ c.eq.s $f10, $f10 -.L80104754: -/* B7B8F4 80104754 3C018015 */ lui $at, %hi(D_8014B2C0) -/* B7B8F8 80104758 45010004 */ bc1t .L8010476C -/* B7B8FC 8010475C 00000000 */ nop -/* B7B900 80104760 3C018015 */ lui $at, %hi(D_8014B2D0) -/* B7B904 80104764 03E00008 */ jr $ra -/* B7B908 80104768 C420B2D0 */ lwc1 $f0, %lo(D_8014B2D0)($at) -.L8010476C: -/* B7B90C 8010476C C420B2C0 */ lwc1 $f0, %lo(D_8014B2C0)($at) -/* B7B910 80104770 03E00008 */ jr $ra -/* B7B914 80104774 00000000 */ nop diff --git a/asm/code_80101B40.s b/asm/guMtxIdentF.s similarity index 96% rename from asm/code_80101B40.s rename to asm/guMtxIdentF.s index 411db6f12d..993ed27ab1 100644 --- a/asm/code_80101B40.s +++ b/asm/guMtxIdentF.s @@ -9,7 +9,9 @@ .align 4 -glabel func_80101B40 +## Handwritten ASM + +glabel guMtxIdentF /* B78CE0 80101B40 3C083F80 */ lui $t0, 0x3f80 /* B78CE4 80101B44 AC880000 */ sw $t0, ($a0) /* B78CE8 80101B48 AC800004 */ sw $zero, 4($a0) diff --git a/asm/non_matchings/code/code_801031F0/func_801031F0.s b/asm/non_matchings/code/code_801031F0/func_801031F0.s deleted file mode 100644 index 1716138a04..0000000000 --- a/asm/non_matchings/code/code_801031F0/func_801031F0.s +++ /dev/null @@ -1,10 +0,0 @@ -glabel func_801031F0 -/* B7A390 801031F0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* B7A394 801031F4 AFBF0014 */ sw $ra, 0x14($sp) -/* B7A398 801031F8 0C0419E8 */ jal __osSpSetPc -/* B7A39C 801031FC 00002025 */ move $a0, $zero -/* B7A3A0 80103200 8FBF0014 */ lw $ra, 0x14($sp) -/* B7A3A4 80103204 27BD0018 */ addiu $sp, $sp, 0x18 -/* B7A3A8 80103208 03E00008 */ jr $ra -/* B7A3AC 8010320C 00000000 */ nop - diff --git a/asm/non_matchings/code/code_801031F0/func_8010328C.s b/asm/non_matchings/code/code_801031F0/func_8010328C.s deleted file mode 100644 index 905566dae6..0000000000 --- a/asm/non_matchings/code/code_801031F0/func_8010328C.s +++ /dev/null @@ -1,11 +0,0 @@ -glabel func_8010328C -/* B7A42C 8010328C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* B7A430 80103290 AFBF0014 */ sw $ra, 0x14($sp) -/* B7A434 80103294 00802825 */ move $a1, $a0 -/* B7A438 80103298 0C04035B */ jal __osContGetInitData -/* B7A43C 8010329C 27A4001F */ addiu $a0, $sp, 0x1f -/* B7A440 801032A0 8FBF0014 */ lw $ra, 0x14($sp) -/* B7A444 801032A4 27BD0020 */ addiu $sp, $sp, 0x20 -/* B7A448 801032A8 03E00008 */ jr $ra -/* B7A44C 801032AC 00000000 */ nop - diff --git a/asm/non_matchings/code/code_801031F0/func_801032B0.s b/asm/non_matchings/code/code_801031F0/func_801032B0.s deleted file mode 100644 index 7c2133afea..0000000000 --- a/asm/non_matchings/code/code_801031F0/func_801032B0.s +++ /dev/null @@ -1,519 +0,0 @@ -.late_rodata - -glabel D_8014B270 - .double 0.1 - -glabel D_8014B278 - .double 0.1 - -.text -glabel func_801032B0 -/* B7A450 801032B0 27BDFF70 */ addiu $sp, $sp, -0x90 -/* B7A454 801032B4 AFBF003C */ sw $ra, 0x3c($sp) -/* B7A458 801032B8 F7BC0030 */ sdc1 $f28, 0x30($sp) -/* B7A45C 801032BC F7BA0028 */ sdc1 $f26, 0x28($sp) -/* B7A460 801032C0 F7B80020 */ sdc1 $f24, 0x20($sp) -/* B7A464 801032C4 F7B60018 */ sdc1 $f22, 0x18($sp) -/* B7A468 801032C8 F7B40010 */ sdc1 $f20, 0x10($sp) -/* B7A46C 801032CC AFA7009C */ sw $a3, 0x9c($sp) -/* B7A470 801032D0 AFA40090 */ sw $a0, 0x90($sp) -/* B7A474 801032D4 AFA50094 */ sw $a1, 0x94($sp) -/* B7A478 801032D8 0C0406D0 */ jal func_80101B40 -/* B7A47C 801032DC AFA60098 */ sw $a2, 0x98($sp) -/* B7A480 801032E0 C7A800A8 */ lwc1 $f8, 0xa8($sp) -/* B7A484 801032E4 C7A6009C */ lwc1 $f6, 0x9c($sp) -/* B7A488 801032E8 C7AA00AC */ lwc1 $f10, 0xac($sp) -/* B7A48C 801032EC C7A400A0 */ lwc1 $f4, 0xa0($sp) -/* B7A490 801032F0 46064301 */ sub.s $f12, $f8, $f6 -/* B7A494 801032F4 C7A600A4 */ lwc1 $f6, 0xa4($sp) -/* B7A498 801032F8 C7A800B0 */ lwc1 $f8, 0xb0($sp) -/* B7A49C 801032FC 46045381 */ sub.s $f14, $f10, $f4 -/* B7A4A0 80103300 460C6282 */ mul.s $f10, $f12, $f12 -/* B7A4A4 80103304 3C013FF0 */ li $at, 0x3FF00000 # 0.000000 -/* B7A4A8 80103308 46064401 */ sub.s $f16, $f8, $f6 -/* B7A4AC 8010330C 460E7102 */ mul.s $f4, $f14, $f14 -/* B7A4B0 80103310 4481B800 */ mtc1 $at, $f23 -/* B7A4B4 80103314 3C01BFF0 */ li $at, 0xBFF00000 # 0.000000 -/* B7A4B8 80103318 46108182 */ mul.s $f6, $f16, $f16 -/* B7A4BC 8010331C 44815800 */ mtc1 $at, $f11 -/* B7A4C0 80103320 C7B400B8 */ lwc1 $f20, 0xb8($sp) -/* B7A4C4 80103324 4480B000 */ mtc1 $zero, $f22 -/* B7A4C8 80103328 3C018015 */ lui $at, %hi(D_8014B270) -/* B7A4CC 8010332C 46045200 */ add.s $f8, $f10, $f4 -/* B7A4D0 80103330 44805000 */ mtc1 $zero, $f10 -/* B7A4D4 80103334 8FA200D8 */ lw $v0, 0xd8($sp) -/* B7A4D8 80103338 8FA300DC */ lw $v1, 0xdc($sp) -/* B7A4DC 8010333C 46064000 */ add.s $f0, $f8, $f6 -/* B7A4E0 80103340 8FA40090 */ lw $a0, 0x90($sp) -/* B7A4E4 80103344 8FA50094 */ lw $a1, 0x94($sp) -/* B7A4E8 80103348 8FA60098 */ lw $a2, 0x98($sp) -/* B7A4EC 8010334C 46000004 */ sqrt.s $f0, $f0 -/* B7A4F0 80103350 00027040 */ sll $t6, $v0, 1 -/* B7A4F4 80103354 00037840 */ sll $t7, $v1, 1 -/* B7A4F8 80103358 46000121 */ cvt.d.s $f4, $f0 -/* B7A4FC 8010335C 46245203 */ div.d $f8, $f10, $f4 -/* B7A500 80103360 462044A0 */ cvt.s.d $f18, $f8 -/* B7A504 80103364 46126182 */ mul.s $f6, $f12, $f18 -/* B7A508 80103368 E7A60054 */ swc1 $f6, 0x54($sp) -/* B7A50C 8010336C 46127102 */ mul.s $f4, $f14, $f18 -/* B7A510 80103370 C7AA0054 */ lwc1 $f10, 0x54($sp) -/* B7A514 80103374 46128182 */ mul.s $f6, $f16, $f18 -/* B7A518 80103378 E7AA0088 */ swc1 $f10, 0x88($sp) -/* B7A51C 8010337C E7A40050 */ swc1 $f4, 0x50($sp) -/* B7A520 80103380 C7A80050 */ lwc1 $f8, 0x50($sp) -/* B7A524 80103384 C7A400BC */ lwc1 $f4, 0xbc($sp) -/* B7A528 80103388 E7A6004C */ swc1 $f6, 0x4c($sp) -/* B7A52C 8010338C C7AA004C */ lwc1 $f10, 0x4c($sp) -/* B7A530 80103390 E7A80084 */ swc1 $f8, 0x84($sp) -/* B7A534 80103394 C7A80050 */ lwc1 $f8, 0x50($sp) -/* B7A538 80103398 E7AA0080 */ swc1 $f10, 0x80($sp) -/* B7A53C 8010339C C7AA004C */ lwc1 $f10, 0x4c($sp) -/* B7A540 801033A0 46082182 */ mul.s $f6, $f4, $f8 -/* B7A544 801033A4 00000000 */ nop -/* B7A548 801033A8 460AA102 */ mul.s $f4, $f20, $f10 -/* B7A54C 801033AC C7AA00BC */ lwc1 $f10, 0xbc($sp) -/* B7A550 801033B0 46062201 */ sub.s $f8, $f4, $f6 -/* B7A554 801033B4 C7A40054 */ lwc1 $f4, 0x54($sp) -/* B7A558 801033B8 46045182 */ mul.s $f6, $f10, $f4 -/* B7A55C 801033BC E7A80048 */ swc1 $f8, 0x48($sp) -/* B7A560 801033C0 C7A800B4 */ lwc1 $f8, 0xb4($sp) -/* B7A564 801033C4 C7AA004C */ lwc1 $f10, 0x4c($sp) -/* B7A568 801033C8 C7B80048 */ lwc1 $f24, 0x48($sp) -/* B7A56C 801033CC 460A4102 */ mul.s $f4, $f8, $f10 -/* B7A570 801033D0 C7AA00B4 */ lwc1 $f10, 0xb4($sp) -/* B7A574 801033D4 46043201 */ sub.s $f8, $f6, $f4 -/* B7A578 801033D8 C7A60050 */ lwc1 $f6, 0x50($sp) -/* B7A57C 801033DC E7A8004C */ swc1 $f8, 0x4c($sp) -/* B7A580 801033E0 46065102 */ mul.s $f4, $f10, $f6 -/* B7A584 801033E4 C7A80054 */ lwc1 $f8, 0x54($sp) -/* B7A588 801033E8 C7BA004C */ lwc1 $f26, 0x4c($sp) -/* B7A58C 801033EC 4608A282 */ mul.s $f10, $f20, $f8 -/* B7A590 801033F0 C7A80048 */ lwc1 $f8, 0x48($sp) -/* B7A594 801033F4 C7B400C0 */ lwc1 $f20, 0xc0($sp) -/* B7A598 801033F8 460A2181 */ sub.s $f6, $f4, $f10 -/* B7A59C 801033FC C7A40048 */ lwc1 $f4, 0x48($sp) -/* B7A5A0 80103400 46044282 */ mul.s $f10, $f8, $f4 -/* B7A5A4 80103404 E7A60054 */ swc1 $f6, 0x54($sp) -/* B7A5A8 80103408 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* B7A5AC 8010340C C7A8004C */ lwc1 $f8, 0x4c($sp) -/* B7A5B0 80103410 C7BC0054 */ lwc1 $f28, 0x54($sp) -/* B7A5B4 80103414 46083102 */ mul.s $f4, $f6, $f8 -/* B7A5B8 80103418 C7A80054 */ lwc1 $f8, 0x54($sp) -/* B7A5BC 8010341C 46045180 */ add.s $f6, $f10, $f4 -/* B7A5C0 80103420 C7AA0054 */ lwc1 $f10, 0x54($sp) -/* B7A5C4 80103424 460A4102 */ mul.s $f4, $f8, $f10 -/* B7A5C8 80103428 46043000 */ add.s $f0, $f6, $f4 -/* B7A5CC 8010342C C7A60084 */ lwc1 $f6, 0x84($sp) -/* B7A5D0 80103430 46000004 */ sqrt.s $f0, $f0 -/* B7A5D4 80103434 46000221 */ cvt.d.s $f8, $f0 -/* B7A5D8 80103438 4628B283 */ div.d $f10, $f22, $f8 -/* B7A5DC 8010343C C7A80080 */ lwc1 $f8, 0x80($sp) -/* B7A5E0 80103440 462050A0 */ cvt.s.d $f2, $f10 -/* B7A5E4 80103444 4602C602 */ mul.s $f24, $f24, $f2 -/* B7A5E8 80103448 00000000 */ nop -/* B7A5EC 8010344C 4602D682 */ mul.s $f26, $f26, $f2 -/* B7A5F0 80103450 00000000 */ nop -/* B7A5F4 80103454 4602E702 */ mul.s $f28, $f28, $f2 -/* B7A5F8 80103458 00000000 */ nop -/* B7A5FC 8010345C 461C3102 */ mul.s $f4, $f6, $f28 -/* B7A600 80103460 C7A60080 */ lwc1 $f6, 0x80($sp) -/* B7A604 80103464 461A4282 */ mul.s $f10, $f8, $f26 -/* B7A608 80103468 460A2381 */ sub.s $f14, $f4, $f10 -/* B7A60C 8010346C 46183202 */ mul.s $f8, $f6, $f24 -/* B7A610 80103470 C7A40088 */ lwc1 $f4, 0x88($sp) -/* B7A614 80103474 C7A60088 */ lwc1 $f6, 0x88($sp) -/* B7A618 80103478 461C2282 */ mul.s $f10, $f4, $f28 -/* B7A61C 8010347C 460A4401 */ sub.s $f16, $f8, $f10 -/* B7A620 80103480 461A3102 */ mul.s $f4, $f6, $f26 -/* B7A624 80103484 C7A80084 */ lwc1 $f8, 0x84($sp) -/* B7A628 80103488 46184282 */ mul.s $f10, $f8, $f24 -/* B7A62C 8010348C 460A2481 */ sub.s $f18, $f4, $f10 -/* B7A630 80103490 460E7182 */ mul.s $f6, $f14, $f14 -/* B7A634 80103494 00000000 */ nop -/* B7A638 80103498 46108202 */ mul.s $f8, $f16, $f16 -/* B7A63C 8010349C 46083100 */ add.s $f4, $f6, $f8 -/* B7A640 801034A0 46129282 */ mul.s $f10, $f18, $f18 -/* B7A644 801034A4 460A2000 */ add.s $f0, $f4, $f10 -/* B7A648 801034A8 46000004 */ sqrt.s $f0, $f0 -/* B7A64C 801034AC 460001A1 */ cvt.d.s $f6, $f0 -/* B7A650 801034B0 4626B203 */ div.d $f8, $f22, $f6 -/* B7A654 801034B4 462040A0 */ cvt.s.d $f2, $f8 -/* B7A658 801034B8 C7A800C4 */ lwc1 $f8, 0xc4($sp) -/* B7A65C 801034BC 46027102 */ mul.s $f4, $f14, $f2 -/* B7A660 801034C0 00000000 */ nop -/* B7A664 801034C4 46028282 */ mul.s $f10, $f16, $f2 -/* B7A668 801034C8 E7A400B4 */ swc1 $f4, 0xb4($sp) -/* B7A66C 801034CC 46029182 */ mul.s $f6, $f18, $f2 -/* B7A670 801034D0 C7A400C4 */ lwc1 $f4, 0xc4($sp) -/* B7A674 801034D4 E7AA00B8 */ swc1 $f10, 0xb8($sp) -/* B7A678 801034D8 46044282 */ mul.s $f10, $f8, $f4 -/* B7A67C 801034DC C7A400C8 */ lwc1 $f4, 0xc8($sp) -/* B7A680 801034E0 E7A600BC */ swc1 $f6, 0xbc($sp) -/* B7A684 801034E4 4614A182 */ mul.s $f6, $f20, $f20 -/* B7A688 801034E8 460A3200 */ add.s $f8, $f6, $f10 -/* B7A68C 801034EC C7A600C8 */ lwc1 $f6, 0xc8($sp) -/* B7A690 801034F0 46062282 */ mul.s $f10, $f4, $f6 -/* B7A694 801034F4 460A4000 */ add.s $f0, $f8, $f10 -/* B7A698 801034F8 C7A800C4 */ lwc1 $f8, 0xc4($sp) -/* B7A69C 801034FC 46000004 */ sqrt.s $f0, $f0 -/* B7A6A0 80103500 46000121 */ cvt.d.s $f4, $f0 -/* B7A6A4 80103504 4624B183 */ div.d $f6, $f22, $f4 -/* B7A6A8 80103508 C7A400C8 */ lwc1 $f4, 0xc8($sp) -/* B7A6AC 8010350C 462030A0 */ cvt.s.d $f2, $f6 -/* B7A6B0 80103510 4602A502 */ mul.s $f20, $f20, $f2 -/* B7A6B4 80103514 00000000 */ nop -/* B7A6B8 80103518 46024282 */ mul.s $f10, $f8, $f2 -/* B7A6BC 8010351C 00000000 */ nop -/* B7A6C0 80103520 46022182 */ mul.s $f6, $f4, $f2 -/* B7A6C4 80103524 E7B400C0 */ swc1 $f20, 0xc0($sp) -/* B7A6C8 80103528 C7A800C0 */ lwc1 $f8, 0xc0($sp) -/* B7A6CC 8010352C C7A40088 */ lwc1 $f4, 0x88($sp) -/* B7A6D0 80103530 E7AA00C4 */ swc1 $f10, 0xc4($sp) -/* B7A6D4 80103534 46044080 */ add.s $f2, $f8, $f4 -/* B7A6D8 80103538 E7A600C8 */ swc1 $f6, 0xc8($sp) -/* B7A6DC 8010353C C7A60084 */ lwc1 $f6, 0x84($sp) -/* B7A6E0 80103540 C7A400C8 */ lwc1 $f4, 0xc8($sp) -/* B7A6E4 80103544 46065200 */ add.s $f8, $f10, $f6 -/* B7A6E8 80103548 C7AA0080 */ lwc1 $f10, 0x80($sp) -/* B7A6EC 8010354C E7A80050 */ swc1 $f8, 0x50($sp) -/* B7A6F0 80103550 460A2180 */ add.s $f6, $f4, $f10 -/* B7A6F4 80103554 C7A40050 */ lwc1 $f4, 0x50($sp) -/* B7A6F8 80103558 C7A80050 */ lwc1 $f8, 0x50($sp) -/* B7A6FC 8010355C E7A6004C */ swc1 $f6, 0x4c($sp) -/* B7A700 80103560 46044282 */ mul.s $f10, $f8, $f4 -/* B7A704 80103564 C7A4004C */ lwc1 $f4, 0x4c($sp) -/* B7A708 80103568 46021182 */ mul.s $f6, $f2, $f2 -/* B7A70C 8010356C 460A3200 */ add.s $f8, $f6, $f10 -/* B7A710 80103570 C7A6004C */ lwc1 $f6, 0x4c($sp) -/* B7A714 80103574 46062282 */ mul.s $f10, $f4, $f6 -/* B7A718 80103578 D424B270 */ ldc1 $f4, %lo(D_8014B270)($at) -/* B7A71C 8010357C 460A4000 */ add.s $f0, $f8, $f10 -/* B7A720 80103580 46000004 */ sqrt.s $f0, $f0 -/* B7A724 80103584 460003A1 */ cvt.d.s $f14, $f0 -/* B7A728 80103588 462E203C */ c.lt.d $f4, $f14 -/* B7A72C 8010358C 00000000 */ nop -/* B7A730 80103590 45000037 */ bc1f .L80103670 -/* B7A734 80103594 00000000 */ nop -/* B7A738 80103598 462EB183 */ div.d $f6, $f22, $f14 -/* B7A73C 8010359C C7A80050 */ lwc1 $f8, 0x50($sp) -/* B7A740 801035A0 C7AA004C */ lwc1 $f10, 0x4c($sp) -/* B7A744 801035A4 8FA200D8 */ lw $v0, 0xd8($sp) -/* B7A748 801035A8 3C014000 */ li $at, 0x40000000 # 0.000000 -/* B7A74C 801035AC 8FA300DC */ lw $v1, 0xdc($sp) -/* B7A750 801035B0 00024080 */ sll $t0, $v0, 2 -/* B7A754 801035B4 00035880 */ sll $t3, $v1, 2 -/* B7A758 801035B8 46203320 */ cvt.s.d $f12, $f6 -/* B7A75C 801035BC 460C1402 */ mul.s $f16, $f2, $f12 -/* B7A760 801035C0 00000000 */ nop -/* B7A764 801035C4 460C4482 */ mul.s $f18, $f8, $f12 -/* B7A768 801035C8 00000000 */ nop -/* B7A76C 801035CC 460C5502 */ mul.s $f20, $f10, $f12 -/* B7A770 801035D0 00000000 */ nop -/* B7A774 801035D4 46188102 */ mul.s $f4, $f16, $f24 -/* B7A778 801035D8 00000000 */ nop -/* B7A77C 801035DC 461A9182 */ mul.s $f6, $f18, $f26 -/* B7A780 801035E0 46062200 */ add.s $f8, $f4, $f6 -/* B7A784 801035E4 461CA282 */ mul.s $f10, $f20, $f28 -/* B7A788 801035E8 44823000 */ mtc1 $v0, $f6 -/* B7A78C 801035EC 460A4100 */ add.s $f4, $f8, $f10 -/* B7A790 801035F0 46803220 */ cvt.s.w $f8, $f6 -/* B7A794 801035F4 44813000 */ mtc1 $at, $f6 -/* B7A798 801035F8 46082282 */ mul.s $f10, $f4, $f8 -/* B7A79C 801035FC 44884000 */ mtc1 $t0, $f8 -/* B7A7A0 80103600 46065102 */ mul.s $f4, $f10, $f6 -/* B7A7A4 80103604 468042A0 */ cvt.s.w $f10, $f8 -/* B7A7A8 80103608 46045180 */ add.s $f6, $f10, $f4 -/* B7A7AC 8010360C 4600320D */ trunc.w.s $f8, $f6 -/* B7A7B0 80103610 440A4000 */ mfc1 $t2, $f8 -/* B7A7B4 80103614 00000000 */ nop -/* B7A7B8 80103618 ACCA0000 */ sw $t2, ($a2) -/* B7A7BC 8010361C C7AA00B4 */ lwc1 $f10, 0xb4($sp) -/* B7A7C0 80103620 C7A600B8 */ lwc1 $f6, 0xb8($sp) -/* B7A7C4 80103624 460A8102 */ mul.s $f4, $f16, $f10 -/* B7A7C8 80103628 00000000 */ nop -/* B7A7CC 8010362C 46069202 */ mul.s $f8, $f18, $f6 -/* B7A7D0 80103630 C7A600BC */ lwc1 $f6, 0xbc($sp) -/* B7A7D4 80103634 46082280 */ add.s $f10, $f4, $f8 -/* B7A7D8 80103638 4606A102 */ mul.s $f4, $f20, $f6 -/* B7A7DC 8010363C 44833000 */ mtc1 $v1, $f6 -/* B7A7E0 80103640 46045200 */ add.s $f8, $f10, $f4 -/* B7A7E4 80103644 468032A0 */ cvt.s.w $f10, $f6 -/* B7A7E8 80103648 44813000 */ mtc1 $at, $f6 -/* B7A7EC 8010364C 460A4102 */ mul.s $f4, $f8, $f10 -/* B7A7F0 80103650 448B5000 */ mtc1 $t3, $f10 -/* B7A7F4 80103654 46062202 */ mul.s $f8, $f4, $f6 -/* B7A7F8 80103658 46805120 */ cvt.s.w $f4, $f10 -/* B7A7FC 8010365C 46082180 */ add.s $f6, $f4, $f8 -/* B7A800 80103660 4600328D */ trunc.w.s $f10, $f6 -/* B7A804 80103664 440D5000 */ mfc1 $t5, $f10 -/* B7A808 80103668 10000003 */ b .L80103678 -/* B7A80C 8010366C ACCD0004 */ sw $t5, 4($a2) -.L80103670: -/* B7A810 80103670 ACCE0000 */ sw $t6, ($a2) -/* B7A814 80103674 ACCF0004 */ sw $t7, 4($a2) -.L80103678: -/* B7A818 80103678 C7A400CC */ lwc1 $f4, 0xcc($sp) -/* B7A81C 8010367C C7A600D0 */ lwc1 $f6, 0xd0($sp) -/* B7A820 80103680 3C018015 */ lui $at, %hi(D_8014B278) -/* B7A824 80103684 46042202 */ mul.s $f8, $f4, $f4 -/* B7A828 80103688 E7A40040 */ swc1 $f4, 0x40($sp) -/* B7A82C 8010368C 00026040 */ sll $t4, $v0, 1 -/* B7A830 80103690 46063282 */ mul.s $f10, $f6, $f6 -/* B7A834 80103694 00036840 */ sll $t5, $v1, 1 -/* B7A838 80103698 460A4200 */ add.s $f8, $f8, $f10 -/* B7A83C 8010369C C7AA00D4 */ lwc1 $f10, 0xd4($sp) -/* B7A840 801036A0 460A5102 */ mul.s $f4, $f10, $f10 -/* B7A844 801036A4 46044000 */ add.s $f0, $f8, $f4 -/* B7A848 801036A8 46000004 */ sqrt.s $f0, $f0 -/* B7A84C 801036AC 46000221 */ cvt.d.s $f8, $f0 -/* B7A850 801036B0 4628B103 */ div.d $f4, $f22, $f8 -/* B7A854 801036B4 C7A80040 */ lwc1 $f8, 0x40($sp) -/* B7A858 801036B8 462020A0 */ cvt.s.d $f2, $f4 -/* B7A85C 801036BC 46024102 */ mul.s $f4, $f8, $f2 -/* B7A860 801036C0 00000000 */ nop -/* B7A864 801036C4 46023202 */ mul.s $f8, $f6, $f2 -/* B7A868 801036C8 00000000 */ nop -/* B7A86C 801036CC 46025182 */ mul.s $f6, $f10, $f2 -/* B7A870 801036D0 C7AA0088 */ lwc1 $f10, 0x88($sp) -/* B7A874 801036D4 E7A400CC */ swc1 $f4, 0xcc($sp) -/* B7A878 801036D8 E7A800D0 */ swc1 $f8, 0xd0($sp) -/* B7A87C 801036DC 460A2100 */ add.s $f4, $f4, $f10 -/* B7A880 801036E0 C7AA0084 */ lwc1 $f10, 0x84($sp) -/* B7A884 801036E4 E7A600D4 */ swc1 $f6, 0xd4($sp) -/* B7A888 801036E8 460A4200 */ add.s $f8, $f8, $f10 -/* B7A88C 801036EC C7AA0080 */ lwc1 $f10, 0x80($sp) -/* B7A890 801036F0 E7A40054 */ swc1 $f4, 0x54($sp) -/* B7A894 801036F4 460A3180 */ add.s $f6, $f6, $f10 -/* B7A898 801036F8 46042282 */ mul.s $f10, $f4, $f4 -/* B7A89C 801036FC E7A80050 */ swc1 $f8, 0x50($sp) -/* B7A8A0 80103700 E7A6004C */ swc1 $f6, 0x4c($sp) -/* B7A8A4 80103704 E7A60040 */ swc1 $f6, 0x40($sp) -/* B7A8A8 80103708 46084182 */ mul.s $f6, $f8, $f8 -/* B7A8AC 8010370C 46065280 */ add.s $f10, $f10, $f6 -/* B7A8B0 80103710 C7A60040 */ lwc1 $f6, 0x40($sp) -/* B7A8B4 80103714 E7A40040 */ swc1 $f4, 0x40($sp) -/* B7A8B8 80103718 46063102 */ mul.s $f4, $f6, $f6 -/* B7A8BC 8010371C 46045000 */ add.s $f0, $f10, $f4 -/* B7A8C0 80103720 D42AB278 */ ldc1 $f10, %lo(D_8014B278)($at) -/* B7A8C4 80103724 46000004 */ sqrt.s $f0, $f0 -/* B7A8C8 80103728 460003A1 */ cvt.d.s $f14, $f0 -/* B7A8CC 8010372C 462E503C */ c.lt.d $f10, $f14 -/* B7A8D0 80103730 00000000 */ nop -/* B7A8D4 80103734 45000035 */ bc1f .L8010380C -/* B7A8D8 80103738 00000000 */ nop -/* B7A8DC 8010373C 462EB103 */ div.d $f4, $f22, $f14 -/* B7A8E0 80103740 C7AA0040 */ lwc1 $f10, 0x40($sp) -/* B7A8E4 80103744 3C014000 */ li $at, 0x40000000 # 0.000000 -/* B7A8E8 80103748 44811000 */ mtc1 $at, $f2 -/* B7A8EC 8010374C 0002C080 */ sll $t8, $v0, 2 -/* B7A8F0 80103750 00034880 */ sll $t1, $v1, 2 -/* B7A8F4 80103754 46202320 */ cvt.s.d $f12, $f4 -/* B7A8F8 80103758 460C5402 */ mul.s $f16, $f10, $f12 -/* B7A8FC 8010375C 00000000 */ nop -/* B7A900 80103760 460C4482 */ mul.s $f18, $f8, $f12 -/* B7A904 80103764 00000000 */ nop -/* B7A908 80103768 460C3502 */ mul.s $f20, $f6, $f12 -/* B7A90C 8010376C 00000000 */ nop -/* B7A910 80103770 46188102 */ mul.s $f4, $f16, $f24 -/* B7A914 80103774 00000000 */ nop -/* B7A918 80103778 461A9282 */ mul.s $f10, $f18, $f26 -/* B7A91C 8010377C 460A2200 */ add.s $f8, $f4, $f10 -/* B7A920 80103780 461CA182 */ mul.s $f6, $f20, $f28 -/* B7A924 80103784 44825000 */ mtc1 $v0, $f10 -/* B7A928 80103788 46064100 */ add.s $f4, $f8, $f6 -/* B7A92C 8010378C 46805220 */ cvt.s.w $f8, $f10 -/* B7A930 80103790 46082182 */ mul.s $f6, $f4, $f8 -/* B7A934 80103794 44982000 */ mtc1 $t8, $f4 -/* B7A938 80103798 00000000 */ nop -/* B7A93C 8010379C 46802220 */ cvt.s.w $f8, $f4 -/* B7A940 801037A0 46023282 */ mul.s $f10, $f6, $f2 -/* B7A944 801037A4 460A4180 */ add.s $f6, $f8, $f10 -/* B7A948 801037A8 4600310D */ trunc.w.s $f4, $f6 -/* B7A94C 801037AC 44082000 */ mfc1 $t0, $f4 -/* B7A950 801037B0 00000000 */ nop -/* B7A954 801037B4 ACC80008 */ sw $t0, 8($a2) -/* B7A958 801037B8 C7A800B4 */ lwc1 $f8, 0xb4($sp) -/* B7A95C 801037BC C7A600B8 */ lwc1 $f6, 0xb8($sp) -/* B7A960 801037C0 46088282 */ mul.s $f10, $f16, $f8 -/* B7A964 801037C4 00000000 */ nop -/* B7A968 801037C8 46069102 */ mul.s $f4, $f18, $f6 -/* B7A96C 801037CC C7A600BC */ lwc1 $f6, 0xbc($sp) -/* B7A970 801037D0 46045200 */ add.s $f8, $f10, $f4 -/* B7A974 801037D4 4606A282 */ mul.s $f10, $f20, $f6 -/* B7A978 801037D8 44833000 */ mtc1 $v1, $f6 -/* B7A97C 801037DC 460A4100 */ add.s $f4, $f8, $f10 -/* B7A980 801037E0 46803220 */ cvt.s.w $f8, $f6 -/* B7A984 801037E4 46082282 */ mul.s $f10, $f4, $f8 -/* B7A988 801037E8 44892000 */ mtc1 $t1, $f4 -/* B7A98C 801037EC 00000000 */ nop -/* B7A990 801037F0 46802220 */ cvt.s.w $f8, $f4 -/* B7A994 801037F4 46025182 */ mul.s $f6, $f10, $f2 -/* B7A998 801037F8 46064280 */ add.s $f10, $f8, $f6 -/* B7A99C 801037FC 4600510D */ trunc.w.s $f4, $f10 -/* B7A9A0 80103800 440B2000 */ mfc1 $t3, $f4 -/* B7A9A4 80103804 10000003 */ b .L80103814 -/* B7A9A8 80103808 ACCB000C */ sw $t3, 0xc($a2) -.L8010380C: -/* B7A9AC 8010380C ACCC0008 */ sw $t4, 8($a2) -/* B7A9B0 80103810 ACCD000C */ sw $t5, 0xc($a2) -.L80103814: -/* B7A9B4 80103814 3C0142FE */ li $at, 0x42FE0000 # 0.000000 -/* B7A9B8 80103818 44811000 */ mtc1 $at, $f2 -/* B7A9BC 8010381C 3C014300 */ li $at, 0x43000000 # 0.000000 -/* B7A9C0 80103820 44817000 */ mtc1 $at, $f14 -/* B7A9C4 80103824 24020080 */ li $v0, 128 -/* B7A9C8 80103828 460EC302 */ mul.s $f12, $f24, $f14 -/* B7A9CC 8010382C 4602603C */ c.lt.s $f12, $f2 -/* B7A9D0 80103830 00000000 */ nop -/* B7A9D4 80103834 45020004 */ bc1fl .L80103848 -/* B7A9D8 80103838 46001006 */ mov.s $f0, $f2 -/* B7A9DC 8010383C 10000002 */ b .L80103848 -/* B7A9E0 80103840 46006006 */ mov.s $f0, $f12 -/* B7A9E4 80103844 46001006 */ mov.s $f0, $f2 -.L80103848: -/* B7A9E8 80103848 460ED302 */ mul.s $f12, $f26, $f14 -/* B7A9EC 8010384C 4600020D */ trunc.w.s $f8, $f0 -/* B7A9F0 80103850 4602603C */ c.lt.s $f12, $f2 -/* B7A9F4 80103854 44184000 */ mfc1 $t8, $f8 -/* B7A9F8 80103858 45000003 */ bc1f .L80103868 -/* B7A9FC 8010385C A0B80008 */ sb $t8, 8($a1) -/* B7AA00 80103860 10000002 */ b .L8010386C -/* B7AA04 80103864 46006006 */ mov.s $f0, $f12 -.L80103868: -/* B7AA08 80103868 46001006 */ mov.s $f0, $f2 -.L8010386C: -/* B7AA0C 8010386C 460EE302 */ mul.s $f12, $f28, $f14 -/* B7AA10 80103870 4600018D */ trunc.w.s $f6, $f0 -/* B7AA14 80103874 4602603C */ c.lt.s $f12, $f2 -/* B7AA18 80103878 44093000 */ mfc1 $t1, $f6 -/* B7AA1C 8010387C 45000003 */ bc1f .L8010388C -/* B7AA20 80103880 A0A90009 */ sb $t1, 9($a1) -/* B7AA24 80103884 10000002 */ b .L80103890 -/* B7AA28 80103888 46006006 */ mov.s $f0, $f12 -.L8010388C: -/* B7AA2C 8010388C 46001006 */ mov.s $f0, $f2 -.L80103890: -/* B7AA30 80103890 4600028D */ trunc.w.s $f10, $f0 -/* B7AA34 80103894 440C5000 */ mfc1 $t4, $f10 -/* B7AA38 80103898 00000000 */ nop -/* B7AA3C 8010389C A0AC000A */ sb $t4, 0xa($a1) -/* B7AA40 801038A0 C7A400B4 */ lwc1 $f4, 0xb4($sp) -/* B7AA44 801038A4 460E2302 */ mul.s $f12, $f4, $f14 -/* B7AA48 801038A8 4602603C */ c.lt.s $f12, $f2 -/* B7AA4C 801038AC 00000000 */ nop -/* B7AA50 801038B0 45020004 */ bc1fl .L801038C4 -/* B7AA54 801038B4 46001006 */ mov.s $f0, $f2 -/* B7AA58 801038B8 10000002 */ b .L801038C4 -/* B7AA5C 801038BC 46006006 */ mov.s $f0, $f12 -/* B7AA60 801038C0 46001006 */ mov.s $f0, $f2 -.L801038C4: -/* B7AA64 801038C4 4600020D */ trunc.w.s $f8, $f0 -/* B7AA68 801038C8 440F4000 */ mfc1 $t7, $f8 -/* B7AA6C 801038CC 00000000 */ nop -/* B7AA70 801038D0 A0AF0018 */ sb $t7, 0x18($a1) -/* B7AA74 801038D4 C7A600B8 */ lwc1 $f6, 0xb8($sp) -/* B7AA78 801038D8 460E3302 */ mul.s $f12, $f6, $f14 -/* B7AA7C 801038DC 4602603C */ c.lt.s $f12, $f2 -/* B7AA80 801038E0 00000000 */ nop -/* B7AA84 801038E4 45020004 */ bc1fl .L801038F8 -/* B7AA88 801038E8 46001006 */ mov.s $f0, $f2 -/* B7AA8C 801038EC 10000002 */ b .L801038F8 -/* B7AA90 801038F0 46006006 */ mov.s $f0, $f12 -/* B7AA94 801038F4 46001006 */ mov.s $f0, $f2 -.L801038F8: -/* B7AA98 801038F8 4600028D */ trunc.w.s $f10, $f0 -/* B7AA9C 801038FC 44085000 */ mfc1 $t0, $f10 -/* B7AAA0 80103900 00000000 */ nop -/* B7AAA4 80103904 A0A80019 */ sb $t0, 0x19($a1) -/* B7AAA8 80103908 C7A400BC */ lwc1 $f4, 0xbc($sp) -/* B7AAAC 8010390C 460E2302 */ mul.s $f12, $f4, $f14 -/* B7AAB0 80103910 4602603C */ c.lt.s $f12, $f2 -/* B7AAB4 80103914 00000000 */ nop -/* B7AAB8 80103918 45020004 */ bc1fl .L8010392C -/* B7AABC 8010391C 46001006 */ mov.s $f0, $f2 -/* B7AAC0 80103920 10000002 */ b .L8010392C -/* B7AAC4 80103924 46006006 */ mov.s $f0, $f12 -/* B7AAC8 80103928 46001006 */ mov.s $f0, $f2 -.L8010392C: -/* B7AACC 8010392C 4600020D */ trunc.w.s $f8, $f0 -/* B7AAD0 80103930 A0A00000 */ sb $zero, ($a1) -/* B7AAD4 80103934 A0A00001 */ sb $zero, 1($a1) -/* B7AAD8 80103938 A0A00002 */ sb $zero, 2($a1) -/* B7AADC 8010393C 440B4000 */ mfc1 $t3, $f8 -/* B7AAE0 80103940 A0A00003 */ sb $zero, 3($a1) -/* B7AAE4 80103944 A0A00004 */ sb $zero, 4($a1) -/* B7AAE8 80103948 A0A00005 */ sb $zero, 5($a1) -/* B7AAEC 8010394C A0A00006 */ sb $zero, 6($a1) -/* B7AAF0 80103950 A0A00007 */ sb $zero, 7($a1) -/* B7AAF4 80103954 A0A00010 */ sb $zero, 0x10($a1) -/* B7AAF8 80103958 A0A20011 */ sb $v0, 0x11($a1) -/* B7AAFC 8010395C A0A00012 */ sb $zero, 0x12($a1) -/* B7AB00 80103960 A0A00013 */ sb $zero, 0x13($a1) -/* B7AB04 80103964 A0A00014 */ sb $zero, 0x14($a1) -/* B7AB08 80103968 A0A20015 */ sb $v0, 0x15($a1) -/* B7AB0C 8010396C A0A00016 */ sb $zero, 0x16($a1) -/* B7AB10 80103970 A0A00017 */ sb $zero, 0x17($a1) -/* B7AB14 80103974 A0AB001A */ sb $t3, 0x1a($a1) -/* B7AB18 80103978 E4980000 */ swc1 $f24, ($a0) -/* B7AB1C 8010397C C7AE009C */ lwc1 $f14, 0x9c($sp) -/* B7AB20 80103980 C7A200A0 */ lwc1 $f2, 0xa0($sp) -/* B7AB24 80103984 C7AC00A4 */ lwc1 $f12, 0xa4($sp) -/* B7AB28 80103988 46187182 */ mul.s $f6, $f14, $f24 -/* B7AB2C 8010398C E49A0010 */ swc1 $f26, 0x10($a0) -/* B7AB30 80103990 E49C0020 */ swc1 $f28, 0x20($a0) -/* B7AB34 80103994 461A1282 */ mul.s $f10, $f2, $f26 -/* B7AB38 80103998 44800000 */ mtc1 $zero, $f0 -/* B7AB3C 8010399C 3C013F80 */ li $at, 0x3F800000 # 0.000000 -/* B7AB40 801039A0 461C6202 */ mul.s $f8, $f12, $f28 -/* B7AB44 801039A4 460A3100 */ add.s $f4, $f6, $f10 -/* B7AB48 801039A8 46082180 */ add.s $f6, $f4, $f8 -/* B7AB4C 801039AC 46003287 */ neg.s $f10, $f6 -/* B7AB50 801039B0 E48A0030 */ swc1 $f10, 0x30($a0) -/* B7AB54 801039B4 C7A400B4 */ lwc1 $f4, 0xb4($sp) -/* B7AB58 801039B8 E4840004 */ swc1 $f4, 4($a0) -/* B7AB5C 801039BC C7A800B8 */ lwc1 $f8, 0xb8($sp) -/* B7AB60 801039C0 E4880014 */ swc1 $f8, 0x14($a0) -/* B7AB64 801039C4 C7A600BC */ lwc1 $f6, 0xbc($sp) -/* B7AB68 801039C8 E4860024 */ swc1 $f6, 0x24($a0) -/* B7AB6C 801039CC C7AA00B4 */ lwc1 $f10, 0xb4($sp) -/* B7AB70 801039D0 C7A800B8 */ lwc1 $f8, 0xb8($sp) -/* B7AB74 801039D4 460A7102 */ mul.s $f4, $f14, $f10 -/* B7AB78 801039D8 00000000 */ nop -/* B7AB7C 801039DC 46081182 */ mul.s $f6, $f2, $f8 -/* B7AB80 801039E0 C7A800BC */ lwc1 $f8, 0xbc($sp) -/* B7AB84 801039E4 46062280 */ add.s $f10, $f4, $f6 -/* B7AB88 801039E8 46086102 */ mul.s $f4, $f12, $f8 -/* B7AB8C 801039EC 46045180 */ add.s $f6, $f10, $f4 -/* B7AB90 801039F0 46003207 */ neg.s $f8, $f6 -/* B7AB94 801039F4 E4880034 */ swc1 $f8, 0x34($a0) -/* B7AB98 801039F8 C7AA0088 */ lwc1 $f10, 0x88($sp) -/* B7AB9C 801039FC E48A0008 */ swc1 $f10, 8($a0) -/* B7ABA0 80103A00 C7A40084 */ lwc1 $f4, 0x84($sp) -/* B7ABA4 80103A04 E4840018 */ swc1 $f4, 0x18($a0) -/* B7ABA8 80103A08 C7A60080 */ lwc1 $f6, 0x80($sp) -/* B7ABAC 80103A0C E4860028 */ swc1 $f6, 0x28($a0) -/* B7ABB0 80103A10 C7A80088 */ lwc1 $f8, 0x88($sp) -/* B7ABB4 80103A14 C7A40084 */ lwc1 $f4, 0x84($sp) -/* B7ABB8 80103A18 46087282 */ mul.s $f10, $f14, $f8 -/* B7ABBC 80103A1C 00000000 */ nop -/* B7ABC0 80103A20 46041182 */ mul.s $f6, $f2, $f4 -/* B7ABC4 80103A24 C7A40080 */ lwc1 $f4, 0x80($sp) -/* B7ABC8 80103A28 E480000C */ swc1 $f0, 0xc($a0) -/* B7ABCC 80103A2C E480001C */ swc1 $f0, 0x1c($a0) -/* B7ABD0 80103A30 E480002C */ swc1 $f0, 0x2c($a0) -/* B7ABD4 80103A34 46065200 */ add.s $f8, $f10, $f6 -/* B7ABD8 80103A38 46046282 */ mul.s $f10, $f12, $f4 -/* B7ABDC 80103A3C 460A4180 */ add.s $f6, $f8, $f10 -/* B7ABE0 80103A40 44814000 */ mtc1 $at, $f8 -/* B7ABE4 80103A44 46003107 */ neg.s $f4, $f6 -/* B7ABE8 80103A48 E488003C */ swc1 $f8, 0x3c($a0) -/* B7ABEC 80103A4C E4840038 */ swc1 $f4, 0x38($a0) -/* B7ABF0 80103A50 8FBF003C */ lw $ra, 0x3c($sp) -/* B7ABF4 80103A54 D7BC0030 */ ldc1 $f28, 0x30($sp) -/* B7ABF8 80103A58 D7BA0028 */ ldc1 $f26, 0x28($sp) -/* B7ABFC 80103A5C D7B80020 */ ldc1 $f24, 0x20($sp) -/* B7AC00 80103A60 D7B60018 */ ldc1 $f22, 0x18($sp) -/* B7AC04 80103A64 D7B40010 */ ldc1 $f20, 0x10($sp) -/* B7AC08 80103A68 03E00008 */ jr $ra -/* B7AC0C 80103A6C 27BD0090 */ addiu $sp, $sp, 0x90 - diff --git a/asm/non_matchings/code/code_801031F0/func_80103A70.s b/asm/non_matchings/code/code_801031F0/func_80103A70.s deleted file mode 100644 index 1fc57f39f0..0000000000 --- a/asm/non_matchings/code/code_801031F0/func_80103A70.s +++ /dev/null @@ -1,47 +0,0 @@ -glabel func_80103A70 -/* B7AC10 80103A70 27BDFF68 */ addiu $sp, $sp, -0x98 -/* B7AC14 80103A74 C7A400A8 */ lwc1 $f4, 0xa8($sp) -/* B7AC18 80103A78 C7A600AC */ lwc1 $f6, 0xac($sp) -/* B7AC1C 80103A7C C7A800B0 */ lwc1 $f8, 0xb0($sp) -/* B7AC20 80103A80 E7A40010 */ swc1 $f4, 0x10($sp) -/* B7AC24 80103A84 E7A60014 */ swc1 $f6, 0x14($sp) -/* B7AC28 80103A88 C7A600C4 */ lwc1 $f6, 0xc4($sp) -/* B7AC2C 80103A8C C7A400C0 */ lwc1 $f4, 0xc0($sp) -/* B7AC30 80103A90 C7AA00B4 */ lwc1 $f10, 0xb4($sp) -/* B7AC34 80103A94 C7B000B8 */ lwc1 $f16, 0xb8($sp) -/* B7AC38 80103A98 C7B200BC */ lwc1 $f18, 0xbc($sp) -/* B7AC3C 80103A9C 44876000 */ mtc1 $a3, $f12 -/* B7AC40 80103AA0 E7A80018 */ swc1 $f8, 0x18($sp) -/* B7AC44 80103AA4 E7A6002C */ swc1 $f6, 0x2c($sp) -/* B7AC48 80103AA8 E7A40028 */ swc1 $f4, 0x28($sp) -/* B7AC4C 80103AAC E7AA001C */ swc1 $f10, 0x1c($sp) -/* B7AC50 80103AB0 E7B00020 */ swc1 $f16, 0x20($sp) -/* B7AC54 80103AB4 E7B20024 */ swc1 $f18, 0x24($sp) -/* B7AC58 80103AB8 C7B200D4 */ lwc1 $f18, 0xd4($sp) -/* B7AC5C 80103ABC C7B000D0 */ lwc1 $f16, 0xd0($sp) -/* B7AC60 80103AC0 C7AA00CC */ lwc1 $f10, 0xcc($sp) -/* B7AC64 80103AC4 C7A400D8 */ lwc1 $f4, 0xd8($sp) -/* B7AC68 80103AC8 C7A600DC */ lwc1 $f6, 0xdc($sp) -/* B7AC6C 80103ACC C7A800C8 */ lwc1 $f8, 0xc8($sp) -/* B7AC70 80103AD0 8FAE00E0 */ lw $t6, 0xe0($sp) -/* B7AC74 80103AD4 8FAF00E4 */ lw $t7, 0xe4($sp) -/* B7AC78 80103AD8 AFBF0054 */ sw $ra, 0x54($sp) -/* B7AC7C 80103ADC AFA40098 */ sw $a0, 0x98($sp) -/* B7AC80 80103AE0 44076000 */ mfc1 $a3, $f12 -/* B7AC84 80103AE4 27A40058 */ addiu $a0, $sp, 0x58 -/* B7AC88 80103AE8 E7B2003C */ swc1 $f18, 0x3c($sp) -/* B7AC8C 80103AEC E7B00038 */ swc1 $f16, 0x38($sp) -/* B7AC90 80103AF0 E7AA0034 */ swc1 $f10, 0x34($sp) -/* B7AC94 80103AF4 E7A40040 */ swc1 $f4, 0x40($sp) -/* B7AC98 80103AF8 E7A60044 */ swc1 $f6, 0x44($sp) -/* B7AC9C 80103AFC E7A80030 */ swc1 $f8, 0x30($sp) -/* B7ACA0 80103B00 AFAE0048 */ sw $t6, 0x48($sp) -/* B7ACA4 80103B04 0C040CAC */ jal func_801032B0 -/* B7ACA8 80103B08 AFAF004C */ sw $t7, 0x4c($sp) -/* B7ACAC 80103B0C 27A40058 */ addiu $a0, $sp, 0x58 -/* B7ACB0 80103B10 0C041938 */ jal func_801064E0 -/* B7ACB4 80103B14 8FA50098 */ lw $a1, 0x98($sp) -/* B7ACB8 80103B18 8FBF0054 */ lw $ra, 0x54($sp) -/* B7ACBC 80103B1C 27BD0098 */ addiu $sp, $sp, 0x98 -/* B7ACC0 80103B20 03E00008 */ jr $ra -/* B7ACC4 80103B24 00000000 */ nop diff --git a/asm/non_matchings/code/guLookAtRef/guLookAtReflect.s b/asm/non_matchings/code/guLookAtRef/guLookAtReflect.s new file mode 100644 index 0000000000..9f35fab6d0 --- /dev/null +++ b/asm/non_matchings/code/guLookAtRef/guLookAtReflect.s @@ -0,0 +1,30 @@ +glabel guLookAtReflect +/* B78FD4 80101E34 27BDFF90 */ addiu $sp, $sp, -0x70 +/* B78FD8 80101E38 44856000 */ mtc1 $a1, $f12 +/* B78FDC 80101E3C 44867000 */ mtc1 $a2, $f14 +/* B78FE0 80101E40 C7A40080 */ lwc1 $f4, 0x80($sp) +/* B78FE4 80101E44 C7A60084 */ lwc1 $f6, 0x84($sp) +/* B78FE8 80101E48 C7A80088 */ lwc1 $f8, 0x88($sp) +/* B78FEC 80101E4C C7AA008C */ lwc1 $f10, 0x8c($sp) +/* B78FF0 80101E50 C7B00090 */ lwc1 $f16, 0x90($sp) +/* B78FF4 80101E54 C7B20094 */ lwc1 $f18, 0x94($sp) +/* B78FF8 80101E58 AFBF002C */ sw $ra, 0x2c($sp) +/* B78FFC 80101E5C AFA40070 */ sw $a0, 0x70($sp) +/* B79000 80101E60 44056000 */ mfc1 $a1, $f12 +/* B79004 80101E64 44067000 */ mfc1 $a2, $f14 +/* B79008 80101E68 AFA7007C */ sw $a3, 0x7c($sp) +/* B7900C 80101E6C 27A40030 */ addiu $a0, $sp, 0x30 +/* B79010 80101E70 E7A40010 */ swc1 $f4, 0x10($sp) +/* B79014 80101E74 E7A60014 */ swc1 $f6, 0x14($sp) +/* B79018 80101E78 E7A80018 */ swc1 $f8, 0x18($sp) +/* B7901C 80101E7C E7AA001C */ swc1 $f10, 0x1c($sp) +/* B79020 80101E80 E7B00020 */ swc1 $f16, 0x20($sp) +/* B79024 80101E84 0C0406E4 */ jal guLookAtReflectF +/* B79028 80101E88 E7B20024 */ swc1 $f18, 0x24($sp) +/* B7902C 80101E8C 27A40030 */ addiu $a0, $sp, 0x30 +/* B79030 80101E90 0C041938 */ jal func_801064E0 +/* B79034 80101E94 8FA50070 */ lw $a1, 0x70($sp) +/* B79038 80101E98 8FBF002C */ lw $ra, 0x2c($sp) +/* B7903C 80101E9C 27BD0070 */ addiu $sp, $sp, 0x70 +/* B79040 80101EA0 03E00008 */ jr $ra +/* B79044 80101EA4 00000000 */ nop diff --git a/asm/code_80101B90.s b/asm/non_matchings/code/guLookAtRef/guLookAtReflectF.s similarity index 82% rename from asm/code_80101B90.s rename to asm/non_matchings/code/guLookAtRef/guLookAtReflectF.s index 287983aaa7..a18e0650e4 100644 --- a/asm/code_80101B90.s +++ b/asm/non_matchings/code/guLookAtRef/guLookAtReflectF.s @@ -1,15 +1,4 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .text - -.align 4 - -glabel func_80101B90 +glabel guLookAtReflectF /* B78D30 80101B90 27BDFF88 */ addiu $sp, $sp, -0x78 /* B78D34 80101B94 AFBF0044 */ sw $ra, 0x44($sp) /* B78D38 80101B98 F7BE0038 */ sdc1 $f30, 0x38($sp) @@ -21,7 +10,7 @@ glabel func_80101B90 /* B78D50 80101BB0 AFA5007C */ sw $a1, 0x7c($sp) /* B78D54 80101BB4 AFA60080 */ sw $a2, 0x80($sp) /* B78D58 80101BB8 AFA70084 */ sw $a3, 0x84($sp) -/* B78D5C 80101BBC 0C0406D0 */ jal func_80101B40 +/* B78D5C 80101BBC 0C0406D0 */ jal guMtxIdentF /* B78D60 80101BC0 AFA40078 */ sw $a0, 0x78($sp) /* B78D64 80101BC4 C7A40088 */ lwc1 $f4, 0x88($sp) /* B78D68 80101BC8 C7A6007C */ lwc1 $f6, 0x7c($sp) @@ -180,33 +169,3 @@ glabel func_80101B90 /* B78FCC 80101E2C 03E00008 */ jr $ra /* B78FD0 80101E30 27BD0078 */ addiu $sp, $sp, 0x78 -glabel func_80101E34 -/* B78FD4 80101E34 27BDFF90 */ addiu $sp, $sp, -0x70 -/* B78FD8 80101E38 44856000 */ mtc1 $a1, $f12 -/* B78FDC 80101E3C 44867000 */ mtc1 $a2, $f14 -/* B78FE0 80101E40 C7A40080 */ lwc1 $f4, 0x80($sp) -/* B78FE4 80101E44 C7A60084 */ lwc1 $f6, 0x84($sp) -/* B78FE8 80101E48 C7A80088 */ lwc1 $f8, 0x88($sp) -/* B78FEC 80101E4C C7AA008C */ lwc1 $f10, 0x8c($sp) -/* B78FF0 80101E50 C7B00090 */ lwc1 $f16, 0x90($sp) -/* B78FF4 80101E54 C7B20094 */ lwc1 $f18, 0x94($sp) -/* B78FF8 80101E58 AFBF002C */ sw $ra, 0x2c($sp) -/* B78FFC 80101E5C AFA40070 */ sw $a0, 0x70($sp) -/* B79000 80101E60 44056000 */ mfc1 $a1, $f12 -/* B79004 80101E64 44067000 */ mfc1 $a2, $f14 -/* B79008 80101E68 AFA7007C */ sw $a3, 0x7c($sp) -/* B7900C 80101E6C 27A40030 */ addiu $a0, $sp, 0x30 -/* B79010 80101E70 E7A40010 */ swc1 $f4, 0x10($sp) -/* B79014 80101E74 E7A60014 */ swc1 $f6, 0x14($sp) -/* B79018 80101E78 E7A80018 */ swc1 $f8, 0x18($sp) -/* B7901C 80101E7C E7AA001C */ swc1 $f10, 0x1c($sp) -/* B79020 80101E80 E7B00020 */ swc1 $f16, 0x20($sp) -/* B79024 80101E84 0C0406E4 */ jal func_80101B90 -/* B79028 80101E88 E7B20024 */ swc1 $f18, 0x24($sp) -/* B7902C 80101E8C 27A40030 */ addiu $a0, $sp, 0x30 -/* B79030 80101E90 0C041938 */ jal func_801064E0 -/* B79034 80101E94 8FA50070 */ lw $a1, 0x70($sp) -/* B79038 80101E98 8FBF002C */ lw $ra, 0x2c($sp) -/* B7903C 80101E9C 27BD0070 */ addiu $sp, $sp, 0x70 -/* B79040 80101EA0 03E00008 */ jr $ra -/* B79044 80101EA4 00000000 */ nop diff --git a/asm/non_matchings/code/z_player_lib/func_80091A24.s b/asm/non_matchings/code/z_player_lib/func_80091A24.s index e7501dc6ef..e83abfce6f 100644 --- a/asm/non_matchings/code/z_player_lib/func_80091A24.s +++ b/asm/non_matchings/code/z_player_lib/func_80091A24.s @@ -312,7 +312,7 @@ glabel func_80091A24 /* B09074 80091ED4 E7A00024 */ swc1 $f0, 0x24($sp) /* B09078 80091ED8 E7A0001C */ swc1 $f0, 0x1c($sp) /* B0907C 80091EDC E7A60020 */ swc1 $f6, 0x20($sp) -/* B09080 80091EE0 0C04078D */ jal func_80101E34 +/* B09080 80091EE0 0C04078D */ jal guLookAtReflect /* B09084 80091EE4 E7A40018 */ swc1 $f4, 0x18($sp) /* B09088 80091EE8 8FA30114 */ lw $v1, 0x114($sp) /* B0908C 80091EEC 3C0FDA38 */ lui $t7, (0xDA380005 >> 16) # lui $t7, 0xda38 diff --git a/asm/non_matchings/code/z_view/func_800AB9EC.s b/asm/non_matchings/code/z_view/func_800AB9EC.s index e381a718fe..496060181d 100644 --- a/asm/non_matchings/code/z_view/func_800AB9EC.s +++ b/asm/non_matchings/code/z_view/func_800AB9EC.s @@ -296,7 +296,7 @@ glabel func_800AB9EC /* B22F88 800ABDE8 C60A0044 */ lwc1 $f10, 0x44($s0) /* B22F8C 800ABDEC E7AA0020 */ swc1 $f10, 0x20($sp) /* B22F90 800ABDF0 C6120048 */ lwc1 $f18, 0x48($s0) -/* B22F94 800ABDF4 0C04078D */ jal func_80101E34 +/* B22F94 800ABDF4 0C04078D */ jal guLookAtReflect /* B22F98 800ABDF8 E7B20024 */ swc1 $f18, 0x24($sp) /* B22F9C 800ABDFC 0240C025 */ move $t8, $s2 /* B22FA0 800ABE00 02007025 */ move $t6, $s0 diff --git a/asm/osViSetEvent.s b/asm/osViSetEvent.s deleted file mode 100644 index 696c23bdfe..0000000000 --- a/asm/osViSetEvent.s +++ /dev/null @@ -1,35 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .text - -.align 4 - -glabel osViSetEvent -/* B7B950 801047B0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* B7B954 801047B4 AFBF0014 */ sw $ra, 0x14($sp) -/* B7B958 801047B8 AFA40018 */ sw $a0, 0x18($sp) -/* B7B95C 801047BC AFA5001C */ sw $a1, 0x1c($sp) -/* B7B960 801047C0 0C001CA0 */ jal __osDisableInt -/* B7B964 801047C4 AFA60020 */ sw $a2, 0x20($sp) -/* B7B968 801047C8 3C038001 */ lui $v1, %hi(__osViNext) # $v1, 0x8001 -/* B7B96C 801047CC 2463AF04 */ addiu $v1, %lo(__osViNext) # addiu $v1, $v1, -0x50fc -/* B7B970 801047D0 8C6F0000 */ lw $t7, ($v1) -/* B7B974 801047D4 8FAE0018 */ lw $t6, 0x18($sp) -/* B7B978 801047D8 00402025 */ move $a0, $v0 -/* B7B97C 801047DC ADEE0010 */ sw $t6, 0x10($t7) -/* B7B980 801047E0 8C790000 */ lw $t9, ($v1) -/* B7B984 801047E4 8FB8001C */ lw $t8, 0x1c($sp) -/* B7B988 801047E8 AF380014 */ sw $t8, 0x14($t9) -/* B7B98C 801047EC 8C690000 */ lw $t1, ($v1) -/* B7B990 801047F0 8FA80020 */ lw $t0, 0x20($sp) -/* B7B994 801047F4 0C001CBC */ jal __osRestoreInt -/* B7B998 801047F8 A5280002 */ sh $t0, 2($t1) -/* B7B99C 801047FC 8FBF0014 */ lw $ra, 0x14($sp) -/* B7B9A0 80104800 27BD0018 */ addiu $sp, $sp, 0x18 -/* B7B9A4 80104804 03E00008 */ jr $ra -/* B7B9A8 80104808 00000000 */ nop diff --git a/data/code_80103BB0.data.s b/data/code_80103BB0.data.s deleted file mode 100644 index d42c19feba..0000000000 --- a/data/code_80103BB0.data.s +++ /dev/null @@ -1,11 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .data - -glabel D_80134D00 - .incbin "baserom.z64", 0xBABEA0, 0x10 diff --git a/include/functions.h b/include/functions.h index 05b35af5cb..ecf95607cf 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2335,9 +2335,9 @@ s16 sins(u16); // ? func_80101910(?); // ? func_801019E0(?); // ? func_80101AA4(?); -// ? func_80101B40(?); -// ? func_80101B90(?); -void func_80101E34(Mtx*, f32, f32, f32, f32, f32, f32, f32, f32, f32); +// ? guMtxIdentF(?); +// ? guLookAtReflectF(?); +void guLookAtReflect(Mtx*, f32, f32, f32, f32, f32, f32, f32, f32, f32); // ? func_80101EB0(?); // ? func_801021E4(?); // ? osStopTimer(?); @@ -2350,16 +2350,15 @@ void func_80101E34(Mtx*, f32, f32, f32, f32, f32, f32, f32, f32, f32); // ? func_80102CC4(?); // ? func_80102FA0(?); // ? func_80103010(?); -// ? func_801031F0(?); +// ? osAfterPreNMI(?); // ? osContStartQuery(?); -// ? func_8010328C(?); -// ? func_801032B0(?); -void func_80103A70(UNK_PTR, Gfx*, Hilite*, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, - s32, s32); +void osContGetQuery(OSContStatus* data); +// ? guLookAtHiliteF(?); +void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 hiliteWidth, s32 hiliteHeight); // ? __osSpDeviceBusy(?); // ? func_80103B60(?); -// ? func_80103BB0(?); -void func_80103D58(Mtx*, f32, f32, f32, f32, f32, f32, f32); +// ? guPositionF(?); +void guPosition(Mtx*, f32, f32, f32, f32, f32, f32, f32); // ? func_80103DC0(?); // ? func_80103E20(?); // ? func_80103FA4(?); diff --git a/spec b/spec index bd459d5fd5..ef7e3baeb5 100644 --- a/spec +++ b/spec @@ -515,8 +515,8 @@ beginseg include "build/data/code_801014A0.bss.o" include "build/asm/code_80101910.o" include "build/data/code_80101910.bss.o" - include "build/asm/code_80101B40.o" - include "build/asm/code_80101B90.o" + include "build/asm/guMtxIdentF.o" + include "build/src/libultra_code/guLookAtRef.o" include "build/asm/code_80101EB0.o" include "build/asm/code_80102330.o" include "build/asm/code_80102420.o" @@ -525,10 +525,10 @@ beginseg include "build/asm/code_80103010.o" include "build/src/libultra_code/sqrtf.o" include "build/src/libultra_code/code_801031F0.o" + include "build/src/libultra_code/guLookAtHilite.o" include "build/src/libultra_code/sp.o" include "build/asm/code_80103B60.o" - include "build/asm/code_80103BB0.o" - include "build/data/code_80103BB0.data.o" + include "build/src/libultra_code/guPosition.o" include "build/asm/code_80103DC0.o" include "build/data/code_80103DC0.data.o" include "build/src/libultra_code/__osGetActiveQueue.o" @@ -539,7 +539,7 @@ beginseg include "build/asm/code_80104450.o" include "build/src/libultra_code/cosf.o" include "build/src/libultra_code/coss.o" - include "build/asm/osViSetEvent.o" + include "build/src/libultra_code/osViSetEvent.o" include "build/asm/code_80104810.o" include "build/asm/code_80104B00.o" include "build/asm/code_80104C80.o" diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index 35be0e3535..d0124a2036 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -142,7 +142,7 @@ void IrqMgr_HandlePRENMI450(IrqMgr* this) { void IrqMgr_HandlePRENMI480(IrqMgr* this) { u32 ret; osSetTimer(&this->timer, OS_USEC_TO_CYCLES(20000), 0ull, &this->queue, (OSMesg)PRENMI500_MSG); - ret = func_801031F0(); // osAfterPreNMI + ret = osAfterPreNMI(); if (ret) { osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); // osAfterPreNMI returned %d !? osSetTimer(&this->timer, OS_USEC_TO_CYCLES(1000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG); diff --git a/src/code/padmgr.c b/src/code/padmgr.c index 1f9daad36a..745c058e42 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -300,7 +300,7 @@ void PadMgr_HandleRetraceMsg(PadMgr* padmgr) { PadMgr_ProcessInputs(padmgr); osContStartQuery(queue); osRecvMesg(queue, NULL, OS_MESG_BLOCK); - func_8010328C(padmgr); + osContGetQuery(padmgr); PadMgr_UnlockSerialMesgQueue(padmgr, queue); mask = 0; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 89b7e3e526..149959ac5b 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1320,8 +1320,9 @@ Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* } func_800ABE74(correctedEyeX, eye->y, eye->z); - func_80103A70(&D_8015BBA8, lookAt, *hilite, correctedEyeX, eye->y, eye->z, object->x, object->y, object->z, 0.0f, - 1.0f, 0.0f, lightDir->x, lightDir->y, lightDir->z, lightDir->x, lightDir->y, lightDir->z, 0x10, 0x10); + guLookAtHilite(&D_8015BBA8, lookAt, *hilite, correctedEyeX, eye->y, eye->z, object->x, object->y, object->z, 0.0f, + 1.0f, 0.0f, lightDir->x, lightDir->y, lightDir->z, lightDir->x, lightDir->y, lightDir->z, 0x10, + 0x10); gSPLookAt(gfx++, lookAt); gDPSetHilite1Tile(gfx++, 1, *hilite, 0x10, 0x10); diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 73d502a06e..0f6f01e201 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -26,7 +26,7 @@ void Sample_Draw(SampleContext* this) { if (1) { Mtx* mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); - func_80103D58(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42)); + guPosition(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42)); gSPMatrix(gfxCtx->polyOpa.p++, mtx, G_MTX_LOAD); } diff --git a/src/code/z_view.c b/src/code/z_view.c index 12a92eb330..613f665291 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -351,8 +351,8 @@ s32 func_800AAA9C(View* view) { } func_800ABE74(view->eye.x, view->eye.y, view->eye.z); - func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, - view->unk_40.x, view->unk_40.y, view->unk_40.z); + guLookAtReflect(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, + view->unk_40.x, view->unk_40.y, view->unk_40.z); view->viewing = *viewing; @@ -500,8 +500,8 @@ s32 func_800AB560(View* view) { } func_800ABE74(view->eye.x, view->eye.y, view->eye.z); - func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, - view->unk_40.x, view->unk_40.y, view->unk_40.z); + guLookAtReflect(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, + view->unk_40.x, view->unk_40.y, view->unk_40.z); view->viewing = *viewing; @@ -518,8 +518,8 @@ s32 func_800AB944(View* view) { Graph_OpenDisps(dispRefs, view->gfxCtx, "../z_view.c", 878); func_800ABE74(view->eye.x, view->eye.y, view->eye.z); - func_80101E34(view->viewingPtr, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, - view->unk_34.z, view->unk_40.x, view->unk_40.y, view->unk_40.z); + guLookAtReflect(view->viewingPtr, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, + view->unk_34.z, view->unk_40.x, view->unk_40.y, view->unk_40.z); Graph_CloseDisps(dispRefs, view->gfxCtx, "../z_view.c", 886); @@ -582,8 +582,8 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) { view->viewingPtr = viewing; func_800ABE74(view->eye.x, view->eye.y, view->eye.z); - func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, - view->unk_40.x, view->unk_40.y, view->unk_40.z); + guLookAtReflect(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, + view->unk_40.x, view->unk_40.y, view->unk_40.z); view->viewing = *viewing; diff --git a/src/libultra_code/code_801031F0.c b/src/libultra_code/code_801031F0.c index 543256a82e..3a5ba4f181 100644 --- a/src/libultra_code/code_801031F0.c +++ b/src/libultra_code/code_801031F0.c @@ -1,8 +1,15 @@ #include "libultra_internal.h" #include -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801031F0/func_801031F0.s") +s32 osAfterPreNMI(void) { + return __osSpSetPc(0); +} +/** + * osContStartQuery: + * Starts to read the values for SI device status and type which are connected to the controller port and joyport + * connector. + **/ s32 osContStartQuery(OSMesgQueue* mq) { s32 ret; ret = 0; @@ -19,8 +26,11 @@ s32 osContStartQuery(OSMesgQueue* mq) { return ret; } -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801031F0/func_8010328C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801031F0/func_801032B0.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801031F0/func_80103A70.s") +/** + * osContGetQuery: + * Returns the values from osContStartQuery to status. Both functions must be paired for use. + **/ +void osContGetQuery(OSContStatus* data) { + u8 pattern; + __osContGetInitData(&pattern, data); +} diff --git a/src/libultra_code/guLookAtHilite.c b/src/libultra_code/guLookAtHilite.c new file mode 100644 index 0000000000..a15dd7b54e --- /dev/null +++ b/src/libultra_code/guLookAtHilite.c @@ -0,0 +1,153 @@ +#include "libultra_internal.h" +#include + +#define FTOFRAC8(x) ((s32)MIN(((x) * (128.0f)), 127.0f) & 0xff) + +/** + * guLookAtHiliteF + * This function creates the viewing matrix (floating point) and sets the LookAt/Hilite structures + **/ +void guLookAtHiliteF(f32 mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, + f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, /* light 1 direction */ + f32 xl2, f32 yl2, f32 zl2, /* light 2 direction */ + s32 hiliteWidth, s32 hiliteHeight) /* size of hilite texture */ +{ + f32 length, xLook, yLook, zLook, xRight, yRight, zRight, xHilite, yHilite, zHilite; + + guMtxIdentF(mf); + + xLook = xAt - xEye; + yLook = yAt - yEye; + zLook = zAt - zEye; + length = -1.0 / sqrtf(xLook * xLook + yLook * yLook + zLook * zLook); + xLook *= length; + yLook *= length; + zLook *= length; + + xRight = yUp * zLook - zUp * yLook; + yRight = zUp * xLook - xUp * zLook; + zRight = xUp * yLook - yUp * xLook; + length = 1.0 / sqrtf(xRight * xRight + yRight * yRight + zRight * zRight); + xRight *= length; + yRight *= length; + zRight *= length; + + xUp = yLook * zRight - zLook * yRight; + yUp = zLook * xRight - xLook * zRight; + zUp = xLook * yRight - yLook * xRight; + length = 1.0 / sqrtf(xUp * xUp + yUp * yUp + zUp * zUp); + xUp *= length; + yUp *= length; + zUp *= length; + + /* hilite vectors */ + + length = 1.0 / sqrtf(xl1 * xl1 + yl1 * yl1 + zl1 * zl1); + xl1 *= length; + yl1 *= length; + zl1 *= length; + + xHilite = xl1 + xLook; + yHilite = yl1 + yLook; + zHilite = zl1 + zLook; + + length = sqrtf(xHilite * xHilite + yHilite * yHilite + zHilite * zHilite); + + if (length > 0.1) { + length = 1.0 / length; + xHilite *= length; + yHilite *= length; + zHilite *= length; + + h->h.x1 = hiliteWidth * 4 + (xHilite * xRight + yHilite * yRight + zHilite * zRight) * hiliteWidth * 2; + + h->h.y1 = hiliteHeight * 4 + (xHilite * xUp + yHilite * yUp + zHilite * zUp) * hiliteHeight * 2; + } else { + h->h.x1 = hiliteWidth * 2; + h->h.y1 = hiliteHeight * 2; + } + + length = 1.0 / sqrtf(xl2 * xl2 + yl2 * yl2 + zl2 * zl2); + xl2 *= length; + yl2 *= length; + zl2 *= length; + + xHilite = xl2 + xLook; + yHilite = yl2 + yLook; + zHilite = zl2 + zLook; + length = sqrtf(xHilite * xHilite + yHilite * yHilite + zHilite * zHilite); + if (length > 0.1) { + length = 1.0 / length; + xHilite *= length; + yHilite *= length; + zHilite *= length; + + h->h.x2 = hiliteWidth * 4 + (xHilite * xRight + yHilite * yRight + zHilite * zRight) * hiliteWidth * 2; + + h->h.y2 = hiliteHeight * 4 + (xHilite * xUp + yHilite * yUp + zHilite * zUp) * hiliteHeight * 2; + } else { + h->h.x2 = hiliteWidth * 2; + h->h.y2 = hiliteHeight * 2; + } + + /* reflectance vectors = Up and Right */ + + l->l[0].l.dir[0] = FTOFRAC8(xRight); + l->l[0].l.dir[1] = FTOFRAC8(yRight); + l->l[0].l.dir[2] = FTOFRAC8(zRight); + l->l[1].l.dir[0] = FTOFRAC8(xUp); + l->l[1].l.dir[1] = FTOFRAC8(yUp); + l->l[1].l.dir[2] = FTOFRAC8(zUp); + l->l[0].l.col[0] = 0x00; + l->l[0].l.col[1] = 0x00; + l->l[0].l.col[2] = 0x00; + l->l[0].l.pad1 = 0x00; + l->l[0].l.colc[0] = 0x00; + l->l[0].l.colc[1] = 0x00; + l->l[0].l.colc[2] = 0x00; + l->l[0].l.pad2 = 0x00; + l->l[1].l.col[0] = 0x00; + l->l[1].l.col[1] = 0x80; + l->l[1].l.col[2] = 0x00; + l->l[1].l.pad1 = 0x00; + l->l[1].l.colc[0] = 0x00; + l->l[1].l.colc[1] = 0x80; + l->l[1].l.colc[2] = 0x00; + l->l[1].l.pad2 = 0x00; + + mf[0][0] = xRight; + mf[1][0] = yRight; + mf[2][0] = zRight; + mf[3][0] = -(xEye * xRight + yEye * yRight + zEye * zRight); + + mf[0][1] = xUp; + mf[1][1] = yUp; + mf[2][1] = zUp; + mf[3][1] = -(xEye * xUp + yEye * yUp + zEye * zUp); + + mf[0][2] = xLook; + mf[1][2] = yLook; + mf[2][2] = zLook; + mf[3][2] = -(xEye * xLook + yEye * yLook + zEye * zLook); + + mf[0][3] = 0; + mf[1][3] = 0; + mf[2][3] = 0; + mf[3][3] = 1; +} + +/** + * guLookAtHilite + * This function creates the viewing matrix (fixed point) and sets the LookAt/Hilite structures + * Same args as previous function + **/ +void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, + f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 hiliteWidth, + s32 hiliteHeight) { + f32 mf[4][4]; + + guLookAtHiliteF(mf, l, h, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp, xl1, yl1, zl1, xl2, yl2, zl2, hiliteWidth, + hiliteHeight); + + guMtxF2L(mf, m); +} diff --git a/src/libultra_code/guLookAtRef.c b/src/libultra_code/guLookAtRef.c new file mode 100644 index 0000000000..d1239c159c --- /dev/null +++ b/src/libultra_code/guLookAtRef.c @@ -0,0 +1,6 @@ +#include +#include + +#pragma GLOBAL_ASM("asm/non_matchings/code/guLookAtRef/guLookAtReflectF.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/guLookAtRef/guLookAtReflect.s") diff --git a/src/libultra_code/guPosition.c b/src/libultra_code/guPosition.c new file mode 100644 index 0000000000..11eae1034d --- /dev/null +++ b/src/libultra_code/guPosition.c @@ -0,0 +1,55 @@ +#include "libultra_internal.h" + +/** + * guPositionF + * Creates a rotation/parallel translation modeling matrix (floating point) + **/ + +void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z) { + static f32 D_80134D00 = M_PI / 180.0; + f32 sinr, sinp, sinh; + f32 cosr, cosp, cosh; + + rot *= D_80134D00; + pitch *= D_80134D00; + yaw *= D_80134D00; + + sinr = sinf(rot); + cosr = cosf(rot); + sinp = sinf(pitch); + cosp = cosf(pitch); + sinh = sinf(yaw); + cosh = cosf(yaw); + + mf[0][0] = (cosp * cosh) * scale; + mf[0][1] = (cosp * sinh) * scale; + mf[0][2] = (-sinp) * scale; + mf[0][3] = 0.0f; + + mf[1][0] = ((sinr * sinp * cosh) - (cosr * sinh)) * scale; + mf[1][1] = ((sinr * sinp * sinh) + (cosr * cosh)) * scale; + mf[1][2] = (sinr * cosp) * scale; + mf[1][3] = 0.0f; + + mf[2][0] = ((cosr * sinp * cosh) + (sinr * sinh)) * scale; + mf[2][1] = ((cosr * sinp * sinh) - (sinr * cosh)) * scale; + mf[2][2] = (cosr * cosp) * scale; + mf[2][3] = 0.0f; + + mf[3][0] = x; + mf[3][1] = y; + mf[3][2] = z; + mf[3][3] = 1.0f; +} + +/** + * guPosition + * Creates a rotational/paralell translation moeling matrix (fixed point) + */ +void guPosition(Mtx* m, f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z) { + f32 mf[4][4]; + + guPositionF(mf, rot, pitch, yaw, scale, x, y, z); + + guMtxF2L(mf, m); +} diff --git a/src/libultra_code/libultra_internal.h b/src/libultra_code/libultra_internal.h index 373a78d1e6..ebbb632f1e 100644 --- a/src/libultra_code/libultra_internal.h +++ b/src/libultra_code/libultra_internal.h @@ -4,8 +4,7 @@ // TODO: rename these // SM64 OOT -#define guMtxIdentF func_80101B40 -#define guMtxF2L func_801064E0 +#define guMtxF2L func_801064E0 // believed to be correct name, needs confirmation. s32 __osDisableInt(); void __osRestoreInt(s32); diff --git a/src/libultra_code/osViSetEvent.c b/src/libultra_code/osViSetEvent.c new file mode 100644 index 0000000000..1c042dc27d --- /dev/null +++ b/src/libultra_code/osViSetEvent.c @@ -0,0 +1,12 @@ +#include "libultra_internal.h" + +extern OSViContext* __osViNext; + +void osViSetEvent(OSMesgQueue* mq, OSMesg msg, u32 retraceCount) { + register u32 saveMask; + saveMask = __osDisableInt(); + __osViNext->mq = mq; + __osViNext->msg = msg; + __osViNext->retraceCount = retraceCount; + __osRestoreInt(saveMask); +} From 26b8e77f99b724618dce48a2f06e2ef78e9c3127 Mon Sep 17 00:00:00 2001 From: Roman971 <32455037+Roman971@users.noreply.github.com> Date: Wed, 22 Apr 2020 19:44:11 +0200 Subject: [PATCH 4/6] Fix ROM and function pointers in overlays (#88) * Fix ROM pointers in overlays ROM pointers are fewer but much harder to find so hopefully this is all of them. * Fix function pointers in overlay data --- .../actors/ovl_kaleido_scope/func_80823548.s | 8 +- .../actors/ovl_kaleido_scope/func_80826AEC.s | 4 +- .../actors/ovl_kaleido_scope/func_80826CB4.s | 116 +++++++++--------- .../ovl_file_choose/func_80811A20.s | 16 +-- .../gamestates/ovl_select/func_80801E44.s | 8 +- data/overlays/actors/z_en_girla.data.s | 72 +++++------ data/overlays/actors/z_en_viewer.data.s | 2 +- .../overlays/actors/z_obj_makeoshihiki.data.s | 2 +- include/segment_symbols.h | 12 ++ 9 files changed, 126 insertions(+), 114 deletions(-) diff --git a/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80823548.s b/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80823548.s index e6d81d84f0..7cbc59f707 100644 --- a/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80823548.s +++ b/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80823548.s @@ -48,10 +48,10 @@ glabel func_80823548 /* 0FDD8 808235F8 1701001A */ bne $t8, $at, .L80823664 /* 0FDDC 808235FC 3C048083 */ lui $a0, %hi(D_8082FD00) ## $a0 = 80830000 /* 0FDE0 80823600 8739ABA8 */ lh $t9, %lo(D_8082ABA8)($t9) -/* 0FDE4 80823604 3C0E0088 */ lui $t6, 0x0088 ## $t6 = 00880000 +/* 0FDE4 80823604 3C0E0088 */ lui $t6, %hi(_map_name_staticSegmentRomStart) /* 0FDE8 80823608 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 /* 0FDEC 8082360C 17200015 */ bne $t9, $zero, .L80823664 -/* 0FDF0 80823610 25CEE000 */ addiu $t6, $t6, 0xE000 ## $t6 = 0087E000 +/* 0FDF0 80823610 25CEE000 */ addiu $t6, %lo(_map_name_staticSegmentRomStart) /* 0FDF4 80823614 3C048016 */ lui $a0, %hi(gSaveContext+0x1409) /* 0FDF8 80823618 9084FA69 */ lbu $a0, %lo(gSaveContext+0x1409)($a0) /* 0FDFC 8082361C 3C078083 */ lui $a3, %hi(D_8082FCE4) ## $a3 = 80830000 @@ -103,8 +103,8 @@ glabel func_80823548 /* 0FE98 808236B8 AFA30020 */ sw $v1, 0x0020($sp) /* 0FE9C 808236BC 8FA20024 */ lw $v0, 0x0024($sp) /* 0FEA0 808236C0 8FAA0020 */ lw $t2, 0x0020($sp) -/* 0FEA4 808236C4 3C0C0082 */ lui $t4, 0x0082 ## $t4 = 00820000 -/* 0FEA8 808236C8 258C1000 */ addiu $t4, $t4, 0x1000 ## $t4 = 00821000 +/* 0FEA4 808236C4 3C0C0082 */ lui $t4, %hi(_item_name_staticSegmentRomStart) +/* 0FEA8 808236C8 258C1000 */ addiu $t4, %lo(_item_name_staticSegmentRomStart) /* 0FEAC 808236CC 3C078083 */ lui $a3, %hi(D_8082FD24) ## $a3 = 80830000 /* 0FEB0 808236D0 240D0848 */ addiu $t5, $zero, 0x0848 ## $t5 = 00000848 /* 0FEB4 808236D4 8C440138 */ lw $a0, 0x0138($v0) ## 00000138 diff --git a/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80826AEC.s b/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80826AEC.s index 7e6d8d8577..d8fe48afaf 100644 --- a/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80826AEC.s +++ b/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80826AEC.s @@ -9,10 +9,10 @@ glabel func_80826AEC /* 132E8 80826B08 3C040001 */ lui $a0, 0x0001 ## $a0 = 00010000 /* 132EC 80826B0C 0018CA00 */ sll $t9, $t8, 8 /* 132F0 80826B10 008E2021 */ addu $a0, $a0, $t6 -/* 132F4 80826B14 3C020098 */ lui $v0, 0x0098 ## $v0 = 00980000 +/* 132F4 80826B14 3C020098 */ lui $v0, %hi(_map_48x85_staticSegmentRomStart) /* 132F8 80826B18 0338C823 */ subu $t9, $t9, $t8 /* 132FC 80826B1C 0019C8C0 */ sll $t9, $t9, 3 -/* 13300 80826B20 24423000 */ addiu $v0, $v0, 0x3000 ## $v0 = 00983000 +/* 13300 80826B20 24423000 */ addiu $v0, %lo(_map_48x85_staticSegmentRomStart) /* 13304 80826B24 8C84062C */ lw $a0, 0x062C($a0) ## 0001062C /* 13308 80826B28 3C078083 */ lui $a3, %hi(D_8082FDB0) ## $a3 = 80830000 /* 1330C 80826B2C 24080D8B */ addiu $t0, $zero, 0x0D8B ## $t0 = 00000D8B diff --git a/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80826CB4.s b/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80826CB4.s index 2264766369..4223b7faf5 100644 --- a/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80826CB4.s +++ b/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_80826CB4.s @@ -144,13 +144,13 @@ glabel L80826E00 /* 1369C 80826EBC 8E0F013C */ lw $t7, 0x013C($s0) ## 0000013C /* 136A0 80826EC0 8FB80068 */ lw $t8, 0x0068($sp) /* 136A4 80826EC4 2401FFF0 */ addiu $at, $zero, 0xFFF0 ## $at = FFFFFFF0 -/* 136A8 80826EC8 3C020075 */ lui $v0, 0x0075 ## $v0 = 00750000 +/* 136A8 80826EC8 3C020075 */ lui $v0, %hi(_icon_item_staticSegmentRomStart) /* 136AC 80826ECC 01F8C821 */ addu $t9, $t7, $t8 /* 136B0 80826ED0 272E000F */ addiu $t6, $t9, 0x000F ## $t6 = 0000000F -/* 136B4 80826ED4 3C18007D */ lui $t8, 0x007D ## $t8 = 007D0000 +/* 136B4 80826ED4 3C18007D */ lui $t8, %hi(_icon_item_staticSegmentRomEnd) /* 136B8 80826ED8 01C17824 */ and $t7, $t6, $at -/* 136BC 80826EDC 27185CA0 */ addiu $t8, $t8, 0x5CA0 ## $t8 = 007D5CA0 -/* 136C0 80826EE0 2442C000 */ addiu $v0, $v0, 0xC000 ## $v0 = 0074C000 +/* 136BC 80826EDC 27185CA0 */ addiu $t8, %lo(_icon_item_staticSegmentRomEnd) +/* 136C0 80826EE0 2442C000 */ addiu $v0, %lo(_icon_item_staticSegmentRomStart) /* 136C4 80826EE4 AE0F0128 */ sw $t7, 0x0128($s0) ## 00000128 /* 136C8 80826EE8 03022823 */ subu $a1, $t8, $v0 /* 136CC 80826EEC 3C048083 */ lui $a0, %hi(D_8082FE14) ## $a0 = 80830000 @@ -216,13 +216,13 @@ glabel L80826E00 /* 137AC 80826FCC 8E180128 */ lw $t8, 0x0128($s0) ## 00000128 /* 137B0 80826FD0 8FB90030 */ lw $t9, 0x0030($sp) /* 137B4 80826FD4 2401FFF0 */ addiu $at, $zero, 0xFFF0 ## $at = FFFFFFF0 -/* 137B8 80826FD8 3C02007D */ lui $v0, 0x007D ## $v0 = 007D0000 +/* 137B8 80826FD8 3C02007D */ lui $v0, %hi(_icon_item_24_staticSegmentRomStart) /* 137BC 80826FDC 03197021 */ addu $t6, $t8, $t9 /* 137C0 80826FE0 25CF000F */ addiu $t7, $t6, 0x000F ## $t7 = 0000000F -/* 137C4 80826FE4 3C19007E */ lui $t9, 0x007E ## $t9 = 007E0000 +/* 137C4 80826FE4 3C19007E */ lui $t9, %hi(_icon_item_24_staticSegmentRomEnd) /* 137C8 80826FE8 01E1C024 */ and $t8, $t7, $at -/* 137CC 80826FEC 27391400 */ addiu $t9, $t9, 0x1400 ## $t9 = 007E1400 -/* 137D0 80826FF0 24426000 */ addiu $v0, $v0, 0x6000 ## $v0 = 007D6000 +/* 137CC 80826FEC 27391400 */ addiu $t9, %lo(_icon_item_24_staticSegmentRomEnd) +/* 137D0 80826FF0 24426000 */ addiu $v0, %lo(_icon_item_24_staticSegmentRomStart) /* 137D4 80826FF4 AE18012C */ sw $t8, 0x012C($s0) ## 0000012C /* 137D8 80826FF8 03222823 */ subu $a1, $t9, $v0 /* 137DC 80826FFC 3C048083 */ lui $a0, %hi(D_8082FE44) ## $a0 = 80830000 @@ -258,10 +258,10 @@ glabel L80826E00 /* 13850 80827070 03000008 */ jr $t8 /* 13854 80827074 00000000 */ nop glabel L80827078 -/* 13858 80827078 3C02007F */ lui $v0, 0x007F ## $v0 = 007F0000 -/* 1385C 8082707C 3C0E007F */ lui $t6, 0x007F ## $t6 = 007F0000 -/* 13860 80827080 25CEFD80 */ addiu $t6, $t6, 0xFD80 ## $t6 = 007EFD80 -/* 13864 80827084 2442E000 */ addiu $v0, $v0, 0xE000 ## $v0 = 007EE000 +/* 13858 80827078 3C02007F */ lui $v0, %hi(_icon_item_dungeon_staticSegmentRomStart) +/* 1385C 8082707C 3C0E007F */ lui $t6, %hi(_icon_item_dungeon_staticSegmentRomEnd) +/* 13860 80827080 25CEFD80 */ addiu $t6, %lo(_icon_item_dungeon_staticSegmentRomEnd) +/* 13864 80827084 2442E000 */ addiu $v0, %lo(_icon_item_dungeon_staticSegmentRomStart) /* 13868 80827088 24190001 */ addiu $t9, $zero, 0x0001 ## $t9 = 00000001 /* 1386C 8082708C 3C018083 */ lui $at, %hi(D_8082ABA8) ## $at = 80830000 /* 13870 80827090 01C22823 */ subu $a1, $t6, $v0 @@ -294,10 +294,10 @@ glabel L80827078 /* 138D8 808270F8 10000018 */ beq $zero, $zero, .L8082715C /* 138DC 808270FC 2529E660 */ addiu $t1, %lo(gSaveContext) glabel L80827100 -/* 138E0 80827100 3C02007E */ lui $v0, 0x007E ## $v0 = 007E0000 -/* 138E4 80827104 3C0E007F */ lui $t6, 0x007F ## $t6 = 007F0000 -/* 138E8 80827108 25CED930 */ addiu $t6, $t6, 0xD930 ## $t6 = 007ED930 -/* 138EC 8082710C 24422000 */ addiu $v0, $v0, 0x2000 ## $v0 = 007E2000 +/* 138E0 80827100 3C02007E */ lui $v0, %hi(_icon_item_field_staticSegmentRomStart) +/* 138E4 80827104 3C0E007F */ lui $t6, %hi(_icon_item_field_staticSegmentRomEnd) +/* 138E8 80827108 25CED930 */ addiu $t6, %lo(_icon_item_field_staticSegmentRomEnd) +/* 138EC 8082710C 24422000 */ addiu $v0, %lo(_icon_item_field_staticSegmentRomStart) /* 138F0 80827110 3C018083 */ lui $at, %hi(D_8082ABA8) ## $at = 80830000 /* 138F4 80827114 01C22823 */ subu $a1, $t6, $v0 /* 138F8 80827118 3C048083 */ lui $a0, %hi(D_8082FEB8) ## $a0 = 80830000 @@ -328,10 +328,10 @@ glabel L80827100 /* 13954 80827174 AE180134 */ sw $t8, 0x0134($s0) ## 00000134 /* 13958 80827178 91231409 */ lbu $v1, 0x1409($t1) ## 8015FA69 /* 1395C 8082717C 14600015 */ bne $v1, $zero, .L808271D4 -/* 13960 80827180 3C02007F */ lui $v0, 0x007F ## $v0 = 007F0000 -/* 13964 80827184 3C190080 */ lui $t9, 0x0080 ## $t9 = 00800000 -/* 13968 80827188 27391C80 */ addiu $t9, $t9, 0x1C80 ## $t9 = 00801C80 -/* 1396C 8082718C 24424000 */ addiu $v0, $v0, 0x4000 ## $v0 = 007F4000 +/* 13960 80827180 3C02007F */ lui $v0, %hi(_icon_item_nes_staticSegmentRomStart) +/* 13964 80827184 3C190080 */ lui $t9, %hi(_icon_item_nes_staticSegmentRomEnd) +/* 13968 80827188 27391C80 */ addiu $t9, %lo(_icon_item_nes_staticSegmentRomEnd) +/* 1396C 8082718C 24424000 */ addiu $v0, %lo(_icon_item_nes_staticSegmentRomStart) /* 13970 80827190 03222823 */ subu $a1, $t9, $v0 /* 13974 80827194 3C048083 */ lui $a0, %hi(D_8082FEF4) ## $a0 = 80830000 /* 13978 80827198 AFA50070 */ sw $a1, 0x0070($sp) @@ -353,11 +353,11 @@ glabel L80827100 .L808271D4: /* 139B4 808271D4 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 /* 139B8 808271D8 14610016 */ bne $v1, $at, .L80827234 -/* 139BC 808271DC 3C020081 */ lui $v0, 0x0081 ## $v0 = 00810000 -/* 139C0 808271E0 3C020080 */ lui $v0, 0x0080 ## $v0 = 00800000 -/* 139C4 808271E4 3C0F0081 */ lui $t7, 0x0081 ## $t7 = 00810000 -/* 139C8 808271E8 25EF0B80 */ addiu $t7, $t7, 0x0B80 ## $t7 = 00810B80 -/* 139CC 808271EC 24422000 */ addiu $v0, $v0, 0x2000 ## $v0 = 00802000 +/* 139BC 808271DC 3C020081 */ lui $v0, %hi(_icon_item_fra_staticSegmentRomStart) +/* 139C0 808271E0 3C020080 */ lui $v0, %hi(_icon_item_ger_staticSegmentRomStart) +/* 139C4 808271E4 3C0F0081 */ lui $t7, %hi(_icon_item_ger_staticSegmentRomEnd) +/* 139C8 808271E8 25EF0B80 */ addiu $t7, %lo(_icon_item_ger_staticSegmentRomEnd) +/* 139CC 808271EC 24422000 */ addiu $v0, %lo(_icon_item_ger_staticSegmentRomStart) /* 139D0 808271F0 01E22823 */ subu $a1, $t7, $v0 /* 139D4 808271F4 3C048083 */ lui $a0, %hi(D_8082FF34) ## $a0 = 80830000 /* 139D8 808271F8 AFA50070 */ sw $a1, 0x0070($sp) @@ -377,9 +377,9 @@ glabel L80827100 /* 13A0C 8082722C 10000014 */ beq $zero, $zero, .L80827280 /* 13A10 80827230 8E0F0134 */ lw $t7, 0x0134($s0) ## 00000134 .L80827234: -/* 13A14 80827234 3C190082 */ lui $t9, 0x0082 ## $t9 = 00820000 -/* 13A18 80827238 27390480 */ addiu $t9, $t9, 0x0480 ## $t9 = 00820480 -/* 13A1C 8082723C 24421000 */ addiu $v0, $v0, 0x1000 ## $v0 = 00001000 +/* 13A14 80827234 3C190082 */ lui $t9, %hi(_icon_item_fra_staticSegmentRomEnd) +/* 13A18 80827238 27390480 */ addiu $t9, %lo(_icon_item_fra_staticSegmentRomEnd) +/* 13A1C 8082723C 24421000 */ addiu $v0, %lo(_icon_item_fra_staticSegmentRomStart) /* 13A20 80827240 03222823 */ subu $a1, $t9, $v0 /* 13A24 80827244 3C048083 */ lui $a0, %hi(D_8082FF74) ## $a0 = 80830000 /* 13A28 80827248 AFA50070 */ sw $a1, 0x0070($sp) @@ -446,8 +446,8 @@ glabel L80827100 /* 13B08 80827328 8E040138 */ lw $a0, 0x0138($s0) ## 00000138 /* 13B0C 8082732C 000E7240 */ sll $t6, $t6, 9 /* 13B10 80827330 34019000 */ ori $at, $zero, 0x9000 ## $at = 00009000 -/* 13B14 80827334 3C180088 */ lui $t8, 0x0088 ## $t8 = 00880000 -/* 13B18 80827338 2718E000 */ addiu $t8, $t8, 0xE000 ## $t8 = 0087E000 +/* 13B14 80827334 3C180088 */ lui $t8, %hi(_map_name_staticSegmentRomStart) +/* 13B18 80827338 2718E000 */ addiu $t8, %lo(_map_name_staticSegmentRomStart) /* 13B1C 8082733C 01C17821 */ addu $t7, $t6, $at /* 13B20 80827340 3C078083 */ lui $a3, %hi(D_8082FFE4) ## $a3 = 80830000 /* 13B24 80827344 24190EC0 */ addiu $t9, $zero, 0x0EC0 ## $t9 = 00000EC0 @@ -470,8 +470,8 @@ glabel L80827100 /* 13B64 80827384 8E040138 */ lw $a0, 0x0138($s0) ## 00000138 /* 13B68 80827388 34216C00 */ ori $at, $at, 0x6C00 ## $at = 00016C00 /* 13B6C 8082738C 000E7240 */ sll $t6, $t6, 9 -/* 13B70 80827390 3C180088 */ lui $t8, 0x0088 ## $t8 = 00880000 -/* 13B74 80827394 2718E000 */ addiu $t8, $t8, 0xE000 ## $t8 = 0087E000 +/* 13B70 80827390 3C180088 */ lui $t8, %hi(_map_name_staticSegmentRomStart) +/* 13B74 80827394 2718E000 */ addiu $t8, %lo(_map_name_staticSegmentRomStart) /* 13B78 80827398 01C17821 */ addu $t7, $t6, $at /* 13B7C 8082739C 3C078083 */ lui $a3, %hi(D_80830000) ## $a3 = 80830000 /* 13B80 808273A0 24190EC4 */ addiu $t9, $zero, 0x0EC4 ## $t9 = 00000EC4 @@ -491,8 +491,8 @@ glabel L80827100 /* 13BB4 808273D4 8E040138 */ lw $a0, 0x0138($s0) ## 00000138 /* 13BB8 808273D8 34214800 */ ori $at, $at, 0x4800 ## $at = 00024800 /* 13BBC 808273DC 000E7240 */ sll $t6, $t6, 9 -/* 13BC0 808273E0 3C180088 */ lui $t8, 0x0088 ## $t8 = 00880000 -/* 13BC4 808273E4 2718E000 */ addiu $t8, $t8, 0xE000 ## $t8 = 0087E000 +/* 13BC0 808273E0 3C180088 */ lui $t8, %hi(_map_name_staticSegmentRomStart) +/* 13BC4 808273E4 2718E000 */ addiu $t8, %lo(_map_name_staticSegmentRomStart) /* 13BC8 808273E8 01C17821 */ addu $t7, $t6, $at /* 13BCC 808273EC 3C078083 */ lui $a3, %hi(D_8083001C) ## $a3 = 80830000 /* 13BD0 808273F0 24190EC8 */ addiu $t9, $zero, 0x0EC8 ## $t9 = 00000EC8 @@ -1866,12 +1866,12 @@ glabel L808286FC /* 14F2C 8082874C 01F17821 */ addu $t7, $t7, $s1 /* 14F30 80828750 8DEF17A4 */ lw $t7, 0x17A4($t7) ## 000117A4 /* 14F34 80828754 2401FFC0 */ addiu $at, $zero, 0xFFC0 ## $at = FFFFFFC0 -/* 14F38 80828758 3C020075 */ lui $v0, 0x0075 ## $v0 = 00750000 -/* 14F3C 8082875C 3C18007D */ lui $t8, 0x007D ## $t8 = 007D0000 +/* 14F38 80828758 3C020075 */ lui $v0, %hi(_icon_item_staticSegmentRomStart) +/* 14F3C 8082875C 3C18007D */ lui $t8, %hi(_icon_item_staticSegmentRomEnd) /* 14F40 80828760 25F90030 */ addiu $t9, $t7, 0x0030 ## $t9 = 00010030 /* 14F44 80828764 03217024 */ and $t6, $t9, $at -/* 14F48 80828768 27185CA0 */ addiu $t8, $t8, 0x5CA0 ## $t8 = 007D5CA0 -/* 14F4C 8082876C 2442C000 */ addiu $v0, $v0, 0xC000 ## $v0 = 0074C000 +/* 14F48 80828768 27185CA0 */ addiu $t8, %lo(_icon_item_staticSegmentRomEnd) +/* 14F4C 8082876C 2442C000 */ addiu $v0, %lo(_icon_item_staticSegmentRomStart) /* 14F50 80828770 AE0E0128 */ sw $t6, 0x0128($s0) ## 00000128 /* 14F54 80828774 03022823 */ subu $a1, $t8, $v0 /* 14F58 80828778 3C048083 */ lui $a0, %hi(D_80830038) ## $a0 = 80830000 @@ -1891,13 +1891,13 @@ glabel L808286FC /* 14F8C 808287AC 8E190128 */ lw $t9, 0x0128($s0) ## 00000128 /* 14F90 808287B0 8FAE0030 */ lw $t6, 0x0030($sp) /* 14F94 808287B4 2401FFF0 */ addiu $at, $zero, 0xFFF0 ## $at = FFFFFFF0 -/* 14F98 808287B8 3C03007D */ lui $v1, 0x007D ## $v1 = 007D0000 +/* 14F98 808287B8 3C03007D */ lui $v1, %hi(_icon_item_24_staticSegmentRomStart) /* 14F9C 808287BC 032EC021 */ addu $t8, $t9, $t6 /* 14FA0 808287C0 270F000F */ addiu $t7, $t8, 0x000F ## $t7 = 0000000F -/* 14FA4 808287C4 3C0E007E */ lui $t6, 0x007E ## $t6 = 007E0000 +/* 14FA4 808287C4 3C0E007E */ lui $t6, %hi(_icon_item_24_staticSegmentRomEnd) /* 14FA8 808287C8 01E1C824 */ and $t9, $t7, $at -/* 14FAC 808287CC 25CE1400 */ addiu $t6, $t6, 0x1400 ## $t6 = 007E1400 -/* 14FB0 808287D0 24636000 */ addiu $v1, $v1, 0x6000 ## $v1 = 007D6000 +/* 14FAC 808287CC 25CE1400 */ addiu $t6, %lo(_icon_item_24_staticSegmentRomEnd) +/* 14FB0 808287D0 24636000 */ addiu $v1, %lo(_icon_item_24_staticSegmentRomStart) /* 14FB4 808287D4 AE19012C */ sw $t9, 0x012C($s0) ## 0000012C /* 14FB8 808287D8 01C32823 */ subu $a1, $t6, $v1 /* 14FBC 808287DC 3C048083 */ lui $a0, %hi(D_80830068) ## $a0 = 80830000 @@ -1917,13 +1917,13 @@ glabel L808286FC /* 14FF0 80828810 02203025 */ or $a2, $s1, $zero ## $a2 = 00000000 /* 14FF4 80828814 8E0F012C */ lw $t7, 0x012C($s0) ## 0000012C /* 14FF8 80828818 2401FFF0 */ addiu $at, $zero, 0xFFF0 ## $at = FFFFFFF0 -/* 14FFC 8082881C 3C03007F */ lui $v1, 0x007F ## $v1 = 007F0000 +/* 14FFC 8082881C 3C03007F */ lui $v1, %hi(_icon_item_gameover_staticSegmentRomStart) /* 15000 80828820 01F1C821 */ addu $t9, $t7, $s1 /* 15004 80828824 272E000F */ addiu $t6, $t9, 0x000F ## $t6 = 0000000F -/* 15008 80828828 3C0F007F */ lui $t7, 0x007F ## $t7 = 007F0000 +/* 15008 80828828 3C0F007F */ lui $t7, %hi(_icon_item_gameover_staticSegmentRomEnd) /* 1500C 8082882C 01C1C024 */ and $t8, $t6, $at -/* 15010 80828830 25EF3C80 */ addiu $t7, $t7, 0x3C80 ## $t7 = 007F3C80 -/* 15014 80828834 24630000 */ addiu $v1, $v1, 0x0000 ## $v1 = 007F0000 +/* 15010 80828830 25EF3C80 */ addiu $t7, %lo(_icon_item_gameover_staticSegmentRomEnd) +/* 15014 80828834 24630000 */ addiu $v1, %lo(_icon_item_gameover_staticSegmentRomStart) /* 15018 80828838 AE180130 */ sw $t8, 0x0130($s0) ## 00000130 /* 1501C 8082883C 01E32823 */ subu $a1, $t7, $v1 /* 15020 80828840 3C048083 */ lui $a0, %hi(D_8083009C) ## $a0 = 80830000 @@ -1954,10 +1954,10 @@ glabel L808286FC /* 15080 808288A0 248400E0 */ addiu $a0, $a0, %lo(D_808300E0) ## $a0 = 808300E0 /* 15084 808288A4 14600015 */ bne $v1, $zero, .L808288FC /* 15088 808288A8 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 -/* 1508C 808288AC 3C02007F */ lui $v0, 0x007F ## $v0 = 007F0000 -/* 15090 808288B0 3C0E0080 */ lui $t6, 0x0080 ## $t6 = 00800000 -/* 15094 808288B4 25CE1C80 */ addiu $t6, $t6, 0x1C80 ## $t6 = 00801C80 -/* 15098 808288B8 24424000 */ addiu $v0, $v0, 0x4000 ## $v0 = 007F4000 +/* 1508C 808288AC 3C02007F */ lui $v0, %hi(_icon_item_nes_staticSegmentRomStart) +/* 15090 808288B0 3C0E0080 */ lui $t6, %hi(_icon_item_nes_staticSegmentRomEnd) +/* 15094 808288B4 25CE1C80 */ addiu $t6, %lo(_icon_item_nes_staticSegmentRomEnd) +/* 15098 808288B8 24424000 */ addiu $v0, %lo(_icon_item_nes_staticSegmentRomStart) /* 1509C 808288BC 01C23023 */ subu $a2, $t6, $v0 /* 150A0 808288C0 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000000 /* 150A4 808288C4 AFA6002C */ sw $a2, 0x002C($sp) @@ -1978,10 +1978,10 @@ glabel L808286FC .L808288FC: /* 150DC 808288FC 14610017 */ bne $v1, $at, .L8082895C /* 150E0 80828900 3C048083 */ lui $a0, %hi(D_80830160) ## $a0 = 80830000 -/* 150E4 80828904 3C020080 */ lui $v0, 0x0080 ## $v0 = 00800000 -/* 150E8 80828908 3C0F0081 */ lui $t7, 0x0081 ## $t7 = 00810000 -/* 150EC 8082890C 25EF0B80 */ addiu $t7, $t7, 0x0B80 ## $t7 = 00810B80 -/* 150F0 80828910 24422000 */ addiu $v0, $v0, 0x2000 ## $v0 = 00802000 +/* 150E4 80828904 3C020080 */ lui $v0, %hi(_icon_item_ger_staticSegmentRomStart) +/* 150E8 80828908 3C0F0081 */ lui $t7, %hi(_icon_item_ger_staticSegmentRomEnd) +/* 150EC 8082890C 25EF0B80 */ addiu $t7, %lo(_icon_item_ger_staticSegmentRomEnd) +/* 150F0 80828910 24422000 */ addiu $v0, %lo(_icon_item_ger_staticSegmentRomStart) /* 150F4 80828914 01E23023 */ subu $a2, $t7, $v0 /* 150F8 80828918 3C048083 */ lui $a0, %hi(D_80830120) ## $a0 = 80830000 /* 150FC 8082891C 24840120 */ addiu $a0, $a0, %lo(D_80830120) ## $a0 = 80830120 @@ -2002,10 +2002,10 @@ glabel L808286FC /* 15134 80828954 10000015 */ beq $zero, $zero, .L808289AC /* 15138 80828958 2508FA90 */ addiu $t0, %lo(gGameInfo) .L8082895C: -/* 1513C 8082895C 3C020081 */ lui $v0, 0x0081 ## $v0 = 00810000 -/* 15140 80828960 3C0E0082 */ lui $t6, 0x0082 ## $t6 = 00820000 -/* 15144 80828964 25CE0480 */ addiu $t6, $t6, 0x0480 ## $t6 = 00820480 -/* 15148 80828968 24421000 */ addiu $v0, $v0, 0x1000 ## $v0 = 00811000 +/* 1513C 8082895C 3C020081 */ lui $v0, %hi(_icon_item_fra_staticSegmentRomStart) +/* 15140 80828960 3C0E0082 */ lui $t6, %hi(_icon_item_fra_staticSegmentRomEnd) +/* 15144 80828964 25CE0480 */ addiu $t6, %lo(_icon_item_fra_staticSegmentRomEnd) +/* 15148 80828968 24421000 */ addiu $v0, %lo(_icon_item_fra_staticSegmentRomStart) /* 1514C 8082896C 01C23023 */ subu $a2, $t6, $v0 /* 15150 80828970 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000000 /* 15154 80828974 AFA6002C */ sw $a2, 0x002C($sp) diff --git a/asm/non_matchings/overlays/gamestates/ovl_file_choose/func_80811A20.s b/asm/non_matchings/overlays/gamestates/ovl_file_choose/func_80811A20.s index d48062ca41..837e4d4d26 100644 --- a/asm/non_matchings/overlays/gamestates/ovl_file_choose/func_80811A20.s +++ b/asm/non_matchings/overlays/gamestates/ovl_file_choose/func_80811A20.s @@ -3,13 +3,13 @@ glabel func_80811A20 /* 0DCE4 80811A24 8DEFFA90 */ lw $t7, %lo(gGameInfo)($t7) /* 0DCE8 80811A28 27BDFFC0 */ addiu $sp, $sp, 0xFFC0 ## $sp = FFFFFFC0 /* 0DCEC 80811A2C AFB00020 */ sw $s0, 0x0020($sp) -/* 0DCF0 80811A30 3C0201AA */ lui $v0, 0x01AA ## $v0 = 01AA0000 -/* 0DCF4 80811A34 3C1801AF */ lui $t8, 0x01AF ## $t8 = 01AF0000 +/* 0DCF0 80811A30 3C0201AA */ lui $v0, %hi(_title_staticSegmentRomStart) +/* 0DCF4 80811A34 3C1801AF */ lui $t8, %hi(_title_staticSegmentRomEnd) /* 0DCF8 80811A38 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 0DCFC 80811A3C AFBF0024 */ sw $ra, 0x0024($sp) /* 0DD00 80811A40 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 -/* 0DD04 80811A44 2718B440 */ addiu $t8, $t8, 0xB440 ## $t8 = 01AEB440 -/* 0DD08 80811A48 24424000 */ addiu $v0, $v0, 0x4000 ## $v0 = 01AA4000 +/* 0DD04 80811A44 2718B440 */ addiu $t8, %lo(_title_staticSegmentRomEnd) +/* 0DD08 80811A48 24424000 */ addiu $v0, %lo(_title_staticSegmentRomStart) /* 0DD0C 80811A4C 03022823 */ subu $a1, $t8, $v0 /* 0DD10 80811A50 3C048081 */ lui $a0, %hi(D_80812F48) ## $a0 = 80810000 /* 0DD14 80811A54 A5EE0110 */ sh $t6, 0x0110($t7) ## 80160110 @@ -43,10 +43,10 @@ glabel func_80811A20 /* 0DD74 80811AB4 8FA50030 */ lw $a1, 0x0030($sp) /* 0DD78 80811AB8 0C0006A8 */ jal DmaMgr_SendRequest1 /* 0DD7C 80811ABC 8FA6002C */ lw $a2, 0x002C($sp) -/* 0DD80 80811AC0 3C0301AF */ lui $v1, 0x01AF ## $v1 = 01AF0000 -/* 0DD84 80811AC4 3C0801AF */ lui $t0, 0x01AF ## $t0 = 01AF0000 -/* 0DD88 80811AC8 2508FB00 */ addiu $t0, $t0, 0xFB00 ## $t0 = 01AEFB00 -/* 0DD8C 80811ACC 2463C000 */ addiu $v1, $v1, 0xC000 ## $v1 = 01AEC000 +/* 0DD80 80811AC0 3C0301AF */ lui $v1, %hi(_parameter_staticSegmentRomStart) +/* 0DD84 80811AC4 3C0801AF */ lui $t0, %hi(_parameter_staticSegmentRomEnd) +/* 0DD88 80811AC8 2508FB00 */ addiu $t0, %lo(_parameter_staticSegmentRomEnd) +/* 0DD8C 80811ACC 2463C000 */ addiu $v1, %lo(_parameter_staticSegmentRomStart) /* 0DD90 80811AD0 01032823 */ subu $a1, $t0, $v1 /* 0DD94 80811AD4 3C068081 */ lui $a2, %hi(D_80812FAC) ## $a2 = 80810000 /* 0DD98 80811AD8 24C62FAC */ addiu $a2, $a2, %lo(D_80812FAC) ## $a2 = 80812FAC diff --git a/asm/non_matchings/overlays/gamestates/ovl_select/func_80801E44.s b/asm/non_matchings/overlays/gamestates/ovl_select/func_80801E44.s index 1d16af0afa..cb77c40602 100644 --- a/asm/non_matchings/overlays/gamestates/ovl_select/func_80801E44.s +++ b/asm/non_matchings/overlays/gamestates/ovl_select/func_80801E44.s @@ -46,13 +46,13 @@ glabel func_80801E44 /* 01364 80801EF4 AE000230 */ sw $zero, 0x0230($s0) ## 00000230 /* 01368 80801EF8 AE000234 */ sw $zero, 0x0234($s0) ## 00000234 /* 0136C 80801EFC 8C820000 */ lw $v0, 0x0000($a0) ## 8015FA90 -/* 01370 80801F00 3C0B01AA */ lui $t3, 0x01AA ## $t3 = 01AA0000 +/* 01370 80801F00 3C0B01AA */ lui $t3, %hi(_z_select_staticSegmentRomEnd) /* 01374 80801F04 3C068080 */ lui $a2, %hi(D_808035CC) ## $a2 = 80800000 /* 01378 80801F08 84431434 */ lh $v1, 0x1434($v0) ## 00001434 /* 0137C 80801F0C 240A0001 */ addiu $t2, $zero, 0x0001 ## $t2 = 00000001 /* 01380 80801F10 24C635CC */ addiu $a2, $a2, %lo(D_808035CC) ## $a2 = 808035CC /* 01384 80801F14 0460000D */ bltz $v1, .L80801F4C -/* 01388 80801F18 256B0200 */ addiu $t3, $t3, 0x0200 ## $t3 = 01AA0200 +/* 01388 80801F18 256B0200 */ addiu $t3, %lo(_z_select_staticSegmentRomEnd) /* 0138C 80801F1C 8E0F01D0 */ lw $t7, 0x01D0($s0) ## 000001D0 /* 01390 80801F20 006F082A */ slt $at, $v1, $t7 /* 01394 80801F24 10200009 */ beq $at, $zero, .L80801F4C @@ -66,8 +66,8 @@ glabel func_80801E44 /* 013B4 80801F44 AE0901DC */ sw $t1, 0x01DC($s0) ## 000001DC /* 013B8 80801F48 8C820000 */ lw $v0, 0x0000($a0) ## 8015FA90 .L80801F4C: -/* 013BC 80801F4C 3C0301AA */ lui $v1, 0x01AA ## $v1 = 01AA0000 -/* 013C0 80801F50 2463E000 */ addiu $v1, $v1, 0xE000 ## $v1 = 01A9E000 +/* 013BC 80801F4C 3C0301AA */ lui $v1, %hi(_z_select_staticSegmentRomStart) +/* 013C0 80801F50 2463E000 */ addiu $v1, %lo(_z_select_staticSegmentRomStart) /* 013C4 80801F54 A44A0110 */ sh $t2, 0x0110($v0) ## 00000110 /* 013C8 80801F58 01632823 */ subu $a1, $t3, $v1 /* 013CC 80801F5C AFA5002C */ sw $a1, 0x002C($sp) diff --git a/data/overlays/actors/z_en_girla.data.s b/data/overlays/actors/z_en_girla.data.s index 33c0fb2637..a9f30e441c 100644 --- a/data/overlays/actors/z_en_girla.data.s +++ b/data/overlays/actors/z_en_girla.data.s @@ -69,23 +69,23 @@ glabel D_80A3C658 glabel D_80A3C668 .word 0x70B670B5, 0x70B470B7, 0x70BB0000 glabel D_80A3C674 - .word 0x00BB0011, 0x8002ED80, 0x000F0005, 0x00B2007F, 0x00000063 + .word 0x00BB0011, func_8002ED80, 0x000F0005, 0x00B2007F, 0x00000063 .word func_80A3ABF8 .word func_80A3B714 .word func_80A3BB6C -.word 0x00D80025, 0x8002EBCC, 0x003C001E, 0x00C1009B, 0x0000004A +.word 0x00D80025, func_8002EBCC, 0x003C001E, 0x00C1009B, 0x0000004A .word func_80A3AAA8 .word func_80A3B634 .word func_80A3BB6C -.word 0x00D80026, 0x8002EBCC, 0x005A0032, 0x00B0007D, 0x0000004B +.word 0x00D80026, func_8002EBCC, 0x005A0032, 0x00B0007D, 0x0000004B .word func_80A3AAA8 .word func_80A3B634 .word func_80A3BB6C -.word 0x00CE001F, 0x8002EBCC, 0x00190005, 0x00A3008B, 0x00000001 +.word 0x00CE001F, func_8002EBCC, 0x00190005, 0x00A3008B, 0x00000001 .word func_80A3AB58 .word func_80A3B678 .word func_80A3BB6C -.word 0x00BB0011, 0x8002ED80, 0x001E000A, 0x00A20087, 0x00000064 +.word 0x00BB0011, func_8002ED80, 0x001E000A, 0x00A20087, 0x00000064 .word func_80A3ABF8 .word func_80A3B714 .word func_80A3BB6C @@ -93,35 +93,35 @@ glabel D_80A3C674 .word func_80A3ACAC .word func_80A3B780 .word func_80A3BB6C -.word 0x00CE001F, 0x8002EBCC, 0x0032000A, 0x00B1007C, 0x00000066 +.word 0x00CE001F, func_8002EBCC, 0x0032000A, 0x00B1007C, 0x00000066 .word func_80A3AB58 .word func_80A3B678 .word func_80A3BB6C -.word 0x00F4003E, 0x8002ED80, 0x00C80001, 0x00B3007E, 0x0000006C +.word 0x00F4003E, func_8002ED80, 0x00C80001, 0x00B3007E, 0x0000006C .word func_80A3AD60 .word 0x00000000 .word func_80A3BB6C -.word 0x00EB0037, 0x8002EBCC, 0x001E0001, 0x00A5008E, 0x00000010 +.word 0x00EB0037, func_8002EBCC, 0x001E0001, 0x00A5008E, 0x00000010 .word func_80A3ADD4 .word func_80A3BA40 .word func_80A3BB6C -.word 0x00EB0036, 0x8002EBCC, 0x001E0001, 0x00A6008F, 0x00000011 +.word 0x00EB0036, func_8002EBCC, 0x001E0001, 0x00A6008F, 0x00000011 .word func_80A3AE48 .word func_80A3BA40 .word func_80A3BB6C -.word 0x00EB0038, 0x8002EBCC, 0x003C0001, 0x00A70090, 0x00000012 +.word 0x00EB0038, func_8002EBCC, 0x003C0001, 0x00A70090, 0x00000012 .word func_80A3AEBC .word func_80A3BA40 .word func_80A3BB6C -.word 0x00F80042, 0x8002EBCC, 0x03E80001, 0x00A80091, 0x00000028 +.word 0x00F80042, func_8002EBCC, 0x03E80001, 0x00A80091, 0x00000028 .word func_80A3AF30 .word func_80A3B7BC .word func_80A3BB6C -.word 0x00DC002B, 0x8002EBCC, 0x00500001, 0x00A90092, 0x0000002A +.word 0x00DC002B, func_8002EBCC, 0x00500001, 0x00A90092, 0x0000002A .word func_80A3AFC4 .word func_80A3B800 .word func_80A3BB6C -.word 0x00CB001C, 0x8002EBCC, 0x00280001, 0x009F0089, 0x00000029 +.word 0x00CB001C, func_8002EBCC, 0x00280001, 0x009F0089, 0x00000029 .word func_80A3B040 .word func_80A3B83C .word func_80A3BB6C @@ -143,7 +143,7 @@ glabel D_80A3C674 .word func_80A3B250 .word func_80A3B92C .word func_80A3BB6C -.word 0x00DA0028, 0x8002EBCC, 0x00640001, 0x00AE0099, 0x00000047 +.word 0x00DA0028, func_8002EBCC, 0x00640001, 0x00AE0099, 0x00000047 .word func_80A3B2AC .word func_80A3B968 .word func_80A3BB6C @@ -153,59 +153,59 @@ glabel D_80A3C674 .word func_80A3B308 .word func_80A3B9A4 .word func_80A3BB6C -.word 0x00DA0028, 0x8002EBCC, 0x27100001, 0x00B50085, 0x00000000 +.word 0x00DA0028, func_8002EBCC, 0x27100001, 0x00B50085, 0x00000000 .word func_80A3B318 .word func_80A3B9D4 .word func_80A3BB6C -.word 0x00D90027, 0x8002EBCC, 0x0064000A, 0x00BC008C, 0x00000003 +.word 0x00D90027, func_8002EBCC, 0x0064000A, 0x00BC008C, 0x00000003 .word func_80A3B328 .word 0x00000000 .word func_80A3BC6C -.word 0x00D90027, 0x8002EBCC, 0x00B40014, 0x0061002A, 0x0000006B +.word 0x00D90027, func_8002EBCC, 0x00B40014, 0x0061002A, 0x0000006B .word func_80A3B328 .word 0x00000000 .word func_80A3BC6C -.word 0x00D90027, 0x8002EBCC, 0x00B40014, 0x0061002A, 0x0000006B +.word 0x00D90027, func_8002EBCC, 0x00B40014, 0x0061002A, 0x0000006B .word func_80A3B328 .word 0x00000000 .word func_80A3BC6C -.word 0x00D90027, 0x8002EBCC, 0x0064000A, 0x00BC008C, 0x00000003 +.word 0x00D90027, func_8002EBCC, 0x0064000A, 0x00BC008C, 0x00000003 .word func_80A3B328 .word 0x00000000 .word func_80A3BC6C -.word 0x00D90027, 0x8002EBCC, 0x0064000A, 0x00BC008C, 0x00000003 +.word 0x00D90027, func_8002EBCC, 0x0064000A, 0x00BC008C, 0x00000003 .word func_80A3B328 .word 0x00000000 .word func_80A3BC6C -.word 0x00D90027, 0x8002EBCC, 0x00B40014, 0x0061002A, 0x0000006B +.word 0x00D90027, func_8002EBCC, 0x00B40014, 0x0061002A, 0x0000006B .word func_80A3B328 .word 0x00000000 .word func_80A3BC6C -.word 0x00D90027, 0x8002EBCC, 0x00B40014, 0x0061002A, 0x0000006B +.word 0x00D90027, func_8002EBCC, 0x00B40014, 0x0061002A, 0x0000006B .word func_80A3B328 .word 0x00000000 .word func_80A3BC6C -.word 0x00D90027, 0x8002EBCC, 0x0064000A, 0x00BC008C, 0x00000003 +.word 0x00D90027, func_8002EBCC, 0x0064000A, 0x00BC008C, 0x00000003 .word func_80A3B328 .word 0x00000000 .word func_80A3BC6C -.word 0x01190047, 0x8002EBCC, 0x001E001E, 0x00DF00DE, 0x00000069 +.word 0x01190047, func_8002EBCC, 0x001E001E, 0x00DF00DE, 0x00000069 .word func_80A3B3A8 .word func_80A3BA04 .word func_80A3BB6C -.word 0x01340030, 0x8002EBCC, 0x00000001, 0x70B270BE, 0x0000001A +.word 0x01340030, func_8002EBCC, 0x00000001, 0x70B270BE, 0x0000001A .word func_80A3B3A8 .word func_80A3BA04 .word func_80A3BB6C -.word 0x01350031, 0x8002EBCC, 0x00000001, 0x70B170BD, 0x00000018 +.word 0x01350031, func_8002EBCC, 0x00000001, 0x70B170BD, 0x00000018 .word func_80A3B3A8 .word func_80A3BA04 .word func_80A3BB6C -.word 0x0136004E, 0x8002EBCC, 0x00000001, 0x70B070BC, 0x00000017 +.word 0x0136004E, func_8002EBCC, 0x00000001, 0x70B070BC, 0x00000017 .word func_80A3B3A8 .word func_80A3BA04 .word func_80A3BB6C -.word 0x0137004F, 0x8002EBCC, 0x00000001, 0x70B370BF, 0x0000001B +.word 0x0137004F, func_8002EBCC, 0x00000001, 0x70B370BF, 0x0000001B .word func_80A3B3A8 .word func_80A3BA04 .word func_80A3BB6C @@ -227,9 +227,9 @@ glabel D_80A3C674 .word func_80A3B3A8 .word func_80A3BA04 .word func_80A3BB6C -.word 0x01480058, 0x8002EBCC, 0x00000000, 0x00BD70C2, 0x00000053 +.word 0x01480058, func_8002EBCC, 0x00000000, 0x00BD70C2, 0x00000053 .word func_80A3B454 -.word 0x00000000, 0x00000000, 0x01730066, 0x8002EBCC, 0x012C0001, 0x00B900B8, 0x0000006E +.word 0x00000000, 0x00000000, 0x01730066, func_8002EBCC, 0x012C0001, 0x00B900B8, 0x0000006E .word func_80A3B464 .word func_80A3BA40 .word func_80A3BB6C @@ -257,27 +257,27 @@ glabel D_80A3C674 .word func_80A3B5C0 .word func_80A3BA40 .word func_80A3BB6C -.word 0x00D80024, 0x8002EBCC, 0x0014000A, 0x00A0008A, 0x00000049 +.word 0x00D80024, func_8002EBCC, 0x0014000A, 0x00A0008A, 0x00000049 .word func_80A3AAA8 .word func_80A3B634 .word func_80A3BB6C -.word 0x00CE001F, 0x8002EBCC, 0x00500014, 0x001C0006, 0x00000067 +.word 0x00CE001F, func_8002EBCC, 0x00500014, 0x001C0006, 0x00000067 .word func_80A3AB58 .word func_80A3B678 .word func_80A3BB6C -.word 0x00CE001F, 0x8002EBCC, 0x0078001E, 0x001D001E, 0x00000068 +.word 0x00CE001F, func_8002EBCC, 0x0078001E, 0x001D001E, 0x00000068 .word func_80A3AB58 .word func_80A3B678 .word func_80A3BB6C -.word 0x00CE001F, 0x8002EBCC, 0x00230005, 0x00CB00CA, 0x00000001 +.word 0x00CE001F, func_8002EBCC, 0x00230005, 0x00CB00CA, 0x00000001 .word func_80A3AB58 .word func_80A3B678 .word func_80A3BB6C -.word 0x00EB0037, 0x8002EBCC, 0x00280001, 0x00640062, 0x00000010 +.word 0x00EB0037, func_8002EBCC, 0x00280001, 0x00640062, 0x00000010 .word func_80A3ADD4 .word func_80A3BA40 .word func_80A3BB6C -.word 0x00EB0037, 0x8002EBCC, 0x00320001, 0x00650063, 0x00000010 +.word 0x00EB0037, func_8002EBCC, 0x00320001, 0x00650063, 0x00000010 .word func_80A3ADD4 .word func_80A3BA40 .word func_80A3BB6C diff --git a/data/overlays/actors/z_en_viewer.data.s b/data/overlays/actors/z_en_viewer.data.s index 6824a5467c..70c7a9fb17 100644 --- a/data/overlays/actors/z_en_viewer.data.s +++ b/data/overlays/actors/z_en_viewer.data.s @@ -25,7 +25,7 @@ glabel D_80B2CFB0 .word func_80B2A300 .word func_80B2A448 glabel D_80B2CFC0 - .word 0x00000000, 0x8002B5EC, 0x8002B644 + .word 0x00000000, ActorShadow_DrawFunc_Circle, ActorShadow_DrawFunc_Squiggly glabel D_80B2CFCC .word 0x00000000 glabel D_80B2CFD0 diff --git a/data/overlays/actors/z_obj_makeoshihiki.data.s b/data/overlays/actors/z_obj_makeoshihiki.data.s index 282f4ff558..1b7de5122b 100644 --- a/data/overlays/actors/z_obj_makeoshihiki.data.s +++ b/data/overlays/actors/z_obj_makeoshihiki.data.s @@ -18,5 +18,5 @@ glabel D_80B988F0 glabel D_80B98948 .word 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001 glabel D_80B98960 - .word 0x8002CBB4, 0x8002CB74, 0x00000000, 0x00000000 + .word Flags_UnsetSwitch, Flags_SetSwitch, 0x00000000, 0x00000000 diff --git a/include/segment_symbols.h b/include/segment_symbols.h index aed6d2f661..c52f09bb74 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -31,6 +31,14 @@ DECLARE_ROM_SEGMENT(Audiotable) DECLARE_ROM_SEGMENT(link_animetion) DECLARE_ROM_SEGMENT(icon_item_static) DECLARE_ROM_SEGMENT(icon_item_24_static) +DECLARE_ROM_SEGMENT(icon_item_field_static) +DECLARE_ROM_SEGMENT(icon_item_dungeon_static) +DECLARE_ROM_SEGMENT(icon_item_gameover_static) +DECLARE_ROM_SEGMENT(icon_item_nes_static) +DECLARE_ROM_SEGMENT(icon_item_ger_static) +DECLARE_ROM_SEGMENT(icon_item_fra_static) +DECLARE_ROM_SEGMENT(item_name_static) +DECLARE_ROM_SEGMENT(map_name_static) DECLARE_ROM_SEGMENT(do_action_static) DECLARE_ROM_SEGMENT(message_static) DECLARE_ROM_SEGMENT(message_texture_static) @@ -38,7 +46,10 @@ DECLARE_ROM_SEGMENT(nes_font_static) DECLARE_ROM_SEGMENT(nes_message_data_static) DECLARE_ROM_SEGMENT(ger_message_data_static) DECLARE_ROM_SEGMENT(fra_message_data_static) +DECLARE_ROM_SEGMENT(staff_message_data_static) DECLARE_ROM_SEGMENT(map_grand_static) +DECLARE_ROM_SEGMENT(map_i_static) +DECLARE_ROM_SEGMENT(map_48x85_static) DECLARE_ROM_SEGMENT(code) DECLARE_BSS_SEGMENT(code) @@ -921,6 +932,7 @@ DECLARE_ROM_SEGMENT(g_pn_55) DECLARE_ROM_SEGMENT(g_pn_56) DECLARE_ROM_SEGMENT(g_pn_57) +DECLARE_ROM_SEGMENT(z_select_static) DECLARE_ROM_SEGMENT(nintendo_rogo_static) DECLARE_ROM_SEGMENT(title_static) DECLARE_ROM_SEGMENT(parameter_static) From 0a598634578062b1ed1d844ebfcf66a531e34b16 Mon Sep 17 00:00:00 2001 From: Roman971 <32455037+Roman971@users.noreply.github.com> Date: Wed, 22 Apr 2020 19:44:46 +0200 Subject: [PATCH 5/6] Disassemble the rom header and entrypoint function (#87) The actual boot code (ipl3) is still only incbin'd. If someone else wants to disassemble it properly, go ahead. I might do it eventually, but for now it doesn't seem required for shiftability or anything interesting. --- asm/entry.s | 35 +++++++++++++++++++++++++++++++++++ asm/ipl3.s | 10 ++++++++++ asm/rom_header.s | 18 ++++++++++++++++++ include/segment_symbols.h | 1 + spec | 12 ++++++------ src/boot/idle.c | 12 ++++++------ 6 files changed, 76 insertions(+), 12 deletions(-) create mode 100644 asm/entry.s create mode 100644 asm/ipl3.s create mode 100644 asm/rom_header.s diff --git a/asm/entry.s b/asm/entry.s new file mode 100644 index 0000000000..f2cb1c3d6f --- /dev/null +++ b/asm/entry.s @@ -0,0 +1,35 @@ +.include "macro.inc" + +# assembler directives +.set noat # allow manual use of $at +.set noreorder # don't insert nops after branches +.set gp=64 # allow use of 64-bit general purposee registers + +.section .text + +glabel entrypoint # 0x80000400 + lui $t0, %hi(_bootSegmentBssStart) # $t0, 0x8001 + addiu $t0, %lo(_bootSegmentBssStart) # addiu $t0, $t0, 0x2370 + li $t1, %lo(_bootSegmentBssSize) # li $t1, 0x4A30 +.L8000040C: + addi $t1, $t1, -8 + sw $zero, ($t0) + sw $zero, 4($t0) + bnez $t1, .L8000040C + addi $t0, $t0, 8 + lui $t2, %hi(bootproc) # $t2, 0x8000 + lui $sp, %hi(gMainThread) # $sp, 0x8001 + addiu $t2, %lo(bootproc) # addiu $t2, $t2, 0x0498 + jr $t2 + addiu $sp, %lo(gMainThread) # addiu $sp, $sp, 0x2D60 + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop diff --git a/asm/ipl3.s b/asm/ipl3.s new file mode 100644 index 0000000000..179b55e946 --- /dev/null +++ b/asm/ipl3.s @@ -0,0 +1,10 @@ +.include "macro.inc" + +# assembler directives +.set noat # allow manual use of $at +.set noreorder # don't insert nops after branches +.set gp=64 # allow use of 64-bit general purposee registers + +.section .text + +.incbin "baserom.z64", 0x40, 0xFC0 diff --git a/asm/rom_header.s b/asm/rom_header.s new file mode 100644 index 0000000000..883b8b0ab8 --- /dev/null +++ b/asm/rom_header.s @@ -0,0 +1,18 @@ +/* + * The Legend of Zelda: Ocarina of Time ROM header + */ + +.byte 0x80, 0x37, 0x12, 0x40 /* PI BSD Domain 1 register */ +.word 0x0000000F /* Clockrate setting */ +.word 0x80000400 /* Entrypoint function (`entrypoint`) */ +.word 0x0000144C /* Revision */ +.word 0x917D18F6 /* Checksum 1 */ +.word 0x69BC5453 /* Checksum 2 */ +.word 0x00000000 /* Unknown */ +.word 0x00000000 /* Unknown */ +.ascii "THE LEGEND OF ZELDA " /* Internal ROM name */ +.word 0x00000000 /* Unknown */ +.word 0x0000004E /* Cartridge */ +.ascii "ZL" /* Cartridge ID */ +.ascii "P" /* Region */ +.byte 0x0F /* Version */ diff --git a/include/segment_symbols.h b/include/segment_symbols.h index c52f09bb74..8b5ae8eb82 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -51,6 +51,7 @@ DECLARE_ROM_SEGMENT(map_grand_static) DECLARE_ROM_SEGMENT(map_i_static) DECLARE_ROM_SEGMENT(map_48x85_static) +DECLARE_SEGMENT(code) DECLARE_ROM_SEGMENT(code) DECLARE_BSS_SEGMENT(code) diff --git a/spec b/spec index ef7e3baeb5..241bdd257c 100644 --- a/spec +++ b/spec @@ -4,12 +4,14 @@ beginseg name "makerom" - include "build/baserom/makerom.o" - address 0x80000000 + include "build/asm/rom_header.o" + include "build/asm/ipl3.o" + include "build/asm/entry.o" endseg beginseg name "boot" + address 0x80000460 include "build/src/boot/boot_main.o" include "build/src/boot/idle.o" include "build/src/boot/viconfig.o" @@ -107,13 +109,11 @@ beginseg include "build/src/libultra_boot_O1/__osGetHWIntrRoutine.o" include "build/asm/__osSetWatchLo.o" include "build/data/rsp_boot.text.o" - address 0x80000460 endseg beginseg name "dmadata" include "build/asm/dmadata.o" - address 0x80016DA0 endseg beginseg @@ -269,6 +269,7 @@ endseg beginseg name "code" + address 0x8001CE60 include "build/src/code/z_en_a_keep.o" include "build/data/z_en_a_keep.data.o" include "build/src/code/z_en_item00.o" @@ -574,7 +575,6 @@ beginseg include "build/src/code/z_construct.o" include "build/data/rsp.text.o" include "build/data/rsp.rodata.o" - address 0x8001CE60 endseg beginseg @@ -586,9 +586,9 @@ endseg beginseg name "ovl_title" + address 0x80800000 include "build/src/overlays/gamestates/ovl_title/z_title.o" include "build/src/overlays/gamestates/ovl_title/z_title_reloc.o" - address 0x80800000 endseg beginseg diff --git a/src/boot/idle.c b/src/boot/idle.c index 6ab012a4c3..6f1134332c 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -2,7 +2,7 @@ #include #include -OSThread sMainThread; +OSThread gMainThread; u8 sMainStack[0x900]; StackEntry sMainStackInfo; OSMesg sPiMgrCmdBuff[50]; @@ -24,7 +24,7 @@ void Main_ThreadEntry(void* arg0) { DmaMgr_Start(); osSyncPrintf("codeセグメントロード中..."); var1 = osGetTime(); - DmaMgr_SendRequest1((u32)_dmadataSegmentEnd, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart, + DmaMgr_SendRequest1(_codeSegmentStart, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart, "../idle.c", 238); var1 -= osGetTime(); osSyncPrintf("\rcodeセグメントロード中...完了\n"); @@ -78,11 +78,11 @@ void Idle_ThreadEntry(void* a0) { osViSetMode(&gViConfigMode); ViConfig_UpdateVi(1); osViBlack(1); - osViSwapBuffer(0x803da80); - osCreatePiManager(0x96, &gPiMgrCmdQ, sPiMgrCmdBuff, 0x32); + osViSwapBuffer(0x803DA80); //! @bug Invalid vram address (probably intended to be 0x803DA800) + osCreatePiManager(150, &gPiMgrCmdQ, sPiMgrCmdBuff, 50); StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack + sizeof(sMainStack), 0, 0x400, "main"); - osCreateThread(&sMainThread, 3, Main_ThreadEntry, a0, sMainStack + sizeof(sMainStack), 10); - osStartThread(&sMainThread); + osCreateThread(&gMainThread, 3, Main_ThreadEntry, a0, sMainStack + sizeof(sMainStack), 10); + osStartThread(&gMainThread); osSetThreadPri(NULL, 0); while (1) { From 4d3d2646244463c60414ded7b36bc775d7a89bb8 Mon Sep 17 00:00:00 2001 From: Synray <31429825+Synray@users.noreply.github.com> Date: Thu, 23 Apr 2020 01:59:25 -0700 Subject: [PATCH 6/6] Decompile code_801067F0, 80106860, 801068B0 (#89) * Decompile code_801067F0, 80106860, 801068B0 * clang format * Remove unnecessary casts --- asm/code_801067F0.s | 40 -------------------- asm/code_80106860.s | 34 ----------------- asm/code_801068B0.s | 81 ---------------------------------------- include/functions.h | 2 +- makefile | 3 ++ spec | 6 +-- src/code/code_801067F0.c | 13 +++++++ src/code/code_80106860.c | 13 +++++++ src/code/code_801068B0.c | 28 ++++++++++++++ 9 files changed, 61 insertions(+), 159 deletions(-) delete mode 100644 asm/code_801067F0.s delete mode 100644 asm/code_80106860.s delete mode 100644 asm/code_801068B0.s create mode 100644 src/code/code_801067F0.c create mode 100644 src/code/code_80106860.c create mode 100644 src/code/code_801068B0.c diff --git a/asm/code_801067F0.s b/asm/code_801067F0.s deleted file mode 100644 index 88bd779af9..0000000000 --- a/asm/code_801067F0.s +++ /dev/null @@ -1,40 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .text - -.align 4 - -glabel func_801067F0 -/* B7D990 801067F0 27BDFFF8 */ addiu $sp, $sp, -8 -/* B7D994 801067F4 44802000 */ mtc1 $zero, $f4 -/* B7D998 801067F8 00000000 */ nop -/* B7D99C 801067FC 46047032 */ c.eq.s $f14, $f4 -/* B7D9A0 80106800 00000000 */ nop -/* B7D9A4 80106804 45000004 */ bc1f .L80106818 -/* B7D9A8 80106808 00000000 */ nop -/* B7D9AC 8010680C 44800000 */ mtc1 $zero, $f0 -/* B7D9B0 80106810 1000000F */ b .L80106850 -/* B7D9B4 80106814 00000000 */ nop -.L80106818: -/* B7D9B8 80106818 460E6183 */ div.s $f6, $f12, $f14 -/* B7D9BC 8010681C 4600320D */ trunc.w.s $f8, $f6 -/* B7D9C0 80106820 440F4000 */ mfc1 $t7, $f8 -/* B7D9C4 80106824 00000000 */ nop -/* B7D9C8 80106828 AFAF0004 */ sw $t7, 4($sp) -/* B7D9CC 8010682C 8FB80004 */ lw $t8, 4($sp) -/* B7D9D0 80106830 44985000 */ mtc1 $t8, $f10 -/* B7D9D4 80106834 00000000 */ nop -/* B7D9D8 80106838 46805420 */ cvt.s.w $f16, $f10 -/* B7D9DC 8010683C 460E8482 */ mul.s $f18, $f16, $f14 -/* B7D9E0 80106840 10000003 */ b .L80106850 -/* B7D9E4 80106844 46126001 */ sub.s $f0, $f12, $f18 -/* B7D9E8 80106848 10000001 */ b .L80106850 -/* B7D9EC 8010684C 00000000 */ nop -.L80106850: -/* B7D9F0 80106850 03E00008 */ jr $ra -/* B7D9F4 80106854 27BD0008 */ addiu $sp, $sp, 8 diff --git a/asm/code_80106860.s b/asm/code_80106860.s deleted file mode 100644 index 411a9f306d..0000000000 --- a/asm/code_80106860.s +++ /dev/null @@ -1,34 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .text - -.align 4 - -glabel func_80106860 -/* B7DA00 80106860 27BDFFF8 */ addiu $sp, $sp, -8 -/* B7DA04 80106864 AFA40004 */ sw $a0, 4($sp) -/* B7DA08 80106868 00C03825 */ move $a3, $a2 -/* B7DA0C 8010686C 10E00009 */ beqz $a3, .L80106894 -/* B7DA10 80106870 24C6FFFF */ addiu $a2, $a2, -1 -.L80106874: -/* B7DA14 80106874 8FAE0004 */ lw $t6, 4($sp) -/* B7DA18 80106878 A1C50000 */ sb $a1, ($t6) -/* B7DA1C 8010687C 8FAF0004 */ lw $t7, 4($sp) -/* B7DA20 80106880 25F80001 */ addiu $t8, $t7, 1 -/* B7DA24 80106884 AFB80004 */ sw $t8, 4($sp) -/* B7DA28 80106888 00C03825 */ move $a3, $a2 -/* B7DA2C 8010688C 14E0FFF9 */ bnez $a3, .L80106874 -/* B7DA30 80106890 24C6FFFF */ addiu $a2, $a2, -1 -.L80106894: -/* B7DA34 80106894 10000003 */ b .L801068A4 -/* B7DA38 80106898 00801025 */ move $v0, $a0 -/* B7DA3C 8010689C 10000001 */ b .L801068A4 -/* B7DA40 801068A0 00000000 */ nop -.L801068A4: -/* B7DA44 801068A4 03E00008 */ jr $ra -/* B7DA48 801068A8 27BD0008 */ addiu $sp, $sp, 8 diff --git a/asm/code_801068B0.s b/asm/code_801068B0.s deleted file mode 100644 index 32a5356df3..0000000000 --- a/asm/code_801068B0.s +++ /dev/null @@ -1,81 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .text - -.align 4 - -glabel func_801068B0 -/* B7DA50 801068B0 27BDFFF0 */ addiu $sp, $sp, -0x10 -/* B7DA54 801068B4 AFA4000C */ sw $a0, 0xc($sp) -/* B7DA58 801068B8 AFA50008 */ sw $a1, 8($sp) -/* B7DA5C 801068BC 8FAE000C */ lw $t6, 0xc($sp) -/* B7DA60 801068C0 8FAF0008 */ lw $t7, 8($sp) -/* B7DA64 801068C4 15CF0003 */ bne $t6, $t7, .L801068D4 -/* B7DA68 801068C8 00000000 */ nop -/* B7DA6C 801068CC 10000034 */ b .L801069A0 -/* B7DA70 801068D0 00801025 */ move $v0, $a0 -.L801068D4: -/* B7DA74 801068D4 8FB8000C */ lw $t8, 0xc($sp) -/* B7DA78 801068D8 8FB90008 */ lw $t9, 8($sp) -/* B7DA7C 801068DC 0319082B */ sltu $at, $t8, $t9 -/* B7DA80 801068E0 10200013 */ beqz $at, .L80106930 -/* B7DA84 801068E4 00000000 */ nop -/* B7DA88 801068E8 00C03825 */ move $a3, $a2 -/* B7DA8C 801068EC 10E0000E */ beqz $a3, .L80106928 -/* B7DA90 801068F0 24C6FFFF */ addiu $a2, $a2, -1 -.L801068F4: -/* B7DA94 801068F4 8FA80008 */ lw $t0, 8($sp) -/* B7DA98 801068F8 8FAA000C */ lw $t2, 0xc($sp) -/* B7DA9C 801068FC 91090000 */ lbu $t1, ($t0) -/* B7DAA0 80106900 A1490000 */ sb $t1, ($t2) -/* B7DAA4 80106904 8FAD0008 */ lw $t5, 8($sp) -/* B7DAA8 80106908 8FAB000C */ lw $t3, 0xc($sp) -/* B7DAAC 8010690C 25AE0001 */ addiu $t6, $t5, 1 -/* B7DAB0 80106910 256C0001 */ addiu $t4, $t3, 1 -/* B7DAB4 80106914 AFAC000C */ sw $t4, 0xc($sp) -/* B7DAB8 80106918 AFAE0008 */ sw $t6, 8($sp) -/* B7DABC 8010691C 00C03825 */ move $a3, $a2 -/* B7DAC0 80106920 14E0FFF4 */ bnez $a3, .L801068F4 -/* B7DAC4 80106924 24C6FFFF */ addiu $a2, $a2, -1 -.L80106928: -/* B7DAC8 80106928 10000019 */ b .L80106990 -/* B7DACC 8010692C 00000000 */ nop -.L80106930: -/* B7DAD0 80106930 8FAF000C */ lw $t7, 0xc($sp) -/* B7DAD4 80106934 01E6C021 */ addu $t8, $t7, $a2 -/* B7DAD8 80106938 2719FFFF */ addiu $t9, $t8, -1 -/* B7DADC 8010693C AFB9000C */ sw $t9, 0xc($sp) -/* B7DAE0 80106940 8FA80008 */ lw $t0, 8($sp) -/* B7DAE4 80106944 01064821 */ addu $t1, $t0, $a2 -/* B7DAE8 80106948 252AFFFF */ addiu $t2, $t1, -1 -/* B7DAEC 8010694C AFAA0008 */ sw $t2, 8($sp) -/* B7DAF0 80106950 00C03825 */ move $a3, $a2 -/* B7DAF4 80106954 10E0000E */ beqz $a3, .L80106990 -/* B7DAF8 80106958 24C6FFFF */ addiu $a2, $a2, -1 -.L8010695C: -/* B7DAFC 8010695C 8FAB0008 */ lw $t3, 8($sp) -/* B7DB00 80106960 8FAD000C */ lw $t5, 0xc($sp) -/* B7DB04 80106964 916C0000 */ lbu $t4, ($t3) -/* B7DB08 80106968 A1AC0000 */ sb $t4, ($t5) -/* B7DB0C 8010696C 8FB80008 */ lw $t8, 8($sp) -/* B7DB10 80106970 8FAE000C */ lw $t6, 0xc($sp) -/* B7DB14 80106974 2719FFFF */ addiu $t9, $t8, -1 -/* B7DB18 80106978 25CFFFFF */ addiu $t7, $t6, -1 -/* B7DB1C 8010697C AFAF000C */ sw $t7, 0xc($sp) -/* B7DB20 80106980 AFB90008 */ sw $t9, 8($sp) -/* B7DB24 80106984 00C03825 */ move $a3, $a2 -/* B7DB28 80106988 14E0FFF4 */ bnez $a3, .L8010695C -/* B7DB2C 8010698C 24C6FFFF */ addiu $a2, $a2, -1 -.L80106990: -/* B7DB30 80106990 10000003 */ b .L801069A0 -/* B7DB34 80106994 00801025 */ move $v0, $a0 -/* B7DB38 80106998 10000001 */ b .L801069A0 -/* B7DB3C 8010699C 00000000 */ nop -.L801069A0: -/* B7DB40 801069A0 03E00008 */ jr $ra -/* B7DB44 801069A4 27BD0010 */ addiu $sp, $sp, 0x10 diff --git a/include/functions.h b/include/functions.h index ecf95607cf..f6e395c7ca 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2408,7 +2408,7 @@ OSThread* __osGetCurrFaultedThread(); // ? __osSpSetPc(?); f32 absf(f32); void* func_80106860(void* ptr, s32 val, size_t size); -// ? func_801068B0(?); +void* func_801068B0(void* dst, void* src, size_t size); // ? func_801069B0(?); u8 func_80106BC8(GlobalContext* globalCtx); // ? func_80106C88(?); diff --git a/makefile b/makefile index 2052ddb974..5e64044a47 100644 --- a/makefile +++ b/makefile @@ -106,6 +106,9 @@ build/src/code/fault.o: CFLAGS += -trapuv build/src/code/fault.o: OPTIMIZATION := -O2 -g3 build/src/code/fault_drawer.o: CFLAGS += -trapuv build/src/code/fault_drawer.o: OPTIMIZATION := -O2 -g3 +build/src/code/code_801068B0.o: OPTIMIZATION := -g +build/src/code/code_80106860.o: OPTIMIZATION := -g +build/src/code/code_801067F0.o: OPTIMIZATION := -g #### Main Targets ### diff --git a/spec b/spec index 241bdd257c..de37baf51f 100644 --- a/spec +++ b/spec @@ -566,9 +566,9 @@ beginseg include "build/src/libultra_code/__osSpSetPc.o" include "build/asm/code_801067D0.o" include "build/asm/code_801067E0.o" - include "build/asm/code_801067F0.o" - include "build/asm/code_80106860.o" - include "build/asm/code_801068B0.o" + include "build/src/code/code_801067F0.o" + include "build/src/code/code_80106860.o" + include "build/src/code/code_801068B0.o" include "build/src/code/z_message_PAL.o" include "build/data/z_message_PAL.rodata.o" include "build/data/z_message_PAL.bss.o" diff --git a/src/code/code_801067F0.c b/src/code/code_801067F0.c new file mode 100644 index 0000000000..72f59a0510 --- /dev/null +++ b/src/code/code_801067F0.c @@ -0,0 +1,13 @@ +#include +#include + +// fmodf? unused +f32 func_801067F0(f32 arg0, f32 arg1) { + s32 sp4; + + if (arg1 == 0.0f) { + return 0.0f; + } + sp4 = arg0 / arg1; + return arg0 - (sp4 * arg1); +} diff --git a/src/code/code_80106860.c b/src/code/code_80106860.c new file mode 100644 index 0000000000..9d862014fb --- /dev/null +++ b/src/code/code_80106860.c @@ -0,0 +1,13 @@ +#include +#include + +// memset used in __osMalloc, z_quake, z_view, and z_camera +void* func_80106860(void* ptr, s32 val, size_t size) { + u8* sp4 = ptr; + register s32 a3; + + for (a3 = size--; a3 != 0; a3 = size--) { + *sp4++ = val; + } + return ptr; +} diff --git a/src/code/code_801068B0.c b/src/code/code_801068B0.c new file mode 100644 index 0000000000..bf3ae57447 --- /dev/null +++ b/src/code/code_801068B0.c @@ -0,0 +1,28 @@ +#include +#include + +// memcpy used in __osMalloc.c +void* func_801068B0(void* dst, void* src, size_t size) { + u8* spC; + u8* sp8; + register s32 a3; + + spC = dst; + sp8 = src; + + if (spC == sp8) { + return dst; + } + if (spC < sp8) { + for (a3 = size--; a3 != 0; a3 = size--) { + *spC++ = *sp8++; + } + } else { + spC += size - 1; + sp8 += size - 1; + for (a3 = size--; a3 != 0; a3 = size--) { + *spC-- = *sp8--; + } + } + return dst; +}