From a8e984d2fd99150f5c9fe08af67f17edc6d8a0d3 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sat, 9 Jul 2022 05:05:11 -0600 Subject: [PATCH] Decomp 800 byte sized funcs and smaller (#241) * Decomp 800 byte sized funcs and below --- .../code_80005FD0/func_8001A0A4.s | 15 --- .../code_80005FD0/func_8001A0DC.s | 19 --- .../code_80005FD0/func_8001A310.s | 16 --- .../code_800431B0/func_8004CB60.s | 13 -- .../code_800431B0/func_80057778.s | 12 -- .../code_80071F00/func_8007223C.s | 15 --- .../code_80071F00/func_80072270.s | 15 --- .../code_80071F00/func_80072320.s | 15 --- .../code_80071F00/func_80072354.s | 15 --- .../code_80071F00/func_8007A910.s | 16 --- .../code_80071F00/func_8007AF40.s | 15 --- .../code_80071F00/func_8007AF78.s | 15 --- .../code_80071F00/func_8007BDA8.s | 15 --- .../code_80086E70/func_8008B7D4.s | 15 --- .../code_80086E70/func_8008B80C.s | 15 --- .../code_80086E70/func_8008B844.s | 18 --- .../code_80086E70/func_8008B888.s | 14 -- .../code_80086E70/func_8008B8BC.s | 14 -- .../{func_8008B8F0.s => func_8008B928.s} | 18 +-- .../code_80091750/func_800925CC.s | 16 --- asm/non_matchings/math_util/func_802B51E8.s | 17 --- include/common_structs.h | 20 +-- src/code_80005FD0.c | 34 +---- src/code_80071F00.c | 117 +++++----------- src/code_80086E70.c | 127 +++++++----------- src/code_80091750.c | 14 +- 26 files changed, 101 insertions(+), 534 deletions(-) delete mode 100644 asm/non_matchings/code_80005FD0/func_8001A0A4.s delete mode 100644 asm/non_matchings/code_80005FD0/func_8001A0DC.s delete mode 100644 asm/non_matchings/code_80005FD0/func_8001A310.s delete mode 100644 asm/non_matchings/code_800431B0/func_8004CB60.s delete mode 100644 asm/non_matchings/code_800431B0/func_80057778.s delete mode 100644 asm/non_matchings/code_80071F00/func_8007223C.s delete mode 100644 asm/non_matchings/code_80071F00/func_80072270.s delete mode 100644 asm/non_matchings/code_80071F00/func_80072320.s delete mode 100644 asm/non_matchings/code_80071F00/func_80072354.s delete mode 100644 asm/non_matchings/code_80071F00/func_8007A910.s delete mode 100644 asm/non_matchings/code_80071F00/func_8007AF40.s delete mode 100644 asm/non_matchings/code_80071F00/func_8007AF78.s delete mode 100644 asm/non_matchings/code_80071F00/func_8007BDA8.s delete mode 100644 asm/non_matchings/code_80086E70/func_8008B7D4.s delete mode 100644 asm/non_matchings/code_80086E70/func_8008B80C.s delete mode 100644 asm/non_matchings/code_80086E70/func_8008B844.s delete mode 100644 asm/non_matchings/code_80086E70/func_8008B888.s delete mode 100644 asm/non_matchings/code_80086E70/func_8008B8BC.s rename asm/non_matchings/code_80086E70/{func_8008B8F0.s => func_8008B928.s} (86%) delete mode 100644 asm/non_matchings/code_80091750/func_800925CC.s delete mode 100644 asm/non_matchings/math_util/func_802B51E8.s diff --git a/asm/non_matchings/code_80005FD0/func_8001A0A4.s b/asm/non_matchings/code_80005FD0/func_8001A0A4.s deleted file mode 100644 index 45254be7a..000000000 --- a/asm/non_matchings/code_80005FD0/func_8001A0A4.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_8001A0A4 -/* 01ACA4 8001A0A4 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 01ACA8 8001A0A8 AFBF0014 */ sw $ra, 0x14($sp) -/* 01ACAC 8001A0AC AFA40018 */ sw $a0, 0x18($sp) -/* 01ACB0 8001A0B0 AFA5001C */ sw $a1, 0x1c($sp) -/* 01ACB4 8001A0B4 AFA60020 */ sw $a2, 0x20($sp) -/* 01ACB8 8001A0B8 AFA70024 */ sw $a3, 0x24($sp) -/* 01ACBC 8001A0BC 0C0067ED */ jal func_80019FB4 -/* 01ACC0 8001A0C0 8FA40028 */ lw $a0, 0x28($sp) -/* 01ACC4 8001A0C4 0C006714 */ jal func_80019C50 -/* 01ACC8 8001A0C8 8FA40028 */ lw $a0, 0x28($sp) -/* 01ACCC 8001A0CC 8FBF0014 */ lw $ra, 0x14($sp) -/* 01ACD0 8001A0D0 27BD0018 */ addiu $sp, $sp, 0x18 -/* 01ACD4 8001A0D4 03E00008 */ jr $ra -/* 01ACD8 8001A0D8 00000000 */ nop diff --git a/asm/non_matchings/code_80005FD0/func_8001A0DC.s b/asm/non_matchings/code_80005FD0/func_8001A0DC.s deleted file mode 100644 index bb680e5f7..000000000 --- a/asm/non_matchings/code_80005FD0/func_8001A0DC.s +++ /dev/null @@ -1,19 +0,0 @@ -glabel func_8001A0DC -/* 01ACDC 8001A0DC 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 01ACE0 8001A0E0 8FB80030 */ lw $t8, 0x30($sp) -/* 01ACE4 8001A0E4 AFBF001C */ sw $ra, 0x1c($sp) -/* 01ACE8 8001A0E8 AFA7002C */ sw $a3, 0x2c($sp) -/* 01ACEC 8001A0EC 00077600 */ sll $t6, $a3, 0x18 -/* 01ACF0 8001A0F0 000E3E03 */ sra $a3, $t6, 0x18 -/* 01ACF4 8001A0F4 AFA50024 */ sw $a1, 0x24($sp) -/* 01ACF8 8001A0F8 AFA60028 */ sw $a2, 0x28($sp) -/* 01ACFC 8001A0FC 0C006829 */ jal func_8001A0A4 -/* 01AD00 8001A100 AFB80010 */ sw $t8, 0x10($sp) -/* 01AD04 8001A104 8FA40024 */ lw $a0, 0x24($sp) -/* 01AD08 8001A108 8FA50028 */ lw $a1, 0x28($sp) -/* 01AD0C 8001A10C 0C00674B */ jal func_80019D2C -/* 01AD10 8001A110 8FA60030 */ lw $a2, 0x30($sp) -/* 01AD14 8001A114 8FBF001C */ lw $ra, 0x1c($sp) -/* 01AD18 8001A118 27BD0020 */ addiu $sp, $sp, 0x20 -/* 01AD1C 8001A11C 03E00008 */ jr $ra -/* 01AD20 8001A120 00000000 */ nop diff --git a/asm/non_matchings/code_80005FD0/func_8001A310.s b/asm/non_matchings/code_80005FD0/func_8001A310.s deleted file mode 100644 index b491f9d9d..000000000 --- a/asm/non_matchings/code_80005FD0/func_8001A310.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_8001A310 -/* 01AF10 8001A310 3C0E800E */ lui $t6, %hi(gCurrentCourseId) -/* 01AF14 8001A314 85CEC5A0 */ lh $t6, %lo(gCurrentCourseId)($t6) -/* 01AF18 8001A318 24010002 */ li $at, 2 -/* 01AF1C 8001A31C 15C10008 */ bne $t6, $at, .L8001A340 -/* 01AF20 8001A320 00000000 */ nop -/* 01AF24 8001A324 10A00006 */ beqz $a1, .L8001A340 -/* 01AF28 8001A328 288100E7 */ slti $at, $a0, 0xe7 -/* 01AF2C 8001A32C 14200004 */ bnez $at, .L8001A340 -/* 01AF30 8001A330 288101C2 */ slti $at, $a0, 0x1c2 -/* 01AF34 8001A334 10200002 */ beqz $at, .L8001A340 -/* 01AF38 8001A338 00000000 */ nop -/* 01AF3C 8001A33C 00002825 */ move $a1, $zero -.L8001A340: -/* 01AF40 8001A340 03E00008 */ jr $ra -/* 01AF44 8001A344 00A01025 */ move $v0, $a1 diff --git a/asm/non_matchings/code_800431B0/func_8004CB60.s b/asm/non_matchings/code_800431B0/func_8004CB60.s deleted file mode 100644 index 8f2305f46..000000000 --- a/asm/non_matchings/code_800431B0/func_8004CB60.s +++ /dev/null @@ -1,13 +0,0 @@ -glabel func_8004CB60 -/* 04D760 8004CB60 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 04D764 8004CB64 AFA60028 */ sw $a2, 0x28($sp) -/* 04D768 8004CB68 8FAE0028 */ lw $t6, 0x28($sp) -/* 04D76C 8004CB6C AFBF001C */ sw $ra, 0x1c($sp) -/* 04D770 8004CB70 24060020 */ li $a2, 32 -/* 04D774 8004CB74 24070008 */ li $a3, 8 -/* 04D778 8004CB78 0C0130D9 */ jal func_8004C364 -/* 04D77C 8004CB7C AFAE0010 */ sw $t6, 0x10($sp) -/* 04D780 8004CB80 8FBF001C */ lw $ra, 0x1c($sp) -/* 04D784 8004CB84 27BD0020 */ addiu $sp, $sp, 0x20 -/* 04D788 8004CB88 03E00008 */ jr $ra -/* 04D78C 8004CB8C 00000000 */ nop diff --git a/asm/non_matchings/code_800431B0/func_80057778.s b/asm/non_matchings/code_800431B0/func_80057778.s deleted file mode 100644 index 4a133a7ec..000000000 --- a/asm/non_matchings/code_800431B0/func_80057778.s +++ /dev/null @@ -1,12 +0,0 @@ -glabel func_80057778 -/* 058378 80057778 3C048015 */ lui $a0, %hi(gDisplayListHead) # $a0, 0x8015 -/* 05837C 8005777C 24840298 */ addiu $a0, %lo(gDisplayListHead) # addiu $a0, $a0, 0x298 -/* 058380 80057780 8C830000 */ lw $v1, ($a0) -/* 058384 80057784 3C180D00 */ lui $t8, %hi(D_0D007EB8) # $t8, 0xd00 -/* 058388 80057788 27187EB8 */ addiu $t8, %lo(D_0D007EB8) # addiu $t8, $t8, 0x7eb8 -/* 05838C 8005778C 246E0008 */ addiu $t6, $v1, 8 -/* 058390 80057790 AC8E0000 */ sw $t6, ($a0) -/* 058394 80057794 3C0F0600 */ lui $t7, 0x600 -/* 058398 80057798 AC6F0000 */ sw $t7, ($v1) -/* 05839C 8005779C 03E00008 */ jr $ra -/* 0583A0 800577A0 AC780004 */ sw $t8, 4($v1) diff --git a/asm/non_matchings/code_80071F00/func_8007223C.s b/asm/non_matchings/code_80071F00/func_8007223C.s deleted file mode 100644 index ac7e095cf..000000000 --- a/asm/non_matchings/code_80071F00/func_8007223C.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_8007223C -/* 072E3C 8007223C 000470C0 */ sll $t6, $a0, 3 -/* 072E40 80072240 01C47023 */ subu $t6, $t6, $a0 -/* 072E44 80072244 000E7140 */ sll $t6, $t6, 5 -/* 072E48 80072248 3C0F8016 */ lui $t7, %hi(D_80165C6C) # 0x8016 -/* 072E4C 8007224C 01EE7821 */ addu $t7, $t7, $t6 -/* 072E50 80072250 8DEF5C6C */ lw $t7, %lo(D_80165C6C)($t7) # 0x5c6c($t7) -/* 072E54 80072254 00001825 */ move $v1, $zero -/* 072E58 80072258 01E5C024 */ and $t8, $t7, $a1 -/* 072E5C 8007225C 13000002 */ beqz $t8, .L80072268 -/* 072E60 80072260 00000000 */ nop -/* 072E64 80072264 24030001 */ li $v1, 1 -.L80072268: -/* 072E68 80072268 03E00008 */ jr $ra -/* 072E6C 8007226C 00601025 */ move $v0, $v1 diff --git a/asm/non_matchings/code_80071F00/func_80072270.s b/asm/non_matchings/code_80071F00/func_80072270.s deleted file mode 100644 index f45cfda23..000000000 --- a/asm/non_matchings/code_80071F00/func_80072270.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_80072270 -/* 072E70 80072270 000470C0 */ sll $t6, $a0, 3 -/* 072E74 80072274 01C47023 */ subu $t6, $t6, $a0 -/* 072E78 80072278 000E7140 */ sll $t6, $t6, 5 -/* 072E7C 8007227C 3C0F8016 */ lui $t7, %hi(D_80165C6C) # 0x8016 -/* 072E80 80072280 01EE7821 */ addu $t7, $t7, $t6 -/* 072E84 80072284 8DEF5C6C */ lw $t7, %lo(D_80165C6C)($t7) # 0x5c6c($t7) -/* 072E88 80072288 00001825 */ move $v1, $zero -/* 072E8C 8007228C 01E5C024 */ and $t8, $t7, $a1 -/* 072E90 80072290 17000002 */ bnez $t8, .L8007229C -/* 072E94 80072294 00000000 */ nop -/* 072E98 80072298 24030001 */ li $v1, 1 -.L8007229C: -/* 072E9C 8007229C 03E00008 */ jr $ra -/* 072EA0 800722A0 00601025 */ move $v0, $v1 diff --git a/asm/non_matchings/code_80071F00/func_80072320.s b/asm/non_matchings/code_80071F00/func_80072320.s deleted file mode 100644 index 16d1c2e30..000000000 --- a/asm/non_matchings/code_80071F00/func_80072320.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_80072320 -/* 072F20 80072320 000470C0 */ sll $t6, $a0, 3 -/* 072F24 80072324 01C47023 */ subu $t6, $t6, $a0 -/* 072F28 80072328 000E7140 */ sll $t6, $t6, 5 -/* 072F2C 8007232C 3C0F8016 */ lui $t7, %hi(D_80165C70) # 0x8016 -/* 072F30 80072330 01EE7821 */ addu $t7, $t7, $t6 -/* 072F34 80072334 8DEF5C70 */ lw $t7, %lo(D_80165C70)($t7) # 0x5c70($t7) -/* 072F38 80072338 00001825 */ move $v1, $zero -/* 072F3C 8007233C 01E5C024 */ and $t8, $t7, $a1 -/* 072F40 80072340 13000002 */ beqz $t8, .L8007234C -/* 072F44 80072344 00000000 */ nop -/* 072F48 80072348 24030001 */ li $v1, 1 -.L8007234C: -/* 072F4C 8007234C 03E00008 */ jr $ra -/* 072F50 80072350 00601025 */ move $v0, $v1 diff --git a/asm/non_matchings/code_80071F00/func_80072354.s b/asm/non_matchings/code_80071F00/func_80072354.s deleted file mode 100644 index ba46f264f..000000000 --- a/asm/non_matchings/code_80071F00/func_80072354.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_80072354 -/* 072F54 80072354 000470C0 */ sll $t6, $a0, 3 -/* 072F58 80072358 01C47023 */ subu $t6, $t6, $a0 -/* 072F5C 8007235C 000E7140 */ sll $t6, $t6, 5 -/* 072F60 80072360 3C0F8016 */ lui $t7, %hi(D_80165C70) # 0x8016 -/* 072F64 80072364 01EE7821 */ addu $t7, $t7, $t6 -/* 072F68 80072368 8DEF5C70 */ lw $t7, %lo(D_80165C70)($t7) # 0x5c70($t7) -/* 072F6C 8007236C 00001825 */ move $v1, $zero -/* 072F70 80072370 01E5C024 */ and $t8, $t7, $a1 -/* 072F74 80072374 17000002 */ bnez $t8, .L80072380 -/* 072F78 80072378 00000000 */ nop -/* 072F7C 8007237C 24030001 */ li $v1, 1 -.L80072380: -/* 072F80 80072380 03E00008 */ jr $ra -/* 072F84 80072384 00601025 */ move $v0, $v1 diff --git a/asm/non_matchings/code_80071F00/func_8007A910.s b/asm/non_matchings/code_80071F00/func_8007A910.s deleted file mode 100644 index 2b23728de..000000000 --- a/asm/non_matchings/code_80071F00/func_8007A910.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_8007A910 -/* 07B510 8007A910 3C0E8016 */ lui $t6, %hi(D_801657B4) # $t6, 0x8016 -/* 07B514 8007A914 81CE57B4 */ lb $t6, %lo(D_801657B4)($t6) -/* 07B518 8007A918 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 07B51C 8007A91C AFBF0014 */ sw $ra, 0x14($sp) -/* 07B520 8007A920 15C00003 */ bnez $t6, .L8007A930 -/* 07B524 8007A924 AFA40018 */ sw $a0, 0x18($sp) -/* 07B528 8007A928 0C01EA23 */ jal func_8007A88C -/* 07B52C 8007A92C 00000000 */ nop -.L8007A930: -/* 07B530 8007A930 0C01E618 */ jal func_80079860 -/* 07B534 8007A934 8FA40018 */ lw $a0, 0x18($sp) -/* 07B538 8007A938 8FBF0014 */ lw $ra, 0x14($sp) -/* 07B53C 8007A93C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 07B540 8007A940 03E00008 */ jr $ra -/* 07B544 8007A944 00000000 */ nop diff --git a/asm/non_matchings/code_80071F00/func_8007AF40.s b/asm/non_matchings/code_80071F00/func_8007AF40.s deleted file mode 100644 index 0c4a2c996..000000000 --- a/asm/non_matchings/code_80071F00/func_8007AF40.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_8007AF40 -/* 07BB40 8007AF40 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 07BB44 8007AF44 AFA40018 */ sw $a0, 0x18($sp) -/* 07BB48 8007AF48 00A07025 */ move $t6, $a1 -/* 07BB4C 8007AF4C 000E2400 */ sll $a0, $t6, 0x10 -/* 07BB50 8007AF50 AFBF0014 */ sw $ra, 0x14($sp) -/* 07BB54 8007AF54 AFA5001C */ sw $a1, 0x1c($sp) -/* 07BB58 8007AF58 00047C03 */ sra $t7, $a0, 0x10 -/* 07BB5C 8007AF5C 01E02025 */ move $a0, $t7 -/* 07BB60 8007AF60 0C01EB6A */ jal gen_random_item -/* 07BB64 8007AF64 00002825 */ move $a1, $zero -/* 07BB68 8007AF68 8FBF0014 */ lw $ra, 0x14($sp) -/* 07BB6C 8007AF6C 27BD0018 */ addiu $sp, $sp, 0x18 -/* 07BB70 8007AF70 03E00008 */ jr $ra -/* 07BB74 8007AF74 00000000 */ nop diff --git a/asm/non_matchings/code_80071F00/func_8007AF78.s b/asm/non_matchings/code_80071F00/func_8007AF78.s deleted file mode 100644 index 0439c1de9..000000000 --- a/asm/non_matchings/code_80071F00/func_8007AF78.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_8007AF78 -/* 07BB78 8007AF78 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 07BB7C 8007AF7C AFA40018 */ sw $a0, 0x18($sp) -/* 07BB80 8007AF80 00A07025 */ move $t6, $a1 -/* 07BB84 8007AF84 000E2400 */ sll $a0, $t6, 0x10 -/* 07BB88 8007AF88 AFBF0014 */ sw $ra, 0x14($sp) -/* 07BB8C 8007AF8C AFA5001C */ sw $a1, 0x1c($sp) -/* 07BB90 8007AF90 00047C03 */ sra $t7, $a0, 0x10 -/* 07BB94 8007AF94 01E02025 */ move $a0, $t7 -/* 07BB98 8007AF98 0C01EB6A */ jal gen_random_item -/* 07BB9C 8007AF9C 24050001 */ li $a1, 1 -/* 07BBA0 8007AFA0 8FBF0014 */ lw $ra, 0x14($sp) -/* 07BBA4 8007AFA4 27BD0018 */ addiu $sp, $sp, 0x18 -/* 07BBA8 8007AFA8 03E00008 */ jr $ra -/* 07BBAC 8007AFAC 00000000 */ nop diff --git a/asm/non_matchings/code_80071F00/func_8007BDA8.s b/asm/non_matchings/code_80071F00/func_8007BDA8.s deleted file mode 100644 index 4dc23fe50..000000000 --- a/asm/non_matchings/code_80071F00/func_8007BDA8.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_8007BDA8 -/* 07C9A8 8007BDA8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 07C9AC 8007BDAC AFBF0014 */ sw $ra, 0x14($sp) -/* 07C9B0 8007BDB0 0C01EF41 */ jal func_8007BD04 -/* 07C9B4 8007BDB4 00002025 */ move $a0, $zero -/* 07C9B8 8007BDB8 3C048018 */ lui $a0, %hi(D_80183F28) # $a0, 0x8018 -/* 07C9BC 8007BDBC 8C843F28 */ lw $a0, %lo(D_80183F28)($a0) -/* 07C9C0 8007BDC0 0C01EEEF */ jal func_8007BBBC -/* 07C9C4 8007BDC4 AFA40018 */ sw $a0, 0x18($sp) -/* 07C9C8 8007BDC8 0C022FC6 */ jal func_8008BF18 -/* 07C9CC 8007BDCC 8FA40018 */ lw $a0, 0x18($sp) -/* 07C9D0 8007BDD0 8FBF0014 */ lw $ra, 0x14($sp) -/* 07C9D4 8007BDD4 27BD0020 */ addiu $sp, $sp, 0x20 -/* 07C9D8 8007BDD8 03E00008 */ jr $ra -/* 07C9DC 8007BDDC 00000000 */ nop diff --git a/asm/non_matchings/code_80086E70/func_8008B7D4.s b/asm/non_matchings/code_80086E70/func_8008B7D4.s deleted file mode 100644 index 5e7997673..000000000 --- a/asm/non_matchings/code_80086E70/func_8008B7D4.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_8008B7D4 -/* 08C3D4 8008B7D4 000470C0 */ sll $t6, $a0, 3 -/* 08C3D8 8008B7D8 01C47023 */ subu $t6, $t6, $a0 -/* 08C3DC 8008B7DC 3C0F8016 */ lui $t7, %hi(D_80165C18) # $t7, 0x8016 -/* 08C3E0 8008B7E0 AFA7000C */ sw $a3, 0xc($sp) -/* 08C3E4 8008B7E4 25EF5C18 */ addiu $t7, %lo(D_80165C18) # addiu $t7, $t7, 0x5c18 -/* 08C3E8 8008B7E8 000E7140 */ sll $t6, $t6, 5 -/* 08C3EC 8008B7EC 44856000 */ mtc1 $a1, $f12 -/* 08C3F0 8008B7F0 44867000 */ mtc1 $a2, $f14 -/* 08C3F4 8008B7F4 C7A4000C */ lwc1 $f4, 0xc($sp) -/* 08C3F8 8008B7F8 01CF1021 */ addu $v0, $t6, $t7 -/* 08C3FC 8008B7FC E44C0010 */ swc1 $f12, 0x10($v0) -/* 08C400 8008B800 E44E0014 */ swc1 $f14, 0x14($v0) -/* 08C404 8008B804 03E00008 */ jr $ra -/* 08C408 8008B808 E4440018 */ swc1 $f4, 0x18($v0) diff --git a/asm/non_matchings/code_80086E70/func_8008B80C.s b/asm/non_matchings/code_80086E70/func_8008B80C.s deleted file mode 100644 index bfab6eee1..000000000 --- a/asm/non_matchings/code_80086E70/func_8008B80C.s +++ /dev/null @@ -1,15 +0,0 @@ -glabel func_8008B80C -/* 08C40C 8008B80C 000470C0 */ sll $t6, $a0, 3 -/* 08C410 8008B810 01C47023 */ subu $t6, $t6, $a0 -/* 08C414 8008B814 3C0F8016 */ lui $t7, %hi(D_80165C18) # $t7, 0x8016 -/* 08C418 8008B818 AFA7000C */ sw $a3, 0xc($sp) -/* 08C41C 8008B81C 25EF5C18 */ addiu $t7, %lo(D_80165C18) # addiu $t7, $t7, 0x5c18 -/* 08C420 8008B820 000E7140 */ sll $t6, $t6, 5 -/* 08C424 8008B824 44856000 */ mtc1 $a1, $f12 -/* 08C428 8008B828 44867000 */ mtc1 $a2, $f14 -/* 08C42C 8008B82C C7A4000C */ lwc1 $f4, 0xc($sp) -/* 08C430 8008B830 01CF1021 */ addu $v0, $t6, $t7 -/* 08C434 8008B834 E44C0028 */ swc1 $f12, 0x28($v0) -/* 08C438 8008B838 E44E002C */ swc1 $f14, 0x2c($v0) -/* 08C43C 8008B83C 03E00008 */ jr $ra -/* 08C440 8008B840 E4440030 */ swc1 $f4, 0x30($v0) diff --git a/asm/non_matchings/code_80086E70/func_8008B844.s b/asm/non_matchings/code_80086E70/func_8008B844.s deleted file mode 100644 index 826589862..000000000 --- a/asm/non_matchings/code_80086E70/func_8008B844.s +++ /dev/null @@ -1,18 +0,0 @@ -glabel func_8008B844 -/* 08C444 8008B844 000470C0 */ sll $t6, $a0, 3 -/* 08C448 8008B848 01C47023 */ subu $t6, $t6, $a0 -/* 08C44C 8008B84C 3C0F8016 */ lui $t7, %hi(D_80165C18) # $t7, 0x8016 -/* 08C450 8008B850 25EF5C18 */ addiu $t7, %lo(D_80165C18) # addiu $t7, $t7, 0x5c18 -/* 08C454 8008B854 000E7140 */ sll $t6, $t6, 5 -/* 08C458 8008B858 01CF1021 */ addu $v0, $t6, $t7 -/* 08C45C 8008B85C C4400010 */ lwc1 $f0, 0x10($v0) -/* 08C460 8008B860 C4440028 */ lwc1 $f4, 0x28($v0) -/* 08C464 8008B864 C448002C */ lwc1 $f8, 0x2c($v0) -/* 08C468 8008B868 C4500030 */ lwc1 $f16, 0x30($v0) -/* 08C46C 8008B86C 46002180 */ add.s $f6, $f4, $f0 -/* 08C470 8008B870 46004280 */ add.s $f10, $f8, $f0 -/* 08C474 8008B874 E4460004 */ swc1 $f6, 4($v0) -/* 08C478 8008B878 46008480 */ add.s $f18, $f16, $f0 -/* 08C47C 8008B87C E44A0008 */ swc1 $f10, 8($v0) -/* 08C480 8008B880 03E00008 */ jr $ra -/* 08C484 8008B884 E452000C */ swc1 $f18, 0xc($v0) diff --git a/asm/non_matchings/code_80086E70/func_8008B888.s b/asm/non_matchings/code_80086E70/func_8008B888.s deleted file mode 100644 index eddd51036..000000000 --- a/asm/non_matchings/code_80086E70/func_8008B888.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel func_8008B888 -/* 08C488 8008B888 0004C8C0 */ sll $t9, $a0, 3 -/* 08C48C 8008B88C 0324C823 */ subu $t9, $t9, $a0 -/* 08C490 8008B890 3C088016 */ lui $t0, %hi(D_80165C18) # $t0, 0x8016 -/* 08C494 8008B894 25085C18 */ addiu $t0, %lo(D_80165C18) # addiu $t0, $t0, 0x5c18 -/* 08C498 8008B898 0019C940 */ sll $t9, $t9, 5 -/* 08C49C 8008B89C 03281021 */ addu $v0, $t9, $t0 -/* 08C4A0 8008B8A0 AFA50004 */ sw $a1, 4($sp) -/* 08C4A4 8008B8A4 AFA60008 */ sw $a2, 8($sp) -/* 08C4A8 8008B8A8 AFA7000C */ sw $a3, 0xc($sp) -/* 08C4AC 8008B8AC A44500BE */ sh $a1, 0xbe($v0) -/* 08C4B0 8008B8B0 A44600C0 */ sh $a2, 0xc0($v0) -/* 08C4B4 8008B8B4 03E00008 */ jr $ra -/* 08C4B8 8008B8B8 A44700C2 */ sh $a3, 0xc2($v0) diff --git a/asm/non_matchings/code_80086E70/func_8008B8BC.s b/asm/non_matchings/code_80086E70/func_8008B8BC.s deleted file mode 100644 index 08f5fca1e..000000000 --- a/asm/non_matchings/code_80086E70/func_8008B8BC.s +++ /dev/null @@ -1,14 +0,0 @@ -glabel func_8008B8BC -/* 08C4BC 8008B8BC 0004C8C0 */ sll $t9, $a0, 3 -/* 08C4C0 8008B8C0 0324C823 */ subu $t9, $t9, $a0 -/* 08C4C4 8008B8C4 3C088016 */ lui $t0, %hi(D_80165C18) # $t0, 0x8016 -/* 08C4C8 8008B8C8 25085C18 */ addiu $t0, %lo(D_80165C18) # addiu $t0, $t0, 0x5c18 -/* 08C4CC 8008B8CC 0019C940 */ sll $t9, $t9, 5 -/* 08C4D0 8008B8D0 03281021 */ addu $v0, $t9, $t0 -/* 08C4D4 8008B8D4 AFA50004 */ sw $a1, 4($sp) -/* 08C4D8 8008B8D8 AFA60008 */ sw $a2, 8($sp) -/* 08C4DC 8008B8DC AFA7000C */ sw $a3, 0xc($sp) -/* 08C4E0 8008B8E0 A44500B2 */ sh $a1, 0xb2($v0) -/* 08C4E4 8008B8E4 A44600B4 */ sh $a2, 0xb4($v0) -/* 08C4E8 8008B8E8 03E00008 */ jr $ra -/* 08C4EC 8008B8EC A44700B6 */ sh $a3, 0xb6($v0) diff --git a/asm/non_matchings/code_80086E70/func_8008B8F0.s b/asm/non_matchings/code_80086E70/func_8008B928.s similarity index 86% rename from asm/non_matchings/code_80086E70/func_8008B8F0.s rename to asm/non_matchings/code_80086E70/func_8008B928.s index 3a6f8c1d9..29d02f881 100644 --- a/asm/non_matchings/code_80086E70/func_8008B8F0.s +++ b/asm/non_matchings/code_80086E70/func_8008B928.s @@ -1,19 +1,4 @@ -glabel func_8008B8F0 -/* 08C4F0 8008B8F0 000470C0 */ sll $t6, $a0, 3 -/* 08C4F4 8008B8F4 01C47023 */ subu $t6, $t6, $a0 -/* 08C4F8 8008B8F8 3C0F8016 */ lui $t7, %hi(D_80165C18) # $t7, 0x8016 -/* 08C4FC 8008B8FC AFA7000C */ sw $a3, 0xc($sp) -/* 08C500 8008B900 25EF5C18 */ addiu $t7, %lo(D_80165C18) # addiu $t7, $t7, 0x5c18 -/* 08C504 8008B904 000E7140 */ sll $t6, $t6, 5 -/* 08C508 8008B908 44856000 */ mtc1 $a1, $f12 -/* 08C50C 8008B90C 44867000 */ mtc1 $a2, $f14 -/* 08C510 8008B910 C7A4000C */ lwc1 $f4, 0xc($sp) -/* 08C514 8008B914 01CF1021 */ addu $v0, $t6, $t7 -/* 08C518 8008B918 E44C0038 */ swc1 $f12, 0x38($v0) -/* 08C51C 8008B91C E44E003C */ swc1 $f14, 0x3c($v0) -/* 08C520 8008B920 03E00008 */ jr $ra -/* 08C524 8008B924 E4440040 */ swc1 $f4, 0x40($v0) - +glabel func_8008B928 /* 08C528 8008B928 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 08C52C 8008B92C AFA50024 */ sw $a1, 0x24($sp) /* 08C530 8008B930 AFA60028 */ sw $a2, 0x28($sp) @@ -85,6 +70,7 @@ glabel func_8008B8F0 /* 08C638 8008BA38 03E00008 */ jr $ra /* 08C63C 8008BA3C 27BD0020 */ addiu $sp, $sp, 0x20 +glabel func_8008BA40 /* 08C640 8008BA40 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 08C644 8008BA44 AFBF0014 */ sw $ra, 0x14($sp) /* 08C648 8008BA48 AFA40018 */ sw $a0, 0x18($sp) diff --git a/asm/non_matchings/code_80091750/func_800925CC.s b/asm/non_matchings/code_80091750/func_800925CC.s deleted file mode 100644 index d871932e7..000000000 --- a/asm/non_matchings/code_80091750/func_800925CC.s +++ /dev/null @@ -1,16 +0,0 @@ -glabel func_800925CC -/* 0931CC 800925CC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0931D0 800925D0 AFBF0014 */ sw $ra, 0x14($sp) -/* 0931D4 800925D4 0C02ABBD */ jal find_8018D9E0_entry_dupe -/* 0931D8 800925D8 240400AF */ li $a0, 175 -/* 0931DC 800925DC 8C4E0004 */ lw $t6, 4($v0) -/* 0931E0 800925E0 24010002 */ li $at, 2 -/* 0931E4 800925E4 240F0003 */ li $t7, 3 -/* 0931E8 800925E8 55C10003 */ bnel $t6, $at, .L800925F8 -/* 0931EC 800925EC 8FBF0014 */ lw $ra, 0x14($sp) -/* 0931F0 800925F0 AC4F0004 */ sw $t7, 4($v0) -/* 0931F4 800925F4 8FBF0014 */ lw $ra, 0x14($sp) -.L800925F8: -/* 0931F8 800925F8 27BD0018 */ addiu $sp, $sp, 0x18 -/* 0931FC 800925FC 03E00008 */ jr $ra -/* 093200 80092600 00000000 */ nop diff --git a/asm/non_matchings/math_util/func_802B51E8.s b/asm/non_matchings/math_util/func_802B51E8.s deleted file mode 100644 index a183a1d88..000000000 --- a/asm/non_matchings/math_util/func_802B51E8.s +++ /dev/null @@ -1,17 +0,0 @@ -glabel func_802B51E8 -/* 11E7F8 802B51E8 C4A40000 */ lwc1 $f4, ($a1) -/* 11E7FC 802B51EC C4860000 */ lwc1 $f6, ($a0) -/* 11E800 802B51F0 C4A80004 */ lwc1 $f8, 4($a1) -/* 11E804 802B51F4 C48A0004 */ lwc1 $f10, 4($a0) -/* 11E808 802B51F8 46062081 */ sub.s $f2, $f4, $f6 -/* 11E80C 802B51FC C4B00008 */ lwc1 $f16, 8($a1) -/* 11E810 802B5200 C4920008 */ lwc1 $f18, 8($a0) -/* 11E814 802B5204 460A4301 */ sub.s $f12, $f8, $f10 -/* 11E818 802B5208 46021102 */ mul.s $f4, $f2, $f2 -/* 11E81C 802B520C 46128381 */ sub.s $f14, $f16, $f18 -/* 11E820 802B5210 460C6182 */ mul.s $f6, $f12, $f12 -/* 11E824 802B5214 46062200 */ add.s $f8, $f4, $f6 -/* 11E828 802B5218 460E4280 */ add.s $f10, $f8, $f14 -/* 11E82C 802B521C 03E00008 */ jr $ra -/* 11E830 802B5220 460E5000 */ add.s $f0, $f10, $f14 - diff --git a/include/common_structs.h b/include/common_structs.h index cd62cadc1..aafbe9450 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -261,7 +261,7 @@ typedef struct { /* 0x00AE */ s16 unk_0AE; /* 0x00B0 */ s16 unk_0B0; /* 0x00B2 */ s16 unk_0B2; - /* 0x00B4 */ s16 unk_0B4; + /* 0x00B4 */ u16 unk_0B4; /* 0x00B6 */ u16 unk_0B6; /* 0x00B8 */ f32 unk_0B8; /* 0x00BC */ s32 unk_0BC; @@ -419,14 +419,14 @@ typedef struct { /* 0x00 */ f32 unk_000; /* 0x04 */ Vec3f unk_004; - /* 0x10 */ s8 unk_010[0x18]; - /* 0x28 */ f32 unk_028; - /* 0x2C */ f32 unk_02C; - /* 0x30 */ f32 unk_030; + /* 0x10 */ Vec3f unk_010; + /* 0x1C */ s8 unk_01C[0xC]; + /* 0x28 */ Vec3f unk_028; /* 0x34 */ f32 unk_034; /* 0x38 */ f32 unk_038; /* 0x3C */ f32 unk_03C; - /* 0x40 */ s8 unk_040[0x8]; + /* 0x40 */ f32 unk_040; + /* 0x44 */ s32 unk_044; /* 0x48 */ s32 unk_048; /* 0x4C */ s32 unk_04C; /* 0x50 */ s32 unk_050; @@ -458,10 +458,10 @@ typedef struct /* 0xB0 */ s16 unk_0B2; /* 0xB0 */ s16 unk_0B4; /* 0xB0 */ s16 unk_0B6; - /* 0xB0 */ s8 unk_0B8[0x8]; - /* 0xC0 */ s16 unk_0C0; - /* 0xC2 */ s8 unk_0C2; - /* 0xC3 */ s8 unk_0C3; + /* 0xB0 */ s8 unk_0B8[0x6]; + /* 0xBE */ u16 unk_0BE; + /* 0xC0 */ u16 unk_0C0; + /* 0xC2 */ u16 unk_0C2; /* 0xC4 */ s8 unk_0C4; /* 0xC5 */ s8 unk_0C5; /* 0xC6 */ s8 unk_0C6; diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index 7014b28b2..946aca668 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -10718,31 +10718,15 @@ void func_80019FB4(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80019FB4.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80019C50(s32); // extern -? func_80019FB4(s32); // extern - -void func_8001A0A4(s32 arg0, ? arg1, ? arg2, ? arg3, s32 arg4) { +void func_8001A0A4(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { func_80019FB4(arg4); func_80019C50(arg4); } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A0A4.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80019D2C(s32, s32, s32); // extern -? func_8001A0A4(s8, s32); // extern - -void func_8001A0DC(s32 arg1, s32 arg2, s8 arg3, s32 arg4) { - func_8001A0A4(arg3, arg4); +void func_8001A0DC(s16 *arg0, Camera *arg1, Player *arg2, s8 arg3, s32 arg4) { + func_8001A0A4(arg0, arg1, arg2, arg3, arg4); func_80019D2C(arg1, arg2, arg4); } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A0DC.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de @@ -10823,20 +10807,12 @@ block_9: GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A220.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 s32 func_8001A310(s32 arg0, s32 arg1) { - s32 phi_a1; - - phi_a1 = arg1; if ((gCurrentCourseId == 2) && (arg1 != 0) && (arg0 >= 0xE7) && (arg0 < 0x1C2)) { - phi_a1 = 0; + arg1 = 0; } - return phi_a1; + return arg1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001A310.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de diff --git a/src/code_80071F00.c b/src/code_80071F00.c index 5f95f7a15..210314349 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -176,39 +176,29 @@ UNUSED void func_80072214(s32 arg0, s32 arg1) { D_80165C18[arg0].unk_054 ^= arg1; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C6C; +// maybe struct_80165C18_entry (same size) +// However, unk_000 needs to be s32. Could be an onion? +struct struct_8007223C { + s32 s32; + s8 unk4[0xDC]; +}; // Size 0xE0 -? func_8007223C(s32 arg0, s32 arg1) { - ? phi_v1; - - phi_v1 = 0; - if ((*(&D_80165C6C + (arg0 * 0xE0)) & arg1) != 0) { +extern struct struct_8007223C D_80165C6C[]; +s32 func_8007223C(s32 arg0, s32 arg1) { + s32 phi_v1 = 0; + if ((D_80165C6C[arg0].s32 & arg1) != 0) { phi_v1 = 1; } return phi_v1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007223C.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C6C; - -? func_80072270(s32 arg0, s32 arg1) { - ? phi_v1; - - phi_v1 = 0; - if ((*(&D_80165C6C + (arg0 * 0xE0)) & arg1) == 0) { +s32 func_80072270(s32 arg0, s32 arg1) { + s32 phi_v1 = 0; + if ((D_80165C6C[arg0].s32 & arg1) == 0) { phi_v1 = 1; } return phi_v1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072270.s") -#endif void func_800722A4(s32 arg0, s32 arg1) { D_80165C18[arg0].unk_058 |= arg1; @@ -222,39 +212,23 @@ UNUSED void func_800722F8(s32 arg0, s32 arg1) { D_80165C18[arg0].unk_058 ^= arg1; } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C70; +extern struct struct_8007223C D_80165C70[]; -? func_80072320(s32 arg0, s32 arg1) { - ? phi_v1; - - phi_v1 = 0; - if ((*(&D_80165C70 + (arg0 * 0xE0)) & arg1) != 0) { +s32 func_80072320(s32 arg0, s32 arg1) { + s32 phi_v1 = 0; + if ((D_80165C70[arg0].s32 & arg1) != 0) { phi_v1 = 1; } return phi_v1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072320.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C70; - -? func_80072354(s32 arg0, s32 arg1) { - ? phi_v1; - - phi_v1 = 0; - if ((*(&D_80165C70 + (arg0 * 0xE0)) & arg1) == 0) { +s32 func_80072354(s32 arg0, s32 arg1) { + s32 phi_v1 = 0; + if ((D_80165C70[arg0].s32 & arg1) == 0) { phi_v1 = 1; } return phi_v1; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072354.s") -#endif // maybe struct_80165C18_entry (same size) // However, unk_000 needs to be s32. Could be an onion? @@ -1490,7 +1464,7 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80074924.s") void func_80074D94(s32 arg0) { if (D_80165C18[arg0].unk_0AE == 1) { - if ((D_80165740 <= D_80165C18[arg0].unk_02C) && (s16_step_down_towards(&D_80165C18[arg0].unk_0A0, 0, 8) != 0)) { + if ((D_80165740 <= D_80165C18[arg0].unk_028[1]) && (s16_step_down_towards(&D_80165C18[arg0].unk_0A0, 0, 8) != 0)) { func_80086F60(arg0); } func_800877C4(arg0); @@ -1868,9 +1842,9 @@ void func_80075698(s32 arg0) { D_80165C18[arg0].unk_0C0 = 0; D_80165C18[arg0].unk_0B2 = 0; D_80165C18[arg0].unk_0B6 = 0; - D_80165C18[arg0].unk_028 = 0.0f; - D_80165C18[arg0].unk_02C = 0.0f; - D_80165C18[arg0].unk_030 = 0.0f; + D_80165C18[arg0].unk_028[0] = 0.0f; + D_80165C18[arg0].unk_028[1] = 0.0f; + D_80165C18[arg0].unk_028[2] = 0.0f; D_80165C18[arg0].unk_000 = 0.5f; func_80072488(arg0); } @@ -1882,7 +1856,7 @@ void func_80075714(s32 arg0) { break; case 2: D_80165C18[arg0].unk_03C -= D_800EEAD0; - f32_step_up_towards(&D_80165C18[arg0].unk_02C, 100.0f, D_80165C18[arg0].unk_03C); + f32_step_up_towards(&D_80165C18[arg0].unk_028[1], 100.0f, D_80165C18[arg0].unk_03C); func_8007415C(arg0, &D_80165C18[arg0].unk_000, 0.55f, 1.0f, D_800EEAD8, 1, 0); if (func_80073B00(arg0, &D_80165C18[arg0].unk_0A0, 0xFF, 0x1E, 7, 0, 0) != 0) { func_80072488(arg0); @@ -2039,9 +2013,9 @@ void func_80075B08(s32 arg0) { D_80165C18[arg0].unk_0C0 = 0; D_80165C18[arg0].unk_0B2 = 0; D_80165C18[arg0].unk_0B6 = 0; - D_80165C18[arg0].unk_028 = 0.0f; - D_80165C18[arg0].unk_02C = 0.0f; - D_80165C18[arg0].unk_030 = 0.0f; + D_80165C18[arg0].unk_028[0] = 0.0f; + D_80165C18[arg0].unk_028[1] = 0.0f; + D_80165C18[arg0].unk_028[2] = 0.0f; D_80165C18[arg0].unk_000 = 0.5f; func_80072488(arg0); } @@ -2053,7 +2027,7 @@ void func_80075B84(s32 arg0) { break; case 2: D_80165C18[arg0].unk_03C -= D_800EEAE0; - f32_step_up_towards(&D_80165C18[arg0].unk_02C, 100.0f, D_80165C18[arg0].unk_03C); + f32_step_up_towards(&D_80165C18[arg0].unk_028[1], 100.0f, D_80165C18[arg0].unk_03C); func_8007415C(arg0, &D_80165C18[arg0].unk_000, 0.55f, 1.0f, D_800EEAE8, 1, 0); if (func_80073B00(arg0, &D_80165C18[arg0].unk_0A0, 0xFF, 0x1E, 7, 0, 0) != 0) { func_80072488(arg0); @@ -5220,10 +5194,6 @@ void func_8007A88C(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007A88C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_80079860(s32); // extern -? func_8007A88C(); // extern extern s8 D_801657B4; void func_8007A910(s32 arg0) { @@ -5232,9 +5202,6 @@ void func_8007A910(s32 arg0) { } func_80079860(arg0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007A910.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909 @@ -5482,27 +5449,14 @@ block_8: GLOBAL_ASM("asm/non_matchings/code_80071F00/gen_random_item.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? gen_random_item(s16, ?); // extern - +void gen_random_item(s16, s16); void func_8007AF40(s32 arg0, s16 arg1) { gen_random_item(arg1, 0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007AF40.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? gen_random_item(s16, ?); // extern void func_8007AF78(s32 arg0, s16 arg1) { gen_random_item(arg1, 1); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007AF78.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -6111,26 +6065,17 @@ void func_8007BD04(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007BD04.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -? func_8007BBBC(s32); // extern -? func_8007BD04(?); // extern -? func_8008BF18(s32); // extern extern s32 D_80183F28; void func_8007BDA8(void) { - s32 sp18; + s32 pad; s32 temp_a0; func_8007BD04(0); temp_a0 = D_80183F28; - sp18 = temp_a0; func_8007BBBC(temp_a0); func_8008BF18(temp_a0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007BDA8.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 diff --git a/src/code_80086E70.c b/src/code_80086E70.c index c647939c5..7ff30fd0b 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -2376,102 +2376,71 @@ void func_8008B78C(s32 arg0) { GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B78C.s") #endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; - void func_8008B7D4(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { - void *temp_v0; - - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unk10 = arg1; - temp_v0->unk14 = arg2; - temp_v0->unk18 = arg3; + D_80165C18[arg0].unk_010[0] = arg1; + D_80165C18[arg0].unk_010[1] = arg2; + D_80165C18[arg0].unk_010[2] = arg3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B7D4.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; void func_8008B80C(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { - void *temp_v0; - - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unk28 = arg1; - temp_v0->unk2C = arg2; - temp_v0->unk30 = arg3; + D_80165C18[arg0].unk_028[0] = arg1; + D_80165C18[arg0].unk_028[1] = arg2; + D_80165C18[arg0].unk_028[2] = arg3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B80C.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; void func_8008B844(s32 arg0) { - f32 temp_f0; - void *temp_v0; + f32 temp_f0 = D_80165C18[arg0].unk_010[0]; - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_f0 = temp_v0->unk10; - temp_v0->unk4 = temp_v0->unk28 + temp_f0; - temp_v0->unk8 = temp_v0->unk2C + temp_f0; - temp_v0->unkC = temp_v0->unk30 + temp_f0; + D_80165C18[arg0].unk_004[0] = D_80165C18[arg0].unk_028[0] + temp_f0; + D_80165C18[arg0].unk_004[1] = D_80165C18[arg0].unk_028[1] + temp_f0; + D_80165C18[arg0].unk_004[2] = D_80165C18[arg0].unk_028[2] + temp_f0; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B844.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; - -void func_8008B888(s32 arg0, s16 arg1, s16 arg2, s16 arg3) { - void *temp_v0; - - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unkBE = arg1; - temp_v0->unkC0 = arg2; - temp_v0->unkC2 = arg3; +void func_8008B888(s32 arg0, u16 arg1, u16 arg2, u16 arg3) { + D_80165C18[arg0].unk_0BE = arg1; + D_80165C18[arg0].unk_0C0 = arg2; + D_80165C18[arg0].unk_0C2 = arg3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B888.s") -#endif -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; - -void func_8008B8BC(s32 arg0, s16 arg1, s16 arg2, s16 arg3) { - void *temp_v0; - - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unkB2 = arg1; - temp_v0->unkB4 = arg2; - temp_v0->unkB6 = arg3; +void func_8008B8BC(s32 arg0, u16 arg1, u16 arg2, u16 arg3) { + D_80165C18[arg0].unk_0B2 = arg1; + D_80165C18[arg0].unk_0B4 = arg2; + D_80165C18[arg0].unk_0B6 = arg3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B8BC.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_80165C18; void func_8008B8F0(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { - void *temp_v0; - - temp_v0 = (arg0 * 0xE0) + &D_80165C18; - temp_v0->unk38 = arg1; - temp_v0->unk3C = arg2; - temp_v0->unk40 = arg3; + D_80165C18[arg0].unk_038 = arg1; + D_80165C18[arg0].unk_03C = arg2; + D_80165C18[arg0].unk_040 = arg3; } + +#ifdef MIPS_TO_C +UNUSED void func_8008B928(s32 arg0, s16 arg1, s16 arg2, s16 arg3, void *arg4) { + s16 temp_v0; + s32 temp_t3; + void *temp_s0; + + temp_s0 = (arg0 * 0xE0) + &D_80165C18; + temp_s0->unk10 = (f32) arg1; + temp_s0->unk14 = (f32) arg2; + temp_s0->unk80 = arg4; + temp_s0->unk18 = (f32) arg3; + temp_s0->unk38 = (f32) (arg4->unkA - arg4->unk2); + temp_s0->unk3C = (f32) (arg4->unkC - arg4->unk4); + temp_s0->unk40 = (f32) (arg4->unkE - arg4->unk6); + temp_v0 = func_80087368(arg1, arg2, arg3); + temp_t3 = -temp_v0 & 0xFFFF; + temp_s0->unkC0 = temp_v0; + temp_s0->unk40 = func_800416D8(temp_s0->unk40, temp_s0->unk38, temp_t3); + temp_s0->unkBE = func_80087324(arg0); +} + +UNUSED void func_8008BA40(s32 arg0, s16 arg1, u16 arg2) { + *(&D_80165C28 + (arg0 * 0xE0)) = (f32) (arg1 + (s16) (random_int(arg2) - ((s32) arg2 / 2))); +} +*/ #else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B8F0.s") +GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B928.s") #endif #ifdef MIPS_TO_C diff --git a/src/code_80091750.c b/src/code_80091750.c index 76ff9d05f..db02a30c2 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -608,18 +608,14 @@ void func_800925A0(void) { add_8018D9E0_entry(0xAF, 0, 0, 0); } -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern void *find_8018D9E0_entry_dupe(s32); // extern -// removed a temp from this func temp = find_8018D9E0_entry_dupe. +struct_8018D9E0_entry *find_8018D9E0_entry_dupe(s32 arg0); + void func_800925CC(void) { - if (find_8018D9E0_entry_dupe(0xAF)->unk4 == 2) { - find_8018D9E0_entry_dupe(0xAF)->unk4 = 3; + struct_8018D9E0_entry *temp = find_8018D9E0_entry_dupe(0xAF); + if (temp->unk4 == 2) { + temp->unk4 = 3; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80091750/func_800925CC.s") -#endif void func_80092604(void) { add_8018D9E0_entry(0xB0, 0, 0, 0);