From 3676d8cd6c212043a09b277401f5eccd30bf1d46 Mon Sep 17 00:00:00 2001 From: dark-samus Date: Wed, 18 Nov 2020 00:32:18 -0500 Subject: [PATCH] decomp more, delete as for matched funcs --- .../code_102610_len_2330/func_802E10F4.s | 26 -- asm/nonmatchings/code_102c80/func_802E1660.s | 65 ----- .../entity_init_Hammer1Block_normal.s | 16 -- .../entity_init_Hammer23Block_normal.s | 16 -- .../entity_init_HammerBlock_small.s | 24 -- .../code_104940_len_dc0/func_802E31B0.s | 19 -- .../code_104940_len_dc0/func_802E31EC.s | 46 ---- .../code_104940_len_dc0/func_802E328C.s | 63 ----- .../code_104940_len_dc0/func_802E3650.s | 43 --- .../code_104940_len_dc0/func_802E3714.s | 9 - .../code_104940_len_dc0/func_802E3728.s | 52 ---- .../code_104940_len_dc0/func_802E37E4.s | 50 ---- .../code_104940_len_dc0/func_802E3898.s | 20 -- .../code_104940_len_dc0/func_802E38D8.s | 83 ------ .../code_104940_len_dc0/func_802E3A00.s | 23 -- .../code_104940_len_dc0/func_802E3A48.s | 54 ---- .../code_104940_len_dc0/func_802E3B08.s | 44 ---- .../code_104940_len_dc0/func_802E3BA4.s | 8 +- .../code_109660_len_1270/func_802E8BC0.s | 58 ---- .../code_109660_len_1270/func_802E8C94.s | 19 -- include/common_structs.h | 23 +- include/functions.h | 5 +- include/macros.h | 1 + include/map.h | 2 +- include/variables.h | 3 + src/code_102610_len_2330.c | 42 +-- src/code_102c80.c | 179 ++++++------- src/code_104940_len_dc0.c | 248 ++++++++++++++++-- src/code_109660_len_1270.c | 52 +++- src/code_a5dd0_len_114e0.c | 4 +- src/os/code_4ac90_len_3910.c | 2 +- src/world/area_kmr/kmr_03/8C7F90.c | 2 +- src/world/area_kmr/kmr_12/header.c | 2 +- undefined_syms.txt | 12 + 34 files changed, 441 insertions(+), 874 deletions(-) delete mode 100644 asm/nonmatchings/code_102610_len_2330/func_802E10F4.s delete mode 100644 asm/nonmatchings/code_102c80/func_802E1660.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/entity_init_Hammer1Block_normal.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/entity_init_Hammer23Block_normal.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/entity_init_HammerBlock_small.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E31B0.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E31EC.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E328C.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E3650.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E3714.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E3728.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E37E4.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E3898.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E38D8.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E3A00.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E3A48.s delete mode 100644 asm/nonmatchings/code_104940_len_dc0/func_802E3B08.s delete mode 100644 asm/nonmatchings/code_109660_len_1270/func_802E8BC0.s delete mode 100644 asm/nonmatchings/code_109660_len_1270/func_802E8C94.s diff --git a/asm/nonmatchings/code_102610_len_2330/func_802E10F4.s b/asm/nonmatchings/code_102610_len_2330/func_802E10F4.s deleted file mode 100644 index d3488dd740..0000000000 --- a/asm/nonmatchings/code_102610_len_2330/func_802E10F4.s +++ /dev/null @@ -1,26 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E10F4 -/* 102974 802E10F4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 102978 802E10F8 AFB10014 */ sw $s1, 0x14($sp) -/* 10297C 802E10FC 0080882D */ daddu $s1, $a0, $zero -/* 102980 802E1100 AFBF0018 */ sw $ra, 0x18($sp) -/* 102984 802E1104 AFB00010 */ sw $s0, 0x10($sp) -/* 102988 802E1108 8E300040 */ lw $s0, 0x40($s1) -/* 10298C 802E110C 86020004 */ lh $v0, 4($s0) -/* 102990 802E1110 24420006 */ addiu $v0, $v0, 6 -/* 102994 802E1114 44826000 */ mtc1 $v0, $f12 -/* 102998 802E1118 00000000 */ nop -/* 10299C 802E111C 0C00A6C9 */ jal clamp_angle -/* 1029A0 802E1120 46806320 */ cvt.s.w $f12, $f12 -/* 1029A4 802E1124 4600008D */ trunc.w.s $f2, $f0 -/* 1029A8 802E1128 44021000 */ mfc1 $v0, $f2 -/* 1029AC 802E112C 0220202D */ daddu $a0, $s1, $zero -/* 1029B0 802E1130 0C0B8D94 */ jal func_802E3650 -/* 1029B4 802E1134 A6020004 */ sh $v0, 4($s0) -/* 1029B8 802E1138 8FBF0018 */ lw $ra, 0x18($sp) -/* 1029BC 802E113C 8FB10014 */ lw $s1, 0x14($sp) -/* 1029C0 802E1140 8FB00010 */ lw $s0, 0x10($sp) -/* 1029C4 802E1144 03E00008 */ jr $ra -/* 1029C8 802E1148 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_102c80/func_802E1660.s b/asm/nonmatchings/code_102c80/func_802E1660.s deleted file mode 100644 index 080da0f3c1..0000000000 --- a/asm/nonmatchings/code_102c80/func_802E1660.s +++ /dev/null @@ -1,65 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E1660 -/* 102EE0 802E1660 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 102EE4 802E1664 AFB00010 */ sw $s0, 0x10($sp) -/* 102EE8 802E1668 0080802D */ daddu $s0, $a0, $zero -/* 102EEC 802E166C AFBF0020 */ sw $ra, 0x20($sp) -/* 102EF0 802E1670 AFB3001C */ sw $s3, 0x1c($sp) -/* 102EF4 802E1674 AFB20018 */ sw $s2, 0x18($sp) -/* 102EF8 802E1678 AFB10014 */ sw $s1, 0x14($sp) -/* 102EFC 802E167C 0C0B854F */ jal func_802E153C -/* 102F00 802E1680 8E130040 */ lw $s3, 0x40($s0) -/* 102F04 802E1684 3C118011 */ lui $s1, %hi(gPlayerStatus) -/* 102F08 802E1688 2631EFC8 */ addiu $s1, $s1, %lo(gPlayerStatus) -/* 102F0C 802E168C 92020006 */ lbu $v0, 6($s0) -/* 102F10 802E1690 3C128011 */ lui $s2, %hi(D_8010EBB0) -/* 102F14 802E1694 2652EBB0 */ addiu $s2, $s2, %lo(D_8010EBB0) -/* 102F18 802E1698 30420040 */ andi $v0, $v0, 0x40 -/* 102F1C 802E169C 1040000A */ beqz $v0, .L802E16C8 -/* 102F20 802E16A0 24020012 */ addiu $v0, $zero, 0x12 -/* 102F24 802E16A4 822300B4 */ lb $v1, 0xb4($s1) -/* 102F28 802E16A8 14620009 */ bne $v1, $v0, .L802E16D0 -/* 102F2C 802E16AC 2402000D */ addiu $v0, $zero, 0xd -/* 102F30 802E16B0 3C028011 */ lui $v0, %hi(gPlayerData+0x1) -/* 102F34 802E16B4 8042F291 */ lb $v0, %lo(gPlayerData+0x1)($v0) -/* 102F38 802E16B8 0440001A */ bltz $v0, .L802E1724 -/* 102F3C 802E16BC 00000000 */ nop -/* 102F40 802E16C0 080B85C2 */ j .L802E1708 -/* 102F44 802E16C4 00000000 */ nop -.L802E16C8: -/* 102F48 802E16C8 822300B4 */ lb $v1, 0xb4($s1) -/* 102F4C 802E16CC 2402000D */ addiu $v0, $zero, 0xd -.L802E16D0: -/* 102F50 802E16D0 10620014 */ beq $v1, $v0, .L802E1724 -/* 102F54 802E16D4 24020004 */ addiu $v0, $zero, 4 -/* 102F58 802E16D8 82430003 */ lb $v1, 3($s2) -/* 102F5C 802E16DC 14620004 */ bne $v1, $v0, .L802E16F0 -/* 102F60 802E16E0 00000000 */ nop -/* 102F64 802E16E4 82420000 */ lb $v0, ($s2) -/* 102F68 802E16E8 1440000E */ bnez $v0, .L802E1724 -/* 102F6C 802E16EC 00000000 */ nop -.L802E16F0: -/* 102F70 802E16F0 92030006 */ lbu $v1, 6($s0) -/* 102F74 802E16F4 30620001 */ andi $v0, $v1, 1 -/* 102F78 802E16F8 14400003 */ bnez $v0, .L802E1708 -/* 102F7C 802E16FC 30620080 */ andi $v0, $v1, 0x80 -/* 102F80 802E1700 10400008 */ beqz $v0, .L802E1724 -/* 102F84 802E1704 00000000 */ nop -.L802E1708: -/* 102F88 802E1708 0C043F5A */ jal func_8010FD68 -/* 102F8C 802E170C 0200202D */ daddu $a0, $s0, $zero -/* 102F90 802E1710 8E640028 */ lw $a0, 0x28($s3) -/* 102F94 802E1714 10800003 */ beqz $a0, .L802E1724 -/* 102F98 802E1718 00000000 */ nop -/* 102F9C 802E171C 0C043F5A */ jal func_8010FD68 -/* 102FA0 802E1720 00000000 */ nop -.L802E1724: -/* 102FA4 802E1724 8FBF0020 */ lw $ra, 0x20($sp) -/* 102FA8 802E1728 8FB3001C */ lw $s3, 0x1c($sp) -/* 102FAC 802E172C 8FB20018 */ lw $s2, 0x18($sp) -/* 102FB0 802E1730 8FB10014 */ lw $s1, 0x14($sp) -/* 102FB4 802E1734 8FB00010 */ lw $s0, 0x10($sp) -/* 102FB8 802E1738 03E00008 */ jr $ra -/* 102FBC 802E173C 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_104940_len_dc0/entity_init_Hammer1Block_normal.s b/asm/nonmatchings/code_104940_len_dc0/entity_init_Hammer1Block_normal.s deleted file mode 100644 index de23024dac..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/entity_init_Hammer1Block_normal.s +++ /dev/null @@ -1,16 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel entity_init_Hammer1Block_normal -/* 105680 802E3E00 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 105684 802E3E04 AFB00010 */ sw $s0, 0x10($sp) -/* 105688 802E3E08 AFBF0014 */ sw $ra, 0x14($sp) -/* 10568C 802E3E0C 0C0B8DB9 */ jal entity_init_Hammer23Block_normal -/* 105690 802E3E10 0080802D */ daddu $s0, $a0, $zero -/* 105694 802E3E14 3C02802E */ lui $v0, 0x802e -/* 105698 802E3E18 244230C0 */ addiu $v0, $v0, 0x30c0 -/* 10569C 802E3E1C AE02003C */ sw $v0, 0x3c($s0) -/* 1056A0 802E3E20 8FBF0014 */ lw $ra, 0x14($sp) -/* 1056A4 802E3E24 8FB00010 */ lw $s0, 0x10($sp) -/* 1056A8 802E3E28 03E00008 */ jr $ra -/* 1056AC 802E3E2C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_104940_len_dc0/entity_init_Hammer23Block_normal.s b/asm/nonmatchings/code_104940_len_dc0/entity_init_Hammer23Block_normal.s deleted file mode 100644 index f5db5eaf71..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/entity_init_Hammer23Block_normal.s +++ /dev/null @@ -1,16 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel entity_init_Hammer23Block_normal -/* 104F64 802E36E4 8C820040 */ lw $v0, 0x40($a0) -/* 104F68 802E36E8 2403FFFF */ addiu $v1, $zero, -1 -/* 104F6C 802E36EC A4430010 */ sh $v1, 0x10($v0) -/* 104F70 802E36F0 C480004C */ lwc1 $f0, 0x4c($a0) -/* 104F74 802E36F4 3C05FFDF */ lui $a1, 0xffdf -/* 104F78 802E36F8 A443000E */ sh $v1, 0xe($v0) -/* 104F7C 802E36FC E4400014 */ swc1 $f0, 0x14($v0) -/* 104F80 802E3700 8C820000 */ lw $v0, ($a0) -/* 104F84 802E3704 34A5FFFF */ ori $a1, $a1, 0xffff -/* 104F88 802E3708 00451024 */ and $v0, $v0, $a1 -/* 104F8C 802E370C 03E00008 */ jr $ra -/* 104F90 802E3710 AC820000 */ sw $v0, ($a0) diff --git a/asm/nonmatchings/code_104940_len_dc0/entity_init_HammerBlock_small.s b/asm/nonmatchings/code_104940_len_dc0/entity_init_HammerBlock_small.s deleted file mode 100644 index 3e3fc2099b..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/entity_init_HammerBlock_small.s +++ /dev/null @@ -1,24 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel entity_init_HammerBlock_small -/* 1056B0 802E3E30 2403FFFF */ addiu $v1, $zero, -1 -/* 1056B4 802E3E34 8C820040 */ lw $v0, 0x40($a0) -/* 1056B8 802E3E38 3C05FFDF */ lui $a1, 0xffdf -/* 1056BC 802E3E3C A4430010 */ sh $v1, 0x10($v0) -/* 1056C0 802E3E40 C480004C */ lwc1 $f0, 0x4c($a0) -/* 1056C4 802E3E44 34A5FFFF */ ori $a1, $a1, 0xffff -/* 1056C8 802E3E48 A443000E */ sh $v1, 0xe($v0) -/* 1056CC 802E3E4C E4400014 */ swc1 $f0, 0x14($v0) -/* 1056D0 802E3E50 8C820000 */ lw $v0, ($a0) -/* 1056D4 802E3E54 3C013F00 */ lui $at, 0x3f00 -/* 1056D8 802E3E58 44810000 */ mtc1 $at, $f0 -/* 1056DC 802E3E5C 00451024 */ and $v0, $v0, $a1 -/* 1056E0 802E3E60 E4800054 */ swc1 $f0, 0x54($a0) -/* 1056E4 802E3E64 E4800058 */ swc1 $f0, 0x58($a0) -/* 1056E8 802E3E68 E480005C */ swc1 $f0, 0x5c($a0) -/* 1056EC 802E3E6C 03E00008 */ jr $ra -/* 1056F0 802E3E70 AC820000 */ sw $v0, ($a0) -/* 1056F4 802E3E74 00000000 */ nop -/* 1056F8 802E3E78 00000000 */ nop -/* 1056FC 802E3E7C 00000000 */ nop diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E31B0.s b/asm/nonmatchings/code_104940_len_dc0/func_802E31B0.s deleted file mode 100644 index 89bb671f69..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E31B0.s +++ /dev/null @@ -1,19 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E31B0 -/* 104A30 802E31B0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 104A34 802E31B4 3C013F80 */ lui $at, 0x3f80 -/* 104A38 802E31B8 44810000 */ mtc1 $at, $f0 -/* 104A3C 802E31BC 2402003C */ addiu $v0, $zero, 0x3c -/* 104A40 802E31C0 AFBF0018 */ sw $ra, 0x18($sp) -/* 104A44 802E31C4 AFA20014 */ sw $v0, 0x14($sp) -/* 104A48 802E31C8 E7A00010 */ swc1 $f0, 0x10($sp) -/* 104A4C 802E31CC 8C850048 */ lw $a1, 0x48($a0) -/* 104A50 802E31D0 8C86004C */ lw $a2, 0x4c($a0) -/* 104A54 802E31D4 8C870050 */ lw $a3, 0x50($a0) -/* 104A58 802E31D8 0C01C88C */ jal func_80072230 -/* 104A5C 802E31DC 0000202D */ daddu $a0, $zero, $zero -/* 104A60 802E31E0 8FBF0018 */ lw $ra, 0x18($sp) -/* 104A64 802E31E4 03E00008 */ jr $ra -/* 104A68 802E31E8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E31EC.s b/asm/nonmatchings/code_104940_len_dc0/func_802E31EC.s deleted file mode 100644 index aa6f51b097..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E31EC.s +++ /dev/null @@ -1,46 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E31EC -/* 104A6C 802E31EC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 104A70 802E31F0 AFB00010 */ sw $s0, 0x10($sp) -/* 104A74 802E31F4 0080802D */ daddu $s0, $a0, $zero -/* 104A78 802E31F8 AFBF0014 */ sw $ra, 0x14($sp) -/* 104A7C 802E31FC 0C0441A9 */ jal get_entity_type -/* 104A80 802E3200 92040004 */ lbu $a0, 4($s0) -/* 104A84 802E3204 2442FFE8 */ addiu $v0, $v0, -0x18 -/* 104A88 802E3208 2C420003 */ sltiu $v0, $v0, 3 -/* 104A8C 802E320C 1040000D */ beqz $v0, .L802E3244 -/* 104A90 802E3210 00000000 */ nop -/* 104A94 802E3214 3C013E6B */ lui $at, 0x3e6b -/* 104A98 802E3218 3421851F */ ori $at, $at, 0x851f -/* 104A9C 802E321C 44810000 */ mtc1 $at, $f0 -/* 104AA0 802E3220 3C014190 */ lui $at, 0x4190 -/* 104AA4 802E3224 44811000 */ mtc1 $at, $f2 -/* 104AA8 802E3228 E6000058 */ swc1 $f0, 0x58($s0) -/* 104AAC 802E322C C600004C */ lwc1 $f0, 0x4c($s0) -/* 104AB0 802E3230 3C013F85 */ lui $at, 0x3f85 -/* 104AB4 802E3234 34211EB8 */ ori $at, $at, 0x1eb8 -/* 104AB8 802E3238 44812000 */ mtc1 $at, $f4 -/* 104ABC 802E323C 080B8C9C */ j .L802E3270 -/* 104AC0 802E3240 46020000 */ add.s $f0, $f0, $f2 -.L802E3244: -/* 104AC4 802E3244 3C013EEB */ lui $at, 0x3eeb -/* 104AC8 802E3248 3421851F */ ori $at, $at, 0x851f -/* 104ACC 802E324C 44810000 */ mtc1 $at, $f0 -/* 104AD0 802E3250 3C014190 */ lui $at, 0x4190 -/* 104AD4 802E3254 44811000 */ mtc1 $at, $f2 -/* 104AD8 802E3258 E6000058 */ swc1 $f0, 0x58($s0) -/* 104ADC 802E325C C600004C */ lwc1 $f0, 0x4c($s0) -/* 104AE0 802E3260 3C014005 */ lui $at, 0x4005 -/* 104AE4 802E3264 34211EB8 */ ori $at, $at, 0x1eb8 -/* 104AE8 802E3268 44812000 */ mtc1 $at, $f4 -/* 104AEC 802E326C 46020000 */ add.s $f0, $f0, $f2 -.L802E3270: -/* 104AF0 802E3270 E6040054 */ swc1 $f4, 0x54($s0) -/* 104AF4 802E3274 E604005C */ swc1 $f4, 0x5c($s0) -/* 104AF8 802E3278 E600004C */ swc1 $f0, 0x4c($s0) -/* 104AFC 802E327C 8FBF0014 */ lw $ra, 0x14($sp) -/* 104B00 802E3280 8FB00010 */ lw $s0, 0x10($sp) -/* 104B04 802E3284 03E00008 */ jr $ra -/* 104B08 802E3288 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E328C.s b/asm/nonmatchings/code_104940_len_dc0/func_802E328C.s deleted file mode 100644 index b0ba408223..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E328C.s +++ /dev/null @@ -1,63 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E328C -/* 104B0C 802E328C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 104B10 802E3290 AFB00010 */ sw $s0, 0x10($sp) -/* 104B14 802E3294 0080802D */ daddu $s0, $a0, $zero -/* 104B18 802E3298 AFBF0014 */ sw $ra, 0x14($sp) -/* 104B1C 802E329C 0C0441A9 */ jal get_entity_type -/* 104B20 802E32A0 92040004 */ lbu $a0, 4($s0) -/* 104B24 802E32A4 2442FFE8 */ addiu $v0, $v0, -0x18 -/* 104B28 802E32A8 2C420003 */ sltiu $v0, $v0, 3 -/* 104B2C 802E32AC 10400012 */ beqz $v0, .L802E32F8 -/* 104B30 802E32B0 00000000 */ nop -/* 104B34 802E32B4 C6000054 */ lwc1 $f0, 0x54($s0) -/* 104B38 802E32B8 3C01802F */ lui $at, 0x802f -/* 104B3C 802E32BC D424B1D0 */ ldc1 $f4, -0x4e30($at) -/* 104B40 802E32C0 C602005C */ lwc1 $f2, 0x5c($s0) -/* 104B44 802E32C4 46000021 */ cvt.d.s $f0, $f0 -/* 104B48 802E32C8 46240001 */ sub.d $f0, $f0, $f4 -/* 104B4C 802E32CC 3C014040 */ lui $at, 0x4040 -/* 104B50 802E32D0 44813000 */ mtc1 $at, $f6 -/* 104B54 802E32D4 460010A1 */ cvt.d.s $f2, $f2 -/* 104B58 802E32D8 46241081 */ sub.d $f2, $f2, $f4 -/* 104B5C 802E32DC 46200020 */ cvt.s.d $f0, $f0 -/* 104B60 802E32E0 E6000054 */ swc1 $f0, 0x54($s0) -/* 104B64 802E32E4 C6000058 */ lwc1 $f0, 0x58($s0) -/* 104B68 802E32E8 3C01802F */ lui $at, 0x802f -/* 104B6C 802E32EC D424B1D8 */ ldc1 $f4, -0x4e28($at) -/* 104B70 802E32F0 080B8CCE */ j .L802E3338 -/* 104B74 802E32F4 46000021 */ cvt.d.s $f0, $f0 -.L802E32F8: -/* 104B78 802E32F8 C6000054 */ lwc1 $f0, 0x54($s0) -/* 104B7C 802E32FC 3C01802F */ lui $at, 0x802f -/* 104B80 802E3300 D424B1E0 */ ldc1 $f4, -0x4e20($at) -/* 104B84 802E3304 C602005C */ lwc1 $f2, 0x5c($s0) -/* 104B88 802E3308 46000021 */ cvt.d.s $f0, $f0 -/* 104B8C 802E330C 46240001 */ sub.d $f0, $f0, $f4 -/* 104B90 802E3310 3C014040 */ lui $at, 0x4040 -/* 104B94 802E3314 44813000 */ mtc1 $at, $f6 -/* 104B98 802E3318 460010A1 */ cvt.d.s $f2, $f2 -/* 104B9C 802E331C 46241081 */ sub.d $f2, $f2, $f4 -/* 104BA0 802E3320 46200020 */ cvt.s.d $f0, $f0 -/* 104BA4 802E3324 E6000054 */ swc1 $f0, 0x54($s0) -/* 104BA8 802E3328 C6000058 */ lwc1 $f0, 0x58($s0) -/* 104BAC 802E332C 3C01802F */ lui $at, 0x802f -/* 104BB0 802E3330 D424B1E8 */ ldc1 $f4, -0x4e18($at) -/* 104BB4 802E3334 46000021 */ cvt.d.s $f0, $f0 -.L802E3338: -/* 104BB8 802E3338 46240000 */ add.d $f0, $f0, $f4 -/* 104BBC 802E333C C604004C */ lwc1 $f4, 0x4c($s0) -/* 104BC0 802E3340 462010A0 */ cvt.s.d $f2, $f2 -/* 104BC4 802E3344 E602005C */ swc1 $f2, 0x5c($s0) -/* 104BC8 802E3348 46062101 */ sub.s $f4, $f4, $f6 -/* 104BCC 802E334C 46200020 */ cvt.s.d $f0, $f0 -/* 104BD0 802E3350 E6000058 */ swc1 $f0, 0x58($s0) -/* 104BD4 802E3354 E604004C */ swc1 $f4, 0x4c($s0) -/* 104BD8 802E3358 0C0B8D94 */ jal func_802E3650 -/* 104BDC 802E335C 0200202D */ daddu $a0, $s0, $zero -/* 104BE0 802E3360 8FBF0014 */ lw $ra, 0x14($sp) -/* 104BE4 802E3364 8FB00010 */ lw $s0, 0x10($sp) -/* 104BE8 802E3368 03E00008 */ jr $ra -/* 104BEC 802E336C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E3650.s b/asm/nonmatchings/code_104940_len_dc0/func_802E3650.s deleted file mode 100644 index 775a4b6e9d..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E3650.s +++ /dev/null @@ -1,43 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E3650 -/* 104ED0 802E3650 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 104ED4 802E3654 AFB00010 */ sw $s0, 0x10($sp) -/* 104ED8 802E3658 0080802D */ daddu $s0, $a0, $zero -/* 104EDC 802E365C AFB20018 */ sw $s2, 0x18($sp) -/* 104EE0 802E3660 AFBF001C */ sw $ra, 0x1c($sp) -/* 104EE4 802E3664 AFB10014 */ sw $s1, 0x14($sp) -/* 104EE8 802E3668 8E110040 */ lw $s1, 0x40($s0) -/* 104EEC 802E366C 0C044AC8 */ jal func_80112B20 -/* 104EF0 802E3670 0000902D */ daddu $s2, $zero, $zero -/* 104EF4 802E3674 10400014 */ beqz $v0, .L802E36C8 -/* 104EF8 802E3678 3C030020 */ lui $v1, 0x20 -/* 104EFC 802E367C 8E020000 */ lw $v0, ($s0) -/* 104F00 802E3680 00431024 */ and $v0, $v0, $v1 -/* 104F04 802E3684 10400011 */ beqz $v0, .L802E36CC -/* 104F08 802E3688 0240102D */ daddu $v0, $s2, $zero -/* 104F0C 802E368C 24120001 */ addiu $s2, $zero, 1 -/* 104F10 802E3690 0C0B8CDC */ jal func_802E3370 -/* 104F14 802E3694 0200202D */ daddu $a0, $s0, $zero -/* 104F18 802E3698 86240010 */ lh $a0, 0x10($s1) -/* 104F1C 802E369C 2402FFFF */ addiu $v0, $zero, -1 -/* 104F20 802E36A0 1082000A */ beq $a0, $v0, .L802E36CC -/* 104F24 802E36A4 0240102D */ daddu $v0, $s2, $zero -/* 104F28 802E36A8 0C04C3D6 */ jal get_item_entity -/* 104F2C 802E36AC 00000000 */ nop -/* 104F30 802E36B0 C600004C */ lwc1 $f0, 0x4c($s0) -/* 104F34 802E36B4 3C014080 */ lui $at, 0x4080 -/* 104F38 802E36B8 44811000 */ mtc1 $at, $f2 -/* 104F3C 802E36BC 00000000 */ nop -/* 104F40 802E36C0 46020000 */ add.s $f0, $f0, $f2 -/* 104F44 802E36C4 E440000C */ swc1 $f0, 0xc($v0) -.L802E36C8: -/* 104F48 802E36C8 0240102D */ daddu $v0, $s2, $zero -.L802E36CC: -/* 104F4C 802E36CC 8FBF001C */ lw $ra, 0x1c($sp) -/* 104F50 802E36D0 8FB20018 */ lw $s2, 0x18($sp) -/* 104F54 802E36D4 8FB10014 */ lw $s1, 0x14($sp) -/* 104F58 802E36D8 8FB00010 */ lw $s0, 0x10($sp) -/* 104F5C 802E36DC 03E00008 */ jr $ra -/* 104F60 802E36E0 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E3714.s b/asm/nonmatchings/code_104940_len_dc0/func_802E3714.s deleted file mode 100644 index d600c866b6..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E3714.s +++ /dev/null @@ -1,9 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E3714 -/* 104F94 802E3714 8C820040 */ lw $v0, 0x40($a0) -/* 104F98 802E3718 3C0142B4 */ lui $at, 0x42b4 -/* 104F9C 802E371C 44810000 */ mtc1 $at, $f0 -/* 104FA0 802E3720 03E00008 */ jr $ra -/* 104FA4 802E3724 E4400018 */ swc1 $f0, 0x18($v0) diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E3728.s b/asm/nonmatchings/code_104940_len_dc0/func_802E3728.s deleted file mode 100644 index 43c9031f21..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E3728.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E3728 -/* 104FA8 802E3728 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 104FAC 802E372C AFB10014 */ sw $s1, 0x14($sp) -/* 104FB0 802E3730 0080882D */ daddu $s1, $a0, $zero -/* 104FB4 802E3734 AFBF0018 */ sw $ra, 0x18($sp) -/* 104FB8 802E3738 AFB00010 */ sw $s0, 0x10($sp) -/* 104FBC 802E373C F7B40020 */ sdc1 $f20, 0x20($sp) -/* 104FC0 802E3740 0C0B8E80 */ jal func_802E3A00 -/* 104FC4 802E3744 8E300040 */ lw $s0, 0x40($s1) -/* 104FC8 802E3748 3C0140C9 */ lui $at, 0x40c9 -/* 104FCC 802E374C 34210FD0 */ ori $at, $at, 0xfd0 -/* 104FD0 802E3750 44810000 */ mtc1 $at, $f0 -/* 104FD4 802E3754 C60C0018 */ lwc1 $f12, 0x18($s0) -/* 104FD8 802E3758 46006302 */ mul.s $f12, $f12, $f0 -/* 104FDC 802E375C 00000000 */ nop -/* 104FE0 802E3760 C634004C */ lwc1 $f20, 0x4c($s1) -/* 104FE4 802E3764 3C0143B4 */ lui $at, 0x43b4 -/* 104FE8 802E3768 44810000 */ mtc1 $at, $f0 -/* 104FEC 802E376C 4600A521 */ cvt.d.s $f20, $f20 -/* 104FF0 802E3770 0C00A85B */ jal sin_rad -/* 104FF4 802E3774 46006303 */ div.s $f12, $f12, $f0 -/* 104FF8 802E3778 46000021 */ cvt.d.s $f0, $f0 -/* 104FFC 802E377C 46200000 */ add.d $f0, $f0, $f0 -/* 105000 802E3780 4620A500 */ add.d $f20, $f20, $f0 -/* 105004 802E3784 3C014270 */ lui $at, 0x4270 -/* 105008 802E3788 44810000 */ mtc1 $at, $f0 -/* 10500C 802E378C 4620A520 */ cvt.s.d $f20, $f20 -/* 105010 802E3790 E634004C */ swc1 $f20, 0x4c($s1) -/* 105014 802E3794 C6020018 */ lwc1 $f2, 0x18($s0) -/* 105018 802E3798 46001300 */ add.s $f12, $f2, $f0 -/* 10501C 802E379C 3C0143E1 */ lui $at, 0x43e1 -/* 105020 802E37A0 44810000 */ mtc1 $at, $f0 -/* 105024 802E37A4 00000000 */ nop -/* 105028 802E37A8 460C003C */ c.lt.s $f0, $f12 -/* 10502C 802E37AC 00000000 */ nop -/* 105030 802E37B0 45000006 */ bc1f .L802E37CC -/* 105034 802E37B4 E60C0018 */ swc1 $f12, 0x18($s0) -/* 105038 802E37B8 0C00A6C9 */ jal clamp_angle -/* 10503C 802E37BC 00000000 */ nop -/* 105040 802E37C0 E6000018 */ swc1 $f0, 0x18($s0) -/* 105044 802E37C4 0C043F5A */ jal func_8010FD68 -/* 105048 802E37C8 0220202D */ daddu $a0, $s1, $zero -.L802E37CC: -/* 10504C 802E37CC 8FBF0018 */ lw $ra, 0x18($sp) -/* 105050 802E37D0 8FB10014 */ lw $s1, 0x14($sp) -/* 105054 802E37D4 8FB00010 */ lw $s0, 0x10($sp) -/* 105058 802E37D8 D7B40020 */ ldc1 $f20, 0x20($sp) -/* 10505C 802E37DC 03E00008 */ jr $ra -/* 105060 802E37E0 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E37E4.s b/asm/nonmatchings/code_104940_len_dc0/func_802E37E4.s deleted file mode 100644 index e45d82eaac..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E37E4.s +++ /dev/null @@ -1,50 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E37E4 -/* 105064 802E37E4 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 105068 802E37E8 AFB10014 */ sw $s1, 0x14($sp) -/* 10506C 802E37EC 0080882D */ daddu $s1, $a0, $zero -/* 105070 802E37F0 AFBF0018 */ sw $ra, 0x18($sp) -/* 105074 802E37F4 AFB00010 */ sw $s0, 0x10($sp) -/* 105078 802E37F8 F7B60028 */ sdc1 $f22, 0x28($sp) -/* 10507C 802E37FC F7B40020 */ sdc1 $f20, 0x20($sp) -/* 105080 802E3800 0C0B8E80 */ jal func_802E3A00 -/* 105084 802E3804 8E300040 */ lw $s0, 0x40($s1) -/* 105088 802E3808 3C0140C9 */ lui $at, 0x40c9 -/* 10508C 802E380C 34210FD0 */ ori $at, $at, 0xfd0 -/* 105090 802E3810 44810000 */ mtc1 $at, $f0 -/* 105094 802E3814 C60C0018 */ lwc1 $f12, 0x18($s0) -/* 105098 802E3818 46006302 */ mul.s $f12, $f12, $f0 -/* 10509C 802E381C 00000000 */ nop -/* 1050A0 802E3820 C634004C */ lwc1 $f20, 0x4c($s1) -/* 1050A4 802E3824 3C0143B4 */ lui $at, 0x43b4 -/* 1050A8 802E3828 4481B000 */ mtc1 $at, $f22 -/* 1050AC 802E382C 4600A521 */ cvt.d.s $f20, $f20 -/* 1050B0 802E3830 0C00A85B */ jal sin_rad -/* 1050B4 802E3834 46166303 */ div.s $f12, $f12, $f22 -/* 1050B8 802E3838 46000021 */ cvt.d.s $f0, $f0 -/* 1050BC 802E383C 4620A500 */ add.d $f20, $f20, $f0 -/* 1050C0 802E3840 3C014270 */ lui $at, 0x4270 -/* 1050C4 802E3844 44811000 */ mtc1 $at, $f2 -/* 1050C8 802E3848 4620A520 */ cvt.s.d $f20, $f20 -/* 1050CC 802E384C E634004C */ swc1 $f20, 0x4c($s1) -/* 1050D0 802E3850 C6000018 */ lwc1 $f0, 0x18($s0) -/* 1050D4 802E3854 46020000 */ add.s $f0, $f0, $f2 -/* 1050D8 802E3858 4600B03E */ c.le.s $f22, $f0 -/* 1050DC 802E385C 00000000 */ nop -/* 1050E0 802E3860 45000006 */ bc1f .L802E387C -/* 1050E4 802E3864 E6000018 */ swc1 $f0, 0x18($s0) -/* 1050E8 802E3868 C6000014 */ lwc1 $f0, 0x14($s0) -/* 1050EC 802E386C 0220202D */ daddu $a0, $s1, $zero -/* 1050F0 802E3870 AE000018 */ sw $zero, 0x18($s0) -/* 1050F4 802E3874 0C043F5A */ jal func_8010FD68 -/* 1050F8 802E3878 E480004C */ swc1 $f0, 0x4c($a0) -.L802E387C: -/* 1050FC 802E387C 8FBF0018 */ lw $ra, 0x18($sp) -/* 105100 802E3880 8FB10014 */ lw $s1, 0x14($sp) -/* 105104 802E3884 8FB00010 */ lw $s0, 0x10($sp) -/* 105108 802E3888 D7B60028 */ ldc1 $f22, 0x28($sp) -/* 10510C 802E388C D7B40020 */ ldc1 $f20, 0x20($sp) -/* 105110 802E3890 03E00008 */ jr $ra -/* 105114 802E3894 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E3898.s b/asm/nonmatchings/code_104940_len_dc0/func_802E3898.s deleted file mode 100644 index 4856a66e69..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E3898.s +++ /dev/null @@ -1,20 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E3898 -/* 105118 802E3898 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 10511C 802E389C AFB00010 */ sw $s0, 0x10($sp) -/* 105120 802E38A0 AFBF0014 */ sw $ra, 0x14($sp) -/* 105124 802E38A4 0C0B8DB9 */ jal entity_init_Hammer23Block_normal -/* 105128 802E38A8 0080802D */ daddu $s0, $a0, $zero -/* 10512C 802E38AC 8E030040 */ lw $v1, 0x40($s0) -/* 105130 802E38B0 2402000A */ addiu $v0, $zero, 0xa -/* 105134 802E38B4 A4620004 */ sh $v0, 4($v1) -/* 105138 802E38B8 2402007B */ addiu $v0, $zero, 0x7b -/* 10513C 802E38BC A4620006 */ sh $v0, 6($v1) -/* 105140 802E38C0 3402FFFF */ ori $v0, $zero, 0xffff -/* 105144 802E38C4 A462000A */ sh $v0, 0xa($v1) -/* 105148 802E38C8 8FBF0014 */ lw $ra, 0x14($sp) -/* 10514C 802E38CC 8FB00010 */ lw $s0, 0x10($sp) -/* 105150 802E38D0 03E00008 */ jr $ra -/* 105154 802E38D4 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E38D8.s b/asm/nonmatchings/code_104940_len_dc0/func_802E38D8.s deleted file mode 100644 index 188b0adfc3..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E38D8.s +++ /dev/null @@ -1,83 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E38D8 -/* 105158 802E38D8 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 10515C 802E38DC AFB1001C */ sw $s1, 0x1c($sp) -/* 105160 802E38E0 0080882D */ daddu $s1, $a0, $zero -/* 105164 802E38E4 AFBF0020 */ sw $ra, 0x20($sp) -/* 105168 802E38E8 AFB00018 */ sw $s0, 0x18($sp) -/* 10516C 802E38EC 8E300040 */ lw $s0, 0x40($s1) -/* 105170 802E38F0 86030004 */ lh $v1, 4($s0) -/* 105174 802E38F4 18600018 */ blez $v1, .L802E3958 -/* 105178 802E38F8 2402000A */ addiu $v0, $zero, 0xa -/* 10517C 802E38FC 14620004 */ bne $v1, $v0, .L802E3910 -/* 105180 802E3900 24030014 */ addiu $v1, $zero, 0x14 -/* 105184 802E3904 9602000A */ lhu $v0, 0xa($s0) -/* 105188 802E3908 080B8E45 */ j .L802E3914 -/* 10518C 802E390C 24030015 */ addiu $v1, $zero, 0x15 -.L802E3910: -/* 105190 802E3910 0000102D */ daddu $v0, $zero, $zero -.L802E3914: -/* 105194 802E3914 C620004C */ lwc1 $f0, 0x4c($s1) -/* 105198 802E3918 3C01403C */ lui $at, 0x403c -/* 10519C 802E391C 44811800 */ mtc1 $at, $f3 -/* 1051A0 802E3920 44801000 */ mtc1 $zero, $f2 -/* 1051A4 802E3924 AFA30010 */ sw $v1, 0x10($sp) -/* 1051A8 802E3928 AFA20014 */ sw $v0, 0x14($sp) -/* 1051AC 802E392C 46000021 */ cvt.d.s $f0, $f0 -/* 1051B0 802E3930 46220000 */ add.d $f0, $f0, $f2 -/* 1051B4 802E3934 8E250048 */ lw $a1, 0x48($s1) -/* 1051B8 802E3938 8E270050 */ lw $a3, 0x50($s1) -/* 1051BC 802E393C 46200020 */ cvt.s.d $f0, $f0 -/* 1051C0 802E3940 44060000 */ mfc1 $a2, $f0 -/* 1051C4 802E3944 0C04C6A5 */ jal make_item_entity_nodelay -/* 1051C8 802E3948 24040157 */ addiu $a0, $zero, 0x157 -/* 1051CC 802E394C 96020004 */ lhu $v0, 4($s0) -/* 1051D0 802E3950 2442FFFF */ addiu $v0, $v0, -1 -/* 1051D4 802E3954 A6020004 */ sh $v0, 4($s0) -.L802E3958: -/* 1051D8 802E3958 86020004 */ lh $v0, 4($s0) -/* 1051DC 802E395C 10400004 */ beqz $v0, .L802E3970 -/* 1051E0 802E3960 00000000 */ nop -/* 1051E4 802E3964 86020006 */ lh $v0, 6($s0) -/* 1051E8 802E3968 14400020 */ bnez $v0, .L802E39EC -/* 1051EC 802E396C 00000000 */ nop -.L802E3970: -/* 1051F0 802E3970 3C04802F */ lui $a0, 0x802f -/* 1051F4 802E3974 2484A07C */ addiu $a0, $a0, -0x5f84 -/* 1051F8 802E3978 24020001 */ addiu $v0, $zero, 1 -/* 1051FC 802E397C A2020003 */ sb $v0, 3($s0) -/* 105200 802E3980 C6220048 */ lwc1 $f2, 0x48($s1) -/* 105204 802E3984 C624004C */ lwc1 $f4, 0x4c($s1) -/* 105208 802E3988 C6260050 */ lwc1 $f6, 0x50($s1) -/* 10520C 802E398C C6200064 */ lwc1 $f0, 0x64($s1) -/* 105210 802E3990 3C028000 */ lui $v0, 0x8000 -/* 105214 802E3994 AFA20014 */ sw $v0, 0x14($sp) -/* 105218 802E3998 4600020D */ trunc.w.s $f8, $f0 -/* 10521C 802E399C E7A80010 */ swc1 $f8, 0x10($sp) -/* 105220 802E39A0 4600120D */ trunc.w.s $f8, $f2 -/* 105224 802E39A4 44054000 */ mfc1 $a1, $f8 -/* 105228 802E39A8 4600220D */ trunc.w.s $f8, $f4 -/* 10522C 802E39AC 44064000 */ mfc1 $a2, $f8 -/* 105230 802E39B0 4600320D */ trunc.w.s $f8, $f6 -/* 105234 802E39B4 44074000 */ mfc1 $a3, $f8 -/* 105238 802E39B8 0C044631 */ jal create_entity -/* 10523C 802E39BC 00000000 */ nop -/* 105240 802E39C0 0C04417A */ jal get_entity_by_index -/* 105244 802E39C4 0040202D */ daddu $a0, $v0, $zero -/* 105248 802E39C8 3C05802F */ lui $a1, 0x802f -/* 10524C 802E39CC 24A59E54 */ addiu $a1, $a1, -0x61ac -/* 105250 802E39D0 0C043EF0 */ jal func_8010FBC0 -/* 105254 802E39D4 0040202D */ daddu $a0, $v0, $zero -/* 105258 802E39D8 3C032000 */ lui $v1, 0x2000 -/* 10525C 802E39DC 8E220000 */ lw $v0, ($s1) -/* 105260 802E39E0 34630020 */ ori $v1, $v1, 0x20 -/* 105264 802E39E4 00431025 */ or $v0, $v0, $v1 -/* 105268 802E39E8 AE220000 */ sw $v0, ($s1) -.L802E39EC: -/* 10526C 802E39EC 8FBF0020 */ lw $ra, 0x20($sp) -/* 105270 802E39F0 8FB1001C */ lw $s1, 0x1c($sp) -/* 105274 802E39F4 8FB00018 */ lw $s0, 0x18($sp) -/* 105278 802E39F8 03E00008 */ jr $ra -/* 10527C 802E39FC 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E3A00.s b/asm/nonmatchings/code_104940_len_dc0/func_802E3A00.s deleted file mode 100644 index c817d28a9c..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E3A00.s +++ /dev/null @@ -1,23 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E3A00 -/* 105280 802E3A00 2403000E */ addiu $v1, $zero, 0xe -/* 105284 802E3A04 9082000A */ lbu $v0, 0xa($a0) -/* 105288 802E3A08 8C840040 */ lw $a0, 0x40($a0) -/* 10528C 802E3A0C 1443000C */ bne $v0, $v1, .L802E3A40 -/* 105290 802E3A10 2402000A */ addiu $v0, $zero, 0xa -/* 105294 802E3A14 84830004 */ lh $v1, 4($a0) -/* 105298 802E3A18 10620009 */ beq $v1, $v0, .L802E3A40 -/* 10529C 802E3A1C 00000000 */ nop -/* 1052A0 802E3A20 94820006 */ lhu $v0, 6($a0) -/* 1052A4 802E3A24 2442FFFF */ addiu $v0, $v0, -1 -/* 1052A8 802E3A28 A4820006 */ sh $v0, 6($a0) -/* 1052AC 802E3A2C 00021400 */ sll $v0, $v0, 0x10 -/* 1052B0 802E3A30 04410003 */ bgez $v0, .L802E3A40 -/* 1052B4 802E3A34 24020001 */ addiu $v0, $zero, 1 -/* 1052B8 802E3A38 A4800006 */ sh $zero, 6($a0) -/* 1052BC 802E3A3C A4820004 */ sh $v0, 4($a0) -.L802E3A40: -/* 1052C0 802E3A40 03E00008 */ jr $ra -/* 1052C4 802E3A44 00000000 */ nop diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E3A48.s b/asm/nonmatchings/code_104940_len_dc0/func_802E3A48.s deleted file mode 100644 index ffe8561b0d..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E3A48.s +++ /dev/null @@ -1,54 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E3A48 -/* 1052C8 802E3A48 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 1052CC 802E3A4C AFB00018 */ sw $s0, 0x18($sp) -/* 1052D0 802E3A50 0080802D */ daddu $s0, $a0, $zero -/* 1052D4 802E3A54 AFBF0020 */ sw $ra, 0x20($sp) -/* 1052D8 802E3A58 AFB1001C */ sw $s1, 0x1c($sp) -/* 1052DC 802E3A5C 92020006 */ lbu $v0, 6($s0) -/* 1052E0 802E3A60 8E110040 */ lw $s1, 0x40($s0) -/* 1052E4 802E3A64 30420080 */ andi $v0, $v0, 0x80 -/* 1052E8 802E3A68 10400005 */ beqz $v0, .L802E3A80 -/* 1052EC 802E3A6C 00000000 */ nop -/* 1052F0 802E3A70 0C043F5A */ jal func_8010FD68 -/* 1052F4 802E3A74 00000000 */ nop -/* 1052F8 802E3A78 080B8EBD */ j .L802E3AF4 -/* 1052FC 802E3A7C 00000000 */ nop -.L802E3A80: -/* 105300 802E3A80 0C0B8E80 */ jal func_802E3A00 -/* 105304 802E3A84 0200202D */ daddu $a0, $s0, $zero -/* 105308 802E3A88 0C0B8D94 */ jal func_802E3650 -/* 10530C 802E3A8C 0200202D */ daddu $a0, $s0, $zero -/* 105310 802E3A90 82220003 */ lb $v0, 3($s1) -/* 105314 802E3A94 10400017 */ beqz $v0, .L802E3AF4 -/* 105318 802E3A98 3C028000 */ lui $v0, 0x8000 -/* 10531C 802E3A9C 3C04802F */ lui $a0, 0x802f -/* 105320 802E3AA0 2484A07C */ addiu $a0, $a0, -0x5f84 -/* 105324 802E3AA4 C6020048 */ lwc1 $f2, 0x48($s0) -/* 105328 802E3AA8 C604004C */ lwc1 $f4, 0x4c($s0) -/* 10532C 802E3AAC C6060050 */ lwc1 $f6, 0x50($s0) -/* 105330 802E3AB0 C6000064 */ lwc1 $f0, 0x64($s0) -/* 105334 802E3AB4 AFA20014 */ sw $v0, 0x14($sp) -/* 105338 802E3AB8 4600020D */ trunc.w.s $f8, $f0 -/* 10533C 802E3ABC E7A80010 */ swc1 $f8, 0x10($sp) -/* 105340 802E3AC0 4600120D */ trunc.w.s $f8, $f2 -/* 105344 802E3AC4 44054000 */ mfc1 $a1, $f8 -/* 105348 802E3AC8 4600220D */ trunc.w.s $f8, $f4 -/* 10534C 802E3ACC 44064000 */ mfc1 $a2, $f8 -/* 105350 802E3AD0 4600320D */ trunc.w.s $f8, $f6 -/* 105354 802E3AD4 44074000 */ mfc1 $a3, $f8 -/* 105358 802E3AD8 0C044631 */ jal create_entity -/* 10535C 802E3ADC 00000000 */ nop -/* 105360 802E3AE0 3C032000 */ lui $v1, 0x2000 -/* 105364 802E3AE4 8E020000 */ lw $v0, ($s0) -/* 105368 802E3AE8 34630020 */ ori $v1, $v1, 0x20 -/* 10536C 802E3AEC 00431025 */ or $v0, $v0, $v1 -/* 105370 802E3AF0 AE020000 */ sw $v0, ($s0) -.L802E3AF4: -/* 105374 802E3AF4 8FBF0020 */ lw $ra, 0x20($sp) -/* 105378 802E3AF8 8FB1001C */ lw $s1, 0x1c($sp) -/* 10537C 802E3AFC 8FB00018 */ lw $s0, 0x18($sp) -/* 105380 802E3B00 03E00008 */ jr $ra -/* 105384 802E3B04 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E3B08.s b/asm/nonmatchings/code_104940_len_dc0/func_802E3B08.s deleted file mode 100644 index 028c93b77c..0000000000 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E3B08.s +++ /dev/null @@ -1,44 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E3B08 -/* 105388 802E3B08 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 10538C 802E3B0C AFB00018 */ sw $s0, 0x18($sp) -/* 105390 802E3B10 0080802D */ daddu $s0, $a0, $zero -/* 105394 802E3B14 AFBF001C */ sw $ra, 0x1c($sp) -/* 105398 802E3B18 8E040040 */ lw $a0, 0x40($s0) -/* 10539C 802E3B1C 9483000A */ lhu $v1, 0xa($a0) -/* 1053A0 802E3B20 3402FFFF */ ori $v0, $zero, 0xffff -/* 1053A4 802E3B24 1062001B */ beq $v1, $v0, .L802E3B94 -/* 1053A8 802E3B28 00000000 */ nop -/* 1053AC 802E3B2C 0C05152F */ jal get_global_flag -/* 1053B0 802E3B30 0060202D */ daddu $a0, $v1, $zero -/* 1053B4 802E3B34 10400017 */ beqz $v0, .L802E3B94 -/* 1053B8 802E3B38 3C028000 */ lui $v0, 0x8000 -/* 1053BC 802E3B3C 3C04802F */ lui $a0, 0x802f -/* 1053C0 802E3B40 2484A07C */ addiu $a0, $a0, -0x5f84 -/* 1053C4 802E3B44 C6020048 */ lwc1 $f2, 0x48($s0) -/* 1053C8 802E3B48 C604004C */ lwc1 $f4, 0x4c($s0) -/* 1053CC 802E3B4C C6060050 */ lwc1 $f6, 0x50($s0) -/* 1053D0 802E3B50 C6000064 */ lwc1 $f0, 0x64($s0) -/* 1053D4 802E3B54 AFA20014 */ sw $v0, 0x14($sp) -/* 1053D8 802E3B58 4600020D */ trunc.w.s $f8, $f0 -/* 1053DC 802E3B5C E7A80010 */ swc1 $f8, 0x10($sp) -/* 1053E0 802E3B60 4600120D */ trunc.w.s $f8, $f2 -/* 1053E4 802E3B64 44054000 */ mfc1 $a1, $f8 -/* 1053E8 802E3B68 4600220D */ trunc.w.s $f8, $f4 -/* 1053EC 802E3B6C 44064000 */ mfc1 $a2, $f8 -/* 1053F0 802E3B70 4600320D */ trunc.w.s $f8, $f6 -/* 1053F4 802E3B74 44074000 */ mfc1 $a3, $f8 -/* 1053F8 802E3B78 0C044631 */ jal create_entity -/* 1053FC 802E3B7C 00000000 */ nop -/* 105400 802E3B80 3C032000 */ lui $v1, 0x2000 -/* 105404 802E3B84 8E020000 */ lw $v0, ($s0) -/* 105408 802E3B88 34630020 */ ori $v1, $v1, 0x20 -/* 10540C 802E3B8C 00431025 */ or $v0, $v0, $v1 -/* 105410 802E3B90 AE020000 */ sw $v0, ($s0) -.L802E3B94: -/* 105414 802E3B94 8FBF001C */ lw $ra, 0x1c($sp) -/* 105418 802E3B98 8FB00018 */ lw $s0, 0x18($sp) -/* 10541C 802E3B9C 03E00008 */ jr $ra -/* 105420 802E3BA0 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_104940_len_dc0/func_802E3BA4.s b/asm/nonmatchings/code_104940_len_dc0/func_802E3BA4.s index ac142e5bf1..715dc2f800 100644 --- a/asm/nonmatchings/code_104940_len_dc0/func_802E3BA4.s +++ b/asm/nonmatchings/code_104940_len_dc0/func_802E3BA4.s @@ -88,6 +88,7 @@ glabel func_802E3BA4 /* 10554C 802E3CCC 8C22B210 */ lw $v0, -0x4df0($at) /* 105550 802E3CD0 00400008 */ jr $v0 /* 105554 802E3CD4 00000000 */ nop +.L802E3CD8: /* case 10, 13 */ /* 105558 802E3CD8 12000007 */ beqz $s0, .L802E3CF8 /* 10555C 802E3CDC 00000000 */ nop /* 105560 802E3CE0 3C028011 */ lui $v0, %hi(gPlayerData) @@ -111,8 +112,10 @@ glabel func_802E3BA4 /* 1055A0 802E3D20 C6200050 */ lwc1 $f0, 0x50($s1) /* 1055A4 802E3D24 080B8F6C */ j .L802E3DB0 /* 1055A8 802E3D28 2404014F */ addiu $a0, $zero, 0x14f +.L802E3D2C: /* case 11, 14 */ /* 1055AC 802E3D2C 12000008 */ beqz $s0, .L802E3D50 /* 1055B0 802E3D30 00000000 */ nop +.L802E3D34: /* case 2-7, 9 */ /* 1055B4 802E3D34 3C028011 */ lui $v0, %hi(gPlayerData) /* 1055B8 802E3D38 8042F290 */ lb $v0, %lo(gPlayerData)($v0) /* 1055BC 802E3D3C 28420002 */ slti $v0, $v0, 2 @@ -135,6 +138,7 @@ glabel func_802E3BA4 /* 1055F8 802E3D78 C6200050 */ lwc1 $f0, 0x50($s1) /* 1055FC 802E3D7C 080B8F6C */ j .L802E3DB0 /* 105600 802E3D80 24040150 */ addiu $a0, $zero, 0x150 +.L802E3D84: /* case 12, 15 */ /* 105604 802E3D84 3C028011 */ lui $v0, %hi(gPlayerData+0x1) /* 105608 802E3D88 8042F291 */ lb $v0, %lo(gPlayerData+0x1)($v0) /* 10560C 802E3D8C 28420002 */ slti $v0, $v0, 2 @@ -154,13 +158,15 @@ glabel func_802E3BA4 /* 105640 802E3DC0 0000282D */ daddu $a1, $zero, $zero /* 105644 802E3DC4 080B8F7A */ j .L802E3DE8 /* 105648 802E3DC8 24020001 */ addiu $v0, $zero, 1 +.L802E3DCC: /* case 0, 16-20 */ /* 10564C 802E3DCC 0C04419E */ jal func_80110678 /* 105650 802E3DD0 0220202D */ daddu $a0, $s1, $zero /* 105654 802E3DD4 080B8F0D */ j .L802E3C34 /* 105658 802E3DD8 00000000 */ nop +.L802E3DDC: /* case 1 */ /* 10565C 802E3DDC 0C04419E */ jal func_80110678 /* 105660 802E3DE0 0220202D */ daddu $a0, $s1, $zero -.L802E3DE4: +.L802E3DE4: /* case 8 */ /* 105664 802E3DE4 24020001 */ addiu $v0, $zero, 1 .L802E3DE8: /* 105668 802E3DE8 8FBF0024 */ lw $ra, 0x24($sp) diff --git a/asm/nonmatchings/code_109660_len_1270/func_802E8BC0.s b/asm/nonmatchings/code_109660_len_1270/func_802E8BC0.s deleted file mode 100644 index 6de4c7211c..0000000000 --- a/asm/nonmatchings/code_109660_len_1270/func_802E8BC0.s +++ /dev/null @@ -1,58 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E8BC0 -/* 10A440 802E8BC0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 10A444 802E8BC4 AFBF001C */ sw $ra, 0x1c($sp) -/* 10A448 802E8BC8 AFB20018 */ sw $s2, 0x18($sp) -/* 10A44C 802E8BCC AFB10014 */ sw $s1, 0x14($sp) -/* 10A450 802E8BD0 AFB00010 */ sw $s0, 0x10($sp) -/* 10A454 802E8BD4 F7B40020 */ sdc1 $f20, 0x20($sp) -/* 10A458 802E8BD8 0C016AFA */ jal get_current_map_header -/* 10A45C 802E8BDC 8C900040 */ lw $s0, 0x40($a0) -/* 10A460 802E8BE0 0040902D */ daddu $s2, $v0, $zero -/* 10A464 802E8BE4 8E02000C */ lw $v0, 0xc($s0) -/* 10A468 802E8BE8 8E430014 */ lw $v1, 0x14($s2) -/* 10A46C 802E8BEC 00021100 */ sll $v0, $v0, 4 -/* 10A470 802E8BF0 00431021 */ addu $v0, $v0, $v1 -/* 10A474 802E8BF4 C44C0000 */ lwc1 $f12, ($v0) -/* 10A478 802E8BF8 0C038022 */ jal func_800E0088 -/* 10A47C 802E8BFC C44E0008 */ lwc1 $f14, 8($v0) -/* 10A480 802E8C00 3C038011 */ lui $v1, %hi(gPlayerStatus) -/* 10A484 802E8C04 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus) -/* 10A488 802E8C08 C462005C */ lwc1 $f2, 0x5c($v1) -/* 10A48C 802E8C0C 0060882D */ daddu $s1, $v1, $zero -/* 10A490 802E8C10 46020003 */ div.s $f0, $f0, $f2 -/* 10A494 802E8C14 4600010D */ trunc.w.s $f4, $f0 -/* 10A498 802E8C18 44022000 */ mfc1 $v0, $f4 -/* 10A49C 802E8C1C 00000000 */ nop -/* 10A4A0 802E8C20 14400003 */ bnez $v0, .L802E8C30 -/* 10A4A4 802E8C24 AE020004 */ sw $v0, 4($s0) -/* 10A4A8 802E8C28 24020001 */ addiu $v0, $zero, 1 -/* 10A4AC 802E8C2C AE020004 */ sw $v0, 4($s0) -.L802E8C30: -/* 10A4B0 802E8C30 C62C0028 */ lwc1 $f12, 0x28($s1) -/* 10A4B4 802E8C34 C62E0030 */ lwc1 $f14, 0x30($s1) -/* 10A4B8 802E8C38 8E02000C */ lw $v0, 0xc($s0) -/* 10A4BC 802E8C3C 8E430014 */ lw $v1, 0x14($s2) -/* 10A4C0 802E8C40 00021100 */ sll $v0, $v0, 4 -/* 10A4C4 802E8C44 00431021 */ addu $v0, $v0, $v1 -/* 10A4C8 802E8C48 8C460000 */ lw $a2, ($v0) -/* 10A4CC 802E8C4C 0C00A720 */ jal atan2 -/* 10A4D0 802E8C50 8C470008 */ lw $a3, 8($v0) -/* 10A4D4 802E8C54 0C03805E */ jal disable_player_input -/* 10A4D8 802E8C58 46000506 */ mov.s $f20, $f0 -/* 10A4DC 802E8C5C 0C038045 */ jal disable_player_static_collisions -/* 10A4E0 802E8C60 00000000 */ nop -/* 10A4E4 802E8C64 8E26005C */ lw $a2, 0x5c($s1) -/* 10A4E8 802E8C68 8E040004 */ lw $a0, 4($s0) -/* 10A4EC 802E8C6C 4405A000 */ mfc1 $a1, $f20 -/* 10A4F0 802E8C70 0C0389DE */ jal move_player -/* 10A4F4 802E8C74 00000000 */ nop -/* 10A4F8 802E8C78 8FBF001C */ lw $ra, 0x1c($sp) -/* 10A4FC 802E8C7C 8FB20018 */ lw $s2, 0x18($sp) -/* 10A500 802E8C80 8FB10014 */ lw $s1, 0x14($sp) -/* 10A504 802E8C84 8FB00010 */ lw $s0, 0x10($sp) -/* 10A508 802E8C88 D7B40020 */ ldc1 $f20, 0x20($sp) -/* 10A50C 802E8C8C 03E00008 */ jr $ra -/* 10A510 802E8C90 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_109660_len_1270/func_802E8C94.s b/asm/nonmatchings/code_109660_len_1270/func_802E8C94.s deleted file mode 100644 index 0601185bd2..0000000000 --- a/asm/nonmatchings/code_109660_len_1270/func_802E8C94.s +++ /dev/null @@ -1,19 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802E8C94 -/* 10A514 802E8C94 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 10A518 802E8C98 AFBF0010 */ sw $ra, 0x10($sp) -/* 10A51C 802E8C9C 8C820040 */ lw $v0, 0x40($a0) -/* 10A520 802E8CA0 8C430004 */ lw $v1, 4($v0) -/* 10A524 802E8CA4 2463FFFF */ addiu $v1, $v1, -1 -/* 10A528 802E8CA8 AC430004 */ sw $v1, 4($v0) -/* 10A52C 802E8CAC 2402FFFF */ addiu $v0, $zero, -1 -/* 10A530 802E8CB0 14620003 */ bne $v1, $v0, .L802E8CC0 -/* 10A534 802E8CB4 00000000 */ nop -/* 10A538 802E8CB8 0C043F5A */ jal func_8010FD68 -/* 10A53C 802E8CBC 00000000 */ nop -.L802E8CC0: -/* 10A540 802E8CC0 8FBF0010 */ lw $ra, 0x10($sp) -/* 10A544 802E8CC4 03E00008 */ jr $ra -/* 10A548 802E8CC8 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/include/common_structs.h b/include/common_structs.h index dfd734c0b5..0eee6db3bf 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -271,10 +271,11 @@ typedef ScriptInstance* ScriptList[MAX_SCRIPTS]; typedef struct Entity { /* 0x00 */ s32 flags; - /* 0x04 */ s8 listIndex; + /* 0x04 */ u8 listIndex; /* 0x05 */ char unk_05; - /* 0x06 */ s8 unk_06; - /* 0x07 */ char unk_07[4]; + /* 0x06 */ u8 unk_06; + /* 0x07 */ char unk_07[3]; + /* 0x0A */ u8 unk_0A; /* 0x0B */ u8 alpha; /* reported by rain */ /* 0x0C */ s16 aabb[3]; /* 0x12 */ char unk_12[2]; @@ -287,8 +288,8 @@ typedef struct Entity { /* 0x2C */ char unk_2C[12]; /* 0x38 */ struct StaticEntityData* static_data; /* 0x3C */ UNK_PTR unk_3C; - /* 0x40 */ struct Trigger* trigger; - /* 0x44 */ s32* vertexData; + /* 0x40 */ void* dataBuf; + /* 0x44 */ Mtx* vertexData; /* 0x48 */ Vec3f position; /* 0x54 */ Vec3f scale; /* 0x60 */ Vec3f rotation; @@ -901,11 +902,16 @@ typedef struct GameStatus { /* 0x078 */ s8 disableScripts; /* 0x079 */ char unk_79; /* 0x07A */ s8 musicEnabled; - /* 0x07B */ char unk_7B[2]; + /* 0x07B */ char unk_7B; + /* 0x07C */ s8 unk_7C; /* 0x07D */ s8 unk_7D; /* 0x07E */ u8 peachFlags; /* (1 = isPeach, 2 = isTransformed, 4 = hasUmbrella) */ /* 0x07F */ u8 peachDisguise; /* (1 = koopatrol, 2 = hammer bros, 3 = clubba) */ - /* 0x080 */ char unk_80[6]; + /* 0x080 */ char unk_80; + /* 0x081 */ s8 unk_81; + /* 0x082 */ s8 unk_82; + /* 0x083 */ s8 unk_83; + /* 0x085 */ char unk_84[2]; /* 0x086 */ s16 areaID; /* Created by retype action */ /* 0x088 */ s16 prevArea; /* 0x08A */ s16 changedArea; /* (1 = yes) */ @@ -931,7 +937,8 @@ typedef struct GameStatus { /* 0x134 */ u16 frameCounter; /* 0x136 */ char unk_136[2]; /* 0x138 */ s32 nextRNG; - /* 0x13C */ char unk_13C[4]; + /* 0x13C */ s16 unk_13C; + /* 0x13E */ char unk_13E[2]; /* 0x140 */ s32* shopItemData; /* 0x144 */ struct Shop* mapShop; /* 0x148 */ s16 enableBackground; /* (bit 2 is also used for something) */ diff --git a/include/functions.h b/include/functions.h index 8c4f3bdd12..fa3632eb9e 100644 --- a/include/functions.h +++ b/include/functions.h @@ -23,7 +23,10 @@ void render_player_model(); f32 integrate_gravity(void); u32 get_entity_type(s32 arg0); -void create_entity(void*, s32, s32, s32, s32, s32); // TODO: not entirely fleshed out. +Entity* get_entity_by_index(s32 index); +s32 create_entity(void*, s32, s32, s32, s32, s32); + +void func_80072230(s32, f32, f32, f32, f32, s32); // Text PrintContext* load_string(s32 stringID, s32* a1); diff --git a/include/macros.h b/include/macros.h index 9c633e9a76..069046a4cc 100644 --- a/include/macros.h +++ b/include/macros.h @@ -22,6 +22,7 @@ #define PLAYER_DATA (&gPlayerData) #define CAM(id) (&gCameras[id]) #define CURRENT_CAM (&gCameras[gCurrentCameraID]) +#define GET_MAP_ENTRY(cfg, idx) (&(*cfg->entryList)[idx]) #define MAX_MAPVARS 16 #define MAX_MAPFLAGS 3 diff --git a/include/map.h b/include/map.h index 8f17fd2fb6..c1703ab2b9 100644 --- a/include/map.h +++ b/include/map.h @@ -11,7 +11,7 @@ #define ENTRY_COUNT(entryList) (sizeof(entryList) / sizeof(Vec4f)) -typedef Vec4f EntryList[]; +typedef Vec4f EntryList[0]; /// Fields other than main, entryList, entryCount, background, and tattle are initialised when the map loads. typedef struct MapConfig { diff --git a/include/variables.h b/include/variables.h index aab2dede3e..baf50f44af 100644 --- a/include/variables.h +++ b/include/variables.h @@ -95,6 +95,9 @@ extern s32 D_802E99DC; extern f64 D_802EB000; extern f64 D_802EB008; +extern Entity* D_802EB3A0; +extern s32 D_8015C7D0; + extern UNK_TYPE D_0A0031E0; extern UNK_TYPE D_0A001508; extern UNK_TYPE D_0A0031B0; diff --git a/src/code_102610_len_2330.c b/src/code_102610_len_2330.c index d5baba560c..32335efca3 100644 --- a/src/code_102610_len_2330.c +++ b/src/code_102610_len_2330.c @@ -1,5 +1,7 @@ #include "common.h" +void func_8010FD68(Entity* entity); + void create_shadow_callback(Shadow* shadow) { shadow->scale.x = 0.1f; shadow->scale.y = 0.1f; @@ -17,7 +19,18 @@ s32 func_802E0DB0(Shadow* shadow) { INCLUDE_ASM(s32, "code_102610_len_2330", func_802E0DE0); -INCLUDE_ASM(s32, "code_102610_len_2330", func_802E10F4); +typedef struct struct802E10F4 { + char unk_0[4]; + Vec3s angle; // TODO: could be wrong, but based on the single usage, seems right to me. +} struct802E10F4; + +void func_802E10F4(Entity* entity) { + struct802E10F4* temp; + + temp = (struct802E10F4*)entity->dataBuf; + temp->angle.x = clamp_angle(temp->angle.x + 6); + func_802E3650(entity); +} void func_802E114C(void) { @@ -40,25 +53,25 @@ void save_game_at_player_position(void) { fio_save_game(gameStatus->saveSlot); } -void func_802E1204(s32 arg0) { +void func_802E1204(Entity* entity) { if (get_global_flag(0xF8405BDF) == 0) { - s32 *temp = &D_802EB390; + s32* temp = &D_802EB390; *temp = 0; load_string(0x1D0000, temp); set_global_flag(0xF8405BDF); return; } - func_8010FD68(arg0); - func_8010FD68(arg0); + func_8010FD68(entity); + func_8010FD68(entity); } -void func_802E1270(void) { +void func_802E1270(Entity* entity) { s32* temp = &D_802EB390; if (*temp != 0) { - func_8010FD68(); + func_8010FD68(entity); } } @@ -76,31 +89,30 @@ void func_802E12F8(void) { play_sound(0x10); } -void func_802E1328(void) { +void func_802E1328(Entity* entity) { s32* temp = &D_802EB394; if (*temp != 0) { - func_8010FD68(); + func_8010FD68(entity); } } -void func_802E1350(s32 arg0) { +void func_802E1350(Entity* entity) { s32* temp = &D_802EB390; if (*temp != 0) { if (D_802EB398->unk_4E8 == 1) { - func_8010FBC0(arg0, &D_802E99DC); + func_8010FBC0(entity, &D_802E99DC); } else { - func_8010FD68(); + func_8010FD68(entity); } close_message(D_802EB39C); } } void func_802E13B8(Entity *entity) { - Trigger* trigger; + Trigger* trigger = (Trigger*)entity->dataBuf; // TODO: Fix this - trigger = entity->trigger; - entity_init_Hammer23Block_normal(); + entity_init_Hammer23Block_normal(entity); entity->unk_3C = func_802E0DE0; trigger->params1.s = 8; } diff --git a/src/code_102c80.c b/src/code_102c80.c index 72a55d6b0d..48dafc8eb0 100644 --- a/src/code_102c80.c +++ b/src/code_102c80.c @@ -1,6 +1,6 @@ #include "common.h" -typedef struct substruct802E176C { +typedef struct struct802E1400 { /* 0x000 */ Vec3f unk_00; /* 0x00C */ char unk_0C[4]; /* 0x010 */ s8 unk_10; @@ -9,87 +9,83 @@ typedef struct substruct802E176C { /* 0x020 */ u16 unk_20; /* 0x022 */ s16 unk_22; /* 0x024 */ char unk_24[4]; - /* 0x028 */ struct struct802E176C* unk_28; + /* 0x028 */ Entity* attachedEntity; /* 0x02C */ char unk_2C[12]; /* 0x038 */ f32 unk_38; -} substruct802E176C; +} struct802E1400; -typedef struct struct802E176C { - /* 0x00 */ s32 flags; - /* 0x04 */ u8 unk_04; - /* 0x05 */ char unk_05; - /* 0x06 */ u8 unk_06; - /* 0x07 */ char unk_07[0x39]; - /* 0x40 */ substruct802E176C* unk_40; - /* 0x44 */ char unk_44[4]; - /* 0x48 */ Vec3f unk_48; - /* 0x54 */ Vec3f unk_54; -} struct802E176C; +void func_802E246C(Entity* entity, void* arg1, void* arg2); -void func_802E246C(struct802E176C* arg0, void* arg1, void* arg2); - -void func_802E1400(struct802E176C* arg0) { +void func_802E1400(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; - substruct802E176C* temp = arg0->unk_40; + struct802E1400* temp = (struct802E1400*)entity->dataBuf; - if (arg0->unk_06 & 1) { + if (entity->unk_06 & 1) { if ((playerStatus->actionState == ActionState_GROUND_POUND) || (playerStatus->actionState == ActionState_ULTRA_POUND)) { - func_8010FD68(arg0); + func_8010FD68(entity); temp->unk_22 = 8; } } } -void func_802E1460(struct802E176C* arg0) { - substruct802E176C* temp = arg0->unk_40; - u16 var = temp->unk_22--; +void func_802E1460(Entity* entity) { + struct802E1400* temp = (struct802E1400*)entity->dataBuf; + u16 temp2 = temp->unk_22--; - if (var) { - arg0->unk_48.y -= D_802EB000; + if (temp2) { + entity->position.y -= D_802EB000; return; } - func_80110678(arg0); - func_8010FD68(arg0); + func_80110678(entity); + func_8010FD68(entity); temp->unk_22 = 8; } -void func_802E14D8(struct802E176C* arg0) { - substruct802E176C* temp = arg0->unk_40; - u16 var = temp->unk_22--; +void func_802E14D8(Entity* entity) { + struct802E1400* temp = (struct802E1400*)entity->dataBuf; + u16 temp2 = temp->unk_22--; - if (var) { - arg0->unk_48.y += D_802EB008; + if (temp2) { + entity->position.y += D_802EB008; return; } - func_8010FD68(arg0); + func_8010FD68(entity); temp->unk_22 = 8; } INCLUDE_ASM(s32, "code_102c80", func_802E153C); -void func_802E1614(struct802E176C* arg0) { +void func_802E1614(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; - if (arg0->unk_06 & 1) { - if ((playerStatus->actionState == ActionState_GROUND_POUND) || (playerStatus->actionState == ActionState_ULTRA_POUND)) { - func_8010FD68(arg0); + if (entity->unk_06 & 1) { + if ((playerStatus->actionState == ActionState_GROUND_POUND) + || (playerStatus->actionState == ActionState_ULTRA_POUND)) { + func_8010FD68(entity); } } } -void func_802E1660(struct802E176C* arg0) { - substruct802E176C* temp = arg0->unk_40; +void func_802E1660(Entity* entity) { + struct802E1400* temp = (struct802E1400*)entity->dataBuf; PlayerStatus* playerStatus = &gPlayerStatus; s8* temp2 = D_8010EBB0; - func_802E153C(arg0); + func_802E153C(entity); - if(arg0->unk_06 & 0x40) { + if(entity->unk_06 & 0x40) { if(playerStatus->actionState == ActionState_HAMMER) { if(gPlayerData.hammerLevel < 0) { return; } - goto label; + func_8010FD68(entity); + + if(temp->attachedEntity == NULL) { + return; + } + + func_8010FD68(temp->attachedEntity); + return; } } @@ -103,30 +99,29 @@ void func_802E1660(struct802E176C* arg0) { } } - if(!(arg0->unk_06 & 1)) { - if(!(arg0->unk_06 & 0x80)) { + if(!(entity->unk_06 & 1)) { + if(!(entity->unk_06 & 0x80)) { return; } } -label: - func_8010FD68(arg0); + func_8010FD68(entity); - if(temp->unk_28 == NULL) { + if(temp->attachedEntity == NULL) { return; } - func_8010FD68(temp->unk_28); + func_8010FD68(temp->attachedEntity); } -void func_802E1740(struct802E176C* arg0) { - if (!(arg0->unk_06 & 1)) { - func_8010FD68(arg0); +void func_802E1740(Entity* entity) { + if (!(entity->unk_06 & 1)) { + func_8010FD68(entity); } } -void func_802E176C(struct802E176C* arg0) { - substruct802E176C* temp = arg0->unk_40; +void func_802E176C(Entity* entity) { + struct802E1400* temp = (struct802E1400*)entity->dataBuf; temp->unk_00.x = 1.0f; temp->unk_00.y = 0.1f; @@ -137,16 +132,17 @@ void func_802E176C(struct802E176C* arg0) { INCLUDE_ASM(s32, "code_102c80", func_802E17A8); -void func_802E1EA8(struct802E176C* arg0) { - set_area_flag(arg0->unk_40->unk_20); - func_80110678(arg0); +void func_802E1EA8(Entity* entity) { + struct802E1400* temp = (struct802E1400*)entity->dataBuf; + set_area_flag(temp->unk_20); + func_80110678(entity); } INCLUDE_ASM(s32, "code_102c80", func_802E1EDC); -void func_802E234C(struct802E176C* arg0) { +void func_802E234C(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; - substruct802E176C* temp = arg0->unk_40; + struct802E1400* temp = (struct802E1400*)entity->dataBuf; playerStatus->animFlags |= 0x1000000; temp->unk_14.x = 1.0f; @@ -154,23 +150,20 @@ void func_802E234C(struct802E176C* arg0) { temp->unk_14.z = 1.0f; } -extern struct802E176C* D_802EB3A0; -extern s32 D_8015C7D0; +void entity_init_BlueSwitch(Entity* entity) { + Entity* temp_v0_2; + struct802E1400* temp = (struct802E1400*)entity->dataBuf; -void entity_init_BlueSwitch(struct802E176C* arg0) { - struct802E176C* temp_v0_2; - substruct802E176C* temp = arg0->unk_40; - - func_802E234C(arg0); + func_802E234C(entity); if (D_8015C7D0 == 2) { - D_802EB3A0 = arg0; + D_802EB3A0 = entity; return; } + if (D_8015C7D0 == 1) { - temp_v0_2 = D_802EB3A0; - if (temp_v0_2 != NULL) { - temp->unk_28 = temp_v0_2; - arg0->flags |= 1; + if (D_802EB3A0 != NULL) { + temp->attachedEntity = D_802EB3A0; + entity->flags |= 1; return; } } else { @@ -178,17 +171,17 @@ void entity_init_BlueSwitch(struct802E176C* arg0) { } } -void entity_init_HugeBlueSwitch(struct802E176C* arg0) { - substruct802E176C* temp_v0; +void entity_init_HugeBlueSwitch(Entity* entity) { + struct802E1400* temp; - func_802E234C(arg0); - temp_v0 = arg0->unk_40; - arg0->unk_54.x = 3.0f; - arg0->unk_54.y = 3.0f; - arg0->unk_54.z = 3.0f; - temp_v0->unk_14.x = 3.0f; - temp_v0->unk_14.y = 3.0f; - temp_v0->unk_14.z = 3.0f; + func_802E234C(entity); + temp = (struct802E1400*)entity->dataBuf; + entity->scale.x = 3.0f; + entity->scale.y = 3.0f; + entity->scale.z = 3.0f; + temp->unk_14.x = 3.0f; + temp->unk_14.y = 3.0f; + temp->unk_14.z = 3.0f; } void func_802E2450(void) { @@ -196,7 +189,7 @@ void func_802E2450(void) { } -INCLUDE_ASM(void, "code_102c80", func_802E246C, struct802E176C* arg0, void* arg1, void* arg2); +INCLUDE_ASM(void, "code_102c80", func_802E246C, Entity* entity, void* arg1, void* arg2); INCLUDE_ASM(s32, "code_102c80", func_802E263C); @@ -204,18 +197,18 @@ INCLUDE_ASM(s32, "code_102c80", func_802E2BA4); #ifdef NON_MATCHING // Needs rodata support -void func_802E2EB0(struct802E176C* arg0) { +void func_802E2EB0(Entity* entity) { u32 type; void* a2 = NULL; void* a1 = NULL; - arg0->unk_40->unk_38 = arg0->unk_48.y; - type = get_entity_type(arg0->unk_04); + ((struct802E1400*)entity->dataBuf)->unk_38 = entity->position.y; + type = get_entity_type((u8)entity->listIndex); if((type - 24) < 3) { - arg0->unk_54.x = 0.5f; - arg0->unk_54.y = 0.5f; - arg0->unk_54.z = 0.5f; + entity->scale.x = 0.5f; + entity->scale.y = 0.5f; + entity->scale.z = 0.5f; } switch(type) { @@ -235,7 +228,7 @@ void func_802E2EB0(struct802E176C* arg0) { a2 = &D_0A001218; break; case 13: - play_sound_at_position(0x158, 0, arg0->unk_48.x, arg0->unk_48.y, arg0->unk_48.z); + play_sound_at_position(0x158, 0, entity->position.x, entity->position.y, entity->position.z); a1 = &D_0A003F70; a2 = &D_0A002318; break; @@ -252,19 +245,19 @@ void func_802E2EB0(struct802E176C* arg0) { return; } - func_802E246C(arg0, a1, a2); + func_802E246C(entity, a1, a2); } #else -INCLUDE_ASM(void, "code_102c80", func_802E2EB0, struct802E176C* arg0); +INCLUDE_ASM(void, "code_102c80", func_802E2EB0, Entity* entity); #endif #ifdef NON_MATCHING //Needs rodata support -void func_802E2FD0(struct802E176C* arg0) { +void func_802E2FD0(Entity* entity) { u32 type; void *addr = NULL; - type = get_entity_type(arg0->unk_04); + type = get_entity_type(entity->listIndex); switch(type) { case 21: @@ -301,7 +294,7 @@ void func_802E2FD0(struct802E176C* arg0) { return; } - create_entity(addr, arg0->unk_48.x, arg0->unk_48.y, arg0->unk_48.z, 0, 0x80000000); + create_entity(addr, entity->position.x, entity->position.y, entity->position.z, 0, 0x80000000); } #else INCLUDE_ASM(s32, "code_102c80", func_802E2FD0); diff --git a/src/code_104940_len_dc0.c b/src/code_104940_len_dc0.c index 00619eff78..37c8b6b7b5 100644 --- a/src/code_104940_len_dc0.c +++ b/src/code_104940_len_dc0.c @@ -1,37 +1,255 @@ #include "common.h" +// TODO: replace usages of these with proper constants +extern f64 D_802EB1D0; // 0.09 +extern f64 D_802EB1D8; // 0.045 +extern f64 D_802EB1E0; // 0.18 +extern f64 D_802EB1E8; // 0.09 +extern f64 D_802EB1F0; // 1.2 +extern f64 D_802EB1F8; // 0.3 +extern f64 D_802EB200; // 1.2 +extern f64 D_802EB208; // 0.3 + INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E30C0); -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E31B0); +void func_802E31B0(Entity* entity) { + func_80072230(0, entity->position.x, entity->position.y, entity->position.z, 1.0f, 0x3C); +} -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E31EC); +f32 func_802E31EC(Entity* entity) { -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E328C); + if ((get_entity_type(entity->listIndex) - 24) < 3) { + entity->scale.y = 0.23f; + entity->scale.x = 1.04f; + entity->scale.z = 1.04f; + entity->position.y += 18.0f; + } else { + entity->scale.y = 0.46f; + entity->scale.x = 2.08f; + entity->scale.z = 2.08f; + entity->position.y += 18.0f; + } +} + +void func_802E328C(Entity* entity) { + + if ((get_entity_type(entity->listIndex) - 24) < 3U) { + entity->scale.x -= D_802EB1D0; + entity->scale.z -= D_802EB1D0; + entity->scale.y += D_802EB1D8; + entity->position.y -= 3.0f; + } else { + entity->scale.x -= D_802EB1E0; + entity->scale.z -= D_802EB1E0; + entity->scale.y += D_802EB1E8; + entity->position.y -= 3.0f; + } + func_802E3650(entity); +} INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3370); -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3650); +typedef struct struct802E3650 { + /* 0x00 */ char unk_00[3]; + /* 0x03 */ s8 unk_03; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ char unk_08[2]; + /* 0x0A */ u16 unk_0A; + /* 0x0C */ char unk_0C[2]; + /* 0x0E */ s16 unk_0E; + /* 0x10 */ s16 unk_10; + /* 0x12 */ char unk_12[2]; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; +} struct802E3650; -INCLUDE_ASM(s32, "code_104940_len_dc0", entity_init_Hammer23Block_normal); +s32 func_802E3650(Entity* entity) { + struct802E3650* temp = (struct802E3650*)entity->dataBuf; + s32 ret = 0; -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3714); + if (func_80112B20() != 0) { + if (entity->flags & 0x200000) { + ret = 1; + func_802E3370(entity); + if (temp->unk_10 != -1) { + ItemEntity* itemEntity = get_item_entity(temp->unk_10); + itemEntity->position.y = entity->position.y + 4.0f; + } + } + } -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3728); + return ret; +} -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E37E4); +void entity_init_Hammer23Block_normal(Entity* entity) { + struct802E3650* temp = (struct802E3650*)entity->dataBuf; + f32 posY; -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3898); + temp->unk_10 = -1; + temp->unk_14 = entity->position.y; + temp->unk_0E = -1; + entity->flags &= ~0x200000; +} -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E38D8); +void func_802E3714(Entity* entity) { + struct802E3650* temp = (struct802E3650*)entity->dataBuf; -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3A00); + temp->unk_18 = 90.0f; +} -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3A48); +void func_802E3728(Entity* entity) { + f64 temp_f20; + struct802E3650* temp = (struct802E3650*)entity->dataBuf; -INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3B08); + func_802E3A00(entity); + temp_f20 = entity->position.y; + entity->position.y = temp_f20 + ((f64)sin_rad((temp->unk_18 * 6.28318f) / 360.0f) * 2); + temp->unk_18 += 60.0f; + if (temp->unk_18 > 450.0f) { + temp->unk_18 = clamp_angle(temp->unk_18); + func_8010FD68(entity); + } +} + +void func_802E37E4(Entity* entity) { + f64 temp_f20; + struct802E3650* temp = (struct802E3650*)entity->dataBuf; + + func_802E3A00(entity); + temp_f20 = entity->position.y; + entity->position.y = temp_f20 + ((f64)sin_rad((temp->unk_18 * 6.28318f) / 360.0f)); + temp->unk_18 += 60.0f; + if (temp->unk_18 >= 360.0f) { + temp->unk_18 = 0.0f; + entity->position.y = temp->unk_14; + func_8010FD68(entity); + } +} + +void func_802E3898(Entity* entity) { + struct802E3650* temp; + + entity_init_Hammer23Block_normal(entity); + temp = (struct802E3650*)entity->dataBuf; + temp->unk_04 = 0xA; + temp->unk_06 = 0x7B; + temp->unk_0A = 0xFFFF; +} + +extern s32 D_802E9E54; +extern s32 D_802EA07C; + +void func_802E38D8(Entity* entity) { + struct802E3650* temp = (struct802E3650*)entity->dataBuf; + s32 phi_v1; + s32 phi_v0; + + if (temp->unk_04 > 0) { + if (temp->unk_04 == 10) { + phi_v1 = 21; + phi_v0 = temp->unk_0A; + } else { + phi_v1 = 20; + phi_v0 = 0; + } + make_item_entity_nodelay(0x157, entity->position.x, entity->position.y + 28.0, entity->position.z, phi_v1, phi_v0); + temp->unk_04 -= 1; + } + + if ((temp->unk_04 == 0) || (temp->unk_06 == 0)) { + temp->unk_03 = 1; + func_8010FBC0(get_entity_by_index(create_entity(&D_802EA07C, entity->position.x, entity->position.y, entity->position.z, entity->rotation.y, 0x80000000)), &D_802E9E54); + entity->flags |= 0x20000020; + } +} + +void func_802E3A00(Entity* entity) { + u16 temp_v0; + struct802E3650* temp = (struct802E3650*)entity->dataBuf; + s16 phi_return; + + if (entity->unk_0A == 0xE) { + if (temp->unk_04 != 0xA) { + temp->unk_06 -= 1; + if (temp->unk_06 < 0) { + temp->unk_06 = 0; + temp->unk_04 = 1; + } + } + } +} + +void func_802E3A48(Entity* entity) { + s32 temp_v0; + struct802E3650* temp = (struct802E3650*)entity->dataBuf; + + if ((entity->unk_06 & 0x80) != 0) { + func_8010FD68(entity); + return; + } + func_802E3A00(entity); + func_802E3650(entity); + if (temp->unk_03 != 0) { + create_entity(&D_802EA07C, entity->position.x, entity->position.y, entity->position.z, entity->rotation.y, 0x80000000); + entity->flags |= 0x20000020; + } +} + +void func_802E3B08(Entity* entity) { + s32 temp_v0; + u16 temp_v1; + struct802E3650* temp = (struct802E3650*)entity->dataBuf; + + if (temp->unk_0A != 0xFFFF) { + if (get_global_flag(temp->unk_0A) != 0) { + create_entity(&D_802EA07C, entity->position.x, entity->position.y, entity->position.z, entity->rotation.y, 0x80000000); + entity->flags |= 0x20000020; + } + } +} INCLUDE_ASM(s32, "code_104940_len_dc0", func_802E3BA4); +/*s32 func_802E3BA4(Entity* entity) { + PlayerStatus* playerStatus = &gPlayerStatus; -INCLUDE_ASM(s32, "code_104940_len_dc0", entity_init_Hammer1Block_normal); + if((entity->alpha != 0) || ((entity->unk_06 & 1) == 0)) { + if(entity->unk_06 & 4) { + s32 type = get_entity_type(entity->listIndex); + if(type == 12) { + return 0; + } else if((type < 12) || (type >= 0x1B) || (type < 0x15)) { + if((playerStatus->flags & 2) != 0) { + func_8010FD68(entity); + return 1; + } + return 1; + } else { + return 0; + } + if((type & 1) ==) -INCLUDE_ASM(s32, "code_104940_len_dc0", entity_init_HammerBlock_small); + } + + } else { + return 0; + } +}*/ + +void entity_init_Hammer1Block_normal(Entity* entity) { + entity_init_Hammer23Block_normal(entity); + entity->unk_3C = func_802E30C0; +} + +s32 entity_init_HammerBlock_small(Entity* entity) { + s32 temp_v0; + struct802E3650* temp = (struct802E3650*)entity->dataBuf; + + temp->unk_10 = -1; + temp->unk_14 = entity->position.y; + temp->unk_0E = -1; + entity->flags &= ~0x200000; + entity->scale.x = 0.5f; + entity->scale.y = 0.5f; + entity->scale.z = 0.5f; +} \ No newline at end of file diff --git a/src/code_109660_len_1270.c b/src/code_109660_len_1270.c index 211391deec..76818729c4 100644 --- a/src/code_109660_len_1270.c +++ b/src/code_109660_len_1270.c @@ -1,4 +1,5 @@ #include "common.h" +#include "map.h" INCLUDE_ASM(s32, "code_109660_len_1270", func_802E7DE0); @@ -22,13 +23,54 @@ INCLUDE_ASM(s32, "code_109660_len_1270", func_802E8A58); INCLUDE_ASM(s32, "code_109660_len_1270", func_802E8ADC); -INCLUDE_ASM(s32, "code_109660_len_1270", func_802E8BC0); +// TODO: what is this struct? +typedef struct struct802E8BC0 { + /* 0x00 */ char unk_00[4]; + /* 0x04 */ s32 unk_04; + /* 0x08 */ char unk_08[4]; + /* 0x0C */ s32 unk_0C; +} struct802E8BC0; -INCLUDE_ASM(s32, "code_109660_len_1270", func_802E8C94); +MapConfig* get_current_map_header(void); +void disable_player_input(void); +void disable_player_static_collisions(void); +void move_player(s32, f32, f32); + +void func_802E8BC0(Entity *entity) { + PlayerStatus *playerStatus = &gPlayerStatus; + PlayerStatus *playerStatus2 = &gPlayerStatus; + struct802E8BC0* temp = (struct802E8BC0*)entity->dataBuf; + MapConfig* mapConfig = get_current_map_header(); + f32 temp_f20; + f32 entryX; + f32 entryZ; + + entryX = GET_MAP_ENTRY(mapConfig, temp->unk_0C)->x; + entryZ = GET_MAP_ENTRY(mapConfig, temp->unk_0C)->z; + temp->unk_04 = func_800E0088(entryX, entryZ) / playerStatus->runSpeed; + if (temp->unk_04 == 0) { + temp->unk_04 = 1; + } + + entryX = GET_MAP_ENTRY(mapConfig, temp->unk_0C)->x; + entryZ = GET_MAP_ENTRY(mapConfig, temp->unk_0C)->z; + temp_f20 = atan2(playerStatus2->position.x, playerStatus2->position.z, entryX, entryZ); + disable_player_input(); + disable_player_static_collisions(); + move_player(temp->unk_04, temp_f20, playerStatus2->runSpeed); +} + +void func_802E8C94(Entity* entity) { + Trigger* trigger = (Trigger*)entity->dataBuf; // TODO: is Trigger correct? + + if (--trigger->params1.w == -1) { + func_8010FD68(); + } +} void player_enter_blue_pipe(Entity* bluePipe) { PlayerStatus* playerStatus = &gPlayerStatus; - Trigger* pipeTrigger = bluePipe->trigger; + Trigger* pipeTrigger = (Trigger*)bluePipe->dataBuf; // TODO: is Trigger correct? playerStatus->targetYaw = CURRENT_CAM->currentYaw + 180.0f; pipeTrigger->params1.w = 0x19; @@ -41,7 +83,7 @@ void player_enter_blue_pipe(Entity* bluePipe) { void func_802E8D74(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; - Trigger* entityTrigger = entity->trigger; + Trigger* entityTrigger = (Trigger*)entity->dataBuf; // TODO: is Trigger correct? playerStatus->position.y--; entityTrigger->params1.w--; @@ -55,7 +97,7 @@ void func_802E8D74(Entity* entity) { } void func_802E8E10(Entity* entity) { - Bytecode* triggerScriptStart = entity->trigger->scriptStart; + Bytecode* triggerScriptStart = ((Trigger*)entity->dataBuf)->scriptStart; D_8009A650[0] &= ~0x40; entity->boundScript = triggerScriptStart; diff --git a/src/code_a5dd0_len_114e0.c b/src/code_a5dd0_len_114e0.c index 054ab704fe..f7ac97be36 100644 --- a/src/code_a5dd0_len_114e0.c +++ b/src/code_a5dd0_len_114e0.c @@ -100,7 +100,7 @@ INCLUDE_ASM(s32, "code_a5dd0_len_114e0", func_80111790); INCLUDE_ASM(s32, "code_a5dd0_len_114e0", func_801117DC); -INCLUDE_ASM(void, "code_a5dd0_len_114e0", create_entity, void* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5); +INCLUDE_ASM(s32, "code_a5dd0_len_114e0", create_entity, void* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5); INCLUDE_ASM(s32, "code_a5dd0_len_114e0", create_shadow_from_data); @@ -121,7 +121,7 @@ ApiStatus AssignFlag(ScriptInstance* script, s32 isInitialCall) { Trigger* trigger; if (isInitialCall == TRUE) { - trigger = get_entity_by_index(gLastCreatedEntityIndex)->trigger; + trigger = (Trigger*)get_entity_by_index(gLastCreatedEntityIndex)->dataBuf; trigger->flags.bytes.genericFlagIndex = get_variable_index(script, *args); return ApiStatus_DONE2; } diff --git a/src/os/code_4ac90_len_3910.c b/src/os/code_4ac90_len_3910.c index 0a8deb9f6d..645996b467 100644 --- a/src/os/code_4ac90_len_3910.c +++ b/src/os/code_4ac90_len_3910.c @@ -222,7 +222,7 @@ INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072170); INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_800721D0); -INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072230); +INCLUDE_ASM(void, "os/code_4ac90_len_3910", func_80072230, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5); INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80072290); diff --git a/src/world/area_kmr/kmr_03/8C7F90.c b/src/world/area_kmr/kmr_03/8C7F90.c index 2a88dc5cc8..1679a9f030 100644 --- a/src/world/area_kmr/kmr_03/8C7F90.c +++ b/src/world/area_kmr/kmr_03/8C7F90.c @@ -50,7 +50,7 @@ ApiStatus func_80240000_8C7F90(ScriptInstance* script, s32 isInitialCall) { #include "world/common/CheckPartnerFlags1000.inc.c" // 8C85E0 -EntryList M(entryList) = { +Vec4f M(entryList)[] = { { -340.0f, 0.0f, 348.0f, 48.0f }, { 480.0f, 0.0f, 0.0f, 270.0f }, { -310.0f, 20.0f, -80.0f, 135.0f }, diff --git a/src/world/area_kmr/kmr_12/header.c b/src/world/area_kmr/kmr_12/header.c index 5d9a96fdf0..0c224d1e3f 100644 --- a/src/world/area_kmr/kmr_12/header.c +++ b/src/world/area_kmr/kmr_12/header.c @@ -1,6 +1,6 @@ #include "kmr_12.h" -EntryList M(entryList) = { +Vec4f M(entryList)[] = { { -126.0f, 0.0f, 12.0f, 90.0f }, // west, towards Red/Blue Goomba miniboss room { 471.0f, 0.0f, 12.0f, 270.0f }, // east, towards Goomba King's Fortress }; diff --git a/undefined_syms.txt b/undefined_syms.txt index 415ad007bf..04c7fd809d 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -282,6 +282,18 @@ D_802EB008 = 0x802EB008; D_802EB3A0 = 0x802EB3A0; D_8015C7D0 = 0x8015C7D0; +D_802EB1D0 = 0x802EB1D0; +D_802EB1D8 = 0x802EB1D8; +D_802EB1E0 = 0x802EB1E0; +D_802EB1E8 = 0x802EB1E8; +D_802EB1F0 = 0x802EB1F0; +D_802EB1F8 = 0x802EB1F8; +D_802EB200 = 0x802EB200; +D_802EB208 = 0x802EB208; + +D_802E9E54 = 0x802E9E54; +D_802EA07C = 0x802EA07C; + D_0A0031E0 = 0x0A0031E0; D_0A001508 = 0x0A001508; D_0A0031B0 = 0x0A0031B0;